@owox/web 0.12.0-next-20251105085230 → 0.12.0-next-20251105123137
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.
- package/dist/assets/index-LdE_0Oij.js +730 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/index-CXvTCnxS.js +0 -730
|
@@ -1,730 +0,0 @@
|
|
|
1
|
-
var fk=Object.defineProperty;var hk=(e,t,n)=>t in e?fk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var js=(e,t,n)=>hk(e,typeof t!="symbol"?t+"":t,n);function mk(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const l=Object.getOwnPropertyDescriptor(r,s);l&&Object.defineProperty(e,s,l.get?l:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(s){if(s.ep)return;s.ep=!0;const l=n(s);fetch(s.href,l)}})();function Ej(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rx={exports:{}},Nd={};/**
|
|
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 x2;function pk(){if(x2)return Nd;x2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,l){var c=null;if(l!==void 0&&(c=""+l),s.key!==void 0&&(c=""+s.key),"key"in s){l={};for(var d in s)d!=="key"&&(l[d]=s[d])}else l=s;return s=l.ref,{$$typeof:e,type:r,key:c,ref:s!==void 0?s:null,props:l}}return Nd.Fragment=t,Nd.jsx=n,Nd.jsxs=n,Nd}var b2;function gk(){return b2||(b2=1,rx.exports=pk()),rx.exports}var o=gk(),ax={exports:{}},ut={};/**
|
|
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 S2;function vk(){if(S2)return ut;S2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,E={};function R(L,P,W){this.props=L,this.context=P,this.refs=E,this.updater=W||w}R.prototype.isReactComponent={},R.prototype.setState=function(L,P){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,P,"setState")},R.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function T(){}T.prototype=R.prototype;function _(L,P,W){this.props=L,this.context=P,this.refs=E,this.updater=W||w}var O=_.prototype=new T;O.constructor=_,C(O,R.prototype),O.isPureReactComponent=!0;var A=Array.isArray;function D(){}var j={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function z(L,P,W){var ee=W.ref;return{$$typeof:e,type:L,key:P,ref:ee!==void 0?ee:null,props:W}}function Z(L,P){return z(L.type,P,L.props)}function K(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function Y(L){var P={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(W){return P[W]})}var ae=/\/+/g;function F(L,P){return typeof L=="object"&&L!==null&&L.key!=null?Y(""+L.key):P.toString(36)}function V(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(D,D):(L.status="pending",L.then(function(P){L.status==="pending"&&(L.status="fulfilled",L.value=P)},function(P){L.status==="pending"&&(L.status="rejected",L.reason=P)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function I(L,P,W,ee,de){var ve=typeof L;(ve==="undefined"||ve==="boolean")&&(L=null);var le=!1;if(L===null)le=!0;else switch(ve){case"bigint":case"string":case"number":le=!0;break;case"object":switch(L.$$typeof){case e:case t:le=!0;break;case g:return le=L._init,I(le(L._payload),P,W,ee,de)}}if(le)return de=de(L),le=ee===""?"."+F(L,0):ee,A(de)?(W="",le!=null&&(W=le.replace(ae,"$&/")+"/"),I(de,P,W,"",function(Te){return Te})):de!=null&&(K(de)&&(de=Z(de,W+(de.key==null||L&&L.key===de.key?"":(""+de.key).replace(ae,"$&/")+"/")+le)),P.push(de)),1;le=0;var Ne=ee===""?".":ee+":";if(A(L))for(var we=0;we<L.length;we++)ee=L[we],ve=Ne+F(ee,we),le+=I(ee,P,W,ve,de);else if(we=b(L),typeof we=="function")for(L=we.call(L),we=0;!(ee=L.next()).done;)ee=ee.value,ve=Ne+F(ee,we++),le+=I(ee,P,W,ve,de);else if(ve==="object"){if(typeof L.then=="function")return I(V(L),P,W,ee,de);throw P=String(L),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return le}function B(L,P,W){if(L==null)return L;var ee=[],de=0;return I(L,ee,"","",function(ve){return P.call(W,ve,de++)}),ee}function G(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(W){(L._status===0||L._status===-1)&&(L._status=1,L._result=W)},function(W){(L._status===0||L._status===-1)&&(L._status=2,L._result=W)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var ie=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},xe={map:B,forEach:function(L,P,W){B(L,function(){P.apply(this,arguments)},W)},count:function(L){var P=0;return B(L,function(){P++}),P},toArray:function(L){return B(L,function(P){return P})||[]},only:function(L){if(!K(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return ut.Activity=v,ut.Children=xe,ut.Component=R,ut.Fragment=n,ut.Profiler=s,ut.PureComponent=_,ut.StrictMode=r,ut.Suspense=f,ut.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,ut.__COMPILER_RUNTIME={__proto__:null,c:function(L){return j.H.useMemoCache(L)}},ut.cache=function(L){return function(){return L.apply(null,arguments)}},ut.cacheSignal=function(){return null},ut.cloneElement=function(L,P,W){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ee=C({},L.props),de=L.key;if(P!=null)for(ve in P.key!==void 0&&(de=""+P.key),P)!M.call(P,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&P.ref===void 0||(ee[ve]=P[ve]);var ve=arguments.length-2;if(ve===1)ee.children=W;else if(1<ve){for(var le=Array(ve),Ne=0;Ne<ve;Ne++)le[Ne]=arguments[Ne+2];ee.children=le}return z(L.type,de,ee)},ut.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},ut.createElement=function(L,P,W){var ee,de={},ve=null;if(P!=null)for(ee in P.key!==void 0&&(ve=""+P.key),P)M.call(P,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(de[ee]=P[ee]);var le=arguments.length-2;if(le===1)de.children=W;else if(1<le){for(var Ne=Array(le),we=0;we<le;we++)Ne[we]=arguments[we+2];de.children=Ne}if(L&&L.defaultProps)for(ee in le=L.defaultProps,le)de[ee]===void 0&&(de[ee]=le[ee]);return z(L,ve,de)},ut.createRef=function(){return{current:null}},ut.forwardRef=function(L){return{$$typeof:d,render:L}},ut.isValidElement=K,ut.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:G}},ut.memo=function(L,P){return{$$typeof:m,type:L,compare:P===void 0?null:P}},ut.startTransition=function(L){var P=j.T,W={};j.T=W;try{var ee=L(),de=j.S;de!==null&&de(W,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(D,ie)}catch(ve){ie(ve)}finally{P!==null&&W.types!==null&&(P.types=W.types),j.T=P}},ut.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},ut.use=function(L){return j.H.use(L)},ut.useActionState=function(L,P,W){return j.H.useActionState(L,P,W)},ut.useCallback=function(L,P){return j.H.useCallback(L,P)},ut.useContext=function(L){return j.H.useContext(L)},ut.useDebugValue=function(){},ut.useDeferredValue=function(L,P){return j.H.useDeferredValue(L,P)},ut.useEffect=function(L,P){return j.H.useEffect(L,P)},ut.useEffectEvent=function(L){return j.H.useEffectEvent(L)},ut.useId=function(){return j.H.useId()},ut.useImperativeHandle=function(L,P,W){return j.H.useImperativeHandle(L,P,W)},ut.useInsertionEffect=function(L,P){return j.H.useInsertionEffect(L,P)},ut.useLayoutEffect=function(L,P){return j.H.useLayoutEffect(L,P)},ut.useMemo=function(L,P){return j.H.useMemo(L,P)},ut.useOptimistic=function(L,P){return j.H.useOptimistic(L,P)},ut.useReducer=function(L,P,W){return j.H.useReducer(L,P,W)},ut.useRef=function(L){return j.H.useRef(L)},ut.useState=function(L){return j.H.useState(L)},ut.useSyncExternalStore=function(L,P,W){return j.H.useSyncExternalStore(L,P,W)},ut.useTransition=function(){return j.H.useTransition()},ut.version="19.2.0",ut}var C2;function mb(){return C2||(C2=1,ax.exports=vk()),ax.exports}var p=mb();const _e=Ej(p),Rj=mk({__proto__:null,default:_e},[p]);var sx={exports:{}},Ad={},ox={exports:{}},ix={};/**
|
|
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 w2;function yk(){return w2||(w2=1,(function(e){function t(I,B){var G=I.length;I.push(B);e:for(;0<G;){var ie=G-1>>>1,xe=I[ie];if(0<s(xe,B))I[ie]=B,I[G]=xe,G=ie;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var B=I[0],G=I.pop();if(G!==B){I[0]=G;e:for(var ie=0,xe=I.length,L=xe>>>1;ie<L;){var P=2*(ie+1)-1,W=I[P],ee=P+1,de=I[ee];if(0>s(W,G))ee<xe&&0>s(de,W)?(I[ie]=de,I[ee]=G,ie=ee):(I[ie]=W,I[P]=G,ie=P);else if(ee<xe&&0>s(de,G))I[ie]=de,I[ee]=G,ie=ee;else break e}}return B}function s(I,B){var G=I.sortIndex-B.sortIndex;return G!==0?G:I.id-B.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],m=[],g=1,v=null,x=3,b=!1,w=!1,C=!1,E=!1,R=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function O(I){for(var B=n(m);B!==null;){if(B.callback===null)r(m);else if(B.startTime<=I)r(m),B.sortIndex=B.expirationTime,t(f,B);else break;B=n(m)}}function A(I){if(C=!1,O(I),!w)if(n(f)!==null)w=!0,D||(D=!0,Y());else{var B=n(m);B!==null&&V(A,B.startTime-I)}}var D=!1,j=-1,M=5,z=-1;function Z(){return E?!0:!(e.unstable_now()-z<M)}function K(){if(E=!1,D){var I=e.unstable_now();z=I;var B=!0;try{e:{w=!1,C&&(C=!1,T(j),j=-1),b=!0;var G=x;try{t:{for(O(I),v=n(f);v!==null&&!(v.expirationTime>I&&Z());){var ie=v.callback;if(typeof ie=="function"){v.callback=null,x=v.priorityLevel;var xe=ie(v.expirationTime<=I);if(I=e.unstable_now(),typeof xe=="function"){v.callback=xe,O(I),B=!0;break t}v===n(f)&&r(f),O(I)}else r(f);v=n(f)}if(v!==null)B=!0;else{var L=n(m);L!==null&&V(A,L.startTime-I),B=!1}}break e}finally{v=null,x=G,b=!1}B=void 0}}finally{B?Y():D=!1}}}var Y;if(typeof _=="function")Y=function(){_(K)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,F=ae.port2;ae.port1.onmessage=K,Y=function(){F.postMessage(null)}}else Y=function(){R(K,0)};function V(I,B){j=R(function(){I(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(I){switch(x){case 1:case 2:case 3:var B=3;break;default:B=x}var G=x;x=B;try{return I()}finally{x=G}},e.unstable_requestPaint=function(){E=!0},e.unstable_runWithPriority=function(I,B){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var G=x;x=I;try{return B()}finally{x=G}},e.unstable_scheduleCallback=function(I,B,G){var ie=e.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?ie+G:ie):G=ie,I){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=G+xe,I={id:g++,callback:B,priorityLevel:I,startTime:G,expirationTime:xe,sortIndex:-1},G>ie?(I.sortIndex=G,t(m,I),n(f)===null&&I===n(m)&&(C?(T(j),j=-1):C=!0,V(A,G-ie))):(I.sortIndex=xe,t(f,I),w||b||(w=!0,D||(D=!0,Y()))),I},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(I){var B=x;return function(){var G=x;x=B;try{return I.apply(this,arguments)}finally{x=G}}}})(ix)),ix}var E2;function xk(){return E2||(E2=1,ox.exports=yk()),ox.exports}var lx={exports:{}},Nr={};/**
|
|
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 R2;function bk(){if(R2)return Nr;R2=1;var e=mb();function t(f){var m="https://react.dev/errors/"+f;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function l(f,m,g){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:f,containerInfo:m,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,m){if(f==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Nr.createPortal=function(f,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return l(f,m,null,g)},Nr.flushSync=function(f){var m=c.T,g=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=m,r.p=g,r.d.f()}},Nr.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))},Nr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Nr.preinit=function(f,m){if(typeof f=="string"&&m&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin),x=typeof m.integrity=="string"?m.integrity:void 0,b=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?r.d.S(f,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:b}):g==="script"&&r.d.X(f,{crossOrigin:v,integrity:x,fetchPriority:b,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Nr.preinitModule=function(f,m){if(typeof f=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=d(m.as,m.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(f)},Nr.preload=function(f,m){if(typeof f=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,v=d(g,m.crossOrigin);r.d.L(f,g,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Nr.preloadModule=function(f,m){if(typeof f=="string")if(m){var g=d(m.as,m.crossOrigin);r.d.m(f,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(f)},Nr.requestFormReset=function(f){r.d.r(f)},Nr.unstable_batchedUpdates=function(f,m){return f(m)},Nr.useFormState=function(f,m,g){return c.H.useFormState(f,m,g)},Nr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Nr.version="19.2.0",Nr}var T2;function Tj(){if(T2)return lx.exports;T2=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(),lx.exports=bk(),lx.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 j2;function Sk(){if(j2)return Ad;j2=1;var e=xk(),t=mb(),n=Tj();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function l(a){var i=a,u=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(u=i.return),a=i.return;while(a)}return i.tag===3?u:null}function c(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function d(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function f(a){if(l(a)!==a)throw Error(r(188))}function m(a){var i=a.alternate;if(!i){if(i=l(a),i===null)throw Error(r(188));return i!==a?null:a}for(var u=a,h=i;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return f(y),a;if(S===h)return f(y),i;S=S.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=S;else{for(var N=!1,k=y.child;k;){if(k===u){N=!0,u=y,h=S;break}if(k===h){N=!0,h=y,u=S;break}k=k.sibling}if(!N){for(k=S.child;k;){if(k===u){N=!0,u=S,h=y;break}if(k===h){N=!0,h=S,u=y;break}k=k.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?a:i}function g(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=g(a),i!==null)return i;a=a.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),_=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function Y(a){return a===null||typeof a!="object"?null:(a=K&&a[K]||a["@@iterator"],typeof a=="function"?a:null)}var ae=Symbol.for("react.client.reference");function F(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ae?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case C:return"Fragment";case R:return"Profiler";case E:return"StrictMode";case A:return"Suspense";case D:return"SuspenseList";case z:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case _:return a.displayName||"Context";case T:return(a._context.displayName||"Context")+".Consumer";case O:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case j:return i=a.displayName||null,i!==null?i:F(a.type)||"Memo";case M:i=a._payload,a=a._init;try{return F(a(i))}catch{}}return null}var V=Array.isArray,I=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},ie=[],xe=-1;function L(a){return{current:a}}function P(a){0>xe||(a.current=ie[xe],ie[xe]=null,xe--)}function W(a,i){xe++,ie[xe]=a.current,a.current=i}var ee=L(null),de=L(null),ve=L(null),le=L(null);function Ne(a,i){switch(W(ve,i),W(de,a),W(ee,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?HE(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=HE(i),a=$E(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}P(ee),W(ee,a)}function we(){P(ee),P(de),P(ve)}function Te(a){a.memoizedState!==null&&W(le,a);var i=ee.current,u=$E(i,a.type);i!==u&&(W(de,a),W(ee,u))}function Be(a){de.current===a&&(P(ee),P(de)),le.current===a&&(P(le),Rd._currentValue=G)}var Xe,Vt;function jt(a){if(Xe===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Xe=i&&i[1]||"",Vt=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Xe+a+Vt}var $t=!1;function Me(a,i){if(!a||$t)return"";$t=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(i){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ue){var oe=ue}Reflect.construct(a,[],pe)}else{try{pe.call()}catch(ue){oe=ue}a.call(pe.prototype)}}else{try{throw Error()}catch(ue){oe=ue}(pe=a())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ue){if(ue&&oe&&typeof ue.stack=="string")return[ue.stack,oe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=h.DetermineComponentFrameRoot(),N=S[0],k=S[1];if(N&&k){var H=N.split(`
|
|
44
|
-
`),re=k.split(`
|
|
45
|
-
`);for(y=h=0;h<H.length&&!H[h].includes("DetermineComponentFrameRoot");)h++;for(;y<re.length&&!re[y].includes("DetermineComponentFrameRoot");)y++;if(h===H.length||y===re.length)for(h=H.length-1,y=re.length-1;1<=h&&0<=y&&H[h]!==re[y];)y--;for(;1<=h&&0<=y;h--,y--)if(H[h]!==re[y]){if(h!==1||y!==1)do if(h--,y--,0>y||H[h]!==re[y]){var he=`
|
|
46
|
-
`+H[h].replace(" at new "," at ");return a.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",a.displayName)),he}while(1<=h&&0<=y);break}}}finally{$t=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?jt(u):""}function _t(a,i){switch(a.tag){case 26:case 27:case 5:return jt(a.type);case 16:return jt("Lazy");case 13:return a.child!==i&&i!==null?jt("Suspense Fallback"):jt("Suspense");case 19:return jt("SuspenseList");case 0:case 15:return Me(a.type,!1);case 11:return Me(a.type.render,!1);case 1:return Me(a.type,!0);case 31:return jt("Activity");default:return""}}function Nt(a){try{var i="",u=null;do i+=_t(a,u),u=a,a=a.return;while(a);return i}catch(h){return`
|
|
47
|
-
Error generating stack: `+h.message+`
|
|
48
|
-
`+h.stack}}var rn=Object.prototype.hasOwnProperty,$=e.unstable_scheduleCallback,te=e.unstable_cancelCallback,fe=e.unstable_shouldYield,je=e.unstable_requestPaint,ye=e.unstable_now,Ce=e.unstable_getCurrentPriorityLevel,Ye=e.unstable_ImmediatePriority,st=e.unstable_UserBlockingPriority,ot=e.unstable_NormalPriority,vn=e.unstable_LowPriority,_a=e.unstable_IdlePriority,yn=e.log,Fo=e.unstable_setDisableYieldValue,Mn=null,Cn=null;function pr(a){if(typeof yn=="function"&&Fo(a),Cn&&typeof Cn.setStrictMode=="function")try{Cn.setStrictMode(Mn,a)}catch{}}var wn=Math.clz32?Math.clz32:zo,Qi=Math.log,bs=Math.LN2;function zo(a){return a>>>=0,a===0?32:31-(Qi(a)/bs|0)|0}var Zs=256,Ss=262144,xn=4194304;function mn(a){var i=a&42;if(i!==0)return i;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Fn(a,i,u){var h=a.pendingLanes;if(h===0)return 0;var y=0,S=a.suspendedLanes,N=a.pingedLanes;a=a.warmLanes;var k=h&134217727;return k!==0?(h=k&~S,h!==0?y=mn(h):(N&=k,N!==0?y=mn(N):u||(u=k&~a,u!==0&&(y=mn(u))))):(k=h&~S,k!==0?y=mn(k):N!==0?y=mn(N):u||(u=h&~a,u!==0&&(y=mn(u)))),y===0?0:i!==0&&i!==y&&(i&S)===0&&(S=y&-y,u=i&-i,S>=u||S===32&&(u&4194048)!==0)?i:y}function gr(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function Xn(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kn(){var a=xn;return xn<<=1,(xn&62914560)===0&&(xn=4194304),a}function _r(a){for(var i=[],u=0;31>u;u++)i.push(a);return i}function Hr(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function U(a,i,u,h,y,S){var N=a.pendingLanes;a.pendingLanes=u,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=u,a.entangledLanes&=u,a.errorRecoveryDisabledLanes&=u,a.shellSuspendCounter=0;var k=a.entanglements,H=a.expirationTimes,re=a.hiddenUpdates;for(u=N&~u;0<u;){var he=31-wn(u),pe=1<<he;k[he]=0,H[he]=-1;var oe=re[he];if(oe!==null)for(re[he]=null,he=0;he<oe.length;he++){var ue=oe[he];ue!==null&&(ue.lane&=-536870913)}u&=~pe}h!==0&&Q(a,h,0),S!==0&&y===0&&a.tag!==0&&(a.suspendedLanes|=S&~(N&~i))}function Q(a,i,u){a.pendingLanes|=i,a.suspendedLanes&=~i;var h=31-wn(i);a.entangledLanes|=i,a.entanglements[h]=a.entanglements[h]|1073741824|u&261930}function se(a,i){var u=a.entangledLanes|=i;for(a=a.entanglements;u;){var h=31-wn(u),y=1<<h;y&i|a[h]&i&&(a[h]|=i),u&=~y}}function ge(a,i){var u=i&-i;return u=(u&42)!==0?1:Ee(u),(u&(a.suspendedLanes|i))!==0?0:u}function Ee(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Fe(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Le(){var a=B.p;return a!==0?a:(a=window.event,a===void 0?32:f2(a.type))}function ke(a,i){var u=B.p;try{return B.p=a,i()}finally{B.p=u}}var Pe=Math.random().toString(36).slice(2),ze="__reactFiber$"+Pe,Ge="__reactProps$"+Pe,qe="__reactContainer$"+Pe,ct="__reactEvents$"+Pe,Yt="__reactListeners$"+Pe,zn="__reactHandles$"+Pe,lr="__reactResources$"+Pe,Bt="__reactMarker$"+Pe;function Gt(a){delete a[ze],delete a[Ge],delete a[ct],delete a[Yt],delete a[zn]}function $r(a){var i=a[ze];if(i)return i;for(var u=a.parentNode;u;){if(i=u[qe]||u[ze]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(a=WE(a);a!==null;){if(u=a[ze])return u;a=WE(a)}return i}a=u,u=a.parentNode}return null}function Na(a){if(a=a[ze]||a[qe]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function Br(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function vr(a){var i=a[lr];return i||(i=a[lr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function En(a){a[Bt]=!0}var Vo=new Set,Cs={};function Aa(a,i){Qa(a,i),Qa(a+"Capture",i)}function Qa(a,i){for(Cs[a]=i,a=0;a<i.length;a++)Vo.add(i[a])}var At=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]*$"),Jn={},Ks={};function Ys(a){return rn.call(Ks,a)?!0:rn.call(Jn,a)?!1:At.test(a)?Ks[a]=!0:(Jn[a]=!0,!1)}function pn(a,i,u){if(Ys(i))if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var h=i.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+u)}}function Ws(a,i,u){if(u===null)a.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+u)}}function Da(a,i,u,h){if(h===null)a.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(u);return}a.setAttributeNS(i,u,""+h)}}function Gr(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function kS(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function sM(a,i,u){var h=Object.getOwnPropertyDescriptor(a.constructor.prototype,i);if(!a.hasOwnProperty(i)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,S=h.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return y.call(this)},set:function(N){u=""+N,S.call(this,N)}}),Object.defineProperty(a,i,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function Wg(a){if(!a._valueTracker){var i=kS(a)?"checked":"value";a._valueTracker=sM(a,i,""+a[i])}}function IS(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var u=i.getValue(),h="";return a&&(h=kS(a)?a.checked?"true":"false":a.value),a=h,a!==u?(i.setValue(a),!0):!1}function ah(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var oM=/[\n"\\]/g;function Oa(a){return a.replace(oM,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Qg(a,i,u,h,y,S,N,k){a.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?a.type=N:a.removeAttribute("type"),i!=null?N==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+Gr(i)):a.value!==""+Gr(i)&&(a.value=""+Gr(i)):N!=="submit"&&N!=="reset"||a.removeAttribute("value"),i!=null?Xg(a,N,Gr(i)):u!=null?Xg(a,N,Gr(u)):h!=null&&a.removeAttribute("value"),y==null&&S!=null&&(a.defaultChecked=!!S),y!=null&&(a.checked=y&&typeof y!="function"&&typeof y!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.name=""+Gr(k):a.removeAttribute("name")}function LS(a,i,u,h,y,S,N,k){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(a.type=S),i!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||i!=null)){Wg(a);return}u=u!=null?""+Gr(u):"",i=i!=null?""+Gr(i):u,k||i===a.value||(a.value=i),a.defaultValue=i}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,a.checked=k?a.checked:!!h,a.defaultChecked=!!h,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.name=N),Wg(a)}function Xg(a,i,u){i==="number"&&ah(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function ec(a,i,u,h){if(a=a.options,i){i={};for(var y=0;y<u.length;y++)i["$"+u[y]]=!0;for(u=0;u<a.length;u++)y=i.hasOwnProperty("$"+a[u].value),a[u].selected!==y&&(a[u].selected=y),y&&h&&(a[u].defaultSelected=!0)}else{for(u=""+Gr(u),i=null,y=0;y<a.length;y++){if(a[y].value===u){a[y].selected=!0,h&&(a[y].defaultSelected=!0);return}i!==null||a[y].disabled||(i=a[y])}i!==null&&(i.selected=!0)}}function PS(a,i,u){if(i!=null&&(i=""+Gr(i),i!==a.value&&(a.value=i),u==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=u!=null?""+Gr(u):""}function US(a,i,u,h){if(i==null){if(h!=null){if(u!=null)throw Error(r(92));if(V(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),i=u}u=Gr(i),a.defaultValue=u,h=a.textContent,h===u&&h!==""&&h!==null&&(a.value=h),Wg(a)}function tc(a,i){if(i){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=i;return}}a.textContent=i}var iM=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 FS(a,i,u){var h=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":h?a.setProperty(i,u):typeof u!="number"||u===0||iM.has(i)?i==="float"?a.cssFloat=u:a[i]=(""+u).trim():a[i]=u+"px"}function zS(a,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||i!=null&&i.hasOwnProperty(h)||(h.indexOf("--")===0?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="");for(var y in i)h=i[y],i.hasOwnProperty(y)&&u[y]!==h&&FS(a,y,h)}else for(var S in i)i.hasOwnProperty(S)&&FS(a,S,i[S])}function Jg(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lM=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"]]),cM=/^[\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 sh(a){return cM.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Qs(){}var ev=null;function tv(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var nc=null,rc=null;function VS(a){var i=Na(a);if(i&&(a=i.stateNode)){var u=a[Ge]||null;e:switch(a=i.stateNode,i.type){case"input":if(Qg(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Oa(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var h=u[i];if(h!==a&&h.form===a.form){var y=h[Ge]||null;if(!y)throw Error(r(90));Qg(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(i=0;i<u.length;i++)h=u[i],h.form===a.form&&IS(h)}break e;case"textarea":PS(a,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&ec(a,!!u.multiple,i,!1)}}}var nv=!1;function HS(a,i,u){if(nv)return a(i,u);nv=!0;try{var h=a(i);return h}finally{if(nv=!1,(nc!==null||rc!==null)&&(qh(),nc&&(i=nc,a=rc,rc=nc=null,VS(i),a)))for(i=0;i<a.length;i++)VS(a[i])}}function Hu(a,i){var u=a.stateNode;if(u===null)return null;var h=u[Ge]||null;if(h===null)return null;u=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(a=a.type,h=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!h;break e;default:a=!1}if(a)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var Xs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rv=!1;if(Xs)try{var $u={};Object.defineProperty($u,"passive",{get:function(){rv=!0}}),window.addEventListener("test",$u,$u),window.removeEventListener("test",$u,$u)}catch{rv=!1}var Ho=null,av=null,oh=null;function $S(){if(oh)return oh;var a,i=av,u=i.length,h,y="value"in Ho?Ho.value:Ho.textContent,S=y.length;for(a=0;a<u&&i[a]===y[a];a++);var N=u-a;for(h=1;h<=N&&i[u-h]===y[S-h];h++);return oh=y.slice(a,1<h?1-h:void 0)}function ih(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function lh(){return!0}function BS(){return!1}function qr(a){function i(u,h,y,S,N){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=S,this.target=N,this.currentTarget=null;for(var k in a)a.hasOwnProperty(k)&&(u=a[k],this[k]=u?u(S):S[k]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?lh:BS,this.isPropagationStopped=BS,this}return v(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=lh)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=lh)},persist:function(){},isPersistent:lh}),i}var Xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ch=qr(Xi),Bu=v({},Xi,{view:0,detail:0}),uM=qr(Bu),sv,ov,Gu,uh=v({},Bu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lv,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==Gu&&(Gu&&a.type==="mousemove"?(sv=a.screenX-Gu.screenX,ov=a.screenY-Gu.screenY):ov=sv=0,Gu=a),sv)},movementY:function(a){return"movementY"in a?a.movementY:ov}}),GS=qr(uh),dM=v({},uh,{dataTransfer:0}),fM=qr(dM),hM=v({},Bu,{relatedTarget:0}),iv=qr(hM),mM=v({},Xi,{animationName:0,elapsedTime:0,pseudoElement:0}),pM=qr(mM),gM=v({},Xi,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),vM=qr(gM),yM=v({},Xi,{data:0}),qS=qr(yM),xM={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bM={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"},SM={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function CM(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=SM[a])?!!i[a]:!1}function lv(){return CM}var wM=v({},Bu,{key:function(a){if(a.key){var i=xM[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=ih(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?bM[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lv,charCode:function(a){return a.type==="keypress"?ih(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?ih(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),EM=qr(wM),RM=v({},uh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ZS=qr(RM),TM=v({},Bu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lv}),jM=qr(TM),_M=v({},Xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),NM=qr(_M),AM=v({},uh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),DM=qr(AM),OM=v({},Xi,{newState:0,oldState:0}),MM=qr(OM),kM=[9,13,27,32],cv=Xs&&"CompositionEvent"in window,qu=null;Xs&&"documentMode"in document&&(qu=document.documentMode);var IM=Xs&&"TextEvent"in window&&!qu,KS=Xs&&(!cv||qu&&8<qu&&11>=qu),YS=" ",WS=!1;function QS(a,i){switch(a){case"keyup":return kM.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function XS(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var ac=!1;function LM(a,i){switch(a){case"compositionend":return XS(i);case"keypress":return i.which!==32?null:(WS=!0,YS);case"textInput":return a=i.data,a===YS&&WS?null:a;default:return null}}function PM(a,i){if(ac)return a==="compositionend"||!cv&&QS(a,i)?(a=$S(),oh=av=Ho=null,ac=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return KS&&i.locale!=="ko"?null:i.data;default:return null}}var UM={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 JS(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!UM[a.type]:i==="textarea"}function eC(a,i,u,h){nc?rc?rc.push(h):rc=[h]:nc=h,i=Jh(i,"onChange"),0<i.length&&(u=new ch("onChange","change",null,u,h),a.push({event:u,listeners:i}))}var Zu=null,Ku=null;function FM(a){LE(a,0)}function dh(a){var i=Br(a);if(IS(i))return a}function tC(a,i){if(a==="change")return i}var nC=!1;if(Xs){var uv;if(Xs){var dv="oninput"in document;if(!dv){var rC=document.createElement("div");rC.setAttribute("oninput","return;"),dv=typeof rC.oninput=="function"}uv=dv}else uv=!1;nC=uv&&(!document.documentMode||9<document.documentMode)}function aC(){Zu&&(Zu.detachEvent("onpropertychange",sC),Ku=Zu=null)}function sC(a){if(a.propertyName==="value"&&dh(Ku)){var i=[];eC(i,Ku,a,tv(a)),HS(FM,i)}}function zM(a,i,u){a==="focusin"?(aC(),Zu=i,Ku=u,Zu.attachEvent("onpropertychange",sC)):a==="focusout"&&aC()}function VM(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return dh(Ku)}function HM(a,i){if(a==="click")return dh(i)}function $M(a,i){if(a==="input"||a==="change")return dh(i)}function BM(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var aa=typeof Object.is=="function"?Object.is:BM;function Yu(a,i){if(aa(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var u=Object.keys(a),h=Object.keys(i);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!rn.call(i,y)||!aa(a[y],i[y]))return!1}return!0}function oC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function iC(a,i){var u=oC(a);a=0;for(var h;u;){if(u.nodeType===3){if(h=a+u.textContent.length,a<=i&&h>=i)return{node:u,offset:i-a};a=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=oC(u)}}function lC(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?lC(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function cC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=ah(a.document);i instanceof a.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)a=i.contentWindow;else break;i=ah(a.document)}return i}function fv(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var GM=Xs&&"documentMode"in document&&11>=document.documentMode,sc=null,hv=null,Wu=null,mv=!1;function uC(a,i,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;mv||sc==null||sc!==ah(h)||(h=sc,"selectionStart"in h&&fv(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Wu&&Yu(Wu,h)||(Wu=h,h=Jh(hv,"onSelect"),0<h.length&&(i=new ch("onSelect","select",null,i,u),a.push({event:i,listeners:h}),i.target=sc)))}function Ji(a,i){var u={};return u[a.toLowerCase()]=i.toLowerCase(),u["Webkit"+a]="webkit"+i,u["Moz"+a]="moz"+i,u}var oc={animationend:Ji("Animation","AnimationEnd"),animationiteration:Ji("Animation","AnimationIteration"),animationstart:Ji("Animation","AnimationStart"),transitionrun:Ji("Transition","TransitionRun"),transitionstart:Ji("Transition","TransitionStart"),transitioncancel:Ji("Transition","TransitionCancel"),transitionend:Ji("Transition","TransitionEnd")},pv={},dC={};Xs&&(dC=document.createElement("div").style,"AnimationEvent"in window||(delete oc.animationend.animation,delete oc.animationiteration.animation,delete oc.animationstart.animation),"TransitionEvent"in window||delete oc.transitionend.transition);function el(a){if(pv[a])return pv[a];if(!oc[a])return a;var i=oc[a],u;for(u in i)if(i.hasOwnProperty(u)&&u in dC)return pv[a]=i[u];return a}var fC=el("animationend"),hC=el("animationiteration"),mC=el("animationstart"),qM=el("transitionrun"),ZM=el("transitionstart"),KM=el("transitioncancel"),pC=el("transitionend"),gC=new Map,gv="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(" ");gv.push("scrollEnd");function Xa(a,i){gC.set(a,i),Aa(i,[a])}var fh=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ma=[],ic=0,vv=0;function hh(){for(var a=ic,i=vv=ic=0;i<a;){var u=Ma[i];Ma[i++]=null;var h=Ma[i];Ma[i++]=null;var y=Ma[i];Ma[i++]=null;var S=Ma[i];if(Ma[i++]=null,h!==null&&y!==null){var N=h.pending;N===null?y.next=y:(y.next=N.next,N.next=y),h.pending=y}S!==0&&vC(u,y,S)}}function mh(a,i,u,h){Ma[ic++]=a,Ma[ic++]=i,Ma[ic++]=u,Ma[ic++]=h,vv|=h,a.lanes|=h,a=a.alternate,a!==null&&(a.lanes|=h)}function yv(a,i,u,h){return mh(a,i,u,h),ph(a)}function tl(a,i){return mh(a,null,null,i),ph(a)}function vC(a,i,u){a.lanes|=u;var h=a.alternate;h!==null&&(h.lanes|=u);for(var y=!1,S=a.return;S!==null;)S.childLanes|=u,h=S.alternate,h!==null&&(h.childLanes|=u),S.tag===22&&(a=S.stateNode,a===null||a._visibility&1||(y=!0)),a=S,S=S.return;return a.tag===3?(S=a.stateNode,y&&i!==null&&(y=31-wn(u),a=S.hiddenUpdates,h=a[y],h===null?a[y]=[i]:h.push(i),i.lane=u|536870912),S):null}function ph(a){if(50<yd)throw yd=0,jy=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var lc={};function YM(a,i,u,h){this.tag=a,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sa(a,i,u,h){return new YM(a,i,u,h)}function xv(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Js(a,i){var u=a.alternate;return u===null?(u=sa(a.tag,i,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=i,u.type=a.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=a.flags&65011712,u.childLanes=a.childLanes,u.lanes=a.lanes,u.child=a.child,u.memoizedProps=a.memoizedProps,u.memoizedState=a.memoizedState,u.updateQueue=a.updateQueue,i=a.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function yC(a,i){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,i=u.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function gh(a,i,u,h,y,S){var N=0;if(h=a,typeof a=="function")xv(a)&&(N=1);else if(typeof a=="string")N=ek(a,u,ee.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case z:return a=sa(31,u,i,y),a.elementType=z,a.lanes=S,a;case C:return nl(u.children,y,S,i);case E:N=8,y|=24;break;case R:return a=sa(12,u,i,y|2),a.elementType=R,a.lanes=S,a;case A:return a=sa(13,u,i,y),a.elementType=A,a.lanes=S,a;case D:return a=sa(19,u,i,y),a.elementType=D,a.lanes=S,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case _:N=10;break e;case T:N=9;break e;case O:N=11;break e;case j:N=14;break e;case M:N=16,h=null;break e}N=29,u=Error(r(130,a===null?"null":typeof a,"")),h=null}return i=sa(N,u,i,y),i.elementType=a,i.type=h,i.lanes=S,i}function nl(a,i,u,h){return a=sa(7,a,h,i),a.lanes=u,a}function bv(a,i,u){return a=sa(6,a,null,i),a.lanes=u,a}function xC(a){var i=sa(18,null,null,0);return i.stateNode=a,i}function Sv(a,i,u){return i=sa(4,a.children!==null?a.children:[],a.key,i),i.lanes=u,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var bC=new WeakMap;function ka(a,i){if(typeof a=="object"&&a!==null){var u=bC.get(a);return u!==void 0?u:(i={value:a,source:i,stack:Nt(i)},bC.set(a,i),i)}return{value:a,source:i,stack:Nt(i)}}var cc=[],uc=0,vh=null,Qu=0,Ia=[],La=0,$o=null,ws=1,Es="";function eo(a,i){cc[uc++]=Qu,cc[uc++]=vh,vh=a,Qu=i}function SC(a,i,u){Ia[La++]=ws,Ia[La++]=Es,Ia[La++]=$o,$o=a;var h=ws;a=Es;var y=32-wn(h)-1;h&=~(1<<y),u+=1;var S=32-wn(i)+y;if(30<S){var N=y-y%5;S=(h&(1<<N)-1).toString(32),h>>=N,y-=N,ws=1<<32-wn(i)+y|u<<y|h,Es=S+a}else ws=1<<S|u<<y|h,Es=a}function Cv(a){a.return!==null&&(eo(a,1),SC(a,1,0))}function wv(a){for(;a===vh;)vh=cc[--uc],cc[uc]=null,Qu=cc[--uc],cc[uc]=null;for(;a===$o;)$o=Ia[--La],Ia[La]=null,Es=Ia[--La],Ia[La]=null,ws=Ia[--La],Ia[La]=null}function CC(a,i){Ia[La++]=ws,Ia[La++]=Es,Ia[La++]=$o,ws=i.id,Es=i.overflow,$o=a}var yr=null,fn=null,Dt=!1,Bo=null,Pa=!1,Ev=Error(r(519));function Go(a){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xu(ka(i,a)),Ev}function wC(a){var i=a.stateNode,u=a.type,h=a.memoizedProps;switch(i[ze]=a,i[Ge]=h,u){case"dialog":bt("cancel",i),bt("close",i);break;case"iframe":case"object":case"embed":bt("load",i);break;case"video":case"audio":for(u=0;u<bd.length;u++)bt(bd[u],i);break;case"source":bt("error",i);break;case"img":case"image":case"link":bt("error",i),bt("load",i);break;case"details":bt("toggle",i);break;case"input":bt("invalid",i),LS(i,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":bt("invalid",i);break;case"textarea":bt("invalid",i),US(i,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||h.suppressHydrationWarning===!0||zE(i.textContent,u)?(h.popover!=null&&(bt("beforetoggle",i),bt("toggle",i)),h.onScroll!=null&&bt("scroll",i),h.onScrollEnd!=null&&bt("scrollend",i),h.onClick!=null&&(i.onclick=Qs),i=!0):i=!1,i||Go(a,!0)}function EC(a){for(yr=a.return;yr;)switch(yr.tag){case 5:case 31:case 13:Pa=!1;return;case 27:case 3:Pa=!0;return;default:yr=yr.return}}function dc(a){if(a!==yr)return!1;if(!Dt)return EC(a),Dt=!0,!1;var i=a.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Hy(a.type,a.memoizedProps)),u=!u),u&&fn&&Go(a),EC(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));fn=YE(a)}else if(i===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));fn=YE(a)}else i===27?(i=fn,si(a.type)?(a=Zy,Zy=null,fn=a):fn=i):fn=yr?Fa(a.stateNode.nextSibling):null;return!0}function rl(){fn=yr=null,Dt=!1}function Rv(){var a=Bo;return a!==null&&(Wr===null?Wr=a:Wr.push.apply(Wr,a),Bo=null),a}function Xu(a){Bo===null?Bo=[a]:Bo.push(a)}var Tv=L(null),al=null,to=null;function qo(a,i,u){W(Tv,i._currentValue),i._currentValue=u}function no(a){a._currentValue=Tv.current,P(Tv)}function jv(a,i,u){for(;a!==null;){var h=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),a===u)break;a=a.return}}function _v(a,i,u,h){var y=a.child;for(y!==null&&(y.return=a);y!==null;){var S=y.dependencies;if(S!==null){var N=y.child;S=S.firstContext;e:for(;S!==null;){var k=S;S=y;for(var H=0;H<i.length;H++)if(k.context===i[H]){S.lanes|=u,k=S.alternate,k!==null&&(k.lanes|=u),jv(S.return,u,a),h||(N=null);break e}S=k.next}}else if(y.tag===18){if(N=y.return,N===null)throw Error(r(341));N.lanes|=u,S=N.alternate,S!==null&&(S.lanes|=u),jv(N,u,a),N=null}else N=y.child;if(N!==null)N.return=y;else for(N=y;N!==null;){if(N===a){N=null;break}if(y=N.sibling,y!==null){y.return=N.return,N=y;break}N=N.return}y=N}}function fc(a,i,u,h){a=null;for(var y=i,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var N=y.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var k=y.type;aa(y.pendingProps.value,N.value)||(a!==null?a.push(k):a=[k])}}else if(y===le.current){if(N=y.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(a!==null?a.push(Rd):a=[Rd])}y=y.return}a!==null&&_v(i,a,u,h),i.flags|=262144}function yh(a){for(a=a.firstContext;a!==null;){if(!aa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function sl(a){al=a,to=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function xr(a){return RC(al,a)}function xh(a,i){return al===null&&sl(a),RC(a,i)}function RC(a,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},to===null){if(a===null)throw Error(r(308));to=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else to=to.next=i;return u}var WM=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(u,h){a.push(h)}};this.abort=function(){i.aborted=!0,a.forEach(function(u){return u()})}},QM=e.unstable_scheduleCallback,XM=e.unstable_NormalPriority,Vn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nv(){return{controller:new WM,data:new Map,refCount:0}}function Ju(a){a.refCount--,a.refCount===0&&QM(XM,function(){a.controller.abort()})}var ed=null,Av=0,hc=0,mc=null;function JM(a,i){if(ed===null){var u=ed=[];Av=0,hc=My(),mc={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Av++,i.then(TC,TC),i}function TC(){if(--Av===0&&ed!==null){mc!==null&&(mc.status="fulfilled");var a=ed;ed=null,hc=0,mc=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function e6(a,i){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return a.then(function(){h.status="fulfilled",h.value=i;for(var y=0;y<u.length;y++)(0,u[y])(i)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var jC=I.S;I.S=function(a,i){uE=ye(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&JM(a,i),jC!==null&&jC(a,i)};var ol=L(null);function Dv(){var a=ol.current;return a!==null?a:an.pooledCache}function bh(a,i){i===null?W(ol,ol.current):W(ol,i.pool)}function _C(){var a=Dv();return a===null?null:{parent:Vn._currentValue,pool:a}}var pc=Error(r(460)),Ov=Error(r(474)),Sh=Error(r(542)),Ch={then:function(){}};function NC(a){return a=a.status,a==="fulfilled"||a==="rejected"}function AC(a,i,u){switch(u=a[u],u===void 0?a.push(i):u!==i&&(i.then(Qs,Qs),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,OC(a),a;default:if(typeof i.status=="string")i.then(Qs,Qs);else{if(a=an,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(h){if(i.status==="pending"){var y=i;y.status="fulfilled",y.value=h}},function(h){if(i.status==="pending"){var y=i;y.status="rejected",y.reason=h}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,OC(a),a}throw ll=i,pc}}function il(a){try{var i=a._init;return i(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(ll=u,pc):u}}var ll=null;function DC(){if(ll===null)throw Error(r(459));var a=ll;return ll=null,a}function OC(a){if(a===pc||a===Sh)throw Error(r(483))}var gc=null,td=0;function wh(a){var i=td;return td+=1,gc===null&&(gc=[]),AC(gc,a,i)}function nd(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function Eh(a,i){throw i.$$typeof===x?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function MC(a){function i(X,q){if(a){var ne=X.deletions;ne===null?(X.deletions=[q],X.flags|=16):ne.push(q)}}function u(X,q){if(!a)return null;for(;q!==null;)i(X,q),q=q.sibling;return null}function h(X){for(var q=new Map;X!==null;)X.key!==null?q.set(X.key,X):q.set(X.index,X),X=X.sibling;return q}function y(X,q){return X=Js(X,q),X.index=0,X.sibling=null,X}function S(X,q,ne){return X.index=ne,a?(ne=X.alternate,ne!==null?(ne=ne.index,ne<q?(X.flags|=67108866,q):ne):(X.flags|=67108866,q)):(X.flags|=1048576,q)}function N(X){return a&&X.alternate===null&&(X.flags|=67108866),X}function k(X,q,ne,me){return q===null||q.tag!==6?(q=bv(ne,X.mode,me),q.return=X,q):(q=y(q,ne),q.return=X,q)}function H(X,q,ne,me){var et=ne.type;return et===C?he(X,q,ne.props.children,me,ne.key):q!==null&&(q.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===M&&il(et)===q.type)?(q=y(q,ne.props),nd(q,ne),q.return=X,q):(q=gh(ne.type,ne.key,ne.props,null,X.mode,me),nd(q,ne),q.return=X,q)}function re(X,q,ne,me){return q===null||q.tag!==4||q.stateNode.containerInfo!==ne.containerInfo||q.stateNode.implementation!==ne.implementation?(q=Sv(ne,X.mode,me),q.return=X,q):(q=y(q,ne.children||[]),q.return=X,q)}function he(X,q,ne,me,et){return q===null||q.tag!==7?(q=nl(ne,X.mode,me,et),q.return=X,q):(q=y(q,ne),q.return=X,q)}function pe(X,q,ne){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=bv(""+q,X.mode,ne),q.return=X,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case b:return ne=gh(q.type,q.key,q.props,null,X.mode,ne),nd(ne,q),ne.return=X,ne;case w:return q=Sv(q,X.mode,ne),q.return=X,q;case M:return q=il(q),pe(X,q,ne)}if(V(q)||Y(q))return q=nl(q,X.mode,ne,null),q.return=X,q;if(typeof q.then=="function")return pe(X,wh(q),ne);if(q.$$typeof===_)return pe(X,xh(X,q),ne);Eh(X,q)}return null}function oe(X,q,ne,me){var et=q!==null?q.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return et!==null?null:k(X,q,""+ne,me);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:return ne.key===et?H(X,q,ne,me):null;case w:return ne.key===et?re(X,q,ne,me):null;case M:return ne=il(ne),oe(X,q,ne,me)}if(V(ne)||Y(ne))return et!==null?null:he(X,q,ne,me,null);if(typeof ne.then=="function")return oe(X,q,wh(ne),me);if(ne.$$typeof===_)return oe(X,q,xh(X,ne),me);Eh(X,ne)}return null}function ue(X,q,ne,me,et){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return X=X.get(ne)||null,k(q,X,""+me,et);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return X=X.get(me.key===null?ne:me.key)||null,H(q,X,me,et);case w:return X=X.get(me.key===null?ne:me.key)||null,re(q,X,me,et);case M:return me=il(me),ue(X,q,ne,me,et)}if(V(me)||Y(me))return X=X.get(ne)||null,he(q,X,me,et,null);if(typeof me.then=="function")return ue(X,q,ne,wh(me),et);if(me.$$typeof===_)return ue(X,q,ne,xh(q,me),et);Eh(q,me)}return null}function $e(X,q,ne,me){for(var et=null,Pt=null,Qe=q,ht=q=0,Rt=null;Qe!==null&&ht<ne.length;ht++){Qe.index>ht?(Rt=Qe,Qe=null):Rt=Qe.sibling;var Ut=oe(X,Qe,ne[ht],me);if(Ut===null){Qe===null&&(Qe=Rt);break}a&&Qe&&Ut.alternate===null&&i(X,Qe),q=S(Ut,q,ht),Pt===null?et=Ut:Pt.sibling=Ut,Pt=Ut,Qe=Rt}if(ht===ne.length)return u(X,Qe),Dt&&eo(X,ht),et;if(Qe===null){for(;ht<ne.length;ht++)Qe=pe(X,ne[ht],me),Qe!==null&&(q=S(Qe,q,ht),Pt===null?et=Qe:Pt.sibling=Qe,Pt=Qe);return Dt&&eo(X,ht),et}for(Qe=h(Qe);ht<ne.length;ht++)Rt=ue(Qe,X,ht,ne[ht],me),Rt!==null&&(a&&Rt.alternate!==null&&Qe.delete(Rt.key===null?ht:Rt.key),q=S(Rt,q,ht),Pt===null?et=Rt:Pt.sibling=Rt,Pt=Rt);return a&&Qe.forEach(function(ui){return i(X,ui)}),Dt&&eo(X,ht),et}function tt(X,q,ne,me){if(ne==null)throw Error(r(151));for(var et=null,Pt=null,Qe=q,ht=q=0,Rt=null,Ut=ne.next();Qe!==null&&!Ut.done;ht++,Ut=ne.next()){Qe.index>ht?(Rt=Qe,Qe=null):Rt=Qe.sibling;var ui=oe(X,Qe,Ut.value,me);if(ui===null){Qe===null&&(Qe=Rt);break}a&&Qe&&ui.alternate===null&&i(X,Qe),q=S(ui,q,ht),Pt===null?et=ui:Pt.sibling=ui,Pt=ui,Qe=Rt}if(Ut.done)return u(X,Qe),Dt&&eo(X,ht),et;if(Qe===null){for(;!Ut.done;ht++,Ut=ne.next())Ut=pe(X,Ut.value,me),Ut!==null&&(q=S(Ut,q,ht),Pt===null?et=Ut:Pt.sibling=Ut,Pt=Ut);return Dt&&eo(X,ht),et}for(Qe=h(Qe);!Ut.done;ht++,Ut=ne.next())Ut=ue(Qe,X,ht,Ut.value,me),Ut!==null&&(a&&Ut.alternate!==null&&Qe.delete(Ut.key===null?ht:Ut.key),q=S(Ut,q,ht),Pt===null?et=Ut:Pt.sibling=Ut,Pt=Ut);return a&&Qe.forEach(function(dk){return i(X,dk)}),Dt&&eo(X,ht),et}function Xt(X,q,ne,me){if(typeof ne=="object"&&ne!==null&&ne.type===C&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case b:e:{for(var et=ne.key;q!==null;){if(q.key===et){if(et=ne.type,et===C){if(q.tag===7){u(X,q.sibling),me=y(q,ne.props.children),me.return=X,X=me;break e}}else if(q.elementType===et||typeof et=="object"&&et!==null&&et.$$typeof===M&&il(et)===q.type){u(X,q.sibling),me=y(q,ne.props),nd(me,ne),me.return=X,X=me;break e}u(X,q);break}else i(X,q);q=q.sibling}ne.type===C?(me=nl(ne.props.children,X.mode,me,ne.key),me.return=X,X=me):(me=gh(ne.type,ne.key,ne.props,null,X.mode,me),nd(me,ne),me.return=X,X=me)}return N(X);case w:e:{for(et=ne.key;q!==null;){if(q.key===et)if(q.tag===4&&q.stateNode.containerInfo===ne.containerInfo&&q.stateNode.implementation===ne.implementation){u(X,q.sibling),me=y(q,ne.children||[]),me.return=X,X=me;break e}else{u(X,q);break}else i(X,q);q=q.sibling}me=Sv(ne,X.mode,me),me.return=X,X=me}return N(X);case M:return ne=il(ne),Xt(X,q,ne,me)}if(V(ne))return $e(X,q,ne,me);if(Y(ne)){if(et=Y(ne),typeof et!="function")throw Error(r(150));return ne=et.call(ne),tt(X,q,ne,me)}if(typeof ne.then=="function")return Xt(X,q,wh(ne),me);if(ne.$$typeof===_)return Xt(X,q,xh(X,ne),me);Eh(X,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,q!==null&&q.tag===6?(u(X,q.sibling),me=y(q,ne),me.return=X,X=me):(u(X,q),me=bv(ne,X.mode,me),me.return=X,X=me),N(X)):u(X,q)}return function(X,q,ne,me){try{td=0;var et=Xt(X,q,ne,me);return gc=null,et}catch(Qe){if(Qe===pc||Qe===Sh)throw Qe;var Pt=sa(29,Qe,null,X.mode);return Pt.lanes=me,Pt.return=X,Pt}finally{}}}var cl=MC(!0),kC=MC(!1),Zo=!1;function Mv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kv(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ko(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Yo(a,i,u){var h=a.updateQueue;if(h===null)return null;if(h=h.shared,(Ft&2)!==0){var y=h.pending;return y===null?i.next=i:(i.next=y.next,y.next=i),h.pending=i,i=ph(a),vC(a,null,u),i}return mh(a,h,i,u),ph(a)}function rd(a,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var h=i.lanes;h&=a.pendingLanes,u|=h,i.lanes=u,se(a,u)}}function Iv(a,i){var u=a.updateQueue,h=a.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=N:S=S.next=N,u=u.next}while(u!==null);S===null?y=S=i:S=S.next=i}else y=S=i;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:h.shared,callbacks:h.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=i:a.next=i,u.lastBaseUpdate=i}var Lv=!1;function ad(){if(Lv){var a=mc;if(a!==null)throw a}}function sd(a,i,u,h){Lv=!1;var y=a.updateQueue;Zo=!1;var S=y.firstBaseUpdate,N=y.lastBaseUpdate,k=y.shared.pending;if(k!==null){y.shared.pending=null;var H=k,re=H.next;H.next=null,N===null?S=re:N.next=re,N=H;var he=a.alternate;he!==null&&(he=he.updateQueue,k=he.lastBaseUpdate,k!==N&&(k===null?he.firstBaseUpdate=re:k.next=re,he.lastBaseUpdate=H))}if(S!==null){var pe=y.baseState;N=0,he=re=H=null,k=S;do{var oe=k.lane&-536870913,ue=oe!==k.lane;if(ue?(Et&oe)===oe:(h&oe)===oe){oe!==0&&oe===hc&&(Lv=!0),he!==null&&(he=he.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var $e=a,tt=k;oe=i;var Xt=u;switch(tt.tag){case 1:if($e=tt.payload,typeof $e=="function"){pe=$e.call(Xt,pe,oe);break e}pe=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=tt.payload,oe=typeof $e=="function"?$e.call(Xt,pe,oe):$e,oe==null)break e;pe=v({},pe,oe);break e;case 2:Zo=!0}}oe=k.callback,oe!==null&&(a.flags|=64,ue&&(a.flags|=8192),ue=y.callbacks,ue===null?y.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:k.tag,payload:k.payload,callback:k.callback,next:null},he===null?(re=he=ue,H=pe):he=he.next=ue,N|=oe;if(k=k.next,k===null){if(k=y.shared.pending,k===null)break;ue=k,k=ue.next,ue.next=null,y.lastBaseUpdate=ue,y.shared.pending=null}}while(!0);he===null&&(H=pe),y.baseState=H,y.firstBaseUpdate=re,y.lastBaseUpdate=he,S===null&&(y.shared.lanes=0),ei|=N,a.lanes=N,a.memoizedState=pe}}function IC(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function LC(a,i){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)IC(u[a],i)}var vc=L(null),Rh=L(0);function PC(a,i){a=fo,W(Rh,a),W(vc,i),fo=a|i.baseLanes}function Pv(){W(Rh,fo),W(vc,vc.current)}function Uv(){fo=Rh.current,P(vc),P(Rh)}var oa=L(null),Ua=null;function Wo(a){var i=a.alternate;W(In,In.current&1),W(oa,a),Ua===null&&(i===null||vc.current!==null||i.memoizedState!==null)&&(Ua=a)}function Fv(a){W(In,In.current),W(oa,a),Ua===null&&(Ua=a)}function UC(a){a.tag===22?(W(In,In.current),W(oa,a),Ua===null&&(Ua=a)):Qo()}function Qo(){W(In,In.current),W(oa,oa.current)}function ia(a){P(oa),Ua===a&&(Ua=null),P(In)}var In=L(0);function Th(a){for(var i=a;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Gy(u)||qy(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ro=0,dt=null,Wt=null,Hn=null,jh=!1,yc=!1,ul=!1,_h=0,od=0,xc=null,t6=0;function Rn(){throw Error(r(321))}function zv(a,i){if(i===null)return!1;for(var u=0;u<i.length&&u<a.length;u++)if(!aa(a[u],i[u]))return!1;return!0}function Vv(a,i,u,h,y,S){return ro=S,dt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,I.H=a===null||a.memoizedState===null?Sw:ny,ul=!1,S=u(h,y),ul=!1,yc&&(S=zC(i,u,h,y)),FC(a),S}function FC(a){I.H=cd;var i=Wt!==null&&Wt.next!==null;if(ro=0,Hn=Wt=dt=null,jh=!1,od=0,xc=null,i)throw Error(r(300));a===null||$n||(a=a.dependencies,a!==null&&yh(a)&&($n=!0))}function zC(a,i,u,h){dt=a;var y=0;do{if(yc&&(xc=null),od=0,yc=!1,25<=y)throw Error(r(301));if(y+=1,Hn=Wt=null,a.updateQueue!=null){var S=a.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}I.H=Cw,S=i(u,h)}while(yc);return S}function n6(){var a=I.H,i=a.useState()[0];return i=typeof i.then=="function"?id(i):i,a=a.useState()[0],(Wt!==null?Wt.memoizedState:null)!==a&&(dt.flags|=1024),i}function Hv(){var a=_h!==0;return _h=0,a}function $v(a,i,u){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~u}function Bv(a){if(jh){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}jh=!1}ro=0,Hn=Wt=dt=null,yc=!1,od=_h=0,xc=null}function Lr(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?dt.memoizedState=Hn=a:Hn=Hn.next=a,Hn}function Ln(){if(Wt===null){var a=dt.alternate;a=a!==null?a.memoizedState:null}else a=Wt.next;var i=Hn===null?dt.memoizedState:Hn.next;if(i!==null)Hn=i,Wt=a;else{if(a===null)throw dt.alternate===null?Error(r(467)):Error(r(310));Wt=a,a={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},Hn===null?dt.memoizedState=Hn=a:Hn=Hn.next=a}return Hn}function Nh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function id(a){var i=od;return od+=1,xc===null&&(xc=[]),a=AC(xc,a,i),i=dt,(Hn===null?i.memoizedState:Hn.next)===null&&(i=i.alternate,I.H=i===null||i.memoizedState===null?Sw:ny),a}function Ah(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return id(a);if(a.$$typeof===_)return xr(a)}throw Error(r(438,String(a)))}function Gv(a){var i=null,u=dt.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var h=dt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(i={data:h.data.map(function(y){return y.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Nh(),dt.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(a),h=0;h<a;h++)u[h]=Z;return i.index++,u}function ao(a,i){return typeof i=="function"?i(a):i}function Dh(a){var i=Ln();return qv(i,Wt,a)}function qv(a,i,u){var h=a.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=a.baseQueue,S=h.pending;if(S!==null){if(y!==null){var N=y.next;y.next=S.next,S.next=N}i.baseQueue=y=S,h.pending=null}if(S=a.baseState,y===null)a.memoizedState=S;else{i=y.next;var k=N=null,H=null,re=i,he=!1;do{var pe=re.lane&-536870913;if(pe!==re.lane?(Et&pe)===pe:(ro&pe)===pe){var oe=re.revertLane;if(oe===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),pe===hc&&(he=!0);else if((ro&oe)===oe){re=re.next,oe===hc&&(he=!0);continue}else pe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},H===null?(k=H=pe,N=S):H=H.next=pe,dt.lanes|=oe,ei|=oe;pe=re.action,ul&&u(S,pe),S=re.hasEagerState?re.eagerState:u(S,pe)}else oe={lane:pe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},H===null?(k=H=oe,N=S):H=H.next=oe,dt.lanes|=pe,ei|=pe;re=re.next}while(re!==null&&re!==i);if(H===null?N=S:H.next=k,!aa(S,a.memoizedState)&&($n=!0,he&&(u=mc,u!==null)))throw u;a.memoizedState=S,a.baseState=N,a.baseQueue=H,h.lastRenderedState=S}return y===null&&(h.lanes=0),[a.memoizedState,h.dispatch]}function Zv(a){var i=Ln(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var h=u.dispatch,y=u.pending,S=i.memoizedState;if(y!==null){u.pending=null;var N=y=y.next;do S=a(S,N.action),N=N.next;while(N!==y);aa(S,i.memoizedState)||($n=!0),i.memoizedState=S,i.baseQueue===null&&(i.baseState=S),u.lastRenderedState=S}return[S,h]}function VC(a,i,u){var h=dt,y=Ln(),S=Dt;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=i();var N=!aa((Wt||y).memoizedState,u);if(N&&(y.memoizedState=u,$n=!0),y=y.queue,Wv(BC.bind(null,h,y,a),[a]),y.getSnapshot!==i||N||Hn!==null&&Hn.memoizedState.tag&1){if(h.flags|=2048,bc(9,{destroy:void 0},$C.bind(null,h,y,u,i),null),an===null)throw Error(r(349));S||(ro&127)!==0||HC(h,i,u)}return u}function HC(a,i,u){a.flags|=16384,a={getSnapshot:i,value:u},i=dt.updateQueue,i===null?(i=Nh(),dt.updateQueue=i,i.stores=[a]):(u=i.stores,u===null?i.stores=[a]:u.push(a))}function $C(a,i,u,h){i.value=u,i.getSnapshot=h,GC(i)&&qC(a)}function BC(a,i,u){return u(function(){GC(i)&&qC(a)})}function GC(a){var i=a.getSnapshot;a=a.value;try{var u=i();return!aa(a,u)}catch{return!0}}function qC(a){var i=tl(a,2);i!==null&&Qr(i,a,2)}function Kv(a){var i=Lr();if(typeof a=="function"){var u=a;if(a=u(),ul){pr(!0);try{u()}finally{pr(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:a},i}function ZC(a,i,u,h){return a.baseState=u,qv(a,Wt,typeof h=="function"?h:ao)}function r6(a,i,u,h,y){if(kh(a))throw Error(r(485));if(a=i.action,a!==null){var S={payload:y,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){S.listeners.push(N)}};I.T!==null?u(!0):S.isTransition=!1,h(S),u=i.pending,u===null?(S.next=i.pending=S,KC(i,S)):(S.next=u.next,i.pending=u.next=S)}}function KC(a,i){var u=i.action,h=i.payload,y=a.state;if(i.isTransition){var S=I.T,N={};I.T=N;try{var k=u(y,h),H=I.S;H!==null&&H(N,k),YC(a,i,k)}catch(re){Yv(a,i,re)}finally{S!==null&&N.types!==null&&(S.types=N.types),I.T=S}}else try{S=u(y,h),YC(a,i,S)}catch(re){Yv(a,i,re)}}function YC(a,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){WC(a,i,h)},function(h){return Yv(a,i,h)}):WC(a,i,u)}function WC(a,i,u){i.status="fulfilled",i.value=u,QC(i),a.state=u,i=a.pending,i!==null&&(u=i.next,u===i?a.pending=null:(u=u.next,i.next=u,KC(a,u)))}function Yv(a,i,u){var h=a.pending;if(a.pending=null,h!==null){h=h.next;do i.status="rejected",i.reason=u,QC(i),i=i.next;while(i!==h)}a.action=null}function QC(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function XC(a,i){return i}function JC(a,i){if(Dt){var u=an.formState;if(u!==null){e:{var h=dt;if(Dt){if(fn){t:{for(var y=fn,S=Pa;y.nodeType!==8;){if(!S){y=null;break t}if(y=Fa(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){fn=Fa(y.nextSibling),h=y.data==="F!";break e}}Go(h)}h=!1}h&&(i=u[0])}}return u=Lr(),u.memoizedState=u.baseState=i,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:XC,lastRenderedState:i},u.queue=h,u=yw.bind(null,dt,h),h.dispatch=u,h=Kv(!1),S=ty.bind(null,dt,!1,h.queue),h=Lr(),y={state:i,dispatch:null,action:a,pending:null},h.queue=y,u=r6.bind(null,dt,y,S,u),y.dispatch=u,h.memoizedState=a,[i,u,!1]}function ew(a){var i=Ln();return tw(i,Wt,a)}function tw(a,i,u){if(i=qv(a,i,XC)[0],a=Dh(ao)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var h=id(i)}catch(N){throw N===pc?Sh:N}else h=i;i=Ln();var y=i.queue,S=y.dispatch;return u!==i.memoizedState&&(dt.flags|=2048,bc(9,{destroy:void 0},a6.bind(null,y,u),null)),[h,S,a]}function a6(a,i){a.action=i}function nw(a){var i=Ln(),u=Wt;if(u!==null)return tw(i,u,a);Ln(),i=i.memoizedState,u=Ln();var h=u.queue.dispatch;return u.memoizedState=a,[i,h,!1]}function bc(a,i,u,h){return a={tag:a,create:u,deps:h,inst:i,next:null},i=dt.updateQueue,i===null&&(i=Nh(),dt.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=a.next=a:(h=u.next,u.next=a,a.next=h,i.lastEffect=a),a}function rw(){return Ln().memoizedState}function Oh(a,i,u,h){var y=Lr();dt.flags|=a,y.memoizedState=bc(1|i,{destroy:void 0},u,h===void 0?null:h)}function Mh(a,i,u,h){var y=Ln();h=h===void 0?null:h;var S=y.memoizedState.inst;Wt!==null&&h!==null&&zv(h,Wt.memoizedState.deps)?y.memoizedState=bc(i,S,u,h):(dt.flags|=a,y.memoizedState=bc(1|i,S,u,h))}function aw(a,i){Oh(8390656,8,a,i)}function Wv(a,i){Mh(2048,8,a,i)}function s6(a){dt.flags|=4;var i=dt.updateQueue;if(i===null)i=Nh(),dt.updateQueue=i,i.events=[a];else{var u=i.events;u===null?i.events=[a]:u.push(a)}}function sw(a){var i=Ln().memoizedState;return s6({ref:i,nextImpl:a}),function(){if((Ft&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function ow(a,i){return Mh(4,2,a,i)}function iw(a,i){return Mh(4,4,a,i)}function lw(a,i){if(typeof i=="function"){a=a();var u=i(a);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function cw(a,i,u){u=u!=null?u.concat([a]):null,Mh(4,4,lw.bind(null,i,a),u)}function Qv(){}function uw(a,i){var u=Ln();i=i===void 0?null:i;var h=u.memoizedState;return i!==null&&zv(i,h[1])?h[0]:(u.memoizedState=[a,i],a)}function dw(a,i){var u=Ln();i=i===void 0?null:i;var h=u.memoizedState;if(i!==null&&zv(i,h[1]))return h[0];if(h=a(),ul){pr(!0);try{a()}finally{pr(!1)}}return u.memoizedState=[h,i],h}function Xv(a,i,u){return u===void 0||(ro&1073741824)!==0&&(Et&261930)===0?a.memoizedState=i:(a.memoizedState=u,a=fE(),dt.lanes|=a,ei|=a,u)}function fw(a,i,u,h){return aa(u,i)?u:vc.current!==null?(a=Xv(a,u,h),aa(a,i)||($n=!0),a):(ro&42)===0||(ro&1073741824)!==0&&(Et&261930)===0?($n=!0,a.memoizedState=u):(a=fE(),dt.lanes|=a,ei|=a,i)}function hw(a,i,u,h,y){var S=B.p;B.p=S!==0&&8>S?S:8;var N=I.T,k={};I.T=k,ty(a,!1,i,u);try{var H=y(),re=I.S;if(re!==null&&re(k,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var he=e6(H,h);ld(a,i,he,ua(a))}else ld(a,i,h,ua(a))}catch(pe){ld(a,i,{then:function(){},status:"rejected",reason:pe},ua())}finally{B.p=S,N!==null&&k.types!==null&&(N.types=k.types),I.T=N}}function o6(){}function Jv(a,i,u,h){if(a.tag!==5)throw Error(r(476));var y=mw(a).queue;hw(a,y,i,G,u===null?o6:function(){return pw(a),u(h)})}function mw(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:G},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ao,lastRenderedState:u},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function pw(a){var i=mw(a);i.next===null&&(i=a.alternate.memoizedState),ld(a,i.next.queue,{},ua())}function ey(){return xr(Rd)}function gw(){return Ln().memoizedState}function vw(){return Ln().memoizedState}function i6(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var u=ua();a=Ko(u);var h=Yo(i,a,u);h!==null&&(Qr(h,i,u),rd(h,i,u)),i={cache:Nv()},a.payload=i;return}i=i.return}}function l6(a,i,u){var h=ua();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},kh(a)?xw(i,u):(u=yv(a,i,u,h),u!==null&&(Qr(u,a,h),bw(u,i,h)))}function yw(a,i,u){var h=ua();ld(a,i,u,h)}function ld(a,i,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(kh(a))xw(i,y);else{var S=a.alternate;if(a.lanes===0&&(S===null||S.lanes===0)&&(S=i.lastRenderedReducer,S!==null))try{var N=i.lastRenderedState,k=S(N,u);if(y.hasEagerState=!0,y.eagerState=k,aa(k,N))return mh(a,i,y,0),an===null&&hh(),!1}catch{}finally{}if(u=yv(a,i,y,h),u!==null)return Qr(u,a,h),bw(u,i,h),!0}return!1}function ty(a,i,u,h){if(h={lane:2,revertLane:My(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},kh(a)){if(i)throw Error(r(479))}else i=yv(a,u,h,2),i!==null&&Qr(i,a,2)}function kh(a){var i=a.alternate;return a===dt||i!==null&&i===dt}function xw(a,i){yc=jh=!0;var u=a.pending;u===null?i.next=i:(i.next=u.next,u.next=i),a.pending=i}function bw(a,i,u){if((u&4194048)!==0){var h=i.lanes;h&=a.pendingLanes,u|=h,i.lanes=u,se(a,u)}}var cd={readContext:xr,use:Ah,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};cd.useEffectEvent=Rn;var Sw={readContext:xr,use:Ah,useCallback:function(a,i){return Lr().memoizedState=[a,i===void 0?null:i],a},useContext:xr,useEffect:aw,useImperativeHandle:function(a,i,u){u=u!=null?u.concat([a]):null,Oh(4194308,4,lw.bind(null,i,a),u)},useLayoutEffect:function(a,i){return Oh(4194308,4,a,i)},useInsertionEffect:function(a,i){Oh(4,2,a,i)},useMemo:function(a,i){var u=Lr();i=i===void 0?null:i;var h=a();if(ul){pr(!0);try{a()}finally{pr(!1)}}return u.memoizedState=[h,i],h},useReducer:function(a,i,u){var h=Lr();if(u!==void 0){var y=u(i);if(ul){pr(!0);try{u(i)}finally{pr(!1)}}}else y=i;return h.memoizedState=h.baseState=y,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:y},h.queue=a,a=a.dispatch=l6.bind(null,dt,a),[h.memoizedState,a]},useRef:function(a){var i=Lr();return a={current:a},i.memoizedState=a},useState:function(a){a=Kv(a);var i=a.queue,u=yw.bind(null,dt,i);return i.dispatch=u,[a.memoizedState,u]},useDebugValue:Qv,useDeferredValue:function(a,i){var u=Lr();return Xv(u,a,i)},useTransition:function(){var a=Kv(!1);return a=hw.bind(null,dt,a.queue,!0,!1),Lr().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,u){var h=dt,y=Lr();if(Dt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),an===null)throw Error(r(349));(Et&127)!==0||HC(h,i,u)}y.memoizedState=u;var S={value:u,getSnapshot:i};return y.queue=S,aw(BC.bind(null,h,S,a),[a]),h.flags|=2048,bc(9,{destroy:void 0},$C.bind(null,h,S,u,i),null),u},useId:function(){var a=Lr(),i=an.identifierPrefix;if(Dt){var u=Es,h=ws;u=(h&~(1<<32-wn(h)-1)).toString(32)+u,i="_"+i+"R_"+u,u=_h++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=t6++,i="_"+i+"r_"+u.toString(32)+"_";return a.memoizedState=i},useHostTransitionStatus:ey,useFormState:JC,useActionState:JC,useOptimistic:function(a){var i=Lr();i.memoizedState=i.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=ty.bind(null,dt,!0,u),u.dispatch=i,[a,i]},useMemoCache:Gv,useCacheRefresh:function(){return Lr().memoizedState=i6.bind(null,dt)},useEffectEvent:function(a){var i=Lr(),u={impl:a};return i.memoizedState=u,function(){if((Ft&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},ny={readContext:xr,use:Ah,useCallback:uw,useContext:xr,useEffect:Wv,useImperativeHandle:cw,useInsertionEffect:ow,useLayoutEffect:iw,useMemo:dw,useReducer:Dh,useRef:rw,useState:function(){return Dh(ao)},useDebugValue:Qv,useDeferredValue:function(a,i){var u=Ln();return fw(u,Wt.memoizedState,a,i)},useTransition:function(){var a=Dh(ao)[0],i=Ln().memoizedState;return[typeof a=="boolean"?a:id(a),i]},useSyncExternalStore:VC,useId:gw,useHostTransitionStatus:ey,useFormState:ew,useActionState:ew,useOptimistic:function(a,i){var u=Ln();return ZC(u,Wt,a,i)},useMemoCache:Gv,useCacheRefresh:vw};ny.useEffectEvent=sw;var Cw={readContext:xr,use:Ah,useCallback:uw,useContext:xr,useEffect:Wv,useImperativeHandle:cw,useInsertionEffect:ow,useLayoutEffect:iw,useMemo:dw,useReducer:Zv,useRef:rw,useState:function(){return Zv(ao)},useDebugValue:Qv,useDeferredValue:function(a,i){var u=Ln();return Wt===null?Xv(u,a,i):fw(u,Wt.memoizedState,a,i)},useTransition:function(){var a=Zv(ao)[0],i=Ln().memoizedState;return[typeof a=="boolean"?a:id(a),i]},useSyncExternalStore:VC,useId:gw,useHostTransitionStatus:ey,useFormState:nw,useActionState:nw,useOptimistic:function(a,i){var u=Ln();return Wt!==null?ZC(u,Wt,a,i):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:Gv,useCacheRefresh:vw};Cw.useEffectEvent=sw;function ry(a,i,u,h){i=a.memoizedState,u=u(h,i),u=u==null?i:v({},i,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var ay={enqueueSetState:function(a,i,u){a=a._reactInternals;var h=ua(),y=Ko(h);y.payload=i,u!=null&&(y.callback=u),i=Yo(a,y,h),i!==null&&(Qr(i,a,h),rd(i,a,h))},enqueueReplaceState:function(a,i,u){a=a._reactInternals;var h=ua(),y=Ko(h);y.tag=1,y.payload=i,u!=null&&(y.callback=u),i=Yo(a,y,h),i!==null&&(Qr(i,a,h),rd(i,a,h))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var u=ua(),h=Ko(u);h.tag=2,i!=null&&(h.callback=i),i=Yo(a,h,u),i!==null&&(Qr(i,a,u),rd(i,a,u))}};function ww(a,i,u,h,y,S,N){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(h,S,N):i.prototype&&i.prototype.isPureReactComponent?!Yu(u,h)||!Yu(y,S):!0}function Ew(a,i,u,h){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,h),i.state!==a&&ay.enqueueReplaceState(i,i.state,null)}function dl(a,i){var u=i;if("ref"in i){u={};for(var h in i)h!=="ref"&&(u[h]=i[h])}if(a=a.defaultProps){u===i&&(u=v({},u));for(var y in a)u[y]===void 0&&(u[y]=a[y])}return u}function Rw(a){fh(a)}function Tw(a){console.error(a)}function jw(a){fh(a)}function Ih(a,i){try{var u=a.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(h){setTimeout(function(){throw h})}}function _w(a,i,u){try{var h=a.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function sy(a,i,u){return u=Ko(u),u.tag=3,u.payload={element:null},u.callback=function(){Ih(a,i)},u}function Nw(a){return a=Ko(a),a.tag=3,a}function Aw(a,i,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=h.value;a.payload=function(){return y(S)},a.callback=function(){_w(i,u,h)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(a.callback=function(){_w(i,u,h),typeof y!="function"&&(ti===null?ti=new Set([this]):ti.add(this));var k=h.stack;this.componentDidCatch(h.value,{componentStack:k!==null?k:""})})}function c6(a,i,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(i=u.alternate,i!==null&&fc(i,u,y,!0),u=oa.current,u!==null){switch(u.tag){case 31:case 13:return Ua===null?Zh():u.alternate===null&&Tn===0&&(Tn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===Ch?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([h]):i.add(h),Ay(a,h,y)),!1;case 22:return u.flags|=65536,h===Ch?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([h]):u.add(h)),Ay(a,h,y)),!1}throw Error(r(435,u.tag))}return Ay(a,h,y),Zh(),!1}if(Dt)return i=oa.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=y,h!==Ev&&(a=Error(r(422),{cause:h}),Xu(ka(a,u)))):(h!==Ev&&(i=Error(r(423),{cause:h}),Xu(ka(i,u))),a=a.current.alternate,a.flags|=65536,y&=-y,a.lanes|=y,h=ka(h,u),y=sy(a.stateNode,h,y),Iv(a,y),Tn!==4&&(Tn=2)),!1;var S=Error(r(520),{cause:h});if(S=ka(S,u),vd===null?vd=[S]:vd.push(S),Tn!==4&&(Tn=2),i===null)return!0;h=ka(h,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,a=y&-y,u.lanes|=a,a=sy(u.stateNode,h,a),Iv(u,a),!1;case 1:if(i=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(ti===null||!ti.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Nw(y),Aw(y,a,u,h),Iv(u,y),!1}u=u.return}while(u!==null);return!1}var oy=Error(r(461)),$n=!1;function br(a,i,u,h){i.child=a===null?kC(i,null,u,h):cl(i,a.child,u,h)}function Dw(a,i,u,h,y){u=u.render;var S=i.ref;if("ref"in h){var N={};for(var k in h)k!=="ref"&&(N[k]=h[k])}else N=h;return sl(i),h=Vv(a,i,u,N,S,y),k=Hv(),a!==null&&!$n?($v(a,i,y),so(a,i,y)):(Dt&&k&&Cv(i),i.flags|=1,br(a,i,h,y),i.child)}function Ow(a,i,u,h,y){if(a===null){var S=u.type;return typeof S=="function"&&!xv(S)&&S.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=S,Mw(a,i,S,h,y)):(a=gh(u.type,null,h,i,i.mode,y),a.ref=i.ref,a.return=i,i.child=a)}if(S=a.child,!my(a,y)){var N=S.memoizedProps;if(u=u.compare,u=u!==null?u:Yu,u(N,h)&&a.ref===i.ref)return so(a,i,y)}return i.flags|=1,a=Js(S,h),a.ref=i.ref,a.return=i,i.child=a}function Mw(a,i,u,h,y){if(a!==null){var S=a.memoizedProps;if(Yu(S,h)&&a.ref===i.ref)if($n=!1,i.pendingProps=h=S,my(a,y))(a.flags&131072)!==0&&($n=!0);else return i.lanes=a.lanes,so(a,i,y)}return iy(a,i,u,h,y)}function kw(a,i,u,h){var y=h.children,S=a!==null?a.memoizedState:null;if(a===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((i.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,a!==null){for(h=i.child=a.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~S}else h=0,i.child=null;return Iw(a,i,S,u,h)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&bh(i,S!==null?S.cachePool:null),S!==null?PC(i,S):Pv(),UC(i);else return h=i.lanes=536870912,Iw(a,i,S!==null?S.baseLanes|u:u,u,h)}else S!==null?(bh(i,S.cachePool),PC(i,S),Qo(),i.memoizedState=null):(a!==null&&bh(i,null),Pv(),Qo());return br(a,i,y,u),i.child}function ud(a,i){return a!==null&&a.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Iw(a,i,u,h,y){var S=Dv();return S=S===null?null:{parent:Vn._currentValue,pool:S},i.memoizedState={baseLanes:u,cachePool:S},a!==null&&bh(i,null),Pv(),UC(i),a!==null&&fc(a,i,h,!0),i.childLanes=y,null}function Lh(a,i){return i=Uh({mode:i.mode,children:i.children},a.mode),i.ref=a.ref,a.child=i,i.return=a,i}function Lw(a,i,u){return cl(i,a.child,null,u),a=Lh(i,i.pendingProps),a.flags|=2,ia(i),i.memoizedState=null,a}function u6(a,i,u){var h=i.pendingProps,y=(i.flags&128)!==0;if(i.flags&=-129,a===null){if(Dt){if(h.mode==="hidden")return a=Lh(i,h),i.lanes=536870912,ud(null,a);if(Fv(i),(a=fn)?(a=KE(a,Pa),a=a!==null&&a.data==="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:$o!==null?{id:ws,overflow:Es}:null,retryLane:536870912,hydrationErrors:null},u=xC(a),u.return=i,i.child=u,yr=i,fn=null)):a=null,a===null)throw Go(i);return i.lanes=536870912,null}return Lh(i,h)}var S=a.memoizedState;if(S!==null){var N=S.dehydrated;if(Fv(i),y)if(i.flags&256)i.flags&=-257,i=Lw(a,i,u);else if(i.memoizedState!==null)i.child=a.child,i.flags|=128,i=null;else throw Error(r(558));else if($n||fc(a,i,u,!1),y=(u&a.childLanes)!==0,$n||y){if(h=an,h!==null&&(N=ge(h,u),N!==0&&N!==S.retryLane))throw S.retryLane=N,tl(a,N),Qr(h,a,N),oy;Zh(),i=Lw(a,i,u)}else a=S.treeContext,fn=Fa(N.nextSibling),yr=i,Dt=!0,Bo=null,Pa=!1,a!==null&&CC(i,a),i=Lh(i,h),i.flags|=4096;return i}return a=Js(a.child,{mode:h.mode,children:h.children}),a.ref=i.ref,i.child=a,a.return=i,a}function Ph(a,i){var u=i.ref;if(u===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(a===null||a.ref!==u)&&(i.flags|=4194816)}}function iy(a,i,u,h,y){return sl(i),u=Vv(a,i,u,h,void 0,y),h=Hv(),a!==null&&!$n?($v(a,i,y),so(a,i,y)):(Dt&&h&&Cv(i),i.flags|=1,br(a,i,u,y),i.child)}function Pw(a,i,u,h,y,S){return sl(i),i.updateQueue=null,u=zC(i,h,u,y),FC(a),h=Hv(),a!==null&&!$n?($v(a,i,S),so(a,i,S)):(Dt&&h&&Cv(i),i.flags|=1,br(a,i,u,S),i.child)}function Uw(a,i,u,h,y){if(sl(i),i.stateNode===null){var S=lc,N=u.contextType;typeof N=="object"&&N!==null&&(S=xr(N)),S=new u(h,S),i.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=ay,i.stateNode=S,S._reactInternals=i,S=i.stateNode,S.props=h,S.state=i.memoizedState,S.refs={},Mv(i),N=u.contextType,S.context=typeof N=="object"&&N!==null?xr(N):lc,S.state=i.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(ry(i,u,N,h),S.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(N=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),N!==S.state&&ay.enqueueReplaceState(S,S.state,null),sd(i,h,S,y),ad(),S.state=i.memoizedState),typeof S.componentDidMount=="function"&&(i.flags|=4194308),h=!0}else if(a===null){S=i.stateNode;var k=i.memoizedProps,H=dl(u,k);S.props=H;var re=S.context,he=u.contextType;N=lc,typeof he=="object"&&he!==null&&(N=xr(he));var pe=u.getDerivedStateFromProps;he=typeof pe=="function"||typeof S.getSnapshotBeforeUpdate=="function",k=i.pendingProps!==k,he||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(k||re!==N)&&Ew(i,S,h,N),Zo=!1;var oe=i.memoizedState;S.state=oe,sd(i,h,S,y),ad(),re=i.memoizedState,k||oe!==re||Zo?(typeof pe=="function"&&(ry(i,u,pe,h),re=i.memoizedState),(H=Zo||ww(i,u,H,h,oe,re,N))?(he||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(i.flags|=4194308)):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=re),S.props=h,S.state=re,S.context=N,h=H):(typeof S.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{S=i.stateNode,kv(a,i),N=i.memoizedProps,he=dl(u,N),S.props=he,pe=i.pendingProps,oe=S.context,re=u.contextType,H=lc,typeof re=="object"&&re!==null&&(H=xr(re)),k=u.getDerivedStateFromProps,(re=typeof k=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N!==pe||oe!==H)&&Ew(i,S,h,H),Zo=!1,oe=i.memoizedState,S.state=oe,sd(i,h,S,y),ad();var ue=i.memoizedState;N!==pe||oe!==ue||Zo||a!==null&&a.dependencies!==null&&yh(a.dependencies)?(typeof k=="function"&&(ry(i,u,k,h),ue=i.memoizedState),(he=Zo||ww(i,u,he,h,oe,ue,H)||a!==null&&a.dependencies!==null&&yh(a.dependencies))?(re||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,ue,H),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,ue,H)),typeof S.componentDidUpdate=="function"&&(i.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=ue),S.props=h,S.state=ue,S.context=H,h=he):(typeof S.componentDidUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||N===a.memoizedProps&&oe===a.memoizedState||(i.flags|=1024),h=!1)}return S=h,Ph(a,i),h=(i.flags&128)!==0,S||h?(S=i.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:S.render(),i.flags|=1,a!==null&&h?(i.child=cl(i,a.child,null,y),i.child=cl(i,null,u,y)):br(a,i,u,y),i.memoizedState=S.state,a=i.child):a=so(a,i,y),a}function Fw(a,i,u,h){return rl(),i.flags|=256,br(a,i,u,h),i.child}var ly={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function cy(a){return{baseLanes:a,cachePool:_C()}}function uy(a,i,u){return a=a!==null?a.childLanes&~u:0,i&&(a|=ca),a}function zw(a,i,u){var h=i.pendingProps,y=!1,S=(i.flags&128)!==0,N;if((N=S)||(N=a!==null&&a.memoizedState===null?!1:(In.current&2)!==0),N&&(y=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,a===null){if(Dt){if(y?Wo(i):Qo(),(a=fn)?(a=KE(a,Pa),a=a!==null&&a.data!=="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:$o!==null?{id:ws,overflow:Es}:null,retryLane:536870912,hydrationErrors:null},u=xC(a),u.return=i,i.child=u,yr=i,fn=null)):a=null,a===null)throw Go(i);return qy(a)?i.lanes=32:i.lanes=536870912,null}var k=h.children;return h=h.fallback,y?(Qo(),y=i.mode,k=Uh({mode:"hidden",children:k},y),h=nl(h,y,u,null),k.return=i,h.return=i,k.sibling=h,i.child=k,h=i.child,h.memoizedState=cy(u),h.childLanes=uy(a,N,u),i.memoizedState=ly,ud(null,h)):(Wo(i),dy(i,k))}var H=a.memoizedState;if(H!==null&&(k=H.dehydrated,k!==null)){if(S)i.flags&256?(Wo(i),i.flags&=-257,i=fy(a,i,u)):i.memoizedState!==null?(Qo(),i.child=a.child,i.flags|=128,i=null):(Qo(),k=h.fallback,y=i.mode,h=Uh({mode:"visible",children:h.children},y),k=nl(k,y,u,null),k.flags|=2,h.return=i,k.return=i,h.sibling=k,i.child=h,cl(i,a.child,null,u),h=i.child,h.memoizedState=cy(u),h.childLanes=uy(a,N,u),i.memoizedState=ly,i=ud(null,h));else if(Wo(i),qy(k)){if(N=k.nextSibling&&k.nextSibling.dataset,N)var re=N.dgst;N=re,h=Error(r(419)),h.stack="",h.digest=N,Xu({value:h,source:null,stack:null}),i=fy(a,i,u)}else if($n||fc(a,i,u,!1),N=(u&a.childLanes)!==0,$n||N){if(N=an,N!==null&&(h=ge(N,u),h!==0&&h!==H.retryLane))throw H.retryLane=h,tl(a,h),Qr(N,a,h),oy;Gy(k)||Zh(),i=fy(a,i,u)}else Gy(k)?(i.flags|=192,i.child=a.child,i=null):(a=H.treeContext,fn=Fa(k.nextSibling),yr=i,Dt=!0,Bo=null,Pa=!1,a!==null&&CC(i,a),i=dy(i,h.children),i.flags|=4096);return i}return y?(Qo(),k=h.fallback,y=i.mode,H=a.child,re=H.sibling,h=Js(H,{mode:"hidden",children:h.children}),h.subtreeFlags=H.subtreeFlags&65011712,re!==null?k=Js(re,k):(k=nl(k,y,u,null),k.flags|=2),k.return=i,h.return=i,h.sibling=k,i.child=h,ud(null,h),h=i.child,k=a.child.memoizedState,k===null?k=cy(u):(y=k.cachePool,y!==null?(H=Vn._currentValue,y=y.parent!==H?{parent:H,pool:H}:y):y=_C(),k={baseLanes:k.baseLanes|u,cachePool:y}),h.memoizedState=k,h.childLanes=uy(a,N,u),i.memoizedState=ly,ud(a.child,h)):(Wo(i),u=a.child,a=u.sibling,u=Js(u,{mode:"visible",children:h.children}),u.return=i,u.sibling=null,a!==null&&(N=i.deletions,N===null?(i.deletions=[a],i.flags|=16):N.push(a)),i.child=u,i.memoizedState=null,u)}function dy(a,i){return i=Uh({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function Uh(a,i){return a=sa(22,a,null,i),a.lanes=0,a}function fy(a,i,u){return cl(i,a.child,null,u),a=dy(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function Vw(a,i,u){a.lanes|=i;var h=a.alternate;h!==null&&(h.lanes|=i),jv(a.return,i,u)}function hy(a,i,u,h,y,S){var N=a.memoizedState;N===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y,treeForkCount:S}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=h,N.tail=u,N.tailMode=y,N.treeForkCount=S)}function Hw(a,i,u){var h=i.pendingProps,y=h.revealOrder,S=h.tail;h=h.children;var N=In.current,k=(N&2)!==0;if(k?(N=N&1|2,i.flags|=128):N&=1,W(In,N),br(a,i,h,u),h=Dt?Qu:0,!k&&a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Vw(a,u,i);else if(a.tag===19)Vw(a,u,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(y){case"forwards":for(u=i.child,y=null;u!==null;)a=u.alternate,a!==null&&Th(a)===null&&(y=u),u=u.sibling;u=y,u===null?(y=i.child,i.child=null):(y=u.sibling,u.sibling=null),hy(i,!1,y,u,S,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=i.child,i.child=null;y!==null;){if(a=y.alternate,a!==null&&Th(a)===null){i.child=y;break}a=y.sibling,y.sibling=u,u=y,y=a}hy(i,!0,u,null,S,h);break;case"together":hy(i,!1,null,null,void 0,h);break;default:i.memoizedState=null}return i.child}function so(a,i,u){if(a!==null&&(i.dependencies=a.dependencies),ei|=i.lanes,(u&i.childLanes)===0)if(a!==null){if(fc(a,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,u=Js(a,a.pendingProps),i.child=u,u.return=i;a.sibling!==null;)a=a.sibling,u=u.sibling=Js(a,a.pendingProps),u.return=i;u.sibling=null}return i.child}function my(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&yh(a)))}function d6(a,i,u){switch(i.tag){case 3:Ne(i,i.stateNode.containerInfo),qo(i,Vn,a.memoizedState.cache),rl();break;case 27:case 5:Te(i);break;case 4:Ne(i,i.stateNode.containerInfo);break;case 10:qo(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Fv(i),null;break;case 13:var h=i.memoizedState;if(h!==null)return h.dehydrated!==null?(Wo(i),i.flags|=128,null):(u&i.child.childLanes)!==0?zw(a,i,u):(Wo(i),a=so(a,i,u),a!==null?a.sibling:null);Wo(i);break;case 19:var y=(a.flags&128)!==0;if(h=(u&i.childLanes)!==0,h||(fc(a,i,u,!1),h=(u&i.childLanes)!==0),y){if(h)return Hw(a,i,u);i.flags|=128}if(y=i.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),W(In,In.current),h)break;return null;case 22:return i.lanes=0,kw(a,i,u,i.pendingProps);case 24:qo(i,Vn,a.memoizedState.cache)}return so(a,i,u)}function $w(a,i,u){if(a!==null)if(a.memoizedProps!==i.pendingProps)$n=!0;else{if(!my(a,u)&&(i.flags&128)===0)return $n=!1,d6(a,i,u);$n=(a.flags&131072)!==0}else $n=!1,Dt&&(i.flags&1048576)!==0&&SC(i,Qu,i.index);switch(i.lanes=0,i.tag){case 16:e:{var h=i.pendingProps;if(a=il(i.elementType),i.type=a,typeof a=="function")xv(a)?(h=dl(a,h),i.tag=1,i=Uw(null,i,a,h,u)):(i.tag=0,i=iy(null,i,a,h,u));else{if(a!=null){var y=a.$$typeof;if(y===O){i.tag=11,i=Dw(null,i,a,h,u);break e}else if(y===j){i.tag=14,i=Ow(null,i,a,h,u);break e}}throw i=F(a)||a,Error(r(306,i,""))}}return i;case 0:return iy(a,i,i.type,i.pendingProps,u);case 1:return h=i.type,y=dl(h,i.pendingProps),Uw(a,i,h,y,u);case 3:e:{if(Ne(i,i.stateNode.containerInfo),a===null)throw Error(r(387));h=i.pendingProps;var S=i.memoizedState;y=S.element,kv(a,i),sd(i,h,null,u);var N=i.memoizedState;if(h=N.cache,qo(i,Vn,h),h!==S.cache&&_v(i,[Vn],u,!0),ad(),h=N.element,S.isDehydrated)if(S={element:h,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=S,i.memoizedState=S,i.flags&256){i=Fw(a,i,h,u);break e}else if(h!==y){y=ka(Error(r(424)),i),Xu(y),i=Fw(a,i,h,u);break e}else{switch(a=i.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(fn=Fa(a.firstChild),yr=i,Dt=!0,Bo=null,Pa=!0,u=kC(i,null,h,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(rl(),h===y){i=so(a,i,u);break e}br(a,i,h,u)}i=i.child}return i;case 26:return Ph(a,i),a===null?(u=e2(i.type,null,i.pendingProps,null))?i.memoizedState=u:Dt||(u=i.type,a=i.pendingProps,h=em(ve.current).createElement(u),h[ze]=i,h[Ge]=a,Sr(h,u,a),En(h),i.stateNode=h):i.memoizedState=e2(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return Te(i),a===null&&Dt&&(h=i.stateNode=QE(i.type,i.pendingProps,ve.current),yr=i,Pa=!0,y=fn,si(i.type)?(Zy=y,fn=Fa(h.firstChild)):fn=y),br(a,i,i.pendingProps.children,u),Ph(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&Dt&&((y=h=fn)&&(h=V6(h,i.type,i.pendingProps,Pa),h!==null?(i.stateNode=h,yr=i,fn=Fa(h.firstChild),Pa=!1,y=!0):y=!1),y||Go(i)),Te(i),y=i.type,S=i.pendingProps,N=a!==null?a.memoizedProps:null,h=S.children,Hy(y,S)?h=null:N!==null&&Hy(y,N)&&(i.flags|=32),i.memoizedState!==null&&(y=Vv(a,i,n6,null,null,u),Rd._currentValue=y),Ph(a,i),br(a,i,h,u),i.child;case 6:return a===null&&Dt&&((a=u=fn)&&(u=H6(u,i.pendingProps,Pa),u!==null?(i.stateNode=u,yr=i,fn=null,a=!0):a=!1),a||Go(i)),null;case 13:return zw(a,i,u);case 4:return Ne(i,i.stateNode.containerInfo),h=i.pendingProps,a===null?i.child=cl(i,null,h,u):br(a,i,h,u),i.child;case 11:return Dw(a,i,i.type,i.pendingProps,u);case 7:return br(a,i,i.pendingProps,u),i.child;case 8:return br(a,i,i.pendingProps.children,u),i.child;case 12:return br(a,i,i.pendingProps.children,u),i.child;case 10:return h=i.pendingProps,qo(i,i.type,h.value),br(a,i,h.children,u),i.child;case 9:return y=i.type._context,h=i.pendingProps.children,sl(i),y=xr(y),h=h(y),i.flags|=1,br(a,i,h,u),i.child;case 14:return Ow(a,i,i.type,i.pendingProps,u);case 15:return Mw(a,i,i.type,i.pendingProps,u);case 19:return Hw(a,i,u);case 31:return u6(a,i,u);case 22:return kw(a,i,u,i.pendingProps);case 24:return sl(i),h=xr(Vn),a===null?(y=Dv(),y===null&&(y=an,S=Nv(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),i.memoizedState={parent:h,cache:y},Mv(i),qo(i,Vn,y)):((a.lanes&u)!==0&&(kv(a,i),sd(i,null,null,u),ad()),y=a.memoizedState,S=i.memoizedState,y.parent!==h?(y={parent:h,cache:h},i.memoizedState=y,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=y),qo(i,Vn,h)):(h=S.cache,qo(i,Vn,h),h!==y.cache&&_v(i,[Vn],u,!0))),br(a,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function oo(a){a.flags|=4}function py(a,i,u,h,y){if((i=(a.mode&32)!==0)&&(i=!1),i){if(a.flags|=16777216,(y&335544128)===y)if(a.stateNode.complete)a.flags|=8192;else if(gE())a.flags|=8192;else throw ll=Ch,Ov}else a.flags&=-16777217}function Bw(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!s2(i))if(gE())a.flags|=8192;else throw ll=Ch,Ov}function Fh(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?kn():536870912,a.lanes|=i,Ec|=i)}function dd(a,i){if(!Dt)switch(a.tailMode){case"hidden":i=a.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?a.tail=null:u.sibling=null;break;case"collapsed":u=a.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:h.sibling=null}}function hn(a){var i=a.alternate!==null&&a.alternate.child===a.child,u=0,h=0;if(i)for(var y=a.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=a,y=y.sibling;else for(y=a.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=a,y=y.sibling;return a.subtreeFlags|=h,a.childLanes=u,i}function f6(a,i,u){var h=i.pendingProps;switch(wv(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hn(i),null;case 1:return hn(i),null;case 3:return u=i.stateNode,h=null,a!==null&&(h=a.memoizedState.cache),i.memoizedState.cache!==h&&(i.flags|=2048),no(Vn),we(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(dc(i)?oo(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Rv())),hn(i),null;case 26:var y=i.type,S=i.memoizedState;return a===null?(oo(i),S!==null?(hn(i),Bw(i,S)):(hn(i),py(i,y,null,h,u))):S?S!==a.memoizedState?(oo(i),hn(i),Bw(i,S)):(hn(i),i.flags&=-16777217):(a=a.memoizedProps,a!==h&&oo(i),hn(i),py(i,y,a,h,u)),null;case 27:if(Be(i),u=ve.current,y=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==h&&oo(i);else{if(!h){if(i.stateNode===null)throw Error(r(166));return hn(i),null}a=ee.current,dc(i)?wC(i):(a=QE(y,h,u),i.stateNode=a,oo(i))}return hn(i),null;case 5:if(Be(i),y=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==h&&oo(i);else{if(!h){if(i.stateNode===null)throw Error(r(166));return hn(i),null}if(S=ee.current,dc(i))wC(i);else{var N=em(ve.current);switch(S){case 1:S=N.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=N.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=N.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=N.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof h.is=="string"?N.createElement("select",{is:h.is}):N.createElement("select"),h.multiple?S.multiple=!0:h.size&&(S.size=h.size);break;default:S=typeof h.is=="string"?N.createElement(y,{is:h.is}):N.createElement(y)}}S[ze]=i,S[Ge]=h;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)S.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===i)break e;for(;N.sibling===null;){if(N.return===null||N.return===i)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}i.stateNode=S;e:switch(Sr(S,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&oo(i)}}return hn(i),py(i,i.type,a===null?null:a.memoizedProps,i.pendingProps,u),null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==h&&oo(i);else{if(typeof h!="string"&&i.stateNode===null)throw Error(r(166));if(a=ve.current,dc(i)){if(a=i.stateNode,u=i.memoizedProps,h=null,y=yr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}a[ze]=i,a=!!(a.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||zE(a.nodeValue,u)),a||Go(i,!0)}else a=em(a).createTextNode(h),a[ze]=i,i.stateNode=a}return hn(i),null;case 31:if(u=i.memoizedState,a===null||a.memoizedState!==null){if(h=dc(i),u!==null){if(a===null){if(!h)throw Error(r(318));if(a=i.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[ze]=i}else rl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;hn(i),a=!1}else u=Rv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return i.flags&256?(ia(i),i):(ia(i),null);if((i.flags&128)!==0)throw Error(r(558))}return hn(i),null;case 13:if(h=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(y=dc(i),h!==null&&h.dehydrated!==null){if(a===null){if(!y)throw Error(r(318));if(y=i.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[ze]=i}else rl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;hn(i),y=!1}else y=Rv(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=y),y=!0;if(!y)return i.flags&256?(ia(i),i):(ia(i),null)}return ia(i),(i.flags&128)!==0?(i.lanes=u,i):(u=h!==null,a=a!==null&&a.memoizedState!==null,u&&(h=i.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),S=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(S=h.memoizedState.cachePool.pool),S!==y&&(h.flags|=2048)),u!==a&&u&&(i.child.flags|=8192),Fh(i,i.updateQueue),hn(i),null);case 4:return we(),a===null&&Py(i.stateNode.containerInfo),hn(i),null;case 10:return no(i.type),hn(i),null;case 19:if(P(In),h=i.memoizedState,h===null)return hn(i),null;if(y=(i.flags&128)!==0,S=h.rendering,S===null)if(y)dd(h,!1);else{if(Tn!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(S=Th(a),S!==null){for(i.flags|=128,dd(h,!1),a=S.updateQueue,i.updateQueue=a,Fh(i,a),i.subtreeFlags=0,a=u,u=i.child;u!==null;)yC(u,a),u=u.sibling;return W(In,In.current&1|2),Dt&&eo(i,h.treeForkCount),i.child}a=a.sibling}h.tail!==null&&ye()>Bh&&(i.flags|=128,y=!0,dd(h,!1),i.lanes=4194304)}else{if(!y)if(a=Th(S),a!==null){if(i.flags|=128,y=!0,a=a.updateQueue,i.updateQueue=a,Fh(i,a),dd(h,!0),h.tail===null&&h.tailMode==="hidden"&&!S.alternate&&!Dt)return hn(i),null}else 2*ye()-h.renderingStartTime>Bh&&u!==536870912&&(i.flags|=128,y=!0,dd(h,!1),i.lanes=4194304);h.isBackwards?(S.sibling=i.child,i.child=S):(a=h.last,a!==null?a.sibling=S:i.child=S,h.last=S)}return h.tail!==null?(a=h.tail,h.rendering=a,h.tail=a.sibling,h.renderingStartTime=ye(),a.sibling=null,u=In.current,W(In,y?u&1|2:u&1),Dt&&eo(i,h.treeForkCount),a):(hn(i),null);case 22:case 23:return ia(i),Uv(),h=i.memoizedState!==null,a!==null?a.memoizedState!==null!==h&&(i.flags|=8192):h&&(i.flags|=8192),h?(u&536870912)!==0&&(i.flags&128)===0&&(hn(i),i.subtreeFlags&6&&(i.flags|=8192)):hn(i),u=i.updateQueue,u!==null&&Fh(i,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==u&&(i.flags|=2048),a!==null&&P(ol),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),no(Vn),hn(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function h6(a,i){switch(wv(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return no(Vn),we(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return Be(i),null;case 31:if(i.memoizedState!==null){if(ia(i),i.alternate===null)throw Error(r(340));rl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 13:if(ia(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));rl()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return P(In),null;case 4:return we(),null;case 10:return no(i.type),null;case 22:case 23:return ia(i),Uv(),a!==null&&P(ol),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return no(Vn),null;case 25:return null;default:return null}}function Gw(a,i){switch(wv(i),i.tag){case 3:no(Vn),we();break;case 26:case 27:case 5:Be(i);break;case 4:we();break;case 31:i.memoizedState!==null&&ia(i);break;case 13:ia(i);break;case 19:P(In);break;case 10:no(i.type);break;case 22:case 23:ia(i),Uv(),a!==null&&P(ol);break;case 24:no(Vn)}}function fd(a,i){try{var u=i.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&a)===a){h=void 0;var S=u.create,N=u.inst;h=S(),N.destroy=h}u=u.next}while(u!==y)}}catch(k){Zt(i,i.return,k)}}function Xo(a,i,u){try{var h=i.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var S=y.next;h=S;do{if((h.tag&a)===a){var N=h.inst,k=N.destroy;if(k!==void 0){N.destroy=void 0,y=i;var H=u,re=k;try{re()}catch(he){Zt(y,H,he)}}}h=h.next}while(h!==S)}}catch(he){Zt(i,i.return,he)}}function qw(a){var i=a.updateQueue;if(i!==null){var u=a.stateNode;try{LC(i,u)}catch(h){Zt(a,a.return,h)}}}function Zw(a,i,u){u.props=dl(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(h){Zt(a,i,h)}}function hd(a,i){try{var u=a.ref;if(u!==null){switch(a.tag){case 26:case 27:case 5:var h=a.stateNode;break;case 30:h=a.stateNode;break;default:h=a.stateNode}typeof u=="function"?a.refCleanup=u(h):u.current=h}}catch(y){Zt(a,i,y)}}function Rs(a,i){var u=a.ref,h=a.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){Zt(a,i,y)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Zt(a,i,y)}else u.current=null}function Kw(a){var i=a.type,u=a.memoizedProps,h=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){Zt(a,a.return,y)}}function gy(a,i,u){try{var h=a.stateNode;I6(h,a.type,u,i),h[Ge]=i}catch(y){Zt(a,a.return,y)}}function Yw(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&si(a.type)||a.tag===4}function vy(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Yw(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&si(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function yy(a,i,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(a),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=Qs));else if(h!==4&&(h===27&&si(a.type)&&(u=a.stateNode,i=null),a=a.child,a!==null))for(yy(a,i,u),a=a.sibling;a!==null;)yy(a,i,u),a=a.sibling}function zh(a,i,u){var h=a.tag;if(h===5||h===6)a=a.stateNode,i?u.insertBefore(a,i):u.appendChild(a);else if(h!==4&&(h===27&&si(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(zh(a,i,u),a=a.sibling;a!==null;)zh(a,i,u),a=a.sibling}function Ww(a){var i=a.stateNode,u=a.memoizedProps;try{for(var h=a.type,y=i.attributes;y.length;)i.removeAttributeNode(y[0]);Sr(i,h,u),i[ze]=a,i[Ge]=u}catch(S){Zt(a,a.return,S)}}var io=!1,Bn=!1,xy=!1,Qw=typeof WeakSet=="function"?WeakSet:Set,cr=null;function m6(a,i){if(a=a.containerInfo,zy=im,a=cC(a),fv(a)){if("selectionStart"in a)var u={start:a.selectionStart,end:a.selectionEnd};else e:{u=(u=a.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,S=h.focusNode;h=h.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var N=0,k=-1,H=-1,re=0,he=0,pe=a,oe=null;t:for(;;){for(var ue;pe!==u||y!==0&&pe.nodeType!==3||(k=N+y),pe!==S||h!==0&&pe.nodeType!==3||(H=N+h),pe.nodeType===3&&(N+=pe.nodeValue.length),(ue=pe.firstChild)!==null;)oe=pe,pe=ue;for(;;){if(pe===a)break t;if(oe===u&&++re===y&&(k=N),oe===S&&++he===h&&(H=N),(ue=pe.nextSibling)!==null)break;pe=oe,oe=pe.parentNode}pe=ue}u=k===-1||H===-1?null:{start:k,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(Vy={focusedElem:a,selectionRange:u},im=!1,cr=i;cr!==null;)if(i=cr,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,cr=a;else for(;cr!==null;){switch(i=cr,S=i.alternate,a=i.flags,i.tag){case 0:if((a&4)!==0&&(a=i.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)y=a[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&S!==null){a=void 0,u=i,y=S.memoizedProps,S=S.memoizedState,h=u.stateNode;try{var $e=dl(u.type,y);a=h.getSnapshotBeforeUpdate($e,S),h.__reactInternalSnapshotBeforeUpdate=a}catch(tt){Zt(u,u.return,tt)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,u=a.nodeType,u===9)By(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":By(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,cr=a;break}cr=i.return}}function Xw(a,i,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:co(a,u),h&4&&fd(5,u);break;case 1:if(co(a,u),h&4)if(a=u.stateNode,i===null)try{a.componentDidMount()}catch(N){Zt(u,u.return,N)}else{var y=dl(u.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(y,i,a.__reactInternalSnapshotBeforeUpdate)}catch(N){Zt(u,u.return,N)}}h&64&&qw(u),h&512&&hd(u,u.return);break;case 3:if(co(a,u),h&64&&(a=u.updateQueue,a!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{LC(a,i)}catch(N){Zt(u,u.return,N)}}break;case 27:i===null&&h&4&&Ww(u);case 26:case 5:co(a,u),i===null&&h&4&&Kw(u),h&512&&hd(u,u.return);break;case 12:co(a,u);break;case 31:co(a,u),h&4&&tE(a,u);break;case 13:co(a,u),h&4&&nE(a,u),h&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=w6.bind(null,u),$6(a,u))));break;case 22:if(h=u.memoizedState!==null||io,!h){i=i!==null&&i.memoizedState!==null||Bn,y=io;var S=Bn;io=h,(Bn=i)&&!S?uo(a,u,(u.subtreeFlags&8772)!==0):co(a,u),io=y,Bn=S}break;case 30:break;default:co(a,u)}}function Jw(a){var i=a.alternate;i!==null&&(a.alternate=null,Jw(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&Gt(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var gn=null,Zr=!1;function lo(a,i,u){for(u=u.child;u!==null;)eE(a,i,u),u=u.sibling}function eE(a,i,u){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(Mn,u)}catch{}switch(u.tag){case 26:Bn||Rs(u,i),lo(a,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Bn||Rs(u,i);var h=gn,y=Zr;si(u.type)&&(gn=u.stateNode,Zr=!1),lo(a,i,u),Cd(u.stateNode),gn=h,Zr=y;break;case 5:Bn||Rs(u,i);case 6:if(h=gn,y=Zr,gn=null,lo(a,i,u),gn=h,Zr=y,gn!==null)if(Zr)try{(gn.nodeType===9?gn.body:gn.nodeName==="HTML"?gn.ownerDocument.body:gn).removeChild(u.stateNode)}catch(S){Zt(u,i,S)}else try{gn.removeChild(u.stateNode)}catch(S){Zt(u,i,S)}break;case 18:gn!==null&&(Zr?(a=gn,qE(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),Oc(a)):qE(gn,u.stateNode));break;case 4:h=gn,y=Zr,gn=u.stateNode.containerInfo,Zr=!0,lo(a,i,u),gn=h,Zr=y;break;case 0:case 11:case 14:case 15:Xo(2,u,i),Bn||Xo(4,u,i),lo(a,i,u);break;case 1:Bn||(Rs(u,i),h=u.stateNode,typeof h.componentWillUnmount=="function"&&Zw(u,i,h)),lo(a,i,u);break;case 21:lo(a,i,u);break;case 22:Bn=(h=Bn)||u.memoizedState!==null,lo(a,i,u),Bn=h;break;default:lo(a,i,u)}}function tE(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Oc(a)}catch(u){Zt(i,i.return,u)}}}function nE(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Oc(a)}catch(u){Zt(i,i.return,u)}}function p6(a){switch(a.tag){case 31:case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new Qw),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new Qw),i;default:throw Error(r(435,a.tag))}}function Vh(a,i){var u=p6(a);i.forEach(function(h){if(!u.has(h)){u.add(h);var y=E6.bind(null,a,h);h.then(y,y)}})}function Kr(a,i){var u=i.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],S=a,N=i,k=N;e:for(;k!==null;){switch(k.tag){case 27:if(si(k.type)){gn=k.stateNode,Zr=!1;break e}break;case 5:gn=k.stateNode,Zr=!1;break e;case 3:case 4:gn=k.stateNode.containerInfo,Zr=!0;break e}k=k.return}if(gn===null)throw Error(r(160));eE(S,N,y),gn=null,Zr=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)rE(i,a),i=i.sibling}var Ja=null;function rE(a,i){var u=a.alternate,h=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Kr(i,a),Yr(a),h&4&&(Xo(3,a,a.return),fd(3,a),Xo(5,a,a.return));break;case 1:Kr(i,a),Yr(a),h&512&&(Bn||u===null||Rs(u,u.return)),h&64&&io&&(a=a.updateQueue,a!==null&&(h=a.callbacks,h!==null&&(u=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=Ja;if(Kr(i,a),Yr(a),h&512&&(Bn||u===null||Rs(u,u.return)),h&4){var S=u!==null?u.memoizedState:null;if(h=a.memoizedState,u===null)if(h===null)if(a.stateNode===null){e:{h=a.type,u=a.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":S=y.getElementsByTagName("title")[0],(!S||S[Bt]||S[ze]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(h),y.head.insertBefore(S,y.querySelector("head > title"))),Sr(S,h,u),S[ze]=a,En(S),h=S;break e;case"link":var N=r2("link","href",y).get(h+(u.href||""));if(N){for(var k=0;k<N.length;k++)if(S=N[k],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(k,1);break t}}S=y.createElement(h),Sr(S,h,u),y.head.appendChild(S);break;case"meta":if(N=r2("meta","content",y).get(h+(u.content||""))){for(k=0;k<N.length;k++)if(S=N[k],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(k,1);break t}}S=y.createElement(h),Sr(S,h,u),y.head.appendChild(S);break;default:throw Error(r(468,h))}S[ze]=a,En(S),h=S}a.stateNode=h}else a2(y,a.type,a.stateNode);else a.stateNode=n2(y,h,a.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?a2(y,a.type,a.stateNode):n2(y,h,a.memoizedProps)):h===null&&a.stateNode!==null&&gy(a,a.memoizedProps,u.memoizedProps)}break;case 27:Kr(i,a),Yr(a),h&512&&(Bn||u===null||Rs(u,u.return)),u!==null&&h&4&&gy(a,a.memoizedProps,u.memoizedProps);break;case 5:if(Kr(i,a),Yr(a),h&512&&(Bn||u===null||Rs(u,u.return)),a.flags&32){y=a.stateNode;try{tc(y,"")}catch($e){Zt(a,a.return,$e)}}h&4&&a.stateNode!=null&&(y=a.memoizedProps,gy(a,y,u!==null?u.memoizedProps:y)),h&1024&&(xy=!0);break;case 6:if(Kr(i,a),Yr(a),h&4){if(a.stateNode===null)throw Error(r(162));h=a.memoizedProps,u=a.stateNode;try{u.nodeValue=h}catch($e){Zt(a,a.return,$e)}}break;case 3:if(rm=null,y=Ja,Ja=tm(i.containerInfo),Kr(i,a),Ja=y,Yr(a),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Oc(i.containerInfo)}catch($e){Zt(a,a.return,$e)}xy&&(xy=!1,aE(a));break;case 4:h=Ja,Ja=tm(a.stateNode.containerInfo),Kr(i,a),Yr(a),Ja=h;break;case 12:Kr(i,a),Yr(a);break;case 31:Kr(i,a),Yr(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Vh(a,h)));break;case 13:Kr(i,a),Yr(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&($h=ye()),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Vh(a,h)));break;case 22:y=a.memoizedState!==null;var H=u!==null&&u.memoizedState!==null,re=io,he=Bn;if(io=re||y,Bn=he||H,Kr(i,a),Bn=he,io=re,Yr(a),h&8192)e:for(i=a.stateNode,i._visibility=y?i._visibility&-2:i._visibility|1,y&&(u===null||H||io||Bn||fl(a)),u=null,i=a;;){if(i.tag===5||i.tag===26){if(u===null){H=u=i;try{if(S=H.stateNode,y)N=S.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{k=H.stateNode;var pe=H.memoizedProps.style,oe=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;k.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch($e){Zt(H,H.return,$e)}}}else if(i.tag===6){if(u===null){H=i;try{H.stateNode.nodeValue=y?"":H.memoizedProps}catch($e){Zt(H,H.return,$e)}}}else if(i.tag===18){if(u===null){H=i;try{var ue=H.stateNode;y?ZE(ue,!0):ZE(H.stateNode,!1)}catch($e){Zt(H,H.return,$e)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}h&4&&(h=a.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Vh(a,u))));break;case 19:Kr(i,a),Yr(a),h&4&&(h=a.updateQueue,h!==null&&(a.updateQueue=null,Vh(a,h)));break;case 30:break;case 21:break;default:Kr(i,a),Yr(a)}}function Yr(a){var i=a.flags;if(i&2){try{for(var u,h=a.return;h!==null;){if(Yw(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,S=vy(a);zh(a,S,y);break;case 5:var N=u.stateNode;u.flags&32&&(tc(N,""),u.flags&=-33);var k=vy(a);zh(a,k,N);break;case 3:case 4:var H=u.stateNode.containerInfo,re=vy(a);yy(a,re,H);break;default:throw Error(r(161))}}catch(he){Zt(a,a.return,he)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function aE(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;aE(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function co(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Xw(a,i.alternate,i),i=i.sibling}function fl(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:Xo(4,i,i.return),fl(i);break;case 1:Rs(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&Zw(i,i.return,u),fl(i);break;case 27:Cd(i.stateNode);case 26:case 5:Rs(i,i.return),fl(i);break;case 22:i.memoizedState===null&&fl(i);break;case 30:fl(i);break;default:fl(i)}a=a.sibling}}function uo(a,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var h=i.alternate,y=a,S=i,N=S.flags;switch(S.tag){case 0:case 11:case 15:uo(y,S,u),fd(4,S);break;case 1:if(uo(y,S,u),h=S,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(re){Zt(h,h.return,re)}if(h=S,y=h.updateQueue,y!==null){var k=h.stateNode;try{var H=y.shared.hiddenCallbacks;if(H!==null)for(y.shared.hiddenCallbacks=null,y=0;y<H.length;y++)IC(H[y],k)}catch(re){Zt(h,h.return,re)}}u&&N&64&&qw(S),hd(S,S.return);break;case 27:Ww(S);case 26:case 5:uo(y,S,u),u&&h===null&&N&4&&Kw(S),hd(S,S.return);break;case 12:uo(y,S,u);break;case 31:uo(y,S,u),u&&N&4&&tE(y,S);break;case 13:uo(y,S,u),u&&N&4&&nE(y,S);break;case 22:S.memoizedState===null&&uo(y,S,u),hd(S,S.return);break;case 30:break;default:uo(y,S,u)}i=i.sibling}}function by(a,i){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&Ju(u))}function Sy(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Ju(a))}function es(a,i,u,h){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)sE(a,i,u,h),i=i.sibling}function sE(a,i,u,h){var y=i.flags;switch(i.tag){case 0:case 11:case 15:es(a,i,u,h),y&2048&&fd(9,i);break;case 1:es(a,i,u,h);break;case 3:es(a,i,u,h),y&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&Ju(a)));break;case 12:if(y&2048){es(a,i,u,h),a=i.stateNode;try{var S=i.memoizedProps,N=S.id,k=S.onPostCommit;typeof k=="function"&&k(N,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(H){Zt(i,i.return,H)}}else es(a,i,u,h);break;case 31:es(a,i,u,h);break;case 13:es(a,i,u,h);break;case 23:break;case 22:S=i.stateNode,N=i.alternate,i.memoizedState!==null?S._visibility&2?es(a,i,u,h):md(a,i):S._visibility&2?es(a,i,u,h):(S._visibility|=2,Sc(a,i,u,h,(i.subtreeFlags&10256)!==0||!1)),y&2048&&by(N,i);break;case 24:es(a,i,u,h),y&2048&&Sy(i.alternate,i);break;default:es(a,i,u,h)}}function Sc(a,i,u,h,y){for(y=y&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var S=a,N=i,k=u,H=h,re=N.flags;switch(N.tag){case 0:case 11:case 15:Sc(S,N,k,H,y),fd(8,N);break;case 23:break;case 22:var he=N.stateNode;N.memoizedState!==null?he._visibility&2?Sc(S,N,k,H,y):md(S,N):(he._visibility|=2,Sc(S,N,k,H,y)),y&&re&2048&&by(N.alternate,N);break;case 24:Sc(S,N,k,H,y),y&&re&2048&&Sy(N.alternate,N);break;default:Sc(S,N,k,H,y)}i=i.sibling}}function md(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=a,h=i,y=h.flags;switch(h.tag){case 22:md(u,h),y&2048&&by(h.alternate,h);break;case 24:md(u,h),y&2048&&Sy(h.alternate,h);break;default:md(u,h)}i=i.sibling}}var pd=8192;function Cc(a,i,u){if(a.subtreeFlags&pd)for(a=a.child;a!==null;)oE(a,i,u),a=a.sibling}function oE(a,i,u){switch(a.tag){case 26:Cc(a,i,u),a.flags&pd&&a.memoizedState!==null&&tk(u,Ja,a.memoizedState,a.memoizedProps);break;case 5:Cc(a,i,u);break;case 3:case 4:var h=Ja;Ja=tm(a.stateNode.containerInfo),Cc(a,i,u),Ja=h;break;case 22:a.memoizedState===null&&(h=a.alternate,h!==null&&h.memoizedState!==null?(h=pd,pd=16777216,Cc(a,i,u),pd=h):Cc(a,i,u));break;default:Cc(a,i,u)}}function iE(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function gd(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var h=i[u];cr=h,cE(h,a)}iE(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)lE(a),a=a.sibling}function lE(a){switch(a.tag){case 0:case 11:case 15:gd(a),a.flags&2048&&Xo(9,a,a.return);break;case 3:gd(a);break;case 12:gd(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,Hh(a)):gd(a);break;default:gd(a)}}function Hh(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var h=i[u];cr=h,cE(h,a)}iE(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:Xo(8,i,i.return),Hh(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Hh(i));break;default:Hh(i)}a=a.sibling}}function cE(a,i){for(;cr!==null;){var u=cr;switch(u.tag){case 0:case 11:case 15:Xo(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Ju(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,cr=h;else e:for(u=a;cr!==null;){h=cr;var y=h.sibling,S=h.return;if(Jw(h),h===u){cr=null;break e}if(y!==null){y.return=S,cr=y;break e}cr=S}}}var g6={getCacheForType:function(a){var i=xr(Vn),u=i.data.get(a);return u===void 0&&(u=a(),i.data.set(a,u)),u},cacheSignal:function(){return xr(Vn).controller.signal}},v6=typeof WeakMap=="function"?WeakMap:Map,Ft=0,an=null,xt=null,Et=0,qt=0,la=null,Jo=!1,wc=!1,Cy=!1,fo=0,Tn=0,ei=0,hl=0,wy=0,ca=0,Ec=0,vd=null,Wr=null,Ey=!1,$h=0,uE=0,Bh=1/0,Gh=null,ti=null,er=0,ni=null,Rc=null,ho=0,Ry=0,Ty=null,dE=null,yd=0,jy=null;function ua(){return(Ft&2)!==0&&Et!==0?Et&-Et:I.T!==null?My():Le()}function fE(){if(ca===0)if((Et&536870912)===0||Dt){var a=Ss;Ss<<=1,(Ss&3932160)===0&&(Ss=262144),ca=a}else ca=536870912;return a=oa.current,a!==null&&(a.flags|=32),ca}function Qr(a,i,u){(a===an&&(qt===2||qt===9)||a.cancelPendingCommit!==null)&&(Tc(a,0),ri(a,Et,ca,!1)),Hr(a,u),((Ft&2)===0||a!==an)&&(a===an&&((Ft&2)===0&&(hl|=u),Tn===4&&ri(a,Et,ca,!1)),Ts(a))}function hE(a,i,u){if((Ft&6)!==0)throw Error(r(327));var h=!u&&(i&127)===0&&(i&a.expiredLanes)===0||gr(a,i),y=h?b6(a,i):Ny(a,i,!0),S=h;do{if(y===0){wc&&!h&&ri(a,i,0,!1);break}else{if(u=a.current.alternate,S&&!y6(u)){y=Ny(a,i,!1),S=!1;continue}if(y===2){if(S=i,a.errorRecoveryDisabledLanes&S)var N=0;else N=a.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var k=a;y=vd;var H=k.current.memoizedState.isDehydrated;if(H&&(Tc(k,N).flags|=256),N=Ny(k,N,!1),N!==2){if(Cy&&!H){k.errorRecoveryDisabledLanes|=S,hl|=S,y=4;break e}S=Wr,Wr=y,S!==null&&(Wr===null?Wr=S:Wr.push.apply(Wr,S))}y=N}if(S=!1,y!==2)continue}}if(y===1){Tc(a,0),ri(a,i,0,!0);break}e:{switch(h=a,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:ri(h,i,ca,!Jo);break e;case 2:Wr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(y=$h+300-ye(),10<y)){if(ri(h,i,ca,!Jo),Fn(h,0,!0)!==0)break e;ho=i,h.timeoutHandle=BE(mE.bind(null,h,u,Wr,Gh,Ey,i,ca,hl,Ec,Jo,S,"Throttled",-0,0),y);break e}mE(h,u,Wr,Gh,Ey,i,ca,hl,Ec,Jo,S,null,-0,0)}}break}while(!0);Ts(a)}function mE(a,i,u,h,y,S,N,k,H,re,he,pe,oe,ue){if(a.timeoutHandle=-1,pe=i.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qs},oE(i,S,pe);var $e=(S&62914560)===S?$h-ye():(S&4194048)===S?uE-ye():0;if($e=nk(pe,$e),$e!==null){ho=S,a.cancelPendingCommit=$e(CE.bind(null,a,i,S,u,h,y,N,k,H,he,pe,null,oe,ue)),ri(a,S,N,!re);return}}CE(a,i,S,u,h,y,N,k,H)}function y6(a){for(var i=a;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],S=y.getSnapshot;y=y.value;try{if(!aa(S(),y))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function ri(a,i,u,h){i&=~wy,i&=~hl,a.suspendedLanes|=i,a.pingedLanes&=~i,h&&(a.warmLanes|=i),h=a.expirationTimes;for(var y=i;0<y;){var S=31-wn(y),N=1<<S;h[S]=-1,y&=~N}u!==0&&Q(a,u,i)}function qh(){return(Ft&6)===0?(xd(0),!1):!0}function _y(){if(xt!==null){if(qt===0)var a=xt.return;else a=xt,to=al=null,Bv(a),gc=null,td=0,a=xt;for(;a!==null;)Gw(a.alternate,a),a=a.return;xt=null}}function Tc(a,i){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,U6(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),ho=0,_y(),an=a,xt=u=Js(a.current,null),Et=i,qt=0,la=null,Jo=!1,wc=gr(a,i),Cy=!1,Ec=ca=wy=hl=ei=Tn=0,Wr=vd=null,Ey=!1,(i&8)!==0&&(i|=i&32);var h=a.entangledLanes;if(h!==0)for(a=a.entanglements,h&=i;0<h;){var y=31-wn(h),S=1<<y;i|=a[y],h&=~S}return fo=i,hh(),u}function pE(a,i){dt=null,I.H=cd,i===pc||i===Sh?(i=DC(),qt=3):i===Ov?(i=DC(),qt=4):qt=i===oy?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,la=i,xt===null&&(Tn=1,Ih(a,ka(i,a.current)))}function gE(){var a=oa.current;return a===null?!0:(Et&4194048)===Et?Ua===null:(Et&62914560)===Et||(Et&536870912)!==0?a===Ua:!1}function vE(){var a=I.H;return I.H=cd,a===null?cd:a}function yE(){var a=I.A;return I.A=g6,a}function Zh(){Tn=4,Jo||(Et&4194048)!==Et&&oa.current!==null||(wc=!0),(ei&134217727)===0&&(hl&134217727)===0||an===null||ri(an,Et,ca,!1)}function Ny(a,i,u){var h=Ft;Ft|=2;var y=vE(),S=yE();(an!==a||Et!==i)&&(Gh=null,Tc(a,i)),i=!1;var N=Tn;e:do try{if(qt!==0&&xt!==null){var k=xt,H=la;switch(qt){case 8:_y(),N=6;break e;case 3:case 2:case 9:case 6:oa.current===null&&(i=!0);var re=qt;if(qt=0,la=null,jc(a,k,H,re),u&&wc){N=0;break e}break;default:re=qt,qt=0,la=null,jc(a,k,H,re)}}x6(),N=Tn;break}catch(he){pE(a,he)}while(!0);return i&&a.shellSuspendCounter++,to=al=null,Ft=h,I.H=y,I.A=S,xt===null&&(an=null,Et=0,hh()),N}function x6(){for(;xt!==null;)xE(xt)}function b6(a,i){var u=Ft;Ft|=2;var h=vE(),y=yE();an!==a||Et!==i?(Gh=null,Bh=ye()+500,Tc(a,i)):wc=gr(a,i);e:do try{if(qt!==0&&xt!==null){i=xt;var S=la;t:switch(qt){case 1:qt=0,la=null,jc(a,i,S,1);break;case 2:case 9:if(NC(S)){qt=0,la=null,bE(i);break}i=function(){qt!==2&&qt!==9||an!==a||(qt=7),Ts(a)},S.then(i,i);break e;case 3:qt=7;break e;case 4:qt=5;break e;case 7:NC(S)?(qt=0,la=null,bE(i)):(qt=0,la=null,jc(a,i,S,7));break;case 5:var N=null;switch(xt.tag){case 26:N=xt.memoizedState;case 5:case 27:var k=xt;if(N?s2(N):k.stateNode.complete){qt=0,la=null;var H=k.sibling;if(H!==null)xt=H;else{var re=k.return;re!==null?(xt=re,Kh(re)):xt=null}break t}}qt=0,la=null,jc(a,i,S,5);break;case 6:qt=0,la=null,jc(a,i,S,6);break;case 8:_y(),Tn=6;break e;default:throw Error(r(462))}}S6();break}catch(he){pE(a,he)}while(!0);return to=al=null,I.H=h,I.A=y,Ft=u,xt!==null?0:(an=null,Et=0,hh(),Tn)}function S6(){for(;xt!==null&&!fe();)xE(xt)}function xE(a){var i=$w(a.alternate,a,fo);a.memoizedProps=a.pendingProps,i===null?Kh(a):xt=i}function bE(a){var i=a,u=i.alternate;switch(i.tag){case 15:case 0:i=Pw(u,i,i.pendingProps,i.type,void 0,Et);break;case 11:i=Pw(u,i,i.pendingProps,i.type.render,i.ref,Et);break;case 5:Bv(i);default:Gw(u,i),i=xt=yC(i,fo),i=$w(u,i,fo)}a.memoizedProps=a.pendingProps,i===null?Kh(a):xt=i}function jc(a,i,u,h){to=al=null,Bv(i),gc=null,td=0;var y=i.return;try{if(c6(a,y,i,u,Et)){Tn=1,Ih(a,ka(u,a.current)),xt=null;return}}catch(S){if(y!==null)throw xt=y,S;Tn=1,Ih(a,ka(u,a.current)),xt=null;return}i.flags&32768?(Dt||h===1?a=!0:wc||(Et&536870912)!==0?a=!1:(Jo=a=!0,(h===2||h===9||h===3||h===6)&&(h=oa.current,h!==null&&h.tag===13&&(h.flags|=16384))),SE(i,a)):Kh(i)}function Kh(a){var i=a;do{if((i.flags&32768)!==0){SE(i,Jo);return}a=i.return;var u=f6(i.alternate,i,fo);if(u!==null){xt=u;return}if(i=i.sibling,i!==null){xt=i;return}xt=i=a}while(i!==null);Tn===0&&(Tn=5)}function SE(a,i){do{var u=h6(a.alternate,a);if(u!==null){u.flags&=32767,xt=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(a=a.sibling,a!==null)){xt=a;return}xt=a=u}while(a!==null);Tn=6,xt=null}function CE(a,i,u,h,y,S,N,k,H){a.cancelPendingCommit=null;do Yh();while(er!==0);if((Ft&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(S=i.lanes|i.childLanes,S|=vv,U(a,u,S,N,k,H),a===an&&(xt=an=null,Et=0),Rc=i,ni=a,ho=u,Ry=S,Ty=y,dE=h,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,R6(ot,function(){return jE(),null})):(a.callbackNode=null,a.callbackPriority=0),h=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||h){h=I.T,I.T=null,y=B.p,B.p=2,N=Ft,Ft|=4;try{m6(a,i,u)}finally{Ft=N,B.p=y,I.T=h}}er=1,wE(),EE(),RE()}}function wE(){if(er===1){er=0;var a=ni,i=Rc,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=I.T,I.T=null;var h=B.p;B.p=2;var y=Ft;Ft|=4;try{rE(i,a);var S=Vy,N=cC(a.containerInfo),k=S.focusedElem,H=S.selectionRange;if(N!==k&&k&&k.ownerDocument&&lC(k.ownerDocument.documentElement,k)){if(H!==null&&fv(k)){var re=H.start,he=H.end;if(he===void 0&&(he=re),"selectionStart"in k)k.selectionStart=re,k.selectionEnd=Math.min(he,k.value.length);else{var pe=k.ownerDocument||document,oe=pe&&pe.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),$e=k.textContent.length,tt=Math.min(H.start,$e),Xt=H.end===void 0?tt:Math.min(H.end,$e);!ue.extend&&tt>Xt&&(N=Xt,Xt=tt,tt=N);var X=iC(k,tt),q=iC(k,Xt);if(X&&q&&(ue.rangeCount!==1||ue.anchorNode!==X.node||ue.anchorOffset!==X.offset||ue.focusNode!==q.node||ue.focusOffset!==q.offset)){var ne=pe.createRange();ne.setStart(X.node,X.offset),ue.removeAllRanges(),tt>Xt?(ue.addRange(ne),ue.extend(q.node,q.offset)):(ne.setEnd(q.node,q.offset),ue.addRange(ne))}}}}for(pe=[],ue=k;ue=ue.parentNode;)ue.nodeType===1&&pe.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<pe.length;k++){var me=pe[k];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}im=!!zy,Vy=zy=null}finally{Ft=y,B.p=h,I.T=u}}a.current=i,er=2}}function EE(){if(er===2){er=0;var a=ni,i=Rc,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=I.T,I.T=null;var h=B.p;B.p=2;var y=Ft;Ft|=4;try{Xw(a,i.alternate,i)}finally{Ft=y,B.p=h,I.T=u}}er=3}}function RE(){if(er===4||er===3){er=0,je();var a=ni,i=Rc,u=ho,h=dE;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?er=5:(er=0,Rc=ni=null,TE(a,a.pendingLanes));var y=a.pendingLanes;if(y===0&&(ti=null),Fe(u),i=i.stateNode,Cn&&typeof Cn.onCommitFiberRoot=="function")try{Cn.onCommitFiberRoot(Mn,i,void 0,(i.current.flags&128)===128)}catch{}if(h!==null){i=I.T,y=B.p,B.p=2,I.T=null;try{for(var S=a.onRecoverableError,N=0;N<h.length;N++){var k=h[N];S(k.value,{componentStack:k.stack})}}finally{I.T=i,B.p=y}}(ho&3)!==0&&Yh(),Ts(a),y=a.pendingLanes,(u&261930)!==0&&(y&42)!==0?a===jy?yd++:(yd=0,jy=a):yd=0,xd(0)}}function TE(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,Ju(i)))}function Yh(){return wE(),EE(),RE(),jE()}function jE(){if(er!==5)return!1;var a=ni,i=Ry;Ry=0;var u=Fe(ho),h=I.T,y=B.p;try{B.p=32>u?32:u,I.T=null,u=Ty,Ty=null;var S=ni,N=ho;if(er=0,Rc=ni=null,ho=0,(Ft&6)!==0)throw Error(r(331));var k=Ft;if(Ft|=4,lE(S.current),sE(S,S.current,N,u),Ft=k,xd(0,!1),Cn&&typeof Cn.onPostCommitFiberRoot=="function")try{Cn.onPostCommitFiberRoot(Mn,S)}catch{}return!0}finally{B.p=y,I.T=h,TE(a,i)}}function _E(a,i,u){i=ka(u,i),i=sy(a.stateNode,i,2),a=Yo(a,i,2),a!==null&&(Hr(a,2),Ts(a))}function Zt(a,i,u){if(a.tag===3)_E(a,a,u);else for(;i!==null;){if(i.tag===3){_E(i,a,u);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ti===null||!ti.has(h))){a=ka(u,a),u=Nw(2),h=Yo(i,u,2),h!==null&&(Aw(u,h,i,a),Hr(h,2),Ts(h));break}}i=i.return}}function Ay(a,i,u){var h=a.pingCache;if(h===null){h=a.pingCache=new v6;var y=new Set;h.set(i,y)}else y=h.get(i),y===void 0&&(y=new Set,h.set(i,y));y.has(u)||(Cy=!0,y.add(u),a=C6.bind(null,a,i,u),i.then(a,a))}function C6(a,i,u){var h=a.pingCache;h!==null&&h.delete(i),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,an===a&&(Et&u)===u&&(Tn===4||Tn===3&&(Et&62914560)===Et&&300>ye()-$h?(Ft&2)===0&&Tc(a,0):wy|=u,Ec===Et&&(Ec=0)),Ts(a)}function NE(a,i){i===0&&(i=kn()),a=tl(a,i),a!==null&&(Hr(a,i),Ts(a))}function w6(a){var i=a.memoizedState,u=0;i!==null&&(u=i.retryLane),NE(a,u)}function E6(a,i){var u=0;switch(a.tag){case 31:case 13:var h=a.stateNode,y=a.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=a.stateNode;break;case 22:h=a.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(i),NE(a,u)}function R6(a,i){return $(a,i)}var Wh=null,_c=null,Dy=!1,Qh=!1,Oy=!1,ai=0;function Ts(a){a!==_c&&a.next===null&&(_c===null?Wh=_c=a:_c=_c.next=a),Qh=!0,Dy||(Dy=!0,j6())}function xd(a,i){if(!Oy&&Qh){Oy=!0;do for(var u=!1,h=Wh;h!==null;){if(a!==0){var y=h.pendingLanes;if(y===0)var S=0;else{var N=h.suspendedLanes,k=h.pingedLanes;S=(1<<31-wn(42|a)+1)-1,S&=y&~(N&~k),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,ME(h,S))}else S=Et,S=Fn(h,h===an?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||gr(h,S)||(u=!0,ME(h,S));h=h.next}while(u);Oy=!1}}function T6(){AE()}function AE(){Qh=Dy=!1;var a=0;ai!==0&&P6()&&(a=ai);for(var i=ye(),u=null,h=Wh;h!==null;){var y=h.next,S=DE(h,i);S===0?(h.next=null,u===null?Wh=y:u.next=y,y===null&&(_c=u)):(u=h,(a!==0||(S&3)!==0)&&(Qh=!0)),h=y}er!==0&&er!==5||xd(a),ai!==0&&(ai=0)}function DE(a,i){for(var u=a.suspendedLanes,h=a.pingedLanes,y=a.expirationTimes,S=a.pendingLanes&-62914561;0<S;){var N=31-wn(S),k=1<<N,H=y[N];H===-1?((k&u)===0||(k&h)!==0)&&(y[N]=Xn(k,i)):H<=i&&(a.expiredLanes|=k),S&=~k}if(i=an,u=Et,u=Fn(a,a===i?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h=a.callbackNode,u===0||a===i&&(qt===2||qt===9)||a.cancelPendingCommit!==null)return h!==null&&h!==null&&te(h),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||gr(a,u)){if(i=u&-u,i===a.callbackPriority)return i;switch(h!==null&&te(h),Fe(u)){case 2:case 8:u=st;break;case 32:u=ot;break;case 268435456:u=_a;break;default:u=ot}return h=OE.bind(null,a),u=$(u,h),a.callbackPriority=i,a.callbackNode=u,i}return h!==null&&h!==null&&te(h),a.callbackPriority=2,a.callbackNode=null,2}function OE(a,i){if(er!==0&&er!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(Yh()&&a.callbackNode!==u)return null;var h=Et;return h=Fn(a,a===an?h:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),h===0?null:(hE(a,h,i),DE(a,ye()),a.callbackNode!=null&&a.callbackNode===u?OE.bind(null,a):null)}function ME(a,i){if(Yh())return null;hE(a,i,!0)}function j6(){F6(function(){(Ft&6)!==0?$(Ye,T6):AE()})}function My(){if(ai===0){var a=hc;a===0&&(a=Zs,Zs<<=1,(Zs&261888)===0&&(Zs=256)),ai=a}return ai}function kE(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:sh(""+a)}function IE(a,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,a.id&&u.setAttribute("form",a.id),i.parentNode.insertBefore(u,i),a=new FormData(a),u.parentNode.removeChild(u),a}function _6(a,i,u,h,y){if(i==="submit"&&u&&u.stateNode===y){var S=kE((y[Ge]||null).action),N=h.submitter;N&&(i=(i=N[Ge]||null)?kE(i.formAction):N.getAttribute("formAction"),i!==null&&(S=i,N=null));var k=new ch("action","action",null,h,y);a.push({event:k,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ai!==0){var H=N?IE(y,N):new FormData(y);Jv(u,{pending:!0,data:H,method:y.method,action:S},null,H)}}else typeof S=="function"&&(k.preventDefault(),H=N?IE(y,N):new FormData(y),Jv(u,{pending:!0,data:H,method:y.method,action:S},S,H))},currentTarget:y}]})}}for(var ky=0;ky<gv.length;ky++){var Iy=gv[ky],N6=Iy.toLowerCase(),A6=Iy[0].toUpperCase()+Iy.slice(1);Xa(N6,"on"+A6)}Xa(fC,"onAnimationEnd"),Xa(hC,"onAnimationIteration"),Xa(mC,"onAnimationStart"),Xa("dblclick","onDoubleClick"),Xa("focusin","onFocus"),Xa("focusout","onBlur"),Xa(qM,"onTransitionRun"),Xa(ZM,"onTransitionStart"),Xa(KM,"onTransitionCancel"),Xa(pC,"onTransitionEnd"),Qa("onMouseEnter",["mouseout","mouseover"]),Qa("onMouseLeave",["mouseout","mouseover"]),Qa("onPointerEnter",["pointerout","pointerover"]),Qa("onPointerLeave",["pointerout","pointerover"]),Aa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Aa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Aa("onBeforeInput",["compositionend","keypress","textInput","paste"]),Aa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Aa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Aa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bd="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(" "),D6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bd));function LE(a,i){i=(i&4)!==0;for(var u=0;u<a.length;u++){var h=a[u],y=h.event;h=h.listeners;e:{var S=void 0;if(i)for(var N=h.length-1;0<=N;N--){var k=h[N],H=k.instance,re=k.currentTarget;if(k=k.listener,H!==S&&y.isPropagationStopped())break e;S=k,y.currentTarget=re;try{S(y)}catch(he){fh(he)}y.currentTarget=null,S=H}else for(N=0;N<h.length;N++){if(k=h[N],H=k.instance,re=k.currentTarget,k=k.listener,H!==S&&y.isPropagationStopped())break e;S=k,y.currentTarget=re;try{S(y)}catch(he){fh(he)}y.currentTarget=null,S=H}}}}function bt(a,i){var u=i[ct];u===void 0&&(u=i[ct]=new Set);var h=a+"__bubble";u.has(h)||(PE(i,a,2,!1),u.add(h))}function Ly(a,i,u){var h=0;i&&(h|=4),PE(u,a,h,i)}var Xh="_reactListening"+Math.random().toString(36).slice(2);function Py(a){if(!a[Xh]){a[Xh]=!0,Vo.forEach(function(u){u!=="selectionchange"&&(D6.has(u)||Ly(u,!1,a),Ly(u,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[Xh]||(i[Xh]=!0,Ly("selectionchange",!1,i))}}function PE(a,i,u,h){switch(f2(i)){case 2:var y=sk;break;case 8:y=ok;break;default:y=Xy}u=y.bind(null,i,u,a),y=void 0,!rv||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(y=!0),h?y!==void 0?a.addEventListener(i,u,{capture:!0,passive:y}):a.addEventListener(i,u,!0):y!==void 0?a.addEventListener(i,u,{passive:y}):a.addEventListener(i,u,!1)}function Uy(a,i,u,h,y){var S=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var N=h.tag;if(N===3||N===4){var k=h.stateNode.containerInfo;if(k===y)break;if(N===4)for(N=h.return;N!==null;){var H=N.tag;if((H===3||H===4)&&N.stateNode.containerInfo===y)return;N=N.return}for(;k!==null;){if(N=$r(k),N===null)return;if(H=N.tag,H===5||H===6||H===26||H===27){h=S=N;continue e}k=k.parentNode}}h=h.return}HS(function(){var re=S,he=tv(u),pe=[];e:{var oe=gC.get(a);if(oe!==void 0){var ue=ch,$e=a;switch(a){case"keypress":if(ih(u)===0)break e;case"keydown":case"keyup":ue=EM;break;case"focusin":$e="focus",ue=iv;break;case"focusout":$e="blur",ue=iv;break;case"beforeblur":case"afterblur":ue=iv;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=GS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=fM;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=jM;break;case fC:case hC:case mC:ue=pM;break;case pC:ue=NM;break;case"scroll":case"scrollend":ue=uM;break;case"wheel":ue=DM;break;case"copy":case"cut":case"paste":ue=vM;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=ZS;break;case"toggle":case"beforetoggle":ue=MM}var tt=(i&4)!==0,Xt=!tt&&(a==="scroll"||a==="scrollend"),X=tt?oe!==null?oe+"Capture":null:oe;tt=[];for(var q=re,ne;q!==null;){var me=q;if(ne=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||ne===null||X===null||(me=Hu(q,X),me!=null&&tt.push(Sd(q,me,ne))),Xt)break;q=q.return}0<tt.length&&(oe=new ue(oe,$e,null,u,he),pe.push({event:oe,listeners:tt}))}}if((i&7)===0){e:{if(oe=a==="mouseover"||a==="pointerover",ue=a==="mouseout"||a==="pointerout",oe&&u!==ev&&($e=u.relatedTarget||u.fromElement)&&($r($e)||$e[qe]))break e;if((ue||oe)&&(oe=he.window===he?he:(oe=he.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?($e=u.relatedTarget||u.toElement,ue=re,$e=$e?$r($e):null,$e!==null&&(Xt=l($e),tt=$e.tag,$e!==Xt||tt!==5&&tt!==27&&tt!==6)&&($e=null)):(ue=null,$e=re),ue!==$e)){if(tt=GS,me="onMouseLeave",X="onMouseEnter",q="mouse",(a==="pointerout"||a==="pointerover")&&(tt=ZS,me="onPointerLeave",X="onPointerEnter",q="pointer"),Xt=ue==null?oe:Br(ue),ne=$e==null?oe:Br($e),oe=new tt(me,q+"leave",ue,u,he),oe.target=Xt,oe.relatedTarget=ne,me=null,$r(he)===re&&(tt=new tt(X,q+"enter",$e,u,he),tt.target=ne,tt.relatedTarget=Xt,me=tt),Xt=me,ue&&$e)t:{for(tt=O6,X=ue,q=$e,ne=0,me=X;me;me=tt(me))ne++;me=0;for(var et=q;et;et=tt(et))me++;for(;0<ne-me;)X=tt(X),ne--;for(;0<me-ne;)q=tt(q),me--;for(;ne--;){if(X===q||q!==null&&X===q.alternate){tt=X;break t}X=tt(X),q=tt(q)}tt=null}else tt=null;ue!==null&&UE(pe,oe,ue,tt,!1),$e!==null&&Xt!==null&&UE(pe,Xt,$e,tt,!0)}}e:{if(oe=re?Br(re):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var Pt=tC;else if(JS(oe))if(nC)Pt=$M;else{Pt=VM;var Qe=zM}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?re&&Jg(re.elementType)&&(Pt=tC):Pt=HM;if(Pt&&(Pt=Pt(a,re))){eC(pe,Pt,u,he);break e}Qe&&Qe(a,oe,re),a==="focusout"&&re&&oe.type==="number"&&re.memoizedProps.value!=null&&Xg(oe,"number",oe.value)}switch(Qe=re?Br(re):window,a){case"focusin":(JS(Qe)||Qe.contentEditable==="true")&&(sc=Qe,hv=re,Wu=null);break;case"focusout":Wu=hv=sc=null;break;case"mousedown":mv=!0;break;case"contextmenu":case"mouseup":case"dragend":mv=!1,uC(pe,u,he);break;case"selectionchange":if(GM)break;case"keydown":case"keyup":uC(pe,u,he)}var ht;if(cv)e:{switch(a){case"compositionstart":var Rt="onCompositionStart";break e;case"compositionend":Rt="onCompositionEnd";break e;case"compositionupdate":Rt="onCompositionUpdate";break e}Rt=void 0}else ac?QS(a,u)&&(Rt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(Rt="onCompositionStart");Rt&&(KS&&u.locale!=="ko"&&(ac||Rt!=="onCompositionStart"?Rt==="onCompositionEnd"&&ac&&(ht=$S()):(Ho=he,av="value"in Ho?Ho.value:Ho.textContent,ac=!0)),Qe=Jh(re,Rt),0<Qe.length&&(Rt=new qS(Rt,a,null,u,he),pe.push({event:Rt,listeners:Qe}),ht?Rt.data=ht:(ht=XS(u),ht!==null&&(Rt.data=ht)))),(ht=IM?LM(a,u):PM(a,u))&&(Rt=Jh(re,"onBeforeInput"),0<Rt.length&&(Qe=new qS("onBeforeInput","beforeinput",null,u,he),pe.push({event:Qe,listeners:Rt}),Qe.data=ht)),_6(pe,a,re,u,he)}LE(pe,i)})}function Sd(a,i,u){return{instance:a,listener:i,currentTarget:u}}function Jh(a,i){for(var u=i+"Capture",h=[];a!==null;){var y=a,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Hu(a,u),y!=null&&h.unshift(Sd(a,y,S)),y=Hu(a,i),y!=null&&h.push(Sd(a,y,S))),a.tag===3)return h;a=a.return}return[]}function O6(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function UE(a,i,u,h,y){for(var S=i._reactName,N=[];u!==null&&u!==h;){var k=u,H=k.alternate,re=k.stateNode;if(k=k.tag,H!==null&&H===h)break;k!==5&&k!==26&&k!==27||re===null||(H=re,y?(re=Hu(u,S),re!=null&&N.unshift(Sd(u,re,H))):y||(re=Hu(u,S),re!=null&&N.push(Sd(u,re,H)))),u=u.return}N.length!==0&&a.push({event:i,listeners:N})}var M6=/\r\n?/g,k6=/\u0000|\uFFFD/g;function FE(a){return(typeof a=="string"?a:""+a).replace(M6,`
|
|
49
|
-
`).replace(k6,"")}function zE(a,i){return i=FE(i),FE(a)===i}function Qt(a,i,u,h,y,S){switch(u){case"children":typeof h=="string"?i==="body"||i==="textarea"&&h===""||tc(a,h):(typeof h=="number"||typeof h=="bigint")&&i!=="body"&&tc(a,""+h);break;case"className":Ws(a,"class",h);break;case"tabIndex":Ws(a,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Ws(a,u,h);break;case"style":zS(a,h,S);break;case"data":if(i!=="object"){Ws(a,"data",h);break}case"src":case"href":if(h===""&&(i!=="a"||u!=="href")){a.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=sh(""+h),a.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){a.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(i!=="input"&&Qt(a,i,"name",y.name,y,null),Qt(a,i,"formEncType",y.formEncType,y,null),Qt(a,i,"formMethod",y.formMethod,y,null),Qt(a,i,"formTarget",y.formTarget,y,null)):(Qt(a,i,"encType",y.encType,y,null),Qt(a,i,"method",y.method,y,null),Qt(a,i,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){a.removeAttribute(u);break}h=sh(""+h),a.setAttribute(u,h);break;case"onClick":h!=null&&(a.onclick=Qs);break;case"onScroll":h!=null&&bt("scroll",a);break;case"onScrollEnd":h!=null&&bt("scrollend",a);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"multiple":a.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":a.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){a.removeAttribute("xlink:href");break}u=sh(""+h),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""+h):a.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,""):a.removeAttribute(u);break;case"capture":case"download":h===!0?a.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?a.setAttribute(u,h):a.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?a.setAttribute(u,h):a.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?a.removeAttribute(u):a.setAttribute(u,h);break;case"popover":bt("beforetoggle",a),bt("toggle",a),pn(a,"popover",h);break;case"xlinkActuate":Da(a,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Da(a,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Da(a,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Da(a,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Da(a,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Da(a,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Da(a,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Da(a,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Da(a,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":pn(a,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=lM.get(u)||u,pn(a,u,h))}}function Fy(a,i,u,h,y,S){switch(u){case"style":zS(a,h,S);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));a.innerHTML=u}}break;case"children":typeof h=="string"?tc(a,h):(typeof h=="number"||typeof h=="bigint")&&tc(a,""+h);break;case"onScroll":h!=null&&bt("scroll",a);break;case"onScrollEnd":h!=null&&bt("scrollend",a);break;case"onClick":h!=null&&(a.onclick=Qs);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cs.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),i=u.slice(2,y?u.length-7:void 0),S=a[Ge]||null,S=S!=null?S[u]:null,typeof S=="function"&&a.removeEventListener(i,S,y),typeof h=="function")){typeof S!="function"&&S!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(i,h,y);break e}u in a?a[u]=h:h===!0?a.setAttribute(u,""):pn(a,u,h)}}}function Sr(a,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":bt("error",a),bt("load",a);var h=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var N=u[S];if(N!=null)switch(S){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Qt(a,i,S,N,u,null)}}y&&Qt(a,i,"srcSet",u.srcSet,u,null),h&&Qt(a,i,"src",u.src,u,null);return;case"input":bt("invalid",a);var k=S=N=y=null,H=null,re=null;for(h in u)if(u.hasOwnProperty(h)){var he=u[h];if(he!=null)switch(h){case"name":y=he;break;case"type":N=he;break;case"checked":H=he;break;case"defaultChecked":re=he;break;case"value":S=he;break;case"defaultValue":k=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,i));break;default:Qt(a,i,h,he,u,null)}}LS(a,S,k,H,re,N,y,!1);return;case"select":bt("invalid",a),h=N=S=null;for(y in u)if(u.hasOwnProperty(y)&&(k=u[y],k!=null))switch(y){case"value":S=k;break;case"defaultValue":N=k;break;case"multiple":h=k;default:Qt(a,i,y,k,u,null)}i=S,u=N,a.multiple=!!h,i!=null?ec(a,!!h,i,!1):u!=null&&ec(a,!!h,u,!0);return;case"textarea":bt("invalid",a),S=y=h=null;for(N in u)if(u.hasOwnProperty(N)&&(k=u[N],k!=null))switch(N){case"value":h=k;break;case"defaultValue":y=k;break;case"children":S=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:Qt(a,i,N,k,u,null)}US(a,h,y,S);return;case"option":for(H in u)if(u.hasOwnProperty(H)&&(h=u[H],h!=null))switch(H){case"selected":a.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Qt(a,i,H,h,u,null)}return;case"dialog":bt("beforetoggle",a),bt("toggle",a),bt("cancel",a),bt("close",a);break;case"iframe":case"object":bt("load",a);break;case"video":case"audio":for(h=0;h<bd.length;h++)bt(bd[h],a);break;case"image":bt("error",a),bt("load",a);break;case"details":bt("toggle",a);break;case"embed":case"source":case"link":bt("error",a),bt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in u)if(u.hasOwnProperty(re)&&(h=u[re],h!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Qt(a,i,re,h,u,null)}return;default:if(Jg(i)){for(he in u)u.hasOwnProperty(he)&&(h=u[he],h!==void 0&&Fy(a,i,he,h,u,void 0));return}}for(k in u)u.hasOwnProperty(k)&&(h=u[k],h!=null&&Qt(a,i,k,h,u,null))}function I6(a,i,u,h){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,N=null,k=null,H=null,re=null,he=null;for(ue in u){var pe=u[ue];if(u.hasOwnProperty(ue)&&pe!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":H=pe;default:h.hasOwnProperty(ue)||Qt(a,i,ue,null,h,pe)}}for(var oe in h){var ue=h[oe];if(pe=u[oe],h.hasOwnProperty(oe)&&(ue!=null||pe!=null))switch(oe){case"type":S=ue;break;case"name":y=ue;break;case"checked":re=ue;break;case"defaultChecked":he=ue;break;case"value":N=ue;break;case"defaultValue":k=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,i));break;default:ue!==pe&&Qt(a,i,oe,ue,h,pe)}}Qg(a,N,k,H,re,he,S,y);return;case"select":ue=N=k=oe=null;for(S in u)if(H=u[S],u.hasOwnProperty(S)&&H!=null)switch(S){case"value":break;case"multiple":ue=H;default:h.hasOwnProperty(S)||Qt(a,i,S,null,h,H)}for(y in h)if(S=h[y],H=u[y],h.hasOwnProperty(y)&&(S!=null||H!=null))switch(y){case"value":oe=S;break;case"defaultValue":k=S;break;case"multiple":N=S;default:S!==H&&Qt(a,i,y,S,h,H)}i=k,u=N,h=ue,oe!=null?ec(a,!!u,oe,!1):!!h!=!!u&&(i!=null?ec(a,!!u,i,!0):ec(a,!!u,u?[]:"",!1));return;case"textarea":ue=oe=null;for(k in u)if(y=u[k],u.hasOwnProperty(k)&&y!=null&&!h.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Qt(a,i,k,null,h,y)}for(N in h)if(y=h[N],S=u[N],h.hasOwnProperty(N)&&(y!=null||S!=null))switch(N){case"value":oe=y;break;case"defaultValue":ue=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&Qt(a,i,N,y,h,S)}PS(a,oe,ue);return;case"option":for(var $e in u)if(oe=u[$e],u.hasOwnProperty($e)&&oe!=null&&!h.hasOwnProperty($e))switch($e){case"selected":a.selected=!1;break;default:Qt(a,i,$e,null,h,oe)}for(H in h)if(oe=h[H],ue=u[H],h.hasOwnProperty(H)&&oe!==ue&&(oe!=null||ue!=null))switch(H){case"selected":a.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:Qt(a,i,H,oe,h,ue)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var tt in u)oe=u[tt],u.hasOwnProperty(tt)&&oe!=null&&!h.hasOwnProperty(tt)&&Qt(a,i,tt,null,h,oe);for(re in h)if(oe=h[re],ue=u[re],h.hasOwnProperty(re)&&oe!==ue&&(oe!=null||ue!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,i));break;default:Qt(a,i,re,oe,h,ue)}return;default:if(Jg(i)){for(var Xt in u)oe=u[Xt],u.hasOwnProperty(Xt)&&oe!==void 0&&!h.hasOwnProperty(Xt)&&Fy(a,i,Xt,void 0,h,oe);for(he in h)oe=h[he],ue=u[he],!h.hasOwnProperty(he)||oe===ue||oe===void 0&&ue===void 0||Fy(a,i,he,oe,h,ue);return}}for(var X in u)oe=u[X],u.hasOwnProperty(X)&&oe!=null&&!h.hasOwnProperty(X)&&Qt(a,i,X,null,h,oe);for(pe in h)oe=h[pe],ue=u[pe],!h.hasOwnProperty(pe)||oe===ue||oe==null&&ue==null||Qt(a,i,pe,oe,h,ue)}function VE(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function L6(){if(typeof performance.getEntriesByType=="function"){for(var a=0,i=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var y=u[h],S=y.transferSize,N=y.initiatorType,k=y.duration;if(S&&k&&VE(N)){for(N=0,k=y.responseEnd,h+=1;h<u.length;h++){var H=u[h],re=H.startTime;if(re>k)break;var he=H.transferSize,pe=H.initiatorType;he&&VE(pe)&&(H=H.responseEnd,N+=he*(H<k?1:(k-re)/(H-re)))}if(--h,i+=8*(S+N)/(y.duration/1e3),a++,10<a)break}}if(0<a)return i/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var zy=null,Vy=null;function em(a){return a.nodeType===9?a:a.ownerDocument}function HE(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $E(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function Hy(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var $y=null;function P6(){var a=window.event;return a&&a.type==="popstate"?a===$y?!1:($y=a,!0):($y=null,!1)}var BE=typeof setTimeout=="function"?setTimeout:void 0,U6=typeof clearTimeout=="function"?clearTimeout:void 0,GE=typeof Promise=="function"?Promise:void 0,F6=typeof queueMicrotask=="function"?queueMicrotask:typeof GE<"u"?function(a){return GE.resolve(null).then(a).catch(z6)}:BE;function z6(a){setTimeout(function(){throw a})}function si(a){return a==="head"}function qE(a,i){var u=i,h=0;do{var y=u.nextSibling;if(a.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(h===0){a.removeChild(y),Oc(i);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Cd(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,Cd(u);for(var S=u.firstChild;S;){var N=S.nextSibling,k=S.nodeName;S[Bt]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=N}}else u==="body"&&Cd(a.ownerDocument.body);u=y}while(u);Oc(i)}function ZE(a,i){var u=a;a=0;do{var h=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(a===0)break;a--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||a++;u=h}while(u)}function By(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":By(u),Gt(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function V6(a,i,u,h){for(;a.nodeType===1;){var y=u;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!h&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(h){if(!a[Bt])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(S=a.getAttribute("rel"),S==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(S!==y.rel||a.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||a.getAttribute("title")!==(y.title==null?null:y.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(S=a.getAttribute("src"),(S!==(y.src==null?null:y.src)||a.getAttribute("type")!==(y.type==null?null:y.type)||a.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&a.getAttribute("name")===S)return a}else return a;if(a=Fa(a.nextSibling),a===null)break}return null}function H6(a,i,u){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=Fa(a.nextSibling),a===null))return null;return a}function KE(a,i){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!i||(a=Fa(a.nextSibling),a===null))return null;return a}function Gy(a){return a.data==="$?"||a.data==="$~"}function qy(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function $6(a,i){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=i;else if(a.data!=="$?"||u.readyState!=="loading")i();else{var h=function(){i(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),a._reactRetry=h}}function Fa(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return a}var Zy=null;function YE(a){a=a.nextSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(i===0)return Fa(a.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}a=a.nextSibling}return null}function WE(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return a;i--}else u!=="/$"&&u!=="/&"||i++}a=a.previousSibling}return null}function QE(a,i,u){switch(i=em(u),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Cd(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);Gt(a)}var za=new Map,XE=new Set;function tm(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var mo=B.d;B.d={f:B6,r:G6,D:q6,C:Z6,L:K6,m:Y6,X:Q6,S:W6,M:X6};function B6(){var a=mo.f(),i=qh();return a||i}function G6(a){var i=Na(a);i!==null&&i.tag===5&&i.type==="form"?pw(i):mo.r(a)}var Nc=typeof document>"u"?null:document;function JE(a,i,u){var h=Nc;if(h&&typeof i=="string"&&i){var y=Oa(i);y='link[rel="'+a+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),XE.has(y)||(XE.add(y),a={rel:a,crossOrigin:u,href:i},h.querySelector(y)===null&&(i=h.createElement("link"),Sr(i,"link",a),En(i),h.head.appendChild(i)))}}function q6(a){mo.D(a),JE("dns-prefetch",a,null)}function Z6(a,i){mo.C(a,i),JE("preconnect",a,i)}function K6(a,i,u){mo.L(a,i,u);var h=Nc;if(h&&a&&i){var y='link[rel="preload"][as="'+Oa(i)+'"]';i==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+Oa(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+Oa(u.imageSizes)+'"]')):y+='[href="'+Oa(a)+'"]';var S=y;switch(i){case"style":S=Ac(a);break;case"script":S=Dc(a)}za.has(S)||(a=v({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:a,as:i},u),za.set(S,a),h.querySelector(y)!==null||i==="style"&&h.querySelector(wd(S))||i==="script"&&h.querySelector(Ed(S))||(i=h.createElement("link"),Sr(i,"link",a),En(i),h.head.appendChild(i)))}}function Y6(a,i){mo.m(a,i);var u=Nc;if(u&&a){var h=i&&typeof i.as=="string"?i.as:"script",y='link[rel="modulepreload"][as="'+Oa(h)+'"][href="'+Oa(a)+'"]',S=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=Dc(a)}if(!za.has(S)&&(a=v({rel:"modulepreload",href:a},i),za.set(S,a),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Ed(S)))return}h=u.createElement("link"),Sr(h,"link",a),En(h),u.head.appendChild(h)}}}function W6(a,i,u){mo.S(a,i,u);var h=Nc;if(h&&a){var y=vr(h).hoistableStyles,S=Ac(a);i=i||"default";var N=y.get(S);if(!N){var k={loading:0,preload:null};if(N=h.querySelector(wd(S)))k.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":i},u),(u=za.get(S))&&Ky(a,u);var H=N=h.createElement("link");En(H),Sr(H,"link",a),H._p=new Promise(function(re,he){H.onload=re,H.onerror=he}),H.addEventListener("load",function(){k.loading|=1}),H.addEventListener("error",function(){k.loading|=2}),k.loading|=4,nm(N,i,h)}N={type:"stylesheet",instance:N,count:1,state:k},y.set(S,N)}}}function Q6(a,i){mo.X(a,i);var u=Nc;if(u&&a){var h=vr(u).hoistableScripts,y=Dc(a),S=h.get(y);S||(S=u.querySelector(Ed(y)),S||(a=v({src:a,async:!0},i),(i=za.get(y))&&Yy(a,i),S=u.createElement("script"),En(S),Sr(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function X6(a,i){mo.M(a,i);var u=Nc;if(u&&a){var h=vr(u).hoistableScripts,y=Dc(a),S=h.get(y);S||(S=u.querySelector(Ed(y)),S||(a=v({src:a,async:!0,type:"module"},i),(i=za.get(y))&&Yy(a,i),S=u.createElement("script"),En(S),Sr(S,"link",a),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function e2(a,i,u,h){var y=(y=ve.current)?tm(y):null;if(!y)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=Ac(u.href),u=vr(y).hoistableStyles,h=u.get(i),h||(h={type:"style",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){a=Ac(u.href);var S=vr(y).hoistableStyles,N=S.get(a);if(N||(y=y.ownerDocument||y,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(a,N),(S=y.querySelector(wd(a)))&&!S._p&&(N.instance=S,N.state.loading=5),za.has(a)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},za.set(a,u),S||J6(y,a,u,N.state))),i&&h===null)throw Error(r(528,""));return N}if(i&&h!==null)throw Error(r(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Dc(u),u=vr(y).hoistableScripts,h=u.get(i),h||(h={type:"script",instance:null,count:0,state:null},u.set(i,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Ac(a){return'href="'+Oa(a)+'"'}function wd(a){return'link[rel="stylesheet"]['+a+"]"}function t2(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function J6(a,i,u,h){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?h.loading=1:(i=a.createElement("link"),h.preload=i,i.addEventListener("load",function(){return h.loading|=1}),i.addEventListener("error",function(){return h.loading|=2}),Sr(i,"link",u),En(i),a.head.appendChild(i))}function Dc(a){return'[src="'+Oa(a)+'"]'}function Ed(a){return"script[async]"+a}function n2(a,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var h=a.querySelector('style[data-href~="'+Oa(u.href)+'"]');if(h)return i.instance=h,En(h),h;var y=v({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(a.ownerDocument||a).createElement("style"),En(h),Sr(h,"style",y),nm(h,u.precedence,a),i.instance=h;case"stylesheet":y=Ac(u.href);var S=a.querySelector(wd(y));if(S)return i.state.loading|=4,i.instance=S,En(S),S;h=t2(u),(y=za.get(y))&&Ky(h,y),S=(a.ownerDocument||a).createElement("link"),En(S);var N=S;return N._p=new Promise(function(k,H){N.onload=k,N.onerror=H}),Sr(S,"link",h),i.state.loading|=4,nm(S,u.precedence,a),i.instance=S;case"script":return S=Dc(u.src),(y=a.querySelector(Ed(S)))?(i.instance=y,En(y),y):(h=u,(y=za.get(S))&&(h=v({},u),Yy(h,y)),a=a.ownerDocument||a,y=a.createElement("script"),En(y),Sr(y,"link",h),a.head.appendChild(y),i.instance=y);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(h=i.instance,i.state.loading|=4,nm(h,u.precedence,a));return i.instance}function nm(a,i,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,S=y,N=0;N<h.length;N++){var k=h[N];if(k.dataset.precedence===i)S=k;else if(S!==y)break}S?S.parentNode.insertBefore(a,S.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(a,i.firstChild))}function Ky(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function Yy(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var rm=null;function r2(a,i,u){if(rm===null){var h=new Map,y=rm=new Map;y.set(u,h)}else y=rm,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(a))return h;for(h.set(a,null),u=u.getElementsByTagName(a),y=0;y<u.length;y++){var S=u[y];if(!(S[Bt]||S[ze]||a==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var N=S.getAttribute(i)||"";N=a+N;var k=h.get(N);k?k.push(S):h.set(N,[S])}}return h}function a2(a,i,u){a=a.ownerDocument||a,a.head.insertBefore(u,i==="title"?a.querySelector("head > title"):null)}function ek(a,i,u){if(u===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function s2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function tk(a,i,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=Ac(h.href),S=i.querySelector(wd(y));if(S){i=S._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(a.count++,a=am.bind(a),i.then(a,a)),u.state.loading|=4,u.instance=S,En(S);return}S=i.ownerDocument||i,h=t2(h),(y=za.get(y))&&Ky(h,y),S=S.createElement("link"),En(S);var N=S;N._p=new Promise(function(k,H){N.onload=k,N.onerror=H}),Sr(S,"link",h),u.instance=S}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=am.bind(a),i.addEventListener("load",u),i.addEventListener("error",u))}}var Wy=0;function nk(a,i){return a.stylesheets&&a.count===0&&om(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var h=setTimeout(function(){if(a.stylesheets&&om(a,a.stylesheets),a.unsuspend){var S=a.unsuspend;a.unsuspend=null,S()}},6e4+i);0<a.imgBytes&&Wy===0&&(Wy=62500*L6());var y=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&om(a,a.stylesheets),a.unsuspend)){var S=a.unsuspend;a.unsuspend=null,S()}},(a.imgBytes>Wy?50:800)+i);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function am(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)om(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var sm=null;function om(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,sm=new Map,i.forEach(rk,a),sm=null,am.call(a))}function rk(a,i){if(!(i.state.loading&4)){var u=sm.get(a);if(u)var h=u.get(null);else{u=new Map,sm.set(a,u);for(var y=a.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var N=y[S];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),h=N)}h&&u.set(null,h)}y=i.instance,N=y.getAttribute("data-precedence"),S=u.get(N)||h,S===h&&u.set(null,y),u.set(N,y),this.count++,h=am.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),S?S.parentNode.insertBefore(y,S.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(y,a.firstChild)),i.state.loading|=4}}var Rd={$$typeof:_,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function ak(a,i,u,h,y,S,N,k,H){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_r(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.hiddenUpdates=_r(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function o2(a,i,u,h,y,S,N,k,H,re,he,pe){return a=new ak(a,i,u,N,H,re,he,pe,k),i=1,S===!0&&(i|=24),S=sa(3,null,null,i),a.current=S,S.stateNode=a,i=Nv(),i.refCount++,a.pooledCache=i,i.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:i},Mv(S),a}function i2(a){return a?(a=lc,a):lc}function l2(a,i,u,h,y,S){y=i2(y),h.context===null?h.context=y:h.pendingContext=y,h=Ko(i),h.payload={element:u},S=S===void 0?null:S,S!==null&&(h.callback=S),u=Yo(a,h,i),u!==null&&(Qr(u,a,i),rd(u,a,i))}function c2(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<i?u:i}}function Qy(a,i){c2(a,i),(a=a.alternate)&&c2(a,i)}function u2(a){if(a.tag===13||a.tag===31){var i=tl(a,67108864);i!==null&&Qr(i,a,67108864),Qy(a,67108864)}}function d2(a){if(a.tag===13||a.tag===31){var i=ua();i=Ee(i);var u=tl(a,i);u!==null&&Qr(u,a,i),Qy(a,i)}}var im=!0;function sk(a,i,u,h){var y=I.T;I.T=null;var S=B.p;try{B.p=2,Xy(a,i,u,h)}finally{B.p=S,I.T=y}}function ok(a,i,u,h){var y=I.T;I.T=null;var S=B.p;try{B.p=8,Xy(a,i,u,h)}finally{B.p=S,I.T=y}}function Xy(a,i,u,h){if(im){var y=Jy(h);if(y===null)Uy(a,i,h,lm,u),h2(a,h);else if(lk(y,a,i,u,h))h.stopPropagation();else if(h2(a,h),i&4&&-1<ik.indexOf(a)){for(;y!==null;){var S=Na(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var N=mn(S.pendingLanes);if(N!==0){var k=S;for(k.pendingLanes|=2,k.entangledLanes|=2;N;){var H=1<<31-wn(N);k.entanglements[1]|=H,N&=~H}Ts(S),(Ft&6)===0&&(Bh=ye()+500,xd(0))}}break;case 31:case 13:k=tl(S,2),k!==null&&Qr(k,S,2),qh(),Qy(S,2)}if(S=Jy(h),S===null&&Uy(a,i,h,lm,u),S===y)break;y=S}y!==null&&h.stopPropagation()}else Uy(a,i,h,null,u)}}function Jy(a){return a=tv(a),ex(a)}var lm=null;function ex(a){if(lm=null,a=$r(a),a!==null){var i=l(a);if(i===null)a=null;else{var u=i.tag;if(u===13){if(a=c(i),a!==null)return a;a=null}else if(u===31){if(a=d(i),a!==null)return a;a=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return lm=a,null}function f2(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ce()){case Ye:return 2;case st:return 8;case ot:case vn:return 32;case _a:return 268435456;default:return 32}default:return 32}}var tx=!1,oi=null,ii=null,li=null,Td=new Map,jd=new Map,ci=[],ik="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 h2(a,i){switch(a){case"focusin":case"focusout":oi=null;break;case"dragenter":case"dragleave":ii=null;break;case"mouseover":case"mouseout":li=null;break;case"pointerover":case"pointerout":Td.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":jd.delete(i.pointerId)}}function _d(a,i,u,h,y,S){return a===null||a.nativeEvent!==S?(a={blockedOn:i,domEventName:u,eventSystemFlags:h,nativeEvent:S,targetContainers:[y]},i!==null&&(i=Na(i),i!==null&&u2(i)),a):(a.eventSystemFlags|=h,i=a.targetContainers,y!==null&&i.indexOf(y)===-1&&i.push(y),a)}function lk(a,i,u,h,y){switch(i){case"focusin":return oi=_d(oi,a,i,u,h,y),!0;case"dragenter":return ii=_d(ii,a,i,u,h,y),!0;case"mouseover":return li=_d(li,a,i,u,h,y),!0;case"pointerover":var S=y.pointerId;return Td.set(S,_d(Td.get(S)||null,a,i,u,h,y)),!0;case"gotpointercapture":return S=y.pointerId,jd.set(S,_d(jd.get(S)||null,a,i,u,h,y)),!0}return!1}function m2(a){var i=$r(a.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){a.blockedOn=i,ke(a.priority,function(){d2(u)});return}}else if(i===31){if(i=d(u),i!==null){a.blockedOn=i,ke(a.priority,function(){d2(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function cm(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var u=Jy(a.nativeEvent);if(u===null){u=a.nativeEvent;var h=new u.constructor(u.type,u);ev=h,u.target.dispatchEvent(h),ev=null}else return i=Na(u),i!==null&&u2(i),a.blockedOn=u,!1;i.shift()}return!0}function p2(a,i,u){cm(a)&&u.delete(i)}function ck(){tx=!1,oi!==null&&cm(oi)&&(oi=null),ii!==null&&cm(ii)&&(ii=null),li!==null&&cm(li)&&(li=null),Td.forEach(p2),jd.forEach(p2)}function um(a,i){a.blockedOn===i&&(a.blockedOn=null,tx||(tx=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,ck)))}var dm=null;function g2(a){dm!==a&&(dm=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){dm===a&&(dm=null);for(var i=0;i<a.length;i+=3){var u=a[i],h=a[i+1],y=a[i+2];if(typeof h!="function"){if(ex(h||u)===null)continue;break}var S=Na(u);S!==null&&(a.splice(i,3),i-=3,Jv(S,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function Oc(a){function i(H){return um(H,a)}oi!==null&&um(oi,a),ii!==null&&um(ii,a),li!==null&&um(li,a),Td.forEach(i),jd.forEach(i);for(var u=0;u<ci.length;u++){var h=ci[u];h.blockedOn===a&&(h.blockedOn=null)}for(;0<ci.length&&(u=ci[0],u.blockedOn===null);)m2(u),u.blockedOn===null&&ci.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],S=u[h+1],N=y[Ge]||null;if(typeof S=="function")N||g2(u);else if(N){var k=null;if(S&&S.hasAttribute("formAction")){if(y=S,N=S[Ge]||null)k=N.formAction;else if(ex(y)!==null)continue}else k=N.action;typeof k=="function"?u[h+1]=k:(u.splice(h,3),h-=3),g2(u)}}}function v2(){function a(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(N){return y=N})},focusReset:"manual",scroll:"manual"})}function i(){y!==null&&(y(),y=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),y!==null&&(y(),y=null)}}}function nx(a){this._internalRoot=a}fm.prototype.render=nx.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,h=ua();l2(u,h,a,i,null,null)},fm.prototype.unmount=nx.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;l2(a.current,2,null,a,null,null),qh(),i[qe]=null}};function fm(a){this._internalRoot=a}fm.prototype.unstable_scheduleHydration=function(a){if(a){var i=Le();a={blockedOn:null,target:a,priority:i};for(var u=0;u<ci.length&&i!==0&&i<ci[u].priority;u++);ci.splice(u,0,a),u===0&&m2(a)}};var y2=t.version;if(y2!=="19.2.0")throw Error(r(527,y2,"19.2.0"));B.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=m(i),a=a!==null?g(a):null,a=a===null?null:a.stateNode,a};var uk={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var hm=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!hm.isDisabled&&hm.supportsFiber)try{Mn=hm.inject(uk),Cn=hm}catch{}}return Ad.createRoot=function(a,i){if(!s(a))throw Error(r(299));var u=!1,h="",y=Rw,S=Tw,N=jw;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(y=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=o2(a,1,!1,null,null,u,h,null,y,S,N,v2),a[qe]=i.current,Py(a),new nx(i)},Ad.hydrateRoot=function(a,i,u){if(!s(a))throw Error(r(299));var h=!1,y="",S=Rw,N=Tw,k=jw,H=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(k=u.onRecoverableError),u.formState!==void 0&&(H=u.formState)),i=o2(a,1,!0,i,u??null,h,y,H,S,N,k,v2),i.context=i2(null),u=i.current,h=ua(),h=Ee(h),y=Ko(h),y.callback=null,Yo(u,y,h),u=h,i.current.lanes=u,Hr(i,u),Ts(i),a[qe]=i.current,Py(a),new fm(i)},Ad.version="19.2.0",Ad}var _2;function Ck(){if(_2)return sx.exports;_2=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(),sx.exports=Sk(),sx.exports}var wk=Ck();/**
|
|
50
|
-
* react-router v7.9.5
|
|
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 jj=e=>{throw TypeError(e)},Ek=(e,t,n)=>t.has(e)||jj("Cannot "+n),cx=(e,t,n)=>(Ek(e,t,"read from private field"),n?n.call(e):t.get(e)),Rk=(e,t,n)=>t.has(e)?jj("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),N2="popstate";function Tk(e={}){function t(r,s){let{pathname:l,search:c,hash:d}=r.location;return rf("",{pathname:l,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:Ps(s)}return _k(t,n,null,e)}function vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function An(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jk(){return Math.random().toString(36).substring(2,10)}function A2(e,t){return{usr:e.state,key:e.key,idx:t}}function rf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ii(t):t,state:n,key:t&&t.key||r||jk()}}function Ps({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 Ii(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 _k(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:l=!1}=r,c=s.history,d="POP",f=null,m=g();m==null&&(m=0,c.replaceState({...c.state,idx:m},""));function g(){return(c.state||{idx:null}).idx}function v(){d="POP";let E=g(),R=E==null?null:E-m;m=E,f&&f({action:d,location:C.location,delta:R})}function x(E,R){d="PUSH";let T=rf(C.location,E,R);m=g()+1;let _=A2(T,m),O=C.createHref(T);try{c.pushState(_,"",O)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;s.location.assign(O)}l&&f&&f({action:d,location:C.location,delta:1})}function b(E,R){d="REPLACE";let T=rf(C.location,E,R);m=g();let _=A2(T,m),O=C.createHref(T);c.replaceState(_,"",O),l&&f&&f({action:d,location:C.location,delta:0})}function w(E){return _j(E)}let C={get action(){return d},get location(){return e(s,c)},listen(E){if(f)throw new Error("A history only accepts one active listener");return s.addEventListener(N2,v),f=E,()=>{s.removeEventListener(N2,v),f=null}},createHref(E){return t(s,E)},createURL:w,encodeLocation(E){let R=w(E);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:x,replace:b,go(E){return c.go(E)}};return C}function _j(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),vt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Ps(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Bd,D2=class{constructor(e){if(Rk(this,Bd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(cx(this,Bd).has(e))return cx(this,Bd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){cx(this,Bd).set(e,t)}};Bd=new WeakMap;var Nk=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ak(e){return Nk.has(e)}var Dk=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Ok(e){return Dk.has(e)}function Mk(e){return e.index===!0}function af(e,t,n=[],r={},s=!1){return e.map((l,c)=>{let d=[...n,String(c)],f=typeof l.id=="string"?l.id:d.join("-");if(vt(l.index!==!0||!l.children,"Cannot specify children on an index route"),vt(s||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),Mk(l)){let m={...l,id:f};return r[f]=O2(m,t(m)),m}else{let m={...l,id:f,children:void 0};return r[f]=O2(m,t(m)),l.children&&(m.children=af(l.children,t,d,r,s)),m}})}function O2(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function gi(e,t,n="/"){return zm(e,t,n,!1)}function zm(e,t,n,r){let s=typeof t=="string"?Ii(t):t,l=Ba(s.pathname||"/",n);if(l==null)return null;let c=Nj(e);Ik(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let m=qk(l);d=Bk(c[f],m,r)}return d}function kk(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 Nj(e,t=[],n=[],r="",s=!1){let l=(c,d,f=s,m)=>{let g={relativePath:m===void 0?c.path||"":m,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&f)return;vt(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let v=ks([r,g.relativePath]),x=n.concat(g);c.children&&c.children.length>0&&(vt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),Nj(c.children,t,x,v,f)),!(c.path==null&&!c.index)&&t.push({path:v,score:Hk(v,c.index),routesMeta:x})};return e.forEach((c,d)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))l(c,d);else for(let m of Aj(c.path))l(c,d,!0,m)}),t}function Aj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return s?[l,""]:[l];let c=Aj(r.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),s&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function Ik(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:$k(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Lk=/^:[\w-]+$/,Pk=3,Uk=2,Fk=1,zk=10,Vk=-2,M2=e=>e==="*";function Hk(e,t){let n=e.split("/"),r=n.length;return n.some(M2)&&(r+=Vk),t&&(r+=Uk),n.filter(s=>!M2(s)).reduce((s,l)=>s+(Lk.test(l)?Pk:l===""?Fk:zk),r)}function $k(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 Bk(e,t,n=!1){let{routesMeta:r}=e,s={},l="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],m=d===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",v=tp({path:f.relativePath,caseSensitive:f.caseSensitive,end:m},g),x=f.route;if(!v&&m&&n&&!r[r.length-1].route.index&&(v=tp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!v)return null;Object.assign(s,v.params),c.push({params:s,pathname:ks([l,v.pathname]),pathnameBase:Wk(ks([l,v.pathnameBase])),route:x}),v.pathnameBase!=="/"&&(l=ks([l,v.pathnameBase]))}return c}function tp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Gk(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let l=s[0],c=l.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:r.reduce((m,{paramName:g,isOptional:v},x)=>{if(g==="*"){let w=d[x]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[x];return v&&!b?m[g]=void 0:m[g]=(b||"").replace(/%2F/g,"/"),m},{}),pathname:l,pathnameBase:c,pattern:e}}function Gk(e,t=!1,n=!0){An(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(r.push({paramName:d,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 qk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return An(!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 Ba(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 Zk({basename:e,pathname:t}){return t==="/"?e:ks([e,t])}function Kk(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Ii(e):e;return{pathname:n?n.startsWith("/")?n:Yk(n,t):t,search:Qk(r),hash:Xk(s)}}function Yk(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 ux(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 Dj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $p(e){let t=Dj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Bp(e,t,n,r=!1){let s;typeof e=="string"?s=Ii(e):(s={...e},vt(!s.pathname||!s.pathname.includes("?"),ux("?","pathname","search",s)),vt(!s.pathname||!s.pathname.includes("#"),ux("#","pathname","hash",s)),vt(!s.search||!s.search.includes("#"),ux("#","search","hash",s)));let l=e===""||s.pathname==="",c=l?"/":s.pathname,d;if(c==null)d=n;else{let v=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),v-=1;s.pathname=x.join("/")}d=v>=0?t[v]:"/"}let f=Kk(s,d),m=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(m||g)&&(f.pathname+="/"),f}var ks=e=>e.join("/").replace(/\/\/+/g,"/"),Wk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Qk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Xk=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,np=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 sf(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function pb(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var xi=Symbol("Uninstrumented");function Jk(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(l){let c=Object.keys(n);for(let d of c)l[d]&&n[d].push(l[d])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=Wc(n.lazy,t.lazy,()=>{});s&&(r.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(l=>{let c=s[l],d=n[`lazy.${l}`];if(typeof c=="function"&&d.length>0){let f=Wc(d,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(s=>{let l=t[s];if(typeof l=="function"&&n[s].length>0){let c=l[xi]??l,d=Wc(n[s],c,(...f)=>k2(f[0]));d&&(d[xi]=c,r[s]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(s=>{let l=s[xi]??s,c=Wc(n.middleware,l,(...d)=>k2(d[0]));return c?(c[xi]=l,c):s})),r}function e8(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(s){let l=Object.keys(s);for(let c of l)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let r=e.navigate[xi]??e.navigate,s=Wc(n.navigate,r,(...l)=>{let[c,d]=l;return{to:typeof c=="number"||typeof c=="string"?c:c?Ps(c):".",...I2(e,d??{})}});s&&(s[xi]=r,e.navigate=s)}if(n.fetch.length>0){let r=e.fetch[xi]??e.fetch,s=Wc(n.fetch,r,(...l)=>{let[c,,d,f]=l;return{href:d??".",fetcherKey:c,...I2(e,f??{})}});s&&(s[xi]=r,e.fetch=s)}return e}function Wc(e,t,n){return e.length===0?null:async(...r)=>{let s=await Oj(e,n(...r),()=>t(...r),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function Oj(e,t,n,r){let s=e[r],l;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=Oj(e,t,n,r-1),l=await c,vt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await s(d,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await d(),await c}else try{l={type:"success",value:await n()}}catch(c){l={type:"error",value:c}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function k2(e){let{request:t,context:n,params:r,unstable_pattern:s}=e;return{request:t8(t),params:{...r},unstable_pattern:s,context:n8(n)}}function I2(e,t){return{currentUrl:Ps(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 t8(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function n8(e){if(a8(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var r8=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function a8(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")===r8}var Mj=["POST","PUT","PATCH","DELETE"],s8=new Set(Mj),o8=["GET",...Mj],i8=new Set(o8),l8=new Set([301,302,303,307,308]),c8=new Set([307,308]),dx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},u8={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Dd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},d8=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gb=e=>d8.test(e),f8=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),kj="remix-router-transitions",Ij=Symbol("ResetLoaderData");function h8(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";vt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],s=e.mapRouteProperties||f8,l=s;if(e.unstable_instrumentations){let U=e.unstable_instrumentations;l=Q=>({...s(Q),...Jk(U.map(se=>se.route).filter(Boolean),Q)})}let c={},d=af(e.routes,l,void 0,c),f,m=e.basename||"/";m.startsWith("/")||(m=`/${m}`);let g=e.dataStrategy||y8,v={...e.future},x=null,b=new Set,w=null,C=null,E=null,R=e.hydrationData!=null,T=gi(d,e.history.location,m),_=!1,O=null,A;if(T==null&&!e.patchRoutesOnNavigation){let U=Va(404,{pathname:e.history.location.pathname}),{matches:Q,route:se}=mm(d);A=!0,T=Q,O={[se.id]:U}}else if(T&&!e.hydrationData&&Xn(T,d,e.history.location.pathname).active&&(T=null),T)if(T.some(U=>U.route.lazy))A=!1;else if(!T.some(U=>vb(U.route)))A=!0;else{let U=e.hydrationData?e.hydrationData.loaderData:null,Q=e.hydrationData?e.hydrationData.errors:null;if(Q){let se=T.findIndex(ge=>Q[ge.route.id]!==void 0);A=T.slice(0,se+1).every(ge=>!c0(ge.route,U,Q))}else A=T.every(se=>!c0(se.route,U,Q))}else{A=!1,T=[];let U=Xn(null,d,e.history.location.pathname);U.active&&U.matches&&(_=!0,T=U.matches)}let D,j={historyAction:e.history.action,location:e.history.location,matches:T,initialized:A,navigation:dx,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||O,fetchers:new Map,blockers:new Map},M="POP",z=!1,Z,K=!1,Y=new Map,ae=null,F=!1,V=!1,I=new Set,B=new Map,G=0,ie=-1,xe=new Map,L=new Set,P=new Map,W=new Map,ee=new Set,de=new Map,ve,le=null;function Ne(){if(x=e.history.listen(({action:U,location:Q,delta:se})=>{if(ve){ve(),ve=void 0;return}An(de.size===0||se!=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 ge=Zs({currentLocation:j.location,nextLocation:Q,historyAction:U});if(ge&&se!=null){let Ee=new Promise(Fe=>{ve=Fe});e.history.go(se*-1),zo(ge,{state:"blocked",location:Q,proceed(){zo(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),Ee.then(()=>e.history.go(se))},reset(){let Fe=new Map(j.blockers);Fe.set(ge,Dd),Be({blockers:Fe})}});return}return $t(U,Q)}),n){M8(t,Y);let U=()=>k8(t,Y);t.addEventListener("pagehide",U),ae=()=>t.removeEventListener("pagehide",U)}return j.initialized||$t("POP",j.location,{initialHydration:!0}),D}function we(){x&&x(),ae&&ae(),b.clear(),Z&&Z.abort(),j.fetchers.forEach((U,Q)=>yn(Q)),j.blockers.forEach((U,Q)=>bs(Q))}function Te(U){return b.add(U),()=>b.delete(U)}function Be(U,Q={}){U.matches&&(U.matches=U.matches.map(Ee=>{let Fe=c[Ee.route.id],Le=Ee.route;return Le.element!==Fe.element||Le.errorElement!==Fe.errorElement||Le.hydrateFallbackElement!==Fe.hydrateFallbackElement?{...Ee,route:Fe}:Ee})),j={...j,...U};let se=[],ge=[];j.fetchers.forEach((Ee,Fe)=>{Ee.state==="idle"&&(ee.has(Fe)?se.push(Fe):ge.push(Fe))}),ee.forEach(Ee=>{!j.fetchers.has(Ee)&&!B.has(Ee)&&se.push(Ee)}),[...b].forEach(Ee=>Ee(j,{deletedFetchers:se,viewTransitionOpts:Q.viewTransitionOpts,flushSync:Q.flushSync===!0})),se.forEach(Ee=>yn(Ee)),ge.forEach(Ee=>j.fetchers.delete(Ee))}function Xe(U,Q,{flushSync:se}={}){var Ge,qe;let ge=j.actionData!=null&&j.navigation.formMethod!=null&&Pr(j.navigation.formMethod)&&j.navigation.state==="loading"&&((Ge=U.state)==null?void 0:Ge._isRedirect)!==!0,Ee;Q.actionData?Object.keys(Q.actionData).length>0?Ee=Q.actionData:Ee=null:ge?Ee=j.actionData:Ee=null;let Fe=Q.loaderData?G2(j.loaderData,Q.loaderData,Q.matches||[],Q.errors):j.loaderData,Le=j.blockers;Le.size>0&&(Le=new Map(Le),Le.forEach((ct,Yt)=>Le.set(Yt,Dd)));let ke=F?!1:gr(U,Q.matches||j.matches),Pe=z===!0||j.navigation.formMethod!=null&&Pr(j.navigation.formMethod)&&((qe=U.state)==null?void 0:qe._isRedirect)!==!0;f&&(d=f,f=void 0),F||M==="POP"||(M==="PUSH"?e.history.push(U,U.state):M==="REPLACE"&&e.history.replace(U,U.state));let ze;if(M==="POP"){let ct=Y.get(j.location.pathname);ct&&ct.has(U.pathname)?ze={currentLocation:j.location,nextLocation:U}:Y.has(U.pathname)&&(ze={currentLocation:U,nextLocation:j.location})}else if(K){let ct=Y.get(j.location.pathname);ct?ct.add(U.pathname):(ct=new Set([U.pathname]),Y.set(j.location.pathname,ct)),ze={currentLocation:j.location,nextLocation:U}}Be({...Q,actionData:Ee,loaderData:Fe,historyAction:M,location:U,initialized:!0,navigation:dx,revalidation:"idle",restoreScrollPosition:ke,preventScrollReset:Pe,blockers:Le},{viewTransitionOpts:ze,flushSync:se===!0}),M="POP",z=!1,K=!1,F=!1,V=!1,le==null||le.resolve(),le=null}async function Vt(U,Q){if(typeof U=="number"){e.history.go(U);return}let se=l0(j.location,j.matches,m,U,Q==null?void 0:Q.fromRouteId,Q==null?void 0:Q.relative),{path:ge,submission:Ee,error:Fe}=L2(!1,se,Q),Le=j.location,ke=rf(j.location,ge,Q&&Q.state);ke={...ke,...e.history.encodeLocation(ke)};let Pe=Q&&Q.replace!=null?Q.replace:void 0,ze="PUSH";Pe===!0?ze="REPLACE":Pe===!1||Ee!=null&&Pr(Ee.formMethod)&&Ee.formAction===j.location.pathname+j.location.search&&(ze="REPLACE");let Ge=Q&&"preventScrollReset"in Q?Q.preventScrollReset===!0:void 0,qe=(Q&&Q.flushSync)===!0,ct=Zs({currentLocation:Le,nextLocation:ke,historyAction:ze});if(ct){zo(ct,{state:"blocked",location:ke,proceed(){zo(ct,{state:"proceeding",proceed:void 0,reset:void 0,location:ke}),Vt(U,Q)},reset(){let Yt=new Map(j.blockers);Yt.set(ct,Dd),Be({blockers:Yt})}});return}await $t(ze,ke,{submission:Ee,pendingError:Fe,preventScrollReset:Ge,replace:Q&&Q.replace,enableViewTransition:Q&&Q.viewTransition,flushSync:qe})}function jt(){le||(le=I8()),Ye(),Be({revalidation:"loading"});let U=le.promise;return j.navigation.state==="submitting"?U:j.navigation.state==="idle"?($t(j.historyAction,j.location,{startUninterruptedRevalidation:!0}),U):($t(M||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:K===!0}),U)}async function $t(U,Q,se){Z&&Z.abort(),Z=null,M=U,F=(se&&se.startUninterruptedRevalidation)===!0,Fn(j.location,j.matches),z=(se&&se.preventScrollReset)===!0,K=(se&&se.enableViewTransition)===!0;let ge=f||d,Ee=se&&se.overrideNavigation,Fe=se!=null&&se.initialHydration&&j.matches&&j.matches.length>0&&!_?j.matches:gi(ge,Q,m),Le=(se&&se.flushSync)===!0;if(Fe&&j.initialized&&!V&&T8(j.location,Q)&&!(se&&se.submission&&Pr(se.submission.formMethod))){Xe(Q,{matches:Fe},{flushSync:Le});return}let ke=Xn(Fe,ge,Q.pathname);if(ke.active&&ke.matches&&(Fe=ke.matches),!Fe){let{error:lr,notFoundMatches:Bt,route:Gt}=Ss(Q.pathname);Xe(Q,{matches:Bt,loaderData:{},errors:{[Gt.id]:lr}},{flushSync:Le});return}Z=new AbortController;let Pe=Hc(e.history,Q,Z.signal,se&&se.submission),ze=e.getContext?await e.getContext():new D2,Ge;if(se&&se.pendingError)Ge=[vi(Fe).route.id,{type:"error",error:se.pendingError}];else if(se&&se.submission&&Pr(se.submission.formMethod)){let lr=await Me(Pe,Q,se.submission,Fe,ze,ke.active,se&&se.initialHydration===!0,{replace:se.replace,flushSync:Le});if(lr.shortCircuited)return;if(lr.pendingActionResult){let[Bt,Gt]=lr.pendingActionResult;if(da(Gt)&&sf(Gt.error)&&Gt.error.status===404){Z=null,Xe(Q,{matches:lr.matches,loaderData:{},errors:{[Bt]:Gt.error}});return}}Fe=lr.matches||Fe,Ge=lr.pendingActionResult,Ee=fx(Q,se.submission),Le=!1,ke.active=!1,Pe=Hc(e.history,Pe.url,Pe.signal)}let{shortCircuited:qe,matches:ct,loaderData:Yt,errors:zn}=await _t(Pe,Q,Fe,ze,ke.active,Ee,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,Le,Ge);qe||(Z=null,Xe(Q,{matches:ct||Fe,...q2(Ge),loaderData:Yt,errors:zn}))}async function Me(U,Q,se,ge,Ee,Fe,Le,ke={}){Ye();let Pe=D8(Q,se);if(Be({navigation:Pe},{flushSync:ke.flushSync===!0}),Fe){let qe=await kn(ge,Q.pathname,U.signal);if(qe.type==="aborted")return{shortCircuited:!0};if(qe.type==="error"){if(qe.partialMatches.length===0){let{matches:Yt,route:zn}=mm(d);return{matches:Yt,pendingActionResult:[zn.id,{type:"error",error:qe.error}]}}let ct=vi(qe.partialMatches).route.id;return{matches:qe.partialMatches,pendingActionResult:[ct,{type:"error",error:qe.error}]}}else if(qe.matches)ge=qe.matches;else{let{notFoundMatches:ct,error:Yt,route:zn}=Ss(Q.pathname);return{matches:ct,pendingActionResult:[zn.id,{type:"error",error:Yt}]}}}let ze,Ge=Vm(ge,Q);if(!Ge.route.action&&!Ge.route.lazy)ze={type:"error",error:Va(405,{method:U.method,pathname:Q.pathname,routeId:Ge.route.id})};else{let qe=Jc(l,c,U,ge,Ge,Le?[]:r,Ee),ct=await ye(U,qe,Ee,null);if(ze=ct[Ge.route.id],!ze){for(let Yt of ge)if(ct[Yt.route.id]){ze=ct[Yt.route.id];break}}if(U.signal.aborted)return{shortCircuited:!0}}if(yl(ze)){let qe;return ke&&ke.replace!=null?qe=ke.replace:qe=H2(ze.response.headers.get("Location"),new URL(U.url),m)===j.location.pathname+j.location.search,await je(U,ze,!0,{submission:se,replace:qe}),{shortCircuited:!0}}if(da(ze)){let qe=vi(ge,Ge.route.id);return(ke&&ke.replace)!==!0&&(M="PUSH"),{matches:ge,pendingActionResult:[qe.route.id,ze,Ge.route.id]}}return{matches:ge,pendingActionResult:[Ge.route.id,ze]}}async function _t(U,Q,se,ge,Ee,Fe,Le,ke,Pe,ze,Ge,qe){let ct=Fe||fx(Q,Le),Yt=Le||ke||K2(ct),zn=!F&&!ze;if(Ee){if(zn){let Jn=Nt(qe);Be({navigation:ct,...Jn!==void 0?{actionData:Jn}:{}},{flushSync:Ge})}let At=await kn(se,Q.pathname,U.signal);if(At.type==="aborted")return{shortCircuited:!0};if(At.type==="error"){if(At.partialMatches.length===0){let{matches:Ks,route:Ys}=mm(d);return{matches:Ks,loaderData:{},errors:{[Ys.id]:At.error}}}let Jn=vi(At.partialMatches).route.id;return{matches:At.partialMatches,loaderData:{},errors:{[Jn]:At.error}}}else if(At.matches)se=At.matches;else{let{error:Jn,notFoundMatches:Ks,route:Ys}=Ss(Q.pathname);return{matches:Ks,loaderData:{},errors:{[Ys.id]:Jn}}}}let lr=f||d,{dsMatches:Bt,revalidatingFetchers:Gt}=P2(U,ge,l,c,e.history,j,se,Yt,Q,ze?[]:r,ze===!0,V,I,ee,P,L,lr,m,e.patchRoutesOnNavigation!=null,qe);if(ie=++G,!e.dataStrategy&&!Bt.some(At=>At.shouldLoad)&&!Bt.some(At=>At.route.middleware&&At.route.middleware.length>0)&&Gt.length===0){let At=pr();return Xe(Q,{matches:se,loaderData:{},errors:qe&&da(qe[1])?{[qe[0]]:qe[1].error}:null,...q2(qe),...At?{fetchers:new Map(j.fetchers)}:{}},{flushSync:Ge}),{shortCircuited:!0}}if(zn){let At={};if(!Ee){At.navigation=ct;let Jn=Nt(qe);Jn!==void 0&&(At.actionData=Jn)}Gt.length>0&&(At.fetchers=rn(Gt)),Be(At,{flushSync:Ge})}Gt.forEach(At=>{Mn(At.key),At.controller&&B.set(At.key,At.controller)});let $r=()=>Gt.forEach(At=>Mn(At.key));Z&&Z.signal.addEventListener("abort",$r);let{loaderResults:Na,fetcherResults:Br}=await Ce(Bt,Gt,U,ge);if(U.signal.aborted)return{shortCircuited:!0};Z&&Z.signal.removeEventListener("abort",$r),Gt.forEach(At=>B.delete(At.key));let vr=pm(Na);if(vr)return await je(U,vr.result,!0,{replace:Pe}),{shortCircuited:!0};if(vr=pm(Br),vr)return L.add(vr.key),await je(U,vr.result,!0,{replace:Pe}),{shortCircuited:!0};let{loaderData:En,errors:Vo}=B2(j,se,Na,qe,Gt,Br);ze&&j.errors&&(Vo={...j.errors,...Vo});let Cs=pr(),Aa=wn(ie),Qa=Cs||Aa||Gt.length>0;return{matches:se,loaderData:En,errors:Vo,...Qa?{fetchers:new Map(j.fetchers)}:{}}}function Nt(U){if(U&&!da(U[1]))return{[U[0]]:U[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function rn(U){return U.forEach(Q=>{let se=j.fetchers.get(Q.key),ge=Od(void 0,se?se.data:void 0);j.fetchers.set(Q.key,ge)}),new Map(j.fetchers)}async function $(U,Q,se,ge){Mn(U);let Ee=(ge&&ge.flushSync)===!0,Fe=f||d,Le=l0(j.location,j.matches,m,se,Q,ge==null?void 0:ge.relative),ke=gi(Fe,Le,m),Pe=Xn(ke,Fe,Le);if(Pe.active&&Pe.matches&&(ke=Pe.matches),!ke){ot(U,Q,Va(404,{pathname:Le}),{flushSync:Ee});return}let{path:ze,submission:Ge,error:qe}=L2(!0,Le,ge);if(qe){ot(U,Q,qe,{flushSync:Ee});return}let ct=e.getContext?await e.getContext():new D2,Yt=(ge&&ge.preventScrollReset)===!0;if(Ge&&Pr(Ge.formMethod)){await te(U,Q,ze,ke,ct,Pe.active,Ee,Yt,Ge);return}P.set(U,{routeId:Q,path:ze}),await fe(U,Q,ze,ke,ct,Pe.active,Ee,Yt,Ge)}async function te(U,Q,se,ge,Ee,Fe,Le,ke,Pe){Ye(),P.delete(U);let ze=j.fetchers.get(U);st(U,O8(Pe,ze),{flushSync:Le});let Ge=new AbortController,qe=Hc(e.history,se,Ge.signal,Pe);if(Fe){let pn=await kn(ge,new URL(qe.url).pathname,qe.signal,U);if(pn.type==="aborted")return;if(pn.type==="error"){ot(U,Q,pn.error,{flushSync:Le});return}else if(pn.matches)ge=pn.matches;else{ot(U,Q,Va(404,{pathname:se}),{flushSync:Le});return}}let ct=Vm(ge,se);if(!ct.route.action&&!ct.route.lazy){let pn=Va(405,{method:Pe.formMethod,pathname:se,routeId:Q});ot(U,Q,pn,{flushSync:Le});return}B.set(U,Ge);let Yt=G,zn=Jc(l,c,qe,ge,ct,r,Ee),Bt=(await ye(qe,zn,Ee,U))[ct.route.id];if(qe.signal.aborted){B.get(U)===Ge&&B.delete(U);return}if(ee.has(U)){if(yl(Bt)||da(Bt)){st(U,yo(void 0));return}}else{if(yl(Bt))if(B.delete(U),ie>Yt){st(U,yo(void 0));return}else return L.add(U),st(U,Od(Pe)),je(qe,Bt,!1,{fetcherSubmission:Pe,preventScrollReset:ke});if(da(Bt)){ot(U,Q,Bt.error);return}}let Gt=j.navigation.location||j.location,$r=Hc(e.history,Gt,Ge.signal),Na=f||d,Br=j.navigation.state!=="idle"?gi(Na,j.navigation.location,m):j.matches;vt(Br,"Didn't find any matches after fetcher action");let vr=++G;xe.set(U,vr);let En=Od(Pe,Bt.data);j.fetchers.set(U,En);let{dsMatches:Vo,revalidatingFetchers:Cs}=P2($r,Ee,l,c,e.history,j,Br,Pe,Gt,r,!1,V,I,ee,P,L,Na,m,e.patchRoutesOnNavigation!=null,[ct.route.id,Bt]);Cs.filter(pn=>pn.key!==U).forEach(pn=>{let Ws=pn.key,Da=j.fetchers.get(Ws),Gr=Od(void 0,Da?Da.data:void 0);j.fetchers.set(Ws,Gr),Mn(Ws),pn.controller&&B.set(Ws,pn.controller)}),Be({fetchers:new Map(j.fetchers)});let Aa=()=>Cs.forEach(pn=>Mn(pn.key));Ge.signal.addEventListener("abort",Aa);let{loaderResults:Qa,fetcherResults:At}=await Ce(Vo,Cs,$r,Ee);if(Ge.signal.aborted)return;if(Ge.signal.removeEventListener("abort",Aa),xe.delete(U),B.delete(U),Cs.forEach(pn=>B.delete(pn.key)),j.fetchers.has(U)){let pn=yo(Bt.data);j.fetchers.set(U,pn)}let Jn=pm(Qa);if(Jn)return je($r,Jn.result,!1,{preventScrollReset:ke});if(Jn=pm(At),Jn)return L.add(Jn.key),je($r,Jn.result,!1,{preventScrollReset:ke});let{loaderData:Ks,errors:Ys}=B2(j,Br,Qa,void 0,Cs,At);wn(vr),j.navigation.state==="loading"&&vr>ie?(vt(M,"Expected pending action"),Z&&Z.abort(),Xe(j.navigation.location,{matches:Br,loaderData:Ks,errors:Ys,fetchers:new Map(j.fetchers)})):(Be({errors:Ys,loaderData:G2(j.loaderData,Ks,Br,Ys),fetchers:new Map(j.fetchers)}),V=!1)}async function fe(U,Q,se,ge,Ee,Fe,Le,ke,Pe){let ze=j.fetchers.get(U);st(U,Od(Pe,ze?ze.data:void 0),{flushSync:Le});let Ge=new AbortController,qe=Hc(e.history,se,Ge.signal);if(Fe){let Gt=await kn(ge,new URL(qe.url).pathname,qe.signal,U);if(Gt.type==="aborted")return;if(Gt.type==="error"){ot(U,Q,Gt.error,{flushSync:Le});return}else if(Gt.matches)ge=Gt.matches;else{ot(U,Q,Va(404,{pathname:se}),{flushSync:Le});return}}let ct=Vm(ge,se);B.set(U,Ge);let Yt=G,zn=Jc(l,c,qe,ge,ct,r,Ee),Bt=(await ye(qe,zn,Ee,U))[ct.route.id];if(B.get(U)===Ge&&B.delete(U),!qe.signal.aborted){if(ee.has(U)){st(U,yo(void 0));return}if(yl(Bt))if(ie>Yt){st(U,yo(void 0));return}else{L.add(U),await je(qe,Bt,!1,{preventScrollReset:ke});return}if(da(Bt)){ot(U,Q,Bt.error);return}st(U,yo(Bt.data))}}async function je(U,Q,se,{submission:ge,fetcherSubmission:Ee,preventScrollReset:Fe,replace:Le}={}){Q.response.headers.has("X-Remix-Revalidate")&&(V=!0);let ke=Q.response.headers.get("Location");vt(ke,"Expected a Location header on the redirect Response"),ke=H2(ke,new URL(U.url),m);let Pe=rf(j.location,ke,{_isRedirect:!0});if(n){let zn=!1;if(Q.response.headers.has("X-Remix-Reload-Document"))zn=!0;else if(gb(ke)){const lr=_j(ke,!0);zn=lr.origin!==t.location.origin||Ba(lr.pathname,m)==null}if(zn){Le?t.location.replace(ke):t.location.assign(ke);return}}Z=null;let ze=Le===!0||Q.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ge,formAction:qe,formEncType:ct}=j.navigation;!ge&&!Ee&&Ge&&qe&&ct&&(ge=K2(j.navigation));let Yt=ge||Ee;if(c8.has(Q.response.status)&&Yt&&Pr(Yt.formMethod))await $t(ze,Pe,{submission:{...Yt,formAction:ke},preventScrollReset:Fe||z,enableViewTransition:se?K:void 0});else{let zn=fx(Pe,ge);await $t(ze,Pe,{overrideNavigation:zn,fetcherSubmission:Ee,preventScrollReset:Fe||z,enableViewTransition:se?K:void 0})}}async function ye(U,Q,se,ge){let Ee,Fe={};try{Ee=await b8(g,U,Q,ge,se,!1)}catch(Le){return Q.filter(ke=>ke.shouldLoad).forEach(ke=>{Fe[ke.route.id]={type:"error",error:Le}}),Fe}if(U.signal.aborted)return Fe;for(let[Le,ke]of Object.entries(Ee))if(N8(ke)){let Pe=ke.result;Fe[Le]={type:"redirect",response:E8(Pe,U,Le,Q,m)}}else Fe[Le]=await w8(ke);return Fe}async function Ce(U,Q,se,ge){let Ee=ye(se,U,ge,null),Fe=Promise.all(Q.map(async Pe=>{if(Pe.matches&&Pe.match&&Pe.request&&Pe.controller){let Ge=(await ye(Pe.request,Pe.matches,ge,Pe.key))[Pe.match.route.id];return{[Pe.key]:Ge}}else return Promise.resolve({[Pe.key]:{type:"error",error:Va(404,{pathname:Pe.path})}})})),Le=await Ee,ke=(await Fe).reduce((Pe,ze)=>Object.assign(Pe,ze),{});return{loaderResults:Le,fetcherResults:ke}}function Ye(){V=!0,P.forEach((U,Q)=>{B.has(Q)&&I.add(Q),Mn(Q)})}function st(U,Q,se={}){j.fetchers.set(U,Q),Be({fetchers:new Map(j.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function ot(U,Q,se,ge={}){let Ee=vi(j.matches,Q);yn(U),Be({errors:{[Ee.route.id]:se},fetchers:new Map(j.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function vn(U){return W.set(U,(W.get(U)||0)+1),ee.has(U)&&ee.delete(U),j.fetchers.get(U)||u8}function _a(U,Q){Mn(U,Q==null?void 0:Q.reason),st(U,yo(null))}function yn(U){let Q=j.fetchers.get(U);B.has(U)&&!(Q&&Q.state==="loading"&&xe.has(U))&&Mn(U),P.delete(U),xe.delete(U),L.delete(U),ee.delete(U),I.delete(U),j.fetchers.delete(U)}function Fo(U){let Q=(W.get(U)||0)-1;Q<=0?(W.delete(U),ee.add(U)):W.set(U,Q),Be({fetchers:new Map(j.fetchers)})}function Mn(U,Q){let se=B.get(U);se&&(se.abort(Q),B.delete(U))}function Cn(U){for(let Q of U){let se=vn(Q),ge=yo(se.data);j.fetchers.set(Q,ge)}}function pr(){let U=[],Q=!1;for(let se of L){let ge=j.fetchers.get(se);vt(ge,`Expected fetcher: ${se}`),ge.state==="loading"&&(L.delete(se),U.push(se),Q=!0)}return Cn(U),Q}function wn(U){let Q=[];for(let[se,ge]of xe)if(ge<U){let Ee=j.fetchers.get(se);vt(Ee,`Expected fetcher: ${se}`),Ee.state==="loading"&&(Mn(se),xe.delete(se),Q.push(se))}return Cn(Q),Q.length>0}function Qi(U,Q){let se=j.blockers.get(U)||Dd;return de.get(U)!==Q&&de.set(U,Q),se}function bs(U){j.blockers.delete(U),de.delete(U)}function zo(U,Q){let se=j.blockers.get(U)||Dd;vt(se.state==="unblocked"&&Q.state==="blocked"||se.state==="blocked"&&Q.state==="blocked"||se.state==="blocked"&&Q.state==="proceeding"||se.state==="blocked"&&Q.state==="unblocked"||se.state==="proceeding"&&Q.state==="unblocked",`Invalid blocker state transition: ${se.state} -> ${Q.state}`);let ge=new Map(j.blockers);ge.set(U,Q),Be({blockers:ge})}function Zs({currentLocation:U,nextLocation:Q,historyAction:se}){if(de.size===0)return;de.size>1&&An(!1,"A router only supports one blocker at a time");let ge=Array.from(de.entries()),[Ee,Fe]=ge[ge.length-1],Le=j.blockers.get(Ee);if(!(Le&&Le.state==="proceeding")&&Fe({currentLocation:U,nextLocation:Q,historyAction:se}))return Ee}function Ss(U){let Q=Va(404,{pathname:U}),se=f||d,{matches:ge,route:Ee}=mm(se);return{notFoundMatches:ge,route:Ee,error:Q}}function xn(U,Q,se){if(w=U,E=Q,C=se||null,!R&&j.navigation===dx){R=!0;let ge=gr(j.location,j.matches);ge!=null&&Be({restoreScrollPosition:ge})}return()=>{w=null,E=null,C=null}}function mn(U,Q){return C&&C(U,Q.map(ge=>kk(ge,j.loaderData)))||U.key}function Fn(U,Q){if(w&&E){let se=mn(U,Q);w[se]=E()}}function gr(U,Q){if(w){let se=mn(U,Q),ge=w[se];if(typeof ge=="number")return ge}return null}function Xn(U,Q,se){if(e.patchRoutesOnNavigation)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:zm(Q,se,m,!0)}}else return{active:!0,matches:zm(Q,se,m,!0)||[]};return{active:!1,matches:null}}async function kn(U,Q,se,ge){if(!e.patchRoutesOnNavigation)return{type:"success",matches:U};let Ee=U;for(;;){let Fe=f==null,Le=f||d,ke=c;try{await e.patchRoutesOnNavigation({signal:se,path:Q,matches:Ee,fetcherKey:ge,patch:(Ge,qe)=>{se.aborted||U2(Ge,qe,Le,ke,l,!1)}})}catch(Ge){return{type:"error",error:Ge,partialMatches:Ee}}finally{Fe&&!se.aborted&&(d=[...d])}if(se.aborted)return{type:"aborted"};let Pe=gi(Le,Q,m);if(Pe)return{type:"success",matches:Pe};let ze=zm(Le,Q,m,!0);if(!ze||Ee.length===ze.length&&Ee.every((Ge,qe)=>Ge.route.id===ze[qe].route.id))return{type:"success",matches:null};Ee=ze}}function _r(U){c={},f=af(U,l,void 0,c)}function Hr(U,Q,se=!1){let ge=f==null;U2(U,Q,f||d,c,l,se),ge&&(d=[...d],Be({}))}return D={get basename(){return m},get future(){return v},get state(){return j},get routes(){return d},get window(){return t},initialize:Ne,subscribe:Te,enableScrollRestoration:xn,navigate:Vt,fetch:$,revalidate:jt,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:vn,resetFetcher:_a,deleteFetcher:Fo,dispose:we,getBlocker:Qi,deleteBlocker:bs,patchRoutes:Hr,_internalFetchControllers:B,_internalSetRoutes:_r,_internalSetStateDoNotUseOrYouWillBreakYourApp(U){Be(U)}},e.unstable_instrumentations&&(D=e8(D,e.unstable_instrumentations.map(U=>U.router).filter(Boolean))),D}function m8(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function l0(e,t,n,r,s,l){let c,d;if(s){c=[];for(let m of t)if(c.push(m),m.route.id===s){d=m;break}}else c=t,d=t[t.length-1];let f=Bp(r||".",$p(c),Ba(e.pathname,n)||e.pathname,l==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let m=yb(f.search);if(d.route.index&&!m)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&m){let g=new URLSearchParams(f.search),v=g.getAll("index");g.delete("index"),v.filter(b=>b).forEach(b=>g.append("index",b));let x=g.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=Zk({basename:n,pathname:f.pathname})),Ps(f)}function L2(e,t,n){if(!n||!m8(n))return{path:t};if(n.formMethod&&!A8(n.formMethod))return{path:t,error:Va(405,{method:n.formMethod})};let r=()=>({path:t,error:Va(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=Vj(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Pr(l))return r();let v=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[b,w])=>`${x}${b}=${w}
|
|
59
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:v}}}else if(n.formEncType==="application/json"){if(!Pr(l))return r();try{let v=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:v,text:void 0}}}catch{return r()}}}vt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=d0(n.formData),f=n.formData;else if(n.body instanceof FormData)d=d0(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=$2(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=$2(d)}catch{return r()}let m={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Pr(m.formMethod))return{path:t,submission:m};let g=Ii(t);return e&&g.search&&yb(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Ps(g),submission:m}}function P2(e,t,n,r,s,l,c,d,f,m,g,v,x,b,w,C,E,R,T,_){var F;let O=_?da(_[1])?_[1].error:_[1].data:void 0,A=s.createURL(l.location),D=s.createURL(f),j;if(g&&l.errors){let V=Object.keys(l.errors)[0];j=c.findIndex(I=>I.route.id===V)}else if(_&&da(_[1])){let V=_[0];j=c.findIndex(I=>I.route.id===V)-1}let M=_?_[1].statusCode:void 0,z=M&&M>=400,Z={currentUrl:A,currentParams:((F=l.matches[0])==null?void 0:F.params)||{},nextUrl:D,nextParams:c[0].params,...d,actionResult:O,actionStatus:M},K=pb(c.map(V=>V.route.path)),Y=c.map((V,I)=>{let{route:B}=V,G=null;if(j!=null&&I>j?G=!1:B.lazy?G=!0:vb(B)?g?G=c0(B,l.loaderData,l.errors):p8(l.loaderData,l.matches[I],V)&&(G=!0):G=!1,G!==null)return u0(n,r,e,K,V,m,t,G);let ie=z?!1:v||A.pathname+A.search===D.pathname+D.search||A.search!==D.search||g8(l.matches[I],V),xe={...Z,defaultShouldRevalidate:ie},L=rp(V,xe);return u0(n,r,e,K,V,m,t,L,xe)}),ae=[];return w.forEach((V,I)=>{if(g||!c.some(ee=>ee.route.id===V.routeId)||b.has(I))return;let B=l.fetchers.get(I),G=B&&B.state!=="idle"&&B.data===void 0,ie=gi(E,V.path,R);if(!ie){if(T&&G)return;ae.push({key:I,routeId:V.routeId,path:V.path,matches:null,match:null,request:null,controller:null});return}if(C.has(I))return;let xe=Vm(ie,V.path),L=new AbortController,P=Hc(s,V.path,L.signal),W=null;if(x.has(I))x.delete(I),W=Jc(n,r,P,ie,xe,m,t);else if(G)v&&(W=Jc(n,r,P,ie,xe,m,t));else{let ee={...Z,defaultShouldRevalidate:z?!1:v};rp(xe,ee)&&(W=Jc(n,r,P,ie,xe,m,t,ee))}W&&ae.push({key:I,routeId:V.routeId,path:V.path,matches:W,match:xe,request:P,controller:L})}),{dsMatches:Y,revalidatingFetchers:ae}}function vb(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function c0(e,t,n){if(e.lazy)return!0;if(!vb(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 p8(e,t,n){let r=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return r||s}function g8(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function rp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function U2(e,t,n,r,s,l){let c;if(e){let m=r[e];vt(m,`No route found to patch children into: routeId = ${e}`),m.children||(m.children=[]),c=m.children}else c=n;let d=[],f=[];if(t.forEach(m=>{let g=c.find(v=>Lj(m,v));g?f.push({existingRoute:g,newRoute:m}):d.push(m)}),d.length>0){let m=af(d,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...m)}if(l&&f.length>0)for(let m=0;m<f.length;m++){let{existingRoute:g,newRoute:v}=f[m],x=g,[b]=af([v],s,[],{},!0);Object.assign(x,{element:b.element?b.element:x.element,errorElement:b.errorElement?b.errorElement:x.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:x.hydrateFallbackElement})}}function Lj(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var s;return(s=t.children)==null?void 0:s.some(l=>Lj(n,l))}):!1}var F2=new WeakMap,Pj=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let s=n[t.id];if(vt(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let l=s.lazy[e];if(!l)return;let c=F2.get(s);c||(c={},F2.set(s,c));let d=c[e];if(d)return d;let f=(async()=>{let m=Ak(e),v=s[e]!==void 0&&e!=="hasErrorBoundary";if(m)An(!m,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(v)An(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await l();x!=null&&(Object.assign(s,{[e]:x}),Object.assign(s,r(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(x=>x===void 0)&&(s.lazy=void 0))})();return c[e]=f,f},z2=new WeakMap;function v8(e,t,n,r,s){let l=n[e.id];if(vt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=z2.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let v=(async()=>{vt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),b={};for(let w in x){let C=x[w];if(C===void 0)continue;let E=Ok(w),T=l[w]!==void 0&&w!=="hasErrorBoundary";E?An(!E,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?An(!T,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=C}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return z2.set(l,v),v.catch(()=>{}),{lazyRoutePromise:v,lazyHandlerPromise:v}}let c=Object.keys(e.lazy),d=[],f;for(let g of c){if(s&&s.includes(g))continue;let v=Pj({key:g,route:e,manifest:n,mapRouteProperties:r});v&&(d.push(v),g===t&&(f=v))}let m=d.length>0?Promise.all(d).then(()=>{}):void 0;return m==null||m.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:f}}async function V2(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,l)=>{n[t[l].route.id]=s}),n}async function y8(e){return e.matches.some(t=>t.route.middleware)?Uj(e,()=>V2(e)):V2(e)}function Uj(e,t){return x8(e,t,r=>r,j8,n);function n(r,s,l){if(l)return Promise.resolve(Object.assign(l.value,{[s]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(m=>m.route.id===s),0),Math.max(c.findIndex(m=>m.unstable_shouldCallHandler()),0)),f=vi(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function x8(e,t,n,r,s){let{matches:l,request:c,params:d,context:f,unstable_pattern:m}=e,g=l.flatMap(x=>x.route.middleware?x.route.middleware.map(b=>[x.route.id,b]):[]);return await Fj({request:c,params:d,context:f,unstable_pattern:m},g,t,n,r,s)}async function Fj(e,t,n,r,s,l,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[c];if(!f)return await n();let[m,g]=f,v,x=async()=>{if(v)throw new Error("You may only call `next()` once per middleware");try{return v={value:await Fj(e,t,n,r,s,l,c+1)},v.value}catch(b){return v={value:await l(b,m,v)},v.value}};try{let b=await g(e,x),w=b!=null?r(b):void 0;return s(w)?w:v?w??v.value:(v={value:await x()},v.value)}catch(b){return await l(b,m,v)}}function zj(e,t,n,r,s){let l=Pj({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=v8(r.route,Pr(n.method)?"action":"loader",t,e,s);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function u0(e,t,n,r,s,l,c,d,f=null){let m=!1,g=zj(e,t,n,s,l);return{...s,_lazyPromises:g,shouldLoad:d,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(v){return m=!0,f?typeof v=="boolean"?rp(s,{...f,defaultShouldRevalidate:v}):rp(s,f):d},resolve(v){let{lazy:x,loader:b,middleware:w}=s.route,C=m||d||v&&!Pr(n.method)&&(x||b),E=w&&w.length>0&&!b&&!x;return C&&(Pr(n.method)||!E)?S8({request:n,unstable_pattern:r,match:s,lazyHandlerPromise:g==null?void 0:g.handler,lazyRoutePromise:g==null?void 0:g.route,handlerOverride:v,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function Jc(e,t,n,r,s,l,c,d=null){return r.map(f=>f.route.id!==s.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:zj(e,t,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:u0(e,t,n,pb(r.map(m=>m.route.path)),f,l,c,!0,d))}async function b8(e,t,n,r,s,l){n.some(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(m=>{var g;return(g=m._lazyPromises)==null?void 0:g.middleware}));let c={request:t,unstable_pattern:pb(n.map(m=>m.route.path)),params:n[0].params,context:s,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:m=>{let g=c;return Uj(g,()=>m({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(m=>{var g,v;return[(g=m._lazyPromises)==null?void 0:g.handler,(v=m._lazyPromises)==null?void 0:v.route]}))}catch{}return f}async function S8({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:s,handlerOverride:l,scopedContext:c}){let d,f,m=Pr(e.method),g=m?"action":"loader",v=x=>{let b,w=new Promise((R,T)=>b=T);f=()=>b(),e.signal.addEventListener("abort",f);let C=R=>typeof x!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${n.route.id}]`)):x({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),E=(async()=>{try{return{type:"data",result:await(l?l(T=>C(T)):C())}}catch(R){return{type:"error",result:R}}})();return Promise.race([E,w])};try{let x=m?n.route.action:n.route.loader;if(r||s)if(x){let b,[w]=await Promise.all([v(x).catch(C=>{b=C}),r,s]);if(b!==void 0)throw b;d=w}else{await r;let b=m?n.route.action:n.route.loader;if(b)[d]=await Promise.all([v(b),s]);else if(g==="action"){let w=new URL(e.url),C=w.pathname+w.search;throw Va(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(x)d=await v(x);else{let b=new URL(e.url),w=b.pathname+b.search;throw Va(404,{pathname:w})}}catch(x){return{type:"error",result:x}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function C8(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 w8(e){var r,s,l,c,d,f;let{result:t,type:n}=e;if(Hj(t)){let m;try{m=await C8(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new np(t.status,t.statusText,m),statusCode:t.status,headers:t.headers}:{type:"data",data:m,statusCode:t.status,headers:t.headers}}return n==="error"?Z2(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new np(((l=t.init)==null?void 0:l.status)||500,void 0,t.data),statusCode:sf(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:sf(t)?t.status:void 0}:Z2(t)?{type:"data",data:t.data,statusCode:(d=t.init)==null?void 0:d.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function E8(e,t,n,r,s){let l=e.headers.get("Location");if(vt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!gb(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=l0(new URL(t.url),c,s,l),e.headers.set("Location",l)}return e}function H2(e,t,n){if(gb(e)){let r=e,s=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=Ba(s.pathname,n)!=null;if(s.origin===t.origin&&l)return s.pathname+s.search+s.hash}return e}function Hc(e,t,n,r){let s=e.createURL(Vj(t)).toString(),l={signal:n};if(r&&Pr(r.formMethod)){let{formMethod:c,formEncType:d}=r;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(r.json)):d==="text/plain"?l.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?l.body=d0(r.formData):l.body=r.formData}return new Request(s,l)}function d0(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function $2(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function R8(e,t,n,r=!1,s=!1){let l={},c=null,d,f=!1,m={},g=n&&da(n[1])?n[1].error:void 0;return e.forEach(v=>{if(!(v.route.id in t))return;let x=v.route.id,b=t[x];if(vt(!yl(b),"Cannot handle redirect results in processLoaderData"),da(b)){let w=b.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},s)c[x]=w;else{let C=vi(e,x);c[C.route.id]==null&&(c[C.route.id]=w)}r||(l[x]=Ij),f||(f=!0,d=sf(b.error)?b.error.status:500),b.headers&&(m[x]=b.headers)}else l[x]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=b.statusCode),b.headers&&(m[x]=b.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:m}}function B2(e,t,n,r,s,l){let{loaderData:c,errors:d}=R8(t,n,r);return s.filter(f=>!f.matches||f.matches.some(m=>m.shouldLoad)).forEach(f=>{let{key:m,match:g,controller:v}=f;if(v&&v.signal.aborted)return;let x=l[m];if(vt(x,"Did not find corresponding fetcher result"),da(x)){let b=vi(e.matches,g==null?void 0:g.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(m)}else if(yl(x))vt(!1,"Unhandled fetcher revalidation redirect");else{let b=yo(x.data);e.fetchers.set(m,b)}}),{loaderData:c,errors:d}}function G2(e,t,n,r){let s=Object.entries(t).filter(([,l])=>l!==Ij).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(s[c]=e[c]),r&&r.hasOwnProperty(c))break}return s}function q2(e){return e?da(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function vi(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 mm(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 Va(e,{pathname:t,routeId:n,method:r,type:s,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new np(e||500,c,new Error(d),!0)}function pm(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,s]=t[n];if(yl(s))return{key:r,result:s}}}function Vj(e){let t=typeof e=="string"?Ii(e):e;return Ps({...t,hash:""})}function T8(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function j8(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&_8(n))}function _8(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function N8(e){return Hj(e.result)&&l8.has(e.result.status)}function da(e){return e.type==="error"}function yl(e){return(e&&e.type)==="redirect"}function Z2(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Hj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function A8(e){return i8.has(e.toUpperCase())}function Pr(e){return s8.has(e.toUpperCase())}function yb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Vm(e,t){let n=typeof t=="string"?Ii(t).search:t.search;if(e[e.length-1].route.index&&yb(n||""))return e[e.length-1];let r=Dj(e);return r[r.length-1]}function K2(e){let{formMethod:t,formAction:n,formEncType:r,text:s,formData:l,json:c}=e;if(!(!t||!n||!r)){if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:s};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function fx(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 D8(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 Od(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 O8(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 yo(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function M8(e,t){try{let n=e.sessionStorage.getItem(kj);if(n){let r=JSON.parse(n);for(let[s,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(s,new Set(l||[]))}}catch{}}function k8(e,t){if(t.size>0){let n={};for(let[r,s]of t)n[r]=[...s];try{e.sessionStorage.setItem(kj,JSON.stringify(n))}catch(r){An(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function I8(){let e,t,n=new Promise((r,s)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{s(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Vl=p.createContext(null);Vl.displayName="DataRouter";var Sf=p.createContext(null);Sf.displayName="DataRouterState";p.createContext(!1);var xb=p.createContext({isTransitioning:!1});xb.displayName="ViewTransition";var $j=p.createContext(new Map);$j.displayName="Fetchers";var L8=p.createContext(null);L8.displayName="Await";var ps=p.createContext(null);ps.displayName="Navigation";var Gp=p.createContext(null);Gp.displayName="Location";var Za=p.createContext({outlet:null,matches:[],isDataRoute:!1});Za.displayName="Route";var bb=p.createContext(null);bb.displayName="RouteError";function P8(e,{relative:t}={}){vt(bu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=p.useContext(ps),{hash:s,pathname:l,search:c}=Cf(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:ks([n,l])),r.createHref({pathname:d,search:c,hash:s})}function bu(){return p.useContext(Gp)!=null}function $s(){return vt(bu(),"useLocation() may be used only in the context of a <Router> component."),p.useContext(Gp).location}var Bj="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Gj(e){p.useContext(ps).static||p.useLayoutEffect(e)}function qp(){let{isDataRoute:e}=p.useContext(Za);return e?Q8():U8()}function U8(){vt(bu(),"useNavigate() may be used only in the context of a <Router> component.");let e=p.useContext(Vl),{basename:t,navigator:n}=p.useContext(ps),{matches:r}=p.useContext(Za),{pathname:s}=$s(),l=JSON.stringify($p(r)),c=p.useRef(!1);return Gj(()=>{c.current=!0}),p.useCallback((f,m={})=>{if(An(c.current,Bj),!c.current)return;if(typeof f=="number"){n.go(f);return}let g=Bp(f,JSON.parse(l),s,m.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ks([t,g.pathname])),(m.replace?n.replace:n.push)(g,m.state,m)},[t,n,l,s,e])}var qj=p.createContext(null);function gs(){return p.useContext(qj)}function F8(e){let t=p.useContext(Za).outlet;return p.useMemo(()=>t&&p.createElement(qj.Provider,{value:e},t),[t,e])}function Zj(){let{matches:e}=p.useContext(Za),t=e[e.length-1];return t?t.params:{}}function Cf(e,{relative:t}={}){let{matches:n}=p.useContext(Za),{pathname:r}=$s(),s=JSON.stringify($p(n));return p.useMemo(()=>Bp(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function z8(e,t,n,r,s){vt(bu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=p.useContext(ps),{matches:c}=p.useContext(Za),d=c[c.length-1],f=d?d.params:{},m=d?d.pathname:"/",g=d?d.pathnameBase:"/",v=d&&d.route;{let T=v&&v.path||"";Kj(m,!v||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
-
|
|
61
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let x=$s(),b;b=x;let w=b.pathname||"/",C=w;if(g!=="/"){let T=g.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let E=gi(e,{pathname:C});return An(v||E!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),An(E==null||E[E.length-1].route.element!==void 0||E[E.length-1].route.Component!==void 0||E[E.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),G8(E&&E.map(T=>Object.assign({},T,{params:Object.assign({},f,T.params),pathname:ks([g,l.encodeLocation?l.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?g:ks([g,l.encodeLocation?l.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),c,n,r,s)}function V8(){let e=W8(),t=sf(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=p.createElement(p.Fragment,null,p.createElement("p",null,"💿 Hey developer 👋"),p.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",p.createElement("code",{style:l},"ErrorBoundary")," or"," ",p.createElement("code",{style:l},"errorElement")," prop on your route.")),p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:s},n):null,c)}var H8=p.createElement(V8,null),$8=class extends p.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?p.createElement(Za.Provider,{value:this.props.routeContext},p.createElement(bb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function B8({routeContext:e,match:t,children:n}){let r=p.useContext(Vl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),p.createElement(Za.Provider,{value:e},n)}function G8(e,t=[],n=null,r=null,s=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,c=n==null?void 0:n.errors;if(c!=null){let m=l.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);vt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,m+1))}let d=!1,f=-1;if(n)for(let m=0;m<l.length;m++){let g=l[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=m),g.route.id){let{loaderData:v,errors:x}=n,b=g.route.loader&&!v.hasOwnProperty(g.route.id)&&(!x||x[g.route.id]===void 0);if(g.route.lazy||b){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((m,g,v)=>{let x,b=!1,w=null,C=null;n&&(x=c&&g.route.id?c[g.route.id]:void 0,w=g.route.errorElement||H8,d&&(f<0&&v===0?(Kj("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,C=null):f===v&&(b=!0,C=g.route.hydrateFallbackElement||null)));let E=t.concat(l.slice(0,v+1)),R=()=>{let T;return x?T=w:b?T=C:g.route.Component?T=p.createElement(g.route.Component,null):g.route.element?T=g.route.element:T=m,p.createElement(B8,{match:g,routeContext:{outlet:m,matches:E,isDataRoute:n!=null},children:T})};return n&&(g.route.ErrorBoundary||g.route.errorElement||v===0)?p.createElement($8,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:R(),routeContext:{outlet:null,matches:E,isDataRoute:!0},unstable_onError:r}):R()},null)}function Sb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function q8(e){let t=p.useContext(Vl);return vt(t,Sb(e)),t}function Z8(e){let t=p.useContext(Sf);return vt(t,Sb(e)),t}function K8(e){let t=p.useContext(Za);return vt(t,Sb(e)),t}function Cb(e){let t=K8(e),n=t.matches[t.matches.length-1];return vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Y8(){return Cb("useRouteId")}function W8(){var r;let e=p.useContext(bb),t=Z8("useRouteError"),n=Cb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function Q8(){let{router:e}=q8("useNavigate"),t=Cb("useNavigate"),n=p.useRef(!1);return Gj(()=>{n.current=!0}),p.useCallback(async(s,l={})=>{An(n.current,Bj),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...l}))},[e,t])}var Y2={};function Kj(e,t,n){!t&&!Y2[e]&&(Y2[e]=!0,An(!1,n))}var W2={};function Q2(e,t){!e&&!W2[t]&&(W2[t]=!0,console.warn(t))}function X8(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&An(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:p.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&An(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&An(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var J8=["HydrateFallback","hydrateFallbackElement"],eI=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 tI({router:e,flushSync:t,unstable_onError:n}){let[r,s]=p.useState(e.state),[l,c]=p.useState(),[d,f]=p.useState({isTransitioning:!1}),[m,g]=p.useState(),[v,x]=p.useState(),[b,w]=p.useState(),C=p.useRef(new Map),E=p.useCallback(A=>{s(D=>(A.errors&&n&&Object.entries(A.errors).forEach(([j,M])=>{var z;((z=D.errors)==null?void 0:z[j])!==M&&n(M)}),A))},[n]),R=p.useCallback((A,{deletedFetchers:D,flushSync:j,viewTransitionOpts:M})=>{A.fetchers.forEach((Z,K)=>{Z.data!==void 0&&C.current.set(K,Z.data)}),D.forEach(Z=>C.current.delete(Z)),Q2(j===!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 z=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Q2(M==null||z,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!M||!z){t&&j?t(()=>E(A)):p.startTransition(()=>E(A));return}if(t&&j){t(()=>{v&&(m&&m.resolve(),v.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let Z=e.window.document.startViewTransition(()=>{t(()=>E(A))});Z.finished.finally(()=>{t(()=>{g(void 0),x(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>x(Z));return}v?(m&&m.resolve(),v.skipTransition(),w({state:A,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(c(A),f({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[e.window,t,v,m,E]);p.useLayoutEffect(()=>e.subscribe(R),[e,R]),p.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new eI)},[d]),p.useEffect(()=>{if(m&&l&&e.window){let A=l,D=m.promise,j=e.window.document.startViewTransition(async()=>{p.startTransition(()=>E(A)),await D});j.finished.finally(()=>{g(void 0),x(void 0),c(void 0),f({isTransitioning:!1})}),x(j)}},[l,m,e.window,E]),p.useEffect(()=>{m&&l&&r.location.key===l.location.key&&m.resolve()},[m,v,r.location,l]),p.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]);let T=p.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,D,j)=>e.navigate(A,{state:D,preventScrollReset:j==null?void 0:j.preventScrollReset}),replace:(A,D,j)=>e.navigate(A,{replace:!0,state:D,preventScrollReset:j==null?void 0:j.preventScrollReset})}),[e]),_=e.basename||"/",O=p.useMemo(()=>({router:e,navigator:T,static:!1,basename:_,unstable_onError:n}),[e,T,_,n]);return p.createElement(p.Fragment,null,p.createElement(Vl.Provider,{value:O},p.createElement(Sf.Provider,{value:r},p.createElement($j.Provider,{value:C.current},p.createElement(xb.Provider,{value:d},p.createElement(sI,{basename:_,location:r.location,navigationType:r.historyAction,navigator:T},p.createElement(nI,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var nI=p.memo(rI);function rI({routes:e,future:t,state:n,unstable_onError:r}){return z8(e,void 0,n,r,t)}function aI({to:e,replace:t,state:n,relative:r}){vt(bu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=p.useContext(ps);An(!s,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:l}=p.useContext(Za),{pathname:c}=$s(),d=qp(),f=Bp(e,$p(l),c,r==="path"),m=JSON.stringify(f);return p.useEffect(()=>{d(JSON.parse(m),{replace:t,state:n,relative:r})},[d,m,r,t,n]),null}function Yj(e){return F8(e.context)}function sI({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:l=!1}){vt(!bu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=p.useMemo(()=>({basename:c,navigator:s,static:l,future:{}}),[c,s,l]);typeof n=="string"&&(n=Ii(n));let{pathname:f="/",search:m="",hash:g="",state:v=null,key:x="default"}=n,b=p.useMemo(()=>{let w=Ba(f,c);return w==null?null:{location:{pathname:w,search:m,hash:g,state:v,key:x},navigationType:r}},[c,f,m,g,v,x,r]);return An(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:p.createElement(ps.Provider,{value:d},p.createElement(Gp.Provider,{children:t,value:b}))}var Hm="get",$m="application/x-www-form-urlencoded";function Zp(e){return e!=null&&typeof e.tagName=="string"}function oI(e){return Zp(e)&&e.tagName.toLowerCase()==="button"}function iI(e){return Zp(e)&&e.tagName.toLowerCase()==="form"}function lI(e){return Zp(e)&&e.tagName.toLowerCase()==="input"}function cI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uI(e,t){return e.button===0&&(!t||t==="_self")&&!cI(e)}function f0(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 dI(e,t){let n=f0(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(l=>{n.append(s,l)})}),n}var gm=null;function fI(){if(gm===null)try{new FormData(document.createElement("form"),0),gm=!1}catch{gm=!0}return gm}var hI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function hx(e){return e!=null&&!hI.has(e)?(An(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$m}"`),null):e}function mI(e,t){let n,r,s,l,c;if(iI(e)){let d=e.getAttribute("action");r=d?Ba(d,t):null,n=e.getAttribute("method")||Hm,s=hx(e.getAttribute("enctype"))||$m,l=new FormData(e)}else if(oI(e)||lI(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?Ba(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Hm,s=hx(e.getAttribute("formenctype"))||hx(d.getAttribute("enctype"))||$m,l=new FormData(d,e),!fI()){let{name:m,type:g,value:v}=e;if(g==="image"){let x=m?`${m}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else m&&l.append(m,v)}}else{if(Zp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Hm,r=null,s=$m,c=e}return l&&s==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function wb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function pI(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&&Ba(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function gI(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 vI(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 yI(e,t,n){let r=await Promise.all(e.map(async s=>{let l=t.routes[s.route.id];if(l){let c=await gI(l,n);return c.links?c.links():[]}return[]}));return CI(r.flat(1).filter(vI).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function X2(e,t,n,r,s,l){let c=(f,m)=>n[m]?f.route.id!==n[m].route.id:!0,d=(f,m)=>{var g;return n[m].pathname!==f.pathname||((g=n[m].route.path)==null?void 0:g.endsWith("*"))&&n[m].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,m)=>c(f,m)||d(f,m)):l==="data"?t.filter((f,m)=>{var v;let g=r.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(c(f,m)||d(f,m))return!0;if(f.route.shouldRevalidate){let x=f.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((v=n[0])==null?void 0:v.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function xI(e,t,{includeHydrateFallback:n}={}){return bI(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let l=[s.module];return s.clientActionModule&&(l=l.concat(s.clientActionModule)),s.clientLoaderModule&&(l=l.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(l=l.concat(s.hydrateFallbackModule)),s.imports&&(l=l.concat(s.imports)),l}).flat(1))}function bI(e){return[...new Set(e)]}function SI(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function CI(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let l=JSON.stringify(SI(s));return n.has(l)||(n.add(l),r.push({key:l,link:s})),r},[])}function Wj(){let e=p.useContext(Vl);return wb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wI(){let e=p.useContext(Sf);return wb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Eb=p.createContext(void 0);Eb.displayName="FrameworkContext";function Qj(){let e=p.useContext(Eb);return wb(e,"You must render this element inside a <HydratedRouter> element"),e}function EI(e,t){let n=p.useContext(Eb),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:m,onMouseLeave:g,onTouchStart:v}=t,x=p.useRef(null);p.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let C=R=>{R.forEach(T=>{c(T.isIntersecting)})},E=new IntersectionObserver(C,{threshold:.5});return x.current&&E.observe(x.current),()=>{E.disconnect()}}},[e]),p.useEffect(()=>{if(r){let C=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(C)}}},[r]);let b=()=>{s(!0)},w=()=>{s(!1),c(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:Md(d,b),onBlur:Md(f,w),onMouseEnter:Md(m,b),onMouseLeave:Md(g,w),onTouchStart:Md(v,b)}]:[!1,x,{}]}function Md(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function RI({page:e,...t}){let{router:n}=Wj(),r=p.useMemo(()=>gi(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?p.createElement(jI,{page:e,matches:r,...t}):null}function TI(e){let{manifest:t,routeModules:n}=Qj(),[r,s]=p.useState([]);return p.useEffect(()=>{let l=!1;return yI(e,t,n).then(c=>{l||s(c)}),()=>{l=!0}},[e,t,n]),r}function jI({page:e,matches:t,...n}){let r=$s(),{manifest:s,routeModules:l}=Qj(),{basename:c}=Wj(),{loaderData:d,matches:f}=wI(),m=p.useMemo(()=>X2(e,t,f,s,r,"data"),[e,t,f,s,r]),g=p.useMemo(()=>X2(e,t,f,s,r,"assets"),[e,t,f,s,r]),v=p.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,C=!1;if(t.forEach(R=>{var _;let T=s.routes[R.route.id];!T||!T.hasLoader||(!m.some(O=>O.route.id===R.route.id)&&R.route.id in d&&((_=l[R.route.id])!=null&&_.shouldRevalidate)||T.hasClientLoader?C=!0:w.add(R.route.id))}),w.size===0)return[];let E=pI(e,c,"data");return C&&w.size>0&&E.searchParams.set("_routes",t.filter(R=>w.has(R.route.id)).map(R=>R.route.id).join(",")),[E.pathname+E.search]},[c,d,r,s,m,t,e,l]),x=p.useMemo(()=>xI(g,s),[g,s]),b=TI(g);return p.createElement(p.Fragment,null,v.map(w=>p.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),x.map(w=>p.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:C})=>p.createElement("link",{key:w,nonce:n.nonce,...C})))}function _I(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Xj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Xj&&(window.__reactRouterVersion="7.9.5")}catch{}function NI(e,t){return h8({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:Tk({window:t==null?void 0:t.window}),hydrationData:AI(),routes:e,mapRouteProperties:X8,hydrationRouteProperties:J8,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 AI(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:DI(e.errors)}),e}function DI(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 np(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let l=window[s.__subType];if(typeof l=="function")try{let c=new l(s.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(s.message);l.stack="",n[r]=l}}else n[r]=s;return n}var Jj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ga=p.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:l,replace:c,state:d,target:f,to:m,preventScrollReset:g,viewTransition:v,...x},b){let{basename:w}=p.useContext(ps),C=typeof m=="string"&&Jj.test(m),E,R=!1;if(typeof m=="string"&&C&&(E=m,Xj))try{let z=new URL(window.location.href),Z=m.startsWith("//")?new URL(z.protocol+m):new URL(m),K=Ba(Z.pathname,w);Z.origin===z.origin&&K!=null?m=K+Z.search+Z.hash:R=!0}catch{An(!1,`<Link to="${m}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let T=P8(m,{relative:s}),[_,O,A]=EI(r,x),D=kI(m,{replace:c,state:d,target:f,preventScrollReset:g,relative:s,viewTransition:v});function j(z){t&&t(z),z.defaultPrevented||D(z)}let M=p.createElement("a",{...x,...A,href:E||T,onClick:R||l?t:j,ref:_I(b,O),target:f,"data-discover":!C&&n==="render"?"true":void 0});return _&&!C?p.createElement(p.Fragment,null,M,p.createElement(RI,{page:T})):M});Ga.displayName="Link";var wf=p.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:l,to:c,viewTransition:d,children:f,...m},g){let v=Cf(c,{relative:m.relative}),x=$s(),b=p.useContext(Sf),{navigator:w,basename:C}=p.useContext(ps),E=b!=null&&zI(v)&&d===!0,R=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,T=x.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(T=T.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&C&&(_=Ba(_,C)||_);const O=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=T===R||!s&&T.startsWith(R)&&T.charAt(O)==="/",D=_!=null&&(_===R||!s&&_.startsWith(R)&&_.charAt(R.length)==="/"),j={isActive:A,isPending:D,isTransitioning:E},M=A?t:void 0,z;typeof r=="function"?z=r(j):z=[r,A?"active":null,D?"pending":null,E?"transitioning":null].filter(Boolean).join(" ");let Z=typeof l=="function"?l(j):l;return p.createElement(Ga,{...m,"aria-current":M,className:z,ref:g,style:Z,to:c,viewTransition:d},typeof f=="function"?f(j):f)});wf.displayName="NavLink";var OI=p.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:l,method:c=Hm,action:d,onSubmit:f,relative:m,preventScrollReset:g,viewTransition:v,...x},b)=>{let w=UI(),C=FI(d,{relative:m}),E=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&Jj.test(d),T=_=>{if(f&&f(_),_.defaultPrevented)return;_.preventDefault();let O=_.nativeEvent.submitter,A=(O==null?void 0:O.getAttribute("formmethod"))||c;w(O||_.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:s,state:l,relative:m,preventScrollReset:g,viewTransition:v})};return p.createElement("form",{ref:b,method:E,action:C,onSubmit:r?f:T,...x,"data-discover":!R&&e==="render"?"true":void 0})});OI.displayName="Form";function MI(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function e_(e){let t=p.useContext(Vl);return vt(t,MI(e)),t}function kI(e,{target:t,replace:n,state:r,preventScrollReset:s,relative:l,viewTransition:c}={}){let d=qp(),f=$s(),m=Cf(e,{relative:l});return p.useCallback(g=>{if(uI(g,t)){g.preventDefault();let v=n!==void 0?n:Ps(f)===Ps(m);d(e,{replace:v,state:r,preventScrollReset:s,relative:l,viewTransition:c})}},[f,d,m,n,r,t,e,s,l,c])}function II(e){An(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=p.useRef(f0(e)),n=p.useRef(!1),r=$s(),s=p.useMemo(()=>dI(r.search,n.current?null:t.current),[r.search]),l=qp(),c=p.useCallback((d,f)=>{const m=f0(typeof d=="function"?d(new URLSearchParams(s)):d);n.current=!0,l("?"+m,f)},[l,s]);return[s,c]}var LI=0,PI=()=>`__${String(++LI)}__`;function UI(){let{router:e}=e_("useSubmit"),{basename:t}=p.useContext(ps),n=Y8();return p.useCallback(async(r,s={})=>{let{action:l,method:c,encType:d,formData:f,body:m}=mI(r,t);if(s.navigate===!1){let g=s.fetcherKey||PI();await e.fetch(g,n,s.action||l,{preventScrollReset:s.preventScrollReset,formData:f,body:m,formMethod:s.method||c,formEncType:s.encType||d,flushSync:s.flushSync})}else await e.navigate(s.action||l,{preventScrollReset:s.preventScrollReset,formData:f,body:m,formMethod:s.method||c,formEncType:s.encType||d,replace:s.replace,state:s.state,fromRouteId:n,flushSync:s.flushSync,viewTransition:s.viewTransition})},[e,t,n])}function FI(e,{relative:t}={}){let{basename:n}=p.useContext(ps),r=p.useContext(Za);vt(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),l={...Cf(e||".",{relative:t})},c=$s();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),f=d.getAll("index");if(f.some(g=>g==="")){d.delete("index"),f.filter(v=>v).forEach(v=>d.append("index",v));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:ks([n,l.pathname])),Ps(l)}function zI(e,{relative:t}={}){let n=p.useContext(xb);vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=e_("useViewTransitionState"),s=Cf(e,{relative:t});if(!n.isTransitioning)return!1;let l=Ba(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Ba(n.nextLocation.pathname,r)||n.nextLocation.pathname;return tp(s.pathname,c)!=null||tp(s.pathname,l)!=null}var is=Tj();const VI=Ej(is);function HI(e){return p.createElement(tI,{flushSync:is.flushSync,...e})}function J2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Do(...e){return t=>{let n=!1;const r=e.map(s=>{const l=J2(s,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let s=0;s<r.length;s++){const l=r[s];typeof l=="function"?l():J2(e[s],null)}}}}function pt(...e){return p.useCallback(Do(...e),e)}function _i(e){const t=$I(e),n=p.forwardRef((r,s)=>{const{children:l,...c}=r,d=p.Children.toArray(l),f=d.find(BI);if(f){const m=f.props.children,g=d.map(v=>v===f?p.Children.count(m)>1?p.Children.only(null):p.isValidElement(m)?m.props.children:null:v);return o.jsx(t,{...c,ref:s,children:p.isValidElement(m)?p.cloneElement(m,void 0,g):null})}return o.jsx(t,{...c,ref:s,children:l})});return n.displayName=`${e}.Slot`,n}var Kp=_i("Slot");function $I(e){const t=p.forwardRef((n,r)=>{const{children:s,...l}=n;if(p.isValidElement(s)){const c=qI(s),d=GI(l,s.props);return s.type!==p.Fragment&&(d.ref=r?Do(r,c):c),p.cloneElement(s,d)}return p.Children.count(s)>1?p.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var t_=Symbol("radix.slottable");function n_(e){const t=({children:n})=>o.jsx(o.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=t_,t}function BI(e){return p.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===t_}function GI(e,t){const n={...t};for(const r in t){const s=e[r],l=t[r];/^on[A-Z]/.test(r)?s&&l?n[r]=(...d)=>{const f=l(...d);return s(...d),f}:s&&(n[r]=s):r==="style"?n[r]={...s,...l}:r==="className"&&(n[r]=[s,l].filter(Boolean).join(" "))}return{...e,...n}}function qI(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 r_(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=r_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function a_(){for(var e,t,n=0,r="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=r_(e))&&(r&&(r+=" "),r+=t);return r}const eR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,tR=a_,Ef=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return tR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:l}=t,c=Object.keys(s).map(m=>{const g=n==null?void 0:n[m],v=l==null?void 0:l[m];if(g===null)return null;const x=eR(g)||eR(v);return s[m][x]}),d=n&&Object.entries(n).reduce((m,g)=>{let[v,x]=g;return x===void 0||(m[v]=x),m},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,g)=>{let{class:v,className:x,...b}=g;return Object.entries(b).every(w=>{let[C,E]=w;return Array.isArray(E)?E.includes({...l,...d}[C]):{...l,...d}[C]===E})?[...m,v,x]:m},[]);return tR(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 ZI=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s_=(...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 KI={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 YI=p.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:l,iconNode:c,...d},f)=>p.createElement("svg",{ref:f,...KI,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:s_("lucide",s),...d},[...c.map(([m,g])=>p.createElement(m,g)),...Array.isArray(l)?l:[l]]));/**
|
|
77
|
-
* @license lucide-react v0.475.0 - ISC
|
|
78
|
-
*
|
|
79
|
-
* This source code is licensed under the ISC license.
|
|
80
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
81
|
-
*/const Oe=(e,t)=>{const n=p.forwardRef(({className:r,...s},l)=>p.createElement(YI,{ref:l,iconNode:t,className:s_(`lucide-${ZI(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 WI=[["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"}]],Rb=Oe("ArchiveRestore",WI);/**
|
|
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 QI=[["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"}]],nR=Oe("ArrowDownZA",QI);/**
|
|
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 XI=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],JI=Oe("ArrowLeft",XI);/**
|
|
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 e9=[["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"}]],t9=Oe("ArrowRightLeft",e9);/**
|
|
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 n9=[["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"}]],rR=Oe("ArrowUpAZ",n9);/**
|
|
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 r9=[["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"}]],aR=Oe("ArrowUpDown",r9);/**
|
|
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 a9=[["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"}]],s9=Oe("Asterisk",a9);/**
|
|
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 o9=[["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"}]],i9=Oe("BadgeAlert",o9);/**
|
|
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 l9=[["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"}]],c9=Oe("BookOpen",l9);/**
|
|
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 u9=[["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"}]],ap=Oe("Box",u9);/**
|
|
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 d9=[["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"}]],f9=Oe("BriefcaseBusiness",d9);/**
|
|
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 h9=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],fr=Oe("Check",h9);/**
|
|
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 m9=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ka=Oe("ChevronDown",m9);/**
|
|
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 p9=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],g9=Oe("ChevronLeft",p9);/**
|
|
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 v9=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ta=Oe("ChevronRight",v9);/**
|
|
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 y9=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Us=Oe("ChevronUp",y9);/**
|
|
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 x9=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],b9=Oe("ChevronsDownUp",x9);/**
|
|
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 S9=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Tb=Oe("ChevronsUpDown",S9);/**
|
|
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 C9=[["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"}]],Rf=Oe("CircleAlert",C9);/**
|
|
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 w9=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],E9=Oe("CircleCheckBig",w9);/**
|
|
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 R9=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Yp=Oe("CircleCheck",R9);/**
|
|
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 T9=[["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"}]],sp=Oe("CircleX",T9);/**
|
|
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 j9=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],jb=Oe("Code",j9);/**
|
|
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 _9=[["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"}]],N9=Oe("Columns3",_9);/**
|
|
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 A9=[["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"}]],of=Oe("Copy",A9);/**
|
|
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 D9=[["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"}]],O9=Oe("DatabaseZap",D9);/**
|
|
212
|
-
* @license lucide-react v0.475.0 - ISC
|
|
213
|
-
*
|
|
214
|
-
* This source code is licensed under the ISC license.
|
|
215
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
-
*/const M9=[["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"}]],cu=Oe("Database",M9);/**
|
|
217
|
-
* @license lucide-react v0.475.0 - ISC
|
|
218
|
-
*
|
|
219
|
-
* This source code is licensed under the ISC license.
|
|
220
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
-
*/const k9=[["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"}]],I9=Oe("Download",k9);/**
|
|
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 L9=[["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"}]],P9=Oe("EllipsisVertical",L9);/**
|
|
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 U9=[["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"}]],Ya=Oe("Ellipsis",U9);/**
|
|
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 F9=[["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"}]],_l=Oe("ExternalLink",F9);/**
|
|
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 z9=[["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"}]],V9=Oe("EyeOff",z9);/**
|
|
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 H9=[["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"}]],o_=Oe("Eye",H9);/**
|
|
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 $9=[["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"}]],B9=Oe("FileText",$9);/**
|
|
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 G9=[["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"}]],sR=Oe("Gem",G9);/**
|
|
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 q9=[["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"}]],Z9=Oe("GraduationCap",q9);/**
|
|
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 K9=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Y9=Oe("GripVertical",K9);/**
|
|
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 W9=[["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"}]],Q9=Oe("Grip",W9);/**
|
|
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 X9=[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]],J9=Oe("Hand",X9);/**
|
|
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 eL=[["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"}]],tL=Oe("History",eL);/**
|
|
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 nL=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Fr=Oe("Info",nL);/**
|
|
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 rL=[["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"}]],h0=Oe("KeyRound",rL);/**
|
|
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 aL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Tf=Oe("LoaderCircle",aL);/**
|
|
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 sL=[["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"}]],oL=Oe("Lock",sL);/**
|
|
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 iL=[["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"}]],lL=Oe("LogOut",iL);/**
|
|
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 cL=[["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"}]],uL=Oe("Menu",cL);/**
|
|
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 dL=[["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"}]],fL=Oe("MessageCircleQuestion",dL);/**
|
|
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 hL=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],mL=Oe("MessageCircle",hL);/**
|
|
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 pL=[["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"}]],i_=Oe("Monitor",pL);/**
|
|
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 gL=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],l_=Oe("Moon",gL);/**
|
|
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 vL=[["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"}]],yL=Oe("OctagonAlert",vL);/**
|
|
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 xL=[["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"}]],bL=Oe("OctagonX",xL);/**
|
|
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 SL=[["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"}]],CL=Oe("PackageSearch",SL);/**
|
|
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 wL=[["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"}]],EL=Oe("PenLine",wL);/**
|
|
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 RL=[["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"}]],jf=Oe("Pencil",RL);/**
|
|
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 TL=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],_b=Oe("Play",TL);/**
|
|
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 jL=[["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"}]],Nb=Oe("Plug",jL);/**
|
|
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 _L=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ja=Oe("Plus",_L);/**
|
|
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 NL=[["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"}]],AL=Oe("RefreshCw",NL);/**
|
|
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 DL=[["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"}]],OL=Oe("Scale",DL);/**
|
|
382
|
-
* @license lucide-react v0.475.0 - ISC
|
|
383
|
-
*
|
|
384
|
-
* This source code is licensed under the ISC license.
|
|
385
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const ML=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Hl=Oe("Search",ML);/**
|
|
387
|
-
* @license lucide-react v0.475.0 - ISC
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the ISC license.
|
|
390
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const kL=[["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"}]],c_=Oe("Settings",kL);/**
|
|
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 IL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],LL=Oe("SquarePlay",IL);/**
|
|
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 PL=[["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"}]],u_=Oe("Sun",PL);/**
|
|
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 UL=[["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"}]],FL=Oe("Table",UL);/**
|
|
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 zL=[["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"}]],VL=Oe("Telescope",zL);/**
|
|
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 HL=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Ab=Oe("Timer",HL);/**
|
|
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 $L=[["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"}]],Lo=Oe("Trash2",$L);/**
|
|
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 BL=[["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"}]],Wp=Oe("TriangleAlert",BL);/**
|
|
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 GL=[["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"}]],lf=Oe("Unplug",GL);/**
|
|
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 qL=[["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"}]],oR=Oe("Users",qL);/**
|
|
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 ZL=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uu=Oe("X",ZL),mx=768;function KL(){const[e,t]=p.useState(void 0);return p.useEffect(()=>{const n=window.matchMedia(`(max-width: ${mx-1}px)`),r=()=>{t(window.innerWidth<mx)};return n.addEventListener("change",r),t(window.innerWidth<mx),()=>n.removeEventListener("change",r)},[]),!!e}const Db="-",YL=e=>{const t=QL(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const d=c.split(Db);return d[0]===""&&d.length!==1&&d.shift(),d_(d,t)||WL(c)},getConflictingClassGroupIds:(c,d)=>{const f=n[c]||[];return d&&r[c]?[...f,...r[c]]:f}}},d_=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),s=r?d_(e.slice(1),r):void 0;if(s)return s;if(t.validators.length===0)return;const l=e.join(Db);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},iR=/^\[(.+)\]$/,WL=e=>{if(iR.test(e)){const t=iR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},QL=e=>{const{theme:t,classGroups:n}=e,r={nextPart:new Map,validators:[]};for(const s in n)m0(n[s],r,s,t);return r},m0=(e,t,n,r)=>{e.forEach(s=>{if(typeof s=="string"){const l=s===""?t:lR(t,s);l.classGroupId=n;return}if(typeof s=="function"){if(XL(s)){m0(s(r),t,n,r);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([l,c])=>{m0(c,lR(t,l),n,r)})})},lR=(e,t)=>{let n=e;return t.split(Db).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},XL=e=>e.isThemeGetter,JL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const s=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=r.get(l))!==void 0)return s(l,c),c},set(l,c){n.has(l)?n.set(l,c):s(l,c)}}},p0="!",g0=":",e7=g0.length,t7=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=s=>{const l=[];let c=0,d=0,f=0,m;for(let w=0;w<s.length;w++){let C=s[w];if(c===0&&d===0){if(C===g0){l.push(s.slice(f,w)),f=w+e7;continue}if(C==="/"){m=w;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const g=l.length===0?s:s.substring(f),v=n7(g),x=v!==g,b=m&&m>f?m-f:void 0;return{modifiers:l,hasImportantModifier:x,baseClassName:v,maybePostfixModifierPosition:b}};if(t){const s=t+g0,l=r;r=c=>c.startsWith(s)?l(c.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:c,maybePostfixModifierPosition:void 0}}if(n){const s=r;r=l=>n({className:l,parseClassName:s})}return r},n7=e=>e.endsWith(p0)?e.substring(0,e.length-1):e.startsWith(p0)?e.substring(1):e,r7=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let l=[];return r.forEach(c=>{c[0]==="["||t[c]?(s.push(...l.sort(),c),l=[]):l.push(c)}),s.push(...l.sort()),s}},a7=e=>({cache:JL(e.cacheSize),parseClassName:t7(e),sortModifiers:r7(e),...YL(e)}),s7=/\s+/,o7=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:l}=t,c=[],d=e.trim().split(s7);let f="";for(let m=d.length-1;m>=0;m-=1){const g=d[m],{isExternal:v,modifiers:x,hasImportantModifier:b,baseClassName:w,maybePostfixModifierPosition:C}=n(g);if(v){f=g+(f.length>0?" "+f:f);continue}let E=!!C,R=r(E?w.substring(0,C):w);if(!R){if(!E){f=g+(f.length>0?" "+f:f);continue}if(R=r(w),!R){f=g+(f.length>0?" "+f:f);continue}E=!1}const T=l(x).join(":"),_=b?T+p0:T,O=_+R;if(c.includes(O))continue;c.push(O);const A=s(R,E);for(let D=0;D<A.length;++D){const j=A[D];c.push(_+j)}f=g+(f.length>0?" "+f:f)}return f};function i7(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=f_(t))&&(r&&(r+=" "),r+=n);return r}const f_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=f_(e[r]))&&(n&&(n+=" "),n+=t);return n};function l7(e,...t){let n,r,s,l=c;function c(f){const m=t.reduce((g,v)=>v(g),e());return n=a7(m),r=n.cache.get,s=n.cache.set,l=d,d(f)}function d(f){const m=r(f);if(m)return m;const g=o7(f,n);return s(f,g),g}return function(){return l(i7.apply(null,arguments))}}const tr=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},h_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,m_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,c7=/^\d+\/\d+$/,u7=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d7=/\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$/,f7=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,h7=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,m7=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Mc=e=>c7.test(e),gt=e=>!!e&&!Number.isNaN(Number(e)),di=e=>!!e&&Number.isInteger(Number(e)),px=e=>e.endsWith("%")&>(e.slice(0,-1)),po=e=>u7.test(e),p7=()=>!0,g7=e=>d7.test(e)&&!f7.test(e),p_=()=>!1,v7=e=>h7.test(e),y7=e=>m7.test(e),x7=e=>!Ze(e)&&!Ke(e),b7=e=>Su(e,y_,p_),Ze=e=>h_.test(e),ml=e=>Su(e,x_,g7),gx=e=>Su(e,R7,gt),cR=e=>Su(e,g_,p_),S7=e=>Su(e,v_,y7),vm=e=>Su(e,b_,v7),Ke=e=>m_.test(e),kd=e=>Cu(e,x_),C7=e=>Cu(e,T7),uR=e=>Cu(e,g_),w7=e=>Cu(e,y_),E7=e=>Cu(e,v_),ym=e=>Cu(e,b_,!0),Su=(e,t,n)=>{const r=h_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Cu=(e,t,n=!1)=>{const r=m_.exec(e);return r?r[1]?t(r[1]):n:!1},g_=e=>e==="position"||e==="percentage",v_=e=>e==="image"||e==="url",y_=e=>e==="length"||e==="size"||e==="bg-size",x_=e=>e==="length",R7=e=>e==="number",T7=e=>e==="family-name",b_=e=>e==="shadow",j7=()=>{const e=tr("color"),t=tr("font"),n=tr("text"),r=tr("font-weight"),s=tr("tracking"),l=tr("leading"),c=tr("breakpoint"),d=tr("container"),f=tr("spacing"),m=tr("radius"),g=tr("shadow"),v=tr("inset-shadow"),x=tr("text-shadow"),b=tr("drop-shadow"),w=tr("blur"),C=tr("perspective"),E=tr("aspect"),R=tr("ease"),T=tr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...O(),Ke,Ze],D=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],M=()=>[Ke,Ze,f],z=()=>[Mc,"full","auto",...M()],Z=()=>[di,"none","subgrid",Ke,Ze],K=()=>["auto",{span:["full",di,Ke,Ze]},di,Ke,Ze],Y=()=>[di,"auto",Ke,Ze],ae=()=>["auto","min","max","fr",Ke,Ze],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],I=()=>["auto",...M()],B=()=>[Mc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],G=()=>[e,Ke,Ze],ie=()=>[...O(),uR,cR,{position:[Ke,Ze]}],xe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",w7,b7,{size:[Ke,Ze]}],P=()=>[px,kd,ml],W=()=>["","none","full",m,Ke,Ze],ee=()=>["",gt,kd,ml],de=()=>["solid","dashed","dotted","double"],ve=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],le=()=>[gt,px,uR,cR],Ne=()=>["","none",w,Ke,Ze],we=()=>["none",gt,Ke,Ze],Te=()=>["none",gt,Ke,Ze],Be=()=>[gt,Ke,Ze],Xe=()=>[Mc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[po],breakpoint:[po],color:[p7],container:[po],"drop-shadow":[po],ease:["in","out","in-out"],font:[x7],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[po],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[po],shadow:[po],spacing:["px",gt],text:[po],"text-shadow":[po],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Mc,Ze,Ke,E]}],container:["container"],columns:[{columns:[gt,Ze,Ke,d]}],"break-after":[{"break-after":_()}],"break-before":[{"break-before":_()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[di,"auto",Ke,Ze]}],basis:[{basis:[Mc,"full","auto",d,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[gt,Mc,"auto","initial","none",Ze]}],grow:[{grow:["",gt,Ke,Ze]}],shrink:[{shrink:["",gt,Ke,Ze]}],order:[{order:[di,"first","last","none",Ke,Ze]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"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:B()}],w:[{w:[d,"screen",...B()]}],"min-w":[{"min-w":[d,"screen","none",...B()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",n,kd,ml]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ke,gx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",px,Ze]}],"font-family":[{font:[C7,Ze,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,Ke,Ze]}],"line-clamp":[{"line-clamp":[gt,"none",Ke,gx]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",Ke,Ze]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ke,Ze]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:G()}],"text-color":[{text:G()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...de(),"wavy"]}],"text-decoration-thickness":[{decoration:[gt,"from-font","auto",Ke,ml]}],"text-decoration-color":[{decoration:G()}],"underline-offset":[{"underline-offset":[gt,"auto",Ke,Ze]}],"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",Ke,Ze]}],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",Ke,Ze]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:xe()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},di,Ke,Ze],radial:["",Ke,Ze],conic:[di,Ke,Ze]},E7,S7]}],"bg-color":[{bg:G()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:G()}],"gradient-via":[{via:G()}],"gradient-to":[{to:G()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...de(),"hidden","none"]}],"divide-style":[{divide:[...de(),"hidden","none"]}],"border-color":[{border:G()}],"border-color-x":[{"border-x":G()}],"border-color-y":[{"border-y":G()}],"border-color-s":[{"border-s":G()}],"border-color-e":[{"border-e":G()}],"border-color-t":[{"border-t":G()}],"border-color-r":[{"border-r":G()}],"border-color-b":[{"border-b":G()}],"border-color-l":[{"border-l":G()}],"divide-color":[{divide:G()}],"outline-style":[{outline:[...de(),"none","hidden"]}],"outline-offset":[{"outline-offset":[gt,Ke,Ze]}],"outline-w":[{outline:["",gt,kd,ml]}],"outline-color":[{outline:G()}],shadow:[{shadow:["","none",g,ym,vm]}],"shadow-color":[{shadow:G()}],"inset-shadow":[{"inset-shadow":["none",v,ym,vm]}],"inset-shadow-color":[{"inset-shadow":G()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:G()}],"ring-offset-w":[{"ring-offset":[gt,ml]}],"ring-offset-color":[{"ring-offset":G()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":G()}],"text-shadow":[{"text-shadow":["none",x,ym,vm]}],"text-shadow-color":[{"text-shadow":G()}],opacity:[{opacity:[gt,Ke,Ze]}],"mix-blend":[{"mix-blend":[...ve(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ve()}],"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":[gt]}],"mask-image-linear-from-pos":[{"mask-linear-from":le()}],"mask-image-linear-to-pos":[{"mask-linear-to":le()}],"mask-image-linear-from-color":[{"mask-linear-from":G()}],"mask-image-linear-to-color":[{"mask-linear-to":G()}],"mask-image-t-from-pos":[{"mask-t-from":le()}],"mask-image-t-to-pos":[{"mask-t-to":le()}],"mask-image-t-from-color":[{"mask-t-from":G()}],"mask-image-t-to-color":[{"mask-t-to":G()}],"mask-image-r-from-pos":[{"mask-r-from":le()}],"mask-image-r-to-pos":[{"mask-r-to":le()}],"mask-image-r-from-color":[{"mask-r-from":G()}],"mask-image-r-to-color":[{"mask-r-to":G()}],"mask-image-b-from-pos":[{"mask-b-from":le()}],"mask-image-b-to-pos":[{"mask-b-to":le()}],"mask-image-b-from-color":[{"mask-b-from":G()}],"mask-image-b-to-color":[{"mask-b-to":G()}],"mask-image-l-from-pos":[{"mask-l-from":le()}],"mask-image-l-to-pos":[{"mask-l-to":le()}],"mask-image-l-from-color":[{"mask-l-from":G()}],"mask-image-l-to-color":[{"mask-l-to":G()}],"mask-image-x-from-pos":[{"mask-x-from":le()}],"mask-image-x-to-pos":[{"mask-x-to":le()}],"mask-image-x-from-color":[{"mask-x-from":G()}],"mask-image-x-to-color":[{"mask-x-to":G()}],"mask-image-y-from-pos":[{"mask-y-from":le()}],"mask-image-y-to-pos":[{"mask-y-to":le()}],"mask-image-y-from-color":[{"mask-y-from":G()}],"mask-image-y-to-color":[{"mask-y-to":G()}],"mask-image-radial":[{"mask-radial":[Ke,Ze]}],"mask-image-radial-from-pos":[{"mask-radial-from":le()}],"mask-image-radial-to-pos":[{"mask-radial-to":le()}],"mask-image-radial-from-color":[{"mask-radial-from":G()}],"mask-image-radial-to-color":[{"mask-radial-to":G()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":O()}],"mask-image-conic-pos":[{"mask-conic":[gt]}],"mask-image-conic-from-pos":[{"mask-conic-from":le()}],"mask-image-conic-to-pos":[{"mask-conic-to":le()}],"mask-image-conic-from-color":[{"mask-conic-from":G()}],"mask-image-conic-to-color":[{"mask-conic-to":G()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:xe()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ke,Ze]}],filter:[{filter:["","none",Ke,Ze]}],blur:[{blur:Ne()}],brightness:[{brightness:[gt,Ke,Ze]}],contrast:[{contrast:[gt,Ke,Ze]}],"drop-shadow":[{"drop-shadow":["","none",b,ym,vm]}],"drop-shadow-color":[{"drop-shadow":G()}],grayscale:[{grayscale:["",gt,Ke,Ze]}],"hue-rotate":[{"hue-rotate":[gt,Ke,Ze]}],invert:[{invert:["",gt,Ke,Ze]}],saturate:[{saturate:[gt,Ke,Ze]}],sepia:[{sepia:["",gt,Ke,Ze]}],"backdrop-filter":[{"backdrop-filter":["","none",Ke,Ze]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[gt,Ke,Ze]}],"backdrop-contrast":[{"backdrop-contrast":[gt,Ke,Ze]}],"backdrop-grayscale":[{"backdrop-grayscale":["",gt,Ke,Ze]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[gt,Ke,Ze]}],"backdrop-invert":[{"backdrop-invert":["",gt,Ke,Ze]}],"backdrop-opacity":[{"backdrop-opacity":[gt,Ke,Ze]}],"backdrop-saturate":[{"backdrop-saturate":[gt,Ke,Ze]}],"backdrop-sepia":[{"backdrop-sepia":["",gt,Ke,Ze]}],"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",Ke,Ze]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[gt,"initial",Ke,Ze]}],ease:[{ease:["linear","initial",R,Ke,Ze]}],delay:[{delay:[gt,Ke,Ze]}],animate:[{animate:["none",T,Ke,Ze]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,Ke,Ze]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:we()}],"rotate-x":[{"rotate-x":we()}],"rotate-y":[{"rotate-y":we()}],"rotate-z":[{"rotate-z":we()}],scale:[{scale:Te()}],"scale-x":[{"scale-x":Te()}],"scale-y":[{"scale-y":Te()}],"scale-z":[{"scale-z":Te()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[Ke,Ze,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Xe()}],"translate-x":[{"translate-x":Xe()}],"translate-y":[{"translate-y":Xe()}],"translate-z":[{"translate-z":Xe()}],"translate-none":["translate-none"],accent:[{accent:G()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:G()}],"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",Ke,Ze]}],"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",Ke,Ze]}],fill:[{fill:["none",...G()]}],"stroke-w":[{stroke:[gt,kd,ml,gx]}],stroke:[{stroke:["none",...G()]}],"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"]}},_7=l7(j7);function J(...e){return _7(a_(e))}const Ob=Ef("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-white/4 dark:hover:bg-white/8",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-white/8",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function be({className:e,variant:t,size:n,asChild:r=!1,...s}){const l=r?Kp:"button";return o.jsx(l,{"data-slot":"button",className:J(Ob({variant:t,size:n,className:e})),...s})}function Ht({className:e,type:t,...n}){return o.jsx("input",{type:t,"data-slot":"input",className:J("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...n})}var N7=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],We=N7.reduce((e,t)=>{const n=_i(`Primitive.${t}`),r=p.forwardRef((s,l)=>{const{asChild:c,...d}=s,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function S_(e,t){e&&is.flushSync(()=>e.dispatchEvent(t))}var A7="Separator",dR="horizontal",D7=["horizontal","vertical"],C_=p.forwardRef((e,t)=>{const{decorative:n,orientation:r=dR,...s}=e,l=O7(r)?r:dR,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return o.jsx(We.div,{"data-orientation":l,...d,...s,ref:t})});C_.displayName=A7;function O7(e){return D7.includes(e)}var M7=C_;function w_({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return o.jsx(M7,{"data-slot":"separator",decorative:n,orientation:t,className:J("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Re(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 k7(e,t){const n=p.createContext(t),r=l=>{const{children:c,...d}=l,f=p.useMemo(()=>d,Object.values(d));return o.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function s(l){const c=p.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,s]}function kr(e,t=[]){let n=[];function r(l,c){const d=p.createContext(c),f=n.length;n=[...n,c];const m=v=>{var R;const{scope:x,children:b,...w}=v,C=((R=x==null?void 0:x[e])==null?void 0:R[f])||d,E=p.useMemo(()=>w,Object.values(w));return o.jsx(C.Provider,{value:E,children:b})};m.displayName=l+"Provider";function g(v,x){var C;const b=((C=x==null?void 0:x[e])==null?void 0:C[f])||d,w=p.useContext(b);if(w)return w;if(c!==void 0)return c;throw new Error(`\`${v}\` must be used within \`${l}\``)}return[m,g]}const s=()=>{const l=n.map(c=>p.createContext(c));return function(d){const f=(d==null?void 0:d[e])||l;return p.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return s.scopeName=e,[r,I7(s,...t)]}function I7(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(l){const c=r.reduce((d,{useScope:f,scopeName:m})=>{const v=f(l)[`__scope${m}`];return{...d,...v}},{});return p.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var wr=globalThis!=null&&globalThis.document?p.useLayoutEffect:()=>{},L7=Rj[" useId ".trim().toString()]||(()=>{}),P7=0;function Dn(e){const[t,n]=p.useState(L7());return wr(()=>{n(r=>r??String(P7++))},[e]),e||(t?`radix-${t}`:"")}var U7=Rj[" useInsertionEffect ".trim().toString()]||wr;function zr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[s,l,c]=F7({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:s;{const g=p.useRef(e!==void 0);p.useEffect(()=>{const v=g.current;v!==d&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),g.current=d},[d,r])}const m=p.useCallback(g=>{var v;if(d){const x=z7(g)?g(e):g;x!==e&&((v=c.current)==null||v.call(c,x))}else l(g)},[d,e,l,c]);return[f,m]}function F7({defaultProp:e,onChange:t}){const[n,r]=p.useState(e),s=p.useRef(n),l=p.useRef(t);return U7(()=>{l.current=t},[t]),p.useEffect(()=>{var c;s.current!==n&&((c=l.current)==null||c.call(l,n),s.current=n)},[n,s]),[n,r,l]}function z7(e){return typeof e=="function"}function ds(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function V7(e,t=globalThis==null?void 0:globalThis.document){const n=ds(e);p.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var H7="DismissableLayer",v0="dismissableLayer.update",$7="dismissableLayer.pointerDownOutside",B7="dismissableLayer.focusOutside",fR,E_=p.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),$l=p.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,m=p.useContext(E_),[g,v]=p.useState(null),x=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=p.useState({}),w=pt(t,j=>v(j)),C=Array.from(m.layers),[E]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),R=C.indexOf(E),T=g?C.indexOf(g):-1,_=m.layersWithOutsidePointerEventsDisabled.size>0,O=T>=R,A=Z7(j=>{const M=j.target,z=[...m.branches].some(Z=>Z.contains(M));!O||z||(s==null||s(j),c==null||c(j),j.defaultPrevented||d==null||d())},x),D=K7(j=>{const M=j.target;[...m.branches].some(Z=>Z.contains(M))||(l==null||l(j),c==null||c(j),j.defaultPrevented||d==null||d())},x);return V7(j=>{T===m.layers.size-1&&(r==null||r(j),!j.defaultPrevented&&d&&(j.preventDefault(),d()))},x),p.useEffect(()=>{if(g)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(fR=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(g)),m.layers.add(g),hR(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(x.body.style.pointerEvents=fR)}},[g,x,n,m]),p.useEffect(()=>()=>{g&&(m.layers.delete(g),m.layersWithOutsidePointerEventsDisabled.delete(g),hR())},[g,m]),p.useEffect(()=>{const j=()=>b({});return document.addEventListener(v0,j),()=>document.removeEventListener(v0,j)},[]),o.jsx(We.div,{...f,ref:w,style:{pointerEvents:_?O?"auto":"none":void 0,...e.style},onFocusCapture:Re(e.onFocusCapture,D.onFocusCapture),onBlurCapture:Re(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:Re(e.onPointerDownCapture,A.onPointerDownCapture)})});$l.displayName=H7;var G7="DismissableLayerBranch",q7=p.forwardRef((e,t)=>{const n=p.useContext(E_),r=p.useRef(null),s=pt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),o.jsx(We.div,{...e,ref:s})});q7.displayName=G7;function Z7(e,t=globalThis==null?void 0:globalThis.document){const n=ds(e),r=p.useRef(!1),s=p.useRef(()=>{});return p.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let f=function(){R_($7,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function K7(e,t=globalThis==null?void 0:globalThis.document){const n=ds(e),r=p.useRef(!1);return p.useEffect(()=>{const s=l=>{l.target&&!r.current&&R_(B7,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function hR(){const e=new CustomEvent(v0);document.dispatchEvent(e)}function R_(e,t,n,{discrete:r}){const s=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),r?S_(s,l):s.dispatchEvent(l)}var vx="focusScope.autoFocusOnMount",yx="focusScope.autoFocusOnUnmount",mR={bubbles:!1,cancelable:!0},Y7="FocusScope",_f=p.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:s,onUnmountAutoFocus:l,...c}=e,[d,f]=p.useState(null),m=ds(s),g=ds(l),v=p.useRef(null),x=pt(t,C=>f(C)),b=p.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;p.useEffect(()=>{if(r){let C=function(_){if(b.paused||!d)return;const O=_.target;d.contains(O)?v.current=O:fi(v.current,{select:!0})},E=function(_){if(b.paused||!d)return;const O=_.relatedTarget;O!==null&&(d.contains(O)||fi(v.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&fi(d)};document.addEventListener("focusin",C),document.addEventListener("focusout",E);const T=new MutationObserver(R);return d&&T.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",C),document.removeEventListener("focusout",E),T.disconnect()}}},[r,d,b.paused]),p.useEffect(()=>{if(d){gR.add(b);const C=document.activeElement;if(!d.contains(C)){const R=new CustomEvent(vx,mR);d.addEventListener(vx,m),d.dispatchEvent(R),R.defaultPrevented||(W7(tP(T_(d)),{select:!0}),document.activeElement===C&&fi(d))}return()=>{d.removeEventListener(vx,m),setTimeout(()=>{const R=new CustomEvent(yx,mR);d.addEventListener(yx,g),d.dispatchEvent(R),R.defaultPrevented||fi(C??document.body,{select:!0}),d.removeEventListener(yx,g),gR.remove(b)},0)}}},[d,m,g,b]);const w=p.useCallback(C=>{if(!n&&!r||b.paused)return;const E=C.key==="Tab"&&!C.altKey&&!C.ctrlKey&&!C.metaKey,R=document.activeElement;if(E&&R){const T=C.currentTarget,[_,O]=Q7(T);_&&O?!C.shiftKey&&R===O?(C.preventDefault(),n&&fi(_,{select:!0})):C.shiftKey&&R===_&&(C.preventDefault(),n&&fi(O,{select:!0})):R===T&&C.preventDefault()}},[n,r,b.paused]);return o.jsx(We.div,{tabIndex:-1,...c,ref:x,onKeyDown:w})});_f.displayName=Y7;function W7(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(fi(r,{select:t}),document.activeElement!==n)return}function Q7(e){const t=T_(e),n=pR(t,e),r=pR(t.reverse(),e);return[n,r]}function T_(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 pR(e,t){for(const n of e)if(!X7(n,{upTo:t}))return n}function X7(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 J7(e){return e instanceof HTMLInputElement&&"select"in e}function fi(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&J7(e)&&t&&e.select()}}var gR=eP();function eP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=vR(e,t),e.unshift(t)},remove(t){var n;e=vR(e,t),(n=e[0])==null||n.resume()}}}function vR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function tP(e){return e.filter(t=>t.tagName!=="A")}var nP="Portal",Bl=p.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[s,l]=p.useState(!1);wr(()=>l(!0),[]);const c=n||s&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?VI.createPortal(o.jsx(We.div,{...r,ref:t}),c):null});Bl.displayName=nP;function rP(e,t){return p.useReducer((n,r)=>t[n][r]??n,e)}var Er=e=>{const{present:t,children:n}=e,r=aP(t),s=typeof n=="function"?n({present:r.isPresent}):p.Children.only(n),l=pt(r.ref,sP(s));return typeof n=="function"||r.isPresent?p.cloneElement(s,{ref:l}):null};Er.displayName="Presence";function aP(e){const[t,n]=p.useState(),r=p.useRef(null),s=p.useRef(e),l=p.useRef("none"),c=e?"mounted":"unmounted",[d,f]=rP(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return p.useEffect(()=>{const m=xm(r.current);l.current=d==="mounted"?m:"none"},[d]),wr(()=>{const m=r.current,g=s.current;if(g!==e){const x=l.current,b=xm(m);e?f("MOUNT"):b==="none"||(m==null?void 0:m.display)==="none"?f("UNMOUNT"):f(g&&x!==b?"ANIMATION_OUT":"UNMOUNT"),s.current=e}},[e,f]),wr(()=>{if(t){let m;const g=t.ownerDocument.defaultView??window,v=b=>{const C=xm(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&C&&(f("ANIMATION_END"),!s.current)){const E=t.style.animationFillMode;t.style.animationFillMode="forwards",m=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=E)})}},x=b=>{b.target===t&&(l.current=xm(r.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{g.clearTimeout(m),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:p.useCallback(m=>{r.current=m?getComputedStyle(m):null,n(m)},[])}}function xm(e){return(e==null?void 0:e.animationName)||"none"}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)}var xx=0;function Qp(){p.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??yR()),document.body.insertAdjacentElement("beforeend",e[1]??yR()),xx++,()=>{xx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),xx--}},[])}function yR(){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 As=function(){return As=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},As.apply(this,arguments)};function j_(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 oP(e,t,n){if(n||arguments.length===2)for(var r=0,s=t.length,l;r<s;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var Bm="right-scroll-bar-position",Gm="width-before-scroll-bar",iP="with-scroll-bars-hidden",lP="--removed-body-scroll-bar-size";function bx(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function cP(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var s=n.value;s!==r&&(n.value=r,n.callback(r,s))}}}})[0];return n.callback=t,n.facade}var uP=typeof window<"u"?p.useLayoutEffect:p.useEffect,xR=new WeakMap;function dP(e,t){var n=cP(null,function(r){return e.forEach(function(s){return bx(s,r)})});return uP(function(){var r=xR.get(n);if(r){var s=new Set(r),l=new Set(e),c=n.current;s.forEach(function(d){l.has(d)||bx(d,null)}),l.forEach(function(d){s.has(d)||bx(d,c)})}xR.set(n,e)},[e]),n}function fP(e){return e}function hP(e,t){t===void 0&&(t=fP);var n=[],r=!1,s={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var f=function(){var g=c;c=[],g.forEach(l)},m=function(){return Promise.resolve().then(f)};m(),n={push:function(g){c.push(g),m()},filter:function(g){return c=c.filter(g),n}}}};return s}function mP(e){e===void 0&&(e={});var t=hP(null);return t.options=As({async:!0,ssr:!1},e),t}var __=function(e){var t=e.sideCar,n=j_(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,As({},n))};__.isSideCarExport=!0;function pP(e,t){return e.useMedium(t),__}var N_=mP(),Sx=function(){},Xp=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Sx,onWheelCapture:Sx,onTouchMoveCapture:Sx}),s=r[0],l=r[1],c=e.forwardProps,d=e.children,f=e.className,m=e.removeScrollBar,g=e.enabled,v=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,C=e.inert,E=e.allowPinchZoom,R=e.as,T=R===void 0?"div":R,_=e.gapMode,O=j_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=x,D=dP([n,t]),j=As(As({},O),s);return p.createElement(p.Fragment,null,g&&p.createElement(A,{sideCar:N_,removeScrollBar:m,shards:v,noRelative:b,noIsolation:w,inert:C,setCallbacks:l,allowPinchZoom:!!E,lockRef:n,gapMode:_}),c?p.cloneElement(p.Children.only(d),As(As({},j),{ref:D})):p.createElement(T,As({},j,{className:f,ref:D}),d))});Xp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Xp.classNames={fullWidth:Gm,zeroRight:Bm};var gP=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function vP(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=gP();return t&&e.setAttribute("nonce",t),e}function yP(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function xP(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var bP=function(){var e=0,t=null;return{add:function(n){e==0&&(t=vP())&&(yP(t,n),xP(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},SP=function(){var e=bP();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},A_=function(){var e=SP(),t=function(n){var r=n.styles,s=n.dynamic;return e(r,s),null};return t},CP={left:0,top:0,right:0,gap:0},Cx=function(e){return parseInt(e||"",10)||0},wP=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[Cx(n),Cx(r),Cx(s)]},EP=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return CP;var t=wP(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])}},RP=A_(),eu="data-scroll-locked",TP=function(e,t,n,r){var s=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
442
|
-
.`.concat(iP,` {
|
|
443
|
-
overflow: hidden `).concat(r,`;
|
|
444
|
-
padding-right: `).concat(d,"px ").concat(r,`;
|
|
445
|
-
}
|
|
446
|
-
body[`).concat(eu,`] {
|
|
447
|
-
overflow: hidden `).concat(r,`;
|
|
448
|
-
overscroll-behavior: contain;
|
|
449
|
-
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
450
|
-
padding-left: `.concat(s,`px;
|
|
451
|
-
padding-top: `).concat(l,`px;
|
|
452
|
-
padding-right: `).concat(c,`px;
|
|
453
|
-
margin-left:0;
|
|
454
|
-
margin-top:0;
|
|
455
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
456
|
-
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.`).concat(Bm,` {
|
|
460
|
-
right: `).concat(d,"px ").concat(r,`;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
.`).concat(Gm,` {
|
|
464
|
-
margin-right: `).concat(d,"px ").concat(r,`;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
.`).concat(Bm," .").concat(Bm,` {
|
|
468
|
-
right: 0 `).concat(r,`;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
.`).concat(Gm," .").concat(Gm,` {
|
|
472
|
-
margin-right: 0 `).concat(r,`;
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
body[`).concat(eu,`] {
|
|
476
|
-
`).concat(lP,": ").concat(d,`px;
|
|
477
|
-
}
|
|
478
|
-
`)},bR=function(){var e=parseInt(document.body.getAttribute(eu)||"0",10);return isFinite(e)?e:0},jP=function(){p.useEffect(function(){return document.body.setAttribute(eu,(bR()+1).toString()),function(){var e=bR()-1;e<=0?document.body.removeAttribute(eu):document.body.setAttribute(eu,e.toString())}},[])},_P=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,s=r===void 0?"margin":r;jP();var l=p.useMemo(function(){return EP(s)},[s]);return p.createElement(RP,{styles:TP(l,!t,s,n?"":"!important")})},y0=!1;if(typeof window<"u")try{var bm=Object.defineProperty({},"passive",{get:function(){return y0=!0,!0}});window.addEventListener("test",bm,bm),window.removeEventListener("test",bm,bm)}catch{y0=!1}var kc=y0?{passive:!1}:!1,NP=function(e){return e.tagName==="TEXTAREA"},D_=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!NP(e)&&n[t]==="visible")},AP=function(e){return D_(e,"overflowY")},DP=function(e){return D_(e,"overflowX")},SR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var s=O_(e,r);if(s){var l=M_(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},OP=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},MP=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},O_=function(e,t){return e==="v"?AP(t):DP(t)},M_=function(e,t){return e==="v"?OP(t):MP(t)},kP=function(e,t){return e==="h"&&t==="rtl"?-1:1},IP=function(e,t,n,r,s){var l=kP(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,f=t.contains(d),m=!1,g=c>0,v=0,x=0;do{if(!d)break;var b=M_(e,d),w=b[0],C=b[1],E=b[2],R=C-E-l*w;(w||R)&&O_(e,d)&&(v+=R,x+=w);var T=d.parentNode;d=T&&T.nodeType===Node.DOCUMENT_FRAGMENT_NODE?T.host:T}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(g&&Math.abs(v)<1||!g&&Math.abs(x)<1)&&(m=!0),m},Sm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},CR=function(e){return[e.deltaX,e.deltaY]},wR=function(e){return e&&"current"in e?e.current:e},LP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},PP=function(e){return`
|
|
479
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
480
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
481
|
-
`)},UP=0,Ic=[];function FP(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),s=p.useState(UP++)[0],l=p.useState(A_)[0],c=p.useRef(e);p.useEffect(function(){c.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var C=oP([e.lockRef.current],(e.shards||[]).map(wR),!0).filter(Boolean);return C.forEach(function(E){return E.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),C.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var d=p.useCallback(function(C,E){if("touches"in C&&C.touches.length===2||C.type==="wheel"&&C.ctrlKey)return!c.current.allowPinchZoom;var R=Sm(C),T=n.current,_="deltaX"in C?C.deltaX:T[0]-R[0],O="deltaY"in C?C.deltaY:T[1]-R[1],A,D=C.target,j=Math.abs(_)>Math.abs(O)?"h":"v";if("touches"in C&&j==="h"&&D.type==="range")return!1;var M=SR(j,D);if(!M)return!0;if(M?A=j:(A=j==="v"?"h":"v",M=SR(j,D)),!M)return!1;if(!r.current&&"changedTouches"in C&&(_||O)&&(r.current=A),!A)return!0;var z=r.current||A;return IP(z,E,C,z==="h"?_:O)},[]),f=p.useCallback(function(C){var E=C;if(!(!Ic.length||Ic[Ic.length-1]!==l)){var R="deltaY"in E?CR(E):Sm(E),T=t.current.filter(function(A){return A.name===E.type&&(A.target===E.target||E.target===A.shadowParent)&&LP(A.delta,R)})[0];if(T&&T.should){E.cancelable&&E.preventDefault();return}if(!T){var _=(c.current.shards||[]).map(wR).filter(Boolean).filter(function(A){return A.contains(E.target)}),O=_.length>0?d(E,_[0]):!c.current.noIsolation;O&&E.cancelable&&E.preventDefault()}}},[]),m=p.useCallback(function(C,E,R,T){var _={name:C,delta:E,target:R,should:T,shadowParent:zP(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(O){return O!==_})},1)},[]),g=p.useCallback(function(C){n.current=Sm(C),r.current=void 0},[]),v=p.useCallback(function(C){m(C.type,CR(C),C.target,d(C,e.lockRef.current))},[]),x=p.useCallback(function(C){m(C.type,Sm(C),C.target,d(C,e.lockRef.current))},[]);p.useEffect(function(){return Ic.push(l),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",f,kc),document.addEventListener("touchmove",f,kc),document.addEventListener("touchstart",g,kc),function(){Ic=Ic.filter(function(C){return C!==l}),document.removeEventListener("wheel",f,kc),document.removeEventListener("touchmove",f,kc),document.removeEventListener("touchstart",g,kc)}},[]);var b=e.removeScrollBar,w=e.inert;return p.createElement(p.Fragment,null,w?p.createElement(l,{styles:PP(s)}):null,b?p.createElement(_P,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const VP=pP(N_,FP);var Nf=p.forwardRef(function(e,t){return p.createElement(Xp,As({},e,{ref:t,sideCar:VP}))});Nf.classNames=Xp.classNames;var HP=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Lc=new WeakMap,Cm=new WeakMap,wm={},wx=0,k_=function(e){return e&&(e.host||k_(e.parentNode))},$P=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=k_(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})},BP=function(e,t,n,r){var s=$P(t,Array.isArray(e)?e:[e]);wm[n]||(wm[n]=new WeakMap);var l=wm[n],c=[],d=new Set,f=new Set(s),m=function(v){!v||d.has(v)||(d.add(v),m(v.parentNode))};s.forEach(m);var g=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(x){if(d.has(x))g(x);else try{var b=x.getAttribute(r),w=b!==null&&b!=="false",C=(Lc.get(x)||0)+1,E=(l.get(x)||0)+1;Lc.set(x,C),l.set(x,E),c.push(x),C===1&&w&&Cm.set(x,!0),E===1&&x.setAttribute(n,"true"),w||x.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",x,R)}})};return g(t),d.clear(),wx++,function(){c.forEach(function(v){var x=Lc.get(v)-1,b=l.get(v)-1;Lc.set(v,x),l.set(v,b),x||(Cm.has(v)||v.removeAttribute(r),Cm.delete(v)),b||v.removeAttribute(n)}),wx--,wx||(Lc=new WeakMap,Lc=new WeakMap,Cm=new WeakMap,wm={})}},Jp=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),s=HP(e);return s?(r.push.apply(r,Array.from(s.querySelectorAll("[aria-live], script"))),BP(r,s,n,"aria-hidden")):function(){return null}},eg="Dialog",[I_,L_]=kr(eg),[GP,vs]=I_(eg),P_=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!0}=e,d=p.useRef(null),f=p.useRef(null),[m,g]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:eg});return o.jsx(GP,{scope:t,triggerRef:d,contentRef:f,contentId:Dn(),titleId:Dn(),descriptionId:Dn(),open:m,onOpenChange:g,onOpenToggle:p.useCallback(()=>g(v=>!v),[g]),modal:c,children:n})};P_.displayName=eg;var U_="DialogTrigger",F_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(U_,n),l=pt(t,s.triggerRef);return o.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Ib(s.open),...r,ref:l,onClick:Re(e.onClick,s.onOpenToggle)})});F_.displayName=U_;var Mb="DialogPortal",[qP,z_]=I_(Mb,{forceMount:void 0}),V_=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:s}=e,l=vs(Mb,t);return o.jsx(qP,{scope:t,forceMount:n,children:p.Children.map(r,c=>o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:c})}))})};V_.displayName=Mb;var op="DialogOverlay",H_=p.forwardRef((e,t)=>{const n=z_(op,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=vs(op,e.__scopeDialog);return l.modal?o.jsx(Er,{present:r||l.open,children:o.jsx(KP,{...s,ref:t})}):null});H_.displayName=op;var ZP=_i("DialogOverlay.RemoveScroll"),KP=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(op,n);return o.jsx(Nf,{as:ZP,allowPinchZoom:!0,shards:[s.contentRef],children:o.jsx(We.div,{"data-state":Ib(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Nl="DialogContent",$_=p.forwardRef((e,t)=>{const n=z_(Nl,e.__scopeDialog),{forceMount:r=n.forceMount,...s}=e,l=vs(Nl,e.__scopeDialog);return o.jsx(Er,{present:r||l.open,children:l.modal?o.jsx(YP,{...s,ref:t}):o.jsx(WP,{...s,ref:t})})});$_.displayName=Nl;var YP=p.forwardRef((e,t)=>{const n=vs(Nl,e.__scopeDialog),r=p.useRef(null),s=pt(t,n.contentRef,r);return p.useEffect(()=>{const l=r.current;if(l)return Jp(l)},[]),o.jsx(B_,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault())})}),WP=p.forwardRef((e,t)=>{const n=vs(Nl,e.__scopeDialog),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(B_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),B_=p.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,...c}=e,d=vs(Nl,n),f=p.useRef(null),m=pt(t,f);return Qp(),o.jsxs(o.Fragment,{children:[o.jsx(_f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx($l,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":Ib(d.open),...c,ref:m,onDismiss:()=>d.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(XP,{titleId:d.titleId}),o.jsx(eU,{contentRef:f,descriptionId:d.descriptionId})]})]})}),kb="DialogTitle",G_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(kb,n);return o.jsx(We.h2,{id:s.titleId,...r,ref:t})});G_.displayName=kb;var q_="DialogDescription",Z_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(q_,n);return o.jsx(We.p,{id:s.descriptionId,...r,ref:t})});Z_.displayName=q_;var K_="DialogClose",Y_=p.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,s=vs(K_,n);return o.jsx(We.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});Y_.displayName=K_;function Ib(e){return e?"open":"closed"}var W_="DialogTitleWarning",[QP,Q_]=k7(W_,{contentName:Nl,titleName:kb,docsSlug:"dialog"}),XP=({titleId:e})=>{const t=Q_(W_),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
482
|
-
|
|
483
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
484
|
-
|
|
485
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return p.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},JP="DialogDescriptionWarning",eU=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Q_(JP).contentName}}.`;return p.useEffect(()=>{var l;const s=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},tg=P_,tU=F_,ng=V_,rg=H_,ag=$_,Lb=G_,Pb=Z_,sg=Y_;function Li({...e}){return o.jsx(tg,{"data-slot":"sheet",...e})}function nU({...e}){return o.jsx(ng,{"data-slot":"sheet-portal",...e})}function rU({className:e,...t}){return o.jsx(rg,{"data-slot":"sheet-overlay",className:J("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function Pi({className:e,children:t,side:n="right",...r}){return o.jsxs(nU,{children:[o.jsx(rU,{}),o.jsxs(ag,{"data-slot":"sheet-content",className:J("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-0 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full min-w-[100%] border-l sm:max-w-sm sm:min-w-[600px]",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[100%] border-r sm:max-w-sm sm:min-w-[600px]",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,o.jsxs(sg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(uu,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Ui({className:e,...t}){return o.jsx("div",{"data-slot":"sheet-header",className:J("flex flex-col gap-1 border-b p-4",e),...t})}function Fi({className:e,...t}){return o.jsx(Lb,{"data-slot":"sheet-title",className:J("text-foreground font-semibold",e),...t})}function Gl({className:e,...t}){return o.jsx(Pb,{"data-slot":"sheet-description",className:J("text-muted-foreground text-sm",e),...t})}function as({className:e,...t}){return o.jsx("div",{"data-slot":"skeleton",className:J("bg-accent animate-pulse rounded-md",e),...t})}const aU=["top","right","bottom","left"],Ni=Math.min,ma=Math.max,ip=Math.round,Em=Math.floor,Is=e=>({x:e,y:e}),sU={left:"right",right:"left",bottom:"top",top:"bottom"},oU={start:"end",end:"start"};function x0(e,t,n){return ma(e,Ni(t,n))}function Oo(e,t){return typeof e=="function"?e(t):e}function Mo(e){return e.split("-")[0]}function wu(e){return e.split("-")[1]}function Ub(e){return e==="x"?"y":"x"}function Fb(e){return e==="y"?"height":"width"}const iU=new Set(["top","bottom"]);function Ds(e){return iU.has(Mo(e))?"y":"x"}function zb(e){return Ub(Ds(e))}function lU(e,t,n){n===void 0&&(n=!1);const r=wu(e),s=zb(e),l=Fb(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=lp(c)),[c,lp(c)]}function cU(e){const t=lp(e);return[b0(e),t,b0(t)]}function b0(e){return e.replace(/start|end/g,t=>oU[t])}const ER=["left","right"],RR=["right","left"],uU=["top","bottom"],dU=["bottom","top"];function fU(e,t,n){switch(e){case"top":case"bottom":return n?t?RR:ER:t?ER:RR;case"left":case"right":return t?uU:dU;default:return[]}}function hU(e,t,n,r){const s=wu(e);let l=fU(Mo(e),n==="start",r);return s&&(l=l.map(c=>c+"-"+s),t&&(l=l.concat(l.map(b0)))),l}function lp(e){return e.replace(/left|right|bottom|top/g,t=>sU[t])}function mU(e){return{top:0,right:0,bottom:0,left:0,...e}}function X_(e){return typeof e!="number"?mU(e):{top:e,right:e,bottom:e,left:e}}function cp(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 TR(e,t,n){let{reference:r,floating:s}=e;const l=Ds(t),c=zb(t),d=Fb(c),f=Mo(t),m=l==="y",g=r.x+r.width/2-s.width/2,v=r.y+r.height/2-s.height/2,x=r[d]/2-s[d]/2;let b;switch(f){case"top":b={x:g,y:r.y-s.height};break;case"bottom":b={x:g,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:v};break;case"left":b={x:r.x-s.width,y:v};break;default:b={x:r.x,y:r.y}}switch(wu(t)){case"start":b[c]-=x*(n&&m?-1:1);break;case"end":b[c]+=x*(n&&m?-1:1);break}return b}const pU=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let m=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:v}=TR(m,r,f),x=r,b={},w=0;for(let C=0;C<d.length;C++){const{name:E,fn:R}=d[C],{x:T,y:_,data:O,reset:A}=await R({x:g,y:v,initialPlacement:r,placement:x,strategy:s,middlewareData:b,rects:m,platform:c,elements:{reference:e,floating:t}});g=T??g,v=_??v,b={...b,[E]:{...b[E],...O}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(x=A.placement),A.rects&&(m=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):A.rects),{x:g,y:v}=TR(m,x,f)),C=-1)}return{x:g,y:v,placement:x,strategy:s,middlewareData:b}};async function cf(e,t){var n;t===void 0&&(t={});const{x:r,y:s,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:m="clippingAncestors",rootBoundary:g="viewport",elementContext:v="floating",altBoundary:x=!1,padding:b=0}=Oo(t,e),w=X_(b),E=d[x?v==="floating"?"reference":"floating":v],R=cp(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(E)))==null||n?E:E.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:m,rootBoundary:g,strategy:f})),T=v==="floating"?{x:r,y:s,width:c.floating.width,height:c.floating.height}:c.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),O=await(l.isElement==null?void 0:l.isElement(_))?await(l.getScale==null?void 0:l.getScale(_))||{x:1,y:1}:{x:1,y:1},A=cp(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:T,offsetParent:_,strategy:f}):T);return{top:(R.top-A.top+w.top)/O.y,bottom:(A.bottom-R.bottom+w.bottom)/O.y,left:(R.left-A.left+w.left)/O.x,right:(A.right-R.right+w.right)/O.x}}const gU=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:m,padding:g=0}=Oo(e,t)||{};if(m==null)return{};const v=X_(g),x={x:n,y:r},b=zb(s),w=Fb(b),C=await c.getDimensions(m),E=b==="y",R=E?"top":"left",T=E?"bottom":"right",_=E?"clientHeight":"clientWidth",O=l.reference[w]+l.reference[b]-x[b]-l.floating[w],A=x[b]-l.reference[b],D=await(c.getOffsetParent==null?void 0:c.getOffsetParent(m));let j=D?D[_]:0;(!j||!await(c.isElement==null?void 0:c.isElement(D)))&&(j=d.floating[_]||l.floating[w]);const M=O/2-A/2,z=j/2-C[w]/2-1,Z=Ni(v[R],z),K=Ni(v[T],z),Y=Z,ae=j-C[w]-K,F=j/2-C[w]/2+M,V=x0(Y,F,ae),I=!f.arrow&&wu(s)!=null&&F!==V&&l.reference[w]/2-(F<Y?Z:K)-C[w]/2<0,B=I?F<Y?F-Y:F-ae:0;return{[b]:x[b]+B,data:{[b]:V,centerOffset:F-V-B,...I&&{alignmentOffset:B}},reset:I}}}),vU=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:s,middlewareData:l,rects:c,initialPlacement:d,platform:f,elements:m}=t,{mainAxis:g=!0,crossAxis:v=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...E}=Oo(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const R=Mo(s),T=Ds(d),_=Mo(d)===d,O=await(f.isRTL==null?void 0:f.isRTL(m.floating)),A=x||(_||!C?[lp(d)]:cU(d)),D=w!=="none";!x&&D&&A.push(...hU(d,C,w,O));const j=[d,...A],M=await cf(t,E),z=[];let Z=((r=l.flip)==null?void 0:r.overflows)||[];if(g&&z.push(M[R]),v){const F=lU(s,c,O);z.push(M[F[0]],M[F[1]])}if(Z=[...Z,{placement:s,overflows:z}],!z.every(F=>F<=0)){var K,Y;const F=(((K=l.flip)==null?void 0:K.index)||0)+1,V=j[F];if(V&&(!(v==="alignment"?T!==Ds(V):!1)||Z.every(G=>Ds(G.placement)===T?G.overflows[0]>0:!0)))return{data:{index:F,overflows:Z},reset:{placement:V}};let I=(Y=Z.filter(B=>B.overflows[0]<=0).sort((B,G)=>B.overflows[1]-G.overflows[1])[0])==null?void 0:Y.placement;if(!I)switch(b){case"bestFit":{var ae;const B=(ae=Z.filter(G=>{if(D){const ie=Ds(G.placement);return ie===T||ie==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(ie=>ie>0).reduce((ie,xe)=>ie+xe,0)]).sort((G,ie)=>G[1]-ie[1])[0])==null?void 0:ae[0];B&&(I=B);break}case"initialPlacement":I=d;break}if(s!==I)return{reset:{placement:I}}}return{}}}};function jR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function _R(e){return aU.some(t=>e[t]>=0)}const yU=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Oo(e,t);switch(r){case"referenceHidden":{const l=await cf(t,{...s,elementContext:"reference"}),c=jR(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:_R(c)}}}case"escaped":{const l=await cf(t,{...s,altBoundary:!0}),c=jR(l,n.floating);return{data:{escapedOffsets:c,escaped:_R(c)}}}default:return{}}}}},J_=new Set(["left","top"]);async function xU(e,t){const{placement:n,platform:r,elements:s}=e,l=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=Mo(n),d=wu(n),f=Ds(n)==="y",m=J_.has(c)?-1:1,g=l&&f?-1:1,v=Oo(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:w}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),f?{x:b*g,y:x*m}:{x:x*m,y:b*g}}const bU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:l,placement:c,middlewareData:d}=t,f=await xU(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:s+f.x,y:l+f.y,data:{...f,placement:c}}}}},SU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:E=>{let{x:R,y:T}=E;return{x:R,y:T}}},...f}=Oo(e,t),m={x:n,y:r},g=await cf(t,f),v=Ds(Mo(s)),x=Ub(v);let b=m[x],w=m[v];if(l){const E=x==="y"?"top":"left",R=x==="y"?"bottom":"right",T=b+g[E],_=b-g[R];b=x0(T,b,_)}if(c){const E=v==="y"?"top":"left",R=v==="y"?"bottom":"right",T=w+g[E],_=w-g[R];w=x0(T,w,_)}const C=d.fn({...t,[x]:b,[v]:w});return{...C,data:{x:C.x-n,y:C.y-r,enabled:{[x]:l,[v]:c}}}}}},CU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:m=!0}=Oo(e,t),g={x:n,y:r},v=Ds(s),x=Ub(v);let b=g[x],w=g[v];const C=Oo(d,t),E=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(f){const _=x==="y"?"height":"width",O=l.reference[x]-l.floating[_]+E.mainAxis,A=l.reference[x]+l.reference[_]-E.mainAxis;b<O?b=O:b>A&&(b=A)}if(m){var R,T;const _=x==="y"?"width":"height",O=J_.has(Mo(s)),A=l.reference[v]-l.floating[_]+(O&&((R=c.offset)==null?void 0:R[v])||0)+(O?0:E.crossAxis),D=l.reference[v]+l.reference[_]+(O?0:((T=c.offset)==null?void 0:T[v])||0)-(O?E.crossAxis:0);w<A?w=A:w>D&&(w=D)}return{[x]:b,[v]:w}}}},wU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...m}=Oo(e,t),g=await cf(t,m),v=Mo(s),x=wu(s),b=Ds(s)==="y",{width:w,height:C}=l.floating;let E,R;v==="top"||v==="bottom"?(E=v,R=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=v,E=x==="end"?"top":"bottom");const T=C-g.top-g.bottom,_=w-g.left-g.right,O=Ni(C-g[E],T),A=Ni(w-g[R],_),D=!t.middlewareData.shift;let j=O,M=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=T),D&&!x){const Z=ma(g.left,0),K=ma(g.right,0),Y=ma(g.top,0),ae=ma(g.bottom,0);b?M=w-2*(Z!==0||K!==0?Z+K:ma(g.left,g.right)):j=C-2*(Y!==0||ae!==0?Y+ae:ma(g.top,g.bottom))}await f({...t,availableWidth:M,availableHeight:j});const z=await c.getDimensions(d.floating);return w!==z.width||C!==z.height?{reset:{rects:!0}}:{}}}};function og(){return typeof window<"u"}function Eu(e){return eN(e)?(e.nodeName||"").toLowerCase():"#document"}function va(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bs(e){var t;return(t=(eN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function eN(e){return og()?e instanceof Node||e instanceof va(e).Node:!1}function fs(e){return og()?e instanceof Element||e instanceof va(e).Element:!1}function Fs(e){return og()?e instanceof HTMLElement||e instanceof va(e).HTMLElement:!1}function NR(e){return!og()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof va(e).ShadowRoot}const EU=new Set(["inline","contents"]);function Af(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=hs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!EU.has(s)}const RU=new Set(["table","td","th"]);function TU(e){return RU.has(Eu(e))}const jU=[":popover-open",":modal"];function ig(e){return jU.some(t=>{try{return e.matches(t)}catch{return!1}})}const _U=["transform","translate","scale","rotate","perspective"],NU=["transform","translate","scale","rotate","perspective","filter"],AU=["paint","layout","strict","content"];function Vb(e){const t=Hb(),n=fs(e)?hs(e):e;return _U.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)||NU.some(r=>(n.willChange||"").includes(r))||AU.some(r=>(n.contain||"").includes(r))}function DU(e){let t=Ai(e);for(;Fs(t)&&!du(t);){if(Vb(t))return t;if(ig(t))return null;t=Ai(t)}return null}function Hb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const OU=new Set(["html","body","#document"]);function du(e){return OU.has(Eu(e))}function hs(e){return va(e).getComputedStyle(e)}function lg(e){return fs(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ai(e){if(Eu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||NR(e)&&e.host||Bs(e);return NR(t)?t.host:t}function tN(e){const t=Ai(e);return du(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fs(t)&&Af(t)?t:tN(t)}function uf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=tN(e),l=s===((r=e.ownerDocument)==null?void 0:r.body),c=va(s);if(l){const d=S0(c);return t.concat(c,c.visualViewport||[],Af(s)?s:[],d&&n?uf(d):[])}return t.concat(s,uf(s,[],n))}function S0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nN(e){const t=hs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Fs(e),l=s?e.offsetWidth:n,c=s?e.offsetHeight:r,d=ip(n)!==l||ip(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function $b(e){return fs(e)?e:e.contextElement}function tu(e){const t=$b(e);if(!Fs(t))return Is(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:l}=nN(t);let c=(l?ip(n.width):n.width)/r,d=(l?ip(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const MU=Is(0);function rN(e){const t=va(e);return!Hb()||!t.visualViewport?MU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==va(e)?!1:t}function Al(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),l=$b(e);let c=Is(1);t&&(r?fs(r)&&(c=tu(r)):c=tu(e));const d=kU(l,n,r)?rN(l):Is(0);let f=(s.left+d.x)/c.x,m=(s.top+d.y)/c.y,g=s.width/c.x,v=s.height/c.y;if(l){const x=va(l),b=r&&fs(r)?va(r):r;let w=x,C=S0(w);for(;C&&r&&b!==w;){const E=tu(C),R=C.getBoundingClientRect(),T=hs(C),_=R.left+(C.clientLeft+parseFloat(T.paddingLeft))*E.x,O=R.top+(C.clientTop+parseFloat(T.paddingTop))*E.y;f*=E.x,m*=E.y,g*=E.x,v*=E.y,f+=_,m+=O,w=va(C),C=S0(w)}}return cp({width:g,height:v,x:f,y:m})}function cg(e,t){const n=lg(e).scrollLeft;return t?t.left+n:Al(Bs(e)).left+n}function aN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-cg(e,n),s=n.top+t.scrollTop;return{x:r,y:s}}function IU(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const l=s==="fixed",c=Bs(r),d=t?ig(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},m=Is(1);const g=Is(0),v=Fs(r);if((v||!v&&!l)&&((Eu(r)!=="body"||Af(c))&&(f=lg(r)),Fs(r))){const b=Al(r);m=tu(r),g.x=b.x+r.clientLeft,g.y=b.y+r.clientTop}const x=c&&!v&&!l?aN(c,f):Is(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-f.scrollLeft*m.x+g.x+x.x,y:n.y*m.y-f.scrollTop*m.y+g.y+x.y}}function LU(e){return Array.from(e.getClientRects())}function PU(e){const t=Bs(e),n=lg(e),r=e.ownerDocument.body,s=ma(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=ma(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+cg(e);const d=-n.scrollTop;return hs(r).direction==="rtl"&&(c+=ma(t.clientWidth,r.clientWidth)-s),{width:s,height:l,x:c,y:d}}const AR=25;function UU(e,t){const n=va(e),r=Bs(e),s=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(s){l=s.width,c=s.height;const g=Hb();(!g||g&&t==="fixed")&&(d=s.offsetLeft,f=s.offsetTop)}const m=cg(r);if(m<=0){const g=r.ownerDocument,v=g.body,x=getComputedStyle(v),b=g.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(r.clientWidth-v.clientWidth-b);w<=AR&&(l-=w)}else m<=AR&&(l+=m);return{width:l,height:c,x:d,y:f}}const FU=new Set(["absolute","fixed"]);function zU(e,t){const n=Al(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,l=Fs(e)?tu(e):Is(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=s*l.x,m=r*l.y;return{width:c,height:d,x:f,y:m}}function DR(e,t,n){let r;if(t==="viewport")r=UU(e,n);else if(t==="document")r=PU(Bs(e));else if(fs(t))r=zU(t,n);else{const s=rN(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return cp(r)}function sN(e,t){const n=Ai(e);return n===t||!fs(n)||du(n)?!1:hs(n).position==="fixed"||sN(n,t)}function VU(e,t){const n=t.get(e);if(n)return n;let r=uf(e,[],!1).filter(d=>fs(d)&&Eu(d)!=="body"),s=null;const l=hs(e).position==="fixed";let c=l?Ai(e):e;for(;fs(c)&&!du(c);){const d=hs(c),f=Vb(c);!f&&d.position==="fixed"&&(s=null),(l?!f&&!s:!f&&d.position==="static"&&!!s&&FU.has(s.position)||Af(c)&&!f&&sN(e,c))?r=r.filter(g=>g!==c):s=d,c=Ai(c)}return t.set(e,r),r}function HU(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?ig(t)?[]:VU(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((m,g)=>{const v=DR(t,g,s);return m.top=ma(v.top,m.top),m.right=Ni(v.right,m.right),m.bottom=Ni(v.bottom,m.bottom),m.left=ma(v.left,m.left),m},DR(t,d,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function $U(e){const{width:t,height:n}=nN(e);return{width:t,height:n}}function BU(e,t,n){const r=Fs(t),s=Bs(t),l=n==="fixed",c=Al(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Is(0);function m(){f.x=cg(s)}if(r||!r&&!l)if((Eu(t)!=="body"||Af(s))&&(d=lg(t)),r){const b=Al(t,!0,l,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else s&&m();l&&!r&&s&&m();const g=s&&!r&&!l?aN(s,d):Is(0),v=c.left+d.scrollLeft-f.x-g.x,x=c.top+d.scrollTop-f.y-g.y;return{x:v,y:x,width:c.width,height:c.height}}function Ex(e){return hs(e).position==="static"}function OR(e,t){if(!Fs(e)||hs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bs(e)===n&&(n=n.ownerDocument.body),n}function oN(e,t){const n=va(e);if(ig(e))return n;if(!Fs(e)){let s=Ai(e);for(;s&&!du(s);){if(fs(s)&&!Ex(s))return s;s=Ai(s)}return n}let r=OR(e,t);for(;r&&TU(r)&&Ex(r);)r=OR(r,t);return r&&du(r)&&Ex(r)&&!Vb(r)?n:r||DU(e)||n}const GU=async function(e){const t=this.getOffsetParent||oN,n=this.getDimensions,r=await n(e.floating);return{reference:BU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function qU(e){return hs(e).direction==="rtl"}const ZU={convertOffsetParentRelativeRectToViewportRelativeRect:IU,getDocumentElement:Bs,getClippingRect:HU,getOffsetParent:oN,getElementRects:GU,getClientRects:LU,getDimensions:$U,getScale:tu,isElement:fs,isRTL:qU};function iN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function KU(e,t){let n=null,r;const s=Bs(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),l();const m=e.getBoundingClientRect(),{left:g,top:v,width:x,height:b}=m;if(d||t(),!x||!b)return;const w=Em(v),C=Em(s.clientWidth-(g+x)),E=Em(s.clientHeight-(v+b)),R=Em(g),_={rootMargin:-w+"px "+-C+"px "+-E+"px "+-R+"px",threshold:ma(0,Ni(1,f))||1};let O=!0;function A(D){const j=D[0].intersectionRatio;if(j!==f){if(!O)return c();j?c(!1,j):r=setTimeout(()=>{c(!1,1e-7)},1e3)}j===1&&!iN(m,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(A,{..._,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return c(!0),l}function YU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,m=$b(e),g=s||l?[...m?uf(m):[],...uf(t)]:[];g.forEach(R=>{s&&R.addEventListener("scroll",n,{passive:!0}),l&&R.addEventListener("resize",n)});const v=m&&d?KU(m,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(R=>{let[T]=R;T&&T.target===m&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(t)})),n()}),m&&!f&&b.observe(m),b.observe(t));let w,C=f?Al(e):null;f&&E();function E(){const R=Al(e);C&&!iN(C,R)&&n(),C=R,w=requestAnimationFrame(E)}return n(),()=>{var R;g.forEach(T=>{s&&T.removeEventListener("scroll",n),l&&T.removeEventListener("resize",n)}),v==null||v(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(w)}}const WU=bU,QU=SU,XU=vU,JU=wU,eF=yU,MR=gU,tF=CU,nF=(e,t,n)=>{const r=new Map,s={platform:ZU,...n},l={...s.platform,_c:r};return pU(e,t,{...s,platform:l})};var rF=typeof document<"u",aF=function(){},qm=rF?p.useLayoutEffect:aF;function up(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(!up(e[r],t[r]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,s[r]))return!1;for(r=n;r--!==0;){const l=s[r];if(!(l==="_owner"&&e.$$typeof)&&!up(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function lN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kR(e,t){const n=lN(e);return Math.round(t*n)/n}function Rx(e){const t=p.useRef(e);return qm(()=>{t.current=e}),t}function sF(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:m}=e,[g,v]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=p.useState(r);up(x,r)||b(r);const[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useCallback(G=>{G!==D.current&&(D.current=G,C(G))},[]),_=p.useCallback(G=>{G!==j.current&&(j.current=G,R(G))},[]),O=l||w,A=c||E,D=p.useRef(null),j=p.useRef(null),M=p.useRef(g),z=f!=null,Z=Rx(f),K=Rx(s),Y=Rx(m),ae=p.useCallback(()=>{if(!D.current||!j.current)return;const G={placement:t,strategy:n,middleware:x};K.current&&(G.platform=K.current),nF(D.current,j.current,G).then(ie=>{const xe={...ie,isPositioned:Y.current!==!1};F.current&&!up(M.current,xe)&&(M.current=xe,is.flushSync(()=>{v(xe)}))})},[x,t,n,K,Y]);qm(()=>{m===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,v(G=>({...G,isPositioned:!1})))},[m]);const F=p.useRef(!1);qm(()=>(F.current=!0,()=>{F.current=!1}),[]),qm(()=>{if(O&&(D.current=O),A&&(j.current=A),O&&A){if(Z.current)return Z.current(O,A,ae);ae()}},[O,A,ae,Z,z]);const V=p.useMemo(()=>({reference:D,floating:j,setReference:T,setFloating:_}),[T,_]),I=p.useMemo(()=>({reference:O,floating:A}),[O,A]),B=p.useMemo(()=>{const G={position:n,left:0,top:0};if(!I.floating)return G;const ie=kR(I.floating,g.x),xe=kR(I.floating,g.y);return d?{...G,transform:"translate("+ie+"px, "+xe+"px)",...lN(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:xe}},[n,d,I.floating,g.x,g.y]);return p.useMemo(()=>({...g,update:ae,refs:V,elements:I,floatingStyles:B}),[g,ae,V,I,B])}const oF=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?MR({element:r.current,padding:s}).fn(n):{}:r?MR({element:r,padding:s}).fn(n):{}}}},iF=(e,t)=>({...WU(e),options:[e,t]}),lF=(e,t)=>({...QU(e),options:[e,t]}),cF=(e,t)=>({...tF(e),options:[e,t]}),uF=(e,t)=>({...XU(e),options:[e,t]}),dF=(e,t)=>({...JU(e),options:[e,t]}),fF=(e,t)=>({...eF(e),options:[e,t]}),hF=(e,t)=>({...oF(e),options:[e,t]});var mF="Arrow",cN=p.forwardRef((e,t)=>{const{children:n,width:r=10,height:s=5,...l}=e;return o.jsx(We.svg,{...l,ref:t,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});cN.displayName=mF;var pF=cN;function Bb(e){const[t,n]=p.useState(void 0);return wr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const l=s[0];let c,d;if("borderBoxSize"in l){const f=l.borderBoxSize,m=Array.isArray(f)?f[0]:f;c=m.inlineSize,d=m.blockSize}else c=e.offsetWidth,d=e.offsetHeight;n({width:c,height:d})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Gb="Popper",[uN,Gs]=kr(Gb),[gF,dN]=uN(Gb),fN=e=>{const{__scopePopper:t,children:n}=e,[r,s]=p.useState(null);return o.jsx(gF,{scope:t,anchor:r,onAnchorChange:s,children:n})};fN.displayName=Gb;var hN="PopperAnchor",mN=p.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...s}=e,l=dN(hN,n),c=p.useRef(null),d=pt(t,c),f=p.useRef(null);return p.useEffect(()=>{const m=f.current;f.current=(r==null?void 0:r.current)||c.current,m!==f.current&&l.onAnchorChange(f.current)}),r?null:o.jsx(We.div,{...s,ref:d})});mN.displayName=hN;var qb="PopperContent",[vF,yF]=uN(qb),pN=p.forwardRef((e,t)=>{var le,Ne,we,Te,Be,Xe;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:m=[],collisionPadding:g=0,sticky:v="partial",hideWhenDetached:x=!1,updatePositionStrategy:b="optimized",onPlaced:w,...C}=e,E=dN(qb,n),[R,T]=p.useState(null),_=pt(t,Vt=>T(Vt)),[O,A]=p.useState(null),D=Bb(O),j=(D==null?void 0:D.width)??0,M=(D==null?void 0:D.height)??0,z=r+(l!=="center"?"-"+l:""),Z=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},K=Array.isArray(m)?m:[m],Y=K.length>0,ae={padding:Z,boundary:K.filter(bF),altBoundary:Y},{refs:F,floatingStyles:V,placement:I,isPositioned:B,middlewareData:G}=sF({strategy:"fixed",placement:z,whileElementsMounted:(...Vt)=>YU(...Vt,{animationFrame:b==="always"}),elements:{reference:E.anchor},middleware:[iF({mainAxis:s+M,alignmentAxis:c}),f&&lF({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?cF():void 0,...ae}),f&&uF({...ae}),dF({...ae,apply:({elements:Vt,rects:jt,availableWidth:$t,availableHeight:Me})=>{const{width:_t,height:Nt}=jt.reference,rn=Vt.floating.style;rn.setProperty("--radix-popper-available-width",`${$t}px`),rn.setProperty("--radix-popper-available-height",`${Me}px`),rn.setProperty("--radix-popper-anchor-width",`${_t}px`),rn.setProperty("--radix-popper-anchor-height",`${Nt}px`)}}),O&&hF({element:O,padding:d}),SF({arrowWidth:j,arrowHeight:M}),x&&fF({strategy:"referenceHidden",...ae})]}),[ie,xe]=yN(I),L=ds(w);wr(()=>{B&&(L==null||L())},[B,L]);const P=(le=G.arrow)==null?void 0:le.x,W=(Ne=G.arrow)==null?void 0:Ne.y,ee=((we=G.arrow)==null?void 0:we.centerOffset)!==0,[de,ve]=p.useState();return wr(()=>{R&&ve(window.getComputedStyle(R).zIndex)},[R]),o.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:B?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:de,"--radix-popper-transform-origin":[(Te=G.transformOrigin)==null?void 0:Te.x,(Be=G.transformOrigin)==null?void 0:Be.y].join(" "),...((Xe=G.hide)==null?void 0:Xe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:o.jsx(vF,{scope:n,placedSide:ie,onArrowChange:A,arrowX:P,arrowY:W,shouldHideArrow:ee,children:o.jsx(We.div,{"data-side":ie,"data-align":xe,...C,ref:_,style:{...C.style,animation:B?void 0:"none"}})})})});pN.displayName=qb;var gN="PopperArrow",xF={top:"bottom",right:"left",bottom:"top",left:"right"},vN=p.forwardRef(function(t,n){const{__scopePopper:r,...s}=t,l=yF(gN,r),c=xF[l.placedSide];return o.jsx("span",{ref:l.onArrowChange,style:{position:"absolute",left:l.arrowX,top:l.arrowY,[c]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[l.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[l.placedSide],visibility:l.shouldHideArrow?"hidden":void 0},children:o.jsx(pF,{...s,ref:n,style:{...s.style,display:"block"}})})});vN.displayName=gN;function bF(e){return e!==null}var SF=e=>({name:"transformOrigin",options:e,fn(t){var E,R,T;const{placement:n,rects:r,middlewareData:s}=t,c=((E=s.arrow)==null?void 0:E.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[m,g]=yN(n),v={start:"0%",center:"50%",end:"100%"}[g],x=(((R=s.arrow)==null?void 0:R.x)??0)+d/2,b=(((T=s.arrow)==null?void 0:T.y)??0)+f/2;let w="",C="";return m==="bottom"?(w=c?v:`${x}px`,C=`${-f}px`):m==="top"?(w=c?v:`${x}px`,C=`${r.floating.height+f}px`):m==="right"?(w=`${-f}px`,C=c?v:`${b}px`):m==="left"&&(w=`${r.floating.width+f}px`,C=c?v:`${b}px`),{data:{x:w,y:C}}}});function yN(e){const[t,n="center"]=e.split("-");return[t,n]}var Ru=fN,Tu=mN,Df=pN,Of=vN,xN=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"}),CF="VisuallyHidden",bN=p.forwardRef((e,t)=>o.jsx(We.span,{...e,ref:t,style:{...xN,...e.style}}));bN.displayName=CF;var wF=bN,[ug]=kr("Tooltip",[Gs]),dg=Gs(),SN="TooltipProvider",EF=700,C0="tooltip.open",[RF,Zb]=ug(SN),CN=e=>{const{__scopeTooltip:t,delayDuration:n=EF,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:l}=e,c=p.useRef(!0),d=p.useRef(!1),f=p.useRef(0);return p.useEffect(()=>{const m=f.current;return()=>window.clearTimeout(m)},[]),o.jsx(RF,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:p.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:p.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:p.useCallback(m=>{d.current=m},[]),disableHoverableContent:s,children:l})};CN.displayName=SN;var df="Tooltip",[TF,Mf]=ug(df),wN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:s,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,f=Zb(df,e.__scopeTooltip),m=dg(t),[g,v]=p.useState(null),x=Dn(),b=p.useRef(0),w=c??f.disableHoverableContent,C=d??f.delayDuration,E=p.useRef(!1),[R,T]=zr({prop:r,defaultProp:s??!1,onChange:j=>{j?(f.onOpen(),document.dispatchEvent(new CustomEvent(C0))):f.onClose(),l==null||l(j)},caller:df}),_=p.useMemo(()=>R?E.current?"delayed-open":"instant-open":"closed",[R]),O=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,E.current=!1,T(!0)},[T]),A=p.useCallback(()=>{window.clearTimeout(b.current),b.current=0,T(!1)},[T]),D=p.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{E.current=!0,T(!0),b.current=0},C)},[C,T]);return p.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),o.jsx(Ru,{...m,children:o.jsx(TF,{scope:t,contentId:x,open:R,stateAttribute:_,trigger:g,onTriggerChange:v,onTriggerEnter:p.useCallback(()=>{f.isOpenDelayedRef.current?D():O()},[f.isOpenDelayedRef,D,O]),onTriggerLeave:p.useCallback(()=>{w?A():(window.clearTimeout(b.current),b.current=0)},[A,w]),onOpen:O,onClose:A,disableHoverableContent:w,children:n})})};wN.displayName=df;var w0="TooltipTrigger",EN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=Mf(w0,n),l=Zb(w0,n),c=dg(n),d=p.useRef(null),f=pt(t,d,s.onTriggerChange),m=p.useRef(!1),g=p.useRef(!1),v=p.useCallback(()=>m.current=!1,[]);return p.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),o.jsx(Tu,{asChild:!0,...c,children:o.jsx(We.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:f,onPointerMove:Re(e.onPointerMove,x=>{x.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(s.onTriggerEnter(),g.current=!0)}),onPointerLeave:Re(e.onPointerLeave,()=>{s.onTriggerLeave(),g.current=!1}),onPointerDown:Re(e.onPointerDown,()=>{s.open&&s.onClose(),m.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:Re(e.onFocus,()=>{m.current||s.onOpen()}),onBlur:Re(e.onBlur,s.onClose),onClick:Re(e.onClick,s.onClose)})})});EN.displayName=w0;var Kb="TooltipPortal",[jF,_F]=ug(Kb,{forceMount:void 0}),RN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:s}=e,l=Mf(Kb,t);return o.jsx(jF,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};RN.displayName=Kb;var fu="TooltipContent",TN=p.forwardRef((e,t)=>{const n=_F(fu,e.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...l}=e,c=Mf(fu,e.__scopeTooltip);return o.jsx(Er,{present:r||c.open,children:c.disableHoverableContent?o.jsx(jN,{side:s,...l,ref:t}):o.jsx(NF,{side:s,...l,ref:t})})}),NF=p.forwardRef((e,t)=>{const n=Mf(fu,e.__scopeTooltip),r=Zb(fu,e.__scopeTooltip),s=p.useRef(null),l=pt(t,s),[c,d]=p.useState(null),{trigger:f,onClose:m}=n,g=s.current,{onPointerInTransitChange:v}=r,x=p.useCallback(()=>{d(null),v(!1)},[v]),b=p.useCallback((w,C)=>{const E=w.currentTarget,R={x:w.clientX,y:w.clientY},T=MF(R,E.getBoundingClientRect()),_=kF(R,T),O=IF(C.getBoundingClientRect()),A=PF([..._,...O]);d(A),v(!0)},[v]);return p.useEffect(()=>()=>x(),[x]),p.useEffect(()=>{if(f&&g){const w=E=>b(E,g),C=E=>b(E,f);return f.addEventListener("pointerleave",w),g.addEventListener("pointerleave",C),()=>{f.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",C)}}},[f,g,b,x]),p.useEffect(()=>{if(c){const w=C=>{const E=C.target,R={x:C.clientX,y:C.clientY},T=(f==null?void 0:f.contains(E))||(g==null?void 0:g.contains(E)),_=!LF(R,c);T?x():_&&(x(),m())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[f,g,c,m,x]),o.jsx(jN,{...e,ref:l})}),[AF,DF]=ug(df,{isInside:!1}),OF=n_("TooltipContent"),jN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=Mf(fu,n),m=dg(n),{onClose:g}=f;return p.useEffect(()=>(document.addEventListener(C0,g),()=>document.removeEventListener(C0,g)),[g]),p.useEffect(()=>{if(f.trigger){const v=x=>{const b=x.target;b!=null&&b.contains(f.trigger)&&g()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[f.trigger,g]),o.jsx($l,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:v=>v.preventDefault(),onDismiss:g,children:o.jsxs(Df,{"data-state":f.stateAttribute,...m,...d,ref:t,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(OF,{children:r}),o.jsx(AF,{scope:n,isInside:!0,children:o.jsx(wF,{id:f.contentId,role:"tooltip",children:s||r})})]})})});TN.displayName=fu;var _N="TooltipArrow",NN=p.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,s=dg(n);return DF(_N,n).isInside?null:o.jsx(Of,{...s,...r,ref:t})});NN.displayName=_N;function MF(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),s=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,s,l)){case l:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function kF(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 IF(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 LF(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],m=d.x,g=d.y,v=f.x,x=f.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function PF(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),UF(t)}function UF(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const s=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))t.pop();else break}t.push(s)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const s=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(s.y-c.y)>=(l.y-c.y)*(s.x-c.x))n.pop();else break}n.push(s)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var FF=CN,zF=wN,VF=EN,HF=RN,$F=TN,BF=NN;function ls({delayDuration:e=0,...t}){return o.jsx(FF,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function St({...e}){return o.jsx(ls,{children:o.jsx(zF,{"data-slot":"tooltip",...e})})}function Ct({...e}){return o.jsx(VF,{"data-slot":"tooltip-trigger",...e})}function wt({className:e,sideOffset:t=0,children:n,...r}){return o.jsx(HF,{children:o.jsxs($F,{"data-slot":"tooltip-content",sideOffset:t,className:J("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-md bg-black px-3 py-1.5 text-xs text-balance text-white dark:bg-white dark:text-black",e),...r,children:[n,o.jsx(BF,{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 GF="sidebar_state",qF=3600*24*7,ZF="16rem",KF="18rem",YF="3rem",WF="b",AN=p.createContext(null);function kf(){const e=p.useContext(AN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function QF({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:s,children:l,...c}){const d=KL(),[f,m]=p.useState(!1),[g,v]=p.useState(e),x=t??g,b=p.useCallback(R=>{const T=typeof R=="function"?R(x):R;n?n(T):v(T),document.cookie=`${GF}=${T}; path=/; max-age=${qF}`},[n,x]),w=p.useCallback(()=>d?m(R=>!R):b(R=>!R),[d,b,m]);p.useEffect(()=>{const R=T=>{T.key===WF&&(T.metaKey||T.ctrlKey)&&(T.preventDefault(),w())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[w]);const C=x?"expanded":"collapsed",E=p.useMemo(()=>({state:C,open:x,setOpen:b,isMobile:d,openMobile:f,setOpenMobile:m,toggleSidebar:w}),[C,x,b,d,f,m,w]);return o.jsx(AN.Provider,{value:E,children:o.jsx(ls,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ZF,"--sidebar-width-icon":YF,...s},className:J("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:l})})})}function XF({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:s,...l}){const{isMobile:c,state:d,openMobile:f,setOpenMobile:m}=kf();return n==="none"?o.jsx("div",{"data-slot":"sidebar",className:J("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:s}):c?o.jsx(Li,{open:f,onOpenChange:m,...l,children:o.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":KF},side:e,children:[o.jsxs(Ui,{className:"sr-only",children:[o.jsx(Fi,{children:"Sidebar"}),o.jsx(Gl,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):o.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[o.jsx("div",{"data-slot":"sidebar-gap",className:J("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{"data-slot":"sidebar-container",className:J("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function JF({className:e,onClick:t,...n}){const{toggleSidebar:r}=kf();return o.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:o.jsxs(be,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:J("size-7",e),onClick:s=>{t==null||t(s),r()},...n,children:[o.jsx(uL,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function ez({className:e,...t}){const{toggleSidebar:n}=kf();return o.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:J("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})}function tz({className:e,...t}){return o.jsx("main",{"data-slot":"sidebar-inset",className:J("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",e),...t})}function nz({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:J("flex flex-col gap-2 p-2",e),...t})}function rz({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:J("flex flex-col gap-2 p-2",e),...t})}function az({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:J("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function IR({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:J("relative flex w-full min-w-0 flex-col p-2",e),...t})}function LR({className:e,...t}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:J("w-full text-sm",e),...t})}function sz({className:e,...t}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:J("flex w-full min-w-0 flex-col gap-1",e),...t})}function oz({className:e,...t}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:J("group/menu-item relative",e),...t})}const iz=Ef("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 lz({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:s,className:l,...c}){const d=e?Kp:"button",{isMobile:f,state:m}=kf(),g=o.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:J(iz({variant:n,size:r}),l),...c});return s?(typeof s=="string"&&(s={children:s}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:g}),o.jsx(wt,{side:"right",align:"center",hidden:m!=="collapsed"||f,...s})]})):g}function fg(e){const t=e+"CollectionProvider",[n,r]=kr(t),[s,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=C=>{const{scope:E,children:R}=C,T=_e.useRef(null),_=_e.useRef(new Map).current;return o.jsx(s,{scope:E,itemMap:_,collectionRef:T,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=_i(d),m=_e.forwardRef((C,E)=>{const{scope:R,children:T}=C,_=l(d,R),O=pt(E,_.collectionRef);return o.jsx(f,{ref:O,children:T})});m.displayName=d;const g=e+"CollectionItemSlot",v="data-radix-collection-item",x=_i(g),b=_e.forwardRef((C,E)=>{const{scope:R,children:T,..._}=C,O=_e.useRef(null),A=pt(E,O),D=l(g,R);return _e.useEffect(()=>(D.itemMap.set(O,{ref:O,..._}),()=>void D.itemMap.delete(O))),o.jsx(x,{[v]:"",ref:A,children:T})});b.displayName=g;function w(C){const E=l(e+"CollectionConsumer",C);return _e.useCallback(()=>{const T=E.collectionRef.current;if(!T)return[];const _=Array.from(T.querySelectorAll(`[${v}]`));return Array.from(E.itemMap.values()).sort((D,j)=>_.indexOf(D.ref.current)-_.indexOf(j.ref.current))},[E.collectionRef,E.itemMap])}return[{Provider:c,Slot:m,ItemSlot:b},w,r]}var cz=p.createContext(void 0);function If(e){const t=p.useContext(cz);return e||t||"ltr"}var Tx="rovingFocusGroup.onEntryFocus",uz={bubbles:!1,cancelable:!0},Lf="RovingFocusGroup",[E0,DN,dz]=fg(Lf),[fz,hg]=kr(Lf,[dz]),[hz,mz]=fz(Lf),ON=p.forwardRef((e,t)=>o.jsx(E0.Provider,{scope:e.__scopeRovingFocusGroup,children:o.jsx(E0.Slot,{scope:e.__scopeRovingFocusGroup,children:o.jsx(pz,{...e,ref:t})})}));ON.displayName=Lf;var pz=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:s=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:m,preventScrollOnEntryFocus:g=!1,...v}=e,x=p.useRef(null),b=pt(t,x),w=If(l),[C,E]=zr({prop:c,defaultProp:d??null,onChange:f,caller:Lf}),[R,T]=p.useState(!1),_=ds(m),O=DN(n),A=p.useRef(!1),[D,j]=p.useState(0);return p.useEffect(()=>{const M=x.current;if(M)return M.addEventListener(Tx,_),()=>M.removeEventListener(Tx,_)},[_]),o.jsx(hz,{scope:n,orientation:r,dir:w,loop:s,currentTabStopId:C,onItemFocus:p.useCallback(M=>E(M),[E]),onItemShiftTab:p.useCallback(()=>T(!0),[]),onFocusableItemAdd:p.useCallback(()=>j(M=>M+1),[]),onFocusableItemRemove:p.useCallback(()=>j(M=>M-1),[]),children:o.jsx(We.div,{tabIndex:R||D===0?-1:0,"data-orientation":r,...v,ref:b,style:{outline:"none",...e.style},onMouseDown:Re(e.onMouseDown,()=>{A.current=!0}),onFocus:Re(e.onFocus,M=>{const z=!A.current;if(M.target===M.currentTarget&&z&&!R){const Z=new CustomEvent(Tx,uz);if(M.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const K=O().filter(I=>I.focusable),Y=K.find(I=>I.active),ae=K.find(I=>I.id===C),V=[Y,ae,...K].filter(Boolean).map(I=>I.ref.current);IN(V,g)}}A.current=!1}),onBlur:Re(e.onBlur,()=>T(!1))})})}),MN="RovingFocusGroupItem",kN=p.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:s=!1,tabStopId:l,children:c,...d}=e,f=Dn(),m=l||f,g=mz(MN,n),v=g.currentTabStopId===m,x=DN(n),{onFocusableItemAdd:b,onFocusableItemRemove:w,currentTabStopId:C}=g;return p.useEffect(()=>{if(r)return b(),()=>w()},[r,b,w]),o.jsx(E0.ItemSlot,{scope:n,id:m,focusable:r,active:s,children:o.jsx(We.span,{tabIndex:v?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Re(e.onMouseDown,E=>{r?g.onItemFocus(m):E.preventDefault()}),onFocus:Re(e.onFocus,()=>g.onItemFocus(m)),onKeyDown:Re(e.onKeyDown,E=>{if(E.key==="Tab"&&E.shiftKey){g.onItemShiftTab();return}if(E.target!==E.currentTarget)return;const R=yz(E,g.orientation,g.dir);if(R!==void 0){if(E.metaKey||E.ctrlKey||E.altKey||E.shiftKey)return;E.preventDefault();let _=x().filter(O=>O.focusable).map(O=>O.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const O=_.indexOf(E.currentTarget);_=g.loop?xz(_,O+1):_.slice(O+1)}setTimeout(()=>IN(_))}}),children:typeof c=="function"?c({isCurrentTabStop:v,hasTabStop:C!=null}):c})})});kN.displayName=MN;var gz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yz(e,t,n){const r=vz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return gz[r]}function IN(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function xz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var LN=ON,PN=kN,R0=["Enter"," "],bz=["ArrowDown","PageUp","Home"],UN=["ArrowUp","PageDown","End"],Sz=[...bz,...UN],Cz={ltr:[...R0,"ArrowRight"],rtl:[...R0,"ArrowLeft"]},wz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Pf="Menu",[ff,Ez,Rz]=fg(Pf),[ql,FN]=kr(Pf,[Rz,Gs,hg]),Uf=Gs(),zN=hg(),[VN,zi]=ql(Pf),[Tz,Ff]=ql(Pf),HN=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:s,onOpenChange:l,modal:c=!0}=e,d=Uf(t),[f,m]=p.useState(null),g=p.useRef(!1),v=ds(l),x=If(s);return p.useEffect(()=>{const b=()=>{g.current=!0,document.addEventListener("pointerdown",w,{capture:!0,once:!0}),document.addEventListener("pointermove",w,{capture:!0,once:!0})},w=()=>g.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",w,{capture:!0}),document.removeEventListener("pointermove",w,{capture:!0})}},[]),o.jsx(Ru,{...d,children:o.jsx(VN,{scope:t,open:n,onOpenChange:v,content:f,onContentChange:m,children:o.jsx(Tz,{scope:t,onClose:p.useCallback(()=>v(!1),[v]),isUsingKeyboardRef:g,dir:x,modal:c,children:r})})})};HN.displayName=Pf;var jz="MenuAnchor",Yb=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Uf(n);return o.jsx(Tu,{...s,...r,ref:t})});Yb.displayName=jz;var Wb="MenuPortal",[_z,$N]=ql(Wb,{forceMount:void 0}),BN=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:s}=e,l=zi(Wb,t);return o.jsx(_z,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};BN.displayName=Wb;var $a="MenuContent",[Nz,Qb]=ql($a),GN=p.forwardRef((e,t)=>{const n=$N($a,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=zi($a,e.__scopeMenu),c=Ff($a,e.__scopeMenu);return o.jsx(ff.Provider,{scope:e.__scopeMenu,children:o.jsx(Er,{present:r||l.open,children:o.jsx(ff.Slot,{scope:e.__scopeMenu,children:c.modal?o.jsx(Az,{...s,ref:t}):o.jsx(Dz,{...s,ref:t})})})})}),Az=p.forwardRef((e,t)=>{const n=zi($a,e.__scopeMenu),r=p.useRef(null),s=pt(t,r);return p.useEffect(()=>{const l=r.current;if(l)return Jp(l)},[]),o.jsx(Xb,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Re(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Dz=p.forwardRef((e,t)=>{const n=zi($a,e.__scopeMenu);return o.jsx(Xb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Oz=_i("MenuContent.ScrollLock"),Xb=p.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:f,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,disableOutsideScroll:w,...C}=e,E=zi($a,n),R=Ff($a,n),T=Uf(n),_=zN(n),O=Ez(n),[A,D]=p.useState(null),j=p.useRef(null),M=pt(t,j,E.onContentChange),z=p.useRef(0),Z=p.useRef(""),K=p.useRef(0),Y=p.useRef(null),ae=p.useRef("right"),F=p.useRef(0),V=w?Nf:p.Fragment,I=w?{as:Oz,allowPinchZoom:!0}:void 0,B=ie=>{var le,Ne;const xe=Z.current+ie,L=O().filter(we=>!we.disabled),P=document.activeElement,W=(le=L.find(we=>we.ref.current===P))==null?void 0:le.textValue,ee=L.map(we=>we.textValue),de=Bz(ee,xe,W),ve=(Ne=L.find(we=>we.textValue===de))==null?void 0:Ne.ref.current;(function we(Te){Z.current=Te,window.clearTimeout(z.current),Te!==""&&(z.current=window.setTimeout(()=>we(""),1e3))})(xe),ve&&setTimeout(()=>ve.focus())};p.useEffect(()=>()=>window.clearTimeout(z.current),[]),Qp();const G=p.useCallback(ie=>{var L,P;return ae.current===((L=Y.current)==null?void 0:L.side)&&qz(ie,(P=Y.current)==null?void 0:P.area)},[]);return o.jsx(Nz,{scope:n,searchRef:Z,onItemEnter:p.useCallback(ie=>{G(ie)&&ie.preventDefault()},[G]),onItemLeave:p.useCallback(ie=>{var xe;G(ie)||((xe=j.current)==null||xe.focus(),D(null))},[G]),onTriggerLeave:p.useCallback(ie=>{G(ie)&&ie.preventDefault()},[G]),pointerGraceTimerRef:K,onPointerGraceIntentChange:p.useCallback(ie=>{Y.current=ie},[]),children:o.jsx(V,{...I,children:o.jsx(_f,{asChild:!0,trapped:s,onMountAutoFocus:Re(l,ie=>{var xe;ie.preventDefault(),(xe=j.current)==null||xe.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:o.jsx($l,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:m,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:x,onDismiss:b,children:o.jsx(LN,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:D,onEntryFocus:Re(f,ie=>{R.isUsingKeyboardRef.current||ie.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Df,{role:"menu","aria-orientation":"vertical","data-state":lA(E.open),"data-radix-menu-content":"",dir:R.dir,...T,...C,ref:M,style:{outline:"none",...C.style},onKeyDown:Re(C.onKeyDown,ie=>{const L=ie.target.closest("[data-radix-menu-content]")===ie.currentTarget,P=ie.ctrlKey||ie.altKey||ie.metaKey,W=ie.key.length===1;L&&(ie.key==="Tab"&&ie.preventDefault(),!P&&W&&B(ie.key));const ee=j.current;if(ie.target!==ee||!Sz.includes(ie.key))return;ie.preventDefault();const ve=O().filter(le=>!le.disabled).map(le=>le.ref.current);UN.includes(ie.key)&&ve.reverse(),Hz(ve)}),onBlur:Re(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(z.current),Z.current="")}),onPointerMove:Re(e.onPointerMove,hf(ie=>{const xe=ie.target,L=F.current!==ie.clientX;if(ie.currentTarget.contains(xe)&&L){const P=ie.clientX>F.current?"right":"left";ae.current=P,F.current=ie.clientX}}))})})})})})})});GN.displayName=$a;var Mz="MenuGroup",Jb=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(We.div,{role:"group",...r,ref:t})});Jb.displayName=Mz;var kz="MenuLabel",qN=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(We.div,{...r,ref:t})});qN.displayName=kz;var dp="MenuItem",PR="menu.itemSelect",mg=p.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...s}=e,l=p.useRef(null),c=Ff(dp,e.__scopeMenu),d=Qb(dp,e.__scopeMenu),f=pt(t,l),m=p.useRef(!1),g=()=>{const v=l.current;if(!n&&v){const x=new CustomEvent(PR,{bubbles:!0,cancelable:!0});v.addEventListener(PR,b=>r==null?void 0:r(b),{once:!0}),S_(v,x),x.defaultPrevented?m.current=!1:c.onClose()}};return o.jsx(ZN,{...s,ref:f,disabled:n,onClick:Re(e.onClick,g),onPointerDown:v=>{var x;(x=e.onPointerDown)==null||x.call(e,v),m.current=!0},onPointerUp:Re(e.onPointerUp,v=>{var x;m.current||(x=v.currentTarget)==null||x.click()}),onKeyDown:Re(e.onKeyDown,v=>{const x=d.searchRef.current!=="";n||x&&v.key===" "||R0.includes(v.key)&&(v.currentTarget.click(),v.preventDefault())})})});mg.displayName=dp;var ZN=p.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:s,...l}=e,c=Qb(dp,n),d=zN(n),f=p.useRef(null),m=pt(t,f),[g,v]=p.useState(!1),[x,b]=p.useState("");return p.useEffect(()=>{const w=f.current;w&&b((w.textContent??"").trim())},[l.children]),o.jsx(ff.ItemSlot,{scope:n,disabled:r,textValue:s??x,children:o.jsx(PN,{asChild:!0,...d,focusable:!r,children:o.jsx(We.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:m,onPointerMove:Re(e.onPointerMove,hf(w=>{r?c.onItemLeave(w):(c.onItemEnter(w),w.defaultPrevented||w.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Re(e.onPointerLeave,hf(w=>c.onItemLeave(w))),onFocus:Re(e.onFocus,()=>v(!0)),onBlur:Re(e.onBlur,()=>v(!1))})})})}),Iz="MenuCheckboxItem",KN=p.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...s}=e;return o.jsx(JN,{scope:e.__scopeMenu,checked:n,children:o.jsx(mg,{role:"menuitemcheckbox","aria-checked":fp(n)?"mixed":n,...s,ref:t,"data-state":n1(n),onSelect:Re(s.onSelect,()=>r==null?void 0:r(fp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});KN.displayName=Iz;var YN="MenuRadioGroup",[Lz,Pz]=ql(YN,{value:void 0,onValueChange:()=>{}}),WN=p.forwardRef((e,t)=>{const{value:n,onValueChange:r,...s}=e,l=ds(r);return o.jsx(Lz,{scope:e.__scopeMenu,value:n,onValueChange:l,children:o.jsx(Jb,{...s,ref:t})})});WN.displayName=YN;var QN="MenuRadioItem",XN=p.forwardRef((e,t)=>{const{value:n,...r}=e,s=Pz(QN,e.__scopeMenu),l=n===s.value;return o.jsx(JN,{scope:e.__scopeMenu,checked:l,children:o.jsx(mg,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":n1(l),onSelect:Re(r.onSelect,()=>{var c;return(c=s.onValueChange)==null?void 0:c.call(s,n)},{checkForDefaultPrevented:!1})})})});XN.displayName=QN;var e1="MenuItemIndicator",[JN,Uz]=ql(e1,{checked:!1}),eA=p.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...s}=e,l=Uz(e1,n);return o.jsx(Er,{present:r||fp(l.checked)||l.checked===!0,children:o.jsx(We.span,{...s,ref:t,"data-state":n1(l.checked)})})});eA.displayName=e1;var Fz="MenuSeparator",tA=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return o.jsx(We.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});tA.displayName=Fz;var zz="MenuArrow",nA=p.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,s=Uf(n);return o.jsx(Of,{...s,...r,ref:t})});nA.displayName=zz;var t1="MenuSub",[Vz,rA]=ql(t1),aA=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:s}=e,l=zi(t1,t),c=Uf(t),[d,f]=p.useState(null),[m,g]=p.useState(null),v=ds(s);return p.useEffect(()=>(l.open===!1&&v(!1),()=>v(!1)),[l.open,v]),o.jsx(Ru,{...c,children:o.jsx(VN,{scope:t,open:r,onOpenChange:v,content:m,onContentChange:g,children:o.jsx(Vz,{scope:t,contentId:Dn(),triggerId:Dn(),trigger:d,onTriggerChange:f,children:n})})})};aA.displayName=t1;var Gd="MenuSubTrigger",sA=p.forwardRef((e,t)=>{const n=zi(Gd,e.__scopeMenu),r=Ff(Gd,e.__scopeMenu),s=rA(Gd,e.__scopeMenu),l=Qb(Gd,e.__scopeMenu),c=p.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:f}=l,m={__scopeMenu:e.__scopeMenu},g=p.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return p.useEffect(()=>g,[g]),p.useEffect(()=>{const v=d.current;return()=>{window.clearTimeout(v),f(null)}},[d,f]),o.jsx(Yb,{asChild:!0,...m,children:o.jsx(ZN,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":s.contentId,"data-state":lA(n.open),...e,ref:Do(t,s.onTriggerChange),onClick:v=>{var x;(x=e.onClick)==null||x.call(e,v),!(e.disabled||v.defaultPrevented)&&(v.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Re(e.onPointerMove,hf(v=>{l.onItemEnter(v),!v.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Re(e.onPointerLeave,hf(v=>{var b,w;g();const x=(b=n.content)==null?void 0:b.getBoundingClientRect();if(x){const C=(w=n.content)==null?void 0:w.dataset.side,E=C==="right",R=E?-5:5,T=x[E?"left":"right"],_=x[E?"right":"left"];l.onPointerGraceIntentChange({area:[{x:v.clientX+R,y:v.clientY},{x:T,y:x.top},{x:_,y:x.top},{x:_,y:x.bottom},{x:T,y:x.bottom}],side:C}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(v),v.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Re(e.onKeyDown,v=>{var b;const x=l.searchRef.current!=="";e.disabled||x&&v.key===" "||Cz[r.dir].includes(v.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),v.preventDefault())})})})});sA.displayName=Gd;var oA="MenuSubContent",iA=p.forwardRef((e,t)=>{const n=$N($a,e.__scopeMenu),{forceMount:r=n.forceMount,...s}=e,l=zi($a,e.__scopeMenu),c=Ff($a,e.__scopeMenu),d=rA(oA,e.__scopeMenu),f=p.useRef(null),m=pt(t,f);return o.jsx(ff.Provider,{scope:e.__scopeMenu,children:o.jsx(Er,{present:r||l.open,children:o.jsx(ff.Slot,{scope:e.__scopeMenu,children:o.jsx(Xb,{id:d.contentId,"aria-labelledby":d.triggerId,...s,ref:m,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var v;c.isUsingKeyboardRef.current&&((v=f.current)==null||v.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Re(e.onFocusOutside,g=>{g.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Re(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:Re(e.onKeyDown,g=>{var b;const v=g.currentTarget.contains(g.target),x=wz[c.dir].includes(g.key);v&&x&&(l.onOpenChange(!1),(b=d.trigger)==null||b.focus(),g.preventDefault())})})})})})});iA.displayName=oA;function lA(e){return e?"open":"closed"}function fp(e){return e==="indeterminate"}function n1(e){return fp(e)?"indeterminate":e?"checked":"unchecked"}function Hz(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function $z(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Bz(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=$z(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function Gz(e,t){const{x:n,y:r}=e;let s=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],m=d.x,g=d.y,v=f.x,x=f.y;g>r!=x>r&&n<(v-m)*(r-g)/(x-g)+m&&(s=!s)}return s}function qz(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Gz(n,t)}function hf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Zz=HN,Kz=Yb,Yz=BN,Wz=GN,Qz=Jb,Xz=qN,Jz=mg,eV=KN,tV=WN,nV=XN,rV=eA,aV=tA,sV=nA,oV=aA,iV=sA,lV=iA,pg="DropdownMenu",[cV]=kr(pg,[FN]),Ir=FN(),[uV,cA]=cV(pg),uA=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:s,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,f=Ir(t),m=p.useRef(null),[g,v]=zr({prop:s,defaultProp:l??!1,onChange:c,caller:pg});return o.jsx(uV,{scope:t,triggerId:Dn(),triggerRef:m,contentId:Dn(),open:g,onOpenChange:v,onOpenToggle:p.useCallback(()=>v(x=>!x),[v]),modal:d,children:o.jsx(Zz,{...f,open:g,onOpenChange:v,dir:r,modal:d,children:n})})};uA.displayName=pg;var dA="DropdownMenuTrigger",fA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...s}=e,l=cA(dA,n),c=Ir(n);return o.jsx(Kz,{asChild:!0,...c,children:o.jsx(We.button,{type:"button",id:l.triggerId,"aria-haspopup":"menu","aria-expanded":l.open,"aria-controls":l.open?l.contentId:void 0,"data-state":l.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...s,ref:Do(t,l.triggerRef),onPointerDown:Re(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:Re(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});fA.displayName=dA;var dV="DropdownMenuPortal",hA=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ir(t);return o.jsx(Yz,{...r,...n})};hA.displayName=dV;var mA="DropdownMenuContent",pA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=cA(mA,n),l=Ir(n),c=p.useRef(!1);return o.jsx(Wz,{id:s.contentId,"aria-labelledby":s.triggerId,...l,...r,ref:t,onCloseAutoFocus:Re(e.onCloseAutoFocus,d=>{var f;c.current||(f=s.triggerRef.current)==null||f.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Re(e.onInteractOutside,d=>{const f=d.detail.originalEvent,m=f.button===0&&f.ctrlKey===!0,g=f.button===2||m;(!s.modal||g)&&(c.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});pA.displayName=mA;var fV="DropdownMenuGroup",hV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Qz,{...s,...r,ref:t})});hV.displayName=fV;var mV="DropdownMenuLabel",pV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Xz,{...s,...r,ref:t})});pV.displayName=mV;var gV="DropdownMenuItem",gA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(Jz,{...s,...r,ref:t})});gA.displayName=gV;var vV="DropdownMenuCheckboxItem",yV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(eV,{...s,...r,ref:t})});yV.displayName=vV;var xV="DropdownMenuRadioGroup",bV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(tV,{...s,...r,ref:t})});bV.displayName=xV;var SV="DropdownMenuRadioItem",CV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(nV,{...s,...r,ref:t})});CV.displayName=SV;var wV="DropdownMenuItemIndicator",EV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(rV,{...s,...r,ref:t})});EV.displayName=wV;var RV="DropdownMenuSeparator",vA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(aV,{...s,...r,ref:t})});vA.displayName=RV;var TV="DropdownMenuArrow",jV=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(sV,{...s,...r,ref:t})});jV.displayName=TV;var _V=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:s,defaultOpen:l}=e,c=Ir(t),[d,f]=zr({prop:r,defaultProp:l??!1,onChange:s,caller:"DropdownMenuSub"});return o.jsx(oV,{...c,open:d,onOpenChange:f,children:n})},NV="DropdownMenuSubTrigger",yA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(iV,{...s,...r,ref:t})});yA.displayName=NV;var AV="DropdownMenuSubContent",xA=p.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,s=Ir(n);return o.jsx(lV,{...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)"}})});xA.displayName=AV;var DV=uA,OV=fA,bA=hA,MV=pA,kV=gA,IV=vA,LV=_V,PV=yA,UV=xA;function Rr({...e}){return o.jsx(DV,{"data-slot":"dropdown-menu",...e})}function FV({...e}){return o.jsx(bA,{"data-slot":"dropdown-menu-portal",...e})}function Tr({...e}){return o.jsx(OV,{"data-slot":"dropdown-menu-trigger",...e})}function jr({className:e,sideOffset:t=4,...n}){return o.jsx(bA,{children:o.jsx(MV,{"data-slot":"dropdown-menu-content",sideOffset:t,className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",e),...n})})}function yt({className:e,inset:t,variant:n="default",...r}){return o.jsx(kV,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:J("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function qa({className:e,...t}){return o.jsx(IV,{"data-slot":"dropdown-menu-separator",className:J("bg-border -mx-1 my-1 h-px",e),...t})}function r1({...e}){return o.jsx(LV,{"data-slot":"dropdown-menu-sub",...e})}function a1({className:e,inset:t,children:n,...r}){return o.jsxs(PV,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:J("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,o.jsx(Ta,{className:"ml-auto size-4"})]})}function s1({className:e,...t}){return o.jsx(UV,{"data-slot":"dropdown-menu-sub-content",className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-lg",e),...t})}const zV="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",VV=({width:e=45,height:t=36,className:n=""})=>o.jsx("img",{src:zV,alt:"OWOX Logo",width:e,height:t,className:n}),SA=p.createContext(null),CA=p.createContext(()=>{});function HV(){return p.useContext(CA)}function hp(e){const t=p.useContext(SA);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function wA(){return hp(e=>e.project)}function o1(){const{data:e,callState:t,error:n}=hp(r=>r.flags);return{flags:e,callState:t,error:n}}function $V({isOpen:e}){const{title:t}=wA();return o.jsx(Tr,{asChild:!0,children:o.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[o.jsx("div",{className:"text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:o.jsx(VV,{width:24,height:24})}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[o.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),o.jsx(Ka,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var Or=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(Or||{});function EA(e,t){return function(){return e.apply(t,arguments)}}const{toString:BV}=Object.prototype,{getPrototypeOf:i1}=Object,{iterator:gg,toStringTag:RA}=Symbol,vg=(e=>t=>{const n=BV.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ys=e=>(e=e.toLowerCase(),t=>vg(t)===e),yg=e=>t=>typeof t===e,{isArray:ju}=Array,hu=yg("undefined");function zf(e){return e!==null&&!hu(e)&&e.constructor!==null&&!hu(e.constructor)&&ea(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const TA=ys("ArrayBuffer");function GV(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&TA(e.buffer),t}const qV=yg("string"),ea=yg("function"),jA=yg("number"),Vf=e=>e!==null&&typeof e=="object",ZV=e=>e===!0||e===!1,Zm=e=>{if(vg(e)!=="object")return!1;const t=i1(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(RA in e)&&!(gg in e)},KV=e=>{if(!Vf(e)||zf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},YV=ys("Date"),WV=ys("File"),QV=ys("Blob"),XV=ys("FileList"),JV=e=>Vf(e)&&ea(e.pipe),eH=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||ea(e.append)&&((t=vg(e))==="formdata"||t==="object"&&ea(e.toString)&&e.toString()==="[object FormData]"))},tH=ys("URLSearchParams"),[nH,rH,aH,sH]=["ReadableStream","Request","Response","Headers"].map(ys),oH=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),ju(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(zf(e))return;const l=n?Object.getOwnPropertyNames(e):Object.keys(e),c=l.length;let d;for(r=0;r<c;r++)d=l[r],t.call(null,e[d],d,e)}}function _A(e,t){if(zf(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 xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,NA=e=>!hu(e)&&e!==xl;function T0(){const{caseless:e,skipUndefined:t}=NA(this)&&this||{},n={},r=(s,l)=>{const c=e&&_A(n,l)||l;Zm(n[c])&&Zm(s)?n[c]=T0(n[c],s):Zm(s)?n[c]=T0({},s):ju(s)?n[c]=s.slice():(!t||!hu(s))&&(n[c]=s)};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&Hf(arguments[s],r);return n}const iH=(e,t,n,{allOwnKeys:r}={})=>(Hf(t,(s,l)=>{n&&ea(s)?e[l]=EA(s,n):e[l]=s},{allOwnKeys:r}),e),lH=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),cH=(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)},uH=(e,t,n,r)=>{let s,l,c;const d={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),l=s.length;l-- >0;)c=s[l],(!r||r(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&i1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dH=(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},fH=e=>{if(!e)return null;if(ju(e))return e;let t=e.length;if(!jA(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},hH=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&i1(Uint8Array)),mH=(e,t)=>{const r=(e&&e[gg]).call(e);let s;for(;(s=r.next())&&!s.done;){const l=s.value;t.call(e,l[0],l[1])}},pH=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},gH=ys("HTMLFormElement"),vH=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),UR=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),yH=ys("RegExp"),AA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Hf(n,(s,l)=>{let c;(c=t(s,l,e))!==!1&&(r[l]=c||s)}),Object.defineProperties(e,r)},xH=e=>{AA(e,(t,n)=>{if(ea(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(ea(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+"'")})}})},bH=(e,t)=>{const n={},r=s=>{s.forEach(l=>{n[l]=!0})};return ju(e)?r(e):r(String(e).split(t)),n},SH=()=>{},CH=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function wH(e){return!!(e&&ea(e.append)&&e[RA]==="FormData"&&e[gg])}const EH=e=>{const t=new Array(10),n=(r,s)=>{if(Vf(r)){if(t.indexOf(r)>=0)return;if(zf(r))return r;if(!("toJSON"in r)){t[s]=r;const l=ju(r)?[]:{};return Hf(r,(c,d)=>{const f=n(c,s+1);!hu(f)&&(l[d]=f)}),t[s]=void 0,l}}return r};return n(e,0)},RH=ys("AsyncFunction"),TH=e=>e&&(Vf(e)||ea(e))&&ea(e.then)&&ea(e.catch),DA=((e,t)=>e?setImmediate:t?((n,r)=>(xl.addEventListener("message",({source:s,data:l})=>{s===xl&&l===n&&r.length&&r.shift()()},!1),s=>{r.push(s),xl.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",ea(xl.postMessage)),jH=typeof queueMicrotask<"u"?queueMicrotask.bind(xl):typeof process<"u"&&process.nextTick||DA,_H=e=>e!=null&&ea(e[gg]),ce={isArray:ju,isArrayBuffer:TA,isBuffer:zf,isFormData:eH,isArrayBufferView:GV,isString:qV,isNumber:jA,isBoolean:ZV,isObject:Vf,isPlainObject:Zm,isEmptyObject:KV,isReadableStream:nH,isRequest:rH,isResponse:aH,isHeaders:sH,isUndefined:hu,isDate:YV,isFile:WV,isBlob:QV,isRegExp:yH,isFunction:ea,isStream:JV,isURLSearchParams:tH,isTypedArray:hH,isFileList:XV,forEach:Hf,merge:T0,extend:iH,trim:oH,stripBOM:lH,inherits:cH,toFlatObject:uH,kindOf:vg,kindOfTest:ys,endsWith:dH,toArray:fH,forEachEntry:mH,matchAll:pH,isHTMLForm:gH,hasOwnProperty:UR,hasOwnProp:UR,reduceDescriptors:AA,freezeMethods:xH,toObjectSet:bH,toCamelCase:vH,noop:SH,toFiniteNumber:CH,findKey:_A,global:xl,isContextDefined:NA,isSpecCompliantForm:wH,toJSONObject:EH,isAsyncFn:RH,isThenable:TH,setImmediate:DA,asap:jH,isIterable:_H};function ft(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)}ce.inherits(ft,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:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const OA=ft.prototype,MA={};["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=>{MA[e]={value:e}});Object.defineProperties(ft,MA);Object.defineProperty(OA,"isAxiosError",{value:!0});ft.from=(e,t,n,r,s,l)=>{const c=Object.create(OA);ce.toFlatObject(e,c,function(g){return g!==Error.prototype},m=>m!=="isAxiosError");const d=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return ft.call(c,d,f,n,r,s),e&&c.cause==null&&Object.defineProperty(c,"cause",{value:e,configurable:!0}),c.name=e&&e.name||"Error",l&&Object.assign(c,l),c};const NH=null;function j0(e){return ce.isPlainObject(e)||ce.isArray(e)}function kA(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function FR(e,t,n){return e?e.concat(t).map(function(s,l){return s=kA(s),!n&&l?"["+s+"]":s}).join(n?".":""):t}function AH(e){return ce.isArray(e)&&!e.some(j0)}const DH=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function xg(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(C,E){return!ce.isUndefined(E[C])});const r=n.metaTokens,s=n.visitor||g,l=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(s))throw new TypeError("visitor must be a function");function m(w){if(w===null)return"";if(ce.isDate(w))return w.toISOString();if(ce.isBoolean(w))return w.toString();if(!f&&ce.isBlob(w))throw new ft("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(w)||ce.isTypedArray(w)?f&&typeof Blob=="function"?new Blob([w]):Buffer.from(w):w}function g(w,C,E){let R=w;if(w&&!E&&typeof w=="object"){if(ce.endsWith(C,"{}"))C=r?C:C.slice(0,-2),w=JSON.stringify(w);else if(ce.isArray(w)&&AH(w)||(ce.isFileList(w)||ce.endsWith(C,"[]"))&&(R=ce.toArray(w)))return C=kA(C),R.forEach(function(_,O){!(ce.isUndefined(_)||_===null)&&t.append(c===!0?FR([C],O,l):c===null?C:C+"[]",m(_))}),!1}return j0(w)?!0:(t.append(FR(E,C,l),m(w)),!1)}const v=[],x=Object.assign(DH,{defaultVisitor:g,convertValue:m,isVisitable:j0});function b(w,C){if(!ce.isUndefined(w)){if(v.indexOf(w)!==-1)throw Error("Circular reference detected in "+C.join("."));v.push(w),ce.forEach(w,function(R,T){(!(ce.isUndefined(R)||R===null)&&s.call(t,R,ce.isString(T)?T.trim():T,C,x))===!0&&b(R,C?C.concat(T):[T])}),v.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function zR(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function l1(e,t){this._pairs=[],e&&xg(e,this,t)}const IA=l1.prototype;IA.append=function(t,n){this._pairs.push([t,n])};IA.toString=function(t){const n=t?function(r){return t.call(this,r,zR)}:zR;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function OH(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function LA(e,t,n){if(!t)return e;const r=n&&n.encode||OH;ce.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let l;if(s?l=s(t,n):l=ce.isURLSearchParams(t)?t.toString():new l1(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class VR{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){ce.forEach(this.handlers,function(r){r!==null&&t(r)})}}const PA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},MH=typeof URLSearchParams<"u"?URLSearchParams:l1,kH=typeof FormData<"u"?FormData:null,IH=typeof Blob<"u"?Blob:null,LH={isBrowser:!0,classes:{URLSearchParams:MH,FormData:kH,Blob:IH},protocols:["http","https","file","blob","url","data"]},c1=typeof window<"u"&&typeof document<"u",_0=typeof navigator=="object"&&navigator||void 0,PH=c1&&(!_0||["ReactNative","NativeScript","NS"].indexOf(_0.product)<0),UH=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",FH=c1&&window.location.href||"http://localhost",zH=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:c1,hasStandardBrowserEnv:PH,hasStandardBrowserWebWorkerEnv:UH,navigator:_0,origin:FH},Symbol.toStringTag,{value:"Module"})),Dr={...zH,...LH};function VH(e,t){return xg(e,new Dr.classes.URLSearchParams,{visitor:function(n,r,s,l){return Dr.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function HH(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function $H(e){const t={},n=Object.keys(e);let r;const s=n.length;let l;for(r=0;r<s;r++)l=n[r],t[l]=e[l];return t}function UA(e){function t(n,r,s,l){let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),f=l>=n.length;return c=!c&&ce.isArray(s)?s.length:c,f?(ce.hasOwnProp(s,c)?s[c]=[s[c],r]:s[c]=r,!d):((!s[c]||!ce.isObject(s[c]))&&(s[c]=[]),t(n,r,s[c],l)&&ce.isArray(s[c])&&(s[c]=$H(s[c])),!d)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,s)=>{t(HH(r),s,n,0)}),n}return null}function BH(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const $f={transitional:PA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,l=ce.isObject(t);if(l&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return s?JSON.stringify(UA(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let d;if(l){if(r.indexOf("application/x-www-form-urlencoded")>-1)return VH(t,this.formSerializer).toString();if((d=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return xg(d?{"files[]":t}:t,f&&new f,this.formSerializer)}}return l||s?(n.setContentType("application/json",!1),BH(t)):t}],transformResponse:[function(t){const n=this.transitional||$f.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||s)){const c=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?ft.from(d,ft.ERR_BAD_RESPONSE,this,null,this.response):d}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dr.classes.FormData,Blob:Dr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{$f.headers[e]={}});const GH=ce.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"]),qH=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
486
|
-
`).forEach(function(c){s=c.indexOf(":"),n=c.substring(0,s).trim().toLowerCase(),r=c.substring(s+1).trim(),!(!n||t[n]&&GH[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},HR=Symbol("internals");function Id(e){return e&&String(e).trim().toLowerCase()}function Km(e){return e===!1||e==null?e:ce.isArray(e)?e.map(Km):String(e)}function ZH(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const KH=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function jx(e,t,n,r,s){if(ce.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function YH(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function WH(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,l,c){return this[r].call(this,t,s,l,c)},configurable:!0})})}let ta=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function l(d,f,m){const g=Id(f);if(!g)throw new Error("header name must be a non-empty string");const v=ce.findKey(s,g);(!v||s[v]===void 0||m===!0||m===void 0&&s[v]!==!1)&&(s[v||f]=Km(d))}const c=(d,f)=>ce.forEach(d,(m,g)=>l(m,g,f));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!KH(t))c(qH(t),n);else if(ce.isObject(t)&&ce.isIterable(t)){let d={},f,m;for(const g of t){if(!ce.isArray(g))throw TypeError("Object iterator must return a key-value pair");d[m=g[0]]=(f=d[m])?ce.isArray(f)?[...f,g[1]]:[f,g[1]]:g[1]}c(d,n)}else t!=null&&l(n,t,r);return this}get(t,n){if(t=Id(t),t){const r=ce.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return ZH(s);if(ce.isFunction(n))return n.call(this,s,r);if(ce.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Id(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||jx(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function l(c){if(c=Id(c),c){const d=ce.findKey(r,c);d&&(!n||jx(r,r[d],d,n))&&(delete r[d],s=!0)}}return ce.isArray(t)?t.forEach(l):l(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const l=n[r];(!t||jx(this,this[l],l,t,!0))&&(delete this[l],s=!0)}return s}normalize(t){const n=this,r={};return ce.forEach(this,(s,l)=>{const c=ce.findKey(r,l);if(c){n[c]=Km(s),delete n[l];return}const d=t?YH(l):String(l).trim();d!==l&&delete n[l],n[d]=Km(s),r[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&ce.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(`
|
|
487
|
-
`)}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[HR]=this[HR]={accessors:{}}).accessors,s=this.prototype;function l(c){const d=Id(c);r[d]||(WH(s,c),r[d]=!0)}return ce.isArray(t)?t.forEach(l):l(t),this}};ta.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(ta.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(ta);function _x(e,t){const n=this||$f,r=t||n,s=ta.from(r.headers);let l=r.data;return ce.forEach(e,function(d){l=d.call(n,l,s.normalize(),t?t.status:void 0)}),s.normalize(),l}function FA(e){return!!(e&&e.__CANCEL__)}function _u(e,t,n){ft.call(this,e??"canceled",ft.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(_u,ft,{__CANCEL__:!0});function zA(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ft("Request failed with status code "+n.status,[ft.ERR_BAD_REQUEST,ft.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function QH(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function XH(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,l=0,c;return t=t!==void 0?t:1e3,function(f){const m=Date.now(),g=r[l];c||(c=m),n[s]=f,r[s]=m;let v=l,x=0;for(;v!==s;)x+=n[v++],v=v%e;if(s=(s+1)%e,s===l&&(l=(l+1)%e),m-c<t)return;const b=g&&m-g;return b?Math.round(x*1e3/b):void 0}}function JH(e,t){let n=0,r=1e3/t,s,l;const c=(m,g=Date.now())=>{n=g,s=null,l&&(clearTimeout(l),l=null),e(...m)};return[(...m)=>{const g=Date.now(),v=g-n;v>=r?c(m,g):(s=m,l||(l=setTimeout(()=>{l=null,c(s)},r-v)))},()=>s&&c(s)]}const mp=(e,t,n=3)=>{let r=0;const s=XH(50,250);return JH(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,f=c-r,m=s(f),g=c<=d;r=c;const v={loaded:c,total:d,progress:d?c/d:void 0,bytes:f,rate:m||void 0,estimated:m&&d&&g?(d-c)/m:void 0,event:l,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(v)},n)},$R=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},BR=e=>(...t)=>ce.asap(()=>e(...t)),e$=Dr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Dr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Dr.origin),Dr.navigator&&/(msie|trident)/i.test(Dr.navigator.userAgent)):()=>!0,t$=Dr.hasStandardBrowserEnv?{write(e,t,n,r,s,l,c){if(typeof document>"u")return;const d=[`${e}=${encodeURIComponent(t)}`];ce.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),ce.isString(r)&&d.push(`path=${r}`),ce.isString(s)&&d.push(`domain=${s}`),l===!0&&d.push("secure"),ce.isString(c)&&d.push(`SameSite=${c}`),document.cookie=d.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 n$(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function r$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function VA(e,t,n){let r=!n$(t);return e&&(r||n==!1)?r$(e,t):t}const GR=e=>e instanceof ta?{...e}:e;function Dl(e,t){t=t||{};const n={};function r(m,g,v,x){return ce.isPlainObject(m)&&ce.isPlainObject(g)?ce.merge.call({caseless:x},m,g):ce.isPlainObject(g)?ce.merge({},g):ce.isArray(g)?g.slice():g}function s(m,g,v,x){if(ce.isUndefined(g)){if(!ce.isUndefined(m))return r(void 0,m,v,x)}else return r(m,g,v,x)}function l(m,g){if(!ce.isUndefined(g))return r(void 0,g)}function c(m,g){if(ce.isUndefined(g)){if(!ce.isUndefined(m))return r(void 0,m)}else return r(void 0,g)}function d(m,g,v){if(v in t)return r(m,g);if(v in e)return r(void 0,m)}const f={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(m,g,v)=>s(GR(m),GR(g),v,!0)};return ce.forEach(Object.keys({...e,...t}),function(g){const v=f[g]||s,x=v(e[g],t[g],g);ce.isUndefined(x)&&v!==d||(n[g]=x)}),n}const HA=e=>{const t=Dl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:l,headers:c,auth:d}=t;if(t.headers=c=ta.from(c),t.url=LA(VA(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),ce.isFormData(n)){if(Dr.hasStandardBrowserEnv||Dr.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(ce.isFunction(n.getHeaders)){const f=n.getHeaders(),m=["content-type","content-length"];Object.entries(f).forEach(([g,v])=>{m.includes(g.toLowerCase())&&c.set(g,v)})}}if(Dr.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&e$(t.url))){const f=s&&l&&t$.read(l);f&&c.set(s,f)}return t},a$=typeof XMLHttpRequest<"u",s$=a$&&function(e){return new Promise(function(n,r){const s=HA(e);let l=s.data;const c=ta.from(s.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:m}=s,g,v,x,b,w;function C(){b&&b(),w&&w(),s.cancelToken&&s.cancelToken.unsubscribe(g),s.signal&&s.signal.removeEventListener("abort",g)}let E=new XMLHttpRequest;E.open(s.method.toUpperCase(),s.url,!0),E.timeout=s.timeout;function R(){if(!E)return;const _=ta.from("getAllResponseHeaders"in E&&E.getAllResponseHeaders()),A={data:!d||d==="text"||d==="json"?E.responseText:E.response,status:E.status,statusText:E.statusText,headers:_,config:e,request:E};zA(function(j){n(j),C()},function(j){r(j),C()},A),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 ft("Request aborted",ft.ECONNABORTED,e,E)),E=null)},E.onerror=function(O){const A=O&&O.message?O.message:"Network Error",D=new ft(A,ft.ERR_NETWORK,e,E);D.event=O||null,r(D),E=null},E.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const A=s.transitional||PA;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new ft(O,A.clarifyTimeoutError?ft.ETIMEDOUT:ft.ECONNABORTED,e,E)),E=null},l===void 0&&c.setContentType(null),"setRequestHeader"in E&&ce.forEach(c.toJSON(),function(O,A){E.setRequestHeader(A,O)}),ce.isUndefined(s.withCredentials)||(E.withCredentials=!!s.withCredentials),d&&d!=="json"&&(E.responseType=s.responseType),m&&([x,w]=mp(m,!0),E.addEventListener("progress",x)),f&&E.upload&&([v,b]=mp(f),E.upload.addEventListener("progress",v),E.upload.addEventListener("loadend",b)),(s.cancelToken||s.signal)&&(g=_=>{E&&(r(!_||_.type?new _u(null,e,E):_),E.abort(),E=null)},s.cancelToken&&s.cancelToken.subscribe(g),s.signal&&(s.signal.aborted?g():s.signal.addEventListener("abort",g)));const T=QH(s.url);if(T&&Dr.protocols.indexOf(T)===-1){r(new ft("Unsupported protocol "+T+":",ft.ERR_BAD_REQUEST,e));return}E.send(l||null)})},o$=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const l=function(m){if(!s){s=!0,d();const g=m instanceof Error?m:this.reason;r.abort(g instanceof ft?g:new _u(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,l(new ft(`timeout ${t} of ms exceeded`,ft.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(m=>{m.unsubscribe?m.unsubscribe(l):m.removeEventListener("abort",l)}),e=null)};e.forEach(m=>m.addEventListener("abort",l));const{signal:f}=r;return f.unsubscribe=()=>ce.asap(d),f}},i$=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},l$=async function*(e,t){for await(const n of c$(e))yield*i$(n,t)},c$=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()}},qR=(e,t,n,r)=>{const s=l$(e,t);let l=0,c,d=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:m,value:g}=await s.next();if(m){d(),f.close();return}let v=g.byteLength;if(n){let x=l+=v;n(x)}f.enqueue(new Uint8Array(g))}catch(m){throw d(m),m}},cancel(f){return d(f),s.return()}},{highWaterMark:2})},ZR=64*1024,{isFunction:Rm}=ce,u$=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:KR,TextEncoder:YR}=ce.global,WR=(e,...t)=>{try{return!!e(...t)}catch{return!1}},d$=e=>{e=ce.merge.call({skipUndefined:!0},u$,e);const{fetch:t,Request:n,Response:r}=e,s=t?Rm(t):typeof fetch=="function",l=Rm(n),c=Rm(r);if(!s)return!1;const d=s&&Rm(KR),f=s&&(typeof YR=="function"?(w=>C=>w.encode(C))(new YR):async w=>new Uint8Array(await new n(w).arrayBuffer())),m=l&&d&&WR(()=>{let w=!1;const C=new n(Dr.origin,{body:new KR,method:"POST",get duplex(){return w=!0,"half"}}).headers.has("Content-Type");return w&&!C}),g=c&&d&&WR(()=>ce.isReadableStream(new r("").body)),v={stream:g&&(w=>w.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(w=>{!v[w]&&(v[w]=(C,E)=>{let R=C&&C[w];if(R)return R.call(C);throw new ft(`Response type '${w}' is not supported`,ft.ERR_NOT_SUPPORT,E)})});const x=async w=>{if(w==null)return 0;if(ce.isBlob(w))return w.size;if(ce.isSpecCompliantForm(w))return(await new n(Dr.origin,{method:"POST",body:w}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(w)||ce.isArrayBuffer(w))return w.byteLength;if(ce.isURLSearchParams(w)&&(w=w+""),ce.isString(w))return(await f(w)).byteLength},b=async(w,C)=>{const E=ce.toFiniteNumber(w.getContentLength());return E??x(C)};return async w=>{let{url:C,method:E,data:R,signal:T,cancelToken:_,timeout:O,onDownloadProgress:A,onUploadProgress:D,responseType:j,headers:M,withCredentials:z="same-origin",fetchOptions:Z}=HA(w),K=t||fetch;j=j?(j+"").toLowerCase():"text";let Y=o$([T,_&&_.toAbortSignal()],O),ae=null;const F=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let V;try{if(D&&m&&E!=="get"&&E!=="head"&&(V=await b(M,R))!==0){let L=new n(C,{method:"POST",body:R,duplex:"half"}),P;if(ce.isFormData(R)&&(P=L.headers.get("content-type"))&&M.setContentType(P),L.body){const[W,ee]=$R(V,mp(BR(D)));R=qR(L.body,ZR,W,ee)}}ce.isString(z)||(z=z?"include":"omit");const I=l&&"credentials"in n.prototype,B={...Z,signal:Y,method:E.toUpperCase(),headers:M.normalize().toJSON(),body:R,duplex:"half",credentials:I?z:void 0};ae=l&&new n(C,B);let G=await(l?K(ae,Z):K(C,B));const ie=g&&(j==="stream"||j==="response");if(g&&(A||ie&&F)){const L={};["status","statusText","headers"].forEach(de=>{L[de]=G[de]});const P=ce.toFiniteNumber(G.headers.get("content-length")),[W,ee]=A&&$R(P,mp(BR(A),!0))||[];G=new r(qR(G.body,ZR,W,()=>{ee&&ee(),F&&F()}),L)}j=j||"text";let xe=await v[ce.findKey(v,j)||"text"](G,w);return!ie&&F&&F(),await new Promise((L,P)=>{zA(L,P,{data:xe,headers:ta.from(G.headers),status:G.status,statusText:G.statusText,config:w,request:ae})})}catch(I){throw F&&F(),I&&I.name==="TypeError"&&/Load failed|fetch/i.test(I.message)?Object.assign(new ft("Network Error",ft.ERR_NETWORK,w,ae),{cause:I.cause||I}):ft.from(I,I&&I.code,w,ae)}}},f$=new Map,$A=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,l=[r,s,n];let c=l.length,d=c,f,m,g=f$;for(;d--;)f=l[d],m=g.get(f),m===void 0&&g.set(f,m=d?new Map:d$(t)),g=m;return m};$A();const u1={http:NH,xhr:s$,fetch:{get:$A}};ce.forEach(u1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const QR=e=>`- ${e}`,h$=e=>ce.isFunction(e)||e===null||e===!1;function m$(e,t){e=ce.isArray(e)?e:[e];const{length:n}=e;let r,s;const l={};for(let c=0;c<n;c++){r=e[c];let d;if(s=r,!h$(r)&&(s=u1[(d=String(r)).toLowerCase()],s===void 0))throw new ft(`Unknown adapter '${d}'`);if(s&&(ce.isFunction(s)||(s=s.get(t))))break;l[d||"#"+c]=s}if(!s){const c=Object.entries(l).map(([f,m])=>`adapter ${f} `+(m===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
|
|
488
|
-
`+c.map(QR).join(`
|
|
489
|
-
`):" "+QR(c[0]):"as no adapter specified";throw new ft("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return s}const BA={getAdapter:m$,adapters:u1};function Nx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _u(null,e)}function XR(e){return Nx(e),e.headers=ta.from(e.headers),e.data=_x.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),BA.getAdapter(e.adapter||$f.adapter,e)(e).then(function(r){return Nx(e),r.data=_x.call(e,e.transformResponse,r),r.headers=ta.from(r.headers),r},function(r){return FA(r)||(Nx(e),r&&r.response&&(r.response.data=_x.call(e,e.transformResponse,r.response),r.response.headers=ta.from(r.response.headers))),Promise.reject(r)})}const GA="1.13.1",bg={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bg[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const JR={};bg.transitional=function(t,n,r){function s(l,c){return"[Axios v"+GA+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,d)=>{if(t===!1)throw new ft(s(c," has been removed"+(n?" in "+n:"")),ft.ERR_DEPRECATED);return n&&!JR[c]&&(JR[c]=!0,console.warn(s(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,d):!0}};bg.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function p$(e,t,n){if(typeof e!="object")throw new ft("options must be an object",ft.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const l=r[s],c=t[l];if(c){const d=e[l],f=d===void 0||c(d,l,e);if(f!==!0)throw new ft("option "+l+" must be "+f,ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ft("Unknown option "+l,ft.ERR_BAD_OPTION)}}const Ym={assertOptions:p$,validators:bg},_s=Ym.validators;let Sl=class{constructor(t){this.defaults=t||{},this.interceptors={request:new VR,response:new VR}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const l=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?l&&!String(r.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
490
|
-
`+l):r.stack=l}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Dl(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:l}=n;r!==void 0&&Ym.assertOptions(r,{silentJSONParsing:_s.transitional(_s.boolean),forcedJSONParsing:_s.transitional(_s.boolean),clarifyTimeoutError:_s.transitional(_s.boolean)},!1),s!=null&&(ce.isFunction(s)?n.paramsSerializer={serialize:s}:Ym.assertOptions(s,{encode:_s.function,serialize:_s.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Ym.assertOptions(n,{baseUrl:_s.spelling("baseURL"),withXsrfToken:_s.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=l&&ce.merge(l.common,l[n.method]);l&&ce.forEach(["delete","get","head","post","put","patch","common"],w=>{delete l[w]}),n.headers=ta.concat(c,l);const d=[];let f=!0;this.interceptors.request.forEach(function(C){typeof C.runWhen=="function"&&C.runWhen(n)===!1||(f=f&&C.synchronous,d.unshift(C.fulfilled,C.rejected))});const m=[];this.interceptors.response.forEach(function(C){m.push(C.fulfilled,C.rejected)});let g,v=0,x;if(!f){const w=[XR.bind(this),void 0];for(w.unshift(...d),w.push(...m),x=w.length,g=Promise.resolve(n);v<x;)g=g.then(w[v++],w[v++]);return g}x=d.length;let b=n;for(;v<x;){const w=d[v++],C=d[v++];try{b=w(b)}catch(E){C.call(this,E);break}}try{g=XR.call(this,b)}catch(w){return Promise.reject(w)}for(v=0,x=m.length;v<x;)g=g.then(m[v++],m[v++]);return g}getUri(t){t=Dl(this.defaults,t);const n=VA(t.baseURL,t.url,t.allowAbsoluteUrls);return LA(n,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){Sl.prototype[t]=function(n,r){return this.request(Dl(r||{},{method:t,url:n,data:(r||{}).data}))}});ce.forEach(["post","put","patch"],function(t){function n(r){return function(l,c,d){return this.request(Dl(d||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}Sl.prototype[t]=n(),Sl.prototype[t+"Form"]=n(!0)});let g$=class qA{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(l){n=l});const r=this;this.promise.then(s=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](s);r._listeners=null}),this.promise.then=s=>{let l;const c=new Promise(d=>{r.subscribe(d),l=d}).then(s);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,d){r.reason||(r.reason=new _u(l,c,d),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new qA(function(s){t=s}),cancel:t}}};function v$(e){return function(n){return e.apply(null,n)}}function y$(e){return ce.isObject(e)&&e.isAxiosError===!0}const N0={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(N0).forEach(([e,t])=>{N0[t]=e});function ZA(e){const t=new Sl(e),n=EA(Sl.prototype.request,t);return ce.extend(n,Sl.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return ZA(Dl(e,s))},n}const On=ZA($f);On.Axios=Sl;On.CanceledError=_u;On.CancelToken=g$;On.isCancel=FA;On.VERSION=GA;On.toFormData=xg;On.AxiosError=ft;On.Cancel=On.CanceledError;On.all=function(t){return Promise.all(t)};On.spread=v$;On.isAxiosError=y$;On.mergeConfig=Dl;On.AxiosHeaders=ta;On.formToJSON=e=>UA(ce.isHTMLForm(e)?new FormData(e):e);On.getAdapter=BA.getAdapter;On.HttpStatusCode=N0;On.default=On;const{Axios:Poe,AxiosError:eT,CanceledError:Uoe,isCancel:Foe,CancelToken:zoe,VERSION:Voe,all:Hoe,Cancel:$oe,isAxiosError:Boe,spread:Goe,toFormData:qoe,AxiosHeaders:x$,HttpStatusCode:Zoe,formToJSON:Koe,getAdapter:Yoe,mergeConfig:Woe}=On;function b$(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const mu={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 S$(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 d1=On.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function C$(){const e=window.location.pathname+window.location.search,t=new URL(mu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function w$(){const e=new URL(mu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",mu.SIGN_IN),window.location.href=e.toString()}async function E$(){try{return(await d1.post(mu.ACCESS_TOKEN,{})).data}catch(e){const t=S$(e);throw new Error(t.message)}}async function R$(e){const t=await d1.get(mu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return b$(t.data)}async function T$(e){return(await d1.get(mu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const KA=p.createContext(null);class j${constructor(t,n){js(this,"getToken");js(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let f1=null;function _$(e){f1=e}function h1(){return f1}function Tm(){f1=null}const N$=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Ue=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",YA(e)},A$=e=>{Ue({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},D$=()=>{Ue({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},YA=e=>{var t;if(typeof window<"u"){N$();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function O$(e,t){switch(t.type){case"SET_LOADING":return{...e,status:Or.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:Or.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:Or.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:Or.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const M$={status:Or.LOADING,session:null,user:null};function k$({children:e}){var g;const[t,n]=p.useReducer(O$,M$);p.useEffect(()=>{var v;if((v=t.session)!=null&&v.accessToken){const x=new j$(()=>{var b;return((b=t.session)==null?void 0:b.accessToken)??null},async()=>await s());_$(x)}else Tm()},[(g=t.session)==null?void 0:g.accessToken]);const r=p.useCallback(()=>{C$()},[]);async function s(){try{const x=(await E$()).accessToken;if(!x)throw new Error("Invalid token received");const b={accessToken:x},w=await R$(x);return n({type:"SET_USER",payload:{user:w}}),n({type:"SET_AUTHENTICATED",payload:{session:b}}),x}catch(v){throw Tm(),n({type:"SET_UNAUTHENTICATED"}),v}}const l=p.useCallback(async()=>{await s()},[]),c=p.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await l()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(v){console.error("Failed to initialize auth:",v),Tm(),n({type:"SET_UNAUTHENTICATED"})}},[l,r]),d=p.useCallback(()=>{try{D$()}finally{w$()}},[]),f=p.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t.user&&(YA({projectId:t.user.projectId}),A$({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),p.useEffect(()=>{const v=()=>{d()};return window.addEventListener("auth:logout",v),()=>{window.removeEventListener("auth:logout",v),Tm()}},[d]);const m={...t,signIn:r,signOut:d,refreshToken:l,clearError:f};return o.jsx(KA.Provider,{value:m,children:e})}function Vi(){const e=p.useContext(KA);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function WA(){const{status:e,session:t,user:n,error:r}=Vi();return{status:e,session:t,user:n,error:r,isLoading:e===Or.LOADING,isAuthenticated:e===Or.AUTHENTICATED,isUnauthenticated:e===Or.UNAUTHENTICATED,hasError:e===Or.ERROR}}function I$(){const{user:e}=Vi();return e}function nu({fullScreen:e=!1,size:t="md",message:n}){const r={sm:"h-4 w-4 border-2",md:"h-8 w-8 border-4",lg:"h-12 w-12 border-4"},s=e?"flex h-screen items-center justify-center":"flex items-center justify-center p-4";return o.jsx("div",{className:s,children:o.jsxs("div",{className:"text-center",children:[o.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&o.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function tT({message:e}){return o.jsx(nu,{fullScreen:!0,message:e})}function nT(){return o.jsx("div",{className:"flex h-screen items-center justify-center",children:o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),o.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),o.jsx(be,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function L$({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:s,isUnauthenticated:l}=WA();return r?o.jsx(tT,{}):s?o.jsx(o.Fragment,{children:e}):l?n?(window.location.href=n,o.jsx(tT,{})):t?o.jsx(o.Fragment,{children:t}):o.jsx(nT,{}):t?o.jsx(o.Fragment,{children:t}):o.jsx(nT,{})}const QA=p.createContext(null);function XA(){const e=p.useContext(QA);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const P$="/ui",U$=()=>P$,pp=(e,t)=>{const n=U$(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function F$(){const{projects:e,loadProjects:t,error:n,isLoading:r}=XA(),{user:s}=Vi();return o.jsxs(r1,{children:[o.jsx(qa,{}),o.jsxs(a1,{className:"flex items-center gap-2",children:[o.jsx(t9,{className:"h-4 w-4"}),"Switch project"]}),o.jsx(FV,{children:o.jsxs(s1,{children:[r&&o.jsx(yt,{disabled:!0,children:o.jsxs("span",{className:"flex items-center gap-2",children:[o.jsx(Tf,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&o.jsxs(o.Fragment,{children:[o.jsx(yt,{disabled:!0,children:"Unable to load projects. Please try again."}),o.jsx(yt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(l=>{const c=l.id===(s==null?void 0:s.projectId);return o.jsx(yt,{asChild:!0,children:o.jsxs(wf,{to:pp(encodeURIComponent(l.id),"/"),className:"flex items-center gap-2",children:[c?o.jsx(fr,{className:"h-4 w-4"}):o.jsx("span",{className:"h-4 w-4"}),l.title]})},l.id)})]})})]})}function z$(){return o.jsx(F$,{})}const V$=({className:e,size:t=24})=>o.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:o.jsx("path",{fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),JA=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M10.6842 44.2221L0.419465 26.278C-0.139822 25.3001 -0.139822 23.6999 0.419465 22.722L10.6842 4.77786C11.2435 3.79993 12.6166 3 13.7355 3H34.265C35.3838 3 36.7567 3.79993 37.3163 4.77786L47.5801 22.722C48.14 23.6999 48.14 25.3001 47.5801 26.278L37.3163 44.2221C36.7567 45.2001 35.3838 46 34.265 46H13.7355C12.6166 46 11.2435 45.2001 10.6842 44.2221Z",fill:"#4486FA"}),o.jsx("path",{d:"M30.6154 18.3848L43.6923 32.8463L37.3828 43.85C36.8268 44.8118 35.4628 45.5986 34.3511 45.5986L17.5385 30.0771L30.6154 18.3848Z",fill:"#3778ED"}),o.jsx("path",{d:"M24.1539 33.1537C28.997 33.1537 32.9231 29.2276 32.9231 24.3845C32.9231 19.5414 28.997 15.6152 24.1539 15.6152C19.3108 15.6152 15.3846 19.5414 15.3846 24.3845C15.3846 29.2276 19.3108 33.1537 24.1539 33.1537Z",fill:"white"}),o.jsx("path",{d:"M31.2681 29.2331L34.3825 32.3476C34.7428 32.7079 34.7428 33.2925 34.3825 33.6528L33.7296 34.3057C33.3693 34.666 32.7847 34.666 32.4244 34.3057L29.3099 31.1913C28.9496 30.831 28.9496 30.2464 29.3099 29.886L29.9628 29.2331C30.3231 28.8728 30.9077 28.8728 31.2681 29.2331Z",fill:"white"}),o.jsx("path",{d:"M24.1538 31.0003C27.8074 31.0003 30.7692 28.0385 30.7692 24.3849C30.7692 20.7313 27.8074 17.7695 24.1538 17.7695C20.5003 17.7695 17.5385 20.7313 17.5385 24.3849C17.5385 28.0385 20.5003 31.0003 24.1538 31.0003Z",fill:"#4486FA"}),o.jsx("path",{d:"M24.1538 29.4615C26.9577 29.4615 29.2308 27.1884 29.2308 24.3845C29.2308 21.5806 26.9577 19.3076 24.1538 19.3076C21.3499 19.3076 19.0769 21.5806 19.0769 24.3845C19.0769 27.1884 21.3499 29.4615 24.1538 29.4615Z",fill:"#4486FA"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3846 21.4619H25.2308V29.4619H23.3846V21.4619ZM26.4615 24.8465H28.3077V28.5388H26.4615V24.8465ZM21.8462 23.6158H20V28.5388H21.8462V23.6158Z",fill:"white"})]}),e4=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),o.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),o.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),o.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),o.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),o.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),o.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),o.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),o.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),o.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),o.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),o.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),o.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),o.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),o.jsx("path",{d:"M24 1.134L27.7974 2.3466V29.6562L24 30.4332V1.134ZM36.8118 9.6L31.179 8.4588V29.0142L36.8118 27.873V9.6ZM43.2144 3.06L39.1344 1.4196V27.381L43.2144 26.5248V3.06ZM48 1.5618L44.901 0V26.1684L48 25.5978V1.5618Z",fill:"#F58534"})]}),t4=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0C19.7661 0 12 0 10 0C8.19719 0 6 2.18498 6 4V44C6 45.815 8.18947 47.9993 10 47.9993H38C39.8105 47.9993 42 45.815 42 44C42 44 42 25.6447 42 14L28 0Z",fill:"#00A65F"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),o.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),H$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M23.7876 0C22.2395 0 20.8149 0.856389 20.0821 2.22332C19.3574 3.59024 19.4398 5.25361 20.3044 6.5382L22.0995 4.75131C22.0419 4.57015 22.009 4.38899 22.009 4.1996C22.009 3.21969 22.7995 2.42918 23.7794 2.42918C24.7593 2.42918 25.5498 3.21969 25.5498 4.1996C25.5498 5.1795 24.7593 5.97002 23.7794 5.97002C23.59 5.97002 23.4088 5.93708 23.2277 5.87944L21.4325 7.66632C22.923 8.67917 24.891 8.62153 26.3238 7.53457C27.7566 6.44762 28.3331 4.56192 27.7566 2.85737C27.1885 1.1446 25.5827 0 23.7876 0Z",fill:"#34A853"}),o.jsx("path",{d:"M22.1161 12.2282C22.1161 10.8118 21.6632 9.42842 20.8068 8.30029L18.4846 10.6224C19.2093 11.9564 18.954 13.6033 17.8506 14.6491L19.1187 17.737C20.9797 16.5266 22.1161 14.4515 22.1161 12.2282Z",fill:"#FBBC04"}),o.jsx("path",{d:"M15.6108 15.5637H15.5531C14.1286 15.5637 12.8604 14.6579 12.3993 13.3075C11.9382 11.957 12.3828 10.4666 13.511 9.58547C14.6391 8.70438 16.1954 8.64674 17.3894 9.43725L19.6951 7.13159C17.4553 5.31176 14.2932 5.17177 11.897 6.78574C9.50076 8.3997 8.44675 11.3806 9.28667 14.1392C10.1266 16.8977 12.671 18.7834 15.5531 18.7834C15.9978 18.7834 16.4425 18.7422 16.8789 18.6517L15.6108 15.5637Z",fill:"#EA4335"}),o.jsx("path",{d:"M23.87 18.231C22.4125 18.231 20.9632 18.4451 19.5716 18.8568L21.4161 23.3611C22.2148 23.1634 23.0383 23.0646 23.87 23.0646C28.6625 23.0646 32.7797 26.449 33.7184 31.1509C34.6489 35.8528 32.1374 40.5547 27.7155 42.3828C23.2936 44.2108 18.1882 42.6627 15.5284 38.6855C12.8687 34.7082 13.3792 29.3969 16.7636 26.0043C17.4718 25.2962 18.2787 24.7033 19.1598 24.2339L17.34 19.7461C10.5465 23.0728 7.32686 30.9697 9.86308 38.1008C12.3993 45.2319 19.8762 49.3244 27.2461 47.6117C34.616 45.9071 39.532 38.9407 38.6756 31.4226C37.8192 23.9045 31.454 18.231 23.8864 18.231H23.87Z",fill:"#4285F4"})]}),$$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M6.10815 8C6.10815 6.89543 7.00358 6 8.10815 6H40.1082C41.2127 6 42.1082 6.89543 42.1082 8V40C42.1082 41.1046 41.2127 42 40.1082 42H8.10816C7.00359 42 6.10815 41.1046 6.10815 40V8Z",fill:"#FF9800"}),o.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),o.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),o.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),o.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),o.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),o.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),o.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),o.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),o.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),o.jsx("path",{d:"M13 35C13 32.7909 14.7909 31 17 31C19.2091 31 21 32.7909 21 35C21 37.2091 19.2091 39 17 39C14.7909 39 13 37.2091 13 35Z",fill:"white"})]}),B$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M41.1492 36.5821L31.017 30.7288C29.5935 29.9092 27.7733 30.3966 26.9494 31.8201C26.6302 32.3808 26.5051 32.9976 26.5655 33.5972V45.0365C26.5655 46.6712 27.894 47.9998 29.5331 47.9998C31.1679 47.9998 32.4965 46.6712 32.4965 45.0365V38.4585L38.173 41.7367C39.5964 42.5605 41.421 42.0688 42.2405 40.6454C43.0644 39.2219 42.577 37.4017 41.1492 36.5821Z",fill:"#29B5E8"}),o.jsx("path",{d:"M15.949 24.039C15.9663 22.9822 15.4099 21.9987 14.4954 21.4682L4.36313 15.6192C3.92316 15.3647 3.41849 15.231 2.91381 15.231C1.87427 15.231 0.908061 15.7874 0.390448 16.6846C-0.411852 18.0735 0.0669408 19.855 1.45587 20.6573L7.29627 24.0261L1.45587 27.3992C0.782972 27.7874 0.299866 28.4128 0.101448 29.1634C-0.101284 29.9139 0.00223886 30.699 0.390448 31.3719C0.908061 32.2691 1.87427 32.8255 2.9095 32.8255C3.41849 32.8255 3.92316 32.6918 4.36313 32.4373L14.4954 26.5883C15.4012 26.062 15.9577 25.0872 15.949 24.039Z",fill:"#29B5E8"}),o.jsx("path",{d:"M6.6628 11.4738L16.7951 17.3228C17.977 18.0086 19.4349 17.7843 20.3666 16.8742C20.9576 16.3307 21.3242 15.5543 21.3242 14.6916V2.96765C21.3242 1.32854 19.9957 0 18.3609 0C16.7217 0 15.3932 1.32854 15.3932 2.96765V9.64054L9.63907 6.31919C8.21564 5.49532 6.39536 5.98274 5.5715 7.40618C4.74763 8.82962 5.23936 10.6499 6.6628 11.4738Z",fill:"#29B5E8"}),o.jsx("path",{d:"M29.4459 24.5131C29.4459 24.7374 29.3165 25.048 29.1569 25.2119L25.1411 29.2277C24.9815 29.3873 24.6666 29.5167 24.4423 29.5167H23.42C23.1957 29.5167 22.8808 29.3873 22.7212 29.2277L18.7011 25.2119C18.5415 25.048 18.4121 24.7374 18.4121 24.5131V23.4908C18.4121 23.2622 18.5415 22.9516 18.7011 22.792L22.7212 18.7719C22.8808 18.6123 23.1957 18.4829 23.42 18.4829H24.4423C24.6666 18.4829 24.9815 18.6123 25.1411 18.7719L29.1569 22.792C29.3165 22.9516 29.4459 23.2622 29.4459 23.4908V24.5131ZM25.8614 24.0214V23.9782C25.8614 23.8143 25.7665 23.5857 25.6501 23.4649L24.4639 22.2831C24.3474 22.1623 24.1188 22.0674 23.9506 22.0674H23.9074C23.7435 22.0674 23.5149 22.1623 23.3941 22.2831L22.2123 23.4649C22.0958 23.5814 22.0009 23.81 22.0009 23.9782V24.0214C22.0009 24.1896 22.0958 24.4182 22.2123 24.5347L23.3941 25.7209C23.5149 25.8373 23.7435 25.9322 23.9074 25.9322H23.9506C24.1188 25.9322 24.3474 25.8373 24.4639 25.7209L25.6501 24.5347C25.7665 24.4182 25.8614 24.1896 25.8614 24.0214Z",fill:"#29B5E8"}),o.jsx("path",{d:"M31.0158 17.3228L41.1481 11.4738C42.5715 10.6542 43.0632 8.82962 42.2394 7.40618C41.4155 5.98274 39.5952 5.49532 38.1718 6.31919L32.4953 9.59741V2.96765C32.4953 1.32854 31.1667 0 29.532 0C27.8928 0 26.5643 1.32854 26.5643 2.96765V14.4587C26.5082 15.0539 26.6247 15.675 26.9482 16.2358C27.7721 17.6592 29.5923 18.1467 31.0158 17.3228Z",fill:"#29B5E8"}),o.jsx("path",{d:"M18.8267 30.3841C18.1538 30.2546 17.4335 30.3625 16.7951 30.7291L6.6628 36.5825C5.23936 37.402 4.74763 39.2223 5.5715 40.6457C6.39536 42.0735 8.21564 42.5609 9.63907 41.737L15.3932 38.4157V45.0368C15.3932 46.6716 16.7217 48.0002 18.3609 48.0002C19.9957 48.0002 21.3242 46.6716 21.3242 45.0368V33.3129C21.3242 31.8334 20.2415 30.6083 18.8267 30.3841Z",fill:"#29B5E8"}),o.jsx("path",{d:"M47.4814 16.6501C46.6618 15.2223 44.8372 14.7349 43.4138 15.5588L33.2815 21.4078C32.311 21.9685 31.7761 22.9951 31.7934 24.039C31.7847 25.0785 32.3196 26.0922 33.2815 26.6443L43.4138 32.4977C44.8372 33.3172 46.6575 32.8298 47.4814 31.4064C48.3052 29.9829 47.8135 28.1626 46.3901 27.3388L40.6532 24.0261L46.3901 20.7133C47.8178 19.8938 48.3052 18.0735 47.4814 16.6501Z",fill:"#29B5E8"})]}),G$=({className:e,size:t=24})=>o.jsx("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:o.jsx("path",{d:"M45.8905 35.0619V26.9571L45.0149 26.4095L24 37.9095L4.0796 26.9571V22.2476L24 33.0905L46 21.1524V13.1571L45.1244 12.6095L24 24.219L4.84577 13.7048L24 3.19048L39.4328 11.6238L40.6368 10.9667V10.0905L24 1L2 12.9381V14.1429L24 26.1905L43.9204 15.2381V20.0571L24 31.0095L2.87562 19.4L2 19.9476V28.0524L24 39.9905L43.9204 29.1476V33.8571L24 44.8095L2.87562 33.3095L2 33.8571V35.0619L24 47L45.8905 35.0619Z",fill:"#FF3621"})}),q$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),o.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),o.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),o.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),o.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),o.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),o.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),Z$=({className:e,size:t=24})=>o.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[o.jsx("path",{d:"M23.9333 0L3 11.9733V35.8933L23.9333 48L44.8667 36.0267V12.0267L23.9333 0ZM41 33.52L23.9333 43.3867L6.86667 33.624V14.3467L23.9333 4.48L41 14.3733V33.52Z",fill:"#0078D4"}),o.jsx("path",{d:"M23.9333 0L3 11.9733L6.86667 14.3467L23.9333 4.48L41 14.3467L44.8667 11.9733L23.9333 0Z",fill:"url(#paint0_linear_19_1262)"}),o.jsx("path",{d:"M33.9068 27.9336C33.7031 27.5984 33.4028 27.3325 33.0454 27.1709C31.9608 24.8031 30.2991 22.7454 28.2128 21.1865C26.1265 19.6276 23.6822 18.6173 21.1041 18.2482L38.3761 8.26689L34.3601 5.96289L14.6908 17.3336C14.3087 17.5535 14.0099 17.8936 13.8411 18.3009C13.6722 18.7082 13.6426 19.1598 13.757 19.5857C13.8714 20.0115 14.1232 20.3876 14.4734 20.6554C14.8236 20.9233 15.2525 21.068 15.6934 21.0669C15.7747 21.0519 15.8549 21.0314 15.9334 21.0056L16.2668 22.4002C18.7745 21.8089 21.4081 22.0755 23.7464 23.1574C26.0848 24.2393 27.9928 26.074 29.1654 28.3682L9.56812 39.6936L13.5681 42.0029L33.1761 30.6669C33.4376 30.5106 33.6586 30.295 33.8214 30.0376L34.0214 29.9896C34.0028 29.9122 33.9734 29.8429 33.9548 29.7656C34.0967 29.4794 34.1665 29.1629 34.1581 28.8436C34.1497 28.5243 34.0634 28.2119 33.9068 27.9336Z",fill:"#50E6FF"}),o.jsx("path",{d:"M32.176 24.0347C31.2003 24.0347 30.2465 24.3241 29.4352 24.8662C28.6239 25.4082 27.9916 26.1787 27.6182 27.0802C27.2448 27.9816 27.1471 28.9735 27.3375 29.9305C27.5278 30.8875 27.9977 31.7665 28.6876 32.4565C29.3775 33.1464 30.2566 33.6163 31.2135 33.8066C32.1705 33.997 33.1625 33.8993 34.0639 33.5259C34.9653 33.1525 35.7358 32.5202 36.2779 31.7089C36.82 30.8976 37.1093 29.9438 37.1093 28.9681C37.1093 27.6597 36.5896 26.4049 35.6644 25.4797C34.7392 24.5545 33.4844 24.0347 32.176 24.0347ZM15.6907 14.0454C14.7149 14.0454 13.7611 14.3347 12.9498 14.8768C12.1386 15.4189 11.5062 16.1894 11.1329 17.0908C10.7595 17.9923 10.6618 18.9842 10.8521 19.9412C11.0425 20.8982 11.5123 21.7772 12.2023 22.4671C12.8922 23.1571 13.7712 23.6269 14.7282 23.8173C15.6852 24.0076 16.6771 23.9099 17.5786 23.5365C18.48 23.1632 19.2505 22.5308 19.7926 21.7196C20.3347 20.9083 20.624 19.9545 20.624 18.9787C20.624 17.6703 20.1042 16.4155 19.1791 15.4904C18.2539 14.5652 16.9991 14.0454 15.6907 14.0454Z",fill:"url(#paint1_linear_19_1262)"}),o.jsxs("defs",{children:[o.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),o.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),o.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[o.jsx("stop",{"stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),o.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),o.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),Nu=({className:e="",size:t=24,base64:n})=>o.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),K$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("path",{fill:"currentColor",d:"M12.455 21.73c-4.585 0-7.749-.347-7.964-.371-.164-.013-1.55-.141-2.44-1.037-.9-.907-1.26-2.518-1.274-2.586-.01-.044-.29-1.267-.432-3.389a61.23 61.23 0 0 1-.078-2.403c0-3.559.49-5.744.511-5.835.016-.068.377-1.522 1.273-2.423.873-.88 2.11-1.02 2.296-1.036.244-.036 2.712-.38 7.444-.38 1.422 0 3.843.082 3.867.083 2.365.106 3.696.274 3.86.296.186.014 1.554.149 2.437 1.037.895.9 1.255 2.355 1.27 2.417.018.069.508 1.963.508 5.743 0 .89-.065 2.337-.068 2.399-.131 2.248-.405 3.447-.416 3.497-.043.174-.422 1.66-1.123 2.383-1.035 1.066-2.154 1.212-2.356 1.23-.248.039-2.558.375-7.315.375Zm-.664-18.502c-4.815 0-7.295.367-7.32.371a.446.446 0 0 1-.038.004c-.009 0-1.04.086-1.711.76-.705.709-1.016 1.955-1.02 1.967-.003.015-.485 2.174-.485 5.614 0 .836.076 2.331.077 2.347.135 2.028.407 3.222.41 3.234.004.02.317 1.413 1.018 2.12.67.673 1.831.758 1.843.759l.024.002c.031.004 3.198.366 7.866.366 4.848 0 7.161-.362 7.184-.365a.484.484 0 0 1 .05-.005c.033-.003.91-.074 1.757-.947.441-.455.784-1.552.879-1.937 0-.004.265-1.173.391-3.323 0-.01.067-1.48.067-2.349 0-3.636-.475-5.488-.48-5.507-.005-.021-.316-1.267-1.02-1.976-.67-.674-1.832-.759-1.844-.76a.391.391 0 0 1-.033-.003c-.013-.002-1.362-.182-3.785-.29-.02 0-2.424-.082-3.83-.082Z"}),o.jsx("path",{fill:"currentColor",d:"M5.415 17.057V6.247h7.074c2.212 0 3.318.925 3.318 2.776 0 .74-.142 1.316-.425 1.732a1.476 1.476 0 0 1-.768.609c.201.052.398.155.59.311.585.477.878 1.213.878 2.209 0 1.162-.284 1.99-.85 2.489-.521.456-1.353.684-2.496.684H5.415Zm.987-9.722v3.531h6.482c.686 0 1.171-.114 1.456-.344.32-.26.48-.718.48-1.374 0-.615-.142-1.063-.425-1.344-.312-.313-.815-.469-1.511-.469H6.402Zm0 4.62v4.013h6.718c.658 0 1.152-.165 1.481-.498.33-.331.493-.86.493-1.586 0-.684-.173-1.177-.52-1.478-.348-.3-.86-.45-1.536-.45l-6.636-.001ZM19.282 17.057h-1.067V6.247h1.067v10.81Z"}),o.jsx("path",{fill:"currentColor",d:"M23.467 11.846c0-3.756-.488-5.627-.5-5.673l-.001-.006a6.188 6.188 0 0 0-.292-.852c-.197-.47-.494-1.022-.906-1.438-.4-.401-.917-.64-1.37-.779a4.392 4.392 0 0 0-.9-.18h-.015c-.156-.021-1.48-.19-3.837-.295-.114-.004-2.465-.082-3.855-.082-4.717 0-7.172.342-7.406.376l-.008.002H4.37c-.176.015-1.328.15-2.131.958-.414.416-.711.97-.909 1.44a6.178 6.178 0 0 0-.292.855c-.025.105-.505 2.264-.505 5.771 0 .84.073 2.278.078 2.386l.059.747c.105 1.173.243 1.982.316 2.358l.05.24.002.004c.006.028.096.432.292.937.199.512.497 1.1.909 1.515.402.405.925.644 1.38.783.453.137.82.17.891.176h.01l.685.069c1.19.107 3.82.301 7.25.301 4.744 0 7.041-.335 7.275-.371l.008-.001h.009c.167-.015 1.215-.149 2.188-1.152.312-.321.567-.832.752-1.307a8.15 8.15 0 0 0 .303-.951c.019-.085.282-1.266.409-3.448.005-.107.068-1.514.068-2.383Zm-.95 0c0-3.598-.469-5.426-.471-5.436l-.001-.005s-.02-.077-.059-.202a5.943 5.943 0 0 0-.177-.49c-.14-.341-.34-.73-.599-1.034l-.114-.124c-.289-.29-.697-.464-1.053-.564a3.79 3.79 0 0 0-.577-.114l-.048-.004a.677.677 0 0 1-.05-.005l-.062-.009-.186-.021a33.921 33.921 0 0 0-.727-.074 60.204 60.204 0 0 0-2.78-.185c-.022 0-2.421-.08-3.822-.08-2.401 0-4.218.091-5.437.183a37.894 37.894 0 0 0-1.725.169l-.087.011-.03.005h-.003a.744.744 0 0 1-.06.005h.001c.007 0-.23.02-.547.117-.32.099-.701.271-.994.566-.316.317-.553.769-.714 1.158-.145.35-.221.63-.234.678 0 0-.478 2.138-.478 5.552 0 .828.077 2.317.077 2.334.134 1.992.399 3.168.404 3.189a6.681 6.681 0 0 0 .235.763c.163.43.4.911.71 1.223.289.29.696.464 1.052.564.35.098.621.119.621.119h.002l.037.003H4.63c.007.002.017.002.03.004l.112.013a62.06 62.06 0 0 0 2.03.167c1.373.09 3.326.18 5.653.18 4.78 0 7.082-.353 7.142-.362l.077-.009c.067-.006.833-.094 1.581-.865.182-.188.363-.533.514-.908.147-.366.252-.724.297-.905.012-.054.263-1.201.384-3.274.004-.086.067-1.495.067-2.333ZM15.54 9.024c0-.869-.257-1.477-.733-1.875-.485-.406-1.243-.632-2.318-.633H5.68v10.27h7.055c1.118 0 1.872-.224 2.321-.618.483-.424.758-1.16.758-2.285 0-.94-.275-1.586-.778-1.997a1.303 1.303 0 0 0-.49-.26l-.881-.229.864-.29a1.21 1.21 0 0 0 .632-.503v-.002c.242-.354.379-.87.379-1.578Zm4.007-3.048v11.351h-1.6V5.976h1.6Zm-1.067 10.81h.534V6.517h-.534v10.27Zm-3.653-2.902c0-.643-.163-1.043-.427-1.272l-.114-.086c-.28-.19-.687-.3-1.248-.3l-6.37-.001v3.473h6.45c.618 0 1.032-.155 1.293-.419.258-.26.416-.703.416-1.395Zm-.275-4.737c0-.579-.134-.941-.345-1.15v-.001c-.24-.24-.659-.391-1.324-.391H6.67v2.99h6.215c.673 0 1.08-.115 1.29-.284.227-.185.38-.543.38-1.164Zm.808 4.737c0 .76-.17 1.374-.571 1.778-.397.4-.971.577-1.67.577H6.135v-4.555l6.904.001c.71 0 1.293.157 1.708.516.43.373.614.959.614 1.683Zm7.689-2.038c0 .44-.017 1.029-.033 1.506l-.024.605-.008.182-.002.05v.022c-.127 2.161-.393 3.345-.399 3.37v.003c-.05.203-.164.586-.322.979-.154.383-.366.814-.625 1.082-.907.935-1.856 1.02-1.929 1.026h-.005a.241.241 0 0 0-.023.003c-.053.008-2.382.368-7.225.368-3.51 0-6.175-.204-7.305-.308l-.593-.059v-.001h-.011a4.034 4.034 0 0 1-.727-.137c-.395-.111-.903-.317-1.285-.701-.39-.394-.662-.963-.832-1.412a6.672 6.672 0 0 1-.258-.84l-.004-.017-.01-.046a17.864 17.864 0 0 1-.145-.816 28.269 28.269 0 0 1-.257-2.396v-.011l-.002-.013-.002-.052-.008-.185c-.008-.156-.018-.371-.027-.612-.02-.48-.039-1.069-.039-1.493 0-3.459.485-5.638.493-5.674v-.006l.003-.005.003-.014.012-.046.048-.162c.043-.135.107-.323.194-.533.172-.414.442-.94.831-1.331.378-.38.849-.588 1.214-.7.365-.113.645-.137.668-.139h.002l.015-.002c.089-.013 2.58-.373 7.358-.373.706 0 1.662.02 2.441.04.39.01.737.02.988.028l.297.01c.035 0 .063.002.082.003h.033c1.216.055 2.164.128 2.81.187l1 .106.008.001h.01l.018.003.045.004a4.322 4.322 0 0 1 .663.13c.394.111.903.317 1.286.702.388.39.657.918.829 1.333.165.399.249.717.26.764l.08.374c.14.717.409 2.458.409 5.203Zm.95 0c0 .897-.066 2.35-.069 2.41v.004c-.132 2.26-.407 3.475-.423 3.543v.005c-.023.093-.132.52-.326 1.018-.19.492-.477 1.086-.866 1.488-1.073 1.106-2.236 1.281-2.507 1.308-.265.04-2.589.378-7.354.378-4.598 0-7.772-.348-7.994-.373a4.92 4.92 0 0 1-.994-.196c-.439-.134-.964-.36-1.416-.743l-.189-.174c-.488-.492-.82-1.162-1.029-1.7a7.404 7.404 0 0 1-.316-1.019c-.023-.1-.298-1.332-.438-3.43v-.003C.075 14.289 0 12.81 0 11.943c0-3.578.493-5.782.519-5.895v-.003c.01-.044.11-.439.32-.941.21-.5.54-1.125 1.024-1.61l.18-.169c.925-.8 2.096-.929 2.281-.945C4.65 2.333 7.127 2 11.791 2c.714 0 1.678.02 2.464.041a215.63 215.63 0 0 1 1.297.038l.082.002.023.001h.013c2.311.104 3.641.268 3.867.297.104.008.516.048 1.016.202.498.153 1.107.426 1.59.913l.174.188c.389.451.664.984.848 1.42.202.482.3.865.316.93.025.092.519 2.01.519 5.814Zm-8.914-2.699c0 .69-.167 1.25-.58 1.586v.001c-.359.289-.922.402-1.622.402H6.135v-4.07l6.75-.002c.725 0 1.312.162 1.696.546l.124.142c.268.348.381.827.381 1.395Zm.988-.123c0 .77-.147 1.407-.472 1.884a1.905 1.905 0 0 1-.396.435l.165.12v.002c.666.543.977 1.369.977 2.418 0 1.199-.292 2.123-.942 2.694-.592.519-1.502.75-2.67.75H5.148V5.976h7.342c1.135 0 2.037.236 2.658.756.63.528.926 1.31.926 2.292Z"})]}),Y$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),o.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),o.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),o.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),W$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M21 9.99795V7.99795C20.9996 7.64722 20.9071 7.30276 20.7315 6.99911C20.556 6.69546 20.3037 6.44331 20 6.26795L13 2.26795C12.696 2.09241 12.3511 2 12 2C11.6489 2 11.304 2.09241 11 2.26795L4 6.26795C3.69626 6.44331 3.44398 6.69546 3.26846 6.99911C3.09294 7.30276 3.00036 7.64722 3 7.99795V15.9979C3.00036 16.3487 3.09294 16.6931 3.26846 16.9968C3.44398 17.3004 3.69626 17.5526 4 17.7279L11 21.7279C11.304 21.9035 11.6489 21.9959 12 21.9959C12.3511 21.9959 12.696 21.9035 13 21.7279L15 20.5879",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),o.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),Q$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M24 12C24 5.37308 18.6269 0 12 0C5.37308 0 0 5.37308 0 12C0 17.989 4.38757 22.9537 10.1252 23.8549V15.4696H7.07749V12H10.1252V9.35565C10.1252 6.34847 11.9173 4.68626 14.6579 4.68626C15.9707 4.68626 17.3444 4.92083 17.3444 4.92083V7.874H15.8307C14.3406 7.874 13.8748 8.79876 13.8748 9.74884V12H17.2026L16.6711 15.4696H13.8748V23.8549C19.6124 22.9554 24 17.9907 24 12Z",fill:"#1977F3"}),o.jsx("path",{d:"M16.6717 15.4708L17.2033 12.0012H13.8755V9.75008C13.8755 8.80169 14.3396 7.87524 15.8313 7.87524H17.345V4.92207C17.345 4.92207 15.9714 4.6875 14.6585 4.6875C11.918 4.6875 10.1258 6.34803 10.1258 9.35689V12.0012H7.07812V15.4708H10.1258V23.8561C10.7367 23.9523 11.3628 24.0012 12.0006 24.0012C12.6385 24.0012 13.2646 23.9506 13.8755 23.8561V15.4708H16.6717Z",fill:"#FEFEFE"})]}),X$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),o.jsx("path",{d:"M20.4491 20.4496H16.8931V14.8805C16.8931 13.5525 16.8694 11.8429 15.0436 11.8429C13.1915 11.8429 12.9081 13.2899 12.9081 14.7838V20.4492H9.35203V8.99689H12.7658V10.562H12.8136C13.1553 9.97782 13.649 9.49726 14.2421 9.17149C14.8352 8.84572 15.5056 8.68693 16.1819 8.71203C19.7861 8.71203 20.4506 11.0828 20.4506 14.167L20.4491 20.4496ZM5.33963 7.43144C4.93148 7.43151 4.53247 7.31055 4.19307 7.08385C3.85367 6.85715 3.58913 6.53489 3.43287 6.15783C3.27661 5.78077 3.23566 5.36584 3.31521 4.96551C3.39477 4.56517 3.59125 4.19743 3.8798 3.90876C4.16835 3.6201 4.53602 3.42348 4.93631 3.34378C5.3366 3.26408 5.75152 3.30488 6.12863 3.46101C6.50573 3.61713 6.82807 3.88158 7.05489 4.22091C7.2817 4.56025 7.40281 4.95922 7.40288 5.36738C7.40293 5.63839 7.34959 5.90675 7.24593 6.15715C7.14227 6.40754 6.99032 6.63507 6.79873 6.82674C6.60714 7.0184 6.37966 7.17045 6.1293 7.27421C5.87895 7.37796 5.61062 7.43139 5.33963 7.43144ZM7.11765 20.4496H3.5579V8.99689H7.11765V20.4496ZM22.222 0.00163516H1.77099C1.30681 -0.00360329 0.859518 0.175663 0.52744 0.500042C0.195362 0.824421 0.00566506 1.26737 0 1.73156V22.2681C0.00547117 22.7325 0.195057 23.1758 0.527123 23.5005C0.85919 23.8252 1.30658 24.0048 1.77099 23.9999H22.222C22.6873 24.0057 23.1359 23.8266 23.4693 23.5019C23.8027 23.1772 23.9936 22.7334 24 22.2681V1.73008C23.9934 1.26497 23.8024 0.821515 23.469 0.497144C23.1356 0.172773 22.6871 -0.00598143 22.222 0.000152822",fill:"#0A66C2"})]}),J$=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M2.4 0H21.6C22.9256 0 24 1.07443 24 2.4V21.6C24 22.9256 22.9256 24 21.6 24H2.4C1.07443 24 0 22.9256 0 21.6V2.4C0 1.07443 1.07443 0 2.4 0Z",fill:"#010101"}),o.jsx("path",{d:"M16.0971 9.46492C17.3375 10.3511 18.8571 10.8725 20.4981 10.8725V7.71605C20.1875 7.71617 19.8778 7.68377 19.5739 7.61937V10.104C17.9329 10.104 16.4136 9.58256 15.1729 8.69639V15.1378C15.1729 18.3601 12.5594 20.9721 9.33558 20.9721C8.13276 20.9721 7.01472 20.6087 6.08594 19.9853C7.14596 21.0686 8.62418 21.7407 10.2596 21.7407C13.4836 21.7407 16.0972 19.1286 16.0972 15.9062V9.46492H16.0971ZM17.2373 6.28044C16.6034 5.5883 16.1872 4.69375 16.0971 3.70479V3.29883H15.2213C15.4417 4.55571 16.1937 5.62956 17.2373 6.28044ZM8.12494 17.5127C7.77082 17.0486 7.5794 16.4808 7.58026 15.897C7.58026 14.4232 8.77571 13.2283 10.2505 13.2283C10.5254 13.2281 10.7986 13.2703 11.0605 13.3533V10.1263C10.7544 10.0844 10.4455 10.0666 10.1366 10.0732V12.5849C9.87454 12.5019 9.60122 12.4597 9.32629 12.4599C7.85147 12.4599 6.65612 13.6548 6.65612 15.1287C6.65612 16.1708 7.25362 17.0732 8.12494 17.5127Z",fill:"#EE1D52"}),o.jsx("path",{d:"M15.1726 8.69639C16.4133 9.58256 17.9326 10.104 19.5736 10.104V7.61937C18.6576 7.42444 17.8467 6.94594 17.237 6.28044C16.1934 5.62956 15.4414 4.55571 15.221 3.29883H12.9204V15.9061C12.9152 17.3758 11.7218 18.5658 10.2501 18.5658C9.38288 18.5658 8.61243 18.1527 8.12452 17.5127C7.2532 17.0732 6.6557 16.1708 6.6557 15.1287C6.6557 13.6548 7.85104 12.4599 9.32587 12.4599C9.60841 12.4599 9.88075 12.5039 10.1362 12.5849V10.0732C6.96907 10.1386 4.42188 12.7251 4.42188 15.9062C4.42188 17.4941 5.05621 18.9337 6.08563 19.9854C7.01441 20.6088 8.13245 20.9722 9.33528 20.9722C12.5591 20.9722 15.1726 18.3601 15.1726 15.1379V8.69639Z",fill:"white"}),o.jsx("path",{d:"M19.5758 7.6202V6.94836C18.7498 6.9496 17.9401 6.71839 17.2392 6.28116C17.8596 6.96001 18.6765 7.42815 19.5758 7.6202ZM15.2232 3.29966C15.2022 3.17955 15.186 3.05864 15.1748 2.93721V2.53125H11.9983V15.1386C11.9932 16.6082 10.7999 17.7982 9.32812 17.7982C8.89598 17.7982 8.48809 17.6958 8.12678 17.5135C8.61468 18.1535 9.38513 18.5666 10.2524 18.5666C11.7239 18.5666 12.9174 17.3766 12.9226 15.9069V3.29966H15.2232ZM10.1386 10.074V9.35876C9.87315 9.32247 9.60555 9.30433 9.33764 9.30447C6.1135 9.30447 3.5 11.9166 3.5 15.1386C3.5 17.1587 4.52715 18.9389 6.088 19.9862C5.05858 18.9344 4.42424 17.4948 4.42424 15.9069C4.42424 12.7259 6.97133 10.1394 10.1386 10.074Z",fill:"#69C9D0"})]}),eB=({className:e,size:t=24})=>o.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[o.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),o.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),o.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),o.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]});function Hi({className:e,...t}){return o.jsx("textarea",{"data-slot":"textarea",className:J("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}function tB({value:e,onChange:t,keysToMask:n=[],className:r,displayOnly:s=!1,showCopyButton:l=!1}){const c=(C,E)=>{if(!C||E.length===0)return!1;try{const R=JSON.parse(C),T=_=>typeof _!="object"||_===null?!1:Array.isArray(_)?_.some(O=>typeof O=="object"&&O!==null&&T(O)):Object.keys(_).some(O=>E.includes(O)||typeof _[O]=="object"&&_[O]!==null&&T(_[O]));return T(R)}catch{return!1}},d=s?!1:!e||n.length===0||!c(e,n),[f,m]=p.useState(d),[g,v]=p.useState(!1);p.useEffect(()=>{s?m(!1):(!e||n.length===0||!c(e,n))&&m(!0)},[e,n,s]),p.useEffect(()=>{if(g){const C=setTimeout(()=>{v(!1)},2e3);return()=>{clearTimeout(C)}}},[g]);const x=()=>{navigator.clipboard.writeText(e),v(!0)},b=C=>{if(!C)return"";try{const E=JSON.parse(C),R=O=>{if(typeof O!="object"||O===null)return O;const A=Array.isArray(O)?[...O]:{...O};return Array.isArray(A)?A.forEach((D,j)=>{typeof D=="object"&&D!==null&&(A[j]=R(D))}):Object.entries(A).forEach(([D,j])=>{if(n.includes(D))if(typeof j=="string"){const M=j.length;M>30?A[D]="*".repeat(Math.min(20,Math.ceil(M/3))):M>10?A[D]="*".repeat(Math.min(10,Math.ceil(M/2))):A[D]="*".repeat(M)}else A[D]="***";else typeof j=="object"&&j!==null&&(A[D]=R(j))}),A},_=R(typeof E=="object"?E:{});return JSON.stringify(_,null,2)}catch{return C}},w=e&&n.length>0&&c(e,n);return o.jsxs("div",{className:"relative",children:[!f&&w&&!s&&o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"absolute top-2 left-2 z-10",children:o.jsx(oL,{className:"h-4 w-4 text-gray-500"})})}),o.jsx(wt,{children:o.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),s?o.jsx("div",{className:`p-2 font-mono ${r??""} min-h-[150px] cursor-not-allowed whitespace-pre-wrap opacity-70`,children:b(e)}):o.jsx(Hi,{value:f?e:b(e),onChange:C=>{(f||!w)&&t&&t(C.target.value)},onFocus:C=>{!f&&w&&C.target.blur()},readOnly:!!(!f&&w),className:`font-mono ${r??""} ${!f&&w?"cursor-not-allowed opacity-70":""} min-h-[150px]`,rows:8}),w&&!s&&o.jsx(be,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{m(!f)},children:f?o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(V9,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),o.jsx(wt,{children:o.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(o_,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),o.jsx(wt,{children:o.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),l&&o.jsx(be,{type:"button",variant:"ghost",className:`absolute ${w&&!s?"top-2 right-24":"top-2 right-2"}`,onClick:x,children:o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"flex items-center gap-1",children:g?o.jsxs(o.Fragment,{children:[o.jsx(fr,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copied!"})]}):o.jsxs(o.Fragment,{children:[o.jsx(of,{className:"h-4 w-4"}),o.jsx("span",{className:"text-xs",children:"Copy"})]})})}),o.jsx(wt,{children:o.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var Lt;(function(e){e.assertEqual=s=>{};function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const l={};for(const c of s)l[c]=c;return l},e.getValidEnumValues=s=>{const l=e.objectKeys(s).filter(d=>typeof s[s[d]]!="number"),c={};for(const d of l)c[d]=s[d];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(l){return s[l]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const l=[];for(const c in s)Object.prototype.hasOwnProperty.call(s,c)&&l.push(c);return l},e.find=(s,l)=>{for(const c of s)if(l(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function r(s,l=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(s,l)=>typeof l=="bigint"?l.toString():l})(Lt||(Lt={}));var rT;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(rT||(rT={}));const Ve=Lt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mi=e=>{switch(typeof e){case"undefined":return Ve.undefined;case"string":return Ve.string;case"number":return Number.isNaN(e)?Ve.nan:Ve.number;case"boolean":return Ve.boolean;case"function":return Ve.function;case"bigint":return Ve.bigint;case"symbol":return Ve.symbol;case"object":return Array.isArray(e)?Ve.array:e===null?Ve.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ve.promise:typeof Map<"u"&&e instanceof Map?Ve.map:typeof Set<"u"&&e instanceof Set?Ve.set:typeof Date<"u"&&e instanceof Date?Ve.date:Ve.object;default:return Ve.unknown}},Se=Lt.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 ko extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}format(t){const n=t||function(l){return l.message},r={_errors:[]},s=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)r._errors.push(n(c));else{let d=r,f=0;for(;f<c.path.length;){const m=c.path[f];f===c.path.length-1?(d[m]=d[m]||{_errors:[]},d[m]._errors.push(n(c))):d[m]=d[m]||{_errors:[]},d=d[m],f++}}};return s(this),r}static assert(t){if(!(t instanceof ko))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Lt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)if(s.path.length>0){const l=s.path[0];n[l]=n[l]||[],n[l].push(t(s))}else r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}ko.create=e=>new ko(e);const A0=(e,t)=>{let n;switch(e.code){case Se.invalid_type:e.received===Ve.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Lt.jsonStringifyReplacer)}`;break;case Se.unrecognized_keys:n=`Unrecognized key(s) in object: ${Lt.joinValues(e.keys,", ")}`;break;case Se.invalid_union:n="Invalid input";break;case Se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Lt.joinValues(e.options)}`;break;case Se.invalid_enum_value:n=`Invalid enum value. Expected ${Lt.joinValues(e.options)}, received '${e.received}'`;break;case Se.invalid_arguments:n="Invalid function arguments";break;case Se.invalid_return_type:n="Invalid function return type";break;case Se.invalid_date:n="Invalid date";break;case Se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Lt.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Se.custom:n="Invalid input";break;case Se.invalid_intersection_types:n="Intersection results could not be merged";break;case Se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Se.not_finite:n="Number must be finite";break;default:n=t.defaultError,Lt.assertNever(e)}return{message:n}};let nB=A0;function rB(){return nB}const aB=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,l=[...n,...s.path||[]],c={...s,path:l};if(s.message!==void 0)return{...s,path:l,message:s.message};let d="";const f=r.filter(m=>!!m).slice().reverse();for(const m of f)d=m(c,{data:t,defaultError:d}).message;return{...s,path:l,message:d}};function De(e,t){const n=rB(),r=aB({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===A0?void 0:A0].filter(s=>!!s)});e.common.issues.push(r)}class Vr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return it;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const l=await s.key,c=await s.value;r.push({key:l,value:c})}return Vr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:l,value:c}=s;if(l.status==="aborted"||c.status==="aborted")return it;l.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||s.alwaysSet)&&(r[l.value]=c.value)}return{status:t.value,value:r}}}const it=Object.freeze({status:"aborted"}),qd=e=>({status:"dirty",value:e}),Wa=e=>({status:"valid",value:e}),aT=e=>e.status==="aborted",sT=e=>e.status==="dirty",pu=e=>e.status==="valid",gp=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 zs{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const oT=(e,t)=>{if(pu(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 ko(e.common.issues);return this._error=n,this._error}}};function mt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(c,d)=>{const{message:f}=e;return c.code==="invalid_enum_value"?{message:f??d.defaultError}:typeof d.data>"u"?{message:f??r??d.defaultError}:c.code!=="invalid_type"?{message:d.defaultError}:{message:f??n??d.defaultError}},description:s}}class Tt{get description(){return this._def.description}_getType(t){return mi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:mi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Vr,ctx:{common:t.parent.common,data:t.data,parsedType:mi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(gp(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:mi(t)},s=this._parseSync({data:t,path:r.path,parent:r});return oT(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:mi(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return pu(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(s=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>pu(l)?{value:l.value}:{issues:n.common.issues})}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:mi(t)},s=this._parse({data:t,path:r.path,parent:r}),l=await(gp(s)?s:Promise.resolve(s));return oT(r,l)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,l)=>{const c=t(s),d=()=>l.addIssue({code:Se.custom,...r(s)});return typeof Promise<"u"&&c instanceof Promise?c.then(f=>f?!0:(d(),!1)):c?!0:(d(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new kl({schema:this,typeName:lt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return To.create(this,this._def)}nullable(){return Il.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ls.create(this)}promise(){return Ep.create(this,this._def)}or(t){return xp.create([this,t],this._def)}and(t){return bp.create(this,t,this._def)}transform(t){return new kl({...mt(this._def),schema:this,typeName:lt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Rp({...mt(this._def),innerType:this,defaultValue:n,typeName:lt.ZodDefault})}brand(){return new s4({typeName:lt.ZodBranded,type:this,...mt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Tp({...mt(this._def),innerType:this,catchValue:n,typeName:lt.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return p1.create(this,t)}readonly(){return jp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const sB=/^c[^\s-]{8,}$/i,oB=/^[0-9a-z]+$/,iB=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lB=/^[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,cB=/^[a-z0-9_-]{21}$/i,uB=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dB=/^[-+]?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)?)??$/,fB=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hB="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ax;const mB=/^(?:(?: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])$/,pB=/^(?:(?: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])$/,gB=/^(([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]))$/,vB=/^(([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])$/,yB=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xB=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,n4="((\\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])))",bB=new RegExp(`^${n4}$`);function r4(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 SB(e){return new RegExp(`^${r4(e)}$`)}function CB(e){let t=`${n4}T${r4(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 wB(e,t){return!!((t==="v4"||!t)&&mB.test(e)||(t==="v6"||!t)&&gB.test(e))}function EB(e,t){if(!uB.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 RB(e,t){return!!((t==="v4"||!t)&&pB.test(e)||(t==="v6"||!t)&&vB.test(e))}class Eo extends Tt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ve.string){const l=this._getOrReturnCtx(t);return De(l,{code:Se.invalid_type,expected:Ve.string,received:l.parsedType}),it}const r=new Vr;let s;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(s=this._getOrReturnCtx(t,s),De(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="max")t.data.length>l.value&&(s=this._getOrReturnCtx(t,s),De(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!1,message:l.message}),r.dirty());else if(l.kind==="length"){const c=t.data.length>l.value,d=t.data.length<l.value;(c||d)&&(s=this._getOrReturnCtx(t,s),c?De(s,{code:Se.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&De(s,{code:Se.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")fB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"email",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Ax||(Ax=new RegExp(hB,"u")),Ax.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"emoji",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")lB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"uuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")cB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"nanoid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")sB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"cuid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")oB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"cuid2",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")iB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"ulid",code:Se.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),De(s,{validation:"url",code:Se.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"regex",code:Se.invalid_string,message:l.message}),r.dirty())):l.kind==="trim"?t.data=t.data.trim():l.kind==="includes"?t.data.includes(l.value,l.position)||(s=this._getOrReturnCtx(t,s),De(s,{code:Se.invalid_string,validation:{includes:l.value,position:l.position},message:l.message}),r.dirty()):l.kind==="toLowerCase"?t.data=t.data.toLowerCase():l.kind==="toUpperCase"?t.data=t.data.toUpperCase():l.kind==="startsWith"?t.data.startsWith(l.value)||(s=this._getOrReturnCtx(t,s),De(s,{code:Se.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(s=this._getOrReturnCtx(t,s),De(s,{code:Se.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?CB(l).test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{code:Se.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?bB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{code:Se.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?SB(l).test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{code:Se.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?dB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"duration",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?wB(t.data,l.version)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"ip",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?EB(t.data,l.alg)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"jwt",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?RB(t.data,l.version)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"cidr",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?yB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"base64",code:Se.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?xB.test(t.data)||(s=this._getOrReturnCtx(t,s),De(s,{validation:"base64url",code:Se.invalid_string,message:l.message}),r.dirty()):Lt.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:Se.invalid_string,...Je.errToObj(r)})}_addCheck(t){return new Eo({...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 Eo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Eo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Eo({...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}}Eo.create=e=>new Eo({checks:[],typeName:lt.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...mt(e)});function TB(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,l=Number.parseInt(e.toFixed(s).replace(".","")),c=Number.parseInt(t.toFixed(s).replace(".",""));return l%c/10**s}class gu extends Tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ve.number){const l=this._getOrReturnCtx(t);return De(l,{code:Se.invalid_type,expected:Ve.number,received:l.parsedType}),it}let r;const s=new Vr;for(const l of this._def.checks)l.kind==="int"?Lt.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Se.invalid_type,expected:"integer",received:"float",message:l.message}),s.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Se.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Se.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),s.dirty()):l.kind==="multipleOf"?TB(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),De(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),De(r,{code:Se.not_finite,message:l.message}),s.dirty()):Lt.assertNever(l);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 gu({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(s)}]})}_addCheck(t){return new gu({...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"&&Lt.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)}}gu.create=e=>new gu({checks:[],typeName:lt.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...mt(e)});class mf extends Tt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ve.bigint)return this._getInvalidInput(t);let r;const s=new Vr;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Se.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Se.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),s.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),De(r,{code:Se.not_multiple_of,multipleOf:l.value,message:l.message}),s.dirty()):Lt.assertNever(l);return{status:s.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return De(n,{code:Se.invalid_type,expected:Ve.bigint,received:n.parsedType}),it}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 mf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(s)}]})}_addCheck(t){return new mf({...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}}mf.create=e=>new mf({checks:[],typeName:lt.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...mt(e)});class D0 extends Tt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ve.boolean){const r=this._getOrReturnCtx(t);return De(r,{code:Se.invalid_type,expected:Ve.boolean,received:r.parsedType}),it}return Wa(t.data)}}D0.create=e=>new D0({typeName:lt.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...mt(e)});class vp extends Tt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ve.date){const l=this._getOrReturnCtx(t);return De(l,{code:Se.invalid_type,expected:Ve.date,received:l.parsedType}),it}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return De(l,{code:Se.invalid_date}),it}const r=new Vr;let s;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(s=this._getOrReturnCtx(t,s),De(s,{code:Se.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(s=this._getOrReturnCtx(t,s),De(s,{code:Se.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):Lt.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new vp({...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}}vp.create=e=>new vp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:lt.ZodDate,...mt(e)});class iT extends Tt{_parse(t){if(this._getType(t)!==Ve.symbol){const r=this._getOrReturnCtx(t);return De(r,{code:Se.invalid_type,expected:Ve.symbol,received:r.parsedType}),it}return Wa(t.data)}}iT.create=e=>new iT({typeName:lt.ZodSymbol,...mt(e)});class O0 extends Tt{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Se.invalid_type,expected:Ve.undefined,received:r.parsedType}),it}return Wa(t.data)}}O0.create=e=>new O0({typeName:lt.ZodUndefined,...mt(e)});class yp extends Tt{_parse(t){if(this._getType(t)!==Ve.null){const r=this._getOrReturnCtx(t);return De(r,{code:Se.invalid_type,expected:Ve.null,received:r.parsedType}),it}return Wa(t.data)}}yp.create=e=>new yp({typeName:lt.ZodNull,...mt(e)});class lT extends Tt{constructor(){super(...arguments),this._any=!0}_parse(t){return Wa(t.data)}}lT.create=e=>new lT({typeName:lt.ZodAny,...mt(e)});class M0 extends Tt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Wa(t.data)}}M0.create=e=>new M0({typeName:lt.ZodUnknown,...mt(e)});class Di extends Tt{_parse(t){const n=this._getOrReturnCtx(t);return De(n,{code:Se.invalid_type,expected:Ve.never,received:n.parsedType}),it}}Di.create=e=>new Di({typeName:lt.ZodNever,...mt(e)});class cT extends Tt{_parse(t){if(this._getType(t)!==Ve.undefined){const r=this._getOrReturnCtx(t);return De(r,{code:Se.invalid_type,expected:Ve.void,received:r.parsedType}),it}return Wa(t.data)}}cT.create=e=>new cT({typeName:lt.ZodVoid,...mt(e)});class Ls extends Tt{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==Ve.array)return De(n,{code:Se.invalid_type,expected:Ve.array,received:n.parsedType}),it;if(s.exactLength!==null){const c=n.data.length>s.exactLength.value,d=n.data.length<s.exactLength.value;(c||d)&&(De(n,{code:c?Se.too_big:Se.too_small,minimum:d?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(De(n,{code:Se.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(De(n,{code:Se.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>s.type._parseAsync(new zs(n,c,n.path,d)))).then(c=>Vr.mergeArray(r,c));const l=[...n.data].map((c,d)=>s.type._parseSync(new zs(n,c,n.path,d)));return Vr.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new Ls({...this._def,minLength:{value:t,message:Je.toString(n)}})}max(t,n){return new Ls({...this._def,maxLength:{value:t,message:Je.toString(n)}})}length(t,n){return new Ls({...this._def,exactLength:{value:t,message:Je.toString(n)}})}nonempty(t){return this.min(1,t)}}Ls.create=(e,t)=>new Ls({type:e,minLength:null,maxLength:null,exactLength:null,typeName:lt.ZodArray,...mt(t)});function $c(e){if(e instanceof qn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=To.create($c(r))}return new qn({...e._def,shape:()=>t})}else return e instanceof Ls?new Ls({...e._def,type:$c(e.element)}):e instanceof To?To.create($c(e.unwrap())):e instanceof Il?Il.create($c(e.unwrap())):e instanceof Ol?Ol.create(e.items.map(t=>$c(t))):e}class qn extends Tt{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=Lt.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==Ve.object){const m=this._getOrReturnCtx(t);return De(m,{code:Se.invalid_type,expected:Ve.object,received:m.parsedType}),it}const{status:r,ctx:s}=this._processInputParams(t),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof Di&&this._def.unknownKeys==="strip"))for(const m in s.data)c.includes(m)||d.push(m);const f=[];for(const m of c){const g=l[m],v=s.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new zs(s,v,s.path,m)),alwaysSet:m in s.data})}if(this._def.catchall instanceof Di){const m=this._def.unknownKeys;if(m==="passthrough")for(const g of d)f.push({key:{status:"valid",value:g},value:{status:"valid",value:s.data[g]}});else if(m==="strict")d.length>0&&(De(s,{code:Se.unrecognized_keys,keys:d}),r.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const m=this._def.catchall;for(const g of d){const v=s.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new zs(s,v,s.path,g)),alwaysSet:g in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const m=[];for(const g of f){const v=await g.key,x=await g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m}).then(m=>Vr.mergeObjectSync(r,m)):Vr.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Je.errToObj,new qn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,c;const s=((c=(l=this._def).errorMap)==null?void 0:c.call(l,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:Je.errToObj(t).message??s}:{message:s}}}:{}})}strip(){return new qn({...this._def,unknownKeys:"strip"})}passthrough(){return new qn({...this._def,unknownKeys:"passthrough"})}extend(t){return new qn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new qn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:lt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new qn({...this._def,catchall:t})}pick(t){const n={};for(const r of Lt.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new qn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Lt.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new qn({...this._def,shape:()=>n})}deepPartial(){return $c(this)}partial(t){const n={};for(const r of Lt.objectKeys(this.shape)){const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}return new qn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Lt.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof To;)l=l._def.innerType;n[r]=l}return new qn({...this._def,shape:()=>n})}keyof(){return a4(Lt.objectKeys(this.shape))}}qn.create=(e,t)=>new qn({shape:()=>e,unknownKeys:"strip",catchall:Di.create(),typeName:lt.ZodObject,...mt(t)});qn.strictCreate=(e,t)=>new qn({shape:()=>e,unknownKeys:"strict",catchall:Di.create(),typeName:lt.ZodObject,...mt(t)});qn.lazycreate=(e,t)=>new qn({shape:e,unknownKeys:"strip",catchall:Di.create(),typeName:lt.ZodObject,...mt(t)});class xp extends Tt{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(l){for(const d of l)if(d.result.status==="valid")return d.result;for(const d of l)if(d.result.status==="dirty")return n.common.issues.push(...d.ctx.common.issues),d.result;const c=l.map(d=>new ko(d.ctx.common.issues));return De(n,{code:Se.invalid_union,unionErrors:c}),it}if(n.common.async)return Promise.all(r.map(async l=>{const c={...n,common:{...n.common,issues:[]},parent:null};return{result:await l._parseAsync({data:n.data,path:n.path,parent:c}),ctx:c}})).then(s);{let l;const c=[];for(const f of r){const m={...n,common:{...n.common,issues:[]},parent:null},g=f._parseSync({data:n.data,path:n.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!l&&(l={result:g,ctx:m}),m.common.issues.length&&c.push(m.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(f=>new ko(f));return De(n,{code:Se.invalid_union,unionErrors:d}),it}}get options(){return this._def.options}}xp.create=(e,t)=>new xp({options:e,typeName:lt.ZodUnion,...mt(t)});const xo=e=>e instanceof I0?xo(e.schema):e instanceof kl?xo(e.innerType()):e instanceof Cp?[e.value]:e instanceof Ml?e.options:e instanceof wp?Lt.objectValues(e.enum):e instanceof Rp?xo(e._def.innerType):e instanceof O0?[void 0]:e instanceof yp?[null]:e instanceof To?[void 0,...xo(e.unwrap())]:e instanceof Il?[null,...xo(e.unwrap())]:e instanceof s4||e instanceof jp?xo(e.unwrap()):e instanceof Tp?xo(e._def.innerType):[];class m1 extends Tt{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.object)return De(n,{code:Se.invalid_type,expected:Ve.object,received:n.parsedType}),it;const r=this.discriminator,s=n.data[r],l=this.optionsMap.get(s);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(De(n,{code:Se.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),it)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const l of n){const c=xo(l.shape[t]);if(!c.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const d of c){if(s.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);s.set(d,l)}}return new m1({typeName:lt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...mt(r)})}}function k0(e,t){const n=mi(e),r=mi(t);if(e===t)return{valid:!0,data:e};if(n===Ve.object&&r===Ve.object){const s=Lt.objectKeys(t),l=Lt.objectKeys(e).filter(d=>s.indexOf(d)!==-1),c={...e,...t};for(const d of l){const f=k0(e[d],t[d]);if(!f.valid)return{valid:!1};c[d]=f.data}return{valid:!0,data:c}}else if(n===Ve.array&&r===Ve.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let l=0;l<e.length;l++){const c=e[l],d=t[l],f=k0(c,d);if(!f.valid)return{valid:!1};s.push(f.data)}return{valid:!0,data:s}}else return n===Ve.date&&r===Ve.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class bp extends Tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(l,c)=>{if(aT(l)||aT(c))return it;const d=k0(l.value,c.value);return d.valid?((sT(l)||sT(c))&&n.dirty(),{status:n.value,value:d.data}):(De(r,{code:Se.invalid_intersection_types}),it)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([l,c])=>s(l,c)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}bp.create=(e,t,n)=>new bp({left:e,right:t,typeName:lt.ZodIntersection,...mt(n)});class Ol extends Tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.array)return De(r,{code:Se.invalid_type,expected:Ve.array,received:r.parsedType}),it;if(r.data.length<this._def.items.length)return De(r,{code:Se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),it;!this._def.rest&&r.data.length>this._def.items.length&&(De(r,{code:Se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const l=[...r.data].map((c,d)=>{const f=this._def.items[d]||this._def.rest;return f?f._parse(new zs(r,c,r.path,d)):null}).filter(c=>!!c);return r.common.async?Promise.all(l).then(c=>Vr.mergeArray(n,c)):Vr.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new Ol({...this._def,rest:t})}}Ol.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ol({items:e,typeName:lt.ZodTuple,rest:null,...mt(t)})};class Sp extends Tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.object)return De(r,{code:Se.invalid_type,expected:Ve.object,received:r.parsedType}),it;const s=[],l=this._def.keyType,c=this._def.valueType;for(const d in r.data)s.push({key:l._parse(new zs(r,d,r.path,d)),value:c._parse(new zs(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?Vr.mergeObjectAsync(n,s):Vr.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Tt?new Sp({keyType:t,valueType:n,typeName:lt.ZodRecord,...mt(r)}):new Sp({keyType:Eo.create(),valueType:t,typeName:lt.ZodRecord,...mt(n)})}}class uT extends Tt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.map)return De(r,{code:Se.invalid_type,expected:Ve.map,received:r.parsedType}),it;const s=this._def.keyType,l=this._def.valueType,c=[...r.data.entries()].map(([d,f],m)=>({key:s._parse(new zs(r,d,r.path,[m,"key"])),value:l._parse(new zs(r,f,r.path,[m,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const f of c){const m=await f.key,g=await f.value;if(m.status==="aborted"||g.status==="aborted")return it;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const f of c){const m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return it;(m.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(m.value,g.value)}return{status:n.value,value:d}}}}uT.create=(e,t,n)=>new uT({valueType:t,keyType:e,typeName:lt.ZodMap,...mt(n)});class pf extends Tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==Ve.set)return De(r,{code:Se.invalid_type,expected:Ve.set,received:r.parsedType}),it;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(De(r,{code:Se.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(De(r,{code:Se.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const l=this._def.valueType;function c(f){const m=new Set;for(const g of f){if(g.status==="aborted")return it;g.status==="dirty"&&n.dirty(),m.add(g.value)}return{status:n.value,value:m}}const d=[...r.data.values()].map((f,m)=>l._parse(new zs(r,f,r.path,m)));return r.common.async?Promise.all(d).then(f=>c(f)):c(d)}min(t,n){return new pf({...this._def,minSize:{value:t,message:Je.toString(n)}})}max(t,n){return new pf({...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)}}pf.create=(e,t)=>new pf({valueType:e,minSize:null,maxSize:null,typeName:lt.ZodSet,...mt(t)});class I0 extends Tt{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})}}I0.create=(e,t)=>new I0({getter:e,typeName:lt.ZodLazy,...mt(t)});class Cp extends Tt{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return De(n,{received:n.data,code:Se.invalid_literal,expected:this._def.value}),it}return{status:"valid",value:t.data}}get value(){return this._def.value}}Cp.create=(e,t)=>new Cp({value:e,typeName:lt.ZodLiteral,...mt(t)});function a4(e,t){return new Ml({values:e,typeName:lt.ZodEnum,...mt(t)})}class Ml extends Tt{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{expected:Lt.joinValues(r),received:n.parsedType,code:Se.invalid_type}),it}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return De(n,{received:n.data,code:Se.invalid_enum_value,options:r}),it}return Wa(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 Ml.create(t,{...this._def,...n})}exclude(t,n=this._def){return Ml.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Ml.create=a4;class wp extends Tt{_parse(t){const n=Lt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==Ve.string&&r.parsedType!==Ve.number){const s=Lt.objectValues(n);return De(r,{expected:Lt.joinValues(s),received:r.parsedType,code:Se.invalid_type}),it}if(this._cache||(this._cache=new Set(Lt.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const s=Lt.objectValues(n);return De(r,{received:r.data,code:Se.invalid_enum_value,options:s}),it}return Wa(t.data)}get enum(){return this._def.values}}wp.create=(e,t)=>new wp({values:e,typeName:lt.ZodNativeEnum,...mt(t)});class Ep extends Tt{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==Ve.promise&&n.common.async===!1)return De(n,{code:Se.invalid_type,expected:Ve.promise,received:n.parsedType}),it;const r=n.parsedType===Ve.promise?n.data:Promise.resolve(n.data);return Wa(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ep.create=(e,t)=>new Ep({type:e,typeName:lt.ZodPromise,...mt(t)});class kl extends Tt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,l={addIssue:c=>{De(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),s.type==="preprocess"){const c=s.transform(r.data,l);if(r.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return it;const f=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return f.status==="aborted"?it:f.status==="dirty"||n.value==="dirty"?qd(f.value):f});{if(n.value==="aborted")return it;const d=this._def.schema._parseSync({data:c,path:r.path,parent:r});return d.status==="aborted"?it:d.status==="dirty"||n.value==="dirty"?qd(d.value):d}}if(s.type==="refinement"){const c=d=>{const f=s.refinement(d,l);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 d};if(r.common.async===!1){const d=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return d.status==="aborted"?it:(d.status==="dirty"&&n.dirty(),c(d.value),{status:n.value,value:d.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(d=>d.status==="aborted"?it:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(s.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!pu(c))return it;const d=s.transform(c.value,l);if(d instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:d}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>pu(c)?Promise.resolve(s.transform(c.value,l)).then(d=>({status:n.value,value:d})):it);Lt.assertNever(s)}}kl.create=(e,t,n)=>new kl({schema:e,typeName:lt.ZodEffects,effect:t,...mt(n)});kl.createWithPreprocess=(e,t,n)=>new kl({schema:t,effect:{type:"preprocess",transform:e},typeName:lt.ZodEffects,...mt(n)});class To extends Tt{_parse(t){return this._getType(t)===Ve.undefined?Wa(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}To.create=(e,t)=>new To({innerType:e,typeName:lt.ZodOptional,...mt(t)});class Il extends Tt{_parse(t){return this._getType(t)===Ve.null?Wa(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Il.create=(e,t)=>new Il({innerType:e,typeName:lt.ZodNullable,...mt(t)});class Rp extends Tt{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===Ve.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Rp.create=(e,t)=>new Rp({innerType:e,typeName:lt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...mt(t)});class Tp extends Tt{_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 gp(s)?s.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new ko(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ko(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Tp.create=(e,t)=>new Tp({innerType:e,typeName:lt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...mt(t)});class dT extends Tt{_parse(t){if(this._getType(t)!==Ve.nan){const r=this._getOrReturnCtx(t);return De(r,{code:Se.invalid_type,expected:Ve.nan,received:r.parsedType}),it}return{status:"valid",value:t.data}}}dT.create=e=>new dT({typeName:lt.ZodNaN,...mt(e)});class s4 extends Tt{_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 p1 extends Tt{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const l=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return l.status==="aborted"?it:l.status==="dirty"?(n.dirty(),qd(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?it:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new p1({in:t,out:n,typeName:lt.ZodPipeline})}}class jp extends Tt{_parse(t){const n=this._def.innerType._parse(t),r=s=>(pu(s)&&(s.value=Object.freeze(s.value)),s);return gp(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}jp.create=(e,t)=>new jp({innerType:e,typeName:lt.ZodReadonly,...mt(t)});var lt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(lt||(lt={}));const cn=Eo.create,jB=gu.create,_B=D0.create,NB=yp.create,AB=M0.create;Di.create;const fT=Ls.create,ln=qn.create,DB=xp.create,o4=m1.create;bp.create;Ol.create;const OB=Sp.create,qs=Cp.create;Ml.create;const g1=wp.create;Ep.create;To.create;const MB=Il.create,Dx=it,i4=ln({serviceAccount:cn().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON object"}),Dx):n.client_email?e:(t.addIssue({code:Se.custom,message:"Service Account must contain a client_email field"}),Dx)}catch(n){return console.error(n),t.addIssue({code:Se.custom,message:"Service Account must be a valid JSON string"}),Dx}})}),kB=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:V$,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:sR,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:c_,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:sR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Subscription",href:"https://platform.owox.com/ui/p/none/settings/subscription",icon:f9,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:oR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:oR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"better-auth"},group:"project"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=community_edition&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Documentation",href:"https://docs.owox.com/?utm_source=app_owox_com&utm_medium=organic&utm_campaign=documentation&utm_content=header_dropdown",icon:Fr,visible:{flagKey:"MENU_DOCUMENTATION_OWOX_CLOUD_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Leave Feedback",href:"https://github.com/OWOX/owox-data-marts/discussions",icon:mL,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:i9,visible:{flagKey:"MENU_ISSUES_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Slack Community",href:"https://join.slack.com/t/owox-data-marts/shared_invite/zt-3fffrsau9-UlobJVlXzRLpXmvs0ffvoQ",icon:Y$,visible:{flagKey:"MENU_SLACK_COMMUNITY_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"License",href:"https://github.com/OWOX/owox-data-marts#License-1-ov-file",icon:OL,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:K$,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function hT(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function IB(){const{flags:e}=o1(),{loadProjects:t,projects:n}=XA(),{id:r}=wA(),s=hT("IDP_PROVIDER","owox",e);p.useEffect(()=>{s&&t()},[t,s]);const l=n.length>1;return{visibleMenuItems:p.useMemo(()=>{const f=kB.filter(x=>typeof x.visible=="boolean"?x.visible:hT(x.visible.flagKey,x.visible.expectedValue,e)).map(x=>{if(x.group==="project"&&x.href&&r)try{const b=x.href.replace("/p/none/",`/p/${r}/`);return{...x,href:b}}catch{return x}return x}),m=new Map;f.forEach(x=>{const b=x.group||"default";m.has(b)||m.set(b,[]);const w=m.get(b);w&&w.push(x)});const g=[],v=Array.from(m.entries()).filter(([,x])=>x.length>0);return v.forEach(([,x],b)=>{g.push(...x),b<v.length-1&&g.push({type:"separator",visible:!0})}),g},[e,r]),canSwitchProject:l}}function LB(){const{visibleMenuItems:e,canSwitchProject:t}=IB();return o.jsxs(jr,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return o.jsx(qa,{},`separator-${String(r)}`);const s=n.icon;return o.jsx(yt,{asChild:!0,children:o.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[o.jsx(s,{className:"size-4"}),n.title]})},n.href)}),t&&o.jsx(z$,{},"switch-project")]})}var Mr=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(Mr||{});let PB={data:""},UB=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||PB},FB=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,zB=/\/\*[^]*?\*\/| +/g,mT=/\n+/g,yi=(e,t)=>{let n="",r="",s="";for(let l in e){let c=e[l];l[0]=="@"?l[1]=="i"?n=l+" "+c+";":r+=l[1]=="f"?yi(c,l):l+"{"+yi(c,l[1]=="k"?"":t)+"}":typeof c=="object"?r+=yi(c,t?t.replace(/([^,])+/g,d=>l.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,f=>/&/.test(f)?f.replace(/&/g,d):d?d+" "+f:f)):l):c!=null&&(l=/^--/.test(l)?l:l.replace(/[A-Z]/g,"-$&").toLowerCase(),s+=yi.p?yi.p(l,c):l+":"+c+";")}return n+(t&&s?t+"{"+s+"}":s)+r},go={},l4=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+l4(e[n]);return t}return e},VB=(e,t,n,r,s)=>{let l=l4(e),c=go[l]||(go[l]=(f=>{let m=0,g=11;for(;m<f.length;)g=101*g+f.charCodeAt(m++)>>>0;return"go"+g})(l));if(!go[c]){let f=l!==e?e:(m=>{let g,v,x=[{}];for(;g=FB.exec(m.replace(zB,""));)g[4]?x.shift():g[3]?(v=g[3].replace(mT," ").trim(),x.unshift(x[0][v]=x[0][v]||{})):x[0][g[1]]=g[2].replace(mT," ").trim();return x[0]})(e);go[c]=yi(s?{["@keyframes "+c]:f}:f,n?"":"."+c)}let d=n&&go.g?go.g:null;return n&&(go.g=go[c]),((f,m,g,v)=>{v?m.data=m.data.replace(v,f):m.data.indexOf(f)===-1&&(m.data=g?f+m.data:m.data+f)})(go[c],t,r,d),c},HB=(e,t,n)=>e.reduce((r,s,l)=>{let c=t[l];if(c&&c.call){let d=c(n),f=d&&d.props&&d.props.className||/^go/.test(d)&&d;c=f?"."+f:d&&typeof d=="object"?d.props?"":yi(d,""):d===!1?"":d}return r+s+(c??"")},"");function Sg(e){let t=this||{},n=e.call?e(t.p):e;return VB(n.unshift?n.raw?HB(n,[].slice.call(arguments,1),t.p):n.reduce((r,s)=>Object.assign(r,s&&s.call?s(t.p):s),{}):n,UB(t.target),t.g,t.o,t.k)}let c4,L0,P0;Sg.bind({g:1});let Io=Sg.bind({k:1});function $B(e,t,n,r){yi.p=t,c4=e,L0=n,P0=r}function $i(e,t){let n=this||{};return function(){let r=arguments;function s(l,c){let d=Object.assign({},l),f=d.className||s.className;n.p=Object.assign({theme:L0&&L0()},d),n.o=/ *go\d+/.test(f),d.className=Sg.apply(n,r)+(f?" "+f:"");let m=e;return e[0]&&(m=d.as||e,delete d.as),P0&&m[0]&&P0(d),c4(m,d)}return s}}var BB=e=>typeof e=="function",_p=(e,t)=>BB(e)?e(t):e,GB=(()=>{let e=0;return()=>(++e).toString()})(),u4=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),qB=20,v1="default",d4=(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 d4(e,{type:e.toasts.find(c=>c.id===r.id)?1:0,toast:r});case 3:let{toastId:s}=t;return{...e,toasts:e.toasts.map(c=>c.id===s||s===void 0?{...c,dismissed:!0,visible:!1}:c)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(c=>c.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let l=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(c=>({...c,pauseDuration:c.pauseDuration+l}))}}},Wm=[],f4={toasts:[],pausedAt:void 0,settings:{toastLimit:qB}},Os={},h4=(e,t=v1)=>{Os[t]=d4(Os[t]||f4,e),Wm.forEach(([n,r])=>{n===t&&r(Os[t])})},m4=e=>Object.keys(Os).forEach(t=>h4(e,t)),ZB=e=>Object.keys(Os).find(t=>Os[t].toasts.some(n=>n.id===e)),Cg=(e=v1)=>t=>{h4(t,e)},KB={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},YB=(e={},t=v1)=>{let[n,r]=p.useState(Os[t]||f4),s=p.useRef(Os[t]);p.useEffect(()=>(s.current!==Os[t]&&r(Os[t]),Wm.push([t,r]),()=>{let c=Wm.findIndex(([d])=>d===t);c>-1&&Wm.splice(c,1)}),[t]);let l=n.toasts.map(c=>{var d,f,m;return{...e,...e[c.type],...c,removeDelay:c.removeDelay||((d=e[c.type])==null?void 0:d.removeDelay)||(e==null?void 0:e.removeDelay),duration:c.duration||((f=e[c.type])==null?void 0:f.duration)||(e==null?void 0:e.duration)||KB[c.type],style:{...e.style,...(m=e[c.type])==null?void 0:m.style,...c.style}}});return{...n,toasts:l}},WB=(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)||GB()}),Bf=e=>(t,n)=>{let r=WB(t,e,n);return Cg(r.toasterId||ZB(r.id))({type:2,toast:r}),r.id},on=(e,t)=>Bf("blank")(e,t);on.error=Bf("error");on.success=Bf("success");on.loading=Bf("loading");on.custom=Bf("custom");on.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Cg(t)(n):m4(n)};on.dismissAll=e=>on.dismiss(void 0,e);on.remove=(e,t)=>{let n={type:4,toastId:e};t?Cg(t)(n):m4(n)};on.removeAll=e=>on.remove(void 0,e);on.promise=(e,t,n)=>{let r=on.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(s=>{let l=t.success?_p(t.success,s):void 0;return l?on.success(l,{id:r,...n,...n==null?void 0:n.success}):on.dismiss(r),s}).catch(s=>{let l=t.error?_p(t.error,s):void 0;l?on.error(l,{id:r,...n,...n==null?void 0:n.error}):on.dismiss(r)}),e};var QB=1e3,XB=(e,t="default")=>{let{toasts:n,pausedAt:r}=YB(e,t),s=p.useRef(new Map).current,l=p.useCallback((v,x=QB)=>{if(s.has(v))return;let b=setTimeout(()=>{s.delete(v),c({type:4,toastId:v})},x);s.set(v,b)},[]);p.useEffect(()=>{if(r)return;let v=Date.now(),x=n.map(b=>{if(b.duration===1/0)return;let w=(b.duration||0)+b.pauseDuration-(v-b.createdAt);if(w<0){b.visible&&on.dismiss(b.id);return}return setTimeout(()=>on.dismiss(b.id,t),w)});return()=>{x.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let c=p.useCallback(Cg(t),[t]),d=p.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=p.useCallback((v,x)=>{c({type:1,toast:{id:v,height:x}})},[c]),m=p.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=p.useCallback((v,x)=>{let{reverseOrder:b=!1,gutter:w=8,defaultPosition:C}=x||{},E=n.filter(_=>(_.position||C)===(v.position||C)&&_.height),R=E.findIndex(_=>_.id===v.id),T=E.filter((_,O)=>O<R&&_.visible).length;return E.filter(_=>_.visible).slice(...b?[T+1]:[0,T]).reduce((_,O)=>_+(O.height||0)+w,0)},[n]);return p.useEffect(()=>{n.forEach(v=>{if(v.dismissed)l(v.id,v.removeDelay);else{let x=s.get(v.id);x&&(clearTimeout(x),s.delete(v.id))}})},[n,l]),{toasts:n,handlers:{updateHeight:f,startPause:d,endPause:m,calculateOffset:g}}},JB=Io`
|
|
491
|
-
from {
|
|
492
|
-
transform: scale(0) rotate(45deg);
|
|
493
|
-
opacity: 0;
|
|
494
|
-
}
|
|
495
|
-
to {
|
|
496
|
-
transform: scale(1) rotate(45deg);
|
|
497
|
-
opacity: 1;
|
|
498
|
-
}`,eG=Io`
|
|
499
|
-
from {
|
|
500
|
-
transform: scale(0);
|
|
501
|
-
opacity: 0;
|
|
502
|
-
}
|
|
503
|
-
to {
|
|
504
|
-
transform: scale(1);
|
|
505
|
-
opacity: 1;
|
|
506
|
-
}`,tG=Io`
|
|
507
|
-
from {
|
|
508
|
-
transform: scale(0) rotate(90deg);
|
|
509
|
-
opacity: 0;
|
|
510
|
-
}
|
|
511
|
-
to {
|
|
512
|
-
transform: scale(1) rotate(90deg);
|
|
513
|
-
opacity: 1;
|
|
514
|
-
}`,nG=$i("div")`
|
|
515
|
-
width: 20px;
|
|
516
|
-
opacity: 0;
|
|
517
|
-
height: 20px;
|
|
518
|
-
border-radius: 10px;
|
|
519
|
-
background: ${e=>e.primary||"#ff4b4b"};
|
|
520
|
-
position: relative;
|
|
521
|
-
transform: rotate(45deg);
|
|
522
|
-
|
|
523
|
-
animation: ${JB} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
524
|
-
forwards;
|
|
525
|
-
animation-delay: 100ms;
|
|
526
|
-
|
|
527
|
-
&:after,
|
|
528
|
-
&:before {
|
|
529
|
-
content: '';
|
|
530
|
-
animation: ${eG} 0.15s ease-out forwards;
|
|
531
|
-
animation-delay: 150ms;
|
|
532
|
-
position: absolute;
|
|
533
|
-
border-radius: 3px;
|
|
534
|
-
opacity: 0;
|
|
535
|
-
background: ${e=>e.secondary||"#fff"};
|
|
536
|
-
bottom: 9px;
|
|
537
|
-
left: 4px;
|
|
538
|
-
height: 2px;
|
|
539
|
-
width: 12px;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
&:before {
|
|
543
|
-
animation: ${tG} 0.15s ease-out forwards;
|
|
544
|
-
animation-delay: 180ms;
|
|
545
|
-
transform: rotate(90deg);
|
|
546
|
-
}
|
|
547
|
-
`,rG=Io`
|
|
548
|
-
from {
|
|
549
|
-
transform: rotate(0deg);
|
|
550
|
-
}
|
|
551
|
-
to {
|
|
552
|
-
transform: rotate(360deg);
|
|
553
|
-
}
|
|
554
|
-
`,aG=$i("div")`
|
|
555
|
-
width: 12px;
|
|
556
|
-
height: 12px;
|
|
557
|
-
box-sizing: border-box;
|
|
558
|
-
border: 2px solid;
|
|
559
|
-
border-radius: 100%;
|
|
560
|
-
border-color: ${e=>e.secondary||"#e0e0e0"};
|
|
561
|
-
border-right-color: ${e=>e.primary||"#616161"};
|
|
562
|
-
animation: ${rG} 1s linear infinite;
|
|
563
|
-
`,sG=Io`
|
|
564
|
-
from {
|
|
565
|
-
transform: scale(0) rotate(45deg);
|
|
566
|
-
opacity: 0;
|
|
567
|
-
}
|
|
568
|
-
to {
|
|
569
|
-
transform: scale(1) rotate(45deg);
|
|
570
|
-
opacity: 1;
|
|
571
|
-
}`,oG=Io`
|
|
572
|
-
0% {
|
|
573
|
-
height: 0;
|
|
574
|
-
width: 0;
|
|
575
|
-
opacity: 0;
|
|
576
|
-
}
|
|
577
|
-
40% {
|
|
578
|
-
height: 0;
|
|
579
|
-
width: 6px;
|
|
580
|
-
opacity: 1;
|
|
581
|
-
}
|
|
582
|
-
100% {
|
|
583
|
-
opacity: 1;
|
|
584
|
-
height: 10px;
|
|
585
|
-
}`,iG=$i("div")`
|
|
586
|
-
width: 20px;
|
|
587
|
-
opacity: 0;
|
|
588
|
-
height: 20px;
|
|
589
|
-
border-radius: 10px;
|
|
590
|
-
background: ${e=>e.primary||"#61d345"};
|
|
591
|
-
position: relative;
|
|
592
|
-
transform: rotate(45deg);
|
|
593
|
-
|
|
594
|
-
animation: ${sG} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
595
|
-
forwards;
|
|
596
|
-
animation-delay: 100ms;
|
|
597
|
-
&:after {
|
|
598
|
-
content: '';
|
|
599
|
-
box-sizing: border-box;
|
|
600
|
-
animation: ${oG} 0.2s ease-out forwards;
|
|
601
|
-
opacity: 0;
|
|
602
|
-
animation-delay: 200ms;
|
|
603
|
-
position: absolute;
|
|
604
|
-
border-right: 2px solid;
|
|
605
|
-
border-bottom: 2px solid;
|
|
606
|
-
border-color: ${e=>e.secondary||"#fff"};
|
|
607
|
-
bottom: 6px;
|
|
608
|
-
left: 6px;
|
|
609
|
-
height: 10px;
|
|
610
|
-
width: 6px;
|
|
611
|
-
}
|
|
612
|
-
`,lG=$i("div")`
|
|
613
|
-
position: absolute;
|
|
614
|
-
`,cG=$i("div")`
|
|
615
|
-
position: relative;
|
|
616
|
-
display: flex;
|
|
617
|
-
justify-content: center;
|
|
618
|
-
align-items: center;
|
|
619
|
-
min-width: 20px;
|
|
620
|
-
min-height: 20px;
|
|
621
|
-
`,uG=Io`
|
|
622
|
-
from {
|
|
623
|
-
transform: scale(0.6);
|
|
624
|
-
opacity: 0.4;
|
|
625
|
-
}
|
|
626
|
-
to {
|
|
627
|
-
transform: scale(1);
|
|
628
|
-
opacity: 1;
|
|
629
|
-
}`,dG=$i("div")`
|
|
630
|
-
position: relative;
|
|
631
|
-
transform: scale(0.6);
|
|
632
|
-
opacity: 0.4;
|
|
633
|
-
min-width: 20px;
|
|
634
|
-
animation: ${uG} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
|
|
635
|
-
forwards;
|
|
636
|
-
`,fG=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?p.createElement(dG,null,t):t:n==="blank"?null:p.createElement(cG,null,p.createElement(aG,{...r}),n!=="loading"&&p.createElement(lG,null,n==="error"?p.createElement(nG,{...r}):p.createElement(iG,{...r})))},hG=e=>`
|
|
637
|
-
0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;}
|
|
638
|
-
100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
|
|
639
|
-
`,mG=e=>`
|
|
640
|
-
0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
|
|
641
|
-
100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;}
|
|
642
|
-
`,pG="0%{opacity:0;} 100%{opacity:1;}",gG="0%{opacity:1;} 100%{opacity:0;}",vG=$i("div")`
|
|
643
|
-
display: flex;
|
|
644
|
-
align-items: center;
|
|
645
|
-
background: #fff;
|
|
646
|
-
color: #363636;
|
|
647
|
-
line-height: 1.3;
|
|
648
|
-
will-change: transform;
|
|
649
|
-
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
|
|
650
|
-
max-width: 350px;
|
|
651
|
-
pointer-events: auto;
|
|
652
|
-
padding: 8px 10px;
|
|
653
|
-
border-radius: 8px;
|
|
654
|
-
`,yG=$i("div")`
|
|
655
|
-
display: flex;
|
|
656
|
-
justify-content: center;
|
|
657
|
-
margin: 4px 10px;
|
|
658
|
-
color: inherit;
|
|
659
|
-
flex: 1 1 auto;
|
|
660
|
-
white-space: pre-line;
|
|
661
|
-
`,xG=(e,t)=>{let n=e.includes("top")?1:-1,[r,s]=u4()?[pG,gG]:[hG(n),mG(n)];return{animation:t?`${Io(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Io(s)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},bG=p.memo(({toast:e,position:t,style:n,children:r})=>{let s=e.height?xG(e.position||t||"top-center",e.visible):{opacity:0},l=p.createElement(fG,{toast:e}),c=p.createElement(yG,{...e.ariaProps},_p(e.message,e));return p.createElement(vG,{className:e.className,style:{...s,...n,...e.style}},typeof r=="function"?r({icon:l,message:c}):p.createElement(p.Fragment,null,l,c))});$B(p.createElement);var SG=({id:e,className:t,style:n,onHeightUpdate:r,children:s})=>{let l=p.useCallback(c=>{if(c){let d=()=>{let f=c.getBoundingClientRect().height;r(e,f)};d(),new MutationObserver(d).observe(c,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return p.createElement("div",{ref:l,className:t,style:n},s)},CG=(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:u4()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...s}},wG=Sg`
|
|
662
|
-
z-index: 9999;
|
|
663
|
-
> * {
|
|
664
|
-
pointer-events: auto;
|
|
665
|
-
}
|
|
666
|
-
`,jm=16,EG=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:s,toasterId:l,containerStyle:c,containerClassName:d})=>{let{toasts:f,handlers:m}=XB(n,l);return p.createElement("div",{"data-rht-toaster":l||"",style:{position:"fixed",zIndex:9999,top:jm,left:jm,right:jm,bottom:jm,pointerEvents:"none",...c},className:d,onMouseEnter:m.startPause,onMouseLeave:m.endPause},f.map(g=>{let v=g.position||t,x=m.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),b=CG(v,x);return p.createElement(SG,{id:g.id,key:g.id,onHeightUpdate:m.updateHeight,className:g.visible?wG:"",style:b},g.type==="custom"?_p(g.message,g):s?s(g):p.createElement(bG,{toast:g,position:v}))}))},Ot=on;const bn=e=>{var n;return(n=e.response)==null?void 0:n.data};function pT(e,t="Something went wrong"){var s,l;const n=bn(e);let r=n.message.trim()||t;(l=(s=n.errorDetails)==null?void 0:s.error)!=null&&l.trim()&&(r=`${r}. ${n.errorDetails.error}`),Ot.error(r)}class RG{constructor(){js(this,"isRefreshingToken",!1);js(this,"refreshTokenPromise",null);js(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 TG={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},pa=On.create(TG),U0=new RG;pa.interceptors.request.use(e=>{if(e.skipAuthHeader||new x$(e.headers).has("X-OWOX-Authorization"))return e;const n=h1(),r=(n==null?void 0:n.getAccessToken())??U0.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));pa.interceptors.response.use(e=>e,async e=>{var n,r,s;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const l=h1();if(!l)throw new Error("No token provider available");const c=await U0.refreshToken(()=>l.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await pa(t)}catch{return U0.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&&pT(e,"Access forbidden - insufficient permissions"),((s=e.response)==null?void 0:s.status)===400&&pT(e,"Bad request"),Promise.reject(e)});const p4={projects:[],callState:Mr.IDLE,error:null};function jG(e,t){switch(t.type){case"LOADING":return{...e,callState:Mr.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:Mr.LOADED,error:null};case"ERROR":return{...e,callState:Mr.ERROR,error:t.payload};case"RESET":return{...p4};default:return e}}function _G({children:e}){const[t,n]=p.useReducer(jG,p4),r=p.useCallback(async()=>{n({type:"LOADING"});try{const d=h1();if(!d){n({type:"ERROR",payload:bn(new eT("No token provider"))});return}const f=d.getAccessToken();if(!f){n({type:"ERROR",payload:bn(new eT("Unable to obtain access token"))});return}const m=await T$(f);n({type:"SUCCESS",payload:m})}catch(d){n({type:"ERROR",payload:bn(d)})}},[]),s=p.useCallback(()=>{n({type:"RESET"})},[]),l=t.callState===Mr.LOADING,c={...t,loadProjects:r,reset:s,isLoading:l};return o.jsx(QA.Provider,{value:c,children:e})}function NG(){const[e,t]=p.useState(!1);return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(Rr,{open:e,onOpenChange:t,children:[o.jsx($V,{isOpen:e}),o.jsx(_G,{children:o.jsx(LB,{})})]})})})})}var AG=(e,t,n,r,s,l,c,d)=>{let f=document.documentElement,m=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(w=>{let C=w==="class",E=C&&l?s.map(R=>l[R]||R):s;C?(f.classList.remove(...E),f.classList.add(l&&l[b]?l[b]:b)):f.setAttribute(w,b)}),v(b)}function v(b){d&&m.includes(b)&&(f.style.colorScheme=b)}function x(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)g(r);else try{let b=localStorage.getItem(t)||n,w=c&&b==="system"?x():b;g(w)}catch{}},gT=["light","dark"],g4="(prefers-color-scheme: dark)",DG=typeof window>"u",y1=p.createContext(void 0),OG={setTheme:e=>{},themes:[]},v4=()=>{var e;return(e=p.useContext(y1))!=null?e:OG},MG=e=>p.useContext(y1)?p.createElement(p.Fragment,null,e.children):p.createElement(IG,{...e}),kG=["light","dark"],IG=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:s="theme",themes:l=kG,defaultTheme:c=n?"system":"light",attribute:d="data-theme",value:f,children:m,nonce:g,scriptProps:v})=>{let[x,b]=p.useState(()=>PG(s,c)),[w,C]=p.useState(()=>x==="system"?Ox():x),E=f?Object.values(f):l,R=p.useCallback(A=>{let D=A;if(!D)return;A==="system"&&n&&(D=Ox());let j=f?f[D]:D,M=t?UG(g):null,z=document.documentElement,Z=K=>{K==="class"?(z.classList.remove(...E),j&&z.classList.add(j)):K.startsWith("data-")&&(j?z.setAttribute(K,j):z.removeAttribute(K))};if(Array.isArray(d)?d.forEach(Z):Z(d),r){let K=gT.includes(c)?c:null,Y=gT.includes(D)?D:K;z.style.colorScheme=Y}M==null||M()},[g]),T=p.useCallback(A=>{let D=typeof A=="function"?A(x):A;b(D);try{localStorage.setItem(s,D)}catch{}},[x]),_=p.useCallback(A=>{let D=Ox(A);C(D),x==="system"&&n&&!e&&R("system")},[x,e]);p.useEffect(()=>{let A=window.matchMedia(g4);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),p.useEffect(()=>{let A=D=>{D.key===s&&(D.newValue?b(D.newValue):T(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[T]),p.useEffect(()=>{R(e??x)},[e,x]);let O=p.useMemo(()=>({theme:x,setTheme:T,forcedTheme:e,resolvedTheme:x==="system"?w:x,themes:n?[...l,"system"]:l,systemTheme:n?w:void 0}),[x,T,e,w,n,l]);return p.createElement(y1.Provider,{value:O},p.createElement(LG,{forcedTheme:e,storageKey:s,attribute:d,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:l,nonce:g,scriptProps:v}),m)},LG=p.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:l,value:c,themes:d,nonce:f,scriptProps:m})=>{let g=JSON.stringify([n,t,l,e,d,c,r,s]).slice(1,-1);return p.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${AG.toString()})(${g})`}})}),PG=(e,t)=>{if(DG)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},UG=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)}},Ox=e=>(e||(e=window.matchMedia(g4)),e.matches?"dark":"light");const FG=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:zG(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:i_},{value:"light",label:"Light",icon:u_},{value:"dark",label:"Dark",icon:l_}]}},{type:"separator"},{type:"item",title:"Sign out",icon:lL,onClick:n,className:"text-red-600 focus:text-red-600"}];function zG(e){switch(e){case"light":return u_;case"dark":return l_;case"system":default:return i_}}function VG({avatar:e,initials:t,displayName:n}){return o.jsx("div",{className:"text-muted-foreground flex aspect-square size-8 items-center justify-center rounded-full border bg-white text-sm font-medium dark:bg-white/10",children:e?o.jsx("img",{src:e,alt:n,className:"size-full rounded-full object-cover"}):o.jsx("span",{children:t})})}function HG({isOpen:e,displayName:t,email:n,avatar:r,initials:s}){return o.jsx(Tr,{asChild:!0,children:o.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:rounded-full group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[o.jsx(VG,{avatar:r,initials:s,displayName:t}),o.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[o.jsx("span",{className:"truncate font-medium",children:t}),n&&o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),o.jsx(Ka,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function $G({items:e}){return o.jsx(jr,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return o.jsx(qa,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return o.jsxs(r1,{children:[o.jsxs(a1,{className:"flex items-center gap-2 px-2 py-1.5",children:[o.jsx(t.icon,{className:"size-4"}),t.title]}),o.jsx(s1,{children:r.options.map(s=>o.jsxs(yt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(s.value)},children:[s.icon&&o.jsx(s.icon,{className:"size-4"}),s.label,r.value===s.value&&o.jsx(fr,{className:"ml-auto size-4"})]},s.value))})]},t.title)}return o.jsxs(yt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[o.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function BG(e,t){var n,r,s,l;if(e){const c=e.trim().split(" ").filter(Boolean);return c.length>=2?`${((n=c[0])==null?void 0:n[0])??""}${((r=c[1])==null?void 0:r[0])??""}`.toUpperCase():((l=(s=c[0])==null?void 0:s[0])==null?void 0:l.toUpperCase())||""}if(t!=null&&t.includes("@")){const c=t.split("@")[0];return c.length>1?`${c[0]}${c[1]}`.toUpperCase():c[0].toUpperCase()}return"U"}function GG(){const{user:e,signOut:t}=Vi(),{setTheme:n,theme:r}=v4(),[s,l]=p.useState(!1);if(!e)return null;const{fullName:c,email:d,avatar:f}=e,m=c??d??"Unknown User",g=BG(c,d);return o.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:o.jsxs(Rr,{open:s,onOpenChange:l,children:[o.jsx(HG,{isOpen:s,displayName:m,email:d,avatar:f,initials:g}),o.jsx($G,{items:FG({theme:r,setTheme:n,signOut:t})})]})})}function qG(){const{user:e,status:t}=Vi();return t===Or.LOADING||t===Or.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function Po(){const e=qp(),t=qG(),n=p.useCallback((l,c)=>{if(!t){e("/",{replace:!0});return}const d=pp(t,l);e(d,c)},[e,t]),r=p.useCallback(l=>t?pp(t,l):l,[t]);return p.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function ZG(){const{scope:e}=Po();return o.jsxs(wf,{to:e("/data-marts/create"),"data-sidebar":"menu-button","data-size":"md",className:"peer/menu-button ring-sidebar-ring bg-primary hover:bg-primary-hover text-primary-foreground hover:text-primary-foreground flex h-8 w-full items-center gap-2 overflow-hidden rounded-full p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[o.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:o.jsx(ja,{className:"size-4 shrink-0"})}),o.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:o.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const KG=[{title:"Data Marts",url:"/data-marts",icon:ap},{title:"Storages",url:"/data-storages",icon:cu},{title:"Destinations",url:"/data-destinations",icon:Rb}];function YG(){const{scope:e}=Po();return o.jsx(sz,{children:KG.map(t=>{const n=t.icon;return o.jsx(oz,{children:o.jsx(wf,{to:e(t.url),className:({isActive:r})=>`flex w-full items-center gap-2 rounded-md font-medium transition-colors ${r?"bg-sidebar-active text-sidebar-active-foreground font-medium shadow-sm":""}`,children:({isActive:r})=>o.jsxs(St,{delayDuration:500,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs(lz,{className:`${r?"hover:bg-transparent":""}`,children:[o.jsx(n,{className:"size-4 shrink-0 transition-all"}),o.jsx("span",{children:t.title}),t.badge&&o.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),o.jsx(wt,{side:"right",children:t.title})]})})},t.title)})})}function WG({variant:e="inset",collapsible:t="icon"}){return o.jsxs(XF,{variant:e,collapsible:t,children:[o.jsx(nz,{children:o.jsx(NG,{})}),o.jsxs(az,{children:[o.jsx(IR,{children:o.jsx(LR,{children:o.jsx(ZG,{})})}),o.jsx(IR,{children:o.jsx(LR,{children:o.jsx(YG,{})})})]}),o.jsx(rz,{children:o.jsx(GG,{})}),o.jsx(ez,{})]})}function QG({children:e,...t}){return o.jsx(MG,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class Zl{constructor(t){js(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const s=this.createUrl(t);return(await pa.get(s,{...r,params:n})).data}async post(t,n,r){const s=this.createUrl(t);return(await pa.post(s,n,r)).data}async put(t,n,r){const s=this.createUrl(t);return(await pa.put(s,n,r)).data}async patch(t,n,r){const s=this.createUrl(t);return(await pa.patch(s,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await pa.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class XG{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 Ms=new XG;class JG{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const s=this.getTimezoneOffset(r,n),l=this.formatOffset(s),c=this.isDaylightSavingTime(r,n),d=this.getDisplayName(r,l);return{identifier:r,displayName:d,offsetMinutes:s,offsetString:l,isDST:c}})}getTimezoneOffset(t,n=new Date){try{const r=new Intl.DateTimeFormat("en-US",{timeZone:"UTC",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),s=new Intl.DateTimeFormat("en-US",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}),l=new Date(r.format(n)),c=new Date(s.format(n));return Math.round((c.getTime()-l.getTime())/(1e3*60))}catch(r){return console.warn(`Failed to get offset for timezone ${t}:`,r),0}}formatOffset(t){const n=t>=0?"+":"-",r=Math.abs(t),s=Math.floor(r/60),l=r%60;return`${n}${s.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const r=new Date(n.getFullYear(),0,1),s=new Date(n.getFullYear(),6,1),l=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,s),d=this.getTimezoneOffset(t,n),f=Math.min(l,c);return d>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),l=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,s);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:s,isDST:l}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const eq=new JG;function tq({isLoading:e,className:t}){const[n,r]=p.useState(0),[s,l]=p.useState(!1);return p.useEffect(()=>{let c,d;return e?(l(!0),r(0),c=setInterval(()=>{r(f=>f<90?f+(90-f)/10:f)},200)):(r(100),d=setTimeout(()=>{l(!1)},300)),()=>{clearInterval(c),clearTimeout(d)}},[e]),o.jsx("div",{className:J("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!s&&"opacity-0",t),children:o.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const y4=p.createContext({isLoading:!1});function nq({children:e}){const[t,n]=p.useState(0),r=t>0;return p.useEffect(()=>{const s=pa.interceptors.request.use(c=>(c.skipLoadingIndicator||n(d=>d+1),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c))),l=pa.interceptors.response.use(c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),c),c=>(c.config.skipLoadingIndicator||n(d=>Math.max(0,d-1)),Promise.reject(c)));return()=>{pa.interceptors.request.eject(s),pa.interceptors.response.eject(l)}},[]),o.jsx(y4.Provider,{value:{isLoading:r},children:e})}function rq(){return p.useContext(y4)}function aq(){return o.jsx(EG,{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 sq({children:e}){const{isLoading:t}=WA(),n=I$(),r=Zj(),s=$s();return p.useEffect(()=>{if(t)return;const l=r.projectId,c=n==null?void 0:n.projectId;if(l&&!s.pathname.startsWith("/auth")&&n&&c&&c!==l){const d=new URLSearchParams({projectId:l}).toString();window.location.href=`/auth/sign-in?${d}`}},[t,n,r.projectId,s.pathname]),o.jsx(o.Fragment,{children:e})}const vT="sidebar_state";function oq(){const{state:e,isMobile:t}=kf(),r=t||e==="collapsed",{isLoading:s}=rq();return o.jsxs(o.Fragment,{children:[o.jsx(aq,{}),o.jsx(tq,{isLoading:s}),o.jsxs(L$,{redirectTo:"/auth/sign-in",children:[o.jsx(WG,{variant:"inset",collapsible:"icon"}),o.jsxs(tz,{children:[r&&o.jsx(JF,{}),o.jsx(sq,{children:o.jsx(Yj,{})})]})]})]})}function iq(){const[e,t]=p.useState(()=>Ms.get(vT,"boolean")??!0),n=r=>{t(r),Ms.set(vT,r)};return o.jsx(QG,{children:o.jsx(nq,{children:o.jsx(QF,{open:e,onOpenChange:n,children:o.jsx(oq,{})})})})}function lq(){return o.jsxs("div",{className:"app-container",children:[o.jsx("h1",{children:"About OWOX"}),o.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function yT(){return o.jsxs("div",{className:"dm-empty-state-404page",children:[o.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[o.jsx(VL,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),o.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",o.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",o.jsx("i",{children:"yesterday"}),".",o.jsx("br",{}),"Escape while you can!"]}),o.jsx(be,{variant:"default",asChild:!0,children:o.jsxs(Ga,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",o.jsx(Ta,{className:"h-4 w-4"})]})})]}),o.jsx("div",{className:"dm-empty-state-404page-background"})]})}const cq={items:[],loading:!1,error:null};function uq(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 x4=p.createContext(void 0);function dq({children:e}){const[t,n]=p.useReducer(uq,cq);return o.jsx(x4.Provider,{value:{state:t,dispatch:n},children:e})}function fq(){const e=p.useContext(x4);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class hq extends Zl{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 getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const sn=new hq;var dr=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(dr||{}),He=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(He||{}),Qm=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(Qm||{});const mq={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 b4=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(b4||{}),Cl=(e=>(e.CONNECTOR="CONNECTOR",e.GOOGLE_SHEETS_EXPORT="GOOGLE_SHEETS_EXPORT",e.LOOKER_STUDIO="LOOKER_STUDIO",e))(Cl||{}),sr=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(sr||{});const S4={statuses:{[dr.DRAFT]:{code:dr.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[dr.PUBLISHED]:{code:dr.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},C4=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,w4=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,pq=e=>e?C4(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",gq=e=>e?w4(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",E4=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)},R4=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)},vq=e=>e?E4(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",yq=e=>e?R4(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required",xq=[{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 bq(e){return"projectId"in e}function Sq(e){return"outputBucket"in e}var Ie=(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))(Ie||{}),Co=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(Co||{});const Cq=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,s=r==="";return o.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[o.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!s?o.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):o.jsx("span",{className:"text-sm",children:s||r===void 0?o.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},wq=({type:e,config:t})=>{const n={[Ie.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[Ie.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[Ie.SNOWFLAKE]:[],[Ie.DATABRICKS]:[],[Ie.AWS_REDSHIFT]:[],[Ie.AZURE_SYNAPSE]:[]},r=t&&(e===Ie.GOOGLE_BIGQUERY&&bq(t)||e===Ie.AWS_ATHENA&&Sq(t));return o.jsx("div",{className:"grid gap-2",children:n[e].map(({label:s,key:l})=>{let c;return r&&(c=(e===Ie.GOOGLE_BIGQUERY,t[l])),o.jsx(Cq,{label:s,value:c},l)})})},Eq=({type:e,config:t})=>o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-1",children:[o.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),o.jsx(wq,{type:e,config:t})]})}),Rq=Ef("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 Cr({className:e,variant:t,asChild:n=!1,...r}){const s=n?Kp:"span";return o.jsx(s,{"data-slot":"badge",className:J(Rq({variant:t}),e),...r})}function T4(e){return e.type===Ie.GOOGLE_BIGQUERY}function j4(e){return e.type===Ie.AWS_ATHENA}const Bi={types:{[Ie.GOOGLE_BIGQUERY]:{type:Ie.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:JA,status:Co.ACTIVE},[Ie.AWS_ATHENA]:{type:Ie.AWS_ATHENA,displayName:"AWS Athena",icon:e4,status:Co.ACTIVE},[Ie.SNOWFLAKE]:{type:Ie.SNOWFLAKE,displayName:"Snowflake",icon:B$,status:Co.COMING_SOON},[Ie.DATABRICKS]:{type:Ie.DATABRICKS,displayName:"Databricks",icon:G$,status:Co.COMING_SOON},[Ie.AWS_REDSHIFT]:{type:Ie.AWS_REDSHIFT,displayName:"AWS Redshift",icon:q$,status:Co.COMING_SOON},[Ie.AZURE_SYNAPSE]:{type:Ie.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:Z$,status:Co.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function Tq({dataStorage:e,isLoading:t=!1}){if(t)return o.jsx("div",{className:"space-y-4",children:o.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,d)=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(as,{className:"h-5 w-24"}),o.jsx(as,{className:"h-6 w-40"})]},d))})});if(!e)return o.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:s,modifiedAt:l}=e;return o.jsx("div",{className:"space-y-2",children:o.jsxs("div",{className:"grid gap-2",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("div",{children:e.title}),o.jsx(Cr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:d}=Bi.getInfo(n);return o.jsxs(o.Fragment,{children:[o.jsx(d,{}),c]})})()})]}),o.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:o.jsx(Eq,{type:n,config:r})}),o.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(s))]}),o.jsxs("div",{children:[o.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(l))]})]})]})})}function jq(e){const t=e.split(".");return t.length!==2?(console.error("Invalid fully qualified name format:",e),null):{dataset:t[0],table:t[1]}}function _q(e,t,n){const r=encodeURIComponent(e),s=encodeURIComponent(t),l=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${s}!3s${l}`}function Nq(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function Aq(e,t){const n=jq(t);if(!n)return null;const{dataset:r,table:s}=n;return T4(e)?_q(e.config.projectId,r,s):j4(e)?Nq(e.config.region):null}function Dq(e,t){const n=Aq(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function Oq(e){return T4(e)?"Open table in Google BigQuery":j4(e)?"Open region in AWS Athena":"Open data in storage"}function _4(e){switch(e.type){case Ie.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case Ie.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);default:return!1}}const Mq=ln({accessKeyId:cn().min(1,"Access Key ID is required"),secretAccessKey:cn().min(1,"Secret Access Key is required")}),kq=ln({projectId:cn().min(1,"Project ID is required"),location:cn().min(1,"Location is required")}),Iq=ln({region:cn().min(1,"Region is required"),outputBucket:cn().min(1,"Output Bucket is required")}),N4=ln({title:cn().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),Lq=N4.extend({type:qs(Ie.GOOGLE_BIGQUERY),credentials:i4,config:kq}),Pq=N4.extend({type:qs(Ie.AWS_ATHENA),credentials:Mq,config:Iq}),Uq=o4("type",[Lq,Pq]),Fq=(e,t)=>{if(!e)return!1;switch(t){case Ie.GOOGLE_BIGQUERY:return C4(e);case Ie.AWS_ATHENA:return E4(e);default:return!1}},zq=(e,t)=>{if(!e)return!1;switch(t){case Ie.GOOGLE_BIGQUERY:return w4(e);case Ie.AWS_ATHENA:return R4(e);default:return!1}},Vq=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case Ie.GOOGLE_BIGQUERY:return pq(e);case Ie.AWS_ATHENA:return vq(e);default:return"Unsupported storage type"}},Hq=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case Ie.GOOGLE_BIGQUERY:return gq(e);case Ie.AWS_ATHENA:return yq(e);default:return"Unsupported storage type"}},A4=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"project.dataset.table";case Ie.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},$q=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"project.dataset.table_*";case Ie.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},D4=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case Ie.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},Bq=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case Ie.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var Nn=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(Nn||{});const Gq={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:""},qq=e=>Gq[e],Zq={[Nn.SUCCESS]:{icon:Yp,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"}},[Nn.ERROR]:{icon:bL,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"}},[Nn.WARNING]:{icon:Wp,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"}},[Nn.INFO]:{icon:Fr,colors:{solid:"bg-blue-500 text-white",subtle:"bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-400",outline:"border-blue-500 text-blue-700 dark:text-blue-400",ghost:"text-blue-500 dark:text-blue-400"}},[Nn.NEUTRAL]:{icon:Fr,colors:{solid:"bg-gray-500 text-white",subtle:"bg-gray-50 text-gray-700 dark:bg-gray-950 dark:text-gray-400",outline:"border-gray-500 text-gray-700 dark:text-gray-400",ghost:"text-muted-foreground"}}};function Gf({type:e=Nn.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:s}){const{icon:l,colors:c}=Zq[e],d=f=>{const m="inline-flex items-center gap-1 text-sm",g=qq(f),v=c[f];return J(m,g,v,s)};return o.jsxs("span",{className:d(t),children:[n&&o.jsx(l,{className:"h-4 w-4","data-testid":"icon"}),r]})}const O4=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,Kq=/[#&]gid=([0-9]+)/;function M4(e){return O4.test(e)}function Yq(e){const t=O4.exec(e);return t?t[2]:""}function Wq(e){const t=Kq.exec(e);return t?t[1]:"0"}function Qq(e){return{spreadsheetId:Yq(e),sheetId:parseInt(Wq(e),10)}}function x1(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function Xq(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 Mx(e){return Xq(e,"client_email")}const k4=p.createContext(void 0);var nt=(e=>(e.FETCH_REPORTS_START="FETCH_REPORTS_START",e.FETCH_REPORTS_SUCCESS="FETCH_REPORTS_SUCCESS",e.FETCH_REPORTS_ERROR="FETCH_REPORTS_ERROR",e.FETCH_DESTINATIONS_START="FETCH_DESTINATIONS_START",e.FETCH_DESTINATIONS_SUCCESS="FETCH_DESTINATIONS_SUCCESS",e.FETCH_DESTINATIONS_ERROR="FETCH_DESTINATIONS_ERROR",e.FETCH_REPORT_START="FETCH_REPORT_START",e.FETCH_REPORT_SUCCESS="FETCH_REPORT_SUCCESS",e.FETCH_REPORT_ERROR="FETCH_REPORT_ERROR",e.CLEAR_CURRENT_REPORT="CLEAR_CURRENT_REPORT",e.CREATE_REPORT_START="CREATE_REPORT_START",e.CREATE_REPORT_SUCCESS="CREATE_REPORT_SUCCESS",e.CREATE_REPORT_ERROR="CREATE_REPORT_ERROR",e.UPDATE_REPORT_START="UPDATE_REPORT_START",e.UPDATE_REPORT_SUCCESS="UPDATE_REPORT_SUCCESS",e.UPDATE_REPORT_ERROR="UPDATE_REPORT_ERROR",e.DELETE_REPORT_START="DELETE_REPORT_START",e.DELETE_REPORT_SUCCESS="DELETE_REPORT_SUCCESS",e.DELETE_REPORT_ERROR="DELETE_REPORT_ERROR",e.START_POLLING_REPORT="START_POLLING_REPORT",e.STOP_POLLING_REPORT="STOP_POLLING_REPORT",e.UPDATE_POLLED_REPORT="UPDATE_POLLED_REPORT",e.STOP_ALL_POLLING="STOP_ALL_POLLING",e.CLEAR_ERROR="CLEAR_ERROR",e))(nt||{}),ya=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e))(ya||{}),dn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(dn||{}),Un=(e=>(e.EDIT="edit",e.CREATE="create",e))(Un||{});const Jq={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function eZ(e,t){switch(t.type){case nt.FETCH_REPORTS_START:case nt.FETCH_REPORT_START:case nt.CREATE_REPORT_START:case nt.UPDATE_REPORT_START:case nt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case nt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case nt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case nt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case nt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case nt.UPDATE_REPORT_SUCCESS:return{...e,currentReport:t.payload,reports:e.reports.map(n=>n.id===t.payload.id?t.payload:n),loading:!1,error:null};case nt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case nt.FETCH_REPORTS_ERROR:case nt.FETCH_REPORT_ERROR:case nt.FETCH_DESTINATIONS_ERROR:case nt.CREATE_REPORT_ERROR:case nt.UPDATE_REPORT_ERROR:case nt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case nt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case nt.CLEAR_ERROR:return{...e,error:null};case nt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case nt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case nt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case nt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==dn.RUNNING||(n==null?void 0:n.lastRunStatus)!==dn.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 I4({children:e}){const[t,n]=p.useReducer(eZ,Jq);return o.jsx(k4.Provider,{value:{state:t,dispatch:n},children:e})}function tZ(){const e=p.useContext(k4);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class nZ extends Zl{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 bo=new nZ,rZ={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class aZ{constructor(){js(this,"pollingTimers",new Map);js(this,"pollCounters",new Map);js(this,"config",rZ)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const r=async()=>{try{const s=this.pollCounters.get(t)??0;this.pollCounters.set(t,s+1);const l=await bo.getReportById(t);if(n(l),l.lastRunStatus!==dn.RUNNING){this.stopPolling(t);return}const d=s<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,f=setTimeout(()=>{r()},d);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 _m=new aZ;var Mt=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e))(Mt||{}),ru=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e))(ru||{}),wl=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e))(wl||{});class sZ extends Zl{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 gl=new sZ,Ll={types:{[Mt.GOOGLE_SHEETS]:{type:Mt.GOOGLE_SHEETS,displayName:"Google Sheets",icon:t4,status:ru.ACTIVE},[Mt.LOOKER_STUDIO]:{type:Mt.LOOKER_STUDIO,displayName:"Looker Studio",icon:H$,status:ru.ACTIVE},[Mt.ODATA]:{type:Mt.ODATA,displayName:"OData",icon:$$,status:ru.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},oZ=ln({deploymentUrl:cn().optional(),destinationId:cn().optional(),destinationSecretKey:cn().optional()}),L4=ln({title:cn().min(1,"Title is required"),type:g1(Mt)}),iZ=L4.extend({type:qs(Mt.GOOGLE_SHEETS),credentials:i4}),lZ=L4.extend({type:qs(Mt.LOOKER_STUDIO),credentials:oZ.optional()}),cZ=o4("type",[iZ,lZ]),P4=p.createContext(void 0);var kt=(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))(kt||{});const uZ={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function dZ(e,t){switch(t.type){case kt.FETCH_DESTINATIONS_START:case kt.FETCH_DESTINATION_START:case kt.CREATE_DESTINATION_START:case kt.UPDATE_DESTINATION_START:case kt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case kt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case kt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case kt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case kt.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 kt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case kt.FETCH_DESTINATIONS_ERROR:case kt.FETCH_DESTINATION_ERROR:case kt.CREATE_DESTINATION_ERROR:case kt.UPDATE_DESTINATION_ERROR:case kt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case kt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case kt.CLEAR_ERROR:return{...e,error:null};default:return e}}function wg({children:e}){const[t,n]=p.useReducer(dZ,uZ);return o.jsx(P4.Provider,{value:{state:t,dispatch:n},children:e})}function fZ(){const e=p.useContext(P4);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class hZ{mapFromDto(t){let n="";try{t.credentials.type===wl.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:Mt.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:wl.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:Mt.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:wl.GOOGLE_SHEETS_CREDENTIALS}}}}class mZ{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:Mt.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:wl.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:Mt.LOOKER_STUDIO,credentials:{type:wl.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===wl.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const U4={getMapper(e){switch(e){case Mt.GOOGLE_SHEETS:return new hZ;case Mt.LOOKER_STUDIO:return new mZ;default:throw new Error(`Unknown destination type: ${e}`)}}};function Bc(e){return U4.getMapper(e.type).mapFromDto(e)}function Eg(){const{state:e,dispatch:t}=fZ(),n=p.useCallback(async()=>{t({type:kt.FETCH_DESTINATIONS_START});try{const g=(await gl.getDataDestinations()).map(Bc);t({type:kt.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(m){const g=m instanceof Error?m.message:"Failed to load destinations";t({type:kt.FETCH_DESTINATIONS_ERROR,payload:g}),Ue({event:"data_destination_error",category:"DataDestination",action:"ListError",label:g})}},[t]),r=p.useCallback(async m=>{try{const g=await gl.getDataDestinationById(m),v=Bc(g);t({type:kt.FETCH_DESTINATION_SUCCESS,payload:v})}catch(g){const v=g instanceof Error?g.message:"Failed to load destination";t({type:kt.FETCH_DESTINATION_ERROR,payload:v}),Ue({event:"data_destination_error",category:"DataDestination",action:"GetError",label:v})}},[t]),s=p.useCallback(async m=>{t({type:kt.CREATE_DESTINATION_START});try{const g=await gl.createDataDestination(m),v=Bc(g);return t({type:kt.CREATE_DESTINATION_SUCCESS,payload:v}),Ue({event:"data_destination_created",category:"DataDestination",action:"Create",label:v.type}),Ot.success("Destination created"),v}catch(g){const v=g instanceof Error?g.message:"Failed to create destination";return t({type:kt.CREATE_DESTINATION_ERROR,payload:v}),Ue({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:m.type}),null}},[t]),l=p.useCallback(async(m,g)=>{t({type:kt.UPDATE_DESTINATION_START});try{const v=await gl.updateDataDestination(m,g),x=Bc(v);return t({type:kt.UPDATE_DESTINATION_SUCCESS,payload:x}),Ue({event:"data_destination_updated",category:"DataDestination",action:"Update",label:x.type}),Ot.success("Destination updated"),x}catch(v){const x=v instanceof Error?v.message:"Failed to update destination";return t({type:kt.UPDATE_DESTINATION_ERROR,payload:x}),Ue({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:x}),null}},[t]),c=p.useCallback(async m=>{t({type:kt.DELETE_DESTINATION_START});try{await gl.deleteDataDestination(m),t({type:kt.DELETE_DESTINATION_SUCCESS,payload:m}),Ue({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),Ot.success("Destination deleted")}catch(g){const v=g instanceof Error?g.message:"Failed to delete destination";throw t({type:kt.DELETE_DESTINATION_ERROR,payload:v}),Ue({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:v}),g}},[t]),d=p.useCallback(()=>{t({type:kt.CLEAR_CURRENT_DESTINATION})},[t]),f=p.useCallback(async m=>{try{const g=await gl.rotateSecretKey(m),v=Bc(g);return Ue({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:v.type}),v}catch(g){const v=g instanceof Error?g.message:"Failed to rotate secret key";throw Ue({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",label:v}),console.error("Failed to rotate secret key:",g),g}},[]);return{dataDestinations:e.dataDestinations,currentDataDestination:e.currentDataDestination,loading:e.loading,error:e.error,fetchDataDestinations:n,getDataDestinationById:r,createDataDestination:s,updateDataDestination:l,deleteDataDestination:c,clearCurrentDataDestination:d,rotateSecretKey:f}}function pZ(e){const t=Ll.getInfo(e.type),n=t.status===ru.ACTIVE;return{destinationInfo:t,isVisible:n}}function gZ(){const{dataMart:e}=gs(),{fetchReportsByDataMartId:t}=Kl(),{dataDestinations:n,fetchDataDestinations:r,loading:s}=Eg(),[l,c]=p.useState(!0);return p.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(m){console.error("Failed to fetch Data Mart destinations or reports:",m)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:l||s}}function b1(e){return JSON.stringify(e,null,2)}class vZ{mapFromDto(t){if(t.type!==ya.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:ya.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class yZ{mapFromDto(t){if(t.type!==ya.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:ya.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const xZ={getMapper(e){switch(e){case ya.GOOGLE_SHEETS_CONFIG:return new vZ;case ya.LOOKER_STUDIO_CONFIG:return new yZ;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function bZ(e){return xZ.getMapper(e.type).mapFromDto(e)}function vl(e){const t=bZ(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:Bc(e.dataDestinationAccess),destinationConfig:t,lastRunDate:e.lastRunAt?new Date(e.lastRunAt):null,lastRunStatus:e.lastRunStatus,lastRunError:e.lastRunError,runsCount:e.runsCount,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function Kl(){const{state:e,dispatch:t}=tZ(),n=p.useCallback(async()=>{t({type:nt.FETCH_DESTINATIONS_START});try{const E=await gl.getDataDestinations();t({type:nt.FETCH_DESTINATIONS_SUCCESS,payload:E})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch destinations";t({type:nt.FETCH_DESTINATIONS_ERROR,payload:R}),Ue({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=p.useCallback(async()=>{t({type:nt.FETCH_REPORTS_START});try{const R=(await bo.getReportsByProject()).map(vl);t({type:nt.FETCH_REPORTS_SUCCESS,payload:R})}catch(E){const R=E instanceof Error?E.message:"Failed to fetch reports";t({type:nt.FETCH_REPORTS_ERROR,payload:R}),Ue({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),s=p.useCallback(async(E,R)=>{R!=null&&R.silent||t({type:nt.FETCH_REPORTS_START});try{const _=(await bo.getReportsByDataMartId(E,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(vl);t({type:nt.FETCH_REPORTS_SUCCESS,payload:_})}catch(T){const _=T instanceof Error?T.message:"Failed to fetch reports";t({type:nt.FETCH_REPORTS_ERROR,payload:_}),Ue({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),l=p.useCallback(async E=>{t({type:nt.FETCH_REPORT_START});try{const R=await bo.getReportById(E),T=vl(R);t({type:nt.FETCH_REPORT_SUCCESS,payload:T})}catch(R){const T=R instanceof Error?R.message:"Failed to fetch report";t({type:nt.FETCH_REPORT_ERROR,payload:T}),Ue({event:"report_error",category:"Report",action:"GetError",label:T})}},[t]),c=p.useCallback(async E=>{t({type:nt.CREATE_REPORT_START});try{const R=await bo.createReport(E),T=vl(R);return t({type:nt.CREATE_REPORT_SUCCESS,payload:T}),Ue({event:"report_created",category:"Report",action:"Create",label:T.dataDestination.type}),Ot.success("Report created"),T}catch(R){const T=R instanceof Error?R.message:"Failed to create report";return t({type:nt.CREATE_REPORT_ERROR,payload:T}),Ue({event:"report_error",category:"Report",action:"CreateError",label:E.destinationConfig.type}),null}},[t]),d=p.useCallback(async(E,R)=>{t({type:nt.UPDATE_REPORT_START});try{const T=await bo.updateReport(E,R),_=vl(T);return t({type:nt.UPDATE_REPORT_SUCCESS,payload:_}),Ue({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type}),Ot.success("Report updated"),_}catch(T){const _=T instanceof Error?T.message:"Failed to update report";return t({type:nt.UPDATE_REPORT_ERROR,payload:_}),Ue({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=p.useCallback(async E=>{t({type:nt.DELETE_REPORT_START});try{await bo.deleteReport(E),t({type:nt.DELETE_REPORT_SUCCESS,payload:E}),Ue({event:"report_deleted",category:"Report",action:"Delete"}),Ot.success("Report deleted")}catch(R){const T=R instanceof Error?R.message:"Failed to delete report";t({type:nt.DELETE_REPORT_ERROR,payload:T}),Ue({event:"report_error",category:"Report",action:"DeleteError",label:T})}},[t]),m=p.useCallback(()=>{t({type:nt.CLEAR_CURRENT_REPORT})},[t]),g=p.useCallback(()=>{t({type:nt.CLEAR_ERROR})},[t]),v=p.useCallback(E=>{_m.stopPolling(E),t({type:nt.STOP_POLLING_REPORT,payload:E})},[t]),x=p.useCallback(E=>{e.polledReportIds.includes(E)&&v(E),t({type:nt.START_POLLING_REPORT,payload:E}),_m.startPolling(E,R=>{const T=vl(R);t({type:nt.UPDATE_POLLED_REPORT,payload:T})})},[t,e.polledReportIds,v]),b=p.useCallback(()=>{_m.stopAllPolling(),t({type:nt.STOP_ALL_POLLING})},[t]),w=p.useCallback(E=>{_m.setConfig(E)},[]),C=p.useCallback(async E=>{try{v(E),await bo.runReport(E),await l(E),x(E),Ue({event:"report_run_started",category:"Report",action:"Run",label:E}),Ot.success("Report run started")}catch(R){const T=R instanceof Error?R.message:"Failed to run report";Ue({event:"report_error",category:"Report",action:"RunError",label:T}),console.error("Failed to run report:",R)}},[l,x,v]);return p.useEffect(()=>()=>{b()},[b]),{destinations:e.destinations,reports:e.reports,currentReport:e.currentReport,loading:e.loading,error:e.error,polledReportIds:e.polledReportIds,fetchDestinations:n,fetchReports:r,fetchReportsByDataMartId:s,fetchReportById:l,createReport:c,updateReport:d,deleteReport:f,runReport:C,startPollingReport:x,stopPollingReport:v,stopAllPolling:b,setPollingConfig:w,clearCurrentReport:m,clearError:g}}dn.SUCCESS+"",dn.SUCCESS,dn.RUNNING+"",dn.RUNNING,dn.ERROR+"",dn.ERROR,dn.CANCELLED+"",dn.CANCELLED;var kx,Rg="HoverCard",[F4]=kr(Rg,[Gs]),Tg=Gs(),[SZ,jg]=F4(Rg),z4=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:s,onOpenChange:l,openDelay:c=700,closeDelay:d=300}=e,f=Tg(t),m=p.useRef(0),g=p.useRef(0),v=p.useRef(!1),x=p.useRef(!1),[b,w]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:Rg}),C=p.useCallback(()=>{clearTimeout(g.current),m.current=window.setTimeout(()=>w(!0),c)},[c,w]),E=p.useCallback(()=>{clearTimeout(m.current),!v.current&&!x.current&&(g.current=window.setTimeout(()=>w(!1),d))},[d,w]),R=p.useCallback(()=>w(!1),[w]);return p.useEffect(()=>()=>{clearTimeout(m.current),clearTimeout(g.current)},[]),o.jsx(SZ,{scope:t,open:b,onOpenChange:w,onOpen:C,onClose:E,onDismiss:R,hasSelectionRef:v,isPointerDownOnContentRef:x,children:o.jsx(Ru,{...f,children:n})})};z4.displayName=Rg;var V4="HoverCardTrigger",H4=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=jg(V4,n),l=Tg(n);return o.jsx(Tu,{asChild:!0,...l,children:o.jsx(We.a,{"data-state":s.open?"open":"closed",...r,ref:t,onPointerEnter:Re(e.onPointerEnter,Ap(s.onOpen)),onPointerLeave:Re(e.onPointerLeave,Ap(s.onClose)),onFocus:Re(e.onFocus,s.onOpen),onBlur:Re(e.onBlur,s.onClose),onTouchStart:Re(e.onTouchStart,c=>c.preventDefault())})})});H4.displayName=V4;var S1="HoverCardPortal",[CZ,wZ]=F4(S1,{forceMount:void 0}),$4=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:s}=e,l=jg(S1,t);return o.jsx(CZ,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};$4.displayName=S1;var Np="HoverCardContent",B4=p.forwardRef((e,t)=>{const n=wZ(Np,e.__scopeHoverCard),{forceMount:r=n.forceMount,...s}=e,l=jg(Np,e.__scopeHoverCard);return o.jsx(Er,{present:r||l.open,children:o.jsx(EZ,{"data-state":l.open?"open":"closed",...s,onPointerEnter:Re(e.onPointerEnter,Ap(l.onOpen)),onPointerLeave:Re(e.onPointerLeave,Ap(l.onClose)),ref:t})})});B4.displayName=Np;var EZ=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:l,onInteractOutside:c,...d}=e,f=jg(Np,n),m=Tg(n),g=p.useRef(null),v=pt(t,g),[x,b]=p.useState(!1);return p.useEffect(()=>{if(x){const w=document.body;return kx=w.style.userSelect||w.style.webkitUserSelect,w.style.userSelect="none",w.style.webkitUserSelect="none",()=>{w.style.userSelect=kx,w.style.webkitUserSelect=kx}}},[x]),p.useEffect(()=>{if(g.current){const w=()=>{b(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var E;((E=document.getSelection())==null?void 0:E.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",w),()=>{document.removeEventListener("pointerup",w),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),p.useEffect(()=>{g.current&&jZ(g.current).forEach(C=>C.setAttribute("tabindex","-1"))}),o.jsx($l,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:Re(l,w=>{w.preventDefault()}),onDismiss:f.onDismiss,children:o.jsx(Df,{...m,...d,onPointerDown:Re(d.onPointerDown,w=>{w.currentTarget.contains(w.target)&&b(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:v,style:{...d.style,userSelect:x?"text":void 0,WebkitUserSelect:x?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})}),RZ="HoverCardArrow",TZ=p.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,s=Tg(n);return o.jsx(Of,{...s,...r,ref:t})});TZ.displayName=RZ;function Ap(e){return t=>t.pointerType==="touch"?void 0:e()}function jZ(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 _Z=z4,NZ=H4,AZ=$4,DZ=B4;const C1=({...e})=>o.jsx(_Z,{"data-slot":"hover-card",...e});C1.displayName="HoverCard";const w1=p.forwardRef(({...e},t)=>o.jsx(NZ,{"data-slot":"hover-card-trigger",ref:t,...e}));w1.displayName="HoverCardTrigger";const E1=p.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...s},l)=>{const c=d=>{d.stopPropagation(),r&&r(d)};return o.jsx(AZ,{children:o.jsx(DZ,{ref:l,align:t,sideOffset:n,className:J("bg-popover text-popover-foreground z-50 w-110 rounded-lg border px-6 py-4 shadow-md outline-none","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2","data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),onClick:c,...s})})});E1.displayName="HoverCardContent";const R1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("border-border flex gap-4 border-b pb-4",e),...t}));R1.displayName="HoverCardHeader";const T1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));T1.displayName="HoverCardHeaderIcon";const j1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("flex flex-col space-y-1",e),...t}));j1.displayName="HoverCardHeaderText";const _1=p.forwardRef(({className:e,...t},n)=>o.jsx("h2",{ref:n,className:J("text-md pt-1 leading-snug font-semibold",e),...t}));_1.displayName="HoverCardHeaderTitle";const N1=p.forwardRef(({className:e,...t},n)=>o.jsx("p",{ref:n,className:J("text-muted-foreground text-sm",e),...t}));N1.displayName="HoverCardHeaderDescription";const A1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("flex flex-col",e),...t}));A1.displayName="HoverCardBody";const bi=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("border-border flex items-center justify-between border-b py-4",e),...t}));bi.displayName="HoverCardItem";const Si=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:J("text-muted-foreground text-sm",e),...t}));Si.displayName="HoverCardItemLabel";const Ci=p.forwardRef(({className:e,...t},n)=>o.jsx("span",{ref:n,className:J("text-sm",e),...t}));Ci.displayName="HoverCardItemValue";const D1=p.forwardRef(({className:e,...t},n)=>o.jsx("div",{ref:n,className:J("pt-4 pb-2",e),...t}));D1.displayName="HoverCardFooter";function _g(e){return e.type===ya.GOOGLE_SHEETS_CONFIG}function G4(e){return e.type===ya.LOOKER_STUDIO_CONFIG}function Pl({date:e,className:t=""}){const n=p.useMemo(()=>{const r=new Date,s=e.getTime()-r.getTime(),l=Math.abs(s),c=s<0,d=Math.floor(l/(1e3*60)),f=Math.floor(l/(1e3*60*60)),m=Math.floor(l/(1e3*60*60*24)),g=Math.floor(m/7),v=Math.floor(m/30),x=Math.floor(m/365),b=C=>C.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),w=C=>C.toLocaleDateString("en-US",{weekday:"long"});if(d<1)return c?"Just now":"In a moment";if(d<60)return c?d===1?"1 minute ago":`${d} minutes ago`:d===1?"In 1 minute":`In ${d} minutes`;if(f<24)return c?f===1?"1 hour ago":`${f} hours ago`:f===1?"In 1 hour":`In ${f} hours`;if(m===1){const C=b(e);return c?`Yesterday at ${C}`:`Tomorrow at ${C}`}if(m<7){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`This ${C} at ${E}`}if(m<14){const C=w(e),E=b(e);return c?`Last ${C} at ${E}`:`Next ${C} at ${E}`}return g<4?c?g===2?"2 weeks ago":"3 weeks ago":g===2?"In 2 weeks":"In 3 weeks":v<12?c?v===1?"1 month ago":`${v} months ago`:v===1?"In 1 month":`In ${v} months`:c?x===1?"1 year ago":`${x} years ago`:x===1?"In 1 year":`In ${x} years`},[e]);return o.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const OZ=()=>{const e=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=p.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},MZ=_e.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:s}=OZ(),l=p.useMemo(()=>t.lastRunStatus?{statusType:LZ(t.lastRunStatus),statusText:UZ(t.lastRunStatus)}:null,[t.lastRunStatus]),c=p.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:s.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,s]),d=p.useMemo(()=>_g(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),f=p.useCallback(()=>{if(!d.isGoogleSheets||!d.spreadsheetId||!d.sheetId)return;const m=x1(d.spreadsheetId,d.sheetId);window.open(m,"_blank","noopener,noreferrer")},[d]);return o.jsxs(C1,{children:[o.jsx(w1,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(E1,{children:[o.jsxs(R1,{children:[o.jsx(T1,{children:o.jsx(t4,{size:20})}),o.jsxs(j1,{children:[o.jsx(_1,{children:t.title||"Unnamed Report"}),o.jsxs(N1,{children:["Last modified ",o.jsx(Pl,{date:new Date(t.modifiedAt)})]})]})]}),o.jsxs(A1,{children:[o.jsxs(bi,{children:[o.jsx(Si,{children:"Last run status:"}),o.jsx(Ci,{children:l?o.jsx(Gf,{type:l.statusType,variant:"ghost",children:l.statusText}):"Not run yet"})]}),o.jsxs(bi,{children:[o.jsx(Si,{children:"Last run date:"}),o.jsx(Ci,{children:t.lastRunDate?o.jsx(Pl,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&o.jsxs(bi,{children:[o.jsx(Si,{children:"Error message:"}),o.jsx(Ci,{children:t.lastRunError})]}),o.jsxs(bi,{children:[o.jsx(Si,{children:"Total runs:"}),o.jsxs(Ci,{children:[t.runsCount||0," runs",c.createdAt&&o.jsxs(o.Fragment,{children:[", since ",c.createdAt]})]})]})]}),d.isGoogleSheets&&o.jsx(D1,{children:o.jsxs(be,{className:"w-full",variant:"default",onClick:f,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",o.jsx(_l,{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)),kZ=e=>{switch(e){case dr.DRAFT:return Nn.NEUTRAL;case dr.PUBLISHED:return Nn.SUCCESS;default:return Nn.NEUTRAL}},IZ=e=>{switch(e){case sr.SUCCESS:return Nn.SUCCESS;case sr.RUNNING:return Nn.INFO;case sr.FAILED:case sr.CANCELLED:case sr.INTERRUPTED:return Nn.ERROR;default:return Nn.NEUTRAL}},LZ=e=>{switch(e){case dn.SUCCESS:return Nn.SUCCESS;case dn.RUNNING:return Nn.INFO;case dn.ERROR:return Nn.ERROR;default:return Nn.NEUTRAL}},PZ=e=>{switch(e){case sr.SUCCESS:return"Success";case sr.RUNNING:return"Running";case sr.FAILED:return"Failed";case sr.CANCELLED:return"Cancelled";case sr.INTERRUPTED:return"Interrupted";case sr.PENDING:return"Pending";default:return"Unknown"}},UZ=e=>{switch(e){case dn.SUCCESS:return"Success";case dn.RUNNING:return"Running";case dn.ERROR:return"Failed";default:return"Unknown"}},q4=e=>ln({fullyQualifiedName:cn().min(1,"Fully qualified name is required").refine(t=>Fq(t,e),t=>({message:Vq(t,e)}))}),FZ=e=>ln({pattern:cn().min(1,"Table pattern is required").refine(t=>zq(t,e),t=>({message:Hq(t,e)}))}),zZ=e=>{const t=[];return e.status.code===dr.PUBLISHED&&t.push(Qm.ALREADY_PUBLISHED),_4(e.storage)||t.push(Qm.INVALID_STORAGE),e.definition||t.push(Qm.MISSING_DEFINITION),t},VZ=e=>e.map(t=>mq[t]);function HZ(e){return e.map(t=>({id:t.id,title:t.title,status:S4.getInfo(t.status),storageType:t.storage.type,storageTitle:t.storage.title||void 0,definitionType:t.definitionType,triggersCount:t.triggersCount,reportsCount:t.reportsCount,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),definition:t.definition}))}function Z4(){const{state:e,dispatch:t}=fq(),n=p.useCallback(async()=>{t({type:"SET_LOADING"});try{const l=await sn.getDataMarts(),c=HZ(l);t({type:"SET_ITEMS",payload:c})}catch(l){t({type:"SET_ERROR",payload:l instanceof Error?l.message:"Failed to load data marts"})}},[t]),r=p.useCallback(async l=>{t({type:"SET_LOADING"});try{await sn.deleteDataMart(l),Ue({event:"data_mart_deleted",category:"DataMart",action:"Delete"})}catch(c){const d=c instanceof Error?c.message:"Failed to delete data mart";throw t({type:"SET_ERROR",payload:d}),Ue({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:d}),c}},[t]),s=p.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:s,deleteDataMart:r}}/**
|
|
667
|
-
* table-core
|
|
668
|
-
*
|
|
669
|
-
* Copyright (c) TanStack
|
|
670
|
-
*
|
|
671
|
-
* This source code is licensed under the MIT license found in the
|
|
672
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
673
|
-
*
|
|
674
|
-
* @license MIT
|
|
675
|
-
*/function wi(e,t){return typeof e=="function"?e(t):e}function xa(e,t){return n=>{t.setState(r=>({...r,[e]:wi(n,r[e])}))}}function Ng(e){return e instanceof Function}function $Z(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function BZ(e,t){const n=[],r=s=>{s.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function rt(e,t,n){let r=[],s;return l=>{let c;n.key&&n.debug&&(c=Date.now());const d=e(l);if(!(d.length!==r.length||d.some((g,v)=>r[v]!==g)))return s;r=d;let m;if(n.key&&n.debug&&(m=Date.now()),s=t(...d),n==null||n.onChange==null||n.onChange(s),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-c)*100)/100,v=Math.round((Date.now()-m)*100)/100,x=v/16,b=(w,C)=>{for(w=String(w);w.length<C;)w=" "+w;return w};console.info(`%c⏱ ${b(v,5)} /${b(g,5)} ms`,`
|
|
676
|
-
font-size: .6rem;
|
|
677
|
-
font-weight: bold;
|
|
678
|
-
color: hsl(${Math.max(0,Math.min(120-120*x,120))}deg 100% 31%);`,n==null?void 0:n.key)}return s}}function at(e,t,n,r){return{debug:()=>{var s;return(s=e==null?void 0:e.debugAll)!=null?s:e[t]},key:!1,onChange:r}}function GZ(e,t,n,r){const s=()=>{var c;return(c=l.getValue())!=null?c:e.options.renderFallbackValue},l={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:s,getContext:rt(()=>[e,n,t,l],(c,d,f,m)=>({table:c,column:d,row:f,cell:m,getValue:m.getValue,renderValue:m.renderValue}),at(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function qZ(e,t,n,r){var s,l;const d={...e._getDefaultColumnDef(),...t},f=d.accessorKey;let m=(s=(l=d.id)!=null?l:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?s:typeof d.header=="string"?d.header:void 0,g;if(d.accessorFn?g=d.accessorFn:f&&(f.includes(".")?g=x=>{let b=x;for(const C of f.split(".")){var w;b=(w=b)==null?void 0:w[C]}return b}:g=x=>x[d.accessorKey]),!m)throw new Error;let v={id:`${String(m)}`,accessorFn:g,parent:r,depth:n,columnDef:d,columns:[],getFlatColumns:rt(()=>[!0],()=>{var x;return[v,...(x=v.columns)==null?void 0:x.flatMap(b=>b.getFlatColumns())]},at(e.options,"debugColumns")),getLeafColumns:rt(()=>[e._getOrderColumnsFn()],x=>{var b;if((b=v.columns)!=null&&b.length){let w=v.columns.flatMap(C=>C.getLeafColumns());return x(w)}return[v]},at(e.options,"debugColumns"))};for(const x of e._features)x.createColumn==null||x.createColumn(v,e);return v}const Ar="debugHeaders";function xT(e,t,n){var r;let l={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const c=[],d=f=>{f.subHeaders&&f.subHeaders.length&&f.subHeaders.map(d),c.push(f)};return d(l),c},getContext:()=>({table:e,header:l,column:t})};return e._features.forEach(c=>{c.createHeader==null||c.createHeader(l,e)}),l}const ZZ={createTable:e=>{e.getHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>{var l,c;const d=(l=r==null?void 0:r.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?l:[],f=(c=s==null?void 0:s.map(v=>n.find(x=>x.id===v)).filter(Boolean))!=null?c:[],m=n.filter(v=>!(r!=null&&r.includes(v.id))&&!(s!=null&&s.includes(v.id)));return Nm(t,[...d,...m,...f],e)},at(e.options,Ar)),e.getCenterHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,s)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(s!=null&&s.includes(l.id))),Nm(t,n,e,"center")),at(e.options,Ar)),e.getLeftHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Nm(t,l,e,"left")},at(e.options,Ar)),e.getRightHeaderGroups=rt(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var s;const l=(s=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?s:[];return Nm(t,l,e,"right")},at(e.options,Ar)),e.getFooterGroups=rt(()=>[e.getHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getLeftFooterGroups=rt(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getCenterFooterGroups=rt(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getRightFooterGroups=rt(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),at(e.options,Ar)),e.getFlatHeaders=rt(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getLeftFlatHeaders=rt(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getCenterFlatHeaders=rt(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getRightFlatHeaders=rt(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),at(e.options,Ar)),e.getCenterLeafHeaders=rt(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getLeftLeafHeaders=rt(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getRightLeafHeaders=rt(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),at(e.options,Ar)),e.getLeafHeaders=rt(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var s,l,c,d,f,m;return[...(s=(l=t[0])==null?void 0:l.headers)!=null?s:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[],...(f=(m=r[0])==null?void 0:m.headers)!=null?f:[]].map(g=>g.getLeafHeaders()).flat()},at(e.options,Ar))}};function Nm(e,t,n,r){var s,l;let c=0;const d=function(x,b){b===void 0&&(b=1),c=Math.max(c,b),x.filter(w=>w.getIsVisible()).forEach(w=>{var C;(C=w.columns)!=null&&C.length&&d(w.columns,b+1)},0)};d(e);let f=[];const m=(x,b)=>{const w={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},C=[];x.forEach(E=>{const R=[...C].reverse()[0],T=E.column.depth===w.depth;let _,O=!1;if(T&&E.column.parent?_=E.column.parent:(_=E.column,O=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(E);else{const A=xT(n,_,{id:[r,b,_.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:O,placeholderId:O?`${C.filter(D=>D.column===_).length}`:void 0,depth:b,index:C.length});A.subHeaders.push(E),C.push(A)}w.headers.push(E),E.headerGroup=w}),f.push(w),b>0&&m(C,b-1)},g=t.map((x,b)=>xT(n,x,{depth:c,index:b}));m(g,c-1),f.reverse();const v=x=>x.filter(w=>w.column.getIsVisible()).map(w=>{let C=0,E=0,R=[0];w.subHeaders&&w.subHeaders.length?(R=[],v(w.subHeaders).forEach(_=>{let{colSpan:O,rowSpan:A}=_;C+=O,R.push(A)})):C=1;const T=Math.min(...R);return E=E+T,w.colSpan=C,w.rowSpan=E,{colSpan:C,rowSpan:E}});return v((s=(l=f[0])==null?void 0:l.headers)!=null?s:[]),f}const O1=(e,t,n,r,s,l,c)=>{let d={id:t,index:r,original:n,depth:s,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(d._valuesCache.hasOwnProperty(f))return d._valuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return d._valuesCache[f]=m.accessorFn(d.original,r),d._valuesCache[f]},getUniqueValues:f=>{if(d._uniqueValuesCache.hasOwnProperty(f))return d._uniqueValuesCache[f];const m=e.getColumn(f);if(m!=null&&m.accessorFn)return m.columnDef.getUniqueValues?(d._uniqueValuesCache[f]=m.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[f]):(d._uniqueValuesCache[f]=[d.getValue(f)],d._uniqueValuesCache[f])},renderValue:f=>{var m;return(m=d.getValue(f))!=null?m:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>BZ(d.subRows,f=>f.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let f=[],m=d;for(;;){const g=m.getParentRow();if(!g)break;f.push(g),m=g}return f.reverse()},getAllCells:rt(()=>[e.getAllLeafColumns()],f=>f.map(m=>GZ(e,d,m,m.id)),at(e.options,"debugRows")),_getAllCellsByColumnId:rt(()=>[d.getAllCells()],f=>f.reduce((m,g)=>(m[g.column.id]=g,m),{}),at(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const m=e._features[f];m==null||m.createRow==null||m.createRow(d,e)}return d},KZ={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()}}},K4=(e,t,n)=>{var r,s;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((s=e.getValue(t))==null||(s=s.toString())==null||(s=s.toLowerCase())==null)&&s.includes(l))};K4.autoRemove=e=>cs(e);const Y4=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};Y4.autoRemove=e=>cs(e);const W4=(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())};W4.autoRemove=e=>cs(e);const Q4=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};Q4.autoRemove=e=>cs(e);const X4=(e,t,n)=>!n.some(r=>{var s;return!((s=e.getValue(t))!=null&&s.includes(r))});X4.autoRemove=e=>cs(e)||!(e!=null&&e.length);const J4=(e,t,n)=>n.some(r=>{var s;return(s=e.getValue(t))==null?void 0:s.includes(r)});J4.autoRemove=e=>cs(e)||!(e!=null&&e.length);const e3=(e,t,n)=>e.getValue(t)===n;e3.autoRemove=e=>cs(e);const t3=(e,t,n)=>e.getValue(t)==n;t3.autoRemove=e=>cs(e);const M1=(e,t,n)=>{let[r,s]=n;const l=e.getValue(t);return l>=r&&l<=s};M1.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,s=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(s)?1/0:s;if(l>c){const d=l;l=c,c=d}return[l,c]};M1.autoRemove=e=>cs(e)||cs(e[0])&&cs(e[1]);const So={includesString:K4,includesStringSensitive:Y4,equalsString:W4,arrIncludes:Q4,arrIncludesAll:X4,arrIncludesSome:J4,equals:e3,weakEquals:t3,inNumberRange:M1};function cs(e){return e==null||e===""}const YZ={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:xa("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"?So.includesString:typeof r=="number"?So.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?So.equals:Array.isArray(r)?So.arrIncludes:So.weakEquals},e.getFilterFn=()=>{var n,r;return Ng(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:So[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,s;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const s=e.getFilterFn(),l=r==null?void 0:r.find(g=>g.id===e.id),c=wi(n,l?l.value:void 0);if(bT(s,c,e)){var d;return(d=r==null?void 0:r.filter(g=>g.id!==e.id))!=null?d:[]}const f={id:e.id,value:c};if(l){var m;return(m=r==null?void 0:r.map(g=>g.id===e.id?f:g))!=null?m:[]}return r!=null&&r.length?[...r,f]:[f]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=s=>{var l;return(l=wi(t,s))==null?void 0:l.filter(c=>{const d=n.find(f=>f.id===c.id);if(d){const f=d.getFilterFn();if(bT(f,c.value,d))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function bT(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const WZ=(e,t,n)=>n.reduce((r,s)=>{const l=s.getValue(e);return r+(typeof l=="number"?l:0)},0),QZ=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},XZ=(e,t,n)=>{let r;return n.forEach(s=>{const l=s.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},JZ=(e,t,n)=>{let r,s;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=s=c):(r>c&&(r=c),s<c&&(s=c)))}),[r,s]},eK=(e,t)=>{let n=0,r=0;if(t.forEach(s=>{let l=s.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},tK=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!$Z(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),s=n.sort((l,c)=>l-c);return n.length%2!==0?s[r]:(s[r-1]+s[r])/2},nK=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),rK=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,aK=(e,t)=>t.length,Ix={sum:WZ,min:QZ,max:XZ,extent:JZ,mean:eK,median:tK,unique:nK,uniqueCount:rK,count:aK},sK={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:xa("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 Ix.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Ix.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Ng(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:Ix[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 oK(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(l=>!t.includes(l.id));return n==="remove"?r:[...t.map(l=>e.find(c=>c.id===l)).filter(Boolean),...r]}const iK={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:xa("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=rt(n=>[Wd(t,n)],n=>n.findIndex(r=>r.id===e.id),at(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Wd(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const s=Wd(t,n);return((r=s[s.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=rt(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>s=>{let l=[];if(!(t!=null&&t.length))l=s;else{const c=[...t],d=[...s];for(;d.length&&c.length;){const f=c.shift(),m=d.findIndex(g=>g.id===f);m>-1&&l.push(d.splice(m,1)[0])}l=[...l,...d]}return oK(l,n,r)},at(e.options,"debugTable"))}},Lx=()=>({left:[],right:[]}),lK={getInitialState:e=>({columnPinning:Lx(),...e}),getDefaultOptions:e=>({onColumnPinningChange:xa("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(s=>s.id).filter(Boolean);t.setColumnPinning(s=>{var l,c;if(n==="right"){var d,f;return{left:((d=s==null?void 0:s.left)!=null?d:[]).filter(v=>!(r!=null&&r.includes(v))),right:[...((f=s==null?void 0:s.right)!=null?f:[]).filter(v=>!(r!=null&&r.includes(v))),...r]}}if(n==="left"){var m,g;return{left:[...((m=s==null?void 0:s.left)!=null?m:[]).filter(v=>!(r!=null&&r.includes(v))),...r],right:((g=s==null?void 0:s.right)!=null?g:[]).filter(v=>!(r!=null&&r.includes(v)))}}return{left:((l=s==null?void 0:s.left)!=null?l:[]).filter(v=>!(r!=null&&r.includes(v))),right:((c=s==null?void 0:s.right)!=null?c:[]).filter(v=>!(r!=null&&r.includes(v)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var s,l,c;return((s=r.columnDef.enablePinning)!=null?s:!0)&&((l=(c=t.options.enableColumnPinning)!=null?c:t.options.enablePinning)!=null?l:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(d=>d.id),{left:r,right:s}=t.getState().columnPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();return s?(n=(r=t.getState().columnPinning)==null||(r=r[s])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,s)=>{const l=[...r??[],...s??[]];return n.filter(c=>!l.includes(c.column.id))},at(t.options,"debugRows")),e.getLeftVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"left"})),at(t.options,"debugRows")),e.getRightVisibleCells=rt(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(l=>n.find(c=>c.column.id===l)).filter(Boolean).map(l=>({...l,position:"right"})),at(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Lx():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Lx())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var s,l;return!!((s=r.left)!=null&&s.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getRightLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(s=>s.id===r)).filter(Boolean),at(e.options,"debugColumns")),e.getCenterLeafColumns=rt(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const s=[...n??[],...r??[]];return t.filter(l=>!s.includes(l.id))},at(e.options,"debugColumns"))}};function cK(e){return e||(typeof document<"u"?document:null)}const Am={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Px=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),uK={getDefaultColumnDef:()=>Am,getInitialState:e=>({columnSizing:{},columnSizingInfo:Px(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:xa("columnSizing",e),onColumnSizingInfoChange:xa("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,s;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Am.minSize,(r=l??e.columnDef.size)!=null?r:Am.size),(s=e.columnDef.maxSize)!=null?s:Am.maxSize)},e.getStart=rt(n=>[n,Wd(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((s,l)=>s+l.getSize(),0),at(t.options,"debugColumns")),e.getAfter=rt(n=>[n,Wd(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((s,l)=>s+l.getSize(),0),at(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...s}=n;return s})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=s=>{if(s.subHeaders.length)s.subHeaders.forEach(r);else{var l;n+=(l=s.column.getSize())!=null?l:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),s=r==null?void 0:r.getCanResize();return l=>{if(!r||!s||(l.persist==null||l.persist(),Ux(l)&&l.touches&&l.touches.length>1))return;const c=e.getSize(),d=e?e.getLeafHeaders().map(R=>[R.column.id,R.column.getSize()]):[[r.id,r.getSize()]],f=Ux(l)?Math.round(l.touches[0].clientX):l.clientX,m={},g=(R,T)=>{typeof T=="number"&&(t.setColumnSizingInfo(_=>{var O,A;const D=t.options.columnResizeDirection==="rtl"?-1:1,j=(T-((O=_==null?void 0:_.startOffset)!=null?O:0))*D,M=Math.max(j/((A=_==null?void 0:_.startSize)!=null?A:0),-.999999);return _.columnSizingStart.forEach(z=>{let[Z,K]=z;m[Z]=Math.round(Math.max(K+K*M,0)*100)/100}),{..._,deltaOffset:j,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...m})))},v=R=>g("move",R),x=R=>{g("end",R),t.setColumnSizingInfo(T=>({...T,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=cK(n),w={moveHandler:R=>v(R.clientX),upHandler:R=>{b==null||b.removeEventListener("mousemove",w.moveHandler),b==null||b.removeEventListener("mouseup",w.upHandler),x(R.clientX)}},C={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),v(R.touches[0].clientX),!1),upHandler:R=>{var T;b==null||b.removeEventListener("touchmove",C.moveHandler),b==null||b.removeEventListener("touchend",C.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),x((T=R.touches[0])==null?void 0:T.clientX)}},E=dK()?{passive:!1}:!1;Ux(l)?(b==null||b.addEventListener("touchmove",C.moveHandler,E),b==null||b.addEventListener("touchend",C.upHandler,E)):(b==null||b.addEventListener("mousemove",w.moveHandler,E),b==null||b.addEventListener("mouseup",w.upHandler,E)),t.setColumnSizingInfo(R=>({...R,startOffset:f,startSize:c,deltaOffset:0,deltaPercentage:0,columnSizingStart:d,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Px():(n=e.initialState.columnSizingInfo)!=null?n:Px())},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 Dm=null;function dK(){if(typeof Dm=="boolean")return Dm;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 Dm=e,Dm}function Ux(e){return e.type==="touchstart"}const fK={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:xa("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const s=e.columns;return(n=s.length?s.some(l=>l.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=rt(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),at(t.options,"debugRows")),e.getVisibleCells=rt(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,s)=>[...n,...r,...s],at(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>rt(()=>[r(),r().filter(s=>s.getIsVisible()).map(s=>s.id).join("_")],s=>s.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),at(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((s,l)=>({...s,[l.id]:n||!(l.getCanHide!=null&&l.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Wd(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const hK={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()}}},mK={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:xa("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,s,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((s=t.options.enableFilters)!=null?s:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>So.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Ng(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:So[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},pK={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:xa("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var s,l;e.setExpanded(r?{}:(s=(l=e.initialState)==null?void 0:l.expanded)!=null?s:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(s=>!s.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(l=>{const c=l.split(".");r=Math.max(r,c.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var s;const l=r===!0?!0:!!(r!=null&&r[e.id]);let c={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(d=>{c[d]=!0}):c=r,n=(s=n)!=null?s:!l,!l&&n)return{...c,[e.id]:!0};if(l&&!n){const{[e.id]:d,...f}=c;return f}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=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()}}}},F0=0,z0=10,Fx=()=>({pageIndex:F0,pageSize:z0}),gK={getInitialState:e=>({...e,pagination:{...Fx(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:xa("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,s;if(!t){e._queue(()=>{t=!0});return}if((r=(s=e.options.autoResetAll)!=null?s:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const s=l=>wi(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(s)},e.resetPagination=r=>{var s;e.setPagination(r?Fx():(s=e.initialState.pagination)!=null?s:Fx())},e.setPageIndex=r=>{e.setPagination(s=>{let l=wi(r,s.pageIndex);const c=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return l=Math.max(0,Math.min(l,c)),{...s,pageIndex:l}})},e.resetPageIndex=r=>{var s,l;e.setPageIndex(r?F0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?s:F0)},e.resetPageSize=r=>{var s,l;e.setPageSize(r?z0:(s=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?s:z0)},e.setPageSize=r=>{e.setPagination(s=>{const l=Math.max(1,wi(r,s.pageSize)),c=s.pageSize*s.pageIndex,d=Math.floor(c/l);return{...s,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(s=>{var l;let c=wi(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...s,pageCount:c}}),e.getPageOptions=rt(()=>[e.getPageCount()],r=>{let s=[];return r&&r>0&&(s=[...new Array(r)].fill(null).map((l,c)=>c)),s},at(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,s=e.getPageCount();return s===-1?!0:s===0?!1:r<s-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},zx=()=>({top:[],bottom:[]}),vK={getInitialState:e=>({rowPinning:zx(),...e}),getDefaultOptions:e=>({onRowPinningChange:xa("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,s)=>{const l=r?e.getLeafRows().map(f=>{let{id:m}=f;return m}):[],c=s?e.getParentRows().map(f=>{let{id:m}=f;return m}):[],d=new Set([...c,e.id,...l]);t.setRowPinning(f=>{var m,g;if(n==="bottom"){var v,x;return{top:((v=f==null?void 0:f.top)!=null?v:[]).filter(C=>!(d!=null&&d.has(C))),bottom:[...((x=f==null?void 0:f.bottom)!=null?x:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)]}}if(n==="top"){var b,w;return{top:[...((b=f==null?void 0:f.top)!=null?b:[]).filter(C=>!(d!=null&&d.has(C))),...Array.from(d)],bottom:((w=f==null?void 0:f.bottom)!=null?w:[]).filter(C=>!(d!=null&&d.has(C)))}}return{top:((m=f==null?void 0:f.top)!=null?m:[]).filter(C=>!(d!=null&&d.has(C))),bottom:((g=f==null?void 0:f.bottom)!=null?g:[]).filter(C=>!(d!=null&&d.has(C)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:s}=t.options;return typeof r=="function"?r(e):(n=r??s)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:s}=t.getState().rowPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>s==null?void 0:s.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const s=e.getIsPinned();if(!s)return-1;const l=(n=s==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(c=>{let{id:d}=c;return d});return(r=l==null?void 0:l.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?zx():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:zx())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var s,l;return!!((s=r.top)!=null&&s.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var s;return((s=e.options.keepPinnedRows)==null||s?(n??[]).map(c=>{const d=e.getRow(c,!0);return d.getIsAllParentsExpanded()?d:null}):(n??[]).map(c=>t.find(d=>d.id===c))).filter(Boolean).map(c=>({...c,position:r}))},e.getTopRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),at(e.options,"debugRows")),e.getBottomRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),at(e.options,"debugRows")),e.getCenterRows=rt(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const s=new Set([...n??[],...r??[]]);return t.filter(l=>!s.has(l.id))},at(e.options,"debugRows"))}},yK={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:xa("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},s=e.getPreGroupedRowModel().flatRows;return t?s.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):s.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),s={...n};return e.getRowModel().rows.forEach(l=>{V0(s,l.id,r,!0,e)}),s}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Vx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getFilteredSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Vx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getGroupedSelectedRowModel=rt(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Vx(e,n):{rows:[],flatRows:[],rowsById:{}},at(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(s=>s.getCanSelect()&&!n[s.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(s=>s.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(s=>!n[s.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const s=e.getIsSelected();t.setRowSelection(l=>{var c;if(n=typeof n<"u"?n:!s,e.getCanSelect()&&s===n)return l;const d={...l};return V0(d,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return k1(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return H0(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return H0(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)}}}},V0=(e,t,n,r,s)=>{var l;const c=s.getRow(t,!0);n?(c.getCanMultiSelect()||Object.keys(e).forEach(d=>delete e[d]),c.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(l=c.subRows)!=null&&l.length&&c.getCanSelectSubRows()&&c.subRows.forEach(d=>V0(e,d.id,n,r,s))};function Vx(e,t){const n=e.getState().rowSelection,r=[],s={},l=function(c,d){return c.map(f=>{var m;const g=k1(f,n);if(g&&(r.push(f),s[f.id]=f),(m=f.subRows)!=null&&m.length&&(f={...f,subRows:l(f.subRows)}),g)return f}).filter(Boolean)};return{rows:l(t.rows),flatRows:r,rowsById:s}}function k1(e,t){var n;return(n=t[e.id])!=null?n:!1}function H0(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let s=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!s)&&(c.getCanSelect()&&(k1(c,t)?l=!0:s=!1),c.subRows&&c.subRows.length)){const d=H0(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),s=!1)}}),s?"all":l?"some":!1}const $0=/([0-9]+)/gm,xK=(e,t,n)=>n3(Oi(e.getValue(n)).toLowerCase(),Oi(t.getValue(n)).toLowerCase()),bK=(e,t,n)=>n3(Oi(e.getValue(n)),Oi(t.getValue(n))),SK=(e,t,n)=>I1(Oi(e.getValue(n)).toLowerCase(),Oi(t.getValue(n)).toLowerCase()),CK=(e,t,n)=>I1(Oi(e.getValue(n)),Oi(t.getValue(n))),wK=(e,t,n)=>{const r=e.getValue(n),s=t.getValue(n);return r>s?1:r<s?-1:0},EK=(e,t,n)=>I1(e.getValue(n),t.getValue(n));function I1(e,t){return e===t?0:e>t?1:-1}function Oi(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function n3(e,t){const n=e.split($0).filter(Boolean),r=t.split($0).filter(Boolean);for(;n.length&&r.length;){const s=n.shift(),l=r.shift(),c=parseInt(s,10),d=parseInt(l,10),f=[c,d].sort();if(isNaN(f[0])){if(s>l)return 1;if(l>s)return-1;continue}if(isNaN(f[1]))return isNaN(c)?-1:1;if(c>d)return 1;if(d>c)return-1}return n.length-r.length}const Ld={alphanumeric:xK,alphanumericCaseSensitive:bK,text:SK,textCaseSensitive:CK,datetime:wK,basic:EK},RK={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:xa("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const s of n){const l=s==null?void 0:s.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return Ld.datetime;if(typeof l=="string"&&(r=!0,l.split($0).length>1))return Ld.alphanumeric}return r?Ld.text:Ld.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 Ng(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:Ld[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const s=e.getNextSortingOrder(),l=typeof n<"u"&&n!==null;t.setSorting(c=>{const d=c==null?void 0:c.find(b=>b.id===e.id),f=c==null?void 0:c.findIndex(b=>b.id===e.id);let m=[],g,v=l?n:s==="desc";if(c!=null&&c.length&&e.getCanMultiSort()&&r?d?g="toggle":g="add":c!=null&&c.length&&f!==c.length-1?g="replace":d?g="toggle":g="replace",g==="toggle"&&(l||s||(g="remove")),g==="add"){var x;m=[...c,{id:e.id,desc:v}],m.splice(0,m.length-((x=t.options.maxMultiSortColCount)!=null?x:Number.MAX_SAFE_INTEGER))}else g==="toggle"?m=c.map(b=>b.id===e.id?{...b,desc:v}:b):g==="remove"?m=c.filter(b=>b.id!==e.id):m=[{id:e.id,desc:v}];return m})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,s;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(s=t.options.enableMultiRemove)!=null)||s)?!1:c==="desc"?"asc":"desc":l},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(s=>s.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(s=>s.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},TK=[ZZ,fK,iK,lK,KZ,YZ,hK,mK,RK,sK,pK,gK,vK,yK,uK];function jK(e){var t,n;const r=[...TK,...(t=e._features)!=null?t:[]];let s={_features:r};const l=s._features.reduce((x,b)=>Object.assign(x,b.getDefaultOptions==null?void 0:b.getDefaultOptions(s)),{}),c=x=>s.options.mergeOptions?s.options.mergeOptions(l,x):{...l,...x};let f={...{},...(n=e.initialState)!=null?n:{}};s._features.forEach(x=>{var b;f=(b=x.getInitialState==null?void 0:x.getInitialState(f))!=null?b:f});const m=[];let g=!1;const v={_features:r,options:{...l,...e},initialState:f,_queue:x=>{m.push(x),g||(g=!0,Promise.resolve().then(()=>{for(;m.length;)m.shift()();g=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{s.setState(s.initialState)},setOptions:x=>{const b=wi(x,s.options);s.options=c(b)},getState:()=>s.options.state,setState:x=>{s.options.onStateChange==null||s.options.onStateChange(x)},_getRowId:(x,b,w)=>{var C;return(C=s.options.getRowId==null?void 0:s.options.getRowId(x,b,w))!=null?C:`${w?[w.id,b].join("."):b}`},getCoreRowModel:()=>(s._getCoreRowModel||(s._getCoreRowModel=s.options.getCoreRowModel(s)),s._getCoreRowModel()),getRowModel:()=>s.getPaginationRowModel(),getRow:(x,b)=>{let w=(b?s.getPrePaginationRowModel():s.getRowModel()).rowsById[x];if(!w&&(w=s.getCoreRowModel().rowsById[x],!w))throw new Error;return w},_getDefaultColumnDef:rt(()=>[s.options.defaultColumn],x=>{var b;return x=(b=x)!=null?b:{},{header:w=>{const C=w.header.column.columnDef;return C.accessorKey?C.accessorKey:C.accessorFn?C.id:null},cell:w=>{var C,E;return(C=(E=w.renderValue())==null||E.toString==null?void 0:E.toString())!=null?C:null},...s._features.reduce((w,C)=>Object.assign(w,C.getDefaultColumnDef==null?void 0:C.getDefaultColumnDef()),{}),...x}},at(e,"debugColumns")),_getColumnDefs:()=>s.options.columns,getAllColumns:rt(()=>[s._getColumnDefs()],x=>{const b=function(w,C,E){return E===void 0&&(E=0),w.map(R=>{const T=qZ(s,R,E,C),_=R;return T.columns=_.columns?b(_.columns,T,E+1):[],T})};return b(x)},at(e,"debugColumns")),getAllFlatColumns:rt(()=>[s.getAllColumns()],x=>x.flatMap(b=>b.getFlatColumns()),at(e,"debugColumns")),_getAllFlatColumnsById:rt(()=>[s.getAllFlatColumns()],x=>x.reduce((b,w)=>(b[w.id]=w,b),{}),at(e,"debugColumns")),getAllLeafColumns:rt(()=>[s.getAllColumns(),s._getOrderColumnsFn()],(x,b)=>{let w=x.flatMap(C=>C.getLeafColumns());return b(w)},at(e,"debugColumns")),getColumn:x=>s._getAllFlatColumnsById()[x]};Object.assign(s,v);for(let x=0;x<s._features.length;x++){const b=s._features[x];b==null||b.createTable==null||b.createTable(s)}return s}function Au(){return e=>rt(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(s,l,c){l===void 0&&(l=0);const d=[];for(let m=0;m<s.length;m++){const g=O1(e,e._getRowId(s[m],m,c),s[m],m,l,void 0,c==null?void 0:c.id);if(n.flatRows.push(g),n.rowsById[g.id]=g,d.push(g),e.options.getSubRows){var f;g.originalSubRows=e.options.getSubRows(s[m],m),(f=g.originalSubRows)!=null&&f.length&&(g.subRows=r(g.originalSubRows,l+1,g))}}return d};return n.rows=r(t),n},at(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function _K(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 NK(e,t,n){return n.options.filterFromLeafRows?AK(e,t,n):DK(e,t,n)}function AK(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(f,m){m===void 0&&(m=0);const g=[];for(let x=0;x<f.length;x++){var v;let b=f[x];const w=O1(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(w.columnFilters=b.columnFilters,(v=b.subRows)!=null&&v.length&&m<c){if(w.subRows=d(b.subRows,m+1),b=w,t(b)&&!w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}if(t(b)||w.subRows.length){g.push(b),l[b.id]=b,s.push(b);continue}}else b=w,t(b)&&(g.push(b),l[b.id]=b,s.push(b))}return g};return{rows:d(e),flatRows:s,rowsById:l}}function DK(e,t,n){var r;const s=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(f,m){m===void 0&&(m=0);const g=[];for(let x=0;x<f.length;x++){let b=f[x];if(t(b)){var v;if((v=b.subRows)!=null&&v.length&&m<c){const C=O1(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);C.subRows=d(b.subRows,m+1),b=C}g.push(b),s.push(b),l[b.id]=b}}return g};return{rows:d(e),flatRows:s,rowsById:l}}function qf(){return e=>rt(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let x=0;x<t.flatRows.length;x++)t.flatRows[x].columnFilters={},t.flatRows[x].columnFiltersMeta={};return t}const s=[],l=[];(n??[]).forEach(x=>{var b;const w=e.getColumn(x.id);if(!w)return;const C=w.getFilterFn();C&&s.push({id:x.id,filterFn:C,resolvedValue:(b=C.resolveFilterValue==null?void 0:C.resolveFilterValue(x.value))!=null?b:x.value})});const c=(n??[]).map(x=>x.id),d=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(x=>x.getCanGlobalFilter());r&&d&&f.length&&(c.push("__global__"),f.forEach(x=>{var b;l.push({id:x.id,filterFn:d,resolvedValue:(b=d.resolveFilterValue==null?void 0:d.resolveFilterValue(r))!=null?b:r})}));let m,g;for(let x=0;x<t.flatRows.length;x++){const b=t.flatRows[x];if(b.columnFilters={},s.length)for(let w=0;w<s.length;w++){m=s[w];const C=m.id;b.columnFilters[C]=m.filterFn(b,C,m.resolvedValue,E=>{b.columnFiltersMeta[C]=E})}if(l.length){for(let w=0;w<l.length;w++){g=l[w];const C=g.id;if(g.filterFn(b,C,g.resolvedValue,E=>{b.columnFiltersMeta[C]=E})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const v=x=>{for(let b=0;b<c.length;b++)if(x.columnFilters[c[b]]===!1)return!1;return!0};return NK(t.rows,v,e)},at(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ag(e){return t=>rt(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:s,pageIndex:l}=n;let{rows:c,flatRows:d,rowsById:f}=r;const m=s*l,g=m+s;c=c.slice(m,g);let v;t.options.paginateExpandedRows?v={rows:c,flatRows:d,rowsById:f}:v=_K({rows:c,flatRows:d,rowsById:f}),v.flatRows=[];const x=b=>{v.flatRows.push(b),b.subRows.length&&b.subRows.forEach(x)};return v.rows.forEach(x),v},at(t.options,"debugTable"))}function Zf(){return e=>rt(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,s=[],l=r.filter(f=>{var m;return(m=e.getColumn(f.id))==null?void 0:m.getCanSort()}),c={};l.forEach(f=>{const m=e.getColumn(f.id);m&&(c[f.id]={sortUndefined:m.columnDef.sortUndefined,invertSorting:m.columnDef.invertSorting,sortingFn:m.getSortingFn()})});const d=f=>{const m=f.map(g=>({...g}));return m.sort((g,v)=>{for(let b=0;b<l.length;b+=1){var x;const w=l[b],C=c[w.id],E=C.sortUndefined,R=(x=w==null?void 0:w.desc)!=null?x:!1;let T=0;if(E){const _=g.getValue(w.id),O=v.getValue(w.id),A=_===void 0,D=O===void 0;if(A||D){if(E==="first")return A?-1:1;if(E==="last")return A?1:-1;T=A&&D?0:A?E:-E}}if(T===0&&(T=C.sortingFn(g,v,w.id)),T!==0)return R&&(T*=-1),C.invertSorting&&(T*=-1),T}return g.index-v.index}),m.forEach(g=>{var v;s.push(g),(v=g.subRows)!=null&&v.length&&(g.subRows=d(g.subRows))}),m};return{rows:d(n.rows),flatRows:s,rowsById:n.rowsById}},at(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
679
|
-
* react-table
|
|
680
|
-
*
|
|
681
|
-
* Copyright (c) TanStack
|
|
682
|
-
*
|
|
683
|
-
* This source code is licensed under the MIT license found in the
|
|
684
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
685
|
-
*
|
|
686
|
-
* @license MIT
|
|
687
|
-
*/function vu(e,t){return e?OK(e)?p.createElement(e,t):e:null}function OK(e){return MK(e)||typeof e=="function"||kK(e)}function MK(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function kK(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Du(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=p.useState(()=>({current:jK(t)})),[r,s]=p.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{s(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function Ou({className:e,...t}){return o.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:o.jsx("table",{"data-slot":"table",className:J("w-full caption-bottom text-sm",e),...t})})}function Mu({className:e,...t}){return o.jsx("thead",{"data-slot":"table-header",className:J("[&_tr]:border-b",e),...t})}function ku({className:e,...t}){return o.jsx("tbody",{"data-slot":"table-body",className:J("[&_tr:last-child]:border-0",e),...t})}function ir({className:e,...t}){return o.jsx("tr",{"data-slot":"table-row",className:J("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function Iu({className:e,...t}){return o.jsx("th",{"data-slot":"table-head",className:J("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ba({className:e,...t}){return o.jsx("td",{"data-slot":"table-cell",className:J("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var r3="AlertDialog",[IK]=kr(r3,[L_]),Uo=L_(),a3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Uo(t);return o.jsx(tg,{...r,...n,modal:!0})};a3.displayName=r3;var LK="AlertDialogTrigger",PK=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(tU,{...s,...r,ref:t})});PK.displayName=LK;var UK="AlertDialogPortal",s3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Uo(t);return o.jsx(ng,{...r,...n})};s3.displayName=UK;var FK="AlertDialogOverlay",o3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(rg,{...s,...r,ref:t})});o3.displayName=FK;var au="AlertDialogContent",[zK,VK]=IK(au),HK=n_("AlertDialogContent"),i3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...s}=e,l=Uo(n),c=p.useRef(null),d=pt(t,c),f=p.useRef(null);return o.jsx(QP,{contentName:au,titleName:l3,docsSlug:"alert-dialog",children:o.jsx(zK,{scope:n,cancelRef:f,children:o.jsxs(ag,{role:"alertdialog",...l,...s,ref:d,onOpenAutoFocus:Re(s.onOpenAutoFocus,m=>{var g;m.preventDefault(),(g=f.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:m=>m.preventDefault(),onInteractOutside:m=>m.preventDefault(),children:[o.jsx(HK,{children:r}),o.jsx(BK,{contentRef:c})]})})})});i3.displayName=au;var l3="AlertDialogTitle",c3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(Lb,{...s,...r,ref:t})});c3.displayName=l3;var u3="AlertDialogDescription",d3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(Pb,{...s,...r,ref:t})});d3.displayName=u3;var $K="AlertDialogAction",f3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,s=Uo(n);return o.jsx(sg,{...s,...r,ref:t})});f3.displayName=$K;var h3="AlertDialogCancel",m3=p.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:s}=VK(h3,n),l=Uo(n),c=pt(t,s);return o.jsx(sg,{...l,...r,ref:c})});m3.displayName=h3;var BK=({contentRef:e})=>{const t=`\`${au}\` requires a description for the component to be accessible for screen reader users.
|
|
688
|
-
|
|
689
|
-
You can add a description to the \`${au}\` by passing a \`${u3}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
690
|
-
|
|
691
|
-
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 \`${au}\`. 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.
|
|
692
|
-
|
|
693
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return p.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},GK=a3,qK=s3,ZK=o3,KK=i3,YK=f3,WK=m3,QK=c3,XK=d3;function JK({...e}){return o.jsx(GK,{"data-slot":"alert-dialog",...e})}function eY({...e}){return o.jsx(qK,{"data-slot":"alert-dialog-portal",...e})}function tY({className:e,...t}){return o.jsx(ZK,{"data-slot":"alert-dialog-overlay",className:J("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function nY({className:e,...t}){return o.jsxs(eY,{children:[o.jsx(tY,{}),o.jsx(KK,{"data-slot":"alert-dialog-content",className:J("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...t})]})}function rY({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-header",className:J("flex flex-col gap-2 text-center sm:text-left",e),...t})}function aY({className:e,...t}){return o.jsx("div",{"data-slot":"alert-dialog-footer",className:J("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function sY({className:e,...t}){return o.jsx(QK,{"data-slot":"alert-dialog-title",className:J("text-lg font-semibold",e),...t})}function oY({className:e,...t}){return o.jsx(XK,{"data-slot":"alert-dialog-description",className:J("text-muted-foreground text-sm",e),...t})}function iY({className:e,...t}){return o.jsx(YK,{className:J(Ob(),e),...t})}function lY({className:e,...t}){return o.jsx(WK,{className:J(Ob({variant:"outline"}),e),...t})}const p3=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],g3={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:He.CONNECTOR,icon:Q$},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:He.CONNECTOR,icon:X$},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:He.CONNECTOR,icon:J$},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:He.CONNECTOR,icon:eB},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:He.CONNECTOR,icon:Nb},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:He.SQL,icon:jb},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:ap}},ST=p3.map(e=>({key:e,...g3[e]}));function cY(e){if(!e||!p3.includes(e))return;const t=e;return{key:t,...g3[t]}}function uY({children:e,className:t="",...n}){return o.jsx("div",{className:"dm-card",children:o.jsx("div",{className:J("-m-4 flex flex-col items-start justify-between gap-12 overflow-hidden px-8 py-16 lg:flex-row-reverse lg:px-16 lg:py-24 2xl:items-center",t),...n,children:e})})}function dY({children:e,className:t="",...n}){return o.jsx("div",{className:J("pb-2",t),...n,children:e})}function fY({children:e,className:t="",...n}){return o.jsx("h2",{className:J("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function hY({children:e,className:t="",...n}){return o.jsx("p",{className:J("text-muted-foreground text-lg",t),...n,children:e})}function mY({children:e,rings:t=7,className:n="",...r}){return o.jsxs("div",{className:J("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[o.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(s,l)=>{const c=`${(16*(l+1)+24).toString()}vmin`;return o.jsx("div",{className:"animate-ring-pulse",style:{height:c,width:c,animationDelay:`${(l*.3).toString()}s`,animationDuration:"4s",opacity:.2+l*.1,filter:l===0?"blur(1px)":"none"}},l)})}),o.jsx("div",{className:"animate-glow-burst"}),o.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function pY({children:e,className:t="",...n}){return o.jsx("div",{className:J("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function Hx({separator:e=!0,children:t,className:n="",...r}){return o.jsx("section",{className:J("relative pb-10",e&&"after:from-border after:absolute after:bottom-0 after:left-0 after:h-px after:w-full after:bg-gradient-to-r after:to-transparent",n),...r,children:t})}function CT({children:e,className:t="",...n}){return o.jsx("h3",{className:J("mb-4 text-xl font-medium",t),...n,children:e})}function $x({children:e,className:t="",...n}){return o.jsx("div",{className:J("flex flex-wrap items-center gap-4",t),...n,children:e})}function Om({href:e,icon:t,title:n,variant:r="outline",size:s,className:l="",target:c,...d}){const f=r==="outline"?"lg":"sm",m=o.jsxs("span",{className:J("flex items-center gap-2"),children:[t,n]});return e?o.jsx(be,{asChild:!0,variant:r,size:s??f,className:J(r==="ghost"?"text-muted-foreground":"",l),...d,children:o.jsx(Ga,{to:e,target:c,children:m})}):o.jsx(be,{variant:r,size:s??f,className:l,...d,children:m})}function gY(){const{scope:e}=Po(),t=ST.filter(r=>r.definitionType===He.CONNECTOR),n=ST.filter(r=>r.definitionType!==He.CONNECTOR);return o.jsxs(uY,{children:[o.jsx(mY,{children:o.jsx(W$,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),o.jsxs(pY,{children:[o.jsxs(dY,{children:[o.jsx(fY,{children:"Let’s Build Your First Data Mart"}),o.jsx(hY,{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"})]}),o.jsxs(Hx,{children:[o.jsx(CT,{children:"Connect a data source"}),o.jsx($x,{children:t.map(r=>o.jsx(Om,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&o.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),o.jsxs(Hx,{children:[o.jsx(CT,{children:"Use existing SQL or start from scratch"}),o.jsx($x,{children:n.map((r,s)=>o.jsxs(o.Fragment,{children:[o.jsx(Om,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&o.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),s<n.length-1&&o.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),o.jsx(Hx,{separator:!1,children:o.jsxs($x,{children:[o.jsx(Om,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:o.jsx(LL,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),o.jsx(Om,{href:"https://docs.owox.com/docs/getting-started/core-concepts/?utm_source=owox_data_marts&utm_medium=empty_data_marts_page&utm_campaign=help_buttons",icon:o.jsx(Z9,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function vY(){return o.jsx(as,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Pc={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},yY={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 Kf({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Pc.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:s=Pc.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:l=Pc.DEFAULT_EXCLUDED_COLUMNS}){const c=p.useMemo(()=>({SORTING:`${t}${Pc.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Pc.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),d=p.useMemo(()=>yY.extractColumnIds(e),[e]),f=p.useMemo(()=>d.filter(C=>!s.includes(C)),[d,s]),m=p.useCallback(()=>{const C=Ms.get(c.SORTING,"json");return C&&Array.isArray(C)&&C.length>0?C:[{id:f.includes(n)?n:f[0]??Pc.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),g=p.useCallback(()=>{const C=Ms.get(c.COLUMN_VISIBILITY,"json");if(C&&typeof C=="object"&&!Array.isArray(C)){const E={};for(const R of d)l.includes(R)||(E[R]=C[R]);return E}return r},[c.COLUMN_VISIBILITY,d,l,r]),[v,x]=p.useState(m),[b,w]=p.useState(g);return p.useEffect(()=>{v.length>0&&f.includes(v[0].id)&&Ms.set(c.SORTING,v)},[v,f,c.SORTING]),p.useEffect(()=>{const C={};for(const E of d){if(l.includes(E))continue;const R=b[E];typeof R=="boolean"&&(C[E]=R)}Ms.set(c.COLUMN_VISIBILITY,C)},[b,d,l,c.COLUMN_VISIBILITY]),{sorting:v,setSorting:x,columnVisibility:b,setColumnVisibility:w}}function xY({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:s}){var D;const{navigate:l,scope:c}=Po(),{sorting:d,setSorting:f,columnVisibility:m,setColumnVisibility:g}=Kf({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1}}),[v,x]=p.useState([]),[b,w]=p.useState({}),[C,E]=p.useState(!1),[R,T]=p.useState(!1),_=async()=>{try{T(!0);const M=A.getSelectedRowModel().rows.map(z=>z.original.id);for(const z of M)await n(z);on.success(`Successfully deleted ${String(M.length)} data mart${M.length!==1?"s":""}`),w({}),await r()}catch(j){console.error("Error deleting data marts:",j),on.error("Failed to delete some data marts. Please try again.")}finally{T(!1),E(!1)}},O=Object.keys(b).length>0,A=Du({data:t,columns:[{id:"select",size:40,header:({table:j})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":j.getIsAllRowsSelected(),"data-state":j.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:j.getToggleAllRowsSelectedHandler(),children:j.getIsAllRowsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),cell:({row:j})=>o.jsx("button",{type:"button",role:"checkbox","aria-checked":j.getIsSelected(),"data-state":j.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:j.getToggleSelectedHandler(),children:j.getIsSelected()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:Au(),getPaginationRowModel:Ag(),onSortingChange:f,getSortedRowModel:Zf(),onColumnFiltersChange:x,getFilteredRowModel:qf(),onColumnVisibilityChange:g,onRowSelectionChange:w,state:{sorting:d,columnFilters:v,columnVisibility:m,rowSelection:b},enableRowSelection:!0});return s?o.jsx("div",{children:o.jsx(vY,{})}):t.length?o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsxs("div",{className:"dm-card-toolbar-left",children:[O&&o.jsx(be,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{E(!0)},disabled:R,children:o.jsx(Lo,{className:"h-4 w-4"})}),o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Hl,{className:"dm-card-toolbar-search-icon"}),o.jsx(Ht,{placeholder:"Search by title",value:(D=A.getColumn("title"))==null?void 0:D.getFilterValue(),onChange:j=>{var M;return(M=A.getColumn("title"))==null?void 0:M.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})]}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsx(Ga,{to:c("/data-marts/create"),children:o.jsxs(be,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[o.jsx(ja,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ou,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[o.jsx(Mu,{className:"dm-card-table-header",children:A.getHeaderGroups().map(j=>o.jsx(ir,{className:"dm-card-table-header-row",children:j.headers.map(M=>o.jsx(Iu,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:M.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:M.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(M.getSize())}%`},children:M.isPlaceholder?null:vu(M.column.columnDef.header,M.getContext())},M.id))},j.id))}),o.jsx(ku,{className:"dm-card-table-body",children:A.getRowModel().rows.length?A.getRowModel().rows.map(j=>o.jsx(ir,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:M=>{if(M.target instanceof HTMLElement&&(M.target.closest('[role="checkbox"]')||M.target.closest(".actions-cell")||M.target.closest('[role="menuitem"]')||M.target.closest('[data-state="open"]')))return;const z=j.original.id;l(`/data-marts/${z}/data-setup`)},children:j.getVisibleCells().map(M=>o.jsx(ba,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${M.column.id==="actions"?"actions-cell":""} ${M.column.id==="createdAt"?"whitespace-nowrap":""}`,style:M.column.id==="select"?{width:40,minWidth:40,maxWidth:40}:M.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(M.column.getSize())}%`},children:vu(M.column.columnDef.cell,M.getContext())},M.id))},j.id)):o.jsx(ir,{children:o.jsx(ba,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(be,{variant:"outline",size:"sm",onClick:()=>{A.previousPage()},disabled:!A.getCanPreviousPage(),children:"Previous"}),o.jsx(be,{variant:"outline",size:"sm",onClick:()=>{A.nextPage()},disabled:!A.getCanNextPage(),children:"Next"})]}),o.jsx(JK,{open:C,onOpenChange:E,children:o.jsxs(nY,{children:[o.jsxs(rY,{children:[o.jsx(sY,{children:"Are you sure?"}),o.jsxs(oY,{children:["You're about to delete ",Object.keys(b).length," selected data mart",Object.keys(b).length!==1?"s":"",". This action cannot be undone."]})]}),o.jsxs(aY,{children:[o.jsx(lY,{disabled:R,children:"Cancel"}),o.jsx(iY,{onClick:()=>{_()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):o.jsx(gY,{})}function pl({column:e,children:t}){return o.jsxs(be,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Us,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Ka,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{className:"text-muted-foreground h-4 w-4"})})]})]})}function L1({...e}){return o.jsx(tg,{"data-slot":"dialog",...e})}function bY({...e}){return o.jsx(ng,{"data-slot":"dialog-portal",...e})}function SY({className:e,...t}){return o.jsx(rg,{"data-slot":"dialog-overlay",className:J("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function P1({className:e,children:t,showCloseButton:n=!0,...r}){return o.jsxs(bY,{"data-slot":"dialog-portal",children:[o.jsx(SY,{}),o.jsxs(ag,{"data-slot":"dialog-content",className:J("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&o.jsxs(sg,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(uu,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function U1({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-header",className:J("flex flex-col gap-2 text-center sm:text-left",e),...t})}function CY({className:e,...t}){return o.jsx("div",{"data-slot":"dialog-footer",className:J("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function F1({className:e,...t}){return o.jsx(Lb,{"data-slot":"dialog-title",className:J("text-lg leading-none font-semibold",e),...t})}function z1({className:e,...t}){return o.jsx(Pb,{"data-slot":"dialog-description",className:J("text-muted-foreground text-sm",e),...t})}const wY=Ef("",{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 su({className:e,variant:t,...n}){return t==="brand"?o.jsx(be,{variant:"default",className:J(wY({variant:t}),e),...n}):o.jsx(be,{variant:t,className:e,...n})}const na=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:s="Confirm",cancelLabel:l,onConfirm:c,onCancel:d,variant:f="destructive",children:m})=>{const g=()=>{t(!1),d==null||d()};return o.jsx(L1,{open:e,onOpenChange:t,children:o.jsxs(P1,{children:[o.jsxs(U1,{children:[o.jsx(F1,{children:n}),o.jsx(z1,{children:r})]}),m,o.jsxs(CY,{children:[l&&o.jsx(su,{variant:"secondary",onClick:g,children:l}),o.jsx(su,{variant:f,onClick:c,children:s})]})]})})},EY=({row:e,onDeleteSuccess:t})=>{const{scope:n}=Po(),[r,s]=p.useState(!1),[l,c]=p.useState(!1),{deleteDataMart:d,refreshList:f}=Z4(),m=async()=>{try{await d(e.original.id),s(!1),await f(),t==null||t()}catch(g){console.error("Failed to delete data mart:",g)}};return o.jsxs("div",{className:"text-right",children:[o.jsxs(Rr,{open:l,onOpenChange:c,children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(jr,{align:"end",children:[o.jsx(yt,{children:o.jsxs(Ga,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[o.jsx(jf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]})}),o.jsx(qa,{}),o.jsxs(yt,{onClick:()=>{s(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),o.jsx(na,{open:r,onOpenChange:s,title:"Delete Data Mart",description:"Are you sure you want to delete this data mart? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>void m(),variant:"destructive"})]})};var jn=(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))(jn||{});const hi={[jn.TITLE]:"Title",[jn.DEFINITION_TYPE]:"Input Source",[jn.STORAGE_TYPE]:"Storage",[jn.STATUS]:"Status",[jn.TRIGGERS_COUNT]:"Triggers",[jn.REPORTS_COUNT]:"Reports",[jn.CREATED_AT]:"Created at"};function RY({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=hi[t.id]||t.id;return o.jsx(yt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const wT={types:{[He.SQL]:{type:He.SQL,displayName:"SQL",icon:jb},[He.TABLE]:{type:He.TABLE,displayName:"Table",icon:FL},[He.VIEW]:{type:He.VIEW,displayName:"View",icon:Q9},[He.TABLE_PATTERN]:{type:He.TABLE_PATTERN,displayName:"Pattern",icon:s9},[He.CONNECTOR]:{type:He.CONNECTOR,displayName:"Connector",icon:Nb}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},TY=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:jn.TITLE,size:40,header:({column:n})=>o.jsx(pl,{column:n,children:hi[jn.TITLE]}),cell:({row:n})=>o.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===He.CONNECTOR){const s=n.definition,l=t.find(c=>c.name===s.connector.source.name);return(l==null?void 0:l.displayName)??(l==null?void 0:l.name)??"Unknown"}else{const{displayName:s}=wT.getInfo(r);return s}},id:jn.DEFINITION_TYPE,size:15,header:({column:n})=>o.jsx(pl,{column:n,children:hi[jn.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case He.CONNECTOR:{const s=n.original.definition,l=t.find(c=>c.name===s.connector.source.name);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(l==null?void 0:l.logoBase64)&&o.jsx(Nu,{base64:l.logoBase64,size:18}),(l==null?void 0:l.displayName)??"Unknown"]})}default:{const{displayName:s,icon:l}=wT.getInfo(r);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(l,{className:"h-4 w-4"}),s]})}}}},{accessorKey:jn.STORAGE_TYPE,size:15,header:({column:n})=>o.jsx(pl,{column:n,children:hi[jn.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),s=n.original.storageTitle,{displayName:l,icon:c}=Bi.getInfo(r),d=s??l;return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),d]})}},{accessorKey:jn.CREATED_AT,size:15,header:({column:n})=>o.jsx(pl,{column:n,children:hi[jn.CREATED_AT]}),cell:({row:n})=>{const r=n.getValue("createdAt"),s=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r);return o.jsx("div",{className:"text-muted-foreground",children:s})}},{accessorKey:jn.STATUS,size:15,header:({column:n})=>o.jsx(pl,{column:n,children:hi[jn.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return o.jsx(Gf,{type:kZ(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:jn.TRIGGERS_COUNT,size:15,header:({column:n})=>o.jsx(pl,{column:n,children:hi[jn.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:jn.REPORTS_COUNT,size:15,header:({column:n})=>o.jsx(pl,{column:n,children:hi[jn.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return o.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>o.jsx(RY,{table:n}),cell:({row:n})=>o.jsx(EY,{row:n,onDeleteSuccess:e})}];var rr=(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))(rr||{});const jY={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function _Y(e,t){switch(t.type){case rr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case rr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case rr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case rr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case rr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case rr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case rr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case rr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case rr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const v3=p.createContext(void 0);function yu({children:e}){const[t,n]=p.useReducer(_Y,jY);return o.jsx(v3.Provider,{value:{state:t,dispatch:n},children:e})}function NY(){const e=p.useContext(v3);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var rs=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(rs||{});class Xm extends Zl{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}}function y3(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 Yl(){const{state:e,dispatch:t}=NY(),n=p.useMemo(()=>y3(e.connectors),[e.connectors]),r=p.useCallback(async()=>{t({type:rr.FETCH_CONNECTORS_START});try{const d=await new Xm().getAvailableConnectors();t({type:rr.FETCH_CONNECTORS_SUCCESS,payload:d})}catch(c){const d=c instanceof Error?c.message:"Unknown error";t({type:rr.FETCH_CONNECTORS_ERROR,payload:d}),Ue({event:"connector_error",category:"Connector",action:"ListError",label:d})}},[t]),s=p.useCallback(async c=>{t({type:rr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new Xm().getConnectorSpecification(c);t({type:rr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:rr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Ue({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),l=p.useCallback(async c=>{t({type:rr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new Xm().getConnectorFields(c);t({type:rr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:rr.FETCH_CONNECTOR_FIELDS_ERROR,payload:f}),Ue({event:"connector_error",category:"Connector",action:"FieldsError",label:c})}},[t]);return{connectors:n,connectorSpecification:e.connectorSpecification,connectorFields:e.connectorFields,loading:e.loading,loadingSpecification:e.loadingSpecification,loadingFields:e.loadingFields,error:e.error,fetchAvailableConnectors:r,fetchConnectorSpecification:s,fetchConnectorFields:l}}const AY=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:s}=Z4(),{connectors:l,fetchAvailableConnectors:c}=Yl();return p.useEffect(()=>{c()},[c]),p.useEffect(()=>{t()},[t]),o.jsx(xY,{columns:TY({connectors:l}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:s})};function ET(){return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(dq,{children:o.jsx(yu,{children:o.jsx(AY,{})})})})]})}const x3=p.createContext(void 0),Pd=e=>{const t=zZ(e);return{...e,canPublish:t.length===0,validationErrors:t}},b3={dataMart:null,isLoading:!1,error:null,runs:[]};function DY(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:Pd(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Pd({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Pd({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Pd({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Pd({...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 b3;default:return e}}function Gi(){const e=p.useContext(x3);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class OY{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:Ie.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 MY{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:Ie.AWS_ATHENA,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{accessKeyId:(r==null?void 0:r.accessKeyId)??"",secretAccessKey:(r==null?void 0:r.secretAccessKey)??""},config:{region:(n==null?void 0:n.region)??"",outputBucket:(n==null?void 0:n.outputBucket)??""}}}mapToUpdateRequest(t){const n={config:{region:t.config.region,outputBucket:t.config.outputBucket}};return t.credentials&&(n.credentials={accessKeyId:t.credentials.accessKeyId,secretAccessKey:t.credentials.secretAccessKey}),n}}const S3={getMapper(e){switch(e){case Ie.GOOGLE_BIGQUERY:return new OY;case Ie.AWS_ATHENA:return new MY;default:throw new Error(`Unknown storage type: ${e}`)}}};function Jm(e){return S3.getMapper(e.type).mapFromDto(e)}function kY(e){const t=S3.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function IY(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function LY(e){return{type:e}}let Mm=null;async function PY(){if(Mm)return Mm;const e=await UY();return Mm=y3(e),Mm}async function UY(){return await new Xm().getAvailableConnectors()}async function FY(e){const t=await PY();return t.length===0?null:t.find(r=>r.name===e)??null}function zY(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function VY(e){return{sqlQuery:e.sqlQuery}}function HY(e){return{sqlQuery:e.sqlQuery}}function $Y(e){return{fullyQualifiedName:e.fullyQualifiedName}}function BY(e){return{fullyQualifiedName:e.fullyQualifiedName}}function GY(e){return{fullyQualifiedName:e.fullyQualifiedName}}function qY(e){return{fullyQualifiedName:e.fullyQualifiedName}}function ZY(e){return{pattern:e.pattern}}function KY(e){return{pattern:e.pattern}}function YY(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 WY(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 QY(e,t){if(!e||!t)return null;switch(e){case He.SQL:return HY(t);case He.TABLE:return BY(t);case He.VIEW:return qY(t);case He.TABLE_PATTERN:return KY(t);case He.CONNECTOR:{const n=WY(t);return n.connector.info=await FY(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function Uc(e){return{id:e.id,title:e.title,description:e.description,status:S4.getInfo(e.status),storage:Jm(e.storage),definitionType:e.definitionType,definition:await QY(e.definitionType,e.definition),schema:e.schema,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,validationErrors:[]}}function XY(e){return{id:e.id,title:e.title}}const JY=e=>({id:e.id,status:e.status,createdAt:new Date(e.createdAt),logs:e.logs,errors:e.errors,definitionRun:e.definitionRun?e.definitionRun:null,type:e.type?e.type:null,triggerType:e.runType?e.runType:null,startedAt:e.startedAt?new Date(e.startedAt):null,finishedAt:e.finishedAt?new Date(e.finishedAt):null,reportDefinition:e.reportDefinition?e.reportDefinition:null}),RT=e=>e.runs.map(JY);function C3({children:e}){const[t,n]=p.useReducer(DY,b3),r=p.useCallback(async A=>{try{n({type:"FETCH_DATA_MART_START"});const D=await sn.getDataMartById(A),j=await Uc(D);n({type:"FETCH_DATA_MART_SUCCESS",payload:j})}catch(D){n({type:"FETCH_DATA_MART_ERROR",payload:bn(D)})}},[]),s=p.useCallback(async A=>{try{n({type:"CREATE_DATA_MART_START"});const D=await sn.createDataMart(A),j=XY(D);return n({type:"CREATE_DATA_MART_SUCCESS",payload:j}),Ue({event:"data_mart_created",category:"DataMart",action:"Create",label:j.id}),Ot.success("Data Mart created"),j}catch(D){const j=bn(D);throw n({type:"CREATE_DATA_MART_ERROR",payload:j}),Ue({event:"data_mart_error",category:"DataMart",action:"CreateError",label:j.message}),D}},[]),l=p.useCallback(async(A,D)=>{try{n({type:"UPDATE_DATA_MART_START"});const j=await sn.updateDataMart(A,D),M=await Uc(j);n({type:"UPDATE_DATA_MART_SUCCESS",payload:M}),Ue({event:"data_mart_updated",category:"DataMart",action:"Update",label:M.id})}catch(j){const M=bn(j);n({type:"UPDATE_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:M.message})}},[]),c=p.useCallback(async A=>{try{n({type:"DELETE_DATA_MART_START"}),await sn.deleteDataMart(A),n({type:"DELETE_DATA_MART_SUCCESS"}),Ue({event:"data_mart_deleted",category:"DataMart",action:"Delete",label:A}),Ot.success("Data Mart deleted")}catch(D){const j=bn(D);n({type:"DELETE_DATA_MART_ERROR",payload:j}),Ue({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:j.message})}},[]),d=p.useCallback(async(A,D)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await sn.updateDataMartTitle(A,D),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:D}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:D}),Ot.success("Title updated")}catch(j){const M=bn(j);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:M.message})}},[]),f=p.useCallback(async(A,D)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await sn.updateDataMartDescription(A,D),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:D??""}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),Ot.success("Description updated")}catch(j){const M=bn(j);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:M.message})}},[]),m=p.useCallback(A=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:A})},[]),g=p.useCallback(async(A,D,j)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let M;switch(D){case He.SQL:M={definitionType:D,definition:VY(j)};break;case He.TABLE:M={definitionType:D,definition:$Y(j)};break;case He.VIEW:M={definitionType:D,definition:GY(j)};break;case He.TABLE_PATTERN:M={definitionType:D,definition:ZY(j)};break;case He.CONNECTOR:{const K=j;let Y;for(const ae of K.connector.source.configuration){const F=ae;if(F._copiedFrom){Y=F._copiedFrom.dataMartId;break}}M={definitionType:He.CONNECTOR,definition:YY(K),sourceDataMartId:Y};break}default:throw new Error(`Unsupported definition type: ${String(D)}`)}const z=await sn.updateDataMartDefinition(A,M),Z=await Uc(z);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:D,definition:j}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:Z}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:D})}catch(M){const z=bn(M);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:z}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:z.message})}},[]),v=p.useCallback(async A=>{try{n({type:"PUBLISH_DATA_MART_START"});const D=await sn.publishDataMart(A),j=await Uc(D);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:j}),Ot.success("Data Mart published")}catch(D){const j=bn(D);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:j}),Ue({event:"data_mart_error",category:"DataMart",action:"PublishError",label:j.message}),D}},[]),x=p.useCallback(async(A,D=5,j=0,M)=>{try{M!=null&&M.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const z=await sn.getDataMartRuns(A,D,j,M!=null&&M.silent?{skipLoadingIndicator:!0}:void 0),Z=RT(z);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:Z}),Z}catch(z){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:bn(z)}),z}},[]),b=p.useCallback(async(A,D,j=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const M=await sn.getDataMartRuns(A,j,D),z=RT(M);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:z}),z}catch(M){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:bn(M)}),M}},[]),w=p.useCallback(async A=>{const D=Ot.loading("Manual run started");try{n({type:"RUN_DATA_MART_START"}),await sn.runDataMart(A.id,A.payload),n({type:"RUN_DATA_MART_SUCCESS"})}catch(j){Ot.dismiss(D);const M=bn(j);n({type:"RUN_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"RunError",label:M.message})}},[]),C=p.useCallback(async(A,D)=>{try{await sn.cancelDataMartRun(A,D),await x(A),Ot.success("Data Mart run canceled")}catch(j){const M=bn(j);n({type:"RUN_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:M.message})}},[x]),E=p.useCallback(async A=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const D=await sn.actualizeDataMartSchema(A),j=await Uc(D);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:j}),Ot.success("Output schema actualized")}catch(D){const j=bn(D);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:j}),Ue({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:j.message})}},[]),R=p.useCallback(async(A,D)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const j=await sn.updateDataMartSchema(A,{schema:D}),M=await Uc(j);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:M}),Ot.success("Output schema updated")}catch(j){const M=bn(j);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:M.message})}},[]),T=p.useCallback(()=>{n({type:"RESET"})},[]),_=p.useCallback(()=>t.error?t.error.message:null,[t.error]),O={...t,getDataMart:r,createDataMart:s,updateDataMart:l,deleteDataMart:c,updateDataMartTitle:d,updateDataMartDescription:f,updateDataMartStorage:m,updateDataMartDefinition:g,publishDataMart:v,runDataMart:w,cancelDataMartRun:C,actualizeDataMartSchema:E,updateDataMartSchema:R,getDataMartRuns:x,loadMoreDataMartRuns:b,getErrorMessage:_,reset:T};return o.jsx(x3.Provider,{value:O,children:e})}var Yf=e=>e.type==="checkbox",bl=e=>e instanceof Date,Jr=e=>e==null;const w3=e=>typeof e=="object";var Kn=e=>!Jr(e)&&!Array.isArray(e)&&w3(e)&&!bl(e),E3=e=>Kn(e)&&e.target?Yf(e.target)?e.target.checked:e.target.value:e,eW=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,R3=(e,t)=>e.has(eW(t)),tW=e=>{const t=e.constructor&&e.constructor.prototype;return Kn(t)&&t.hasOwnProperty("isPrototypeOf")},V1=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function nr(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(!(V1&&(e instanceof Blob||r))&&(n||Kn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!tW(e))t=e;else for(const s in e)e.hasOwnProperty(s)&&(t[s]=nr(e[s]));else return e;return t}var Dg=e=>/^\w*$/.test(e),_n=e=>e===void 0,H1=e=>Array.isArray(e)?e.filter(Boolean):[],$1=e=>H1(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ae=(e,t,n)=>{if(!t||!Kn(e))return n;const r=(Dg(t)?[t]:$1(t)).reduce((s,l)=>Jr(s)?s:s[l],e);return _n(r)||r===e?_n(e[t])?n:e[t]:r},fa=e=>typeof e=="boolean",Kt=(e,t,n)=>{let r=-1;const s=Dg(t)?[t]:$1(t),l=s.length,c=l-1;for(;++r<l;){const d=s[r];let f=n;if(r!==c){const m=e[d];f=Kn(m)||Array.isArray(m)?m:isNaN(+s[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=f,e=e[d]}};const Dp={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ss={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},vo={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},B1=_e.createContext(null);B1.displayName="HookFormContext";const Lu=()=>_e.useContext(B1),T3=e=>{const{children:t,...n}=e;return _e.createElement(B1.Provider,{value:n},t)};var j3=(e,t,n,r=!0)=>{const s={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(s,l,{get:()=>{const c=l;return t._proxyFormState[c]!==ss.all&&(t._proxyFormState[c]=!r||ss.all),n&&(n[c]=!0),e[c]}});return s};const G1=typeof window<"u"?_e.useLayoutEffect:_e.useEffect;function _3(e){const t=Lu(),{control:n=t.control,disabled:r,name:s,exact:l}=e||{},[c,d]=_e.useState(n._formState),f=_e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return G1(()=>n._subscribe({name:s,formState:f.current,exact:l,callback:m=>{!r&&d({...n._formState,...m})}}),[s,r,l]),_e.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),_e.useMemo(()=>j3(c,n,f.current,!1),[c,n])}var ga=e=>typeof e=="string",N3=(e,t,n,r,s)=>ga(e)?(r&&t.watch.add(e),Ae(n,e,s)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),Ae(n,l))):(r&&(t.watchAll=!0),n),B0=e=>Jr(e)||!w3(e);function wo(e,t,n=new WeakSet){if(B0(e)||B0(t))return e===t;if(bl(e)&&bl(t))return e.getTime()===t.getTime();const r=Object.keys(e),s=Object.keys(t);if(r.length!==s.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const l of r){const c=e[l];if(!s.includes(l))return!1;if(l!=="ref"){const d=t[l];if(bl(c)&&bl(d)||Kn(c)&&Kn(d)||Array.isArray(c)&&Array.isArray(d)?!wo(c,d,n):c!==d)return!1}}return!0}function nW(e){const t=Lu(),{control:n=t.control,name:r,defaultValue:s,disabled:l,exact:c,compute:d}=e||{},f=_e.useRef(s),m=_e.useRef(d),g=_e.useRef(void 0);m.current=d;const v=_e.useMemo(()=>n._getWatch(r,f.current),[n,r]),[x,b]=_e.useState(m.current?m.current(v):v);return G1(()=>n._subscribe({name:r,formState:{values:!0},exact:c,callback:w=>{if(!l){const C=N3(r,n._names,w.values||n._formValues,!1,f.current);if(m.current){const E=m.current(C);wo(E,g.current)||(b(E),g.current=E)}else b(C)}}}),[n,l,r,c]),_e.useEffect(()=>n._removeUnmounted()),x}function rW(e){const t=Lu(),{name:n,disabled:r,control:s=t.control,shouldUnregister:l,defaultValue:c}=e,d=R3(s._names.array,n),f=_e.useMemo(()=>Ae(s._formValues,n,Ae(s._defaultValues,n,c)),[s,n,c]),m=nW({control:s,name:n,defaultValue:f,exact:!0}),g=_3({control:s,name:n,exact:!0}),v=_e.useRef(e),x=_e.useRef(void 0),b=_e.useRef(s.register(n,{...e.rules,value:m,...fa(e.disabled)?{disabled:e.disabled}:{}}));v.current=e;const w=_e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ae(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ae(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ae(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ae(g.validatingFields,n)},error:{enumerable:!0,get:()=>Ae(g.errors,n)}}),[g,n]),C=_e.useCallback(_=>b.current.onChange({target:{value:E3(_),name:n},type:Dp.CHANGE}),[n]),E=_e.useCallback(()=>b.current.onBlur({target:{value:Ae(s._formValues,n),name:n},type:Dp.BLUR}),[n,s._formValues]),R=_e.useCallback(_=>{const O=Ae(s._fields,n);O&&_&&(O._f.ref={focus:()=>_.focus&&_.focus(),select:()=>_.select&&_.select(),setCustomValidity:A=>_.setCustomValidity(A),reportValidity:()=>_.reportValidity()})},[s._fields,n]),T=_e.useMemo(()=>({name:n,value:m,...fa(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:C,onBlur:E,ref:R}),[n,r,g.disabled,C,E,R,m]);return _e.useEffect(()=>{const _=s._options.shouldUnregister||l,O=x.current;O&&O!==n&&!d&&s.unregister(O),s.register(n,{...v.current.rules,...fa(v.current.disabled)?{disabled:v.current.disabled}:{}});const A=(D,j)=>{const M=Ae(s._fields,D);M&&M._f&&(M._f.mount=j)};if(A(n,!0),_){const D=nr(Ae(s._options.defaultValues,n,v.current.defaultValue));Kt(s._defaultValues,n,D),_n(Ae(s._formValues,n))&&Kt(s._formValues,n,D)}return!d&&s.register(n),x.current=n,()=>{(d?_&&!s._state.action:_)?s.unregister(n):A(n,!1)}},[n,s,d,l]),_e.useEffect(()=>{s._setDisabledField({disabled:r,name:n})},[r,n,s]),_e.useMemo(()=>({field:T,formState:g,fieldState:w}),[T,g,w])}const aW=e=>e.render(rW(e));var q1=(e,t,n,r,s)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:s||!0}}:{},Qd=e=>Array.isArray(e)?e:[e],TT=()=>{let e=[];return{get observers(){return e},next:s=>{for(const l of e)l.next&&l.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(l=>l!==s)}}),unsubscribe:()=>{e=[]}}};function A3(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const s=e[r],l=t[r];if(s&&Kn(s)&&l){const c=A3(s,l);Kn(c)&&(n[r]=c)}else e[r]&&(n[r]=l)}return n}var Xr=e=>Kn(e)&&!Object.keys(e).length,Z1=e=>e.type==="file",os=e=>typeof e=="function",Op=e=>{if(!V1)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},D3=e=>e.type==="select-multiple",K1=e=>e.type==="radio",sW=e=>K1(e)||Yf(e),Bx=e=>Op(e)&&e.isConnected;function oW(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=_n(e)?r++:e[t[r++]];return e}function iW(e){for(const t in e)if(e.hasOwnProperty(t)&&!_n(e[t]))return!1;return!0}function Gn(e,t){const n=Array.isArray(t)?t:Dg(t)?[t]:$1(t),r=n.length===1?e:oW(e,n),s=n.length-1,l=n[s];return r&&delete r[l],s!==0&&(Kn(r)&&Xr(r)||Array.isArray(r)&&iW(r))&&Gn(e,n.slice(0,-1)),e}var lW=e=>{for(const t in e)if(os(e[t]))return!0;return!1};function O3(e){return Array.isArray(e)||Kn(e)&&!lW(e)}function G0(e,t={}){for(const n in e)O3(e[n])?(t[n]=Array.isArray(e[n])?[]:{},G0(e[n],t[n])):_n(e[n])||(t[n]=!0);return t}function Gc(e,t,n){n||(n=G0(t));for(const r in e)O3(e[r])?_n(t)||B0(n[r])?n[r]=G0(e[r],Array.isArray(e[r])?[]:{}):Gc(e[r],Jr(t)?{}:t[r],n[r]):n[r]=!wo(e[r],t[r]);return n}const jT={value:!1,isValid:!1},_T={value:!0,isValid:!0};var M3=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&&!_n(e[0].attributes.value)?_n(e[0].value)||e[0].value===""?_T:{value:e[0].value,isValid:!0}:_T:jT}return jT},k3=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>_n(e)?e:t?e===""?NaN:e&&+e:n&&ga(e)?new Date(e):r?r(e):e;const NT={isValid:!1,value:null};var I3=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,NT):NT;function AT(e){const t=e.ref;return Z1(t)?t.files:K1(t)?I3(e.refs).value:D3(t)?[...t.selectedOptions].map(({value:n})=>n):Yf(t)?M3(e.refs).value:k3(_n(t.value)?e.ref.value:t.value,e)}var cW=(e,t,n,r)=>{const s={};for(const l of e){const c=Ae(t,l);c&&Kt(s,l,c._f)}return{criteriaMode:n,names:[...e],fields:s,shouldUseNativeValidation:r}},Mp=e=>e instanceof RegExp,Ud=e=>_n(e)?e:Mp(e)?e.source:Kn(e)?Mp(e.value)?e.value.source:e.value:e,DT=e=>({isOnSubmit:!e||e===ss.onSubmit,isOnBlur:e===ss.onBlur,isOnChange:e===ss.onChange,isOnAll:e===ss.all,isOnTouch:e===ss.onTouched});const OT="AsyncFunction";var uW=e=>!!e&&!!e.validate&&!!(os(e.validate)&&e.validate.constructor.name===OT||Kn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===OT)),dW=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),MT=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Xd=(e,t,n,r)=>{for(const s of n||Object.keys(e)){const l=Ae(e,s);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],s)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(Xd(d,t))break}else if(Kn(d)&&Xd(d,t))break}}};function kT(e,t,n){const r=Ae(e,n);if(r||Dg(n))return{error:r,name:n};const s=n.split(".");for(;s.length;){const l=s.join("."),c=Ae(t,l),d=Ae(e,l);if(c&&!Array.isArray(c)&&n!==l)return{name:n};if(d&&d.type)return{name:l,error:d};if(d&&d.root&&d.root.type)return{name:`${l}.root`,error:d.root};s.pop()}return{name:n}}var fW=(e,t,n,r)=>{n(e);const{name:s,...l}=e;return Xr(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||ss.all))},hW=(e,t,n)=>!e||!t||e===t||Qd(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),mW=(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,pW=(e,t)=>!H1(Ae(e,t)).length&&Gn(e,t),gW=(e,t,n)=>{const r=Qd(Ae(e,n));return Kt(r,"root",t[n]),Kt(e,n,r),e};function IT(e,t,n="validate"){if(ga(e)||Array.isArray(e)&&e.every(ga)||fa(e)&&!e)return{type:n,message:ga(e)?e:"",ref:t}}var Fc=e=>Kn(e)&&!Mp(e)?e:{value:e,message:""},LT=async(e,t,n,r,s,l)=>{const{ref:c,refs:d,required:f,maxLength:m,minLength:g,min:v,max:x,pattern:b,validate:w,name:C,valueAsNumber:E,mount:R}=e._f,T=Ae(n,C);if(!R||t.has(C))return{};const _=d?d[0]:c,O=Y=>{s&&_.reportValidity&&(_.setCustomValidity(fa(Y)?"":Y||""),_.reportValidity())},A={},D=K1(c),j=Yf(c),M=D||j,z=(E||Z1(c))&&_n(c.value)&&_n(T)||Op(c)&&c.value===""||T===""||Array.isArray(T)&&!T.length,Z=q1.bind(null,C,r,A),K=(Y,ae,F,V=vo.maxLength,I=vo.minLength)=>{const B=Y?ae:F;A[C]={type:Y?V:I,message:B,ref:c,...Z(Y?V:I,B)}};if(l?!Array.isArray(T)||!T.length:f&&(!M&&(z||Jr(T))||fa(T)&&!T||j&&!M3(d).isValid||D&&!I3(d).isValid)){const{value:Y,message:ae}=ga(f)?{value:!!f,message:f}:Fc(f);if(Y&&(A[C]={type:vo.required,message:ae,ref:_,...Z(vo.required,ae)},!r))return O(ae),A}if(!z&&(!Jr(v)||!Jr(x))){let Y,ae;const F=Fc(x),V=Fc(v);if(!Jr(T)&&!isNaN(T)){const I=c.valueAsNumber||T&&+T;Jr(F.value)||(Y=I>F.value),Jr(V.value)||(ae=I<V.value)}else{const I=c.valueAsDate||new Date(T),B=xe=>new Date(new Date().toDateString()+" "+xe),G=c.type=="time",ie=c.type=="week";ga(F.value)&&T&&(Y=G?B(T)>B(F.value):ie?T>F.value:I>new Date(F.value)),ga(V.value)&&T&&(ae=G?B(T)<B(V.value):ie?T<V.value:I<new Date(V.value))}if((Y||ae)&&(K(!!Y,F.message,V.message,vo.max,vo.min),!r))return O(A[C].message),A}if((m||g)&&!z&&(ga(T)||l&&Array.isArray(T))){const Y=Fc(m),ae=Fc(g),F=!Jr(Y.value)&&T.length>+Y.value,V=!Jr(ae.value)&&T.length<+ae.value;if((F||V)&&(K(F,Y.message,ae.message),!r))return O(A[C].message),A}if(b&&!z&&ga(T)){const{value:Y,message:ae}=Fc(b);if(Mp(Y)&&!T.match(Y)&&(A[C]={type:vo.pattern,message:ae,ref:c,...Z(vo.pattern,ae)},!r))return O(ae),A}if(w){if(os(w)){const Y=await w(T,n),ae=IT(Y,_);if(ae&&(A[C]={...ae,...Z(vo.validate,ae.message)},!r))return O(ae.message),A}else if(Kn(w)){let Y={};for(const ae in w){if(!Xr(Y)&&!r)break;const F=IT(await w[ae](T,n),_,ae);F&&(Y={...F,...Z(ae,F.message)},O(F.message),r&&(A[C]=Y))}if(!Xr(Y)&&(A[C]={ref:_,...Y},!r))return A}}return O(!0),A};const vW={mode:ss.onSubmit,reValidateMode:ss.onChange,shouldFocusError:!0};function yW(e={}){let t={...vW,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:os(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},s=Kn(t.defaultValues)||Kn(t.values)?nr(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:nr(s),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let v={...g};const x={array:TT(),state:TT()},b=t.criteriaMode===ss.all,w=$=>te=>{clearTimeout(m),m=setTimeout($,te)},C=async $=>{if(!t.disabled&&(g.isValid||v.isValid||$)){const te=t.resolver?Xr((await j()).errors):await z(r,!0);te!==n.isValid&&x.state.next({isValid:te})}},E=($,te)=>{!t.disabled&&(g.isValidating||g.validatingFields||v.isValidating||v.validatingFields)&&(($||Array.from(d.mount)).forEach(fe=>{fe&&(te?Kt(n.validatingFields,fe,te):Gn(n.validatingFields,fe))}),x.state.next({validatingFields:n.validatingFields,isValidating:!Xr(n.validatingFields)}))},R=($,te=[],fe,je,ye=!0,Ce=!0)=>{if(je&&fe&&!t.disabled){if(c.action=!0,Ce&&Array.isArray(Ae(r,$))){const Ye=fe(Ae(r,$),je.argA,je.argB);ye&&Kt(r,$,Ye)}if(Ce&&Array.isArray(Ae(n.errors,$))){const Ye=fe(Ae(n.errors,$),je.argA,je.argB);ye&&Kt(n.errors,$,Ye),pW(n.errors,$)}if((g.touchedFields||v.touchedFields)&&Ce&&Array.isArray(Ae(n.touchedFields,$))){const Ye=fe(Ae(n.touchedFields,$),je.argA,je.argB);ye&&Kt(n.touchedFields,$,Ye)}(g.dirtyFields||v.dirtyFields)&&(n.dirtyFields=Gc(s,l)),x.state.next({name:$,isDirty:K($,te),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Kt(l,$,te)},T=($,te)=>{Kt(n.errors,$,te),x.state.next({errors:n.errors})},_=$=>{n.errors=$,x.state.next({errors:n.errors,isValid:!1})},O=($,te,fe,je)=>{const ye=Ae(r,$);if(ye){const Ce=Ae(l,$,_n(fe)?Ae(s,$):fe);_n(Ce)||je&&je.defaultChecked||te?Kt(l,$,te?Ce:AT(ye._f)):F($,Ce),c.mount&&C()}},A=($,te,fe,je,ye)=>{let Ce=!1,Ye=!1;const st={name:$};if(!t.disabled){if(!fe||je){(g.isDirty||v.isDirty)&&(Ye=n.isDirty,n.isDirty=st.isDirty=K(),Ce=Ye!==st.isDirty);const ot=wo(Ae(s,$),te);Ye=!!Ae(n.dirtyFields,$),ot?Gn(n.dirtyFields,$):Kt(n.dirtyFields,$,!0),st.dirtyFields=n.dirtyFields,Ce=Ce||(g.dirtyFields||v.dirtyFields)&&Ye!==!ot}if(fe){const ot=Ae(n.touchedFields,$);ot||(Kt(n.touchedFields,$,fe),st.touchedFields=n.touchedFields,Ce=Ce||(g.touchedFields||v.touchedFields)&&ot!==fe)}Ce&&ye&&x.state.next(st)}return Ce?st:{}},D=($,te,fe,je)=>{const ye=Ae(n.errors,$),Ce=(g.isValid||v.isValid)&&fa(te)&&n.isValid!==te;if(t.delayError&&fe?(f=w(()=>T($,fe)),f(t.delayError)):(clearTimeout(m),f=null,fe?Kt(n.errors,$,fe):Gn(n.errors,$)),(fe?!wo(ye,fe):ye)||!Xr(je)||Ce){const Ye={...je,...Ce&&fa(te)?{isValid:te}:{},errors:n.errors,name:$};n={...n,...Ye},x.state.next(Ye)}},j=async $=>{E($,!0);const te=await t.resolver(l,t.context,cW($||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return E($),te},M=async $=>{const{errors:te}=await j($);if($)for(const fe of $){const je=Ae(te,fe);je?Kt(n.errors,fe,je):Gn(n.errors,fe)}else n.errors=te;return te},z=async($,te,fe={valid:!0})=>{for(const je in $){const ye=$[je];if(ye){const{_f:Ce,...Ye}=ye;if(Ce){const st=d.array.has(Ce.name),ot=ye._f&&uW(ye._f);ot&&g.validatingFields&&E([Ce.name],!0);const vn=await LT(ye,d.disabled,l,b,t.shouldUseNativeValidation&&!te,st);if(ot&&g.validatingFields&&E([Ce.name]),vn[Ce.name]&&(fe.valid=!1,te))break;!te&&(Ae(vn,Ce.name)?st?gW(n.errors,vn,Ce.name):Kt(n.errors,Ce.name,vn[Ce.name]):Gn(n.errors,Ce.name))}!Xr(Ye)&&await z(Ye,te,fe)}}return fe.valid},Z=()=>{for(const $ of d.unMount){const te=Ae(r,$);te&&(te._f.refs?te._f.refs.every(fe=>!Bx(fe)):!Bx(te._f.ref))&&le($)}d.unMount=new Set},K=($,te)=>!t.disabled&&($&&te&&Kt(l,$,te),!wo(xe(),s)),Y=($,te,fe)=>N3($,d,{...c.mount?l:_n(te)?s:ga($)?{[$]:te}:te},fe,te),ae=$=>H1(Ae(c.mount?l:s,$,t.shouldUnregister?Ae(s,$,[]):[])),F=($,te,fe={})=>{const je=Ae(r,$);let ye=te;if(je){const Ce=je._f;Ce&&(!Ce.disabled&&Kt(l,$,k3(te,Ce)),ye=Op(Ce.ref)&&Jr(te)?"":te,D3(Ce.ref)?[...Ce.ref.options].forEach(Ye=>Ye.selected=ye.includes(Ye.value)):Ce.refs?Yf(Ce.ref)?Ce.refs.forEach(Ye=>{(!Ye.defaultChecked||!Ye.disabled)&&(Array.isArray(ye)?Ye.checked=!!ye.find(st=>st===Ye.value):Ye.checked=ye===Ye.value||!!ye)}):Ce.refs.forEach(Ye=>Ye.checked=Ye.value===ye):Z1(Ce.ref)?Ce.ref.value="":(Ce.ref.value=ye,Ce.ref.type||x.state.next({name:$,values:nr(l)})))}(fe.shouldDirty||fe.shouldTouch)&&A($,ye,fe.shouldTouch,fe.shouldDirty,!0),fe.shouldValidate&&ie($)},V=($,te,fe)=>{for(const je in te){if(!te.hasOwnProperty(je))return;const ye=te[je],Ce=$+"."+je,Ye=Ae(r,Ce);(d.array.has($)||Kn(ye)||Ye&&!Ye._f)&&!bl(ye)?V(Ce,ye,fe):F(Ce,ye,fe)}},I=($,te,fe={})=>{const je=Ae(r,$),ye=d.array.has($),Ce=nr(te);Kt(l,$,Ce),ye?(x.array.next({name:$,values:nr(l)}),(g.isDirty||g.dirtyFields||v.isDirty||v.dirtyFields)&&fe.shouldDirty&&x.state.next({name:$,dirtyFields:Gc(s,l),isDirty:K($,Ce)})):je&&!je._f&&!Jr(Ce)?V($,Ce,fe):F($,Ce,fe),MT($,d)&&x.state.next({...n,name:$}),x.state.next({name:c.mount?$:void 0,values:nr(l)})},B=async $=>{c.mount=!0;const te=$.target;let fe=te.name,je=!0;const ye=Ae(r,fe),Ce=ot=>{je=Number.isNaN(ot)||bl(ot)&&isNaN(ot.getTime())||wo(ot,Ae(l,fe,ot))},Ye=DT(t.mode),st=DT(t.reValidateMode);if(ye){let ot,vn;const _a=te.type?AT(ye._f):E3($),yn=$.type===Dp.BLUR||$.type===Dp.FOCUS_OUT,Fo=!dW(ye._f)&&!t.resolver&&!Ae(n.errors,fe)&&!ye._f.deps||mW(yn,Ae(n.touchedFields,fe),n.isSubmitted,st,Ye),Mn=MT(fe,d,yn);Kt(l,fe,_a),yn?(!te||!te.readOnly)&&(ye._f.onBlur&&ye._f.onBlur($),f&&f(0)):ye._f.onChange&&ye._f.onChange($);const Cn=A(fe,_a,yn),pr=!Xr(Cn)||Mn;if(!yn&&x.state.next({name:fe,type:$.type,values:nr(l)}),Fo)return(g.isValid||v.isValid)&&(t.mode==="onBlur"?yn&&C():yn||C()),pr&&x.state.next({name:fe,...Mn?{}:Cn});if(!yn&&Mn&&x.state.next({...n}),t.resolver){const{errors:wn}=await j([fe]);if(Ce(_a),je){const Qi=kT(n.errors,r,fe),bs=kT(wn,r,Qi.name||fe);ot=bs.error,fe=bs.name,vn=Xr(wn)}}else E([fe],!0),ot=(await LT(ye,d.disabled,l,b,t.shouldUseNativeValidation))[fe],E([fe]),Ce(_a),je&&(ot?vn=!1:(g.isValid||v.isValid)&&(vn=await z(r,!0)));je&&(ye._f.deps&&(!Array.isArray(ye._f.deps)||ye._f.deps.length>0)&&ie(ye._f.deps),D(fe,vn,ot,Cn))}},G=($,te)=>{if(Ae(n.errors,te)&&$.focus)return $.focus(),1},ie=async($,te={})=>{let fe,je;const ye=Qd($);if(t.resolver){const Ce=await M(_n($)?$:ye);fe=Xr(Ce),je=$?!ye.some(Ye=>Ae(Ce,Ye)):fe}else $?(je=(await Promise.all(ye.map(async Ce=>{const Ye=Ae(r,Ce);return await z(Ye&&Ye._f?{[Ce]:Ye}:Ye)}))).every(Boolean),!(!je&&!n.isValid)&&C()):je=fe=await z(r);return x.state.next({...!ga($)||(g.isValid||v.isValid)&&fe!==n.isValid?{}:{name:$},...t.resolver||!$?{isValid:fe}:{},errors:n.errors}),te.shouldFocus&&!je&&Xd(r,G,$?ye:d.mount),je},xe=($,te)=>{let fe={...c.mount?l:s};return te&&(fe=A3(te.dirtyFields?n.dirtyFields:n.touchedFields,fe)),_n($)?fe:ga($)?Ae(fe,$):$.map(je=>Ae(fe,je))},L=($,te)=>({invalid:!!Ae((te||n).errors,$),isDirty:!!Ae((te||n).dirtyFields,$),error:Ae((te||n).errors,$),isValidating:!!Ae(n.validatingFields,$),isTouched:!!Ae((te||n).touchedFields,$)}),P=$=>{$&&Qd($).forEach(te=>Gn(n.errors,te)),x.state.next({errors:$?n.errors:{}})},W=($,te,fe)=>{const je=(Ae(r,$,{_f:{}})._f||{}).ref,ye=Ae(n.errors,$)||{},{ref:Ce,message:Ye,type:st,...ot}=ye;Kt(n.errors,$,{...ot,...te,ref:je}),x.state.next({name:$,errors:n.errors,isValid:!1}),fe&&fe.shouldFocus&&je&&je.focus&&je.focus()},ee=($,te)=>os($)?x.state.subscribe({next:fe=>"values"in fe&&$(Y(void 0,te),fe)}):Y($,te,!0),de=$=>x.state.subscribe({next:te=>{hW($.name,te.name,$.exact)&&fW(te,$.formState||g,_t,$.reRenderRoot)&&$.callback({values:{...l},...n,...te,defaultValues:s})}}).unsubscribe,ve=$=>(c.mount=!0,v={...v,...$.formState},de({...$,formState:v})),le=($,te={})=>{for(const fe of $?Qd($):d.mount)d.mount.delete(fe),d.array.delete(fe),te.keepValue||(Gn(r,fe),Gn(l,fe)),!te.keepError&&Gn(n.errors,fe),!te.keepDirty&&Gn(n.dirtyFields,fe),!te.keepTouched&&Gn(n.touchedFields,fe),!te.keepIsValidating&&Gn(n.validatingFields,fe),!t.shouldUnregister&&!te.keepDefaultValue&&Gn(s,fe);x.state.next({values:nr(l)}),x.state.next({...n,...te.keepDirty?{isDirty:K()}:{}}),!te.keepIsValid&&C()},Ne=({disabled:$,name:te})=>{(fa($)&&c.mount||$||d.disabled.has(te))&&($?d.disabled.add(te):d.disabled.delete(te))},we=($,te={})=>{let fe=Ae(r,$);const je=fa(te.disabled)||fa(t.disabled);return Kt(r,$,{...fe||{},_f:{...fe&&fe._f?fe._f:{ref:{name:$}},name:$,mount:!0,...te}}),d.mount.add($),fe?Ne({disabled:fa(te.disabled)?te.disabled:t.disabled,name:$}):O($,!0,te.value),{...je?{disabled:te.disabled||t.disabled}:{},...t.progressive?{required:!!te.required,min:Ud(te.min),max:Ud(te.max),minLength:Ud(te.minLength),maxLength:Ud(te.maxLength),pattern:Ud(te.pattern)}:{},name:$,onChange:B,onBlur:B,ref:ye=>{if(ye){we($,te),fe=Ae(r,$);const Ce=_n(ye.value)&&ye.querySelectorAll&&ye.querySelectorAll("input,select,textarea")[0]||ye,Ye=sW(Ce),st=fe._f.refs||[];if(Ye?st.find(ot=>ot===Ce):Ce===fe._f.ref)return;Kt(r,$,{_f:{...fe._f,...Ye?{refs:[...st.filter(Bx),Ce,...Array.isArray(Ae(s,$))?[{}]:[]],ref:{type:Ce.type,name:$}}:{ref:Ce}}}),O($,!1,void 0,Ce)}else fe=Ae(r,$,{}),fe._f&&(fe._f.mount=!1),(t.shouldUnregister||te.shouldUnregister)&&!(R3(d.array,$)&&c.action)&&d.unMount.add($)}}},Te=()=>t.shouldFocusError&&Xd(r,G,d.mount),Be=$=>{fa($)&&(x.state.next({disabled:$}),Xd(r,(te,fe)=>{const je=Ae(r,fe);je&&(te.disabled=je._f.disabled||$,Array.isArray(je._f.refs)&&je._f.refs.forEach(ye=>{ye.disabled=je._f.disabled||$}))},0,!1))},Xe=($,te)=>async fe=>{let je;fe&&(fe.preventDefault&&fe.preventDefault(),fe.persist&&fe.persist());let ye=nr(l);if(x.state.next({isSubmitting:!0}),t.resolver){const{errors:Ce,values:Ye}=await j();n.errors=Ce,ye=nr(Ye)}else await z(r);if(d.disabled.size)for(const Ce of d.disabled)Gn(ye,Ce);if(Gn(n.errors,"root"),Xr(n.errors)){x.state.next({errors:{}});try{await $(ye,fe)}catch(Ce){je=Ce}}else te&&await te({...n.errors},fe),Te(),setTimeout(Te);if(x.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Xr(n.errors)&&!je,submitCount:n.submitCount+1,errors:n.errors}),je)throw je},Vt=($,te={})=>{Ae(r,$)&&(_n(te.defaultValue)?I($,nr(Ae(s,$))):(I($,te.defaultValue),Kt(s,$,nr(te.defaultValue))),te.keepTouched||Gn(n.touchedFields,$),te.keepDirty||(Gn(n.dirtyFields,$),n.isDirty=te.defaultValue?K($,nr(Ae(s,$))):K()),te.keepError||(Gn(n.errors,$),g.isValid&&C()),x.state.next({...n}))},jt=($,te={})=>{const fe=$?nr($):s,je=nr(fe),ye=Xr($),Ce=ye?s:je;if(te.keepDefaultValues||(s=fe),!te.keepValues){if(te.keepDirtyValues){const Ye=new Set([...d.mount,...Object.keys(Gc(s,l))]);for(const st of Array.from(Ye))Ae(n.dirtyFields,st)?Kt(Ce,st,Ae(l,st)):I(st,Ae(Ce,st))}else{if(V1&&_n($))for(const Ye of d.mount){const st=Ae(r,Ye);if(st&&st._f){const ot=Array.isArray(st._f.refs)?st._f.refs[0]:st._f.ref;if(Op(ot)){const vn=ot.closest("form");if(vn){vn.reset();break}}}}if(te.keepFieldsRef)for(const Ye of d.mount)I(Ye,Ae(Ce,Ye));else r={}}l=t.shouldUnregister?te.keepDefaultValues?nr(s):{}:nr(Ce),x.array.next({values:{...Ce}}),x.state.next({values:{...Ce}})}d={mount:te.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!te.keepIsValid||!!te.keepDirtyValues,c.watch=!!t.shouldUnregister,x.state.next({submitCount:te.keepSubmitCount?n.submitCount:0,isDirty:ye?!1:te.keepDirty?n.isDirty:!!(te.keepDefaultValues&&!wo($,s)),isSubmitted:te.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:ye?{}:te.keepDirtyValues?te.keepDefaultValues&&l?Gc(s,l):n.dirtyFields:te.keepDefaultValues&&$?Gc(s,$):te.keepDirty?n.dirtyFields:{},touchedFields:te.keepTouched?n.touchedFields:{},errors:te.keepErrors?n.errors:{},isSubmitSuccessful:te.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},$t=($,te)=>jt(os($)?$(l):$,te),Me=($,te={})=>{const fe=Ae(r,$),je=fe&&fe._f;if(je){const ye=je.refs?je.refs[0]:je.ref;ye.focus&&(ye.focus(),te.shouldSelect&&os(ye.select)&&ye.select())}},_t=$=>{n={...n,...$}},rn={control:{register:we,unregister:le,getFieldState:L,handleSubmit:Xe,setError:W,_subscribe:de,_runSchema:j,_focusError:Te,_getWatch:Y,_getDirty:K,_setValid:C,_setFieldArray:R,_setDisabledField:Ne,_setErrors:_,_getFieldArray:ae,_reset:jt,_resetDefaultValues:()=>os(t.defaultValues)&&t.defaultValues().then($=>{$t($,t.resetOptions),x.state.next({isLoading:!1})}),_removeUnmounted:Z,_disableForm:Be,_subjects:x,_proxyFormState:g,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state($){c=$},get _defaultValues(){return s},get _names(){return d},set _names($){d=$},get _formState(){return n},get _options(){return t},set _options($){t={...t,...$}}},subscribe:ve,trigger:ie,register:we,handleSubmit:Xe,watch:ee,setValue:I,getValues:xe,reset:$t,resetField:Vt,clearErrors:P,unregister:le,setError:W,setFocus:Me,getFieldState:L};return{...rn,formControl:rn}}function qi(e={}){const t=_e.useRef(void 0),n=_e.useRef(void 0),[r,s]=_e.useState({isDirty:!1,isValidating:!1,isLoading:os(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:os(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!os(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=yW(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,G1(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>s({...l._formState}),reRenderRoot:!0});return s(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),_e.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),_e.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),_e.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),_e.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),_e.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==r.isDirty&&l._subjects.state.next({isDirty:c})}},[l,r.isDirty]),_e.useEffect(()=>{e.values&&!wo(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),n.current=e.values,s(c=>({...c}))):l._resetDefaultValues()},[l,e.values]),_e.useEffect(()=>{l._state.mount||(l._setValid(),l._state.mount=!0),l._state.watch&&(l._state.watch=!1,l._subjects.state.next({...l._formState})),l._removeUnmounted()}),t.current.formState=j3(r,l),t.current}var xW="Label",L3=p.forwardRef((e,t)=>o.jsx(We.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())}}));L3.displayName=xW;var bW=L3;function Sa({className:e,...t}){return o.jsx(bW,{"data-slot":"label",className:J("flex items-center gap-2 text-sm leading-none font-medium group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}const Wl=T3,P3=p.createContext({}),Jt=({...e})=>o.jsx(P3.Provider,{value:{name:e.name},children:o.jsx(aW,{...e})}),Wf=()=>{const e=p.useContext(P3),t=p.useContext(U3),{getFieldState:n}=Lu(),r=_3({name:e.name}),s=n(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:l}=t;return{id:l,name:e.name,formItemId:`${l}-form-item`,formDescriptionId:`${l}-form-item-description`,formMessageId:`${l}-form-item-message`,...s}},U3=p.createContext({});function en({className:e="",...t}){const n=p.useId();return o.jsx(U3.Provider,{value:{id:n},children:o.jsx("div",{"data-slot":"form-item",className:J("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",e),...t})})}function tn({className:e="",tooltip:t,tooltipProps:n,children:r,...s}){const{error:l,formItemId:c}=Wf();return o.jsxs(Sa,{"data-slot":"form-label","data-error":!!l,className:J("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...s,children:[o.jsx("span",{children:r}),t&&o.jsxs(St,{...n,children:[o.jsx(Ct,{asChild:!0,children:o.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(wt,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function nn({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:s}=Wf();return o.jsx(Kp,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${s}`:`${r}`,"aria-invalid":!!t,...e})}function or({className:e,...t}){const{formDescriptionId:n}=Wf();return o.jsx("div",{"data-slot":"form-description",id:n,className:J("text-muted-foreground text-sm",e),...t})}function un({className:e,...t}){const{error:n,formMessageId:r}=Wf(),s=n?String((n==null?void 0:n.message)??""):t.children;return s?o.jsx("p",{"data-slot":"form-message",id:r,className:J("text-destructive text-sm",e),...t,children:s}):null}function Ql({children:e,className:t="",variant:n="default"}){const r=n==="light"?"flex-1 overflow-y-auto":"bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4";return o.jsx("div",{className:r,children:o.jsx("div",{className:J("flex min-h-full flex-col gap-4",t),children:e})})}function Xl({className:e="",children:t,variant:n="default"}){const r=n==="light"?"flex flex-col gap-1.5 pt-4":"flex flex-col gap-1.5 border-t px-4 py-3";return o.jsx("div",{className:J(r,e),children:t})}function Vs({title:e,children:t}){return o.jsxs("section",{className:"mb-4",children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function SW({value:e,label:t,checked:n,onChange:r,disabled:s=!1,orientation:l="vertical",className:c=""}){const{formItemId:d}=Wf();return o.jsxs("label",{htmlFor:`${d}-${e}`,className:J("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",s&&"cursor-not-allowed opacity-50",l==="horizontal"?"flex-row":"flex-col",n?"bg-muted border-input border-b":"hover:bg-muted border-border bg-transparent",c),children:[o.jsx("input",{type:"radio",id:`${d}-${e}`,value:e,checked:n,onChange:r,disabled:s,className:J("peer border-input ring-offset-background h-4 w-4 rounded-full border","checked:bg-primary checked:border-primary","focus-visible:ring-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),o.jsx("span",{className:J("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function CW({options:e,value:t,onChange:n,orientation:r="vertical",className:s=""}){return o.jsx("div",{tabIndex:-1,className:J(r==="horizontal"?"flex gap-6":"flex flex-col gap-2","border-input rounded-md border bg-transparent px-1 py-1 transition-colors","focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]","text-foreground selection:bg-primary selection:text-primary-foreground","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",s),children:e.map(l=>o.jsx(SW,{value:l.value,label:l.label,checked:t===l.value,onChange:c=>n(c.target.value),disabled:l.disabled,orientation:r},l.value))})}const Zi=p.forwardRef(({children:e,className:t="",...n},r)=>o.jsx("form",{ref:r,className:J("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));Zi.displayName="AppForm";function PT(e,[t,n]){return Math.min(n,Math.max(t,e))}function Y1(e){const t=p.useRef({value:e,previous:e});return p.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var wW=[" ","Enter","ArrowUp","ArrowDown"],EW=[" ","Enter"],Ul="Select",[Og,Mg,RW]=fg(Ul),[Pu]=kr(Ul,[RW,Gs]),kg=Gs(),[TW,Ki]=Pu(Ul),[jW,_W]=Pu(Ul),F3=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:s,onOpenChange:l,value:c,defaultValue:d,onValueChange:f,dir:m,name:g,autoComplete:v,disabled:x,required:b,form:w}=e,C=kg(t),[E,R]=p.useState(null),[T,_]=p.useState(null),[O,A]=p.useState(!1),D=If(m),[j,M]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:Ul}),[z,Z]=zr({prop:c,defaultProp:d,onChange:f,caller:Ul}),K=p.useRef(null),Y=E?w||!!E.closest("form"):!0,[ae,F]=p.useState(new Set),V=Array.from(ae).map(I=>I.props.value).join(";");return o.jsx(Ru,{...C,children:o.jsxs(TW,{required:b,scope:t,trigger:E,onTriggerChange:R,valueNode:T,onValueNodeChange:_,valueNodeHasChildren:O,onValueNodeHasChildrenChange:A,contentId:Dn(),value:z,onValueChange:Z,open:j,onOpenChange:M,dir:D,triggerPointerDownPosRef:K,disabled:x,children:[o.jsx(Og.Provider,{scope:t,children:o.jsx(jW,{scope:e.__scopeSelect,onNativeOptionAdd:p.useCallback(I=>{F(B=>new Set(B).add(I))},[]),onNativeOptionRemove:p.useCallback(I=>{F(B=>{const G=new Set(B);return G.delete(I),G})},[]),children:n})}),Y?o.jsxs(cD,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:v,value:z,onChange:I=>Z(I.target.value),disabled:x,form:w,children:[z===void 0?o.jsx("option",{value:""}):null,Array.from(ae)]},V):null]})})};F3.displayName=Ul;var z3="SelectTrigger",V3=p.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...s}=e,l=kg(n),c=Ki(z3,n),d=c.disabled||r,f=pt(t,c.onTriggerChange),m=Mg(n),g=p.useRef("touch"),[v,x,b]=dD(C=>{const E=m().filter(_=>!_.disabled),R=E.find(_=>_.value===c.value),T=fD(E,C,R);T!==void 0&&c.onValueChange(T.value)}),w=C=>{d||(c.onOpenChange(!0),b()),C&&(c.triggerPointerDownPosRef.current={x:Math.round(C.pageX),y:Math.round(C.pageY)})};return o.jsx(Tu,{asChild:!0,...l,children:o.jsx(We.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":uD(c.value)?"":void 0,...s,ref:f,onClick:Re(s.onClick,C=>{C.currentTarget.focus(),g.current!=="mouse"&&w(C)}),onPointerDown:Re(s.onPointerDown,C=>{g.current=C.pointerType;const E=C.target;E.hasPointerCapture(C.pointerId)&&E.releasePointerCapture(C.pointerId),C.button===0&&C.ctrlKey===!1&&C.pointerType==="mouse"&&(w(C),C.preventDefault())}),onKeyDown:Re(s.onKeyDown,C=>{const E=v.current!=="";!(C.ctrlKey||C.altKey||C.metaKey)&&C.key.length===1&&x(C.key),!(E&&C.key===" ")&&wW.includes(C.key)&&(w(),C.preventDefault())})})})});V3.displayName=z3;var H3="SelectValue",$3=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,children:l,placeholder:c="",...d}=e,f=Ki(H3,n),{onValueNodeHasChildrenChange:m}=f,g=l!==void 0,v=pt(t,f.onValueNodeChange);return wr(()=>{m(g)},[m,g]),o.jsx(We.span,{...d,ref:v,style:{pointerEvents:"none"},children:uD(f.value)?o.jsx(o.Fragment,{children:c}):l})});$3.displayName=H3;var NW="SelectIcon",B3=p.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...s}=e;return o.jsx(We.span,{"aria-hidden":!0,...s,ref:t,children:r||"▼"})});B3.displayName=NW;var AW="SelectPortal",G3=e=>o.jsx(Bl,{asChild:!0,...e});G3.displayName=AW;var Fl="SelectContent",q3=p.forwardRef((e,t)=>{const n=Ki(Fl,e.__scopeSelect),[r,s]=p.useState();if(wr(()=>{s(new DocumentFragment)},[]),!n.open){const l=r;return l?is.createPortal(o.jsx(Z3,{scope:e.__scopeSelect,children:o.jsx(Og.Slot,{scope:e.__scopeSelect,children:o.jsx("div",{children:e.children})})}),l):null}return o.jsx(K3,{...e,ref:t})});q3.displayName=Fl;var ts=10,[Z3,Yi]=Pu(Fl),DW="SelectContentImpl",OW=_i("SelectContent.RemoveScroll"),K3=p.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E,...R}=e,T=Ki(Fl,n),[_,O]=p.useState(null),[A,D]=p.useState(null),j=pt(t,le=>O(le)),[M,z]=p.useState(null),[Z,K]=p.useState(null),Y=Mg(n),[ae,F]=p.useState(!1),V=p.useRef(!1);p.useEffect(()=>{if(_)return Jp(_)},[_]),Qp();const I=p.useCallback(le=>{const[Ne,...we]=Y().map(Xe=>Xe.ref.current),[Te]=we.slice(-1),Be=document.activeElement;for(const Xe of le)if(Xe===Be||(Xe==null||Xe.scrollIntoView({block:"nearest"}),Xe===Ne&&A&&(A.scrollTop=0),Xe===Te&&A&&(A.scrollTop=A.scrollHeight),Xe==null||Xe.focus(),document.activeElement!==Be))return},[Y,A]),B=p.useCallback(()=>I([M,_]),[I,M,_]);p.useEffect(()=>{ae&&B()},[ae,B]);const{onOpenChange:G,triggerPointerDownPosRef:ie}=T;p.useEffect(()=>{if(_){let le={x:0,y:0};const Ne=Te=>{var Be,Xe;le={x:Math.abs(Math.round(Te.pageX)-(((Be=ie.current)==null?void 0:Be.x)??0)),y:Math.abs(Math.round(Te.pageY)-(((Xe=ie.current)==null?void 0:Xe.y)??0))}},we=Te=>{le.x<=10&&le.y<=10?Te.preventDefault():_.contains(Te.target)||G(!1),document.removeEventListener("pointermove",Ne),ie.current=null};return ie.current!==null&&(document.addEventListener("pointermove",Ne),document.addEventListener("pointerup",we,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ne),document.removeEventListener("pointerup",we,{capture:!0})}}},[_,G,ie]),p.useEffect(()=>{const le=()=>G(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[G]);const[xe,L]=dD(le=>{const Ne=Y().filter(Be=>!Be.disabled),we=Ne.find(Be=>Be.ref.current===document.activeElement),Te=fD(Ne,le,we);Te&&setTimeout(()=>Te.ref.current.focus())}),P=p.useCallback((le,Ne,we)=>{const Te=!V.current&&!we;(T.value!==void 0&&T.value===Ne||Te)&&(z(le),Te&&(V.current=!0))},[T.value]),W=p.useCallback(()=>_==null?void 0:_.focus(),[_]),ee=p.useCallback((le,Ne,we)=>{const Te=!V.current&&!we;(T.value!==void 0&&T.value===Ne||Te)&&K(le)},[T.value]),de=r==="popper"?q0:Y3,ve=de===q0?{side:d,sideOffset:f,align:m,alignOffset:g,arrowPadding:v,collisionBoundary:x,collisionPadding:b,sticky:w,hideWhenDetached:C,avoidCollisions:E}:{};return o.jsx(Z3,{scope:n,content:_,viewport:A,onViewportChange:D,itemRefCallback:P,selectedItem:M,onItemLeave:W,itemTextRefCallback:ee,focusSelectedItem:B,selectedItemText:Z,position:r,isPositioned:ae,searchRef:xe,children:o.jsx(Nf,{as:OW,allowPinchZoom:!0,children:o.jsx(_f,{asChild:!0,trapped:T.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Re(s,le=>{var Ne;(Ne=T.trigger)==null||Ne.focus({preventScroll:!0}),le.preventDefault()}),children:o.jsx($l,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:o.jsx(de,{role:"listbox",id:T.contentId,"data-state":T.open?"open":"closed",dir:T.dir,onContextMenu:le=>le.preventDefault(),...R,...ve,onPlaced:()=>F(!0),ref:j,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Re(R.onKeyDown,le=>{const Ne=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!Ne&&le.key.length===1&&L(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let Te=Y().filter(Be=>!Be.disabled).map(Be=>Be.ref.current);if(["ArrowUp","End"].includes(le.key)&&(Te=Te.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const Be=le.target,Xe=Te.indexOf(Be);Te=Te.slice(Xe+1)}setTimeout(()=>I(Te)),le.preventDefault()}})})})})})})});K3.displayName=DW;var MW="SelectItemAlignedPosition",Y3=p.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...s}=e,l=Ki(Fl,n),c=Yi(Fl,n),[d,f]=p.useState(null),[m,g]=p.useState(null),v=pt(t,j=>g(j)),x=Mg(n),b=p.useRef(!1),w=p.useRef(!0),{viewport:C,selectedItem:E,selectedItemText:R,focusSelectedItem:T}=c,_=p.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&m&&C&&E&&R){const j=l.trigger.getBoundingClientRect(),M=m.getBoundingClientRect(),z=l.valueNode.getBoundingClientRect(),Z=R.getBoundingClientRect();if(l.dir!=="rtl"){const Be=Z.left-M.left,Xe=z.left-Be,Vt=j.left-Xe,jt=j.width+Vt,$t=Math.max(jt,M.width),Me=window.innerWidth-ts,_t=PT(Xe,[ts,Math.max(ts,Me-$t)]);d.style.minWidth=jt+"px",d.style.left=_t+"px"}else{const Be=M.right-Z.right,Xe=window.innerWidth-z.right-Be,Vt=window.innerWidth-j.right-Xe,jt=j.width+Vt,$t=Math.max(jt,M.width),Me=window.innerWidth-ts,_t=PT(Xe,[ts,Math.max(ts,Me-$t)]);d.style.minWidth=jt+"px",d.style.right=_t+"px"}const K=x(),Y=window.innerHeight-ts*2,ae=C.scrollHeight,F=window.getComputedStyle(m),V=parseInt(F.borderTopWidth,10),I=parseInt(F.paddingTop,10),B=parseInt(F.borderBottomWidth,10),G=parseInt(F.paddingBottom,10),ie=V+I+ae+G+B,xe=Math.min(E.offsetHeight*5,ie),L=window.getComputedStyle(C),P=parseInt(L.paddingTop,10),W=parseInt(L.paddingBottom,10),ee=j.top+j.height/2-ts,de=Y-ee,ve=E.offsetHeight/2,le=E.offsetTop+ve,Ne=V+I+le,we=ie-Ne;if(Ne<=ee){const Be=K.length>0&&E===K[K.length-1].ref.current;d.style.bottom="0px";const Xe=m.clientHeight-C.offsetTop-C.offsetHeight,Vt=Math.max(de,ve+(Be?W:0)+Xe+B),jt=Ne+Vt;d.style.height=jt+"px"}else{const Be=K.length>0&&E===K[0].ref.current;d.style.top="0px";const Vt=Math.max(ee,V+C.offsetTop+(Be?P:0)+ve)+we;d.style.height=Vt+"px",C.scrollTop=Ne-ee+C.offsetTop}d.style.margin=`${ts}px 0`,d.style.minHeight=xe+"px",d.style.maxHeight=Y+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[x,l.trigger,l.valueNode,d,m,C,E,R,l.dir,r]);wr(()=>_(),[_]);const[O,A]=p.useState();wr(()=>{m&&A(window.getComputedStyle(m).zIndex)},[m]);const D=p.useCallback(j=>{j&&w.current===!0&&(_(),T==null||T(),w.current=!1)},[_,T]);return o.jsx(IW,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:b,onScrollButtonChange:D,children:o.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:O},children:o.jsx(We.div,{...s,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});Y3.displayName=MW;var kW="SelectPopperPosition",q0=p.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:s=ts,...l}=e,c=kg(n);return o.jsx(Df,{...c,...l,ref:t,align:r,collisionPadding:s,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});q0.displayName=kW;var[IW,W1]=Pu(Fl,{}),Z0="SelectViewport",W3=p.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...s}=e,l=Yi(Z0,n),c=W1(Z0,n),d=pt(t,l.onViewportChange),f=p.useRef(0);return o.jsxs(o.Fragment,{children:[o.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),o.jsx(Og.Slot,{scope:n,children:o.jsx(We.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:Re(s.onScroll,m=>{const g=m.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:x}=c;if(x!=null&&x.current&&v){const b=Math.abs(f.current-g.scrollTop);if(b>0){const w=window.innerHeight-ts*2,C=parseFloat(v.style.minHeight),E=parseFloat(v.style.height),R=Math.max(C,E);if(R<w){const T=R+b,_=Math.min(w,T),O=T-_;v.style.height=_+"px",v.style.bottom==="0px"&&(g.scrollTop=O>0?O:0,v.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});W3.displayName=Z0;var Q3="SelectGroup",[LW,PW]=Pu(Q3),X3=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=Dn();return o.jsx(LW,{scope:n,id:s,children:o.jsx(We.div,{role:"group","aria-labelledby":s,...r,ref:t})})});X3.displayName=Q3;var J3="SelectLabel",UW=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=PW(J3,n);return o.jsx(We.div,{id:s.id,...r,ref:t})});UW.displayName=J3;var kp="SelectItem",[FW,eD]=Pu(kp),tD=p.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:s=!1,textValue:l,...c}=e,d=Ki(kp,n),f=Yi(kp,n),m=d.value===r,[g,v]=p.useState(l??""),[x,b]=p.useState(!1),w=pt(t,T=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,T,r,s)}),C=Dn(),E=p.useRef("touch"),R=()=>{s||(d.onValueChange(r),d.onOpenChange(!1))};if(r==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return o.jsx(FW,{scope:n,value:r,disabled:s,textId:C,isSelected:m,onItemTextChange:p.useCallback(T=>{v(_=>_||((T==null?void 0:T.textContent)??"").trim())},[]),children:o.jsx(Og.ItemSlot,{scope:n,value:r,disabled:s,textValue:g,children:o.jsx(We.div,{role:"option","aria-labelledby":C,"data-highlighted":x?"":void 0,"aria-selected":m&&x,"data-state":m?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...c,ref:w,onFocus:Re(c.onFocus,()=>b(!0)),onBlur:Re(c.onBlur,()=>b(!1)),onClick:Re(c.onClick,()=>{E.current!=="mouse"&&R()}),onPointerUp:Re(c.onPointerUp,()=>{E.current==="mouse"&&R()}),onPointerDown:Re(c.onPointerDown,T=>{E.current=T.pointerType}),onPointerMove:Re(c.onPointerMove,T=>{var _;E.current=T.pointerType,s?(_=f.onItemLeave)==null||_.call(f):E.current==="mouse"&&T.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Re(c.onPointerLeave,T=>{var _;T.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Re(c.onKeyDown,T=>{var O;((O=f.searchRef)==null?void 0:O.current)!==""&&T.key===" "||(EW.includes(T.key)&&R(),T.key===" "&&T.preventDefault())})})})})});tD.displayName=kp;var Zd="SelectItemText",nD=p.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:s,...l}=e,c=Ki(Zd,n),d=Yi(Zd,n),f=eD(Zd,n),m=_W(Zd,n),[g,v]=p.useState(null),x=pt(t,R=>v(R),f.onItemTextChange,R=>{var T;return(T=d.itemTextRefCallback)==null?void 0:T.call(d,R,f.value,f.disabled)}),b=g==null?void 0:g.textContent,w=p.useMemo(()=>o.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:C,onNativeOptionRemove:E}=m;return wr(()=>(C(w),()=>E(w)),[C,E,w]),o.jsxs(o.Fragment,{children:[o.jsx(We.span,{id:f.textId,...l,ref:x}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?is.createPortal(l.children,c.valueNode):null]})});nD.displayName=Zd;var rD="SelectItemIndicator",aD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return eD(rD,n).isSelected?o.jsx(We.span,{"aria-hidden":!0,...r,ref:t}):null});aD.displayName=rD;var K0="SelectScrollUpButton",sD=p.forwardRef((e,t)=>{const n=Yi(K0,e.__scopeSelect),r=W1(K0,e.__scopeSelect),[s,l]=p.useState(!1),c=pt(t,r.onScrollButtonChange);return wr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollTop>0;l(m)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(iD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});sD.displayName=K0;var Y0="SelectScrollDownButton",oD=p.forwardRef((e,t)=>{const n=Yi(Y0,e.__scopeSelect),r=W1(Y0,e.__scopeSelect),[s,l]=p.useState(!1),c=pt(t,r.onScrollButtonChange);return wr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const m=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<m;l(g)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),s?o.jsx(iD,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});oD.displayName=Y0;var iD=p.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...s}=e,l=Yi("SelectScrollButton",n),c=p.useRef(null),d=Mg(n),f=p.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return p.useEffect(()=>()=>f(),[f]),wr(()=>{var g;const m=d().find(v=>v.ref.current===document.activeElement);(g=m==null?void 0:m.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),o.jsx(We.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:Re(s.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Re(s.onPointerMove,()=>{var m;(m=l.onItemLeave)==null||m.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Re(s.onPointerLeave,()=>{f()})})}),zW="SelectSeparator",lD=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return o.jsx(We.div,{"aria-hidden":!0,...r,ref:t})});lD.displayName=zW;var W0="SelectArrow",VW=p.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,s=kg(n),l=Ki(W0,n),c=Yi(W0,n);return l.open&&c.position==="popper"?o.jsx(Of,{...s,...r,ref:t}):null});VW.displayName=W0;var HW="SelectBubbleInput",cD=p.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const s=p.useRef(null),l=pt(r,s),c=Y1(t);return p.useEffect(()=>{const d=s.current;if(!d)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&g){const v=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(v)}},[c,t]),o.jsx(We.select,{...n,style:{...xN,...n.style},ref:l,defaultValue:t})});cD.displayName=HW;function uD(e){return e===""||e===void 0}function dD(e){const t=ds(e),n=p.useRef(""),r=p.useRef(0),s=p.useCallback(c=>{const d=n.current+c;t(d),(function f(m){n.current=m,window.clearTimeout(r.current),m!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(d)},[t]),l=p.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,s,l]}function fD(e,t,n){const s=t.length>1&&Array.from(t).every(m=>m===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=$W(e,Math.max(l,0));s.length===1&&(c=c.filter(m=>m!==n));const f=c.find(m=>m.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function $W(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var BW=F3,GW=V3,qW=$3,ZW=B3,KW=G3,YW=q3,WW=W3,QW=X3,XW=tD,JW=nD,eQ=aD,tQ=sD,nQ=oD,rQ=lD;function Ca({...e}){return o.jsx(BW,{"data-slot":"select",...e})}function Ig({...e}){return o.jsx(QW,{"data-slot":"select-group",...e})}function wa({...e}){return o.jsx(qW,{"data-slot":"select-value",...e})}function Ea({className:e,size:t="default",children:n,...r}){return o.jsxs(GW,{"data-slot":"select-trigger","data-size":t,className:J("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,o.jsx(ZW,{asChild:!0,children:o.jsx(Ka,{className:"size-4 opacity-50"})})]})}function Ra({className:e,children:t,position:n="popper",...r}){return o.jsx(KW,{children:o.jsxs(YW,{"data-slot":"select-content",className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[o.jsx(sQ,{}),o.jsx(WW,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),o.jsx(oQ,{})]})})}function Zn({className:e,children:t,...n}){return o.jsxs(XW,{"data-slot":"select-item",className:J("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[o.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:o.jsx(eQ,{children:o.jsx(fr,{className:"size-4"})})}),o.jsx(JW,{children:t})]})}function aQ({className:e,...t}){return o.jsx(rQ,{"data-slot":"select-separator",className:J("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function sQ({className:e,...t}){return o.jsx(tQ,{"data-slot":"select-scroll-up-button",className:J("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Us,{className:"size-4"})})}function oQ({className:e,...t}){return o.jsx(nQ,{"data-slot":"select-scroll-down-button",className:J("flex cursor-default items-center justify-center py-1",e),...t,children:o.jsx(Ka,{className:"size-4"})})}const iQ=ln({title:cn().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:cn().min(1,"Storage is required")});function lQ(){const{createDataMart:e,isLoading:t,error:n}=Gi();return{handleCreate:p.useCallback(async s=>{try{return await e(s)}catch(l){return console.error(l),null}},[e]),isSubmitting:t,serverError:n}}function cQ(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,reset:b,dataMart:w,isLoading:C,error:E,getErrorMessage:R,runs:T}=Gi();return p.useEffect(()=>(e?t(e):b(),()=>{b()}),[e,t,b]),{dataMart:w,isLoading:C,error:E,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:s,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:m,cancelDataMartRun:g,getDataMartRuns:v,loadMoreDataMartRuns:x,runs:T,getDataMart:t}}const UT=(e,t,n)=>{if(e&&"reportValidity"in e){const r=Ae(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},Q0=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?UT(r.ref,n,e):r&&r.refs&&r.refs.forEach(s=>UT(s,n,e))}},FT=(e,t)=>{t.shouldUseNativeValidation&&Q0(e,t);const n={};for(const r in e){const s=Ae(t.fields,r),l=Object.assign(e[r]||{},{ref:s&&s.ref});if(uQ(t.names||Object.keys(e),r)){const c=Object.assign({},Ae(n,r));Kt(c,"root",l),Kt(n,r,c)}else Kt(n,r,l)}return n},uQ=(e,t)=>{const n=zT(t);return e.some(r=>zT(r).match(`^${n}\\.\\d+`))};function zT(e){return e.replace(/\]|\[/g,"")}function hD(e,t,n){function r(d,f){var m;Object.defineProperty(d,"_zod",{value:d._zod??{},enumerable:!1}),(m=d._zod).traits??(m.traits=new Set),d._zod.traits.add(e),t(d,f);for(const g in c.prototype)g in d||Object.defineProperty(d,g,{value:c.prototype[g].bind(d)});d._zod.constr=c,d._zod.def=f}const s=(n==null?void 0:n.Parent)??Object;class l extends s{}Object.defineProperty(l,"name",{value:e});function c(d){var f;const m=n!=null&&n.Parent?new l:this;r(m,d),(f=m._zod).deferred??(f.deferred=[]);for(const g of m._zod.deferred)g();return m}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var f,m;return n!=null&&n.Parent&&d instanceof n.Parent?!0:(m=(f=d==null?void 0:d._zod)==null?void 0:f.traits)==null?void 0:m.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class dQ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const fQ={};function mD(e){return fQ}function hQ(e,t){return typeof t=="bigint"?t.toString():t}const pD=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function km(e){return typeof e=="string"?e:e==null?void 0:e.message}function gD(e,t,n){var s,l,c,d,f,m;const r={...e,path:e.path??[]};if(!e.message){const g=km((c=(l=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:l.error)==null?void 0:c.call(l,e))??km((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??km((f=n.customError)==null?void 0:f.call(n,e))??km((m=n.localeError)==null?void 0:m.call(n,e))??"Invalid input";r.message=g}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const vD=(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,hQ,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},mQ=hD("$ZodError",vD),yD=hD("$ZodError",vD,{Parent:Error}),pQ=e=>(t,n,r,s)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new dQ;if(c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>gD(f,l,mD())));throw pD(d,s==null?void 0:s.callee),d}return c.value},gQ=pQ(yD),vQ=e=>async(t,n,r,s)=>{const l=r?Object.assign(r,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise&&(c=await c),c.issues.length){const d=new((s==null?void 0:s.Err)??e)(c.issues.map(f=>gD(f,l,mD())));throw pD(d,s==null?void 0:s.callee),d}return c.value},yQ=vQ(yD);function VT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function xQ(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if("unionErrors"in r){var d=r.unionErrors[0].errors[0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if("unionErrors"in r&&r.unionErrors.forEach(function(g){return g.errors.forEach(function(v){return e.push(v)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=q1(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function bQ(e,t){for(var n={};e.length;){var r=e[0],s=r.code,l=r.message,c=r.path.join(".");if(!n[c])if(r.code==="invalid_union"&&r.errors.length>0){var d=r.errors[0][0];n[c]={message:d.message,type:d.code}}else n[c]={message:l,type:s};if(r.code==="invalid_union"&&r.errors.forEach(function(g){return g.forEach(function(v){return e.push(v)})}),t){var f=n[c].types,m=f&&f[r.code];n[c]=q1(c,t,n,s,m?[].concat(m,r.message):r.message)}e.shift()}return n}function Jl(e,t,n){if(n===void 0&&(n={}),(function(r){return"_def"in r&&typeof r._def=="object"&&"typeName"in r._def})(e))return function(r,s,l){try{return Promise.resolve(VT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&Q0({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return Array.isArray(d==null?void 0:d.issues)})(c))return{values:{},errors:FT(xQ(c.errors,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};if((function(r){return"_zod"in r&&typeof r._zod=="object"})(e))return function(r,s,l){try{return Promise.resolve(VT(function(){return Promise.resolve((n.mode==="sync"?gQ:yQ)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&Q0({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof mQ})(c))return{values:{},errors:FT(bQ(c.issues,!l.shouldUseNativeValidation&&l.criteriaMode==="all"),l)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const xD=p.createContext(void 0);function SQ(){const e=p.useContext(xD);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var It=(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))(It||{});const CQ={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function wQ(e,t){switch(t.type){case It.FETCH_STORAGES_START:case It.FETCH_STORAGE_START:case It.CREATE_STORAGE_START:case It.UPDATE_STORAGE_START:return{...e,error:null};case It.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case It.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case It.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case It.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case It.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 It.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case It.FETCH_STORAGES_ERROR:case It.FETCH_STORAGE_ERROR:case It.CREATE_STORAGE_ERROR:case It.UPDATE_STORAGE_ERROR:case It.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case It.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case It.CLEAR_ERROR:return{...e,error:null};default:return e}}function Q1({children:e}){const[t,n]=p.useReducer(wQ,CQ);return o.jsx(xD.Provider,{value:{state:t,dispatch:n},children:e})}class EQ extends Zl{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 Fd=new EQ;function Lg(){const{state:e,dispatch:t}=SQ(),n=p.useCallback(async()=>{t({type:It.FETCH_STORAGES_START});try{const f=await Fd.getDataStorages();t({type:It.FETCH_STORAGES_SUCCESS,payload:f.map(IY)})}catch(f){throw t({type:It.FETCH_STORAGES_ERROR,payload:bn(f)}),f}},[t]),r=p.useCallback(async f=>{try{const m=await Fd.getDataStorageById(f),g=Jm(m);t({type:It.FETCH_STORAGE_SUCCESS,payload:g})}catch(m){throw t({type:It.FETCH_STORAGE_ERROR,payload:bn(m)}),m}},[t]),s=p.useCallback(async f=>{t({type:It.CREATE_STORAGE_START});try{const m=LY(f),g=await Fd.createDataStorage(m),v=Jm(g);return t({type:It.CREATE_STORAGE_SUCCESS,payload:v}),Ue({event:"data_storage_created",category:"DataStorage",action:"Create",label:v.type}),Ot.success("Storage created"),v}catch(m){return t({type:It.CREATE_STORAGE_ERROR,payload:bn(m)}),null}},[t]),l=p.useCallback(async(f,m)=>{t({type:It.UPDATE_STORAGE_START});try{const g=kY(m),v=await Fd.updateDataStorage(f,g),x=Jm(v);return t({type:It.UPDATE_STORAGE_SUCCESS,payload:x}),Ue({event:"data_storage_updated",category:"DataStorage",action:"Update",label:x.type}),Ot.success("Storage updated"),x}catch(g){return t({type:It.UPDATE_STORAGE_ERROR,payload:bn(g)}),null}},[t]),c=p.useCallback(async f=>{t({type:It.DELETE_STORAGE_START});try{await Fd.deleteDataStorage(f),t({type:It.DELETE_STORAGE_SUCCESS,payload:f}),Ue({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),Ot.success("Storage deleted")}catch(m){throw t({type:It.DELETE_STORAGE_ERROR,payload:bn(m)}),m}},[t]),d=p.useCallback(()=>{t({type:It.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:s,updateDataStorage:l,deleteDataStorage:c,clearCurrentDataStorage:d}}const bD=({isOpen:e,onClose:t,onSelect:n})=>o.jsx(L1,{open:e,onOpenChange:t,children:o.jsxs(P1,{className:"sm:max-w-sm",children:[o.jsxs(U1,{children:[o.jsx(F1,{children:"New Storage"}),o.jsx(z1,{children:"Choose the type of storage you want to create"})]}),o.jsx("div",{className:"flex flex-col gap-4 py-4",children:Bi.getAllTypes().map(r=>{const s=r.icon,l=r.status===Co.ACTIVE;return o.jsxs(be,{variant:"outline",className:"flex px-4 py-6",onClick:()=>void n(r.type),disabled:!l,children:[o.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[o.jsx(s,{size:24}),o.jsx("span",{className:"font-medium",children:r.displayName})]}),!l&&o.jsx(Cr,{variant:"secondary",children:"Coming soon"})]},r.type)})})]})});function RQ({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:s}=lQ(),{dataStorages:l,loading:c,fetchDataStorages:d,createDataStorage:f,getDataStorageById:m}=Lg(),[g,v]=p.useState(!1);p.useEffect(()=>{d()},[d]);const x=qi({resolver:Jl(iQ),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async E=>{const R=await n(E);R&&t&&t(R)},w=()=>{v(!0)},C=async E=>{try{const R=await f(E);R!=null&&R.id&&(await m(R.id),x.setValue("storageId",R.id))}catch(R){console.error("Failed to create storage:",R)}v(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(Wl,{...x,children:o.jsxs(Zi,{onSubmit:E=>{x.handleSubmit(b)(E)},children:[o.jsxs(Ql,{variant:"light",children:[s&&o.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:s.message}),o.jsx(Jt,{control:x.control,name:"title",render:({field:E})=>o.jsxs(en,{children:[o.jsx(tn,{children:"Title"}),o.jsx(nn,{children:o.jsx(Ht,{id:"title",placeholder:"Enter title",...E,disabled:r})}),o.jsx(un,{})]})}),o.jsx(Jt,{control:x.control,name:"storageId",render:({field:E})=>o.jsxs(en,{children:[o.jsx(tn,{children:"Storage"}),o.jsx(nn,{children:o.jsxs(Ca,{onValueChange:R=>{R==="create_new"?w():E.onChange(R)},value:E.value,disabled:r||c,children:[o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a storage"})}),o.jsx(Ra,{children:o.jsxs(Ig,{children:[c&&o.jsx(Zn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&l.map(R=>{const T=Bi.getInfo(R.type).icon;return o.jsx(Zn,{value:R.id,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(T,{size:20}),o.jsx("span",{children:R.title})]})},R.id)}),!c&&l.length>0&&o.jsx(aQ,{}),o.jsx(Zn,{value:"create_new",children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:o.jsx(ja,{size:20})}),o.jsx("span",{children:"Create new storage"})]})})]})})]})}),o.jsx(un,{})]})})]}),o.jsxs(Xl,{variant:"light",children:[o.jsx(be,{type:"submit",children:"Create Data Mart"}),o.jsx(be,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),o.jsx(bD,{isOpen:g,onClose:()=>{v(!1)},onSelect:E=>C(E)})]})}function TQ({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:s="200px"}){const[l,c]=p.useState(e),[d,f]=p.useState(!1),m=p.useRef(null);p.useEffect(()=>{c(e)},[e]),p.useEffect(()=>{m.current&&(m.current.style.height="auto",m.current.style.height=`${String(m.current.scrollHeight)}px`)},[l]);const g=async()=>{if(l.trim()===""){c(e);return}if(l.trim()!==e)try{f(!0),await t(l.trim())}catch(x){c(e),console.error(x)}finally{f(!1)}},v=x=>{if(x.key==="Enter"&&!x.shiftKey){if(x.preventDefault(),l.trim()===""){Ot.error(r),c(e);return}g()}else x.key==="Escape"&&c(e)};return o.jsx("h2",{className:J("m-0 cursor-pointer p-0 hover:opacity-80",n),children:o.jsx(Hi,{ref:m,value:l,onChange:x=>{c(x.target.value);const b=x.target;b.style.height="auto",b.style.height=`${String(b.scrollHeight)}px`},onBlur:()=>void g(),onKeyDown:v,className:J("m-0 w-full border-0 p-0 shadow-none","bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0",{"opacity-50":d}),style:{fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",fontFamily:"inherit",color:"inherit",resize:"none",overflow:"hidden",minHeight:"inherit",height:"auto",minWidth:s},disabled:d})})}var qc=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(qc||{}),SD=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))(SD||{});function jQ({configuration:e,onClose:t,onSubmit:n}){const[r,s]=p.useState(new Set),l=p.useId(),c=qi({defaultValues:{runType:qc.INCREMENTAL}}),{loading:d,loadingSpecification:f,connectorSpecification:m,fetchConnectorSpecification:g}=Yl(),v=p.useCallback(async C=>{!r.has(C)&&!f&&(s(E=>new Set(E).add(C)),await g(C))},[r,f,g]);p.useEffect(()=>{e!=null&&e.connector.source.name&&v(e.connector.source.name)},[e,d,v]);const x=C=>{n&&n(C)},b=()=>{t&&t()},w=C=>{if(!C)return"text";switch(C){case rs.DATE:return"date";case rs.NUMBER:return"number";default:return"text"}};return f?o.jsx("div",{children:"Loading..."}):m?o.jsx(Wl,{...c,children:o.jsxs(Zi,{id:l,noValidate:!0,onSubmit:C=>void c.handleSubmit(x)(C),children:[o.jsxs(Ql,{children:[o.jsx(Vs,{title:"General",children:o.jsx(Jt,{control:c.control,name:"runType",render:({field:C})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),o.jsx(nn,{children:o.jsxs(o.Fragment,{children:[o.jsx(CW,{options:[{value:qc.INCREMENTAL,label:"Incremental load"},{value:qc.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:C.value,onChange:C.onChange,orientation:"horizontal"}),o.jsx(or,{children:c.watch("runType")===qc.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")===qc.MANUAL_BACKFILL&&o.jsx(Vs,{title:"Run configuration",children:m.filter(C=>{var E;return(E=C.attributes)==null?void 0:E.includes(SD.MANUAL_BACKFILL)}).map(C=>o.jsx(Jt,{control:c.control,name:`data.${C.name}`,render:()=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:C.description,children:C.title??C.name}),o.jsx(nn,{children:o.jsx(Ht,{id:C.name,placeholder:C.description,type:w(C.requiredType),defaultValue:typeof C.default=="string"||typeof C.default=="number"?C.default.toString():void 0,...c.register(`data.${C.name}`,{required:!0})})}),o.jsx(un,{})]},C.name)}))})]}),o.jsxs(Xl,{children:[o.jsx(be,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),o.jsx(be,{type:"button",variant:"outline",onClick:b,children:"Cancel"})]})]})}):o.jsx("div",{children:"No connector specification found"})}function _Q({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return o.jsx(Li,{open:e,onOpenChange:t,children:o.jsxs(Pi,{children:[o.jsx(Ui,{children:o.jsx(Fi,{children:"Manual Run"})}),o.jsx(jQ,{configuration:n,onClose:t,onSubmit:r})]})})}function CD({children:e,configuration:t,onManualRun:n,open:r}){const[s,l]=p.useState(r??!1),c=()=>{l(!0)},d=m=>{n(m),l(!1)},f=()=>e?o.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return o.jsxs(o.Fragment,{children:[f(),s&&o.jsx(yu,{children:o.jsx(_Q,{isOpen:s,onClose:()=>{l(!1)},configuration:t,onSubmit:d})})]})}var El=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(El||{});const NQ=1e3;function X1(e,t){const[n,r]=p.useState(!1),[s,l]=p.useState(null),c=p.useRef(null),d=p.useRef(null),f=p.useRef(!0),m=p.useRef(t);m.current=t;const g=p.useCallback(E=>{f.current&&r(E)},[]),v=p.useCallback(E=>{f.current&&l(E)},[]),x=p.useCallback((E,R)=>{const T=E instanceof Error?E.message:"Schema actualization failed";Ot.dismiss(R),v(T),g(!1),c.current=null,d.current=null,Ot.error(T,{duration:void 0,id:R})},[v,g]),b=p.useCallback(async()=>{var R;const E=c.current;if((R=d.current)==null||R.abort(),E){Ot.dismiss(E);try{await sn.abortSchemaActualizeTrigger(e,E)}catch{}}c.current=null,d.current=null,g(!1)},[e,g]),w=p.useCallback(async(E,R)=>{var _;const T=O=>O===El.SUCCESS||O===El.ERROR||O===El.CANCELLED;for(;!R.aborted&&c.current===E;)try{const O=await sn.getSchemaActualizeTriggerStatus(e,E);if(T(O)){try{const A=await sn.getSchemaActualizeTriggerResponse(e,E);if(Ot.dismiss(E),A.success)(_=m.current)==null||_.call(m),Ot.success("Output schema actualized",{duration:void 0,id:E});else{const D=A.error??"Schema actualization failed";v(D),Ot.error(D,{duration:void 0,id:E})}}catch(A){const D=A instanceof Error?A.message:"Schema actualization failed";Ot.dismiss(E),v(D),Ot.error(D,{duration:void 0,id:E})}g(!1),c.current=null,d.current=null;return}await new Promise(A=>setTimeout(A,NQ))}catch(O){x(O,E)}},[e,v,g,x]),C=p.useCallback(async()=>{c.current&&await b(),v(null),g(!0);try{const{triggerId:E}=await sn.createSchemaActualizeTrigger(e);Ot.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:E}),c.current=E;const R=new AbortController;d.current=R;try{await w(E,R.signal)}catch(T){x(T,E)}}catch(E){g(!1),v(E instanceof Error?E.message:"Failed to start schema actualization")}},[e,b,w,v,g,x]);return p.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const E=c.current;(R=d.current)==null||R.abort(),E&&(Ot.dismiss(E),sn.abortSchemaActualizeTrigger(e,E).catch(()=>{})),c.current=null,d.current=null}),[e]),{run:C,isLoading:n,cancel:b,error:s}}function AQ({id:e}){const{navigate:t}=Po(),{dataMart:n,deleteDataMart:r,updateDataMartTitle:s,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,publishDataMart:m,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,isLoading:w,error:C,getErrorMessage:E,runs:R,getDataMart:T}=cQ(e),[_,O]=p.useState(!1),[A,D]=p.useState(!1),j=(n==null?void 0:n.id)??"",M=p.useCallback(()=>{j&&T(j)},[j,T]),{run:z}=X1(j,M),Z=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],K=async F=>{n&&await s(n.id,F)},Y=async()=>{if(n){D(!0);try{await m(n.id),z()}catch(F){console.log(F instanceof Error?F.message:"Failed to publish Data Mart")}finally{D(!1)}}},ae=async F=>{if(n){if(n.status.code!==dr.PUBLISHED){on.error("Manual run is only available for published Data Marts");return}await g({id:n.id,payload:F})}};return n?o.jsxs("div",{className:"px-12 py-6",children:[o.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[o.jsx(su,{onClick:()=>{t("/data-marts")},variant:"ghost",size:"sm","aria-label":"Back to Data Marts",title:"Back to Data Marts",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:o.jsx(JI,{className:"h-5 w-5"})}),o.jsx(TQ,{title:n.title,onUpdate:K,className:"text-2xl font-medium"})]}),o.jsxs("div",{className:"flex items-center gap-2"+(A?" opacity-50":""),style:{minWidth:"120px"},children:[o.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{children:o.jsx(Gf,{type:n.status.code===dr.PUBLISHED?Nn.SUCCESS:Nn.NEUTRAL,variant:"subtle",children:n.status.displayName})})}),o.jsx(wt,{children:n.status.code===dr.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),n.status.code===dr.DRAFT&&o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{children:o.jsxs(su,{variant:"default",onClick:()=>{Y()},disabled:A||!n.canPublish,className:"ml-2 flex items-center gap-1",children:[o.jsx(Yp,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!n.canPublish&&o.jsxs(wt,{children:[o.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),n.validationErrors.length>0&&o.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:VZ(n.validationErrors).map((F,V)=>o.jsx("li",{children:F},V))})]})]})]}),o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(su,{variant:"ghost",children:o.jsx(P9,{className:"h-5 w-5"})})}),o.jsxs(jr,{align:"end",children:[n.definitionType===He.CONNECTOR&&o.jsxs(o.Fragment,{children:[o.jsx(CD,{configuration:n.definition??null,onManualRun:F=>{ae({runType:F.runType,data:F.data})},children:o.jsxs(yt,{onClick:F=>{F.preventDefault()},children:[o.jsx(_b,{className:"text-foreground h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})}),o.jsx(qa,{})]}),o.jsxs(yt,{onClick:()=>{O(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600"}),o.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),o.jsx("div",{children:o.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:Z.map(F=>o.jsx(wf,{to:F.path,className:({isActive:V})=>J("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",V?"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:F.name},F.name))})}),o.jsx("div",{className:"pt-4",children:o.jsx(Yj,{context:{dataMart:n,isLoading:w,error:C,getErrorMessage:E,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,runDataMart:g,cancelDataMartRun:v,getDataMartRuns:x,loadMoreDataMartRuns:b,runs:R,getDataMart:T}})}),o.jsx(na,{open:_,onOpenChange:O,title:"Delete Data Mart",description:o.jsxs(o.Fragment,{children:["Are you sure you want to delete ",o.jsxs("strong",{children:['"',n.title,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await r(n.id),O(!1),t("/data-marts")}catch(F){console.error("Failed to delete Data Mart:",F)}})()}})]}):o.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[o.jsx(as,{className:"h-16 w-full"},0),Array.from({length:3}).map((F,V)=>o.jsx(as,{className:"h-48 w-full"},V+1))]})}function DQ({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:s="100%",minHeight:l="100px"}){const[c,d]=p.useState(e??""),[f,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useRef(null);p.useEffect(()=>{d(e??"")},[e]),p.useEffect(()=>{if(x.current&&f){x.current.focus();const R=x.current.value.length;x.current.setSelectionRange(R,R),b(x.current)}},[f]);const b=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},w=R=>{d(R.target.value),b(R.target)},C=async()=>{const R=c.trim();if(R===(e??"")){m(!1);return}try{v(!0),await t(R===""?null:R),m(!1)}catch(_){console.error("Failed to update description:",_),d(e??"")}finally{v(!1)}},E=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),C()):R.key==="Escape"&&(R.preventDefault(),d(e??""),m(!1))};return f?o.jsxs("div",{className:"w-full",children:[o.jsx(Hi,{ref:x,value:c,onChange:w,onBlur:()=>void C(),onKeyDown:E,placeholder:r,className:J("m-0 w-full border-0 bg-white p-2 shadow-none dark:bg-white/4","focus-visible:ring-primary focus-visible:ring-0",{"opacity-50":g}),style:{fontSize:"inherit",lineHeight:"inherit",fontFamily:"inherit",resize:"vertical",minHeight:l,minWidth:s},disabled:g}),o.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[o.jsxs("span",{children:["Press"," ",o.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Ctrl+Enter"})," ","to save •"," "]}),o.jsxs("span",{children:[o.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Esc"})," ","to cancel •"," "]}),o.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):o.jsx("div",{className:"flex w-full items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:o.jsx("div",{onClick:()=>{m(!0)},className:J("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:s},children:e??r})})}function OQ(){const{dataMart:e,updateDataMartDescription:t}=gs(),n=async r=>{await t(e.id,r)};return o.jsx("div",{children:o.jsx(DQ,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function HT(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 MQ(e){if(Array.isArray(e))return e}function kQ(e,t,n){return(t=VQ(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function IQ(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,l,c,d=[],f=!0,m=!1;try{if(l=(n=n.call(e)).next,t!==0)for(;!(f=(r=l.call(n)).done)&&(d.push(r.value),d.length!==t);f=!0);}catch(g){m=!0,s=g}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(m)throw s}}return d}}function LQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
694
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $T(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 BT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$T(Object(n),!0).forEach(function(r){kQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$T(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function PQ(e,t){if(e==null)return{};var n,r,s=UQ(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function UQ(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 FQ(e,t){return MQ(e)||IQ(e,t)||HQ(e,t)||LQ()}function zQ(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 VQ(e){var t=zQ(e,"string");return typeof t=="symbol"?t:t+""}function HQ(e,t){if(e){if(typeof e=="string")return HT(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)?HT(e,t):void 0}}function $Q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GT(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 qT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?GT(Object(n),!0).forEach(function(r){$Q(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function BQ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){return t.reduceRight(function(s,l){return l(s)},r)}}function Kd(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(s,d))}}}function Ip(e){return{}.toString.call(e).includes("Object")}function GQ(e){return!Object.keys(e).length}function gf(e){return typeof e=="function"}function qQ(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ZQ(e,t){return Ip(t)||Ri("changeType"),Object.keys(t).some(function(n){return!qQ(e,n)})&&Ri("changeField"),t}function KQ(e){gf(e)||Ri("selectorType")}function YQ(e){gf(e)||Ip(e)||Ri("handlerType"),Ip(e)&&Object.values(e).some(function(t){return!gf(t)})&&Ri("handlersType")}function WQ(e){e||Ri("initialIsRequired"),Ip(e)||Ri("initialType"),GQ(e)&&Ri("initialContent")}function QQ(e,t){throw new Error(e[t]||e.default)}var XQ={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"},Ri=Kd(QQ)(XQ),Im={changes:ZQ,selector:KQ,handler:YQ,initial:WQ};function JQ(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Im.initial(e),Im.handler(t);var n={current:e},r=Kd(nX)(n,t),s=Kd(tX)(n),l=Kd(Im.changes)(e),c=Kd(eX)(n);function d(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return Im.selector(m),m(n.current)}function f(m){BQ(r,s,l,c)(m)}return[d,f]}function eX(e,t){return gf(t)?t(e.current):t}function tX(e,t){return e.current=qT(qT({},e.current),t),t}function nX(e,t,n){return gf(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 rX={create:JQ},aX={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function sX(e){return function t(){for(var n=this,r=arguments.length,s=new Array(r),l=0;l<r;l++)s[l]=arguments[l];return s.length>=e.length?e.apply(this,s):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(s,d))}}}function oX(e){return{}.toString.call(e).includes("Object")}function iX(e){return e||ZT("configIsRequired"),oX(e)||ZT("configType"),e.urls?(lX(),{paths:{vs:e.urls.monacoBase}}):e}function lX(){console.warn(wD.deprecation)}function cX(e,t){throw new Error(e[t]||e.default)}var wD={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!
|
|
695
|
-
You are using deprecated way of configuration.
|
|
696
|
-
|
|
697
|
-
Instead of using
|
|
698
|
-
monaco.config({ urls: { monacoBase: '...' } })
|
|
699
|
-
use
|
|
700
|
-
monaco.config({ paths: { vs: '...' } })
|
|
701
|
-
|
|
702
|
-
For more please check the link https://github.com/suren-atoyan/monaco-loader#config
|
|
703
|
-
`},ZT=sX(cX)(wD),uX={config:iX},dX=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(s){return n.reduceRight(function(l,c){return c(l)},s)}};function ED(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],ED(e[n],t[n]))}),BT(BT({},e),t)}var fX={type:"cancelation",msg:"operation is manually canceled"};function Gx(e){var t=!1,n=new Promise(function(r,s){e.then(function(l){return t?s(fX):r(l)}),e.catch(s)});return n.cancel=function(){return t=!0},n}var hX=["monaco"],mX=rX.create({config:aX,isInitialized:!1,resolve:null,reject:null,monaco:null}),RD=FQ(mX,2),Qf=RD[0],Pg=RD[1];function pX(e){var t=uX.config(e),n=t.monaco,r=PQ(t,hX);Pg(function(s){return{config:ED(s.config,r),monaco:n}})}function gX(){var e=Qf(function(t){var n=t.monaco,r=t.isInitialized,s=t.resolve;return{monaco:n,isInitialized:r,resolve:s}});if(!e.isInitialized){if(Pg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),Gx(qx);if(window.monaco&&window.monaco.editor)return TD(window.monaco),e.resolve(window.monaco),Gx(qx);dX(vX,xX)(bX)}return Gx(qx)}function vX(e){return document.body.appendChild(e)}function yX(e){var t=document.createElement("script");return e&&(t.src=e),t}function xX(e){var t=Qf(function(r){var s=r.config,l=r.reject;return{config:s,reject:l}}),n=yX("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function bX(){var e=Qf(function(n){var r=n.config,s=n.resolve,l=n.reject;return{config:r,resolve:s,reject:l}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;TD(r),e.resolve(r)},function(n){e.reject(n)})}function TD(e){Qf().monaco||Pg({monaco:e})}function SX(){return Qf(function(e){var t=e.monaco;return t})}var qx=new Promise(function(e,t){return Pg({resolve:e,reject:t})}),jD={config:pX,init:gX,__getMonacoInstance:SX},CX={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},Zx=CX,wX={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},EX=wX;function RX({children:e}){return _e.createElement("div",{style:EX.container},e)}var TX=RX,jX=TX;function _X({width:e,height:t,isEditorReady:n,loading:r,_ref:s,className:l,wrapperProps:c}){return _e.createElement("section",{style:{...Zx.wrapper,width:e,height:t},...c},!n&&_e.createElement(jX,null,r),_e.createElement("div",{ref:s,style:{...Zx.fullWidth,...!n&&Zx.hide},className:l}))}var NX=_X,_D=p.memo(NX);function AX(e){p.useEffect(e,[])}var ND=AX;function DX(e,t,n=!0){let r=p.useRef(!0);p.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var ha=DX;function Jd(){}function Qc(e,t,n,r){return OX(e,r)||MX(e,t,n,r)}function OX(e,t){return e.editor.getModel(AD(e,t))}function MX(e,t,n,r){return e.editor.createModel(t,n,r?AD(e,r):void 0)}function AD(e,t){return e.Uri.parse(t)}function kX({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:s,originalModelPath:l,modifiedModelPath:c,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:f=!1,theme:m="light",loading:g="Loading...",options:v={},height:x="100%",width:b="100%",className:w,wrapperProps:C={},beforeMount:E=Jd,onMount:R=Jd}){let[T,_]=p.useState(!1),[O,A]=p.useState(!0),D=p.useRef(null),j=p.useRef(null),M=p.useRef(null),z=p.useRef(R),Z=p.useRef(E),K=p.useRef(!1);ND(()=>{let V=jD.init();return V.then(I=>(j.current=I)&&A(!1)).catch(I=>(I==null?void 0:I.type)!=="cancelation"&&console.error("Monaco initialization: error:",I)),()=>D.current?F():V.cancel()}),ha(()=>{if(D.current&&j.current){let V=D.current.getOriginalEditor(),I=Qc(j.current,e||"",r||n||"text",l||"");I!==V.getModel()&&V.setModel(I)}},[l],T),ha(()=>{if(D.current&&j.current){let V=D.current.getModifiedEditor(),I=Qc(j.current,t||"",s||n||"text",c||"");I!==V.getModel()&&V.setModel(I)}},[c],T),ha(()=>{let V=D.current.getModifiedEditor();V.getOption(j.current.editor.EditorOption.readOnly)?V.setValue(t||""):t!==V.getValue()&&(V.executeEdits("",[{range:V.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),V.pushUndoStop())},[t],T),ha(()=>{var V,I;(I=(V=D.current)==null?void 0:V.getModel())==null||I.original.setValue(e||"")},[e],T),ha(()=>{let{original:V,modified:I}=D.current.getModel();j.current.editor.setModelLanguage(V,r||n||"text"),j.current.editor.setModelLanguage(I,s||n||"text")},[n,r,s],T),ha(()=>{var V;(V=j.current)==null||V.editor.setTheme(m)},[m],T),ha(()=>{var V;(V=D.current)==null||V.updateOptions(v)},[v],T);let Y=p.useCallback(()=>{var B;if(!j.current)return;Z.current(j.current);let V=Qc(j.current,e||"",r||n||"text",l||""),I=Qc(j.current,t||"",s||n||"text",c||"");(B=D.current)==null||B.setModel({original:V,modified:I})},[n,t,s,e,r,l,c]),ae=p.useCallback(()=>{var V;!K.current&&M.current&&(D.current=j.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...v}),Y(),(V=j.current)==null||V.editor.setTheme(m),_(!0),K.current=!0)},[v,m,Y]);p.useEffect(()=>{T&&z.current(D.current,j.current)},[T]),p.useEffect(()=>{!O&&!T&&ae()},[O,T,ae]);function F(){var I,B,G,ie;let V=(I=D.current)==null?void 0:I.getModel();d||((B=V==null?void 0:V.original)==null||B.dispose()),f||((G=V==null?void 0:V.modified)==null||G.dispose()),(ie=D.current)==null||ie.dispose()}return _e.createElement(_D,{width:b,height:x,isEditorReady:T,loading:g,_ref:M,className:w,wrapperProps:C})}var IX=kX;p.memo(IX);function LX(e){let t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}var PX=LX,Lm=new Map;function UX({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:s,path:l,theme:c="light",line:d,loading:f="Loading...",options:m={},overrideServices:g={},saveViewState:v=!0,keepCurrentModel:x=!1,width:b="100%",height:w="100%",className:C,wrapperProps:E={},beforeMount:R=Jd,onMount:T=Jd,onChange:_,onValidate:O=Jd}){let[A,D]=p.useState(!1),[j,M]=p.useState(!0),z=p.useRef(null),Z=p.useRef(null),K=p.useRef(null),Y=p.useRef(T),ae=p.useRef(R),F=p.useRef(),V=p.useRef(r),I=PX(l),B=p.useRef(!1),G=p.useRef(!1);ND(()=>{let L=jD.init();return L.then(P=>(z.current=P)&&M(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>Z.current?xe():L.cancel()}),ha(()=>{var P,W,ee,de;let L=Qc(z.current,e||r||"",t||s||"",l||n||"");L!==((P=Z.current)==null?void 0:P.getModel())&&(v&&Lm.set(I,(W=Z.current)==null?void 0:W.saveViewState()),(ee=Z.current)==null||ee.setModel(L),v&&((de=Z.current)==null||de.restoreViewState(Lm.get(l))))},[l],A),ha(()=>{var L;(L=Z.current)==null||L.updateOptions(m)},[m],A),ha(()=>{!Z.current||r===void 0||(Z.current.getOption(z.current.editor.EditorOption.readOnly)?Z.current.setValue(r):r!==Z.current.getValue()&&(G.current=!0,Z.current.executeEdits("",[{range:Z.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),Z.current.pushUndoStop(),G.current=!1))},[r],A),ha(()=>{var P,W;let L=(P=Z.current)==null?void 0:P.getModel();L&&s&&((W=z.current)==null||W.editor.setModelLanguage(L,s))},[s],A),ha(()=>{var L;d!==void 0&&((L=Z.current)==null||L.revealLine(d))},[d],A),ha(()=>{var L;(L=z.current)==null||L.editor.setTheme(c)},[c],A);let ie=p.useCallback(()=>{var L;if(!(!K.current||!z.current)&&!B.current){ae.current(z.current);let P=l||n,W=Qc(z.current,r||e||"",t||s||"",P||"");Z.current=(L=z.current)==null?void 0:L.editor.create(K.current,{model:W,automaticLayout:!0,...m},g),v&&Z.current.restoreViewState(Lm.get(P)),z.current.editor.setTheme(c),d!==void 0&&Z.current.revealLine(d),D(!0),B.current=!0}},[e,t,n,r,s,l,m,g,v,c,d]);p.useEffect(()=>{A&&Y.current(Z.current,z.current)},[A]),p.useEffect(()=>{!j&&!A&&ie()},[j,A,ie]),V.current=r,p.useEffect(()=>{var L,P;A&&_&&((L=F.current)==null||L.dispose(),F.current=(P=Z.current)==null?void 0:P.onDidChangeModelContent(W=>{G.current||_(Z.current.getValue(),W)}))},[A,_]),p.useEffect(()=>{if(A){let L=z.current.editor.onDidChangeMarkers(P=>{var ee;let W=(ee=Z.current.getModel())==null?void 0:ee.uri;if(W&&P.find(de=>de.path===W.path)){let de=z.current.editor.getModelMarkers({resource:W});O==null||O(de)}});return()=>{L==null||L.dispose()}}return()=>{}},[A,O]);function xe(){var L,P;(L=F.current)==null||L.dispose(),x?v&&Lm.set(l,Z.current.saveViewState()):(P=Z.current.getModel())==null||P.dispose(),Z.current.dispose()}return _e.createElement(_D,{width:b,height:w,isEditorReady:A,loading:f,_ref:K,className:C,wrapperProps:E})}var FX=UX,zX=p.memo(FX);function VX({initialValue:e,onChange:t}){const[n,r]=p.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:s}=v4();p.useEffect(()=>{e!=null&&e.sqlQuery&&e.sqlQuery!==n&&r(e.sqlQuery)},[e,n]);function l(c){c!==void 0&&(r(c),t({sqlQuery:c}))}return o.jsx("div",{className:"shadow-xs",children:o.jsx(zX,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:l,theme:s==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function X0({icon:e,title:t,subtitle:n,rightContent:r,onClick:s,className:l}){const c=e;return o.jsxs("div",{className:J("group flex items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",s&&"cursor-pointer dark:hover:bg-white/5",l),onClick:s,children:[o.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&o.jsx("div",{className:"flex items-center justify-center",children:o.jsx(c,{className:"h-6 w-6"})}),o.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[o.jsx("div",{className:"text-md font-medium",children:t}),n&&o.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),o.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,s&&o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:o.jsx(Ta,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var KT=1,HX=.9,$X=.8,BX=.17,Kx=.1,Yx=.999,GX=.9999,qX=.99,ZX=/[\\\/_+.#"@\[\(\{&]/,KX=/[\\\/_+.#"@\[\(\{&]/g,YX=/[\s-]/,DD=/[\s-]/g;function J0(e,t,n,r,s,l,c){if(l===t.length)return s===e.length?KT:qX;var d=`${s},${l}`;if(c[d]!==void 0)return c[d];for(var f=r.charAt(l),m=n.indexOf(f,s),g=0,v,x,b,w;m>=0;)v=J0(e,t,n,r,m+1,l+1,c),v>g&&(m===s?v*=KT:ZX.test(e.charAt(m-1))?(v*=$X,b=e.slice(s,m-1).match(KX),b&&s>0&&(v*=Math.pow(Yx,b.length))):YX.test(e.charAt(m-1))?(v*=HX,w=e.slice(s,m-1).match(DD),w&&s>0&&(v*=Math.pow(Yx,w.length))):(v*=BX,s>0&&(v*=Math.pow(Yx,m-s))),e.charAt(m)!==t.charAt(l)&&(v*=GX)),(v<Kx&&n.charAt(m-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(m-1)!==r.charAt(l))&&(x=J0(e,t,n,r,m+1,l+2,c),x*Kx>v&&(v=x*Kx)),v>g&&(g=v),m=n.indexOf(f,m+1);return c[d]=g,g}function YT(e){return e.toLowerCase().replace(DD," ")}function WX(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,J0(e,t,YT(e),YT(t),0,0,{})}var zd='[cmdk-group=""]',Wx='[cmdk-group-items=""]',QX='[cmdk-group-heading=""]',OD='[cmdk-item=""]',WT=`${OD}:not([aria-disabled="true"])`,eb="cmdk-item-select",Zc="data-value",XX=(e,t,n)=>WX(e,t,n),MD=p.createContext(void 0),Xf=()=>p.useContext(MD),kD=p.createContext(void 0),J1=()=>p.useContext(kD),ID=p.createContext(void 0),LD=p.forwardRef((e,t)=>{let n=Kc(()=>{var P,W;return{search:"",value:(W=(P=e.value)!=null?P:e.defaultValue)!=null?W:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Kc(()=>new Set),s=Kc(()=>new Map),l=Kc(()=>new Map),c=Kc(()=>new Set),d=PD(e),{label:f,children:m,value:g,onValueChange:v,filter:x,shouldFilter:b,loop:w,disablePointerSelection:C=!1,vimBindings:E=!0,...R}=e,T=Dn(),_=Dn(),O=Dn(),A=p.useRef(null),D=cJ();zl(()=>{if(g!==void 0){let P=g.trim();n.current.value=P,j.emit()}},[g]),zl(()=>{D(6,ae)},[]);let j=p.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,W,ee)=>{var de,ve,le,Ne;if(!Object.is(n.current[P],W)){if(n.current[P]=W,P==="search")Y(),Z(),D(1,K);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let we=document.getElementById(O);we?we.focus():(de=document.getElementById(T))==null||de.focus()}if(D(7,()=>{var we;n.current.selectedItemId=(we=F())==null?void 0:we.id,j.emit()}),ee||D(5,ae),((ve=d.current)==null?void 0:ve.value)!==void 0){let we=W??"";(Ne=(le=d.current).onValueChange)==null||Ne.call(le,we);return}}j.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),M=p.useMemo(()=>({value:(P,W,ee)=>{var de;W!==((de=l.current.get(P))==null?void 0:de.value)&&(l.current.set(P,{value:W,keywords:ee}),n.current.filtered.items.set(P,z(W,ee)),D(2,()=>{Z(),j.emit()}))},item:(P,W)=>(r.current.add(P),W&&(s.current.has(W)?s.current.get(W).add(P):s.current.set(W,new Set([P]))),D(3,()=>{Y(),Z(),n.current.value||K(),j.emit()}),()=>{l.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let ee=F();D(4,()=>{Y(),(ee==null?void 0:ee.getAttribute("id"))===P&&K(),j.emit()})}),group:P=>(s.current.has(P)||s.current.set(P,new Set),()=>{l.current.delete(P),s.current.delete(P)}),filter:()=>d.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:T,inputId:O,labelId:_,listInnerRef:A}),[]);function z(P,W){var ee,de;let ve=(de=(ee=d.current)==null?void 0:ee.filter)!=null?de:XX;return P?ve(P,n.current.search,W):0}function Z(){if(!n.current.search||d.current.shouldFilter===!1)return;let P=n.current.filtered.items,W=[];n.current.filtered.groups.forEach(de=>{let ve=s.current.get(de),le=0;ve.forEach(Ne=>{let we=P.get(Ne);le=Math.max(we,le)}),W.push([de,le])});let ee=A.current;V().sort((de,ve)=>{var le,Ne;let we=de.getAttribute("id"),Te=ve.getAttribute("id");return((le=P.get(Te))!=null?le:0)-((Ne=P.get(we))!=null?Ne:0)}).forEach(de=>{let ve=de.closest(Wx);ve?ve.appendChild(de.parentElement===ve?de:de.closest(`${Wx} > *`)):ee.appendChild(de.parentElement===ee?de:de.closest(`${Wx} > *`))}),W.sort((de,ve)=>ve[1]-de[1]).forEach(de=>{var ve;let le=(ve=A.current)==null?void 0:ve.querySelector(`${zd}[${Zc}="${encodeURIComponent(de[0])}"]`);le==null||le.parentElement.appendChild(le)})}function K(){let P=V().find(ee=>ee.getAttribute("aria-disabled")!=="true"),W=P==null?void 0:P.getAttribute(Zc);j.setState("value",W||void 0)}function Y(){var P,W,ee,de;if(!n.current.search||d.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let ve=0;for(let le of r.current){let Ne=(W=(P=l.current.get(le))==null?void 0:P.value)!=null?W:"",we=(de=(ee=l.current.get(le))==null?void 0:ee.keywords)!=null?de:[],Te=z(Ne,we);n.current.filtered.items.set(le,Te),Te>0&&ve++}for(let[le,Ne]of s.current)for(let we of Ne)if(n.current.filtered.items.get(we)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ve}function ae(){var P,W,ee;let de=F();de&&(((P=de.parentElement)==null?void 0:P.firstChild)===de&&((ee=(W=de.closest(zd))==null?void 0:W.querySelector(QX))==null||ee.scrollIntoView({block:"nearest"})),de.scrollIntoView({block:"nearest"}))}function F(){var P;return(P=A.current)==null?void 0:P.querySelector(`${OD}[aria-selected="true"]`)}function V(){var P;return Array.from(((P=A.current)==null?void 0:P.querySelectorAll(WT))||[])}function I(P){let W=V()[P];W&&j.setState("value",W.getAttribute(Zc))}function B(P){var W;let ee=F(),de=V(),ve=de.findIndex(Ne=>Ne===ee),le=de[ve+P];(W=d.current)!=null&&W.loop&&(le=ve+P<0?de[de.length-1]:ve+P===de.length?de[0]:de[ve+P]),le&&j.setState("value",le.getAttribute(Zc))}function G(P){let W=F(),ee=W==null?void 0:W.closest(zd),de;for(;ee&&!de;)ee=P>0?iJ(ee,zd):lJ(ee,zd),de=ee==null?void 0:ee.querySelector(WT);de?j.setState("value",de.getAttribute(Zc)):B(P)}let ie=()=>I(V().length-1),xe=P=>{P.preventDefault(),P.metaKey?ie():P.altKey?G(1):B(1)},L=P=>{P.preventDefault(),P.metaKey?I(0):P.altKey?G(-1):B(-1)};return p.createElement(We.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:P=>{var W;(W=R.onKeyDown)==null||W.call(R,P);let ee=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||ee))switch(P.key){case"n":case"j":{E&&P.ctrlKey&&xe(P);break}case"ArrowDown":{xe(P);break}case"p":case"k":{E&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),I(0);break}case"End":{P.preventDefault(),ie();break}case"Enter":{P.preventDefault();let de=F();if(de){let ve=new Event(eb);de.dispatchEvent(ve)}}}}},p.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:dJ},f),Ug(e,P=>p.createElement(kD.Provider,{value:j},p.createElement(MD.Provider,{value:M},P))))}),JX=p.forwardRef((e,t)=>{var n,r;let s=Dn(),l=p.useRef(null),c=p.useContext(ID),d=Xf(),f=PD(e),m=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;zl(()=>{if(!m)return d.item(s,c==null?void 0:c.id)},[m]);let g=UD(s,l,[e.value,e.children,l],e.keywords),v=J1(),x=Mi(D=>D.value&&D.value===g.current),b=Mi(D=>m||d.filter()===!1?!0:D.search?D.filtered.items.get(s)>0:!0);p.useEffect(()=>{let D=l.current;if(!(!D||e.disabled))return D.addEventListener(eb,w),()=>D.removeEventListener(eb,w)},[b,e.onSelect,e.disabled]);function w(){var D,j;C(),(j=(D=f.current).onSelect)==null||j.call(D,g.current)}function C(){v.setState("value",g.current,!0)}if(!b)return null;let{disabled:E,value:R,onSelect:T,forceMount:_,keywords:O,...A}=e;return p.createElement(We.div,{ref:Do(l,t),...A,id:s,"cmdk-item":"",role:"option","aria-disabled":!!E,"aria-selected":!!x,"data-disabled":!!E,"data-selected":!!x,onPointerMove:E||d.getDisablePointerSelection()?void 0:C,onClick:E?void 0:w},e.children)}),eJ=p.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:s,...l}=e,c=Dn(),d=p.useRef(null),f=p.useRef(null),m=Dn(),g=Xf(),v=Mi(b=>s||g.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);zl(()=>g.group(c),[]),UD(c,d,[e.value,e.heading,f]);let x=p.useMemo(()=>({id:c,forceMount:s}),[s]);return p.createElement(We.div,{ref:Do(d,t),...l,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},n&&p.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:m},n),Ug(e,b=>p.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?m:void 0},p.createElement(ID.Provider,{value:x},b))))}),tJ=p.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,s=p.useRef(null),l=Mi(c=>!c.search);return!n&&!l?null:p.createElement(We.div,{ref:Do(s,t),...r,"cmdk-separator":"",role:"separator"})}),nJ=p.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,s=e.value!=null,l=J1(),c=Mi(m=>m.search),d=Mi(m=>m.selectedItemId),f=Xf();return p.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),p.createElement(We.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:s?e.value:c,onChange:m=>{s||l.setState("search",m.target.value),n==null||n(m.target.value)}})}),rJ=p.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...s}=e,l=p.useRef(null),c=p.useRef(null),d=Mi(m=>m.selectedItemId),f=Xf();return p.useEffect(()=>{if(c.current&&l.current){let m=c.current,g=l.current,v,x=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let b=m.offsetHeight;g.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(m),()=>{cancelAnimationFrame(v),x.unobserve(m)}}},[]),p.createElement(We.div,{ref:Do(l,t),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:f.listId},Ug(e,m=>p.createElement("div",{ref:Do(c,f.listInnerRef),"cmdk-list-sizer":""},m)))}),aJ=p.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:s,contentClassName:l,container:c,...d}=e;return p.createElement(tg,{open:n,onOpenChange:r},p.createElement(ng,{container:c},p.createElement(rg,{"cmdk-overlay":"",className:s}),p.createElement(ag,{"aria-label":e.label,"cmdk-dialog":"",className:l},p.createElement(LD,{ref:t,...d}))))}),sJ=p.forwardRef((e,t)=>Mi(n=>n.filtered.count===0)?p.createElement(We.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),oJ=p.forwardRef((e,t)=>{let{progress:n,children:r,label:s="Loading...",...l}=e;return p.createElement(We.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Ug(e,c=>p.createElement("div",{"aria-hidden":!0},c)))}),Uu=Object.assign(LD,{List:rJ,Item:JX,Input:nJ,Group:eJ,Separator:tJ,Dialog:aJ,Empty:sJ,Loading:oJ});function iJ(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function lJ(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function PD(e){let t=p.useRef(e);return zl(()=>{t.current=e}),t}var zl=typeof window>"u"?p.useEffect:p.useLayoutEffect;function Kc(e){let t=p.useRef();return t.current===void 0&&(t.current=e()),t}function Mi(e){let t=J1(),n=()=>e(t.snapshot());return p.useSyncExternalStore(t.subscribe,n,n)}function UD(e,t,n,r=[]){let s=p.useRef(),l=Xf();return zl(()=>{var c;let d=(()=>{var m;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(m=g.current.textContent)==null?void 0:m.trim():s.current}})(),f=r.map(m=>m.trim());l.value(e,d,f),(c=t.current)==null||c.setAttribute(Zc,d),s.current=d}),s}var cJ=()=>{let[e,t]=p.useState(),n=Kc(()=>new Map);return zl(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,s)=>{n.current.set(r,s),t({})}};function uJ(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Ug({asChild:e,children:t},n){return e&&p.isValidElement(t)?p.cloneElement(uJ(t),{ref:t.ref},n(t.props.children)):n(t)}var dJ={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function FD({className:e,...t}){return o.jsx(Uu,{"data-slot":"command",className:J("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function zD({className:e,...t}){return o.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[o.jsx(Hl,{className:"size-4 shrink-0 opacity-50"}),o.jsx(Uu.Input,{"data-slot":"command-input",className:J("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})}function fJ({className:e,...t}){return o.jsx(Uu.List,{"data-slot":"command-list",className:J("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function VD({...e}){return o.jsx(Uu.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function HD({className:e,...t}){return o.jsx(Uu.Group,{"data-slot":"command-group",className:J("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...t})}function $D({className:e,...t}){return o.jsx(Uu.Item,{"data-slot":"command-item",className:J("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}var Fg="Popover",[BD]=kr(Fg,[Gs]),Jf=Gs(),[hJ,Wi]=BD(Fg),GD=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:s,onOpenChange:l,modal:c=!1}=e,d=Jf(t),f=p.useRef(null),[m,g]=p.useState(!1),[v,x]=zr({prop:r,defaultProp:s??!1,onChange:l,caller:Fg});return o.jsx(Ru,{...d,children:o.jsx(hJ,{scope:t,contentId:Dn(),triggerRef:f,open:v,onOpenChange:x,onOpenToggle:p.useCallback(()=>x(b=>!b),[x]),hasCustomAnchor:m,onCustomAnchorAdd:p.useCallback(()=>g(!0),[]),onCustomAnchorRemove:p.useCallback(()=>g(!1),[]),modal:c,children:n})})};GD.displayName=Fg;var qD="PopoverAnchor",mJ=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Wi(qD,n),l=Jf(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=s;return p.useEffect(()=>(c(),()=>d()),[c,d]),o.jsx(Tu,{...l,...r,ref:t})});mJ.displayName=qD;var ZD="PopoverTrigger",KD=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Wi(ZD,n),l=Jf(n),c=pt(t,s.triggerRef),d=o.jsx(We.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":JD(s.open),...r,ref:c,onClick:Re(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?d:o.jsx(Tu,{asChild:!0,...l,children:d})});KD.displayName=ZD;var eS="PopoverPortal",[pJ,gJ]=BD(eS,{forceMount:void 0}),YD=e=>{const{__scopePopover:t,forceMount:n,children:r,container:s}=e,l=Wi(eS,t);return o.jsx(pJ,{scope:t,forceMount:n,children:o.jsx(Er,{present:n||l.open,children:o.jsx(Bl,{asChild:!0,container:s,children:r})})})};YD.displayName=eS;var xu="PopoverContent",WD=p.forwardRef((e,t)=>{const n=gJ(xu,e.__scopePopover),{forceMount:r=n.forceMount,...s}=e,l=Wi(xu,e.__scopePopover);return o.jsx(Er,{present:r||l.open,children:l.modal?o.jsx(yJ,{...s,ref:t}):o.jsx(xJ,{...s,ref:t})})});WD.displayName=xu;var vJ=_i("PopoverContent.RemoveScroll"),yJ=p.forwardRef((e,t)=>{const n=Wi(xu,e.__scopePopover),r=p.useRef(null),s=pt(t,r),l=p.useRef(!1);return p.useEffect(()=>{const c=r.current;if(c)return Jp(c)},[]),o.jsx(Nf,{as:vJ,allowPinchZoom:!0,children:o.jsx(QD,{...e,ref:s,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Re(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),l.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Re(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,m=d.button===2||f;l.current=m},{checkForDefaultPrevented:!1}),onFocusOutside:Re(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),xJ=p.forwardRef((e,t)=>{const n=Wi(xu,e.__scopePopover),r=p.useRef(!1),s=p.useRef(!1);return o.jsx(QD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:l=>{var c,d;(c=e.onCloseAutoFocus)==null||c.call(e,l),l.defaultPrevented||(r.current||(d=n.triggerRef.current)==null||d.focus(),l.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:l=>{var f,m;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=l.target;((m=n.triggerRef.current)==null?void 0:m.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&s.current&&l.preventDefault()}})}),QD=p.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onInteractOutside:g,...v}=e,x=Wi(xu,n),b=Jf(n);return Qp(),o.jsx(_f,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:l,children:o.jsx($l,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:m,onDismiss:()=>x.onOpenChange(!1),children:o.jsx(Df,{"data-state":JD(x.open),role:"dialog",id:x.contentId,...b,...v,ref:t,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),XD="PopoverClose",bJ=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Wi(XD,n);return o.jsx(We.button,{type:"button",...r,ref:t,onClick:Re(e.onClick,()=>s.onOpenChange(!1))})});bJ.displayName=XD;var SJ="PopoverArrow",CJ=p.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,s=Jf(n);return o.jsx(Of,{...s,...r,ref:t})});CJ.displayName=SJ;function JD(e){return e?"open":"closed"}var wJ=GD,EJ=KD,RJ=YD,TJ=WD;function tS({...e}){return o.jsx(wJ,{"data-slot":"popover",...e})}function nS({...e}){return o.jsx(EJ,{"data-slot":"popover-trigger",...e})}function rS({className:e,align:t="center",sideOffset:n=4,...r}){return o.jsx(RJ,{children:o.jsx(TJ,{"data-slot":"popover-content",align:t,sideOffset:n,className:J("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...r})})}function aS({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:s="No results found.",className:l,disabled:c=!1}){const[d,f]=p.useState(!1),[m,g]=p.useState(""),v=p.useMemo(()=>{const w={};return e.forEach(C=>{const E=C.group??"";Object.prototype.hasOwnProperty.call(w,E)||(w[E]=[]),w[E].push(C)}),w},[e]),x=e.find(w=>w.value===t),b=p.useCallback(w=>{n(w),requestAnimationFrame(()=>{g(""),f(!1)})},[n]);return o.jsxs(tS,{open:d,onOpenChange:f,modal:!0,children:[o.jsx(nS,{asChild:!0,children:o.jsxs(be,{variant:"outline",role:"combobox","aria-expanded":d,className:J("w-full justify-between",!t&&"text-muted-foreground",l),disabled:c,children:[x?x.label:r,o.jsx(Tb,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),o.jsx(rS,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:o.jsxs(FD,{children:[o.jsx(zD,{placeholder:`Search ${r.toLowerCase()}...`,value:m,onValueChange:g}),o.jsx(VD,{children:s}),Object.entries(v).map(([w,C])=>o.jsx(HD,{heading:w,children:C.map(E=>o.jsxs($D,{value:E.value,onSelect:()=>{b(E.value)},keywords:[E.label],children:[o.jsx(fr,{className:J("mr-2 h-4 w-4",t===E.value?"opacity-100":"opacity-0")}),E.label]},E.value))},w||"default"))]})})]})}var zg="Collapsible",[jJ,eO]=kr(zg),[_J,sS]=jJ(zg),tO=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:s,disabled:l,onOpenChange:c,...d}=e,[f,m]=zr({prop:r,defaultProp:s??!1,onChange:c,caller:zg});return o.jsx(_J,{scope:n,disabled:l,contentId:Dn(),open:f,onOpenToggle:p.useCallback(()=>m(g=>!g),[m]),children:o.jsx(We.div,{"data-state":cS(f),"data-disabled":l?"":void 0,...d,ref:t})})});tO.displayName=zg;var nO="CollapsibleTrigger",oS=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,s=sS(nO,n);return o.jsx(We.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":cS(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...r,ref:t,onClick:Re(e.onClick,s.onOpenToggle)})});oS.displayName=nO;var iS="CollapsibleContent",lS=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=sS(iS,e.__scopeCollapsible);return o.jsx(Er,{present:n||s.open,children:({present:l})=>o.jsx(NJ,{...r,ref:t,present:l})})});lS.displayName=iS;var NJ=p.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:s,...l}=e,c=sS(iS,n),[d,f]=p.useState(r),m=p.useRef(null),g=pt(t,m),v=p.useRef(0),x=v.current,b=p.useRef(0),w=b.current,C=c.open||d,E=p.useRef(C),R=p.useRef(void 0);return p.useEffect(()=>{const T=requestAnimationFrame(()=>E.current=!1);return()=>cancelAnimationFrame(T)},[]),wr(()=>{const T=m.current;if(T){R.current=R.current||{transitionDuration:T.style.transitionDuration,animationName:T.style.animationName},T.style.transitionDuration="0s",T.style.animationName="none";const _=T.getBoundingClientRect();v.current=_.height,b.current=_.width,E.current||(T.style.transitionDuration=R.current.transitionDuration,T.style.animationName=R.current.animationName),f(r)}},[c.open,r]),o.jsx(We.div,{"data-state":cS(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!C,...l,ref:g,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":w?`${w}px`:void 0,...e.style},children:C&&s})});function cS(e){return e?"open":"closed"}var rO=tO,AJ=oS,DJ=lS,xs="Accordion",OJ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[uS,MJ,kJ]=fg(xs),[Vg]=kr(xs,[kJ,eO]),dS=eO(),aO=_e.forwardRef((e,t)=>{const{type:n,...r}=e,s=r,l=r;return o.jsx(uS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?o.jsx(UJ,{...l,ref:t}):o.jsx(PJ,{...s,ref:t})})});aO.displayName=xs;var[sO,IJ]=Vg(xs),[oO,LJ]=Vg(xs,{collapsible:!1}),PJ=_e.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},collapsible:l=!1,...c}=e,[d,f]=zr({prop:n,defaultProp:r??"",onChange:s,caller:xs});return o.jsx(sO,{scope:e.__scopeAccordion,value:_e.useMemo(()=>d?[d]:[],[d]),onItemOpen:f,onItemClose:_e.useCallback(()=>l&&f(""),[l,f]),children:o.jsx(oO,{scope:e.__scopeAccordion,collapsible:l,children:o.jsx(iO,{...c,ref:t})})})}),UJ=_e.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:s=()=>{},...l}=e,[c,d]=zr({prop:n,defaultProp:r??[],onChange:s,caller:xs}),f=_e.useCallback(g=>d((v=[])=>[...v,g]),[d]),m=_e.useCallback(g=>d((v=[])=>v.filter(x=>x!==g)),[d]);return o.jsx(sO,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:m,children:o.jsx(oO,{scope:e.__scopeAccordion,collapsible:!0,children:o.jsx(iO,{...l,ref:t})})})}),[FJ,Hg]=Vg(xs),iO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:s,orientation:l="vertical",...c}=e,d=_e.useRef(null),f=pt(d,t),m=MJ(n),v=If(s)==="ltr",x=Re(e.onKeyDown,b=>{var M;if(!OJ.includes(b.key))return;const w=b.target,C=m().filter(z=>{var Z;return!((Z=z.ref.current)!=null&&Z.disabled)}),E=C.findIndex(z=>z.ref.current===w),R=C.length;if(E===-1)return;b.preventDefault();let T=E;const _=0,O=R-1,A=()=>{T=E+1,T>O&&(T=_)},D=()=>{T=E-1,T<_&&(T=O)};switch(b.key){case"Home":T=_;break;case"End":T=O;break;case"ArrowRight":l==="horizontal"&&(v?A():D());break;case"ArrowDown":l==="vertical"&&A();break;case"ArrowLeft":l==="horizontal"&&(v?D():A());break;case"ArrowUp":l==="vertical"&&D();break}const j=T%R;(M=C[j].ref.current)==null||M.focus()});return o.jsx(FJ,{scope:n,disabled:r,direction:s,orientation:l,children:o.jsx(uS.Slot,{scope:n,children:o.jsx(We.div,{...c,"data-orientation":l,ref:f,onKeyDown:r?void 0:x})})})}),Lp="AccordionItem",[zJ,fS]=Vg(Lp),lO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...s}=e,l=Hg(Lp,n),c=IJ(Lp,n),d=dS(n),f=Dn(),m=r&&c.value.includes(r)||!1,g=l.disabled||e.disabled;return o.jsx(zJ,{scope:n,open:m,disabled:g,triggerId:f,children:o.jsx(rO,{"data-orientation":l.orientation,"data-state":mO(m),...d,...s,ref:t,disabled:g,open:m,onOpenChange:v=>{v?c.onItemOpen(r):c.onItemClose(r)}})})});lO.displayName=Lp;var cO="AccordionHeader",uO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Hg(xs,n),l=fS(cO,n);return o.jsx(We.h3,{"data-orientation":s.orientation,"data-state":mO(l.open),"data-disabled":l.disabled?"":void 0,...r,ref:t})});uO.displayName=cO;var tb="AccordionTrigger",dO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Hg(xs,n),l=fS(tb,n),c=LJ(tb,n),d=dS(n);return o.jsx(uS.ItemSlot,{scope:n,children:o.jsx(AJ,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":s.orientation,id:l.triggerId,...d,...r,ref:t})})});dO.displayName=tb;var fO="AccordionContent",hO=_e.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,s=Hg(xs,n),l=fS(fO,n),c=dS(n);return o.jsx(DJ,{role:"region","aria-labelledby":l.triggerId,"data-orientation":s.orientation,...c,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});hO.displayName=fO;function mO(e){return e?"open":"closed"}var VJ=aO,HJ=lO,$J=uO,BJ=dO,GJ=hO;const hS={default:{itemClass:"border-b last:border-b-0",triggerClass:"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",icon:null,chevronClass:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",contentInnerClass:"pt-0 pb-4",headerClass:"flex"},common:{itemClass:"overflow-hidden",triggerClass:"group focus-visible:ring-primary hover:bg-muted [&[data-state=open]]:bg-muted flex items-center gap-1 rounded-sm px-2 py-1 transition-all outline-none focus-visible:ring-2 [&[data-state=open]]:rounded-br-none [&[data-state=open]]:rounded-bl-none [&[data-state=open]]:font-semibold",icon:o.jsx(fL,{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}},pO=p.createContext("default");function mr({variant:e="default",...t}){return o.jsx(pO.Provider,{value:e,children:o.jsx(VJ,{"data-slot":"accordion",...t})})}function mS(e){const t=p.useContext(pO);return e??t??"default"}function Yn({className:e,variant:t,...n}){const r=mS(t),{itemClass:s}=hS[r];return o.jsx(HJ,{"data-slot":"accordion-item",className:J(s,e),...n})}function Wn({className:e,children:t,variant:n,...r}){const s=mS(n),{triggerClass:l,icon:c,chevronClass:d,headerClass:f}=hS[s];return o.jsx($J,{className:f,children:o.jsxs(BJ,{"data-slot":"accordion-trigger",className:J(l,e),...r,children:[c,t,o.jsx(Ka,{className:d,"aria-hidden":"true"})]})})}function Qn({className:e,children:t,variant:n,...r}){const s=mS(n),{contentClass:l,contentInnerClass:c}=hS[s];return o.jsx(GJ,{"data-slot":"accordion-content",className:J(l,e),...r,children:o.jsx("div",{className:c,children:t})})}function hr({href:e,children:t,className:n,...r}){return o.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:J("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,o.jsx(_l,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function qJ(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"service-account-details",children:[o.jsx(Wn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(hr,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Assign the ",o.jsx("strong",{children:"bigquery.dataEditor"})," and ",o.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function ZJ(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"project-id-details",children:[o.jsx(Wn,{children:"How do I find my Project ID?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(hr,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),o.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),o.jsxs("li",{children:["Find your project in the list. The ",o.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),o.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function KJ(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"gbq-location-details",children:[o.jsx(Wn,{children:"How do I find my dataset location?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"BigQuery data is stored in specific regions. To avoid query errors, your SQL queries must process data stored in the same location."}),o.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(hr,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),o.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),o.jsxs("li",{children:["Click each dataset name to open its details. The ",o.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",o.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",o.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),o.jsx("li",{children:"Make sure all your datasets are stored in the same location. If they are in different locations, select the location where most of your data is stored or create separate Storage for each location."}),o.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const gO=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}},YJ=({form:e})=>{const[t,n]=p.useState(!1);if(e.watch("type")!==Ie.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?gO(l):null;return o.jsxs(o.Fragment,{children:[o.jsxs(Vs,{title:"Connection Settings",children:[o.jsx(Jt,{control:e.control,name:"config.projectId",render:({field:d})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),o.jsx(nn,{children:o.jsx(Ht,{...d,placeholder:"Enter a Project Id"})}),o.jsx(or,{children:o.jsx(ZJ,{})}),o.jsx(un,{})]})}),o.jsx(Jt,{control:e.control,name:"config.location",render:({field:d})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),o.jsx(nn,{children:o.jsx(aS,{options:xq,value:d.value,onValueChange:d.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),o.jsx(or,{children:o.jsx(KJ,{})}),o.jsx(un,{})]})})]}),o.jsx(Vs,{title:"Authentication",children:o.jsx(Jt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(en,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(tn,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&l&&o.jsx(be,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(be,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(nn,{children:!t&&c?o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(hr,{href:c.url,children:c.email})}),o.jsx(wt,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(Hi,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(or,{children:o.jsx(qJ,{})}),o.jsx(un,{})]})})})]})};function WJ(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"athena-region-details",children:[o.jsx(Wn,{children:"How do I find my Athena region?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"Athena queries run in a specific AWS region. You must select the region where your Athena service and data are located."}),o.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(hr,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),o.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),o.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function QJ(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"athena-output-bucket-details",children:[o.jsx(Wn,{children:"How do I find a bucket?"}),o.jsxs(Qn,{children:[o.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",o.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(hr,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),o.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),o.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),o.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function XJ(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"athena-access-key-id-details",children:[o.jsx(Wn,{children:"How do I get my AWS Access Key ID?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"Before accessing your AWS Access Key ID, make sure you have a user with the necessary permissions to use Athena and Glue in your AWS account."}),o.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",o.jsx(hr,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/?utm_source=owox_data_marts&utm_medium=storage_enity&utm_campaign=tooltip_aws",children:"in documentation"}),"."]}),o.jsx(w_,{className:"my-4"}),o.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),o.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(hr,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),o.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function JJ(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"athena-secret-access-key-details",children:[o.jsx(Wn,{children:"How do I get my AWS Secret Access Key?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"The Secret Access Key is part of your AWS credentials needed to connect and authenticate. It is only shown when you create a new key."}),o.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(hr,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),o.jsxs("li",{children:["Under ",o.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),o.jsx("li",{children:"When you create a new key, copy and securely store the Secret Access Key — you won't be able to see it again."})]})]})]})})}const eee=({form:e})=>{const[t,n]=p.useState("");return p.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const s="_".repeat(r.length);n(s),e.setValue("credentials.secretAccessKey",s,{shouldDirty:!1})}},[e]),e.watch("type")!==Ie.AWS_ATHENA?null:o.jsxs(o.Fragment,{children:[o.jsxs(Vs,{title:"Connection Settings",children:[o.jsx(Jt,{control:e.control,name:"config.region",render:({field:r})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),o.jsx(nn,{children:o.jsx(Ht,{...r,placeholder:"Enter a region"})}),o.jsx(or,{children:o.jsx(WJ,{})}),o.jsx(un,{})]})}),o.jsx(Jt,{control:e.control,name:"config.outputBucket",render:({field:r})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),o.jsx(nn,{children:o.jsx(Ht,{...r,placeholder:"Enter an output bucket"})}),o.jsx(or,{children:o.jsx(QJ,{})}),o.jsx(un,{})]})})]}),o.jsxs(Vs,{title:"Authentication",children:[o.jsx(Jt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),o.jsx(nn,{children:o.jsx(Ht,{...r,placeholder:"Enter an access key id"})}),o.jsx(or,{children:o.jsx(XJ,{})}),o.jsx(un,{})]})}),o.jsx(Jt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),o.jsx(nn,{children:o.jsx(Ht,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),o.jsx(or,{children:o.jsx(JJ,{})}),o.jsx(un,{})]})})]})]})};function tee(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"bigquery-api-details",children:[o.jsx(Wn,{children:"How do I enable the BigQuery API?"}),o.jsxs(Qn,{children:[o.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",o.jsx(hr,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function nee(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"athena-api-details",children:[o.jsx(Wn,{children:"How do I activate Athena API?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"AWS Athena is a serverless interactive query service. To use it, you need to activate Athena in your AWS account."}),o.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open"," ",o.jsx(hr,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),o.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),o.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function vO(e){return JSON.parse(JSON.stringify(e))}function ree({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=qi({resolver:Jl(Uq),defaultValues:e}),{watch:l,control:c,formState:{isDirty:d,isSubmitting:f}}=s,m=l("type");_e.useEffect(()=>{r==null||r(d)},[d,r]);const g=async v=>{const{dirtyFields:x}=s.formState,b=vO(v);return x.credentials||delete b.credentials,t(b)};return o.jsx(Wl,{...s,children:o.jsxs(Zi,{onSubmit:v=>{s.handleSubmit(g)(v)},noValidate:!0,children:[o.jsxs(Ql,{children:[o.jsxs(Vs,{title:"General",children:[o.jsx(Jt,{control:c,name:"title",render:({field:v})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),o.jsx(nn,{children:o.jsx(Ht,{...v,placeholder:"Storage title"})}),o.jsx(un,{})]})}),o.jsx(Jt,{control:c,name:"type",render:({field:v})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),o.jsx(nn,{children:o.jsxs(Ca,{value:v.value,onValueChange:v.onChange,disabled:!!e,children:[o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a storage type"})}),o.jsx(Ra,{children:o.jsx(Ig,{children:Bi.getAllTypes().map(({type:x,displayName:b,icon:w,status:C})=>o.jsx(Zn,{value:x,disabled:C===Co.COMING_SOON,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(w,{size:20}),b]})},x))})})]})}),o.jsxs(or,{children:[m===Ie.GOOGLE_BIGQUERY&&o.jsx(tee,{}),m===Ie.AWS_ATHENA&&o.jsx(nee,{})]}),o.jsx(un,{})]})})]}),m===Ie.GOOGLE_BIGQUERY&&o.jsx(YJ,{form:s}),m===Ie.AWS_ATHENA&&o.jsx(eee,{form:s})]}),o.jsxs(Xl,{children:[o.jsx(be,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!d||f,children:"Save"}),o.jsx(be,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function yO({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:s}=Lg(),[l,c]=p.useState(!1),[d,f]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),f(!1),t()},[t]),v=p.useCallback(w=>{f(w)},[]),x=async w=>{if(n){const C=await s(n.id,w);C&&(r(C),t())}},b=p.useRef(!1);return p.useEffect(()=>{const w=n?"Edit":"Create";e&&!b.current?(Ue({event:"data_storage_config_open",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!0):!e&&b.current&&(Ue({event:"data_storage_config_close",category:"DataStorage",action:w,label:n==null?void 0:n.type}),b.current=!1)},[e,n]),o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:w=>{w||m()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:"Configure Storage Provider"}),o.jsx(Gl,{children:"Customize settings for your storage provider"})]}),o.jsx(ree,{initialData:n??void 0,onSubmit:x,onCancel:m,onDirtyChange:v})]})}),o.jsx(na,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const aee=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=p.useState(!1),s=Bi.getInfo(e.type),l=()=>{r(!0)},c=()=>{r(!1)},d=()=>{if(!_4(e))return o.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[o.jsx(Wp,{className:"h-4 w-4 text-red-500"}),o.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const m=(v,x)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:x})]}),g=(v,x,b)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[v,":"]})," ",o.jsx(hr,{href:b,onClick:w=>{w.stopPropagation()},children:x})]});switch(e.type){case Ie.GOOGLE_BIGQUERY:{const v=e.config.projectId,x=e.config.location,b=`https://console.cloud.google.com/bigquery?project=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",v,b),o.jsx("span",{className:"text-muted-foreground",children:"•"}),m("Location",x)]})}case Ie.AWS_ATHENA:{const v=e.config.region,x=e.config.outputBucket,b=`https://s3.console.aws.amazon.com/s3/buckets/${x}?region=${v}`;return o.jsxs("div",{className:"flex flex-wrap gap-2",children:[m("Region",v),o.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",x,b)]})}default:return"Unknown storage type configuration"}};return o.jsxs(o.Fragment,{children:[o.jsx(X0,{title:e.title,icon:s.icon,subtitle:d(),onClick:l}),o.jsx(Q1,{children:o.jsx(yO,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function see({initialType:e,onTypeSelect:t}){var c;const[n,r]=p.useState(e??null);p.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const s=d=>{r(d),t(d)},l=[{type:He.SQL,label:"SQL",description:"SQL query"},{type:He.TABLE,label:"Table",description:"Existing table"},{type:He.VIEW,label:"View",description:"Existing view"},{type:He.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:He.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return o.jsxs("div",{className:"dm-card-block",children:[o.jsx(Sa,{className:"text-foreground",children:"Definition Type"}),o.jsxs(Ca,{value:n??"",onValueChange:d=>{s(d)},children:[o.jsx(Ea,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:o.jsx(wa,{placeholder:"Select definition type",children:n&&((c=l.find(d=>d.type===n))==null?void 0:c.label)})}),o.jsx(Ra,{children:o.jsx(Ig,{children:l.map(d=>o.jsxs(Zn,{value:d.type,children:[d.label,o.jsx("span",{className:"text-muted-foreground/80 ml-2",children:d.description})]},d.type))})})]})]})}const oee=ln({definitionType:qs(He.SQL),definition:ln({sqlQuery:cn().min(1,"SQL query is required")})}),iee=e=>{const t=q4(e);return ln({definitionType:qs(He.TABLE),definition:t})},lee=e=>{const t=q4(e);return ln({definitionType:qs(He.VIEW),definition:t})},cee=e=>{const t=FZ(e);return ln({definitionType:qs(He.TABLE_PATTERN),definition:t})},uee=ln({definitionType:qs(He.CONNECTOR),definition:ln({connector:ln({source:ln({name:cn().min(1,"Connector name is required"),configuration:fT(OB(AB())).min(1,"At least one configuration is required"),node:cn().min(1,"Node is required"),fields:fT(cn()).min(1,"At least one field is required")}),storage:ln({fullyQualifiedName:cn().min(1,"fully qualified name is required")})})})}),dee=(e,t)=>{if(!e)return ln({definitionType:MB(g1(He)),definition:ln({}).optional()});switch(e){case He.SQL:return oee;case He.TABLE:return iee(t);case He.VIEW:return lee(t);case He.TABLE_PATTERN:return cee(t);case He.CONNECTOR:return uee;default:return ln({})}};function fee({control:e}){return o.jsx(Jt,{control:e,name:"definition.sqlQuery",render:({field:t})=>o.jsxs(en,{className:"dm-card-block",children:[o.jsx(tn,{className:"text-foreground",children:"SQL Query"}),o.jsx(nn,{children:o.jsx(VX,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),o.jsx(un,{})]})})}function hee({control:e,storageType:t}){const n=A4(t),r=D4(t);return o.jsx(Jt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(en,{className:"dm-card-block",children:[o.jsx(tn,{children:"Fully Qualified Table Name"}),o.jsx(nn,{children:o.jsx(Ht,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(or,{className:"text-muted-foreground/75",children:r}),o.jsx(un,{})]})})}function mee({control:e,storageType:t}){const n=A4(t),r=D4(t);return o.jsx(Jt,{control:e,name:"definition.fullyQualifiedName",render:({field:s})=>o.jsxs(en,{className:"dm-card-block",children:[o.jsx(tn,{children:"Fully Qualified View Name"}),o.jsx(nn,{children:o.jsx(Ht,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(or,{className:"text-muted-foreground/75",children:r}),o.jsx(un,{})]})})}function pee({control:e,storageType:t}){const n=$q(t),r=Bq(t);return o.jsx(Jt,{control:e,name:"definition.pattern",render:({field:s})=>o.jsxs(en,{className:"dm-card-block",children:[o.jsx(tn,{children:"Table Pattern"}),o.jsx(nn,{children:o.jsx(Ht,{placeholder:n,value:s.value||"",onChange:s.onChange,className:"dm-card-formcontrol"})}),o.jsx(or,{className:"text-muted-foreground/75",children:r}),o.jsx(un,{})]})})}const nb=e=>{switch(e){case He.SQL:return{sqlQuery:""};case He.TABLE:return{fullyQualifiedName:""};case He.VIEW:return{fullyQualifiedName:""};case He.TABLE_PATTERN:return{pattern:""};case He.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},gee=Ef("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 pS({className:e,variant:t,...n}){return o.jsx("div",{"data-slot":"alert",role:"alert",className:J(gee({variant:t}),e),...n})}function xO({className:e,...t}){return o.jsx("div",{"data-slot":"alert-title",className:J("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function gS({className:e,...t}){return o.jsx("div",{"data-slot":"alert-description",className:J("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}var $g="Tabs",[vee]=kr($g,[hg]),bO=hg(),[yee,vS]=vee($g),SO=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:s,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:f="automatic",...m}=e,g=If(d),[v,x]=zr({prop:r,onChange:s,defaultProp:l??"",caller:$g});return o.jsx(yee,{scope:n,baseId:Dn(),value:v,onValueChange:x,orientation:c,dir:g,activationMode:f,children:o.jsx(We.div,{dir:g,"data-orientation":c,...m,ref:t})})});SO.displayName=$g;var CO="TabsList",wO=p.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...s}=e,l=vS(CO,n),c=bO(n);return o.jsx(LN,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:o.jsx(We.div,{role:"tablist","aria-orientation":l.orientation,...s,ref:t})})});wO.displayName=CO;var EO="TabsTrigger",RO=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:s=!1,...l}=e,c=vS(EO,n),d=bO(n),f=_O(c.baseId,r),m=NO(c.baseId,r),g=r===c.value;return o.jsx(PN,{asChild:!0,...d,focusable:!s,active:g,children:o.jsx(We.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":m,"data-state":g?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:f,...l,ref:t,onMouseDown:Re(e.onMouseDown,v=>{!s&&v.button===0&&v.ctrlKey===!1?c.onValueChange(r):v.preventDefault()}),onKeyDown:Re(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&c.onValueChange(r)}),onFocus:Re(e.onFocus,()=>{const v=c.activationMode!=="manual";!g&&!s&&v&&c.onValueChange(r)})})})});RO.displayName=EO;var TO="TabsContent",jO=p.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:s,children:l,...c}=e,d=vS(TO,n),f=_O(d.baseId,r),m=NO(d.baseId,r),g=r===d.value,v=p.useRef(g);return p.useEffect(()=>{const x=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(x)},[]),o.jsx(Er,{present:s||g,children:({present:x})=>o.jsx(We.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!x,id:m,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:v.current?"0s":void 0},children:x&&l})})});jO.displayName=TO;function _O(e,t){return`${e}-trigger-${t}`}function NO(e,t){return`${e}-content-${t}`}var xee=SO,bee=wO,See=RO,Cee=jO;function wee({className:e,...t}){return o.jsx(xee,{"data-slot":"tabs",className:J("flex flex-col gap-2",e),...t})}function Eee({className:e,...t}){return o.jsx(bee,{"data-slot":"tabs-list",className:J("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function Ree({className:e,...t}){return o.jsx(See,{"data-slot":"tabs-trigger",className:J("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Tee({className:e,...t}){return o.jsx(Cee,{"data-slot":"tabs-content",className:J("flex-1 outline-none",e),...t})}const jee=rO,_ee=oS,Nee=lS;function Aee({children:e,className:t="",...n}){return o.jsx("div",{className:J("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function Dee({children:e,className:t="",...n}){return o.jsx("div",{className:J("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:o.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function Oee({children:e,className:t="",variant:n="horizontal",...r}){const s=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return o.jsx("div",{className:J(s,t),...r,children:e})}function Yd({children:e,className:t="",...n}){return o.jsx("div",{"data-slot":"wizard-step-item",className:J("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",t),...n,children:e})}function Mee({label:e,children:t,className:n="",options:r,value:s,onValueChange:l,required:c=!1,tooltip:d,...f}){return o.jsx("div",{"data-slot":"wizard-step-item-one-of",className:J("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",n),...f,children:o.jsxs(wee,{value:s,onValueChange:l,children:[o.jsxs("div",{className:"flex items-center",children:[o.jsx(Ro,{required:c,tooltip:d,className:"w-full",children:e}),o.jsx(Eee,{children:r.map(m=>o.jsx(Ree,{value:m.value,children:m.label},m.value))})]}),t]})})}function kee({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[s,l]=p.useState(n);return o.jsxs(jee,{open:s,onOpenChange:l,"data-slot":"wizard-collapsible",className:J("group flex flex-col gap-2 py-3",r),children:[o.jsx(_ee,{asChild:!0,children:o.jsxs("button",{type:"button",className:J("flex cursor-pointer items-center gap-1"),children:[o.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx(Ta,{className:J("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",s&&"rotate-90")})]})}),o.jsx(Nee,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:o.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function Ro({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:s="",...l}){return o.jsxs(Sa,{"data-slot":"wizard-step-label",className:J("text-foreground flex items-center justify-between gap-2 text-sm font-medium",s),...l,children:[t?o.jsxs(St,{...r,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("span",{className:"flex items-center gap-1",children:[e,o.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),o.jsx(wt,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):o.jsx("span",{children:e}),n&&o.jsxs(St,{...r,children:[o.jsx(Ct,{asChild:!0,children:o.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),o.jsx(wt,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function Rl({title:e,children:t,className:n="",...r}){return o.jsxs("section",{"data-slot":"wizard-step-section",className:J("mb-8",n),...r,children:[e&&o.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),o.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function ki({icon:e,title:t,subtitle:n,docUrl:r,variant:s="default",className:l,...c}){return s==="compact"?o.jsxs("div",{"data-slot":"wizard-step-hero",className:J("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",l),...c,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[e&&o.jsx("div",{children:e}),o.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&o.jsx(be,{variant:"outline",asChild:!0,children:o.jsxs(Ga,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(_l,{className:"h-4 w-4"})]})})]}):o.jsxs("div",{"data-slot":"wizard-step-hero",className:J("mb-6 flex flex-col items-center justify-center text-center",l),...c,children:[e&&o.jsx("div",{className:"mt-6 mb-3",children:e}),o.jsx("h2",{className:"text-xl font-medium",children:t}),n&&o.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&o.jsx(be,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:o.jsxs(Ga,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",o.jsx(_l,{className:"h-4 w-4"})]})})]})}function jo({children:e,className:t="",...n}){return o.jsx("div",{"data-slot":"wizard-step",className:J("space-y-4",t),...n,children:e})}function Iee({children:e,className:t="",...n}){return o.jsx("div",{className:J("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function Lee({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:s,onDoubleClick:l,className:c="",...d}){return o.jsxs("div",{className:J("border-border flex items-center gap-4 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",r?"cursor-not-allowed opacity-50 hover:shadow-none":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",n&&!r?"ring-primary border-transparent ring-2 dark:bg-white/8":"",c),onClick:s,onDoubleClick:l,...d,children:[e&&o.jsx("span",{className:"shrink-0",children:e}),r?o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),o.jsx(wt,{side:"top",align:"center",children:"Coming soon"})]}):o.jsx("span",{className:"text-sm font-medium",children:t})]})}function AO({type:e,id:t,name:n,value:r,label:s,checked:l,selected:c=!1,disabled:d=!1,tooltip:f,rightIcon:m,onChange:g,className:v="",...x}){const b=C=>{g&&g(e==="checkbox"?C.target.checked:C.target.value)},w=p.useRef(null);return o.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:C=>{if(d)return;const E=C.target;E.tagName==="INPUT"||E.tagName==="LABEL"||E.closest("label")||w.current&&w.current.click()},className:J("group border-border flex items-center gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 select-none hover:shadow-sm dark:border-transparent dark:bg-white/4",d?"cursor-not-allowed":"cursor-pointer hover:shadow-sm dark:hover:bg-white/8",c?"ring-primary border-transparent ring-2 dark:bg-white/8":"",v),children:[o.jsx("input",{ref:w,id:t,type:e,name:n,value:r,checked:l,disabled:d,onChange:b,className:J("text-primary focus:ring-primary border-border cursor-pointer",e==="radio"||e==="checkbox"?"h-4 w-4":"h-8 w-full rounded-md border px-2"),...x}),s&&o.jsx(Ro,{htmlFor:t,className:J("cursor-pointer",d&&"cursor-not-allowed"),children:s}),(f||m)&&o.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Fr,{className:"text-muted-foreground/75 pointer-events-none h-4 w-4 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100","data-tooltip-trigger":!0})}),o.jsx(wt,{side:"top",align:"center",children:f})]}),m&&o.jsx("div",{className:"flex items-center",children:m})]})]})}function yS({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),s=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return o.jsx("div",{"data-slot":"wizard-step-loading",className:J(s,n),children:Array.from({length:r}).map((l,c)=>o.jsx(as,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function Pee({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:s,onConnectorDoubleClick:l}){return n?o.jsx(yS,{variant:"grid"}):r?o.jsxs(pS,{variant:"destructive",children:[o.jsx(Rf,{className:"h-4 w-4"}),o.jsx(gS,{children:"Failed to load available connectors. Please try again."})]}):o.jsxs(jo,{children:[o.jsx(Rl,{title:"Choose Connector",children:o.jsx(Iee,{children:e.map(c=>o.jsx(Lee,{icon:c.logoBase64?o.jsx(Nu,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{s(c)},onDoubleClick:()=>{s(c),l==null||l(c)}},c.name))})}),e.length===0&&o.jsx(ki,{icon:o.jsx(lf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function Uee({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:s=!1,onNext:l,onBack:c,onFinish:d,nextLabel:f="Next",backLabel:m="Back",finishLabel:g="Save"}){const v=e===t;return t===1?o.jsx("div",{className:"w-full",children:o.jsx(be,{className:"w-full",variant:"default",onClick:d,disabled:!n||s,children:g})}):o.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[o.jsx("div",{className:"flex-1",children:r&&o.jsxs(be,{variant:"outline",onClick:c,disabled:s,children:[o.jsx(g9,{className:"h-4 w-4"}),m]})}),o.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),o.jsx("div",{className:"flex flex-1 justify-end",children:v?o.jsx(be,{variant:"default",onClick:d,disabled:!n||s,children:g}):o.jsxs(be,{variant:"default",onClick:l,disabled:!n||s,children:[f,o.jsx(Ta,{className:"h-4 w-4"})]})})]})}function Tl({connector:e,size:t=24,variant:n="compact"}){return o.jsx(ki,{icon:o.jsx(Nu,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function ou({label:e}){return o.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:o.jsx(be,{variant:"outline",asChild:!0,children:o.jsxs(Ga,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",o.jsx(_l,{className:"h-4 w-4"})]})})})}const rb="**********";function Fee({specification:e,configuration:t,onValueChange:n}){const{name:r,title:s}=e,l=s??r,c=r;return o.jsxs("div",{className:"flex items-center space-x-2",children:[o.jsx(Ht,{type:"checkbox",id:c,name:r,checked:t[r]||!1,onChange:d=>{n(r,d.target.checked)},className:"text-primary focus:ring-primary border-border h-4 w-4 rounded"}),o.jsx(Sa,{htmlFor:c,className:"cursor-pointer text-sm",children:o.jsx(Ro,{htmlFor:c,required:e.required,tooltip:e.description,children:l})})]})}function zee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,l=e.title??e.name;return o.jsx(Ht,{id:r,name:r,type:"number",value:t[r]||"",placeholder:s??`Enter ${l.toLowerCase()}`,onChange:c=>{const d=c.target.value,f=d===""?void 0:parseFloat(d);n(r,f)}})}function Vee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:l}=e,c=e.title??e.name;return o.jsx(Hi,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
|
|
704
|
-
`):Array.isArray(l)?l.join(`
|
|
705
|
-
`):"",placeholder:s??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:d=>{const f=d.target.value.split(`
|
|
706
|
-
`).filter(m=>m.trim());n(r,f)}})}function Hee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s,default:l}=e,c=e.title??e.name,d=f=>{if(!f||typeof f!="string"&&typeof f!="number")return"";const m=typeof f=="string"?f:f.toString();try{const g=new Date(m);return isNaN(g.getTime())?"":g.toISOString().split("T")[0]}catch{return""}};return o.jsx(Ht,{id:r,name:r,type:"date",value:t[r]||d(l)||"",placeholder:s??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function $ee({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:s}=e,l=e.title??e.name;return o.jsx(Ht,{id:r,name:r,type:"text",value:t[r]||"",placeholder:s??`Enter ${l.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function Bee({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:s,placeholder:l,default:c}=e;return o.jsx(Hi,{id:s,name:s,value:t[s]&&typeof t[s]=="object"?JSON.stringify(t[s],null,2):typeof c=="object"?JSON.stringify(c,null,2):"",placeholder:l??`Enter ${r.toLowerCase()} as JSON`,rows:6,className:"font-mono",onChange:d=>{try{const f=JSON.parse(d.target.value);n(s,f)}catch{n(s,d.target.value)}}})}function Gee({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s}){const l=e.title??e.name,c=r&&!s;return o.jsx(Ht,{id:e.name,...c?{}:{name:e.name},type:c?"password":"text",autoComplete:c?"new-password":"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,value:c?rb:t[e.name]||"",...c?{readOnly:!0,disabled:!0}:{},...c?{}:{placeholder:e.placeholder??`Enter ${l.toLowerCase()}`},...c?{}:{onChange:d=>{n(e.name,d.target.value)}}})}function qee({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:s,placeholder:l,default:c}=e,d=e.title??e.name,f=r.map(m=>({value:m,label:m}));return o.jsx(aS,{options:f,value:t[s]||c||"",onValueChange:m=>{n(s,m)},placeholder:l??`Select ${d.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function DO({specification:e,configuration:t,onValueChange:n,flags:r}){const{requiredType:s,options:l}=e,{isSecret:c=!1,isEditingExisting:d=!1,isSecretEditing:f=!1}=r??{};if(c)return o.jsx(Gee,{specification:e,configuration:t,onValueChange:n,isEditingExisting:d,isSecretEditing:f});if(l&&l.length>0)return o.jsx(qee,{specification:e,configuration:t,onValueChange:n,specOptions:l});switch(s){case rs.BOOLEAN:return o.jsx(Fee,{specification:e,configuration:t,onValueChange:n});case rs.NUMBER:return o.jsx(zee,{specification:e,configuration:t,onValueChange:n});case rs.ARRAY:return o.jsx(Vee,{specification:e,configuration:t,onValueChange:n});case rs.OBJECT:return o.jsx(Bee,{specification:e,configuration:t,onValueChange:n});case rs.DATE:return o.jsx(Hee,{specification:e,configuration:t,onValueChange:n});case rs.STRING:default:return o.jsx($ee,{specification:e,configuration:t,onValueChange:n})}}function Zee({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:s,onValueChange:l,onSecretEditToggle:c}){return o.jsxs(Yd,{children:[e.requiredType!==rs.BOOLEAN&&o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Ro,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),s&&n&&o.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),DO({specification:e,configuration:t,onValueChange:l,flags:{isSecret:s,isEditingExisting:n,isSecretEditing:r}})]},e.name)}function Kee({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:s,onSecretEditToggle:l}){const c=p.useMemo(()=>{var v,x;const g=t[e.name];if(g&&typeof g=="object"){const b=Object.keys(g);if(b.length>0)return b[0]}return((x=(v=e.oneOf)==null?void 0:v[0])==null?void 0:x.value)??""},[t,e.name,e.oneOf]),[d,f]=p.useState(c);if(p.useEffect(()=>{f(c)},[c]),!e.oneOf)return null;const m=(g,v,x)=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[g]:{...typeof b[g]=="object"&&b[g]!==null?b[g]:{},[v]:x}})};return o.jsx(Mee,{label:e.title??e.name,options:e.oneOf.map(g=>({value:g.value,label:g.label})),value:d,onValueChange:f,children:e.oneOf.map(g=>o.jsx(Tee,{value:g.value,children:Object.entries(g.items).map(([v,x])=>{const b=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},w=Array.isArray(x.attributes)&&Object.keys(b)[0]===g.value?x.attributes.includes("SECRET"):!1,C=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},E=typeof C[g.value]=="object"&&C[g.value]!==null?C[g.value]:{};return o.jsxs("div",{className:"mb-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(Ro,{htmlFor:v,required:x.required,tooltip:x.description,className:"mb-2 justify-start",children:v}),w&&r&&o.jsx(be,{variant:"ghost",size:"sm",type:"button",onClick:()=>{l(e.name,!s)},children:s?"Cancel":"Edit"})]}),DO({specification:{...x,name:v},configuration:E,onValueChange:(R,T)=>{m(g.value,R,T)},flags:{isEditingExisting:r,isSecret:w,isSecretEditing:s}})]},v)})},g.value))},e.name)}function QT(e,t,n,r,s,l){return e.map(c=>{const d=Array.isArray(c.attributes)?c.attributes.includes("SECRET"):!1,f=s[c.name];return c.oneOf&&c.requiredType===rs.OBJECT?o.jsx(Kee,{specification:c,configuration:t,onValueChange:n,isEditingExisting:l,isSecretEditing:f,onSecretEditToggle:r},c.name):o.jsx(Zee,{specification:c,configuration:t,isEditingExisting:l,isSecret:d,isSecretEditing:f,onValueChange:n,onSecretEditToggle:r},c.name)})}function XT({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:s,secretEditing:l,isEditingExisting:c}){return e?o.jsx(kee,{title:e,children:QT(t,n,r,s,l,c)}):QT(t,n,r,s,l,c)}function Yee({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,s]=p.useState([]),[l,c]=p.useState(!1),[d,f]=p.useState(!1),m=p.useCallback(async()=>{c(!0);try{const x=await sn.getDataMartsByConnectorName(e);s(x)}catch{s([])}finally{c(!1)}},[e]);p.useEffect(()=>{d&&m()},[d,m]);const g=(x,b)=>{const w=b._id;if(!w){console.error("Configuration does not have _id field");return}t({dataMartId:x.id,dataMartTitle:x.title,configId:w,configuration:b}),f(!1)},v=x=>{const w=[],C=R=>{if(!n)return!0;const T=n.find(_=>_.name===R);return(T==null?void 0:T.required)??!1},E=(R,T,_=0,O=!0)=>{if(R.startsWith("_")||O&&_===0&&!C(R))return;let A=null;if(T==null)A="N/A";else if(typeof T=="string")A=T;else if(typeof T=="number"||typeof T=="boolean")A=String(T);else if(Array.isArray(T))A=JSON.stringify(T);else if(typeof T=="object"){w.push({key:R,value:"{",indent:_}),Object.entries(T).forEach(([D,j])=>{E(D,j,_+1,!1)}),w.push({key:"",value:"}",indent:_});return}else A=JSON.stringify(T);w.push({key:R,value:A,indent:_})};for(const[R,T]of Object.entries(x))E(R,T);return o.jsx("div",{className:"space-y-1 font-mono text-xs",children:w.map(({key:R,value:T,indent:_},O)=>o.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&o.jsxs("span",{className:"font-medium",children:[R,":"]}),o.jsx("span",{className:"text-muted-foreground truncate",title:T,children:T})]},O))})};return o.jsx(ls,{children:o.jsxs(Rr,{open:d,onOpenChange:f,children:[o.jsx(Tr,{asChild:!0,children:o.jsxs(be,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[o.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),o.jsx(Ta,{className:J("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",d&&"rotate-90")})]})}),o.jsx(jr,{side:"bottom",align:"end",className:"w-72",children:l?o.jsx(yt,{disabled:!0,children:"Loading…"}):r.length===0?o.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[o.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:o.jsx(CL,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),o.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),o.jsx("span",{className:"text-muted-foreground text-sm",children:"You can reuse configuration settings only from connector-based Data Marts that use the same source."})]}):o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to reuse its configuration settings."}),o.jsx("div",{children:r.map(x=>{const w=x.definition.connector.source.configuration;return w.length===0?null:w.length===1?o.jsxs(St,{delayDuration:300,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs(yt,{onSelect:()=>{g(x,w[0])},children:[o.jsx(ap,{className:"text-foreground h-4 w-4"}),x.title]})}),o.jsx(wt,{side:"right",className:"max-w-sm",children:v(w[0])})]},x.id):o.jsxs(r1,{children:[o.jsxs(a1,{className:"flex items-center gap-2",children:[o.jsx(ap,{className:"text-foreground h-4 w-4"}),o.jsx("span",{children:x.title})]}),o.jsx(s1,{children:w.map((C,E)=>o.jsxs(St,{delayDuration:300,children:[o.jsx(Ct,{asChild:!0,children:o.jsxs(yt,{onSelect:()=>{g(x,C)},children:["Configuration ",E+1]})}),o.jsx(wt,{side:"right",className:"max-w-sm",children:v(C)})]},E))})]},x.id)})})]})})]})})}function JT({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:s,loading:l=!1,isEditingExisting:c=!1}){const[d,f]=p.useState({}),m=p.useRef(!1),g=p.useRef(!1),[v,x]=p.useState({});p.useEffect(()=>{if(t){g.current=!0;const D={...s??{}};t.forEach(j=>{const M=Array.isArray(j.attributes)?j.attributes.includes("SECRET"):!1;D[j.name]===void 0&&j.default!==void 0&&(D[j.name]=j.default),c&&M&&(D[j.name]=rb)}),f(D),m.current=!0,setTimeout(()=>{g.current=!1},0)}},[t,s,c]),p.useEffect(()=>{m.current&&s&&Object.keys(s).length>0&&(g.current=!0,f({...s}),setTimeout(()=>{g.current=!1},0))},[s]),p.useEffect(()=>{m.current&&!g.current&&Object.keys(d).length>0&&(n==null||n(d))},[d,n]);const b=(D,j)=>{f(M=>({...M,[D]:j}))},w=p.useCallback(D=>!(D==null||typeof D=="string"&&D.trim()===""||typeof D=="number"&&isNaN(D)||Array.isArray(D)&&D.length===0),[]),C=p.useCallback((D,j)=>{var z;if(typeof D!="object"||D===null)return w(D);const M=(z=j.oneOf)==null?void 0:z.filter(Z=>Z.value===Object.keys(D)[0]);return M?M.every(Z=>Object.entries(Z.items).every(([,K])=>Z.value in D?C(D[Z.value],K):!1)):w(D[j.name])},[w]),E=p.useCallback((D,j)=>{const M=j.filter(Y=>Y.required&&Y.oneOf),z=M.length===0?!0:M.some(Y=>C(D[Y.name],Y)),K=j.filter(Y=>Y.required&&Y.name!=="Fields").every(Y=>w(D[Y.name]));return z&&K},[w,C]),R=(D,j)=>{x(M=>({...M,[D]:j})),f(j?M=>({...M,[D]:""}):M=>({...M,[D]:rb}))},T=D=>{const j={...d};Object.entries(D.configuration).forEach(([M,z])=>{["_id","_copiedFrom"].includes(M)||(j[M]=z)}),j._copiedFrom={dataMartId:D.dataMartId,dataMartTitle:D.dataMartTitle,configId:D.configId},f(j)};if(p.useEffect(()=>{if(t&&r){const D=E(d,t);r(D)}},[d,t,r,E]),l)return o.jsx(yS,{variant:"list"});if(!t||t.length===0)return o.jsxs(jo,{children:[o.jsx(Tl,{connector:e}),o.jsx(ki,{icon:o.jsx(lf,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(ou,{label:"Need configuration?"})]});const _=[...t].filter(D=>{var j;return D.name!=="Fields"&&!((j=D.attributes)!=null&&j.includes("HIDE_IN_CONFIG_FORM"))}).sort((D,j)=>{const M=z=>{const Z=z.default!=null&&z.default!=="";return z.required&&!Z?1:z.required&&Z?2:!z.required&&!Z?3:4};return M(D)-M(j)}),O=_.filter(D=>{var j;return!((j=D.attributes)!=null&&j.includes("ADVANCED"))}),A=_.filter(D=>{var j;return(j=D.attributes)==null?void 0:j.includes("ADVANCED")});return o.jsx(o.Fragment,{children:o.jsxs(jo,{children:[o.jsx(Tl,{connector:e}),o.jsxs(Rl,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),o.jsx(Yee,{currentConnectorName:e.name,onCopyConfiguration:T,connectorSpecification:t})]}),O.length>0&&o.jsx(XT,{items:O,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:v,isEditingExisting:c}),A.length>0&&o.jsx(XT,{collapsibleTitle:"Advanced Settings",items:A,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:v,isEditingExisting:c})]})]})})}function Wee({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:s=!1,onFieldSelect:l}){const c=r?`Select data for ${r}`:"Select data";return s?o.jsx(yS,{variant:"list"}):!t||t.length===0?o.jsxs(jo,{children:[o.jsx(Tl,{connector:e}),o.jsx(ki,{icon:o.jsx(lf,{size:56,strokeWidth:1}),title:r?`No nodes found for ${r}`:"No nodes found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(ou,{label:"Missing some data?"})]}):o.jsxs(jo,{children:[o.jsx(Tl,{connector:e}),o.jsxs(Rl,{title:c,children:[t.map(d=>o.jsx(AO,{type:"radio",id:d.name,name:"selectedField",value:d.name,label:d.overview??d.name,checked:n===d.name,onChange:f=>{l(f)},tooltip:d.name&&o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Table name:"})," ",d.destinationName??d.name]}),d.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",d.description]}),d.documentation&&o.jsxs(Ga,{to:d.documentation,target:"_blank",rel:"noopener noreferrer",className:"bg-muted/16 hover:bg-muted/20 dark:bg-muted/8 dark:hover:bg-muted/16 flex items-center justify-center gap-1 rounded-sm px-2 py-1 font-semibold",children:["Read more",o.jsx(Ta,{className:"h-3 w-3"})]})]}),selected:n===d.name},d.name)),o.jsx(ou,{label:"Missing some data?"})]})]})}var Ns=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(Ns||{});function ej({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:s}){const l=p.useRef(null),[c,d]=p.useState(""),[f,m]=p.useState(Ns.ORIGINAL),g=t==null?void 0:t.find(R=>R.name===n),v=p.useMemo(()=>(g==null?void 0:g.fields)??[],[g==null?void 0:g.fields]),x=p.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),b=p.useMemo(()=>{const R=new Map;return v.forEach((T,_)=>R.set(T.name,_)),R},[v]),w=p.useMemo(()=>{const R=v.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),T=(_,O)=>{const A=x.includes(_.name),D=x.includes(O.name);if(A&&!D)return-1;if(!A&&D)return 1;if(f===Ns.ASC)return _.name.localeCompare(O.name);if(f===Ns.DESC)return O.name.localeCompare(_.name);const j=b.get(_.name)??0,M=b.get(O.name)??0;return j-M};return[...R].sort(T)},[v,c,x,f,b]),C=v.map(R=>R.name),E=r.filter(R=>C.includes(R)).length;return p.useEffect(()=>{if(x.length>0){const R=x.filter(T=>v.some(_=>_.name===T)&&!r.includes(T));R.length>0&&R.forEach(T=>{s(T,!0)})}},[n,x,v,r,s]),p.useEffect(()=>{const R=T=>{const O=(T.ctrlKey||T.metaKey)&&T.shiftKey&&T.key.toLowerCase()==="a",A=document.activeElement.tagName;if(!(A==="INPUT"||A==="TEXTAREA")&&O){T.preventDefault();const D=v.map(z=>z.name),M=D.filter(z=>!r.includes(z)).length>0;D.forEach(z=>{s(z,M)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[v,r,s]),!n||!t?o.jsxs(jo,{children:[o.jsx(Tl,{connector:e}),o.jsx(ki,{icon:o.jsx(lf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(ou,{label:"Need fields?"})]}):v.length?o.jsx(jo,{children:o.jsxs(o.Fragment,{children:[o.jsx(Tl,{connector:e}),o.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[o.jsxs("div",{className:"relative flex-1",children:[o.jsx(Hl,{className:"text-muted-foreground absolute top-1/2 left-3 h-4 w-4 -translate-y-1/2 cursor-text",onClick:()=>{var R;(R=l.current)==null||R.focus()}}),o.jsx("input",{ref:l,type:"text",placeholder:"Search field",value:c,onChange:R=>{d(R.target.value)},className:"h-12 w-full rounded-none border-0 pl-9 text-sm outline-none"}),c&&o.jsx("button",{type:"button",onClick:()=>{d("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:o.jsx(uu,{className:"h-4 w-4"})})]}),o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsxs(be,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===Ns.ASC&&o.jsx(rR,{className:"text-muted-foreground h-4 w-4"}),f===Ns.DESC&&o.jsx(nR,{className:"text-muted-foreground h-4 w-4"}),f===Ns.ORIGINAL&&o.jsx(aR,{className:"text-muted-foreground h-4 w-4"})]})}),o.jsxs(jr,{align:"end",children:[o.jsxs(yt,{onSelect:()=>{m(Ns.ASC)},children:[o.jsx(rR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),o.jsxs(yt,{onSelect:()=>{m(Ns.DESC)},children:[o.jsx(nR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),o.jsxs(yt,{onSelect:()=>{m(Ns.ORIGINAL)},children:[o.jsx(aR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),o.jsxs(Rl,{title:`Selected ${String(E)} of ${String(C.length)} fields for "${n}" data`,children:[w.map(R=>{const T=x.includes(R.name);return o.jsx(AO,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||T,disabled:T,onChange:_=>{s(R.name,_)},label:R.name,tooltip:o.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[T&&o.jsxs("p",{className:"flex items-center gap-2",children:[o.jsx("span",{className:"font-semibold",children:"Unique key"})," ",o.jsx(h0,{className:"text-secondary h-3 w-3"})]}),o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&o.jsxs("p",{children:[o.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:T?o.jsx(h0,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),w.length===0&&c&&o.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),o.jsx(ou,{label:"Need another field?"})]})]})}):o.jsxs(jo,{children:[o.jsx(Tl,{connector:e}),o.jsx(ki,{icon:o.jsx(lf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),o.jsx(ou,{label:"Need fields?"})]})}const OO=p.createContext(void 0),MO={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function Qee(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 MO;default:return e}}class Xee extends Zl{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 zc=new Xee;var Sn=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(Sn||{});const Xc={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class ab{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!==Sn.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await bo.getReportById(n.reportId),s=vl(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:Sn.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 Jee{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:Sn.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 Qx={getMapper(e){switch(e){case Sn.REPORT_RUN:return new ab;case Sn.CONNECTOR_RUN:return new Jee;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Vd={mapFromDto(e){return Qx.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 Sn.REPORT_RUN:return new ab().enhanceWithReportData(n);case Sn.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new ab,r=this.mapFromDtoList(e),s=r.filter(c=>c.type===Sn.REPORT_RUN),l=await n.enhanceTriggersWithReportData(s);return r.map(c=>{switch(c.type){case Sn.REPORT_RUN:return l.find(d=>d.id===c.id)??c;case Sn.CONNECTOR_RUN:{const d=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:d}}}default:return c}})},mapToCreateRequest(e){return Qx.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return Qx.getMapper(e.type).mapToUpdateRequest(e)}};function ete({children:e}){const[t,n]=p.useReducer(Qee,MO),{dataMart:r}=Gi(),{fetchAvailableConnectors:s}=Yl();if(!r)throw new Error("Trigger provider must be used within a data mart context");const l=p.useCallback(async b=>{await s(),n({type:"FETCH_TRIGGERS_START"});try{const w=await zc.getScheduledTriggers(b),C=await Vd.mapFromDtoListWithReportData(w,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:C})}catch(w){const C=w instanceof Error?w.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:C}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:C})}},[r,s]),c=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGERS_START"});try{const E=(await zc.getScheduledTriggers(b)).filter(T=>T.type===w),R=await Vd.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(C){const E=C instanceof Error?C.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:E}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:E})}},[r]),d=p.useCallback(async(b,w)=>{n({type:"FETCH_TRIGGER_START"});try{const C=await zc.getScheduledTrigger(b,w),E=await Vd.mapFromDtoWithReportData(C,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:E})}catch(C){const E=C instanceof Error?C.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:E}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:E})}},[r]),f=p.useCallback(async(b,w,C,E,R,T)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:w,cronExpression:C,timeZone:E,isActive:R,triggerConfig:T},O=await zc.createScheduledTrigger(b,_),A=await Vd.mapFromDtoWithReportData(O,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),Ue({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:w}),on.success("Trigger created"),A}catch(_){const O=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:O}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:O}),_}},[r]),m=p.useCallback(async(b,w,C,E,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const T={cronExpression:C,timeZone:E,isActive:R},_=await zc.updateScheduledTrigger(b,w,T),O=await Vd.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:O}),Ue({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:O.type}),on.success("Trigger updated")}catch(T){const _=T instanceof Error?T.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),T}},[r]),g=p.useCallback(async(b,w)=>{n({type:"DELETE_TRIGGER_START"});try{await zc.deleteScheduledTrigger(b,w),n({type:"DELETE_TRIGGER_SUCCESS",payload:w}),Ue({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:w}),on.success("Trigger deleted")}catch(C){const E=C instanceof Error?C.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:E}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:E}),C}},[]),v=p.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),x=p.useCallback(()=>{n({type:"RESET"})},[]);return o.jsx(OO.Provider,{value:{...t,getScheduledTriggers:l,getScheduledTriggersByType:c,getScheduledTrigger:d,createScheduledTrigger:f,updateScheduledTrigger:m,deleteScheduledTrigger:g,selectScheduledTrigger:v,reset:x},children:e})}function kO(){const e=p.useContext(OO);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function tte(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:s,updateScheduledTrigger:l,deleteScheduledTrigger:c,selectScheduledTrigger:d,reset:f,triggers:m,selectedTrigger:g,isLoading:v,error:x}=kO();return p.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:m,selectedTrigger:g,isLoading:v,error:x,getScheduledTriggers:b=>t(b),getScheduledTriggersByType:(b,w)=>n(b,w),getScheduledTrigger:(b,w)=>r(b,w),createScheduledTrigger:(b,w,C,E,R,T)=>s(b,w,C,E,R,T),updateScheduledTrigger:(b,w,C,E,R)=>l(b,w,C,E,R),deleteScheduledTrigger:(b,w)=>c(b,w),selectScheduledTrigger:d}}const nte=ln({type:qs(Xc.SCHEDULED_REPORT_RUN),reportId:cn().min(1,"Report ID is required")}),rte=NB(),ate=ln({type:g1(Sn),cronExpression:cn().min(1,"Cron expression is required"),timeZone:cn().min(1,"Time zone is required"),isActive:_B(),triggerConfig:DB([nte,rte])});function ste({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const s=qi({resolver:Jl(ate),defaultValues:{type:e?e.type:n??Sn.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:Xc.SCHEDULED_REPORT_RUN,reportId:t??""}}});p.useEffect(()=>{t&&s.getValues("type")===Sn.REPORT_RUN&&s.setValue("triggerConfig",{type:Xc.SCHEDULED_REPORT_RUN,reportId:t})},[t,s]),p.useEffect(()=>{n&&(s.setValue("type",n),n===Sn.REPORT_RUN?s.setValue("triggerConfig",{type:Xc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null))},[n,t,s]);const l=d=>{s.setValue("type",d),d===Sn.REPORT_RUN?s.setValue("triggerConfig",{type:Xc.SCHEDULED_REPORT_RUN,reportId:t??""}):s.setValue("triggerConfig",null)},c=async d=>{try{await r(d)}catch(f){console.error("Error submitting form:",f)}};return{form:s,handleTypeChange:l,handleSubmit:s.handleSubmit(c),isDirty:s.formState.isDirty}}function ote({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:s}=Kl(),{dataMart:l}=Gi();p.useEffect(()=>{l&&s(l.id)},[s,l]);const c=r.filter(d=>d.dataDestination.type===Mt.GOOGLE_SHEETS);return o.jsxs(Ca,{value:e,onValueChange:t,disabled:n,children:[o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a report"})}),o.jsx(Ra,{children:c.map(d=>o.jsx(Zn,{value:d.id,children:d.title},d.id))})]})}var Bg="Switch",[ite]=kr(Bg),[lte,cte]=ite(Bg),IO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:f="on",onCheckedChange:m,form:g,...v}=e,[x,b]=p.useState(null),w=pt(t,_=>b(_)),C=p.useRef(!1),E=x?g||!!x.closest("form"):!0,[R,T]=zr({prop:s,defaultProp:l??!1,onChange:m,caller:Bg});return o.jsxs(lte,{scope:n,checked:R,disabled:d,children:[o.jsx(We.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":FO(R),"data-disabled":d?"":void 0,disabled:d,value:f,...v,ref:w,onClick:Re(e.onClick,_=>{T(O=>!O),E&&(C.current=_.isPropagationStopped(),C.current||_.stopPropagation())})}),E&&o.jsx(UO,{control:x,bubbles:!C.current,name:r,value:f,checked:R,required:c,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});IO.displayName=Bg;var LO="SwitchThumb",PO=p.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,s=cte(LO,n);return o.jsx(We.span,{"data-state":FO(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:t})});PO.displayName=LO;var ute="SwitchBubbleInput",UO=p.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...s},l)=>{const c=p.useRef(null),d=pt(c,l),f=Y1(n),m=Bb(t);return p.useEffect(()=>{const g=c.current;if(!g)return;const v=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(v,"checked").set;if(f!==n&&b){const w=new Event("click",{bubbles:r});b.call(g,n),g.dispatchEvent(w)}},[f,n,r]),o.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...s,tabIndex:-1,ref:d,style:{...s.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});UO.displayName=ute;function FO(e){return e?"checked":"unchecked"}var dte=IO,fte=PO;function zO({className:e,...t}){return o.jsx(dte,{"data-slot":"switch",className:J("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(fte,{"data-slot":"switch-thumb",className:J("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function hte(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 sb(e,t="UTC"){const n=hte(e);if(!n)return{type:"daily",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};const{minute:r,hour:s,day:l,month:c,dayOfWeek:d}=n;if(r.startsWith("*/")&&s==="*"&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(r.substring(2));if(!isNaN(v))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:v,timezone:t}}if(r!=="*"&&s.startsWith("*/")&&l==="*"&&c==="*"&&d==="*"){const v=Number.parseInt(s.substring(2));if(!isNaN(v)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:v,timezone:t}}const f=Number.parseInt(r),m=Number.parseInt(s),g=!isNaN(f)&&!isNaN(m)?`${m.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`:"09:00";if(!isNaN(f)&&!isNaN(m)&&l==="*"&&c==="*"&&d==="*")return{type:"daily",time:g,weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t};if(!isNaN(f)&&!isNaN(m)&&l==="*"&&c==="*"&&d!=="*"){const v=d.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=0&&x<=6);if(v.length>0)return{type:"weekly",time:g,weekdays:v,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(f)&&!isNaN(m)&&l!=="*"&&c==="*"&&d==="*"){const v=l.split(",").map(x=>Number.parseInt(x.trim())).filter(x=>!isNaN(x)&&x>=1&&x<=31);if(v.length>0)return{type:"monthly",time:g,weekdays:[1,2,3,4,5],monthDays:v,customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}return{type:"custom",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}function VO({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:s="Search...",maxDisplayItems:l=3}){const[c,d]=p.useState(!1),f=v=>{const x=t.includes(v)?t.filter(b=>b!==v):[...t,v].sort((b,w)=>b-w);n(x)},m=(v,x)=>{x.preventDefault(),x.stopPropagation(),n(t.filter(b=>b!==v))},g=()=>{if(t.length===0)return o.jsx("span",{className:"text-muted-foreground text-sm",children:r});const v=t.map(x=>e.find(b=>b.value===x)).filter(Boolean);return v.length<=l?o.jsx("div",{className:"flex flex-wrap gap-1",children:v.map(x=>o.jsxs(Cr,{variant:"secondary",className:"h-5 text-xs",children:[x.label,o.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:b=>m(x.value,b),children:o.jsx(uu,{className:"h-2 w-2"})})]},x.value))}):o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsxs(Cr,{variant:"secondary",className:"h-5 text-xs",children:[v[0].label,o.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:x=>m(v[0].value,x),children:o.jsx(uu,{className:"h-2 w-2"})})]}),v.length>1&&o.jsxs(Cr,{variant:"outline",className:"h-5 text-xs",children:["+",v.length-1]})]})};return o.jsxs(tS,{open:c,onOpenChange:d,modal:!0,children:[o.jsx(nS,{asChild:!0,children:o.jsxs(be,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[o.jsx("div",{className:"flex-1 text-left",children:g()}),o.jsx(Tb,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),o.jsx(rS,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:o.jsxs(FD,{className:"h-full overflow-visible",children:[o.jsx(zD,{placeholder:s,className:"h-8"}),o.jsxs(fJ,{className:"h-full max-h-[350px] overflow-y-auto",children:[o.jsx(VD,{children:"No items found."}),o.jsx(HD,{className:"h-full overflow-visible",children:e.map(v=>o.jsxs($D,{value:v.value.toString(),onSelect:()=>f(v.value),className:"text-sm",children:[o.jsx(fr,{className:J("mr-2 h-3 w-3",t.includes(v.value)?"opacity-100":"opacity-0")}),v.label]},v.value))})]})]})})]})}const HO=[{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"}],Pm=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function $O(e,t){if(!t)return"Schedule is disabled";const n=e.time;switch(e.type){case"daily":return`Daily at ${n}`;case"weekly":return`Weekly on ${e.weekdays.map(s=>{var l;return(l=HO.find(c=>c.value===s))==null?void 0:l.label}).join(", ")} at ${n}`;case"monthly":{const s=[...e.monthDays].sort((c,d)=>c-d).map(c=>c===1?"1st":c===2?"2nd":c===3?"3rd":`${String(c)}th`);return`Monthly on the ${s.length===1?s[0]:s.length===2?`${s[0]} and ${s[1]}`:`${s.slice(0,-1).join(", ")}, and ${s[s.length-1]}`} at ${n}`}case"interval":return e.intervalType==="minutes"?`Every ${String(e.intervalValue)} minute${e.intervalValue!==1?"s":""}`:`Every ${String(e.intervalValue)} hour${e.intervalValue!==1?"s":""}`;case"custom":return"Custom schedule";default:return""}}function mte(e,t,n=!0){const r=sb(e,t);return $O(r,n)}const pte=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),ob=[5,10,15,30],ib=[1,2,3,4,6,8,12],gte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Sa,{children:"Type"}),o.jsxs(Ca,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{})}),o.jsxs(Ra,{children:[o.jsx(Zn,{value:"daily",children:"Daily"}),o.jsx(Zn,{value:"weekly",children:"Weekly"}),o.jsx(Zn,{value:"monthly",children:"Monthly"}),o.jsx(Zn,{value:"interval",children:"Interval"})]})]})]}),vte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Sa,{children:"Time"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(Ht,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),tj=({value:e,onChange:t,disabled:n,timezones:r})=>o.jsxs("div",{className:"w-full space-y-2",children:[o.jsx(Sa,{children:"Timezone"}),o.jsx("div",{className:"flex items-center gap-2",children:o.jsx(aS,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),yte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Sa,{children:"Days of Week"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(VO,{options:HO,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),xte=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-2",children:[o.jsx(Sa,{children:"Days of Month"}),o.jsx("div",{className:n?"pointer-events-none":"",children:o.jsx(VO,{options:pte,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),bte=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:s})=>o.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Sa,{children:"Type"}),o.jsxs(Ca,{value:e,onValueChange:l=>{n(l)},disabled:s,children:[o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{})}),o.jsxs(Ra,{children:[o.jsx(Zn,{value:"minutes",children:"Minutes"}),o.jsx(Zn,{value:"hours",children:"Hours"})]})]})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Sa,{children:"Every"}),o.jsxs(Ca,{value:t.toString(),onValueChange:l=>{r(Number.parseInt(l)||1)},disabled:s,children:[o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{})}),o.jsx(Ra,{children:(e==="minutes"?ob:ib).map(l=>o.jsxs(Zn,{value:l.toString(),children:[l," ",e==="minutes"?"min":"hr"]},l))})]})]})]}),Ste=({value:e,onChange:t,disabled:n})=>o.jsxs("div",{className:"space-y-1",children:[o.jsx(Sa,{className:"text-sm",children:"Cron Expression"}),o.jsx(Ht,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function Cte({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:s,showPreview:l=!0,showSaveButton:c=!1}){const[d,f]=p.useState(n),[m,g]=p.useState(t??Pm()),[v,x]=p.useState(!1),b=p.useMemo(()=>eq.getTimezonesWithOffset().map(F=>({value:F.identifier,label:F.displayName,offset:F.offsetString,isDST:F.isDST})),[]),[w,C]=p.useState(()=>sb(e,m)),[E,R]=p.useState(""),[T,_]=p.useState("");p.useEffect(()=>{f(n)},[n]),p.useEffect(()=>{const F=t??Pm();g(F)},[t]),p.useEffect(()=>{if(e){const F=sb(e,m);C(F)}},[e,m]);const O=F=>{const[V,I]=F.time.split(":").map(Number);switch(F.type){case"daily":return`${String(I)} ${String(V)} * * *`;case"weekly":return`${String(I)} ${String(V)} * * ${F.weekdays.join(",")}`;case"monthly":return`${String(I)} ${String(V)} ${F.monthDays.join(",")} * *`;case"interval":return F.intervalType==="minutes"?`*/${String(F.intervalValue)} * * * *`:`0 */${String(F.intervalValue)} * * *`;case"custom":return F.customCron;default:return`${String(I)} ${String(V)} * * *`}},A=p.useCallback(F=>{C(V=>{if(V.intervalType===F)return console.log("Type unchanged, skipping update"),V;const B=(F==="minutes"?ob:ib)[0];return{...V,intervalType:F,intervalValue:B}})},[]),D=p.useCallback(F=>{C(V=>(V.intervalType==="minutes"?ob:ib).includes(F)?{...V,intervalValue:F}:V)},[]),j=p.useMemo(()=>F=>$O(F,d),[d]);p.useEffect(()=>{const F=O(w);R(F),_(j(w))},[w,d,m,j]);const M=p.useRef(""),z=p.useRef(""),Z=p.useRef(!1);p.useEffect(()=>{const F=O(w);r&&(M.current!==F||z.current!==m||Z.current!==d)&&(r({cron:F,timezone:m,enabled:d}),M.current=F,z.current=m,Z.current=d)},[w,m,d,r]);const K=F=>{f(F)},Y=F=>{g(F),C(V=>({...V,timezone:F}))},ae=["daily","weekly","monthly"].includes(w.type);return o.jsxs("div",{className:s,children:[o.jsx("div",{className:"mb-4 space-y-4 pt-0",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Sa,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:d?"Enabled":"Disabled"}),o.jsx(zO,{id:"schedule-enabled",checked:d,onCheckedChange:K})]})]})}),o.jsxs("div",{className:"space-y-4 pt-0",children:[o.jsxs("div",{className:`space-y-4 ${d?"":"opacity-50"}`,children:[o.jsx(gte,{value:w.type,onChange:F=>{C(V=>({...V,type:F}))},disabled:!d}),w.type!=="custom"&&w.type!=="interval"&&o.jsxs("div",{className:"flex gap-3",children:[o.jsx(vte,{value:w.time,onChange:F=>{C(V=>({...V,time:F}))},disabled:!d}),ae&&o.jsx(tj,{value:m,onChange:Y,disabled:!d,timezones:b})]}),(w.type==="interval"||w.type==="custom")&&o.jsx(tj,{value:m,onChange:Y,disabled:!d,timezones:b}),w.type==="weekly"&&o.jsx(yte,{value:w.weekdays,onChange:F=>{C(V=>({...V,weekdays:F}))},disabled:!d}),w.type==="monthly"&&o.jsx(xte,{value:w.monthDays,onChange:F=>{C(V=>({...V,monthDays:F}))},disabled:!d}),w.type==="interval"&&o.jsx(bte,{intervalType:w.intervalType,intervalValue:w.intervalValue,onTypeChange:A,onValueChange:D,disabled:!d}),w.type==="custom"&&o.jsx(Ste,{value:w.customCron,onChange:F=>{C(V=>({...V,customCron:F}))},disabled:!d})]}),l&&o.jsxs(o.Fragment,{children:[o.jsx(w_,{className:"my-3"}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{x(!v)},children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(c_,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),v?o.jsx(Us,{className:"text-muted-foreground h-4 w-4"}):o.jsx(Ka,{className:"text-muted-foreground h-4 w-4"})]}),v&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"grid gap-4",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),o.jsx(Cr,{variant:d?"default":"secondary",className:"text-xs",children:d?"Enabled":"Disabled"})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),o.jsx(Cr,{variant:"secondary",className:"font-mono text-xs",children:E})]}),o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),o.jsx(Cr,{variant:"outline",className:"text-xs",children:m})]}),o.jsxs("div",{className:"flex items-start justify-between gap-2",children:[o.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),o.jsx("span",{className:"flex-1 text-right text-xs",children:T})]})]}),d&&ae&&m!==Pm()&&o.jsxs(pS,{className:"border-amber-200 bg-amber-50",children:[o.jsx(Rf,{className:"h-4 w-4"}),o.jsx(xO,{children:"Time Zone"}),o.jsxs(gS,{children:["Schedule runs in ",m," (not your local ",Pm()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&o.jsx(be,{className:"w-full",disabled:!d,children:"Save Schedule"})]})]})}function wte(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"trigger-type-options-description-details",children:[o.jsx(Wn,{children:"How do I choose a type?"}),o.jsxs(Qn,{children:[o.jsxs("p",{className:"mb-2",children:[o.jsx("strong",{children:"Report Run"})," - runs a report to import data from the specified Data Storage into a Destination provider (e.g. Google Sheets document)."]}),o.jsxs("p",{className:"mb-2",children:[o.jsx("strong",{children:"Connector Run"})," - runs a connector (e.g., Facebook Ads) configured in the Data Mart to update raw data in the selected Data Storage."]})]})]})})}function Ete(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"trigger-type-change-description-details",children:[o.jsx(Wn,{children:"How do I change the trigger type?"}),o.jsx(Qn,{children:o.jsx("p",{children:"Trigger type cannot be changed after the trigger is created. If you need a different type, delete the existing trigger and create a new one with the desired type."})})]})})}function Rte(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"report-change-description-details",children:[o.jsx(Wn,{children:"How do I change a report?"}),o.jsx(Qn,{children:o.jsx("p",{children:"The report cannot be changed after the trigger is created. If you need a different report, delete the existing trigger and create a new one with the desired report."})})]})})}function Tte(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"report-select-description-details",children:[o.jsx(Wn,{children:"How do I choose the report?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),o.jsxs("p",{children:["You can use an existing one or create a new one on the ",o.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function jte({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:s,onDirtyChange:l}){const[c,d]=p.useState(!1),{form:f,handleTypeChange:m,handleSubmit:g,isDirty:v}=ste({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async E=>{d(!0);try{await r(E)}finally{d(!1)}}});p.useEffect(()=>{l==null||l(v)},[v,l]);const{control:x,watch:b}=f,C=b("type")===Sn.REPORT_RUN;return o.jsx(Wl,{...f,children:o.jsxs(Zi,{onSubmit:E=>void g(E),noValidate:!1,children:[o.jsxs(Ql,{children:[o.jsx(Jt,{control:x,name:"type",render:({field:E})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),o.jsxs(Ca,{onValueChange:R=>{E.onChange(R),m(R)},defaultValue:E.value,disabled:!!n||!!e||!!b("triggerConfig.reportId"),children:[o.jsx(nn,{children:o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{placeholder:"Select trigger type"})})}),o.jsxs(Ra,{children:[o.jsx(Zn,{value:Sn.REPORT_RUN,children:"Report Run"}),o.jsx(Zn,{value:Sn.CONNECTOR_RUN,children:"Connector Run"})]})]}),o.jsx(or,{children:e?o.jsx(Ete,{}):o.jsx(wte,{})}),o.jsx(un,{})]})}),C&&o.jsx(Jt,{control:x,name:"triggerConfig.reportId",render:({field:E})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),o.jsx(nn,{children:o.jsx(I4,{children:o.jsx(ote,{value:E.value,onChange:E.onChange,disabled:!!t||!!e})})}),o.jsx(or,{children:e!=null&&e.triggerConfig?o.jsx(Rte,{}):o.jsx(Tte,{})}),o.jsx(un,{})]})}),o.jsx(Cte,{showPreview:!1,cron:b("cronExpression"),timezone:b("timeZone"),enabled:b("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"})]}),o.jsxs(Xl,{children:[o.jsx(be,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!v||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),s&&o.jsx(be,{variant:"outline",type:"button",onClick:s,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function _te({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=p.useMemo(()=>mte(e,t,n),[e,t,n]);return o.jsxs("div",{children:[o.jsx("div",{children:r}),n&&o.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function Nte({table:e}){return o.jsx("div",{className:"text-right",children:o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(yt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta.title??t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function Ate({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),d=()=>{c(!1),n(e.id)};return o.jsxs("div",{className:"text-right",onClick:f=>{f.stopPropagation()},children:[o.jsxs(Rr,{open:r,onOpenChange:s,children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${r?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(jr,{align:"end",children:[o.jsxs(yt,{onClick:()=>{t(e.id)},children:[o.jsx(jf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),o.jsx(qa,{}),o.jsxs(yt,{onClick:()=>{c(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),o.jsx(na,{open:l,onOpenChange:c,title:"Delete Scheduled Trigger",description:"Are you sure you want to delete this scheduled trigger? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:d,variant:"destructive"})]})}function Dte({connector:e}){const{connectors:t}=Yl(),n=zY(e,t);return o.jsx(o.Fragment,{children:n})}function BO({connector:e}){return o.jsx(Dte,{connector:e})}function Ote(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 Mte=e=>{const{connectors:t}=Yl();return p.useMemo(()=>t.find(n=>n.name===e),[t,e])},kte=_e.memo(function({connector:t,children:n}){const r=Mte(t.source.name),{dataMart:s,runs:l,getDataMartRuns:c}=Gi();p.useEffect(()=>{s!=null&&s.id&&c(s.id)},[s==null?void 0:s.id,c]);const d=p.useMemo(()=>r!=null&&r.logoBase64?o.jsx(Nu,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=p.useCallback(()=>{s!=null&&s.storage&&Dq(s.storage,t.storage.fullyQualifiedName)},[s==null?void 0:s.storage,t.storage.fullyQualifiedName]),m=p.useMemo(()=>Ote(l),[l]),g=p.useMemo(()=>!m.lastRunDate||!m.lastRunStatus?null:{statusType:IZ(m.lastRunStatus),statusText:PZ(m.lastRunStatus),date:m.lastRunDate},[m]),v=p.useMemo(()=>(s==null?void 0:s.storage)&&Oq(s.storage),[s]),x=p.useMemo(()=>{const b=t.source.fields.length.toString();return`${t.source.node} • ${b} fields`},[t.source.node,t.source.fields.length]);return o.jsxs(C1,{children:[o.jsx(w1,{asChild:!0,children:o.jsx("span",{children:n})}),o.jsxs(E1,{children:[o.jsxs(R1,{children:[o.jsx(T1,{children:d}),o.jsxs(j1,{children:[o.jsx(_1,{children:o.jsx(BO,{connector:t})}),o.jsx(N1,{children:x})]})]}),o.jsxs(A1,{children:[o.jsxs(bi,{children:[o.jsx(Si,{children:"Last run status:"}),o.jsx(Ci,{children:g?o.jsx(Gf,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),o.jsxs(bi,{children:[o.jsx(Si,{children:"Last run date:"}),o.jsx(Ci,{children:g?o.jsx(Pl,{date:g.date}):"Never run"})]}),o.jsxs(bi,{children:[o.jsx(Si,{children:"Total runs:"}),o.jsxs(Ci,{children:[m.totalRuns," runs",m.firstRunDate&&o.jsxs(o.Fragment,{children:[", since"," ",m.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),o.jsx(D1,{children:o.jsxs(be,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[v,o.jsx(_l,{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 Ite(e){const t=e.triggerConfig;return o.jsxs("div",{className:"inline gap-1",children:[t.report.title,o.jsx(MZ,{report:t.report,children:o.jsx(Fr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Lte(e){const t=e.triggerConfig,{connector:n}=t.connector;return o.jsxs("div",{className:"inline gap-1",children:[o.jsx(BO,{connector:n}),o.jsx(kte,{connector:n,children:o.jsx(Fr,{className:"ml-1 inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Pte({trigger:e}){switch(e.type){case Sn.REPORT_RUN:return Ite(e);case Sn.CONNECTOR_RUN:return Lte(e);default:return o.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Ute({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const s=n.getValue("type")===Sn.REPORT_RUN?"Report Run":"Connector Run";return o.jsx(Cr,{variant:"outline",children:s})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>o.jsx(Pte,{trigger:n.original}),meta:{title:"Run Target"}},{accessorKey:"cronExpression",size:20,header:"Schedule",cell:({row:n})=>{const r=n.getValue("cronExpression"),s=n.original.timeZone,l=n.getValue("isActive");return o.jsx(_te,{cronExpression:String(r),timeZone:s,isEnabled:l})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(Pl,{date:new Date(r)}):"Not scheduled"})},meta:{title:"Next Run"}},{accessorKey:"lastRun",size:15,header:"Last Run",cell:({row:n})=>{const r=n.original.lastRun;return o.jsx("div",{className:"text-sm",children:r?o.jsx(Pl,{date:new Date(r)}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"Never run"})})},meta:{title:"Last Run"}},{accessorKey:"isActive",size:15,header:"Trigger Status",cell:({row:n})=>{const r=n.getValue("isActive");return o.jsx(Gf,{type:r?Nn.SUCCESS:Nn.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>o.jsx(Nte,{table:n}),cell:({row:n})=>o.jsx(Ate,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function Fte({table:e,onPreviousClick:t,onNextClick:n}){return o.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[o.jsx(be,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),o.jsx(be,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function xS({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:s}){const{createScheduledTrigger:l,updateScheduledTrigger:c,selectedTrigger:d}=kO(),[f,m]=p.useState(!1),[g,v]=p.useState(!1),x=p.useCallback(()=>{g?m(!0):t()},[g,t]),b=p.useCallback(()=>{m(!1),v(!1),t()},[t]),w=p.useCallback(O=>{v(O)},[]),C=p.useCallback(()=>{v(!1),t()},[t]),E=!!d,R=p.useMemo(()=>d?{type:d.type,cronExpression:d.cronExpression,timeZone:d.timeZone,isActive:d.isActive,triggerConfig:d.type===Sn.REPORT_RUN?{type:Xc.SCHEDULED_REPORT_RUN,reportId:d.triggerConfig.reportId}:null}:void 0,[d]),T=async O=>{E?await c(n,d.id,O.cronExpression,O.timeZone,O.isActive):await l(n,O.type,O.cronExpression,O.timeZone,O.isActive,O.triggerConfig),C()},_=p.useRef(!1);return p.useEffect(()=>{const O=E?"Edit":"Create",A=(d==null?void 0:d.type)??s;e&&!_.current?(Ue({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:O,label:A}),_.current=!0):!e&&_.current&&(Ue({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:O,label:A}),_.current=!1)},[e,E,d,s]),o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:O=>{O||x()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsxs(Fi,{children:[E?"Edit":"Create"," Scheduled Trigger"]}),o.jsx(Gl,{children:"Configure automatic runs for your reports or connectors."})]}),o.jsx(jte,{preSelectedReportId:r,preSelectedType:s,initialData:R,onSubmit:T,onCancel:x,onDirtyChange:w})]})}),o.jsx(na,{open:f,onOpenChange:m,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:b,variant:"destructive"})]})}function zte({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[s,l]=p.useState(!1),c=p.useCallback(()=>{l(!1)},[]),d=p.useCallback(R=>{r(R)},[r]),f=p.useMemo(()=>Ute({onEditTrigger:n,onDeleteTrigger:d}),[n,d]),{sorting:m,setSorting:g,columnVisibility:v,setColumnVisibility:x}=Kf({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),b=Du({data:e,columns:f,getCoreRowModel:Au(),getPaginationRowModel:Ag(),onSortingChange:g,getSortedRowModel:Zf(),getFilteredRowModel:qf(),state:{sorting:m,columnVisibility:v},onColumnVisibilityChange:x,enableGlobalFilter:!0,enableColumnResizing:!1}),w=p.useCallback(()=>{b.previousPage()},[b]),C=p.useCallback(()=>{b.nextPage()},[b]);return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ou,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[o.jsx(Mu,{className:"dm-card-table-header",children:b.getHeaderGroups().map(R=>o.jsx(ir,{className:"dm-card-table-header-row",children:R.headers.map(T=>o.jsx(Iu,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:T.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.getSize())}%`},children:T.isPlaceholder?null:typeof T.column.columnDef.header=="function"?T.column.columnDef.header(T.getContext()):T.column.columnDef.header},T.id))},R.id))}),o.jsx(ku,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map((R,T)=>o.jsx(ir,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":T+1,children:R.getVisibleCells().map((_,O)=>o.jsx(ba,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":O+1,style:_.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:typeof _.column.columnDef.cell=="function"?_.column.columnDef.cell(_.getContext()):_.column.columnDef.cell},_.id))},R.id)):o.jsx(ir,{children:o.jsx(ba,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),o.jsx(Fte,{table:b,onPreviousClick:w,onNextClick:C}),o.jsx(xS,{isOpen:s,onClose:c,dataMartId:t})]})}function Vte({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:s}=tte(e),[l,c]=p.useState(!1);p.useEffect(()=>{s&&c(!0)},[s]);const d=g=>{const v=t.find(x=>x.id===g);v&&r(v)},f=()=>{c(!1),r(null)},m=async g=>{try{await n(e,g)}catch(v){console.error("Error deleting trigger:",v)}};return o.jsxs(o.Fragment,{children:[o.jsx(zte,{triggers:t,dataMartId:e,onEditTrigger:d,onDeleteTrigger:g=>void m(g)}),o.jsx(xS,{isOpen:l,onClose:f,dataMartId:e})]})}function GO(){return o.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:o.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[o.jsx(Ab,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium",children:"Time Triggers"}),o.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",o.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function Hte({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:s}){const l=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[d,f]=p.useState(""),[m,g]=p.useState(""),[v,x]=p.useState(null),[b,w]=p.useState(null),C=_=>_.trim()?/^[A-Za-z][A-Za-z0-9_]*$/.test(_)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",E=p.useCallback((_,O,A,D)=>{s({fullyQualifiedName:`${_}.${O}`,isValid:!!(_&&O&&A===null&&D===null)})},[s]);p.useEffect(()=>{let _="",O="";if(t!=null&&t.fullyQualifiedName){const z=t.fullyQualifiedName.split(".");_=z[0]??"",O=z[1]??""}else _=`${c}_owox`,O=l;const A=C(_),D=C(O);f(_),g(O),x(A),w(D);const j=`${_}.${O}`,M=!!(_&&O&&A===null&&D===null);((t==null?void 0:t.fullyQualifiedName)!==j||t.isValid!==M)&&E(_,O,A,D)},[t,l,c,E]);const R=_=>{f(_);const O=C(_);x(O),E(_,m,O,b)},T=_=>{g(_);const O=C(_);w(O),E(d,_,v,O)};return o.jsxs(jo,{children:[e===Ie.GOOGLE_BIGQUERY&&o.jsxs(o.Fragment,{children:[o.jsx(ki,{icon:o.jsx(JA,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),o.jsxs(Rl,{title:"Choose where to store your data",children:[o.jsxs(Yd,{children:[o.jsx(Ro,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),o.jsx(Ht,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"dataset-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),v&&o.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs(Yd,{children:[o.jsx(Ro,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx(Ht,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"table-name-error":void 0,onChange:_=>{T(_.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),e===Ie.AWS_ATHENA&&o.jsxs(o.Fragment,{children:[o.jsx(ki,{icon:o.jsx(e4,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),o.jsxs(Rl,{title:"Choose where to store your data",children:[o.jsxs(Yd,{children:[o.jsx(Ro,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),o.jsx(Ht,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!v,"aria-describedby":v?"database-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),v&&o.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:v})]}),o.jsxs(Yd,{children:[o.jsx(Ro,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),o.jsx(Ht,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:m,"aria-invalid":!!b,"aria-describedby":b?"athena-table-name-error":void 0,onChange:_=>{T(_.target.value)},required:!0}),o.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&o.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),o.jsx(Rl,{title:"Schedule updates",children:o.jsx(GO,{})})]})}function $te({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:s="full",initialStep:l,preselectedConnector:c}){const[d,f]=p.useState(null),[m,g]=p.useState(""),[v,x]=p.useState([]),[b,w]=p.useState(1),[C,E]=p.useState({}),[R,T]=p.useState(!1),[_,O]=p.useState(new Set),[A,D]=p.useState(new Set),{connectors:j,connectorSpecification:M,connectorFields:z,loading:Z,loadingSpecification:K,loadingFields:Y,error:ae,fetchAvailableConnectors:F,fetchConnectorSpecification:V,fetchConnectorFields:I}=Yl(),[B,G]=p.useState(null),xe=(n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:s==="fields-only"?[{id:1,title:"Select Fields",description:"Pick specific fields"}]:[{id:1,title:"Select Connector",description:"Choose a data source"},{id:2,title:"Configuration",description:"Set up connector parameters"},{id:3,title:"Select Nodes",description:"Choose data nodes"},{id:4,title:"Select Fields",description:"Pick specific fields"},{id:5,title:"Target Setup",description:"Configure destination"}]).length,L=p.useCallback(async Me=>{!_.has(Me)&&!K&&(O(_t=>new Set(_t).add(Me)),await V(Me))},[_,K,V]),P=p.useCallback(async Me=>{A.has(Me)||(D(_t=>new Set(_t).add(Me)),await I(Me))},[A,I]);p.useEffect(()=>{if(!c||d||j.length===0)return;const Me=j.find(_t=>_t.name===c);Me&&(f(Me),w(l??2),L(Me.name),!n&&s!=="fields-only"&&P(Me.name))},[c,j,d,l,n,s,L,P]),p.useEffect(()=>{if(j.length===0&&!Z&&F(),r&&j.length>0&&!d){const{source:Me,storage:_t}=r;g(Me.node),x(Me.fields),E(Me.configuration[0]||{}),G({fullyQualifiedName:_t.fullyQualifiedName,isValid:!0});const Nt=j.find(rn=>rn.name===Me.name);Nt&&(f(Nt),L(Nt.name),!n&&s!=="fields-only"&&P(Nt.name),s==="fields-only"&&P(Nt.name))}if(n&&j.length>0&&!d&&!r){const Me=j[0];f(Me),L(Me.name)}},[s,r,j,n,Z,F,L,P,d]);const W=Me=>{f(Me),E({}),T(!1),O(_t=>{const Nt=new Set(_t);return Nt.delete(Me.name),Nt}),L(Me.name),P(Me.name)},ee=Me=>{g(Me),x([])},de=(Me,_t)=>{x(_t?Nt=>Nt.includes(Me)?Nt:[...Nt,Me]:Nt=>Nt.filter(rn=>rn!==Me))},ve=(Me,_t)=>{x(_t?Nt=>{const rn=Me.filter($=>!Nt.includes($));return[...Nt,...rn]}:Nt=>Nt.filter(rn=>!Me.includes(rn)))},le=Me=>{G(Me)},Ne=p.useCallback(Me=>{E(Me)},[]),we=p.useCallback(Me=>{T(Me)},[]);p.useEffect(()=>{M&&(M.some(_t=>_t.required&&_t.name!=="Fields")||T(!0))},[M]);const Te=()=>{b<xe&&w(b+1)},Be=()=>{b>1&&w(b-1)},Xe=()=>{if(n)return d!==null&&R;if(s==="fields-only")switch(b){case 1:return v.length>0;default:return!1}switch(b){case 1:return d!==null;case 2:return R;case 3:return m!=="";case 4:return v.length>0;case 5:return B!==null&&B.fullyQualifiedName!==""&&B.isValid;default:return!1}},Vt=()=>b>1,jt=(Me,_t)=>{if(!Me)return _t;const Nt=Me.find(rn=>rn.name===_t);return(Nt==null?void 0:Nt.destinationName)??_t},$t=()=>{if(n&&b===1)return M&&d?o.jsx(JT,{connector:d,connectorSpecification:M,onConfigurationChange:Ne,onValidationChange:we,initialConfiguration:C,loading:K,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(s==="fields-only")switch(b){case 1:return d&&m&&z?o.jsx(ej,{connector:d,connectorFields:z,selectedField:m,selectedFields:v,onFieldToggle:de,onSelectAllFields:ve}):null;default:return null}switch(b){case 1:return o.jsx(Pee,{connectors:j,selectedConnector:d,loading:Z,error:ae,onConnectorSelect:W,onConnectorDoubleClick:()=>{w(Me=>Me<xe?Me+1:Me)}});case 2:return d&&M?o.jsx(JT,{connector:d,connectorSpecification:M,onConfigurationChange:Ne,onValidationChange:we,initialConfiguration:C,loading:K,isEditingExisting:!1}):null;case 3:return d&&z?o.jsx(Wee,{connectorFields:z,connector:d,selectedField:m,connectorName:d.displayName,loading:Y,onFieldSelect:ee}):null;case 4:return d&&m&&z?o.jsx(ej,{connector:d,connectorFields:z,selectedField:m,selectedFields:v,onFieldToggle:de,onSelectAllFields:ve}):null;case 5:return m&&z?o.jsx(Hte,{dataStorageType:t,destinationName:jt(z,m),connectorName:(d==null?void 0:d.displayName)??"",target:B,onTargetChange:le}):null;default:return null}};return o.jsxs(Aee,{children:[o.jsx(Dee,{children:$t()}),o.jsx(Oee,{variant:"horizontal",children:o.jsx(Uee,{currentStep:b,totalSteps:xe,canGoNext:Xe(),canGoBack:Vt(),isLoading:K||Y,onNext:Te,onBack:Be,onFinish:()=>{n&&d?e({source:{name:d.name,configuration:[C],node:(r==null?void 0:r.source.node)??m,fields:(r==null?void 0:r.source.fields)??v},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}):s==="fields-only"&&r?e({source:{...r.source,fields:v},storage:r.storage}):d&&B&&e({source:{name:d.name,configuration:[C],node:m,fields:v},storage:{fullyQualifiedName:B.fullyQualifiedName}})}})})]})}const qO=20,ZO=20;function KO({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 Bte(e=30,t=0){KO({vertical:ZO+e,horizontal:qO+t})}function lb(){KO({vertical:ZO,horizontal:qO})}function YO({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:s=!1,existingConnector:l=null,mode:c="full",initialStep:d,preselectedConnector:f}){return p.useEffect(()=>(e?Bte(55):lb(),()=>{lb()}),[e]),o.jsx(Li,{open:e,onOpenChange:t,children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:c==="fields-only"?"Connector Fields":l!=null&&l.source.name?"Edit Connector":"Set Up Connector"}),o.jsx(Gl,{children:c==="fields-only"?"Select fields for your Data Mart":l!=null&&l.source.name?"Update configuration":"Follow these steps to set it up"})]}),o.jsx($te,{onSubmit:m=>{r(m),t()},dataStorageType:n,configurationOnly:s||c==="configuration-only",existingConnector:l,mode:c,initialStep:d,preselectedConnector:f})]})})}const bS=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:s=null,preset:l,isOpen:c,onClose:d})=>{const[f,m]=p.useState(!1),[g,v]=p.useState(1),[x,b]=p.useState();p.useEffect(()=>{c!==void 0&&m(c)},[c]);const w=()=>{b(void 0),v(1),m(!0)},C=()=>{m(!1),d==null||d()};return p.useEffect(()=>{l&&(l==="connector"?(b(void 0),v(1),m(!0)):(b(l),v(2),m(!0)))},[l]),o.jsxs(o.Fragment,{children:[n&&o.jsx("div",{onClick:w,style:{cursor:"pointer"},children:n}),o.jsx(yu,{children:o.jsx(YO,{isOpen:f,onClose:C,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:s,initialStep:g,preselectedConnector:x})})]})};function Gte({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:s}){return o.jsx(bS,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:s,children:o.jsxs(be,{type:"button",variant:"outline",className:"flex h-24 w-full cursor-pointer items-center justify-center gap-2 border-0 shadow-none dark:border-transparent dark:bg-transparent dark:hover:bg-white/4",children:[o.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:o.jsx(Nb,{className:"h-4 w-4",strokeWidth:2.25})}),o.jsx("span",{children:"Setup Connector"}),o.jsx(Ta,{className:"h-6 w-6"})]})})}const qte=e=>{switch(e){case Ie.GOOGLE_BIGQUERY:return"Google BigQuery";case Ie.AWS_ATHENA:return"AWS Athena";default:return e}},Yc=e=>typeof e=="object"&&"connector"in e,Hd=e=>{if(!Yc(e))return!1;const{source:t,storage:n}=e.connector,r=!!t.name&&!!t.configuration&&t.configuration.length>0&&!!t.node&&!!t.fields&&t.fields.length>0,s=!!n.fullyQualifiedName&&n.fullyQualifiedName.split(".").length===2;return r&&s};function Zte({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,dataMartStatus:s,totalConfigurations:l,dataStorage:c}){const d=Bi.getInfo(c.type),{connectors:f,fetchAvailableConnectors:m}=Yl();p.useEffect(()=>{m()},[m]);const g=C=>{const E=f.find(R=>R.name===C);if(E!=null&&E.logoBase64)return()=>o.jsx(Nu,{base64:E.logoBase64,size:24})},v=()=>{const C=t.connector.source.node||"No node selected";return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[o.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",o.jsx("span",{className:"text-muted-foreground font-medium",children:C}),o.jsx("span",{className:"text-muted-foreground",children:"•"}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[o.jsx("span",{children:"Edit config"}),o.jsx(Ta,{className:"h-3 w-3"})]})}),o.jsx(wt,{children:"Edit connector configuration"})]})]})},x=(C,E,R)=>o.jsxs("span",{children:[o.jsxs("span",{className:"text-muted-foreground/75",children:[C,":"]})," ",o.jsx(hr,{href:R,onClick:T=>{T.stopPropagation()},children:E})]}),b=()=>{switch(c.type){case Ie.GOOGLE_BIGQUERY:{const C=c.config.projectId,E=t.connector.storage.fullyQualifiedName,R=E.split(".")[0],T=E.split(".")[1],_=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}`,O=`https://console.cloud.google.com/bigquery?project=${C}&ws=!1m4!1m3!3m2!1s${C}!2s${R}!3s${T}`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Dataset",R,_),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,O),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Fr,{className:"h-4 w-4"})}),o.jsx(wt,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case Ie.AWS_ATHENA:{const C=c.config.region,E=t.connector.storage.fullyQualifiedName,[R,T]=E.split("."),_=`https://console.aws.amazon.com/athena/home?region=${C}#/query-editor`;return o.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x("Database",R,_),o.jsx("span",{className:"text-muted-foreground",children:"•"}),x("Table",T,_),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(Fr,{className:"h-4 w-4"})}),o.jsx(wt,{children:"The database and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}default:return"Unknown storage type configuration"}},w=()=>!(s===dr.PUBLISHED&&l===1);return o.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[o.jsx("div",{className:"flex-grow",children:o.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[o.jsx(bS,{dataStorageType:c.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:o.jsx(X0,{icon:g(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:v(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),o.jsx(X0,{title:qte(c.type),icon:d.icon,subtitle:b(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),o.jsx("div",{className:"shrink-0 px-4",children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(be,{type:"button",variant:"ghost",onClick:()=>{w()&&n(e)},disabled:!w(),children:o.jsx(Lo,{className:"h-4 w-4"})})}),!w()&&o.jsx(wt,{children:"Cannot remove the last configuration in published pipeline"})]})})]})}function Kte({storageType:e,onAddConfiguration:t,existingConnector:n}){return o.jsx("div",{children:o.jsx(bS,{dataStorageType:e,onSubmit:r=>{const s=r.source.configuration[0]||{};t(s)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:o.jsxs(be,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(ja,{className:"h-4 w-4"}),o.jsx("span",{children:"Configuration"})]})})})}function Yte({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:s}){const{dataMart:l,runDataMart:c}=gs(),{setValue:d,getValues:f,trigger:m}=Lu(),[g,v]=p.useState(!1),[x,b]=p.useState(!1);p.useEffect(()=>{r&&b(!0)},[r]);const w=(l==null?void 0:l.status)??dr.DRAFT,C=async F=>{d("definition",F,{shouldDirty:!0,shouldTouch:!0}),await m("definition")&&s&&s()},E=async F=>{const V=F.source,I=F.storage;await C({connector:{source:V,storage:I}})},R=async F=>{if(l){if(l.status.code!==dr.PUBLISHED){Ot.error("Manual run is only available for published data marts");return}await c({id:l.id,payload:F})}},T=F=>async V=>{const B=f().definition;if(typeof B=="object"&&Yc(B)){const G=[...B.connector.source.configuration];G[F]=V.source.configuration[0]||{};const ie={connector:{...B.connector,source:{...B.connector.source,configuration:G}}};await C(ie)}},_=async F=>{const I=f().definition;if(typeof I=="object"&&Yc(I)){const B={connector:{...I.connector,source:{...I.connector.source,fields:F.source.fields}}};await C(B)}v(!1)},O=F=>{R({runType:F.runType,data:F.data})},A=F=>{const V=F.connector.source.fields.length;return o.jsxs(be,{type:"button",variant:"outline",onClick:()=>{v(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[o.jsx(EL,{className:"h-4 w-4"}),o.jsxs("span",{children:["Edit Fields (",String(V),")"]})]})},[D,j]=p.useState(null),[M,z]=p.useState(!1),Z=F=>{j(F),z(!0)},K=async()=>{D!==null&&(await Y(D),j(null),z(!1))},Y=async F=>{const I=f().definition;if(Yc(I)&&I.connector.source.configuration.length<=1){const B=nb(He.CONNECTOR);await C(B)}if(typeof I=="object"&&Yc(I)&&I.connector.source.configuration.length>1){const B={...I.connector.source,configuration:I.connector.source.configuration.filter((ie,xe)=>xe!==F)},G={connector:{...I.connector,source:B}};await C(G)}},ae=async F=>{const I=f().definition;if(Yc(I)){const B={...I.connector.source,configuration:[...I.connector.source.configuration,F]},G={connector:{...I.connector,source:B}};await C(G)}};return o.jsxs(o.Fragment,{children:[o.jsx(Jt,{control:e,name:"definition",render:({field:F})=>o.jsxs(en,{className:"dark:bg-white/2",children:[o.jsx(nn,{children:o.jsx("div",{className:"space-y-3",children:!Hd(F.value)||w===dr.DRAFT?o.jsx(Gte,{storageType:t,onSetupConnector:V=>{E(V),b(!1)},preset:n,isOpen:x,onClose:()=>{b(!1)}}):o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Kte,{storageType:t,onAddConfiguration:V=>void ae(V),existingConnector:Hd(F.value)?{source:F.value.connector.source,storage:F.value.connector.storage}:void 0}),Hd(F.value)&&A(F.value)]}),o.jsx("div",{className:"flex items-center gap-2",children:l&&l.definitionType===He.CONNECTOR&&o.jsx(CD,{configuration:l.definition,onManualRun:O,children:o.jsxs(be,{variant:"outline",children:[o.jsx(_b,{className:"h-4 w-4"}),o.jsx("span",{children:"Manual Run..."})]})})})]}),o.jsx("div",{className:"space-y-3",children:Hd(F.value)&&(l!=null&&l.storage)?F.value.connector.source.configuration.map((V,I)=>{const B=F.value;return o.jsx(yu,{children:o.jsx(Zte,{configIndex:I,connectorDef:B,dataStorage:l.storage,onRemoveConfiguration:G=>{Z(G)},onUpdateConfiguration:G=>T(G),dataMartStatus:typeof w=="object"?w.code:w,totalConfigurations:B.connector.source.configuration.length},I)},I)}):null})]})})}),o.jsx(un,{})]})}),o.jsx(yu,{children:o.jsx(YO,{isOpen:g,onClose:()=>{v(!1)},onSubmit:F=>void _(F),dataStorageType:t,existingConnector:Hd(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),o.jsx(na,{open:M,onOpenChange:z,title:"Delete Configuration",description:"Are you sure you want to delete this configuration? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{K()},onCancel:()=>{j(null)},variant:"destructive"})]})}function Wte({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:s}=Lu(),[l,c]=p.useState(!1);return p.useEffect(()=>{e===He.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),o.jsxs("div",{className:"space-y-2",children:[e===He.SQL&&o.jsx(fee,{control:s}),e===He.TABLE&&o.jsx(hee,{control:s,storageType:t}),e===He.VIEW&&o.jsx(mee,{control:s,storageType:t}),e===He.TABLE_PATTERN&&o.jsx(pee,{control:s,storageType:t}),e===He.CONNECTOR&&o.jsx(Yte,{control:s,storageType:t,preset:n,autoOpen:l,saveDataMartDefinition:r})]})}function WO(){const[e]=II(),t=e.get("preset");return p.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return cY(n)},[t])}const SS=e=>{if(!e)return"—";let t;if(typeof e=="string"){if(t=new Date(e),isNaN(t.getTime()))return"—"}else if(t=e,isNaN(t.getTime()))return"—";const r=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(t),s=new Map(r.map(v=>[v.type,v.value])),l=s.get("year")??"",c=s.get("month")??"",d=s.get("day")??"",f=s.get("hour")??"",m=s.get("minute")??"",g=s.get("second")??"";return`${l}-${c}-${d} ${f}:${m}:${g}`},Vc=e=>SS(Qte(e).toISOString()),Qte=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},Xte=(e,t)=>{const n=t.getTime()-e.getTime(),r=Math.floor(n/1e3),s=Math.floor(r/60),l=Math.floor(s/60),c=s%60,d=r%60,f=[];return l>0&&f.push(`${String(l)} h`),c>0&&f.push(`${String(c)} min`),f.push(`${String(d)} sec`),f.join(" ")};function Jte(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${Number.parseFloat((e/Math.pow(t,r)).toFixed(2)).toString()} ${n[r]}`}function ene(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function tne(e,t){const[n,r]=p.useState(e);return p.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const nne=1e3,rne=[El.SUCCESS,El.ERROR,El.CANCELLED];function ane(e){const[t,n]=p.useState(!1),[r,s]=p.useState(null),l=p.useRef({triggerId:null,abortController:null}),c=p.useCallback(v=>l.current.triggerId===v,[]),d=p.useCallback(v=>{s({isValid:!1,error:v instanceof Error?v.message:"Validation failed"}),n(!1)},[]),f=p.useCallback(async()=>{const{triggerId:v,abortController:x}=l.current;if(v){x==null||x.abort(),l.current={triggerId:null,abortController:null},s(null),n(!1);try{await sn.abortSqlDryRunTrigger(e,v)}catch(b){console.error("Failed to cancel trigger:",b)}}},[e]),m=p.useCallback(async(v,x)=>{for(;!x.aborted&&c(v);)try{const b=await sn.getSqlDryRunTriggerStatus(e,v);if(rne.includes(b)){const w=await sn.getSqlDryRunTriggerResponse(e,v);s({isValid:w.isValid,error:w.error??void 0,bytes:w.bytes}),n(!1),l.current={triggerId:null,abortController:null};return}await new Promise(w=>setTimeout(w,nne))}catch(b){d(b),l.current={triggerId:null,abortController:null};return}},[e,c,d]),g=p.useCallback(async v=>{await f(),n(!0),s(null);try{const{triggerId:x}=await sn.createSqlDryRunTrigger(e,v),b=new AbortController;l.current={triggerId:x,abortController:b},await m(x,b.signal)}catch(x){d(x)}},[e,f,m,d]);return p.useEffect(()=>()=>{const{triggerId:v,abortController:x}=l.current;x==null||x.abort(),v&&sn.abortSqlDryRunTrigger(e,v).catch(()=>{})},[e]),{validateSql:g,isLoading:t,result:r,cancel:f}}const sne=300;function one({sql:e,dataMartId:t,debounceDelay:n=sne,className:r="",onValidationStateChange:s}){const l=tne(e.trim(),n),{validateSql:c,isLoading:d,result:f,cancel:m}=ane(t);p.useEffect(()=>{if(!l){m();const v={isLoading:!1,isValid:null,error:null,bytes:null};s==null||s(v);return}c(l)},[l,c,m,s]),p.useEffect(()=>{const v={isLoading:d,isValid:(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(v)},[d,f,s]);const g=()=>d?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(Tf,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{className:"text-sm",children:"Validating..."})]}):f?f.isValid?o.jsxs("div",{className:"flex h-5 items-center gap-2",children:[o.jsx(E9,{className:"h-4 w-4 text-green-600"}),o.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),f.bytes!==void 0&&o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(cu,{className:"h-3 w-3 text-gray-600"}),o.jsx("span",{className:"text-xs text-gray-600",children:Jte(f.bytes)})]})}),o.jsx(wt,{children:o.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):o.jsxs("div",{className:"flex h-9 items-center gap-2",children:[o.jsx(sp,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),f.error&&o.jsx("span",{className:"text-xs text-red-500",children:f.error})]}):o.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[o.jsx(cu,{className:"h-4 w-4"}),o.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return o.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:g()})}function ine(){const{dataMart:e,updateDataMartDefinition:t,getDataMart:n}=gs(),r=WO();if(!e)throw new Error("Data mart not found");const{definitionType:s,definition:l,id:c,storage:{type:d}}=e,[f,m]=p.useState(s),[,g]=p.useState({isValid:null,isLoading:!1,error:null}),v=p.useCallback(()=>{if(!f)return;const V={definitionType:f,definition:nb(f)};return l?{definitionType:f,definition:l}:V},[f,l]),x=p.useCallback(()=>{if(!f)return;const V=dee(f,d);return Jl(V)},[f,d]),b=qi({resolver:x(),defaultValues:v(),mode:"onChange"}),{handleSubmit:w,reset:C,watch:E,formState:{isDirty:R,isValid:T}}=b,_=(V,I)=>{if(V!==He.SQL)return"";const B=I;return(B==null?void 0:B.sqlQuery)??""},O=E("definition"),A=_(f,O);p.useEffect(()=>{f&&C(v())},[f,C,v]);const D=V=>nb(V);p.useEffect(()=>{if(!f&&!s&&(r!=null&&r.definitionType)){m(r.definitionType);const V={definitionType:r.definitionType,definition:D(r.definitionType)};C(V)}},[r,f,s,C]);const j=p.useCallback(V=>{g({isLoading:V.isLoading,isValid:V.isValid,error:V.error})},[]),M=V=>{m(V)},z=p.useCallback(()=>{c&&n(c)},[c,n]),{run:Z}=X1(c,z),K=async V=>{if(f&&c)try{await t(c,V.definitionType,V.definition),await Z(),C(V)}catch(I){console.error("Failed to update data mart definition:",I)}},Y=V=>{V==null||V.preventDefault(),w(K)(V)},ae=()=>{C(v())},F=()=>f?o.jsxs("form",{onSubmit:Y,className:"space-y-4",children:[o.jsx(Wte,{definitionType:f,storageType:d,preset:r==null?void 0:r.connectorSourceTitle,saveDataMartDefinition:Y}),f!==He.CONNECTOR&&o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(be,{variant:"default",type:"submit",disabled:!T||!R,children:"Save"}),o.jsx(be,{type:"button",variant:"ghost",onClick:ae,disabled:!R,children:"Discard"}),f===He.SQL&&A&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"h-6 w-px bg-gray-300"}),o.jsx(one,{sql:A,dataMartId:c,onValidationStateChange:j})]})]})]}):null;return o.jsx(T3,{...b,children:o.jsxs("div",{className:"space-y-4",children:[!s&&o.jsx(see,{initialType:f,onTypeSelect:M}),F()]})})}function lne(e){switch(e){case Ie.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case Ie.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function QO(e){return e.type==="bigquery-data-mart-schema"}function XO(e){return e.type==="athena-data-mart-schema"}function nj(e){return e!==null&&typeof e=="object"&&"mode"in e}function rj(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function cne(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function Xx(e){return e==null?e:JSON.parse(JSON.stringify(e))}function une(e){const t=Xx(e),[n,r]=p.useState(t),[s,l]=p.useState(!1);p.useEffect(()=>{const f=Xx(e);r(f),l(!1)},[e]);const c=p.useCallback(f=>{n?QO(n)&&f.every(nj)?(r({...n,fields:f}),l(!0)):XO(n)&&f.every(rj)&&(r({...n,fields:f}),l(!0)):f.length>0&&(nj(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),l(!0)):rj(f[0])&&(r({type:"athena-data-mart-schema",fields:f}),l(!0)))},[n]),d=p.useCallback(()=>{const f=Xx(e);r(f),l(!1)},[e]);return{schema:n,isDirty:s,updateSchema:c,resetSchema:d,setIsDirty:l}}function dne(e,t){const n=p.useRef(!1),r=p.useRef(!1),[s,l]=p.useState("idle");return p.useEffect(()=>{e||(n.current||r.current)&&(l(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:s,startSaveOperation:()=>{n.current=!0,l("idle")},startActualizeOperation:()=>{r.current=!0,l("idle")},resetOperationStatus:()=>{l("idle")}}}function fne(e){const t=p.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(s=>s.meta&&s.meta.hidden).map(s=>["id"in s&&s.id?s.id:"accessorKey"in s&&typeof s.accessorKey=="string"?s.accessorKey:void 0,!1]).filter(([s])=>s!==void 0)):{},[e]),[n,r]=p.useState({});return p.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function JO(e,t){const n=e.name?e.name.toLowerCase().includes(t):!1,r=e.alias?e.alias.toLowerCase().includes(t):!1,s=e.description?e.description.toLowerCase().includes(t):!1;if(n||r||s)return!0;const l=e;return l.fields&&l.fields.length>0?l.fields.some(c=>JO(c,t)):!1}function e5(e,t,n=""){const r=[];return e.forEach((s,l)=>{const c=n?`${n}.${String(l)}`:String(l),d=s.name?s.name.toLowerCase().includes(t):!1,f=s.alias?s.alias.toLowerCase().includes(t):!1,m=s.description?s.description.toLowerCase().includes(t):!1;if((d||f||m)&&r.push(c),s.fields&&s.fields.length>0){const g=e5(s.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function hne(e,t,n){const r=e.original;if(!n)return!0;const s=n.toLowerCase();return JO(r,s)}function mne(e){const[t,n]=p.useState(""),r=p.useCallback(l=>{n(l),e.setGlobalFilter(l)},[e]),s=t.toLowerCase();return{value:t,onChange:r,searchValue:s}}var us=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(us||{}),vf=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(vf||{}),Pn=(e=>(e.INTEGER="INTEGER",e.FLOAT="FLOAT",e.NUMERIC="NUMERIC",e.BIGNUMERIC="BIGNUMERIC",e.STRING="STRING",e.BYTES="BYTES",e.BOOLEAN="BOOLEAN",e.DATE="DATE",e.TIME="TIME",e.DATETIME="DATETIME",e.TIMESTAMP="TIMESTAMP",e.GEOGRAPHY="GEOGRAPHY",e.JSON="JSON",e.RECORD="RECORD",e.STRUCT="STRUCT",e.RANGE="RANGE",e.INTERVAL="INTERVAL",e))(Pn||{}),CS=(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))(CS||{});function pne(e){const[t,n]=p.useState(new Set),[r,s]=p.useState(null),l=p.useRef(""),c=p.useMemo(()=>{const w=C=>C.some(E=>E.type===Pn.RECORD||E.type===Pn.STRUCT||E.fields&&w(E.fields));return w(e)},[e]),d=p.useCallback(w=>{n(C=>{const E=new Set(C);return E.has(w)?E.delete(w):E.add(w),E})},[]),f=p.useCallback(()=>{const w=[],C=(E,R="")=>{E.forEach((T,_)=>{const O=R?`${R}.${String(_)}`:String(_);(T.type===Pn.RECORD||T.type===Pn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};C(e),n(E=>w.every(T=>E.has(T))?new Set:new Set(w))},[e]),m=p.useMemo(()=>{const w=[],C=(E,R="",T=0)=>{E.forEach((_,O)=>{const A=R?`${R}.${String(O)}`:String(O),D=_.type===Pn.RECORD||_.type===Pn.STRUCT;w.push({..._,path:A,level:T}),D&&_.fields&&t.has(A)&&C(_.fields,A,T+1)})};return C(e),w},[e,t]),g=p.useCallback(w=>{if(w!==l.current)if(l.current=w,w){r===null&&s(new Set(t));const E=e5(e,w).filter(R=>{const T=R.split(".").map(Number);let _=e,O;for(let A=0;A<T.length;A++){if(O=_[T[A]],!O)return!1;if((O.type===Pn.RECORD||O.type===Pn.STRUCT)&&O.fields&&O.fields.length>0)return!0;A<T.length-1&&(_=O.fields??[])}return!1});n(R=>{const T=new Set(R);return E.forEach(_=>{T.add(_)}),T})}else r!==null&&(n(r),s(null))},[e,t,r]),v=p.useCallback(w=>{const C=m[w];return C.type===Pn.RECORD||C.type===Pn.STRUCT},[m]),x=p.useMemo(()=>e.map(w=>({...w,fields:void 0})),[e]),b=p.useMemo(()=>{const w=[],C=(E,R="")=>{E.forEach((T,_)=>{const O=R?`${R}.${String(_)}`:String(_);(T.type===Pn.RECORD||T.type===Pn.STRUCT)&&T.fields&&T.fields.length>0&&(w.push(O),C(T.fields,O))})};return C(e),w.length===0?!1:w.every(E=>t.has(E))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:d,toggleAllRecords:f,flattenedFields:m,handleSearchChange:g,isRecordType:v,topLevelFields:x,allExpanded:b}}function gne(e,t,n,r){const s=p.useCallback((f,m)=>{if(n){const g=[...e],v=t[f].path;if(!v)g[f]={...g[f],...m};else{const x=v.split(".").map(Number);let b=g,w;for(let E=0;E<x.length-1;E++)w=b[x[E]],b=w.fields??[];const C=x[x.length-1];b[C]&&(b[C]={...b[C],...m})}n(g)}},[e,t,n]),l=p.useCallback(()=>{if(n){const f={name:"",type:Pn.STRING,mode:vf.NULLABLE,isPrimaryKey:!1,status:us.DISCONNECTED};n([...e,f])}},[e,n]),c=p.useCallback(f=>{if(n){const m=[...e],g=t[f].path;if(!g)m.splice(f,1);else{const v=g.split(".").map(Number);let x=m,b;for(let C=0;C<v.length-1;C++)b=x[v[C]],x=b.fields??[];const w=v[v.length-1];x.splice(w,1)}n(m)}},[e,t,n]),d=p.useCallback(f=>{var m,g;if(n&&r){const v=[...e],x=t[f].path,b={name:"",type:Pn.STRING,mode:vf.NULLABLE,isPrimaryKey:!1,status:us.DISCONNECTED};if(!x)(m=v[f]).fields??(m.fields=[]),v[f].fields.push(b);else{const w=x.split(".").map(Number);let C=v;for(let E=0;E<w.length;E++){const R=w[E];E===w.length-1?((g=C[R]).fields??(g.fields=[]),C[R].fields.push(b)):C=C[R].fields??[]}}n(v)}},[e,t,n,r]);return{updateField:s,handleAddRow:l,handleDeleteRow:c,handleAddNestedField:d}}function t5(e,t,n){return{handleDragEnd:p.useCallback(s=>{const{active:l,over:c}=s;if(!c||l.id===c.id||!t)return;if(!n){const x=Number(l.id),b=Number(c.id),w=[...e],[C]=w.splice(x,1);w.splice(b,0,C),t(w);return}const d=n.findIndex((x,b)=>(x.path??String(b))===l.id),f=n.findIndex((x,b)=>(x.path??String(b))===c.id);if(d===-1||f===-1)return;const m=n[d].path,g=n[f].path,v=[...e];if(!m&&!g){const[x]=v.splice(d,1);v.splice(f,0,x),t(v);return}if(m&&g){const x=m.split(".").map(Number),b=g.split(".").map(Number);if(x.length===b.length&&x.slice(0,-1).join(".")===b.slice(0,-1).join(".")){let w=v;for(let T=0;T<x.length-1;T++)w=w[x[T]].fields??[];const C=x[x.length-1],E=b[b.length-1],[R]=w.splice(C,1);w.splice(E,0,R),t(v)}}},[e,n,t])}}function vne(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>r=>{t.forEach(s=>s(r))},t)}const Gg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Fu(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function wS(e){return"nodeType"in e}function ra(e){var t,n;return e?Fu(e)?e:wS(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function ES(e){const{Document:t}=ra(e);return e instanceof t}function eh(e){return Fu(e)?!1:e instanceof ra(e).HTMLElement}function n5(e){return e instanceof ra(e).SVGElement}function zu(e){return e?Fu(e)?e.document:wS(e)?ES(e)?e:eh(e)||n5(e)?e.ownerDocument:document:document:document}const Hs=Gg?p.useLayoutEffect:p.useEffect;function RS(e){const t=p.useRef(e);return Hs(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function yne(){const e=p.useRef(null),t=p.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=p.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function yf(e,t){t===void 0&&(t=[e]);const n=p.useRef(e);return Hs(()=>{n.current!==e&&(n.current=e)},t),n}function th(e,t){const n=p.useRef();return p.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Pp(e){const t=RS(e),n=p.useRef(null),r=p.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function cb(e){const t=p.useRef();return p.useEffect(()=>{t.current=e},[e]),t.current}let Jx={};function nh(e,t){return p.useMemo(()=>{if(t)return t;const n=Jx[e]==null?0:Jx[e]+1;return Jx[e]=n,e+"-"+n},[e,t])}function r5(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((l,c)=>{const d=Object.entries(c);for(const[f,m]of d){const g=l[f];g!=null&&(l[f]=g+e*m)}return l},{...t})}}const iu=r5(1),Up=r5(-1);function xne(e){return"clientX"in e&&"clientY"in e}function TS(e){if(!e)return!1;const{KeyboardEvent:t}=ra(e.target);return t&&e instanceof t}function bne(e){if(!e)return!1;const{TouchEvent:t}=ra(e.target);return t&&e instanceof t}function ub(e){if(bne(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 xne(e)?{x:e.clientX,y:e.clientY}:null}const xf=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[xf.Translate.toString(e),xf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),aj="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Sne(e){return e.matches(aj)?e:e.querySelector(aj)}const Cne={display:"none"};function wne(e){let{id:t,value:n}=e;return _e.createElement("div",{id:t,style:Cne},n)}function Ene(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 _e.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function Rne(){const[e,t]=p.useState("");return{announce:p.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const a5=p.createContext(null);function Tne(e){const t=p.useContext(a5);p.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function jne(){const[e]=p.useState(()=>new Set),t=p.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[p.useCallback(r=>{let{type:s,event:l}=r;e.forEach(c=>{var d;return(d=c[s])==null?void 0:d.call(c,l)})},[e]),t]}const _ne={draggable:`
|
|
707
|
-
To pick up a draggable item, press the space bar.
|
|
708
|
-
While dragging, use the arrow keys to move the item.
|
|
709
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
710
|
-
`},Nne={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 Ane(e){let{announcements:t=Nne,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=_ne}=e;const{announce:l,announcement:c}=Rne(),d=nh("DndLiveRegion"),[f,m]=p.useState(!1);if(p.useEffect(()=>{m(!0)},[]),Tne(p.useMemo(()=>({onDragStart(v){let{active:x}=v;l(t.onDragStart({active:x}))},onDragMove(v){let{active:x,over:b}=v;t.onDragMove&&l(t.onDragMove({active:x,over:b}))},onDragOver(v){let{active:x,over:b}=v;l(t.onDragOver({active:x,over:b}))},onDragEnd(v){let{active:x,over:b}=v;l(t.onDragEnd({active:x,over:b}))},onDragCancel(v){let{active:x,over:b}=v;l(t.onDragCancel({active:x,over:b}))}}),[l,t])),!f)return null;const g=_e.createElement(_e.Fragment,null,_e.createElement(wne,{id:r,value:s.draggable}),_e.createElement(Ene,{id:d,announcement:c}));return n?is.createPortal(g,n):g}var ar;(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"})(ar||(ar={}));function Fp(){}function s5(e,t){return p.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function o5(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return p.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ms=Object.freeze({x:0,y:0});function Dne(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function One(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Mne(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function kne(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function sj(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 i5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=sj(t,t.left,t.top),l=[];for(const c of r){const{id:d}=c,f=n.get(d);if(f){const m=Dne(sj(f),s);l.push({id:d,data:{droppableContainer:c,value:m}})}}return l.sort(One)};function Ine(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=s-r,d=l-n;if(r<s&&n<l){const f=t.width*t.height,m=e.width*e.height,g=c*d,v=g/(f+m-g);return Number(v.toFixed(4))}return 0}const Lne=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const l of r){const{id:c}=l,d=n.get(c);if(d){const f=Ine(d,t);f>0&&s.push({id:c,data:{droppableContainer:l,value:f}})}}return s.sort(Mne)};function Pne(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function l5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ms}function Une(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),l=1;l<r;l++)s[l-1]=arguments[l];return s.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const Fne=Une(1);function zne(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 Vne(e,t,n){const r=zne(t);if(!r)return e;const{scaleX:s,scaleY:l,x:c,y:d}=r,f=e.left-c-(1-s)*parseFloat(n),m=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s:e.width,v=l?e.height/l:e.height;return{width:g,height:v,top:m,right:f+g,bottom:m+v,left:f}}const Hne={ignoreTransform:!1};function Vu(e,t){t===void 0&&(t=Hne);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:m,transformOrigin:g}=ra(e).getComputedStyle(e);m&&(n=Vne(n,m,g))}const{top:r,left:s,width:l,height:c,bottom:d,right:f}=n;return{top:r,left:s,width:l,height:c,bottom:d,right:f}}function oj(e){return Vu(e,{ignoreTransform:!0})}function $ne(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Bne(e,t){return t===void 0&&(t=ra(e).getComputedStyle(e)),t.position==="fixed"}function Gne(e,t){t===void 0&&(t=ra(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const l=t[s];return typeof l=="string"?n.test(l):!1})}function jS(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(ES(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!eh(s)||n5(s)||n.includes(s))return n;const l=ra(e).getComputedStyle(s);return s!==e&&Gne(s,l)&&n.push(s),Bne(s,l)?n:r(s.parentNode)}return e?r(e):n}function c5(e){const[t]=jS(e,1);return t??null}function e0(e){return!Gg||!e?null:Fu(e)?e:wS(e)?ES(e)||e===zu(e).scrollingElement?window:eh(e)?e:null:null}function u5(e){return Fu(e)?e.scrollX:e.scrollLeft}function d5(e){return Fu(e)?e.scrollY:e.scrollTop}function db(e){return{x:u5(e),y:d5(e)}}var ur;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(ur||(ur={}));function f5(e){return!Gg||!e?!1:e===document.scrollingElement}function h5(e){const t={x:0,y:0},n=f5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,d=e.scrollLeft>=r.x;return{isTop:s,isLeft:l,isBottom:c,isRight:d,maxScroll:r,minScroll:t}}const qne={x:.2,y:.2};function Zne(e,t,n,r,s){let{top:l,left:c,right:d,bottom:f}=n;r===void 0&&(r=10),s===void 0&&(s=qne);const{isTop:m,isBottom:g,isLeft:v,isRight:x}=h5(e),b={x:0,y:0},w={x:0,y:0},C={height:t.height*s.y,width:t.width*s.x};return!m&&l<=t.top+C.height?(b.y=ur.Backward,w.y=r*Math.abs((t.top+C.height-l)/C.height)):!g&&f>=t.bottom-C.height&&(b.y=ur.Forward,w.y=r*Math.abs((t.bottom-C.height-f)/C.height)),!x&&d>=t.right-C.width?(b.x=ur.Forward,w.x=r*Math.abs((t.right-C.width-d)/C.width)):!v&&c<=t.left+C.width&&(b.x=ur.Backward,w.x=r*Math.abs((t.left+C.width-c)/C.width)),{direction:b,speed:w}}function Kne(e){if(e===document.scrollingElement){const{innerWidth:l,innerHeight:c}=window;return{top:0,left:0,right:l,bottom:c,width:l,height:c}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function m5(e){return e.reduce((t,n)=>iu(t,db(n)),ms)}function Yne(e){return e.reduce((t,n)=>t+u5(n),0)}function Wne(e){return e.reduce((t,n)=>t+d5(n),0)}function Qne(e,t){if(t===void 0&&(t=Vu),!e)return;const{top:n,left:r,bottom:s,right:l}=t(e);c5(e)&&(s<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xne=[["x",["left","right"],Yne],["y",["top","bottom"],Wne]];class _S{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=jS(n),s=m5(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of Xne)for(const f of c)Object.defineProperty(this,f,{get:()=>{const m=d(r),g=s[l]-m;return this.rect[f]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ef{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 Jne(e){const{EventTarget:t}=ra(e);return e instanceof t?e:zu(e)}function t0(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 Ha;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ha||(Ha={}));function ij(e){e.preventDefault()}function ere(e){e.stopPropagation()}var zt;(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"})(zt||(zt={}));const p5={start:[zt.Space,zt.Enter],cancel:[zt.Esc],end:[zt.Space,zt.Enter,zt.Tab]},tre=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case zt.Right:return{...n,x:n.x+25};case zt.Left:return{...n,x:n.x-25};case zt.Down:return{...n,y:n.y+25};case zt.Up:return{...n,y:n.y-25}}};class g5{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 ef(zu(n)),this.windowListeners=new ef(ra(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ha.Resize,this.handleCancel),this.windowListeners.add(Ha.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ha.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Qne(r),n(ms)}handleKeyDown(t){if(TS(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:l=p5,coordinateGetter:c=tre,scrollBehavior:d="smooth"}=s,{code:f}=t;if(l.end.includes(f)){this.handleEnd(t);return}if(l.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:m}=r.current,g=m?{x:m.left,y:m.top}:ms;this.referenceCoordinates||(this.referenceCoordinates=g);const v=c(t,{active:n,context:r.current,currentCoordinates:g});if(v){const x=Up(v,g),b={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const E=t.code,{isTop:R,isRight:T,isLeft:_,isBottom:O,maxScroll:A,minScroll:D}=h5(C),j=Kne(C),M={x:Math.min(E===zt.Right?j.right-j.width/2:j.right,Math.max(E===zt.Right?j.left:j.left+j.width/2,v.x)),y:Math.min(E===zt.Down?j.bottom-j.height/2:j.bottom,Math.max(E===zt.Down?j.top:j.top+j.height/2,v.y))},z=E===zt.Right&&!T||E===zt.Left&&!_,Z=E===zt.Down&&!O||E===zt.Up&&!R;if(z&&M.x!==v.x){const K=C.scrollLeft+x.x,Y=E===zt.Right&&K<=A.x||E===zt.Left&&K>=D.x;if(Y&&!x.y){C.scrollTo({left:K,behavior:d});return}Y?b.x=C.scrollLeft-K:b.x=E===zt.Right?C.scrollLeft-A.x:C.scrollLeft-D.x,b.x&&C.scrollBy({left:-b.x,behavior:d});break}else if(Z&&M.y!==v.y){const K=C.scrollTop+x.y,Y=E===zt.Down&&K<=A.y||E===zt.Up&&K>=D.y;if(Y&&!x.x){C.scrollTo({top:K,behavior:d});return}Y?b.y=C.scrollTop-K:b.y=E===zt.Down?C.scrollTop-A.y:C.scrollTop-D.y,b.y&&C.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,iu(Up(v,this.referenceCoordinates),b))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}g5.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=p5,onActivation:s}=t,{active:l}=n;const{code:c}=e.nativeEvent;if(r.start.includes(c)){const d=l.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function lj(e){return!!(e&&"distance"in e)}function cj(e){return!!(e&&"delay"in e)}class NS{constructor(t,n,r){var s;r===void 0&&(r=Jne(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:l}=t,{target:c}=l;this.props=t,this.events=n,this.document=zu(c),this.documentListeners=new ef(this.document),this.listeners=new ef(r),this.windowListeners=new ef(ra(c)),this.initialCoordinates=(s=ub(l))!=null?s:ms,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ha.Resize,this.handleCancel),this.windowListeners.add(Ha.DragStart,ij),this.windowListeners.add(Ha.VisibilityChange,this.handleCancel),this.windowListeners.add(Ha.ContextMenu,ij),this.documentListeners.add(Ha.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(cj(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(lj(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(Ha.Click,ere,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ha.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!s)return;const f=(n=ub(t))!=null?n:ms,m=Up(s,f);if(!r&&d){if(lj(d)){if(d.tolerance!=null&&t0(m,d.tolerance))return this.handleCancel();if(t0(m,d.distance))return this.handleStart()}if(cj(d)&&t0(m,d.tolerance))return this.handleCancel();this.handlePending(d,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===zt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const nre={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class qg extends NS{constructor(t){const{event:n}=t,r=zu(n.target);super(t,nre,r)}}qg.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 rre={move:{name:"mousemove"},end:{name:"mouseup"}};var fb;(function(e){e[e.RightClick=2]="RightClick"})(fb||(fb={}));class are extends NS{constructor(t){super(t,rre,zu(t.event.target))}}are.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===fb.RightClick?!1:(r==null||r({event:n}),!0)}}];const n0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class sre extends NS{constructor(t){super(t,n0)}static setup(){return window.addEventListener(n0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(n0.move.name,t)};function t(){}}}sre.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 tf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(tf||(tf={}));var zp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zp||(zp={}));function ore(e){let{acceleration:t,activator:n=tf.Pointer,canScroll:r,draggingRect:s,enabled:l,interval:c=5,order:d=zp.TreeOrder,pointerCoordinates:f,scrollableAncestors:m,scrollableAncestorRects:g,delta:v,threshold:x}=e;const b=lre({delta:v,disabled:!l}),[w,C]=yne(),E=p.useRef({x:0,y:0}),R=p.useRef({x:0,y:0}),T=p.useMemo(()=>{switch(n){case tf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case tf.DraggableRect:return s}},[n,s,f]),_=p.useRef(null),O=p.useCallback(()=>{const D=_.current;if(!D)return;const j=E.current.x*R.current.x,M=E.current.y*R.current.y;D.scrollBy(j,M)},[]),A=p.useMemo(()=>d===zp.TreeOrder?[...m].reverse():m,[d,m]);p.useEffect(()=>{if(!l||!m.length||!T){C();return}for(const D of A){if((r==null?void 0:r(D))===!1)continue;const j=m.indexOf(D),M=g[j];if(!M)continue;const{direction:z,speed:Z}=Zne(D,M,T,t,x);for(const K of["x","y"])b[K][z[K]]||(Z[K]=0,z[K]=0);if(Z.x>0||Z.y>0){C(),_.current=D,w(O,c),E.current=Z,R.current=z;return}}E.current={x:0,y:0},R.current={x:0,y:0},C()},[t,O,r,C,l,c,JSON.stringify(T),JSON.stringify(b),w,m,A,g,JSON.stringify(x)])}const ire={x:{[ur.Backward]:!1,[ur.Forward]:!1},y:{[ur.Backward]:!1,[ur.Forward]:!1}};function lre(e){let{delta:t,disabled:n}=e;const r=cb(t);return th(s=>{if(n||!r||!s)return ire;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[ur.Backward]:s.x[ur.Backward]||l.x===-1,[ur.Forward]:s.x[ur.Forward]||l.x===1},y:{[ur.Backward]:s.y[ur.Backward]||l.y===-1,[ur.Forward]:s.y[ur.Forward]||l.y===1}}},[n,t,r])}function cre(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return th(s=>{var l;return t==null?null:(l=r??s)!=null?l:null},[r,t])}function ure(e,t){return p.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,l=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...l]},[]),[e,t])}var bf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(bf||(bf={}));var hb;(function(e){e.Optimized="optimized"})(hb||(hb={}));const uj=new Map;function dre(e,t){let{dragging:n,dependencies:r,config:s}=t;const[l,c]=p.useState(null),{frequency:d,measure:f,strategy:m}=s,g=p.useRef(e),v=E(),x=yf(v),b=p.useCallback(function(R){R===void 0&&(R=[]),!x.current&&c(T=>T===null?R:T.concat(R.filter(_=>!T.includes(_))))},[x]),w=p.useRef(null),C=th(R=>{if(v&&!n)return uj;if(!R||R===uj||g.current!==e||l!=null){const T=new Map;for(let _ of e){if(!_)continue;if(l&&l.length>0&&!l.includes(_.id)&&_.rect.current){T.set(_.id,_.rect.current);continue}const O=_.node.current,A=O?new _S(f(O),O):null;_.rect.current=A,A&&T.set(_.id,A)}return T}return R},[e,l,n,v,f]);return p.useEffect(()=>{g.current=e},[e]),p.useEffect(()=>{v||b()},[n,v]),p.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),p.useEffect(()=>{v||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},d))},[d,v,b,...r]),{droppableRects:C,measureDroppableContainers:b,measuringScheduled:l!=null};function E(){switch(m){case bf.Always:return!1;case bf.BeforeDragging:return n;default:return!n}}}function v5(e,t){return th(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function fre(e,t){return v5(e,t)}function hre(e){let{callback:t,disabled:n}=e;const r=RS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function Zg(e){let{callback:t,disabled:n}=e;const r=RS(t),s=p.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return p.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function mre(e){return new _S(Vu(e),e)}function dj(e,t,n){t===void 0&&(t=mre);const[r,s]=p.useState(null);function l(){s(f=>{if(!e)return null;if(e.isConnected===!1){var m;return(m=f??n)!=null?m:null}const g=t(e);return JSON.stringify(f)===JSON.stringify(g)?f:g})}const c=hre({callback(f){if(e)for(const m of f){const{type:g,target:v}=m;if(g==="childList"&&v instanceof HTMLElement&&v.contains(e)){l();break}}}}),d=Zg({callback:l});return Hs(()=>{l(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),r}function pre(e){const t=v5(e);return l5(e,t)}const fj=[];function gre(e){const t=p.useRef(e),n=th(r=>e?r&&r!==fj&&e&&t.current&&e.parentNode===t.current.parentNode?r:jS(e):fj,[e]);return p.useEffect(()=>{t.current=e},[e]),n}function vre(e){const[t,n]=p.useState(null),r=p.useRef(e),s=p.useCallback(l=>{const c=e0(l.target);c&&n(d=>d?(d.set(c,db(c)),new Map(d)):null)},[]);return p.useEffect(()=>{const l=r.current;if(e!==l){c(l);const d=e.map(f=>{const m=e0(f);return m?(m.addEventListener("scroll",s,{passive:!0}),[m,db(m)]):null}).filter(f=>f!=null);n(d.length?new Map(d):null),r.current=e}return()=>{c(e),c(l)};function c(d){d.forEach(f=>{const m=e0(f);m==null||m.removeEventListener("scroll",s)})}},[s,e]),p.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>iu(l,c),ms):m5(e):ms,[e,t])}function hj(e,t){t===void 0&&(t=[]);const n=p.useRef(null);return p.useEffect(()=>{n.current=null},t),p.useEffect(()=>{const r=e!==ms;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Up(e,n.current):ms}function yre(e){p.useEffect(()=>{if(!Gg)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 xre(e,t){return p.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:l}=r;return n[s]=c=>{l(c,t)},n},{}),[e,t])}function y5(e){return p.useMemo(()=>e?$ne(e):null,[e])}const mj=[];function bre(e,t){t===void 0&&(t=Vu);const[n]=e,r=y5(n?ra(n):null),[s,l]=p.useState(mj);function c(){l(()=>e.length?e.map(f=>f5(f)?r:new _S(t(f),f)):mj)}const d=Zg({callback:c});return Hs(()=>{d==null||d.disconnect(),c(),e.forEach(f=>d==null?void 0:d.observe(f))},[e]),s}function Sre(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return eh(t)?t:e}function Cre(e){let{measure:t}=e;const[n,r]=p.useState(null),s=p.useCallback(m=>{for(const{target:g}of m)if(eh(g)){r(v=>{const x=t(g);return v?{...v,width:x.width,height:x.height}:x});break}},[t]),l=Zg({callback:s}),c=p.useCallback(m=>{const g=Sre(m);l==null||l.disconnect(),g&&(l==null||l.observe(g)),r(g?t(g):null)},[t,l]),[d,f]=Pp(c);return p.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const wre=[{sensor:qg,options:{}},{sensor:g5,options:{}}],Ere={current:{}},ep={draggable:{measure:oj},droppable:{measure:oj,strategy:bf.WhileDragging,frequency:hb.Optimized},dragOverlay:{measure:Vu}};class nf 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 Rre={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new nf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ep,measureDroppableContainers:Fp,windowRect:null,measuringScheduled:!1},Tre={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fp,draggableNodes:new Map,over:null,measureDroppableContainers:Fp},Kg=p.createContext(Tre),x5=p.createContext(Rre);function jre(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new nf}}}function _re(e,t){switch(t.type){case ar.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case ar.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 ar.DragEnd:case ar.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case ar.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new nf(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case ar.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const c=new nf(e.droppable.containers);return c.set(n,{...l,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case ar.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const l=new nf(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Nre(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=p.useContext(Kg),l=cb(r),c=cb(n==null?void 0:n.id);return p.useEffect(()=>{if(!t&&!r&&l&&c!=null){if(!TS(l)||document.activeElement===l.target)return;const d=s.get(c);if(!d)return;const{activatorNode:f,node:m}=d;if(!f.current&&!m.current)return;requestAnimationFrame(()=>{for(const g of[f.current,m.current]){if(!g)continue;const v=Sne(g);if(v){v.focus();break}}})}},[r,t,s,c,l]),null}function Are(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,l)=>l({transform:s,...r}),n):n}function Dre(e){return p.useMemo(()=>({draggable:{...ep.draggable,...e==null?void 0:e.draggable},droppable:{...ep.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ep.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 Ore(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const l=p.useRef(!1),{x:c,y:d}=typeof s=="boolean"?{x:s,y:s}:s;Hs(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!r)return;const m=t==null?void 0:t.node.current;if(!m||m.isConnected===!1)return;const g=n(m),v=l5(g,r);if(c||(v.x=0),d||(v.y=0),l.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const x=c5(m);x&&x.scrollBy({top:v.y,left:v.x})}},[t,c,d,r,n])}const b5=p.createContext({...ms,scaleX:1,scaleY:1});var pi;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(pi||(pi={}));const S5=p.memo(function(t){var n,r,s,l;let{id:c,accessibility:d,autoScroll:f=!0,children:m,sensors:g=wre,collisionDetection:v=Lne,measuring:x,modifiers:b,...w}=t;const C=p.useReducer(_re,void 0,jre),[E,R]=C,[T,_]=jne(),[O,A]=p.useState(pi.Uninitialized),D=O===pi.Initialized,{draggable:{active:j,nodes:M,translate:z},droppable:{containers:Z}}=E,K=j!=null?M.get(j):null,Y=p.useRef({initial:null,translated:null}),ae=p.useMemo(()=>{var xn;return j!=null?{id:j,data:(xn=K==null?void 0:K.data)!=null?xn:Ere,rect:Y}:null},[j,K]),F=p.useRef(null),[V,I]=p.useState(null),[B,G]=p.useState(null),ie=yf(w,Object.values(w)),xe=nh("DndDescribedBy",c),L=p.useMemo(()=>Z.getEnabled(),[Z]),P=Dre(x),{droppableRects:W,measureDroppableContainers:ee,measuringScheduled:de}=dre(L,{dragging:D,dependencies:[z.x,z.y],config:P.droppable}),ve=cre(M,j),le=p.useMemo(()=>B?ub(B):null,[B]),Ne=Ss(),we=fre(ve,P.draggable.measure);Ore({activeNode:j!=null?M.get(j):null,config:Ne.layoutShiftCompensation,initialRect:we,measure:P.draggable.measure});const Te=dj(ve,P.draggable.measure,we),Be=dj(ve?ve.parentElement:null),Xe=p.useRef({activatorEvent:null,active:null,activeNode:ve,collisionRect:null,collisions:null,droppableRects:W,draggableNodes:M,draggingNode:null,draggingNodeRect:null,droppableContainers:Z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Vt=Z.getNodeFor((n=Xe.current.over)==null?void 0:n.id),jt=Cre({measure:P.dragOverlay.measure}),$t=(r=jt.nodeRef.current)!=null?r:ve,Me=D?(s=jt.rect)!=null?s:Te:null,_t=!!(jt.nodeRef.current&&jt.rect),Nt=pre(_t?null:Te),rn=y5($t?ra($t):null),$=gre(D?Vt??ve:null),te=bre($),fe=Are(b,{transform:{x:z.x-Nt.x,y:z.y-Nt.y,scaleX:1,scaleY:1},activatorEvent:B,active:ae,activeNodeRect:Te,containerNodeRect:Be,draggingNodeRect:Me,over:Xe.current.over,overlayNodeRect:jt.rect,scrollableAncestors:$,scrollableAncestorRects:te,windowRect:rn}),je=le?iu(le,z):null,ye=vre($),Ce=hj(ye),Ye=hj(ye,[Te]),st=iu(fe,Ce),ot=Me?Fne(Me,fe):null,vn=ae&&ot?v({active:ae,collisionRect:ot,droppableRects:W,droppableContainers:L,pointerCoordinates:je}):null,_a=kne(vn,"id"),[yn,Fo]=p.useState(null),Mn=_t?fe:iu(fe,Ye),Cn=Pne(Mn,(l=yn==null?void 0:yn.rect)!=null?l:null,Te),pr=p.useRef(null),wn=p.useCallback((xn,mn)=>{let{sensor:Fn,options:gr}=mn;if(F.current==null)return;const Xn=M.get(F.current);if(!Xn)return;const kn=xn.nativeEvent,_r=new Fn({active:F.current,activeNode:Xn,event:kn,options:gr,context:Xe,onAbort(U){if(!M.get(U))return;const{onDragAbort:se}=ie.current,ge={id:U};se==null||se(ge),T({type:"onDragAbort",event:ge})},onPending(U,Q,se,ge){if(!M.get(U))return;const{onDragPending:Fe}=ie.current,Le={id:U,constraint:Q,initialCoordinates:se,offset:ge};Fe==null||Fe(Le),T({type:"onDragPending",event:Le})},onStart(U){const Q=F.current;if(Q==null)return;const se=M.get(Q);if(!se)return;const{onDragStart:ge}=ie.current,Ee={activatorEvent:kn,active:{id:Q,data:se.data,rect:Y}};is.unstable_batchedUpdates(()=>{ge==null||ge(Ee),A(pi.Initializing),R({type:ar.DragStart,initialCoordinates:U,active:Q}),T({type:"onDragStart",event:Ee}),I(pr.current),G(kn)})},onMove(U){R({type:ar.DragMove,coordinates:U})},onEnd:Hr(ar.DragEnd),onCancel:Hr(ar.DragCancel)});pr.current=_r;function Hr(U){return async function(){const{active:se,collisions:ge,over:Ee,scrollAdjustedTranslate:Fe}=Xe.current;let Le=null;if(se&&Fe){const{cancelDrop:ke}=ie.current;Le={activatorEvent:kn,active:se,collisions:ge,delta:Fe,over:Ee},U===ar.DragEnd&&typeof ke=="function"&&await Promise.resolve(ke(Le))&&(U=ar.DragCancel)}F.current=null,is.unstable_batchedUpdates(()=>{R({type:U}),A(pi.Uninitialized),Fo(null),I(null),G(null),pr.current=null;const ke=U===ar.DragEnd?"onDragEnd":"onDragCancel";if(Le){const Pe=ie.current[ke];Pe==null||Pe(Le),T({type:ke,event:Le})}})}}},[M]),Qi=p.useCallback((xn,mn)=>(Fn,gr)=>{const Xn=Fn.nativeEvent,kn=M.get(gr);if(F.current!==null||!kn||Xn.dndKit||Xn.defaultPrevented)return;const _r={active:kn};xn(Fn,mn.options,_r)===!0&&(Xn.dndKit={capturedBy:mn.sensor},F.current=gr,wn(Fn,mn))},[M,wn]),bs=ure(g,Qi);yre(g),Hs(()=>{Te&&O===pi.Initializing&&A(pi.Initialized)},[Te,O]),p.useEffect(()=>{const{onDragMove:xn}=ie.current,{active:mn,activatorEvent:Fn,collisions:gr,over:Xn}=Xe.current;if(!mn||!Fn)return;const kn={active:mn,activatorEvent:Fn,collisions:gr,delta:{x:st.x,y:st.y},over:Xn};is.unstable_batchedUpdates(()=>{xn==null||xn(kn),T({type:"onDragMove",event:kn})})},[st.x,st.y]),p.useEffect(()=>{const{active:xn,activatorEvent:mn,collisions:Fn,droppableContainers:gr,scrollAdjustedTranslate:Xn}=Xe.current;if(!xn||F.current==null||!mn||!Xn)return;const{onDragOver:kn}=ie.current,_r=gr.get(_a),Hr=_r&&_r.rect.current?{id:_r.id,rect:_r.rect.current,data:_r.data,disabled:_r.disabled}:null,U={active:xn,activatorEvent:mn,collisions:Fn,delta:{x:Xn.x,y:Xn.y},over:Hr};is.unstable_batchedUpdates(()=>{Fo(Hr),kn==null||kn(U),T({type:"onDragOver",event:U})})},[_a]),Hs(()=>{Xe.current={activatorEvent:B,active:ae,activeNode:ve,collisionRect:ot,collisions:vn,droppableRects:W,draggableNodes:M,draggingNode:$t,draggingNodeRect:Me,droppableContainers:Z,over:yn,scrollableAncestors:$,scrollAdjustedTranslate:st},Y.current={initial:Me,translated:ot}},[ae,ve,vn,ot,M,$t,Me,W,Z,yn,$,st]),ore({...Ne,delta:z,draggingRect:ot,pointerCoordinates:je,scrollableAncestors:$,scrollableAncestorRects:te});const zo=p.useMemo(()=>({active:ae,activeNode:ve,activeNodeRect:Te,activatorEvent:B,collisions:vn,containerNodeRect:Be,dragOverlay:jt,draggableNodes:M,droppableContainers:Z,droppableRects:W,over:yn,measureDroppableContainers:ee,scrollableAncestors:$,scrollableAncestorRects:te,measuringConfiguration:P,measuringScheduled:de,windowRect:rn}),[ae,ve,Te,B,vn,Be,jt,M,Z,W,yn,ee,$,te,P,de,rn]),Zs=p.useMemo(()=>({activatorEvent:B,activators:bs,active:ae,activeNodeRect:Te,ariaDescribedById:{draggable:xe},dispatch:R,draggableNodes:M,over:yn,measureDroppableContainers:ee}),[B,bs,ae,Te,R,xe,M,yn,ee]);return _e.createElement(a5.Provider,{value:_},_e.createElement(Kg.Provider,{value:Zs},_e.createElement(x5.Provider,{value:zo},_e.createElement(b5.Provider,{value:Cn},m)),_e.createElement(Nre,{disabled:(d==null?void 0:d.restoreFocus)===!1})),_e.createElement(Ane,{...d,hiddenTextDescribedById:xe}));function Ss(){const xn=(V==null?void 0:V.autoScrollEnabled)===!1,mn=typeof f=="object"?f.enabled===!1:f===!1,Fn=D&&!xn&&!mn;return typeof f=="object"?{...f,enabled:Fn}:{enabled:Fn}}}),Mre=p.createContext(null),pj="button",kre="Draggable";function Ire(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const l=nh(kre),{activators:c,activatorEvent:d,active:f,activeNodeRect:m,ariaDescribedById:g,draggableNodes:v,over:x}=p.useContext(Kg),{role:b=pj,roleDescription:w="draggable",tabIndex:C=0}=s??{},E=(f==null?void 0:f.id)===t,R=p.useContext(E?b5:Mre),[T,_]=Pp(),[O,A]=Pp(),D=xre(c,t),j=yf(n);Hs(()=>(v.set(t,{id:t,key:l,node:T,activatorNode:O,data:j}),()=>{const z=v.get(t);z&&z.key===l&&v.delete(t)}),[v,t]);const M=p.useMemo(()=>({role:b,tabIndex:C,"aria-disabled":r,"aria-pressed":E&&b===pj?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[r,b,C,E,w,g.draggable]);return{active:f,activatorEvent:d,activeNodeRect:m,attributes:M,isDragging:E,listeners:r?void 0:D,node:T,over:x,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function Lre(){return p.useContext(x5)}const Pre="Droppable",Ure={timeout:25};function Fre(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const l=nh(Pre),{active:c,dispatch:d,over:f,measureDroppableContainers:m}=p.useContext(Kg),g=p.useRef({disabled:n}),v=p.useRef(!1),x=p.useRef(null),b=p.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:E}={...Ure,...s},R=yf(C??r),T=p.useCallback(()=>{if(!v.current){v.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{m(Array.isArray(R.current)?R.current:[R.current]),b.current=null},E)},[E]),_=Zg({callback:T,disabled:w||!c}),O=p.useCallback((M,z)=>{_&&(z&&(_.unobserve(z),v.current=!1),M&&_.observe(M))},[_]),[A,D]=Pp(O),j=yf(t);return p.useEffect(()=>{!_||!A.current||(_.disconnect(),v.current=!1,_.observe(A.current))},[A,_]),p.useEffect(()=>(d({type:ar.RegisterDroppable,element:{id:r,key:l,disabled:n,node:A,rect:x,data:j}}),()=>d({type:ar.UnregisterDroppable,key:l,id:r})),[r]),p.useEffect(()=>{n!==g.current.disabled&&(d({type:ar.SetDroppableDisabled,id:r,key:l,disabled:n}),g.current.disabled=n)},[r,l,n,d]),{active:c,rect:x,isOver:(f==null?void 0:f.id)===r,node:A,over:f,setNodeRef:D}}function C5(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function zre(e,t){return e.reduce((n,r,s)=>{const l=t.get(r);return l&&(n[s]=l),n},Array(e.length))}function Um(e){return e!==null&&e>=0}function Vre(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 Hre(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const w5=e=>{let{rects:t,activeIndex:n,overIndex:r,index:s}=e;const l=C5(t,r,n),c=t[s],d=l[s];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Fm={scaleX:1,scaleY:1},E5=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:s,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:r;if(!d)return null;if(s===n){const m=l[c];return m?{x:0,y:n<c?m.top+m.height-(d.top+d.height):m.top-d.top,...Fm}:null}const f=$re(l,s,n);return s>n&&s<=c?{x:0,y:-d.height-f,...Fm}:s<n&&s>=c?{x:0,y:d.height+f,...Fm}:{x:0,y:0,...Fm}};function $re(e,t,n){const r=e[t],s=e[t-1],l=e[t+1];return r?n<t?s?r.top-(s.top+s.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const R5="Sortable",T5=_e.createContext({activeIndex:-1,containerId:R5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:w5,disabled:{draggable:!1,droppable:!1}});function j5(e){let{children:t,id:n,items:r,strategy:s=w5,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:f,over:m,measureDroppableContainers:g}=Lre(),v=nh(R5,n),x=d.rect!==null,b=p.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),w=c!=null,C=c?b.indexOf(c.id):-1,E=m?b.indexOf(m.id):-1,R=p.useRef(b),T=!Vre(b,R.current),_=E!==-1&&C===-1||T,O=Hre(l);Hs(()=>{T&&w&&g(b)},[T,b,w,g]),p.useEffect(()=>{R.current=b},[b]);const A=p.useMemo(()=>({activeIndex:C,containerId:v,disabled:O,disableTransforms:_,items:b,overIndex:E,useDragOverlay:x,sortedRects:zre(b,f),strategy:s}),[C,v,O.draggable,O.droppable,_,b,E,f,x,s]);return _e.createElement(T5.Provider,{value:A},t)}const Bre=e=>{let{id:t,items:n,activeIndex:r,overIndex:s}=e;return C5(n,r,s).indexOf(t)},Gre=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:s,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:m}=e;return!m||!r||d!==l&&s===c?!1:n?!0:c!==s&&t===f},qre={duration:200,easing:"ease"},_5="transform",Zre=xf.Transition.toString({property:_5,duration:0,easing:"linear"}),Kre={roleDescription:"sortable"};function Yre(e){let{disabled:t,index:n,node:r,rect:s}=e;const[l,c]=p.useState(null),d=p.useRef(n);return Hs(()=>{if(!t&&n!==d.current&&r.current){const f=s.current;if(f){const m=Vu(r.current,{ignoreTransform:!0}),g={x:f.left-m.left,y:f.top-m.top,scaleX:f.width/m.width,scaleY:f.height/m.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,r,s]),p.useEffect(()=>{l&&c(null)},[l]),l}function Wre(e){let{animateLayoutChanges:t=Gre,attributes:n,disabled:r,data:s,getNewIndex:l=Bre,id:c,strategy:d,resizeObserverConfig:f,transition:m=qre}=e;const{items:g,containerId:v,activeIndex:x,disabled:b,disableTransforms:w,sortedRects:C,overIndex:E,useDragOverlay:R,strategy:T}=p.useContext(T5),_=Qre(r,b),O=g.indexOf(c),A=p.useMemo(()=>({sortable:{containerId:v,index:O,items:g},...s}),[v,s,O,g]),D=p.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:j,node:M,isOver:z,setNodeRef:Z}=Fre({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...f}}),{active:K,activatorEvent:Y,activeNodeRect:ae,attributes:F,setNodeRef:V,listeners:I,isDragging:B,over:G,setActivatorNodeRef:ie,transform:xe}=Ire({id:c,data:A,attributes:{...Kre,...n},disabled:_.draggable}),L=vne(Z,V),P=!!K,W=P&&!w&&Um(x)&&Um(E),ee=!R&&B,de=ee&&W?xe:null,le=W?de??(d??T)({rects:C,activeNodeRect:ae,activeIndex:x,overIndex:E,index:O}):null,Ne=Um(x)&&Um(E)?l({id:c,items:g,activeIndex:x,overIndex:E}):O,we=K==null?void 0:K.id,Te=p.useRef({activeId:we,items:g,newIndex:Ne,containerId:v}),Be=g!==Te.current.items,Xe=t({active:K,containerId:v,isDragging:B,isSorting:P,id:c,index:O,items:g,newIndex:Te.current.newIndex,previousItems:Te.current.items,previousContainerId:Te.current.containerId,transition:m,wasDragging:Te.current.activeId!=null}),Vt=Yre({disabled:!Xe,index:O,node:M,rect:j});return p.useEffect(()=>{P&&Te.current.newIndex!==Ne&&(Te.current.newIndex=Ne),v!==Te.current.containerId&&(Te.current.containerId=v),g!==Te.current.items&&(Te.current.items=g)},[P,Ne,v,g]),p.useEffect(()=>{if(we===Te.current.activeId)return;if(we&&!Te.current.activeId){Te.current.activeId=we;return}const $t=setTimeout(()=>{Te.current.activeId=we},50);return()=>clearTimeout($t)},[we]),{active:K,activeIndex:x,attributes:F,data:A,rect:j,index:O,newIndex:Ne,items:g,isOver:z,isSorting:P,isDragging:B,listeners:I,node:M,overIndex:E,over:G,setNodeRef:L,setActivatorNodeRef:ie,setDroppableNodeRef:Z,setDraggableNodeRef:V,transform:Vt??le,transition:jt()};function jt(){if(Vt||Be&&Te.current.newIndex===O)return Zre;if(!(ee&&!TS(Y)||!m)&&(P||Xe))return xf.Transition.toString({...m,property:_5})}}function Qre(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}}zt.Down,zt.Right,zt.Up,zt.Left;function lu({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:s=!1,className:l,saveButtonText:c="Save",cancelButtonText:d="Discard"}){const[f,m]=p.useState(!1),[g,v]=p.useState(e),x=p.useRef(null),b=T=>{v(T.target.value)},w=()=>{n&&g!==e&&n(g.trim()),m(!1)},C=()=>{v(e),m(!1)},E=T=>{T.key==="Enter"&&!T.shiftKey?(r===1||T.ctrlKey)&&(T.preventDefault(),w()):T.key==="Escape"&&(T.preventDefault(),C())},R=T=>{m(T),T?(v(e),setTimeout(()=>{x.current&&x.current.focus()},0)):C()};return o.jsxs(tS,{open:f,onOpenChange:R,children:[o.jsx(nS,{asChild:!0,children:o.jsx("div",{className:J("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",s&&"font-medium",l),children:e||t})}),o.jsxs(rS,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[o.jsx(Hi,{ref:x,value:g,onChange:b,onKeyDown:E,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),o.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[o.jsx(be,{variant:"outline",size:"sm",onClick:C,className:"h-7 cursor-pointer px-2 text-xs",children:d}),o.jsx(be,{size:"sm",onClick:w,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function Xre({isAllExpanded:e,onToggle:t}){return o.jsx(be,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,title:e?"Collapse all items":"Expand all items",children:e?o.jsx(b9,{className:"h-4 w-4"}):o.jsx(Tb,{className:"h-4 w-4"})})}function Jre({isExpanded:e,onToggle:t,ariaLabel:n}){return o.jsx(be,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?o.jsx(Ka,{className:"h-4 w-4"}):o.jsx(Ta,{className:"h-4 w-4"})})}function eae({className:e="",...t}){return o.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:o.jsx(Y9,{className:"h-4 w-4 text-gray-400"})})}function N5({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:l,transition:c,isDragging:d}=Wre({id:e}),f={transform:xf.Transform.toString(l),transition:c,opacity:d?.75:1},m=p.Children.toArray(t),g=[o.jsx(ba,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:o.jsx(eae,{...n,...r})},"drag-handle-cell"),...m.slice(1)];return o.jsx(ir,{ref:s,style:f,className:"group",children:g})}function A5({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[s,l]=p.useState(!1),c=()=>{t&&t(e.index),l(!1)},d=r&&n&&r(e.index),f=!!t,m=d&&f;return o.jsxs("div",{className:"px-3 text-right",children:[o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":"Row actions",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(jr,{align:"end",children:[d&&o.jsxs(yt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[o.jsx(ja,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),m&&o.jsx(qa,{}),f&&o.jsxs(yt,{onClick:()=>{l(!0)},children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),o.jsx(na,{open:s,onOpenChange:l,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function tae({mode:e,onModeChange:t}){const n=Object.values(vf),r=s=>{t&&t(s)};return o.jsxs(Ca,{value:e,onValueChange:r,children:[o.jsx(Ea,{className:"h-90 cursor-pointer",size:"sm",children:o.jsx(wa,{placeholder:"Select field mode"})}),o.jsx(Ra,{className:"max-h-[300px]",children:n.map(s=>o.jsx(Zn,{value:s,children:s},s))})]})}var Yg="Checkbox",[nae]=kr(Yg),[rae,AS]=nae(Yg);function aae(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:s,disabled:l,form:c,name:d,onCheckedChange:f,required:m,value:g="on",internal_do_not_use_render:v}=e,[x,b]=zr({prop:n,defaultProp:s??!1,onChange:f,caller:Yg}),[w,C]=p.useState(null),[E,R]=p.useState(null),T=p.useRef(!1),_=w?!!c||!!w.closest("form"):!0,O={checked:x,disabled:l,setChecked:b,control:w,setControl:C,name:d,form:c,value:g,hasConsumerStoppedPropagationRef:T,required:m,defaultChecked:Ti(s)?!1:s,isFormControl:_,bubbleInput:E,setBubbleInput:R};return o.jsx(rae,{scope:t,...O,children:sae(v)?v(O):r})}var D5="CheckboxTrigger",O5=p.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},s)=>{const{control:l,value:c,disabled:d,checked:f,required:m,setControl:g,setChecked:v,hasConsumerStoppedPropagationRef:x,isFormControl:b,bubbleInput:w}=AS(D5,e),C=pt(s,g),E=p.useRef(f);return p.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const T=()=>v(E.current);return R.addEventListener("reset",T),()=>R.removeEventListener("reset",T)}},[l,v]),o.jsx(We.button,{type:"button",role:"checkbox","aria-checked":Ti(f)?"mixed":f,"aria-required":m,"data-state":U5(f),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:C,onKeyDown:Re(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Re(n,R=>{v(T=>Ti(T)?!0:!T),w&&b&&(x.current=R.isPropagationStopped(),x.current||R.stopPropagation())})})});O5.displayName=D5;var M5=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:l,required:c,disabled:d,value:f,onCheckedChange:m,form:g,...v}=e;return o.jsx(aae,{__scopeCheckbox:n,checked:s,defaultChecked:l,disabled:d,required:c,onCheckedChange:m,name:r,form:g,value:f,internal_do_not_use_render:({isFormControl:x})=>o.jsxs(o.Fragment,{children:[o.jsx(O5,{...v,ref:t,__scopeCheckbox:n}),x&&o.jsx(P5,{__scopeCheckbox:n})]})})});M5.displayName=Yg;var k5="CheckboxIndicator",I5=p.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...s}=e,l=AS(k5,n);return o.jsx(Er,{present:r||Ti(l.checked)||l.checked===!0,children:o.jsx(We.span,{"data-state":U5(l.checked),"data-disabled":l.disabled?"":void 0,...s,ref:t,style:{pointerEvents:"none",...e.style}})})});I5.displayName=k5;var L5="CheckboxBubbleInput",P5=p.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:s,checked:l,defaultChecked:c,required:d,disabled:f,name:m,value:g,form:v,bubbleInput:x,setBubbleInput:b}=AS(L5,e),w=pt(n,b),C=Y1(l),E=Bb(r);p.useEffect(()=>{const T=x;if(!T)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,D=!s.current;if(C!==l&&A){const j=new Event("click",{bubbles:D});T.indeterminate=Ti(l),A.call(T,Ti(l)?!1:l),T.dispatchEvent(j)}},[x,C,l,s]);const R=p.useRef(Ti(l)?!1:l);return o.jsx(We.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:d,disabled:f,name:m,value:g,form:v,...t,tabIndex:-1,ref:w,style:{...t.style,...E,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});P5.displayName=L5;function sae(e){return typeof e=="function"}function Ti(e){return e==="indeterminate"}function U5(e){return Ti(e)?"indeterminate":e?"checked":"unchecked"}function F5({className:e,...t}){return o.jsx(M5,{"data-slot":"checkbox",className:J("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:o.jsx(I5,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5"})})})}function z5({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=s=>{t&&t(s)};return o.jsx(F5,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const gj={[us.CONNECTED]:{icon:Yp,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[us.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:Wp,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[us.DISCONNECTED]:{icon:yL,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function V5({status:e}){if(!e||!(e in gj))return null;const t=gj[e],{icon:n,color:r,label:s,description:l}=t,c=`schema-field-status-tooltip-${e}`;return o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(n,{className:J("h-5 w-5",r),role:"img","aria-label":s,"aria-describedby":c,tabIndex:0})}),o.jsxs(wt,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs font-medium",children:s}),o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:l})]})]})})}function H5({type:e,storageType:t,onTypeChange:n}){const r=t===Ie.GOOGLE_BIGQUERY?Object.values(Pn):Object.values(CS),s=l=>{n&&(Ie.GOOGLE_BIGQUERY,n(l))};return o.jsxs(Ca,{value:e,onValueChange:s,children:[o.jsx(Ea,{className:"cursor-pointer",size:"sm",children:o.jsx(wa,{placeholder:"Select field type"})}),o.jsx(Ra,{className:"max-h-[300px]",children:r.map(l=>o.jsx(Zn,{value:l,children:l},l))})]})}function oae({table:e}){return o.jsx("div",{className:"px-3 text-right",children:o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(yt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta?t.columnDef.meta.title??t.id:t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function iae({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:s=500,className:l,"aria-label":c}){const[d,f]=p.useState(n),m=p.useRef(!0);p.useEffect(()=>{(n===""||m.current)&&(f(n),m.current=!1)},[n]);const g=p.useCallback(v=>{const x=v.target.value;f(x);const b=setTimeout(()=>{r(x)},s);return()=>{clearTimeout(b)}},[r,s]);return o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Hl,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),o.jsx(Ht,{id:e,placeholder:t,value:d,onChange:g,className:l??"dm-card-toolbar-search-input","aria-label":c??t})]})}function lae({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:s}){return o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsx(iae,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),o.jsxs("div",{className:"dm-card-toolbar-right",children:[s&&o.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(s).map(([l,c])=>c===0?null:o.jsxs("div",{className:"flex items-center gap-1",children:[o.jsx(V5,{status:l}),o.jsx("span",{className:"text-sm font-medium text-gray-500",children:c})]},l))}),o.jsxs(be,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,"aria-label":"Add new field",children:[o.jsx(ja,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const cae={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function vj(e,t={}){const n=cae[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 uae({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:s,dragContext:l,dragContextProps:c,rowComponent:d=ir,getRowId:f}){const m=t,g=l,v=d,{columnVisibility:x,setColumnVisibility:b}=fne(m),w=Du({data:e,columns:m,getCoreRowModel:Au(),getFilteredRowModel:qf(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:x},onColumnVisibilityChange:b,enableGlobalFilter:!0,globalFilterFn:hne,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:C,onChange:E,searchValue:R}=mne(w),T=p.useRef("");p.useEffect(()=>{s&&R!==T.current&&(T.current=R,s(R))},[R,s]);const _=p.useMemo(()=>{const D={[us.CONNECTED]:0,[us.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[us.DISCONNECTED]:0};return(r??e).forEach(M=>{M.status in D&&D[M.status]++}),D},[e,r]);return o.jsxs("div",{className:"space-y-4",children:[n&&o.jsx(lae,{table:w,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:C,onFilterChange:E,statusCounts:_}),o.jsx("div",{className:"dm-card-table-wrap mb-0",children:o.jsxs(Ou,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[o.jsx(Mu,{className:"dm-card-table-header",children:w.getHeaderGroups().map(D=>o.jsx(ir,{className:"dm-card-table-header-row",children:D.headers.map(j=>o.jsx(Iu,{className:"bg-secondary dark:bg-background",style:vj(j.column.id,{width:j.getSize()!==0?j.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:j.isPlaceholder?null:typeof j.column.columnDef.header=="function"?j.column.columnDef.header(j.getContext()):j.column.columnDef.header},j.id))},D.id))}),o.jsx(ku,{className:"dm-card-table-body",children:w.getRowModel().rows.length?o.jsx(g,{...c,children:w.getRowModel().rows.map(D=>o.jsx(v,{id:f?f(D):D.index,row:D,children:D.getVisibleCells().map(j=>o.jsx(ba,{className:"bg-background dark:bg-muted",style:vj(j.column.id,{width:j.column.getSize()!==0?j.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:j.column.columnDef.cell&&typeof j.column.columnDef.cell=="function"?j.column.columnDef.cell(j.getContext()):null},j.id))},D.id))}):o.jsx(ir,{children:o.jsx(ba,{colSpan:m.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&o.jsxs(be,{variant:"outline",className:"dm-card-table-add-field-btn bg-background dark:bg-muted w-full cursor-pointer rounded-t-none border-0",onClick:n,"aria-label":"Add new field",children:[o.jsx(ja,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function $5({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:s,additionalColumns:l=[],fieldsForStatusCount:c,onSearchChange:d,nameColumnHeader:f,nameColumnCell:m,primaryKeyColumnCell:g,aliasColumnCell:v,descriptionColumnCell:x,actionsColumnCell:b,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R}){const T=p.useCallback((j,M)=>{if(t){const z=[...e];z[j]={...z[j],...M},t(z)}},[e,t]),_=p.useCallback(()=>{if(t){const j=r();t([...e,j])}},[e,t,r]),O=p.useCallback(j=>{if(t){const M=[...e];M.splice(j,1),t(M)}},[e,t]),A=p.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:j})=>o.jsx(V5,{status:j.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Name"}),o.jsx(wt,{children:"Field name in the output schema"})]})),size:80,cell:({row:j})=>m?m({row:j,updateField:T}):o.jsx(lu,{value:cne(j.getValue("name")),onValueChange:M=>{T(j.index,{name:M})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"PK"}),o.jsx(wt,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:j})=>g?g({row:j,updateField:T}):o.jsx(z5,{isPrimaryKey:j.getValue("isPrimaryKey"),onPrimaryKeyChange:M=>{T(j.index,{isPrimaryKey:M})}}),enableHiding:!1},{accessorKey:"alias",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Alias"}),o.jsx(wt,{children:"Alternative name for the field"})]}),size:80,cell:({row:j})=>v?v({row:j,updateField:T}):o.jsx(lu,{value:j.getValue("alias"),onValueChange:M=>{T(j.index,{alias:M})},placeholder:"-"})},{accessorKey:"description",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Description"}),o.jsx(wt,{children:"Detailed information about the field"})]}),cell:({row:j})=>x?x({row:j,updateField:T}):o.jsx(lu,{value:j.getValue("description"),onValueChange:M=>{T(j.index,{description:M})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:j})=>o.jsx(oae,{table:j}),cell:({row:j,table:M})=>b?b({row:j,table:M}):o.jsx(A5,{row:j,onDeleteRow:t?O:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[T,O,t,f,m,g,v,x,b]),D=p.useMemo(()=>{const M={accessorKey:"type",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default pl-[12px]",children:"Type"}),o.jsx(wt,{children:"Data type of the field"})]}),size:80,cell:Z=>s({row:Z.row,updateField:T}),enableHiding:!1},z=[...A];if(z.splice(3,0,M),l.length>0){const Z=[...l];Z.sort((K,Y)=>{const ae=K.columnIndex??1/0,F=Y.columnIndex??1/0;return ae-F}),Z.forEach(K=>{if(K.columnIndex!==void 0){const Y=Math.min(Math.max(0,K.columnIndex),z.length);z.splice(Y,0,K)}else z.splice(z.length-1,0,K)})}return z},[A,s,T,l]);return o.jsx(uae,{fields:e,columns:D,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:d,dragContext:w,dragContextProps:C,rowComponent:E,getRowId:R})}function dae({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:s,toggleAllRecords:l,flattenedFields:c,handleSearchChange:d,isRecordType:f,topLevelFields:m,allExpanded:g}=pne(e),{updateField:v,handleDeleteRow:x,handleAddNestedField:b,handleAddRow:w}=gne(e,c,t,K=>K),C=p.useCallback(()=>({name:"",type:Pn.STRING,mode:vf.NULLABLE,isPrimaryKey:!1,status:us.DISCONNECTED}),[]),E=p.useCallback(({row:K})=>o.jsx(H5,{type:K.getValue("type"),storageType:Ie.GOOGLE_BIGQUERY,onTypeChange:Y=>{v(K.index,{type:Y})}}),[v]),R=p.useMemo(()=>[{accessorKey:"mode",header:()=>o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default pl-[12px]",children:"Mode"}),o.jsx(wt,{style:{whiteSpace:"pre"},children:`BigQuery Field mode:
|
|
711
|
-
NULLABLE - field can be NULL
|
|
712
|
-
REQUIRED - field cant be NULL
|
|
713
|
-
REPEATED - field is an Array of Type`})]}),size:80,cell:({row:K})=>o.jsx(tae,{mode:K.getValue("mode"),onModeChange:Y=>{v(K.index,{mode:Y})}}),columnIndex:4}],[v]),T=p.useCallback(()=>o.jsxs("div",{className:"flex items-center",children:[r&&o.jsx(Xre,{isAllExpanded:g,onToggle:l}),o.jsxs(St,{children:[o.jsx(Ct,{className:"cursor-default",children:"Name"}),o.jsx(wt,{children:"Field name in the output schema"})]})]}),[r,g,l]),_=p.useCallback(({row:K})=>{const Y=c[K.index],F=(Y.type===Pn.RECORD||Y.type===Pn.STRUCT)&&Y.fields&&Y.fields.length>0,V=Y.path??"",I=Y.level??0,B=n.has(V);return o.jsxs("div",{className:"flex items-center",children:[I>0&&o.jsx("div",{style:{width:`${String(I*16-(F?4:0))}px`},className:"flex-shrink-0"}),F?o.jsx(Jre,{isExpanded:B,onToggle:()=>{s(V)},ariaLabel:B?"Collapse nested fields":"Expand nested fields"}):r&&o.jsx("div",{className:"w-5"}),o.jsx(lu,{value:K.getValue("name"),onValueChange:G=>{v(K.index,{name:G})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,s,v]),O=p.useCallback(({row:K})=>{const Y=c[K.index],ae=Y.type===Pn.RECORD||Y.type===Pn.STRUCT;return(Y.level??0)===0&&!ae?o.jsx(z5,{isPrimaryKey:K.getValue("isPrimaryKey"),onPrimaryKeyChange:V=>{v(K.index,{isPrimaryKey:V})}}):o.jsx("div",{})},[c,v]),A=p.useCallback(({row:K})=>o.jsx(lu,{value:K.getValue("description"),onValueChange:Y=>{v(K.index,{description:Y})},minRows:5,placeholder:"-"}),[v]),D=p.useCallback(({row:K})=>o.jsx(lu,{value:K.getValue("alias"),onValueChange:Y=>{v(K.index,{alias:Y})},placeholder:"-"}),[v]),j=p.useCallback(({row:K})=>o.jsx(A5,{row:K,onDeleteRow:t?x:void 0,onAddNestedField:t?b:void 0,isRecordType:f}),[t,x,b,f]),{handleDragEnd:M}=t5(e,t,c),z=p.useCallback(K=>{const Y=c[K.index];return Y.path??String(c.indexOf(Y))},[c]),Z=o5(s5(qg,{activationConstraint:{distance:5}}));return o.jsx(S5,{sensors:Z,collisionDetection:i5,onDragEnd:M,children:o.jsx($5,{fields:c,onFieldsChange:t,onAddRow:w,createNewField:C,renderTypeCell:E,additionalColumns:R,fieldsForStatusCount:m,onSearchChange:d,nameColumnHeader:T,nameColumnCell:_,primaryKeyColumnCell:O,aliasColumnCell:D,descriptionColumnCell:A,actionsColumnCell:j,dragContext:j5,dragContextProps:{items:c.map(K=>K.path??String(c.indexOf(K))),strategy:E5},rowComponent:N5,getRowId:z})})}function fae({fields:e,onFieldsChange:t}){const n=p.useCallback(()=>({name:"",type:CS.STRING,isPrimaryKey:!1,status:us.DISCONNECTED}),[]),r=p.useCallback(({row:c,updateField:d})=>o.jsx(H5,{type:c.getValue("type"),storageType:Ie.AWS_ATHENA,onTypeChange:f=>{d(c.index,{type:f})}}),[]),{handleDragEnd:s}=t5(e,t),l=o5(s5(qg,{activationConstraint:{distance:5}}));return o.jsx(S5,{sensors:l,collisionDetection:i5,onDragEnd:s,children:o.jsx($5,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:j5,dragContextProps:{items:e.map((c,d)=>d),strategy:E5},rowComponent:N5})})}function hae({schema:e,storageType:t,onFieldsChange:n}){const r=p.useMemo(()=>{if(!e){const s=lne(t);return n(s.fields),s}return e},[e,t,n]);return QO(r)?o.jsx(dae,{fields:r.fields,onFieldsChange:n}):XO(r)?o.jsx(fae,{fields:r.fields,onFieldsChange:n}):o.jsx("div",{className:"p-4 text-center",children:o.jsx("p",{children:"Unsupported schema type"})})}function mae(){const{dataMart:e,updateDataMartSchema:t,isLoading:n,error:r,getDataMart:s}=gs(),l=e==null?void 0:e.schema,{schema:c,isDirty:d,updateSchema:f,resetSchema:m}=une(l),{operationStatus:g,startSaveOperation:v}=dne(n,r);p.useEffect(()=>{g==="success"&&m()},[g,m]);const x=p.useCallback(O=>{f(O)},[f]),b=(e==null?void 0:e.id)??"",w=p.useCallback(()=>{b&&s(b)},[b,s]),{run:C,isLoading:E}=X1(b,w);if(!e)return o.jsx("div",{children:"Error: Data mart not found"});const R=()=>{b&&c&&(v(),t(b,c).then(()=>{C()}))},T=()=>{C()},_=()=>{m()};return o.jsx("div",{className:"space-y-4",children:o.jsxs("div",{className:"space-y-4",children:[o.jsx(hae,{schema:c,storageType:e.storage.type,onFieldsChange:x}),o.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[o.jsxs("div",{className:"flex space-x-4",children:[o.jsx(be,{variant:"default",onClick:R,disabled:!d,children:"Save"}),o.jsx(be,{type:"button",variant:"ghost",onClick:_,disabled:!d,children:"Discard"})]}),o.jsx("div",{children:o.jsx(be,{type:"button",variant:"outline",onClick:T,disabled:E,children:"Refresh schema"})})]})]})})}function pae(){const e=Zj(),{id:t,projectId:n}=e;return t?n?o.jsx("div",{className:"dm-page",children:o.jsx(C3,{children:o.jsx(AQ,{id:t})})}):o.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):o.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function gae({className:e,...t}){return o.jsx("div",{"data-slot":"card",className:J("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function vae({className:e,...t}){return o.jsx("div",{"data-slot":"card-header",className:J("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function yae({className:e,...t}){return o.jsx("div",{"data-slot":"card-title",className:J("leading-none font-semibold",e),...t})}function xae({className:e,...t}){return o.jsx("div",{"data-slot":"card-description",className:J("text-muted-foreground text-sm",e),...t})}function bae({className:e,...t}){return o.jsx("div",{"data-slot":"card-content",className:J("px-6",e),...t})}function Sae({className:e,...t}){return o.jsx("div",{"data-slot":"card-footer",className:J("flex items-center px-6 [.border-t]:pt-6",e),...t})}const DS=p.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function _o({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:s}=p.useContext(DS);return o.jsxs("div",{className:"flex items-center gap-2 self-center",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:o.jsx(e,{size:18})}),o.jsx(yae,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&o.jsx(xae,{className:J("text-md text-muted-foreground/50",!s&&"hidden"),children:n}),t&&o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{className:"pointer-events-none ml-2 flex items-center opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100",children:[o.jsx(Fr,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),o.jsx("span",{className:"sr-only",children:t})]})}),o.jsx(wt,{children:o.jsx("p",{children:t})})]})})]})}_o.displayName="CollapsibleCardHeaderTitle";function rh({children:e,className:t}){const n=r=>{r.stopPropagation()};return o.jsx("div",{className:J("flex items-center gap-2 self-center",t),onClick:n,children:e})}rh.displayName="CollapsibleCardHeaderActions";function No({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=p.useContext(DS);let s,l;return p.Children.forEach(e,c=>{if(p.isValidElement(c))switch(c.type){case _o:s=c;break;case rh:l=c;break}}),o.jsxs(vae,{className:J("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[s,o.jsxs("div",{className:"flex items-center gap-2",children:[l,t&&o.jsx("div",{className:J("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-white/4"),children:o.jsx("div",{className:J("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:o.jsx(Ka,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}No.displayName="CollapsibleCardHeader";function Ao({children:e}){return o.jsx(bae,{className:"px-4 pt-1",children:e})}Ao.displayName="CollapsibleCardContent";function ji({left:e,right:t}){return o.jsxs(Sae,{className:"flex items-center gap-2 px-4 py-4",children:[o.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&o.jsx("div",{className:"flex items-center",children:t})]})}ji.displayName="CollapsibleCardFooter";const yj="collapsed-card-";function jl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:s=!1,onCollapsedChange:l,name:c}){const d=c?Ms.get(`${yj}${c}`,"boolean")??s:s,[f,m]=p.useState(d);p.useEffect(()=>{c&&Ms.set(`${yj}${c}`,f)},[f,c]);const g=()=>{const C=!f;m(C),l==null||l(C)};let v,x,b;p.Children.forEach(e,C=>{if(p.isValidElement(C))switch(C.type){case No:v=C;break;case Ao:x=C;break;case ji:b=C;break}});const w={default:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none",dense:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none text-sm",flat:"rounded-md p-0 gap-0 border-0 border-b-0 shadow-none"};return o.jsx(DS.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:g},children:o.jsxs(gae,{className:J(w[n],t),children:[v,o.jsx("div",{className:J("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:o.jsxs("div",{className:"overflow-hidden",children:[x,b]})})]})})}function Cae(){const{dataMart:e,updateDataMartStorage:t}=Gi();return o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs(jl,{collapsible:!0,name:"data-storage",children:[o.jsx(No,{children:o.jsx(_o,{icon:cu,tooltip:"Configure where your data will be stored",children:"Storage"})}),o.jsx(Ao,{children:(e==null?void 0:e.storage)&&o.jsx(aee,{dataStorage:e.storage,onDataStorageChange:t})}),o.jsx(ji,{})]}),o.jsxs(jl,{collapsible:!0,name:"input-source",children:[o.jsx(No,{children:o.jsx(_o,{icon:jb,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),o.jsx(Ao,{children:e&&o.jsx(ine,{})}),o.jsx(ji,{})]}),o.jsxs(jl,{collapsible:!0,name:"output-schema",children:[o.jsx(No,{children:o.jsx(_o,{icon:N9,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),o.jsx(Ao,{children:e&&o.jsx(mae,{})}),o.jsx(ji,{})]})]})}function wae({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,s]=p.useState(!1),[l,c]=p.useState(!1),[d,f]=p.useState(!1),{deleteReport:m,fetchReportsByDataMartId:g,runReport:v}=Kl(),x=`actions-menu-${e.original.id}`,b=p.useCallback(async()=>{try{await m(e.original.id),await g(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[m,g,t,e.original.id,e.original.dataMart.id]),w=p.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),C=p.useCallback(async()=>{try{s(!0),await v(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{s(!1)}},[v,e.original.id]),E=p.useCallback(()=>{f(!0),c(!1)},[]);return o.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[o.jsxs(Rr,{open:l,onOpenChange:c,children:[o.jsx(Tr,{asChild:!0,children:o.jsxs(be,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${l?"opacity-100":"group-hover:opacity-100"}`,"aria-label":`Actions for report: ${e.original.title}`,"aria-haspopup":"true","aria-expanded":l,"aria-controls":x,children:[o.jsx("span",{className:"sr-only",children:"Open menu"}),o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),o.jsxs(jr,{id:x,align:"end",role:"menu",children:[o.jsxs(yt,{onClick:R=>{R.stopPropagation(),w()},role:"menuitem",children:[o.jsx(jf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),_g(e.original.destinationConfig)&&o.jsxs(o.Fragment,{children:[o.jsx(qa,{}),o.jsxs(yt,{onClick:R=>{R.stopPropagation(),C()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[o.jsx(_b,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),o.jsx(yt,{asChild:!0,children:o.jsxs("a",{href:x1(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[o.jsx(B9,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),o.jsx(qa,{}),o.jsxs(yt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),o.jsx(na,{open:d,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:()=>{b()},variant:"destructive"})]})}const Eae={[dn.SUCCESS]:{icon:Yp,color:"text-green-500",label:"Success"},[dn.ERROR]:{icon:sp,color:"text-red-500",label:"Fail"},[dn.RUNNING]:{icon:Tf,color:"text-primary animate-spin",label:"In progress"},[dn.CANCELLED]:{icon:sp,color:"text-gray-500",label:"Cancelled"}};function Rae({status:e,error:t}){if(!e)return null;const n=Eae[e],{icon:r,color:s,label:l}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,d=()=>e===dn.ERROR&&t?`${l}: ${t}`:l;return o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(r,{className:J("h-5 w-5",s),role:"img","aria-label":d(),"aria-describedby":c,tabIndex:0})}),o.jsxs(wt,{id:c,side:"bottom",role:"tooltip",children:[o.jsx("div",{className:"text-xs",children:l}),e===dn.ERROR&&t&&o.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function r0({column:e,children:t,label:n}){const r=e.getIsSorted(),s=p.useCallback(()=>{e.toggleSorting(e.getIsSorted()==="asc")},[e]),l=()=>r==="asc"?"sorted ascending":r==="desc"?"sorted descending":"not sorted",c=()=>r==="asc"?"ascending":r==="desc"?"descending":"none",d=n??(typeof t=="string"?t:"Column");return o.jsxs(be,{variant:"ghost",onClick:s,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&o.jsx(Us,{className:"text-foreground h-4 w-4"}),r==="desc"&&o.jsx(Ka,{className:"text-foreground h-4 w-4"}),!r&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{className:"text-muted-foreground h-4 w-4"})})]})]})}var Ei=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(Ei||{});const B5={[Ei.TITLE]:"Title",[Ei.LAST_RUN_DATE]:"Last Run Date",[Ei.LAST_RUN_STATUS]:"Last Run Status"};function Tae({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=B5[t.id]||t.id;return o.jsx(yt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:n})]})},t.id)})})]})})}const xj=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},jae=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:Ei.TITLE,header:({column:n})=>o.jsx(r0,{column:n,children:B5[Ei.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:Ei.LAST_RUN_DATE,header:({column:n})=>o.jsx(r0,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return o.jsx("div",{className:"text-muted-foreground text-sm",children:r?o.jsx(Pl,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:Ei.LAST_RUN_STATUS,header:({column:n})=>o.jsx(r0,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?o.jsx(Rae,{status:n.original.lastRunStatus,error:n.original.lastRunError}):o.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>o.jsx(Tae,{table:n}),cell:({row:n})=>o.jsx(wae,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function G5({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const s=p.useRef(r);s.current=r;const l=p.useRef(null);p.useEffect(()=>{var f;if(!e)return;(f=l.current)==null||f.abort(),l.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const m=new AbortController;s.current(m.signal)}};c();const d=window.setInterval(c,t);return()=>{var m;window.clearInterval(d),(m=l.current)==null||m.abort()}},[e,t,n])}const _ae=5e3;function Nae({destination:e,onEditReport:t,autoRefreshEnabled:n=!1}){const{dataMart:r}=gs(),{fetchReportsByDataMartId:s,reports:l,stopAllPolling:c,setPollingConfig:d}=Kl(),f=p.useMemo(()=>l.filter(E=>E.dataDestination.type===Mt.GOOGLE_SHEETS&&E.dataDestination.id===e.id),[l,e.id]);p.useEffect(()=>{d({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[d]),p.useEffect(()=>{(async()=>{try{if(!r)return;await s(r.id)}catch(R){console.error(R)}})()},[s,r]),G5({enabled:!!r&&n,intervalMs:_ae,onTick:()=>{r&&s(r.id,{silent:!0})}}),p.useEffect(()=>()=>{c()},[r==null?void 0:r.id,c]);const m=p.useMemo(()=>jae({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:g,setSorting:v,columnVisibility:x,setColumnVisibility:b}=Kf({columns:m,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),w=Du({data:f,columns:m,getCoreRowModel:Au(),onSortingChange:v,getSortedRowModel:Zf(),state:{sorting:g,columnVisibility:x},onColumnVisibilityChange:b}),C=`google-sheets-reports-table-${e.id}`;return o.jsx("div",{className:"w-full",children:o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ou,{id:C,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[o.jsx(Mu,{className:"dm-card-table-header",children:w.getHeaderGroups().map(E=>o.jsx(ir,{className:"dm-card-table-header-row",children:E.headers.map(R=>o.jsx(Iu,{className:xj(R.column.columnDef._align),style:R.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(R.column.getSize())}%`},scope:"col",children:R.isPlaceholder?null:typeof R.column.columnDef.header=="function"?R.column.columnDef.header(R.getContext()):R.column.columnDef.header},R.id))},E.id))}),o.jsx(ku,{className:"dm-card-table-body",children:w.getRowModel().rows.length?w.getRowModel().rows.map((E,R)=>o.jsx(ir,{onClick:()=>{const T=l.find(_=>_.id===E.original.id);T&&t(T)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":R+1,children:E.getVisibleCells().map((T,_)=>o.jsx(ba,{className:`px-6 whitespace-normal ${xj(T.column.columnDef._align)}`,style:T.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(T.column.getSize())}%`},role:"cell","aria-colindex":_+1,children:typeof T.column.columnDef.cell=="function"?T.column.columnDef.cell(T.getContext()):T.column.columnDef.cell},T.id))},E.id)):o.jsx(ir,{children:o.jsx(ba,{colSpan:m.length,className:"dm-card-table-body-row-empty",role:"cell",children:o.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function Aae({children:e,className:t,...n}){return o.jsx("div",{className:J("group flex items-start justify-center gap-3 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-xs dark:border-0 dark:bg-white/2",t),...n,children:e})}function Dae({children:e,className:t,...n}){return o.jsx("div",{className:J("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function Oae({children:e,className:t,...n}){return o.jsx("div",{className:J("text-md font-medium",t),...n,children:e})}function Mae({children:e,className:t,...n}){return o.jsx("div",{className:J("text-muted-foreground text-sm",t),...n,children:e})}function kae({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:s,tooltipTextSwitchOff:l,tooltipTextSwitchDisabled:c}){const d=t?c??"Disabled":e?s:l;return o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?o.jsx(Tf,{className:"text-muted-foreground h-5 w-5 animate-spin"}):o.jsx(zO,{checked:e,disabled:t,onCheckedChange:r})})}),o.jsx(wt,{children:d})]})}function Iae({icon:e,className:t,...n}){return o.jsx("div",{className:J("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:o.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:e??o.jsx(Ta,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Lae(e){const{dataMart:t}=gs(),{reports:n,createReport:r,deleteReport:s,fetchReportsByDataMartId:l}=Kl(),[c,d]=p.useState(!1),f=p.useMemo(()=>n.find(b=>b.dataDestination.type===Mt.LOOKER_STUDIO&&b.dataDestination.id===e.id),[n,e.id]),m=p.useMemo(()=>(t==null?void 0:t.status.code)===dr.PUBLISHED,[t==null?void 0:t.status.code]),g=p.useMemo(()=>!!f,[f]),v=p.useMemo(()=>g?"Available in Looker Studio":"Not available in Looker Studio",[g]),x=p.useCallback(async b=>{if(!(!t||!m)){d(!0);try{if(b){const w={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:ya.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(w),await l(t.id)}else f&&(await s(f.id),await l(t.id))}catch(w){console.error("Failed to toggle Looker Studio report:",w)}finally{d(!1)}}},[t,m,e,f,r,s,l]);return{existingReport:f,isLoading:c,isEnabled:m,isChecked:g,dynamicTitle:v,handleSwitchChange:x}}function Pae({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:s,isEnabled:l,isChecked:c,dynamicTitle:d,handleSwitchChange:f}=Lae(e),m=p.useCallback(()=>{r&&t(r)},[r,t]);return o.jsxs(Aae,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?m:void 0,...n,children:[o.jsx(kae,{checked:c,disabled:!l,loading:s,onCheckedChange:g=>void f(g),tooltipTextSwitchOn:"Switch off to remove access",tooltipTextSwitchOff:"Switch on to enable access",tooltipTextSwitchDisabled:"Publish the Data Mart first to enable access in Looker Studio"}),o.jsxs(Dae,{children:[o.jsx(Oae,{children:d}),o.jsx(Mae,{children:c&&r?o.jsx(o.Fragment,{children:r.lastRunDate?o.jsxs(o.Fragment,{children:["Last fetched"," ",r.lastRunStatus===dn.SUCCESS&&"successfully ",o.jsx(Pl,{date:new Date(r.lastRunDate)}),r.lastRunStatus===dn.ERROR&&" but failed with error",r.lastRunError&&o.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:r.lastRunError})]}):"Waiting for Looker Studio to fetch data"}):"Switch on to enable access"})]}),c&&r&&o.jsx(Iae,{})]})}function Uae(){const{scope:e}=Po();return o.jsx("div",{className:"dm-card",children:o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(Rb,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),o.jsx(be,{variant:"outline",asChild:!0,children:o.jsxs(Ga,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",o.jsx(Ta,{className:"h-4 w-4"})]})})]})})}function Fae(){const[e,t]=p.useState(!1),[n,r]=p.useState(Un.CREATE),[s,l]=p.useState(null);return{isOpen:e,mode:n,editingReport:s,handleAddReport:()=>{r(Un.CREATE),l(null),t(!0),Ue({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:m=>{r(Un.EDIT),l(m),t(!0),Ue({event:"report_open",category:"Report",action:"EditReport",label:m.dataDestination.type})},handleCloseModal:()=>{t(!1),l(null),Ue({event:"report_close",category:"Report",action:n===Un.EDIT?"Edit":"Create",label:"ReportForm"})}}}function zae({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=pZ(e),{isOpen:s,mode:l,editingReport:c,handleAddReport:d,handleEditReport:f,handleCloseModal:m}=Fae();return r?o.jsxs(o.Fragment,{children:[o.jsxs(jl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[o.jsxs(No,{children:[o.jsx(_o,{icon:n.icon,children:e.title}),o.jsx(rh,{children:e.type===Mt.GOOGLE_SHEETS&&o.jsx(Vae,{dataMartStatus:t,onAddReport:d})})]}),o.jsx(Ao,{children:o.jsx(nse,{destination:e,onEditReport:f,...e.type===Mt.GOOGLE_SHEETS&&{autoRefreshEnabled:!0}})}),o.jsx(ji,{})]}),o.jsx(tse,{destination:e,isOpen:s,onClose:m,mode:l,initialReport:c})]}):null}function Vae({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===dr.DRAFT;return o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("span",{children:o.jsxs(be,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[o.jsx(ja,{className:"h-4 w-4"}),"Add Report"]})})}),n&&o.jsx(wt,{children:o.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function Hae({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){p.useEffect(()=>{{const s=setTimeout(()=>{const l=document.getElementById(e);if(l){const c=l;c.focus(),r&&c.value?c.select():c.value&&c.setSelectionRange(c.value.length,c.value.length)}},n);return()=>{clearTimeout(s)}}},[t,e,n,r])}const $ae=ln({title:cn().min(1,"Title is required"),documentUrl:cn().refine(M4,"Enter a valid Google Sheets URL"),dataDestinationId:cn().min(1,"Destination is required")});function Bae({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:s}){const[l,c]=p.useState(null),[d,f]=p.useState(!1),{updateReport:m,createReport:g,error:v,clearError:x}=Kl();p.useEffect(()=>{d&&v&&(c(v),f(!1))},[v,d]);const b=qi({resolver:Jl($ae),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&_g(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(s==null?void 0:s.id)??""},mode:"onTouched"}),{register:w,handleSubmit:C,formState:E,reset:R}=b,{errors:T,isDirty:_}=E,O=p.useCallback(async A=>{try{c(null),x(),f(!0);const{spreadsheetId:D,sheetId:j}=Qq(A.documentUrl);if(!D){c("Invalid Google Sheets URL");return}let M;if(t===Un.CREATE)M=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:{type:ya.GOOGLE_SHEETS_CONFIG,spreadsheetId:D,sheetId:j}});else{if(!e){c("Initial report is required for edit mode");return}M=await m(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:{type:ya.GOOGLE_SHEETS_CONFIG,spreadsheetId:D,sheetId:j}})}if(!M||v){c(v??"An error occurred while submitting the form");return}r==null||r()}catch(D){console.error("Error submitting form:",D),c("An error occurred while submitting the form")}},[t,e,n,g,m,r,x,v]);return{form:b,register:w,handleSubmit:C,errors:T,isDirty:_,reset:R,formError:l,isSubmitting:d,setFormError:c,getValues:b.getValues,onSubmit:O}}function Gae(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"service-account-details",children:[o.jsx(Wn,{children:"How do I get a correct document link?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Open your Google Sheets document and select the specific ",o.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),o.jsxs("li",{children:["Share the document with the service account email and grant it ",o.jsx("strong",{children:"Editor"})," ","access."]}),o.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",o.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),o.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function a0(e){return"serviceAccount"in e}function qae({value:e,children:t}){const[n,r]=p.useState(!1),s=async()=>{e&&(await navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3))};return o.jsx(ls,{children:o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsxs("div",{role:"button",tabIndex:0,onClick:s,onKeyDown:l=>l.key==="Enter"&&s(),className:J("flex cursor-pointer items-center justify-between gap-2 select-none","text-muted-foreground border-input rounded-md border px-3 py-1.5 text-sm","hover:bg-accent hover:text-accent-foreground transition-colors"),children:[o.jsx("span",{className:"truncate",children:t||e||"No data"}),n?o.jsx(fr,{className:"h-4 w-4 text-green-500"}):o.jsx(of,{className:"h-4 w-4"})]})}),o.jsx(wt,{children:o.jsx("p",{children:n?"Copied!":"Click to copy"})})]})})}const Zae=p.forwardRef(({initialReport:e,mode:t=Un.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const f="google-sheets-edit-form",m="google-sheets-title-input",g="google-sheets-document-url-input",v="google-sheets-data-destination-select",{dataMart:x}=gs(),{scope:b}=Po(),{dataDestinations:w,fetchDataDestinations:C,loading:E}=Eg(),[R,T]=p.useState([]);p.useEffect(()=>{x&&C()},[x,C]),p.useEffect(()=>{if(w.length>0){const K=w.filter(Y=>Y.type===Mt.GOOGLE_SHEETS);T(K)}},[w]),Hae({elementId:m,isOpen:!0,delay:150});const{isDirty:_,reset:O,form:A,isSubmitting:D,formError:j,onSubmit:M}=Bae({initialReport:e,mode:t,dataMartId:(x==null?void 0:x.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});p.useEffect(()=>{r&&r(j)},[j,r]),p.useEffect(()=>{if(t===Un.EDIT&&e&&_g(e.destinationConfig))O({title:e.title,documentUrl:x1(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===Un.CREATE){const K=(c==null?void 0:c.id)??"";O({title:"",documentUrl:"",dataDestinationId:K})}},[e,t,O,c]),p.useEffect(()=>{n==null||n(_)},[_,n]);const z=A.watch("documentUrl"),Z=z&&M4(z.trim());return o.jsx(Wl,{...A,children:o.jsxs(Zi,{id:f,ref:d,noValidate:!0,onSubmit:K=>void A.handleSubmit(M)(K),children:[o.jsxs(Ql,{children:[o.jsxs(Vs,{title:"General",children:[o.jsx(Jt,{control:A.control,name:"title",render:({field:K})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),o.jsx(nn,{children:o.jsx(Ht,{id:m,placeholder:"Enter a report title",...K})}),o.jsx(un,{})]})}),o.jsx(Jt,{control:A.control,name:"dataDestinationId",render:({field:K})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Select one of your existing destinations",children:"Destination"}),o.jsxs(Ca,{onValueChange:K.onChange,value:K.value,disabled:E||R.length===0,children:[o.jsx(nn,{children:o.jsx(Ea,{id:v,className:"w-full max-w-full overflow-hidden",children:o.jsx(wa,{className:"truncate",placeholder:"Select a destination",children:K.value&&R.length>0&&(()=>{const Y=R.find(ae=>ae.id===K.value);if(Y){const F=Ll.getInfo(Y.type).icon;return o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(F,{className:"flex-shrink-0",size:18}),o.jsx("div",{className:"flex min-w-0 flex-col",children:o.jsx("span",{className:"truncate",children:Y.title})})]})}return null})()})})}),o.jsx(Ra,{children:R.map(Y=>{const F=Ll.getInfo(Y.type).icon;return o.jsx(Zn,{value:Y.id,children:o.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[o.jsx(F,{className:"flex-shrink-0",size:18}),o.jsxs("div",{className:"flex min-w-0 flex-col",children:[o.jsx("span",{className:"truncate",children:Y.title}),o.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(a0(Y.credentials)&&Mx(Y.credentials.serviceAccount))??"No email found"})]})]})},Y.id)})})]}),R.length===0&&!E&&o.jsxs(pS,{className:"mt-2",children:[o.jsx(Rf,{className:"h-4 w-4"}),o.jsx(xO,{children:"No destinations available"}),o.jsxs(gS,{children:["You need to create a Destination before you can create a report."," ",o.jsx(Ga,{to:b("/data-destinations"),className:"font-medium text-blue-600 hover:text-blue-800 dark:text-blue-400 dark:hover:text-blue-300",children:"Go to Destinations"})]})]}),K.value&&R.length>0&&(()=>{const Y=R.find(ae=>ae.id===K.value);return Y?o.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[o.jsx(tn,{children:"Service Account Email"}),o.jsx(qae,{value:a0(Y.credentials)?Mx(Y.credentials.serviceAccount)??"No email found":"",children:a0(Y.credentials)?Mx(Y.credentials.serviceAccount):"No email found"})]}):null})(),o.jsx(un,{})]})}),o.jsx(Jt,{control:A.control,name:"documentUrl",render:({field:K})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),o.jsx(nn,{children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Ht,{id:g,placeholder:"Document URL",className:"flex-1",...K}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("button",{type:"button",className:`flex-shrink-0 rounded-md p-2 transition-all duration-200 ${Z?"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:()=>{Z&&window.open(z.trim(),"_blank","noopener,noreferrer")},disabled:!Z,"aria-label":Z?"Open document in new tab":"Document link is not valid",children:o.jsx(_l,{className:"h-4 w-4","aria-hidden":"true"})})}),o.jsx(wt,{side:"top",align:"center",role:"tooltip",children:Z?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),o.jsx(or,{children:o.jsx(Gae,{})}),o.jsx(un,{})]})})]}),o.jsx(Vs,{title:"Automate Report Runs",children:o.jsx(GO,{})})]}),o.jsxs(Xl,{children:[o.jsx(be,{variant:"default",type:"submit",className:"w-full","aria-label":t===Un.CREATE?"Create new report":"Save changes to report",disabled:!_||D,children:D?t===Un.CREATE?"Creating...":"Saving...":t===Un.CREATE?"Create new report":"Save changes to report"}),l&&o.jsx(be,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Kae({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,f]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),f(!1),t()},[t]),v=p.useCallback(b=>{f(b)},[]),x=p.useCallback(()=>{f(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:r===Un.CREATE?"Create new report":"Edit report"}),o.jsx(Gl,{children:r===Un.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),o.jsx(wg,{children:o.jsx(Zae,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(na,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}const Yae=ln({cacheLifetime:jB().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Wae({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[s,l]=p.useState(null),{createReport:c,updateReport:d}=Kl(),f=qi({resolver:Jl(Yae),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&G4(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async g=>{try{l(null);const{cacheLifetime:v}=g,x={type:ya.LOOKER_STUDIO_CONFIG,cacheLifetime:v};e?await d(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:x}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:x}),n==null||n()}catch(v){console.error("Error submitting form:",v),l("Failed to save report. Please try again.")}},formError:s,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function Qae(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"cache-lifetime-details",children:[o.jsx(Wn,{children:"What is the Cache Lifetime for Looker Studio?"}),o.jsx(Qn,{children:o.jsx("p",{className:"mb-2",children:"Cache Lifetime - defines the period during which results from previous query executions are served from storage-side cache, eliminating the need to re-execute the query"})})]})})}const Xae=[{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"}],Jae=p.forwardRef(({initialReport:e,mode:t=Un.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:s,onCancel:l,preSelectedDestination:c},d)=>{const f="looker-studio-edit-form",{dataMart:m}=gs(),{isDirty:g,reset:v,form:x,isSubmitting:b,formError:w,onSubmit:C}=Wae({initialReport:e,dataMartId:(m==null?void 0:m.id)??"",onSuccess:()=>{s==null||s()},preSelectedDestination:c});return p.useEffect(()=>{r&&r(w)},[w,r]),p.useEffect(()=>{t===Un.EDIT&&e&&G4(e.destinationConfig)?v({cacheLifetime:e.destinationConfig.cacheLifetime}):t===Un.CREATE&&v({cacheLifetime:300})},[e,t,v]),p.useEffect(()=>{n==null||n(g)},[g,n]),o.jsx(Wl,{...x,children:o.jsxs(Zi,{id:f,ref:d,noValidate:!0,onSubmit:E=>void x.handleSubmit(C)(E),children:[o.jsx(Ql,{children:o.jsx(Vs,{title:"Cache Configuration",children:o.jsx(Jt,{control:x.control,name:"cacheLifetime",render:({field:E})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),o.jsxs(Ca,{onValueChange:R=>{E.onChange(parseInt(R,10))},value:E.value.toString(),defaultValue:"300",children:[o.jsx(nn,{children:o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{placeholder:"Select cache time"})})}),o.jsx(Ra,{children:Xae.map(R=>o.jsx(Zn,{value:R.value.toString(),children:R.label},R.value))})]}),o.jsx(un,{}),o.jsx(or,{children:o.jsx(Qae,{})})]})})})}),o.jsxs(Xl,{children:[o.jsx(be,{variant:"default",type:"submit",className:"w-full","aria-label":t===Un.CREATE?"Create":"Save changes",disabled:!g||b,children:b?t===Un.CREATE?"Creating...":"Saving...":t===Un.CREATE?"Create":"Save changes"}),l&&o.jsx(be,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function ese({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:s}){const[l,c]=p.useState(!1),[d,f]=p.useState(!1),m=p.useCallback(()=>{d?c(!0):t()},[d,t]),g=p.useCallback(()=>{c(!1),f(!1),t()},[t]),v=p.useCallback(b=>{f(b)},[]),x=p.useCallback(()=>{f(!1),t()},[t]);return o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:b=>{b||m()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:(s==null?void 0:s.title)??"Looker Studio"}),o.jsx(Gl,{children:r===Un.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),o.jsx(wg,{children:o.jsx(Jae,{initialReport:n,mode:r,onDirtyChange:v,onSubmit:x,onCancel:m,preSelectedDestination:s})})]})}),o.jsx(na,{open:l,onOpenChange:c,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:g,variant:"destructive"})]})}function tse({destination:e,isOpen:t,onClose:n,mode:r,initialReport:s}){switch(e.type){case Mt.GOOGLE_SHEETS:return o.jsx(Kae,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});case Mt.LOOKER_STUDIO:return o.jsx(ese,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:s??void 0});default:return null}}function nse({destination:e,onEditReport:t,autoRefreshEnabled:n}){switch(e.type){case Mt.GOOGLE_SHEETS:return o.jsx(Nae,{destination:e,onEditReport:t,autoRefreshEnabled:n});case Mt.LOOKER_STUDIO:return o.jsx(Pae,{destination:e,onEditReport:t});default:return null}}function q5(){return o.jsx("div",{className:"flex flex-col gap-4",children:o.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>o.jsx("div",{className:"border-border rounded-lg border p-4",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(as,{className:"h-4 w-4 rounded-full"}),o.jsx(as,{className:"h-4 w-40"}),o.jsx(as,{className:"h-3 w-32"})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(as,{className:"h-6 w-16 rounded-full"}),o.jsx(as,{className:"h-4 w-4"})]})]})},t))})})}function rse(){const{dataMart:e}=gs(),{dataDestinations:t,isLoading:n}=gZ();return e?o.jsx("div",{className:"flex flex-col gap-4",children:n?o.jsx(q5,{}):t.length===0?o.jsx(Uae,{}):t.map(r=>o.jsx(zae,{destination:r,dataMartStatus:e.status},r.id))}):null}function ase(){return o.jsx(wg,{children:o.jsx(I4,{children:o.jsx(rse,{})})})}function bj(){return o.jsxs(jl,{children:[o.jsx(No,{children:o.jsx(_o,{icon:c9,tooltip:"Description of the Data Mart",children:"Description"})}),o.jsx(Ao,{children:o.jsx(OQ,{})}),o.jsx(ji,{})]})}function sse(){const{dataMart:e}=Gi(),[t,n]=p.useState(!1),r=p.useCallback(()=>{n(!0)},[]),s=p.useCallback(()=>{n(!1)},[]);return o.jsxs(jl,{children:[o.jsxs(No,{children:[o.jsx(_o,{icon:Ab,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),o.jsx(rh,{children:o.jsxs(be,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[o.jsx(ja,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),o.jsx(Ao,{children:o.jsx(yu,{children:o.jsx(ete,{children:e&&o.jsxs(o.Fragment,{children:[o.jsx(Vte,{dataMartId:e.id}),o.jsx(xS,{isOpen:t,onClose:s,dataMartId:e.id})]})})})}),o.jsx(ji,{})]})}function ose(){const e=WO(),{navigate:t}=Po(),n=r=>{const s=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(s)};return o.jsx("div",{className:"flex h-full w-full items-center justify-center",children:o.jsx("div",{className:"m-auto w-lg",children:o.jsxs("div",{className:"bg-muted/50 dark:bg-sidebar rounded-xl border-b border-gray-200 p-12 pt-8 dark:border-gray-700/50",children:[o.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),o.jsx(Q1,{children:o.jsx(C3,{children:o.jsx(RQ,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function Z5({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:s,loading:l,clearCurrentDataStorage:c}=Lg();p.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const d=()=>{c(),t()};return o.jsx(L1,{open:e,onOpenChange:f=>{f||d()},children:o.jsxs(P1,{children:[o.jsxs(U1,{children:[o.jsx(F1,{children:"Storage Details"}),o.jsx(z1,{children:"View detailed information about this storage."})]}),o.jsx("div",{className:"py-4",children:o.jsx(Tq,{dataStorage:s,isLoading:l})})]})})}function s0({column:e,children:t}){return o.jsxs(be,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Ka,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const ise=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[s,l]=p.useState(!1);return o.jsx("div",{className:"text-right",children:o.jsxs(Rr,{open:s,onOpenChange:l,children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${s?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(jr,{align:"end",children:[o.jsxs(yt,{onClick:()=>t==null?void 0:t(e),children:[o.jsx(o_,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"View details"})]}),o.jsxs(yt,{onClick:()=>void(n==null?void 0:n(e)),children:[o.jsx(jf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),o.jsx(qa,{}),o.jsxs(yt,{onClick:()=>r==null?void 0:r(e),children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})};function lse({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(yt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const cse=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(s0,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(s0,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Bi.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(s0,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(lse,{table:r}),cell:({row:r})=>o.jsx(ise,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function use({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(O9,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),o.jsxs(be,{variant:"outline",onClick:e,children:[o.jsx(ja,{className:"h-4 w-4"}),"New Storage"]})]})}function dse({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Kf({columns:e,storageKeyPrefix:"data-storage-list"}),[f,m]=p.useState([]),[g,v]=p.useState({}),[x,b]=p.useState(!1),[w]=p.useState(null),C=Du({data:t,columns:[...e],getCoreRowModel:Au(),getPaginationRowModel:Ag(),onSortingChange:l,getSortedRowModel:Zf(),onColumnFiltersChange:m,getFilteredRowModel:qf(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),E=(T,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(T)};return t.length?o.jsxs("div",{children:[w&&o.jsx(Z5,{isOpen:x,onClose:()=>{b(!1)},id:w.id}),o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Hl,{className:"dm-card-toolbar-search-icon"}),o.jsx(Ht,{placeholder:"Search by title",value:(R=C.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:T=>{var _;return(_=C.getColumn("title"))==null?void 0:_.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(be,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(ja,{className:"h-4 w-4"}),"New Storage"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ou,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[o.jsx(Mu,{className:"dm-card-table-header",children:C.getHeaderGroups().map(T=>o.jsx(ir,{className:"dm-card-table-header-row",children:T.headers.map(_=>o.jsx(Iu,{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:vu(_.column.columnDef.header,_.getContext())},_.id))},T.id))}),o.jsx(ku,{className:"dm-card-table-body",children:C.getRowModel().rows.length?C.getRowModel().rows.map(T=>o.jsx(ir,{"data-state":T.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const O=T.original.id;E(O,_)},children:T.getVisibleCells().map(_=>o.jsx(ba,{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:vu(_.column.columnDef.cell,_.getContext())},_.id))},T.id)):o.jsx(ir,{children:o.jsx(ba,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(be,{variant:"outline",size:"sm",onClick:()=>{C.previousPage()},disabled:!C.getCanPreviousPage(),children:"Previous"}),o.jsx(be,{variant:"outline",size:"sm",onClick:()=>{C.nextPage()},disabled:!C.getCanNextPage(),children:"Next"})]})]})]}):o.jsx("div",{className:"dm-card",children:o.jsx(use,{onOpenTypeDialog:r})})}const fse=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=p.useState(e),{dataStorages:s,currentDataStorage:l,clearCurrentDataStorage:c,fetchDataStorages:d,getDataStorageById:f,deleteDataStorage:m,createDataStorage:g}=Lg();p.useEffect(()=>{d()},[d]),p.useEffect(()=>{r(e)},[e]);const v=()=>{r(!1),t==null||t()},[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,_]=p.useState(!1),[O,A]=p.useState(null),D=async I=>{try{const B=await g(I);v(),B!=null&&B.id&&(await f(B.id),b(!0))}catch(B){console.error("Failed to create storage:",B)}},j=I=>{A(I),_(!0)},M=()=>{_(!1),A(null)},z=async I=>{await f(I),b(!0)},Z=I=>{R(I),C(!0)},K=async()=>{if(E)try{await m(E),await d()}catch(I){console.error("Failed to delete storage:",I)}finally{C(!1),R(null)}},Y=async()=>{try{b(!1),await d()}catch(I){console.error("Failed to save storage:",I)}},ae=()=>{b(!1),c()},F=s.map(I=>({id:I.id,title:I.title,type:I.type,createdAt:I.createdAt,modifiedAt:I.modifiedAt})),V=cse({onViewDetails:j,onEdit:z,onDelete:Z});return o.jsxs("div",{children:[o.jsx(dse,{columns:V,data:F,onEdit:z,onOpenTypeDialog:()=>{r(!0)}}),o.jsx(Z5,{isOpen:T,onClose:M,id:O??""}),o.jsx(bD,{isOpen:n,onClose:v,onSelect:D}),o.jsx(yO,{isOpen:x,onClose:ae,dataStorage:l,onSaveSuccess:()=>void Y()}),o.jsx(na,{open:w,onOpenChange:C,title:"Delete Storage",description:"Are you sure you want to delete this storage? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{K()},onCancel:()=>{R(null)},variant:"destructive"})]})},hse=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(Q1,{children:o.jsx(fse,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function mse({onOpenTypeDialog:e}){return o.jsxs("div",{className:"dm-empty-state",children:[o.jsx(Rb,{className:"dm-empty-state-ico",strokeWidth:1}),o.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),o.jsx("p",{className:"dm-empty-state-subtitle",children:"A Destination combines your reporting tool and access credentials — both needed to deliver data from Data Marts to your reports and dashboards."}),o.jsxs(be,{variant:"outline",onClick:e,children:[o.jsx(ja,{className:"h-4 w-4"}),"New Destination"]})]})}function pse({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var w;const{sorting:s,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Kf({columns:e,storageKeyPrefix:"data-destination-list"}),[f,m]=p.useState([]),[g,v]=p.useState({}),x=Du({data:t,columns:[...e],getCoreRowModel:Au(),getPaginationRowModel:Ag(),onSortingChange:l,getSortedRowModel:Zf(),onColumnFiltersChange:m,getFilteredRowModel:qf(),onColumnVisibilityChange:d,onRowSelectionChange:v,state:{sorting:s,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),b=(C,E)=>{E.target instanceof HTMLElement&&(E.target.closest('[role="checkbox"]')||E.target.closest(".actions-cell")||E.target.closest('[role="menuitem"]'))||n==null||n(C)};return t.length?o.jsx("div",{children:o.jsxs("div",{className:"dm-card",children:[o.jsxs("div",{className:"dm-card-toolbar",children:[o.jsx("div",{className:"dm-card-toolbar-left",children:o.jsxs("div",{className:"dm-card-toolbar-search",children:[o.jsx(Hl,{className:"dm-card-toolbar-search-icon"}),o.jsx(Ht,{placeholder:"Search by title",value:(w=x.getColumn("title"))==null?void 0:w.getFilterValue(),onChange:C=>{var E;return(E=x.getColumn("title"))==null?void 0:E.setFilterValue(C.target.value)},className:"dm-card-toolbar-search-input"})]})}),o.jsx("div",{className:"dm-card-toolbar-right",children:o.jsxs(be,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[o.jsx(ja,{className:"h-4 w-4"}),"New Destination"]})})]}),o.jsx("div",{className:"dm-card-table-wrap",children:o.jsxs(Ou,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[o.jsx(Mu,{className:"dm-card-table-header",children:x.getHeaderGroups().map(C=>o.jsx(ir,{className:"dm-card-table-header-row",children:C.headers.map(E=>o.jsx(Iu,{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:vu(E.column.columnDef.header,E.getContext())},E.id))},C.id))}),o.jsx(ku,{className:"dm-card-table-body",children:x.getRowModel().rows.length?x.getRowModel().rows.map(C=>o.jsx(ir,{"data-state":C.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:E=>{const R=C.original.id;b(R,E)},children:C.getVisibleCells().map(E=>o.jsx(ba,{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:vu(E.column.columnDef.cell,E.getContext())},E.id))},C.id)):o.jsx(ir,{children:o.jsx(ba,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),o.jsxs("div",{className:"dm-card-pagination",children:[o.jsx(be,{variant:"outline",size:"sm",onClick:()=>{x.previousPage()},disabled:!x.getCanPreviousPage(),children:"Previous"}),o.jsx(be,{variant:"outline",size:"sm",onClick:()=>{x.nextPage()},disabled:!x.getCanNextPage(),children:"Next"})]})]})}):o.jsx("div",{className:"dm-card",children:o.jsx(mse,{onOpenTypeDialog:r})})}function o0({column:e,children:t}){return o.jsxs(be,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,o.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&o.jsx(Ka,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&o.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:o.jsx(Us,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}function OS(e){return"destinationSecretKey"in e}const gse=({id:e,type:t,credentials:n,onEdit:r,onDelete:s,onRotateSecretKey:l})=>{const[c,d]=p.useState(!1),f=()=>{if(n&&OS(n)){const v=b1(n);navigator.clipboard.writeText(v),Ot.success("JSON Config copied to clipboard")}},m=t===Mt.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return o.jsx(o.Fragment,{children:o.jsx("div",{className:"text-right",children:o.jsxs(Rr,{open:c,onOpenChange:d,children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${c?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsxs(jr,{align:"end",children:[o.jsxs(yt,{onClick:()=>void(r==null?void 0:r(e)),children:[o.jsx(jf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Edit"})]}),m&&g&&o.jsxs(o.Fragment,{children:[o.jsx(qa,{}),o.jsxs(yt,{onClick:f,children:[o.jsx(of,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Copy JSON Config"})]}),o.jsxs(yt,{onClick:()=>{l==null||l(e)},children:[o.jsx(h0,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),o.jsx("span",{children:"Rotate Secret Key"})]})]}),o.jsx(qa,{}),o.jsxs(yt,{onClick:()=>s==null?void 0:s(e),children:[o.jsx(Lo,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),o.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})};function vse({table:e}){return o.jsx("div",{className:"px-4 text-right",children:o.jsxs(Rr,{children:[o.jsx(Tr,{asChild:!0,children:o.jsx(be,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:o.jsx(Ya,{className:"dm-card-table-body-row-actionbtn-icon"})})}),o.jsx(jr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>o.jsx(yt,{className:"capitalize",children:o.jsxs("label",{className:"flex items-center space-x-2",children:[o.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&o.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:o.jsx(fr,{className:"size-3.5 text-white"})})}),o.jsx("span",{children:t.id})]})},t.id))})]})})}const yse=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>o.jsx(o0,{column:r,children:"Title"}),cell:({row:r})=>{const s=r.getValue("title");return o.jsx("div",{className:"overflow-hidden text-ellipsis",children:s})}},{accessorKey:"type",size:30,header:({column:r})=>o.jsx(o0,{column:r,children:"Type"}),cell:({row:r})=>{const s=r.getValue("type"),{displayName:l,icon:c}=Ll.getInfo(s);return o.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[o.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>o.jsx(o0,{column:r,children:"Created at"}),cell:({row:r})=>{const s=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(s);return o.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>o.jsx(vse,{table:r}),cell:({row:r})=>o.jsx(gse,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function xse(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"service-account-details",children:[o.jsx(Wn,{children:"How do I get a Service Account JSON key?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),o.jsx("p",{className:"mb-2",children:"Here's what to do:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsxs("li",{children:["Go to"," ",o.jsx(hr,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),o.jsxs("li",{children:["Open ",o.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),o.jsx("li",{children:"Create a new service account or select an existing one."}),o.jsxs("li",{children:["Open the Service Accounts page, go to the ",o.jsx("strong",{children:"Keys"})," tab, click"," ",o.jsx("strong",{children:"Add key"}),", and select ",o.jsx("strong",{children:"Create new key"}),"."]}),o.jsxs("li",{children:["Choose ",o.jsx("strong",{children:"JSON"})," format and click ",o.jsx("strong",{children:"Create"}),"."]}),o.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function bse({form:e}){const[t,n]=p.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},s=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?gO(l):null;return o.jsx(Jt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>o.jsxs(en,{children:[o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsx(tn,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&l&&o.jsx(be,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&o.jsx(be,{variant:"ghost",size:"sm",onClick:s,type:"button",children:"Cancel"})]}),o.jsx(nn,{children:!t&&c?o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx(hr,{href:c.url,children:c.email})}),o.jsx(wt,{children:o.jsx("p",{children:"View in Google Cloud Console"})})]}):o.jsx(Hi,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),o.jsx(or,{children:o.jsx(xse,{})}),o.jsx(un,{})]})})}function Sse(){return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsxs(Yn,{value:"json-config-details",children:[o.jsx(Wn,{children:"What is the JSON Config for Looker Studio?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),o.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[o.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),o.jsx("li",{children:"If you need to rotate a previous secret key, you can use the corresponding function in the menu on the destinations list."})]})]})]})})}function Cse({form:e}){const t=e.getValues("credentials"),n=p.useMemo(()=>t&&OS(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=p.useMemo(()=>b1(n),[n]);return o.jsx(o.Fragment,{children:n.destinationSecretKey&&o.jsx(Jt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>o.jsxs(en,{children:[o.jsx(tn,{children:"JSON Config"}),o.jsx(nn,{children:o.jsx(tB,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),o.jsx(un,{}),o.jsx(or,{children:o.jsx(Sse,{})})]})})})}const wse=()=>o.jsxs(Yn,{value:"sheets-api-details",children:[o.jsx(Wn,{children:"How do I enable the Google Sheets API?"}),o.jsxs(Qn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",o.jsx(hr,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),o.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),o.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[o.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),o.jsxs("li",{children:["If the API isn't enabled yet, click ",o.jsx("strong",{children:"Enable"}),"."]}),o.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]}),Ese=()=>o.jsxs(Yn,{value:"looker-studio-details",children:[o.jsx(Wn,{children:"How do I connect to Looker Studio?"}),o.jsxs(Qn,{children:[o.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",o.jsx(hr,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),o.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),o.jsx(hr,{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"})]})]}),Rse=()=>o.jsxs(Yn,{value:"odata-details",children:[o.jsx(Wn,{children:"How do I use OData?"}),o.jsxs(Qn,{children:[o.jsx("p",{className:"mb-2",children:"OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs."}),o.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]}),Tse={[Mt.GOOGLE_SHEETS]:wse,[Mt.LOOKER_STUDIO]:Ese,[Mt.ODATA]:Rse};function jse({destinationType:e}){const t=Tse[e];return o.jsx(mr,{variant:"common",type:"single",collapsible:!0,children:o.jsx(t,{})})}function _se({form:e,initialData:t}){return o.jsx(Jt,{control:e.control,name:"type",render:({field:n})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Select the destination to send your data",children:"Destination Type"}),o.jsxs(Ca,{onValueChange:n.onChange,defaultValue:n.value,disabled:!!t,children:[o.jsx(nn,{children:o.jsx(Ea,{className:"w-full",children:o.jsx(wa,{placeholder:"Select a destination type"})})}),o.jsx(Ra,{children:o.jsx(Ig,{children:Ll.getAllTypes().map(({type:r,displayName:s,icon:l,status:c})=>{const d=c===ru.COMING_SOON;return o.jsx(Zn,{value:r,disabled:d,children:o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(l,{size:18}),s,d&&o.jsx(Cr,{variant:"secondary",children:c})]})},r)})})})]}),o.jsx(or,{children:o.jsx(jse,{destinationType:n.value})}),o.jsx(un,{})]})})}function Nse({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const s=qi({resolver:Jl(cZ),defaultValues:e??{title:"New Destination",type:Mt.GOOGLE_SHEETS},mode:"onTouched"}),l=s.watch("type");p.useEffect(()=>{r==null||r(s.formState.isDirty)},[s.formState.isDirty,r]);const c=async d=>{const{dirtyFields:f}=s.formState,m=vO(d);return f.credentials||delete m.credentials,t(m)};return o.jsx(Wl,{...s,children:o.jsxs(Zi,{onSubmit:d=>{s.handleSubmit(c)(d)},children:[o.jsxs(Ql,{children:[o.jsx(Jt,{control:s.control,name:"title",render:({field:d})=>o.jsxs(en,{children:[o.jsx(tn,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),o.jsx(nn,{children:o.jsx(Ht,{placeholder:"Enter title",...d})}),o.jsx(un,{})]})}),o.jsx(_se,{form:s,initialData:e}),l===Mt.GOOGLE_SHEETS&&o.jsx(bse,{form:s}),l===Mt.LOOKER_STUDIO&&o.jsx(Cse,{form:s})]}),o.jsxs(Xl,{children:[o.jsxs(be,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!s.formState.isDirty||s.formState.isSubmitting,children:[s.formState.isSubmitting&&o.jsx(Tf,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),o.jsx(be,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function Ase({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:s,createDataDestination:l}=Eg(),[c,d]=p.useState(!1),[f,m]=p.useState(!1),g=p.useCallback(()=>{f?d(!0):t()},[f,t]),v=p.useCallback(()=>{d(!1),m(!1),t()},[t]),x=p.useCallback(C=>{m(C)},[]),b=async C=>{const E=U4.getMapper(C.type);if(n){const R=E.mapToUpdateRequest(C),T=await s(n.id,R);T&&r(T)}else{const R=E.mapToCreateRequest(C),T=await l(R);T&&r(T)}t()},w=p.useRef(!1);return p.useEffect(()=>{const C=n?"Edit":"Create";e&&!w.current?(Ue({event:"data_destination_config_open",category:"DataDestination",action:C,label:n==null?void 0:n.type}),w.current=!0):!e&&w.current&&(Ue({event:"data_destination_config_close",category:"DataDestination",action:C,label:n==null?void 0:n.type}),w.current=!1)},[e,n]),o.jsxs(o.Fragment,{children:[o.jsx(Li,{open:e,onOpenChange:C=>{C||g()},children:o.jsxs(Pi,{children:[o.jsxs(Ui,{children:[o.jsx(Fi,{children:"Configure destination"}),o.jsx(Gl,{children:"Customize settings for your destination"})]}),o.jsx(Nse,{initialData:n??void 0,onSubmit:b,onCancel:g,onDirtyChange:x})]})}),o.jsx(na,{open:c,onOpenChange:d,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:v,variant:"destructive"})]})}const Dse=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:s,fetchDataDestinations:l,getDataDestinationById:c,deleteDataDestination:d,rotateSecretKey:f}=Eg(),m=p.useCallback(()=>{s(),v(!0),t==null||t()},[s,t]),[g,v]=p.useState(!1),[x,b]=p.useState(!1),[w,C]=p.useState(!1),[E,R]=p.useState(null),[T,_]=p.useState(null);p.useEffect(()=>{l()},[l]),p.useEffect(()=>{e&&m()},[e,m]);const O=async ae=>{await c(ae),v(!0)},A=ae=>{R(ae),b(!0)},D=ae=>{_(ae),C(!0)},j=async()=>{if(T)try{const ae=await f(T);if(OS(ae.credentials)){Ot.success("New JSON Config copied to clipboard");const F=b1(ae.credentials);navigator.clipboard.writeText(F)}await l()}catch(ae){console.error("Failed to rotate secret key:",ae)}finally{C(!1),_(null)}},M=async()=>{if(E)try{await d(E),await l()}catch(ae){console.error("Failed to delete destination:",ae)}finally{b(!1),R(null)}},z=async()=>{try{v(!1),await l()}catch(ae){console.error("Failed to save destination:",ae)}},Z=()=>{v(!1),s()},K=n.map(ae=>({id:ae.id,title:ae.title,type:ae.type,createdAt:ae.createdAt,modifiedAt:ae.modifiedAt,credentials:ae.credentials})),Y=yse({onEdit:O,onDelete:A,onRotateSecretKey:D});return o.jsxs("div",{children:[o.jsx(pse,{columns:Y,data:K,onEdit:O,onDelete:A,onRotateSecretKey:D,onOpenTypeDialog:m}),o.jsx(Ase,{isOpen:g,onClose:Z,dataDestination:r,onSaveSuccess:()=>void z()}),o.jsx(na,{open:x,onOpenChange:b,title:"Delete Destination",description:"Are you sure you want to delete this destination? This action cannot be undone.",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:()=>{M()},onCancel:()=>{R(null)},variant:"destructive"}),o.jsx(na,{open:w,onOpenChange:C,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void j(),onCancel:()=>{C(!1)},variant:"destructive",children:o.jsxs("div",{className:"text-sm",children:[o.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),o.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[o.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),o.jsx("li",{children:"Go to your Looker Studio Connector"}),o.jsx("li",{children:"Update the configuration with the new JSON Config"}),o.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),o.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},Ose=()=>{const[e,t]=p.useState(!1);return o.jsxs("div",{className:"dm-page",children:[o.jsx("header",{className:"dm-page-header",children:o.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),o.jsx("div",{className:"dm-page-content",children:o.jsx(wg,{children:o.jsx(Dse,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function Mse({status:e}){switch(e){case sr.RUNNING:return o.jsx(Cr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case sr.SUCCESS:return o.jsx(Cr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case sr.FAILED:return o.jsx(Cr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case sr.CANCELLED:return o.jsx(Cr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case sr.INTERRUPTED:return o.jsx(Cr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case sr.PENDING:return o.jsx(Cr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return o.jsx(Cr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var Ur=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))(Ur||{}),ns=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(ns||{});const Sj=(e,t,n=!1)=>{var c,d,f,m;const r=e.split(`
|
|
714
|
-
`).filter(g=>g.trim()!=="");if(r.length>=3){const g=r[0],v=r[1],x=r.slice(2).join(`
|
|
715
|
-
`);if(g.includes("T")&&g.includes("Z")){const b=i0(x);return{id:`log-${t.toString()}`,timestamp:Vc(g),level:n?Ur.ERROR:Ur.INFO,message:b.message,metadata:{at:(c=b.metadata)!=null&&c.at?Vc(b.metadata.at):Vc(g),type:((d=b.metadata)==null?void 0:d.type)??(v!=="unknown"?v:null)}}}}const s=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(s){const g=i0(s[3]);return{id:`log-${t.toString()}`,timestamp:Vc(s[1]),level:n?Ur.ERROR:s[2],message:g.message,metadata:(f=g.metadata)!=null&&f.at?{...g.metadata,at:Vc(g.metadata.at)}:g.metadata}}const l=i0(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?Ur.ERROR:Ur.INFO,message:l.message,metadata:(m=l.metadata)!=null&&m.at?{...l.metadata,at:Vc(l.metadata.at)}:l.metadata}},i0=e=>{try{const t=JSON.parse(e);if(typeof t=="object"){const n={},r={...t};"type"in r&&(n.type=r.type,delete r.type),"at"in r&&(n.at=r.at,delete r.at);const s=Object.keys(r);if(s.length===1){const l=s[0],c=r[l];return{message:typeof c=="string"?c:JSON.stringify(c),metadata:Object.keys(n).length>0?n:void 0}}return{message:JSON.stringify(r,null,2),metadata:Object.keys(n).length>0?n:void 0}}}catch{}return{message:e}},K5=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},kse=(e,t)=>{var d;const n=e.triggerType??"manual";let r="",s="";switch(e.type){case Cl.CONNECTOR:r=t??"",s="connector";break;case Cl.LOOKER_STUDIO:r="Looker Studio data fetching",s="report";break;case Cl.GOOGLE_SHEETS_EXPORT:r=((d=e.reportDefinition)==null?void 0:d.title)??"",s="report";break}return[ene(`${n} ${s} run`.trim()),r].join(" • ")},Ise=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)},Lse=e=>{const t=e.startedAt??e.createdAt;return SS(t.toISOString())},Pse=e=>{const t=Cj(e.startedAt),n=Cj(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=Xte(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},Cj=e=>e?SS(e.toISOString()):"N/A";function Use({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:s,cancelDataMartRun:l,dataMartId:c}){const d=g=>{g.stopPropagation()},f=async g=>{if(g.stopPropagation(),c)try{await l(c,s.id),on.success("Data mart run cancelled successfully")}catch(v){on.error(v instanceof Error?v.message:"Failed to cancel data mart run")}},m=g=>`px-3 py-2 text-sm font-medium transition-colors rounded-none ${g?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-accent"}`;return o.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ns.STRUCTURED)},className:`${m(e===ns.STRUCTURED)} rounded-l-lg`,children:"Structured"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ns.RAW)},className:`${m(e===ns.RAW)} rounded-none`,children:"Raw"}),o.jsx("button",{onClick:g=>{g.stopPropagation(),t(ns.CONFIGURATION)},className:`${m(e===ns.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==ns.CONFIGURATION&&o.jsxs("div",{className:"relative",children:[o.jsx(Hl,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),o.jsx(Ht,{type:"text",placeholder:"Search logs...",value:n,onChange:g=>{r(g.target.value)},onClick:d,className:"border-input bg-background text-foreground placeholder:text-muted-foreground focus:ring-ring rounded-md border py-2 pr-4 pl-8 text-xs focus:border-transparent focus:ring-2 focus:outline-none"})]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[s.status===sr.RUNNING&&o.jsxs(be,{variant:"destructive",size:"sm",onClick:g=>void f(g),children:[o.jsx(uu,{className:"h-4 w-4"}),"Cancel"]}),o.jsxs(be,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),Ise(s)},className:"flex items-center gap-2",children:[o.jsx(I9,{className:"h-4 w-4"}),"JSON"]})]})]})}function Fse(e){switch(e){case Ur.INFO:return o.jsx(Fr,{className:"h-3 w-3 text-blue-500"});case Ur.WARNING:return o.jsx(Wp,{className:"h-3 w-3 text-yellow-500"});case Ur.ERROR:return o.jsx(sp,{className:"h-3 w-3 text-red-500"});case Ur.SYSTEM:return o.jsx(Rf,{className:"text-muted-foreground h-3 w-3"});default:return o.jsx(Fr,{className:"text-muted-foreground h-3 w-3"})}}function zse(e){switch(e){case Ur.INFO:return"text-blue-600 dark:text-blue-400";case Ur.WARNING:return"text-yellow-600 dark:text-yellow-400";case Ur.ERROR:return"text-red-600 dark:text-red-400";case Ur.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function Vse(e){return e===b4.SCHEDULED?o.jsx(Ab,{size:18}):o.jsx(J9,{size:18})}function Hse({logs:e}){const t=r=>{r.stopPropagation()},n=r=>{var s;return(s=r.metadata)!=null&&s.at?r.metadata.at:r.timestamp};return e.length===0?o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No logs found"})}):o.jsx("div",{className:"bg-background border-border rounded-lg border",children:o.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,s)=>o.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-sm text-xs ${s===e.length-1?"border-b-0":""}`,onClick:t,children:[o.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),o.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[Fse(r.level),o.jsx("span",{className:`text-xs font-medium ${zse(r.level)}`,children:K5(r)})]}),o.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===Ur.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
|
|
716
|
-
`)?o.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):o.jsx("span",{children:r.message})})]},r.id))})})}var Vp=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Vp||{});function Hp({text:e,section:t,variant:n="default",copiedSection:r,onCopy:s,iconOnly:l=!1}){const c=n==="error",d=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 o.jsx("button",{onClick:g=>{s(e,t),g.stopPropagation()},className:`${f} ${m}`,title:`Copy ${t} to clipboard`,children:l?o.jsx(o.Fragment,{children:d?o.jsx(fr,{className:"h-3 w-3"}):o.jsx(of,{className:"h-3 w-3"})}):d?o.jsxs(o.Fragment,{children:[o.jsx(fr,{className:"h-3 w-3"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(of,{className:"h-3 w-3"}),"Copy"]})})}function MS(){const[e,t]=p.useState(null),n=async(s,l)=>{try{await navigator.clipboard.writeText(s),t(l),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(s,l)=>{n(s,l)}}}function $se({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=MS(),s=l=>{l.stopPropagation()};return o.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:s,children:[t.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[o.jsx(Rf,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),o.jsx(Hp,{text:t.join(`
|
|
717
|
-
`),section:"errors",variant:Vp.ERROR,copiedSection:n,onCopy:r})]}),o.jsx("div",{className:"max-h-96 overflow-y-auto rounded-md bg-red-50 p-3 font-mono text-xs dark:border-red-800 dark:bg-red-950/40",children:t.map((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:l},c))})]}),e.length>0&&o.jsxs("div",{children:[o.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[o.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[o.jsx(Fr,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),o.jsx(Hp,{text:e.join(`
|
|
718
|
-
`),section:"logs",variant:Vp.DEFAULT,copiedSection:n,onCopy:r})]}),o.jsx("div",{className:"bg-muted max-h-96 overflow-y-auto rounded-md p-3 font-mono text-xs dark:bg-white/3",children:e.map((l,c)=>o.jsx("div",{className:"mb-1 leading-relaxed",children:l},c))})]})]})}function Bse({definitionRun:e,reportDefinition:t}){const{copiedSection:n,handleCopy:r}=MS(),s=l=>{l.stopPropagation()};return o.jsx("div",{className:"border-border rounded-lg border",onClick:s,children:e!=null?o.jsxs("div",{className:"p-4",children:[o.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[o.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),o.jsx(Hp,{text:JSON.stringify(e,null,2),section:"configuration",variant:Vp.DEFAULT,copiedSection:n,onCopy:r})]}),o.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(e,null,2)}),t&&o.jsxs(o.Fragment,{children:[o.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Report definition:"}),o.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(t,null,2)})]})]}):o.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}const $d=18;function Gse({type:e,base64Icon:t}){switch(e){case Cl.CONNECTOR:return t?o.jsx(Nu,{base64:t,size:$d}):o.jsx(cu,{size:$d});case Cl.GOOGLE_SHEETS_EXPORT:{const n=Ll.getInfo(Mt.GOOGLE_SHEETS).icon;return o.jsx(n,{size:$d})}case Cl.LOOKER_STUDIO:{const n=Ll.getInfo(Mt.LOOKER_STUDIO).icon;return o.jsx(n,{size:$d})}default:return o.jsx(cu,{size:$d})}}function qse({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,cancelDataMartRun:d,dataMartId:f,dataMartConnectorInfo:m}){const{copiedSection:g,handleCopy:v}=MS(),x=p.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const E=e.logs.map((_,O)=>Sj(_,O)),R=e.errors.map((_,O)=>Sj(_,e.logs.length+O,!0));return[...E,...R].filter(_=>{const O=K5(_);return l===""||_.message.toLowerCase().includes(l.toLowerCase())||O.toLowerCase().includes(l.toLowerCase())})},[e.logs,e.errors,l]),b=p.useCallback(()=>r===ns.STRUCTURED?o.jsx(Hse,{logs:x}):r===ns.RAW?o.jsx($se,{logs:e.logs,errors:e.errors}):o.jsx(Bse,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition}),[r,x,e.logs,e.errors,e.definitionRun,e.reportDefinition]),w=Lse(e),C=Pse(e);return o.jsxs("div",{className:"dm-card-block",children:[o.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("div",{children:o.jsx(Gse,{type:e.type,base64Icon:m==null?void 0:m.logoBase64})}),o.jsxs(St,{children:[o.jsx(Ct,{asChild:!0,children:o.jsx("div",{className:"text-foreground align-center flex items-center font-mono text-sm font-medium",children:w})}),o.jsx(wt,{children:o.jsxs("div",{className:"space-y-1",children:[o.jsxs("div",{children:["Started At: ",C.startedAt]}),o.jsxs("div",{children:["Finished At: ",C.finishedAt]}),C.duration&&o.jsxs("div",{children:["Duration: ",C.duration]})]})})]}),o.jsxs("div",{className:"text-muted-foreground ml-6 flex items-center gap-1 text-sm",children:[Vse(e.triggerType),kse(e,m==null?void 0:m.displayName)]})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(Mse,{status:e.status}),o.jsx(Ta,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&o.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[o.jsxs("div",{className:"flex items-center",children:[o.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),o.jsx(Hp,{text:e.id,section:"run-id",onCopy:v,copiedSection:g,iconOnly:!0})]}),o.jsx(Use,{logViewType:r,setLogViewType:s,searchTerm:l,setSearchTerm:c,run:e,cancelDataMartRun:d,dataMartId:f}),b()]})]})}function Zse(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:s,runs:l=[],isLoading:c}=gs(),[d,f]=p.useState(!1),[m,g]=p.useState(!0),[v,x]=p.useState(0),[b,w]=p.useState(null),[C,E]=p.useState(ns.STRUCTURED),[R,T]=p.useState(""),_=p.useCallback(async()=>{if(!(t!=null&&t.id))return;const j=await n(t.id,20,0);x(j.length),g(j.length===20)},[t==null?void 0:t.id,n,20]),O=p.useCallback(async()=>{if(!(t!=null&&t.id)||d)return;f(!0);const j=await r(t.id,v,20);x(M=>M+j.length),g(j.length===20),f(!1)},[t==null?void 0:t.id,r,v,d,20]);p.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=p.useMemo(()=>(t==null?void 0:t.definitionType)===He.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),D=j=>{w(b===j?null:j)};return c?o.jsx(q5,{}):o.jsx("div",{className:"flex flex-col gap-4 pb-4",children:l.length===0?o.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):o.jsxs("div",{className:"space-y-2",children:[l.map(j=>o.jsx(qse,{run:j,isExpanded:b===j.id,onToggle:D,logViewType:C,setLogViewType:E,searchTerm:R,setSearchTerm:T,cancelDataMartRun:s,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:A},j.id)),m&&o.jsx("div",{className:"flex justify-center pt-4",children:o.jsx(su,{variant:"outline",size:"sm",onClick:()=>void O(),disabled:d,className:"flex items-center gap-2",children:d?o.jsxs(o.Fragment,{children:[o.jsx(AL,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const Kse=5e3,Yse=20;function Wse(){const{dataMart:e,getDataMartRuns:t}=Gi(),n=p.useMemo(()=>e!=null&&e.id?`data-mart-run-history-auto-refresh-${e.id}`:"",[e==null?void 0:e.id]),[r,s]=p.useState(()=>n?Ms.get(n,"boolean")??!1:!1);return p.useEffect(()=>{n&&Ms.set(n,r)},[r,n]),G5({enabled:!!(e!=null&&e.id)&&r,intervalMs:Kse,onTick:()=>{e!=null&&e.id&&t(e.id,Yse,0,{silent:!0})}}),o.jsx("div",{className:"flex flex-col gap-4",children:o.jsxs(jl,{collapsible:!1,name:"run-history",children:[o.jsxs(No,{children:[o.jsx(_o,{icon:tL,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"}),o.jsx(rh,{children:o.jsxs("div",{className:"flex items-center gap-2 pl-3",children:[o.jsx(F5,{id:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,checked:r,onCheckedChange:l=>{s(!!l)},"aria-label":"Auto refresh"}),o.jsx("label",{htmlFor:`run-history-auto-refresh-${(e==null?void 0:e.id)??"unknown"}`,className:"text-sm",children:"Auto refresh"})]})})]}),o.jsx(Ao,{children:o.jsx(Zse,{})})]})})}const Qse=[{path:"overview",element:o.jsx(bj,{})},{path:"data-setup",element:o.jsx(Cae,{})},{path:"reports",element:o.jsx(ase,{})},{path:"triggers",element:o.jsx(sse,{})},{path:"run-history",element:o.jsx(Wse,{})},{index:!0,element:o.jsx(bj,{})}];function Xse({to:e="/data-marts"}){const{user:t,status:n}=Vi();if(n===Or.LOADING)return o.jsx(nu,{fullScreen:!0,message:"Loading..."});if(n===Or.UNAUTHENTICATED||!t)return o.jsx(nu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=pp(t.projectId,e);return o.jsx(aI,{to:r,replace:!0})}return o.jsx(nu,{fullScreen:!0,message:"Project not found"})}const Jse=[{index:!0,path:"/",element:o.jsx(Xse,{})},{path:"/ui/:projectId",element:o.jsx(iq,{}),children:[{path:"about",element:o.jsx(lq,{})},{index:!0,element:o.jsx(ET,{})},{path:"data-marts",element:o.jsx(ET,{})},{path:"data-marts/create",element:o.jsx(ose,{})},{path:"data-marts/:id",element:o.jsx(pae,{}),children:Qse},{path:"data-storages",element:o.jsx(hse,{})},{path:"data-destinations",element:o.jsx(Ose,{})},{path:"*",element:o.jsx(yT,{})}]},{path:"*",element:o.jsx(yT,{})}],Y5="gtm-script",W5="gtm-noscript",eoe="GOOGLE_TAG_MANAGER_CONTAINER_ID";function toe(){return!!document.getElementById(Y5)}function noe(e){const t=document.createElement("script");return t.id=Y5,t.innerHTML=`
|
|
719
|
-
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
|
|
720
|
-
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
|
|
721
|
-
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
|
|
722
|
-
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
|
|
723
|
-
})(window,document,'script','dataLayer','${e}');
|
|
724
|
-
`,t}function roe(e){const t=document.createElement("noscript");return t.id=W5,t.innerHTML=`
|
|
725
|
-
<iframe src="https://www.googletagmanager.com/ns.html?id=${e}"
|
|
726
|
-
height="0"
|
|
727
|
-
width="0"
|
|
728
|
-
style="display:none;visibility:hidden">
|
|
729
|
-
</iframe>
|
|
730
|
-
`,t}function aoe(e){if(toe())return;const t=noe(e);document.head.prepend(t)}function soe(e){if(document.getElementById(W5))return;const t=roe(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function ooe(e){try{aoe(e),soe(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function ioe(e){return(e[eoe]??"").trim()}function loe(){const{flags:e,callState:t}=o1();return p.useEffect(()=>{if(t!==Mr.LOADED||!e)return;const n=ioe(e);n&&ooe(n)},[e,t]),null}const coe="INTERCOM_APP_ID",Q5="intercom-widget-script";function uoe(){return!!document.getElementById(Q5)}function doe(e,t){if(uoe()){t();return}const n=document.createElement("script");n.id=Q5,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function foe(){try{return(await pa.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function hoe(e,t){const n={app_id:e,user_id:t.id};return t.email&&(n.email=t.email),t.fullName&&(n.name=t.fullName),t.projectTitle&&(n.Name_project=t.projectTitle),n}async function moe(e,t){if(!t)return;const n=hoe(e,t),r=await foe();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(s){console.warn("Failed to boot Intercom",s)}}}function poe(){const{flags:e,callState:t}=o1(),{user:n}=Vi(),r=p.useRef(!1);return p.useEffect(()=>{if(r.current||t!==Mr.LOADED||!e)return;const s=e[coe],l=(typeof s=="string"?s:"").trim();l&&doe(l,()=>{moe(l,n).then(()=>{r.current=!0,lb()})})},[e,t,n]),null}function goe({initialState:e,reducer:t,children:n}){const[r,s]=p.useReducer(t,e),l=p.useMemo(()=>s,[s]);return o.jsx(SA.Provider,{value:r,children:o.jsx(CA.Provider,{value:l,children:n})})}function voe(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(s=>{const l=e[s],c=t[s],d=l(c,n);d!==c&&(r[s]=d)}),r}}const wj={id:null,title:null},X5="project/SET_PROJECT",yoe="project/CLEAR_PROJECT";function xoe(e){return{type:X5,payload:e}}function boe(e=wj,t){switch(t.type){case X5:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case yoe:return{...wj};default:return e}}class Soe extends Zl{getFlags(){return this.get("/flags")}}const Coe=new Soe(""),J5={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"},woe={data:{...J5},callState:Mr.IDLE},eM="settings/LOAD_FLAGS",tM="settings/LOAD_FLAGS_SUCCESS",nM="settings/LOAD_FLAGS_ERROR";function Eoe(){return{type:eM}}function Roe(e){return{type:tM,payload:e}}function Toe(e){return{type:nM,payload:e}}function joe(e=woe,t){switch(t.type){case eM:return{...e,callState:Mr.LOADING,error:void 0};case tM:return{...e,callState:Mr.LOADED,data:{...J5,...t.payload}};case nM:return{...e,callState:Mr.ERROR,error:t.payload};default:return e}}async function _oe(e){try{e(Eoe());const t=await Coe.getFlags();e(Roe(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Toe(n))}}const rM="app/SET_READY";function Noe(e={ready:!1},t){switch(t.type){case rM:return{...e,ready:!!t.payload};default:return e}}const Aoe=voe({project:boe,flags:joe,app:Noe});function Doe({children:e}){return o.jsx(goe,{reducer:Aoe,initialState:{project:{id:null,title:null},flags:{data:null,callState:Mr.IDLE},app:{ready:!1}},children:e})}function Ooe({children:e}){const t=HV(),{user:n,status:r}=Vi(),s=hp(f=>f.flags),l=s.callState,c=hp(f=>f.app.ready);p.useEffect(()=>{r===Or.AUTHENTICATED&&(n!=null&&n.projectId)&&(t(xoe({id:n.projectId,title:n.projectTitle??null})),l===Mr.IDLE&&_oe(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,l,t]),p.useEffect(()=>{const f=r===Or.AUTHENTICATED&&!!(n!=null&&n.projectId)&&l===Mr.LOADED;t({type:rM,payload:f})},[r,n==null?void 0:n.projectId,l,t]);const d=p.useMemo(()=>o.jsx(nu,{fullScreen:!0,message:"Loading application..."}),[]);return c?o.jsx(o.Fragment,{children:e}):l===Mr.ERROR?o.jsx(nu,{fullScreen:!0,message:`Failed to load app flags: ${s.error??""}`}):d}function Moe(){const e=NI(Jse);return o.jsx(k$,{children:o.jsx(Doe,{children:o.jsxs(Ooe,{children:[o.jsx(loe,{}),o.jsx(poe,{}),o.jsx(HI,{router:e})]})})})}const aM=document.getElementById("root");if(!aM)throw new Error("Root element not found");wk.createRoot(aM).render(o.jsx(p.StrictMode,{children:o.jsx(Moe,{})}));
|