@owox/web 0.13.0-next-20251126155223 → 0.13.0-next-20251127103230

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.
Files changed (97) hide show
  1. package/dist/assets/abap-DLDM7-KI.js +1 -0
  2. package/dist/assets/apex-DNDY2TF8.js +1 -0
  3. package/dist/assets/azcli-Y6nb8tq_.js +1 -0
  4. package/dist/assets/bat-BwHxbl9M.js +1 -0
  5. package/dist/assets/bicep-CFznDFnq.js +2 -0
  6. package/dist/assets/cameligo-Bf6VGUru.js +1 -0
  7. package/dist/assets/clojure-Dnu-v4kV.js +1 -0
  8. package/dist/assets/codicon-ngg6Pgfi.ttf +0 -0
  9. package/dist/assets/coffee-Bd8akH9Z.js +1 -0
  10. package/dist/assets/cpp-BbWJElDN.js +1 -0
  11. package/dist/assets/csharp-Co3qMtFm.js +1 -0
  12. package/dist/assets/csp-D-4FJmMZ.js +1 -0
  13. package/dist/assets/css-DdJfP1eB.js +3 -0
  14. package/dist/assets/css.worker-B4z49cGk.js +93 -0
  15. package/dist/assets/cssMode-DMWw2mWl.js +1 -0
  16. package/dist/assets/cypher-cTPe9QuQ.js +1 -0
  17. package/dist/assets/dart-BOtBlQCF.js +1 -0
  18. package/dist/assets/dockerfile-BG73LgW2.js +1 -0
  19. package/dist/assets/ecl-BEgZUVRK.js +1 -0
  20. package/dist/assets/elixir-BkW5O-1t.js +1 -0
  21. package/dist/assets/flow9-BeJ5waoc.js +1 -0
  22. package/dist/assets/freemarker2-BMnLSs0U.js +3 -0
  23. package/dist/assets/fsharp-PahG7c26.js +1 -0
  24. package/dist/assets/go-acbASCJo.js +1 -0
  25. package/dist/assets/graphql-BxJiqAUM.js +1 -0
  26. package/dist/assets/handlebars-CNM60ynw.js +1 -0
  27. package/dist/assets/hcl-DtV1sZF8.js +1 -0
  28. package/dist/assets/html-97JU94Cq.js +1 -0
  29. package/dist/assets/html.worker-DtiGdgqp.js +470 -0
  30. package/dist/assets/htmlMode-CsVIsZTH.js +1 -0
  31. package/dist/assets/index-BTtfu2aX.js +1662 -0
  32. package/dist/assets/index-CsaFu3rQ.css +1 -0
  33. package/dist/assets/ini-Kd9XrMLS.js +1 -0
  34. package/dist/assets/java-CXBNlu9o.js +1 -0
  35. package/dist/assets/javascript-CZOCBGd9.js +1 -0
  36. package/dist/assets/json.worker-leyajbqV.js +58 -0
  37. package/dist/assets/jsonMode-DdxXG8Yt.js +7 -0
  38. package/dist/assets/julia-cl7-CwDS.js +1 -0
  39. package/dist/assets/kotlin-s7OhZKlX.js +1 -0
  40. package/dist/assets/less-9HpZscsL.js +2 -0
  41. package/dist/assets/lexon-OrD6JF1K.js +1 -0
  42. package/dist/assets/liquid-BLzwTqL_.js +1 -0
  43. package/dist/assets/lspLanguageFeatures-_7DvxShE.js +4 -0
  44. package/dist/assets/lua-Cyyb5UIc.js +1 -0
  45. package/dist/assets/m3-B8OfTtLu.js +1 -0
  46. package/dist/assets/markdown-BFxVWTOG.js +1 -0
  47. package/dist/assets/mdx-Cy-12lbx.js +1 -0
  48. package/dist/assets/mips-CiqrrVzr.js +1 -0
  49. package/dist/assets/msdax-DmeGPVcC.js +1 -0
  50. package/dist/assets/mysql-C_tMU-Nz.js +1 -0
  51. package/dist/assets/objective-c-BDtDVThU.js +1 -0
  52. package/dist/assets/pascal-vHIfCaH5.js +1 -0
  53. package/dist/assets/pascaligo-DtZ0uQbO.js +1 -0
  54. package/dist/assets/perl-Ub6l9XKa.js +1 -0
  55. package/dist/assets/pgsql-BlNEE0v7.js +1 -0
  56. package/dist/assets/php-BBUBE1dy.js +1 -0
  57. package/dist/assets/pla-DSh2-awV.js +1 -0
  58. package/dist/assets/postiats-CocnycG-.js +1 -0
  59. package/dist/assets/powerquery-tScXyioY.js +1 -0
  60. package/dist/assets/powershell-COWaemsV.js +1 -0
  61. package/dist/assets/protobuf-Brw8urJB.js +2 -0
  62. package/dist/assets/pug-8SOpv6rk.js +1 -0
  63. package/dist/assets/python-CJkoBeiD.js +1 -0
  64. package/dist/assets/qsharp-Bw9ernYp.js +1 -0
  65. package/dist/assets/r-j7ic8hl3.js +1 -0
  66. package/dist/assets/razor-BVD0RRVU.js +1 -0
  67. package/dist/assets/redis-Bu5POkcn.js +1 -0
  68. package/dist/assets/redshift-Bs9aos_-.js +1 -0
  69. package/dist/assets/restructuredtext-CqXO7rUv.js +1 -0
  70. package/dist/assets/ruby-zBfavPgS.js +1 -0
  71. package/dist/assets/rust-BzKRNQWT.js +1 -0
  72. package/dist/assets/sb-BBc9UKZt.js +1 -0
  73. package/dist/assets/scala-D9hQfWCl.js +1 -0
  74. package/dist/assets/scheme-BPhDTwHR.js +1 -0
  75. package/dist/assets/scss-CBJaRo0y.js +3 -0
  76. package/dist/assets/shell-DiJ1NA_G.js +1 -0
  77. package/dist/assets/solidity-Db0IVjzk.js +1 -0
  78. package/dist/assets/sophia-CnS9iZB_.js +1 -0
  79. package/dist/assets/sparql-CJmd_6j2.js +1 -0
  80. package/dist/assets/sql-ClhHkBeG.js +1 -0
  81. package/dist/assets/st-CHwy0fLd.js +1 -0
  82. package/dist/assets/swift-Bqt4WxQ4.js +3 -0
  83. package/dist/assets/systemverilog-Bs9z6M-B.js +1 -0
  84. package/dist/assets/tcl-Dm6ycUr_.js +1 -0
  85. package/dist/assets/ts.worker-59MjiAqk.js +67731 -0
  86. package/dist/assets/tsMode-CeE1BjP5.js +11 -0
  87. package/dist/assets/twig-Csy3S7wG.js +1 -0
  88. package/dist/assets/typescript-xLZS7_A5.js +1 -0
  89. package/dist/assets/typespec-Btyra-wh.js +1 -0
  90. package/dist/assets/vb-Db0cS2oM.js +1 -0
  91. package/dist/assets/wgsl-BTesnYfV.js +298 -0
  92. package/dist/assets/xml-DAxXVCzV.js +1 -0
  93. package/dist/assets/yaml-3emzF-wo.js +1 -0
  94. package/dist/index.html +2 -2
  95. package/package.json +1 -1
  96. package/dist/assets/index-CCi26ud_.js +0 -730
  97. package/dist/assets/index-Znd03oc7.css +0 -1
@@ -1,730 +0,0 @@
1
- var $M=Object.defineProperty;var BM=(e,t,n)=>t in e?$M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ls=(e,t,n)=>BM(e,typeof t!="symbol"?t+"":t,n);function GM(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)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(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function ZT(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hx={exports:{}},Id={};/**
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 kw;function qM(){if(kw)return Id;kw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:l}}return Id.Fragment=t,Id.jsx=n,Id.jsxs=n,Id}var Lw;function ZM(){return Lw||(Lw=1,hx.exports=qM()),hx.exports}var a=ZM(),mx={exports:{}},ft={};/**
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 Pw;function KM(){if(Pw)return ft;Pw=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=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"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=v&&L[v]||L["@@iterator"],typeof L=="function"?L:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,C={};function R(L,P,W){this.props=L,this.context=P,this.refs=C,this.updater=W||E}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 j(){}j.prototype=R.prototype;function _(L,P,W){this.props=L,this.context=P,this.refs=C,this.updater=W||E}var D=_.prototype=new j;D.constructor=_,S(D,R.prototype),D.isPureReactComponent=!0;var A=Array.isArray;function O(){}var T={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function V(L,P,W){var te=W.ref;return{$$typeof:e,type:L,key:P,ref:te!==void 0?te:null,props:W}}function Z(L,P){return V(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 G=/\/+/g;function U(L,P){return typeof L=="object"&&L!==null&&L.key!=null?Y(""+L.key):P.toString(36)}function H(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(O,O):(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 k(L,P,W,te,ue){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,k(le(L._payload),P,W,te,ue)}}if(le)return ue=ue(L),le=te===""?"."+U(L,0):te,A(ue)?(W="",le!=null&&(W=le.replace(G,"$&/")+"/"),k(ue,P,W,"",function(Ne){return Ne})):ue!=null&&(K(ue)&&(ue=Z(ue,W+(ue.key==null||L&&L.key===ue.key?"":(""+ue.key).replace(G,"$&/")+"/")+le)),P.push(ue)),1;le=0;var Ae=te===""?".":te+":";if(A(L))for(var we=0;we<L.length;we++)te=L[we],ve=Ae+U(te,we),le+=k(te,P,W,ve,ue);else if(we=b(L),typeof we=="function")for(L=we.call(L),we=0;!(te=L.next()).done;)te=te.value,ve=Ae+U(te,we++),le+=k(te,P,W,ve,ue);else if(ve==="object"){if(typeof L.then=="function")return k(H(L),P,W,te,ue);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 $(L,P,W){if(L==null)return L;var te=[],ue=0;return k(L,te,"","",function(ve){return P.call(W,ve,ue++)}),te}function q(L){if(L._status===-1){var P=L._result;P=P(),P.then(function(W){(L._status===0||L._status===-1)&&(L._status=1,L._result=W)},function(W){(L._status===0||L._status===-1)&&(L._status=2,L._result=W)}),L._status===-1&&(L._status=0,L._result=P)}if(L._status===1)return L._result.default;throw L._result}var ie=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},be={map:$,forEach:function(L,P,W){$(L,function(){P.apply(this,arguments)},W)},count:function(L){var P=0;return $(L,function(){P++}),P},toArray:function(L){return $(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 ft.Activity=y,ft.Children=be,ft.Component=R,ft.Fragment=n,ft.Profiler=o,ft.PureComponent=_,ft.StrictMode=r,ft.Suspense=f,ft.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,ft.__COMPILER_RUNTIME={__proto__:null,c:function(L){return T.H.useMemoCache(L)}},ft.cache=function(L){return function(){return L.apply(null,arguments)}},ft.cacheSignal=function(){return null},ft.cloneElement=function(L,P,W){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var te=S({},L.props),ue=L.key;if(P!=null)for(ve in P.key!==void 0&&(ue=""+P.key),P)!M.call(P,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&P.ref===void 0||(te[ve]=P[ve]);var ve=arguments.length-2;if(ve===1)te.children=W;else if(1<ve){for(var le=Array(ve),Ae=0;Ae<ve;Ae++)le[Ae]=arguments[Ae+2];te.children=le}return V(L.type,ue,te)},ft.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},ft.createElement=function(L,P,W){var te,ue={},ve=null;if(P!=null)for(te in P.key!==void 0&&(ve=""+P.key),P)M.call(P,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=P[te]);var le=arguments.length-2;if(le===1)ue.children=W;else if(1<le){for(var Ae=Array(le),we=0;we<le;we++)Ae[we]=arguments[we+2];ue.children=Ae}if(L&&L.defaultProps)for(te in le=L.defaultProps,le)ue[te]===void 0&&(ue[te]=le[te]);return V(L,ve,ue)},ft.createRef=function(){return{current:null}},ft.forwardRef=function(L){return{$$typeof:d,render:L}},ft.isValidElement=K,ft.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:q}},ft.memo=function(L,P){return{$$typeof:h,type:L,compare:P===void 0?null:P}},ft.startTransition=function(L){var P=T.T,W={};T.T=W;try{var te=L(),ue=T.S;ue!==null&&ue(W,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(O,ie)}catch(ve){ie(ve)}finally{P!==null&&W.types!==null&&(P.types=W.types),T.T=P}},ft.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},ft.use=function(L){return T.H.use(L)},ft.useActionState=function(L,P,W){return T.H.useActionState(L,P,W)},ft.useCallback=function(L,P){return T.H.useCallback(L,P)},ft.useContext=function(L){return T.H.useContext(L)},ft.useDebugValue=function(){},ft.useDeferredValue=function(L,P){return T.H.useDeferredValue(L,P)},ft.useEffect=function(L,P){return T.H.useEffect(L,P)},ft.useEffectEvent=function(L){return T.H.useEffectEvent(L)},ft.useId=function(){return T.H.useId()},ft.useImperativeHandle=function(L,P,W){return T.H.useImperativeHandle(L,P,W)},ft.useInsertionEffect=function(L,P){return T.H.useInsertionEffect(L,P)},ft.useLayoutEffect=function(L,P){return T.H.useLayoutEffect(L,P)},ft.useMemo=function(L,P){return T.H.useMemo(L,P)},ft.useOptimistic=function(L,P){return T.H.useOptimistic(L,P)},ft.useReducer=function(L,P,W){return T.H.useReducer(L,P,W)},ft.useRef=function(L){return T.H.useRef(L)},ft.useState=function(L){return T.H.useState(L)},ft.useSyncExternalStore=function(L,P,W){return T.H.useSyncExternalStore(L,P,W)},ft.useTransition=function(){return T.H.useTransition()},ft.version="19.2.0",ft}var Uw;function N1(){return Uw||(Uw=1,mx.exports=KM()),mx.exports}var m=N1();const ye=ZT(m),A1=GM({__proto__:null,default:ye},[m]);var px={exports:{}},kd={},gx={exports:{}},yx={};/**
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 Fw;function YM(){return Fw||(Fw=1,(function(e){function t(k,$){var q=k.length;k.push($);e:for(;0<q;){var ie=q-1>>>1,be=k[ie];if(0<o(be,$))k[ie]=$,k[q]=be,q=ie;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var $=k[0],q=k.pop();if(q!==$){k[0]=q;e:for(var ie=0,be=k.length,L=be>>>1;ie<L;){var P=2*(ie+1)-1,W=k[P],te=P+1,ue=k[te];if(0>o(W,q))te<be&&0>o(ue,W)?(k[ie]=ue,k[te]=q,ie=te):(k[ie]=W,k[P]=q,ie=P);else if(te<be&&0>o(ue,q))k[ie]=ue,k[te]=q,ie=te;else break e}}return $}function o(k,$){var q=k.sortIndex-$.sortIndex;return q!==0?q:k.id-$.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=[],h=[],g=1,y=null,v=3,b=!1,E=!1,S=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function D(k){for(var $=n(h);$!==null;){if($.callback===null)r(h);else if($.startTime<=k)r(h),$.sortIndex=$.expirationTime,t(f,$);else break;$=n(h)}}function A(k){if(S=!1,D(k),!E)if(n(f)!==null)E=!0,O||(O=!0,Y());else{var $=n(h);$!==null&&H(A,$.startTime-k)}}var O=!1,T=-1,M=5,V=-1;function Z(){return C?!0:!(e.unstable_now()-V<M)}function K(){if(C=!1,O){var k=e.unstable_now();V=k;var $=!0;try{e:{E=!1,S&&(S=!1,j(T),T=-1),b=!0;var q=v;try{t:{for(D(k),y=n(f);y!==null&&!(y.expirationTime>k&&Z());){var ie=y.callback;if(typeof ie=="function"){y.callback=null,v=y.priorityLevel;var be=ie(y.expirationTime<=k);if(k=e.unstable_now(),typeof be=="function"){y.callback=be,D(k),$=!0;break t}y===n(f)&&r(f),D(k)}else r(f);y=n(f)}if(y!==null)$=!0;else{var L=n(h);L!==null&&H(A,L.startTime-k),$=!1}}break e}finally{y=null,v=q,b=!1}$=void 0}}finally{$?Y():O=!1}}}var Y;if(typeof _=="function")Y=function(){_(K)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,U=G.port2;G.port1.onmessage=K,Y=function(){U.postMessage(null)}}else Y=function(){R(K,0)};function H(k,$){T=R(function(){k(e.unstable_now())},$)}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(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(k){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var q=v;v=$;try{return k()}finally{v=q}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var q=v;v=k;try{return $()}finally{v=q}},e.unstable_scheduleCallback=function(k,$,q){var ie=e.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?ie+q:ie):q=ie,k){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=q+be,k={id:g++,callback:$,priorityLevel:k,startTime:q,expirationTime:be,sortIndex:-1},q>ie?(k.sortIndex=q,t(h,k),n(f)===null&&k===n(h)&&(S?(j(T),T=-1):S=!0,H(A,q-ie))):(k.sortIndex=be,t(f,k),E||b||(E=!0,O||(O=!0,Y()))),k},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(k){var $=v;return function(){var q=v;v=$;try{return k.apply(this,arguments)}finally{v=q}}}})(yx)),yx}var Vw;function WM(){return Vw||(Vw=1,gx.exports=YM()),gx.exports}var vx={exports:{}},Dr={};/**
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 zw;function QM(){if(zw)return Dr;zw=1;var e=N1();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" 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},o=Symbol.for("react.portal");function l(f,h,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:y==null?null:""+y,children:f,containerInfo:h,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Dr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dr.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return l(f,h,null,g)},Dr.flushSync=function(f){var h=c.T,g=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=h,r.p=g,r.d.f()}},Dr.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Dr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Dr.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,y=d(g,h.crossOrigin),v=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:v,fetchPriority:b}):g==="script"&&r.d.X(f,{crossOrigin:y,integrity:v,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Dr.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Dr.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,y=d(g,h.crossOrigin);r.d.L(f,g,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Dr.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Dr.requestFormReset=function(f){r.d.r(f)},Dr.unstable_batchedUpdates=function(f,h){return f(h)},Dr.useFormState=function(f,h,g){return c.H.useFormState(f,h,g)},Dr.useFormStatus=function(){return c.H.useHostTransitionStatus()},Dr.version="19.2.0",Dr}var Hw;function KT(){if(Hw)return vx.exports;Hw=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(),vx.exports=QM(),vx.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 $w;function XM(){if($w)return kd;$w=1;var e=WM(),t=N1(),n=KT();function r(s){var i="https://react.dev/errors/"+s;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 #"+s+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function l(s){var i=s,u=s;if(s.alternate)for(;i.return;)i=i.return;else{s=i;do i=s,(i.flags&4098)!==0&&(u=i.return),s=i.return;while(s)}return i.tag===3?u:null}function c(s){if(s.tag===13){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function d(s){if(s.tag===31){var i=s.memoizedState;if(i===null&&(s=s.alternate,s!==null&&(i=s.memoizedState)),i!==null)return i.dehydrated}return null}function f(s){if(l(s)!==s)throw Error(r(188))}function h(s){var i=s.alternate;if(!i){if(i=l(s),i===null)throw Error(r(188));return i!==s?null:s}for(var u=s,p=i;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(p=x.return,p!==null){u=p;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return f(x),s;if(w===p)return f(x),i;w=w.sibling}throw Error(r(188))}if(u.return!==p.return)u=x,p=w;else{for(var N=!1,I=x.child;I;){if(I===u){N=!0,u=x,p=w;break}if(I===p){N=!0,p=x,u=w;break}I=I.sibling}if(!N){for(I=w.child;I;){if(I===u){N=!0,u=w,p=x;break}if(I===p){N=!0,p=w,u=x;break}I=I.sibling}if(!N)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?s:i}function g(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s;for(s=s.child;s!==null;){if(i=g(s),i!==null)return i;s=s.sibling}return null}var y=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),_=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function Y(s){return s===null||typeof s!="object"?null:(s=K&&s[K]||s["@@iterator"],typeof s=="function"?s:null)}var G=Symbol.for("react.client.reference");function U(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===G?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case S:return"Fragment";case R:return"Profiler";case C:return"StrictMode";case A:return"Suspense";case O:return"SuspenseList";case V:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case E:return"Portal";case _:return s.displayName||"Context";case j:return(s._context.displayName||"Context")+".Consumer";case D:var i=s.render;return s=s.displayName,s||(s=i.displayName||i.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case T:return i=s.displayName||null,i!==null?i:U(s.type)||"Memo";case M:i=s._payload,s=s._init;try{return U(s(i))}catch{}}return null}var H=Array.isArray,k=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},ie=[],be=-1;function L(s){return{current:s}}function P(s){0>be||(s.current=ie[be],ie[be]=null,be--)}function W(s,i){be++,ie[be]=s.current,s.current=i}var te=L(null),ue=L(null),ve=L(null),le=L(null);function Ae(s,i){switch(W(ve,i),W(ue,s),W(te,null),i.nodeType){case 9:case 11:s=(s=i.documentElement)&&(s=s.namespaceURI)?aw(s):0;break;default:if(s=i.tagName,i=i.namespaceURI)i=aw(i),s=sw(i,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}P(te),W(te,s)}function we(){P(te),P(ue),P(ve)}function Ne(s){s.memoizedState!==null&&W(le,s);var i=te.current,u=sw(i,s.type);i!==u&&(W(ue,s),W(te,u))}function Be(s){ue.current===s&&(P(te),P(ue)),le.current===s&&(P(le),Ad._currentValue=q)}var Qe,qt;function Dt(s){if(Qe===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Qe=i&&i[1]||"",qt=-1<u.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+Qe+s+qt}var Zt=!1;function jn(s,i){if(!s||Zt)return"";Zt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={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(fe){var oe=fe}Reflect.construct(s,[],pe)}else{try{pe.call()}catch(fe){oe=fe}s.call(pe.prototype)}}else{try{throw Error()}catch(fe){oe=fe}(pe=s())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(fe){if(fe&&oe&&typeof fe.stack=="string")return[fe.stack,oe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),N=w[0],I=w[1];if(N&&I){var B=N.split(`
44
- `),ae=I.split(`
45
- `);for(x=p=0;p<B.length&&!B[p].includes("DetermineComponentFrameRoot");)p++;for(;x<ae.length&&!ae[x].includes("DetermineComponentFrameRoot");)x++;if(p===B.length||x===ae.length)for(p=B.length-1,x=ae.length-1;1<=p&&0<=x&&B[p]!==ae[x];)x--;for(;1<=p&&0<=x;p--,x--)if(B[p]!==ae[x]){if(p!==1||x!==1)do if(p--,x--,0>x||B[p]!==ae[x]){var he=`
46
- `+B[p].replace(" at new "," at ");return s.displayName&&he.includes("<anonymous>")&&(he=he.replace("<anonymous>",s.displayName)),he}while(1<=p&&0<=x);break}}}finally{Zt=!1,Error.prepareStackTrace=u}return(u=s?s.displayName||s.name:"")?Dt(u):""}function Nr(s,i){switch(s.tag){case 26:case 27:case 5:return Dt(s.type);case 16:return Dt("Lazy");case 13:return s.child!==i&&i!==null?Dt("Suspense Fallback"):Dt("Suspense");case 19:return Dt("SuspenseList");case 0:case 15:return jn(s.type,!1);case 11:return jn(s.type.render,!1);case 1:return jn(s.type,!0);case 31:return Dt("Activity");default:return""}}function va(s){try{var i="",u=null;do i+=Nr(s,u),u=s,s=s.return;while(s);return i}catch(p){return`
47
- Error generating stack: `+p.message+`
48
- `+p.stack}}var Ve=Object.prototype.hasOwnProperty,F=e.unstable_scheduleCallback,X=e.unstable_cancelCallback,de=e.unstable_shouldYield,_e=e.unstable_requestPaint,Se=e.unstable_now,Ee=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,ot=e.unstable_UserBlockingPriority,it=e.unstable_NormalPriority,xn=e.unstable_LowPriority,Ua=e.unstable_IdlePriority,bn=e.log,Jo=e.unstable_setDisableYieldValue,Fn=null,Tn=null;function vr(s){if(typeof bn=="function"&&Jo(s),Tn&&typeof Tn.setStrictMode=="function")try{Tn.setStrictMode(Fn,s)}catch{}}var _n=Math.clz32?Math.clz32:ei,ul=Math.log,Ns=Math.LN2;function ei(s){return s>>>=0,s===0?32:31-(ul(s)/Ns|0)|0}var to=256,As=262144,Sn=4194304;function pn(s){var i=s&42;if(i!==0)return i;switch(s&-s){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 s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Gn(s,i,u){var p=s.pendingLanes;if(p===0)return 0;var x=0,w=s.suspendedLanes,N=s.pingedLanes;s=s.warmLanes;var I=p&134217727;return I!==0?(p=I&~w,p!==0?x=pn(p):(N&=I,N!==0?x=pn(N):u||(u=I&~s,u!==0&&(x=pn(u))))):(I=p&~w,I!==0?x=pn(I):N!==0?x=pn(N):u||(u=p&~s,u!==0&&(x=pn(u)))),x===0?0:i!==0&&i!==x&&(i&w)===0&&(w=x&-x,u=i&-i,w>=u||w===32&&(u&4194048)!==0)?i:x}function xr(s,i){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&i)===0}function er(s,i){switch(s){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 Vn(){var s=Sn;return Sn<<=1,(Sn&62914560)===0&&(Sn=4194304),s}function Ar(s){for(var i=[],u=0;31>u;u++)i.push(s);return i}function Xr(s,i){s.pendingLanes|=i,i!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function z(s,i,u,p,x,w){var N=s.pendingLanes;s.pendingLanes=u,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=u,s.entangledLanes&=u,s.errorRecoveryDisabledLanes&=u,s.shellSuspendCounter=0;var I=s.entanglements,B=s.expirationTimes,ae=s.hiddenUpdates;for(u=N&~u;0<u;){var he=31-_n(u),pe=1<<he;I[he]=0,B[he]=-1;var oe=ae[he];if(oe!==null)for(ae[he]=null,he=0;he<oe.length;he++){var fe=oe[he];fe!==null&&(fe.lane&=-536870913)}u&=~pe}p!==0&&J(s,p,0),w!==0&&x===0&&s.tag!==0&&(s.suspendedLanes|=w&~(N&~i))}function J(s,i,u){s.pendingLanes|=i,s.suspendedLanes&=~i;var p=31-_n(i);s.entangledLanes|=i,s.entanglements[p]=s.entanglements[p]|1073741824|u&261930}function se(s,i){var u=s.entangledLanes|=i;for(s=s.entanglements;u;){var p=31-_n(u),x=1<<p;x&i|s[p]&i&&(s[p]|=i),u&=~x}}function ge(s,i){var u=i&-i;return u=(u&42)!==0?1:Re(u),(u&(s.suspendedLanes|i))!==0?0:u}function Re(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=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:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function ze(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Le(){var s=$.p;return s!==0?s:(s=window.event,s===void 0?32:_w(s.type))}function Ie(s,i){var u=$.p;try{return $.p=s,i()}finally{$.p=u}}var Pe=Math.random().toString(36).slice(2),He="__reactFiber$"+Pe,qe="__reactProps$"+Pe,Ze="__reactContainer$"+Pe,ut="__reactEvents$"+Pe,en="__reactListeners$"+Pe,qn="__reactHandles$"+Pe,hr="__reactResources$"+Pe,Kt="__reactMarker$"+Pe;function Yt(s){delete s[He],delete s[qe],delete s[ut],delete s[en],delete s[qn]}function Jr(s){var i=s[He];if(i)return i;for(var u=s.parentNode;u;){if(i=u[Ze]||u[He]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(s=fw(s);s!==null;){if(u=s[He])return u;s=fw(s)}return i}s=u,u=s.parentNode}return null}function Fa(s){if(s=s[He]||s[Ze]){var i=s.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return s}return null}function ea(s){var i=s.tag;if(i===5||i===26||i===27||i===6)return s.stateNode;throw Error(r(33))}function br(s){var i=s[hr];return i||(i=s[hr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Nn(s){s[Kt]=!0}var ti=new Set,Ds={};function Va(s,i){ss(s,i),ss(s+"Capture",i)}function ss(s,i){for(Ds[s]=i,s=0;s<i.length;s++)ti.add(i[s])}var Ot=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]*$"),tr={},no={};function ro(s){return Ve.call(no,s)?!0:Ve.call(tr,s)?!1:Ot.test(s)?no[s]=!0:(tr[s]=!0,!1)}function gn(s,i,u){if(ro(i))if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":s.removeAttribute(i);return;case"boolean":var p=i.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){s.removeAttribute(i);return}}s.setAttribute(i,""+u)}}function ao(s,i,u){if(u===null)s.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(i);return}s.setAttribute(i,""+u)}}function za(s,i,u,p){if(p===null)s.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(u);return}s.setAttributeNS(i,u,""+p)}}function ta(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function WS(s){var i=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function L6(s,i,u){var p=Object.getOwnPropertyDescriptor(s.constructor.prototype,i);if(!s.hasOwnProperty(i)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var x=p.get,w=p.set;return Object.defineProperty(s,i,{configurable:!0,get:function(){return x.call(this)},set:function(N){u=""+N,w.call(this,N)}}),Object.defineProperty(s,i,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(N){u=""+N},stopTracking:function(){s._valueTracker=null,delete s[i]}}}}function oy(s){if(!s._valueTracker){var i=WS(s)?"checked":"value";s._valueTracker=L6(s,i,""+s[i])}}function QS(s){if(!s)return!1;var i=s._valueTracker;if(!i)return!0;var u=i.getValue(),p="";return s&&(p=WS(s)?s.checked?"true":"false":s.value),s=p,s!==u?(i.setValue(s),!0):!1}function lh(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var P6=/[\n"\\]/g;function Ha(s){return s.replace(P6,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function iy(s,i,u,p,x,w,N,I){s.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?s.type=N:s.removeAttribute("type"),i!=null?N==="number"?(i===0&&s.value===""||s.value!=i)&&(s.value=""+ta(i)):s.value!==""+ta(i)&&(s.value=""+ta(i)):N!=="submit"&&N!=="reset"||s.removeAttribute("value"),i!=null?ly(s,N,ta(i)):u!=null?ly(s,N,ta(u)):p!=null&&s.removeAttribute("value"),x==null&&w!=null&&(s.defaultChecked=!!w),x!=null&&(s.checked=x&&typeof x!="function"&&typeof x!="symbol"),I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?s.name=""+ta(I):s.removeAttribute("name")}function XS(s,i,u,p,x,w,N,I){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(s.type=w),i!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||i!=null)){oy(s);return}u=u!=null?""+ta(u):"",i=i!=null?""+ta(i):u,I||i===s.value||(s.value=i),s.defaultValue=i}p=p??x,p=typeof p!="function"&&typeof p!="symbol"&&!!p,s.checked=I?s.checked:!!p,s.defaultChecked=!!p,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(s.name=N),oy(s)}function ly(s,i,u){i==="number"&&lh(s.ownerDocument)===s||s.defaultValue===""+u||(s.defaultValue=""+u)}function fc(s,i,u,p){if(s=s.options,i){i={};for(var x=0;x<u.length;x++)i["$"+u[x]]=!0;for(u=0;u<s.length;u++)x=i.hasOwnProperty("$"+s[u].value),s[u].selected!==x&&(s[u].selected=x),x&&p&&(s[u].defaultSelected=!0)}else{for(u=""+ta(u),i=null,x=0;x<s.length;x++){if(s[x].value===u){s[x].selected=!0,p&&(s[x].defaultSelected=!0);return}i!==null||s[x].disabled||(i=s[x])}i!==null&&(i.selected=!0)}}function JS(s,i,u){if(i!=null&&(i=""+ta(i),i!==s.value&&(s.value=i),u==null)){s.defaultValue!==i&&(s.defaultValue=i);return}s.defaultValue=u!=null?""+ta(u):""}function eC(s,i,u,p){if(i==null){if(p!=null){if(u!=null)throw Error(r(92));if(H(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),i=u}u=ta(i),s.defaultValue=u,p=s.textContent,p===u&&p!==""&&p!==null&&(s.value=p),oy(s)}function hc(s,i){if(i){var u=s.firstChild;if(u&&u===s.lastChild&&u.nodeType===3){u.nodeValue=i;return}}s.textContent=i}var U6=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 tC(s,i,u){var p=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?s.setProperty(i,""):i==="float"?s.cssFloat="":s[i]="":p?s.setProperty(i,u):typeof u!="number"||u===0||U6.has(i)?i==="float"?s.cssFloat=u:s[i]=(""+u).trim():s[i]=u+"px"}function nC(s,i,u){if(i!=null&&typeof i!="object")throw Error(r(62));if(s=s.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||i!=null&&i.hasOwnProperty(p)||(p.indexOf("--")===0?s.setProperty(p,""):p==="float"?s.cssFloat="":s[p]="");for(var x in i)p=i[x],i.hasOwnProperty(x)&&u[x]!==p&&tC(s,x,p)}else for(var w in i)i.hasOwnProperty(w)&&tC(s,w,i[w])}function cy(s){if(s.indexOf("-")===-1)return!1;switch(s){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 F6=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"]]),V6=/^[\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 ch(s){return V6.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function so(){}var uy=null;function dy(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var mc=null,pc=null;function rC(s){var i=Fa(s);if(i&&(s=i.stateNode)){var u=s[qe]||null;e:switch(s=i.stateNode,i.type){case"input":if(iy(s,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=s;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Ha(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var p=u[i];if(p!==s&&p.form===s.form){var x=p[qe]||null;if(!x)throw Error(r(90));iy(p,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(i=0;i<u.length;i++)p=u[i],p.form===s.form&&QS(p)}break e;case"textarea":JS(s,u.value,u.defaultValue);break e;case"select":i=u.value,i!=null&&fc(s,!!u.multiple,i,!1)}}}var fy=!1;function aC(s,i,u){if(fy)return s(i,u);fy=!0;try{var p=s(i);return p}finally{if(fy=!1,(mc!==null||pc!==null)&&(Wh(),mc&&(i=mc,s=pc,pc=mc=null,rC(i),s)))for(i=0;i<s.length;i++)rC(s[i])}}function Zu(s,i){var u=s.stateNode;if(u===null)return null;var p=u[qe]||null;if(p===null)return null;u=p[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":(p=!p.disabled)||(s=s.type,p=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!p;break e;default:s=!1}if(s)return null;if(u&&typeof u!="function")throw Error(r(231,i,typeof u));return u}var oo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),hy=!1;if(oo)try{var Ku={};Object.defineProperty(Ku,"passive",{get:function(){hy=!0}}),window.addEventListener("test",Ku,Ku),window.removeEventListener("test",Ku,Ku)}catch{hy=!1}var ni=null,my=null,uh=null;function sC(){if(uh)return uh;var s,i=my,u=i.length,p,x="value"in ni?ni.value:ni.textContent,w=x.length;for(s=0;s<u&&i[s]===x[s];s++);var N=u-s;for(p=1;p<=N&&i[u-p]===x[w-p];p++);return uh=x.slice(s,1<p?1-p:void 0)}function dh(s){var i=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&i===13&&(s=13)):s=i,s===10&&(s=13),32<=s||s===13?s:0}function fh(){return!0}function oC(){return!1}function na(s){function i(u,p,x,w,N){this._reactName=u,this._targetInst=x,this.type=p,this.nativeEvent=w,this.target=N,this.currentTarget=null;for(var I in s)s.hasOwnProperty(I)&&(u=s[I],this[I]=u?u(w):w[I]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?fh:oC,this.isPropagationStopped=oC,this}return y(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=fh)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=fh)},persist:function(){},isPersistent:fh}),i}var dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hh=na(dl),Yu=y({},dl,{view:0,detail:0}),z6=na(Yu),py,gy,Wu,mh=y({},Yu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vy,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Wu&&(Wu&&s.type==="mousemove"?(py=s.screenX-Wu.screenX,gy=s.screenY-Wu.screenY):gy=py=0,Wu=s),py)},movementY:function(s){return"movementY"in s?s.movementY:gy}}),iC=na(mh),H6=y({},mh,{dataTransfer:0}),$6=na(H6),B6=y({},Yu,{relatedTarget:0}),yy=na(B6),G6=y({},dl,{animationName:0,elapsedTime:0,pseudoElement:0}),q6=na(G6),Z6=y({},dl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),K6=na(Z6),Y6=y({},dl,{data:0}),lC=na(Y6),W6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Q6={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"},X6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function J6(s){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(s):(s=X6[s])?!!i[s]:!1}function vy(){return J6}var e8=y({},Yu,{key:function(s){if(s.key){var i=W6[s.key]||s.key;if(i!=="Unidentified")return i}return s.type==="keypress"?(s=dh(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?Q6[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vy,charCode:function(s){return s.type==="keypress"?dh(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?dh(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),t8=na(e8),n8=y({},mh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),cC=na(n8),r8=y({},Yu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vy}),a8=na(r8),s8=y({},dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),o8=na(s8),i8=y({},mh,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),l8=na(i8),c8=y({},dl,{newState:0,oldState:0}),u8=na(c8),d8=[9,13,27,32],xy=oo&&"CompositionEvent"in window,Qu=null;oo&&"documentMode"in document&&(Qu=document.documentMode);var f8=oo&&"TextEvent"in window&&!Qu,uC=oo&&(!xy||Qu&&8<Qu&&11>=Qu),dC=" ",fC=!1;function hC(s,i){switch(s){case"keyup":return d8.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function mC(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var gc=!1;function h8(s,i){switch(s){case"compositionend":return mC(i);case"keypress":return i.which!==32?null:(fC=!0,dC);case"textInput":return s=i.data,s===dC&&fC?null:s;default:return null}}function m8(s,i){if(gc)return s==="compositionend"||!xy&&hC(s,i)?(s=sC(),uh=my=ni=null,gc=!1,s):null;switch(s){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 uC&&i.locale!=="ko"?null:i.data;default:return null}}var p8={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 pC(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i==="input"?!!p8[s.type]:i==="textarea"}function gC(s,i,u,p){mc?pc?pc.push(p):pc=[p]:mc=p,i=rm(i,"onChange"),0<i.length&&(u=new hh("onChange","change",null,u,p),s.push({event:u,listeners:i}))}var Xu=null,Ju=null;function g8(s){XE(s,0)}function ph(s){var i=ea(s);if(QS(i))return s}function yC(s,i){if(s==="change")return i}var vC=!1;if(oo){var by;if(oo){var Sy="oninput"in document;if(!Sy){var xC=document.createElement("div");xC.setAttribute("oninput","return;"),Sy=typeof xC.oninput=="function"}by=Sy}else by=!1;vC=by&&(!document.documentMode||9<document.documentMode)}function bC(){Xu&&(Xu.detachEvent("onpropertychange",SC),Ju=Xu=null)}function SC(s){if(s.propertyName==="value"&&ph(Ju)){var i=[];gC(i,Ju,s,dy(s)),aC(g8,i)}}function y8(s,i,u){s==="focusin"?(bC(),Xu=i,Ju=u,Xu.attachEvent("onpropertychange",SC)):s==="focusout"&&bC()}function v8(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return ph(Ju)}function x8(s,i){if(s==="click")return ph(i)}function b8(s,i){if(s==="input"||s==="change")return ph(i)}function S8(s,i){return s===i&&(s!==0||1/s===1/i)||s!==s&&i!==i}var xa=typeof Object.is=="function"?Object.is:S8;function ed(s,i){if(xa(s,i))return!0;if(typeof s!="object"||s===null||typeof i!="object"||i===null)return!1;var u=Object.keys(s),p=Object.keys(i);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var x=u[p];if(!Ve.call(i,x)||!xa(s[x],i[x]))return!1}return!0}function CC(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function EC(s,i){var u=CC(s);s=0;for(var p;u;){if(u.nodeType===3){if(p=s+u.textContent.length,s<=i&&p>=i)return{node:u,offset:i-s};s=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=CC(u)}}function wC(s,i){return s&&i?s===i?!0:s&&s.nodeType===3?!1:i&&i.nodeType===3?wC(s,i.parentNode):"contains"in s?s.contains(i):s.compareDocumentPosition?!!(s.compareDocumentPosition(i)&16):!1:!1}function RC(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var i=lh(s.document);i instanceof s.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)s=i.contentWindow;else break;i=lh(s.document)}return i}function Cy(s){var i=s&&s.nodeName&&s.nodeName.toLowerCase();return i&&(i==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||i==="textarea"||s.contentEditable==="true")}var C8=oo&&"documentMode"in document&&11>=document.documentMode,yc=null,Ey=null,td=null,wy=!1;function jC(s,i,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;wy||yc==null||yc!==lh(p)||(p=yc,"selectionStart"in p&&Cy(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),td&&ed(td,p)||(td=p,p=rm(Ey,"onSelect"),0<p.length&&(i=new hh("onSelect","select",null,i,u),s.push({event:i,listeners:p}),i.target=yc)))}function fl(s,i){var u={};return u[s.toLowerCase()]=i.toLowerCase(),u["Webkit"+s]="webkit"+i,u["Moz"+s]="moz"+i,u}var vc={animationend:fl("Animation","AnimationEnd"),animationiteration:fl("Animation","AnimationIteration"),animationstart:fl("Animation","AnimationStart"),transitionrun:fl("Transition","TransitionRun"),transitionstart:fl("Transition","TransitionStart"),transitioncancel:fl("Transition","TransitionCancel"),transitionend:fl("Transition","TransitionEnd")},Ry={},TC={};oo&&(TC=document.createElement("div").style,"AnimationEvent"in window||(delete vc.animationend.animation,delete vc.animationiteration.animation,delete vc.animationstart.animation),"TransitionEvent"in window||delete vc.transitionend.transition);function hl(s){if(Ry[s])return Ry[s];if(!vc[s])return s;var i=vc[s],u;for(u in i)if(i.hasOwnProperty(u)&&u in TC)return Ry[s]=i[u];return s}var _C=hl("animationend"),NC=hl("animationiteration"),AC=hl("animationstart"),E8=hl("transitionrun"),w8=hl("transitionstart"),R8=hl("transitioncancel"),DC=hl("transitionend"),OC=new Map,jy="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(" ");jy.push("scrollEnd");function os(s,i){OC.set(s,i),Va(i,[s])}var gh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},$a=[],xc=0,Ty=0;function yh(){for(var s=xc,i=Ty=xc=0;i<s;){var u=$a[i];$a[i++]=null;var p=$a[i];$a[i++]=null;var x=$a[i];$a[i++]=null;var w=$a[i];if($a[i++]=null,p!==null&&x!==null){var N=p.pending;N===null?x.next=x:(x.next=N.next,N.next=x),p.pending=x}w!==0&&MC(u,x,w)}}function vh(s,i,u,p){$a[xc++]=s,$a[xc++]=i,$a[xc++]=u,$a[xc++]=p,Ty|=p,s.lanes|=p,s=s.alternate,s!==null&&(s.lanes|=p)}function _y(s,i,u,p){return vh(s,i,u,p),xh(s)}function ml(s,i){return vh(s,null,null,i),xh(s)}function MC(s,i,u){s.lanes|=u;var p=s.alternate;p!==null&&(p.lanes|=u);for(var x=!1,w=s.return;w!==null;)w.childLanes|=u,p=w.alternate,p!==null&&(p.childLanes|=u),w.tag===22&&(s=w.stateNode,s===null||s._visibility&1||(x=!0)),s=w,w=w.return;return s.tag===3?(w=s.stateNode,x&&i!==null&&(x=31-_n(u),s=w.hiddenUpdates,p=s[x],p===null?s[x]=[i]:p.push(i),i.lane=u|536870912),w):null}function xh(s){if(50<Ed)throw Ed=0,Pv=null,Error(r(185));for(var i=s.return;i!==null;)s=i,i=s.return;return s.tag===3?s.stateNode:null}var bc={};function j8(s,i,u,p){this.tag=s,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=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ba(s,i,u,p){return new j8(s,i,u,p)}function Ny(s){return s=s.prototype,!(!s||!s.isReactComponent)}function io(s,i){var u=s.alternate;return u===null?(u=ba(s.tag,i,s.key,s.mode),u.elementType=s.elementType,u.type=s.type,u.stateNode=s.stateNode,u.alternate=s,s.alternate=u):(u.pendingProps=i,u.type=s.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=s.flags&65011712,u.childLanes=s.childLanes,u.lanes=s.lanes,u.child=s.child,u.memoizedProps=s.memoizedProps,u.memoizedState=s.memoizedState,u.updateQueue=s.updateQueue,i=s.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=s.sibling,u.index=s.index,u.ref=s.ref,u.refCleanup=s.refCleanup,u}function IC(s,i){s.flags&=65011714;var u=s.alternate;return u===null?(s.childLanes=0,s.lanes=i,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=u.childLanes,s.lanes=u.lanes,s.child=u.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=u.memoizedProps,s.memoizedState=u.memoizedState,s.updateQueue=u.updateQueue,s.type=u.type,i=u.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),s}function bh(s,i,u,p,x,w){var N=0;if(p=s,typeof s=="function")Ny(s)&&(N=1);else if(typeof s=="string")N=DM(s,u,te.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case V:return s=ba(31,u,i,x),s.elementType=V,s.lanes=w,s;case S:return pl(u.children,x,w,i);case C:N=8,x|=24;break;case R:return s=ba(12,u,i,x|2),s.elementType=R,s.lanes=w,s;case A:return s=ba(13,u,i,x),s.elementType=A,s.lanes=w,s;case O:return s=ba(19,u,i,x),s.elementType=O,s.lanes=w,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case _:N=10;break e;case j:N=9;break e;case D:N=11;break e;case T:N=14;break e;case M:N=16,p=null;break e}N=29,u=Error(r(130,s===null?"null":typeof s,"")),p=null}return i=ba(N,u,i,x),i.elementType=s,i.type=p,i.lanes=w,i}function pl(s,i,u,p){return s=ba(7,s,p,i),s.lanes=u,s}function Ay(s,i,u){return s=ba(6,s,null,i),s.lanes=u,s}function kC(s){var i=ba(18,null,null,0);return i.stateNode=s,i}function Dy(s,i,u){return i=ba(4,s.children!==null?s.children:[],s.key,i),i.lanes=u,i.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},i}var LC=new WeakMap;function Ba(s,i){if(typeof s=="object"&&s!==null){var u=LC.get(s);return u!==void 0?u:(i={value:s,source:i,stack:va(i)},LC.set(s,i),i)}return{value:s,source:i,stack:va(i)}}var Sc=[],Cc=0,Sh=null,nd=0,Ga=[],qa=0,ri=null,Os=1,Ms="";function lo(s,i){Sc[Cc++]=nd,Sc[Cc++]=Sh,Sh=s,nd=i}function PC(s,i,u){Ga[qa++]=Os,Ga[qa++]=Ms,Ga[qa++]=ri,ri=s;var p=Os;s=Ms;var x=32-_n(p)-1;p&=~(1<<x),u+=1;var w=32-_n(i)+x;if(30<w){var N=x-x%5;w=(p&(1<<N)-1).toString(32),p>>=N,x-=N,Os=1<<32-_n(i)+x|u<<x|p,Ms=w+s}else Os=1<<w|u<<x|p,Ms=s}function Oy(s){s.return!==null&&(lo(s,1),PC(s,1,0))}function My(s){for(;s===Sh;)Sh=Sc[--Cc],Sc[Cc]=null,nd=Sc[--Cc],Sc[Cc]=null;for(;s===ri;)ri=Ga[--qa],Ga[qa]=null,Ms=Ga[--qa],Ga[qa]=null,Os=Ga[--qa],Ga[qa]=null}function UC(s,i){Ga[qa++]=Os,Ga[qa++]=Ms,Ga[qa++]=ri,Os=i.id,Ms=i.overflow,ri=s}var Sr=null,hn=null,Mt=!1,ai=null,Za=!1,Iy=Error(r(519));function si(s){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw rd(Ba(i,s)),Iy}function FC(s){var i=s.stateNode,u=s.type,p=s.memoizedProps;switch(i[He]=s,i[qe]=p,u){case"dialog":wt("cancel",i),wt("close",i);break;case"iframe":case"object":case"embed":wt("load",i);break;case"video":case"audio":for(u=0;u<Rd.length;u++)wt(Rd[u],i);break;case"source":wt("error",i);break;case"img":case"image":case"link":wt("error",i),wt("load",i);break;case"details":wt("toggle",i);break;case"input":wt("invalid",i),XS(i,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":wt("invalid",i);break;case"textarea":wt("invalid",i),eC(i,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||p.suppressHydrationWarning===!0||nw(i.textContent,u)?(p.popover!=null&&(wt("beforetoggle",i),wt("toggle",i)),p.onScroll!=null&&wt("scroll",i),p.onScrollEnd!=null&&wt("scrollend",i),p.onClick!=null&&(i.onclick=so),i=!0):i=!1,i||si(s,!0)}function VC(s){for(Sr=s.return;Sr;)switch(Sr.tag){case 5:case 31:case 13:Za=!1;return;case 27:case 3:Za=!0;return;default:Sr=Sr.return}}function Ec(s){if(s!==Sr)return!1;if(!Mt)return VC(s),Mt=!0,!1;var i=s.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=s.type,u=!(u!=="form"&&u!=="button")||Xv(s.type,s.memoizedProps)),u=!u),u&&hn&&si(s),VC(s),i===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));hn=dw(s)}else if(i===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(317));hn=dw(s)}else i===27?(i=hn,xi(s.type)?(s=rx,rx=null,hn=s):hn=i):hn=Sr?Ya(s.stateNode.nextSibling):null;return!0}function gl(){hn=Sr=null,Mt=!1}function ky(){var s=ai;return s!==null&&(oa===null?oa=s:oa.push.apply(oa,s),ai=null),s}function rd(s){ai===null?ai=[s]:ai.push(s)}var Ly=L(null),yl=null,co=null;function oi(s,i,u){W(Ly,i._currentValue),i._currentValue=u}function uo(s){s._currentValue=Ly.current,P(Ly)}function Py(s,i,u){for(;s!==null;){var p=s.alternate;if((s.childLanes&i)!==i?(s.childLanes|=i,p!==null&&(p.childLanes|=i)):p!==null&&(p.childLanes&i)!==i&&(p.childLanes|=i),s===u)break;s=s.return}}function Uy(s,i,u,p){var x=s.child;for(x!==null&&(x.return=s);x!==null;){var w=x.dependencies;if(w!==null){var N=x.child;w=w.firstContext;e:for(;w!==null;){var I=w;w=x;for(var B=0;B<i.length;B++)if(I.context===i[B]){w.lanes|=u,I=w.alternate,I!==null&&(I.lanes|=u),Py(w.return,u,s),p||(N=null);break e}w=I.next}}else if(x.tag===18){if(N=x.return,N===null)throw Error(r(341));N.lanes|=u,w=N.alternate,w!==null&&(w.lanes|=u),Py(N,u,s),N=null}else N=x.child;if(N!==null)N.return=x;else for(N=x;N!==null;){if(N===s){N=null;break}if(x=N.sibling,x!==null){x.return=N.return,N=x;break}N=N.return}x=N}}function wc(s,i,u,p){s=null;for(var x=i,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var N=x.alternate;if(N===null)throw Error(r(387));if(N=N.memoizedProps,N!==null){var I=x.type;xa(x.pendingProps.value,N.value)||(s!==null?s.push(I):s=[I])}}else if(x===le.current){if(N=x.alternate,N===null)throw Error(r(387));N.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(s!==null?s.push(Ad):s=[Ad])}x=x.return}s!==null&&Uy(i,s,u,p),i.flags|=262144}function Ch(s){for(s=s.firstContext;s!==null;){if(!xa(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function vl(s){yl=s,co=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Cr(s){return zC(yl,s)}function Eh(s,i){return yl===null&&vl(s),zC(s,i)}function zC(s,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},co===null){if(s===null)throw Error(r(308));co=i,s.dependencies={lanes:0,firstContext:i},s.flags|=524288}else co=co.next=i;return u}var T8=typeof AbortController<"u"?AbortController:function(){var s=[],i=this.signal={aborted:!1,addEventListener:function(u,p){s.push(p)}};this.abort=function(){i.aborted=!0,s.forEach(function(u){return u()})}},_8=e.unstable_scheduleCallback,N8=e.unstable_NormalPriority,Zn={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Fy(){return{controller:new T8,data:new Map,refCount:0}}function ad(s){s.refCount--,s.refCount===0&&_8(N8,function(){s.controller.abort()})}var sd=null,Vy=0,Rc=0,jc=null;function A8(s,i){if(sd===null){var u=sd=[];Vy=0,Rc=$v(),jc={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Vy++,i.then(HC,HC),i}function HC(){if(--Vy===0&&sd!==null){jc!==null&&(jc.status="fulfilled");var s=sd;sd=null,Rc=0,jc=null;for(var i=0;i<s.length;i++)(0,s[i])()}}function D8(s,i){var u=[],p={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return s.then(function(){p.status="fulfilled",p.value=i;for(var x=0;x<u.length;x++)(0,u[x])(i)},function(x){for(p.status="rejected",p.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),p}var $C=k.S;k.S=function(s,i){jE=Se(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&A8(s,i),$C!==null&&$C(s,i)};var xl=L(null);function zy(){var s=xl.current;return s!==null?s:an.pooledCache}function wh(s,i){i===null?W(xl,xl.current):W(xl,i.pool)}function BC(){var s=zy();return s===null?null:{parent:Zn._currentValue,pool:s}}var Tc=Error(r(460)),Hy=Error(r(474)),Rh=Error(r(542)),jh={then:function(){}};function GC(s){return s=s.status,s==="fulfilled"||s==="rejected"}function qC(s,i,u){switch(u=s[u],u===void 0?s.push(i):u!==i&&(i.then(so,so),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,KC(s),s;default:if(typeof i.status=="string")i.then(so,so);else{if(s=an,s!==null&&100<s.shellSuspendCounter)throw Error(r(482));s=i,s.status="pending",s.then(function(p){if(i.status==="pending"){var x=i;x.status="fulfilled",x.value=p}},function(p){if(i.status==="pending"){var x=i;x.status="rejected",x.reason=p}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw s=i.reason,KC(s),s}throw Sl=i,Tc}}function bl(s){try{var i=s._init;return i(s._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Sl=u,Tc):u}}var Sl=null;function ZC(){if(Sl===null)throw Error(r(459));var s=Sl;return Sl=null,s}function KC(s){if(s===Tc||s===Rh)throw Error(r(483))}var _c=null,od=0;function Th(s){var i=od;return od+=1,_c===null&&(_c=[]),qC(_c,s,i)}function id(s,i){i=i.props.ref,s.ref=i!==void 0?i:null}function _h(s,i){throw i.$$typeof===v?Error(r(525)):(s=Object.prototype.toString.call(i),Error(r(31,s==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":s)))}function YC(s){function i(ee,Q){if(s){var re=ee.deletions;re===null?(ee.deletions=[Q],ee.flags|=16):re.push(Q)}}function u(ee,Q){if(!s)return null;for(;Q!==null;)i(ee,Q),Q=Q.sibling;return null}function p(ee){for(var Q=new Map;ee!==null;)ee.key!==null?Q.set(ee.key,ee):Q.set(ee.index,ee),ee=ee.sibling;return Q}function x(ee,Q){return ee=io(ee,Q),ee.index=0,ee.sibling=null,ee}function w(ee,Q,re){return ee.index=re,s?(re=ee.alternate,re!==null?(re=re.index,re<Q?(ee.flags|=67108866,Q):re):(ee.flags|=67108866,Q)):(ee.flags|=1048576,Q)}function N(ee){return s&&ee.alternate===null&&(ee.flags|=67108866),ee}function I(ee,Q,re,me){return Q===null||Q.tag!==6?(Q=Ay(re,ee.mode,me),Q.return=ee,Q):(Q=x(Q,re),Q.return=ee,Q)}function B(ee,Q,re,me){var tt=re.type;return tt===S?he(ee,Q,re.props.children,me,re.key):Q!==null&&(Q.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===M&&bl(tt)===Q.type)?(Q=x(Q,re.props),id(Q,re),Q.return=ee,Q):(Q=bh(re.type,re.key,re.props,null,ee.mode,me),id(Q,re),Q.return=ee,Q)}function ae(ee,Q,re,me){return Q===null||Q.tag!==4||Q.stateNode.containerInfo!==re.containerInfo||Q.stateNode.implementation!==re.implementation?(Q=Dy(re,ee.mode,me),Q.return=ee,Q):(Q=x(Q,re.children||[]),Q.return=ee,Q)}function he(ee,Q,re,me,tt){return Q===null||Q.tag!==7?(Q=pl(re,ee.mode,me,tt),Q.return=ee,Q):(Q=x(Q,re),Q.return=ee,Q)}function pe(ee,Q,re){if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return Q=Ay(""+Q,ee.mode,re),Q.return=ee,Q;if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case b:return re=bh(Q.type,Q.key,Q.props,null,ee.mode,re),id(re,Q),re.return=ee,re;case E:return Q=Dy(Q,ee.mode,re),Q.return=ee,Q;case M:return Q=bl(Q),pe(ee,Q,re)}if(H(Q)||Y(Q))return Q=pl(Q,ee.mode,re,null),Q.return=ee,Q;if(typeof Q.then=="function")return pe(ee,Th(Q),re);if(Q.$$typeof===_)return pe(ee,Eh(ee,Q),re);_h(ee,Q)}return null}function oe(ee,Q,re,me){var tt=Q!==null?Q.key:null;if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return tt!==null?null:I(ee,Q,""+re,me);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case b:return re.key===tt?B(ee,Q,re,me):null;case E:return re.key===tt?ae(ee,Q,re,me):null;case M:return re=bl(re),oe(ee,Q,re,me)}if(H(re)||Y(re))return tt!==null?null:he(ee,Q,re,me,null);if(typeof re.then=="function")return oe(ee,Q,Th(re),me);if(re.$$typeof===_)return oe(ee,Q,Eh(ee,re),me);_h(ee,re)}return null}function fe(ee,Q,re,me,tt){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ee=ee.get(re)||null,I(Q,ee,""+me,tt);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return ee=ee.get(me.key===null?re:me.key)||null,B(Q,ee,me,tt);case E:return ee=ee.get(me.key===null?re:me.key)||null,ae(Q,ee,me,tt);case M:return me=bl(me),fe(ee,Q,re,me,tt)}if(H(me)||Y(me))return ee=ee.get(re)||null,he(Q,ee,me,tt,null);if(typeof me.then=="function")return fe(ee,Q,re,Th(me),tt);if(me.$$typeof===_)return fe(ee,Q,re,Eh(Q,me),tt);_h(Q,me)}return null}function Ge(ee,Q,re,me){for(var tt=null,Vt=null,Xe=Q,gt=Q=0,Tt=null;Xe!==null&&gt<re.length;gt++){Xe.index>gt?(Tt=Xe,Xe=null):Tt=Xe.sibling;var zt=oe(ee,Xe,re[gt],me);if(zt===null){Xe===null&&(Xe=Tt);break}s&&Xe&&zt.alternate===null&&i(ee,Xe),Q=w(zt,Q,gt),Vt===null?tt=zt:Vt.sibling=zt,Vt=zt,Xe=Tt}if(gt===re.length)return u(ee,Xe),Mt&&lo(ee,gt),tt;if(Xe===null){for(;gt<re.length;gt++)Xe=pe(ee,re[gt],me),Xe!==null&&(Q=w(Xe,Q,gt),Vt===null?tt=Xe:Vt.sibling=Xe,Vt=Xe);return Mt&&lo(ee,gt),tt}for(Xe=p(Xe);gt<re.length;gt++)Tt=fe(Xe,ee,gt,re[gt],me),Tt!==null&&(s&&Tt.alternate!==null&&Xe.delete(Tt.key===null?gt:Tt.key),Q=w(Tt,Q,gt),Vt===null?tt=Tt:Vt.sibling=Tt,Vt=Tt);return s&&Xe.forEach(function(wi){return i(ee,wi)}),Mt&&lo(ee,gt),tt}function nt(ee,Q,re,me){if(re==null)throw Error(r(151));for(var tt=null,Vt=null,Xe=Q,gt=Q=0,Tt=null,zt=re.next();Xe!==null&&!zt.done;gt++,zt=re.next()){Xe.index>gt?(Tt=Xe,Xe=null):Tt=Xe.sibling;var wi=oe(ee,Xe,zt.value,me);if(wi===null){Xe===null&&(Xe=Tt);break}s&&Xe&&wi.alternate===null&&i(ee,Xe),Q=w(wi,Q,gt),Vt===null?tt=wi:Vt.sibling=wi,Vt=wi,Xe=Tt}if(zt.done)return u(ee,Xe),Mt&&lo(ee,gt),tt;if(Xe===null){for(;!zt.done;gt++,zt=re.next())zt=pe(ee,zt.value,me),zt!==null&&(Q=w(zt,Q,gt),Vt===null?tt=zt:Vt.sibling=zt,Vt=zt);return Mt&&lo(ee,gt),tt}for(Xe=p(Xe);!zt.done;gt++,zt=re.next())zt=fe(Xe,ee,gt,zt.value,me),zt!==null&&(s&&zt.alternate!==null&&Xe.delete(zt.key===null?gt:zt.key),Q=w(zt,Q,gt),Vt===null?tt=zt:Vt.sibling=zt,Vt=zt);return s&&Xe.forEach(function(HM){return i(ee,HM)}),Mt&&lo(ee,gt),tt}function rn(ee,Q,re,me){if(typeof re=="object"&&re!==null&&re.type===S&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case b:e:{for(var tt=re.key;Q!==null;){if(Q.key===tt){if(tt=re.type,tt===S){if(Q.tag===7){u(ee,Q.sibling),me=x(Q,re.props.children),me.return=ee,ee=me;break e}}else if(Q.elementType===tt||typeof tt=="object"&&tt!==null&&tt.$$typeof===M&&bl(tt)===Q.type){u(ee,Q.sibling),me=x(Q,re.props),id(me,re),me.return=ee,ee=me;break e}u(ee,Q);break}else i(ee,Q);Q=Q.sibling}re.type===S?(me=pl(re.props.children,ee.mode,me,re.key),me.return=ee,ee=me):(me=bh(re.type,re.key,re.props,null,ee.mode,me),id(me,re),me.return=ee,ee=me)}return N(ee);case E:e:{for(tt=re.key;Q!==null;){if(Q.key===tt)if(Q.tag===4&&Q.stateNode.containerInfo===re.containerInfo&&Q.stateNode.implementation===re.implementation){u(ee,Q.sibling),me=x(Q,re.children||[]),me.return=ee,ee=me;break e}else{u(ee,Q);break}else i(ee,Q);Q=Q.sibling}me=Dy(re,ee.mode,me),me.return=ee,ee=me}return N(ee);case M:return re=bl(re),rn(ee,Q,re,me)}if(H(re))return Ge(ee,Q,re,me);if(Y(re)){if(tt=Y(re),typeof tt!="function")throw Error(r(150));return re=tt.call(re),nt(ee,Q,re,me)}if(typeof re.then=="function")return rn(ee,Q,Th(re),me);if(re.$$typeof===_)return rn(ee,Q,Eh(ee,re),me);_h(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint"?(re=""+re,Q!==null&&Q.tag===6?(u(ee,Q.sibling),me=x(Q,re),me.return=ee,ee=me):(u(ee,Q),me=Ay(re,ee.mode,me),me.return=ee,ee=me),N(ee)):u(ee,Q)}return function(ee,Q,re,me){try{od=0;var tt=rn(ee,Q,re,me);return _c=null,tt}catch(Xe){if(Xe===Tc||Xe===Rh)throw Xe;var Vt=ba(29,Xe,null,ee.mode);return Vt.lanes=me,Vt.return=ee,Vt}finally{}}}var Cl=YC(!0),WC=YC(!1),ii=!1;function $y(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function By(s,i){s=s.updateQueue,i.updateQueue===s&&(i.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function li(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function ci(s,i,u){var p=s.updateQueue;if(p===null)return null;if(p=p.shared,(Bt&2)!==0){var x=p.pending;return x===null?i.next=i:(i.next=x.next,x.next=i),p.pending=i,i=xh(s),MC(s,null,u),i}return vh(s,p,i,u),xh(s)}function ld(s,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var p=i.lanes;p&=s.pendingLanes,u|=p,i.lanes=u,se(s,u)}}function Gy(s,i){var u=s.updateQueue,p=s.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var N={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?x=w=N:w=w.next=N,u=u.next}while(u!==null);w===null?x=w=i:w=w.next=i}else x=w=i;u={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},s.updateQueue=u;return}s=u.lastBaseUpdate,s===null?u.firstBaseUpdate=i:s.next=i,u.lastBaseUpdate=i}var qy=!1;function cd(){if(qy){var s=jc;if(s!==null)throw s}}function ud(s,i,u,p){qy=!1;var x=s.updateQueue;ii=!1;var w=x.firstBaseUpdate,N=x.lastBaseUpdate,I=x.shared.pending;if(I!==null){x.shared.pending=null;var B=I,ae=B.next;B.next=null,N===null?w=ae:N.next=ae,N=B;var he=s.alternate;he!==null&&(he=he.updateQueue,I=he.lastBaseUpdate,I!==N&&(I===null?he.firstBaseUpdate=ae:I.next=ae,he.lastBaseUpdate=B))}if(w!==null){var pe=x.baseState;N=0,he=ae=B=null,I=w;do{var oe=I.lane&-536870913,fe=oe!==I.lane;if(fe?(jt&oe)===oe:(p&oe)===oe){oe!==0&&oe===Rc&&(qy=!0),he!==null&&(he=he.next={lane:0,tag:I.tag,payload:I.payload,callback:null,next:null});e:{var Ge=s,nt=I;oe=i;var rn=u;switch(nt.tag){case 1:if(Ge=nt.payload,typeof Ge=="function"){pe=Ge.call(rn,pe,oe);break e}pe=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=nt.payload,oe=typeof Ge=="function"?Ge.call(rn,pe,oe):Ge,oe==null)break e;pe=y({},pe,oe);break e;case 2:ii=!0}}oe=I.callback,oe!==null&&(s.flags|=64,fe&&(s.flags|=8192),fe=x.callbacks,fe===null?x.callbacks=[oe]:fe.push(oe))}else fe={lane:oe,tag:I.tag,payload:I.payload,callback:I.callback,next:null},he===null?(ae=he=fe,B=pe):he=he.next=fe,N|=oe;if(I=I.next,I===null){if(I=x.shared.pending,I===null)break;fe=I,I=fe.next,fe.next=null,x.lastBaseUpdate=fe,x.shared.pending=null}}while(!0);he===null&&(B=pe),x.baseState=B,x.firstBaseUpdate=ae,x.lastBaseUpdate=he,w===null&&(x.shared.lanes=0),mi|=N,s.lanes=N,s.memoizedState=pe}}function QC(s,i){if(typeof s!="function")throw Error(r(191,s));s.call(i)}function XC(s,i){var u=s.callbacks;if(u!==null)for(s.callbacks=null,s=0;s<u.length;s++)QC(u[s],i)}var Nc=L(null),Nh=L(0);function JC(s,i){s=bo,W(Nh,s),W(Nc,i),bo=s|i.baseLanes}function Zy(){W(Nh,bo),W(Nc,Nc.current)}function Ky(){bo=Nh.current,P(Nc),P(Nh)}var Sa=L(null),Ka=null;function ui(s){var i=s.alternate;W(zn,zn.current&1),W(Sa,s),Ka===null&&(i===null||Nc.current!==null||i.memoizedState!==null)&&(Ka=s)}function Yy(s){W(zn,zn.current),W(Sa,s),Ka===null&&(Ka=s)}function e2(s){s.tag===22?(W(zn,zn.current),W(Sa,s),Ka===null&&(Ka=s)):di()}function di(){W(zn,zn.current),W(Sa,Sa.current)}function Ca(s){P(Sa),Ka===s&&(Ka=null),P(zn)}var zn=L(0);function Ah(s){for(var i=s;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||tx(u)||nx(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===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var fo=0,ht=null,tn=null,Kn=null,Dh=!1,Ac=!1,El=!1,Oh=0,dd=0,Dc=null,O8=0;function An(){throw Error(r(321))}function Wy(s,i){if(i===null)return!1;for(var u=0;u<i.length&&u<s.length;u++)if(!xa(s[u],i[u]))return!1;return!0}function Qy(s,i,u,p,x,w){return fo=w,ht=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,k.H=s===null||s.memoizedState===null?P2:fv,El=!1,w=u(p,x),El=!1,Ac&&(w=n2(i,u,p,x)),t2(s),w}function t2(s){k.H=md;var i=tn!==null&&tn.next!==null;if(fo=0,Kn=tn=ht=null,Dh=!1,dd=0,Dc=null,i)throw Error(r(300));s===null||Yn||(s=s.dependencies,s!==null&&Ch(s)&&(Yn=!0))}function n2(s,i,u,p){ht=s;var x=0;do{if(Ac&&(Dc=null),dd=0,Ac=!1,25<=x)throw Error(r(301));if(x+=1,Kn=tn=null,s.updateQueue!=null){var w=s.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}k.H=U2,w=i(u,p)}while(Ac);return w}function M8(){var s=k.H,i=s.useState()[0];return i=typeof i.then=="function"?fd(i):i,s=s.useState()[0],(tn!==null?tn.memoizedState:null)!==s&&(ht.flags|=1024),i}function Xy(){var s=Oh!==0;return Oh=0,s}function Jy(s,i,u){i.updateQueue=s.updateQueue,i.flags&=-2053,s.lanes&=~u}function ev(s){if(Dh){for(s=s.memoizedState;s!==null;){var i=s.queue;i!==null&&(i.pending=null),s=s.next}Dh=!1}fo=0,Kn=tn=ht=null,Ac=!1,dd=Oh=0,Dc=null}function Fr(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?ht.memoizedState=Kn=s:Kn=Kn.next=s,Kn}function Hn(){if(tn===null){var s=ht.alternate;s=s!==null?s.memoizedState:null}else s=tn.next;var i=Kn===null?ht.memoizedState:Kn.next;if(i!==null)Kn=i,tn=s;else{if(s===null)throw ht.alternate===null?Error(r(467)):Error(r(310));tn=s,s={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},Kn===null?ht.memoizedState=Kn=s:Kn=Kn.next=s}return Kn}function Mh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fd(s){var i=dd;return dd+=1,Dc===null&&(Dc=[]),s=qC(Dc,s,i),i=ht,(Kn===null?i.memoizedState:Kn.next)===null&&(i=i.alternate,k.H=i===null||i.memoizedState===null?P2:fv),s}function Ih(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return fd(s);if(s.$$typeof===_)return Cr(s)}throw Error(r(438,String(s)))}function tv(s){var i=null,u=ht.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var p=ht.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(i={data:p.data.map(function(x){return x.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Mh(),ht.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(s),p=0;p<s;p++)u[p]=Z;return i.index++,u}function ho(s,i){return typeof i=="function"?i(s):i}function kh(s){var i=Hn();return nv(i,tn,s)}function nv(s,i,u){var p=s.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var x=s.baseQueue,w=p.pending;if(w!==null){if(x!==null){var N=x.next;x.next=w.next,w.next=N}i.baseQueue=x=w,p.pending=null}if(w=s.baseState,x===null)s.memoizedState=w;else{i=x.next;var I=N=null,B=null,ae=i,he=!1;do{var pe=ae.lane&-536870913;if(pe!==ae.lane?(jt&pe)===pe:(fo&pe)===pe){var oe=ae.revertLane;if(oe===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),pe===Rc&&(he=!0);else if((fo&oe)===oe){ae=ae.next,oe===Rc&&(he=!0);continue}else pe={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},B===null?(I=B=pe,N=w):B=B.next=pe,ht.lanes|=oe,mi|=oe;pe=ae.action,El&&u(w,pe),w=ae.hasEagerState?ae.eagerState:u(w,pe)}else oe={lane:pe,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},B===null?(I=B=oe,N=w):B=B.next=oe,ht.lanes|=pe,mi|=pe;ae=ae.next}while(ae!==null&&ae!==i);if(B===null?N=w:B.next=I,!xa(w,s.memoizedState)&&(Yn=!0,he&&(u=jc,u!==null)))throw u;s.memoizedState=w,s.baseState=N,s.baseQueue=B,p.lastRenderedState=w}return x===null&&(p.lanes=0),[s.memoizedState,p.dispatch]}function rv(s){var i=Hn(),u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=s;var p=u.dispatch,x=u.pending,w=i.memoizedState;if(x!==null){u.pending=null;var N=x=x.next;do w=s(w,N.action),N=N.next;while(N!==x);xa(w,i.memoizedState)||(Yn=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),u.lastRenderedState=w}return[w,p]}function r2(s,i,u){var p=ht,x=Hn(),w=Mt;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=i();var N=!xa((tn||x).memoizedState,u);if(N&&(x.memoizedState=u,Yn=!0),x=x.queue,ov(o2.bind(null,p,x,s),[s]),x.getSnapshot!==i||N||Kn!==null&&Kn.memoizedState.tag&1){if(p.flags|=2048,Oc(9,{destroy:void 0},s2.bind(null,p,x,u,i),null),an===null)throw Error(r(349));w||(fo&127)!==0||a2(p,i,u)}return u}function a2(s,i,u){s.flags|=16384,s={getSnapshot:i,value:u},i=ht.updateQueue,i===null?(i=Mh(),ht.updateQueue=i,i.stores=[s]):(u=i.stores,u===null?i.stores=[s]:u.push(s))}function s2(s,i,u,p){i.value=u,i.getSnapshot=p,i2(i)&&l2(s)}function o2(s,i,u){return u(function(){i2(i)&&l2(s)})}function i2(s){var i=s.getSnapshot;s=s.value;try{var u=i();return!xa(s,u)}catch{return!0}}function l2(s){var i=ml(s,2);i!==null&&ia(i,s,2)}function av(s){var i=Fr();if(typeof s=="function"){var u=s;if(s=u(),El){vr(!0);try{u()}finally{vr(!1)}}}return i.memoizedState=i.baseState=s,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ho,lastRenderedState:s},i}function c2(s,i,u,p){return s.baseState=u,nv(s,tn,typeof p=="function"?p:ho)}function I8(s,i,u,p,x){if(Uh(s))throw Error(r(485));if(s=i.action,s!==null){var w={payload:x,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){w.listeners.push(N)}};k.T!==null?u(!0):w.isTransition=!1,p(w),u=i.pending,u===null?(w.next=i.pending=w,u2(i,w)):(w.next=u.next,i.pending=u.next=w)}}function u2(s,i){var u=i.action,p=i.payload,x=s.state;if(i.isTransition){var w=k.T,N={};k.T=N;try{var I=u(x,p),B=k.S;B!==null&&B(N,I),d2(s,i,I)}catch(ae){sv(s,i,ae)}finally{w!==null&&N.types!==null&&(w.types=N.types),k.T=w}}else try{w=u(x,p),d2(s,i,w)}catch(ae){sv(s,i,ae)}}function d2(s,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){f2(s,i,p)},function(p){return sv(s,i,p)}):f2(s,i,u)}function f2(s,i,u){i.status="fulfilled",i.value=u,h2(i),s.state=u,i=s.pending,i!==null&&(u=i.next,u===i?s.pending=null:(u=u.next,i.next=u,u2(s,u)))}function sv(s,i,u){var p=s.pending;if(s.pending=null,p!==null){p=p.next;do i.status="rejected",i.reason=u,h2(i),i=i.next;while(i!==p)}s.action=null}function h2(s){s=s.listeners;for(var i=0;i<s.length;i++)(0,s[i])()}function m2(s,i){return i}function p2(s,i){if(Mt){var u=an.formState;if(u!==null){e:{var p=ht;if(Mt){if(hn){t:{for(var x=hn,w=Za;x.nodeType!==8;){if(!w){x=null;break t}if(x=Ya(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){hn=Ya(x.nextSibling),p=x.data==="F!";break e}}si(p)}p=!1}p&&(i=u[0])}}return u=Fr(),u.memoizedState=u.baseState=i,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m2,lastRenderedState:i},u.queue=p,u=I2.bind(null,ht,p),p.dispatch=u,p=av(!1),w=dv.bind(null,ht,!1,p.queue),p=Fr(),x={state:i,dispatch:null,action:s,pending:null},p.queue=x,u=I8.bind(null,ht,x,w,u),x.dispatch=u,p.memoizedState=s,[i,u,!1]}function g2(s){var i=Hn();return y2(i,tn,s)}function y2(s,i,u){if(i=nv(s,i,m2)[0],s=kh(ho)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var p=fd(i)}catch(N){throw N===Tc?Rh:N}else p=i;i=Hn();var x=i.queue,w=x.dispatch;return u!==i.memoizedState&&(ht.flags|=2048,Oc(9,{destroy:void 0},k8.bind(null,x,u),null)),[p,w,s]}function k8(s,i){s.action=i}function v2(s){var i=Hn(),u=tn;if(u!==null)return y2(i,u,s);Hn(),i=i.memoizedState,u=Hn();var p=u.queue.dispatch;return u.memoizedState=s,[i,p,!1]}function Oc(s,i,u,p){return s={tag:s,create:u,deps:p,inst:i,next:null},i=ht.updateQueue,i===null&&(i=Mh(),ht.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=s.next=s:(p=u.next,u.next=s,s.next=p,i.lastEffect=s),s}function x2(){return Hn().memoizedState}function Lh(s,i,u,p){var x=Fr();ht.flags|=s,x.memoizedState=Oc(1|i,{destroy:void 0},u,p===void 0?null:p)}function Ph(s,i,u,p){var x=Hn();p=p===void 0?null:p;var w=x.memoizedState.inst;tn!==null&&p!==null&&Wy(p,tn.memoizedState.deps)?x.memoizedState=Oc(i,w,u,p):(ht.flags|=s,x.memoizedState=Oc(1|i,w,u,p))}function b2(s,i){Lh(8390656,8,s,i)}function ov(s,i){Ph(2048,8,s,i)}function L8(s){ht.flags|=4;var i=ht.updateQueue;if(i===null)i=Mh(),ht.updateQueue=i,i.events=[s];else{var u=i.events;u===null?i.events=[s]:u.push(s)}}function S2(s){var i=Hn().memoizedState;return L8({ref:i,nextImpl:s}),function(){if((Bt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function C2(s,i){return Ph(4,2,s,i)}function E2(s,i){return Ph(4,4,s,i)}function w2(s,i){if(typeof i=="function"){s=s();var u=i(s);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return s=s(),i.current=s,function(){i.current=null}}function R2(s,i,u){u=u!=null?u.concat([s]):null,Ph(4,4,w2.bind(null,i,s),u)}function iv(){}function j2(s,i){var u=Hn();i=i===void 0?null:i;var p=u.memoizedState;return i!==null&&Wy(i,p[1])?p[0]:(u.memoizedState=[s,i],s)}function T2(s,i){var u=Hn();i=i===void 0?null:i;var p=u.memoizedState;if(i!==null&&Wy(i,p[1]))return p[0];if(p=s(),El){vr(!0);try{s()}finally{vr(!1)}}return u.memoizedState=[p,i],p}function lv(s,i,u){return u===void 0||(fo&1073741824)!==0&&(jt&261930)===0?s.memoizedState=i:(s.memoizedState=u,s=_E(),ht.lanes|=s,mi|=s,u)}function _2(s,i,u,p){return xa(u,i)?u:Nc.current!==null?(s=lv(s,u,p),xa(s,i)||(Yn=!0),s):(fo&42)===0||(fo&1073741824)!==0&&(jt&261930)===0?(Yn=!0,s.memoizedState=u):(s=_E(),ht.lanes|=s,mi|=s,i)}function N2(s,i,u,p,x){var w=$.p;$.p=w!==0&&8>w?w:8;var N=k.T,I={};k.T=I,dv(s,!1,i,u);try{var B=x(),ae=k.S;if(ae!==null&&ae(I,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var he=D8(B,p);hd(s,i,he,Ra(s))}else hd(s,i,p,Ra(s))}catch(pe){hd(s,i,{then:function(){},status:"rejected",reason:pe},Ra())}finally{$.p=w,N!==null&&I.types!==null&&(N.types=I.types),k.T=N}}function P8(){}function cv(s,i,u,p){if(s.tag!==5)throw Error(r(476));var x=A2(s).queue;N2(s,x,i,q,u===null?P8:function(){return D2(s),u(p)})}function A2(s){var i=s.memoizedState;if(i!==null)return i;i={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ho,lastRenderedState:q},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ho,lastRenderedState:u},next:null},s.memoizedState=i,s=s.alternate,s!==null&&(s.memoizedState=i),i}function D2(s){var i=A2(s);i.next===null&&(i=s.alternate.memoizedState),hd(s,i.next.queue,{},Ra())}function uv(){return Cr(Ad)}function O2(){return Hn().memoizedState}function M2(){return Hn().memoizedState}function U8(s){for(var i=s.return;i!==null;){switch(i.tag){case 24:case 3:var u=Ra();s=li(u);var p=ci(i,s,u);p!==null&&(ia(p,i,u),ld(p,i,u)),i={cache:Fy()},s.payload=i;return}i=i.return}}function F8(s,i,u){var p=Ra();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Uh(s)?k2(i,u):(u=_y(s,i,u,p),u!==null&&(ia(u,s,p),L2(u,i,p)))}function I2(s,i,u){var p=Ra();hd(s,i,u,p)}function hd(s,i,u,p){var x={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Uh(s))k2(i,x);else{var w=s.alternate;if(s.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var N=i.lastRenderedState,I=w(N,u);if(x.hasEagerState=!0,x.eagerState=I,xa(I,N))return vh(s,i,x,0),an===null&&yh(),!1}catch{}finally{}if(u=_y(s,i,x,p),u!==null)return ia(u,s,p),L2(u,i,p),!0}return!1}function dv(s,i,u,p){if(p={lane:2,revertLane:$v(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Uh(s)){if(i)throw Error(r(479))}else i=_y(s,u,p,2),i!==null&&ia(i,s,2)}function Uh(s){var i=s.alternate;return s===ht||i!==null&&i===ht}function k2(s,i){Ac=Dh=!0;var u=s.pending;u===null?i.next=i:(i.next=u.next,u.next=i),s.pending=i}function L2(s,i,u){if((u&4194048)!==0){var p=i.lanes;p&=s.pendingLanes,u|=p,i.lanes=u,se(s,u)}}var md={readContext:Cr,use:Ih,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useLayoutEffect:An,useInsertionEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useSyncExternalStore:An,useId:An,useHostTransitionStatus:An,useFormState:An,useActionState:An,useOptimistic:An,useMemoCache:An,useCacheRefresh:An};md.useEffectEvent=An;var P2={readContext:Cr,use:Ih,useCallback:function(s,i){return Fr().memoizedState=[s,i===void 0?null:i],s},useContext:Cr,useEffect:b2,useImperativeHandle:function(s,i,u){u=u!=null?u.concat([s]):null,Lh(4194308,4,w2.bind(null,i,s),u)},useLayoutEffect:function(s,i){return Lh(4194308,4,s,i)},useInsertionEffect:function(s,i){Lh(4,2,s,i)},useMemo:function(s,i){var u=Fr();i=i===void 0?null:i;var p=s();if(El){vr(!0);try{s()}finally{vr(!1)}}return u.memoizedState=[p,i],p},useReducer:function(s,i,u){var p=Fr();if(u!==void 0){var x=u(i);if(El){vr(!0);try{u(i)}finally{vr(!1)}}}else x=i;return p.memoizedState=p.baseState=x,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:x},p.queue=s,s=s.dispatch=F8.bind(null,ht,s),[p.memoizedState,s]},useRef:function(s){var i=Fr();return s={current:s},i.memoizedState=s},useState:function(s){s=av(s);var i=s.queue,u=I2.bind(null,ht,i);return i.dispatch=u,[s.memoizedState,u]},useDebugValue:iv,useDeferredValue:function(s,i){var u=Fr();return lv(u,s,i)},useTransition:function(){var s=av(!1);return s=N2.bind(null,ht,s.queue,!0,!1),Fr().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,i,u){var p=ht,x=Fr();if(Mt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=i(),an===null)throw Error(r(349));(jt&127)!==0||a2(p,i,u)}x.memoizedState=u;var w={value:u,getSnapshot:i};return x.queue=w,b2(o2.bind(null,p,w,s),[s]),p.flags|=2048,Oc(9,{destroy:void 0},s2.bind(null,p,w,u,i),null),u},useId:function(){var s=Fr(),i=an.identifierPrefix;if(Mt){var u=Ms,p=Os;u=(p&~(1<<32-_n(p)-1)).toString(32)+u,i="_"+i+"R_"+u,u=Oh++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=O8++,i="_"+i+"r_"+u.toString(32)+"_";return s.memoizedState=i},useHostTransitionStatus:uv,useFormState:p2,useActionState:p2,useOptimistic:function(s){var i=Fr();i.memoizedState=i.baseState=s;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=dv.bind(null,ht,!0,u),u.dispatch=i,[s,i]},useMemoCache:tv,useCacheRefresh:function(){return Fr().memoizedState=U8.bind(null,ht)},useEffectEvent:function(s){var i=Fr(),u={impl:s};return i.memoizedState=u,function(){if((Bt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},fv={readContext:Cr,use:Ih,useCallback:j2,useContext:Cr,useEffect:ov,useImperativeHandle:R2,useInsertionEffect:C2,useLayoutEffect:E2,useMemo:T2,useReducer:kh,useRef:x2,useState:function(){return kh(ho)},useDebugValue:iv,useDeferredValue:function(s,i){var u=Hn();return _2(u,tn.memoizedState,s,i)},useTransition:function(){var s=kh(ho)[0],i=Hn().memoizedState;return[typeof s=="boolean"?s:fd(s),i]},useSyncExternalStore:r2,useId:O2,useHostTransitionStatus:uv,useFormState:g2,useActionState:g2,useOptimistic:function(s,i){var u=Hn();return c2(u,tn,s,i)},useMemoCache:tv,useCacheRefresh:M2};fv.useEffectEvent=S2;var U2={readContext:Cr,use:Ih,useCallback:j2,useContext:Cr,useEffect:ov,useImperativeHandle:R2,useInsertionEffect:C2,useLayoutEffect:E2,useMemo:T2,useReducer:rv,useRef:x2,useState:function(){return rv(ho)},useDebugValue:iv,useDeferredValue:function(s,i){var u=Hn();return tn===null?lv(u,s,i):_2(u,tn.memoizedState,s,i)},useTransition:function(){var s=rv(ho)[0],i=Hn().memoizedState;return[typeof s=="boolean"?s:fd(s),i]},useSyncExternalStore:r2,useId:O2,useHostTransitionStatus:uv,useFormState:v2,useActionState:v2,useOptimistic:function(s,i){var u=Hn();return tn!==null?c2(u,tn,s,i):(u.baseState=s,[s,u.queue.dispatch])},useMemoCache:tv,useCacheRefresh:M2};U2.useEffectEvent=S2;function hv(s,i,u,p){i=s.memoizedState,u=u(p,i),u=u==null?i:y({},i,u),s.memoizedState=u,s.lanes===0&&(s.updateQueue.baseState=u)}var mv={enqueueSetState:function(s,i,u){s=s._reactInternals;var p=Ra(),x=li(p);x.payload=i,u!=null&&(x.callback=u),i=ci(s,x,p),i!==null&&(ia(i,s,p),ld(i,s,p))},enqueueReplaceState:function(s,i,u){s=s._reactInternals;var p=Ra(),x=li(p);x.tag=1,x.payload=i,u!=null&&(x.callback=u),i=ci(s,x,p),i!==null&&(ia(i,s,p),ld(i,s,p))},enqueueForceUpdate:function(s,i){s=s._reactInternals;var u=Ra(),p=li(u);p.tag=2,i!=null&&(p.callback=i),i=ci(s,p,u),i!==null&&(ia(i,s,u),ld(i,s,u))}};function F2(s,i,u,p,x,w,N){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(p,w,N):i.prototype&&i.prototype.isPureReactComponent?!ed(u,p)||!ed(x,w):!0}function V2(s,i,u,p){s=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,p),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,p),i.state!==s&&mv.enqueueReplaceState(i,i.state,null)}function wl(s,i){var u=i;if("ref"in i){u={};for(var p in i)p!=="ref"&&(u[p]=i[p])}if(s=s.defaultProps){u===i&&(u=y({},u));for(var x in s)u[x]===void 0&&(u[x]=s[x])}return u}function z2(s){gh(s)}function H2(s){console.error(s)}function $2(s){gh(s)}function Fh(s,i){try{var u=s.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(p){setTimeout(function(){throw p})}}function B2(s,i,u){try{var p=s.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function pv(s,i,u){return u=li(u),u.tag=3,u.payload={element:null},u.callback=function(){Fh(s,i)},u}function G2(s){return s=li(s),s.tag=3,s}function q2(s,i,u,p){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var w=p.value;s.payload=function(){return x(w)},s.callback=function(){B2(i,u,p)}}var N=u.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(s.callback=function(){B2(i,u,p),typeof x!="function"&&(pi===null?pi=new Set([this]):pi.add(this));var I=p.stack;this.componentDidCatch(p.value,{componentStack:I!==null?I:""})})}function V8(s,i,u,p,x){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(i=u.alternate,i!==null&&wc(i,u,x,!0),u=Sa.current,u!==null){switch(u.tag){case 31:case 13:return Ka===null?Qh():u.alternate===null&&Dn===0&&(Dn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,p===jh?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([p]):i.add(p),Vv(s,p,x)),!1;case 22:return u.flags|=65536,p===jh?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([p]):u.add(p)),Vv(s,p,x)),!1}throw Error(r(435,u.tag))}return Vv(s,p,x),Qh(),!1}if(Mt)return i=Sa.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=x,p!==Iy&&(s=Error(r(422),{cause:p}),rd(Ba(s,u)))):(p!==Iy&&(i=Error(r(423),{cause:p}),rd(Ba(i,u))),s=s.current.alternate,s.flags|=65536,x&=-x,s.lanes|=x,p=Ba(p,u),x=pv(s.stateNode,p,x),Gy(s,x),Dn!==4&&(Dn=2)),!1;var w=Error(r(520),{cause:p});if(w=Ba(w,u),Cd===null?Cd=[w]:Cd.push(w),Dn!==4&&(Dn=2),i===null)return!0;p=Ba(p,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,s=x&-x,u.lanes|=s,s=pv(u.stateNode,p,s),Gy(u,s),!1;case 1:if(i=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(pi===null||!pi.has(w))))return u.flags|=65536,x&=-x,u.lanes|=x,x=G2(x),q2(x,s,u,p),Gy(u,x),!1}u=u.return}while(u!==null);return!1}var gv=Error(r(461)),Yn=!1;function Er(s,i,u,p){i.child=s===null?WC(i,null,u,p):Cl(i,s.child,u,p)}function Z2(s,i,u,p,x){u=u.render;var w=i.ref;if("ref"in p){var N={};for(var I in p)I!=="ref"&&(N[I]=p[I])}else N=p;return vl(i),p=Qy(s,i,u,N,w,x),I=Xy(),s!==null&&!Yn?(Jy(s,i,x),mo(s,i,x)):(Mt&&I&&Oy(i),i.flags|=1,Er(s,i,p,x),i.child)}function K2(s,i,u,p,x){if(s===null){var w=u.type;return typeof w=="function"&&!Ny(w)&&w.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=w,Y2(s,i,w,p,x)):(s=bh(u.type,null,p,i,i.mode,x),s.ref=i.ref,s.return=i,i.child=s)}if(w=s.child,!wv(s,x)){var N=w.memoizedProps;if(u=u.compare,u=u!==null?u:ed,u(N,p)&&s.ref===i.ref)return mo(s,i,x)}return i.flags|=1,s=io(w,p),s.ref=i.ref,s.return=i,i.child=s}function Y2(s,i,u,p,x){if(s!==null){var w=s.memoizedProps;if(ed(w,p)&&s.ref===i.ref)if(Yn=!1,i.pendingProps=p=w,wv(s,x))(s.flags&131072)!==0&&(Yn=!0);else return i.lanes=s.lanes,mo(s,i,x)}return yv(s,i,u,p,x)}function W2(s,i,u,p){var x=p.children,w=s!==null?s.memoizedState:null;if(s===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((i.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,s!==null){for(p=i.child=s.child,x=0;p!==null;)x=x|p.lanes|p.childLanes,p=p.sibling;p=x&~w}else p=0,i.child=null;return Q2(s,i,w,u,p)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},s!==null&&wh(i,w!==null?w.cachePool:null),w!==null?JC(i,w):Zy(),e2(i);else return p=i.lanes=536870912,Q2(s,i,w!==null?w.baseLanes|u:u,u,p)}else w!==null?(wh(i,w.cachePool),JC(i,w),di(),i.memoizedState=null):(s!==null&&wh(i,null),Zy(),di());return Er(s,i,x,u),i.child}function pd(s,i){return s!==null&&s.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Q2(s,i,u,p,x){var w=zy();return w=w===null?null:{parent:Zn._currentValue,pool:w},i.memoizedState={baseLanes:u,cachePool:w},s!==null&&wh(i,null),Zy(),e2(i),s!==null&&wc(s,i,p,!0),i.childLanes=x,null}function Vh(s,i){return i=Hh({mode:i.mode,children:i.children},s.mode),i.ref=s.ref,s.child=i,i.return=s,i}function X2(s,i,u){return Cl(i,s.child,null,u),s=Vh(i,i.pendingProps),s.flags|=2,Ca(i),i.memoizedState=null,s}function z8(s,i,u){var p=i.pendingProps,x=(i.flags&128)!==0;if(i.flags&=-129,s===null){if(Mt){if(p.mode==="hidden")return s=Vh(i,p),i.lanes=536870912,pd(null,s);if(Yy(i),(s=hn)?(s=uw(s,Za),s=s!==null&&s.data==="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:ri!==null?{id:Os,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},u=kC(s),u.return=i,i.child=u,Sr=i,hn=null)):s=null,s===null)throw si(i);return i.lanes=536870912,null}return Vh(i,p)}var w=s.memoizedState;if(w!==null){var N=w.dehydrated;if(Yy(i),x)if(i.flags&256)i.flags&=-257,i=X2(s,i,u);else if(i.memoizedState!==null)i.child=s.child,i.flags|=128,i=null;else throw Error(r(558));else if(Yn||wc(s,i,u,!1),x=(u&s.childLanes)!==0,Yn||x){if(p=an,p!==null&&(N=ge(p,u),N!==0&&N!==w.retryLane))throw w.retryLane=N,ml(s,N),ia(p,s,N),gv;Qh(),i=X2(s,i,u)}else s=w.treeContext,hn=Ya(N.nextSibling),Sr=i,Mt=!0,ai=null,Za=!1,s!==null&&UC(i,s),i=Vh(i,p),i.flags|=4096;return i}return s=io(s.child,{mode:p.mode,children:p.children}),s.ref=i.ref,i.child=s,s.return=i,s}function zh(s,i){var u=i.ref;if(u===null)s!==null&&s.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(s===null||s.ref!==u)&&(i.flags|=4194816)}}function yv(s,i,u,p,x){return vl(i),u=Qy(s,i,u,p,void 0,x),p=Xy(),s!==null&&!Yn?(Jy(s,i,x),mo(s,i,x)):(Mt&&p&&Oy(i),i.flags|=1,Er(s,i,u,x),i.child)}function J2(s,i,u,p,x,w){return vl(i),i.updateQueue=null,u=n2(i,p,u,x),t2(s),p=Xy(),s!==null&&!Yn?(Jy(s,i,w),mo(s,i,w)):(Mt&&p&&Oy(i),i.flags|=1,Er(s,i,u,w),i.child)}function eE(s,i,u,p,x){if(vl(i),i.stateNode===null){var w=bc,N=u.contextType;typeof N=="object"&&N!==null&&(w=Cr(N)),w=new u(p,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=mv,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=p,w.state=i.memoizedState,w.refs={},$y(i),N=u.contextType,w.context=typeof N=="object"&&N!==null?Cr(N):bc,w.state=i.memoizedState,N=u.getDerivedStateFromProps,typeof N=="function"&&(hv(i,u,N,p),w.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(N=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),N!==w.state&&mv.enqueueReplaceState(w,w.state,null),ud(i,p,w,x),cd(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),p=!0}else if(s===null){w=i.stateNode;var I=i.memoizedProps,B=wl(u,I);w.props=B;var ae=w.context,he=u.contextType;N=bc,typeof he=="object"&&he!==null&&(N=Cr(he));var pe=u.getDerivedStateFromProps;he=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",I=i.pendingProps!==I,he||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(I||ae!==N)&&V2(i,w,p,N),ii=!1;var oe=i.memoizedState;w.state=oe,ud(i,p,w,x),cd(),ae=i.memoizedState,I||oe!==ae||ii?(typeof pe=="function"&&(hv(i,u,pe,p),ae=i.memoizedState),(B=ii||F2(i,u,B,p,oe,ae,N))?(he||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(i.flags|=4194308)):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=p,i.memoizedState=ae),w.props=p,w.state=ae,w.context=N,p=B):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),p=!1)}else{w=i.stateNode,By(s,i),N=i.memoizedProps,he=wl(u,N),w.props=he,pe=i.pendingProps,oe=w.context,ae=u.contextType,B=bc,typeof ae=="object"&&ae!==null&&(B=Cr(ae)),I=u.getDerivedStateFromProps,(ae=typeof I=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N!==pe||oe!==B)&&V2(i,w,p,B),ii=!1,oe=i.memoizedState,w.state=oe,ud(i,p,w,x),cd();var fe=i.memoizedState;N!==pe||oe!==fe||ii||s!==null&&s.dependencies!==null&&Ch(s.dependencies)?(typeof I=="function"&&(hv(i,u,I,p),fe=i.memoizedState),(he=ii||F2(i,u,he,p,oe,fe,B)||s!==null&&s.dependencies!==null&&Ch(s.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,fe,B),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,fe,B)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||N===s.memoizedProps&&oe===s.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===s.memoizedProps&&oe===s.memoizedState||(i.flags|=1024),i.memoizedProps=p,i.memoizedState=fe),w.props=p,w.state=fe,w.context=B,p=he):(typeof w.componentDidUpdate!="function"||N===s.memoizedProps&&oe===s.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||N===s.memoizedProps&&oe===s.memoizedState||(i.flags|=1024),p=!1)}return w=p,zh(s,i),p=(i.flags&128)!==0,w||p?(w=i.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:w.render(),i.flags|=1,s!==null&&p?(i.child=Cl(i,s.child,null,x),i.child=Cl(i,null,u,x)):Er(s,i,u,x),i.memoizedState=w.state,s=i.child):s=mo(s,i,x),s}function tE(s,i,u,p){return gl(),i.flags|=256,Er(s,i,u,p),i.child}var vv={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function xv(s){return{baseLanes:s,cachePool:BC()}}function bv(s,i,u){return s=s!==null?s.childLanes&~u:0,i&&(s|=wa),s}function nE(s,i,u){var p=i.pendingProps,x=!1,w=(i.flags&128)!==0,N;if((N=w)||(N=s!==null&&s.memoizedState===null?!1:(zn.current&2)!==0),N&&(x=!0,i.flags&=-129),N=(i.flags&32)!==0,i.flags&=-33,s===null){if(Mt){if(x?ui(i):di(),(s=hn)?(s=uw(s,Za),s=s!==null&&s.data!=="&"?s:null,s!==null&&(i.memoizedState={dehydrated:s,treeContext:ri!==null?{id:Os,overflow:Ms}:null,retryLane:536870912,hydrationErrors:null},u=kC(s),u.return=i,i.child=u,Sr=i,hn=null)):s=null,s===null)throw si(i);return nx(s)?i.lanes=32:i.lanes=536870912,null}var I=p.children;return p=p.fallback,x?(di(),x=i.mode,I=Hh({mode:"hidden",children:I},x),p=pl(p,x,u,null),I.return=i,p.return=i,I.sibling=p,i.child=I,p=i.child,p.memoizedState=xv(u),p.childLanes=bv(s,N,u),i.memoizedState=vv,pd(null,p)):(ui(i),Sv(i,I))}var B=s.memoizedState;if(B!==null&&(I=B.dehydrated,I!==null)){if(w)i.flags&256?(ui(i),i.flags&=-257,i=Cv(s,i,u)):i.memoizedState!==null?(di(),i.child=s.child,i.flags|=128,i=null):(di(),I=p.fallback,x=i.mode,p=Hh({mode:"visible",children:p.children},x),I=pl(I,x,u,null),I.flags|=2,p.return=i,I.return=i,p.sibling=I,i.child=p,Cl(i,s.child,null,u),p=i.child,p.memoizedState=xv(u),p.childLanes=bv(s,N,u),i.memoizedState=vv,i=pd(null,p));else if(ui(i),nx(I)){if(N=I.nextSibling&&I.nextSibling.dataset,N)var ae=N.dgst;N=ae,p=Error(r(419)),p.stack="",p.digest=N,rd({value:p,source:null,stack:null}),i=Cv(s,i,u)}else if(Yn||wc(s,i,u,!1),N=(u&s.childLanes)!==0,Yn||N){if(N=an,N!==null&&(p=ge(N,u),p!==0&&p!==B.retryLane))throw B.retryLane=p,ml(s,p),ia(N,s,p),gv;tx(I)||Qh(),i=Cv(s,i,u)}else tx(I)?(i.flags|=192,i.child=s.child,i=null):(s=B.treeContext,hn=Ya(I.nextSibling),Sr=i,Mt=!0,ai=null,Za=!1,s!==null&&UC(i,s),i=Sv(i,p.children),i.flags|=4096);return i}return x?(di(),I=p.fallback,x=i.mode,B=s.child,ae=B.sibling,p=io(B,{mode:"hidden",children:p.children}),p.subtreeFlags=B.subtreeFlags&65011712,ae!==null?I=io(ae,I):(I=pl(I,x,u,null),I.flags|=2),I.return=i,p.return=i,p.sibling=I,i.child=p,pd(null,p),p=i.child,I=s.child.memoizedState,I===null?I=xv(u):(x=I.cachePool,x!==null?(B=Zn._currentValue,x=x.parent!==B?{parent:B,pool:B}:x):x=BC(),I={baseLanes:I.baseLanes|u,cachePool:x}),p.memoizedState=I,p.childLanes=bv(s,N,u),i.memoizedState=vv,pd(s.child,p)):(ui(i),u=s.child,s=u.sibling,u=io(u,{mode:"visible",children:p.children}),u.return=i,u.sibling=null,s!==null&&(N=i.deletions,N===null?(i.deletions=[s],i.flags|=16):N.push(s)),i.child=u,i.memoizedState=null,u)}function Sv(s,i){return i=Hh({mode:"visible",children:i},s.mode),i.return=s,s.child=i}function Hh(s,i){return s=ba(22,s,null,i),s.lanes=0,s}function Cv(s,i,u){return Cl(i,s.child,null,u),s=Sv(i,i.pendingProps.children),s.flags|=2,i.memoizedState=null,s}function rE(s,i,u){s.lanes|=i;var p=s.alternate;p!==null&&(p.lanes|=i),Py(s.return,i,u)}function Ev(s,i,u,p,x,w){var N=s.memoizedState;N===null?s.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:x,treeForkCount:w}:(N.isBackwards=i,N.rendering=null,N.renderingStartTime=0,N.last=p,N.tail=u,N.tailMode=x,N.treeForkCount=w)}function aE(s,i,u){var p=i.pendingProps,x=p.revealOrder,w=p.tail;p=p.children;var N=zn.current,I=(N&2)!==0;if(I?(N=N&1|2,i.flags|=128):N&=1,W(zn,N),Er(s,i,p,u),p=Mt?nd:0,!I&&s!==null&&(s.flags&128)!==0)e:for(s=i.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&rE(s,u,i);else if(s.tag===19)rE(s,u,i);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(x){case"forwards":for(u=i.child,x=null;u!==null;)s=u.alternate,s!==null&&Ah(s)===null&&(x=u),u=u.sibling;u=x,u===null?(x=i.child,i.child=null):(x=u.sibling,u.sibling=null),Ev(i,!1,x,u,w,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=i.child,i.child=null;x!==null;){if(s=x.alternate,s!==null&&Ah(s)===null){i.child=x;break}s=x.sibling,x.sibling=u,u=x,x=s}Ev(i,!0,u,null,w,p);break;case"together":Ev(i,!1,null,null,void 0,p);break;default:i.memoizedState=null}return i.child}function mo(s,i,u){if(s!==null&&(i.dependencies=s.dependencies),mi|=i.lanes,(u&i.childLanes)===0)if(s!==null){if(wc(s,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(s!==null&&i.child!==s.child)throw Error(r(153));if(i.child!==null){for(s=i.child,u=io(s,s.pendingProps),i.child=u,u.return=i;s.sibling!==null;)s=s.sibling,u=u.sibling=io(s,s.pendingProps),u.return=i;u.sibling=null}return i.child}function wv(s,i){return(s.lanes&i)!==0?!0:(s=s.dependencies,!!(s!==null&&Ch(s)))}function H8(s,i,u){switch(i.tag){case 3:Ae(i,i.stateNode.containerInfo),oi(i,Zn,s.memoizedState.cache),gl();break;case 27:case 5:Ne(i);break;case 4:Ae(i,i.stateNode.containerInfo);break;case 10:oi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Yy(i),null;break;case 13:var p=i.memoizedState;if(p!==null)return p.dehydrated!==null?(ui(i),i.flags|=128,null):(u&i.child.childLanes)!==0?nE(s,i,u):(ui(i),s=mo(s,i,u),s!==null?s.sibling:null);ui(i);break;case 19:var x=(s.flags&128)!==0;if(p=(u&i.childLanes)!==0,p||(wc(s,i,u,!1),p=(u&i.childLanes)!==0),x){if(p)return aE(s,i,u);i.flags|=128}if(x=i.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),W(zn,zn.current),p)break;return null;case 22:return i.lanes=0,W2(s,i,u,i.pendingProps);case 24:oi(i,Zn,s.memoizedState.cache)}return mo(s,i,u)}function sE(s,i,u){if(s!==null)if(s.memoizedProps!==i.pendingProps)Yn=!0;else{if(!wv(s,u)&&(i.flags&128)===0)return Yn=!1,H8(s,i,u);Yn=(s.flags&131072)!==0}else Yn=!1,Mt&&(i.flags&1048576)!==0&&PC(i,nd,i.index);switch(i.lanes=0,i.tag){case 16:e:{var p=i.pendingProps;if(s=bl(i.elementType),i.type=s,typeof s=="function")Ny(s)?(p=wl(s,p),i.tag=1,i=eE(null,i,s,p,u)):(i.tag=0,i=yv(null,i,s,p,u));else{if(s!=null){var x=s.$$typeof;if(x===D){i.tag=11,i=Z2(null,i,s,p,u);break e}else if(x===T){i.tag=14,i=K2(null,i,s,p,u);break e}}throw i=U(s)||s,Error(r(306,i,""))}}return i;case 0:return yv(s,i,i.type,i.pendingProps,u);case 1:return p=i.type,x=wl(p,i.pendingProps),eE(s,i,p,x,u);case 3:e:{if(Ae(i,i.stateNode.containerInfo),s===null)throw Error(r(387));p=i.pendingProps;var w=i.memoizedState;x=w.element,By(s,i),ud(i,p,null,u);var N=i.memoizedState;if(p=N.cache,oi(i,Zn,p),p!==w.cache&&Uy(i,[Zn],u,!0),cd(),p=N.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:N.cache},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){i=tE(s,i,p,u);break e}else if(p!==x){x=Ba(Error(r(424)),i),rd(x),i=tE(s,i,p,u);break e}else{switch(s=i.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(hn=Ya(s.firstChild),Sr=i,Mt=!0,ai=null,Za=!0,u=WC(i,null,p,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(gl(),p===x){i=mo(s,i,u);break e}Er(s,i,p,u)}i=i.child}return i;case 26:return zh(s,i),s===null?(u=gw(i.type,null,i.pendingProps,null))?i.memoizedState=u:Mt||(u=i.type,s=i.pendingProps,p=am(ve.current).createElement(u),p[He]=i,p[qe]=s,wr(p,u,s),Nn(p),i.stateNode=p):i.memoizedState=gw(i.type,s.memoizedProps,i.pendingProps,s.memoizedState),null;case 27:return Ne(i),s===null&&Mt&&(p=i.stateNode=hw(i.type,i.pendingProps,ve.current),Sr=i,Za=!0,x=hn,xi(i.type)?(rx=x,hn=Ya(p.firstChild)):hn=x),Er(s,i,i.pendingProps.children,u),zh(s,i),s===null&&(i.flags|=4194304),i.child;case 5:return s===null&&Mt&&((x=p=hn)&&(p=vM(p,i.type,i.pendingProps,Za),p!==null?(i.stateNode=p,Sr=i,hn=Ya(p.firstChild),Za=!1,x=!0):x=!1),x||si(i)),Ne(i),x=i.type,w=i.pendingProps,N=s!==null?s.memoizedProps:null,p=w.children,Xv(x,w)?p=null:N!==null&&Xv(x,N)&&(i.flags|=32),i.memoizedState!==null&&(x=Qy(s,i,M8,null,null,u),Ad._currentValue=x),zh(s,i),Er(s,i,p,u),i.child;case 6:return s===null&&Mt&&((s=u=hn)&&(u=xM(u,i.pendingProps,Za),u!==null?(i.stateNode=u,Sr=i,hn=null,s=!0):s=!1),s||si(i)),null;case 13:return nE(s,i,u);case 4:return Ae(i,i.stateNode.containerInfo),p=i.pendingProps,s===null?i.child=Cl(i,null,p,u):Er(s,i,p,u),i.child;case 11:return Z2(s,i,i.type,i.pendingProps,u);case 7:return Er(s,i,i.pendingProps,u),i.child;case 8:return Er(s,i,i.pendingProps.children,u),i.child;case 12:return Er(s,i,i.pendingProps.children,u),i.child;case 10:return p=i.pendingProps,oi(i,i.type,p.value),Er(s,i,p.children,u),i.child;case 9:return x=i.type._context,p=i.pendingProps.children,vl(i),x=Cr(x),p=p(x),i.flags|=1,Er(s,i,p,u),i.child;case 14:return K2(s,i,i.type,i.pendingProps,u);case 15:return Y2(s,i,i.type,i.pendingProps,u);case 19:return aE(s,i,u);case 31:return z8(s,i,u);case 22:return W2(s,i,u,i.pendingProps);case 24:return vl(i),p=Cr(Zn),s===null?(x=zy(),x===null&&(x=an,w=Fy(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=u),x=w),i.memoizedState={parent:p,cache:x},$y(i),oi(i,Zn,x)):((s.lanes&u)!==0&&(By(s,i),ud(i,null,null,u),cd()),x=s.memoizedState,w=i.memoizedState,x.parent!==p?(x={parent:p,cache:p},i.memoizedState=x,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=x),oi(i,Zn,p)):(p=w.cache,oi(i,Zn,p),p!==x.cache&&Uy(i,[Zn],u,!0))),Er(s,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function po(s){s.flags|=4}function Rv(s,i,u,p,x){if((i=(s.mode&32)!==0)&&(i=!1),i){if(s.flags|=16777216,(x&335544128)===x)if(s.stateNode.complete)s.flags|=8192;else if(OE())s.flags|=8192;else throw Sl=jh,Hy}else s.flags&=-16777217}function oE(s,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!Sw(i))if(OE())s.flags|=8192;else throw Sl=jh,Hy}function $h(s,i){i!==null&&(s.flags|=4),s.flags&16384&&(i=s.tag!==22?Vn():536870912,s.lanes|=i,Lc|=i)}function gd(s,i){if(!Mt)switch(s.tailMode){case"hidden":i=s.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?s.tail=null:u.sibling=null;break;case"collapsed":u=s.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?i||s.tail===null?s.tail=null:s.tail.sibling=null:p.sibling=null}}function mn(s){var i=s.alternate!==null&&s.alternate.child===s.child,u=0,p=0;if(i)for(var x=s.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags&65011712,p|=x.flags&65011712,x.return=s,x=x.sibling;else for(x=s.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=s,x=x.sibling;return s.subtreeFlags|=p,s.childLanes=u,i}function $8(s,i,u){var p=i.pendingProps;switch(My(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(i),null;case 1:return mn(i),null;case 3:return u=i.stateNode,p=null,s!==null&&(p=s.memoizedState.cache),i.memoizedState.cache!==p&&(i.flags|=2048),uo(Zn),we(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(s===null||s.child===null)&&(Ec(i)?po(i):s===null||s.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,ky())),mn(i),null;case 26:var x=i.type,w=i.memoizedState;return s===null?(po(i),w!==null?(mn(i),oE(i,w)):(mn(i),Rv(i,x,null,p,u))):w?w!==s.memoizedState?(po(i),mn(i),oE(i,w)):(mn(i),i.flags&=-16777217):(s=s.memoizedProps,s!==p&&po(i),mn(i),Rv(i,x,s,p,u)),null;case 27:if(Be(i),u=ve.current,x=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==p&&po(i);else{if(!p){if(i.stateNode===null)throw Error(r(166));return mn(i),null}s=te.current,Ec(i)?FC(i):(s=hw(x,p,u),i.stateNode=s,po(i))}return mn(i),null;case 5:if(Be(i),x=i.type,s!==null&&i.stateNode!=null)s.memoizedProps!==p&&po(i);else{if(!p){if(i.stateNode===null)throw Error(r(166));return mn(i),null}if(w=te.current,Ec(i))FC(i);else{var N=am(ve.current);switch(w){case 1:w=N.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:w=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":w=N.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":w=N.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":w=N.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?N.createElement("select",{is:p.is}):N.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?N.createElement(x,{is:p.is}):N.createElement(x)}}w[He]=i,w[qe]=p;e:for(N=i.child;N!==null;){if(N.tag===5||N.tag===6)w.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===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=w;e:switch(wr(w,x,p),x){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&po(i)}}return mn(i),Rv(i,i.type,s===null?null:s.memoizedProps,i.pendingProps,u),null;case 6:if(s&&i.stateNode!=null)s.memoizedProps!==p&&po(i);else{if(typeof p!="string"&&i.stateNode===null)throw Error(r(166));if(s=ve.current,Ec(i)){if(s=i.stateNode,u=i.memoizedProps,p=null,x=Sr,x!==null)switch(x.tag){case 27:case 5:p=x.memoizedProps}s[He]=i,s=!!(s.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||nw(s.nodeValue,u)),s||si(i,!0)}else s=am(s).createTextNode(p),s[He]=i,i.stateNode=s}return mn(i),null;case 31:if(u=i.memoizedState,s===null||s.memoizedState!==null){if(p=Ec(i),u!==null){if(s===null){if(!p)throw Error(r(318));if(s=i.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(r(557));s[He]=i}else gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mn(i),s=!1}else u=ky(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=u),s=!0;if(!s)return i.flags&256?(Ca(i),i):(Ca(i),null);if((i.flags&128)!==0)throw Error(r(558))}return mn(i),null;case 13:if(p=i.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(x=Ec(i),p!==null&&p.dehydrated!==null){if(s===null){if(!x)throw Error(r(318));if(x=i.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[He]=i}else gl(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;mn(i),x=!1}else x=ky(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=x),x=!0;if(!x)return i.flags&256?(Ca(i),i):(Ca(i),null)}return Ca(i),(i.flags&128)!==0?(i.lanes=u,i):(u=p!==null,s=s!==null&&s.memoizedState!==null,u&&(p=i.child,x=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(x=p.alternate.memoizedState.cachePool.pool),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==x&&(p.flags|=2048)),u!==s&&u&&(i.child.flags|=8192),$h(i,i.updateQueue),mn(i),null);case 4:return we(),s===null&&Zv(i.stateNode.containerInfo),mn(i),null;case 10:return uo(i.type),mn(i),null;case 19:if(P(zn),p=i.memoizedState,p===null)return mn(i),null;if(x=(i.flags&128)!==0,w=p.rendering,w===null)if(x)gd(p,!1);else{if(Dn!==0||s!==null&&(s.flags&128)!==0)for(s=i.child;s!==null;){if(w=Ah(s),w!==null){for(i.flags|=128,gd(p,!1),s=w.updateQueue,i.updateQueue=s,$h(i,s),i.subtreeFlags=0,s=u,u=i.child;u!==null;)IC(u,s),u=u.sibling;return W(zn,zn.current&1|2),Mt&&lo(i,p.treeForkCount),i.child}s=s.sibling}p.tail!==null&&Se()>Kh&&(i.flags|=128,x=!0,gd(p,!1),i.lanes=4194304)}else{if(!x)if(s=Ah(w),s!==null){if(i.flags|=128,x=!0,s=s.updateQueue,i.updateQueue=s,$h(i,s),gd(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!Mt)return mn(i),null}else 2*Se()-p.renderingStartTime>Kh&&u!==536870912&&(i.flags|=128,x=!0,gd(p,!1),i.lanes=4194304);p.isBackwards?(w.sibling=i.child,i.child=w):(s=p.last,s!==null?s.sibling=w:i.child=w,p.last=w)}return p.tail!==null?(s=p.tail,p.rendering=s,p.tail=s.sibling,p.renderingStartTime=Se(),s.sibling=null,u=zn.current,W(zn,x?u&1|2:u&1),Mt&&lo(i,p.treeForkCount),s):(mn(i),null);case 22:case 23:return Ca(i),Ky(),p=i.memoizedState!==null,s!==null?s.memoizedState!==null!==p&&(i.flags|=8192):p&&(i.flags|=8192),p?(u&536870912)!==0&&(i.flags&128)===0&&(mn(i),i.subtreeFlags&6&&(i.flags|=8192)):mn(i),u=i.updateQueue,u!==null&&$h(i,u.retryQueue),u=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),p=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(p=i.memoizedState.cachePool.pool),p!==u&&(i.flags|=2048),s!==null&&P(xl),null;case 24:return u=null,s!==null&&(u=s.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),uo(Zn),mn(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function B8(s,i){switch(My(i),i.tag){case 1:return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 3:return uo(Zn),we(),s=i.flags,(s&65536)!==0&&(s&128)===0?(i.flags=s&-65537|128,i):null;case 26:case 27:case 5:return Be(i),null;case 31:if(i.memoizedState!==null){if(Ca(i),i.alternate===null)throw Error(r(340));gl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 13:if(Ca(i),s=i.memoizedState,s!==null&&s.dehydrated!==null){if(i.alternate===null)throw Error(r(340));gl()}return s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 19:return P(zn),null;case 4:return we(),null;case 10:return uo(i.type),null;case 22:case 23:return Ca(i),Ky(),s!==null&&P(xl),s=i.flags,s&65536?(i.flags=s&-65537|128,i):null;case 24:return uo(Zn),null;case 25:return null;default:return null}}function iE(s,i){switch(My(i),i.tag){case 3:uo(Zn),we();break;case 26:case 27:case 5:Be(i);break;case 4:we();break;case 31:i.memoizedState!==null&&Ca(i);break;case 13:Ca(i);break;case 19:P(zn);break;case 10:uo(i.type);break;case 22:case 23:Ca(i),Ky(),s!==null&&P(xl);break;case 24:uo(Zn)}}function yd(s,i){try{var u=i.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var x=p.next;u=x;do{if((u.tag&s)===s){p=void 0;var w=u.create,N=u.inst;p=w(),N.destroy=p}u=u.next}while(u!==x)}}catch(I){Qt(i,i.return,I)}}function fi(s,i,u){try{var p=i.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var w=x.next;p=w;do{if((p.tag&s)===s){var N=p.inst,I=N.destroy;if(I!==void 0){N.destroy=void 0,x=i;var B=u,ae=I;try{ae()}catch(he){Qt(x,B,he)}}}p=p.next}while(p!==w)}}catch(he){Qt(i,i.return,he)}}function lE(s){var i=s.updateQueue;if(i!==null){var u=s.stateNode;try{XC(i,u)}catch(p){Qt(s,s.return,p)}}}function cE(s,i,u){u.props=wl(s.type,s.memoizedProps),u.state=s.memoizedState;try{u.componentWillUnmount()}catch(p){Qt(s,i,p)}}function vd(s,i){try{var u=s.ref;if(u!==null){switch(s.tag){case 26:case 27:case 5:var p=s.stateNode;break;case 30:p=s.stateNode;break;default:p=s.stateNode}typeof u=="function"?s.refCleanup=u(p):u.current=p}}catch(x){Qt(s,i,x)}}function Is(s,i){var u=s.ref,p=s.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(x){Qt(s,i,x)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){Qt(s,i,x)}else u.current=null}function uE(s){var i=s.type,u=s.memoizedProps,p=s.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(x){Qt(s,s.return,x)}}function jv(s,i,u){try{var p=s.stateNode;fM(p,s.type,u,i),p[qe]=i}catch(x){Qt(s,s.return,x)}}function dE(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&xi(s.type)||s.tag===4}function Tv(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||dE(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&xi(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function _v(s,i,u){var p=s.tag;if(p===5||p===6)s=s.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(s,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(s),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=so));else if(p!==4&&(p===27&&xi(s.type)&&(u=s.stateNode,i=null),s=s.child,s!==null))for(_v(s,i,u),s=s.sibling;s!==null;)_v(s,i,u),s=s.sibling}function Bh(s,i,u){var p=s.tag;if(p===5||p===6)s=s.stateNode,i?u.insertBefore(s,i):u.appendChild(s);else if(p!==4&&(p===27&&xi(s.type)&&(u=s.stateNode),s=s.child,s!==null))for(Bh(s,i,u),s=s.sibling;s!==null;)Bh(s,i,u),s=s.sibling}function fE(s){var i=s.stateNode,u=s.memoizedProps;try{for(var p=s.type,x=i.attributes;x.length;)i.removeAttributeNode(x[0]);wr(i,p,u),i[He]=s,i[qe]=u}catch(w){Qt(s,s.return,w)}}var go=!1,Wn=!1,Nv=!1,hE=typeof WeakSet=="function"?WeakSet:Set,mr=null;function G8(s,i){if(s=s.containerInfo,Wv=dm,s=RC(s),Cy(s)){if("selectionStart"in s)var u={start:s.selectionStart,end:s.selectionEnd};else e:{u=(u=s.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var x=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var N=0,I=-1,B=-1,ae=0,he=0,pe=s,oe=null;t:for(;;){for(var fe;pe!==u||x!==0&&pe.nodeType!==3||(I=N+x),pe!==w||p!==0&&pe.nodeType!==3||(B=N+p),pe.nodeType===3&&(N+=pe.nodeValue.length),(fe=pe.firstChild)!==null;)oe=pe,pe=fe;for(;;){if(pe===s)break t;if(oe===u&&++ae===x&&(I=N),oe===w&&++he===p&&(B=N),(fe=pe.nextSibling)!==null)break;pe=oe,oe=pe.parentNode}pe=fe}u=I===-1||B===-1?null:{start:I,end:B}}else u=null}u=u||{start:0,end:0}}else u=null;for(Qv={focusedElem:s,selectionRange:u},dm=!1,mr=i;mr!==null;)if(i=mr,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,mr=s;else for(;mr!==null;){switch(i=mr,w=i.alternate,s=i.flags,i.tag){case 0:if((s&4)!==0&&(s=i.updateQueue,s=s!==null?s.events:null,s!==null))for(u=0;u<s.length;u++)x=s[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&w!==null){s=void 0,u=i,x=w.memoizedProps,w=w.memoizedState,p=u.stateNode;try{var Ge=wl(u.type,x);s=p.getSnapshotBeforeUpdate(Ge,w),p.__reactInternalSnapshotBeforeUpdate=s}catch(nt){Qt(u,u.return,nt)}}break;case 3:if((s&1024)!==0){if(s=i.stateNode.containerInfo,u=s.nodeType,u===9)ex(s);else if(u===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":ex(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(r(163))}if(s=i.sibling,s!==null){s.return=i.return,mr=s;break}mr=i.return}}function mE(s,i,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:vo(s,u),p&4&&yd(5,u);break;case 1:if(vo(s,u),p&4)if(s=u.stateNode,i===null)try{s.componentDidMount()}catch(N){Qt(u,u.return,N)}else{var x=wl(u.type,i.memoizedProps);i=i.memoizedState;try{s.componentDidUpdate(x,i,s.__reactInternalSnapshotBeforeUpdate)}catch(N){Qt(u,u.return,N)}}p&64&&lE(u),p&512&&vd(u,u.return);break;case 3:if(vo(s,u),p&64&&(s=u.updateQueue,s!==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{XC(s,i)}catch(N){Qt(u,u.return,N)}}break;case 27:i===null&&p&4&&fE(u);case 26:case 5:vo(s,u),i===null&&p&4&&uE(u),p&512&&vd(u,u.return);break;case 12:vo(s,u);break;case 31:vo(s,u),p&4&&yE(s,u);break;case 13:vo(s,u),p&4&&vE(s,u),p&64&&(s=u.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(u=eM.bind(null,u),bM(s,u))));break;case 22:if(p=u.memoizedState!==null||go,!p){i=i!==null&&i.memoizedState!==null||Wn,x=go;var w=Wn;go=p,(Wn=i)&&!w?xo(s,u,(u.subtreeFlags&8772)!==0):vo(s,u),go=x,Wn=w}break;case 30:break;default:vo(s,u)}}function pE(s){var i=s.alternate;i!==null&&(s.alternate=null,pE(i)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(i=s.stateNode,i!==null&&Yt(i)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var yn=null,ra=!1;function yo(s,i,u){for(u=u.child;u!==null;)gE(s,i,u),u=u.sibling}function gE(s,i,u){if(Tn&&typeof Tn.onCommitFiberUnmount=="function")try{Tn.onCommitFiberUnmount(Fn,u)}catch{}switch(u.tag){case 26:Wn||Is(u,i),yo(s,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Wn||Is(u,i);var p=yn,x=ra;xi(u.type)&&(yn=u.stateNode,ra=!1),yo(s,i,u),Td(u.stateNode),yn=p,ra=x;break;case 5:Wn||Is(u,i);case 6:if(p=yn,x=ra,yn=null,yo(s,i,u),yn=p,ra=x,yn!==null)if(ra)try{(yn.nodeType===9?yn.body:yn.nodeName==="HTML"?yn.ownerDocument.body:yn).removeChild(u.stateNode)}catch(w){Qt(u,i,w)}else try{yn.removeChild(u.stateNode)}catch(w){Qt(u,i,w)}break;case 18:yn!==null&&(ra?(s=yn,lw(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,u.stateNode),Bc(s)):lw(yn,u.stateNode));break;case 4:p=yn,x=ra,yn=u.stateNode.containerInfo,ra=!0,yo(s,i,u),yn=p,ra=x;break;case 0:case 11:case 14:case 15:fi(2,u,i),Wn||fi(4,u,i),yo(s,i,u);break;case 1:Wn||(Is(u,i),p=u.stateNode,typeof p.componentWillUnmount=="function"&&cE(u,i,p)),yo(s,i,u);break;case 21:yo(s,i,u);break;case 22:Wn=(p=Wn)||u.memoizedState!==null,yo(s,i,u),Wn=p;break;default:yo(s,i,u)}}function yE(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Bc(s)}catch(u){Qt(i,i.return,u)}}}function vE(s,i){if(i.memoizedState===null&&(s=i.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Bc(s)}catch(u){Qt(i,i.return,u)}}function q8(s){switch(s.tag){case 31:case 13:case 19:var i=s.stateNode;return i===null&&(i=s.stateNode=new hE),i;case 22:return s=s.stateNode,i=s._retryCache,i===null&&(i=s._retryCache=new hE),i;default:throw Error(r(435,s.tag))}}function Gh(s,i){var u=q8(s);i.forEach(function(p){if(!u.has(p)){u.add(p);var x=tM.bind(null,s,p);p.then(x,x)}})}function aa(s,i){var u=i.deletions;if(u!==null)for(var p=0;p<u.length;p++){var x=u[p],w=s,N=i,I=N;e:for(;I!==null;){switch(I.tag){case 27:if(xi(I.type)){yn=I.stateNode,ra=!1;break e}break;case 5:yn=I.stateNode,ra=!1;break e;case 3:case 4:yn=I.stateNode.containerInfo,ra=!0;break e}I=I.return}if(yn===null)throw Error(r(160));gE(w,N,x),yn=null,ra=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)xE(i,s),i=i.sibling}var is=null;function xE(s,i){var u=s.alternate,p=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:aa(i,s),sa(s),p&4&&(fi(3,s,s.return),yd(3,s),fi(5,s,s.return));break;case 1:aa(i,s),sa(s),p&512&&(Wn||u===null||Is(u,u.return)),p&64&&go&&(s=s.updateQueue,s!==null&&(p=s.callbacks,p!==null&&(u=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var x=is;if(aa(i,s),sa(s),p&512&&(Wn||u===null||Is(u,u.return)),p&4){var w=u!==null?u.memoizedState:null;if(p=s.memoizedState,u===null)if(p===null)if(s.stateNode===null){e:{p=s.type,u=s.memoizedProps,x=x.ownerDocument||x;t:switch(p){case"title":w=x.getElementsByTagName("title")[0],(!w||w[Kt]||w[He]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(p),x.head.insertBefore(w,x.querySelector("head > title"))),wr(w,p,u),w[He]=s,Nn(w),p=w;break e;case"link":var N=xw("link","href",x).get(p+(u.href||""));if(N){for(var I=0;I<N.length;I++)if(w=N[I],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){N.splice(I,1);break t}}w=x.createElement(p),wr(w,p,u),x.head.appendChild(w);break;case"meta":if(N=xw("meta","content",x).get(p+(u.content||""))){for(I=0;I<N.length;I++)if(w=N[I],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){N.splice(I,1);break t}}w=x.createElement(p),wr(w,p,u),x.head.appendChild(w);break;default:throw Error(r(468,p))}w[He]=s,Nn(w),p=w}s.stateNode=p}else bw(x,s.type,s.stateNode);else s.stateNode=vw(x,p,s.memoizedProps);else w!==p?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,p===null?bw(x,s.type,s.stateNode):vw(x,p,s.memoizedProps)):p===null&&s.stateNode!==null&&jv(s,s.memoizedProps,u.memoizedProps)}break;case 27:aa(i,s),sa(s),p&512&&(Wn||u===null||Is(u,u.return)),u!==null&&p&4&&jv(s,s.memoizedProps,u.memoizedProps);break;case 5:if(aa(i,s),sa(s),p&512&&(Wn||u===null||Is(u,u.return)),s.flags&32){x=s.stateNode;try{hc(x,"")}catch(Ge){Qt(s,s.return,Ge)}}p&4&&s.stateNode!=null&&(x=s.memoizedProps,jv(s,x,u!==null?u.memoizedProps:x)),p&1024&&(Nv=!0);break;case 6:if(aa(i,s),sa(s),p&4){if(s.stateNode===null)throw Error(r(162));p=s.memoizedProps,u=s.stateNode;try{u.nodeValue=p}catch(Ge){Qt(s,s.return,Ge)}}break;case 3:if(im=null,x=is,is=sm(i.containerInfo),aa(i,s),is=x,sa(s),p&4&&u!==null&&u.memoizedState.isDehydrated)try{Bc(i.containerInfo)}catch(Ge){Qt(s,s.return,Ge)}Nv&&(Nv=!1,bE(s));break;case 4:p=is,is=sm(s.stateNode.containerInfo),aa(i,s),sa(s),is=p;break;case 12:aa(i,s),sa(s);break;case 31:aa(i,s),sa(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,Gh(s,p)));break;case 13:aa(i,s),sa(s),s.child.flags&8192&&s.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Zh=Se()),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,Gh(s,p)));break;case 22:x=s.memoizedState!==null;var B=u!==null&&u.memoizedState!==null,ae=go,he=Wn;if(go=ae||x,Wn=he||B,aa(i,s),Wn=he,go=ae,sa(s),p&8192)e:for(i=s.stateNode,i._visibility=x?i._visibility&-2:i._visibility|1,x&&(u===null||B||go||Wn||Rl(s)),u=null,i=s;;){if(i.tag===5||i.tag===26){if(u===null){B=u=i;try{if(w=B.stateNode,x)N=w.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{I=B.stateNode;var pe=B.memoizedProps.style,oe=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;I.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ge){Qt(B,B.return,Ge)}}}else if(i.tag===6){if(u===null){B=i;try{B.stateNode.nodeValue=x?"":B.memoizedProps}catch(Ge){Qt(B,B.return,Ge)}}}else if(i.tag===18){if(u===null){B=i;try{var fe=B.stateNode;x?cw(fe,!0):cw(B.stateNode,!1)}catch(Ge){Qt(B,B.return,Ge)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===s)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}p&4&&(p=s.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Gh(s,u))));break;case 19:aa(i,s),sa(s),p&4&&(p=s.updateQueue,p!==null&&(s.updateQueue=null,Gh(s,p)));break;case 30:break;case 21:break;default:aa(i,s),sa(s)}}function sa(s){var i=s.flags;if(i&2){try{for(var u,p=s.return;p!==null;){if(dE(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,w=Tv(s);Bh(s,w,x);break;case 5:var N=u.stateNode;u.flags&32&&(hc(N,""),u.flags&=-33);var I=Tv(s);Bh(s,I,N);break;case 3:case 4:var B=u.stateNode.containerInfo,ae=Tv(s);_v(s,ae,B);break;default:throw Error(r(161))}}catch(he){Qt(s,s.return,he)}s.flags&=-3}i&4096&&(s.flags&=-4097)}function bE(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var i=s;bE(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),s=s.sibling}}function vo(s,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)mE(s,i.alternate,i),i=i.sibling}function Rl(s){for(s=s.child;s!==null;){var i=s;switch(i.tag){case 0:case 11:case 14:case 15:fi(4,i,i.return),Rl(i);break;case 1:Is(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&cE(i,i.return,u),Rl(i);break;case 27:Td(i.stateNode);case 26:case 5:Is(i,i.return),Rl(i);break;case 22:i.memoizedState===null&&Rl(i);break;case 30:Rl(i);break;default:Rl(i)}s=s.sibling}}function xo(s,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var p=i.alternate,x=s,w=i,N=w.flags;switch(w.tag){case 0:case 11:case 15:xo(x,w,u),yd(4,w);break;case 1:if(xo(x,w,u),p=w,x=p.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ae){Qt(p,p.return,ae)}if(p=w,x=p.updateQueue,x!==null){var I=p.stateNode;try{var B=x.shared.hiddenCallbacks;if(B!==null)for(x.shared.hiddenCallbacks=null,x=0;x<B.length;x++)QC(B[x],I)}catch(ae){Qt(p,p.return,ae)}}u&&N&64&&lE(w),vd(w,w.return);break;case 27:fE(w);case 26:case 5:xo(x,w,u),u&&p===null&&N&4&&uE(w),vd(w,w.return);break;case 12:xo(x,w,u);break;case 31:xo(x,w,u),u&&N&4&&yE(x,w);break;case 13:xo(x,w,u),u&&N&4&&vE(x,w);break;case 22:w.memoizedState===null&&xo(x,w,u),vd(w,w.return);break;case 30:break;default:xo(x,w,u)}i=i.sibling}}function Av(s,i){var u=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),s=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(s=i.memoizedState.cachePool.pool),s!==u&&(s!=null&&s.refCount++,u!=null&&ad(u))}function Dv(s,i){s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&ad(s))}function ls(s,i,u,p){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)SE(s,i,u,p),i=i.sibling}function SE(s,i,u,p){var x=i.flags;switch(i.tag){case 0:case 11:case 15:ls(s,i,u,p),x&2048&&yd(9,i);break;case 1:ls(s,i,u,p);break;case 3:ls(s,i,u,p),x&2048&&(s=null,i.alternate!==null&&(s=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==s&&(i.refCount++,s!=null&&ad(s)));break;case 12:if(x&2048){ls(s,i,u,p),s=i.stateNode;try{var w=i.memoizedProps,N=w.id,I=w.onPostCommit;typeof I=="function"&&I(N,i.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(B){Qt(i,i.return,B)}}else ls(s,i,u,p);break;case 31:ls(s,i,u,p);break;case 13:ls(s,i,u,p);break;case 23:break;case 22:w=i.stateNode,N=i.alternate,i.memoizedState!==null?w._visibility&2?ls(s,i,u,p):xd(s,i):w._visibility&2?ls(s,i,u,p):(w._visibility|=2,Mc(s,i,u,p,(i.subtreeFlags&10256)!==0||!1)),x&2048&&Av(N,i);break;case 24:ls(s,i,u,p),x&2048&&Dv(i.alternate,i);break;default:ls(s,i,u,p)}}function Mc(s,i,u,p,x){for(x=x&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=s,N=i,I=u,B=p,ae=N.flags;switch(N.tag){case 0:case 11:case 15:Mc(w,N,I,B,x),yd(8,N);break;case 23:break;case 22:var he=N.stateNode;N.memoizedState!==null?he._visibility&2?Mc(w,N,I,B,x):xd(w,N):(he._visibility|=2,Mc(w,N,I,B,x)),x&&ae&2048&&Av(N.alternate,N);break;case 24:Mc(w,N,I,B,x),x&&ae&2048&&Dv(N.alternate,N);break;default:Mc(w,N,I,B,x)}i=i.sibling}}function xd(s,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=s,p=i,x=p.flags;switch(p.tag){case 22:xd(u,p),x&2048&&Av(p.alternate,p);break;case 24:xd(u,p),x&2048&&Dv(p.alternate,p);break;default:xd(u,p)}i=i.sibling}}var bd=8192;function Ic(s,i,u){if(s.subtreeFlags&bd)for(s=s.child;s!==null;)CE(s,i,u),s=s.sibling}function CE(s,i,u){switch(s.tag){case 26:Ic(s,i,u),s.flags&bd&&s.memoizedState!==null&&OM(u,is,s.memoizedState,s.memoizedProps);break;case 5:Ic(s,i,u);break;case 3:case 4:var p=is;is=sm(s.stateNode.containerInfo),Ic(s,i,u),is=p;break;case 22:s.memoizedState===null&&(p=s.alternate,p!==null&&p.memoizedState!==null?(p=bd,bd=16777216,Ic(s,i,u),bd=p):Ic(s,i,u));break;default:Ic(s,i,u)}}function EE(s){var i=s.alternate;if(i!==null&&(s=i.child,s!==null)){i.child=null;do i=s.sibling,s.sibling=null,s=i;while(s!==null)}}function Sd(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var p=i[u];mr=p,RE(p,s)}EE(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)wE(s),s=s.sibling}function wE(s){switch(s.tag){case 0:case 11:case 15:Sd(s),s.flags&2048&&fi(9,s,s.return);break;case 3:Sd(s);break;case 12:Sd(s);break;case 22:var i=s.stateNode;s.memoizedState!==null&&i._visibility&2&&(s.return===null||s.return.tag!==13)?(i._visibility&=-3,qh(s)):Sd(s);break;default:Sd(s)}}function qh(s){var i=s.deletions;if((s.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var p=i[u];mr=p,RE(p,s)}EE(s)}for(s=s.child;s!==null;){switch(i=s,i.tag){case 0:case 11:case 15:fi(8,i,i.return),qh(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,qh(i));break;default:qh(i)}s=s.sibling}}function RE(s,i){for(;mr!==null;){var u=mr;switch(u.tag){case 0:case 11:case 15:fi(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:ad(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,mr=p;else e:for(u=s;mr!==null;){p=mr;var x=p.sibling,w=p.return;if(pE(p),p===u){mr=null;break e}if(x!==null){x.return=w,mr=x;break e}mr=w}}}var Z8={getCacheForType:function(s){var i=Cr(Zn),u=i.data.get(s);return u===void 0&&(u=s(),i.data.set(s,u)),u},cacheSignal:function(){return Cr(Zn).controller.signal}},K8=typeof WeakMap=="function"?WeakMap:Map,Bt=0,an=null,Et=null,jt=0,Wt=0,Ea=null,hi=!1,kc=!1,Ov=!1,bo=0,Dn=0,mi=0,jl=0,Mv=0,wa=0,Lc=0,Cd=null,oa=null,Iv=!1,Zh=0,jE=0,Kh=1/0,Yh=null,pi=null,nr=0,gi=null,Pc=null,So=0,kv=0,Lv=null,TE=null,Ed=0,Pv=null;function Ra(){return(Bt&2)!==0&&jt!==0?jt&-jt:k.T!==null?$v():Le()}function _E(){if(wa===0)if((jt&536870912)===0||Mt){var s=As;As<<=1,(As&3932160)===0&&(As=262144),wa=s}else wa=536870912;return s=Sa.current,s!==null&&(s.flags|=32),wa}function ia(s,i,u){(s===an&&(Wt===2||Wt===9)||s.cancelPendingCommit!==null)&&(Uc(s,0),yi(s,jt,wa,!1)),Xr(s,u),((Bt&2)===0||s!==an)&&(s===an&&((Bt&2)===0&&(jl|=u),Dn===4&&yi(s,jt,wa,!1)),ks(s))}function NE(s,i,u){if((Bt&6)!==0)throw Error(r(327));var p=!u&&(i&127)===0&&(i&s.expiredLanes)===0||xr(s,i),x=p?Q8(s,i):Fv(s,i,!0),w=p;do{if(x===0){kc&&!p&&yi(s,i,0,!1);break}else{if(u=s.current.alternate,w&&!Y8(u)){x=Fv(s,i,!1),w=!1;continue}if(x===2){if(w=i,s.errorRecoveryDisabledLanes&w)var N=0;else N=s.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){i=N;e:{var I=s;x=Cd;var B=I.current.memoizedState.isDehydrated;if(B&&(Uc(I,N).flags|=256),N=Fv(I,N,!1),N!==2){if(Ov&&!B){I.errorRecoveryDisabledLanes|=w,jl|=w,x=4;break e}w=oa,oa=x,w!==null&&(oa===null?oa=w:oa.push.apply(oa,w))}x=N}if(w=!1,x!==2)continue}}if(x===1){Uc(s,0),yi(s,i,0,!0);break}e:{switch(p=s,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:yi(p,i,wa,!hi);break e;case 2:oa=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(x=Zh+300-Se(),10<x)){if(yi(p,i,wa,!hi),Gn(p,0,!0)!==0)break e;So=i,p.timeoutHandle=ow(AE.bind(null,p,u,oa,Yh,Iv,i,wa,jl,Lc,hi,w,"Throttled",-0,0),x);break e}AE(p,u,oa,Yh,Iv,i,wa,jl,Lc,hi,w,null,-0,0)}}break}while(!0);ks(s)}function AE(s,i,u,p,x,w,N,I,B,ae,he,pe,oe,fe){if(s.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:so},CE(i,w,pe);var Ge=(w&62914560)===w?Zh-Se():(w&4194048)===w?jE-Se():0;if(Ge=MM(pe,Ge),Ge!==null){So=w,s.cancelPendingCommit=Ge(UE.bind(null,s,i,w,u,p,x,N,I,B,he,pe,null,oe,fe)),yi(s,w,N,!ae);return}}UE(s,i,w,u,p,x,N,I,B)}function Y8(s){for(var i=s;;){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 p=0;p<u.length;p++){var x=u[p],w=x.getSnapshot;x=x.value;try{if(!xa(w(),x))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===s)break;for(;i.sibling===null;){if(i.return===null||i.return===s)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function yi(s,i,u,p){i&=~Mv,i&=~jl,s.suspendedLanes|=i,s.pingedLanes&=~i,p&&(s.warmLanes|=i),p=s.expirationTimes;for(var x=i;0<x;){var w=31-_n(x),N=1<<w;p[w]=-1,x&=~N}u!==0&&J(s,u,i)}function Wh(){return(Bt&6)===0?(wd(0),!1):!0}function Uv(){if(Et!==null){if(Wt===0)var s=Et.return;else s=Et,co=yl=null,ev(s),_c=null,od=0,s=Et;for(;s!==null;)iE(s.alternate,s),s=s.return;Et=null}}function Uc(s,i){var u=s.timeoutHandle;u!==-1&&(s.timeoutHandle=-1,pM(u)),u=s.cancelPendingCommit,u!==null&&(s.cancelPendingCommit=null,u()),So=0,Uv(),an=s,Et=u=io(s.current,null),jt=i,Wt=0,Ea=null,hi=!1,kc=xr(s,i),Ov=!1,Lc=wa=Mv=jl=mi=Dn=0,oa=Cd=null,Iv=!1,(i&8)!==0&&(i|=i&32);var p=s.entangledLanes;if(p!==0)for(s=s.entanglements,p&=i;0<p;){var x=31-_n(p),w=1<<x;i|=s[x],p&=~w}return bo=i,yh(),u}function DE(s,i){ht=null,k.H=md,i===Tc||i===Rh?(i=ZC(),Wt=3):i===Hy?(i=ZC(),Wt=4):Wt=i===gv?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Ea=i,Et===null&&(Dn=1,Fh(s,Ba(i,s.current)))}function OE(){var s=Sa.current;return s===null?!0:(jt&4194048)===jt?Ka===null:(jt&62914560)===jt||(jt&536870912)!==0?s===Ka:!1}function ME(){var s=k.H;return k.H=md,s===null?md:s}function IE(){var s=k.A;return k.A=Z8,s}function Qh(){Dn=4,hi||(jt&4194048)!==jt&&Sa.current!==null||(kc=!0),(mi&134217727)===0&&(jl&134217727)===0||an===null||yi(an,jt,wa,!1)}function Fv(s,i,u){var p=Bt;Bt|=2;var x=ME(),w=IE();(an!==s||jt!==i)&&(Yh=null,Uc(s,i)),i=!1;var N=Dn;e:do try{if(Wt!==0&&Et!==null){var I=Et,B=Ea;switch(Wt){case 8:Uv(),N=6;break e;case 3:case 2:case 9:case 6:Sa.current===null&&(i=!0);var ae=Wt;if(Wt=0,Ea=null,Fc(s,I,B,ae),u&&kc){N=0;break e}break;default:ae=Wt,Wt=0,Ea=null,Fc(s,I,B,ae)}}W8(),N=Dn;break}catch(he){DE(s,he)}while(!0);return i&&s.shellSuspendCounter++,co=yl=null,Bt=p,k.H=x,k.A=w,Et===null&&(an=null,jt=0,yh()),N}function W8(){for(;Et!==null;)kE(Et)}function Q8(s,i){var u=Bt;Bt|=2;var p=ME(),x=IE();an!==s||jt!==i?(Yh=null,Kh=Se()+500,Uc(s,i)):kc=xr(s,i);e:do try{if(Wt!==0&&Et!==null){i=Et;var w=Ea;t:switch(Wt){case 1:Wt=0,Ea=null,Fc(s,i,w,1);break;case 2:case 9:if(GC(w)){Wt=0,Ea=null,LE(i);break}i=function(){Wt!==2&&Wt!==9||an!==s||(Wt=7),ks(s)},w.then(i,i);break e;case 3:Wt=7;break e;case 4:Wt=5;break e;case 7:GC(w)?(Wt=0,Ea=null,LE(i)):(Wt=0,Ea=null,Fc(s,i,w,7));break;case 5:var N=null;switch(Et.tag){case 26:N=Et.memoizedState;case 5:case 27:var I=Et;if(N?Sw(N):I.stateNode.complete){Wt=0,Ea=null;var B=I.sibling;if(B!==null)Et=B;else{var ae=I.return;ae!==null?(Et=ae,Xh(ae)):Et=null}break t}}Wt=0,Ea=null,Fc(s,i,w,5);break;case 6:Wt=0,Ea=null,Fc(s,i,w,6);break;case 8:Uv(),Dn=6;break e;default:throw Error(r(462))}}X8();break}catch(he){DE(s,he)}while(!0);return co=yl=null,k.H=p,k.A=x,Bt=u,Et!==null?0:(an=null,jt=0,yh(),Dn)}function X8(){for(;Et!==null&&!de();)kE(Et)}function kE(s){var i=sE(s.alternate,s,bo);s.memoizedProps=s.pendingProps,i===null?Xh(s):Et=i}function LE(s){var i=s,u=i.alternate;switch(i.tag){case 15:case 0:i=J2(u,i,i.pendingProps,i.type,void 0,jt);break;case 11:i=J2(u,i,i.pendingProps,i.type.render,i.ref,jt);break;case 5:ev(i);default:iE(u,i),i=Et=IC(i,bo),i=sE(u,i,bo)}s.memoizedProps=s.pendingProps,i===null?Xh(s):Et=i}function Fc(s,i,u,p){co=yl=null,ev(i),_c=null,od=0;var x=i.return;try{if(V8(s,x,i,u,jt)){Dn=1,Fh(s,Ba(u,s.current)),Et=null;return}}catch(w){if(x!==null)throw Et=x,w;Dn=1,Fh(s,Ba(u,s.current)),Et=null;return}i.flags&32768?(Mt||p===1?s=!0:kc||(jt&536870912)!==0?s=!1:(hi=s=!0,(p===2||p===9||p===3||p===6)&&(p=Sa.current,p!==null&&p.tag===13&&(p.flags|=16384))),PE(i,s)):Xh(i)}function Xh(s){var i=s;do{if((i.flags&32768)!==0){PE(i,hi);return}s=i.return;var u=$8(i.alternate,i,bo);if(u!==null){Et=u;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=s}while(i!==null);Dn===0&&(Dn=5)}function PE(s,i){do{var u=B8(s.alternate,s);if(u!==null){u.flags&=32767,Et=u;return}if(u=s.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(s=s.sibling,s!==null)){Et=s;return}Et=s=u}while(s!==null);Dn=6,Et=null}function UE(s,i,u,p,x,w,N,I,B){s.cancelPendingCommit=null;do Jh();while(nr!==0);if((Bt&6)!==0)throw Error(r(327));if(i!==null){if(i===s.current)throw Error(r(177));if(w=i.lanes|i.childLanes,w|=Ty,z(s,u,w,N,I,B),s===an&&(Et=an=null,jt=0),Pc=i,gi=s,So=u,kv=w,Lv=x,TE=p,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,nM(it,function(){return $E(),null})):(s.callbackNode=null,s.callbackPriority=0),p=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||p){p=k.T,k.T=null,x=$.p,$.p=2,N=Bt,Bt|=4;try{G8(s,i,u)}finally{Bt=N,$.p=x,k.T=p}}nr=1,FE(),VE(),zE()}}function FE(){if(nr===1){nr=0;var s=gi,i=Pc,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=k.T,k.T=null;var p=$.p;$.p=2;var x=Bt;Bt|=4;try{xE(i,s);var w=Qv,N=RC(s.containerInfo),I=w.focusedElem,B=w.selectionRange;if(N!==I&&I&&I.ownerDocument&&wC(I.ownerDocument.documentElement,I)){if(B!==null&&Cy(I)){var ae=B.start,he=B.end;if(he===void 0&&(he=ae),"selectionStart"in I)I.selectionStart=ae,I.selectionEnd=Math.min(he,I.value.length);else{var pe=I.ownerDocument||document,oe=pe&&pe.defaultView||window;if(oe.getSelection){var fe=oe.getSelection(),Ge=I.textContent.length,nt=Math.min(B.start,Ge),rn=B.end===void 0?nt:Math.min(B.end,Ge);!fe.extend&&nt>rn&&(N=rn,rn=nt,nt=N);var ee=EC(I,nt),Q=EC(I,rn);if(ee&&Q&&(fe.rangeCount!==1||fe.anchorNode!==ee.node||fe.anchorOffset!==ee.offset||fe.focusNode!==Q.node||fe.focusOffset!==Q.offset)){var re=pe.createRange();re.setStart(ee.node,ee.offset),fe.removeAllRanges(),nt>rn?(fe.addRange(re),fe.extend(Q.node,Q.offset)):(re.setEnd(Q.node,Q.offset),fe.addRange(re))}}}}for(pe=[],fe=I;fe=fe.parentNode;)fe.nodeType===1&&pe.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof I.focus=="function"&&I.focus(),I=0;I<pe.length;I++){var me=pe[I];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}dm=!!Wv,Qv=Wv=null}finally{Bt=x,$.p=p,k.T=u}}s.current=i,nr=2}}function VE(){if(nr===2){nr=0;var s=gi,i=Pc,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=k.T,k.T=null;var p=$.p;$.p=2;var x=Bt;Bt|=4;try{mE(s,i.alternate,i)}finally{Bt=x,$.p=p,k.T=u}}nr=3}}function zE(){if(nr===4||nr===3){nr=0,_e();var s=gi,i=Pc,u=So,p=TE;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?nr=5:(nr=0,Pc=gi=null,HE(s,s.pendingLanes));var x=s.pendingLanes;if(x===0&&(pi=null),ze(u),i=i.stateNode,Tn&&typeof Tn.onCommitFiberRoot=="function")try{Tn.onCommitFiberRoot(Fn,i,void 0,(i.current.flags&128)===128)}catch{}if(p!==null){i=k.T,x=$.p,$.p=2,k.T=null;try{for(var w=s.onRecoverableError,N=0;N<p.length;N++){var I=p[N];w(I.value,{componentStack:I.stack})}}finally{k.T=i,$.p=x}}(So&3)!==0&&Jh(),ks(s),x=s.pendingLanes,(u&261930)!==0&&(x&42)!==0?s===Pv?Ed++:(Ed=0,Pv=s):Ed=0,wd(0)}}function HE(s,i){(s.pooledCacheLanes&=i)===0&&(i=s.pooledCache,i!=null&&(s.pooledCache=null,ad(i)))}function Jh(){return FE(),VE(),zE(),$E()}function $E(){if(nr!==5)return!1;var s=gi,i=kv;kv=0;var u=ze(So),p=k.T,x=$.p;try{$.p=32>u?32:u,k.T=null,u=Lv,Lv=null;var w=gi,N=So;if(nr=0,Pc=gi=null,So=0,(Bt&6)!==0)throw Error(r(331));var I=Bt;if(Bt|=4,wE(w.current),SE(w,w.current,N,u),Bt=I,wd(0,!1),Tn&&typeof Tn.onPostCommitFiberRoot=="function")try{Tn.onPostCommitFiberRoot(Fn,w)}catch{}return!0}finally{$.p=x,k.T=p,HE(s,i)}}function BE(s,i,u){i=Ba(u,i),i=pv(s.stateNode,i,2),s=ci(s,i,2),s!==null&&(Xr(s,2),ks(s))}function Qt(s,i,u){if(s.tag===3)BE(s,s,u);else for(;i!==null;){if(i.tag===3){BE(i,s,u);break}else if(i.tag===1){var p=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(pi===null||!pi.has(p))){s=Ba(u,s),u=G2(2),p=ci(i,u,2),p!==null&&(q2(u,p,i,s),Xr(p,2),ks(p));break}}i=i.return}}function Vv(s,i,u){var p=s.pingCache;if(p===null){p=s.pingCache=new K8;var x=new Set;p.set(i,x)}else x=p.get(i),x===void 0&&(x=new Set,p.set(i,x));x.has(u)||(Ov=!0,x.add(u),s=J8.bind(null,s,i,u),i.then(s,s))}function J8(s,i,u){var p=s.pingCache;p!==null&&p.delete(i),s.pingedLanes|=s.suspendedLanes&u,s.warmLanes&=~u,an===s&&(jt&u)===u&&(Dn===4||Dn===3&&(jt&62914560)===jt&&300>Se()-Zh?(Bt&2)===0&&Uc(s,0):Mv|=u,Lc===jt&&(Lc=0)),ks(s)}function GE(s,i){i===0&&(i=Vn()),s=ml(s,i),s!==null&&(Xr(s,i),ks(s))}function eM(s){var i=s.memoizedState,u=0;i!==null&&(u=i.retryLane),GE(s,u)}function tM(s,i){var u=0;switch(s.tag){case 31:case 13:var p=s.stateNode,x=s.memoizedState;x!==null&&(u=x.retryLane);break;case 19:p=s.stateNode;break;case 22:p=s.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(i),GE(s,u)}function nM(s,i){return F(s,i)}var em=null,Vc=null,zv=!1,tm=!1,Hv=!1,vi=0;function ks(s){s!==Vc&&s.next===null&&(Vc===null?em=Vc=s:Vc=Vc.next=s),tm=!0,zv||(zv=!0,aM())}function wd(s,i){if(!Hv&&tm){Hv=!0;do for(var u=!1,p=em;p!==null;){if(s!==0){var x=p.pendingLanes;if(x===0)var w=0;else{var N=p.suspendedLanes,I=p.pingedLanes;w=(1<<31-_n(42|s)+1)-1,w&=x&~(N&~I),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,YE(p,w))}else w=jt,w=Gn(p,p===an?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||xr(p,w)||(u=!0,YE(p,w));p=p.next}while(u);Hv=!1}}function rM(){qE()}function qE(){tm=zv=!1;var s=0;vi!==0&&mM()&&(s=vi);for(var i=Se(),u=null,p=em;p!==null;){var x=p.next,w=ZE(p,i);w===0?(p.next=null,u===null?em=x:u.next=x,x===null&&(Vc=u)):(u=p,(s!==0||(w&3)!==0)&&(tm=!0)),p=x}nr!==0&&nr!==5||wd(s),vi!==0&&(vi=0)}function ZE(s,i){for(var u=s.suspendedLanes,p=s.pingedLanes,x=s.expirationTimes,w=s.pendingLanes&-62914561;0<w;){var N=31-_n(w),I=1<<N,B=x[N];B===-1?((I&u)===0||(I&p)!==0)&&(x[N]=er(I,i)):B<=i&&(s.expiredLanes|=I),w&=~I}if(i=an,u=jt,u=Gn(s,s===i?u:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p=s.callbackNode,u===0||s===i&&(Wt===2||Wt===9)||s.cancelPendingCommit!==null)return p!==null&&p!==null&&X(p),s.callbackNode=null,s.callbackPriority=0;if((u&3)===0||xr(s,u)){if(i=u&-u,i===s.callbackPriority)return i;switch(p!==null&&X(p),ze(u)){case 2:case 8:u=ot;break;case 32:u=it;break;case 268435456:u=Ua;break;default:u=it}return p=KE.bind(null,s),u=F(u,p),s.callbackPriority=i,s.callbackNode=u,i}return p!==null&&p!==null&&X(p),s.callbackPriority=2,s.callbackNode=null,2}function KE(s,i){if(nr!==0&&nr!==5)return s.callbackNode=null,s.callbackPriority=0,null;var u=s.callbackNode;if(Jh()&&s.callbackNode!==u)return null;var p=jt;return p=Gn(s,s===an?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),p===0?null:(NE(s,p,i),ZE(s,Se()),s.callbackNode!=null&&s.callbackNode===u?KE.bind(null,s):null)}function YE(s,i){if(Jh())return null;NE(s,i,!0)}function aM(){gM(function(){(Bt&6)!==0?F(We,rM):qE()})}function $v(){if(vi===0){var s=Rc;s===0&&(s=to,to<<=1,(to&261888)===0&&(to=256)),vi=s}return vi}function WE(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:ch(""+s)}function QE(s,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,s.id&&u.setAttribute("form",s.id),i.parentNode.insertBefore(u,i),s=new FormData(s),u.parentNode.removeChild(u),s}function sM(s,i,u,p,x){if(i==="submit"&&u&&u.stateNode===x){var w=WE((x[qe]||null).action),N=p.submitter;N&&(i=(i=N[qe]||null)?WE(i.formAction):N.getAttribute("formAction"),i!==null&&(w=i,N=null));var I=new hh("action","action",null,p,x);s.push({event:I,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(vi!==0){var B=N?QE(x,N):new FormData(x);cv(u,{pending:!0,data:B,method:x.method,action:w},null,B)}}else typeof w=="function"&&(I.preventDefault(),B=N?QE(x,N):new FormData(x),cv(u,{pending:!0,data:B,method:x.method,action:w},w,B))},currentTarget:x}]})}}for(var Bv=0;Bv<jy.length;Bv++){var Gv=jy[Bv],oM=Gv.toLowerCase(),iM=Gv[0].toUpperCase()+Gv.slice(1);os(oM,"on"+iM)}os(_C,"onAnimationEnd"),os(NC,"onAnimationIteration"),os(AC,"onAnimationStart"),os("dblclick","onDoubleClick"),os("focusin","onFocus"),os("focusout","onBlur"),os(E8,"onTransitionRun"),os(w8,"onTransitionStart"),os(R8,"onTransitionCancel"),os(DC,"onTransitionEnd"),ss("onMouseEnter",["mouseout","mouseover"]),ss("onMouseLeave",["mouseout","mouseover"]),ss("onPointerEnter",["pointerout","pointerover"]),ss("onPointerLeave",["pointerout","pointerover"]),Va("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Va("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Va("onBeforeInput",["compositionend","keypress","textInput","paste"]),Va("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Va("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Rd="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(" "),lM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Rd));function XE(s,i){i=(i&4)!==0;for(var u=0;u<s.length;u++){var p=s[u],x=p.event;p=p.listeners;e:{var w=void 0;if(i)for(var N=p.length-1;0<=N;N--){var I=p[N],B=I.instance,ae=I.currentTarget;if(I=I.listener,B!==w&&x.isPropagationStopped())break e;w=I,x.currentTarget=ae;try{w(x)}catch(he){gh(he)}x.currentTarget=null,w=B}else for(N=0;N<p.length;N++){if(I=p[N],B=I.instance,ae=I.currentTarget,I=I.listener,B!==w&&x.isPropagationStopped())break e;w=I,x.currentTarget=ae;try{w(x)}catch(he){gh(he)}x.currentTarget=null,w=B}}}}function wt(s,i){var u=i[ut];u===void 0&&(u=i[ut]=new Set);var p=s+"__bubble";u.has(p)||(JE(i,s,2,!1),u.add(p))}function qv(s,i,u){var p=0;i&&(p|=4),JE(u,s,p,i)}var nm="_reactListening"+Math.random().toString(36).slice(2);function Zv(s){if(!s[nm]){s[nm]=!0,ti.forEach(function(u){u!=="selectionchange"&&(lM.has(u)||qv(u,!1,s),qv(u,!0,s))});var i=s.nodeType===9?s:s.ownerDocument;i===null||i[nm]||(i[nm]=!0,qv("selectionchange",!1,i))}}function JE(s,i,u,p){switch(_w(i)){case 2:var x=LM;break;case 8:x=PM;break;default:x=lx}u=x.bind(null,i,u,s),x=void 0,!hy||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(x=!0),p?x!==void 0?s.addEventListener(i,u,{capture:!0,passive:x}):s.addEventListener(i,u,!0):x!==void 0?s.addEventListener(i,u,{passive:x}):s.addEventListener(i,u,!1)}function Kv(s,i,u,p,x){var w=p;if((i&1)===0&&(i&2)===0&&p!==null)e:for(;;){if(p===null)return;var N=p.tag;if(N===3||N===4){var I=p.stateNode.containerInfo;if(I===x)break;if(N===4)for(N=p.return;N!==null;){var B=N.tag;if((B===3||B===4)&&N.stateNode.containerInfo===x)return;N=N.return}for(;I!==null;){if(N=Jr(I),N===null)return;if(B=N.tag,B===5||B===6||B===26||B===27){p=w=N;continue e}I=I.parentNode}}p=p.return}aC(function(){var ae=w,he=dy(u),pe=[];e:{var oe=OC.get(s);if(oe!==void 0){var fe=hh,Ge=s;switch(s){case"keypress":if(dh(u)===0)break e;case"keydown":case"keyup":fe=t8;break;case"focusin":Ge="focus",fe=yy;break;case"focusout":Ge="blur",fe=yy;break;case"beforeblur":case"afterblur":fe=yy;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":fe=iC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=$6;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=a8;break;case _C:case NC:case AC:fe=q6;break;case DC:fe=o8;break;case"scroll":case"scrollend":fe=z6;break;case"wheel":fe=l8;break;case"copy":case"cut":case"paste":fe=K6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=cC;break;case"toggle":case"beforetoggle":fe=u8}var nt=(i&4)!==0,rn=!nt&&(s==="scroll"||s==="scrollend"),ee=nt?oe!==null?oe+"Capture":null:oe;nt=[];for(var Q=ae,re;Q!==null;){var me=Q;if(re=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||re===null||ee===null||(me=Zu(Q,ee),me!=null&&nt.push(jd(Q,me,re))),rn)break;Q=Q.return}0<nt.length&&(oe=new fe(oe,Ge,null,u,he),pe.push({event:oe,listeners:nt}))}}if((i&7)===0){e:{if(oe=s==="mouseover"||s==="pointerover",fe=s==="mouseout"||s==="pointerout",oe&&u!==uy&&(Ge=u.relatedTarget||u.fromElement)&&(Jr(Ge)||Ge[Ze]))break e;if((fe||oe)&&(oe=he.window===he?he:(oe=he.ownerDocument)?oe.defaultView||oe.parentWindow:window,fe?(Ge=u.relatedTarget||u.toElement,fe=ae,Ge=Ge?Jr(Ge):null,Ge!==null&&(rn=l(Ge),nt=Ge.tag,Ge!==rn||nt!==5&&nt!==27&&nt!==6)&&(Ge=null)):(fe=null,Ge=ae),fe!==Ge)){if(nt=iC,me="onMouseLeave",ee="onMouseEnter",Q="mouse",(s==="pointerout"||s==="pointerover")&&(nt=cC,me="onPointerLeave",ee="onPointerEnter",Q="pointer"),rn=fe==null?oe:ea(fe),re=Ge==null?oe:ea(Ge),oe=new nt(me,Q+"leave",fe,u,he),oe.target=rn,oe.relatedTarget=re,me=null,Jr(he)===ae&&(nt=new nt(ee,Q+"enter",Ge,u,he),nt.target=re,nt.relatedTarget=rn,me=nt),rn=me,fe&&Ge)t:{for(nt=cM,ee=fe,Q=Ge,re=0,me=ee;me;me=nt(me))re++;me=0;for(var tt=Q;tt;tt=nt(tt))me++;for(;0<re-me;)ee=nt(ee),re--;for(;0<me-re;)Q=nt(Q),me--;for(;re--;){if(ee===Q||Q!==null&&ee===Q.alternate){nt=ee;break t}ee=nt(ee),Q=nt(Q)}nt=null}else nt=null;fe!==null&&ew(pe,oe,fe,nt,!1),Ge!==null&&rn!==null&&ew(pe,rn,Ge,nt,!0)}}e:{if(oe=ae?ea(ae):window,fe=oe.nodeName&&oe.nodeName.toLowerCase(),fe==="select"||fe==="input"&&oe.type==="file")var Vt=yC;else if(pC(oe))if(vC)Vt=b8;else{Vt=v8;var Xe=y8}else fe=oe.nodeName,!fe||fe.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&cy(ae.elementType)&&(Vt=yC):Vt=x8;if(Vt&&(Vt=Vt(s,ae))){gC(pe,Vt,u,he);break e}Xe&&Xe(s,oe,ae),s==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&ly(oe,"number",oe.value)}switch(Xe=ae?ea(ae):window,s){case"focusin":(pC(Xe)||Xe.contentEditable==="true")&&(yc=Xe,Ey=ae,td=null);break;case"focusout":td=Ey=yc=null;break;case"mousedown":wy=!0;break;case"contextmenu":case"mouseup":case"dragend":wy=!1,jC(pe,u,he);break;case"selectionchange":if(C8)break;case"keydown":case"keyup":jC(pe,u,he)}var gt;if(xy)e:{switch(s){case"compositionstart":var Tt="onCompositionStart";break e;case"compositionend":Tt="onCompositionEnd";break e;case"compositionupdate":Tt="onCompositionUpdate";break e}Tt=void 0}else gc?hC(s,u)&&(Tt="onCompositionEnd"):s==="keydown"&&u.keyCode===229&&(Tt="onCompositionStart");Tt&&(uC&&u.locale!=="ko"&&(gc||Tt!=="onCompositionStart"?Tt==="onCompositionEnd"&&gc&&(gt=sC()):(ni=he,my="value"in ni?ni.value:ni.textContent,gc=!0)),Xe=rm(ae,Tt),0<Xe.length&&(Tt=new lC(Tt,s,null,u,he),pe.push({event:Tt,listeners:Xe}),gt?Tt.data=gt:(gt=mC(u),gt!==null&&(Tt.data=gt)))),(gt=f8?h8(s,u):m8(s,u))&&(Tt=rm(ae,"onBeforeInput"),0<Tt.length&&(Xe=new lC("onBeforeInput","beforeinput",null,u,he),pe.push({event:Xe,listeners:Tt}),Xe.data=gt)),sM(pe,s,ae,u,he)}XE(pe,i)})}function jd(s,i,u){return{instance:s,listener:i,currentTarget:u}}function rm(s,i){for(var u=i+"Capture",p=[];s!==null;){var x=s,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=Zu(s,u),x!=null&&p.unshift(jd(s,x,w)),x=Zu(s,i),x!=null&&p.push(jd(s,x,w))),s.tag===3)return p;s=s.return}return[]}function cM(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function ew(s,i,u,p,x){for(var w=i._reactName,N=[];u!==null&&u!==p;){var I=u,B=I.alternate,ae=I.stateNode;if(I=I.tag,B!==null&&B===p)break;I!==5&&I!==26&&I!==27||ae===null||(B=ae,x?(ae=Zu(u,w),ae!=null&&N.unshift(jd(u,ae,B))):x||(ae=Zu(u,w),ae!=null&&N.push(jd(u,ae,B)))),u=u.return}N.length!==0&&s.push({event:i,listeners:N})}var uM=/\r\n?/g,dM=/\u0000|\uFFFD/g;function tw(s){return(typeof s=="string"?s:""+s).replace(uM,`
49
- `).replace(dM,"")}function nw(s,i){return i=tw(i),tw(s)===i}function nn(s,i,u,p,x,w){switch(u){case"children":typeof p=="string"?i==="body"||i==="textarea"&&p===""||hc(s,p):(typeof p=="number"||typeof p=="bigint")&&i!=="body"&&hc(s,""+p);break;case"className":ao(s,"class",p);break;case"tabIndex":ao(s,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":ao(s,u,p);break;case"style":nC(s,p,w);break;case"data":if(i!=="object"){ao(s,"data",p);break}case"src":case"href":if(p===""&&(i!=="a"||u!=="href")){s.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(u);break}p=ch(""+p),s.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){s.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 w=="function"&&(u==="formAction"?(i!=="input"&&nn(s,i,"name",x.name,x,null),nn(s,i,"formEncType",x.formEncType,x,null),nn(s,i,"formMethod",x.formMethod,x,null),nn(s,i,"formTarget",x.formTarget,x,null)):(nn(s,i,"encType",x.encType,x,null),nn(s,i,"method",x.method,x,null),nn(s,i,"target",x.target,x,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){s.removeAttribute(u);break}p=ch(""+p),s.setAttribute(u,p);break;case"onClick":p!=null&&(s.onclick=so);break;case"onScroll":p!=null&&wt("scroll",s);break;case"onScrollEnd":p!=null&&wt("scrollend",s);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"multiple":s.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":s.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){s.removeAttribute("xlink:href");break}u=ch(""+p),s.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":p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,""+p):s.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":p&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,""):s.removeAttribute(u);break;case"capture":case"download":p===!0?s.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?s.setAttribute(u,p):s.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?s.setAttribute(u,p):s.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?s.removeAttribute(u):s.setAttribute(u,p);break;case"popover":wt("beforetoggle",s),wt("toggle",s),gn(s,"popover",p);break;case"xlinkActuate":za(s,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":za(s,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":za(s,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":za(s,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":za(s,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":za(s,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":za(s,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":za(s,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":za(s,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":gn(s,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=F6.get(u)||u,gn(s,u,p))}}function Yv(s,i,u,p,x,w){switch(u){case"style":nC(s,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(r(60));s.innerHTML=u}}break;case"children":typeof p=="string"?hc(s,p):(typeof p=="number"||typeof p=="bigint")&&hc(s,""+p);break;case"onScroll":p!=null&&wt("scroll",s);break;case"onScrollEnd":p!=null&&wt("scrollend",s);break;case"onClick":p!=null&&(s.onclick=so);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ds.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),i=u.slice(2,x?u.length-7:void 0),w=s[qe]||null,w=w!=null?w[u]:null,typeof w=="function"&&s.removeEventListener(i,w,x),typeof p=="function")){typeof w!="function"&&w!==null&&(u in s?s[u]=null:s.hasAttribute(u)&&s.removeAttribute(u)),s.addEventListener(i,p,x);break e}u in s?s[u]=p:p===!0?s.setAttribute(u,""):gn(s,u,p)}}}function wr(s,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":wt("error",s),wt("load",s);var p=!1,x=!1,w;for(w in u)if(u.hasOwnProperty(w)){var N=u[w];if(N!=null)switch(w){case"src":p=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:nn(s,i,w,N,u,null)}}x&&nn(s,i,"srcSet",u.srcSet,u,null),p&&nn(s,i,"src",u.src,u,null);return;case"input":wt("invalid",s);var I=w=N=x=null,B=null,ae=null;for(p in u)if(u.hasOwnProperty(p)){var he=u[p];if(he!=null)switch(p){case"name":x=he;break;case"type":N=he;break;case"checked":B=he;break;case"defaultChecked":ae=he;break;case"value":w=he;break;case"defaultValue":I=he;break;case"children":case"dangerouslySetInnerHTML":if(he!=null)throw Error(r(137,i));break;default:nn(s,i,p,he,u,null)}}XS(s,w,I,B,ae,N,x,!1);return;case"select":wt("invalid",s),p=N=w=null;for(x in u)if(u.hasOwnProperty(x)&&(I=u[x],I!=null))switch(x){case"value":w=I;break;case"defaultValue":N=I;break;case"multiple":p=I;default:nn(s,i,x,I,u,null)}i=w,u=N,s.multiple=!!p,i!=null?fc(s,!!p,i,!1):u!=null&&fc(s,!!p,u,!0);return;case"textarea":wt("invalid",s),w=x=p=null;for(N in u)if(u.hasOwnProperty(N)&&(I=u[N],I!=null))switch(N){case"value":p=I;break;case"defaultValue":x=I;break;case"children":w=I;break;case"dangerouslySetInnerHTML":if(I!=null)throw Error(r(91));break;default:nn(s,i,N,I,u,null)}eC(s,p,x,w);return;case"option":for(B in u)if(u.hasOwnProperty(B)&&(p=u[B],p!=null))switch(B){case"selected":s.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:nn(s,i,B,p,u,null)}return;case"dialog":wt("beforetoggle",s),wt("toggle",s),wt("cancel",s),wt("close",s);break;case"iframe":case"object":wt("load",s);break;case"video":case"audio":for(p=0;p<Rd.length;p++)wt(Rd[p],s);break;case"image":wt("error",s),wt("load",s);break;case"details":wt("toggle",s);break;case"embed":case"source":case"link":wt("error",s),wt("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in u)if(u.hasOwnProperty(ae)&&(p=u[ae],p!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:nn(s,i,ae,p,u,null)}return;default:if(cy(i)){for(he in u)u.hasOwnProperty(he)&&(p=u[he],p!==void 0&&Yv(s,i,he,p,u,void 0));return}}for(I in u)u.hasOwnProperty(I)&&(p=u[I],p!=null&&nn(s,i,I,p,u,null))}function fM(s,i,u,p){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,N=null,I=null,B=null,ae=null,he=null;for(fe in u){var pe=u[fe];if(u.hasOwnProperty(fe)&&pe!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":B=pe;default:p.hasOwnProperty(fe)||nn(s,i,fe,null,p,pe)}}for(var oe in p){var fe=p[oe];if(pe=u[oe],p.hasOwnProperty(oe)&&(fe!=null||pe!=null))switch(oe){case"type":w=fe;break;case"name":x=fe;break;case"checked":ae=fe;break;case"defaultChecked":he=fe;break;case"value":N=fe;break;case"defaultValue":I=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,i));break;default:fe!==pe&&nn(s,i,oe,fe,p,pe)}}iy(s,N,I,B,ae,he,w,x);return;case"select":fe=N=I=oe=null;for(w in u)if(B=u[w],u.hasOwnProperty(w)&&B!=null)switch(w){case"value":break;case"multiple":fe=B;default:p.hasOwnProperty(w)||nn(s,i,w,null,p,B)}for(x in p)if(w=p[x],B=u[x],p.hasOwnProperty(x)&&(w!=null||B!=null))switch(x){case"value":oe=w;break;case"defaultValue":I=w;break;case"multiple":N=w;default:w!==B&&nn(s,i,x,w,p,B)}i=I,u=N,p=fe,oe!=null?fc(s,!!u,oe,!1):!!p!=!!u&&(i!=null?fc(s,!!u,i,!0):fc(s,!!u,u?[]:"",!1));return;case"textarea":fe=oe=null;for(I in u)if(x=u[I],u.hasOwnProperty(I)&&x!=null&&!p.hasOwnProperty(I))switch(I){case"value":break;case"children":break;default:nn(s,i,I,null,p,x)}for(N in p)if(x=p[N],w=u[N],p.hasOwnProperty(N)&&(x!=null||w!=null))switch(N){case"value":oe=x;break;case"defaultValue":fe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&nn(s,i,N,x,p,w)}JS(s,oe,fe);return;case"option":for(var Ge in u)if(oe=u[Ge],u.hasOwnProperty(Ge)&&oe!=null&&!p.hasOwnProperty(Ge))switch(Ge){case"selected":s.selected=!1;break;default:nn(s,i,Ge,null,p,oe)}for(B in p)if(oe=p[B],fe=u[B],p.hasOwnProperty(B)&&oe!==fe&&(oe!=null||fe!=null))switch(B){case"selected":s.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:nn(s,i,B,oe,p,fe)}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 nt in u)oe=u[nt],u.hasOwnProperty(nt)&&oe!=null&&!p.hasOwnProperty(nt)&&nn(s,i,nt,null,p,oe);for(ae in p)if(oe=p[ae],fe=u[ae],p.hasOwnProperty(ae)&&oe!==fe&&(oe!=null||fe!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(r(137,i));break;default:nn(s,i,ae,oe,p,fe)}return;default:if(cy(i)){for(var rn in u)oe=u[rn],u.hasOwnProperty(rn)&&oe!==void 0&&!p.hasOwnProperty(rn)&&Yv(s,i,rn,void 0,p,oe);for(he in p)oe=p[he],fe=u[he],!p.hasOwnProperty(he)||oe===fe||oe===void 0&&fe===void 0||Yv(s,i,he,oe,p,fe);return}}for(var ee in u)oe=u[ee],u.hasOwnProperty(ee)&&oe!=null&&!p.hasOwnProperty(ee)&&nn(s,i,ee,null,p,oe);for(pe in p)oe=p[pe],fe=u[pe],!p.hasOwnProperty(pe)||oe===fe||oe==null&&fe==null||nn(s,i,pe,oe,p,fe)}function rw(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hM(){if(typeof performance.getEntriesByType=="function"){for(var s=0,i=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var x=u[p],w=x.transferSize,N=x.initiatorType,I=x.duration;if(w&&I&&rw(N)){for(N=0,I=x.responseEnd,p+=1;p<u.length;p++){var B=u[p],ae=B.startTime;if(ae>I)break;var he=B.transferSize,pe=B.initiatorType;he&&rw(pe)&&(B=B.responseEnd,N+=he*(B<I?1:(I-ae)/(B-ae)))}if(--p,i+=8*(w+N)/(x.duration/1e3),s++,10<s)break}}if(0<s)return i/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Wv=null,Qv=null;function am(s){return s.nodeType===9?s:s.ownerDocument}function aw(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function sw(s,i){if(s===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&i==="foreignObject"?0:s}function Xv(s,i){return s==="textarea"||s==="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 Jv=null;function mM(){var s=window.event;return s&&s.type==="popstate"?s===Jv?!1:(Jv=s,!0):(Jv=null,!1)}var ow=typeof setTimeout=="function"?setTimeout:void 0,pM=typeof clearTimeout=="function"?clearTimeout:void 0,iw=typeof Promise=="function"?Promise:void 0,gM=typeof queueMicrotask=="function"?queueMicrotask:typeof iw<"u"?function(s){return iw.resolve(null).then(s).catch(yM)}:ow;function yM(s){setTimeout(function(){throw s})}function xi(s){return s==="head"}function lw(s,i){var u=i,p=0;do{var x=u.nextSibling;if(s.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(p===0){s.removeChild(x),Bc(i);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Td(s.ownerDocument.documentElement);else if(u==="head"){u=s.ownerDocument.head,Td(u);for(var w=u.firstChild;w;){var N=w.nextSibling,I=w.nodeName;w[Kt]||I==="SCRIPT"||I==="STYLE"||I==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=N}}else u==="body"&&Td(s.ownerDocument.body);u=x}while(u);Bc(i)}function cw(s,i){var u=s;s=0;do{var p=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||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(s===0)break;s--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||s++;u=p}while(u)}function ex(s){var i=s.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":ex(u),Yt(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}s.removeChild(u)}}function vM(s,i,u,p){for(;s.nodeType===1;){var x=u;if(s.nodeName.toLowerCase()!==i.toLowerCase()){if(!p&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(p){if(!s[Kt])switch(i){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(w=s.getAttribute("rel"),w==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(w!==x.rel||s.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||s.getAttribute("title")!==(x.title==null?null:x.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(w=s.getAttribute("src"),(w!==(x.src==null?null:x.src)||s.getAttribute("type")!==(x.type==null?null:x.type)||s.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(i==="input"&&s.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&s.getAttribute("name")===w)return s}else return s;if(s=Ya(s.nextSibling),s===null)break}return null}function xM(s,i,u){if(i==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!u||(s=Ya(s.nextSibling),s===null))return null;return s}function uw(s,i){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!i||(s=Ya(s.nextSibling),s===null))return null;return s}function tx(s){return s.data==="$?"||s.data==="$~"}function nx(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function bM(s,i){var u=s.ownerDocument;if(s.data==="$~")s._reactRetry=i;else if(s.data!=="$?"||u.readyState!=="loading")i();else{var p=function(){i(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),s._reactRetry=p}}function Ya(s){for(;s!=null;s=s.nextSibling){var i=s.nodeType;if(i===1||i===3)break;if(i===8){if(i=s.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return s}var rx=null;function dw(s){s=s.nextSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="/$"||u==="/&"){if(i===0)return Ya(s.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}s=s.nextSibling}return null}function fw(s){s=s.previousSibling;for(var i=0;s;){if(s.nodeType===8){var u=s.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return s;i--}else u!=="/$"&&u!=="/&"||i++}s=s.previousSibling}return null}function hw(s,i,u){switch(i=am(u),s){case"html":if(s=i.documentElement,!s)throw Error(r(452));return s;case"head":if(s=i.head,!s)throw Error(r(453));return s;case"body":if(s=i.body,!s)throw Error(r(454));return s;default:throw Error(r(451))}}function Td(s){for(var i=s.attributes;i.length;)s.removeAttributeNode(i[0]);Yt(s)}var Wa=new Map,mw=new Set;function sm(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var Co=$.d;$.d={f:SM,r:CM,D:EM,C:wM,L:RM,m:jM,X:_M,S:TM,M:NM};function SM(){var s=Co.f(),i=Wh();return s||i}function CM(s){var i=Fa(s);i!==null&&i.tag===5&&i.type==="form"?D2(i):Co.r(s)}var zc=typeof document>"u"?null:document;function pw(s,i,u){var p=zc;if(p&&typeof i=="string"&&i){var x=Ha(i);x='link[rel="'+s+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),mw.has(x)||(mw.add(x),s={rel:s,crossOrigin:u,href:i},p.querySelector(x)===null&&(i=p.createElement("link"),wr(i,"link",s),Nn(i),p.head.appendChild(i)))}}function EM(s){Co.D(s),pw("dns-prefetch",s,null)}function wM(s,i){Co.C(s,i),pw("preconnect",s,i)}function RM(s,i,u){Co.L(s,i,u);var p=zc;if(p&&s&&i){var x='link[rel="preload"][as="'+Ha(i)+'"]';i==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+Ha(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+Ha(u.imageSizes)+'"]')):x+='[href="'+Ha(s)+'"]';var w=x;switch(i){case"style":w=Hc(s);break;case"script":w=$c(s)}Wa.has(w)||(s=y({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:s,as:i},u),Wa.set(w,s),p.querySelector(x)!==null||i==="style"&&p.querySelector(_d(w))||i==="script"&&p.querySelector(Nd(w))||(i=p.createElement("link"),wr(i,"link",s),Nn(i),p.head.appendChild(i)))}}function jM(s,i){Co.m(s,i);var u=zc;if(u&&s){var p=i&&typeof i.as=="string"?i.as:"script",x='link[rel="modulepreload"][as="'+Ha(p)+'"][href="'+Ha(s)+'"]',w=x;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=$c(s)}if(!Wa.has(w)&&(s=y({rel:"modulepreload",href:s},i),Wa.set(w,s),u.querySelector(x)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Nd(w)))return}p=u.createElement("link"),wr(p,"link",s),Nn(p),u.head.appendChild(p)}}}function TM(s,i,u){Co.S(s,i,u);var p=zc;if(p&&s){var x=br(p).hoistableStyles,w=Hc(s);i=i||"default";var N=x.get(w);if(!N){var I={loading:0,preload:null};if(N=p.querySelector(_d(w)))I.loading=5;else{s=y({rel:"stylesheet",href:s,"data-precedence":i},u),(u=Wa.get(w))&&ax(s,u);var B=N=p.createElement("link");Nn(B),wr(B,"link",s),B._p=new Promise(function(ae,he){B.onload=ae,B.onerror=he}),B.addEventListener("load",function(){I.loading|=1}),B.addEventListener("error",function(){I.loading|=2}),I.loading|=4,om(N,i,p)}N={type:"stylesheet",instance:N,count:1,state:I},x.set(w,N)}}}function _M(s,i){Co.X(s,i);var u=zc;if(u&&s){var p=br(u).hoistableScripts,x=$c(s),w=p.get(x);w||(w=u.querySelector(Nd(x)),w||(s=y({src:s,async:!0},i),(i=Wa.get(x))&&sx(s,i),w=u.createElement("script"),Nn(w),wr(w,"link",s),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function NM(s,i){Co.M(s,i);var u=zc;if(u&&s){var p=br(u).hoistableScripts,x=$c(s),w=p.get(x);w||(w=u.querySelector(Nd(x)),w||(s=y({src:s,async:!0,type:"module"},i),(i=Wa.get(x))&&sx(s,i),w=u.createElement("script"),Nn(w),wr(w,"link",s),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function gw(s,i,u,p){var x=(x=ve.current)?sm(x):null;if(!x)throw Error(r(446));switch(s){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=Hc(u.href),u=br(x).hoistableStyles,p=u.get(i),p||(p={type:"style",instance:null,count:0,state:null},u.set(i,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){s=Hc(u.href);var w=br(x).hoistableStyles,N=w.get(s);if(N||(x=x.ownerDocument||x,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(s,N),(w=x.querySelector(_d(s)))&&!w._p&&(N.instance=w,N.state.loading=5),Wa.has(s)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Wa.set(s,u),w||AM(x,s,u,N.state))),i&&p===null)throw Error(r(528,""));return N}if(i&&p!==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=$c(u),u=br(x).hoistableScripts,p=u.get(i),p||(p={type:"script",instance:null,count:0,state:null},u.set(i,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,s))}}function Hc(s){return'href="'+Ha(s)+'"'}function _d(s){return'link[rel="stylesheet"]['+s+"]"}function yw(s){return y({},s,{"data-precedence":s.precedence,precedence:null})}function AM(s,i,u,p){s.querySelector('link[rel="preload"][as="style"]['+i+"]")?p.loading=1:(i=s.createElement("link"),p.preload=i,i.addEventListener("load",function(){return p.loading|=1}),i.addEventListener("error",function(){return p.loading|=2}),wr(i,"link",u),Nn(i),s.head.appendChild(i))}function $c(s){return'[src="'+Ha(s)+'"]'}function Nd(s){return"script[async]"+s}function vw(s,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var p=s.querySelector('style[data-href~="'+Ha(u.href)+'"]');if(p)return i.instance=p,Nn(p),p;var x=y({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(s.ownerDocument||s).createElement("style"),Nn(p),wr(p,"style",x),om(p,u.precedence,s),i.instance=p;case"stylesheet":x=Hc(u.href);var w=s.querySelector(_d(x));if(w)return i.state.loading|=4,i.instance=w,Nn(w),w;p=yw(u),(x=Wa.get(x))&&ax(p,x),w=(s.ownerDocument||s).createElement("link"),Nn(w);var N=w;return N._p=new Promise(function(I,B){N.onload=I,N.onerror=B}),wr(w,"link",p),i.state.loading|=4,om(w,u.precedence,s),i.instance=w;case"script":return w=$c(u.src),(x=s.querySelector(Nd(w)))?(i.instance=x,Nn(x),x):(p=u,(x=Wa.get(w))&&(p=y({},u),sx(p,x)),s=s.ownerDocument||s,x=s.createElement("script"),Nn(x),wr(x,"link",p),s.head.appendChild(x),i.instance=x);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(p=i.instance,i.state.loading|=4,om(p,u.precedence,s));return i.instance}function om(s,i,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=p.length?p[p.length-1]:null,w=x,N=0;N<p.length;N++){var I=p[N];if(I.dataset.precedence===i)w=I;else if(w!==x)break}w?w.parentNode.insertBefore(s,w.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(s,i.firstChild))}function ax(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.title==null&&(s.title=i.title)}function sx(s,i){s.crossOrigin==null&&(s.crossOrigin=i.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=i.referrerPolicy),s.integrity==null&&(s.integrity=i.integrity)}var im=null;function xw(s,i,u){if(im===null){var p=new Map,x=im=new Map;x.set(u,p)}else x=im,p=x.get(u),p||(p=new Map,x.set(u,p));if(p.has(s))return p;for(p.set(s,null),u=u.getElementsByTagName(s),x=0;x<u.length;x++){var w=u[x];if(!(w[Kt]||w[He]||s==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var N=w.getAttribute(i)||"";N=s+N;var I=p.get(N);I?I.push(w):p.set(N,[w])}}return p}function bw(s,i,u){s=s.ownerDocument||s,s.head.insertBefore(u,i==="title"?s.querySelector("head > title"):null)}function DM(s,i,u){if(u===1||i.itemProp!=null)return!1;switch(s){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 s=i.disabled,typeof i.precedence=="string"&&s==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 Sw(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function OM(s,i,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=Hc(p.href),w=i.querySelector(_d(x));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(s.count++,s=lm.bind(s),i.then(s,s)),u.state.loading|=4,u.instance=w,Nn(w);return}w=i.ownerDocument||i,p=yw(p),(x=Wa.get(x))&&ax(p,x),w=w.createElement("link"),Nn(w);var N=w;N._p=new Promise(function(I,B){N.onload=I,N.onerror=B}),wr(w,"link",p),u.instance=w}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(s.count++,u=lm.bind(s),i.addEventListener("load",u),i.addEventListener("error",u))}}var ox=0;function MM(s,i){return s.stylesheets&&s.count===0&&um(s,s.stylesheets),0<s.count||0<s.imgCount?function(u){var p=setTimeout(function(){if(s.stylesheets&&um(s,s.stylesheets),s.unsuspend){var w=s.unsuspend;s.unsuspend=null,w()}},6e4+i);0<s.imgBytes&&ox===0&&(ox=62500*hM());var x=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&um(s,s.stylesheets),s.unsuspend)){var w=s.unsuspend;s.unsuspend=null,w()}},(s.imgBytes>ox?50:800)+i);return s.unsuspend=u,function(){s.unsuspend=null,clearTimeout(p),clearTimeout(x)}}:null}function lm(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)um(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var cm=null;function um(s,i){s.stylesheets=null,s.unsuspend!==null&&(s.count++,cm=new Map,i.forEach(IM,s),cm=null,lm.call(s))}function IM(s,i){if(!(i.state.loading&4)){var u=cm.get(s);if(u)var p=u.get(null);else{u=new Map,cm.set(s,u);for(var x=s.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var N=x[w];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(u.set(N.dataset.precedence,N),p=N)}p&&u.set(null,p)}x=i.instance,N=x.getAttribute("data-precedence"),w=u.get(N)||p,w===p&&u.set(null,x),u.set(N,x),this.count++,p=lm.bind(this),x.addEventListener("load",p),x.addEventListener("error",p),w?w.parentNode.insertBefore(x,w.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(x,s.firstChild)),i.state.loading|=4}}var Ad={$$typeof:_,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function kM(s,i,u,p,x,w,N,I,B){this.tag=1,this.containerInfo=s,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=Ar(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ar(0),this.hiddenUpdates=Ar(null),this.identifierPrefix=p,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function Cw(s,i,u,p,x,w,N,I,B,ae,he,pe){return s=new kM(s,i,u,N,B,ae,he,pe,I),i=1,w===!0&&(i|=24),w=ba(3,null,null,i),s.current=w,w.stateNode=s,i=Fy(),i.refCount++,s.pooledCache=i,i.refCount++,w.memoizedState={element:p,isDehydrated:u,cache:i},$y(w),s}function Ew(s){return s?(s=bc,s):bc}function ww(s,i,u,p,x,w){x=Ew(x),p.context===null?p.context=x:p.pendingContext=x,p=li(i),p.payload={element:u},w=w===void 0?null:w,w!==null&&(p.callback=w),u=ci(s,p,i),u!==null&&(ia(u,s,i),ld(u,s,i))}function Rw(s,i){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var u=s.retryLane;s.retryLane=u!==0&&u<i?u:i}}function ix(s,i){Rw(s,i),(s=s.alternate)&&Rw(s,i)}function jw(s){if(s.tag===13||s.tag===31){var i=ml(s,67108864);i!==null&&ia(i,s,67108864),ix(s,67108864)}}function Tw(s){if(s.tag===13||s.tag===31){var i=Ra();i=Re(i);var u=ml(s,i);u!==null&&ia(u,s,i),ix(s,i)}}var dm=!0;function LM(s,i,u,p){var x=k.T;k.T=null;var w=$.p;try{$.p=2,lx(s,i,u,p)}finally{$.p=w,k.T=x}}function PM(s,i,u,p){var x=k.T;k.T=null;var w=$.p;try{$.p=8,lx(s,i,u,p)}finally{$.p=w,k.T=x}}function lx(s,i,u,p){if(dm){var x=cx(p);if(x===null)Kv(s,i,p,fm,u),Nw(s,p);else if(FM(x,s,i,u,p))p.stopPropagation();else if(Nw(s,p),i&4&&-1<UM.indexOf(s)){for(;x!==null;){var w=Fa(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var N=pn(w.pendingLanes);if(N!==0){var I=w;for(I.pendingLanes|=2,I.entangledLanes|=2;N;){var B=1<<31-_n(N);I.entanglements[1]|=B,N&=~B}ks(w),(Bt&6)===0&&(Kh=Se()+500,wd(0))}}break;case 31:case 13:I=ml(w,2),I!==null&&ia(I,w,2),Wh(),ix(w,2)}if(w=cx(p),w===null&&Kv(s,i,p,fm,u),w===x)break;x=w}x!==null&&p.stopPropagation()}else Kv(s,i,p,null,u)}}function cx(s){return s=dy(s),ux(s)}var fm=null;function ux(s){if(fm=null,s=Jr(s),s!==null){var i=l(s);if(i===null)s=null;else{var u=i.tag;if(u===13){if(s=c(i),s!==null)return s;s=null}else if(u===31){if(s=d(i),s!==null)return s;s=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;s=null}else i!==s&&(s=null)}}return fm=s,null}function _w(s){switch(s){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(Ee()){case We:return 2;case ot:return 8;case it:case xn:return 32;case Ua:return 268435456;default:return 32}default:return 32}}var dx=!1,bi=null,Si=null,Ci=null,Dd=new Map,Od=new Map,Ei=[],UM="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 Nw(s,i){switch(s){case"focusin":case"focusout":bi=null;break;case"dragenter":case"dragleave":Si=null;break;case"mouseover":case"mouseout":Ci=null;break;case"pointerover":case"pointerout":Dd.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Od.delete(i.pointerId)}}function Md(s,i,u,p,x,w){return s===null||s.nativeEvent!==w?(s={blockedOn:i,domEventName:u,eventSystemFlags:p,nativeEvent:w,targetContainers:[x]},i!==null&&(i=Fa(i),i!==null&&jw(i)),s):(s.eventSystemFlags|=p,i=s.targetContainers,x!==null&&i.indexOf(x)===-1&&i.push(x),s)}function FM(s,i,u,p,x){switch(i){case"focusin":return bi=Md(bi,s,i,u,p,x),!0;case"dragenter":return Si=Md(Si,s,i,u,p,x),!0;case"mouseover":return Ci=Md(Ci,s,i,u,p,x),!0;case"pointerover":var w=x.pointerId;return Dd.set(w,Md(Dd.get(w)||null,s,i,u,p,x)),!0;case"gotpointercapture":return w=x.pointerId,Od.set(w,Md(Od.get(w)||null,s,i,u,p,x)),!0}return!1}function Aw(s){var i=Jr(s.target);if(i!==null){var u=l(i);if(u!==null){if(i=u.tag,i===13){if(i=c(u),i!==null){s.blockedOn=i,Ie(s.priority,function(){Tw(u)});return}}else if(i===31){if(i=d(u),i!==null){s.blockedOn=i,Ie(s.priority,function(){Tw(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){s.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}s.blockedOn=null}function hm(s){if(s.blockedOn!==null)return!1;for(var i=s.targetContainers;0<i.length;){var u=cx(s.nativeEvent);if(u===null){u=s.nativeEvent;var p=new u.constructor(u.type,u);uy=p,u.target.dispatchEvent(p),uy=null}else return i=Fa(u),i!==null&&jw(i),s.blockedOn=u,!1;i.shift()}return!0}function Dw(s,i,u){hm(s)&&u.delete(i)}function VM(){dx=!1,bi!==null&&hm(bi)&&(bi=null),Si!==null&&hm(Si)&&(Si=null),Ci!==null&&hm(Ci)&&(Ci=null),Dd.forEach(Dw),Od.forEach(Dw)}function mm(s,i){s.blockedOn===i&&(s.blockedOn=null,dx||(dx=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,VM)))}var pm=null;function Ow(s){pm!==s&&(pm=s,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){pm===s&&(pm=null);for(var i=0;i<s.length;i+=3){var u=s[i],p=s[i+1],x=s[i+2];if(typeof p!="function"){if(ux(p||u)===null)continue;break}var w=Fa(u);w!==null&&(s.splice(i,3),i-=3,cv(w,{pending:!0,data:x,method:u.method,action:p},p,x))}}))}function Bc(s){function i(B){return mm(B,s)}bi!==null&&mm(bi,s),Si!==null&&mm(Si,s),Ci!==null&&mm(Ci,s),Dd.forEach(i),Od.forEach(i);for(var u=0;u<Ei.length;u++){var p=Ei[u];p.blockedOn===s&&(p.blockedOn=null)}for(;0<Ei.length&&(u=Ei[0],u.blockedOn===null);)Aw(u),u.blockedOn===null&&Ei.shift();if(u=(s.ownerDocument||s).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var x=u[p],w=u[p+1],N=x[qe]||null;if(typeof w=="function")N||Ow(u);else if(N){var I=null;if(w&&w.hasAttribute("formAction")){if(x=w,N=w[qe]||null)I=N.formAction;else if(ux(x)!==null)continue}else I=N.action;typeof I=="function"?u[p+1]=I:(u.splice(p,3),p-=3),Ow(u)}}}function Mw(){function s(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(N){return x=N})},focusReset:"manual",scroll:"manual"})}function i(){x!==null&&(x(),x=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,x=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),x!==null&&(x(),x=null)}}}function fx(s){this._internalRoot=s}gm.prototype.render=fx.prototype.render=function(s){var i=this._internalRoot;if(i===null)throw Error(r(409));var u=i.current,p=Ra();ww(u,p,s,i,null,null)},gm.prototype.unmount=fx.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var i=s.containerInfo;ww(s.current,2,null,s,null,null),Wh(),i[Ze]=null}};function gm(s){this._internalRoot=s}gm.prototype.unstable_scheduleHydration=function(s){if(s){var i=Le();s={blockedOn:null,target:s,priority:i};for(var u=0;u<Ei.length&&i!==0&&i<Ei[u].priority;u++);Ei.splice(u,0,s),u===0&&Aw(s)}};var Iw=t.version;if(Iw!=="19.2.0")throw Error(r(527,Iw,"19.2.0"));$.findDOMNode=function(s){var i=s._reactInternals;if(i===void 0)throw typeof s.render=="function"?Error(r(188)):(s=Object.keys(s).join(","),Error(r(268,s)));return s=h(i),s=s!==null?g(s):null,s=s===null?null:s.stateNode,s};var zM={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ym=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ym.isDisabled&&ym.supportsFiber)try{Fn=ym.inject(zM),Tn=ym}catch{}}return kd.createRoot=function(s,i){if(!o(s))throw Error(r(299));var u=!1,p="",x=z2,w=H2,N=$2;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError)),i=Cw(s,1,!1,null,null,u,p,null,x,w,N,Mw),s[Ze]=i.current,Zv(s),new fx(i)},kd.hydrateRoot=function(s,i,u){if(!o(s))throw Error(r(299));var p=!1,x="",w=z2,N=H2,I=$2,B=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(N=u.onCaughtError),u.onRecoverableError!==void 0&&(I=u.onRecoverableError),u.formState!==void 0&&(B=u.formState)),i=Cw(s,1,!0,i,u??null,p,x,B,w,N,I,Mw),i.context=Ew(null),u=i.current,p=Ra(),p=Re(p),x=li(p),x.callback=null,ci(u,x,p),u=p,i.current.lanes=u,Xr(i,u),ks(i),s[Ze]=i.current,Zv(s),new gm(i)},kd.version="19.2.0",kd}var Bw;function JM(){if(Bw)return px.exports;Bw=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(),px.exports=XM(),px.exports}var e9=JM();/**
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 YT=e=>{throw TypeError(e)},t9=(e,t,n)=>t.has(e)||YT("Cannot "+n),xx=(e,t,n)=>(t9(e,t,"read from private field"),n?n.call(e):t.get(e)),n9=(e,t,n)=>t.has(e)?YT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Gw="popstate";function r9(e={}){function t(r,o){let{pathname:l,search:c,hash:d}=r.location;return uf("",{pathname:l,search:c,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Zs(o)}return s9(t,n,null,e)}function xt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function kn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function a9(){return Math.random().toString(36).substring(2,10)}function qw(e,t){return{usr:e.state,key:e.key,idx:t}}function uf(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Qi(t):t,state:n,key:t&&t.key||r||a9()}}function Zs({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 Qi(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 s9(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:l=!1}=r,c=o.history,d="POP",f=null,h=g();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function g(){return(c.state||{idx:null}).idx}function y(){d="POP";let C=g(),R=C==null?null:C-h;h=C,f&&f({action:d,location:S.location,delta:R})}function v(C,R){d="PUSH";let j=uf(S.location,C,R);h=g()+1;let _=qw(j,h),D=S.createHref(j);try{c.pushState(_,"",D)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;o.location.assign(D)}l&&f&&f({action:d,location:S.location,delta:1})}function b(C,R){d="REPLACE";let j=uf(S.location,C,R);h=g();let _=qw(j,h),D=S.createHref(j);c.replaceState(_,"",D),l&&f&&f({action:d,location:S.location,delta:0})}function E(C){return WT(C)}let S={get action(){return d},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(Gw,y),f=C,()=>{o.removeEventListener(Gw,y),f=null}},createHref(C){return t(o,C)},createURL:E,encodeLocation(C){let R=E(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:b,go(C){return c.go(C)}};return S}function WT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),xt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Zs(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Yd,Zw=class{constructor(e){if(n9(this,Yd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(xx(this,Yd).has(e))return xx(this,Yd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){xx(this,Yd).set(e,t)}};Yd=new WeakMap;var o9=new Set(["lazy","caseSensitive","path","id","index","children"]);function i9(e){return o9.has(e)}var l9=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function c9(e){return l9.has(e)}function u9(e){return e.index===!0}function df(e,t,n=[],r={},o=!1){return e.map((l,c)=>{let d=[...n,String(c)],f=typeof l.id=="string"?l.id:d.join("-");if(xt(l.index!==!0||!l.children,"Cannot specify children on an index route"),xt(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),u9(l)){let h={...l,id:f};return r[f]=Kw(h,t(h)),h}else{let h={...l,id:f,children:void 0};return r[f]=Kw(h,t(h)),l.children&&(h.children=df(l.children,t,d,r,o)),h}})}function Kw(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ai(e,t,n="/"){return qm(e,t,n,!1)}function qm(e,t,n,r){let o=typeof t=="string"?Qi(t):t,l=ts(o.pathname||"/",n);if(l==null)return null;let c=QT(e);f9(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let h=E9(l);d=S9(c[f],h,r)}return d}function d9(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function QT(e,t=[],n=[],r="",o=!1){let l=(c,d,f=o,h)=>{let g={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&f)return;xt(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let y=$s([r,g.relativePath]),v=n.concat(g);c.children&&c.children.length>0&&(xt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),QT(c.children,t,v,y,f)),!(c.path==null&&!c.index)&&t.push({path:y,score:x9(y,c.index),routesMeta:v})};return e.forEach((c,d)=>{var f;if(c.path===""||!((f=c.path)!=null&&f.includes("?")))l(c,d);else for(let h of XT(c.path))l(c,d,!0,h)}),t}function XT(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return o?[l,""]:[l];let c=XT(r.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),o&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function f9(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:b9(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var h9=/^:[\w-]+$/,m9=3,p9=2,g9=1,y9=10,v9=-2,Yw=e=>e==="*";function x9(e,t){let n=e.split("/"),r=n.length;return n.some(Yw)&&(r+=v9),t&&(r+=p9),n.filter(o=>!Yw(o)).reduce((o,l)=>o+(h9.test(l)?m9:l===""?g9:y9),r)}function b9(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function S9(e,t,n=!1){let{routesMeta:r}=e,o={},l="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],h=d===r.length-1,g=l==="/"?t:t.slice(l.length)||"/",y=op({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),v=f.route;if(!y&&h&&n&&!r[r.length-1].route.index&&(y=op({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!y)return null;Object.assign(o,y.params),c.push({params:o,pathname:$s([l,y.pathname]),pathnameBase:T9($s([l,y.pathnameBase])),route:v}),y.pathnameBase!=="/"&&(l=$s([l,y.pathnameBase]))}return c}function op(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=C9(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let l=o[0],c=l.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((h,{paramName:g,isOptional:y},v)=>{if(g==="*"){let E=d[v]||"";c=l.slice(0,l.length-E.length).replace(/(.)\/+$/,"$1")}const b=d[v];return y&&!b?h[g]=void 0:h[g]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:c,pattern:e}}function C9(e,t=!1,n=!0){kn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+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:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function E9(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ts(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 w9({basename:e,pathname:t}){return t==="/"?e:$s([e,t])}function R9(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Qi(e):e;return{pathname:n?n.startsWith("/")?n:j9(n,t):t,search:_9(r),hash:N9(o)}}function j9(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function bx(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 JT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Wp(e){let t=JT(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Qp(e,t,n,r=!1){let o;typeof e=="string"?o=Qi(e):(o={...e},xt(!o.pathname||!o.pathname.includes("?"),bx("?","pathname","search",o)),xt(!o.pathname||!o.pathname.includes("#"),bx("#","pathname","hash",o)),xt(!o.search||!o.search.includes("#"),bx("#","search","hash",o)));let l=e===""||o.pathname==="",c=l?"/":o.pathname,d;if(c==null)d=n;else{let y=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),y-=1;o.pathname=v.join("/")}d=y>=0?t[y]:"/"}let f=R9(o,d),h=c&&c!=="/"&&c.endsWith("/"),g=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var $s=e=>e.join("/").replace(/\/\/+/g,"/"),T9=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),_9=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,N9=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,ip=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 ff(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function D1(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Mi=Symbol("Uninstrumented");function A9(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({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 o=iu(n.lazy,t.lazy,()=>{});o&&(r.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(l=>{let c=o[l],d=n[`lazy.${l}`];if(typeof c=="function"&&d.length>0){let f=iu(d,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(o=>{let l=t[o];if(typeof l=="function"&&n[o].length>0){let c=l[Mi]??l,d=iu(n[o],c,(...f)=>Ww(f[0]));d&&(d[Mi]=c,r[o]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let l=o[Mi]??o,c=iu(n.middleware,l,(...d)=>Ww(d[0]));return c?(c[Mi]=l,c):o})),r}function D9(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(o){let l=Object.keys(o);for(let c of l)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let r=e.navigate[Mi]??e.navigate,o=iu(n.navigate,r,(...l)=>{let[c,d]=l;return{to:typeof c=="number"||typeof c=="string"?c:c?Zs(c):".",...Qw(e,d??{})}});o&&(o[Mi]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[Mi]??e.fetch,o=iu(n.fetch,r,(...l)=>{let[c,,d,f]=l;return{href:d??".",fetcherKey:c,...Qw(e,f??{})}});o&&(o[Mi]=r,e.fetch=o)}return e}function iu(e,t,n){return e.length===0?null:async(...r)=>{let o=await e_(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function e_(e,t,n,r){let o=e[r],l;if(o){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=e_(e,t,n,r-1),l=await c,xt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(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 Ww(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:O9(t),params:{...r},unstable_pattern:o,context:M9(n)}}function Qw(e,t){return{currentUrl:Zs(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 O9(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function M9(e){if(k9(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var I9=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function k9(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")===I9}var t_=["POST","PUT","PATCH","DELETE"],L9=new Set(t_),P9=["GET",...t_],U9=new Set(P9),F9=new Set([301,302,303,307,308]),V9=new Set([307,308]),Sx={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},z9={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ld={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},H9=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,O1=e=>H9.test(e),$9=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),n_="remix-router-transitions",r_=Symbol("ResetLoaderData");function B9(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";xt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||$9,l=o;if(e.unstable_instrumentations){let z=e.unstable_instrumentations;l=J=>({...o(J),...A9(z.map(se=>se.route).filter(Boolean),J)})}let c={},d=df(e.routes,l,void 0,c),f,h=e.basename||"/";h.startsWith("/")||(h=`/${h}`);let g=e.dataStrategy||Y9,y={...e.future},v=null,b=new Set,E=null,S=null,C=null,R=e.hydrationData!=null,j=Ai(d,e.history.location,h),_=!1,D=null,A;if(j==null&&!e.patchRoutesOnNavigation){let z=Qa(404,{pathname:e.history.location.pathname}),{matches:J,route:se}=vm(d);A=!0,j=J,D={[se.id]:z}}else if(j&&!e.hydrationData&&er(j,d,e.history.location.pathname).active&&(j=null),j)if(j.some(z=>z.route.lazy))A=!1;else if(!j.some(z=>M1(z.route)))A=!0;else{let z=e.hydrationData?e.hydrationData.loaderData:null,J=e.hydrationData?e.hydrationData.errors:null;if(J){let se=j.findIndex(ge=>J[ge.route.id]!==void 0);A=j.slice(0,se+1).every(ge=>!C0(ge.route,z,J))}else A=j.every(se=>!C0(se.route,z,J))}else{A=!1,j=[];let z=er(null,d,e.history.location.pathname);z.active&&z.matches&&(_=!0,j=z.matches)}let O,T={historyAction:e.history.action,location:e.history.location,matches:j,initialized:A,navigation:Sx,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||D,fetchers:new Map,blockers:new Map},M="POP",V=!1,Z,K=!1,Y=new Map,G=null,U=!1,H=!1,k=new Set,$=new Map,q=0,ie=-1,be=new Map,L=new Set,P=new Map,W=new Map,te=new Set,ue=new Map,ve,le=null;function Ae(){if(v=e.history.listen(({action:z,location:J,delta:se})=>{if(ve){ve(),ve=void 0;return}kn(ue.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=to({currentLocation:T.location,nextLocation:J,historyAction:z});if(ge&&se!=null){let Re=new Promise(ze=>{ve=ze});e.history.go(se*-1),ei(ge,{state:"blocked",location:J,proceed(){ei(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:J}),Re.then(()=>e.history.go(se))},reset(){let ze=new Map(T.blockers);ze.set(ge,Ld),Be({blockers:ze})}});return}return Zt(z,J)}),n){uI(t,Y);let z=()=>dI(t,Y);t.addEventListener("pagehide",z),G=()=>t.removeEventListener("pagehide",z)}return T.initialized||Zt("POP",T.location,{initialHydration:!0}),O}function we(){v&&v(),G&&G(),b.clear(),Z&&Z.abort(),T.fetchers.forEach((z,J)=>bn(J)),T.blockers.forEach((z,J)=>Ns(J))}function Ne(z){return b.add(z),()=>b.delete(z)}function Be(z,J={}){z.matches&&(z.matches=z.matches.map(Re=>{let ze=c[Re.route.id],Le=Re.route;return Le.element!==ze.element||Le.errorElement!==ze.errorElement||Le.hydrateFallbackElement!==ze.hydrateFallbackElement?{...Re,route:ze}:Re})),T={...T,...z};let se=[],ge=[];T.fetchers.forEach((Re,ze)=>{Re.state==="idle"&&(te.has(ze)?se.push(ze):ge.push(ze))}),te.forEach(Re=>{!T.fetchers.has(Re)&&!$.has(Re)&&se.push(Re)}),[...b].forEach(Re=>Re(T,{deletedFetchers:se,viewTransitionOpts:J.viewTransitionOpts,flushSync:J.flushSync===!0})),se.forEach(Re=>bn(Re)),ge.forEach(Re=>T.fetchers.delete(Re))}function Qe(z,J,{flushSync:se}={}){var qe,Ze;let ge=T.actionData!=null&&T.navigation.formMethod!=null&&zr(T.navigation.formMethod)&&T.navigation.state==="loading"&&((qe=z.state)==null?void 0:qe._isRedirect)!==!0,Re;J.actionData?Object.keys(J.actionData).length>0?Re=J.actionData:Re=null:ge?Re=T.actionData:Re=null;let ze=J.loaderData?iR(T.loaderData,J.loaderData,J.matches||[],J.errors):T.loaderData,Le=T.blockers;Le.size>0&&(Le=new Map(Le),Le.forEach((ut,en)=>Le.set(en,Ld)));let Ie=U?!1:xr(z,J.matches||T.matches),Pe=V===!0||T.navigation.formMethod!=null&&zr(T.navigation.formMethod)&&((Ze=z.state)==null?void 0:Ze._isRedirect)!==!0;f&&(d=f,f=void 0),U||M==="POP"||(M==="PUSH"?e.history.push(z,z.state):M==="REPLACE"&&e.history.replace(z,z.state));let He;if(M==="POP"){let ut=Y.get(T.location.pathname);ut&&ut.has(z.pathname)?He={currentLocation:T.location,nextLocation:z}:Y.has(z.pathname)&&(He={currentLocation:z,nextLocation:T.location})}else if(K){let ut=Y.get(T.location.pathname);ut?ut.add(z.pathname):(ut=new Set([z.pathname]),Y.set(T.location.pathname,ut)),He={currentLocation:T.location,nextLocation:z}}Be({...J,actionData:Re,loaderData:ze,historyAction:M,location:z,initialized:!0,navigation:Sx,revalidation:"idle",restoreScrollPosition:Ie,preventScrollReset:Pe,blockers:Le},{viewTransitionOpts:He,flushSync:se===!0}),M="POP",V=!1,K=!1,U=!1,H=!1,le==null||le.resolve(),le=null}async function qt(z,J){if(typeof z=="number"){e.history.go(z);return}let se=S0(T.location,T.matches,h,z,J==null?void 0:J.fromRouteId,J==null?void 0:J.relative),{path:ge,submission:Re,error:ze}=Xw(!1,se,J),Le=T.location,Ie=uf(T.location,ge,J&&J.state);Ie={...Ie,...e.history.encodeLocation(Ie)};let Pe=J&&J.replace!=null?J.replace:void 0,He="PUSH";Pe===!0?He="REPLACE":Pe===!1||Re!=null&&zr(Re.formMethod)&&Re.formAction===T.location.pathname+T.location.search&&(He="REPLACE");let qe=J&&"preventScrollReset"in J?J.preventScrollReset===!0:void 0,Ze=(J&&J.flushSync)===!0,ut=to({currentLocation:Le,nextLocation:Ie,historyAction:He});if(ut){ei(ut,{state:"blocked",location:Ie,proceed(){ei(ut,{state:"proceeding",proceed:void 0,reset:void 0,location:Ie}),qt(z,J)},reset(){let en=new Map(T.blockers);en.set(ut,Ld),Be({blockers:en})}});return}await Zt(He,Ie,{submission:Re,pendingError:ze,preventScrollReset:qe,replace:J&&J.replace,enableViewTransition:J&&J.viewTransition,flushSync:Ze})}function Dt(){le||(le=fI()),We(),Be({revalidation:"loading"});let z=le.promise;return T.navigation.state==="submitting"?z:T.navigation.state==="idle"?(Zt(T.historyAction,T.location,{startUninterruptedRevalidation:!0}),z):(Zt(M||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:K===!0}),z)}async function Zt(z,J,se){Z&&Z.abort(),Z=null,M=z,U=(se&&se.startUninterruptedRevalidation)===!0,Gn(T.location,T.matches),V=(se&&se.preventScrollReset)===!0,K=(se&&se.enableViewTransition)===!0;let ge=f||d,Re=se&&se.overrideNavigation,ze=se!=null&&se.initialHydration&&T.matches&&T.matches.length>0&&!_?T.matches:Ai(ge,J,h),Le=(se&&se.flushSync)===!0;if(ze&&T.initialized&&!H&&rI(T.location,J)&&!(se&&se.submission&&zr(se.submission.formMethod))){Qe(J,{matches:ze},{flushSync:Le});return}let Ie=er(ze,ge,J.pathname);if(Ie.active&&Ie.matches&&(ze=Ie.matches),!ze){let{error:hr,notFoundMatches:Kt,route:Yt}=As(J.pathname);Qe(J,{matches:Kt,loaderData:{},errors:{[Yt.id]:hr}},{flushSync:Le});return}Z=new AbortController;let Pe=eu(e.history,J,Z.signal,se&&se.submission),He=e.getContext?await e.getContext():new Zw,qe;if(se&&se.pendingError)qe=[Di(ze).route.id,{type:"error",error:se.pendingError}];else if(se&&se.submission&&zr(se.submission.formMethod)){let hr=await jn(Pe,J,se.submission,ze,He,Ie.active,se&&se.initialHydration===!0,{replace:se.replace,flushSync:Le});if(hr.shortCircuited)return;if(hr.pendingActionResult){let[Kt,Yt]=hr.pendingActionResult;if(ja(Yt)&&ff(Yt.error)&&Yt.error.status===404){Z=null,Qe(J,{matches:hr.matches,loaderData:{},errors:{[Kt]:Yt.error}});return}}ze=hr.matches||ze,qe=hr.pendingActionResult,Re=Cx(J,se.submission),Le=!1,Ie.active=!1,Pe=eu(e.history,Pe.url,Pe.signal)}let{shortCircuited:Ze,matches:ut,loaderData:en,errors:qn}=await Nr(Pe,J,ze,He,Ie.active,Re,se&&se.submission,se&&se.fetcherSubmission,se&&se.replace,se&&se.initialHydration===!0,Le,qe);Ze||(Z=null,Qe(J,{matches:ut||ze,...lR(qe),loaderData:en,errors:qn}))}async function jn(z,J,se,ge,Re,ze,Le,Ie={}){We();let Pe=lI(J,se);if(Be({navigation:Pe},{flushSync:Ie.flushSync===!0}),ze){let Ze=await Vn(ge,J.pathname,z.signal);if(Ze.type==="aborted")return{shortCircuited:!0};if(Ze.type==="error"){if(Ze.partialMatches.length===0){let{matches:en,route:qn}=vm(d);return{matches:en,pendingActionResult:[qn.id,{type:"error",error:Ze.error}]}}let ut=Di(Ze.partialMatches).route.id;return{matches:Ze.partialMatches,pendingActionResult:[ut,{type:"error",error:Ze.error}]}}else if(Ze.matches)ge=Ze.matches;else{let{notFoundMatches:ut,error:en,route:qn}=As(J.pathname);return{matches:ut,pendingActionResult:[qn.id,{type:"error",error:en}]}}}let He,qe=Zm(ge,J);if(!qe.route.action&&!qe.route.lazy)He={type:"error",error:Qa(405,{method:z.method,pathname:J.pathname,routeId:qe.route.id})};else{let Ze=uu(l,c,z,ge,qe,Le?[]:r,Re),ut=await Se(z,Ze,Re,null);if(He=ut[qe.route.id],!He){for(let en of ge)if(ut[en.route.id]){He=ut[en.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(Ol(He)){let Ze;return Ie&&Ie.replace!=null?Ze=Ie.replace:Ze=aR(He.response.headers.get("Location"),new URL(z.url),h)===T.location.pathname+T.location.search,await _e(z,He,!0,{submission:se,replace:Ze}),{shortCircuited:!0}}if(ja(He)){let Ze=Di(ge,qe.route.id);return(Ie&&Ie.replace)!==!0&&(M="PUSH"),{matches:ge,pendingActionResult:[Ze.route.id,He,qe.route.id]}}return{matches:ge,pendingActionResult:[qe.route.id,He]}}async function Nr(z,J,se,ge,Re,ze,Le,Ie,Pe,He,qe,Ze){let ut=ze||Cx(J,Le),en=Le||Ie||uR(ut),qn=!U&&!He;if(Re){if(qn){let tr=va(Ze);Be({navigation:ut,...tr!==void 0?{actionData:tr}:{}},{flushSync:qe})}let Ot=await Vn(se,J.pathname,z.signal);if(Ot.type==="aborted")return{shortCircuited:!0};if(Ot.type==="error"){if(Ot.partialMatches.length===0){let{matches:no,route:ro}=vm(d);return{matches:no,loaderData:{},errors:{[ro.id]:Ot.error}}}let tr=Di(Ot.partialMatches).route.id;return{matches:Ot.partialMatches,loaderData:{},errors:{[tr]:Ot.error}}}else if(Ot.matches)se=Ot.matches;else{let{error:tr,notFoundMatches:no,route:ro}=As(J.pathname);return{matches:no,loaderData:{},errors:{[ro.id]:tr}}}}let hr=f||d,{dsMatches:Kt,revalidatingFetchers:Yt}=Jw(z,ge,l,c,e.history,T,se,en,J,He?[]:r,He===!0,H,k,te,P,L,hr,h,e.patchRoutesOnNavigation!=null,Ze);if(ie=++q,!e.dataStrategy&&!Kt.some(Ot=>Ot.shouldLoad)&&!Kt.some(Ot=>Ot.route.middleware&&Ot.route.middleware.length>0)&&Yt.length===0){let Ot=vr();return Qe(J,{matches:se,loaderData:{},errors:Ze&&ja(Ze[1])?{[Ze[0]]:Ze[1].error}:null,...lR(Ze),...Ot?{fetchers:new Map(T.fetchers)}:{}},{flushSync:qe}),{shortCircuited:!0}}if(qn){let Ot={};if(!Re){Ot.navigation=ut;let tr=va(Ze);tr!==void 0&&(Ot.actionData=tr)}Yt.length>0&&(Ot.fetchers=Ve(Yt)),Be(Ot,{flushSync:qe})}Yt.forEach(Ot=>{Fn(Ot.key),Ot.controller&&$.set(Ot.key,Ot.controller)});let Jr=()=>Yt.forEach(Ot=>Fn(Ot.key));Z&&Z.signal.addEventListener("abort",Jr);let{loaderResults:Fa,fetcherResults:ea}=await Ee(Kt,Yt,z,ge);if(z.signal.aborted)return{shortCircuited:!0};Z&&Z.signal.removeEventListener("abort",Jr),Yt.forEach(Ot=>$.delete(Ot.key));let br=xm(Fa);if(br)return await _e(z,br.result,!0,{replace:Pe}),{shortCircuited:!0};if(br=xm(ea),br)return L.add(br.key),await _e(z,br.result,!0,{replace:Pe}),{shortCircuited:!0};let{loaderData:Nn,errors:ti}=oR(T,se,Fa,Ze,Yt,ea);He&&T.errors&&(ti={...T.errors,...ti});let Ds=vr(),Va=_n(ie),ss=Ds||Va||Yt.length>0;return{matches:se,loaderData:Nn,errors:ti,...ss?{fetchers:new Map(T.fetchers)}:{}}}function va(z){if(z&&!ja(z[1]))return{[z[0]]:z[1].data};if(T.actionData)return Object.keys(T.actionData).length===0?null:T.actionData}function Ve(z){return z.forEach(J=>{let se=T.fetchers.get(J.key),ge=Pd(void 0,se?se.data:void 0);T.fetchers.set(J.key,ge)}),new Map(T.fetchers)}async function F(z,J,se,ge){Fn(z);let Re=(ge&&ge.flushSync)===!0,ze=f||d,Le=S0(T.location,T.matches,h,se,J,ge==null?void 0:ge.relative),Ie=Ai(ze,Le,h),Pe=er(Ie,ze,Le);if(Pe.active&&Pe.matches&&(Ie=Pe.matches),!Ie){it(z,J,Qa(404,{pathname:Le}),{flushSync:Re});return}let{path:He,submission:qe,error:Ze}=Xw(!0,Le,ge);if(Ze){it(z,J,Ze,{flushSync:Re});return}let ut=e.getContext?await e.getContext():new Zw,en=(ge&&ge.preventScrollReset)===!0;if(qe&&zr(qe.formMethod)){await X(z,J,He,Ie,ut,Pe.active,Re,en,qe);return}P.set(z,{routeId:J,path:He}),await de(z,J,He,Ie,ut,Pe.active,Re,en,qe)}async function X(z,J,se,ge,Re,ze,Le,Ie,Pe){We(),P.delete(z);let He=T.fetchers.get(z);ot(z,cI(Pe,He),{flushSync:Le});let qe=new AbortController,Ze=eu(e.history,se,qe.signal,Pe);if(ze){let gn=await Vn(ge,new URL(Ze.url).pathname,Ze.signal,z);if(gn.type==="aborted")return;if(gn.type==="error"){it(z,J,gn.error,{flushSync:Le});return}else if(gn.matches)ge=gn.matches;else{it(z,J,Qa(404,{pathname:se}),{flushSync:Le});return}}let ut=Zm(ge,se);if(!ut.route.action&&!ut.route.lazy){let gn=Qa(405,{method:Pe.formMethod,pathname:se,routeId:J});it(z,J,gn,{flushSync:Le});return}$.set(z,qe);let en=q,qn=uu(l,c,Ze,ge,ut,r,Re),Kt=(await Se(Ze,qn,Re,z))[ut.route.id];if(Ze.signal.aborted){$.get(z)===qe&&$.delete(z);return}if(te.has(z)){if(Ol(Kt)||ja(Kt)){ot(z,To(void 0));return}}else{if(Ol(Kt))if($.delete(z),ie>en){ot(z,To(void 0));return}else return L.add(z),ot(z,Pd(Pe)),_e(Ze,Kt,!1,{fetcherSubmission:Pe,preventScrollReset:Ie});if(ja(Kt)){it(z,J,Kt.error);return}}let Yt=T.navigation.location||T.location,Jr=eu(e.history,Yt,qe.signal),Fa=f||d,ea=T.navigation.state!=="idle"?Ai(Fa,T.navigation.location,h):T.matches;xt(ea,"Didn't find any matches after fetcher action");let br=++q;be.set(z,br);let Nn=Pd(Pe,Kt.data);T.fetchers.set(z,Nn);let{dsMatches:ti,revalidatingFetchers:Ds}=Jw(Jr,Re,l,c,e.history,T,ea,Pe,Yt,r,!1,H,k,te,P,L,Fa,h,e.patchRoutesOnNavigation!=null,[ut.route.id,Kt]);Ds.filter(gn=>gn.key!==z).forEach(gn=>{let ao=gn.key,za=T.fetchers.get(ao),ta=Pd(void 0,za?za.data:void 0);T.fetchers.set(ao,ta),Fn(ao),gn.controller&&$.set(ao,gn.controller)}),Be({fetchers:new Map(T.fetchers)});let Va=()=>Ds.forEach(gn=>Fn(gn.key));qe.signal.addEventListener("abort",Va);let{loaderResults:ss,fetcherResults:Ot}=await Ee(ti,Ds,Jr,Re);if(qe.signal.aborted)return;if(qe.signal.removeEventListener("abort",Va),be.delete(z),$.delete(z),Ds.forEach(gn=>$.delete(gn.key)),T.fetchers.has(z)){let gn=To(Kt.data);T.fetchers.set(z,gn)}let tr=xm(ss);if(tr)return _e(Jr,tr.result,!1,{preventScrollReset:Ie});if(tr=xm(Ot),tr)return L.add(tr.key),_e(Jr,tr.result,!1,{preventScrollReset:Ie});let{loaderData:no,errors:ro}=oR(T,ea,ss,void 0,Ds,Ot);_n(br),T.navigation.state==="loading"&&br>ie?(xt(M,"Expected pending action"),Z&&Z.abort(),Qe(T.navigation.location,{matches:ea,loaderData:no,errors:ro,fetchers:new Map(T.fetchers)})):(Be({errors:ro,loaderData:iR(T.loaderData,no,ea,ro),fetchers:new Map(T.fetchers)}),H=!1)}async function de(z,J,se,ge,Re,ze,Le,Ie,Pe){let He=T.fetchers.get(z);ot(z,Pd(Pe,He?He.data:void 0),{flushSync:Le});let qe=new AbortController,Ze=eu(e.history,se,qe.signal);if(ze){let Yt=await Vn(ge,new URL(Ze.url).pathname,Ze.signal,z);if(Yt.type==="aborted")return;if(Yt.type==="error"){it(z,J,Yt.error,{flushSync:Le});return}else if(Yt.matches)ge=Yt.matches;else{it(z,J,Qa(404,{pathname:se}),{flushSync:Le});return}}let ut=Zm(ge,se);$.set(z,qe);let en=q,qn=uu(l,c,Ze,ge,ut,r,Re),Kt=(await Se(Ze,qn,Re,z))[ut.route.id];if($.get(z)===qe&&$.delete(z),!Ze.signal.aborted){if(te.has(z)){ot(z,To(void 0));return}if(Ol(Kt))if(ie>en){ot(z,To(void 0));return}else{L.add(z),await _e(Ze,Kt,!1,{preventScrollReset:Ie});return}if(ja(Kt)){it(z,J,Kt.error);return}ot(z,To(Kt.data))}}async function _e(z,J,se,{submission:ge,fetcherSubmission:Re,preventScrollReset:ze,replace:Le}={}){J.response.headers.has("X-Remix-Revalidate")&&(H=!0);let Ie=J.response.headers.get("Location");xt(Ie,"Expected a Location header on the redirect Response"),Ie=aR(Ie,new URL(z.url),h);let Pe=uf(T.location,Ie,{_isRedirect:!0});if(n){let qn=!1;if(J.response.headers.has("X-Remix-Reload-Document"))qn=!0;else if(O1(Ie)){const hr=WT(Ie,!0);qn=hr.origin!==t.location.origin||ts(hr.pathname,h)==null}if(qn){Le?t.location.replace(Ie):t.location.assign(Ie);return}}Z=null;let He=Le===!0||J.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:qe,formAction:Ze,formEncType:ut}=T.navigation;!ge&&!Re&&qe&&Ze&&ut&&(ge=uR(T.navigation));let en=ge||Re;if(V9.has(J.response.status)&&en&&zr(en.formMethod))await Zt(He,Pe,{submission:{...en,formAction:Ie},preventScrollReset:ze||V,enableViewTransition:se?K:void 0});else{let qn=Cx(Pe,ge);await Zt(He,Pe,{overrideNavigation:qn,fetcherSubmission:Re,preventScrollReset:ze||V,enableViewTransition:se?K:void 0})}}async function Se(z,J,se,ge){let Re,ze={};try{Re=await Q9(g,z,J,ge,se,!1)}catch(Le){return J.filter(Ie=>Ie.shouldLoad).forEach(Ie=>{ze[Ie.route.id]={type:"error",error:Le}}),ze}if(z.signal.aborted)return ze;for(let[Le,Ie]of Object.entries(Re))if(oI(Ie)){let Pe=Ie.result;ze[Le]={type:"redirect",response:tI(Pe,z,Le,J,h)}}else ze[Le]=await eI(Ie);return ze}async function Ee(z,J,se,ge){let Re=Se(se,z,ge,null),ze=Promise.all(J.map(async Pe=>{if(Pe.matches&&Pe.match&&Pe.request&&Pe.controller){let qe=(await Se(Pe.request,Pe.matches,ge,Pe.key))[Pe.match.route.id];return{[Pe.key]:qe}}else return Promise.resolve({[Pe.key]:{type:"error",error:Qa(404,{pathname:Pe.path})}})})),Le=await Re,Ie=(await ze).reduce((Pe,He)=>Object.assign(Pe,He),{});return{loaderResults:Le,fetcherResults:Ie}}function We(){H=!0,P.forEach((z,J)=>{$.has(J)&&k.add(J),Fn(J)})}function ot(z,J,se={}){T.fetchers.set(z,J),Be({fetchers:new Map(T.fetchers)},{flushSync:(se&&se.flushSync)===!0})}function it(z,J,se,ge={}){let Re=Di(T.matches,J);bn(z),Be({errors:{[Re.route.id]:se},fetchers:new Map(T.fetchers)},{flushSync:(ge&&ge.flushSync)===!0})}function xn(z){return W.set(z,(W.get(z)||0)+1),te.has(z)&&te.delete(z),T.fetchers.get(z)||z9}function Ua(z,J){Fn(z,J==null?void 0:J.reason),ot(z,To(null))}function bn(z){let J=T.fetchers.get(z);$.has(z)&&!(J&&J.state==="loading"&&be.has(z))&&Fn(z),P.delete(z),be.delete(z),L.delete(z),te.delete(z),k.delete(z),T.fetchers.delete(z)}function Jo(z){let J=(W.get(z)||0)-1;J<=0?(W.delete(z),te.add(z)):W.set(z,J),Be({fetchers:new Map(T.fetchers)})}function Fn(z,J){let se=$.get(z);se&&(se.abort(J),$.delete(z))}function Tn(z){for(let J of z){let se=xn(J),ge=To(se.data);T.fetchers.set(J,ge)}}function vr(){let z=[],J=!1;for(let se of L){let ge=T.fetchers.get(se);xt(ge,`Expected fetcher: ${se}`),ge.state==="loading"&&(L.delete(se),z.push(se),J=!0)}return Tn(z),J}function _n(z){let J=[];for(let[se,ge]of be)if(ge<z){let Re=T.fetchers.get(se);xt(Re,`Expected fetcher: ${se}`),Re.state==="loading"&&(Fn(se),be.delete(se),J.push(se))}return Tn(J),J.length>0}function ul(z,J){let se=T.blockers.get(z)||Ld;return ue.get(z)!==J&&ue.set(z,J),se}function Ns(z){T.blockers.delete(z),ue.delete(z)}function ei(z,J){let se=T.blockers.get(z)||Ld;xt(se.state==="unblocked"&&J.state==="blocked"||se.state==="blocked"&&J.state==="blocked"||se.state==="blocked"&&J.state==="proceeding"||se.state==="blocked"&&J.state==="unblocked"||se.state==="proceeding"&&J.state==="unblocked",`Invalid blocker state transition: ${se.state} -> ${J.state}`);let ge=new Map(T.blockers);ge.set(z,J),Be({blockers:ge})}function to({currentLocation:z,nextLocation:J,historyAction:se}){if(ue.size===0)return;ue.size>1&&kn(!1,"A router only supports one blocker at a time");let ge=Array.from(ue.entries()),[Re,ze]=ge[ge.length-1],Le=T.blockers.get(Re);if(!(Le&&Le.state==="proceeding")&&ze({currentLocation:z,nextLocation:J,historyAction:se}))return Re}function As(z){let J=Qa(404,{pathname:z}),se=f||d,{matches:ge,route:Re}=vm(se);return{notFoundMatches:ge,route:Re,error:J}}function Sn(z,J,se){if(E=z,C=J,S=se||null,!R&&T.navigation===Sx){R=!0;let ge=xr(T.location,T.matches);ge!=null&&Be({restoreScrollPosition:ge})}return()=>{E=null,C=null,S=null}}function pn(z,J){return S&&S(z,J.map(ge=>d9(ge,T.loaderData)))||z.key}function Gn(z,J){if(E&&C){let se=pn(z,J);E[se]=C()}}function xr(z,J){if(E){let se=pn(z,J),ge=E[se];if(typeof ge=="number")return ge}return null}function er(z,J,se){if(e.patchRoutesOnNavigation)if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:qm(J,se,h,!0)}}else return{active:!0,matches:qm(J,se,h,!0)||[]};return{active:!1,matches:null}}async function Vn(z,J,se,ge){if(!e.patchRoutesOnNavigation)return{type:"success",matches:z};let Re=z;for(;;){let ze=f==null,Le=f||d,Ie=c;try{await e.patchRoutesOnNavigation({signal:se,path:J,matches:Re,fetcherKey:ge,patch:(qe,Ze)=>{se.aborted||eR(qe,Ze,Le,Ie,l,!1)}})}catch(qe){return{type:"error",error:qe,partialMatches:Re}}finally{ze&&!se.aborted&&(d=[...d])}if(se.aborted)return{type:"aborted"};let Pe=Ai(Le,J,h);if(Pe)return{type:"success",matches:Pe};let He=qm(Le,J,h,!0);if(!He||Re.length===He.length&&Re.every((qe,Ze)=>qe.route.id===He[Ze].route.id))return{type:"success",matches:null};Re=He}}function Ar(z){c={},f=df(z,l,void 0,c)}function Xr(z,J,se=!1){let ge=f==null;eR(z,J,f||d,c,l,se),ge&&(d=[...d],Be({}))}return O={get basename(){return h},get future(){return y},get state(){return T},get routes(){return d},get window(){return t},initialize:Ae,subscribe:Ne,enableScrollRestoration:Sn,navigate:qt,fetch:F,revalidate:Dt,createHref:z=>e.history.createHref(z),encodeLocation:z=>e.history.encodeLocation(z),getFetcher:xn,resetFetcher:Ua,deleteFetcher:Jo,dispose:we,getBlocker:ul,deleteBlocker:Ns,patchRoutes:Xr,_internalFetchControllers:$,_internalSetRoutes:Ar,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){Be(z)}},e.unstable_instrumentations&&(O=D9(O,e.unstable_instrumentations.map(z=>z.router).filter(Boolean))),O}function G9(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function S0(e,t,n,r,o,l){let c,d;if(o){c=[];for(let h of t)if(c.push(h),h.route.id===o){d=h;break}}else c=t,d=t[t.length-1];let f=Qp(r||".",Wp(c),ts(e.pathname,n)||e.pathname,l==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let h=I1(f.search);if(d.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&h){let g=new URLSearchParams(f.search),y=g.getAll("index");g.delete("index"),y.filter(b=>b).forEach(b=>g.append("index",b));let v=g.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=w9({basename:n,pathname:f.pathname})),Zs(f)}function Xw(e,t,n){if(!n||!G9(n))return{path:t};if(n.formMethod&&!iI(n.formMethod))return{path:t,error:Qa(405,{method:n.formMethod})};let r=()=>({path:t,error:Qa(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=c_(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!zr(l))return r();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[b,E])=>`${v}${b}=${E}
59
- `,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!zr(l))return r();try{let y=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:y,text:void 0}}}catch{return r()}}}xt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=w0(n.formData),f=n.formData;else if(n.body instanceof FormData)d=w0(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=sR(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=sR(d)}catch{return r()}let h={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(zr(h.formMethod))return{path:t,submission:h};let g=Qi(t);return e&&g.search&&I1(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Zs(g),submission:h}}function Jw(e,t,n,r,o,l,c,d,f,h,g,y,v,b,E,S,C,R,j,_){var U;let D=_?ja(_[1])?_[1].error:_[1].data:void 0,A=o.createURL(l.location),O=o.createURL(f),T;if(g&&l.errors){let H=Object.keys(l.errors)[0];T=c.findIndex(k=>k.route.id===H)}else if(_&&ja(_[1])){let H=_[0];T=c.findIndex(k=>k.route.id===H)-1}let M=_?_[1].statusCode:void 0,V=M&&M>=400,Z={currentUrl:A,currentParams:((U=l.matches[0])==null?void 0:U.params)||{},nextUrl:O,nextParams:c[0].params,...d,actionResult:D,actionStatus:M},K=D1(c.map(H=>H.route.path)),Y=c.map((H,k)=>{let{route:$}=H,q=null;if(T!=null&&k>T?q=!1:$.lazy?q=!0:M1($)?g?q=C0($,l.loaderData,l.errors):q9(l.loaderData,l.matches[k],H)&&(q=!0):q=!1,q!==null)return E0(n,r,e,K,H,h,t,q);let ie=V?!1:y||A.pathname+A.search===O.pathname+O.search||A.search!==O.search||Z9(l.matches[k],H),be={...Z,defaultShouldRevalidate:ie},L=lp(H,be);return E0(n,r,e,K,H,h,t,L,be)}),G=[];return E.forEach((H,k)=>{if(g||!c.some(te=>te.route.id===H.routeId)||b.has(k))return;let $=l.fetchers.get(k),q=$&&$.state!=="idle"&&$.data===void 0,ie=Ai(C,H.path,R);if(!ie){if(j&&q)return;G.push({key:k,routeId:H.routeId,path:H.path,matches:null,match:null,request:null,controller:null});return}if(S.has(k))return;let be=Zm(ie,H.path),L=new AbortController,P=eu(o,H.path,L.signal),W=null;if(v.has(k))v.delete(k),W=uu(n,r,P,ie,be,h,t);else if(q)y&&(W=uu(n,r,P,ie,be,h,t));else{let te={...Z,defaultShouldRevalidate:V?!1:y};lp(be,te)&&(W=uu(n,r,P,ie,be,h,t,te))}W&&G.push({key:k,routeId:H.routeId,path:H.path,matches:W,match:be,request:P,controller:L})}),{dsMatches:Y,revalidatingFetchers:G}}function M1(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function C0(e,t,n){if(e.lazy)return!0;if(!M1(e))return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function q9(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function Z9(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function lp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function eR(e,t,n,r,o,l){let c;if(e){let h=r[e];xt(h,`No route found to patch children into: routeId = ${e}`),h.children||(h.children=[]),c=h.children}else c=n;let d=[],f=[];if(t.forEach(h=>{let g=c.find(y=>a_(h,y));g?f.push({existingRoute:g,newRoute:h}):d.push(h)}),d.length>0){let h=df(d,o,[e||"_","patch",String((c==null?void 0:c.length)||"0")],r);c.push(...h)}if(l&&f.length>0)for(let h=0;h<f.length;h++){let{existingRoute:g,newRoute:y}=f[h],v=g,[b]=df([y],o,[],{},!0);Object.assign(v,{element:b.element?b.element:v.element,errorElement:b.errorElement?b.errorElement:v.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:v.hydrateFallbackElement})}}function a_(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 o;return(o=t.children)==null?void 0:o.some(l=>a_(n,l))}):!1}var tR=new WeakMap,s_=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(xt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let c=tR.get(o);c||(c={},tR.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let h=i9(e),y=o[e]!==void 0&&e!=="hasErrorBoundary";if(h)kn(!h,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(y)kn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(o,{[e]:v}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(v=>v===void 0)&&(o.lazy=void 0))})();return c[e]=f,f},nR=new WeakMap;function K9(e,t,n,r,o){let l=n[e.id];if(xt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=nR.get(l);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let y=(async()=>{xt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let E in v){let S=v[E];if(S===void 0)continue;let C=c9(E),j=l[E]!==void 0&&E!=="hasErrorBoundary";C?kn(!C,"Route property "+E+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?kn(!j,`Route "${l.id}" has a static property "${E}" defined but its lazy function is also returning a value for this property. The lazy route property "${E}" will be ignored.`):b[E]=S}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return nR.set(l,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(e.lazy),d=[],f;for(let g of c){if(o&&o.includes(g))continue;let y=s_({key:g,route:e,manifest:n,mapRouteProperties:r});y&&(d.push(y),g===t&&(f=y))}let h=d.length>0?Promise.all(d).then(()=>{}):void 0;return h==null||h.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function rR(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{n[t[l].route.id]=o}),n}async function Y9(e){return e.matches.some(t=>t.route.middleware)?o_(e,()=>rR(e)):rR(e)}function o_(e,t){return W9(e,t,r=>r,aI,n);function n(r,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(h=>h.route.id===o),0),Math.max(c.findIndex(h=>h.unstable_shouldCallHandler()),0)),f=Di(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function W9(e,t,n,r,o){let{matches:l,request:c,params:d,context:f,unstable_pattern:h}=e,g=l.flatMap(v=>v.route.middleware?v.route.middleware.map(b=>[v.route.id,b]):[]);return await i_({request:c,params:d,context:f,unstable_pattern:h},g,t,n,r,o)}async function i_(e,t,n,r,o,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[h,g]=f,y,v=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await i_(e,t,n,r,o,l,c+1)},y.value}catch(b){return y={value:await l(b,h,y)},y.value}};try{let b=await g(e,v),E=b!=null?r(b):void 0;return o(E)?E:y?E??y.value:(y={value:await v()},y.value)}catch(b){return await l(b,h,y)}}function l_(e,t,n,r,o){let l=s_({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=K9(r.route,zr(n.method)?"action":"loader",t,e,o);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function E0(e,t,n,r,o,l,c,d,f=null){let h=!1,g=l_(e,t,n,o,l);return{...o,_lazyPromises:g,shouldLoad:d,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(y){return h=!0,f?typeof y=="boolean"?lp(o,{...f,defaultShouldRevalidate:y}):lp(o,f):d},resolve(y){let{lazy:v,loader:b,middleware:E}=o.route,S=h||d||y&&!zr(n.method)&&(v||b),C=E&&E.length>0&&!b&&!v;return S&&(zr(n.method)||!C)?X9({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:g==null?void 0:g.handler,lazyRoutePromise:g==null?void 0:g.route,handlerOverride:y,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function uu(e,t,n,r,o,l,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:l_(e,t,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:E0(e,t,n,D1(r.map(h=>h.route.path)),f,l,c,!0,d))}async function Q9(e,t,n,r,o,l){n.some(h=>{var g;return(g=h._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(h=>{var g;return(g=h._lazyPromises)==null?void 0:g.middleware}));let c={request:t,unstable_pattern:D1(n.map(h=>h.route.path)),params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:h=>{let g=c;return o_(g,()=>h({...g,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(h=>{var g,y;return[(g=h._lazyPromises)==null?void 0:g.handler,(y=h._lazyPromises)==null?void 0:y.route]}))}catch{}return f}async function X9({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:l,scopedContext:c}){let d,f,h=zr(e.method),g=h?"action":"loader",y=v=>{let b,E=new Promise((R,j)=>b=j);f=()=>b(),e.signal.addEventListener("abort",f);let S=R=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${n.route.id}]`)):v({request:e,unstable_pattern:t,params:n.params,context:c},...R!==void 0?[R]:[]),C=(async()=>{try{return{type:"data",result:await(l?l(j=>S(j)):S())}}catch(R){return{type:"error",result:R}}})();return Promise.race([C,E])};try{let v=h?n.route.action:n.route.loader;if(r||o)if(v){let b,[E]=await Promise.all([y(v).catch(S=>{b=S}),r,o]);if(b!==void 0)throw b;d=E}else{await r;let b=h?n.route.action:n.route.loader;if(b)[d]=await Promise.all([y(b),o]);else if(g==="action"){let E=new URL(e.url),S=E.pathname+E.search;throw Qa(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(v)d=await y(v);else{let b=new URL(e.url),E=b.pathname+b.search;throw Qa(404,{pathname:E})}}catch(v){return{type:"error",result:v}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function J9(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 eI(e){var r,o,l,c,d,f;let{result:t,type:n}=e;if(u_(t)){let h;try{h=await J9(t)}catch(g){return{type:"error",error:g}}return n==="error"?{type:"error",error:new ip(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?cR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new ip(((l=t.init)==null?void 0:l.status)||500,void 0,t.data),statusCode:ff(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ff(t)?t.status:void 0}:cR(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 tI(e,t,n,r,o){let l=e.headers.get("Location");if(xt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!O1(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=S0(new URL(t.url),c,o,l),e.headers.set("Location",l)}return e}function aR(e,t,n){if(O1(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=ts(o.pathname,n)!=null;if(o.origin===t.origin&&l)return o.pathname+o.search+o.hash}return e}function eu(e,t,n,r){let o=e.createURL(c_(t)).toString(),l={signal:n};if(r&&zr(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=w0(r.formData):l.body=r.formData}return new Request(o,l)}function w0(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function sR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function nI(e,t,n,r=!1,o=!1){let l={},c=null,d,f=!1,h={},g=n&&ja(n[1])?n[1].error:void 0;return e.forEach(y=>{if(!(y.route.id in t))return;let v=y.route.id,b=t[v];if(xt(!Ol(b),"Cannot handle redirect results in processLoaderData"),ja(b)){let E=b.error;if(g!==void 0&&(E=g,g=void 0),c=c||{},o)c[v]=E;else{let S=Di(e,v);c[S.route.id]==null&&(c[S.route.id]=E)}r||(l[v]=r_),f||(f=!0,d=ff(b.error)?b.error.status:500),b.headers&&(h[v]=b.headers)}else l[v]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=b.statusCode),b.headers&&(h[v]=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:h}}function oR(e,t,n,r,o,l){let{loaderData:c,errors:d}=nI(t,n,r);return o.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:g,controller:y}=f;if(y&&y.signal.aborted)return;let v=l[h];if(xt(v,"Did not find corresponding fetcher result"),ja(v)){let b=Di(e.matches,g==null?void 0:g.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:v.error}),e.fetchers.delete(h)}else if(Ol(v))xt(!1,"Unhandled fetcher revalidation redirect");else{let b=To(v.data);e.fetchers.set(h,b)}}),{loaderData:c,errors:d}}function iR(e,t,n,r){let o=Object.entries(t).filter(([,l])=>l!==r_).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&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function lR(e){return e?ja(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Di(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 vm(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 Qa(e,{pathname:t,routeId:n,method:r,type:o,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.`:o==="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 ip(e||500,c,new Error(d),!0)}function xm(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(Ol(o))return{key:r,result:o}}}function c_(e){let t=typeof e=="string"?Qi(e):e;return Zs({...t,hash:""})}function rI(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function aI(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&sI(n))}function sI(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function oI(e){return u_(e.result)&&F9.has(e.result.status)}function ja(e){return e.type==="error"}function Ol(e){return(e&&e.type)==="redirect"}function cR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function u_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function iI(e){return U9.has(e.toUpperCase())}function zr(e){return L9.has(e.toUpperCase())}function I1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Zm(e,t){let n=typeof t=="string"?Qi(t).search:t.search;if(e[e.length-1].route.index&&I1(n||""))return e[e.length-1];let r=JT(e);return r[r.length-1]}function uR(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:l,json:c}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};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 Cx(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 lI(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 Pd(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 cI(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 To(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 uI(e,t){try{let n=e.sessionStorage.getItem(n_);if(n){let r=JSON.parse(n);for(let[o,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function dI(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(n_,JSON.stringify(n))}catch(r){kn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function fI(){let e,t,n=new Promise((r,o)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{o(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Xl=m.createContext(null);Xl.displayName="DataRouter";var Tf=m.createContext(null);Tf.displayName="DataRouterState";m.createContext(!1);var k1=m.createContext({isTransitioning:!1});k1.displayName="ViewTransition";var d_=m.createContext(new Map);d_.displayName="Fetchers";var hI=m.createContext(null);hI.displayName="Await";var ws=m.createContext(null);ws.displayName="Navigation";var Xp=m.createContext(null);Xp.displayName="Location";var rs=m.createContext({outlet:null,matches:[],isDataRoute:!1});rs.displayName="Route";var L1=m.createContext(null);L1.displayName="RouteError";function mI(e,{relative:t}={}){xt(Nu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=m.useContext(ws),{hash:o,pathname:l,search:c}=_f(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:$s([n,l])),r.createHref({pathname:d,search:c,hash:o})}function Nu(){return m.useContext(Xp)!=null}function Qs(){return xt(Nu(),"useLocation() may be used only in the context of a <Router> component."),m.useContext(Xp).location}var f_="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function h_(e){m.useContext(ws).static||m.useLayoutEffect(e)}function Jp(){let{isDataRoute:e}=m.useContext(rs);return e?_I():pI()}function pI(){xt(Nu(),"useNavigate() may be used only in the context of a <Router> component.");let e=m.useContext(Xl),{basename:t,navigator:n}=m.useContext(ws),{matches:r}=m.useContext(rs),{pathname:o}=Qs(),l=JSON.stringify(Wp(r)),c=m.useRef(!1);return h_(()=>{c.current=!0}),m.useCallback((f,h={})=>{if(kn(c.current,f_),!c.current)return;if(typeof f=="number"){n.go(f);return}let g=Qp(f,JSON.parse(l),o,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:$s([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,l,o,e])}var m_=m.createContext(null);function Ia(){return m.useContext(m_)}function gI(e){let t=m.useContext(rs).outlet;return m.useMemo(()=>t&&m.createElement(m_.Provider,{value:e},t),[t,e])}function p_(){let{matches:e}=m.useContext(rs),t=e[e.length-1];return t?t.params:{}}function _f(e,{relative:t}={}){let{matches:n}=m.useContext(rs),{pathname:r}=Qs(),o=JSON.stringify(Wp(n));return m.useMemo(()=>Qp(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function yI(e,t,n,r,o){xt(Nu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=m.useContext(ws),{matches:c}=m.useContext(rs),d=c[c.length-1],f=d?d.params:{},h=d?d.pathname:"/",g=d?d.pathnameBase:"/",y=d&&d.route;{let j=y&&y.path||"";g_(h,!y||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${j}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
60
-
61
- Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let v=Qs(),b;b=v;let E=b.pathname||"/",S=E;if(g!=="/"){let j=g.replace(/^\//,"").split("/");S="/"+E.replace(/^\//,"").split("/").slice(j.length).join("/")}let C=Ai(e,{pathname:S});return kn(y||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),kn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.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.`),CI(C&&C.map(j=>Object.assign({},j,{params:Object.assign({},f,j.params),pathname:$s([g,l.encodeLocation?l.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?g:$s([g,l.encodeLocation?l.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),c,n,r,o)}function vI(){let e=TI(),t=ff(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)",o={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=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:l},"ErrorBoundary")," or"," ",m.createElement("code",{style:l},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:o},n):null,c)}var xI=m.createElement(vI,null),bI=class extends m.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?m.createElement(rs.Provider,{value:this.props.routeContext},m.createElement(L1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function SI({routeContext:e,match:t,children:n}){let r=m.useContext(Xl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(rs.Provider,{value:e},n)}function CI(e,t=[],n=null,r=null,o=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 h=l.findIndex(g=>g.route.id&&(c==null?void 0:c[g.route.id])!==void 0);xt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,h+1))}let d=!1,f=-1;if(n)for(let h=0;h<l.length;h++){let g=l[h];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(f=h),g.route.id){let{loaderData:y,errors:v}=n,b=g.route.loader&&!y.hasOwnProperty(g.route.id)&&(!v||v[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((h,g,y)=>{let v,b=!1,E=null,S=null;n&&(v=c&&g.route.id?c[g.route.id]:void 0,E=g.route.errorElement||xI,d&&(f<0&&y===0?(g_("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,S=null):f===y&&(b=!0,S=g.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,y+1)),R=()=>{let j;return v?j=E:b?j=S:g.route.Component?j=m.createElement(g.route.Component,null):g.route.element?j=g.route.element:j=h,m.createElement(SI,{match:g,routeContext:{outlet:h,matches:C,isDataRoute:n!=null},children:j})};return n&&(g.route.ErrorBoundary||g.route.errorElement||y===0)?m.createElement(bI,{location:n.location,revalidation:n.revalidation,component:E,error:v,children:R(),routeContext:{outlet:null,matches:C,isDataRoute:!0},unstable_onError:r}):R()},null)}function P1(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function EI(e){let t=m.useContext(Xl);return xt(t,P1(e)),t}function wI(e){let t=m.useContext(Tf);return xt(t,P1(e)),t}function RI(e){let t=m.useContext(rs);return xt(t,P1(e)),t}function U1(e){let t=RI(e),n=t.matches[t.matches.length-1];return xt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function jI(){return U1("useRouteId")}function TI(){var r;let e=m.useContext(L1),t=wI("useRouteError"),n=U1("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function _I(){let{router:e}=EI("useNavigate"),t=U1("useNavigate"),n=m.useRef(!1);return h_(()=>{n.current=!0}),m.useCallback(async(o,l={})=>{kn(n.current,f_),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var dR={};function g_(e,t,n){!t&&!dR[e]&&(dR[e]=!0,kn(!1,n))}var fR={};function hR(e,t){!e&&!fR[t]&&(fR[t]=!0,console.warn(t))}function NI(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&kn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:m.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&kn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&kn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var AI=["HydrateFallback","hydrateFallbackElement"],DI=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 OI({router:e,flushSync:t,unstable_onError:n}){let[r,o]=m.useState(e.state),[l,c]=m.useState(),[d,f]=m.useState({isTransitioning:!1}),[h,g]=m.useState(),[y,v]=m.useState(),[b,E]=m.useState(),S=m.useRef(new Map),C=m.useCallback(A=>{o(O=>(A.errors&&n&&Object.entries(A.errors).forEach(([T,M])=>{var V;((V=O.errors)==null?void 0:V[T])!==M&&n(M)}),A))},[n]),R=m.useCallback((A,{deletedFetchers:O,flushSync:T,viewTransitionOpts:M})=>{A.fetchers.forEach((Z,K)=>{Z.data!==void 0&&S.current.set(K,Z.data)}),O.forEach(Z=>S.current.delete(Z)),hR(T===!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 V=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(hR(M==null||V,"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||!V){t&&T?t(()=>C(A)):m.startTransition(()=>C(A));return}if(t&&T){t(()=>{y&&(h&&h.resolve(),y.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let Z=e.window.document.startViewTransition(()=>{t(()=>C(A))});Z.finished.finally(()=>{t(()=>{g(void 0),v(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>v(Z));return}y?(h&&h.resolve(),y.skipTransition(),E({state:A,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(c(A),f({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[e.window,t,y,h,C]);m.useLayoutEffect(()=>e.subscribe(R),[e,R]),m.useEffect(()=>{d.isTransitioning&&!d.flushSync&&g(new DI)},[d]),m.useEffect(()=>{if(h&&l&&e.window){let A=l,O=h.promise,T=e.window.document.startViewTransition(async()=>{m.startTransition(()=>C(A)),await O});T.finished.finally(()=>{g(void 0),v(void 0),c(void 0),f({isTransitioning:!1})}),v(T)}},[l,h,e.window,C]),m.useEffect(()=>{h&&l&&r.location.key===l.location.key&&h.resolve()},[h,y,r.location,l]),m.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),E(void 0))},[d.isTransitioning,b]);let j=m.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:A=>e.navigate(A),push:(A,O,T)=>e.navigate(A,{state:O,preventScrollReset:T==null?void 0:T.preventScrollReset}),replace:(A,O,T)=>e.navigate(A,{replace:!0,state:O,preventScrollReset:T==null?void 0:T.preventScrollReset})}),[e]),_=e.basename||"/",D=m.useMemo(()=>({router:e,navigator:j,static:!1,basename:_,unstable_onError:n}),[e,j,_,n]);return m.createElement(m.Fragment,null,m.createElement(Xl.Provider,{value:D},m.createElement(Tf.Provider,{value:r},m.createElement(d_.Provider,{value:S.current},m.createElement(k1.Provider,{value:d},m.createElement(LI,{basename:_,location:r.location,navigationType:r.historyAction,navigator:j},m.createElement(MI,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var MI=m.memo(II);function II({routes:e,future:t,state:n,unstable_onError:r}){return yI(e,void 0,n,r,t)}function kI({to:e,replace:t,state:n,relative:r}){xt(Nu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=m.useContext(ws);kn(!o,"<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}=m.useContext(rs),{pathname:c}=Qs(),d=Jp(),f=Qp(e,Wp(l),c,r==="path"),h=JSON.stringify(f);return m.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:r})},[d,h,r,t,n]),null}function y_(e){return gI(e.context)}function LI({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:l=!1}){xt(!Nu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=m.useMemo(()=>({basename:c,navigator:o,static:l,future:{}}),[c,o,l]);typeof n=="string"&&(n=Qi(n));let{pathname:f="/",search:h="",hash:g="",state:y=null,key:v="default"}=n,b=m.useMemo(()=>{let E=ts(f,c);return E==null?null:{location:{pathname:E,search:h,hash:g,state:y,key:v},navigationType:r}},[c,f,h,g,y,v,r]);return kn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${h}${g}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:m.createElement(ws.Provider,{value:d},m.createElement(Xp.Provider,{children:t,value:b}))}var Km="get",Ym="application/x-www-form-urlencoded";function eg(e){return e!=null&&typeof e.tagName=="string"}function PI(e){return eg(e)&&e.tagName.toLowerCase()==="button"}function UI(e){return eg(e)&&e.tagName.toLowerCase()==="form"}function FI(e){return eg(e)&&e.tagName.toLowerCase()==="input"}function VI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function zI(e,t){return e.button===0&&(!t||t==="_self")&&!VI(e)}function R0(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(o=>[n,o]):[[n,r]])},[]))}function HI(e,t){let n=R0(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(l=>{n.append(o,l)})}),n}var bm=null;function $I(){if(bm===null)try{new FormData(document.createElement("form"),0),bm=!1}catch{bm=!0}return bm}var BI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Ex(e){return e!=null&&!BI.has(e)?(kn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ym}"`),null):e}function GI(e,t){let n,r,o,l,c;if(UI(e)){let d=e.getAttribute("action");r=d?ts(d,t):null,n=e.getAttribute("method")||Km,o=Ex(e.getAttribute("enctype"))||Ym,l=new FormData(e)}else if(PI(e)||FI(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?ts(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Km,o=Ex(e.getAttribute("formenctype"))||Ex(d.getAttribute("enctype"))||Ym,l=new FormData(d,e),!$I()){let{name:h,type:g,value:y}=e;if(g==="image"){let v=h?`${h}.`:"";l.append(`${v}x`,"0"),l.append(`${v}y`,"0")}else h&&l.append(h,y)}}else{if(eg(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Km,r=null,o=Ym,c=e}return l&&o==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function F1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qI(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&&ts(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function ZI(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 KI(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 o=>{let l=t.routes[o.route.id];if(l){let c=await ZI(l,n);return c.links?c.links():[]}return[]}));return JI(r.flat(1).filter(KI).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function mR(e,t,n,r,o,l){let c=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,d=(f,h)=>{var g;return n[h].pathname!==f.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return l==="assets"?t.filter((f,h)=>c(f,h)||d(f,h)):l==="data"?t.filter((f,h)=>{var y;let g=r.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(c(f,h)||d(f,h))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((y=n[0])==null?void 0:y.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function WI(e,t,{includeHydrateFallback:n}={}){return QI(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function QI(e){return[...new Set(e)]}function XI(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function JI(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let l=JSON.stringify(XI(o));return n.has(l)||(n.add(l),r.push({key:l,link:o})),r},[])}function v_(){let e=m.useContext(Xl);return F1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function e7(){let e=m.useContext(Tf);return F1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var V1=m.createContext(void 0);V1.displayName="FrameworkContext";function x_(){let e=m.useContext(V1);return F1(e,"You must render this element inside a <HydratedRouter> element"),e}function t7(e,t){let n=m.useContext(V1),[r,o]=m.useState(!1),[l,c]=m.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:y}=t,v=m.useRef(null);m.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=R=>{R.forEach(j=>{c(j.isIntersecting)})},C=new IntersectionObserver(S,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),m.useEffect(()=>{if(r){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[r]);let b=()=>{o(!0)},E=()=>{o(!1),c(!1)};return n?e!=="intent"?[l,v,{}]:[l,v,{onFocus:Ud(d,b),onBlur:Ud(f,E),onMouseEnter:Ud(h,b),onMouseLeave:Ud(g,E),onTouchStart:Ud(y,b)}]:[!1,v,{}]}function Ud(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function n7({page:e,...t}){let{router:n}=v_(),r=m.useMemo(()=>Ai(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?m.createElement(a7,{page:e,matches:r,...t}):null}function r7(e){let{manifest:t,routeModules:n}=x_(),[r,o]=m.useState([]);return m.useEffect(()=>{let l=!1;return YI(e,t,n).then(c=>{l||o(c)}),()=>{l=!0}},[e,t,n]),r}function a7({page:e,matches:t,...n}){let r=Qs(),{manifest:o,routeModules:l}=x_(),{basename:c}=v_(),{loaderData:d,matches:f}=e7(),h=m.useMemo(()=>mR(e,t,f,o,r,"data"),[e,t,f,o,r]),g=m.useMemo(()=>mR(e,t,f,o,r,"assets"),[e,t,f,o,r]),y=m.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let E=new Set,S=!1;if(t.forEach(R=>{var _;let j=o.routes[R.route.id];!j||!j.hasLoader||(!h.some(D=>D.route.id===R.route.id)&&R.route.id in d&&((_=l[R.route.id])!=null&&_.shouldRevalidate)||j.hasClientLoader?S=!0:E.add(R.route.id))}),E.size===0)return[];let C=qI(e,c,"data");return S&&E.size>0&&C.searchParams.set("_routes",t.filter(R=>E.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[c,d,r,o,h,t,e,l]),v=m.useMemo(()=>WI(g,o),[g,o]),b=r7(g);return m.createElement(m.Fragment,null,y.map(E=>m.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...n})),v.map(E=>m.createElement("link",{key:E,rel:"modulepreload",href:E,...n})),b.map(({key:E,link:S})=>m.createElement("link",{key:E,nonce:n.nonce,...S})))}function s7(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var b_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{b_&&(window.__reactRouterVersion="7.9.5")}catch{}function o7(e,t){return B9({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:r9({window:t==null?void 0:t.window}),hydrationData:i7(),routes:e,mapRouteProperties:NI,hydrationRouteProperties:AI,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 i7(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:l7(e.errors)}),e}function l7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new ip(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let c=new l(o.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(o.message);l.stack="",n[r]=l}}else n[r]=o;return n}var S_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ha=m.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:l,replace:c,state:d,target:f,to:h,preventScrollReset:g,viewTransition:y,...v},b){let{basename:E}=m.useContext(ws),S=typeof h=="string"&&S_.test(h),C,R=!1;if(typeof h=="string"&&S&&(C=h,b_))try{let V=new URL(window.location.href),Z=h.startsWith("//")?new URL(V.protocol+h):new URL(h),K=ts(Z.pathname,E);Z.origin===V.origin&&K!=null?h=K+Z.search+Z.hash:R=!0}catch{kn(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let j=mI(h,{relative:o}),[_,D,A]=t7(r,v),O=d7(h,{replace:c,state:d,target:f,preventScrollReset:g,relative:o,viewTransition:y});function T(V){t&&t(V),V.defaultPrevented||O(V)}let M=m.createElement("a",{...v,...A,href:C||j,onClick:R||l?t:T,ref:s7(b,D),target:f,"data-discover":!S&&n==="render"?"true":void 0});return _&&!S?m.createElement(m.Fragment,null,M,m.createElement(n7,{page:j})):M});ha.displayName="Link";var Nf=m.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:l,to:c,viewTransition:d,children:f,...h},g){let y=_f(c,{relative:h.relative}),v=Qs(),b=m.useContext(Tf),{navigator:E,basename:S}=m.useContext(ws),C=b!=null&&y7(y)&&d===!0,R=E.encodeLocation?E.encodeLocation(y).pathname:y.pathname,j=v.pathname,_=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(j=j.toLowerCase(),_=_?_.toLowerCase():null,R=R.toLowerCase()),_&&S&&(_=ts(_,S)||_);const D=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=j===R||!o&&j.startsWith(R)&&j.charAt(D)==="/",O=_!=null&&(_===R||!o&&_.startsWith(R)&&_.charAt(R.length)==="/"),T={isActive:A,isPending:O,isTransitioning:C},M=A?t:void 0,V;typeof r=="function"?V=r(T):V=[r,A?"active":null,O?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let Z=typeof l=="function"?l(T):l;return m.createElement(ha,{...h,"aria-current":M,className:V,ref:g,style:Z,to:c,viewTransition:d},typeof f=="function"?f(T):f)});Nf.displayName="NavLink";var c7=m.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:l,method:c=Km,action:d,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:y,...v},b)=>{let E=p7(),S=g7(d,{relative:h}),C=c.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&S_.test(d),j=_=>{if(f&&f(_),_.defaultPrevented)return;_.preventDefault();let D=_.nativeEvent.submitter,A=(D==null?void 0:D.getAttribute("formmethod"))||c;E(D||_.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:o,state:l,relative:h,preventScrollReset:g,viewTransition:y})};return m.createElement("form",{ref:b,method:C,action:S,onSubmit:r?f:j,...v,"data-discover":!R&&e==="render"?"true":void 0})});c7.displayName="Form";function u7(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function C_(e){let t=m.useContext(Xl);return xt(t,u7(e)),t}function d7(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:l,viewTransition:c}={}){let d=Jp(),f=Qs(),h=_f(e,{relative:l});return m.useCallback(g=>{if(zI(g,t)){g.preventDefault();let y=n!==void 0?n:Zs(f)===Zs(h);d(e,{replace:y,state:r,preventScrollReset:o,relative:l,viewTransition:c})}},[f,d,h,n,r,t,e,o,l,c])}function f7(e){kn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=m.useRef(R0(e)),n=m.useRef(!1),r=Qs(),o=m.useMemo(()=>HI(r.search,n.current?null:t.current),[r.search]),l=Jp(),c=m.useCallback((d,f)=>{const h=R0(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,l("?"+h,f)},[l,o]);return[o,c]}var h7=0,m7=()=>`__${String(++h7)}__`;function p7(){let{router:e}=C_("useSubmit"),{basename:t}=m.useContext(ws),n=jI();return m.useCallback(async(r,o={})=>{let{action:l,method:c,encType:d,formData:f,body:h}=GI(r,t);if(o.navigate===!1){let g=o.fetcherKey||m7();await e.fetch(g,n,o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:h,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await e.navigate(o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:h,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function g7(e,{relative:t}={}){let{basename:n}=m.useContext(ws),r=m.useContext(rs);xt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),l={..._f(e||".",{relative:t})},c=Qs();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(y=>y).forEach(y=>d.append("index",y));let g=d.toString();l.search=g?`?${g}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:$s([n,l.pathname])),Zs(l)}function y7(e,{relative:t}={}){let n=m.useContext(k1);xt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=C_("useViewTransitionState"),o=_f(e,{relative:t});if(!n.isTransitioning)return!1;let l=ts(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ts(n.nextLocation.pathname,r)||n.nextLocation.pathname;return op(o.pathname,c)!=null||op(o.pathname,l)!=null}var ys=KT();const v7=ZT(ys);function x7(e){return m.createElement(OI,{flushSync:ys.flushSync,...e})}function pR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Pr(...e){return t=>{let n=!1;const r=e.map(o=>{const l=pR(o,t);return!n&&typeof l=="function"&&(n=!0),l});if(n)return()=>{for(let o=0;o<r.length;o++){const l=r[o];typeof l=="function"?l():pR(e[o],null)}}}}function dt(...e){return m.useCallback(Pr(...e),e)}var b7=Symbol.for("react.lazy"),cp=A1[" use ".trim().toString()];function S7(e){return typeof e=="object"&&e!==null&&"then"in e}function E_(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===b7&&"_payload"in e&&S7(e._payload)}function z1(e){const t=C7(e),n=m.forwardRef((r,o)=>{let{children:l,...c}=r;E_(l)&&typeof cp=="function"&&(l=cp(l._payload));const d=m.Children.toArray(l),f=d.find(w7);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}var tg=z1("Slot");function C7(e){const t=m.forwardRef((n,r)=>{let{children:o,...l}=n;if(E_(o)&&typeof cp=="function"&&(o=cp(o._payload)),m.isValidElement(o)){const c=j7(o),d=R7(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var E7=Symbol("radix.slottable");function w7(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===E7}function R7(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function j7(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function w_(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=w_(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function R_(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=w_(e))&&(r&&(r+=" "),r+=t);return r}const gR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,yR=R_,Af=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return yR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:l}=t,c=Object.keys(o).map(h=>{const g=n==null?void 0:n[h],y=l==null?void 0:l[h];if(g===null)return null;const v=gR(g)||gR(y);return o[h][v]}),d=n&&Object.entries(n).reduce((h,g)=>{let[y,v]=g;return v===void 0||(h[y]=v),h},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,g)=>{let{class:y,className:v,...b}=g;return Object.entries(b).every(E=>{let[S,C]=E;return Array.isArray(C)?C.includes({...l,...d}[S]):{...l,...d}[S]===C})?[...h,y,v]:h},[]);return yR(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 T7=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),j_=(...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 _7={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 N7=m.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:l,iconNode:c,...d},f)=>m.createElement("svg",{ref:f,..._7,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:j_("lucide",o),...d},[...c.map(([h,g])=>m.createElement(h,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 Me=(e,t)=>{const n=m.forwardRef(({className:r,...o},l)=>m.createElement(N7,{ref:l,iconNode:t,className:j_(`lucide-${T7(e)}`,r),...o}));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 A7=[["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"}]],H1=Me("ArchiveRestore",A7);/**
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 D7=[["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"}]],vR=Me("ArrowDownZA",D7);/**
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 O7=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],M7=Me("ArrowLeft",O7);/**
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 I7=[["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"}]],k7=Me("ArrowRightLeft",I7);/**
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 L7=[["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"}]],xR=Me("ArrowUpAZ",L7);/**
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 P7=[["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"}]],bR=Me("ArrowUpDown",P7);/**
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 U7=[["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"}]],F7=Me("Asterisk",U7);/**
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 V7=[["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"}]],z7=Me("BadgeAlert",V7);/**
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 H7=[["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"}]],$7=Me("BookOpen",H7);/**
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 B7=[["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"}]],up=Me("Box",B7);/**
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 G7=[["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"}]],q7=Me("BriefcaseBusiness",G7);/**
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 Z7=[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]],K7=Me("CalendarClock",Z7);/**
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 Y7=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lr=Me("Check",Y7);/**
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 W7=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],ka=Me("ChevronDown",W7);/**
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 Q7=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],X7=Me("ChevronLeft",Q7);/**
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 J7=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],La=Me("ChevronRight",J7);/**
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 ek=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],ns=Me("ChevronUp",ek);/**
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 tk=[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]],nk=Me("ChevronsDownUp",tk);/**
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 rk=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],$1=Me("ChevronsUpDown",rk);/**
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 ak=[["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"}]],Df=Me("CircleAlert",ak);/**
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 sk=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],ok=Me("CircleCheckBig",sk);/**
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 ik=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ng=Me("CircleCheck",ik);/**
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 lk=[["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"}]],dp=Me("CircleX",lk);/**
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 ck=[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]],B1=Me("Code",ck);/**
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 uk=[["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"}]],dk=Me("Columns3",uk);/**
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 fk=[["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"}]],hf=Me("Copy",fk);/**
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 hk=[["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"}]],mk=Me("DatabaseZap",hk);/**
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 pk=[["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"}]],zl=Me("Database",pk);/**
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 gk=[["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"}]],yk=Me("Download",gk);/**
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 vk=[["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"}]],xk=Me("EllipsisVertical",vk);/**
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 bk=[["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"}]],pa=Me("Ellipsis",bk);/**
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 Sk=[["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"}]],Uo=Me("ExternalLink",Sk);/**
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 Ck=[["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"}]],Ek=Me("EyeOff",Ck);/**
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 wk=[["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"}]],T_=Me("Eye",wk);/**
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 Rk=[["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"}]],jk=Me("FileText",Rk);/**
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 Tk=[["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=Me("Gem",Tk);/**
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 _k=[["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"}]],Nk=Me("GraduationCap",_k);/**
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 Ak=[["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"}]],Dk=Me("GripVertical",Ak);/**
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 Ok=[["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"}]],Mk=Me("Grip",Ok);/**
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 Ik=[["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"}]],kk=Me("History",Ik);/**
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 Lk=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Br=Me("Info",Lk);/**
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 Pk=[["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"}]],j0=Me("KeyRound",Pk);/**
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 Uk=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Of=Me("LoaderCircle",Uk);/**
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 Fk=[["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"}]],Vk=Me("Lock",Fk);/**
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 zk=[["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"}]],Hk=Me("LogOut",zk);/**
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 $k=[["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"}]],Bk=Me("Menu",$k);/**
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 Gk=[["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"}]],qk=Me("MessageCircleQuestion",Gk);/**
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 Zk=[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]],Kk=Me("MessageCircle",Zk);/**
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 Yk=[["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"}]],__=Me("Monitor",Yk);/**
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 Wk=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],N_=Me("Moon",Wk);/**
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 Qk=[["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"}]],Xk=Me("OctagonAlert",Qk);/**
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 Jk=[["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"}]],eL=Me("OctagonX",Jk);/**
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 tL=[["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"}]],nL=Me("PackageSearch",tL);/**
347
- * @license lucide-react v0.475.0 - ISC
348
- *
349
- * This source code is licensed under the ISC license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */const rL=[["path",{d:"M12 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"}]],aL=Me("PenLine",rL);/**
352
- * @license lucide-react v0.475.0 - ISC
353
- *
354
- * This source code is licensed under the ISC license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */const sL=[["path",{d:"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"}]],Au=Me("Pencil",sL);/**
357
- * @license lucide-react v0.475.0 - ISC
358
- *
359
- * This source code is licensed under the ISC license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */const oL=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],rg=Me("Play",oL);/**
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 iL=[["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"}]],G1=Me("Plug",iL);/**
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 lL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Pa=Me("Plus",lL);/**
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 cL=[["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"}]],uL=Me("RefreshCw",cL);/**
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"}]],fL=Me("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 hL=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Jl=Me("Search",hL);/**
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 mL=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],A_=Me("Settings",mL);/**
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 pL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m9 8 6 4-6 4Z",key:"f1r3lt"}]],D_=Me("SquarePlay",pL);/**
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 gL=[["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"}]],O_=Me("Sun",gL);/**
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 yL=[["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"}]],vL=Me("Table",yL);/**
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 xL=[["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"}]],bL=Me("Telescope",xL);/**
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 SL=[["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"}]],M_=Me("Timer",SL);/**
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 CL=[["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"}]],Xs=Me("Trash2",CL);/**
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 EL=[["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"}]],ag=Me("TriangleAlert",EL);/**
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 wL=[["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"}]],mf=Me("Unplug",wL);/**
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 RL=[["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"}]],CR=Me("Users",RL);/**
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 jL=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xu=Me("X",jL),wx=768;function TL(){const[e,t]=m.useState(void 0);return m.useEffect(()=>{const n=window.matchMedia(`(max-width: ${wx-1}px)`),r=()=>{t(window.innerWidth<wx)};return n.addEventListener("change",r),t(window.innerWidth<wx),()=>n.removeEventListener("change",r)},[]),!!e}const _L=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},NL=(e,t)=>({classGroupId:e,validator:t}),I_=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),fp="-",ER=[],AL="arbitrary..",DL=e=>{const t=ML(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return OL(c);const d=c.split(fp),f=d[0]===""&&d.length>1?1:0;return k_(d,f,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const f=r[c],h=n[c];return f?h?_L(h,f):f:h||ER}return n[c]||ER}}},k_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],l=n.nextPart.get(o);if(l){const h=k_(e,t+1,l);if(h)return h}const c=n.validators;if(c===null)return;const d=t===0?e.join(fp):e.slice(t).join(fp),f=c.length;for(let h=0;h<f;h++){const g=c[h];if(g.validator(d))return g.classGroupId}},OL=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?AL+r:void 0})(),ML=e=>{const{theme:t,classGroups:n}=e;return IL(n,t)},IL=(e,t)=>{const n=I_();for(const r in e){const o=e[r];q1(o,n,r,t)}return n},q1=(e,t,n,r)=>{const o=e.length;for(let l=0;l<o;l++){const c=e[l];kL(c,t,n,r)}},kL=(e,t,n,r)=>{if(typeof e=="string"){LL(e,t,n);return}if(typeof e=="function"){PL(e,t,n,r);return}UL(e,t,n,r)},LL=(e,t,n)=>{const r=e===""?t:L_(t,e);r.classGroupId=n},PL=(e,t,n,r)=>{if(FL(e)){q1(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(NL(n,e))},UL=(e,t,n,r)=>{const o=Object.entries(e),l=o.length;for(let c=0;c<l;c++){const[d,f]=o[c];q1(f,L_(t,d),n,r)}},L_=(e,t)=>{let n=e;const r=t.split(fp),o=r.length;for(let l=0;l<o;l++){const c=r[l];let d=n.nextPart.get(c);d||(d=I_(),n.nextPart.set(c,d)),n=d}return n},FL=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,VL=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const o=(l,c)=>{n[l]=c,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(l){let c=n[l];if(c!==void 0)return c;if((c=r[l])!==void 0)return o(l,c),c},set(l,c){l in n?n[l]=c:o(l,c)}}},T0="!",wR=":",zL=[],RR=(e,t,n,r,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:o}),HL=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=o=>{const l=[];let c=0,d=0,f=0,h;const g=o.length;for(let S=0;S<g;S++){const C=o[S];if(c===0&&d===0){if(C===wR){l.push(o.slice(f,S)),f=S+1;continue}if(C==="/"){h=S;continue}}C==="["?c++:C==="]"?c--:C==="("?d++:C===")"&&d--}const y=l.length===0?o:o.slice(f);let v=y,b=!1;y.endsWith(T0)?(v=y.slice(0,-1),b=!0):y.startsWith(T0)&&(v=y.slice(1),b=!0);const E=h&&h>f?h-f:void 0;return RR(l,b,v,E)};if(t){const o=t+wR,l=r;r=c=>c.startsWith(o)?l(c.slice(o.length)):RR(zL,!1,c,void 0,!0)}if(n){const o=r;r=l=>n({className:l,parseClassName:o})}return r},$L=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let o=[];for(let l=0;l<n.length;l++){const c=n[l],d=c[0]==="[",f=t.has(c);d||f?(o.length>0&&(o.sort(),r.push(...o),o=[]),r.push(c)):o.push(c)}return o.length>0&&(o.sort(),r.push(...o)),r}},BL=e=>({cache:VL(e.cacheSize),parseClassName:HL(e),sortModifiers:$L(e),...DL(e)}),GL=/\s+/,qL=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o,sortModifiers:l}=t,c=[],d=e.trim().split(GL);let f="";for(let h=d.length-1;h>=0;h-=1){const g=d[h],{isExternal:y,modifiers:v,hasImportantModifier:b,baseClassName:E,maybePostfixModifierPosition:S}=n(g);if(y){f=g+(f.length>0?" "+f:f);continue}let C=!!S,R=r(C?E.substring(0,S):E);if(!R){if(!C){f=g+(f.length>0?" "+f:f);continue}if(R=r(E),!R){f=g+(f.length>0?" "+f:f);continue}C=!1}const j=v.length===0?"":v.length===1?v[0]:l(v).join(":"),_=b?j+T0:j,D=_+R;if(c.indexOf(D)>-1)continue;c.push(D);const A=o(R,C);for(let O=0;O<A.length;++O){const T=A[O];c.push(_+T)}f=g+(f.length>0?" "+f:f)}return f},ZL=(...e)=>{let t=0,n,r,o="";for(;t<e.length;)(n=e[t++])&&(r=P_(n))&&(o&&(o+=" "),o+=r);return o},P_=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=P_(e[r]))&&(n&&(n+=" "),n+=t);return n},KL=(e,...t)=>{let n,r,o,l;const c=f=>{const h=t.reduce((g,y)=>y(g),e());return n=BL(h),r=n.cache.get,o=n.cache.set,l=d,d(f)},d=f=>{const h=r(f);if(h)return h;const g=qL(f,n);return o(f,g),g};return l=c,(...f)=>l(ZL(...f))},YL=[],rr=e=>{const t=n=>n[e]||YL;return t.isThemeGetter=!0,t},U_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,F_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,WL=/^\d+\/\d+$/,QL=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,XL=/\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$/,JL=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eP=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tP=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gc=e=>WL.test(e),vt=e=>!!e&&!Number.isNaN(Number(e)),Ri=e=>!!e&&Number.isInteger(Number(e)),Rx=e=>e.endsWith("%")&&vt(e.slice(0,-1)),Eo=e=>QL.test(e),nP=()=>!0,rP=e=>XL.test(e)&&!JL.test(e),V_=()=>!1,aP=e=>eP.test(e),sP=e=>tP.test(e),oP=e=>!Ke(e)&&!Ye(e),iP=e=>Du(e,$_,V_),Ke=e=>U_.test(e),Tl=e=>Du(e,B_,rP),jx=e=>Du(e,fP,vt),jR=e=>Du(e,z_,V_),lP=e=>Du(e,H_,sP),Sm=e=>Du(e,G_,aP),Ye=e=>F_.test(e),Fd=e=>Ou(e,B_),cP=e=>Ou(e,hP),TR=e=>Ou(e,z_),uP=e=>Ou(e,$_),dP=e=>Ou(e,H_),Cm=e=>Ou(e,G_,!0),Du=(e,t,n)=>{const r=U_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Ou=(e,t,n=!1)=>{const r=F_.exec(e);return r?r[1]?t(r[1]):n:!1},z_=e=>e==="position"||e==="percentage",H_=e=>e==="image"||e==="url",$_=e=>e==="length"||e==="size"||e==="bg-size",B_=e=>e==="length",fP=e=>e==="number",hP=e=>e==="family-name",G_=e=>e==="shadow",mP=()=>{const e=rr("color"),t=rr("font"),n=rr("text"),r=rr("font-weight"),o=rr("tracking"),l=rr("leading"),c=rr("breakpoint"),d=rr("container"),f=rr("spacing"),h=rr("radius"),g=rr("shadow"),y=rr("inset-shadow"),v=rr("text-shadow"),b=rr("drop-shadow"),E=rr("blur"),S=rr("perspective"),C=rr("aspect"),R=rr("ease"),j=rr("animate"),_=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...D(),Ye,Ke],O=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],M=()=>[Ye,Ke,f],V=()=>[Gc,"full","auto",...M()],Z=()=>[Ri,"none","subgrid",Ye,Ke],K=()=>["auto",{span:["full",Ri,Ye,Ke]},Ri,Ye,Ke],Y=()=>[Ri,"auto",Ye,Ke],G=()=>["auto","min","max","fr",Ye,Ke],U=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],k=()=>["auto",...M()],$=()=>[Gc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],q=()=>[e,Ye,Ke],ie=()=>[...D(),TR,jR,{position:[Ye,Ke]}],be=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",uP,iP,{size:[Ye,Ke]}],P=()=>[Rx,Fd,Tl],W=()=>["","none","full",h,Ye,Ke],te=()=>["",vt,Fd,Tl],ue=()=>["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=()=>[vt,Rx,TR,jR],Ae=()=>["","none",E,Ye,Ke],we=()=>["none",vt,Ye,Ke],Ne=()=>["none",vt,Ye,Ke],Be=()=>[vt,Ye,Ke],Qe=()=>[Gc,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Eo],breakpoint:[Eo],color:[nP],container:[Eo],"drop-shadow":[Eo],ease:["in","out","in-out"],font:[oP],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Eo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Eo],shadow:[Eo],spacing:["px",vt],text:[Eo],"text-shadow":[Eo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gc,Ke,Ye,C]}],container:["container"],columns:[{columns:[vt,Ke,Ye,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:O()}],"overflow-x":[{"overflow-x":O()}],"overflow-y":[{"overflow-y":O()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Ri,"auto",Ye,Ke]}],basis:[{basis:[Gc,"full","auto",d,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[vt,Gc,"auto","initial","none",Ke]}],grow:[{grow:["",vt,Ye,Ke]}],shrink:[{shrink:["",vt,Ye,Ke]}],order:[{order:[Ri,"first","last","none",Ye,Ke]}],"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":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...U(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...U()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":U()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],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:k()}],mx:[{mx:k()}],my:[{my:k()}],ms:[{ms:k()}],me:[{me:k()}],mt:[{mt:k()}],mr:[{mr:k()}],mb:[{mb:k()}],ml:[{ml:k()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],w:[{w:[d,"screen",...$()]}],"min-w":[{"min-w":[d,"screen","none",...$()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Fd,Tl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ye,jx]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Rx,Ke]}],"font-family":[{font:[cP,Ke,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ye,Ke]}],"line-clamp":[{"line-clamp":[vt,"none",Ye,jx]}],leading:[{leading:[l,...M()]}],"list-image":[{"list-image":["none",Ye,Ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ye,Ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:q()}],"text-color":[{text:q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[vt,"from-font","auto",Ye,Tl]}],"text-decoration-color":[{decoration:q()}],"underline-offset":[{"underline-offset":[vt,"auto",Ye,Ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ye,Ke]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ye,Ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ie()}],"bg-repeat":[{bg:be()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ri,Ye,Ke],radial:["",Ye,Ke],conic:[Ri,Ye,Ke]},dP,lP]}],"bg-color":[{bg:q()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:q()}],"gradient-via":[{via:q()}],"gradient-to":[{to:q()}],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:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:q()}],"border-color-x":[{"border-x":q()}],"border-color-y":[{"border-y":q()}],"border-color-s":[{"border-s":q()}],"border-color-e":[{"border-e":q()}],"border-color-t":[{"border-t":q()}],"border-color-r":[{"border-r":q()}],"border-color-b":[{"border-b":q()}],"border-color-l":[{"border-l":q()}],"divide-color":[{divide:q()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[vt,Ye,Ke]}],"outline-w":[{outline:["",vt,Fd,Tl]}],"outline-color":[{outline:q()}],shadow:[{shadow:["","none",g,Cm,Sm]}],"shadow-color":[{shadow:q()}],"inset-shadow":[{"inset-shadow":["none",y,Cm,Sm]}],"inset-shadow-color":[{"inset-shadow":q()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:q()}],"ring-offset-w":[{"ring-offset":[vt,Tl]}],"ring-offset-color":[{"ring-offset":q()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":q()}],"text-shadow":[{"text-shadow":["none",v,Cm,Sm]}],"text-shadow-color":[{"text-shadow":q()}],opacity:[{opacity:[vt,Ye,Ke]}],"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":[vt]}],"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":q()}],"mask-image-linear-to-color":[{"mask-linear-to":q()}],"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":q()}],"mask-image-t-to-color":[{"mask-t-to":q()}],"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":q()}],"mask-image-r-to-color":[{"mask-r-to":q()}],"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":q()}],"mask-image-b-to-color":[{"mask-b-to":q()}],"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":q()}],"mask-image-l-to-color":[{"mask-l-to":q()}],"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":q()}],"mask-image-x-to-color":[{"mask-x-to":q()}],"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":q()}],"mask-image-y-to-color":[{"mask-y-to":q()}],"mask-image-radial":[{"mask-radial":[Ye,Ke]}],"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":q()}],"mask-image-radial-to-color":[{"mask-radial-to":q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[vt]}],"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":q()}],"mask-image-conic-to-color":[{"mask-conic-to":q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ie()}],"mask-repeat":[{mask:be()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ye,Ke]}],filter:[{filter:["","none",Ye,Ke]}],blur:[{blur:Ae()}],brightness:[{brightness:[vt,Ye,Ke]}],contrast:[{contrast:[vt,Ye,Ke]}],"drop-shadow":[{"drop-shadow":["","none",b,Cm,Sm]}],"drop-shadow-color":[{"drop-shadow":q()}],grayscale:[{grayscale:["",vt,Ye,Ke]}],"hue-rotate":[{"hue-rotate":[vt,Ye,Ke]}],invert:[{invert:["",vt,Ye,Ke]}],saturate:[{saturate:[vt,Ye,Ke]}],sepia:[{sepia:["",vt,Ye,Ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ye,Ke]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[vt,Ye,Ke]}],"backdrop-contrast":[{"backdrop-contrast":[vt,Ye,Ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",vt,Ye,Ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vt,Ye,Ke]}],"backdrop-invert":[{"backdrop-invert":["",vt,Ye,Ke]}],"backdrop-opacity":[{"backdrop-opacity":[vt,Ye,Ke]}],"backdrop-saturate":[{"backdrop-saturate":[vt,Ye,Ke]}],"backdrop-sepia":[{"backdrop-sepia":["",vt,Ye,Ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ye,Ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[vt,"initial",Ye,Ke]}],ease:[{ease:["linear","initial",R,Ye,Ke]}],delay:[{delay:[vt,Ye,Ke]}],animate:[{animate:["none",j,Ye,Ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,Ye,Ke]}],"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:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:Be()}],"skew-x":[{"skew-x":Be()}],"skew-y":[{"skew-y":Be()}],transform:[{transform:[Ye,Ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Qe()}],"translate-x":[{"translate-x":Qe()}],"translate-y":[{"translate-y":Qe()}],"translate-z":[{"translate-z":Qe()}],"translate-none":["translate-none"],accent:[{accent:q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ye,Ke]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ye,Ke]}],fill:[{fill:["none",...q()]}],"stroke-w":[{stroke:[vt,Fd,Tl,jx]}],stroke:[{stroke:["none",...q()]}],"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"]}},pP=KL(mP);function ne(...e){return pP(R_(e))}const Z1=Af("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 xe({className:e,variant:t,size:n,asChild:r=!1,...o}){const l=r?tg:"button";return a.jsx(l,{"data-slot":"button",className:ne(Z1({variant:t,size:n,className:e})),...o})}function Ht({className:e,type:t,...n}){return a.jsx("input",{type:t,"data-slot":"input",className:ne("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 gP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],yP=gP.reduce((e,t)=>{const n=z1(`Primitive.${t}`),r=m.forwardRef((o,l)=>{const{asChild:c,...d}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),vP="Separator",_R="horizontal",xP=["horizontal","vertical"],q_=m.forwardRef((e,t)=>{const{decorative:n,orientation:r=_R,...o}=e,l=bP(r)?r:_R,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return a.jsx(yP.div,{"data-orientation":l,...d,...o,ref:t})});q_.displayName=vP;function bP(e){return xP.includes(e)}var SP=q_;function Z_({className:e,orientation:t="horizontal",decorative:n=!0,...r}){return a.jsx(SP,{"data-slot":"separator",decorative:n,orientation:t,className:ne("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",e),...r})}function Te(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function CP(e,t){const n=m.createContext(t),r=l=>{const{children:c,...d}=l,f=m.useMemo(()=>d,Object.values(d));return a.jsx(n.Provider,{value:f,children:c})};r.displayName=e+"Provider";function o(l){const c=m.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${l}\` must be used within \`${e}\``)}return[r,o]}function cr(e,t=[]){let n=[];function r(l,c){const d=m.createContext(c),f=n.length;n=[...n,c];const h=y=>{var R;const{scope:v,children:b,...E}=y,S=((R=v==null?void 0:v[e])==null?void 0:R[f])||d,C=m.useMemo(()=>E,Object.values(E));return a.jsx(S.Provider,{value:C,children:b})};h.displayName=l+"Provider";function g(y,v){var S;const b=((S=v==null?void 0:v[e])==null?void 0:S[f])||d,E=m.useContext(b);if(E)return E;if(c!==void 0)return c;throw new Error(`\`${y}\` must be used within \`${l}\``)}return[h,g]}const o=()=>{const l=n.map(c=>m.createContext(c));return function(d){const f=(d==null?void 0:d[e])||l;return m.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return o.scopeName=e,[r,EP(o,...t)]}function EP(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(l){const c=r.reduce((d,{useScope:f,scopeName:h})=>{const y=f(l)[`__scope${h}`];return{...d,...y}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var jr=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},wP=A1[" useId ".trim().toString()]||(()=>{}),RP=0;function Ln(e){const[t,n]=m.useState(wP());return jr(()=>{n(r=>r??String(RP++))},[e]),e||(t?`radix-${t}`:"")}var jP=A1[" useInsertionEffect ".trim().toString()]||jr;function Gr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,l,c]=TP({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:o;{const g=m.useRef(e!==void 0);m.useEffect(()=>{const y=g.current;y!==d&&console.warn(`${r} is changing from ${y?"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 h=m.useCallback(g=>{var y;if(d){const v=_P(g)?g(e):g;v!==e&&((y=c.current)==null||y.call(c,v))}else l(g)},[d,e,l,c]);return[f,h]}function TP({defaultProp:e,onChange:t}){const[n,r]=m.useState(e),o=m.useRef(n),l=m.useRef(t);return jP(()=>{l.current=t},[t]),m.useEffect(()=>{var c;o.current!==n&&((c=l.current)==null||c.call(l,n),o.current=n)},[n,o]),[n,r,l]}function _P(e){return typeof e=="function"}function NP(e){const t=AP(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(OP);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function AP(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=IP(o),d=MP(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DP=Symbol("radix.slottable");function OP(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DP}function MP(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function IP(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kP=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],et=kP.reduce((e,t)=>{const n=NP(`Primitive.${t}`),r=m.forwardRef((o,l)=>{const{asChild:c,...d}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function K_(e,t){e&&ys.flushSync(()=>e.dispatchEvent(t))}function bs(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function LP(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e);m.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var PP="DismissableLayer",_0="dismissableLayer.update",UP="dismissableLayer.pointerDownOutside",FP="dismissableLayer.focusOutside",NR,Y_=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ec=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,onDismiss:d,...f}=e,h=m.useContext(Y_),[g,y]=m.useState(null),v=(g==null?void 0:g.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,b]=m.useState({}),E=dt(t,T=>y(T)),S=Array.from(h.layers),[C]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),R=S.indexOf(C),j=g?S.indexOf(g):-1,_=h.layersWithOutsidePointerEventsDisabled.size>0,D=j>=R,A=HP(T=>{const M=T.target,V=[...h.branches].some(Z=>Z.contains(M));!D||V||(o==null||o(T),c==null||c(T),T.defaultPrevented||d==null||d())},v),O=$P(T=>{const M=T.target;[...h.branches].some(Z=>Z.contains(M))||(l==null||l(T),c==null||c(T),T.defaultPrevented||d==null||d())},v);return LP(T=>{j===h.layers.size-1&&(r==null||r(T),!T.defaultPrevented&&d&&(T.preventDefault(),d()))},v),m.useEffect(()=>{if(g)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(NR=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(g)),h.layers.add(g),AR(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=NR)}},[g,v,n,h]),m.useEffect(()=>()=>{g&&(h.layers.delete(g),h.layersWithOutsidePointerEventsDisabled.delete(g),AR())},[g,h]),m.useEffect(()=>{const T=()=>b({});return document.addEventListener(_0,T),()=>document.removeEventListener(_0,T)},[]),a.jsx(et.div,{...f,ref:E,style:{pointerEvents:_?D?"auto":"none":void 0,...e.style},onFocusCapture:Te(e.onFocusCapture,O.onFocusCapture),onBlurCapture:Te(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:Te(e.onPointerDownCapture,A.onPointerDownCapture)})});ec.displayName=PP;var VP="DismissableLayerBranch",zP=m.forwardRef((e,t)=>{const n=m.useContext(Y_),r=m.useRef(null),o=dt(t,r);return m.useEffect(()=>{const l=r.current;if(l)return n.branches.add(l),()=>{n.branches.delete(l)}},[n.branches]),a.jsx(et.div,{...e,ref:o})});zP.displayName=VP;function HP(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e),r=m.useRef(!1),o=m.useRef(()=>{});return m.useEffect(()=>{const l=d=>{if(d.target&&!r.current){let f=function(){W_(UP,n,h,{discrete:!0})};const h={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=f,t.addEventListener("click",o.current,{once:!0})):f()}else t.removeEventListener("click",o.current);r.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",l)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",l),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function $P(e,t=globalThis==null?void 0:globalThis.document){const n=bs(e),r=m.useRef(!1);return m.useEffect(()=>{const o=l=>{l.target&&!r.current&&W_(FP,n,{originalEvent:l},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function AR(){const e=new CustomEvent(_0);document.dispatchEvent(e)}function W_(e,t,n,{discrete:r}){const o=n.originalEvent.target,l=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?K_(o,l):o.dispatchEvent(l)}var Tx="focusScope.autoFocusOnMount",_x="focusScope.autoFocusOnUnmount",DR={bubbles:!1,cancelable:!0},BP="FocusScope",Mf=m.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...c}=e,[d,f]=m.useState(null),h=bs(o),g=bs(l),y=m.useRef(null),v=dt(t,S=>f(S)),b=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let S=function(_){if(b.paused||!d)return;const D=_.target;d.contains(D)?y.current=D:ji(y.current,{select:!0})},C=function(_){if(b.paused||!d)return;const D=_.relatedTarget;D!==null&&(d.contains(D)||ji(y.current,{select:!0}))},R=function(_){if(document.activeElement===document.body)for(const A of _)A.removedNodes.length>0&&ji(d)};document.addEventListener("focusin",S),document.addEventListener("focusout",C);const j=new MutationObserver(R);return d&&j.observe(d,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",C),j.disconnect()}}},[r,d,b.paused]),m.useEffect(()=>{if(d){MR.add(b);const S=document.activeElement;if(!d.contains(S)){const R=new CustomEvent(Tx,DR);d.addEventListener(Tx,h),d.dispatchEvent(R),R.defaultPrevented||(GP(WP(Q_(d)),{select:!0}),document.activeElement===S&&ji(d))}return()=>{d.removeEventListener(Tx,h),setTimeout(()=>{const R=new CustomEvent(_x,DR);d.addEventListener(_x,g),d.dispatchEvent(R),R.defaultPrevented||ji(S??document.body,{select:!0}),d.removeEventListener(_x,g),MR.remove(b)},0)}}},[d,h,g,b]);const E=m.useCallback(S=>{if(!n&&!r||b.paused)return;const C=S.key==="Tab"&&!S.altKey&&!S.ctrlKey&&!S.metaKey,R=document.activeElement;if(C&&R){const j=S.currentTarget,[_,D]=qP(j);_&&D?!S.shiftKey&&R===D?(S.preventDefault(),n&&ji(_,{select:!0})):S.shiftKey&&R===_&&(S.preventDefault(),n&&ji(D,{select:!0})):R===j&&S.preventDefault()}},[n,r,b.paused]);return a.jsx(et.div,{tabIndex:-1,...c,ref:v,onKeyDown:E})});Mf.displayName=BP;function GP(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ji(r,{select:t}),document.activeElement!==n)return}function qP(e){const t=Q_(e),n=OR(t,e),r=OR(t.reverse(),e);return[n,r]}function Q_(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function OR(e,t){for(const n of e)if(!ZP(n,{upTo:t}))return n}function ZP(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 KP(e){return e instanceof HTMLInputElement&&"select"in e}function ji(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&KP(e)&&t&&e.select()}}var MR=YP();function YP(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=IR(e,t),e.unshift(t)},remove(t){var n;e=IR(e,t),(n=e[0])==null||n.resume()}}}function IR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function WP(e){return e.filter(t=>t.tagName!=="A")}var QP="Portal",tc=m.forwardRef((e,t)=>{var d;const{container:n,...r}=e,[o,l]=m.useState(!1);jr(()=>l(!0),[]);const c=n||o&&((d=globalThis==null?void 0:globalThis.document)==null?void 0:d.body);return c?v7.createPortal(a.jsx(et.div,{...r,ref:t}),c):null});tc.displayName=QP;function XP(e,t){return m.useReducer((n,r)=>t[n][r]??n,e)}var _r=e=>{const{present:t,children:n}=e,r=JP(t),o=typeof n=="function"?n({present:r.isPresent}):m.Children.only(n),l=dt(r.ref,eU(o));return typeof n=="function"||r.isPresent?m.cloneElement(o,{ref:l}):null};_r.displayName="Presence";function JP(e){const[t,n]=m.useState(),r=m.useRef(null),o=m.useRef(e),l=m.useRef("none"),c=e?"mounted":"unmounted",[d,f]=XP(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return m.useEffect(()=>{const h=Em(r.current);l.current=d==="mounted"?h:"none"},[d]),jr(()=>{const h=r.current,g=o.current;if(g!==e){const v=l.current,b=Em(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(g&&v!==b?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,f]),jr(()=>{if(t){let h;const g=t.ownerDocument.defaultView??window,y=b=>{const S=Em(r.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(f("ANIMATION_END"),!o.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",h=g.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=b=>{b.target===t&&(l.current=Em(r.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",y),t.addEventListener("animationend",y),()=>{g.clearTimeout(h),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",y),t.removeEventListener("animationend",y)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:m.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function Em(e){return(e==null?void 0:e.animationName)||"none"}function eU(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Nx=0;function sg(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kR()),document.body.insertAdjacentElement("beforeend",e[1]??kR()),Nx++,()=>{Nx===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Nx--}},[])}function kR(){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 Fs=function(){return Fs=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},Fs.apply(this,arguments)};function X_(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function tU(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,l;r<o;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 Wm="right-scroll-bar-position",Qm="width-before-scroll-bar",nU="with-scroll-bars-hidden",rU="--removed-body-scroll-bar-size";function Ax(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aU(e,t){var n=m.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var sU=typeof window<"u"?m.useLayoutEffect:m.useEffect,LR=new WeakMap;function oU(e,t){var n=aU(null,function(r){return e.forEach(function(o){return Ax(o,r)})});return sU(function(){var r=LR.get(n);if(r){var o=new Set(r),l=new Set(e),c=n.current;o.forEach(function(d){l.has(d)||Ax(d,null)}),l.forEach(function(d){o.has(d)||Ax(d,c)})}LR.set(n,e)},[e]),n}function iU(e){return e}function lU(e,t){t===void 0&&(t=iU);var n=[],r=!1,o={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)},h=function(){return Promise.resolve().then(f)};h(),n={push:function(g){c.push(g),h()},filter:function(g){return c=c.filter(g),n}}}};return o}function cU(e){e===void 0&&(e={});var t=lU(null);return t.options=Fs({async:!0,ssr:!1},e),t}var J_=function(e){var t=e.sideCar,n=X_(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 m.createElement(r,Fs({},n))};J_.isSideCarExport=!0;function uU(e,t){return e.useMedium(t),J_}var eN=cU(),Dx=function(){},og=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:Dx,onWheelCapture:Dx,onTouchMoveCapture:Dx}),o=r[0],l=r[1],c=e.forwardProps,d=e.children,f=e.className,h=e.removeScrollBar,g=e.enabled,y=e.shards,v=e.sideCar,b=e.noRelative,E=e.noIsolation,S=e.inert,C=e.allowPinchZoom,R=e.as,j=R===void 0?"div":R,_=e.gapMode,D=X_(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,O=oU([n,t]),T=Fs(Fs({},D),o);return m.createElement(m.Fragment,null,g&&m.createElement(A,{sideCar:eN,removeScrollBar:h,shards:y,noRelative:b,noIsolation:E,inert:S,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:_}),c?m.cloneElement(m.Children.only(d),Fs(Fs({},T),{ref:O})):m.createElement(j,Fs({},T,{className:f,ref:O}),d))});og.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};og.classNames={fullWidth:Qm,zeroRight:Wm};var dU=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fU(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=dU();return t&&e.setAttribute("nonce",t),e}function hU(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mU(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var pU=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fU())&&(hU(t,n),mU(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},gU=function(){var e=pU();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tN=function(){var e=gU(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},yU={left:0,top:0,right:0,gap:0},Ox=function(e){return parseInt(e||"",10)||0},vU=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Ox(n),Ox(r),Ox(o)]},xU=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yU;var t=vU(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])}},bU=tN(),du="data-scroll-locked",SU=function(e,t,n,r){var o=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
442
- .`.concat(nU,` {
443
- overflow: hidden `).concat(r,`;
444
- padding-right: `).concat(d,"px ").concat(r,`;
445
- }
446
- body[`).concat(du,`] {
447
- overflow: hidden `).concat(r,`;
448
- overscroll-behavior: contain;
449
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
450
- padding-left: `.concat(o,`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(Wm,` {
460
- right: `).concat(d,"px ").concat(r,`;
461
- }
462
-
463
- .`).concat(Qm,` {
464
- margin-right: `).concat(d,"px ").concat(r,`;
465
- }
466
-
467
- .`).concat(Wm," .").concat(Wm,` {
468
- right: 0 `).concat(r,`;
469
- }
470
-
471
- .`).concat(Qm," .").concat(Qm,` {
472
- margin-right: 0 `).concat(r,`;
473
- }
474
-
475
- body[`).concat(du,`] {
476
- `).concat(rU,": ").concat(d,`px;
477
- }
478
- `)},PR=function(){var e=parseInt(document.body.getAttribute(du)||"0",10);return isFinite(e)?e:0},CU=function(){m.useEffect(function(){return document.body.setAttribute(du,(PR()+1).toString()),function(){var e=PR()-1;e<=0?document.body.removeAttribute(du):document.body.setAttribute(du,e.toString())}},[])},EU=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;CU();var l=m.useMemo(function(){return xU(o)},[o]);return m.createElement(bU,{styles:SU(l,!t,o,n?"":"!important")})},N0=!1;if(typeof window<"u")try{var wm=Object.defineProperty({},"passive",{get:function(){return N0=!0,!0}});window.addEventListener("test",wm,wm),window.removeEventListener("test",wm,wm)}catch{N0=!1}var qc=N0?{passive:!1}:!1,wU=function(e){return e.tagName==="TEXTAREA"},nN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!wU(e)&&n[t]==="visible")},RU=function(e){return nN(e,"overflowY")},jU=function(e){return nN(e,"overflowX")},UR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=rN(e,r);if(o){var l=aN(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},TU=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},_U=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},rN=function(e,t){return e==="v"?RU(t):jU(t)},aN=function(e,t){return e==="v"?TU(t):_U(t)},NU=function(e,t){return e==="h"&&t==="rtl"?-1:1},AU=function(e,t,n,r,o){var l=NU(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,f=t.contains(d),h=!1,g=c>0,y=0,v=0;do{if(!d)break;var b=aN(e,d),E=b[0],S=b[1],C=b[2],R=S-C-l*E;(E||R)&&rN(e,d)&&(y+=R,v+=E);var j=d.parentNode;d=j&&j.nodeType===Node.DOCUMENT_FRAGMENT_NODE?j.host:j}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(g&&Math.abs(y)<1||!g&&Math.abs(v)<1)&&(h=!0),h},Rm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},FR=function(e){return[e.deltaX,e.deltaY]},VR=function(e){return e&&"current"in e?e.current:e},DU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},OU=function(e){return`
479
- .block-interactivity-`.concat(e,` {pointer-events: none;}
480
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
481
- `)},MU=0,Zc=[];function IU(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(MU++)[0],l=m.useState(tN)[0],c=m.useRef(e);m.useEffect(function(){c.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var S=tU([e.lockRef.current],(e.shards||[]).map(VR),!0).filter(Boolean);return S.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),S.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=m.useCallback(function(S,C){if("touches"in S&&S.touches.length===2||S.type==="wheel"&&S.ctrlKey)return!c.current.allowPinchZoom;var R=Rm(S),j=n.current,_="deltaX"in S?S.deltaX:j[0]-R[0],D="deltaY"in S?S.deltaY:j[1]-R[1],A,O=S.target,T=Math.abs(_)>Math.abs(D)?"h":"v";if("touches"in S&&T==="h"&&O.type==="range")return!1;var M=UR(T,O);if(!M)return!0;if(M?A=T:(A=T==="v"?"h":"v",M=UR(T,O)),!M)return!1;if(!r.current&&"changedTouches"in S&&(_||D)&&(r.current=A),!A)return!0;var V=r.current||A;return AU(V,C,S,V==="h"?_:D)},[]),f=m.useCallback(function(S){var C=S;if(!(!Zc.length||Zc[Zc.length-1]!==l)){var R="deltaY"in C?FR(C):Rm(C),j=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&DU(A.delta,R)})[0];if(j&&j.should){C.cancelable&&C.preventDefault();return}if(!j){var _=(c.current.shards||[]).map(VR).filter(Boolean).filter(function(A){return A.contains(C.target)}),D=_.length>0?d(C,_[0]):!c.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),h=m.useCallback(function(S,C,R,j){var _={name:S,delta:C,target:R,should:j,shadowParent:kU(R)};t.current.push(_),setTimeout(function(){t.current=t.current.filter(function(D){return D!==_})},1)},[]),g=m.useCallback(function(S){n.current=Rm(S),r.current=void 0},[]),y=m.useCallback(function(S){h(S.type,FR(S),S.target,d(S,e.lockRef.current))},[]),v=m.useCallback(function(S){h(S.type,Rm(S),S.target,d(S,e.lockRef.current))},[]);m.useEffect(function(){return Zc.push(l),e.setCallbacks({onScrollCapture:y,onWheelCapture:y,onTouchMoveCapture:v}),document.addEventListener("wheel",f,qc),document.addEventListener("touchmove",f,qc),document.addEventListener("touchstart",g,qc),function(){Zc=Zc.filter(function(S){return S!==l}),document.removeEventListener("wheel",f,qc),document.removeEventListener("touchmove",f,qc),document.removeEventListener("touchstart",g,qc)}},[]);var b=e.removeScrollBar,E=e.inert;return m.createElement(m.Fragment,null,E?m.createElement(l,{styles:OU(o)}):null,b?m.createElement(EU,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function kU(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LU=uU(eN,IU);var If=m.forwardRef(function(e,t){return m.createElement(og,Fs({},e,{ref:t,sideCar:LU}))});If.classNames=og.classNames;var PU=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Kc=new WeakMap,jm=new WeakMap,Tm={},Mx=0,sN=function(e){return e&&(e.host||sN(e.parentNode))},UU=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=sN(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})},FU=function(e,t,n,r){var o=UU(t,Array.isArray(e)?e:[e]);Tm[n]||(Tm[n]=new WeakMap);var l=Tm[n],c=[],d=new Set,f=new Set(o),h=function(y){!y||d.has(y)||(d.add(y),h(y.parentNode))};o.forEach(h);var g=function(y){!y||f.has(y)||Array.prototype.forEach.call(y.children,function(v){if(d.has(v))g(v);else try{var b=v.getAttribute(r),E=b!==null&&b!=="false",S=(Kc.get(v)||0)+1,C=(l.get(v)||0)+1;Kc.set(v,S),l.set(v,C),c.push(v),S===1&&E&&jm.set(v,!0),C===1&&v.setAttribute(n,"true"),E||v.setAttribute(r,"true")}catch(R){console.error("aria-hidden: cannot operate on ",v,R)}})};return g(t),d.clear(),Mx++,function(){c.forEach(function(y){var v=Kc.get(y)-1,b=l.get(y)-1;Kc.set(y,v),l.set(y,b),v||(jm.has(y)||y.removeAttribute(r),jm.delete(y)),b||y.removeAttribute(n)}),Mx--,Mx||(Kc=new WeakMap,Kc=new WeakMap,jm=new WeakMap,Tm={})}},ig=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=PU(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),FU(r,o,n,"aria-hidden")):function(){return null}};function VU(e){const t=zU(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find($U);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function zU(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=GU(o),d=BU(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var HU=Symbol("radix.slottable");function $U(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===HU}function BU(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function GU(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lg="Dialog",[oN,iN]=cr(lg),[qU,Rs]=oN(lg),lN=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:c=!0}=e,d=m.useRef(null),f=m.useRef(null),[h,g]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:lg});return a.jsx(qU,{scope:t,triggerRef:d,contentRef:f,contentId:Ln(),titleId:Ln(),descriptionId:Ln(),open:h,onOpenChange:g,onOpenToggle:m.useCallback(()=>g(y=>!y),[g]),modal:c,children:n})};lN.displayName=lg;var cN="DialogTrigger",uN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(cN,n),l=dt(t,o.triggerRef);return a.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":W1(o.open),...r,ref:l,onClick:Te(e.onClick,o.onOpenToggle)})});uN.displayName=cN;var K1="DialogPortal",[ZU,dN]=oN(K1,{forceMount:void 0}),fN=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,l=Rs(K1,t);return a.jsx(ZU,{scope:t,forceMount:n,children:m.Children.map(r,c=>a.jsx(_r,{present:n||l.open,children:a.jsx(tc,{asChild:!0,container:o,children:c})}))})};fN.displayName=K1;var hp="DialogOverlay",hN=m.forwardRef((e,t)=>{const n=dN(hp,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Rs(hp,e.__scopeDialog);return l.modal?a.jsx(_r,{present:r||l.open,children:a.jsx(YU,{...o,ref:t})}):null});hN.displayName=hp;var KU=VU("DialogOverlay.RemoveScroll"),YU=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(hp,n);return a.jsx(If,{as:KU,allowPinchZoom:!0,shards:[o.contentRef],children:a.jsx(et.div,{"data-state":W1(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Hl="DialogContent",mN=m.forwardRef((e,t)=>{const n=dN(Hl,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,l=Rs(Hl,e.__scopeDialog);return a.jsx(_r,{present:r||l.open,children:l.modal?a.jsx(WU,{...o,ref:t}):a.jsx(QU,{...o,ref:t})})});mN.displayName=Hl;var WU=m.forwardRef((e,t)=>{const n=Rs(Hl,e.__scopeDialog),r=m.useRef(null),o=dt(t,n.contentRef,r);return m.useEffect(()=>{const l=r.current;if(l)return ig(l)},[]),a.jsx(pN,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,l=>{var c;l.preventDefault(),(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,l=>{const c=l.detail.originalEvent,d=c.button===0&&c.ctrlKey===!0;(c.button===2||d)&&l.preventDefault()}),onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault())})}),QU=m.forwardRef((e,t)=>{const n=Rs(Hl,e.__scopeDialog),r=m.useRef(!1),o=m.useRef(!1);return a.jsx(pN,{...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,o.current=!1},onInteractOutside:l=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=l.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),pN=m.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,...c}=e,d=Rs(Hl,n),f=m.useRef(null),h=dt(t,f);return sg(),a.jsxs(a.Fragment,{children:[a.jsx(Mf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:a.jsx(ec,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":W1(d.open),...c,ref:h,onDismiss:()=>d.onOpenChange(!1)})}),a.jsxs(a.Fragment,{children:[a.jsx(JU,{titleId:d.titleId}),a.jsx(tF,{contentRef:f,descriptionId:d.descriptionId})]})]})}),Y1="DialogTitle",gN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(Y1,n);return a.jsx(et.h2,{id:o.titleId,...r,ref:t})});gN.displayName=Y1;var yN="DialogDescription",vN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(yN,n);return a.jsx(et.p,{id:o.descriptionId,...r,ref:t})});vN.displayName=yN;var xN="DialogClose",bN=m.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Rs(xN,n);return a.jsx(et.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});bN.displayName=xN;function W1(e){return e?"open":"closed"}var SN="DialogTitleWarning",[XU,CN]=CP(SN,{contentName:Hl,titleName:Y1,docsSlug:"dialog"}),JU=({titleId:e})=>{const t=CN(SN),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 m.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},eF="DialogDescriptionWarning",tF=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${CN(eF).contentName}}.`;return m.useEffect(()=>{var l;const o=(l=e.current)==null?void 0:l.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},cg=lN,nF=uN,ug=fN,dg=hN,fg=mN,Q1=gN,X1=vN,hg=bN;function $o({...e}){return a.jsx(cg,{"data-slot":"sheet",...e})}function rF({...e}){return a.jsx(ug,{"data-slot":"sheet-portal",...e})}function aF({className:e,...t}){return a.jsx(dg,{"data-slot":"sheet-overlay",className:ne("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 Bo({className:e,children:t,side:n="right",...r}){return a.jsxs(rF,{children:[a.jsx(aF,{}),a.jsxs(fg,{"data-slot":"sheet-content",className:ne("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-0 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full min-w-[100%] border-l sm:max-w-sm sm:min-w-[600px]",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full min-w-[100%] border-r sm:max-w-sm sm:min-w-[600px]",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",e),...r,children:[t,a.jsxs(hg,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[a.jsx(xu,{className:"size-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Go({className:e,...t}){return a.jsx("div",{"data-slot":"sheet-header",className:ne("flex flex-col gap-1 border-b p-4",e),...t})}function qo({className:e,...t}){return a.jsx(Q1,{"data-slot":"sheet-title",className:ne("text-foreground font-semibold",e),...t})}function Xi({className:e,...t}){return a.jsx(X1,{"data-slot":"sheet-description",className:ne("text-muted-foreground text-sm",e),...t})}function hs({className:e,...t}){return a.jsx("div",{"data-slot":"skeleton",className:ne("bg-accent animate-pulse rounded-md",e),...t})}const sF=["top","right","bottom","left"],Bi=Math.min,Na=Math.max,mp=Math.round,_m=Math.floor,Bs=e=>({x:e,y:e}),oF={left:"right",right:"left",bottom:"top",top:"bottom"},iF={start:"end",end:"start"};function A0(e,t,n){return Na(e,Bi(t,n))}function Fo(e,t){return typeof e=="function"?e(t):e}function Vo(e){return e.split("-")[0]}function Mu(e){return e.split("-")[1]}function J1(e){return e==="x"?"y":"x"}function eb(e){return e==="y"?"height":"width"}const lF=new Set(["top","bottom"]);function Vs(e){return lF.has(Vo(e))?"y":"x"}function tb(e){return J1(Vs(e))}function cF(e,t,n){n===void 0&&(n=!1);const r=Mu(e),o=tb(e),l=eb(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=pp(c)),[c,pp(c)]}function uF(e){const t=pp(e);return[D0(e),t,D0(t)]}function D0(e){return e.replace(/start|end/g,t=>iF[t])}const zR=["left","right"],HR=["right","left"],dF=["top","bottom"],fF=["bottom","top"];function hF(e,t,n){switch(e){case"top":case"bottom":return n?t?HR:zR:t?zR:HR;case"left":case"right":return t?dF:fF;default:return[]}}function mF(e,t,n,r){const o=Mu(e);let l=hF(Vo(e),n==="start",r);return o&&(l=l.map(c=>c+"-"+o),t&&(l=l.concat(l.map(D0)))),l}function pp(e){return e.replace(/left|right|bottom|top/g,t=>oF[t])}function pF(e){return{top:0,right:0,bottom:0,left:0,...e}}function EN(e){return typeof e!="number"?pF(e):{top:e,right:e,bottom:e,left:e}}function gp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function $R(e,t,n){let{reference:r,floating:o}=e;const l=Vs(t),c=tb(t),d=eb(c),f=Vo(t),h=l==="y",g=r.x+r.width/2-o.width/2,y=r.y+r.height/2-o.height/2,v=r[d]/2-o[d]/2;let b;switch(f){case"top":b={x:g,y:r.y-o.height};break;case"bottom":b={x:g,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y};break;case"left":b={x:r.x-o.width,y};break;default:b={x:r.x,y:r.y}}switch(Mu(t)){case"start":b[c]-=v*(n&&h?-1:1);break;case"end":b[c]+=v*(n&&h?-1:1);break}return b}const gF=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let h=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:g,y}=$R(h,r,f),v=r,b={},E=0;for(let S=0;S<d.length;S++){const{name:C,fn:R}=d[S],{x:j,y:_,data:D,reset:A}=await R({x:g,y,initialPlacement:r,placement:v,strategy:o,middlewareData:b,rects:h,platform:c,elements:{reference:e,floating:t}});g=j??g,y=_??y,b={...b,[C]:{...b[C],...D}},A&&E<=50&&(E++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(h=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):A.rects),{x:g,y}=$R(h,v,f)),S=-1)}return{x:g,y,placement:v,strategy:o,middlewareData:b}};async function pf(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:h="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:v=!1,padding:b=0}=Fo(t,e),E=EN(b),C=d[v?y==="floating"?"reference":"floating":y],R=gp(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:h,rootBoundary:g,strategy:f})),j=y==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),D=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=gp(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:j,offsetParent:_,strategy:f}):j);return{top:(R.top-A.top+E.top)/D.y,bottom:(A.bottom-R.bottom+E.bottom)/D.y,left:(R.left-A.left+E.left)/D.x,right:(A.right-R.right+E.right)/D.x}}const yF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:h,padding:g=0}=Fo(e,t)||{};if(h==null)return{};const y=EN(g),v={x:n,y:r},b=tb(o),E=eb(b),S=await c.getDimensions(h),C=b==="y",R=C?"top":"left",j=C?"bottom":"right",_=C?"clientHeight":"clientWidth",D=l.reference[E]+l.reference[b]-v[b]-l.floating[E],A=v[b]-l.reference[b],O=await(c.getOffsetParent==null?void 0:c.getOffsetParent(h));let T=O?O[_]:0;(!T||!await(c.isElement==null?void 0:c.isElement(O)))&&(T=d.floating[_]||l.floating[E]);const M=D/2-A/2,V=T/2-S[E]/2-1,Z=Bi(y[R],V),K=Bi(y[j],V),Y=Z,G=T-S[E]-K,U=T/2-S[E]/2+M,H=A0(Y,U,G),k=!f.arrow&&Mu(o)!=null&&U!==H&&l.reference[E]/2-(U<Y?Z:K)-S[E]/2<0,$=k?U<Y?U-Y:U-G:0;return{[b]:v[b]+$,data:{[b]:H,centerOffset:U-H-$,...k&&{alignmentOffset:$}},reset:k}}}),vF=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,rects:c,initialPlacement:d,platform:f,elements:h}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:S=!0,...C}=Fo(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const R=Vo(o),j=Vs(d),_=Vo(d)===d,D=await(f.isRTL==null?void 0:f.isRTL(h.floating)),A=v||(_||!S?[pp(d)]:uF(d)),O=E!=="none";!v&&O&&A.push(...mF(d,S,E,D));const T=[d,...A],M=await pf(t,C),V=[];let Z=((r=l.flip)==null?void 0:r.overflows)||[];if(g&&V.push(M[R]),y){const U=cF(o,c,D);V.push(M[U[0]],M[U[1]])}if(Z=[...Z,{placement:o,overflows:V}],!V.every(U=>U<=0)){var K,Y;const U=(((K=l.flip)==null?void 0:K.index)||0)+1,H=T[U];if(H&&(!(y==="alignment"?j!==Vs(H):!1)||Z.every(q=>Vs(q.placement)===j?q.overflows[0]>0:!0)))return{data:{index:U,overflows:Z},reset:{placement:H}};let k=(Y=Z.filter($=>$.overflows[0]<=0).sort(($,q)=>$.overflows[1]-q.overflows[1])[0])==null?void 0:Y.placement;if(!k)switch(b){case"bestFit":{var G;const $=(G=Z.filter(q=>{if(O){const ie=Vs(q.placement);return ie===j||ie==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ie=>ie>0).reduce((ie,be)=>ie+be,0)]).sort((q,ie)=>q[1]-ie[1])[0])==null?void 0:G[0];$&&(k=$);break}case"initialPlacement":k=d;break}if(o!==k)return{reset:{placement:k}}}return{}}}};function BR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function GR(e){return sF.some(t=>e[t]>=0)}const xF=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Fo(e,t);switch(r){case"referenceHidden":{const l=await pf(t,{...o,elementContext:"reference"}),c=BR(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:GR(c)}}}case"escaped":{const l=await pf(t,{...o,altBoundary:!0}),c=BR(l,n.floating);return{data:{escapedOffsets:c,escaped:GR(c)}}}default:return{}}}}},wN=new Set(["left","top"]);async function bF(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Vo(n),d=Mu(n),f=Vs(n)==="y",h=wN.has(c)?-1:1,g=l&&f?-1:1,y=Fo(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:E}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return d&&typeof E=="number"&&(b=d==="end"?E*-1:E),f?{x:b*g,y:v*h}:{x:v*h,y:b*g}}const SF=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:c,middlewareData:d}=t,f=await bF(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:c}}}}},CF=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:R,y:j}=C;return{x:R,y:j}}},...f}=Fo(e,t),h={x:n,y:r},g=await pf(t,f),y=Vs(Vo(o)),v=J1(y);let b=h[v],E=h[y];if(l){const C=v==="y"?"top":"left",R=v==="y"?"bottom":"right",j=b+g[C],_=b-g[R];b=A0(j,b,_)}if(c){const C=y==="y"?"top":"left",R=y==="y"?"bottom":"right",j=E+g[C],_=E-g[R];E=A0(j,E,_)}const S=d.fn({...t,[v]:b,[y]:E});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[v]:l,[y]:c}}}}}},EF=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:h=!0}=Fo(e,t),g={x:n,y:r},y=Vs(o),v=J1(y);let b=g[v],E=g[y];const S=Fo(d,t),C=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(f){const _=v==="y"?"height":"width",D=l.reference[v]-l.floating[_]+C.mainAxis,A=l.reference[v]+l.reference[_]-C.mainAxis;b<D?b=D:b>A&&(b=A)}if(h){var R,j;const _=v==="y"?"width":"height",D=wN.has(Vo(o)),A=l.reference[y]-l.floating[_]+(D&&((R=c.offset)==null?void 0:R[y])||0)+(D?0:C.crossAxis),O=l.reference[y]+l.reference[_]+(D?0:((j=c.offset)==null?void 0:j[y])||0)-(D?C.crossAxis:0);E<A?E=A:E>O&&(E=O)}return{[v]:b,[y]:E}}}},wF=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...h}=Fo(e,t),g=await pf(t,h),y=Vo(o),v=Mu(o),b=Vs(o)==="y",{width:E,height:S}=l.floating;let C,R;y==="top"||y==="bottom"?(C=y,R=v===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(R=y,C=v==="end"?"top":"bottom");const j=S-g.top-g.bottom,_=E-g.left-g.right,D=Bi(S-g[C],j),A=Bi(E-g[R],_),O=!t.middlewareData.shift;let T=D,M=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=_),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=j),O&&!v){const Z=Na(g.left,0),K=Na(g.right,0),Y=Na(g.top,0),G=Na(g.bottom,0);b?M=E-2*(Z!==0||K!==0?Z+K:Na(g.left,g.right)):T=S-2*(Y!==0||G!==0?Y+G:Na(g.top,g.bottom))}await f({...t,availableWidth:M,availableHeight:T});const V=await c.getDimensions(d.floating);return E!==V.width||S!==V.height?{reset:{rects:!0}}:{}}}};function mg(){return typeof window<"u"}function Iu(e){return RN(e)?(e.nodeName||"").toLowerCase():"#document"}function Da(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Js(e){var t;return(t=(RN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function RN(e){return mg()?e instanceof Node||e instanceof Da(e).Node:!1}function Ss(e){return mg()?e instanceof Element||e instanceof Da(e).Element:!1}function Ks(e){return mg()?e instanceof HTMLElement||e instanceof Da(e).HTMLElement:!1}function qR(e){return!mg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Da(e).ShadowRoot}const RF=new Set(["inline","contents"]);function kf(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Cs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!RF.has(o)}const jF=new Set(["table","td","th"]);function TF(e){return jF.has(Iu(e))}const _F=[":popover-open",":modal"];function pg(e){return _F.some(t=>{try{return e.matches(t)}catch{return!1}})}const NF=["transform","translate","scale","rotate","perspective"],AF=["transform","translate","scale","rotate","perspective","filter"],DF=["paint","layout","strict","content"];function nb(e){const t=rb(),n=Ss(e)?Cs(e):e;return NF.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)||AF.some(r=>(n.willChange||"").includes(r))||DF.some(r=>(n.contain||"").includes(r))}function OF(e){let t=Gi(e);for(;Ks(t)&&!bu(t);){if(nb(t))return t;if(pg(t))return null;t=Gi(t)}return null}function rb(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const MF=new Set(["html","body","#document"]);function bu(e){return MF.has(Iu(e))}function Cs(e){return Da(e).getComputedStyle(e)}function gg(e){return Ss(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Gi(e){if(Iu(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qR(e)&&e.host||Js(e);return qR(t)?t.host:t}function jN(e){const t=Gi(e);return bu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ks(t)&&kf(t)?t:jN(t)}function gf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=jN(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),c=Da(o);if(l){const d=O0(c);return t.concat(c,c.visualViewport||[],kf(o)?o:[],d&&n?gf(d):[])}return t.concat(o,gf(o,[],n))}function O0(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function TN(e){const t=Cs(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ks(e),l=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=mp(n)!==l||mp(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function ab(e){return Ss(e)?e:e.contextElement}function fu(e){const t=ab(e);if(!Ks(t))return Bs(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=TN(t);let c=(l?mp(n.width):n.width)/r,d=(l?mp(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const IF=Bs(0);function _N(e){const t=Da(e);return!rb()||!t.visualViewport?IF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function kF(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Da(e)?!1:t}function $l(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=ab(e);let c=Bs(1);t&&(r?Ss(r)&&(c=fu(r)):c=fu(e));const d=kF(l,n,r)?_N(l):Bs(0);let f=(o.left+d.x)/c.x,h=(o.top+d.y)/c.y,g=o.width/c.x,y=o.height/c.y;if(l){const v=Da(l),b=r&&Ss(r)?Da(r):r;let E=v,S=O0(E);for(;S&&r&&b!==E;){const C=fu(S),R=S.getBoundingClientRect(),j=Cs(S),_=R.left+(S.clientLeft+parseFloat(j.paddingLeft))*C.x,D=R.top+(S.clientTop+parseFloat(j.paddingTop))*C.y;f*=C.x,h*=C.y,g*=C.x,y*=C.y,f+=_,h+=D,E=Da(S),S=O0(E)}}return gp({width:g,height:y,x:f,y:h})}function yg(e,t){const n=gg(e).scrollLeft;return t?t.left+n:$l(Js(e)).left+n}function NN(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-yg(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function LF(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",c=Js(r),d=t?pg(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},h=Bs(1);const g=Bs(0),y=Ks(r);if((y||!y&&!l)&&((Iu(r)!=="body"||kf(c))&&(f=gg(r)),Ks(r))){const b=$l(r);h=fu(r),g.x=b.x+r.clientLeft,g.y=b.y+r.clientTop}const v=c&&!y&&!l?NN(c,f):Bs(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-f.scrollLeft*h.x+g.x+v.x,y:n.y*h.y-f.scrollTop*h.y+g.y+v.y}}function PF(e){return Array.from(e.getClientRects())}function UF(e){const t=Js(e),n=gg(e),r=e.ownerDocument.body,o=Na(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=Na(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+yg(e);const d=-n.scrollTop;return Cs(r).direction==="rtl"&&(c+=Na(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:c,y:d}}const ZR=25;function FF(e,t){const n=Da(e),r=Js(e),o=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(o){l=o.width,c=o.height;const g=rb();(!g||g&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const h=yg(r);if(h<=0){const g=r.ownerDocument,y=g.body,v=getComputedStyle(y),b=g.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,E=Math.abs(r.clientWidth-y.clientWidth-b);E<=ZR&&(l-=E)}else h<=ZR&&(l+=h);return{width:l,height:c,x:d,y:f}}const VF=new Set(["absolute","fixed"]);function zF(e,t){const n=$l(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=Ks(e)?fu(e):Bs(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=o*l.x,h=r*l.y;return{width:c,height:d,x:f,y:h}}function KR(e,t,n){let r;if(t==="viewport")r=FF(e,n);else if(t==="document")r=UF(Js(e));else if(Ss(t))r=zF(t,n);else{const o=_N(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return gp(r)}function AN(e,t){const n=Gi(e);return n===t||!Ss(n)||bu(n)?!1:Cs(n).position==="fixed"||AN(n,t)}function HF(e,t){const n=t.get(e);if(n)return n;let r=gf(e,[],!1).filter(d=>Ss(d)&&Iu(d)!=="body"),o=null;const l=Cs(e).position==="fixed";let c=l?Gi(e):e;for(;Ss(c)&&!bu(c);){const d=Cs(c),f=nb(c);!f&&d.position==="fixed"&&(o=null),(l?!f&&!o:!f&&d.position==="static"&&!!o&&VF.has(o.position)||kf(c)&&!f&&AN(e,c))?r=r.filter(g=>g!==c):o=d,c=Gi(c)}return t.set(e,r),r}function $F(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?pg(t)?[]:HF(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((h,g)=>{const y=KR(t,g,o);return h.top=Na(y.top,h.top),h.right=Bi(y.right,h.right),h.bottom=Bi(y.bottom,h.bottom),h.left=Na(y.left,h.left),h},KR(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function BF(e){const{width:t,height:n}=TN(e);return{width:t,height:n}}function GF(e,t,n){const r=Ks(t),o=Js(t),l=n==="fixed",c=$l(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=Bs(0);function h(){f.x=yg(o)}if(r||!r&&!l)if((Iu(t)!=="body"||kf(o))&&(d=gg(t)),r){const b=$l(t,!0,l,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else o&&h();l&&!r&&o&&h();const g=o&&!r&&!l?NN(o,d):Bs(0),y=c.left+d.scrollLeft-f.x-g.x,v=c.top+d.scrollTop-f.y-g.y;return{x:y,y:v,width:c.width,height:c.height}}function Ix(e){return Cs(e).position==="static"}function YR(e,t){if(!Ks(e)||Cs(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Js(e)===n&&(n=n.ownerDocument.body),n}function DN(e,t){const n=Da(e);if(pg(e))return n;if(!Ks(e)){let o=Gi(e);for(;o&&!bu(o);){if(Ss(o)&&!Ix(o))return o;o=Gi(o)}return n}let r=YR(e,t);for(;r&&TF(r)&&Ix(r);)r=YR(r,t);return r&&bu(r)&&Ix(r)&&!nb(r)?n:r||OF(e)||n}const qF=async function(e){const t=this.getOffsetParent||DN,n=this.getDimensions,r=await n(e.floating);return{reference:GF(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ZF(e){return Cs(e).direction==="rtl"}const KF={convertOffsetParentRelativeRectToViewportRelativeRect:LF,getDocumentElement:Js,getClippingRect:$F,getOffsetParent:DN,getElementRects:qF,getClientRects:PF,getDimensions:BF,getScale:fu,isElement:Ss,isRTL:ZF};function ON(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function YF(e,t){let n=null,r;const o=Js(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 h=e.getBoundingClientRect(),{left:g,top:y,width:v,height:b}=h;if(d||t(),!v||!b)return;const E=_m(y),S=_m(o.clientWidth-(g+v)),C=_m(o.clientHeight-(y+b)),R=_m(g),_={rootMargin:-E+"px "+-S+"px "+-C+"px "+-R+"px",threshold:Na(0,Bi(1,f))||1};let D=!0;function A(O){const T=O[0].intersectionRatio;if(T!==f){if(!D)return c();T?c(!1,T):r=setTimeout(()=>{c(!1,1e-7)},1e3)}T===1&&!ON(h,e.getBoundingClientRect())&&c(),D=!1}try{n=new IntersectionObserver(A,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(A,_)}n.observe(e)}return c(!0),l}function WF(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,h=ab(e),g=o||l?[...h?gf(h):[],...gf(t)]:[];g.forEach(R=>{o&&R.addEventListener("scroll",n,{passive:!0}),l&&R.addEventListener("resize",n)});const y=h&&d?YF(h,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(R=>{let[j]=R;j&&j.target===h&&b&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var _;(_=b)==null||_.observe(t)})),n()}),h&&!f&&b.observe(h),b.observe(t));let E,S=f?$l(e):null;f&&C();function C(){const R=$l(e);S&&!ON(S,R)&&n(),S=R,E=requestAnimationFrame(C)}return n(),()=>{var R;g.forEach(j=>{o&&j.removeEventListener("scroll",n),l&&j.removeEventListener("resize",n)}),y==null||y(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(E)}}const QF=SF,XF=CF,JF=vF,eV=wF,tV=xF,WR=yF,nV=EF,rV=(e,t,n)=>{const r=new Map,o={platform:KF,...n},l={...o.platform,_c:r};return gF(e,t,{...o,platform:l})};var aV=typeof document<"u",sV=function(){},Xm=aV?m.useLayoutEffect:sV;function yp(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,o;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(!yp(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!yp(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function MN(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function QR(e,t){const n=MN(e);return Math.round(t*n)/n}function kx(e){const t=m.useRef(e);return Xm(()=>{t.current=e}),t}function oV(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:h}=e,[g,y]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=m.useState(r);yp(v,r)||b(r);const[E,S]=m.useState(null),[C,R]=m.useState(null),j=m.useCallback(q=>{q!==O.current&&(O.current=q,S(q))},[]),_=m.useCallback(q=>{q!==T.current&&(T.current=q,R(q))},[]),D=l||E,A=c||C,O=m.useRef(null),T=m.useRef(null),M=m.useRef(g),V=f!=null,Z=kx(f),K=kx(o),Y=kx(h),G=m.useCallback(()=>{if(!O.current||!T.current)return;const q={placement:t,strategy:n,middleware:v};K.current&&(q.platform=K.current),rV(O.current,T.current,q).then(ie=>{const be={...ie,isPositioned:Y.current!==!1};U.current&&!yp(M.current,be)&&(M.current=be,ys.flushSync(()=>{y(be)}))})},[v,t,n,K,Y]);Xm(()=>{h===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,y(q=>({...q,isPositioned:!1})))},[h]);const U=m.useRef(!1);Xm(()=>(U.current=!0,()=>{U.current=!1}),[]),Xm(()=>{if(D&&(O.current=D),A&&(T.current=A),D&&A){if(Z.current)return Z.current(D,A,G);G()}},[D,A,G,Z,V]);const H=m.useMemo(()=>({reference:O,floating:T,setReference:j,setFloating:_}),[j,_]),k=m.useMemo(()=>({reference:D,floating:A}),[D,A]),$=m.useMemo(()=>{const q={position:n,left:0,top:0};if(!k.floating)return q;const ie=QR(k.floating,g.x),be=QR(k.floating,g.y);return d?{...q,transform:"translate("+ie+"px, "+be+"px)",...MN(k.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:be}},[n,d,k.floating,g.x,g.y]);return m.useMemo(()=>({...g,update:G,refs:H,elements:k,floatingStyles:$}),[g,G,H,k,$])}const iV=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?WR({element:r.current,padding:o}).fn(n):{}:r?WR({element:r,padding:o}).fn(n):{}}}},lV=(e,t)=>({...QF(e),options:[e,t]}),cV=(e,t)=>({...XF(e),options:[e,t]}),uV=(e,t)=>({...nV(e),options:[e,t]}),dV=(e,t)=>({...JF(e),options:[e,t]}),fV=(e,t)=>({...eV(e),options:[e,t]}),hV=(e,t)=>({...tV(e),options:[e,t]}),mV=(e,t)=>({...iV(e),options:[e,t]});var pV="Arrow",IN=m.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...l}=e;return a.jsx(et.svg,{...l,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:a.jsx("polygon",{points:"0,0 30,0 15,10"})})});IN.displayName=pV;var gV=IN;function sb(e){const[t,n]=m.useState(void 0);return jr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const l=o[0];let c,d;if("borderBoxSize"in l){const f=l.borderBoxSize,h=Array.isArray(f)?f[0]:f;c=h.inlineSize,d=h.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 ob="Popper",[kN,eo]=cr(ob),[yV,LN]=kN(ob),PN=e=>{const{__scopePopper:t,children:n}=e,[r,o]=m.useState(null);return a.jsx(yV,{scope:t,anchor:r,onAnchorChange:o,children:n})};PN.displayName=ob;var UN="PopperAnchor",FN=m.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,l=LN(UN,n),c=m.useRef(null),d=dt(t,c),f=m.useRef(null);return m.useEffect(()=>{const h=f.current;f.current=(r==null?void 0:r.current)||c.current,h!==f.current&&l.onAnchorChange(f.current)}),r?null:a.jsx(et.div,{...o,ref:d})});FN.displayName=UN;var ib="PopperContent",[vV,xV]=kN(ib),VN=m.forwardRef((e,t)=>{var le,Ae,we,Ne,Be,Qe;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:l="center",alignOffset:c=0,arrowPadding:d=0,avoidCollisions:f=!0,collisionBoundary:h=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:E,...S}=e,C=LN(ib,n),[R,j]=m.useState(null),_=dt(t,qt=>j(qt)),[D,A]=m.useState(null),O=sb(D),T=(O==null?void 0:O.width)??0,M=(O==null?void 0:O.height)??0,V=r+(l!=="center"?"-"+l:""),Z=typeof g=="number"?g:{top:0,right:0,bottom:0,left:0,...g},K=Array.isArray(h)?h:[h],Y=K.length>0,G={padding:Z,boundary:K.filter(SV),altBoundary:Y},{refs:U,floatingStyles:H,placement:k,isPositioned:$,middlewareData:q}=oV({strategy:"fixed",placement:V,whileElementsMounted:(...qt)=>WF(...qt,{animationFrame:b==="always"}),elements:{reference:C.anchor},middleware:[lV({mainAxis:o+M,alignmentAxis:c}),f&&cV({mainAxis:!0,crossAxis:!1,limiter:y==="partial"?uV():void 0,...G}),f&&dV({...G}),fV({...G,apply:({elements:qt,rects:Dt,availableWidth:Zt,availableHeight:jn})=>{const{width:Nr,height:va}=Dt.reference,Ve=qt.floating.style;Ve.setProperty("--radix-popper-available-width",`${Zt}px`),Ve.setProperty("--radix-popper-available-height",`${jn}px`),Ve.setProperty("--radix-popper-anchor-width",`${Nr}px`),Ve.setProperty("--radix-popper-anchor-height",`${va}px`)}}),D&&mV({element:D,padding:d}),CV({arrowWidth:T,arrowHeight:M}),v&&hV({strategy:"referenceHidden",...G})]}),[ie,be]=$N(k),L=bs(E);jr(()=>{$&&(L==null||L())},[$,L]);const P=(le=q.arrow)==null?void 0:le.x,W=(Ae=q.arrow)==null?void 0:Ae.y,te=((we=q.arrow)==null?void 0:we.centerOffset)!==0,[ue,ve]=m.useState();return jr(()=>{R&&ve(window.getComputedStyle(R).zIndex)},[R]),a.jsx("div",{ref:U.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:$?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ue,"--radix-popper-transform-origin":[(Ne=q.transformOrigin)==null?void 0:Ne.x,(Be=q.transformOrigin)==null?void 0:Be.y].join(" "),...((Qe=q.hide)==null?void 0:Qe.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:a.jsx(vV,{scope:n,placedSide:ie,onArrowChange:A,arrowX:P,arrowY:W,shouldHideArrow:te,children:a.jsx(et.div,{"data-side":ie,"data-align":be,...S,ref:_,style:{...S.style,animation:$?void 0:"none"}})})})});VN.displayName=ib;var zN="PopperArrow",bV={top:"bottom",right:"left",bottom:"top",left:"right"},HN=m.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,l=xV(zN,r),c=bV[l.placedSide];return a.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:a.jsx(gV,{...o,ref:n,style:{...o.style,display:"block"}})})});HN.displayName=zN;function SV(e){return e!==null}var CV=e=>({name:"transformOrigin",options:e,fn(t){var C,R,j;const{placement:n,rects:r,middlewareData:o}=t,c=((C=o.arrow)==null?void 0:C.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,g]=$N(n),y={start:"0%",center:"50%",end:"100%"}[g],v=(((R=o.arrow)==null?void 0:R.x)??0)+d/2,b=(((j=o.arrow)==null?void 0:j.y)??0)+f/2;let E="",S="";return h==="bottom"?(E=c?y:`${v}px`,S=`${-f}px`):h==="top"?(E=c?y:`${v}px`,S=`${r.floating.height+f}px`):h==="right"?(E=`${-f}px`,S=c?y:`${b}px`):h==="left"&&(E=`${r.floating.width+f}px`,S=c?y:`${b}px`),{data:{x:E,y:S}}}});function $N(e){const[t,n="center"]=e.split("-");return[t,n]}var ku=PN,Lu=FN,Lf=VN,Pf=HN,EV=Symbol("radix.slottable");function wV(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=EV,t}var BN=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"}),RV="VisuallyHidden",GN=m.forwardRef((e,t)=>a.jsx(et.span,{...e,ref:t,style:{...BN,...e.style}}));GN.displayName=RV;var jV=GN,[vg]=cr("Tooltip",[eo]),xg=eo(),qN="TooltipProvider",TV=700,M0="tooltip.open",[_V,lb]=vg(qN),ZN=e=>{const{__scopeTooltip:t,delayDuration:n=TV,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:l}=e,c=m.useRef(!0),d=m.useRef(!1),f=m.useRef(0);return m.useEffect(()=>{const h=f.current;return()=>window.clearTimeout(h)},[]),a.jsx(_V,{scope:t,isOpenDelayedRef:c,delayDuration:n,onOpen:m.useCallback(()=>{window.clearTimeout(f.current),c.current=!1},[]),onClose:m.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>c.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:m.useCallback(h=>{d.current=h},[]),disableHoverableContent:o,children:l})};ZN.displayName=qN;var yf="Tooltip",[NV,Uf]=vg(yf),KN=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:l,disableHoverableContent:c,delayDuration:d}=e,f=lb(yf,e.__scopeTooltip),h=xg(t),[g,y]=m.useState(null),v=Ln(),b=m.useRef(0),E=c??f.disableHoverableContent,S=d??f.delayDuration,C=m.useRef(!1),[R,j]=Gr({prop:r,defaultProp:o??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(M0))):f.onClose(),l==null||l(T)},caller:yf}),_=m.useMemo(()=>R?C.current?"delayed-open":"instant-open":"closed",[R]),D=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,C.current=!1,j(!0)},[j]),A=m.useCallback(()=>{window.clearTimeout(b.current),b.current=0,j(!1)},[j]),O=m.useCallback(()=>{window.clearTimeout(b.current),b.current=window.setTimeout(()=>{C.current=!0,j(!0),b.current=0},S)},[S,j]);return m.useEffect(()=>()=>{b.current&&(window.clearTimeout(b.current),b.current=0)},[]),a.jsx(ku,{...h,children:a.jsx(NV,{scope:t,contentId:v,open:R,stateAttribute:_,trigger:g,onTriggerChange:y,onTriggerEnter:m.useCallback(()=>{f.isOpenDelayedRef.current?O():D()},[f.isOpenDelayedRef,O,D]),onTriggerLeave:m.useCallback(()=>{E?A():(window.clearTimeout(b.current),b.current=0)},[A,E]),onOpen:D,onClose:A,disableHoverableContent:E,children:n})})};KN.displayName=yf;var I0="TooltipTrigger",YN=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Uf(I0,n),l=lb(I0,n),c=xg(n),d=m.useRef(null),f=dt(t,d,o.onTriggerChange),h=m.useRef(!1),g=m.useRef(!1),y=m.useCallback(()=>h.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener("pointerup",y),[y]),a.jsx(Lu,{asChild:!0,...c,children:a.jsx(et.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:f,onPointerMove:Te(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!l.isPointerInTransitRef.current&&(o.onTriggerEnter(),g.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{o.onTriggerLeave(),g.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{o.open&&o.onClose(),h.current=!0,document.addEventListener("pointerup",y,{once:!0})}),onFocus:Te(e.onFocus,()=>{h.current||o.onOpen()}),onBlur:Te(e.onBlur,o.onClose),onClick:Te(e.onClick,o.onClose)})})});YN.displayName=I0;var cb="TooltipPortal",[AV,DV]=vg(cb,{forceMount:void 0}),WN=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,l=Uf(cb,t);return a.jsx(AV,{scope:t,forceMount:n,children:a.jsx(_r,{present:n||l.open,children:a.jsx(tc,{asChild:!0,container:o,children:r})})})};WN.displayName=cb;var Su="TooltipContent",QN=m.forwardRef((e,t)=>{const n=DV(Su,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...l}=e,c=Uf(Su,e.__scopeTooltip);return a.jsx(_r,{present:r||c.open,children:c.disableHoverableContent?a.jsx(XN,{side:o,...l,ref:t}):a.jsx(OV,{side:o,...l,ref:t})})}),OV=m.forwardRef((e,t)=>{const n=Uf(Su,e.__scopeTooltip),r=lb(Su,e.__scopeTooltip),o=m.useRef(null),l=dt(t,o),[c,d]=m.useState(null),{trigger:f,onClose:h}=n,g=o.current,{onPointerInTransitChange:y}=r,v=m.useCallback(()=>{d(null),y(!1)},[y]),b=m.useCallback((E,S)=>{const C=E.currentTarget,R={x:E.clientX,y:E.clientY},j=LV(R,C.getBoundingClientRect()),_=PV(R,j),D=UV(S.getBoundingClientRect()),A=VV([..._,...D]);d(A),y(!0)},[y]);return m.useEffect(()=>()=>v(),[v]),m.useEffect(()=>{if(f&&g){const E=C=>b(C,g),S=C=>b(C,f);return f.addEventListener("pointerleave",E),g.addEventListener("pointerleave",S),()=>{f.removeEventListener("pointerleave",E),g.removeEventListener("pointerleave",S)}}},[f,g,b,v]),m.useEffect(()=>{if(c){const E=S=>{const C=S.target,R={x:S.clientX,y:S.clientY},j=(f==null?void 0:f.contains(C))||(g==null?void 0:g.contains(C)),_=!FV(R,c);j?v():_&&(v(),h())};return document.addEventListener("pointermove",E),()=>document.removeEventListener("pointermove",E)}},[f,g,c,h,v]),a.jsx(XN,{...e,ref:l})}),[MV,IV]=vg(yf,{isInside:!1}),kV=wV("TooltipContent"),XN=m.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:l,onPointerDownOutside:c,...d}=e,f=Uf(Su,n),h=xg(n),{onClose:g}=f;return m.useEffect(()=>(document.addEventListener(M0,g),()=>document.removeEventListener(M0,g)),[g]),m.useEffect(()=>{if(f.trigger){const y=v=>{const b=v.target;b!=null&&b.contains(f.trigger)&&g()};return window.addEventListener("scroll",y,{capture:!0}),()=>window.removeEventListener("scroll",y,{capture:!0})}},[f.trigger,g]),a.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:y=>y.preventDefault(),onDismiss:g,children:a.jsxs(Lf,{"data-state":f.stateAttribute,...h,...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:[a.jsx(kV,{children:r}),a.jsx(MV,{scope:n,isInside:!0,children:a.jsx(jV,{id:f.contentId,role:"tooltip",children:o||r})})]})})});QN.displayName=Su;var JN="TooltipArrow",e4=m.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=xg(n);return IV(JN,n).isInside?null:a.jsx(Pf,{...o,...r,ref:t})});e4.displayName=JN;function LV(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,r,o,l)){case l:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function PV(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 UV(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function FV(e,t){const{x:n,y:r}=e;let o=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],h=d.x,g=d.y,y=f.x,v=f.y;g>r!=v>r&&n<(y-h)*(r-g)/(v-g)+h&&(o=!o)}return o}function VV(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),zV(t)}function zV(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const l=t[t.length-1],c=t[t.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const l=n[n.length-1],c=n[n.length-2];if((l.x-c.x)*(o.y-c.y)>=(l.y-c.y)*(o.x-c.x))n.pop();else break}n.push(o)}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 HV=ZN,$V=KN,BV=YN,GV=WN,qV=QN,ZV=e4;function vs({delayDuration:e=0,...t}){return a.jsx(HV,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function bt({...e}){return a.jsx(vs,{children:a.jsx($V,{"data-slot":"tooltip",...e})})}function St({...e}){return a.jsx(BV,{"data-slot":"tooltip-trigger",...e})}function Ct({className:e,sideOffset:t=0,children:n,...r}){return a.jsx(GV,{children:a.jsxs(qV,{"data-slot":"tooltip-content",sideOffset:t,className:ne("animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-[--radix-tooltip-content-transform-origin] rounded-md bg-black px-3 py-1.5 text-xs text-balance text-white dark:bg-white dark:text-black",e),...r,children:[n,a.jsx(ZV,{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 KV="sidebar_state",YV=3600*24*7,WV="16rem",QV="18rem",XV="3rem",JV="b",t4=m.createContext(null);function Ff(){const e=m.useContext(t4);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function ez({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:l,...c}){const d=TL(),[f,h]=m.useState(!1),[g,y]=m.useState(e),v=t??g,b=m.useCallback(R=>{const j=typeof R=="function"?R(v):R;n?n(j):y(j),document.cookie=`${KV}=${j}; path=/; max-age=${YV}`},[n,v]),E=m.useCallback(()=>d?h(R=>!R):b(R=>!R),[d,b,h]);m.useEffect(()=>{const R=j=>{j.key===JV&&(j.metaKey||j.ctrlKey)&&(j.preventDefault(),E())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[E]);const S=v?"expanded":"collapsed",C=m.useMemo(()=>({state:S,open:v,setOpen:b,isMobile:d,openMobile:f,setOpenMobile:h,toggleSidebar:E}),[S,v,b,d,f,h,E]);return a.jsx(t4.Provider,{value:C,children:a.jsx(vs,{delayDuration:0,children:a.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":WV,"--sidebar-width-icon":XV,...o},className:ne("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...c,children:l})})})}function tz({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...l}){const{isMobile:c,state:d,openMobile:f,setOpenMobile:h}=Ff();return n==="none"?a.jsx("div",{"data-slot":"sidebar",className:ne("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:o}):c?a.jsx($o,{open:f,onOpenChange:h,...l,children:a.jsxs(Bo,{"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":QV},side:e,children:[a.jsxs(Go,{className:"sr-only",children:[a.jsx(qo,{children:"Sidebar"}),a.jsx(Xi,{children:"Displays the mobile sidebar."})]}),a.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):a.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:[a.jsx("div",{"data-slot":"sidebar-gap",className:ne("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),a.jsx("div",{"data-slot":"sidebar-container",className:ne("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:a.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:o})})]})}function nz({className:e,onClick:t,...n}){const{toggleSidebar:r}=Ff();return a.jsx("div",{className:"absolute top-4 left-0 z-10 md:hidden",children:a.jsxs(xe,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:ne("size-7",e),onClick:o=>{t==null||t(o),r()},...n,children:[a.jsx(Bk,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})})}function rz({className:e,...t}){const{toggleSidebar:n}=Ff();return a.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:n,title:"Toggle Sidebar",className:ne("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 az({className:e,...t}){return a.jsx("main",{"data-slot":"sidebar-inset",className:ne("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 sz({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:ne("flex flex-col gap-2 p-2",e),...t})}function oz({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:ne("flex flex-col gap-2 p-2",e),...t})}function iz({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:ne("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function XR({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:ne("relative flex w-full min-w-0 flex-col p-2",e),...t})}function JR({className:e,...t}){return a.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:ne("w-full text-sm",e),...t})}function lz({className:e,...t}){return a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:ne("flex w-full min-w-0 flex-col gap-1",e),...t})}function cz({className:e,...t}){return a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:ne("group/menu-item relative",e),...t})}const uz=Af("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 dz({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:l,...c}){const d=e?tg:"button",{isMobile:f,state:h}=Ff(),g=a.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":r,"data-active":t,className:ne(uz({variant:n,size:r}),l),...c});return o?(typeof o=="string"&&(o={children:o}),a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:g}),a.jsx(Ct,{side:"right",align:"center",hidden:h!=="collapsed"||f,...o})]})):g}function k0(e){const t=fz(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(mz);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function fz(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=gz(o),d=pz(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var hz=Symbol("radix.slottable");function mz(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hz}function pz(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function gz(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function yz(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return a.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=k0(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return a.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=k0(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),a.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function E(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},E,r]}var vz=m.createContext(void 0);function Vf(e){const t=m.useContext(vz);return e||t||"ltr"}function ej(e){const t=xz(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(Sz);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function xz(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=Ez(o),d=Cz(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bz=Symbol("radix.slottable");function Sz(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bz}function Cz(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function Ez(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function wz(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return a.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=ej(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return a.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=ej(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),a.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function E(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},E,r]}var Lx="rovingFocusGroup.onEntryFocus",Rz={bubbles:!1,cancelable:!0},zf="RovingFocusGroup",[L0,n4,jz]=wz(zf),[Tz,bg]=cr(zf,[jz]),[_z,Nz]=Tz(zf),r4=m.forwardRef((e,t)=>a.jsx(L0.Provider,{scope:e.__scopeRovingFocusGroup,children:a.jsx(L0.Slot,{scope:e.__scopeRovingFocusGroup,children:a.jsx(Az,{...e,ref:t})})}));r4.displayName=zf;var Az=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:l,currentTabStopId:c,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:f,onEntryFocus:h,preventScrollOnEntryFocus:g=!1,...y}=e,v=m.useRef(null),b=dt(t,v),E=Vf(l),[S,C]=Gr({prop:c,defaultProp:d??null,onChange:f,caller:zf}),[R,j]=m.useState(!1),_=bs(h),D=n4(n),A=m.useRef(!1),[O,T]=m.useState(0);return m.useEffect(()=>{const M=v.current;if(M)return M.addEventListener(Lx,_),()=>M.removeEventListener(Lx,_)},[_]),a.jsx(_z,{scope:n,orientation:r,dir:E,loop:o,currentTabStopId:S,onItemFocus:m.useCallback(M=>C(M),[C]),onItemShiftTab:m.useCallback(()=>j(!0),[]),onFocusableItemAdd:m.useCallback(()=>T(M=>M+1),[]),onFocusableItemRemove:m.useCallback(()=>T(M=>M-1),[]),children:a.jsx(et.div,{tabIndex:R||O===0?-1:0,"data-orientation":r,...y,ref:b,style:{outline:"none",...e.style},onMouseDown:Te(e.onMouseDown,()=>{A.current=!0}),onFocus:Te(e.onFocus,M=>{const V=!A.current;if(M.target===M.currentTarget&&V&&!R){const Z=new CustomEvent(Lx,Rz);if(M.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){const K=D().filter(k=>k.focusable),Y=K.find(k=>k.active),G=K.find(k=>k.id===S),H=[Y,G,...K].filter(Boolean).map(k=>k.ref.current);o4(H,g)}}A.current=!1}),onBlur:Te(e.onBlur,()=>j(!1))})})}),a4="RovingFocusGroupItem",s4=m.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:l,children:c,...d}=e,f=Ln(),h=l||f,g=Nz(a4,n),y=g.currentTabStopId===h,v=n4(n),{onFocusableItemAdd:b,onFocusableItemRemove:E,currentTabStopId:S}=g;return m.useEffect(()=>{if(r)return b(),()=>E()},[r,b,E]),a.jsx(L0.ItemSlot,{scope:n,id:h,focusable:r,active:o,children:a.jsx(et.span,{tabIndex:y?0:-1,"data-orientation":g.orientation,...d,ref:t,onMouseDown:Te(e.onMouseDown,C=>{r?g.onItemFocus(h):C.preventDefault()}),onFocus:Te(e.onFocus,()=>g.onItemFocus(h)),onKeyDown:Te(e.onKeyDown,C=>{if(C.key==="Tab"&&C.shiftKey){g.onItemShiftTab();return}if(C.target!==C.currentTarget)return;const R=Mz(C,g.orientation,g.dir);if(R!==void 0){if(C.metaKey||C.ctrlKey||C.altKey||C.shiftKey)return;C.preventDefault();let _=v().filter(D=>D.focusable).map(D=>D.ref.current);if(R==="last")_.reverse();else if(R==="prev"||R==="next"){R==="prev"&&_.reverse();const D=_.indexOf(C.currentTarget);_=g.loop?Iz(_,D+1):_.slice(D+1)}setTimeout(()=>o4(_))}}),children:typeof c=="function"?c({isCurrentTabStop:y,hasTabStop:S!=null}):c})})});s4.displayName=a4;var Dz={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Oz(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Mz(e,t,n){const r=Oz(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Dz[r]}function o4(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Iz(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var i4=r4,l4=s4,P0=["Enter"," "],kz=["ArrowDown","PageUp","Home"],c4=["ArrowUp","PageDown","End"],Lz=[...kz,...c4],Pz={ltr:[...P0,"ArrowRight"],rtl:[...P0,"ArrowLeft"]},Uz={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Hf="Menu",[vf,Fz,Vz]=yz(Hf),[nc,u4]=cr(Hf,[Vz,eo,bg]),$f=eo(),d4=bg(),[f4,Ji]=nc(Hf),[zz,Bf]=nc(Hf),h4=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:l,modal:c=!0}=e,d=$f(t),[f,h]=m.useState(null),g=m.useRef(!1),y=bs(l),v=Vf(o);return m.useEffect(()=>{const b=()=>{g.current=!0,document.addEventListener("pointerdown",E,{capture:!0,once:!0}),document.addEventListener("pointermove",E,{capture:!0,once:!0})},E=()=>g.current=!1;return document.addEventListener("keydown",b,{capture:!0}),()=>{document.removeEventListener("keydown",b,{capture:!0}),document.removeEventListener("pointerdown",E,{capture:!0}),document.removeEventListener("pointermove",E,{capture:!0})}},[]),a.jsx(ku,{...d,children:a.jsx(f4,{scope:t,open:n,onOpenChange:y,content:f,onContentChange:h,children:a.jsx(zz,{scope:t,onClose:m.useCallback(()=>y(!1),[y]),isUsingKeyboardRef:g,dir:v,modal:c,children:r})})})};h4.displayName=Hf;var Hz="MenuAnchor",ub=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=$f(n);return a.jsx(Lu,{...o,...r,ref:t})});ub.displayName=Hz;var db="MenuPortal",[$z,m4]=nc(db,{forceMount:void 0}),p4=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,l=Ji(db,t);return a.jsx($z,{scope:t,forceMount:n,children:a.jsx(_r,{present:n||l.open,children:a.jsx(tc,{asChild:!0,container:o,children:r})})})};p4.displayName=db;var Ja="MenuContent",[Bz,fb]=nc(Ja),g4=m.forwardRef((e,t)=>{const n=m4(Ja,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,l=Ji(Ja,e.__scopeMenu),c=Bf(Ja,e.__scopeMenu);return a.jsx(vf.Provider,{scope:e.__scopeMenu,children:a.jsx(_r,{present:r||l.open,children:a.jsx(vf.Slot,{scope:e.__scopeMenu,children:c.modal?a.jsx(Gz,{...o,ref:t}):a.jsx(qz,{...o,ref:t})})})})}),Gz=m.forwardRef((e,t)=>{const n=Ji(Ja,e.__scopeMenu),r=m.useRef(null),o=dt(t,r);return m.useEffect(()=>{const l=r.current;if(l)return ig(l)},[]),a.jsx(hb,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Te(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),qz=m.forwardRef((e,t)=>{const n=Ji(Ja,e.__scopeMenu);return a.jsx(hb,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Zz=k0("MenuContent.ScrollLock"),hb=m.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:c,disableOutsidePointerEvents:d,onEntryFocus:f,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,disableOutsideScroll:E,...S}=e,C=Ji(Ja,n),R=Bf(Ja,n),j=$f(n),_=d4(n),D=Fz(n),[A,O]=m.useState(null),T=m.useRef(null),M=dt(t,T,C.onContentChange),V=m.useRef(0),Z=m.useRef(""),K=m.useRef(0),Y=m.useRef(null),G=m.useRef("right"),U=m.useRef(0),H=E?If:m.Fragment,k=E?{as:Zz,allowPinchZoom:!0}:void 0,$=ie=>{var le,Ae;const be=Z.current+ie,L=D().filter(we=>!we.disabled),P=document.activeElement,W=(le=L.find(we=>we.ref.current===P))==null?void 0:le.textValue,te=L.map(we=>we.textValue),ue=sH(te,be,W),ve=(Ae=L.find(we=>we.textValue===ue))==null?void 0:Ae.ref.current;(function we(Ne){Z.current=Ne,window.clearTimeout(V.current),Ne!==""&&(V.current=window.setTimeout(()=>we(""),1e3))})(be),ve&&setTimeout(()=>ve.focus())};m.useEffect(()=>()=>window.clearTimeout(V.current),[]),sg();const q=m.useCallback(ie=>{var L,P;return G.current===((L=Y.current)==null?void 0:L.side)&&iH(ie,(P=Y.current)==null?void 0:P.area)},[]);return a.jsx(Bz,{scope:n,searchRef:Z,onItemEnter:m.useCallback(ie=>{q(ie)&&ie.preventDefault()},[q]),onItemLeave:m.useCallback(ie=>{var be;q(ie)||((be=T.current)==null||be.focus(),O(null))},[q]),onTriggerLeave:m.useCallback(ie=>{q(ie)&&ie.preventDefault()},[q]),pointerGraceTimerRef:K,onPointerGraceIntentChange:m.useCallback(ie=>{Y.current=ie},[]),children:a.jsx(H,{...k,children:a.jsx(Mf,{asChild:!0,trapped:o,onMountAutoFocus:Te(l,ie=>{var be;ie.preventDefault(),(be=T.current)==null||be.focus({preventScroll:!0})}),onUnmountAutoFocus:c,children:a.jsx(ec,{asChild:!0,disableOutsidePointerEvents:d,onEscapeKeyDown:h,onPointerDownOutside:g,onFocusOutside:y,onInteractOutside:v,onDismiss:b,children:a.jsx(i4,{asChild:!0,..._,dir:R.dir,orientation:"vertical",loop:r,currentTabStopId:A,onCurrentTabStopIdChange:O,onEntryFocus:Te(f,ie=>{R.isUsingKeyboardRef.current||ie.preventDefault()}),preventScrollOnEntryFocus:!0,children:a.jsx(Lf,{role:"menu","aria-orientation":"vertical","data-state":M4(C.open),"data-radix-menu-content":"",dir:R.dir,...j,...S,ref:M,style:{outline:"none",...S.style},onKeyDown:Te(S.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&&$(ie.key));const te=T.current;if(ie.target!==te||!Lz.includes(ie.key))return;ie.preventDefault();const ve=D().filter(le=>!le.disabled).map(le=>le.ref.current);c4.includes(ie.key)&&ve.reverse(),rH(ve)}),onBlur:Te(e.onBlur,ie=>{ie.currentTarget.contains(ie.target)||(window.clearTimeout(V.current),Z.current="")}),onPointerMove:Te(e.onPointerMove,xf(ie=>{const be=ie.target,L=U.current!==ie.clientX;if(ie.currentTarget.contains(be)&&L){const P=ie.clientX>U.current?"right":"left";G.current=P,U.current=ie.clientX}}))})})})})})})});g4.displayName=Ja;var Kz="MenuGroup",mb=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{role:"group",...r,ref:t})});mb.displayName=Kz;var Yz="MenuLabel",y4=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{...r,ref:t})});y4.displayName=Yz;var vp="MenuItem",tj="menu.itemSelect",Sg=m.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,l=m.useRef(null),c=Bf(vp,e.__scopeMenu),d=fb(vp,e.__scopeMenu),f=dt(t,l),h=m.useRef(!1),g=()=>{const y=l.current;if(!n&&y){const v=new CustomEvent(tj,{bubbles:!0,cancelable:!0});y.addEventListener(tj,b=>r==null?void 0:r(b),{once:!0}),K_(y,v),v.defaultPrevented?h.current=!1:c.onClose()}};return a.jsx(v4,{...o,ref:f,disabled:n,onClick:Te(e.onClick,g),onPointerDown:y=>{var v;(v=e.onPointerDown)==null||v.call(e,y),h.current=!0},onPointerUp:Te(e.onPointerUp,y=>{var v;h.current||(v=y.currentTarget)==null||v.click()}),onKeyDown:Te(e.onKeyDown,y=>{const v=d.searchRef.current!=="";n||v&&y.key===" "||P0.includes(y.key)&&(y.currentTarget.click(),y.preventDefault())})})});Sg.displayName=vp;var v4=m.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...l}=e,c=fb(vp,n),d=d4(n),f=m.useRef(null),h=dt(t,f),[g,y]=m.useState(!1),[v,b]=m.useState("");return m.useEffect(()=>{const E=f.current;E&&b((E.textContent??"").trim())},[l.children]),a.jsx(vf.ItemSlot,{scope:n,disabled:r,textValue:o??v,children:a.jsx(l4,{asChild:!0,...d,focusable:!r,children:a.jsx(et.div,{role:"menuitem","data-highlighted":g?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...l,ref:h,onPointerMove:Te(e.onPointerMove,xf(E=>{r?c.onItemLeave(E):(c.onItemEnter(E),E.defaultPrevented||E.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Te(e.onPointerLeave,xf(E=>c.onItemLeave(E))),onFocus:Te(e.onFocus,()=>y(!0)),onBlur:Te(e.onBlur,()=>y(!1))})})})}),Wz="MenuCheckboxItem",x4=m.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return a.jsx(w4,{scope:e.__scopeMenu,checked:n,children:a.jsx(Sg,{role:"menuitemcheckbox","aria-checked":xp(n)?"mixed":n,...o,ref:t,"data-state":yb(n),onSelect:Te(o.onSelect,()=>r==null?void 0:r(xp(n)?!0:!n),{checkForDefaultPrevented:!1})})})});x4.displayName=Wz;var b4="MenuRadioGroup",[Qz,Xz]=nc(b4,{value:void 0,onValueChange:()=>{}}),S4=m.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,l=bs(r);return a.jsx(Qz,{scope:e.__scopeMenu,value:n,onValueChange:l,children:a.jsx(mb,{...o,ref:t})})});S4.displayName=b4;var C4="MenuRadioItem",E4=m.forwardRef((e,t)=>{const{value:n,...r}=e,o=Xz(C4,e.__scopeMenu),l=n===o.value;return a.jsx(w4,{scope:e.__scopeMenu,checked:l,children:a.jsx(Sg,{role:"menuitemradio","aria-checked":l,...r,ref:t,"data-state":yb(l),onSelect:Te(r.onSelect,()=>{var c;return(c=o.onValueChange)==null?void 0:c.call(o,n)},{checkForDefaultPrevented:!1})})})});E4.displayName=C4;var pb="MenuItemIndicator",[w4,Jz]=nc(pb,{checked:!1}),R4=m.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,l=Jz(pb,n);return a.jsx(_r,{present:r||xp(l.checked)||l.checked===!0,children:a.jsx(et.span,{...o,ref:t,"data-state":yb(l.checked)})})});R4.displayName=pb;var eH="MenuSeparator",j4=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return a.jsx(et.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});j4.displayName=eH;var tH="MenuArrow",T4=m.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=$f(n);return a.jsx(Pf,{...o,...r,ref:t})});T4.displayName=tH;var gb="MenuSub",[nH,_4]=nc(gb),N4=e=>{const{__scopeMenu:t,children:n,open:r=!1,onOpenChange:o}=e,l=Ji(gb,t),c=$f(t),[d,f]=m.useState(null),[h,g]=m.useState(null),y=bs(o);return m.useEffect(()=>(l.open===!1&&y(!1),()=>y(!1)),[l.open,y]),a.jsx(ku,{...c,children:a.jsx(f4,{scope:t,open:r,onOpenChange:y,content:h,onContentChange:g,children:a.jsx(nH,{scope:t,contentId:Ln(),triggerId:Ln(),trigger:d,onTriggerChange:f,children:n})})})};N4.displayName=gb;var Wd="MenuSubTrigger",A4=m.forwardRef((e,t)=>{const n=Ji(Wd,e.__scopeMenu),r=Bf(Wd,e.__scopeMenu),o=_4(Wd,e.__scopeMenu),l=fb(Wd,e.__scopeMenu),c=m.useRef(null),{pointerGraceTimerRef:d,onPointerGraceIntentChange:f}=l,h={__scopeMenu:e.__scopeMenu},g=m.useCallback(()=>{c.current&&window.clearTimeout(c.current),c.current=null},[]);return m.useEffect(()=>g,[g]),m.useEffect(()=>{const y=d.current;return()=>{window.clearTimeout(y),f(null)}},[d,f]),a.jsx(ub,{asChild:!0,...h,children:a.jsx(v4,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":M4(n.open),...e,ref:Pr(t,o.onTriggerChange),onClick:y=>{var v;(v=e.onClick)==null||v.call(e,y),!(e.disabled||y.defaultPrevented)&&(y.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Te(e.onPointerMove,xf(y=>{l.onItemEnter(y),!y.defaultPrevented&&!e.disabled&&!n.open&&!c.current&&(l.onPointerGraceIntentChange(null),c.current=window.setTimeout(()=>{n.onOpenChange(!0),g()},100))})),onPointerLeave:Te(e.onPointerLeave,xf(y=>{var b,E;g();const v=(b=n.content)==null?void 0:b.getBoundingClientRect();if(v){const S=(E=n.content)==null?void 0:E.dataset.side,C=S==="right",R=C?-5:5,j=v[C?"left":"right"],_=v[C?"right":"left"];l.onPointerGraceIntentChange({area:[{x:y.clientX+R,y:y.clientY},{x:j,y:v.top},{x:_,y:v.top},{x:_,y:v.bottom},{x:j,y:v.bottom}],side:S}),window.clearTimeout(d.current),d.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(y),y.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:Te(e.onKeyDown,y=>{var b;const v=l.searchRef.current!=="";e.disabled||v&&y.key===" "||Pz[r.dir].includes(y.key)&&(n.onOpenChange(!0),(b=n.content)==null||b.focus(),y.preventDefault())})})})});A4.displayName=Wd;var D4="MenuSubContent",O4=m.forwardRef((e,t)=>{const n=m4(Ja,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,l=Ji(Ja,e.__scopeMenu),c=Bf(Ja,e.__scopeMenu),d=_4(D4,e.__scopeMenu),f=m.useRef(null),h=dt(t,f);return a.jsx(vf.Provider,{scope:e.__scopeMenu,children:a.jsx(_r,{present:r||l.open,children:a.jsx(vf.Slot,{scope:e.__scopeMenu,children:a.jsx(hb,{id:d.contentId,"aria-labelledby":d.triggerId,...o,ref:h,align:"start",side:c.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:g=>{var y;c.isUsingKeyboardRef.current&&((y=f.current)==null||y.focus()),g.preventDefault()},onCloseAutoFocus:g=>g.preventDefault(),onFocusOutside:Te(e.onFocusOutside,g=>{g.target!==d.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:Te(e.onEscapeKeyDown,g=>{c.onClose(),g.preventDefault()}),onKeyDown:Te(e.onKeyDown,g=>{var b;const y=g.currentTarget.contains(g.target),v=Uz[c.dir].includes(g.key);y&&v&&(l.onOpenChange(!1),(b=d.trigger)==null||b.focus(),g.preventDefault())})})})})})});O4.displayName=D4;function M4(e){return e?"open":"closed"}function xp(e){return e==="indeterminate"}function yb(e){return xp(e)?"indeterminate":e?"checked":"unchecked"}function rH(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function aH(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function sH(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=aH(e,Math.max(l,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function oH(e,t){const{x:n,y:r}=e;let o=!1;for(let l=0,c=t.length-1;l<t.length;c=l++){const d=t[l],f=t[c],h=d.x,g=d.y,y=f.x,v=f.y;g>r!=v>r&&n<(y-h)*(r-g)/(v-g)+h&&(o=!o)}return o}function iH(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return oH(n,t)}function xf(e){return t=>t.pointerType==="mouse"?e(t):void 0}var lH=h4,cH=ub,uH=p4,dH=g4,fH=mb,hH=y4,mH=Sg,pH=x4,gH=S4,yH=E4,vH=R4,xH=j4,bH=T4,SH=N4,CH=A4,EH=O4,Cg="DropdownMenu",[wH]=cr(Cg,[u4]),Ur=u4(),[RH,I4]=wH(Cg),k4=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:l,onOpenChange:c,modal:d=!0}=e,f=Ur(t),h=m.useRef(null),[g,y]=Gr({prop:o,defaultProp:l??!1,onChange:c,caller:Cg});return a.jsx(RH,{scope:t,triggerId:Ln(),triggerRef:h,contentId:Ln(),open:g,onOpenChange:y,onOpenToggle:m.useCallback(()=>y(v=>!v),[y]),modal:d,children:a.jsx(lH,{...f,open:g,onOpenChange:y,dir:r,modal:d,children:n})})};k4.displayName=Cg;var L4="DropdownMenuTrigger",P4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,l=I4(L4,n),c=Ur(n);return a.jsx(cH,{asChild:!0,...c,children:a.jsx(et.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,...o,ref:Pr(t,l.triggerRef),onPointerDown:Te(e.onPointerDown,d=>{!r&&d.button===0&&d.ctrlKey===!1&&(l.onOpenToggle(),l.open||d.preventDefault())}),onKeyDown:Te(e.onKeyDown,d=>{r||(["Enter"," "].includes(d.key)&&l.onOpenToggle(),d.key==="ArrowDown"&&l.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(d.key)&&d.preventDefault())})})})});P4.displayName=L4;var jH="DropdownMenuPortal",U4=e=>{const{__scopeDropdownMenu:t,...n}=e,r=Ur(t);return a.jsx(uH,{...r,...n})};U4.displayName=jH;var F4="DropdownMenuContent",V4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=I4(F4,n),l=Ur(n),c=m.useRef(!1);return a.jsx(dH,{id:o.contentId,"aria-labelledby":o.triggerId,...l,...r,ref:t,onCloseAutoFocus:Te(e.onCloseAutoFocus,d=>{var f;c.current||(f=o.triggerRef.current)==null||f.focus(),c.current=!1,d.preventDefault()}),onInteractOutside:Te(e.onInteractOutside,d=>{const f=d.detail.originalEvent,h=f.button===0&&f.ctrlKey===!0,g=f.button===2||h;(!o.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)"}})});V4.displayName=F4;var TH="DropdownMenuGroup",_H=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(fH,{...o,...r,ref:t})});_H.displayName=TH;var NH="DropdownMenuLabel",AH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(hH,{...o,...r,ref:t})});AH.displayName=NH;var DH="DropdownMenuItem",z4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(mH,{...o,...r,ref:t})});z4.displayName=DH;var OH="DropdownMenuCheckboxItem",MH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(pH,{...o,...r,ref:t})});MH.displayName=OH;var IH="DropdownMenuRadioGroup",kH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(gH,{...o,...r,ref:t})});kH.displayName=IH;var LH="DropdownMenuRadioItem",PH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(yH,{...o,...r,ref:t})});PH.displayName=LH;var UH="DropdownMenuItemIndicator",FH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(vH,{...o,...r,ref:t})});FH.displayName=UH;var VH="DropdownMenuSeparator",H4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(xH,{...o,...r,ref:t})});H4.displayName=VH;var zH="DropdownMenuArrow",HH=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(bH,{...o,...r,ref:t})});HH.displayName=zH;var $H=e=>{const{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:o,defaultOpen:l}=e,c=Ur(t),[d,f]=Gr({prop:r,defaultProp:l??!1,onChange:o,caller:"DropdownMenuSub"});return a.jsx(SH,{...c,open:d,onOpenChange:f,children:n})},BH="DropdownMenuSubTrigger",$4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(CH,{...o,...r,ref:t})});$4.displayName=BH;var GH="DropdownMenuSubContent",B4=m.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=Ur(n);return a.jsx(EH,{...o,...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)"}})});B4.displayName=GH;var qH=k4,ZH=P4,G4=U4,KH=V4,YH=z4,WH=H4,QH=$H,XH=$4,JH=B4;function ur({...e}){return a.jsx(qH,{"data-slot":"dropdown-menu",...e})}function e$({...e}){return a.jsx(G4,{"data-slot":"dropdown-menu-portal",...e})}function dr({...e}){return a.jsx(ZH,{"data-slot":"dropdown-menu-trigger",...e})}function fr({className:e,sideOffset:t=4,...n}){return a.jsx(G4,{children:a.jsx(KH,{"data-slot":"dropdown-menu-content",sideOffset:t,className:ne("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 pt({className:e,inset:t,variant:n="default",...r}){return a.jsx(YH,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:ne("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 ma({className:e,...t}){return a.jsx(WH,{"data-slot":"dropdown-menu-separator",className:ne("bg-border -mx-1 my-1 h-px",e),...t})}function vb({...e}){return a.jsx(QH,{"data-slot":"dropdown-menu-sub",...e})}function xb({className:e,inset:t,children:n,...r}){return a.jsxs(XH,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:ne("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",e),...r,children:[n,a.jsx(La,{className:"ml-auto size-4"})]})}function bb({className:e,...t}){return a.jsx(JH,{"data-slot":"dropdown-menu-sub-content",className:ne("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 t$="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",n$=({width:e=45,height:t=36,className:n=""})=>a.jsx("img",{src:t$,alt:"OWOX Logo",width:e,height:t,className:n}),q4=m.createContext(null),Z4=m.createContext(()=>{});function r$(){return m.useContext(Z4)}function bp(e){const t=m.useContext(q4);if(t==null)throw new Error("useAppSelector must be used within StoreProvider");return e(t)}function K4(){return bp(e=>e.project)}function Eg(){const{data:e,callState:t,error:n}=bp(r=>r.flags);return{flags:e,callState:t,error:n}}function a$({isOpen:e}){const{title:t}=K4();return a.jsx(dr,{asChild:!0,children:a.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[a.jsx("div",{className:"text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-md border bg-white dark:bg-white/10",children:a.jsx(n$,{width:24,height:24})}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[a.jsx("span",{className:"truncate font-medium",children:"OWOX Data Marts"}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:t??"Project"})]}),a.jsx(ka,{className:`ml-auto size-4 transition-transform duration-200 ${e?"rotate-180":""}`})]})})}var kr=(e=>(e.LOADING="loading",e.AUTHENTICATED="authenticated",e.UNAUTHENTICATED="unauthenticated",e.ERROR="error",e))(kr||{});function Y4(e,t){return function(){return e.apply(t,arguments)}}const{toString:s$}=Object.prototype,{getPrototypeOf:Sb}=Object,{iterator:wg,toStringTag:W4}=Symbol,Rg=(e=>t=>{const n=s$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),js=e=>(e=e.toLowerCase(),t=>Rg(t)===e),jg=e=>t=>typeof t===e,{isArray:Pu}=Array,Cu=jg("undefined");function Gf(e){return e!==null&&!Cu(e)&&e.constructor!==null&&!Cu(e.constructor)&&da(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const Q4=js("ArrayBuffer");function o$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Q4(e.buffer),t}const i$=jg("string"),da=jg("function"),X4=jg("number"),qf=e=>e!==null&&typeof e=="object",l$=e=>e===!0||e===!1,Jm=e=>{if(Rg(e)!=="object")return!1;const t=Sb(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(W4 in e)&&!(wg in e)},c$=e=>{if(!qf(e)||Gf(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},u$=js("Date"),d$=js("File"),f$=js("Blob"),h$=js("FileList"),m$=e=>qf(e)&&da(e.pipe),p$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||da(e.append)&&((t=Rg(e))==="formdata"||t==="object"&&da(e.toString)&&e.toString()==="[object FormData]"))},g$=js("URLSearchParams"),[y$,v$,x$,b$]=["ReadableStream","Request","Response","Headers"].map(js),S$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Zf(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Pu(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(Gf(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 J4(e,t){if(Gf(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,eA=e=>!Cu(e)&&e!==Ml;function U0(){const{caseless:e,skipUndefined:t}=eA(this)&&this||{},n={},r=(o,l)=>{const c=e&&J4(n,l)||l;Jm(n[c])&&Jm(o)?n[c]=U0(n[c],o):Jm(o)?n[c]=U0({},o):Pu(o)?n[c]=o.slice():(!t||!Cu(o))&&(n[c]=o)};for(let o=0,l=arguments.length;o<l;o++)arguments[o]&&Zf(arguments[o],r);return n}const C$=(e,t,n,{allOwnKeys:r}={})=>(Zf(t,(o,l)=>{n&&da(o)?e[l]=Y4(o,n):e[l]=o},{allOwnKeys:r}),e),E$=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),w$=(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)},R$=(e,t,n,r)=>{let o,l,c;const d={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),l=o.length;l-- >0;)c=o[l],(!r||r(c,e,t))&&!d[c]&&(t[c]=e[c],d[c]=!0);e=n!==!1&&Sb(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},j$=(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},T$=e=>{if(!e)return null;if(Pu(e))return e;let t=e.length;if(!X4(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},_$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Sb(Uint8Array)),N$=(e,t)=>{const r=(e&&e[wg]).call(e);let o;for(;(o=r.next())&&!o.done;){const l=o.value;t.call(e,l[0],l[1])}},A$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},D$=js("HTMLFormElement"),O$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),nj=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M$=js("RegExp"),tA=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Zf(n,(o,l)=>{let c;(c=t(o,l,e))!==!1&&(r[l]=c||o)}),Object.defineProperties(e,r)},I$=e=>{tA(e,(t,n)=>{if(da(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(da(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+"'")})}})},k$=(e,t)=>{const n={},r=o=>{o.forEach(l=>{n[l]=!0})};return Pu(e)?r(e):r(String(e).split(t)),n},L$=()=>{},P$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function U$(e){return!!(e&&da(e.append)&&e[W4]==="FormData"&&e[wg])}const F$=e=>{const t=new Array(10),n=(r,o)=>{if(qf(r)){if(t.indexOf(r)>=0)return;if(Gf(r))return r;if(!("toJSON"in r)){t[o]=r;const l=Pu(r)?[]:{};return Zf(r,(c,d)=>{const f=n(c,o+1);!Cu(f)&&(l[d]=f)}),t[o]=void 0,l}}return r};return n(e,0)},V$=js("AsyncFunction"),z$=e=>e&&(qf(e)||da(e))&&da(e.then)&&da(e.catch),nA=((e,t)=>e?setImmediate:t?((n,r)=>(Ml.addEventListener("message",({source:o,data:l})=>{o===Ml&&l===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Ml.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",da(Ml.postMessage)),H$=typeof queueMicrotask<"u"?queueMicrotask.bind(Ml):typeof process<"u"&&process.nextTick||nA,$$=e=>e!=null&&da(e[wg]),ce={isArray:Pu,isArrayBuffer:Q4,isBuffer:Gf,isFormData:p$,isArrayBufferView:o$,isString:i$,isNumber:X4,isBoolean:l$,isObject:qf,isPlainObject:Jm,isEmptyObject:c$,isReadableStream:y$,isRequest:v$,isResponse:x$,isHeaders:b$,isUndefined:Cu,isDate:u$,isFile:d$,isBlob:f$,isRegExp:M$,isFunction:da,isStream:m$,isURLSearchParams:g$,isTypedArray:_$,isFileList:h$,forEach:Zf,merge:U0,extend:C$,trim:S$,stripBOM:E$,inherits:w$,toFlatObject:R$,kindOf:Rg,kindOfTest:js,endsWith:j$,toArray:T$,forEachEntry:N$,matchAll:A$,isHTMLForm:D$,hasOwnProperty:nj,hasOwnProp:nj,reduceDescriptors:tA,freezeMethods:I$,toObjectSet:k$,toCamelCase:O$,noop:L$,toFiniteNumber:P$,findKey:J4,global:Ml,isContextDefined:eA,isSpecCompliantForm:U$,toJSONObject:F$,isAsyncFn:V$,isThenable:z$,setImmediate:nA,asap:H$,isIterable:$$};function mt(e,t,n,r,o){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),o&&(this.response=o,this.status=o.status?o.status:null)}ce.inherits(mt,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 rA=mt.prototype,aA={};["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=>{aA[e]={value:e}});Object.defineProperties(mt,aA);Object.defineProperty(rA,"isAxiosError",{value:!0});mt.from=(e,t,n,r,o,l)=>{const c=Object.create(rA);ce.toFlatObject(e,c,function(g){return g!==Error.prototype},h=>h!=="isAxiosError");const d=e&&e.message?e.message:"Error",f=t==null&&e?e.code:t;return mt.call(c,d,f,n,r,o),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 B$=null;function F0(e){return ce.isPlainObject(e)||ce.isArray(e)}function sA(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function rj(e,t,n){return e?e.concat(t).map(function(o,l){return o=sA(o),!n&&l?"["+o+"]":o}).join(n?".":""):t}function G$(e){return ce.isArray(e)&&!e.some(F0)}const q$=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function Tg(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(S,C){return!ce.isUndefined(C[S])});const r=n.metaTokens,o=n.visitor||g,l=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(o))throw new TypeError("visitor must be a function");function h(E){if(E===null)return"";if(ce.isDate(E))return E.toISOString();if(ce.isBoolean(E))return E.toString();if(!f&&ce.isBlob(E))throw new mt("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(E)||ce.isTypedArray(E)?f&&typeof Blob=="function"?new Blob([E]):Buffer.from(E):E}function g(E,S,C){let R=E;if(E&&!C&&typeof E=="object"){if(ce.endsWith(S,"{}"))S=r?S:S.slice(0,-2),E=JSON.stringify(E);else if(ce.isArray(E)&&G$(E)||(ce.isFileList(E)||ce.endsWith(S,"[]"))&&(R=ce.toArray(E)))return S=sA(S),R.forEach(function(_,D){!(ce.isUndefined(_)||_===null)&&t.append(c===!0?rj([S],D,l):c===null?S:S+"[]",h(_))}),!1}return F0(E)?!0:(t.append(rj(C,S,l),h(E)),!1)}const y=[],v=Object.assign(q$,{defaultVisitor:g,convertValue:h,isVisitable:F0});function b(E,S){if(!ce.isUndefined(E)){if(y.indexOf(E)!==-1)throw Error("Circular reference detected in "+S.join("."));y.push(E),ce.forEach(E,function(R,j){(!(ce.isUndefined(R)||R===null)&&o.call(t,R,ce.isString(j)?j.trim():j,S,v))===!0&&b(R,S?S.concat(j):[j])}),y.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return b(e),t}function aj(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Cb(e,t){this._pairs=[],e&&Tg(e,this,t)}const oA=Cb.prototype;oA.append=function(t,n){this._pairs.push([t,n])};oA.toString=function(t){const n=t?function(r){return t.call(this,r,aj)}:aj;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Z$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function iA(e,t,n){if(!t)return e;const r=n&&n.encode||Z$;ce.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let l;if(o?l=o(t,n):l=ce.isURLSearchParams(t)?t.toString():new Cb(t,n).toString(r),l){const c=e.indexOf("#");c!==-1&&(e=e.slice(0,c)),e+=(e.indexOf("?")===-1?"?":"&")+l}return e}class sj{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 lA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},K$=typeof URLSearchParams<"u"?URLSearchParams:Cb,Y$=typeof FormData<"u"?FormData:null,W$=typeof Blob<"u"?Blob:null,Q$={isBrowser:!0,classes:{URLSearchParams:K$,FormData:Y$,Blob:W$},protocols:["http","https","file","blob","url","data"]},Eb=typeof window<"u"&&typeof document<"u",V0=typeof navigator=="object"&&navigator||void 0,X$=Eb&&(!V0||["ReactNative","NativeScript","NS"].indexOf(V0.product)<0),J$=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",eB=Eb&&window.location.href||"http://localhost",tB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Eb,hasStandardBrowserEnv:X$,hasStandardBrowserWebWorkerEnv:J$,navigator:V0,origin:eB},Symbol.toStringTag,{value:"Module"})),Ir={...tB,...Q$};function nB(e,t){return Tg(e,new Ir.classes.URLSearchParams,{visitor:function(n,r,o,l){return Ir.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...t})}function rB(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function aB(e){const t={},n=Object.keys(e);let r;const o=n.length;let l;for(r=0;r<o;r++)l=n[r],t[l]=e[l];return t}function cA(e){function t(n,r,o,l){let c=n[l++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),f=l>=n.length;return c=!c&&ce.isArray(o)?o.length:c,f?(ce.hasOwnProp(o,c)?o[c]=[o[c],r]:o[c]=r,!d):((!o[c]||!ce.isObject(o[c]))&&(o[c]=[]),t(n,r,o[c],l)&&ce.isArray(o[c])&&(o[c]=aB(o[c])),!d)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,o)=>{t(rB(r),o,n,0)}),n}return null}function sB(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 Kf={transitional:lA,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,l=ce.isObject(t);if(l&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return o?JSON.stringify(cA(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 nB(t,this.formSerializer).toString();if((d=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Tg(d?{"files[]":t}:t,f&&new f,this.formSerializer)}}return l||o?(n.setContentType("application/json",!1),sB(t)):t}],transformResponse:[function(t){const n=this.transitional||Kf.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||o)){const c=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?mt.from(d,mt.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:Ir.classes.FormData,Blob:Ir.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=>{Kf.headers[e]={}});const oB=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"]),iB=e=>{const t={};let n,r,o;return e&&e.split(`
486
- `).forEach(function(c){o=c.indexOf(":"),n=c.substring(0,o).trim().toLowerCase(),r=c.substring(o+1).trim(),!(!n||t[n]&&oB[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},oj=Symbol("internals");function Vd(e){return e&&String(e).trim().toLowerCase()}function ep(e){return e===!1||e==null?e:ce.isArray(e)?e.map(ep):String(e)}function lB(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 cB=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Px(e,t,n,r,o){if(ce.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function uB(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function dB(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,l,c){return this[r].call(this,t,o,l,c)},configurable:!0})})}let fa=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function l(d,f,h){const g=Vd(f);if(!g)throw new Error("header name must be a non-empty string");const y=ce.findKey(o,g);(!y||o[y]===void 0||h===!0||h===void 0&&o[y]!==!1)&&(o[y||f]=ep(d))}const c=(d,f)=>ce.forEach(d,(h,g)=>l(h,g,f));if(ce.isPlainObject(t)||t instanceof this.constructor)c(t,n);else if(ce.isString(t)&&(t=t.trim())&&!cB(t))c(iB(t),n);else if(ce.isObject(t)&&ce.isIterable(t)){let d={},f,h;for(const g of t){if(!ce.isArray(g))throw TypeError("Object iterator must return a key-value pair");d[h=g[0]]=(f=d[h])?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=Vd(t),t){const r=ce.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return lB(o);if(ce.isFunction(n))return n.call(this,o,r);if(ce.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Vd(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Px(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function l(c){if(c=Vd(c),c){const d=ce.findKey(r,c);d&&(!n||Px(r,r[d],d,n))&&(delete r[d],o=!0)}}return ce.isArray(t)?t.forEach(l):l(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const l=n[r];(!t||Px(this,this[l],l,t,!0))&&(delete this[l],o=!0)}return o}normalize(t){const n=this,r={};return ce.forEach(this,(o,l)=>{const c=ce.findKey(r,l);if(c){n[c]=ep(o),delete n[l];return}const d=t?uB(l):String(l).trim();d!==l&&delete n[l],n[d]=ep(o),r[d]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=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(o=>r.set(o)),r}static accessor(t){const r=(this[oj]=this[oj]={accessors:{}}).accessors,o=this.prototype;function l(c){const d=Vd(c);r[d]||(dB(o,c),r[d]=!0)}return ce.isArray(t)?t.forEach(l):l(t),this}};fa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(fa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(fa);function Ux(e,t){const n=this||Kf,r=t||n,o=fa.from(r.headers);let l=r.data;return ce.forEach(e,function(d){l=d.call(n,l,o.normalize(),t?t.status:void 0)}),o.normalize(),l}function uA(e){return!!(e&&e.__CANCEL__)}function Uu(e,t,n){mt.call(this,e??"canceled",mt.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Uu,mt,{__CANCEL__:!0});function dA(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new mt("Request failed with status code "+n.status,[mt.ERR_BAD_REQUEST,mt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function fB(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function hB(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,l=0,c;return t=t!==void 0?t:1e3,function(f){const h=Date.now(),g=r[l];c||(c=h),n[o]=f,r[o]=h;let y=l,v=0;for(;y!==o;)v+=n[y++],y=y%e;if(o=(o+1)%e,o===l&&(l=(l+1)%e),h-c<t)return;const b=g&&h-g;return b?Math.round(v*1e3/b):void 0}}function mB(e,t){let n=0,r=1e3/t,o,l;const c=(h,g=Date.now())=>{n=g,o=null,l&&(clearTimeout(l),l=null),e(...h)};return[(...h)=>{const g=Date.now(),y=g-n;y>=r?c(h,g):(o=h,l||(l=setTimeout(()=>{l=null,c(o)},r-y)))},()=>o&&c(o)]}const Sp=(e,t,n=3)=>{let r=0;const o=hB(50,250);return mB(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,f=c-r,h=o(f),g=c<=d;r=c;const y={loaded:c,total:d,progress:d?c/d:void 0,bytes:f,rate:h||void 0,estimated:h&&d&&g?(d-c)/h:void 0,event:l,lengthComputable:d!=null,[t?"download":"upload"]:!0};e(y)},n)},ij=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},lj=e=>(...t)=>ce.asap(()=>e(...t)),pB=Ir.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ir.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ir.origin),Ir.navigator&&/(msie|trident)/i.test(Ir.navigator.userAgent)):()=>!0,gB=Ir.hasStandardBrowserEnv?{write(e,t,n,r,o,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(o)&&d.push(`domain=${o}`),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 yB(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function vB(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function fA(e,t,n){let r=!yB(t);return e&&(r||n==!1)?vB(e,t):t}const cj=e=>e instanceof fa?{...e}:e;function Bl(e,t){t=t||{};const n={};function r(h,g,y,v){return ce.isPlainObject(h)&&ce.isPlainObject(g)?ce.merge.call({caseless:v},h,g):ce.isPlainObject(g)?ce.merge({},g):ce.isArray(g)?g.slice():g}function o(h,g,y,v){if(ce.isUndefined(g)){if(!ce.isUndefined(h))return r(void 0,h,y,v)}else return r(h,g,y,v)}function l(h,g){if(!ce.isUndefined(g))return r(void 0,g)}function c(h,g){if(ce.isUndefined(g)){if(!ce.isUndefined(h))return r(void 0,h)}else return r(void 0,g)}function d(h,g,y){if(y in t)return r(h,g);if(y in e)return r(void 0,h)}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:(h,g,y)=>o(cj(h),cj(g),y,!0)};return ce.forEach(Object.keys({...e,...t}),function(g){const y=f[g]||o,v=y(e[g],t[g],g);ce.isUndefined(v)&&y!==d||(n[g]=v)}),n}const hA=e=>{const t=Bl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:l,headers:c,auth:d}=t;if(t.headers=c=fa.from(c),t.url=iA(fA(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(Ir.hasStandardBrowserEnv||Ir.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(ce.isFunction(n.getHeaders)){const f=n.getHeaders(),h=["content-type","content-length"];Object.entries(f).forEach(([g,y])=>{h.includes(g.toLowerCase())&&c.set(g,y)})}}if(Ir.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&pB(t.url))){const f=o&&l&&gB.read(l);f&&c.set(o,f)}return t},xB=typeof XMLHttpRequest<"u",bB=xB&&function(e){return new Promise(function(n,r){const o=hA(e);let l=o.data;const c=fa.from(o.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:h}=o,g,y,v,b,E;function S(){b&&b(),E&&E(),o.cancelToken&&o.cancelToken.unsubscribe(g),o.signal&&o.signal.removeEventListener("abort",g)}let C=new XMLHttpRequest;C.open(o.method.toUpperCase(),o.url,!0),C.timeout=o.timeout;function R(){if(!C)return;const _=fa.from("getAllResponseHeaders"in C&&C.getAllResponseHeaders()),A={data:!d||d==="text"||d==="json"?C.responseText:C.response,status:C.status,statusText:C.statusText,headers:_,config:e,request:C};dA(function(T){n(T),S()},function(T){r(T),S()},A),C=null}"onloadend"in C?C.onloadend=R:C.onreadystatechange=function(){!C||C.readyState!==4||C.status===0&&!(C.responseURL&&C.responseURL.indexOf("file:")===0)||setTimeout(R)},C.onabort=function(){C&&(r(new mt("Request aborted",mt.ECONNABORTED,e,C)),C=null)},C.onerror=function(D){const A=D&&D.message?D.message:"Network Error",O=new mt(A,mt.ERR_NETWORK,e,C);O.event=D||null,r(O),C=null},C.ontimeout=function(){let D=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const A=o.transitional||lA;o.timeoutErrorMessage&&(D=o.timeoutErrorMessage),r(new mt(D,A.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,e,C)),C=null},l===void 0&&c.setContentType(null),"setRequestHeader"in C&&ce.forEach(c.toJSON(),function(D,A){C.setRequestHeader(A,D)}),ce.isUndefined(o.withCredentials)||(C.withCredentials=!!o.withCredentials),d&&d!=="json"&&(C.responseType=o.responseType),h&&([v,E]=Sp(h,!0),C.addEventListener("progress",v)),f&&C.upload&&([y,b]=Sp(f),C.upload.addEventListener("progress",y),C.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(g=_=>{C&&(r(!_||_.type?new Uu(null,e,C):_),C.abort(),C=null)},o.cancelToken&&o.cancelToken.subscribe(g),o.signal&&(o.signal.aborted?g():o.signal.addEventListener("abort",g)));const j=fB(o.url);if(j&&Ir.protocols.indexOf(j)===-1){r(new mt("Unsupported protocol "+j+":",mt.ERR_BAD_REQUEST,e));return}C.send(l||null)})},SB=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const l=function(h){if(!o){o=!0,d();const g=h instanceof Error?h:this.reason;r.abort(g instanceof mt?g:new Uu(g instanceof Error?g.message:g))}};let c=t&&setTimeout(()=>{c=null,l(new mt(`timeout ${t} of ms exceeded`,mt.ETIMEDOUT))},t);const d=()=>{e&&(c&&clearTimeout(c),c=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(l):h.removeEventListener("abort",l)}),e=null)};e.forEach(h=>h.addEventListener("abort",l));const{signal:f}=r;return f.unsubscribe=()=>ce.asap(d),f}},CB=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},EB=async function*(e,t){for await(const n of wB(e))yield*CB(n,t)},wB=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()}},uj=(e,t,n,r)=>{const o=EB(e,t);let l=0,c,d=f=>{c||(c=!0,r&&r(f))};return new ReadableStream({async pull(f){try{const{done:h,value:g}=await o.next();if(h){d(),f.close();return}let y=g.byteLength;if(n){let v=l+=y;n(v)}f.enqueue(new Uint8Array(g))}catch(h){throw d(h),h}},cancel(f){return d(f),o.return()}},{highWaterMark:2})},dj=64*1024,{isFunction:Nm}=ce,RB=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:fj,TextEncoder:hj}=ce.global,mj=(e,...t)=>{try{return!!e(...t)}catch{return!1}},jB=e=>{e=ce.merge.call({skipUndefined:!0},RB,e);const{fetch:t,Request:n,Response:r}=e,o=t?Nm(t):typeof fetch=="function",l=Nm(n),c=Nm(r);if(!o)return!1;const d=o&&Nm(fj),f=o&&(typeof hj=="function"?(E=>S=>E.encode(S))(new hj):async E=>new Uint8Array(await new n(E).arrayBuffer())),h=l&&d&&mj(()=>{let E=!1;const S=new n(Ir.origin,{body:new fj,method:"POST",get duplex(){return E=!0,"half"}}).headers.has("Content-Type");return E&&!S}),g=c&&d&&mj(()=>ce.isReadableStream(new r("").body)),y={stream:g&&(E=>E.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(E=>{!y[E]&&(y[E]=(S,C)=>{let R=S&&S[E];if(R)return R.call(S);throw new mt(`Response type '${E}' is not supported`,mt.ERR_NOT_SUPPORT,C)})});const v=async E=>{if(E==null)return 0;if(ce.isBlob(E))return E.size;if(ce.isSpecCompliantForm(E))return(await new n(Ir.origin,{method:"POST",body:E}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(E)||ce.isArrayBuffer(E))return E.byteLength;if(ce.isURLSearchParams(E)&&(E=E+""),ce.isString(E))return(await f(E)).byteLength},b=async(E,S)=>{const C=ce.toFiniteNumber(E.getContentLength());return C??v(S)};return async E=>{let{url:S,method:C,data:R,signal:j,cancelToken:_,timeout:D,onDownloadProgress:A,onUploadProgress:O,responseType:T,headers:M,withCredentials:V="same-origin",fetchOptions:Z}=hA(E),K=t||fetch;T=T?(T+"").toLowerCase():"text";let Y=SB([j,_&&_.toAbortSignal()],D),G=null;const U=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let H;try{if(O&&h&&C!=="get"&&C!=="head"&&(H=await b(M,R))!==0){let L=new n(S,{method:"POST",body:R,duplex:"half"}),P;if(ce.isFormData(R)&&(P=L.headers.get("content-type"))&&M.setContentType(P),L.body){const[W,te]=ij(H,Sp(lj(O)));R=uj(L.body,dj,W,te)}}ce.isString(V)||(V=V?"include":"omit");const k=l&&"credentials"in n.prototype,$={...Z,signal:Y,method:C.toUpperCase(),headers:M.normalize().toJSON(),body:R,duplex:"half",credentials:k?V:void 0};G=l&&new n(S,$);let q=await(l?K(G,Z):K(S,$));const ie=g&&(T==="stream"||T==="response");if(g&&(A||ie&&U)){const L={};["status","statusText","headers"].forEach(ue=>{L[ue]=q[ue]});const P=ce.toFiniteNumber(q.headers.get("content-length")),[W,te]=A&&ij(P,Sp(lj(A),!0))||[];q=new r(uj(q.body,dj,W,()=>{te&&te(),U&&U()}),L)}T=T||"text";let be=await y[ce.findKey(y,T)||"text"](q,E);return!ie&&U&&U(),await new Promise((L,P)=>{dA(L,P,{data:be,headers:fa.from(q.headers),status:q.status,statusText:q.statusText,config:E,request:G})})}catch(k){throw U&&U(),k&&k.name==="TypeError"&&/Load failed|fetch/i.test(k.message)?Object.assign(new mt("Network Error",mt.ERR_NETWORK,E,G),{cause:k.cause||k}):mt.from(k,k&&k.code,E,G)}}},TB=new Map,mA=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:o}=t,l=[r,o,n];let c=l.length,d=c,f,h,g=TB;for(;d--;)f=l[d],h=g.get(f),h===void 0&&g.set(f,h=d?new Map:jB(t)),g=h;return h};mA();const wb={http:B$,xhr:bB,fetch:{get:mA}};ce.forEach(wb,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const pj=e=>`- ${e}`,_B=e=>ce.isFunction(e)||e===null||e===!1;function NB(e,t){e=ce.isArray(e)?e:[e];const{length:n}=e;let r,o;const l={};for(let c=0;c<n;c++){r=e[c];let d;if(o=r,!_B(r)&&(o=wb[(d=String(r)).toLowerCase()],o===void 0))throw new mt(`Unknown adapter '${d}'`);if(o&&(ce.isFunction(o)||(o=o.get(t))))break;l[d||"#"+c]=o}if(!o){const c=Object.entries(l).map(([f,h])=>`adapter ${f} `+(h===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since :
488
- `+c.map(pj).join(`
489
- `):" "+pj(c[0]):"as no adapter specified";throw new mt("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return o}const pA={getAdapter:NB,adapters:wb};function Fx(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Uu(null,e)}function gj(e){return Fx(e),e.headers=fa.from(e.headers),e.data=Ux.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),pA.getAdapter(e.adapter||Kf.adapter,e)(e).then(function(r){return Fx(e),r.data=Ux.call(e,e.transformResponse,r),r.headers=fa.from(r.headers),r},function(r){return uA(r)||(Fx(e),r&&r.response&&(r.response.data=Ux.call(e,e.transformResponse,r.response),r.response.headers=fa.from(r.response.headers))),Promise.reject(r)})}const gA="1.13.2",_g={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_g[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const yj={};_g.transitional=function(t,n,r){function o(l,c){return"[Axios v"+gA+"] Transitional option '"+l+"'"+c+(r?". "+r:"")}return(l,c,d)=>{if(t===!1)throw new mt(o(c," has been removed"+(n?" in "+n:"")),mt.ERR_DEPRECATED);return n&&!yj[c]&&(yj[c]=!0,console.warn(o(c," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(l,c,d):!0}};_g.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function AB(e,t,n){if(typeof e!="object")throw new mt("options must be an object",mt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const l=r[o],c=t[l];if(c){const d=e[l],f=d===void 0||c(d,l,e);if(f!==!0)throw new mt("option "+l+" must be "+f,mt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new mt("Unknown option "+l,mt.ERR_BAD_OPTION)}}const tp={assertOptions:AB,validators:_g},Ps=tp.validators;let Ll=class{constructor(t){this.defaults=t||{},this.interceptors={request:new sj,response:new sj}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const l=o.stack?o.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=Bl(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:l}=n;r!==void 0&&tp.assertOptions(r,{silentJSONParsing:Ps.transitional(Ps.boolean),forcedJSONParsing:Ps.transitional(Ps.boolean),clarifyTimeoutError:Ps.transitional(Ps.boolean)},!1),o!=null&&(ce.isFunction(o)?n.paramsSerializer={serialize:o}:tp.assertOptions(o,{encode:Ps.function,serialize:Ps.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),tp.assertOptions(n,{baseUrl:Ps.spelling("baseURL"),withXsrfToken:Ps.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"],E=>{delete l[E]}),n.headers=fa.concat(c,l);const d=[];let f=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(f=f&&S.synchronous,d.unshift(S.fulfilled,S.rejected))});const h=[];this.interceptors.response.forEach(function(S){h.push(S.fulfilled,S.rejected)});let g,y=0,v;if(!f){const E=[gj.bind(this),void 0];for(E.unshift(...d),E.push(...h),v=E.length,g=Promise.resolve(n);y<v;)g=g.then(E[y++],E[y++]);return g}v=d.length;let b=n;for(;y<v;){const E=d[y++],S=d[y++];try{b=E(b)}catch(C){S.call(this,C);break}}try{g=gj.call(this,b)}catch(E){return Promise.reject(E)}for(y=0,v=h.length;y<v;)g=g.then(h[y++],h[y++]);return g}getUri(t){t=Bl(this.defaults,t);const n=fA(t.baseURL,t.url,t.allowAbsoluteUrls);return iA(n,t.params,t.paramsSerializer)}};ce.forEach(["delete","get","head","options"],function(t){Ll.prototype[t]=function(n,r){return this.request(Bl(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(Bl(d||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:l,data:c}))}}Ll.prototype[t]=n(),Ll.prototype[t+"Form"]=n(!0)});let DB=class yA{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(o=>{if(!r._listeners)return;let l=r._listeners.length;for(;l-- >0;)r._listeners[l](o);r._listeners=null}),this.promise.then=o=>{let l;const c=new Promise(d=>{r.subscribe(d),l=d}).then(o);return c.cancel=function(){r.unsubscribe(l)},c},t(function(l,c,d){r.reason||(r.reason=new Uu(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 yA(function(o){t=o}),cancel:t}}};function OB(e){return function(n){return e.apply(null,n)}}function MB(e){return ce.isObject(e)&&e.isAxiosError===!0}const z0={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(z0).forEach(([e,t])=>{z0[t]=e});function vA(e){const t=new Ll(e),n=Y4(Ll.prototype.request,t);return ce.extend(n,Ll.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return vA(Bl(e,o))},n}const Un=vA(Kf);Un.Axios=Ll;Un.CanceledError=Uu;Un.CancelToken=DB;Un.isCancel=uA;Un.VERSION=gA;Un.toFormData=Tg;Un.AxiosError=mt;Un.Cancel=Un.CanceledError;Un.all=function(t){return Promise.all(t)};Un.spread=OB;Un.isAxiosError=MB;Un.mergeConfig=Bl;Un.AxiosHeaders=fa;Un.formToJSON=e=>cA(ce.isHTMLForm(e)?new FormData(e):e);Un.getAdapter=pA.getAdapter;Un.HttpStatusCode=z0;Un.default=Un;const{Axios:ice,AxiosError:vj,CanceledError:lce,isCancel:cce,CancelToken:uce,VERSION:dce,all:fce,Cancel:hce,isAxiosError:mce,spread:pce,toFormData:gce,AxiosHeaders:IB,HttpStatusCode:yce,formToJSON:vce,getAdapter:xce,mergeConfig:bce}=Un;function kB(e){return{id:e.userId,email:e.email,fullName:e.fullName,roles:e.roles,projectId:e.projectId,projectTitle:e.projectTitle,avatar:e.avatar}}const Eu={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 LB(e){if(e&&typeof e=="object"&&"response"in e){const n=e,{status:r,data:o}=n.response;switch(r){case 401:return{message:(o==null?void 0:o.message)??"Invalid credentials or session expired",code:"UNAUTHORIZED",statusCode:401};case 403:return{message:(o==null?void 0:o.message)??"Access forbidden",code:"FORBIDDEN",statusCode:403};case 422:return{message:(o==null?void 0:o.message)??"Invalid request data",code:"VALIDATION_ERROR",statusCode:422};default:return{message:(o==null?void 0:o.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 Rb=Un.create({baseURL:"/",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"},withCredentials:!0});function PB(){const e=window.location.pathname+window.location.search,t=new URL(Eu.SIGN_IN,window.location.origin);e.startsWith("/auth/")||t.searchParams.set("redirect",e),window.location.href=t.toString()}function UB(){const e=new URL(Eu.SIGN_OUT,window.location.origin);e.searchParams.set("redirect",Eu.SIGN_IN),window.location.href=e.toString()}async function FB(){try{return(await Rb.post(Eu.ACCESS_TOKEN,{})).data}catch(e){const t=LB(e);throw new Error(t.message)}}async function VB(e){const t=await Rb.get(Eu.API_USER,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}});return kB(t.data)}async function zB(e){return(await Rb.get(Eu.API_PROJECTS,{headers:{"X-OWOX-Authorization":`Bearer ${e}`}})).data}const xA=m.createContext(null);class HB{constructor(t,n){Ls(this,"getToken");Ls(this,"refreshFn");this.getToken=t,this.refreshFn=n}getAccessToken(){return this.getToken()}async refreshToken(){return await this.refreshFn()}}let jb=null;function $B(e){jb=e}function Tb(){return jb}function Am(){jb=null}const BB=()=>{typeof window<"u"&&!window.dataLayer&&(window.dataLayer=[])},Ue=e=>{e.timestamp=e.timestamp??Date.now(),e.eventType=e.eventType??"app",bA(e)},GB=e=>{Ue({event:"system_user_identified",eventType:"system",category:"UserSession",action:"Identified",...e})},qB=()=>{Ue({event:"system_user_logged_out",eventType:"system",category:"UserSession",action:"Logout"})},bA=e=>{var t;if(typeof window<"u"){BB();try{(t=window.dataLayer)==null||t.push(e)}catch(n){console.error("Failed to push data to dataLayer",n)}}};function ZB(e,t){switch(t.type){case"SET_LOADING":return{...e,status:kr.LOADING,error:void 0};case"SET_AUTHENTICATED":return{...e,status:kr.AUTHENTICATED,session:t.payload.session,error:void 0};case"SET_UNAUTHENTICATED":return{...e,status:kr.UNAUTHENTICATED,session:null,error:void 0};case"SET_USER":return{...e,user:t.payload.user};case"SET_ERROR":return{...e,status:kr.ERROR,error:t.payload};case"CLEAR_ERROR":return{...e,error:void 0};default:return e}}const KB={status:kr.LOADING,session:null,user:null};function YB({children:e}){var g;const[t,n]=m.useReducer(ZB,KB);m.useEffect(()=>{var y;if((y=t.session)!=null&&y.accessToken){const v=new HB(()=>{var b;return((b=t.session)==null?void 0:b.accessToken)??null},async()=>await o());$B(v)}else Am()},[(g=t.session)==null?void 0:g.accessToken]);const r=m.useCallback(()=>{PB()},[]);async function o(){try{const v=(await FB()).accessToken;if(!v)throw new Error("Invalid token received");const b={accessToken:v},E=await VB(v);return n({type:"SET_USER",payload:{user:E}}),n({type:"SET_AUTHENTICATED",payload:{session:b}}),v}catch(y){throw Am(),n({type:"SET_UNAUTHENTICATED"}),y}}const l=m.useCallback(async()=>{await o()},[]),c=m.useCallback(async()=>{try{n({type:"SET_LOADING"});try{await l()}catch{n({type:"SET_UNAUTHENTICATED"}),r()}}catch(y){console.error("Failed to initialize auth:",y),Am(),n({type:"SET_UNAUTHENTICATED"})}},[l,r]),d=m.useCallback(()=>{try{qB()}finally{UB()}},[]),f=m.useCallback(()=>{n({type:"CLEAR_ERROR"})},[]);m.useEffect(()=>{c()},[c]),m.useEffect(()=>{t.user&&(bA({projectId:t.user.projectId}),GB({userId:t.user.id,userEmail:t.user.email,userFullName:t.user.fullName}))},[t.user]),m.useEffect(()=>{const y=()=>{d()};return window.addEventListener("auth:logout",y),()=>{window.removeEventListener("auth:logout",y),Am()}},[d]);const h={...t,signIn:r,signOut:d,refreshToken:l,clearError:f};return a.jsx(xA.Provider,{value:h,children:e})}function el(){const e=m.useContext(xA);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}function SA(){const{status:e,session:t,user:n,error:r}=el();return{status:e,session:t,user:n,error:r,isLoading:e===kr.LOADING,isAuthenticated:e===kr.AUTHENTICATED,isUnauthenticated:e===kr.UNAUTHENTICATED,hasError:e===kr.ERROR}}function WB(){const{user:e}=el();return e}function hu({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"},o=e?"flex h-screen items-center justify-center":"flex items-center justify-center p-4";return a.jsx("div",{className:o,children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:` ${r[t]} mx-auto mb-4 animate-spin rounded-full border-gray-300 border-t-blue-600`}),n&&a.jsx("p",{className:"text-sm text-gray-600",children:n})]})})}function xj({message:e}){return a.jsx(hu,{fullScreen:!0,message:e})}function bj(){return a.jsx("div",{className:"flex h-screen items-center justify-center",children:a.jsxs("div",{className:"text-center",children:[a.jsx("h2",{className:"mb-4 text-2xl font-bold text-gray-900",children:"Authentication Required"}),a.jsx("p",{className:"mb-6 text-gray-600",children:"You need to sign in to access this page."}),a.jsx(xe,{onClick:()=>window.location.href="/api/auth/sign-in",children:"Sign In"})]})})}function QB({children:e,fallback:t,redirectTo:n}){const{isLoading:r,isAuthenticated:o,isUnauthenticated:l}=SA();return r?a.jsx(xj,{}):o?a.jsx(a.Fragment,{children:e}):l?n?(window.location.href=n,a.jsx(xj,{})):t?a.jsx(a.Fragment,{children:t}):a.jsx(bj,{}):t?a.jsx(a.Fragment,{children:t}):a.jsx(bj,{})}const CA=m.createContext(null);function EA(){const e=m.useContext(CA);if(!e)throw new Error("useProjects must be used within a ProjectsProvider");return e}const XB="/ui",JB=()=>XB,Cp=(e,t)=>{const n=JB(),r=t.startsWith("/")?t:`/${t}`;return`${n}/${e}${r}`};function eG(){const{projects:e,loadProjects:t,error:n,isLoading:r}=EA(),{user:o}=el();return a.jsxs(vb,{children:[a.jsx(ma,{}),a.jsxs(xb,{className:"flex items-center gap-2",children:[a.jsx(k7,{className:"h-4 w-4"}),"Switch project"]}),a.jsx(e$,{children:a.jsxs(bb,{children:[r&&a.jsx(pt,{disabled:!0,children:a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Of,{className:"h-4 w-4 animate-spin"})," Loading projects..."]})}),!r&&n&&a.jsxs(a.Fragment,{children:[a.jsx(pt,{disabled:!0,children:"Unable to load projects. Please try again."}),a.jsx(pt,{onClick:()=>void t(),children:"Retry"})]}),!r&&!n&&e.map(l=>{const c=l.id===(o==null?void 0:o.projectId);return a.jsx(pt,{asChild:!0,children:a.jsxs(Nf,{to:Cp(encodeURIComponent(l.id),"/"),className:"flex items-center gap-2",children:[c?a.jsx(lr,{className:"h-4 w-4"}):a.jsx("span",{className:"h-4 w-4"}),l.title]})},l.id)})]})})]})}function tG(){return a.jsx(eG,{})}const nG=({className:e,size:t=24})=>a.jsx("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{fill:"currentColor",d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})}),wA=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M10.6842 44.2221L0.419465 26.278C-0.139822 25.3001 -0.139822 23.6999 0.419465 22.722L10.6842 4.77786C11.2435 3.79993 12.6166 3 13.7355 3H34.265C35.3838 3 36.7567 3.79993 37.3163 4.77786L47.5801 22.722C48.14 23.6999 48.14 25.3001 47.5801 26.278L37.3163 44.2221C36.7567 45.2001 35.3838 46 34.265 46H13.7355C12.6166 46 11.2435 45.2001 10.6842 44.2221Z",fill:"#4486FA"}),a.jsx("path",{d:"M30.6154 18.3848L43.6923 32.8463L37.3828 43.85C36.8268 44.8118 35.4628 45.5986 34.3511 45.5986L17.5385 30.0771L30.6154 18.3848Z",fill:"#3778ED"}),a.jsx("path",{d:"M24.1539 33.1537C28.997 33.1537 32.9231 29.2276 32.9231 24.3845C32.9231 19.5414 28.997 15.6152 24.1539 15.6152C19.3108 15.6152 15.3846 19.5414 15.3846 24.3845C15.3846 29.2276 19.3108 33.1537 24.1539 33.1537Z",fill:"white"}),a.jsx("path",{d:"M31.2681 29.2331L34.3825 32.3476C34.7428 32.7079 34.7428 33.2925 34.3825 33.6528L33.7296 34.3057C33.3693 34.666 32.7847 34.666 32.4244 34.3057L29.3099 31.1913C28.9496 30.831 28.9496 30.2464 29.3099 29.886L29.9628 29.2331C30.3231 28.8728 30.9077 28.8728 31.2681 29.2331Z",fill:"white"}),a.jsx("path",{d:"M24.1538 31.0003C27.8074 31.0003 30.7692 28.0385 30.7692 24.3849C30.7692 20.7313 27.8074 17.7695 24.1538 17.7695C20.5003 17.7695 17.5385 20.7313 17.5385 24.3849C17.5385 28.0385 20.5003 31.0003 24.1538 31.0003Z",fill:"#4486FA"}),a.jsx("path",{d:"M24.1538 29.4615C26.9577 29.4615 29.2308 27.1884 29.2308 24.3845C29.2308 21.5806 26.9577 19.3076 24.1538 19.3076C21.3499 19.3076 19.0769 21.5806 19.0769 24.3845C19.0769 27.1884 21.3499 29.4615 24.1538 29.4615Z",fill:"#4486FA"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M23.3846 21.4619H25.2308V29.4619H23.3846V21.4619ZM26.4615 24.8465H28.3077V28.5388H26.4615V24.8465ZM21.8462 23.6158H20V28.5388H21.8462V23.6158Z",fill:"white"})]}),RA=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M48 29.0142L24 26.0256L0 29.0142L24 48L48 29.0142Z",fill:"#FCBF92"}),a.jsx("path",{d:"M0 29.0142L24 36.2676V48L0 35.8398V29.0142Z",fill:"#9D5025"}),a.jsx("path",{d:"M48 29.0142L24 36.2676V48L48 35.8398V29.0142Z",fill:"#F58534"}),a.jsx("path",{d:"M3.099 18.7008H0V25.5978L3.099 26.1684L6.5436 22.4742L3.099 18.7014V18.7008Z",fill:"#9D5025"}),a.jsx("path",{d:"M6.54421 25.8828L3.09961 26.1678V18.7008H6.54421V25.8828Z",fill:"#F58534"}),a.jsx("path",{d:"M8.86613 10.0992L4.78613 10.8768V26.5248L8.86613 27.3804L12.6005 18.7002L8.86613 10.0986V10.0992Z",fill:"#9D5025"}),a.jsx("path",{d:"M12.6 26.9526L8.86621 27.3804V10.0992L12.6 10.527V26.9526Z",fill:"#F58534"}),a.jsx("path",{d:"M16.8213 13.5798L11.1885 14.1504V27.873L16.8213 29.0142L22.8003 21.261L16.8213 13.5798Z",fill:"#9D5025"}),a.jsx("path",{d:"M20.6187 28.3722L16.8213 29.0142V13.5798L20.6187 13.8648V28.3722Z",fill:"#F58534"}),a.jsx("path",{d:"M23.9995 1.134L20.2021 2.3466V29.6562L23.9995 30.4332L27.7969 15.7836L23.9995 1.134Z",fill:"#9D5025"}),a.jsx("path",{d:"M27.5156 28.3722L31.1792 29.0142L36.812 18.7008L31.1792 8.4588L27.5156 9.0294V28.3722Z",fill:"#9D5025"}),a.jsx("path",{d:"M36.812 18.7008L31.1792 8.4588L27.5156 9.0294",fill:"#9D5025"}),a.jsx("path",{d:"M35.3281 26.9532L39.1327 27.381L43.2127 14.3646L39.1327 1.4196L35.3281 2.3466V26.9532Z",fill:"#9D5025"}),a.jsx("path",{d:"M41.4551 25.8828L44.8997 26.1678L47.9987 13.2948L44.8997 0L41.4551 0.8556V25.8828Z",fill:"#9D5025"}),a.jsx("path",{d:"M24 1.134L27.7974 2.3466V29.6562L24 30.4332V1.134ZM36.8118 9.6L31.179 8.4588V29.0142L36.8118 27.873V9.6ZM43.2144 3.06L39.1344 1.4196V27.381L43.2144 26.5248V3.06ZM48 1.5618L44.901 0V26.1684L48 25.5978V1.5618Z",fill:"#F58534"})]}),rG=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0C19.7661 0 12 0 10 0C8.19719 0 6 2.18498 6 4V44C6 45.815 8.18947 47.9993 10 47.9993H38C39.8105 47.9993 42 45.815 42 44C42 44 42 25.6447 42 14L28 0Z",fill:"#00A65F"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 14H42V24L28 14Z",fill:"#007944"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M28 0V13.9683L42 14L28 0Z",fill:"#64C3A7"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 42L12.0563 22H36V42H12ZM34 24H14V40H34V24Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20 22H22V42H20V22Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 28V30H12V28H36Z",fill:"white"}),a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M36 34V36H12V34H36Z",fill:"white"})]}),aG=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M23.7876 0C22.2395 0 20.8149 0.856389 20.0821 2.22332C19.3574 3.59024 19.4398 5.25361 20.3044 6.5382L22.0995 4.75131C22.0419 4.57015 22.009 4.38899 22.009 4.1996C22.009 3.21969 22.7995 2.42918 23.7794 2.42918C24.7593 2.42918 25.5498 3.21969 25.5498 4.1996C25.5498 5.1795 24.7593 5.97002 23.7794 5.97002C23.59 5.97002 23.4088 5.93708 23.2277 5.87944L21.4325 7.66632C22.923 8.67917 24.891 8.62153 26.3238 7.53457C27.7566 6.44762 28.3331 4.56192 27.7566 2.85737C27.1885 1.1446 25.5827 0 23.7876 0Z",fill:"#34A853"}),a.jsx("path",{d:"M22.1161 12.2282C22.1161 10.8118 21.6632 9.42842 20.8068 8.30029L18.4846 10.6224C19.2093 11.9564 18.954 13.6033 17.8506 14.6491L19.1187 17.737C20.9797 16.5266 22.1161 14.4515 22.1161 12.2282Z",fill:"#FBBC04"}),a.jsx("path",{d:"M15.6108 15.5637H15.5531C14.1286 15.5637 12.8604 14.6579 12.3993 13.3075C11.9382 11.957 12.3828 10.4666 13.511 9.58547C14.6391 8.70438 16.1954 8.64674 17.3894 9.43725L19.6951 7.13159C17.4553 5.31176 14.2932 5.17177 11.897 6.78574C9.50076 8.3997 8.44675 11.3806 9.28667 14.1392C10.1266 16.8977 12.671 18.7834 15.5531 18.7834C15.9978 18.7834 16.4425 18.7422 16.8789 18.6517L15.6108 15.5637Z",fill:"#EA4335"}),a.jsx("path",{d:"M23.87 18.231C22.4125 18.231 20.9632 18.4451 19.5716 18.8568L21.4161 23.3611C22.2148 23.1634 23.0383 23.0646 23.87 23.0646C28.6625 23.0646 32.7797 26.449 33.7184 31.1509C34.6489 35.8528 32.1374 40.5547 27.7155 42.3828C23.2936 44.2108 18.1882 42.6627 15.5284 38.6855C12.8687 34.7082 13.3792 29.3969 16.7636 26.0043C17.4718 25.2962 18.2787 24.7033 19.1598 24.2339L17.34 19.7461C10.5465 23.0728 7.32686 30.9697 9.86308 38.1008C12.3993 45.2319 19.8762 49.3244 27.2461 47.6117C34.616 45.9071 39.532 38.9407 38.6756 31.4226C37.8192 23.9045 31.454 18.231 23.8864 18.231H23.87Z",fill:"#4285F4"})]}),sG=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M6.10815 8C6.10815 6.89543 7.00358 6 8.10815 6H40.1082C41.2127 6 42.1082 6.89543 42.1082 8V40C42.1082 41.1046 41.2127 42 40.1082 42H8.10816C7.00359 42 6.10815 41.1046 6.10815 40V8Z",fill:"#FF9800"}),a.jsx("path",{d:"M11 11H23V14H11V11Z",fill:"white"}),a.jsx("path",{d:"M11 16H23V19H11V16Z",fill:"white"}),a.jsx("path",{d:"M11 21H23V24H11V21Z",fill:"white"}),a.jsx("path",{d:"M11 26H23V29H11V26Z",fill:"white"}),a.jsx("path",{d:"M25 11H37V14H25V11Z",fill:"white"}),a.jsx("path",{d:"M25 16H37V19H25V16Z",fill:"white"}),a.jsx("path",{d:"M25 21H37V24H25V21Z",fill:"white"}),a.jsx("path",{d:"M25 26H37V29H25V26Z",fill:"white"}),a.jsx("path",{d:"M25 31H37V34H25V31Z",fill:"white"}),a.jsx("path",{d:"M13 35C13 32.7909 14.7909 31 17 31C19.2091 31 21 32.7909 21 35C21 37.2091 19.2091 39 17 39C14.7909 39 13 37.2091 13 35Z",fill:"white"})]}),oG=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M41.1492 36.5821L31.017 30.7288C29.5935 29.9092 27.7733 30.3966 26.9494 31.8201C26.6302 32.3808 26.5051 32.9976 26.5655 33.5972V45.0365C26.5655 46.6712 27.894 47.9998 29.5331 47.9998C31.1679 47.9998 32.4965 46.6712 32.4965 45.0365V38.4585L38.173 41.7367C39.5964 42.5605 41.421 42.0688 42.2405 40.6454C43.0644 39.2219 42.577 37.4017 41.1492 36.5821Z",fill:"#29B5E8"}),a.jsx("path",{d:"M15.949 24.039C15.9663 22.9822 15.4099 21.9987 14.4954 21.4682L4.36313 15.6192C3.92316 15.3647 3.41849 15.231 2.91381 15.231C1.87427 15.231 0.908061 15.7874 0.390448 16.6846C-0.411852 18.0735 0.0669408 19.855 1.45587 20.6573L7.29627 24.0261L1.45587 27.3992C0.782972 27.7874 0.299866 28.4128 0.101448 29.1634C-0.101284 29.9139 0.00223886 30.699 0.390448 31.3719C0.908061 32.2691 1.87427 32.8255 2.9095 32.8255C3.41849 32.8255 3.92316 32.6918 4.36313 32.4373L14.4954 26.5883C15.4012 26.062 15.9577 25.0872 15.949 24.039Z",fill:"#29B5E8"}),a.jsx("path",{d:"M6.6628 11.4738L16.7951 17.3228C17.977 18.0086 19.4349 17.7843 20.3666 16.8742C20.9576 16.3307 21.3242 15.5543 21.3242 14.6916V2.96765C21.3242 1.32854 19.9957 0 18.3609 0C16.7217 0 15.3932 1.32854 15.3932 2.96765V9.64054L9.63907 6.31919C8.21564 5.49532 6.39536 5.98274 5.5715 7.40618C4.74763 8.82962 5.23936 10.6499 6.6628 11.4738Z",fill:"#29B5E8"}),a.jsx("path",{d:"M29.4459 24.5131C29.4459 24.7374 29.3165 25.048 29.1569 25.2119L25.1411 29.2277C24.9815 29.3873 24.6666 29.5167 24.4423 29.5167H23.42C23.1957 29.5167 22.8808 29.3873 22.7212 29.2277L18.7011 25.2119C18.5415 25.048 18.4121 24.7374 18.4121 24.5131V23.4908C18.4121 23.2622 18.5415 22.9516 18.7011 22.792L22.7212 18.7719C22.8808 18.6123 23.1957 18.4829 23.42 18.4829H24.4423C24.6666 18.4829 24.9815 18.6123 25.1411 18.7719L29.1569 22.792C29.3165 22.9516 29.4459 23.2622 29.4459 23.4908V24.5131ZM25.8614 24.0214V23.9782C25.8614 23.8143 25.7665 23.5857 25.6501 23.4649L24.4639 22.2831C24.3474 22.1623 24.1188 22.0674 23.9506 22.0674H23.9074C23.7435 22.0674 23.5149 22.1623 23.3941 22.2831L22.2123 23.4649C22.0958 23.5814 22.0009 23.81 22.0009 23.9782V24.0214C22.0009 24.1896 22.0958 24.4182 22.2123 24.5347L23.3941 25.7209C23.5149 25.8373 23.7435 25.9322 23.9074 25.9322H23.9506C24.1188 25.9322 24.3474 25.8373 24.4639 25.7209L25.6501 24.5347C25.7665 24.4182 25.8614 24.1896 25.8614 24.0214Z",fill:"#29B5E8"}),a.jsx("path",{d:"M31.0158 17.3228L41.1481 11.4738C42.5715 10.6542 43.0632 8.82962 42.2394 7.40618C41.4155 5.98274 39.5952 5.49532 38.1718 6.31919L32.4953 9.59741V2.96765C32.4953 1.32854 31.1667 0 29.532 0C27.8928 0 26.5643 1.32854 26.5643 2.96765V14.4587C26.5082 15.0539 26.6247 15.675 26.9482 16.2358C27.7721 17.6592 29.5923 18.1467 31.0158 17.3228Z",fill:"#29B5E8"}),a.jsx("path",{d:"M18.8267 30.3841C18.1538 30.2546 17.4335 30.3625 16.7951 30.7291L6.6628 36.5825C5.23936 37.402 4.74763 39.2223 5.5715 40.6457C6.39536 42.0735 8.21564 42.5609 9.63907 41.737L15.3932 38.4157V45.0368C15.3932 46.6716 16.7217 48.0002 18.3609 48.0002C19.9957 48.0002 21.3242 46.6716 21.3242 45.0368V33.3129C21.3242 31.8334 20.2415 30.6083 18.8267 30.3841Z",fill:"#29B5E8"}),a.jsx("path",{d:"M47.4814 16.6501C46.6618 15.2223 44.8372 14.7349 43.4138 15.5588L33.2815 21.4078C32.311 21.9685 31.7761 22.9951 31.7934 24.039C31.7847 25.0785 32.3196 26.0922 33.2815 26.6443L43.4138 32.4977C44.8372 33.3172 46.6575 32.8298 47.4814 31.4064C48.3052 29.9829 47.8135 28.1626 46.3901 27.3388L40.6532 24.0261L46.3901 20.7133C47.8178 19.8938 48.3052 18.0735 47.4814 16.6501Z",fill:"#29B5E8"})]}),iG=({className:e,size:t=24})=>a.jsx("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:a.jsx("path",{d:"M45.8905 35.0619V26.9571L45.0149 26.4095L24 37.9095L4.0796 26.9571V22.2476L24 33.0905L46 21.1524V13.1571L45.1244 12.6095L24 24.219L4.84577 13.7048L24 3.19048L39.4328 11.6238L40.6368 10.9667V10.0905L24 1L2 12.9381V14.1429L24 26.1905L43.9204 15.2381V20.0571L24 31.0095L2.87562 19.4L2 19.9476V28.0524L24 39.9905L43.9204 29.1476V33.8571L24 44.8095L2.87562 33.3095L2 33.8571V35.0619L24 47L45.8905 35.0619Z",fill:"#FF3621"})}),lG=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M2 8.48783L5.5122 7.02441V40.9756L2 39.5122V8.48783Z",fill:"#205B98"}),a.jsx("path",{d:"M5.51172 7.02441L12.2434 8.48783V39.5122L5.51172 40.9756V7.02441Z",fill:"#5294CF"}),a.jsx("path",{d:"M12.2441 3.5122L18 0V48L12.2441 44.4878V3.5122Z",fill:"#205B98"}),a.jsx("path",{d:"M18 0H30V48H18V0Z",fill:"#2D72B8"}),a.jsx("path",{d:"M35.3665 3.5122L30 0V48L35.3665 44.4878V3.5122Z",fill:"#5294CF"}),a.jsx("path",{d:"M45.6099 8.48783L42.0977 7.02441V40.9756L45.6099 39.5122V8.48783Z",fill:"#5294CF"}),a.jsx("path",{d:"M42.0969 7.02441L35.3652 8.48783V39.5122L42.0969 40.9756V7.02441Z",fill:"#205B98"})]}),cG=({className:e,size:t=24})=>a.jsxs("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:e,style:{minWidth:t,minHeight:t},children:[a.jsx("path",{d:"M23.9333 0L3 11.9733V35.8933L23.9333 48L44.8667 36.0267V12.0267L23.9333 0ZM41 33.52L23.9333 43.3867L6.86667 33.624V14.3467L23.9333 4.48L41 14.3733V33.52Z",fill:"#0078D4"}),a.jsx("path",{d:"M23.9333 0L3 11.9733L6.86667 14.3467L23.9333 4.48L41 14.3467L44.8667 11.9733L23.9333 0Z",fill:"url(#paint0_linear_19_1262)"}),a.jsx("path",{d:"M33.9068 27.9336C33.7031 27.5984 33.4028 27.3325 33.0454 27.1709C31.9608 24.8031 30.2991 22.7454 28.2128 21.1865C26.1265 19.6276 23.6822 18.6173 21.1041 18.2482L38.3761 8.26689L34.3601 5.96289L14.6908 17.3336C14.3087 17.5535 14.0099 17.8936 13.8411 18.3009C13.6722 18.7082 13.6426 19.1598 13.757 19.5857C13.8714 20.0115 14.1232 20.3876 14.4734 20.6554C14.8236 20.9233 15.2525 21.068 15.6934 21.0669C15.7747 21.0519 15.8549 21.0314 15.9334 21.0056L16.2668 22.4002C18.7745 21.8089 21.4081 22.0755 23.7464 23.1574C26.0848 24.2393 27.9928 26.074 29.1654 28.3682L9.56812 39.6936L13.5681 42.0029L33.1761 30.6669C33.4376 30.5106 33.6586 30.295 33.8214 30.0376L34.0214 29.9896C34.0028 29.9122 33.9734 29.8429 33.9548 29.7656C34.0967 29.4794 34.1665 29.1629 34.1581 28.8436C34.1497 28.5243 34.0634 28.2119 33.9068 27.9336Z",fill:"#50E6FF"}),a.jsx("path",{d:"M32.176 24.0347C31.2003 24.0347 30.2465 24.3241 29.4352 24.8662C28.6239 25.4082 27.9916 26.1787 27.6182 27.0802C27.2448 27.9816 27.1471 28.9735 27.3375 29.9305C27.5278 30.8875 27.9977 31.7665 28.6876 32.4565C29.3775 33.1464 30.2566 33.6163 31.2135 33.8066C32.1705 33.997 33.1625 33.8993 34.0639 33.5259C34.9653 33.1525 35.7358 32.5202 36.2779 31.7089C36.82 30.8976 37.1093 29.9438 37.1093 28.9681C37.1093 27.6597 36.5896 26.4049 35.6644 25.4797C34.7392 24.5545 33.4844 24.0347 32.176 24.0347ZM15.6907 14.0454C14.7149 14.0454 13.7611 14.3347 12.9498 14.8768C12.1386 15.4189 11.5062 16.1894 11.1329 17.0908C10.7595 17.9923 10.6618 18.9842 10.8521 19.9412C11.0425 20.8982 11.5123 21.7772 12.2023 22.4671C12.8922 23.1571 13.7712 23.6269 14.7282 23.8173C15.6852 24.0076 16.6771 23.9099 17.5786 23.5365C18.48 23.1632 19.2505 22.5308 19.7926 21.7196C20.3347 20.9083 20.624 19.9545 20.624 18.9787C20.624 17.6703 20.1042 16.4155 19.1791 15.4904C18.2539 14.5652 16.9991 14.0454 15.6907 14.0454Z",fill:"url(#paint1_linear_19_1262)"}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_19_1262",x1:"23.9333",y1:"14.3467",x2:"23.9333",y2:"0",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{offset:"0.199","stop-color":"#005BA1"}),a.jsx("stop",{offset:"1","stop-color":"#0078D4"})]}),a.jsxs("linearGradient",{id:"paint1_linear_19_1262",x1:"23.9333",y1:"33.9014",x2:"23.9333",y2:"14.0987",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.172","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.5","stop-color":"#198AB3"}),a.jsx("stop",{offset:"0.662","stop-color":"#32BEDD"}),a.jsx("stop",{offset:"0.975","stop-color":"#50E6FF"})]})]})]}),rc=({className:e="",size:t=24,base64:n})=>a.jsx("img",{src:n??void 0,alt:"icon",className:`max-w-none ${e}`,style:{width:t,height:t}}),uG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{fill:"currentColor",d:"M12.455 21.73c-4.585 0-7.749-.347-7.964-.371-.164-.013-1.55-.141-2.44-1.037-.9-.907-1.26-2.518-1.274-2.586-.01-.044-.29-1.267-.432-3.389a61.23 61.23 0 0 1-.078-2.403c0-3.559.49-5.744.511-5.835.016-.068.377-1.522 1.273-2.423.873-.88 2.11-1.02 2.296-1.036.244-.036 2.712-.38 7.444-.38 1.422 0 3.843.082 3.867.083 2.365.106 3.696.274 3.86.296.186.014 1.554.149 2.437 1.037.895.9 1.255 2.355 1.27 2.417.018.069.508 1.963.508 5.743 0 .89-.065 2.337-.068 2.399-.131 2.248-.405 3.447-.416 3.497-.043.174-.422 1.66-1.123 2.383-1.035 1.066-2.154 1.212-2.356 1.23-.248.039-2.558.375-7.315.375Zm-.664-18.502c-4.815 0-7.295.367-7.32.371a.446.446 0 0 1-.038.004c-.009 0-1.04.086-1.711.76-.705.709-1.016 1.955-1.02 1.967-.003.015-.485 2.174-.485 5.614 0 .836.076 2.331.077 2.347.135 2.028.407 3.222.41 3.234.004.02.317 1.413 1.018 2.12.67.673 1.831.758 1.843.759l.024.002c.031.004 3.198.366 7.866.366 4.848 0 7.161-.362 7.184-.365a.484.484 0 0 1 .05-.005c.033-.003.91-.074 1.757-.947.441-.455.784-1.552.879-1.937 0-.004.265-1.173.391-3.323 0-.01.067-1.48.067-2.349 0-3.636-.475-5.488-.48-5.507-.005-.021-.316-1.267-1.02-1.976-.67-.674-1.832-.759-1.844-.76a.391.391 0 0 1-.033-.003c-.013-.002-1.362-.182-3.785-.29-.02 0-2.424-.082-3.83-.082Z"}),a.jsx("path",{fill:"currentColor",d:"M5.415 17.057V6.247h7.074c2.212 0 3.318.925 3.318 2.776 0 .74-.142 1.316-.425 1.732a1.476 1.476 0 0 1-.768.609c.201.052.398.155.59.311.585.477.878 1.213.878 2.209 0 1.162-.284 1.99-.85 2.489-.521.456-1.353.684-2.496.684H5.415Zm.987-9.722v3.531h6.482c.686 0 1.171-.114 1.456-.344.32-.26.48-.718.48-1.374 0-.615-.142-1.063-.425-1.344-.312-.313-.815-.469-1.511-.469H6.402Zm0 4.62v4.013h6.718c.658 0 1.152-.165 1.481-.498.33-.331.493-.86.493-1.586 0-.684-.173-1.177-.52-1.478-.348-.3-.86-.45-1.536-.45l-6.636-.001ZM19.282 17.057h-1.067V6.247h1.067v10.81Z"}),a.jsx("path",{fill:"currentColor",d:"M23.467 11.846c0-3.756-.488-5.627-.5-5.673l-.001-.006a6.188 6.188 0 0 0-.292-.852c-.197-.47-.494-1.022-.906-1.438-.4-.401-.917-.64-1.37-.779a4.392 4.392 0 0 0-.9-.18h-.015c-.156-.021-1.48-.19-3.837-.295-.114-.004-2.465-.082-3.855-.082-4.717 0-7.172.342-7.406.376l-.008.002H4.37c-.176.015-1.328.15-2.131.958-.414.416-.711.97-.909 1.44a6.178 6.178 0 0 0-.292.855c-.025.105-.505 2.264-.505 5.771 0 .84.073 2.278.078 2.386l.059.747c.105 1.173.243 1.982.316 2.358l.05.24.002.004c.006.028.096.432.292.937.199.512.497 1.1.909 1.515.402.405.925.644 1.38.783.453.137.82.17.891.176h.01l.685.069c1.19.107 3.82.301 7.25.301 4.744 0 7.041-.335 7.275-.371l.008-.001h.009c.167-.015 1.215-.149 2.188-1.152.312-.321.567-.832.752-1.307a8.15 8.15 0 0 0 .303-.951c.019-.085.282-1.266.409-3.448.005-.107.068-1.514.068-2.383Zm-.95 0c0-3.598-.469-5.426-.471-5.436l-.001-.005s-.02-.077-.059-.202a5.943 5.943 0 0 0-.177-.49c-.14-.341-.34-.73-.599-1.034l-.114-.124c-.289-.29-.697-.464-1.053-.564a3.79 3.79 0 0 0-.577-.114l-.048-.004a.677.677 0 0 1-.05-.005l-.062-.009-.186-.021a33.921 33.921 0 0 0-.727-.074 60.204 60.204 0 0 0-2.78-.185c-.022 0-2.421-.08-3.822-.08-2.401 0-4.218.091-5.437.183a37.894 37.894 0 0 0-1.725.169l-.087.011-.03.005h-.003a.744.744 0 0 1-.06.005h.001c.007 0-.23.02-.547.117-.32.099-.701.271-.994.566-.316.317-.553.769-.714 1.158-.145.35-.221.63-.234.678 0 0-.478 2.138-.478 5.552 0 .828.077 2.317.077 2.334.134 1.992.399 3.168.404 3.189a6.681 6.681 0 0 0 .235.763c.163.43.4.911.71 1.223.289.29.696.464 1.052.564.35.098.621.119.621.119h.002l.037.003H4.63c.007.002.017.002.03.004l.112.013a62.06 62.06 0 0 0 2.03.167c1.373.09 3.326.18 5.653.18 4.78 0 7.082-.353 7.142-.362l.077-.009c.067-.006.833-.094 1.581-.865.182-.188.363-.533.514-.908.147-.366.252-.724.297-.905.012-.054.263-1.201.384-3.274.004-.086.067-1.495.067-2.333ZM15.54 9.024c0-.869-.257-1.477-.733-1.875-.485-.406-1.243-.632-2.318-.633H5.68v10.27h7.055c1.118 0 1.872-.224 2.321-.618.483-.424.758-1.16.758-2.285 0-.94-.275-1.586-.778-1.997a1.303 1.303 0 0 0-.49-.26l-.881-.229.864-.29a1.21 1.21 0 0 0 .632-.503v-.002c.242-.354.379-.87.379-1.578Zm4.007-3.048v11.351h-1.6V5.976h1.6Zm-1.067 10.81h.534V6.517h-.534v10.27Zm-3.653-2.902c0-.643-.163-1.043-.427-1.272l-.114-.086c-.28-.19-.687-.3-1.248-.3l-6.37-.001v3.473h6.45c.618 0 1.032-.155 1.293-.419.258-.26.416-.703.416-1.395Zm-.275-4.737c0-.579-.134-.941-.345-1.15v-.001c-.24-.24-.659-.391-1.324-.391H6.67v2.99h6.215c.673 0 1.08-.115 1.29-.284.227-.185.38-.543.38-1.164Zm.808 4.737c0 .76-.17 1.374-.571 1.778-.397.4-.971.577-1.67.577H6.135v-4.555l6.904.001c.71 0 1.293.157 1.708.516.43.373.614.959.614 1.683Zm7.689-2.038c0 .44-.017 1.029-.033 1.506l-.024.605-.008.182-.002.05v.022c-.127 2.161-.393 3.345-.399 3.37v.003c-.05.203-.164.586-.322.979-.154.383-.366.814-.625 1.082-.907.935-1.856 1.02-1.929 1.026h-.005a.241.241 0 0 0-.023.003c-.053.008-2.382.368-7.225.368-3.51 0-6.175-.204-7.305-.308l-.593-.059v-.001h-.011a4.034 4.034 0 0 1-.727-.137c-.395-.111-.903-.317-1.285-.701-.39-.394-.662-.963-.832-1.412a6.672 6.672 0 0 1-.258-.84l-.004-.017-.01-.046a17.864 17.864 0 0 1-.145-.816 28.269 28.269 0 0 1-.257-2.396v-.011l-.002-.013-.002-.052-.008-.185c-.008-.156-.018-.371-.027-.612-.02-.48-.039-1.069-.039-1.493 0-3.459.485-5.638.493-5.674v-.006l.003-.005.003-.014.012-.046.048-.162c.043-.135.107-.323.194-.533.172-.414.442-.94.831-1.331.378-.38.849-.588 1.214-.7.365-.113.645-.137.668-.139h.002l.015-.002c.089-.013 2.58-.373 7.358-.373.706 0 1.662.02 2.441.04.39.01.737.02.988.028l.297.01c.035 0 .063.002.082.003h.033c1.216.055 2.164.128 2.81.187l1 .106.008.001h.01l.018.003.045.004a4.322 4.322 0 0 1 .663.13c.394.111.903.317 1.286.702.388.39.657.918.829 1.333.165.399.249.717.26.764l.08.374c.14.717.409 2.458.409 5.203Zm.95 0c0 .897-.066 2.35-.069 2.41v.004c-.132 2.26-.407 3.475-.423 3.543v.005c-.023.093-.132.52-.326 1.018-.19.492-.477 1.086-.866 1.488-1.073 1.106-2.236 1.281-2.507 1.308-.265.04-2.589.378-7.354.378-4.598 0-7.772-.348-7.994-.373a4.92 4.92 0 0 1-.994-.196c-.439-.134-.964-.36-1.416-.743l-.189-.174c-.488-.492-.82-1.162-1.029-1.7a7.404 7.404 0 0 1-.316-1.019c-.023-.1-.298-1.332-.438-3.43v-.003C.075 14.289 0 12.81 0 11.943c0-3.578.493-5.782.519-5.895v-.003c.01-.044.11-.439.32-.941.21-.5.54-1.125 1.024-1.61l.18-.169c.925-.8 2.096-.929 2.281-.945C4.65 2.333 7.127 2 11.791 2c.714 0 1.678.02 2.464.041a215.63 215.63 0 0 1 1.297.038l.082.002.023.001h.013c2.311.104 3.641.268 3.867.297.104.008.516.048 1.016.202.498.153 1.107.426 1.59.913l.174.188c.389.451.664.984.848 1.42.202.482.3.865.316.93.025.092.519 2.01.519 5.814Zm-8.914-2.699c0 .69-.167 1.25-.58 1.586v.001c-.359.289-.922.402-1.622.402H6.135v-4.07l6.75-.002c.725 0 1.312.162 1.696.546l.124.142c.268.348.381.827.381 1.395Zm.988-.123c0 .77-.147 1.407-.472 1.884a1.905 1.905 0 0 1-.396.435l.165.12v.002c.666.543.977 1.369.977 2.418 0 1.199-.292 2.123-.942 2.694-.592.519-1.502.75-2.67.75H5.148V5.976h7.342c1.135 0 2.037.236 2.658.756.63.528.926 1.31.926 2.292Z"})]}),dG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M5.14132 15.1175C5.14132 16.4971 4.02636 17.612 2.64683 17.612C1.2673 17.612 0.152344 16.4971 0.152344 15.1175C0.152344 13.738 1.2673 12.623 2.64683 12.623H5.14132V15.1175ZM6.38856 15.1175C6.38856 13.738 7.50352 12.623 8.88305 12.623C10.2626 12.623 11.3775 13.738 11.3775 15.1175V21.3538C11.3775 22.7333 10.2626 23.8482 8.88305 23.8482C7.50352 23.8482 6.38856 22.7333 6.38856 21.3538V15.1175Z",fill:"#E01E5A"}),a.jsx("path",{d:"M8.88242 5.10226C7.50289 5.10226 6.38793 3.9873 6.38793 2.60777C6.38793 1.22824 7.50289 0.113281 8.88242 0.113281C10.2619 0.113281 11.3769 1.22824 11.3769 2.60777V5.10226H8.88242ZM8.88242 6.3684C10.2619 6.3684 11.3769 7.48336 11.3769 8.86289C11.3769 10.2424 10.2619 11.3574 8.88242 11.3574H2.6273C1.24777 11.3574 0.132812 10.2424 0.132812 8.86289C0.132812 7.48336 1.24777 6.3684 2.6273 6.3684H8.88242Z",fill:"#36C5F0"}),a.jsx("path",{d:"M18.8768 8.86289C18.8768 7.48336 19.9918 6.3684 21.3713 6.3684C22.7509 6.3684 23.8658 7.48336 23.8658 8.86289C23.8658 10.2424 22.7509 11.3574 21.3713 11.3574H18.8768V8.86289ZM17.6296 8.86289C17.6296 10.2424 16.5146 11.3574 15.1351 11.3574C13.7556 11.3574 12.6406 10.2424 12.6406 8.86289V2.60777C12.6406 1.22824 13.7556 0.113281 15.1351 0.113281C16.5146 0.113281 17.6296 1.22824 17.6296 2.60777V8.86289Z",fill:"#2EB67D"}),a.jsx("path",{d:"M15.1351 18.8593C16.5146 18.8593 17.6296 19.9742 17.6296 21.3538C17.6296 22.7333 16.5146 23.8482 15.1351 23.8482C13.7556 23.8482 12.6406 22.7333 12.6406 21.3538V18.8593H15.1351ZM15.1351 17.612C13.7556 17.612 12.6406 16.4971 12.6406 15.1175C12.6406 13.738 13.7556 12.623 15.1351 12.623H21.3902C22.7698 12.623 23.8847 13.738 23.8847 15.1175C23.8847 16.4971 22.7698 17.612 21.3902 17.612H15.1351Z",fill:"#ECB22E"})]}),fG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"13",y:"2",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M19 8.5V10h1.5A1.5 1.5 0 1 0 19 8.5"}),a.jsx("rect",{fill:"currentColor",width:"3",height:"8",x:"8",y:"14",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M5 15.5V14H3.5A1.5 1.5 0 1 0 5 15.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"14",y:"13",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M15.5 19H14v1.5a1.5 1.5 0 1 0 1.5-1.5"}),a.jsx("rect",{fill:"currentColor",width:"8",height:"3",x:"2",y:"8",rx:"1.5"}),a.jsx("path",{fill:"currentColor",d:"M8.5 5H10V3.5A1.5 1.5 0 1 0 8.5 5"})]}),hG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M16 16H22",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M19 13V19",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M21 9.99795V7.99795C20.9996 7.64722 20.9071 7.30276 20.7315 6.99911C20.556 6.69546 20.3037 6.44331 20 6.26795L13 2.26795C12.696 2.09241 12.3511 2 12 2C11.6489 2 11.304 2.09241 11 2.26795L4 6.26795C3.69626 6.44331 3.44398 6.69546 3.26846 6.99911C3.09294 7.30276 3.00036 7.64722 3 7.99795V15.9979C3.00036 16.3487 3.09294 16.6931 3.26846 16.9968C3.44398 17.3004 3.69626 17.5526 4 17.7279L11 21.7279C11.304 21.9035 11.6489 21.9959 12 21.9959C12.3511 21.9959 12.696 21.9035 13 21.7279L15 20.5879",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M3.28906 7L11.9991 12L20.7091 7",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"}),a.jsx("path",{d:"M12 22V12",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"})]}),mG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M24 12C24 5.37308 18.6269 0 12 0C5.37308 0 0 5.37308 0 12C0 17.989 4.38757 22.9537 10.1252 23.8549V15.4696H7.07749V12H10.1252V9.35565C10.1252 6.34847 11.9173 4.68626 14.6579 4.68626C15.9707 4.68626 17.3444 4.92083 17.3444 4.92083V7.874H15.8307C14.3406 7.874 13.8748 8.79876 13.8748 9.74884V12H17.2026L16.6711 15.4696H13.8748V23.8549C19.6124 22.9554 24 17.9907 24 12Z",fill:"#1977F3"}),a.jsx("path",{d:"M16.6717 15.4708L17.2033 12.0012H13.8755V9.75008C13.8755 8.80169 14.3396 7.87524 15.8313 7.87524H17.345V4.92207C17.345 4.92207 15.9714 4.6875 14.6585 4.6875C11.918 4.6875 10.1258 6.34803 10.1258 9.35689V12.0012H7.07812V15.4708H10.1258V23.8561C10.7367 23.9523 11.3628 24.0012 12.0006 24.0012C12.6385 24.0012 13.2646 23.9506 13.8755 23.8561V15.4708H16.6717Z",fill:"#FEFEFE"})]}),pG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("rect",{x:"2",y:"2",width:"20",height:"20",fill:"white"}),a.jsx("path",{d:"M20.4491 20.4496H16.8931V14.8805C16.8931 13.5525 16.8694 11.8429 15.0436 11.8429C13.1915 11.8429 12.9081 13.2899 12.9081 14.7838V20.4492H9.35203V8.99689H12.7658V10.562H12.8136C13.1553 9.97782 13.649 9.49726 14.2421 9.17149C14.8352 8.84572 15.5056 8.68693 16.1819 8.71203C19.7861 8.71203 20.4506 11.0828 20.4506 14.167L20.4491 20.4496ZM5.33963 7.43144C4.93148 7.43151 4.53247 7.31055 4.19307 7.08385C3.85367 6.85715 3.58913 6.53489 3.43287 6.15783C3.27661 5.78077 3.23566 5.36584 3.31521 4.96551C3.39477 4.56517 3.59125 4.19743 3.8798 3.90876C4.16835 3.6201 4.53602 3.42348 4.93631 3.34378C5.3366 3.26408 5.75152 3.30488 6.12863 3.46101C6.50573 3.61713 6.82807 3.88158 7.05489 4.22091C7.2817 4.56025 7.40281 4.95922 7.40288 5.36738C7.40293 5.63839 7.34959 5.90675 7.24593 6.15715C7.14227 6.40754 6.99032 6.63507 6.79873 6.82674C6.60714 7.0184 6.37966 7.17045 6.1293 7.27421C5.87895 7.37796 5.61062 7.43139 5.33963 7.43144ZM7.11765 20.4496H3.5579V8.99689H7.11765V20.4496ZM22.222 0.00163516H1.77099C1.30681 -0.00360329 0.859518 0.175663 0.52744 0.500042C0.195362 0.824421 0.00566506 1.26737 0 1.73156V22.2681C0.00547117 22.7325 0.195057 23.1758 0.527123 23.5005C0.85919 23.8252 1.30658 24.0048 1.77099 23.9999H22.222C22.6873 24.0057 23.1359 23.8266 23.4693 23.5019C23.8027 23.1772 23.9936 22.7334 24 22.2681V1.73008C23.9934 1.26497 23.8024 0.821515 23.469 0.497144C23.1356 0.172773 22.6871 -0.00598143 22.222 0.000152822",fill:"#0A66C2"})]}),gG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M2.4 0H21.6C22.9256 0 24 1.07443 24 2.4V21.6C24 22.9256 22.9256 24 21.6 24H2.4C1.07443 24 0 22.9256 0 21.6V2.4C0 1.07443 1.07443 0 2.4 0Z",fill:"#010101"}),a.jsx("path",{d:"M16.0971 9.46492C17.3375 10.3511 18.8571 10.8725 20.4981 10.8725V7.71605C20.1875 7.71617 19.8778 7.68377 19.5739 7.61937V10.104C17.9329 10.104 16.4136 9.58256 15.1729 8.69639V15.1378C15.1729 18.3601 12.5594 20.9721 9.33558 20.9721C8.13276 20.9721 7.01472 20.6087 6.08594 19.9853C7.14596 21.0686 8.62418 21.7407 10.2596 21.7407C13.4836 21.7407 16.0972 19.1286 16.0972 15.9062V9.46492H16.0971ZM17.2373 6.28044C16.6034 5.5883 16.1872 4.69375 16.0971 3.70479V3.29883H15.2213C15.4417 4.55571 16.1937 5.62956 17.2373 6.28044ZM8.12494 17.5127C7.77082 17.0486 7.5794 16.4808 7.58026 15.897C7.58026 14.4232 8.77571 13.2283 10.2505 13.2283C10.5254 13.2281 10.7986 13.2703 11.0605 13.3533V10.1263C10.7544 10.0844 10.4455 10.0666 10.1366 10.0732V12.5849C9.87454 12.5019 9.60122 12.4597 9.32629 12.4599C7.85147 12.4599 6.65612 13.6548 6.65612 15.1287C6.65612 16.1708 7.25362 17.0732 8.12494 17.5127Z",fill:"#EE1D52"}),a.jsx("path",{d:"M15.1726 8.69639C16.4133 9.58256 17.9326 10.104 19.5736 10.104V7.61937C18.6576 7.42444 17.8467 6.94594 17.237 6.28044C16.1934 5.62956 15.4414 4.55571 15.221 3.29883H12.9204V15.9061C12.9152 17.3758 11.7218 18.5658 10.2501 18.5658C9.38288 18.5658 8.61243 18.1527 8.12452 17.5127C7.2532 17.0732 6.6557 16.1708 6.6557 15.1287C6.6557 13.6548 7.85104 12.4599 9.32587 12.4599C9.60841 12.4599 9.88075 12.5039 10.1362 12.5849V10.0732C6.96907 10.1386 4.42188 12.7251 4.42188 15.9062C4.42188 17.4941 5.05621 18.9337 6.08563 19.9854C7.01441 20.6088 8.13245 20.9722 9.33528 20.9722C12.5591 20.9722 15.1726 18.3601 15.1726 15.1379V8.69639Z",fill:"white"}),a.jsx("path",{d:"M19.5758 7.6202V6.94836C18.7498 6.9496 17.9401 6.71839 17.2392 6.28116C17.8596 6.96001 18.6765 7.42815 19.5758 7.6202ZM15.2232 3.29966C15.2022 3.17955 15.186 3.05864 15.1748 2.93721V2.53125H11.9983V15.1386C11.9932 16.6082 10.7999 17.7982 9.32812 17.7982C8.89598 17.7982 8.48809 17.6958 8.12678 17.5135C8.61468 18.1535 9.38513 18.5666 10.2524 18.5666C11.7239 18.5666 12.9174 17.3766 12.9226 15.9069V3.29966H15.2232ZM10.1386 10.074V9.35876C9.87315 9.32247 9.60555 9.30433 9.33764 9.30447C6.1135 9.30447 3.5 11.9166 3.5 15.1386C3.5 17.1587 4.52715 18.9389 6.088 19.9862C5.05858 18.9344 4.42424 17.4948 4.42424 15.9069C4.42424 12.7259 6.97133 10.1394 10.1386 10.074Z",fill:"#69C9D0"})]}),yG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",children:[a.jsx("path",{d:"M2 2H11.5V11.5H2V2Z",fill:"#F25022"}),a.jsx("path",{d:"M12.5 2H22V11.5H12.5V2Z",fill:"#7FBA00"}),a.jsx("path",{d:"M2 12.5H11.5V22H2V12.5Z",fill:"#00A4EF"}),a.jsx("path",{d:"M12.5 12.5H22V22H12.5V12.5Z",fill:"#FFB900"})]}),vG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsxs("g",{"clip-path":"url(#clip0_377_3451)",children:[a.jsx("path",{d:"M16.4954 9.25H22.6042C23.1814 9.25 23.6492 9.71786 23.6492 10.295V15.8593C23.6492 17.9805 21.9297 19.7 19.8086 19.7H19.7904C17.6693 19.7003 15.9495 17.981 15.9492 15.8599C15.9492 15.8597 15.9492 15.8595 15.9492 15.8593V9.79616C15.9492 9.49452 16.1937 9.25 16.4954 9.25Z",fill:"#5059C9"}),a.jsx("path",{d:"M20.6234 8.14922C21.9903 8.14922 23.0984 7.04112 23.0984 5.67422C23.0984 4.30731 21.9903 3.19922 20.6234 3.19922C19.2565 3.19922 18.1484 4.30731 18.1484 5.67422C18.1484 7.04112 19.2565 8.14922 20.6234 8.14922Z",fill:"#5059C9"}),a.jsx("path",{d:"M12.9266 8.15001C14.901 8.15001 16.5016 6.54942 16.5016 4.575C16.5016 2.60058 14.901 1 12.9266 1C10.9521 1 9.35156 2.60058 9.35156 4.575C9.35156 6.54942 10.9521 8.15001 12.9266 8.15001Z",fill:"#7B83EB"}),a.jsx("path",{d:"M17.6912 9.25H7.60751C7.03725 9.26411 6.58614 9.73737 6.59937 10.3077V16.6541C6.51973 20.0763 9.22724 22.9163 12.6494 23C16.0715 22.9163 18.779 20.0763 18.6994 16.6541V10.3077C18.7126 9.73737 18.2615 9.26411 17.6912 9.25Z",fill:"#7B83EB"}),a.jsx("path",{opacity:"0.1",d:"M13.2019 9.25V18.1435C13.1991 18.5513 12.952 18.9177 12.5749 19.073C12.4548 19.1238 12.3257 19.15 12.1954 19.15H7.08585C7.01436 18.9685 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H13.2019Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V18.6935C12.6518 18.8239 12.6257 18.9529 12.5749 19.073C12.4196 19.4501 12.0532 19.6973 11.6454 19.7H7.34436C7.25085 19.5185 7.16286 19.337 7.08585 19.15C7.00885 18.963 6.94836 18.787 6.89335 18.6C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.6519 9.25V17.5935C12.6477 18.1476 12.1995 18.5958 11.6454 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.6519Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1018 9.25V17.5935C12.0977 18.1476 11.6495 18.5958 11.0953 18.6H6.89335C6.70082 17.9689 6.60259 17.3128 6.60185 16.653V10.306C6.58863 9.73663 7.039 9.26411 7.60835 9.25H12.1018Z",fill:"black"}),a.jsx("path",{opacity:"0.1",d:"M13.2002 6.40688V8.13938C13.1067 8.14488 13.0187 8.15038 12.9252 8.15038C12.8317 8.15038 12.7437 8.14489 12.6502 8.13938C12.4646 8.12706 12.2805 8.09761 12.1002 8.05138C10.9865 7.78763 10.0663 7.00654 9.62522 5.95039C9.54932 5.77303 9.4904 5.58886 9.44922 5.40039H12.1937C12.7487 5.40249 13.1981 5.85188 13.2002 6.40688Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.65 6.95571V8.13821C12.4643 8.12589 12.2802 8.09644 12.1 8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.6435C12.1985 5.95132 12.6479 6.40071 12.65 6.95571Z",fill:"black"}),a.jsx("path",{opacity:"0.2",d:"M12.1 6.95572V8.05022C10.9862 7.78646 10.0661 7.00537 9.625 5.94922H11.0935C11.6485 5.95133 12.0979 6.40072 12.1 6.95572Z",fill:"black"}),a.jsx("path",{d:"M1.00814 5.94922H11.0918C11.6486 5.94922 12.1 6.40059 12.1 6.95736V17.0411C12.1 17.5978 11.6486 18.0492 11.0918 18.0492H1.00814C0.451357 18.0492 0 17.5978 0 17.0411V6.95736C0 6.40059 0.451368 5.94922 1.00814 5.94922Z",fill:"url(#paint0_linear_377_3451)"}),a.jsx("path",{d:"M8.70484 9.78745H6.68908V15.2765H5.40484V9.78745H3.39844V8.72266H8.70484V9.78745Z",fill:"white"})]}),a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"paint0_linear_377_3451",x1:"2.10202",y1:"5.16147",x2:"9.99799",y2:"18.837",gradientUnits:"userSpaceOnUse",children:[a.jsx("stop",{"stop-color":"#5A62C3"}),a.jsx("stop",{offset:"0.5","stop-color":"#4D55BD"}),a.jsx("stop",{offset:"1","stop-color":"#3940AB"})]}),a.jsx("clipPath",{id:"clip0_377_3451",children:a.jsx("rect",{width:"23.65",height:"22",fill:"white",transform:"translate(0 1)"})})]})]}),xG=({className:e,size:t=24})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",children:[a.jsx("path",{d:"M6.22775 0.0390625L6.2285 5.77431L0.5 5.77281V1.55856C0.5425 1.26056 0.63075 1.01031 0.76475 0.807812C1.09525 0.306812 1.57575 0.0545625 2.20625 0.0510625C3.53925 0.0440625 4.87975 0.0400625 6.22775 0.0390625Z",fill:"#0066DA"}),a.jsx("path",{d:"M6.22656 0.0390625L18.0331 0.0405625C18.0579 0.0405527 18.082 0.0481525 18.1021 0.0623125L18.1298 0.0825625C18.1218 0.0855625 18.1151 0.0888125 18.1096 0.0923125C18.1011 0.0968125 18.0968 0.103813 18.0968 0.113313L18.0953 5.77656C18.0943 5.77656 18.0931 5.77656 18.0916 5.77656H6.22956C6.22906 5.77606 6.22831 5.77531 6.22731 5.77431L6.22656 0.0390625Z",fill:"#FBBC04"}),a.jsx("path",{d:"M18.1322 0.0820312L23.7909 5.75803L18.0977 5.77603L18.0992 0.112781C18.0992 0.103281 18.1034 0.0962812 18.1119 0.0917812C18.1174 0.0882812 18.1242 0.0850312 18.1322 0.0820312Z",fill:"#EA4335"}),a.jsx("path",{d:"M0.5 5.77148L6.2285 5.77298C6.2295 5.77398 6.23025 5.77473 6.23075 5.77523L6.23225 13.7012L0.5 13.6997V5.77148Z",fill:"#2684FC"}),a.jsx("path",{d:"M23.788 5.75781L23.8232 5.78331V17.9258C23.6902 18.6523 23.3137 19.1216 22.6937 19.3336C22.4727 19.4096 22.147 19.4471 21.7165 19.4461C18.922 19.4416 16.099 19.4373 13.2475 19.4333C12.8335 19.4328 12.4135 19.4358 11.9875 19.4423C11.964 19.4428 11.944 19.4513 11.9275 19.4678C10.5325 20.8563 9.13247 22.2568 7.72747 23.6693C7.51222 23.8861 7.26847 24.0068 6.95947 23.9611C6.67147 23.9186 6.45922 23.7701 6.32272 23.5156C6.26522 23.4076 6.23597 23.2106 6.23497 22.9246C6.23147 21.7651 6.23022 20.6018 6.23122 19.4348L6.23047 16.5638L9.06397 13.7303C9.07632 13.718 9.09102 13.7081 9.10723 13.7015C9.12345 13.6948 9.14086 13.6913 9.15847 13.6913L18.031 13.6943C18.0475 13.6943 18.0633 13.6878 18.075 13.6761C18.0867 13.6644 18.0932 13.6486 18.0932 13.6321L18.091 5.77581C18.0925 5.77581 18.0937 5.77581 18.0947 5.77581L23.788 5.75781Z",fill:"#00AC47"}),a.jsx("path",{d:"M6.23225 13.7027V16.5647L6.233 19.4357C5.0345 19.4427 3.84625 19.4449 2.66825 19.4424C2.17725 19.4414 1.8235 19.4029 1.607 19.3269C1 19.1149 0.631 18.6449 0.5 17.9169V13.7012L6.23225 13.7027Z",fill:"#00832D"})]}),bG=({className:e,size:t=24,strokeWidth:n=2,strokeColor:r="#1E88E5"})=>a.jsxs("svg",{role:"img",viewBox:"0 0 24 24",width:t,height:t,className:e,xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:r,"stroke-width":n,"stroke-linecap":"round","stroke-linejoin":"round",children:[a.jsx("path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7"}),a.jsx("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"})]});function Zo({className:e,...t}){return a.jsx("textarea",{"data-slot":"textarea",className:ne("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 jA({value:e,onChange:t,keysToMask:n=[],className:r,minHeightClass:o="min-h-[150px]",displayOnly:l=!1,showCopyButton:c=!1}){const d=(C,R)=>{if(!C||R.length===0)return!1;try{const j=JSON.parse(C),_=D=>typeof D!="object"||D===null?!1:Array.isArray(D)?D.some(A=>typeof A=="object"&&A!==null&&_(A)):Object.keys(D).some(A=>R.includes(A)||typeof D[A]=="object"&&D[A]!==null&&_(D[A]));return _(j)}catch{return!1}},f=l?!1:!e||n.length===0||!d(e,n),[h,g]=m.useState(f),[y,v]=m.useState(!1);m.useEffect(()=>{l?g(!1):(!e||n.length===0||!d(e,n))&&g(!0)},[e,n,l]),m.useEffect(()=>{if(y){const C=setTimeout(()=>{v(!1)},2e3);return()=>{clearTimeout(C)}}},[y]);const b=()=>{navigator.clipboard.writeText(e),v(!0)},E=C=>{if(!C)return"";try{const R=JSON.parse(C),j=A=>{if(typeof A!="object"||A===null)return A;const O=Array.isArray(A)?[...A]:{...A};return Array.isArray(O)?O.forEach((T,M)=>{typeof T=="object"&&T!==null&&(O[M]=j(T))}):Object.entries(O).forEach(([T,M])=>{if(n.includes(T))if(typeof M=="string"){const V=M.length;V>30?O[T]="*".repeat(Math.min(20,Math.ceil(V/3))):V>10?O[T]="*".repeat(Math.min(10,Math.ceil(V/2))):O[T]="*".repeat(V)}else O[T]="***";else typeof M=="object"&&M!==null&&(O[T]=j(M))}),O},D=j(typeof R=="object"?R:{});return JSON.stringify(D,null,2)}catch{return C}},S=e&&n.length>0&&d(e,n);return a.jsxs("div",{className:"relative",children:[!h&&S&&!l&&a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("div",{className:"absolute top-2 left-2 z-10",children:a.jsx(Vk,{className:"h-4 w-4 text-gray-500"})})}),a.jsx(Ct,{children:a.jsx("p",{children:"Content is locked in masked mode. Click the eye icon to enable editing."})})]})}),l?a.jsx("div",{className:`p-2 font-mono ${r??""} ${o} cursor-not-allowed whitespace-pre-wrap opacity-70`,children:E(e)}):a.jsx(Zo,{value:h?e:E(e),onChange:C=>{(h||!S)&&t&&t(C.target.value)},onFocus:C=>{!h&&S&&C.target.blur()},readOnly:!!(!h&&S),className:`font-mono ${r??""} ${!h&&S?"cursor-not-allowed opacity-70":""} ${o}`,rows:8}),S&&!l&&a.jsx(xe,{type:"button",variant:"ghost",className:"absolute top-2 right-2",onClick:()=>{g(!h)},children:h?a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(Ek,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Mask & Lock"})]})}),a.jsx(Ct,{children:a.jsx("p",{children:"Mask sensitive data and lock editing"})})]})}):a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(T_,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Show & Edit"})]})}),a.jsx(Ct,{children:a.jsx("p",{children:"Show sensitive data and enable editing"})})]})})}),c&&a.jsx(xe,{type:"button",variant:"ghost",className:`absolute ${S&&!l?"top-2 right-24":"top-2 right-2"}`,onClick:b,children:a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("div",{className:"flex items-center gap-1",children:y?a.jsxs(a.Fragment,{children:[a.jsx(lr,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copied!"})]}):a.jsxs(a.Fragment,{children:[a.jsx(hf,{className:"h-4 w-4"}),a.jsx("span",{className:"text-xs",children:"Copy"})]})})}),a.jsx(Ct,{children:a.jsx("p",{children:"Copy content to clipboard"})})]})})})]})}var Ut;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{const l={};for(const c of o)l[c]=c;return l},e.getValidEnumValues=o=>{const l=e.objectKeys(o).filter(d=>typeof o[o[d]]!="number"),c={};for(const d of l)c[d]=o[d];return e.objectValues(c)},e.objectValues=o=>e.objectKeys(o).map(function(l){return o[l]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const l=[];for(const c in o)Object.prototype.hasOwnProperty.call(o,c)&&l.push(c);return l},e.find=(o,l)=>{for(const c of o)if(l(c))return c},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,l=" | "){return o.map(c=>typeof c=="string"?`'${c}'`:c).join(l)}e.joinValues=r,e.jsonStringifyReplacer=(o,l)=>typeof l=="bigint"?l.toString():l})(Ut||(Ut={}));var Sj;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Sj||(Sj={}));const $e=Ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),_i=e=>{switch(typeof e){case"undefined":return $e.undefined;case"string":return $e.string;case"number":return Number.isNaN(e)?$e.nan:$e.number;case"boolean":return $e.boolean;case"function":return $e.function;case"bigint":return $e.bigint;case"symbol":return $e.symbol;case"object":return Array.isArray(e)?$e.array:e===null?$e.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?$e.promise:typeof Map<"u"&&e instanceof Map?$e.map:typeof Set<"u"&&e instanceof Set?$e.set:typeof Date<"u"&&e instanceof Date?$e.date:$e.object;default:return $e.unknown}},Ce=Ut.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 zo 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:[]},o=l=>{for(const c of l.issues)if(c.code==="invalid_union")c.unionErrors.map(o);else if(c.code==="invalid_return_type")o(c.returnTypeError);else if(c.code==="invalid_arguments")o(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 h=c.path[f];f===c.path.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(n(c))):d[h]=d[h]||{_errors:[]},d=d[h],f++}}};return o(this),r}static assert(t){if(!(t instanceof zo))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ut.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const o of this.issues)if(o.path.length>0){const l=o.path[0];n[l]=n[l]||[],n[l].push(t(o))}else r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}zo.create=e=>new zo(e);const H0=(e,t)=>{let n;switch(e.code){case Ce.invalid_type:e.received===$e.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ce.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ut.jsonStringifyReplacer)}`;break;case Ce.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ut.joinValues(e.keys,", ")}`;break;case Ce.invalid_union:n="Invalid input";break;case Ce.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ut.joinValues(e.options)}`;break;case Ce.invalid_enum_value:n=`Invalid enum value. Expected ${Ut.joinValues(e.options)}, received '${e.received}'`;break;case Ce.invalid_arguments:n="Invalid function arguments";break;case Ce.invalid_return_type:n="Invalid function return type";break;case Ce.invalid_date:n="Invalid date";break;case Ce.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}"`:Ut.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ce.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 Ce.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 Ce.custom:n="Invalid input";break;case Ce.invalid_intersection_types:n="Intersection results could not be merged";break;case Ce.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ce.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ut.assertNever(e)}return{message:n}};let SG=H0;function CG(){return SG}const EG=e=>{const{data:t,path:n,errorMaps:r,issueData:o}=e,l=[...n,...o.path||[]],c={...o,path:l};if(o.message!==void 0)return{...o,path:l,message:o.message};let d="";const f=r.filter(h=>!!h).slice().reverse();for(const h of f)d=h(c,{data:t,defaultError:d}).message;return{...o,path:l,message:d}};function Oe(e,t){const n=CG(),r=EG({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===H0?void 0:H0].filter(o=>!!o)});e.common.issues.push(r)}class qr{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 o of n){if(o.status==="aborted")return lt;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const o of n){const l=await o.key,c=await o.value;r.push({key:l,value:c})}return qr.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const o of n){const{key:l,value:c}=o;if(l.status==="aborted"||c.status==="aborted")return lt;l.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),l.value!=="__proto__"&&(typeof c.value<"u"||o.alwaysSet)&&(r[l.value]=c.value)}return{status:t.value,value:r}}}const lt=Object.freeze({status:"aborted"}),Qd=e=>({status:"dirty",value:e}),as=e=>({status:"valid",value:e}),Cj=e=>e.status==="aborted",Ej=e=>e.status==="dirty",wu=e=>e.status==="valid",Ep=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 Ys{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}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 wj=(e,t)=>{if(wu(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 zo(e.common.issues);return this._error=n,this._error}}};function yt(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:o}=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:o}:{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:o}}class At{get description(){return this._def.description}_getType(t){return _i(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new qr,ctx:{common:t.parent.common,data:t.data,parsedType:_i(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Ep(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:_i(t)},o=this._parseSync({data:t,path:r.path,parent:r});return wj(r,o)}"~validate"(t){var r,o;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:_i(t)};if(!this["~standard"].async)try{const l=this._parseSync({data:t,path:[],parent:n});return wu(l)?{value:l.value}:{issues:n.common.issues}}catch(l){(o=(r=l==null?void 0:l.message)==null?void 0:r.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:n}).then(l=>wu(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:_i(t)},o=this._parse({data:t,path:r.path,parent:r}),l=await(Ep(o)?o:Promise.resolve(o));return wj(r,l)}refine(t,n){const r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,l)=>{const c=t(o),d=()=>l.addIssue({code:Ce.custom,...r(o)});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,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Zl({schema:this,typeName:ct.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 Mo.create(this,this._def)}nullable(){return Kl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Gs.create(this)}promise(){return Dp.create(this,this._def)}or(t){return jp.create([this,t],this._def)}and(t){return Tp.create(this,t,this._def)}transform(t){return new Zl({...yt(this._def),schema:this,typeName:ct.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Op({...yt(this._def),innerType:this,defaultValue:n,typeName:ct.ZodDefault})}brand(){return new AA({typeName:ct.ZodBranded,type:this,...yt(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Mp({...yt(this._def),innerType:this,catchValue:n,typeName:ct.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Nb.create(this,t)}readonly(){return Ip.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const wG=/^c[^\s-]{8,}$/i,RG=/^[0-9a-z]+$/,jG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,TG=/^[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,_G=/^[a-z0-9_-]{21}$/i,NG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,AG=/^[-+]?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)?)??$/,DG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,OG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Vx;const MG=/^(?:(?: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])$/,IG=/^(?:(?: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])$/,kG=/^(([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]))$/,LG=/^(([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])$/,PG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,UG=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,TA="((\\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])))",FG=new RegExp(`^${TA}$`);function _A(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 VG(e){return new RegExp(`^${_A(e)}$`)}function zG(e){let t=`${TA}T${_A(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 HG(e,t){return!!((t==="v4"||!t)&&MG.test(e)||(t==="v6"||!t)&&kG.test(e))}function $G(e,t){if(!NG.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,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function BG(e,t){return!!((t==="v4"||!t)&&IG.test(e)||(t==="v6"||!t)&&LG.test(e))}class Oo extends At{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==$e.string){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_type,expected:$e.string,received:l.parsedType}),lt}const r=new qr;let o;for(const l of this._def.checks)if(l.kind==="min")t.data.length<l.value&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.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&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.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)&&(o=this._getOrReturnCtx(t,o),c?Oe(o,{code:Ce.too_big,maximum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}):d&&Oe(o,{code:Ce.too_small,minimum:l.value,type:"string",inclusive:!0,exact:!0,message:l.message}),r.dirty())}else if(l.kind==="email")DG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"email",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="emoji")Vx||(Vx=new RegExp(OG,"u")),Vx.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"emoji",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="uuid")TG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"uuid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="nanoid")_G.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"nanoid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid")wG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"cuid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="cuid2")RG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"cuid2",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="ulid")jG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"ulid",code:Ce.invalid_string,message:l.message}),r.dirty());else if(l.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),Oe(o,{validation:"url",code:Ce.invalid_string,message:l.message}),r.dirty()}else l.kind==="regex"?(l.regex.lastIndex=0,l.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"regex",code:Ce.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)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.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)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:{startsWith:l.value},message:l.message}),r.dirty()):l.kind==="endsWith"?t.data.endsWith(l.value)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:{endsWith:l.value},message:l.message}),r.dirty()):l.kind==="datetime"?zG(l).test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:"datetime",message:l.message}),r.dirty()):l.kind==="date"?FG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:"date",message:l.message}),r.dirty()):l.kind==="time"?VG(l).test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.invalid_string,validation:"time",message:l.message}),r.dirty()):l.kind==="duration"?AG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"duration",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="ip"?HG(t.data,l.version)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"ip",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="jwt"?$G(t.data,l.alg)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"jwt",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="cidr"?BG(t.data,l.version)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"cidr",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="base64"?PG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"base64",code:Ce.invalid_string,message:l.message}),r.dirty()):l.kind==="base64url"?UG.test(t.data)||(o=this._getOrReturnCtx(t,o),Oe(o,{validation:"base64url",code:Ce.invalid_string,message:l.message}),r.dirty()):Ut.assertNever(l);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(o=>t.test(o),{validation:n,code:Ce.invalid_string,...Je.errToObj(r)})}_addCheck(t){return new Oo({...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 Oo({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Oo({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Oo({...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}}Oo.create=e=>new Oo({checks:[],typeName:ct.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...yt(e)});function GG(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,l=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return l%c/10**o}class Ru extends At{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)!==$e.number){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_type,expected:$e.number,received:l.parsedType}),lt}let r;const o=new qr;for(const l of this._def.checks)l.kind==="int"?Ut.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.invalid_type,expected:"integer",received:"float",message:l.message}),o.dirty()):l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_small,minimum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_big,maximum:l.value,type:"number",inclusive:l.inclusive,exact:!1,message:l.message}),o.dirty()):l.kind==="multipleOf"?GG(t.data,l.value)!==0&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):l.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.not_finite,message:l.message}),o.dirty()):Ut.assertNever(l);return{status:o.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,o){return new Ru({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(o)}]})}_addCheck(t){return new Ru({...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"&&Ut.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)}}Ru.create=e=>new Ru({checks:[],typeName:ct.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...yt(e)});class bf extends At{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)!==$e.bigint)return this._getInvalidInput(t);let r;const o=new qr;for(const l of this._def.checks)l.kind==="min"?(l.inclusive?t.data<l.value:t.data<=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_small,type:"bigint",minimum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()):l.kind==="max"?(l.inclusive?t.data>l.value:t.data>=l.value)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.too_big,type:"bigint",maximum:l.value,inclusive:l.inclusive,message:l.message}),o.dirty()):l.kind==="multipleOf"?t.data%l.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),Oe(r,{code:Ce.not_multiple_of,multipleOf:l.value,message:l.message}),o.dirty()):Ut.assertNever(l);return{status:o.value,value:t.data}}_getInvalidInput(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Ce.invalid_type,expected:$e.bigint,received:n.parsedType}),lt}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,o){return new bf({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Je.toString(o)}]})}_addCheck(t){return new bf({...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}}bf.create=e=>new bf({checks:[],typeName:ct.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...yt(e)});class $0 extends At{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==$e.boolean){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.boolean,received:r.parsedType}),lt}return as(t.data)}}$0.create=e=>new $0({typeName:ct.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...yt(e)});class wp extends At{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==$e.date){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_type,expected:$e.date,received:l.parsedType}),lt}if(Number.isNaN(t.data.getTime())){const l=this._getOrReturnCtx(t);return Oe(l,{code:Ce.invalid_date}),lt}const r=new qr;let o;for(const l of this._def.checks)l.kind==="min"?t.data.getTime()<l.value&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.too_small,message:l.message,inclusive:!0,exact:!1,minimum:l.value,type:"date"}),r.dirty()):l.kind==="max"?t.data.getTime()>l.value&&(o=this._getOrReturnCtx(t,o),Oe(o,{code:Ce.too_big,message:l.message,inclusive:!0,exact:!1,maximum:l.value,type:"date"}),r.dirty()):Ut.assertNever(l);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new wp({...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}}wp.create=e=>new wp({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:ct.ZodDate,...yt(e)});class Rj extends At{_parse(t){if(this._getType(t)!==$e.symbol){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.symbol,received:r.parsedType}),lt}return as(t.data)}}Rj.create=e=>new Rj({typeName:ct.ZodSymbol,...yt(e)});class B0 extends At{_parse(t){if(this._getType(t)!==$e.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.undefined,received:r.parsedType}),lt}return as(t.data)}}B0.create=e=>new B0({typeName:ct.ZodUndefined,...yt(e)});class Rp extends At{_parse(t){if(this._getType(t)!==$e.null){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.null,received:r.parsedType}),lt}return as(t.data)}}Rp.create=e=>new Rp({typeName:ct.ZodNull,...yt(e)});class jj extends At{constructor(){super(...arguments),this._any=!0}_parse(t){return as(t.data)}}jj.create=e=>new jj({typeName:ct.ZodAny,...yt(e)});class G0 extends At{constructor(){super(...arguments),this._unknown=!0}_parse(t){return as(t.data)}}G0.create=e=>new G0({typeName:ct.ZodUnknown,...yt(e)});class qi extends At{_parse(t){const n=this._getOrReturnCtx(t);return Oe(n,{code:Ce.invalid_type,expected:$e.never,received:n.parsedType}),lt}}qi.create=e=>new qi({typeName:ct.ZodNever,...yt(e)});class Tj extends At{_parse(t){if(this._getType(t)!==$e.undefined){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.void,received:r.parsedType}),lt}return as(t.data)}}Tj.create=e=>new Tj({typeName:ct.ZodVoid,...yt(e)});class Gs extends At{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==$e.array)return Oe(n,{code:Ce.invalid_type,expected:$e.array,received:n.parsedType}),lt;if(o.exactLength!==null){const c=n.data.length>o.exactLength.value,d=n.data.length<o.exactLength.value;(c||d)&&(Oe(n,{code:c?Ce.too_big:Ce.too_small,minimum:d?o.exactLength.value:void 0,maximum:c?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(Oe(n,{code:Ce.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(Oe(n,{code:Ce.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((c,d)=>o.type._parseAsync(new Ys(n,c,n.path,d)))).then(c=>qr.mergeArray(r,c));const l=[...n.data].map((c,d)=>o.type._parseSync(new Ys(n,c,n.path,d)));return qr.mergeArray(r,l)}get element(){return this._def.type}min(t,n){return new Gs({...this._def,minLength:{value:t,message:Je.toString(n)}})}max(t,n){return new Gs({...this._def,maxLength:{value:t,message:Je.toString(n)}})}length(t,n){return new Gs({...this._def,exactLength:{value:t,message:Je.toString(n)}})}nonempty(t){return this.min(1,t)}}Gs.create=(e,t)=>new Gs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ct.ZodArray,...yt(t)});function tu(e){if(e instanceof Xn){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Mo.create(tu(r))}return new Xn({...e._def,shape:()=>t})}else return e instanceof Gs?new Gs({...e._def,type:tu(e.element)}):e instanceof Mo?Mo.create(tu(e.unwrap())):e instanceof Kl?Kl.create(tu(e.unwrap())):e instanceof Gl?Gl.create(e.items.map(t=>tu(t))):e}class Xn extends At{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=Ut.objectKeys(t);return this._cached={shape:t,keys:n},this._cached}_parse(t){if(this._getType(t)!==$e.object){const h=this._getOrReturnCtx(t);return Oe(h,{code:Ce.invalid_type,expected:$e.object,received:h.parsedType}),lt}const{status:r,ctx:o}=this._processInputParams(t),{shape:l,keys:c}=this._getCached(),d=[];if(!(this._def.catchall instanceof qi&&this._def.unknownKeys==="strip"))for(const h in o.data)c.includes(h)||d.push(h);const f=[];for(const h of c){const g=l[h],y=o.data[h];f.push({key:{status:"valid",value:h},value:g._parse(new Ys(o,y,o.path,h)),alwaysSet:h in o.data})}if(this._def.catchall instanceof qi){const h=this._def.unknownKeys;if(h==="passthrough")for(const g of d)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(h==="strict")d.length>0&&(Oe(o,{code:Ce.unrecognized_keys,keys:d}),r.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const h=this._def.catchall;for(const g of d){const y=o.data[g];f.push({key:{status:"valid",value:g},value:h._parse(new Ys(o,y,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const h=[];for(const g of f){const y=await g.key,v=await g.value;h.push({key:y,value:v,alwaysSet:g.alwaysSet})}return h}).then(h=>qr.mergeObjectSync(r,h)):qr.mergeObjectSync(r,f)}get shape(){return this._def.shape()}strict(t){return Je.errToObj,new Xn({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var l,c;const o=((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??o}:{message:o}}}:{}})}strip(){return new Xn({...this._def,unknownKeys:"strip"})}passthrough(){return new Xn({...this._def,unknownKeys:"passthrough"})}extend(t){return new Xn({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Xn({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ct.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Xn({...this._def,catchall:t})}pick(t){const n={};for(const r of Ut.objectKeys(t))t[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new Xn({...this._def,shape:()=>n})}omit(t){const n={};for(const r of Ut.objectKeys(this.shape))t[r]||(n[r]=this.shape[r]);return new Xn({...this._def,shape:()=>n})}deepPartial(){return tu(this)}partial(t){const n={};for(const r of Ut.objectKeys(this.shape)){const o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}return new Xn({...this._def,shape:()=>n})}required(t){const n={};for(const r of Ut.objectKeys(this.shape))if(t&&!t[r])n[r]=this.shape[r];else{let l=this.shape[r];for(;l instanceof Mo;)l=l._def.innerType;n[r]=l}return new Xn({...this._def,shape:()=>n})}keyof(){return NA(Ut.objectKeys(this.shape))}}Xn.create=(e,t)=>new Xn({shape:()=>e,unknownKeys:"strip",catchall:qi.create(),typeName:ct.ZodObject,...yt(t)});Xn.strictCreate=(e,t)=>new Xn({shape:()=>e,unknownKeys:"strict",catchall:qi.create(),typeName:ct.ZodObject,...yt(t)});Xn.lazycreate=(e,t)=>new Xn({shape:e,unknownKeys:"strip",catchall:qi.create(),typeName:ct.ZodObject,...yt(t)});class jp extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function o(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 zo(d.ctx.common.issues));return Oe(n,{code:Ce.invalid_union,unionErrors:c}),lt}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(o);{let l;const c=[];for(const f of r){const h={...n,common:{...n.common,issues:[]},parent:null},g=f._parseSync({data:n.data,path:n.path,parent:h});if(g.status==="valid")return g;g.status==="dirty"&&!l&&(l={result:g,ctx:h}),h.common.issues.length&&c.push(h.common.issues)}if(l)return n.common.issues.push(...l.ctx.common.issues),l.result;const d=c.map(f=>new zo(f));return Oe(n,{code:Ce.invalid_union,unionErrors:d}),lt}}get options(){return this._def.options}}jp.create=(e,t)=>new jp({options:e,typeName:ct.ZodUnion,...yt(t)});const _o=e=>e instanceof Z0?_o(e.schema):e instanceof Zl?_o(e.innerType()):e instanceof Np?[e.value]:e instanceof ql?e.options:e instanceof Ap?Ut.objectValues(e.enum):e instanceof Op?_o(e._def.innerType):e instanceof B0?[void 0]:e instanceof Rp?[null]:e instanceof Mo?[void 0,..._o(e.unwrap())]:e instanceof Kl?[null,..._o(e.unwrap())]:e instanceof AA||e instanceof Ip?_o(e.unwrap()):e instanceof Mp?_o(e._def.innerType):[];class _b extends At{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==$e.object)return Oe(n,{code:Ce.invalid_type,expected:$e.object,received:n.parsedType}),lt;const r=this.discriminator,o=n.data[r],l=this.optionsMap.get(o);return l?n.common.async?l._parseAsync({data:n.data,path:n.path,parent:n}):l._parseSync({data:n.data,path:n.path,parent:n}):(Oe(n,{code:Ce.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),lt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const o=new Map;for(const l of n){const c=_o(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(o.has(d))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(d)}`);o.set(d,l)}}return new _b({typeName:ct.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...yt(r)})}}function q0(e,t){const n=_i(e),r=_i(t);if(e===t)return{valid:!0,data:e};if(n===$e.object&&r===$e.object){const o=Ut.objectKeys(t),l=Ut.objectKeys(e).filter(d=>o.indexOf(d)!==-1),c={...e,...t};for(const d of l){const f=q0(e[d],t[d]);if(!f.valid)return{valid:!1};c[d]=f.data}return{valid:!0,data:c}}else if(n===$e.array&&r===$e.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let l=0;l<e.length;l++){const c=e[l],d=t[l],f=q0(c,d);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return n===$e.date&&r===$e.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Tp extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=(l,c)=>{if(Cj(l)||Cj(c))return lt;const d=q0(l.value,c.value);return d.valid?((Ej(l)||Ej(c))&&n.dirty(),{status:n.value,value:d.data}):(Oe(r,{code:Ce.invalid_intersection_types}),lt)};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])=>o(l,c)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Tp.create=(e,t,n)=>new Tp({left:e,right:t,typeName:ct.ZodIntersection,...yt(n)});class Gl extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.array)return Oe(r,{code:Ce.invalid_type,expected:$e.array,received:r.parsedType}),lt;if(r.data.length<this._def.items.length)return Oe(r,{code:Ce.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),lt;!this._def.rest&&r.data.length>this._def.items.length&&(Oe(r,{code:Ce.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 Ys(r,c,r.path,d)):null}).filter(c=>!!c);return r.common.async?Promise.all(l).then(c=>qr.mergeArray(n,c)):qr.mergeArray(n,l)}get items(){return this._def.items}rest(t){return new Gl({...this._def,rest:t})}}Gl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Gl({items:e,typeName:ct.ZodTuple,rest:null,...yt(t)})};class _p extends At{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!==$e.object)return Oe(r,{code:Ce.invalid_type,expected:$e.object,received:r.parsedType}),lt;const o=[],l=this._def.keyType,c=this._def.valueType;for(const d in r.data)o.push({key:l._parse(new Ys(r,d,r.path,d)),value:c._parse(new Ys(r,r.data[d],r.path,d)),alwaysSet:d in r.data});return r.common.async?qr.mergeObjectAsync(n,o):qr.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof At?new _p({keyType:t,valueType:n,typeName:ct.ZodRecord,...yt(r)}):new _p({keyType:Oo.create(),valueType:t,typeName:ct.ZodRecord,...yt(n)})}}class _j extends At{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!==$e.map)return Oe(r,{code:Ce.invalid_type,expected:$e.map,received:r.parsedType}),lt;const o=this._def.keyType,l=this._def.valueType,c=[...r.data.entries()].map(([d,f],h)=>({key:o._parse(new Ys(r,d,r.path,[h,"key"])),value:l._parse(new Ys(r,f,r.path,[h,"value"]))}));if(r.common.async){const d=new Map;return Promise.resolve().then(async()=>{for(const f of c){const h=await f.key,g=await f.value;if(h.status==="aborted"||g.status==="aborted")return lt;(h.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(h.value,g.value)}return{status:n.value,value:d}})}else{const d=new Map;for(const f of c){const h=f.key,g=f.value;if(h.status==="aborted"||g.status==="aborted")return lt;(h.status==="dirty"||g.status==="dirty")&&n.dirty(),d.set(h.value,g.value)}return{status:n.value,value:d}}}}_j.create=(e,t,n)=>new _j({valueType:t,keyType:e,typeName:ct.ZodMap,...yt(n)});class Sf extends At{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==$e.set)return Oe(r,{code:Ce.invalid_type,expected:$e.set,received:r.parsedType}),lt;const o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(Oe(r,{code:Ce.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(Oe(r,{code:Ce.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());const l=this._def.valueType;function c(f){const h=new Set;for(const g of f){if(g.status==="aborted")return lt;g.status==="dirty"&&n.dirty(),h.add(g.value)}return{status:n.value,value:h}}const d=[...r.data.values()].map((f,h)=>l._parse(new Ys(r,f,r.path,h)));return r.common.async?Promise.all(d).then(f=>c(f)):c(d)}min(t,n){return new Sf({...this._def,minSize:{value:t,message:Je.toString(n)}})}max(t,n){return new Sf({...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)}}Sf.create=(e,t)=>new Sf({valueType:e,minSize:null,maxSize:null,typeName:ct.ZodSet,...yt(t)});class Z0 extends At{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})}}Z0.create=(e,t)=>new Z0({getter:e,typeName:ct.ZodLazy,...yt(t)});class Np extends At{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return Oe(n,{received:n.data,code:Ce.invalid_literal,expected:this._def.value}),lt}return{status:"valid",value:t.data}}get value(){return this._def.value}}Np.create=(e,t)=>new Np({value:e,typeName:ct.ZodLiteral,...yt(t)});function NA(e,t){return new ql({values:e,typeName:ct.ZodEnum,...yt(t)})}class ql extends At{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{expected:Ut.joinValues(r),received:n.parsedType,code:Ce.invalid_type}),lt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return Oe(n,{received:n.data,code:Ce.invalid_enum_value,options:r}),lt}return as(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 ql.create(t,{...this._def,...n})}exclude(t,n=this._def){return ql.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}ql.create=NA;class Ap extends At{_parse(t){const n=Ut.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==$e.string&&r.parsedType!==$e.number){const o=Ut.objectValues(n);return Oe(r,{expected:Ut.joinValues(o),received:r.parsedType,code:Ce.invalid_type}),lt}if(this._cache||(this._cache=new Set(Ut.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=Ut.objectValues(n);return Oe(r,{received:r.data,code:Ce.invalid_enum_value,options:o}),lt}return as(t.data)}get enum(){return this._def.values}}Ap.create=(e,t)=>new Ap({values:e,typeName:ct.ZodNativeEnum,...yt(t)});class Dp extends At{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==$e.promise&&n.common.async===!1)return Oe(n,{code:Ce.invalid_type,expected:$e.promise,received:n.parsedType}),lt;const r=n.parsedType===$e.promise?n.data:Promise.resolve(n.data);return as(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Dp.create=(e,t)=>new Dp({type:e,typeName:ct.ZodPromise,...yt(t)});class Zl extends At{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ct.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,l={addIssue:c=>{Oe(r,c),c.fatal?n.abort():n.dirty()},get path(){return r.path}};if(l.addIssue=l.addIssue.bind(l),o.type==="preprocess"){const c=o.transform(r.data,l);if(r.common.async)return Promise.resolve(c).then(async d=>{if(n.value==="aborted")return lt;const f=await this._def.schema._parseAsync({data:d,path:r.path,parent:r});return f.status==="aborted"?lt:f.status==="dirty"||n.value==="dirty"?Qd(f.value):f});{if(n.value==="aborted")return lt;const d=this._def.schema._parseSync({data:c,path:r.path,parent:r});return d.status==="aborted"?lt:d.status==="dirty"||n.value==="dirty"?Qd(d.value):d}}if(o.type==="refinement"){const c=d=>{const f=o.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"?lt:(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"?lt:(d.status==="dirty"&&n.dirty(),c(d.value).then(()=>({status:n.value,value:d.value}))))}if(o.type==="transform")if(r.common.async===!1){const c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!wu(c))return lt;const d=o.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=>wu(c)?Promise.resolve(o.transform(c.value,l)).then(d=>({status:n.value,value:d})):lt);Ut.assertNever(o)}}Zl.create=(e,t,n)=>new Zl({schema:e,typeName:ct.ZodEffects,effect:t,...yt(n)});Zl.createWithPreprocess=(e,t,n)=>new Zl({schema:t,effect:{type:"preprocess",transform:e},typeName:ct.ZodEffects,...yt(n)});class Mo extends At{_parse(t){return this._getType(t)===$e.undefined?as(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Mo.create=(e,t)=>new Mo({innerType:e,typeName:ct.ZodOptional,...yt(t)});class Kl extends At{_parse(t){return this._getType(t)===$e.null?as(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Kl.create=(e,t)=>new Kl({innerType:e,typeName:ct.ZodNullable,...yt(t)});class Op extends At{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===$e.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Op.create=(e,t)=>new Op({innerType:e,typeName:ct.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...yt(t)});class Mp extends At{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ep(o)?o.then(l=>({status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new zo(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new zo(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Mp.create=(e,t)=>new Mp({innerType:e,typeName:ct.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...yt(t)});class Nj extends At{_parse(t){if(this._getType(t)!==$e.nan){const r=this._getOrReturnCtx(t);return Oe(r,{code:Ce.invalid_type,expected:$e.nan,received:r.parsedType}),lt}return{status:"valid",value:t.data}}}Nj.create=e=>new Nj({typeName:ct.ZodNaN,...yt(e)});class AA extends At{_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 Nb extends At{_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"?lt:l.status==="dirty"?(n.dirty(),Qd(l.value)):this._def.out._parseAsync({data:l.value,path:r.path,parent:r})})();{const o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?lt:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new Nb({in:t,out:n,typeName:ct.ZodPipeline})}}class Ip extends At{_parse(t){const n=this._def.innerType._parse(t),r=o=>(wu(o)&&(o.value=Object.freeze(o.value)),o);return Ep(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}}Ip.create=(e,t)=>new Ip({innerType:e,typeName:ct.ZodReadonly,...yt(t)});var ct;(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"})(ct||(ct={}));const $t=Oo.create,qG=Ru.create,ZG=$0.create,KG=Rp.create,YG=G0.create;qi.create;const K0=Gs.create,Jt=Xn.create,WG=jp.create,DA=_b.create;Tp.create;Gl.create;const QG=_p.create,ga=Np.create;ql.create;const Ng=Ap.create;Dp.create;Mo.create;const XG=Kl.create,zx=lt,OA=Jt({serviceAccount:$t().min(1,"Service Account Key is required").transform((e,t)=>{try{const n=JSON.parse(e);return typeof n!="object"?(t.addIssue({code:Ce.custom,message:"Service Account must be a valid JSON object"}),zx):n.client_email?e:(t.addIssue({code:Ce.custom,message:"Service Account must contain a client_email field"}),zx)}catch(n){return console.error(n),t.addIssue({code:Ce.custom,message:"Service Account must be a valid JSON string"}),zx}})}),JG=[{type:"menu-item",title:"GitHub Community",href:"https://github.com/OWOX/owox-data-marts",icon:nG,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:A_,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Credits consumption",href:"https://platform.owox.com/ui/p/none/settings/consumption",icon: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:q7,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"https://platform.owox.com/ui/p/none/settings/members",icon:CR,visible:{flagKey:"IDP_PROVIDER",expectedValue:"owox"},group:"project"},{type:"menu-item",title:"Members",href:"/auth",icon:CR,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:Br,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:Br,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:Kk,visible:{flagKey:"MENU_FEEDBACK_VISIBLE",expectedValue:"true"},group:"feedback"},{type:"menu-item",title:"Issues",href:"https://github.com/OWOX/owox-data-marts/issues",icon:z7,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:fG,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:fL,visible:{flagKey:"MENU_LICENSE_VISIBLE",expectedValue:"true"},group:"legal"},{type:"menu-item",title:"OWOX BI",href:"https://bi.owox.com/",icon:uG,visible:{flagKey:"MENU_OWOX_BI_VISIBLE",expectedValue:"true"},group:"external"}];function Aj(e,t,n){if(!n||typeof n!="object")return!1;const r=n[e];return t===void 0?!!r:r===t}function eq(){const{flags:e}=Eg(),{loadProjects:t,projects:n}=EA(),{id:r}=K4(),o=Aj("IDP_PROVIDER","owox",e);m.useEffect(()=>{o&&t()},[t,o]);const l=n.length>1;return{visibleMenuItems:m.useMemo(()=>{const f=JG.filter(v=>typeof v.visible=="boolean"?v.visible:Aj(v.visible.flagKey,v.visible.expectedValue,e)).map(v=>{if(v.group==="project"&&v.href&&r)try{const b=v.href.replace("/p/none/",`/p/${r}/`);return{...v,href:b}}catch{return v}return v}),h=new Map;f.forEach(v=>{const b=v.group||"default";h.has(b)||h.set(b,[]);const E=h.get(b);E&&E.push(v)});const g=[],y=Array.from(h.entries()).filter(([,v])=>v.length>0);return y.forEach(([,v],b)=>{g.push(...v),b<y.length-1&&g.push({type:"separator",visible:!0})}),g},[e,r]),canSwitchProject:l}}function tq(){const{visibleMenuItems:e,canSwitchProject:t}=eq();return a.jsxs(fr,{align:"start",sideOffset:8,className:"w-56",children:[e.map((n,r)=>{if(n.type==="separator")return a.jsx(ma,{},`separator-${String(r)}`);const o=n.icon;return a.jsx(pt,{asChild:!0,children:a.jsxs("a",{href:n.href,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[a.jsx(o,{className:"size-4"}),n.title]})},n.href)}),t&&a.jsx(tG,{},"switch-project")]})}var Lr=(e=>(e.IDLE="idle",e.LOADING="loading",e.LOADED="loaded",e.ERROR="error",e))(Lr||{});let nq={data:""},rq=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||nq},aq=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,sq=/\/\*[^]*?\*\/| +/g,Dj=/\n+/g,Oi=(e,t)=>{let n="",r="",o="";for(let l in e){let c=e[l];l[0]=="@"?l[1]=="i"?n=l+" "+c+";":r+=l[1]=="f"?Oi(c,l):l+"{"+Oi(c,l[1]=="k"?"":t)+"}":typeof c=="object"?r+=Oi(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(),o+=Oi.p?Oi.p(l,c):l+":"+c+";")}return n+(t&&o?t+"{"+o+"}":o)+r},wo={},MA=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+MA(e[n]);return t}return e},oq=(e,t,n,r,o)=>{let l=MA(e),c=wo[l]||(wo[l]=(f=>{let h=0,g=11;for(;h<f.length;)g=101*g+f.charCodeAt(h++)>>>0;return"go"+g})(l));if(!wo[c]){let f=l!==e?e:(h=>{let g,y,v=[{}];for(;g=aq.exec(h.replace(sq,""));)g[4]?v.shift():g[3]?(y=g[3].replace(Dj," ").trim(),v.unshift(v[0][y]=v[0][y]||{})):v[0][g[1]]=g[2].replace(Dj," ").trim();return v[0]})(e);wo[c]=Oi(o?{["@keyframes "+c]:f}:f,n?"":"."+c)}let d=n&&wo.g?wo.g:null;return n&&(wo.g=wo[c]),((f,h,g,y)=>{y?h.data=h.data.replace(y,f):h.data.indexOf(f)===-1&&(h.data=g?f+h.data:h.data+f)})(wo[c],t,r,d),c},iq=(e,t,n)=>e.reduce((r,o,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?"":Oi(d,""):d===!1?"":d}return r+o+(c??"")},"");function Ag(e){let t=this||{},n=e.call?e(t.p):e;return oq(n.unshift?n.raw?iq(n,[].slice.call(arguments,1),t.p):n.reduce((r,o)=>Object.assign(r,o&&o.call?o(t.p):o),{}):n,rq(t.target),t.g,t.o,t.k)}let IA,Y0,W0;Ag.bind({g:1});let Ho=Ag.bind({k:1});function lq(e,t,n,r){Oi.p=t,IA=e,Y0=n,W0=r}function tl(e,t){let n=this||{};return function(){let r=arguments;function o(l,c){let d=Object.assign({},l),f=d.className||o.className;n.p=Object.assign({theme:Y0&&Y0()},d),n.o=/ *go\d+/.test(f),d.className=Ag.apply(n,r)+(f?" "+f:"");let h=e;return e[0]&&(h=d.as||e,delete d.as),W0&&h[0]&&W0(d),IA(h,d)}return o}}var cq=e=>typeof e=="function",kp=(e,t)=>cq(e)?e(t):e,uq=(()=>{let e=0;return()=>(++e).toString()})(),kA=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),dq=20,Ab="default",LA=(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 LA(e,{type:e.toasts.find(c=>c.id===r.id)?1:0,toast:r});case 3:let{toastId:o}=t;return{...e,toasts:e.toasts.map(c=>c.id===o||o===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}))}}},np=[],PA={toasts:[],pausedAt:void 0,settings:{toastLimit:dq}},zs={},UA=(e,t=Ab)=>{zs[t]=LA(zs[t]||PA,e),np.forEach(([n,r])=>{n===t&&r(zs[t])})},FA=e=>Object.keys(zs).forEach(t=>UA(e,t)),fq=e=>Object.keys(zs).find(t=>zs[t].toasts.some(n=>n.id===e)),Dg=(e=Ab)=>t=>{UA(t,e)},hq={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},mq=(e={},t=Ab)=>{let[n,r]=m.useState(zs[t]||PA),o=m.useRef(zs[t]);m.useEffect(()=>(o.current!==zs[t]&&r(zs[t]),np.push([t,r]),()=>{let c=np.findIndex(([d])=>d===t);c>-1&&np.splice(c,1)}),[t]);let l=n.toasts.map(c=>{var d,f,h;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)||hq[c.type],style:{...e.style,...(h=e[c.type])==null?void 0:h.style,...c.style}}});return{...n,toasts:l}},pq=(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)||uq()}),Yf=e=>(t,n)=>{let r=pq(t,e,n);return Dg(r.toasterId||fq(r.id))({type:2,toast:r}),r.id},on=(e,t)=>Yf("blank")(e,t);on.error=Yf("error");on.success=Yf("success");on.loading=Yf("loading");on.custom=Yf("custom");on.dismiss=(e,t)=>{let n={type:3,toastId:e};t?Dg(t)(n):FA(n)};on.dismissAll=e=>on.dismiss(void 0,e);on.remove=(e,t)=>{let n={type:4,toastId:e};t?Dg(t)(n):FA(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(o=>{let l=t.success?kp(t.success,o):void 0;return l?on.success(l,{id:r,...n,...n==null?void 0:n.success}):on.dismiss(r),o}).catch(o=>{let l=t.error?kp(t.error,o):void 0;l?on.error(l,{id:r,...n,...n==null?void 0:n.error}):on.dismiss(r)}),e};var gq=1e3,yq=(e,t="default")=>{let{toasts:n,pausedAt:r}=mq(e,t),o=m.useRef(new Map).current,l=m.useCallback((y,v=gq)=>{if(o.has(y))return;let b=setTimeout(()=>{o.delete(y),c({type:4,toastId:y})},v);o.set(y,b)},[]);m.useEffect(()=>{if(r)return;let y=Date.now(),v=n.map(b=>{if(b.duration===1/0)return;let E=(b.duration||0)+b.pauseDuration-(y-b.createdAt);if(E<0){b.visible&&on.dismiss(b.id);return}return setTimeout(()=>on.dismiss(b.id,t),E)});return()=>{v.forEach(b=>b&&clearTimeout(b))}},[n,r,t]);let c=m.useCallback(Dg(t),[t]),d=m.useCallback(()=>{c({type:5,time:Date.now()})},[c]),f=m.useCallback((y,v)=>{c({type:1,toast:{id:y,height:v}})},[c]),h=m.useCallback(()=>{r&&c({type:6,time:Date.now()})},[r,c]),g=m.useCallback((y,v)=>{let{reverseOrder:b=!1,gutter:E=8,defaultPosition:S}=v||{},C=n.filter(_=>(_.position||S)===(y.position||S)&&_.height),R=C.findIndex(_=>_.id===y.id),j=C.filter((_,D)=>D<R&&_.visible).length;return C.filter(_=>_.visible).slice(...b?[j+1]:[0,j]).reduce((_,D)=>_+(D.height||0)+E,0)},[n]);return m.useEffect(()=>{n.forEach(y=>{if(y.dismissed)l(y.id,y.removeDelay);else{let v=o.get(y.id);v&&(clearTimeout(v),o.delete(y.id))}})},[n,l]),{toasts:n,handlers:{updateHeight:f,startPause:d,endPause:h,calculateOffset:g}}},vq=Ho`
491
- from {
492
- transform: scale(0) rotate(45deg);
493
- opacity: 0;
494
- }
495
- to {
496
- transform: scale(1) rotate(45deg);
497
- opacity: 1;
498
- }`,xq=Ho`
499
- from {
500
- transform: scale(0);
501
- opacity: 0;
502
- }
503
- to {
504
- transform: scale(1);
505
- opacity: 1;
506
- }`,bq=Ho`
507
- from {
508
- transform: scale(0) rotate(90deg);
509
- opacity: 0;
510
- }
511
- to {
512
- transform: scale(1) rotate(90deg);
513
- opacity: 1;
514
- }`,Sq=tl("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: ${vq} 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: ${xq} 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: ${bq} 0.15s ease-out forwards;
544
- animation-delay: 180ms;
545
- transform: rotate(90deg);
546
- }
547
- `,Cq=Ho`
548
- from {
549
- transform: rotate(0deg);
550
- }
551
- to {
552
- transform: rotate(360deg);
553
- }
554
- `,Eq=tl("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: ${Cq} 1s linear infinite;
563
- `,wq=Ho`
564
- from {
565
- transform: scale(0) rotate(45deg);
566
- opacity: 0;
567
- }
568
- to {
569
- transform: scale(1) rotate(45deg);
570
- opacity: 1;
571
- }`,Rq=Ho`
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
- }`,jq=tl("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: ${wq} 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: ${Rq} 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
- `,Tq=tl("div")`
613
- position: absolute;
614
- `,_q=tl("div")`
615
- position: relative;
616
- display: flex;
617
- justify-content: center;
618
- align-items: center;
619
- min-width: 20px;
620
- min-height: 20px;
621
- `,Nq=Ho`
622
- from {
623
- transform: scale(0.6);
624
- opacity: 0.4;
625
- }
626
- to {
627
- transform: scale(1);
628
- opacity: 1;
629
- }`,Aq=tl("div")`
630
- position: relative;
631
- transform: scale(0.6);
632
- opacity: 0.4;
633
- min-width: 20px;
634
- animation: ${Nq} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
635
- forwards;
636
- `,Dq=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?m.createElement(Aq,null,t):t:n==="blank"?null:m.createElement(_q,null,m.createElement(Eq,{...r}),n!=="loading"&&m.createElement(Tq,null,n==="error"?m.createElement(Sq,{...r}):m.createElement(jq,{...r})))},Oq=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
- `,Mq=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
- `,Iq="0%{opacity:0;} 100%{opacity:1;}",kq="0%{opacity:1;} 100%{opacity:0;}",Lq=tl("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
- `,Pq=tl("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
- `,Uq=(e,t)=>{let n=e.includes("top")?1:-1,[r,o]=kA()?[Iq,kq]:[Oq(n),Mq(n)];return{animation:t?`${Ho(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Ho(o)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},Fq=m.memo(({toast:e,position:t,style:n,children:r})=>{let o=e.height?Uq(e.position||t||"top-center",e.visible):{opacity:0},l=m.createElement(Dq,{toast:e}),c=m.createElement(Pq,{...e.ariaProps},kp(e.message,e));return m.createElement(Lq,{className:e.className,style:{...o,...n,...e.style}},typeof r=="function"?r({icon:l,message:c}):m.createElement(m.Fragment,null,l,c))});lq(m.createElement);var Vq=({id:e,className:t,style:n,onHeightUpdate:r,children:o})=>{let l=m.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 m.createElement("div",{ref:l,className:t,style:n},o)},zq=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},o=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:kA()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...o}},Hq=Ag`
662
- z-index: 9999;
663
- > * {
664
- pointer-events: auto;
665
- }
666
- `,Dm=16,$q=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:o,toasterId:l,containerStyle:c,containerClassName:d})=>{let{toasts:f,handlers:h}=yq(n,l);return m.createElement("div",{"data-rht-toaster":l||"",style:{position:"fixed",zIndex:9999,top:Dm,left:Dm,right:Dm,bottom:Dm,pointerEvents:"none",...c},className:d,onMouseEnter:h.startPause,onMouseLeave:h.endPause},f.map(g=>{let y=g.position||t,v=h.calculateOffset(g,{reverseOrder:e,gutter:r,defaultPosition:t}),b=zq(y,v);return m.createElement(Vq,{id:g.id,key:g.id,onHeightUpdate:h.updateHeight,className:g.visible?Hq:"",style:b},g.type==="custom"?kp(g.message,g):o?o(g):m.createElement(Fq,{toast:g,position:y}))}))},It=on;const Cn=e=>{var n;return(n=e.response)==null?void 0:n.data};function Oj(e,t="Something went wrong"){var o,l;const n=Cn(e);let r=n.message.trim()||t;(l=(o=n.errorDetails)==null?void 0:o.error)!=null&&l.trim()&&(r=`${r}. ${n.errorDetails.error}`),It.error(r)}class Bq{constructor(){Ls(this,"isRefreshingToken",!1);Ls(this,"refreshTokenPromise",null);Ls(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 Gq={baseURL:"/api",timeout:3e4,headers:{"Content-Type":"application/json",Accept:"application/json"}},ca=Un.create(Gq),Q0=new Bq;ca.interceptors.request.use(e=>{if(e.skipAuthHeader||new IB(e.headers).has("X-OWOX-Authorization"))return e;const n=Tb(),r=(n==null?void 0:n.getAccessToken())??Q0.getAccessToken();return r&&(e.headers["X-OWOX-Authorization"]=`Bearer ${r}`),e},e=>Promise.reject(e instanceof Error?e:new Error("Unknown error")));ca.interceptors.response.use(e=>e,async e=>{var n,r,o;const t=e.config;if(((n=e.response)==null?void 0:n.status)===401&&!t._retry){t._retry=!0;try{const l=Tb();if(!l)throw new Error("No token provider available");const c=await Q0.refreshToken(()=>l.refreshToken());return t.headers["X-OWOX-Authorization"]=`Bearer ${c}`,await ca(t)}catch{return Q0.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&&Oj(e,"Access forbidden - insufficient permissions"),((o=e.response)==null?void 0:o.status)===400&&Oj(e,"Bad request"),Promise.reject(e)});const VA={projects:[],callState:Lr.IDLE,error:null};function qq(e,t){switch(t.type){case"LOADING":return{...e,callState:Lr.LOADING,error:null};case"SUCCESS":return{projects:t.payload,callState:Lr.LOADED,error:null};case"ERROR":return{...e,callState:Lr.ERROR,error:t.payload};case"RESET":return{...VA};default:return e}}function Zq({children:e}){const[t,n]=m.useReducer(qq,VA),r=m.useCallback(async()=>{n({type:"LOADING"});try{const d=Tb();if(!d){n({type:"ERROR",payload:Cn(new vj("No token provider"))});return}const f=d.getAccessToken();if(!f){n({type:"ERROR",payload:Cn(new vj("Unable to obtain access token"))});return}const h=await zB(f);n({type:"SUCCESS",payload:h})}catch(d){n({type:"ERROR",payload:Cn(d)})}},[]),o=m.useCallback(()=>{n({type:"RESET"})},[]),l=t.callState===Lr.LOADING,c={...t,loadProjects:r,reset:o,isLoading:l};return a.jsx(CA.Provider,{value:c,children:e})}function Kq(){const[e,t]=m.useState(!1);return a.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:"flex flex-col gap-2",children:a.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:"flex w-full min-w-0 flex-col gap-1",children:a.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(ur,{open:e,onOpenChange:t,children:[a.jsx(a$,{isOpen:e}),a.jsx(Zq,{children:a.jsx(tq,{})})]})})})})}var Yq=(e,t,n,r,o,l,c,d)=>{let f=document.documentElement,h=["light","dark"];function g(b){(Array.isArray(e)?e:[e]).forEach(E=>{let S=E==="class",C=S&&l?o.map(R=>l[R]||R):o;S?(f.classList.remove(...C),f.classList.add(l&&l[b]?l[b]:b)):f.setAttribute(E,b)}),y(b)}function y(b){d&&h.includes(b)&&(f.style.colorScheme=b)}function v(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(r)g(r);else try{let b=localStorage.getItem(t)||n,E=c&&b==="system"?v():b;g(E)}catch{}},Mj=["light","dark"],zA="(prefers-color-scheme: dark)",Wq=typeof window>"u",Db=m.createContext(void 0),Qq={setTheme:e=>{},themes:[]},Ob=()=>{var e;return(e=m.useContext(Db))!=null?e:Qq},Xq=e=>m.useContext(Db)?m.createElement(m.Fragment,null,e.children):m.createElement(eZ,{...e}),Jq=["light","dark"],eZ=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:r=!0,storageKey:o="theme",themes:l=Jq,defaultTheme:c=n?"system":"light",attribute:d="data-theme",value:f,children:h,nonce:g,scriptProps:y})=>{let[v,b]=m.useState(()=>nZ(o,c)),[E,S]=m.useState(()=>v==="system"?Hx():v),C=f?Object.values(f):l,R=m.useCallback(A=>{let O=A;if(!O)return;A==="system"&&n&&(O=Hx());let T=f?f[O]:O,M=t?rZ(g):null,V=document.documentElement,Z=K=>{K==="class"?(V.classList.remove(...C),T&&V.classList.add(T)):K.startsWith("data-")&&(T?V.setAttribute(K,T):V.removeAttribute(K))};if(Array.isArray(d)?d.forEach(Z):Z(d),r){let K=Mj.includes(c)?c:null,Y=Mj.includes(O)?O:K;V.style.colorScheme=Y}M==null||M()},[g]),j=m.useCallback(A=>{let O=typeof A=="function"?A(v):A;b(O);try{localStorage.setItem(o,O)}catch{}},[v]),_=m.useCallback(A=>{let O=Hx(A);S(O),v==="system"&&n&&!e&&R("system")},[v,e]);m.useEffect(()=>{let A=window.matchMedia(zA);return A.addListener(_),_(A),()=>A.removeListener(_)},[_]),m.useEffect(()=>{let A=O=>{O.key===o&&(O.newValue?b(O.newValue):j(c))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[j]),m.useEffect(()=>{R(e??v)},[e,v]);let D=m.useMemo(()=>({theme:v,setTheme:j,forcedTheme:e,resolvedTheme:v==="system"?E:v,themes:n?[...l,"system"]:l,systemTheme:n?E:void 0}),[v,j,e,E,n,l]);return m.createElement(Db.Provider,{value:D},m.createElement(tZ,{forcedTheme:e,storageKey:o,attribute:d,enableSystem:n,enableColorScheme:r,defaultTheme:c,value:f,themes:l,nonce:g,scriptProps:y}),h)},tZ=m.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:o,defaultTheme:l,value:c,themes:d,nonce:f,scriptProps:h})=>{let g=JSON.stringify([n,t,l,e,d,c,r,o]).slice(1,-1);return m.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(${Yq.toString()})(${g})`}})}),nZ=(e,t)=>{if(Wq)return;let n;try{n=localStorage.getItem(e)||void 0}catch{}return n||t},rZ=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)}},Hx=e=>(e||(e=window.matchMedia(zA)),e.matches?"dark":"light");const aZ=({theme:e,setTheme:t,signOut:n})=>[{type:"submenu",title:"Appearance",icon:sZ(e),submenu:{value:e,onChange:r=>{t(r)},options:[{value:"system",label:"System",icon:__},{value:"light",label:"Light",icon:O_},{value:"dark",label:"Dark",icon:N_}]}},{type:"separator"},{type:"item",title:"Sign out",icon:Hk,onClick:n,className:"text-red-600 focus:text-red-600"}];function sZ(e){switch(e){case"light":return O_;case"dark":return N_;case"system":default:return __}}function oZ({avatar:e,initials:t,displayName:n}){return a.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?a.jsx("img",{src:e,alt:n,className:"size-full rounded-full object-cover"}):a.jsx("span",{children:t})})}function iZ({isOpen:e,displayName:t,email:n,avatar:r,initials:o}){return a.jsx(dr,{asChild:!0,children:a.jsxs("button",{type:"button","data-slot":"dropdown-menu-trigger","data-sidebar":"menu-button","data-size":"lg","data-active":e?"true":"false","aria-haspopup":"menu","aria-expanded":e,"data-state":e?"open":"closed",className:"peer/menu-button ring-sidebar-ring active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground flex h-12 w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:rounded-full group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[a.jsx(oZ,{avatar:r,initials:o,displayName:t}),a.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight group-data-[collapsible=icon]:hidden",children:[a.jsx("span",{className:"truncate font-medium",children:t}),n&&a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:n})]}),a.jsx(ka,{className:`ml-auto size-4 transition-transform duration-200 group-data-[collapsible=icon]:hidden ${e?"rotate-180":""}`})]})})}function lZ({items:e}){return a.jsx(fr,{align:"start",side:"top",sideOffset:8,className:"w-56",children:e.map((t,n)=>{if(t.type==="separator")return a.jsx(ma,{},`sep-${String(n)}`);if(t.type==="submenu"){const{submenu:r}=t;return a.jsxs(vb,{children:[a.jsxs(xb,{className:"flex items-center gap-2 px-2 py-1.5",children:[a.jsx(t.icon,{className:"size-4"}),t.title]}),a.jsx(bb,{children:r.options.map(o=>a.jsxs(pt,{className:"flex items-center gap-2 px-2 py-1.5",onClick:()=>{r.onChange(o.value)},children:[o.icon&&a.jsx(o.icon,{className:"size-4"}),o.label,r.value===o.value&&a.jsx(lr,{className:"ml-auto size-4"})]},o.value))})]},t.title)}return a.jsxs(pt,{onClick:t.onClick,className:`flex items-center gap-2 px-2 py-1.5 ${t.className??""}`,children:[a.jsx(t.icon,{className:`size-4 ${t.className??""}`}),t.title]},t.title)})})}function cZ(e,t){var n,r,o,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=(o=c[0])==null?void 0:o[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 uZ(){const{user:e,signOut:t}=el(),{setTheme:n,theme:r}=Ob(),[o,l]=m.useState(!1);if(!e)return null;const{fullName:c,email:d,avatar:f}=e,h=c??d??"Unknown User",g=cZ(c,d);return a.jsx("div",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:"group/menu-item relative",children:a.jsxs(ur,{open:o,onOpenChange:l,children:[a.jsx(iZ,{isOpen:o,displayName:h,email:d,avatar:f,initials:g}),a.jsx(lZ,{items:aZ({theme:r,setTheme:n,signOut:t})})]})})}function dZ(){const{user:e,status:t}=el();return t===kr.LOADING||t===kr.UNAUTHENTICATED||!(e!=null&&e.projectId)?null:e.projectId}function Ko(){const e=Jp(),t=dZ(),n=m.useCallback((l,c)=>{if(!t){e("/",{replace:!0});return}const d=Cp(t,l);e(d,c)},[e,t]),r=m.useCallback(l=>t?Cp(t,l):l,[t]);return m.useMemo(()=>({navigate:n,scope:r,projectId:t}),[n,r,t])}function fZ(){const{scope:e}=Ko();return a.jsxs(Nf,{to:e("/data-marts/create"),"data-sidebar":"menu-button","data-size":"md",className:"peer/menu-button ring-sidebar-ring bg-primary hover:bg-primary-hover text-primary-foreground hover:text-primary-foreground flex h-8 w-full items-center gap-2 overflow-hidden rounded-full p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-0! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",children:[a.jsx("div",{className:"flex aspect-square size-8 items-center justify-center",children:a.jsx(Pa,{className:"size-4 shrink-0"})}),a.jsx("div",{className:"grid flex-1 text-left text-sm leading-tight",children:a.jsx("span",{className:"truncate font-medium",children:"New Data Mart"})})]})}const hZ=[{title:"Data Marts",url:"/data-marts",icon:up},{title:"Storages",url:"/data-storages",icon:zl},{title:"Destinations",url:"/data-destinations",icon:H1}];function mZ(){const{scope:e}=Ko();return a.jsx(lz,{children:hZ.map(t=>{const n=t.icon;return a.jsx(cz,{children:a.jsx(Nf,{to:e(t.url),className:({isActive:r})=>`flex w-full items-center gap-2 rounded-md font-medium transition-colors ${r?"bg-sidebar-active text-sidebar-active-foreground font-medium shadow-sm":""}`,children:({isActive:r})=>a.jsxs(bt,{delayDuration:500,children:[a.jsx(St,{asChild:!0,children:a.jsxs(dz,{className:`${r?"hover:bg-transparent":""}`,children:[a.jsx(n,{className:"size-4 shrink-0 transition-all"}),a.jsx("span",{children:t.title}),t.badge&&a.jsx("span",{className:"bg-primary/20 text-primary ml-auto rounded-full px-2 py-0.5 text-xs",children:t.badge})]})}),a.jsx(Ct,{side:"right",children:t.title})]})})},t.title)})})}function pZ({variant:e="inset",collapsible:t="icon"}){return a.jsxs(tz,{variant:e,collapsible:t,children:[a.jsx(sz,{children:a.jsx(Kq,{})}),a.jsxs(iz,{children:[a.jsx(XR,{children:a.jsx(JR,{children:a.jsx(fZ,{})})}),a.jsx(XR,{children:a.jsx(JR,{children:a.jsx(mZ,{})})})]}),a.jsx(oz,{children:a.jsx(uZ,{})}),a.jsx(rz,{})]})}function gZ({children:e,...t}){return a.jsx(Xq,{attribute:"class",defaultTheme:"system",enableSystem:!0,...t,children:e})}class ac{constructor(t){Ls(this,"baseUrl");this.baseUrl=t}async get(t,n,r){const o=this.createUrl(t);return(await ca.get(o,{...r,params:n})).data}async post(t,n,r){const o=this.createUrl(t);return(await ca.post(o,n,r)).data}async put(t,n,r){const o=this.createUrl(t);return(await ca.put(o,n,r)).data}async patch(t,n,r){const o=this.createUrl(t);return(await ca.patch(o,n,r)).data}async delete(t,n){const r=this.createUrl(t);return(await ca.delete(r,n)).data}createUrl(t){return this.baseUrl?`${this.baseUrl}${t}`:t}}class yZ{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 o=JSON.parse(r);return typeof o=="object"?o: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 Ii=new yZ;class vZ{getTimezones(){return Intl.supportedValuesOf("timeZone")}getTimezonesWithOffset(){const t=this.getTimezones(),n=new Date;return t.map(r=>{const o=this.getTimezoneOffset(r,n),l=this.formatOffset(o),c=this.isDaylightSavingTime(r,n),d=this.getDisplayName(r,l);return{identifier:r,displayName:d,offsetMinutes:o,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}),o=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(o.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),o=Math.floor(r/60),l=r%60;return`${n}${o.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}`}isDaylightSavingTime(t,n=new Date){try{const r=new Date(n.getFullYear(),0,1),o=new Date(n.getFullYear(),6,1),l=this.getTimezoneOffset(t,r),c=this.getTimezoneOffset(t,o),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),o=this.formatOffset(r),l=this.isDaylightSavingTime(t,n),c=this.getDisplayName(t,o);return{identifier:t,displayName:c,offsetMinutes:r,offsetString:o,isDST:l}}getBrowserOffset(){return this.getBrowserTimezone().offsetMinutes}}const xZ=new vZ;function bZ({isLoading:e,className:t}){const[n,r]=m.useState(0),[o,l]=m.useState(!1);return m.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]),a.jsx("div",{className:ne("fixed top-0 right-0 left-0 z-50 h-1 transition-opacity duration-300",!o&&"opacity-0",t),children:a.jsx("div",{className:"bg-primary h-full transition-all duration-300 ease-out",style:{width:`${n.toString()}%`}})})}const HA=m.createContext({isLoading:!1});function SZ({children:e}){const[t,n]=m.useState(0),r=t>0;return m.useEffect(()=>{const o=ca.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=ca.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()=>{ca.interceptors.request.eject(o),ca.interceptors.response.eject(l)}},[]),a.jsx(HA.Provider,{value:{isLoading:r},children:e})}function CZ(){return m.useContext(HA)}function EZ(){return a.jsx($q,{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 wZ({children:e}){const{isLoading:t}=SA(),n=WB(),r=p_(),o=Qs();return m.useEffect(()=>{if(t)return;const l=r.projectId,c=n==null?void 0:n.projectId;if(l&&!o.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,o.pathname]),a.jsx(a.Fragment,{children:e})}const Ij="sidebar_state";function RZ(){const{state:e,isMobile:t}=Ff(),r=t||e==="collapsed",{isLoading:o}=CZ();return a.jsxs(a.Fragment,{children:[a.jsx(EZ,{}),a.jsx(bZ,{isLoading:o}),a.jsxs(QB,{redirectTo:"/auth/sign-in",children:[a.jsx(pZ,{variant:"inset",collapsible:"icon"}),a.jsxs(az,{children:[r&&a.jsx(nz,{}),a.jsx(wZ,{children:a.jsx(y_,{})})]})]})]})}function jZ(){const[e,t]=m.useState(()=>Ii.get(Ij,"boolean")??!0),n=r=>{t(r),Ii.set(Ij,r)};return a.jsx(gZ,{children:a.jsx(SZ,{children:a.jsx(ez,{open:e,onOpenChange:n,children:a.jsx(RZ,{})})})})}function TZ(){return a.jsxs("div",{className:"app-container",children:[a.jsx("h1",{children:"About OWOX"}),a.jsx("p",{children:"OWOX Data Marts — Free, Open-Source Connectors for Data Analysts"})]})}function kj(){return a.jsxs("div",{className:"dm-empty-state-404page",children:[a.jsxs("div",{className:"dm-empty-state-404page-foreground",children:[a.jsx(bL,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h1",{className:"dm-empty-state-title",children:"Lost in the 404th Data Realm"}),a.jsxs("p",{className:"dm-empty-state-subtitle",children:["In this dimension, ",a.jsx("code",{children:"1+1=3"}),", percentages exceed 100%, and dashboards predict"," ",a.jsx("i",{children:"yesterday"}),".",a.jsx("br",{}),"Escape while you can!"]}),a.jsx(xe,{variant:"default",asChild:!0,children:a.jsxs(ha,{to:"/",className:"flex items-center gap-1","aria-label":"Guide Me Home",children:["Guide Me Home",a.jsx(La,{className:"h-4 w-4"})]})})]}),a.jsx("div",{className:"dm-empty-state-404page-background"})]})}const _Z={items:[],loading:!1,error:null};function NZ(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 $A=m.createContext(void 0);function AZ({children:e}){const[t,n]=m.useReducer(NZ,_Z);return a.jsx($A.Provider,{value:{state:t,dispatch:n},children:e})}function DZ(){const e=m.useContext($A);if(e===void 0)throw new Error("useDataMartListContext must be used within a DataMartListProvider");return e}class OZ extends ac{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,o){return await this.get(`/${t}/runs`,{limit:n,offset:r},o)}async getDataMartsByConnectorName(t){return this.get(`/by-connector/${t}`)}}const sn=new OZ;var Rr=(e=>(e.DRAFT="DRAFT",e.PUBLISHED="PUBLISHED",e))(Rr||{}),Fe=(e=>(e.SQL="SQL",e.TABLE="TABLE",e.VIEW="VIEW",e.TABLE_PATTERN="TABLE_PATTERN",e.CONNECTOR="CONNECTOR",e))(Fe||{}),rp=(e=>(e.ALREADY_PUBLISHED="ALREADY_PUBLISHED",e.INVALID_STORAGE="INVALID_STORAGE",e.MISSING_DEFINITION="MISSING_DEFINITION",e))(rp||{});const MZ={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 BA=(e=>(e.SCHEDULED="scheduled",e.MANUAL="manual",e))(BA||{}),Mr=(e=>(e.CONNECTOR="CONNECTOR",e.GOOGLE_SHEETS_EXPORT="GOOGLE_SHEETS_EXPORT",e.LOOKER_STUDIO="LOOKER_STUDIO",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e.INSIGHT="INSIGHT",e))(Mr||{}),ir=(e=>(e.RUNNING="RUNNING",e.SUCCESS="SUCCESS",e.FAILED="FAILED",e.CANCELLED="CANCELLED",e.INTERRUPTED="INTERRUPTED",e.PENDING="PENDING",e))(ir||{});const GA={statuses:{[Rr.DRAFT]:{code:Rr.DRAFT,displayName:"Draft",description:"Data mart is in draft mode and not yet published"},[Rr.PUBLISHED]:{code:Rr.PUBLISHED,displayName:"Published",description:"Data mart is published and available for use"}},getInfo(e){return this.statuses[e]},getAllStatuses(){return Object.values(this.statuses)}},qA=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+$/.test(e):!1,ZA=e=>e?/^[a-zA-Z0-9_-]+\.[a-zA-Z0-9_-]+\.[a-zA-Z0-9_\-*]+$/.test(e):!1,IZ=e=>e?qA(e)?"":"Invalid format. Expected: project.dataset.object":"Fully qualified name is required",kZ=e=>e?ZA(e)?"":"Invalid format. Expected: project.dataset.table_* (with wildcards)":"Table pattern is required",KA=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)},YA=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)},LZ=e=>e?KA(e)?"":"Invalid format. Expected: database.object or catalog.database.object":"Fully qualified name is required",PZ=e=>e?YA(e)?"":"Invalid format. Expected: database.table_* or catalog.database.table_* (with wildcards)":"Table pattern is required",UZ=[{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 FZ(e){return"projectId"in e}function VZ(e){return"outputBucket"in e}var ke=(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))(ke||{}),Do=(e=>(e.ACTIVE="active",e.COMING_SOON="coming_soon",e))(Do||{});const zZ=({label:e,value:t,truncate:n=!1})=>{const r=typeof t=="string"?t.trim():t,o=r==="";return a.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[a.jsxs("span",{className:"text-muted-foreground text-sm",children:[e,":"]}),n&&r&&!o?a.jsx("span",{className:"truncate text-sm",title:r,children:r.length>30?r.substring(0,30)+"...":r}):a.jsx("span",{className:"text-sm",children:o||r===void 0?a.jsx("span",{className:"text-muted-foreground",children:"—"}):r})]})},HZ=({type:e,config:t})=>{const n={[ke.GOOGLE_BIGQUERY]:[{label:"Project ID",key:"projectId"},{label:"Location",key:"location"}],[ke.AWS_ATHENA]:[{label:"Region",key:"region"},{label:"Output Bucket",key:"outputBucket"}],[ke.SNOWFLAKE]:[],[ke.DATABRICKS]:[],[ke.AWS_REDSHIFT]:[],[ke.AZURE_SYNAPSE]:[]},r=t&&(e===ke.GOOGLE_BIGQUERY&&FZ(t)||e===ke.AWS_ATHENA&&VZ(t));return a.jsx("div",{className:"grid gap-2",children:n[e].map(({label:o,key:l})=>{let c;return r&&(c=(e===ke.GOOGLE_BIGQUERY,t[l])),a.jsx(zZ,{label:o,value:c},l)})})},$Z=({type:e,config:t})=>a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("h4",{className:"text-sm font-medium",children:"Configuration"}),a.jsx(HZ,{type:e,config:t})]})}),BZ=Af("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 gr({className:e,variant:t,asChild:n=!1,...r}){const o=n?tg:"span";return a.jsx(o,{"data-slot":"badge",className:ne(BZ({variant:t}),e),...r})}function WA(e){return e.type===ke.GOOGLE_BIGQUERY}function QA(e){return e.type===ke.AWS_ATHENA}const nl={types:{[ke.GOOGLE_BIGQUERY]:{type:ke.GOOGLE_BIGQUERY,displayName:"Google BigQuery",icon:wA,status:Do.ACTIVE},[ke.AWS_ATHENA]:{type:ke.AWS_ATHENA,displayName:"AWS Athena",icon:RA,status:Do.ACTIVE},[ke.SNOWFLAKE]:{type:ke.SNOWFLAKE,displayName:"Snowflake",icon:oG,status:Do.COMING_SOON},[ke.DATABRICKS]:{type:ke.DATABRICKS,displayName:"Databricks",icon:iG,status:Do.COMING_SOON},[ke.AWS_REDSHIFT]:{type:ke.AWS_REDSHIFT,displayName:"AWS Redshift",icon:lG,status:Do.COMING_SOON},[ke.AZURE_SYNAPSE]:{type:ke.AZURE_SYNAPSE,displayName:"Azure Synapse",icon:cG,status:Do.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}};function GZ({dataStorage:e,isLoading:t=!1}){if(t)return a.jsx("div",{className:"space-y-4",children:a.jsx("div",{className:"grid gap-4",children:Array(4).fill(0).map((c,d)=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(hs,{className:"h-5 w-24"}),a.jsx(hs,{className:"h-6 w-40"})]},d))})});if(!e)return a.jsx("div",{children:"No storage information available."});const{type:n,config:r,createdAt:o,modifiedAt:l}=e;return a.jsx("div",{className:"space-y-2",children:a.jsxs("div",{className:"grid gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{children:e.title}),a.jsx(gr,{variant:"secondary",className:"flex h-7 items-center gap-2",children:(()=>{const{displayName:c,icon:d}=nl.getInfo(n);return a.jsxs(a.Fragment,{children:[a.jsx(d,{}),c]})})()})]}),a.jsx("div",{className:"bg-muted/10 rounded-md border p-4",children:a.jsx($Z,{type:n,config:r})}),a.jsxs("div",{className:"text-muted-foreground flex gap-6 text-xs",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Created:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(o))]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium",children:"Modified:"})," ",new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(l))]})]})]})})}function qZ(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 ZZ(e,t,n){const r=encodeURIComponent(e),o=encodeURIComponent(t),l=encodeURIComponent(n);return`https://console.cloud.google.com/bigquery?project=${r}&ws=!1m5!1m4!4m3!1s${r}!2s${o}!3s${l}`}function KZ(e){return`https://console.aws.amazon.com/athena/home?region=${encodeURIComponent(e)}#/query-editor`}function YZ(e,t){const n=qZ(t);if(!n)return null;const{dataset:r,table:o}=n;return WA(e)?ZZ(e.config.projectId,r,o):QA(e)?KZ(e.config.region):null}function WZ(e,t){const n=YZ(e,t);return n?(window.open(n,"_blank","noopener,noreferrer"),!0):!1}function QZ(e){return WA(e)?"Open table in Google BigQuery":QA(e)?"Open region in AWS Athena":"Open data in storage"}function XA(e){switch(e.type){case ke.GOOGLE_BIGQUERY:return!!(e.config.projectId&&e.config.location);case ke.AWS_ATHENA:return!!(e.config.region&&e.config.outputBucket);default:return!1}}const XZ=Jt({accessKeyId:$t().min(1,"Access Key ID is required"),secretAccessKey:$t().min(1,"Secret Access Key is required")}),JZ=Jt({projectId:$t().min(1,"Project ID is required"),location:$t().min(1,"Location is required")}),eK=Jt({region:$t().min(1,"Region is required"),outputBucket:$t().min(1,"Output Bucket is required")}),JA=Jt({title:$t().min(1,"Title is required").max(255,"Title must be 255 characters or less")}),tK=JA.extend({type:ga(ke.GOOGLE_BIGQUERY),credentials:OA,config:JZ}),nK=JA.extend({type:ga(ke.AWS_ATHENA),credentials:XZ,config:eK}),rK=DA("type",[tK,nK]),aK=(e,t)=>{if(!e)return!1;switch(t){case ke.GOOGLE_BIGQUERY:return qA(e);case ke.AWS_ATHENA:return KA(e);default:return!1}},sK=(e,t)=>{if(!e)return!1;switch(t){case ke.GOOGLE_BIGQUERY:return ZA(e);case ke.AWS_ATHENA:return YA(e);default:return!1}},oK=(e,t)=>{if(!e)return"Fully qualified name is required";switch(t){case ke.GOOGLE_BIGQUERY:return IZ(e);case ke.AWS_ATHENA:return LZ(e);default:return"Unsupported storage type"}},iK=(e,t)=>{if(!e)return"Table pattern is required";switch(t){case ke.GOOGLE_BIGQUERY:return kZ(e);case ke.AWS_ATHENA:return PZ(e);default:return"Unsupported storage type"}},e3=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"project.dataset.table";case ke.AWS_ATHENA:return"database.table or catalog.database.table";default:return""}},lK=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"project.dataset.table_*";case ke.AWS_ATHENA:return"database.table_* or catalog.database.table_*";default:return""}},t3=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"Enter the fully qualified name of the table (e.g., project.dataset.table)";case ke.AWS_ATHENA:return"Enter the fully qualified name of the table (e.g., database.table or catalog.database.table)";default:return""}},cK=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return'Enter a pattern to match multiple tables (e.g., project.dataset.table_* will match all tables starting with "table_")';case ke.AWS_ATHENA:return'Enter a pattern to match multiple tables (e.g., database.table_* will match all tables starting with "table_")';default:return""}};var In=(e=>(e.SUCCESS="success",e.ERROR="error",e.WARNING="warning",e.INFO="info",e.NEUTRAL="neutral",e))(In||{});const uK={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:""},dK=e=>uK[e],fK={[In.SUCCESS]:{icon:ng,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"}},[In.ERROR]:{icon:eL,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"}},[In.WARNING]:{icon:ag,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"}},[In.INFO]:{icon:Br,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"}},[In.NEUTRAL]:{icon:Br,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 Wf({type:e=In.NEUTRAL,variant:t="ghost",showIcon:n=!0,children:r,className:o}){const{icon:l,colors:c}=fK[e],d=f=>{const h="inline-flex items-center gap-1 text-sm",g=dK(f),y=c[f];return ne(h,g,y,o)};return a.jsxs("span",{className:d(t),children:[n&&a.jsx(l,{className:"h-4 w-4","data-testid":"icon"}),r]})}const n3=/^https:\/\/(docs|spreadsheets)\.google\.com\/spreadsheets\/d\/([a-zA-Z0-9-_]+)/,hK=/[#&]gid=([0-9]+)/;function r3(e){return n3.test(e)}function mK(e){const t=n3.exec(e);return t?t[2]:""}function pK(e){const t=hK.exec(e);return t?t[1]:"0"}function gK(e){return{spreadsheetId:mK(e),sheetId:parseInt(pK(e),10)}}function Mb(e,t){return`https://docs.google.com/spreadsheets/d/${e}/edit#gid=${String(t)}`}function yK(e,t,n){try{const r=JSON.parse(e);return t in r?r[t]:n}catch(r){return console.error(`Error parsing service account JSON: ${String(r)}`),n}}function $x(e){return yK(e,"client_email")}const a3=m.createContext(void 0);var rt=(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))(rt||{}),yr=(e=>(e.GOOGLE_SHEETS_CONFIG="google-sheets-config",e.LOOKER_STUDIO_CONFIG="looker-studio-config",e.EMAIL_CONFIG="email-config",e))(yr||{}),fn=(e=>(e.SUCCESS="SUCCESS",e.RUNNING="RUNNING",e.ERROR="ERROR",e.CANCELLED="CANCELLED",e))(fn||{}),ln=(e=>(e.EDIT="edit",e.CREATE="create",e))(ln||{});const vK={reports:[],destinations:[],currentReport:null,loading:!1,error:null,polledReportIds:[]};function xK(e,t){switch(t.type){case rt.FETCH_REPORTS_START:case rt.FETCH_REPORT_START:case rt.CREATE_REPORT_START:case rt.UPDATE_REPORT_START:case rt.DELETE_REPORT_START:return{...e,loading:!0,error:null};case rt.FETCH_REPORTS_SUCCESS:return{...e,reports:t.payload,loading:!1,error:null};case rt.FETCH_DESTINATIONS_SUCCESS:return{...e,destinations:t.payload,loading:!1,error:null};case rt.FETCH_REPORT_SUCCESS:return{...e,currentReport:t.payload,loading:!1,error:null};case rt.CREATE_REPORT_SUCCESS:return{...e,reports:[...e.reports,t.payload],loading:!1,error:null};case rt.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 rt.DELETE_REPORT_SUCCESS:return{...e,reports:e.reports.filter(n=>n.id!==t.payload),loading:!1,error:null};case rt.FETCH_REPORTS_ERROR:case rt.FETCH_REPORT_ERROR:case rt.FETCH_DESTINATIONS_ERROR:case rt.CREATE_REPORT_ERROR:case rt.UPDATE_REPORT_ERROR:case rt.DELETE_REPORT_ERROR:return{...e,loading:!1,error:t.payload};case rt.CLEAR_CURRENT_REPORT:return{...e,currentReport:null};case rt.CLEAR_ERROR:return{...e,error:null};case rt.START_POLLING_REPORT:return{...e,polledReportIds:[...e.polledReportIds,t.payload]};case rt.STOP_POLLING_REPORT:return{...e,polledReportIds:e.polledReportIds.filter(n=>n!==t.payload)};case rt.STOP_ALL_POLLING:return{...e,polledReportIds:[]};case rt.UPDATE_POLLED_REPORT:{const n=e.reports.find(r=>r.id===t.payload.id);return n&&t.payload.lastRunStatus!==fn.RUNNING||(n==null?void 0:n.lastRunStatus)!==fn.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 s3({children:e}){const[t,n]=m.useReducer(xK,vK);return a.jsx(a3.Provider,{value:{state:t,dispatch:n},children:e})}function bK(){const e=m.useContext(a3);if(e===void 0)throw new Error("useReportContext must be used within a ReportProvider");return e}class SK extends ac{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 No=new SK,CK={initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3};class EK{constructor(){Ls(this,"pollingTimers",new Map);Ls(this,"pollCounters",new Map);Ls(this,"config",CK)}setConfig(t){this.config={...this.config,...t}}startPolling(t,n){this.stopPolling(t),this.pollCounters.set(t,0);const r=async()=>{try{const o=this.pollCounters.get(t)??0;this.pollCounters.set(t,o+1);const l=await No.getReportById(t);if(n(l),l.lastRunStatus!==fn.RUNNING){this.stopPolling(t);return}const d=o<this.config.initialPollCount?this.config.initialPollingIntervalMs:this.config.regularPollingIntervalMs,f=setTimeout(()=>{r()},d);this.pollingTimers.set(t,f)}catch(o){console.error(`Error polling report status for ${t}:`,o),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 Om=new EK;var je=(e=>(e.GOOGLE_SHEETS="GOOGLE_SHEETS",e.LOOKER_STUDIO="LOOKER_STUDIO",e.ODATA="OData",e.EMAIL="EMAIL",e.SLACK="SLACK",e.MS_TEAMS="MS_TEAMS",e.GOOGLE_CHAT="GOOGLE_CHAT",e))(je||{}),us=(e=>(e.ACTIVE="Active",e.COMING_SOON="Coming soon",e.CLOUD_ONLY="Cloud only",e))(us||{}),qs=(e=>(e.GOOGLE_SHEETS_CREDENTIALS="google-sheets-credentials",e.LOOKER_STUDIO_CREDENTIALS="looker-studio-credentials",e.EMAIL_CREDENTIALS="email-credentials",e))(qs||{});class wK extends ac{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 Nl=new wK,Hr={types:{[je.GOOGLE_SHEETS]:{type:je.GOOGLE_SHEETS,displayName:"Google Sheets",icon:rG,status:us.ACTIVE},[je.LOOKER_STUDIO]:{type:je.LOOKER_STUDIO,displayName:"Looker Studio",icon:aG,status:us.ACTIVE},[je.EMAIL]:{type:je.EMAIL,displayName:"Email",icon:bG,status:us.CLOUD_ONLY},[je.SLACK]:{type:je.SLACK,displayName:"Slack",icon:dG,status:us.CLOUD_ONLY},[je.MS_TEAMS]:{type:je.MS_TEAMS,displayName:"Microsoft Teams",icon:vG,status:us.CLOUD_ONLY},[je.GOOGLE_CHAT]:{type:je.GOOGLE_CHAT,displayName:"Google Chat",icon:xG,status:us.CLOUD_ONLY},[je.ODATA]:{type:je.ODATA,displayName:"OData",icon:sG,status:us.COMING_SOON}},getInfo(e){return this.types[e]},getAllTypes(){return Object.values(this.types)}},RK=Jt({deploymentUrl:$t().optional(),destinationId:$t().optional(),destinationSecretKey:$t().optional()}),jK=Jt({to:K0($t().email()).min(1)}),Ib=Jt({title:$t().min(1,"Title is required"),type:Ng(je)}),TK=Ib.extend({type:ga(je.GOOGLE_SHEETS),credentials:OA}),_K=Ib.extend({type:ga(je.LOOKER_STUDIO),credentials:RK.optional()}),Og=Ib.extend({credentials:jK.optional()}),NK=Og.extend({type:ga(je.EMAIL)}),AK=Og.extend({type:ga(je.SLACK)}),DK=Og.extend({type:ga(je.MS_TEAMS)}),OK=Og.extend({type:ga(je.GOOGLE_CHAT)}),MK=DA("type",[TK,_K,NK,AK,DK,OK]),o3=m.createContext(void 0);var Lt=(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))(Lt||{});const IK={dataDestinations:[],currentDataDestination:null,loading:!1,error:null};function kK(e,t){switch(t.type){case Lt.FETCH_DESTINATIONS_START:case Lt.FETCH_DESTINATION_START:case Lt.CREATE_DESTINATION_START:case Lt.UPDATE_DESTINATION_START:case Lt.DELETE_DESTINATION_START:return{...e,loading:!0,error:null};case Lt.FETCH_DESTINATIONS_SUCCESS:return{...e,dataDestinations:t.payload,loading:!1,error:null};case Lt.FETCH_DESTINATION_SUCCESS:return{...e,currentDataDestination:t.payload,loading:!1,error:null};case Lt.CREATE_DESTINATION_SUCCESS:return{...e,dataDestinations:[...e.dataDestinations,t.payload],loading:!1,error:null};case Lt.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 Lt.DELETE_DESTINATION_SUCCESS:return{...e,dataDestinations:e.dataDestinations.filter(n=>n.id!==t.payload),loading:!1,error:null};case Lt.FETCH_DESTINATIONS_ERROR:case Lt.FETCH_DESTINATION_ERROR:case Lt.CREATE_DESTINATION_ERROR:case Lt.UPDATE_DESTINATION_ERROR:case Lt.DELETE_DESTINATION_ERROR:return{...e,loading:!1,error:t.payload};case Lt.CLEAR_CURRENT_DESTINATION:return{...e,currentDataDestination:null};case Lt.CLEAR_ERROR:return{...e,error:null};default:return e}}function Qf({children:e}){const[t,n]=m.useReducer(kK,IK);return a.jsx(o3.Provider,{value:{state:t,dispatch:n},children:e})}function LK(){const e=m.useContext(o3);if(e===void 0)throw new Error("useDataDestinationContext must be used within a DataDestinationProvider");return e}class Mm{constructor(t){this.type=t}mapFromDto(t){const n=this.extractCredentials(t.credentials);return{id:t.id,title:t.title,type:this.type,projectId:t.projectId,credentials:n,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt)}}mapToUpdateRequest(t){const n=t,r={title:n.title??""};if(n.credentials!==void 0){const o=n.credentials.to;r.credentials={type:qs.EMAIL_CREDENTIALS,to:o}}return r}mapToCreateRequest(t){const n=t,r=n.credentials.to;return{title:n.title,type:this.type,credentials:{type:qs.EMAIL_CREDENTIALS,to:r}}}extractCredentials(t){return t.type===qs.EMAIL_CREDENTIALS?{to:t.to}:{to:[]}}}class PK{mapFromDto(t){let n="";try{t.credentials.type===qs.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:je.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:qs.GOOGLE_SHEETS_CREDENTIALS}),r}mapToCreateRequest(t){const n=t;return{title:n.title,type:je.GOOGLE_SHEETS,credentials:{serviceAccountKey:JSON.parse(n.credentials.serviceAccount),type:qs.GOOGLE_SHEETS_CREDENTIALS}}}}class UK{mapFromDto(t){const n=this.extractLookerStudioCredentials(t.credentials);return{id:t.id,title:t.title,type:je.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:qs.LOOKER_STUDIO_CREDENTIALS}}}mapToCreateRequest(t){return{title:t.title,type:je.LOOKER_STUDIO,credentials:{type:qs.LOOKER_STUDIO_CREDENTIALS}}}extractLookerStudioCredentials(t){return t.type===qs.LOOKER_STUDIO_CREDENTIALS?{deploymentUrl:t.deploymentUrl,destinationId:t.destinationId,destinationSecretKey:t.destinationSecretKey}:{deploymentUrl:"",destinationId:"",destinationSecretKey:""}}}const i3={getMapper(e){switch(e){case je.GOOGLE_SHEETS:return new PK;case je.LOOKER_STUDIO:return new UK;case je.EMAIL:return new Mm(je.EMAIL);case je.SLACK:return new Mm(je.SLACK);case je.MS_TEAMS:return new Mm(je.MS_TEAMS);case je.GOOGLE_CHAT:return new Mm(je.GOOGLE_CHAT);default:throw new Error(`Unknown destination type: ${e}`)}}};function nu(e){return i3.getMapper(e.type).mapFromDto(e)}function Xf(){const{state:e,dispatch:t}=LK(),n=m.useCallback(async()=>{t({type:Lt.FETCH_DESTINATIONS_START});try{const g=(await Nl.getDataDestinations()).map(nu);t({type:Lt.FETCH_DESTINATIONS_SUCCESS,payload:g})}catch(h){const g=h instanceof Error?h.message:"Failed to load destinations";t({type:Lt.FETCH_DESTINATIONS_ERROR,payload:g}),Ue({event:"data_destination_error",category:"DataDestination",action:"ListError",label:g})}},[t]),r=m.useCallback(async h=>{try{const g=await Nl.getDataDestinationById(h),y=nu(g);t({type:Lt.FETCH_DESTINATION_SUCCESS,payload:y})}catch(g){const y=g instanceof Error?g.message:"Failed to load destination";t({type:Lt.FETCH_DESTINATION_ERROR,payload:y}),Ue({event:"data_destination_error",category:"DataDestination",action:"GetError",label:y})}},[t]),o=m.useCallback(async h=>{t({type:Lt.CREATE_DESTINATION_START});try{const g=await Nl.createDataDestination(h),y=nu(g);return t({type:Lt.CREATE_DESTINATION_SUCCESS,payload:y}),Ue({event:"data_destination_created",category:"DataDestination",action:"Create",label:y.type}),It.success("Destination created"),y}catch(g){const y=g instanceof Error?g.message:"Failed to create destination";return t({type:Lt.CREATE_DESTINATION_ERROR,payload:y}),Ue({event:"data_destination_error",category:"DataDestination",action:"CreateError",label:h.type}),null}},[t]),l=m.useCallback(async(h,g)=>{t({type:Lt.UPDATE_DESTINATION_START});try{const y=await Nl.updateDataDestination(h,g),v=nu(y);return t({type:Lt.UPDATE_DESTINATION_SUCCESS,payload:v}),Ue({event:"data_destination_updated",category:"DataDestination",action:"Update",label:v.type}),It.success("Destination updated"),v}catch(y){const v=y instanceof Error?y.message:"Failed to update destination";return t({type:Lt.UPDATE_DESTINATION_ERROR,payload:v}),Ue({event:"data_destination_error",category:"DataDestination",action:"UpdateError",label:v}),null}},[t]),c=m.useCallback(async h=>{t({type:Lt.DELETE_DESTINATION_START});try{await Nl.deleteDataDestination(h),t({type:Lt.DELETE_DESTINATION_SUCCESS,payload:h}),Ue({event:"data_destination_deleted",category:"DataDestination",action:"Delete"}),It.success("Destination deleted")}catch(g){const y=g instanceof Error?g.message:"Failed to delete destination";throw t({type:Lt.DELETE_DESTINATION_ERROR,payload:y}),Ue({event:"data_destination_error",category:"DataDestination",action:"DeleteError",label:y}),g}},[t]),d=m.useCallback(()=>{t({type:Lt.CLEAR_CURRENT_DESTINATION})},[t]),f=m.useCallback(async h=>{try{const g=await Nl.rotateSecretKey(h),y=nu(g);return Ue({event:"data_destination_updated",category:"DataDestination",action:"RotateSecretKey",label:y.type}),y}catch(g){const y=g instanceof Error?g.message:"Failed to rotate secret key";throw Ue({event:"data_destination_error",category:"DataDestination",action:"RotateSecretKeyError",label:y}),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:o,updateDataDestination:l,deleteDataDestination:c,clearCurrentDataDestination:d,rotateSecretKey:f}}function FK(e){const t=Hr.getInfo(e.type),n=t.status!==us.COMING_SOON;return{destinationInfo:t,isVisible:n}}function VK(){const{dataMart:e}=Ia(),{fetchReportsByDataMartId:t}=Ts(),{dataDestinations:n,fetchDataDestinations:r,loading:o}=Xf(),[l,c]=m.useState(!0);return m.useEffect(()=>{if(!e)return;(async()=>{c(!0);try{await Promise.all([r(),t(e.id)])}catch(h){console.error("Failed to fetch Data Mart destinations or reports:",h)}finally{c(!1)}})()},[e,r,t]),{dataDestinations:n,isLoading:l||o}}function kb(e){return JSON.stringify(e,null,2)}class zK{mapFromDto(t){if(t.type!==yr.EMAIL_CONFIG)throw new Error("Invalid destination config type");return{type:yr.EMAIL_CONFIG,reportCondition:t.reportCondition,subject:t.subject,messageTemplate:t.messageTemplate}}}class HK{mapFromDto(t){if(t.type!==yr.GOOGLE_SHEETS_CONFIG)throw new Error("Invalid destination config type");return{type:yr.GOOGLE_SHEETS_CONFIG,spreadsheetId:t.spreadsheetId,sheetId:t.sheetId.toString()}}}class $K{mapFromDto(t){if(t.type!==yr.LOOKER_STUDIO_CONFIG)throw new Error("Invalid destination config type");return{type:yr.LOOKER_STUDIO_CONFIG,cacheLifetime:t.cacheLifetime}}}const BK={getMapper(e){switch(e){case yr.GOOGLE_SHEETS_CONFIG:return new HK;case yr.LOOKER_STUDIO_CONFIG:return new $K;case yr.EMAIL_CONFIG:return new zK;default:throw new Error(`Unknown destination config type: ${String(e)}`)}}};function GK(e){return BK.getMapper(e.type).mapFromDto(e)}function Al(e){const t=GK(e.destinationConfig);return{id:e.id,title:e.title,dataMart:{id:e.dataMart.id},dataDestination:nu(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 Ts(){const{state:e,dispatch:t}=bK(),n=m.useCallback(async()=>{t({type:rt.FETCH_DESTINATIONS_START});try{const C=await Nl.getDataDestinations();t({type:rt.FETCH_DESTINATIONS_SUCCESS,payload:C})}catch(C){const R=C instanceof Error?C.message:"Failed to fetch destinations";t({type:rt.FETCH_DESTINATIONS_ERROR,payload:R}),Ue({event:"report_error",category:"Report",action:"DestinationsListError",label:R})}},[t]),r=m.useCallback(async()=>{t({type:rt.FETCH_REPORTS_START});try{const R=(await No.getReportsByProject()).map(Al);t({type:rt.FETCH_REPORTS_SUCCESS,payload:R})}catch(C){const R=C instanceof Error?C.message:"Failed to fetch reports";t({type:rt.FETCH_REPORTS_ERROR,payload:R}),Ue({event:"report_error",category:"Report",action:"ListError",label:R})}},[t]),o=m.useCallback(async(C,R)=>{R!=null&&R.silent||t({type:rt.FETCH_REPORTS_START});try{const _=(await No.getReportsByDataMartId(C,R!=null&&R.silent?{skipLoadingIndicator:!0}:void 0)).map(Al);t({type:rt.FETCH_REPORTS_SUCCESS,payload:_})}catch(j){const _=j instanceof Error?j.message:"Failed to fetch reports";t({type:rt.FETCH_REPORTS_ERROR,payload:_}),Ue({event:"report_error",category:"Report",action:"ListError",label:_})}},[t]),l=m.useCallback(async C=>{t({type:rt.FETCH_REPORT_START});try{const R=await No.getReportById(C),j=Al(R);t({type:rt.FETCH_REPORT_SUCCESS,payload:j})}catch(R){const j=R instanceof Error?R.message:"Failed to fetch report";t({type:rt.FETCH_REPORT_ERROR,payload:j}),Ue({event:"report_error",category:"Report",action:"GetError",label:j})}},[t]),c=m.useCallback(async C=>{t({type:rt.CREATE_REPORT_START});try{const R=await No.createReport(C),j=Al(R);return t({type:rt.CREATE_REPORT_SUCCESS,payload:j}),Ue({event:"report_created",category:"Report",action:"Create",label:j.dataDestination.type}),It.success("Report created"),j}catch(R){const j=R instanceof Error?R.message:"Failed to create report";return t({type:rt.CREATE_REPORT_ERROR,payload:j}),Ue({event:"report_error",category:"Report",action:"CreateError",label:C.destinationConfig.type}),null}},[t]),d=m.useCallback(async(C,R)=>{t({type:rt.UPDATE_REPORT_START});try{const j=await No.updateReport(C,R),_=Al(j);return t({type:rt.UPDATE_REPORT_SUCCESS,payload:_}),Ue({event:"report_updated",category:"Report",action:"Update",label:_.dataDestination.type}),It.success("Report updated"),_}catch(j){const _=j instanceof Error?j.message:"Failed to update report";return t({type:rt.UPDATE_REPORT_ERROR,payload:_}),Ue({event:"report_error",category:"Report",action:"UpdateError",label:_}),null}},[t]),f=m.useCallback(async C=>{t({type:rt.DELETE_REPORT_START});try{await No.deleteReport(C),t({type:rt.DELETE_REPORT_SUCCESS,payload:C}),Ue({event:"report_deleted",category:"Report",action:"Delete"}),It.success("Report deleted")}catch(R){const j=R instanceof Error?R.message:"Failed to delete report";t({type:rt.DELETE_REPORT_ERROR,payload:j}),Ue({event:"report_error",category:"Report",action:"DeleteError",label:j})}},[t]),h=m.useCallback(()=>{t({type:rt.CLEAR_CURRENT_REPORT})},[t]),g=m.useCallback(()=>{t({type:rt.CLEAR_ERROR})},[t]),y=m.useCallback(C=>{Om.stopPolling(C),t({type:rt.STOP_POLLING_REPORT,payload:C})},[t]),v=m.useCallback(C=>{e.polledReportIds.includes(C)&&y(C),t({type:rt.START_POLLING_REPORT,payload:C}),Om.startPolling(C,R=>{const j=Al(R);t({type:rt.UPDATE_POLLED_REPORT,payload:j})})},[t,e.polledReportIds,y]),b=m.useCallback(()=>{Om.stopAllPolling(),t({type:rt.STOP_ALL_POLLING})},[t]),E=m.useCallback(C=>{Om.setConfig(C)},[]),S=m.useCallback(async C=>{try{y(C),await No.runReport(C),await l(C),v(C),Ue({event:"report_run_started",category:"Report",action:"Run",label:C}),It.success("Report run started")}catch(R){const j=R instanceof Error?R.message:"Failed to run report";Ue({event:"report_error",category:"Report",action:"RunError",label:j}),console.error("Failed to run report:",R)}},[l,v,y]);return m.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:o,fetchReportById:l,createReport:c,updateReport:d,deleteReport:f,runReport:S,startPollingReport:v,stopPollingReport:y,stopAllPolling:b,setPollingConfig:E,clearCurrentReport:h,clearError:g}}fn.SUCCESS+"",fn.SUCCESS,fn.RUNNING+"",fn.RUNNING,fn.ERROR+"",fn.ERROR,fn.CANCELLED+"",fn.CANCELLED;var Bx,Mg="HoverCard",[l3]=cr(Mg,[eo]),Ig=eo(),[qK,kg]=l3(Mg),c3=e=>{const{__scopeHoverCard:t,children:n,open:r,defaultOpen:o,onOpenChange:l,openDelay:c=700,closeDelay:d=300}=e,f=Ig(t),h=m.useRef(0),g=m.useRef(0),y=m.useRef(!1),v=m.useRef(!1),[b,E]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:Mg}),S=m.useCallback(()=>{clearTimeout(g.current),h.current=window.setTimeout(()=>E(!0),c)},[c,E]),C=m.useCallback(()=>{clearTimeout(h.current),!y.current&&!v.current&&(g.current=window.setTimeout(()=>E(!1),d))},[d,E]),R=m.useCallback(()=>E(!1),[E]);return m.useEffect(()=>()=>{clearTimeout(h.current),clearTimeout(g.current)},[]),a.jsx(qK,{scope:t,open:b,onOpenChange:E,onOpen:S,onClose:C,onDismiss:R,hasSelectionRef:y,isPointerDownOnContentRef:v,children:a.jsx(ku,{...f,children:n})})};c3.displayName=Mg;var u3="HoverCardTrigger",d3=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=kg(u3,n),l=Ig(n);return a.jsx(Lu,{asChild:!0,...l,children:a.jsx(et.a,{"data-state":o.open?"open":"closed",...r,ref:t,onPointerEnter:Te(e.onPointerEnter,Pp(o.onOpen)),onPointerLeave:Te(e.onPointerLeave,Pp(o.onClose)),onFocus:Te(e.onFocus,o.onOpen),onBlur:Te(e.onBlur,o.onClose),onTouchStart:Te(e.onTouchStart,c=>c.preventDefault())})})});d3.displayName=u3;var Lb="HoverCardPortal",[ZK,KK]=l3(Lb,{forceMount:void 0}),f3=e=>{const{__scopeHoverCard:t,forceMount:n,children:r,container:o}=e,l=kg(Lb,t);return a.jsx(ZK,{scope:t,forceMount:n,children:a.jsx(_r,{present:n||l.open,children:a.jsx(tc,{asChild:!0,container:o,children:r})})})};f3.displayName=Lb;var Lp="HoverCardContent",h3=m.forwardRef((e,t)=>{const n=KK(Lp,e.__scopeHoverCard),{forceMount:r=n.forceMount,...o}=e,l=kg(Lp,e.__scopeHoverCard);return a.jsx(_r,{present:r||l.open,children:a.jsx(YK,{"data-state":l.open?"open":"closed",...o,onPointerEnter:Te(e.onPointerEnter,Pp(l.onOpen)),onPointerLeave:Te(e.onPointerLeave,Pp(l.onClose)),ref:t})})});h3.displayName=Lp;var YK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:l,onInteractOutside:c,...d}=e,f=kg(Lp,n),h=Ig(n),g=m.useRef(null),y=dt(t,g),[v,b]=m.useState(!1);return m.useEffect(()=>{if(v){const E=document.body;return Bx=E.style.userSelect||E.style.webkitUserSelect,E.style.userSelect="none",E.style.webkitUserSelect="none",()=>{E.style.userSelect=Bx,E.style.webkitUserSelect=Bx}}},[v]),m.useEffect(()=>{if(g.current){const E=()=>{b(!1),f.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var C;((C=document.getSelection())==null?void 0:C.toString())!==""&&(f.hasSelectionRef.current=!0)})};return document.addEventListener("pointerup",E),()=>{document.removeEventListener("pointerup",E),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!1}}},[f.isPointerDownOnContentRef,f.hasSelectionRef]),m.useEffect(()=>{g.current&&XK(g.current).forEach(S=>S.setAttribute("tabindex","-1"))}),a.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:c,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:Te(l,E=>{E.preventDefault()}),onDismiss:f.onDismiss,children:a.jsx(Lf,{...h,...d,onPointerDown:Te(d.onPointerDown,E=>{E.currentTarget.contains(E.target)&&b(!0),f.hasSelectionRef.current=!1,f.isPointerDownOnContentRef.current=!0}),ref:y,style:{...d.style,userSelect:v?"text":void 0,WebkitUserSelect:v?"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)"}})})}),WK="HoverCardArrow",QK=m.forwardRef((e,t)=>{const{__scopeHoverCard:n,...r}=e,o=Ig(n);return a.jsx(Pf,{...o,...r,ref:t})});QK.displayName=WK;function Pp(e){return t=>t.pointerType==="touch"?void 0:e()}function XK(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 JK=c3,eY=d3,tY=f3,nY=h3;const Pb=({...e})=>a.jsx(JK,{"data-slot":"hover-card",...e});Pb.displayName="HoverCard";const Ub=m.forwardRef(({...e},t)=>a.jsx(eY,{"data-slot":"hover-card-trigger",ref:t,...e}));Ub.displayName="HoverCardTrigger";const Fb=m.forwardRef(({className:e,align:t="center",sideOffset:n=4,onClick:r,...o},l)=>{const c=d=>{d.stopPropagation(),r&&r(d)};return a.jsx(tY,{children:a.jsx(nY,{ref:l,align:t,sideOffset:n,className:ne("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,...o})})});Fb.displayName="HoverCardContent";const Vb=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ne("border-border flex gap-4 border-b pb-4",e),...t}));Vb.displayName="HoverCardHeader";const zb=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ne("bg-muted flex h-14 min-h-[56px] w-14 min-w-[56px] shrink-0 items-center justify-center rounded-full",e),...t}));zb.displayName="HoverCardHeaderIcon";const Hb=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ne("flex flex-col space-y-1",e),...t}));Hb.displayName="HoverCardHeaderText";const $b=m.forwardRef(({className:e,...t},n)=>a.jsx("h2",{ref:n,className:ne("text-md pt-1 leading-snug font-semibold",e),...t}));$b.displayName="HoverCardHeaderTitle";const Bb=m.forwardRef(({className:e,...t},n)=>a.jsx("p",{ref:n,className:ne("text-muted-foreground text-sm",e),...t}));Bb.displayName="HoverCardHeaderDescription";const Gb=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ne("flex flex-col",e),...t}));Gb.displayName="HoverCardBody";const ki=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ne("border-border flex items-center justify-between border-b py-4",e),...t}));ki.displayName="HoverCardItem";const Li=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:ne("text-muted-foreground text-sm",e),...t}));Li.displayName="HoverCardItemLabel";const Pi=m.forwardRef(({className:e,...t},n)=>a.jsx("span",{ref:n,className:ne("text-sm",e),...t}));Pi.displayName="HoverCardItemValue";const qb=m.forwardRef(({className:e,...t},n)=>a.jsx("div",{ref:n,className:ne("pt-4 pb-2",e),...t}));qb.displayName="HoverCardFooter";function Lg(e){return e.type===yr.GOOGLE_SHEETS_CONFIG}function m3(e){return e.type===yr.LOOKER_STUDIO_CONFIG}function Gx(e){return e.type===yr.EMAIL_CONFIG}function Zi({date:e,className:t=""}){const n=m.useMemo(()=>{const r=new Date,o=e.getTime()-r.getTime(),l=Math.abs(o),c=o<0,d=Math.floor(l/(1e3*60)),f=Math.floor(l/(1e3*60*60)),h=Math.floor(l/(1e3*60*60*24)),g=Math.floor(h/7),y=Math.floor(h/30),v=Math.floor(h/365),b=S=>S.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0}),E=S=>S.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(h===1){const S=b(e);return c?`Yesterday at ${S}`:`Tomorrow at ${S}`}if(h<7){const S=E(e),C=b(e);return c?`Last ${S} at ${C}`:`This ${S} at ${C}`}if(h<14){const S=E(e),C=b(e);return c?`Last ${S} at ${C}`:`Next ${S} at ${C}`}return g<4?c?g===2?"2 weeks ago":"3 weeks ago":g===2?"In 2 weeks":"In 3 weeks":y<12?c?y===1?"1 month ago":`${y} months ago`:y===1?"In 1 month":`In ${y} months`:c?v===1?"1 year ago":`${v} years ago`:v===1?"In 1 year":`In ${v} years`},[e]);return a.jsx("span",{className:`${t}`,title:e.toLocaleString(),children:n})}const rY=()=>{const e=m.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}),[]),t=m.useMemo(()=>new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}),[]);return{detailedDateFormatter:e,shortDateFormatter:t}},aY=ye.memo(function({report:t,children:n}){const{detailedDateFormatter:r,shortDateFormatter:o}=rY(),l=m.useMemo(()=>t.lastRunStatus?{statusType:iY(t.lastRunStatus),statusText:cY(t.lastRunStatus)}:null,[t.lastRunStatus]),c=m.useMemo(()=>({modifiedAt:r.format(new Date(t.modifiedAt)),createdAt:o.format(new Date(t.createdAt))}),[t.modifiedAt,t.createdAt,r,o]),d=m.useMemo(()=>Hr.getInfo(t.dataDestination.type).icon,[t.dataDestination.type]),f=m.useMemo(()=>Lg(t.destinationConfig)?{isGoogleSheets:!0,spreadsheetId:t.destinationConfig.spreadsheetId,sheetId:t.destinationConfig.sheetId}:{isGoogleSheets:!1,spreadsheetId:null,sheetId:null},[t.destinationConfig]),h=m.useCallback(()=>{if(!f.isGoogleSheets||!f.spreadsheetId||!f.sheetId)return;const g=Mb(f.spreadsheetId,f.sheetId);window.open(g,"_blank","noopener,noreferrer")},[f]);return a.jsxs(Pb,{children:[a.jsx(Ub,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Fb,{children:[a.jsxs(Vb,{children:[a.jsx(zb,{children:a.jsx(d,{size:20})}),a.jsxs(Hb,{children:[a.jsx($b,{children:t.title||"Unnamed Report"}),a.jsxs(Bb,{children:["Last modified ",a.jsx(Zi,{date:new Date(t.modifiedAt)})]})]})]}),a.jsxs(Gb,{children:[a.jsxs(ki,{children:[a.jsx(Li,{children:"Last run status:"}),a.jsx(Pi,{children:l?a.jsx(Wf,{type:l.statusType,variant:"ghost",children:l.statusText}):"Not run yet"})]}),a.jsxs(ki,{children:[a.jsx(Li,{children:"Last run date:"}),a.jsx(Pi,{children:t.lastRunDate?a.jsx(Zi,{date:t.lastRunDate}):"Never run"})]}),t.lastRunError&&a.jsxs(ki,{children:[a.jsx(Li,{children:"Error message:"}),a.jsx(Pi,{children:t.lastRunError})]}),a.jsxs(ki,{children:[a.jsx(Li,{children:"Total runs:"}),a.jsxs(Pi,{children:[t.runsCount||0," runs",c.createdAt&&a.jsxs(a.Fragment,{children:[", since ",c.createdAt]})]})]})]}),f.isGoogleSheets&&a.jsx(qb,{children:a.jsxs(xe,{className:"w-full",variant:"default",onClick:h,title:"Open in Google Sheets","aria-label":"Open in Google Sheets",children:["Open in Google Sheets",a.jsx(Uo,{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)),sY=e=>{switch(e){case Rr.DRAFT:return In.NEUTRAL;case Rr.PUBLISHED:return In.SUCCESS;default:return In.NEUTRAL}},oY=e=>{switch(e){case ir.SUCCESS:return In.SUCCESS;case ir.RUNNING:return In.INFO;case ir.FAILED:case ir.CANCELLED:case ir.INTERRUPTED:return In.ERROR;default:return In.NEUTRAL}},iY=e=>{switch(e){case fn.SUCCESS:return In.SUCCESS;case fn.RUNNING:return In.INFO;case fn.ERROR:return In.ERROR;default:return In.NEUTRAL}},lY=e=>{switch(e){case ir.SUCCESS:return"Success";case ir.RUNNING:return"Running";case ir.FAILED:return"Failed";case ir.CANCELLED:return"Cancelled";case ir.INTERRUPTED:return"Interrupted";case ir.PENDING:return"Pending";default:return"Unknown"}},cY=e=>{switch(e){case fn.SUCCESS:return"Success";case fn.RUNNING:return"Running";case fn.ERROR:return"Failed";default:return"Unknown"}},p3=e=>Jt({fullyQualifiedName:$t().min(1,"Fully qualified name is required").refine(t=>aK(t,e),t=>({message:oK(t,e)}))}),uY=e=>Jt({pattern:$t().min(1,"Table pattern is required").refine(t=>sK(t,e),t=>({message:iK(t,e)}))}),dY=e=>{const t=[];return e.status.code===Rr.PUBLISHED&&t.push(rp.ALREADY_PUBLISHED),XA(e.storage)||t.push(rp.INVALID_STORAGE),e.definition||t.push(rp.MISSING_DEFINITION),t},fY=e=>e.map(t=>MZ[t]);function hY(e){return e.map(t=>({id:t.id,title:t.title,status:GA.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 g3(){const{state:e,dispatch:t}=DZ(),n=m.useCallback(async()=>{t({type:"SET_LOADING"});try{const l=await sn.getDataMarts(),c=hY(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=m.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]),o=m.useCallback(()=>n(),[n]);return{items:e.items,loading:e.loading,error:e.error,loadDataMarts:n,refreshList:o,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 Ui(e,t){return typeof e=="function"?e(t):e}function Oa(e,t){return n=>{t.setState(r=>({...r,[e]:Ui(n,r[e])}))}}function Pg(e){return e instanceof Function}function mY(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function pY(e,t){const n=[],r=o=>{o.forEach(l=>{n.push(l);const c=t(l);c!=null&&c.length&&r(c)})};return r(e),n}function at(e,t,n){let r=[],o;return l=>{let c;n.key&&n.debug&&(c=Date.now());const d=e(l);if(!(d.length!==r.length||d.some((g,y)=>r[y]!==g)))return o;r=d;let h;if(n.key&&n.debug&&(h=Date.now()),o=t(...d),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const g=Math.round((Date.now()-c)*100)/100,y=Math.round((Date.now()-h)*100)/100,v=y/16,b=(E,S)=>{for(E=String(E);E.length<S;)E=" "+E;return E};console.info(`%c⏱ ${b(y,5)} /${b(g,5)} ms`,`
676
- font-size: .6rem;
677
- font-weight: bold;
678
- color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n==null?void 0:n.key)}return o}}function st(e,t,n,r){return{debug:()=>{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function gY(e,t,n,r){const o=()=>{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:o,getContext:at(()=>[e,n,t,l],(c,d,f,h)=>({table:c,column:d,row:f,cell:h,getValue:h.getValue,renderValue:h.renderValue}),st(e.options,"debugCells"))};return e._features.forEach(c=>{c.createCell==null||c.createCell(l,n,t,e)},{}),l}function yY(e,t,n,r){var o,l;const d={...e._getDefaultColumnDef(),...t},f=d.accessorKey;let h=(o=(l=d.id)!=null?l:f?typeof String.prototype.replaceAll=="function"?f.replaceAll(".","_"):f.replace(/\./g,"_"):void 0)!=null?o:typeof d.header=="string"?d.header:void 0,g;if(d.accessorFn?g=d.accessorFn:f&&(f.includes(".")?g=v=>{let b=v;for(const S of f.split(".")){var E;b=(E=b)==null?void 0:E[S]}return b}:g=v=>v[d.accessorKey]),!h)throw new Error;let y={id:`${String(h)}`,accessorFn:g,parent:r,depth:n,columnDef:d,columns:[],getFlatColumns:at(()=>[!0],()=>{var v;return[y,...(v=y.columns)==null?void 0:v.flatMap(b=>b.getFlatColumns())]},st(e.options,"debugColumns")),getLeafColumns:at(()=>[e._getOrderColumnsFn()],v=>{var b;if((b=y.columns)!=null&&b.length){let E=y.columns.flatMap(S=>S.getLeafColumns());return v(E)}return[y]},st(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(y,e);return y}const Or="debugHeaders";function Lj(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 vY={createTable:e=>{e.getHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var l,c;const d=(l=r==null?void 0:r.map(y=>n.find(v=>v.id===y)).filter(Boolean))!=null?l:[],f=(c=o==null?void 0:o.map(y=>n.find(v=>v.id===y)).filter(Boolean))!=null?c:[],h=n.filter(y=>!(r!=null&&r.includes(y.id))&&!(o!=null&&o.includes(y.id)));return Im(t,[...d,...h,...f],e)},st(e.options,Or)),e.getCenterHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(l=>!(r!=null&&r.includes(l.id))&&!(o!=null&&o.includes(l.id))),Im(t,n,e,"center")),st(e.options,Or)),e.getLeftHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const l=(o=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?o:[];return Im(t,l,e,"left")},st(e.options,Or)),e.getRightHeaderGroups=at(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const l=(o=r==null?void 0:r.map(c=>n.find(d=>d.id===c)).filter(Boolean))!=null?o:[];return Im(t,l,e,"right")},st(e.options,Or)),e.getFooterGroups=at(()=>[e.getHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getLeftFooterGroups=at(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getCenterFooterGroups=at(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getRightFooterGroups=at(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),st(e.options,Or)),e.getFlatHeaders=at(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getLeftFlatHeaders=at(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getCenterFlatHeaders=at(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getRightFlatHeaders=at(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),st(e.options,Or)),e.getCenterLeafHeaders=at(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(e.options,Or)),e.getLeftLeafHeaders=at(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(e.options,Or)),e.getRightLeafHeaders=at(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),st(e.options,Or)),e.getLeafHeaders=at(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,l,c,d,f,h;return[...(o=(l=t[0])==null?void 0:l.headers)!=null?o:[],...(c=(d=n[0])==null?void 0:d.headers)!=null?c:[],...(f=(h=r[0])==null?void 0:h.headers)!=null?f:[]].map(g=>g.getLeafHeaders()).flat()},st(e.options,Or))}};function Im(e,t,n,r){var o,l;let c=0;const d=function(v,b){b===void 0&&(b=1),c=Math.max(c,b),v.filter(E=>E.getIsVisible()).forEach(E=>{var S;(S=E.columns)!=null&&S.length&&d(E.columns,b+1)},0)};d(e);let f=[];const h=(v,b)=>{const E={depth:b,id:[r,`${b}`].filter(Boolean).join("_"),headers:[]},S=[];v.forEach(C=>{const R=[...S].reverse()[0],j=C.column.depth===E.depth;let _,D=!1;if(j&&C.column.parent?_=C.column.parent:(_=C.column,D=!0),R&&(R==null?void 0:R.column)===_)R.subHeaders.push(C);else{const A=Lj(n,_,{id:[r,b,_.id,C==null?void 0:C.id].filter(Boolean).join("_"),isPlaceholder:D,placeholderId:D?`${S.filter(O=>O.column===_).length}`:void 0,depth:b,index:S.length});A.subHeaders.push(C),S.push(A)}E.headers.push(C),C.headerGroup=E}),f.push(E),b>0&&h(S,b-1)},g=t.map((v,b)=>Lj(n,v,{depth:c,index:b}));h(g,c-1),f.reverse();const y=v=>v.filter(E=>E.column.getIsVisible()).map(E=>{let S=0,C=0,R=[0];E.subHeaders&&E.subHeaders.length?(R=[],y(E.subHeaders).forEach(_=>{let{colSpan:D,rowSpan:A}=_;S+=D,R.push(A)})):S=1;const j=Math.min(...R);return C=C+j,E.colSpan=S,E.rowSpan=C,{colSpan:S,rowSpan:C}});return y((o=(l=f[0])==null?void 0:l.headers)!=null?o:[]),f}const Zb=(e,t,n,r,o,l,c)=>{let d={id:t,index:r,original:n,depth:o,parentId:c,_valuesCache:{},_uniqueValuesCache:{},getValue:f=>{if(d._valuesCache.hasOwnProperty(f))return d._valuesCache[f];const h=e.getColumn(f);if(h!=null&&h.accessorFn)return d._valuesCache[f]=h.accessorFn(d.original,r),d._valuesCache[f]},getUniqueValues:f=>{if(d._uniqueValuesCache.hasOwnProperty(f))return d._uniqueValuesCache[f];const h=e.getColumn(f);if(h!=null&&h.accessorFn)return h.columnDef.getUniqueValues?(d._uniqueValuesCache[f]=h.columnDef.getUniqueValues(d.original,r),d._uniqueValuesCache[f]):(d._uniqueValuesCache[f]=[d.getValue(f)],d._uniqueValuesCache[f])},renderValue:f=>{var h;return(h=d.getValue(f))!=null?h:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>pY(d.subRows,f=>f.subRows),getParentRow:()=>d.parentId?e.getRow(d.parentId,!0):void 0,getParentRows:()=>{let f=[],h=d;for(;;){const g=h.getParentRow();if(!g)break;f.push(g),h=g}return f.reverse()},getAllCells:at(()=>[e.getAllLeafColumns()],f=>f.map(h=>gY(e,d,h,h.id)),st(e.options,"debugRows")),_getAllCellsByColumnId:at(()=>[d.getAllCells()],f=>f.reduce((h,g)=>(h[g.column.id]=g,h),{}),st(e.options,"debugRows"))};for(let f=0;f<e._features.length;f++){const h=e._features[f];h==null||h.createRow==null||h.createRow(d,e)}return d},xY={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()}}},y3=(e,t,n)=>{var r,o;const l=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(l))};y3.autoRemove=e=>xs(e);const v3=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};v3.autoRemove=e=>xs(e);const x3=(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())};x3.autoRemove=e=>xs(e);const b3=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};b3.autoRemove=e=>xs(e);const S3=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});S3.autoRemove=e=>xs(e)||!(e!=null&&e.length);const C3=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});C3.autoRemove=e=>xs(e)||!(e!=null&&e.length);const E3=(e,t,n)=>e.getValue(t)===n;E3.autoRemove=e=>xs(e);const w3=(e,t,n)=>e.getValue(t)==n;w3.autoRemove=e=>xs(e);const Kb=(e,t,n)=>{let[r,o]=n;const l=e.getValue(t);return l>=r&&l<=o};Kb.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,l=t===null||Number.isNaN(r)?-1/0:r,c=n===null||Number.isNaN(o)?1/0:o;if(l>c){const d=l;l=c,c=d}return[l,c]};Kb.autoRemove=e=>xs(e)||xs(e[0])&&xs(e[1]);const Ao={includesString:y3,includesStringSensitive:v3,equalsString:x3,arrIncludes:b3,arrIncludesAll:S3,arrIncludesSome:C3,equals:E3,weakEquals:w3,inNumberRange:Kb};function xs(e){return e==null||e===""}const bY={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Oa("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"?Ao.includesString:typeof r=="number"?Ao.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ao.equals:Array.isArray(r)?Ao.arrIncludes:Ao.weakEquals},e.getFilterFn=()=>{var n,r;return Pg(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:Ao[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!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(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),l=r==null?void 0:r.find(g=>g.id===e.id),c=Ui(n,l?l.value:void 0);if(Pj(o,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 h;return(h=r==null?void 0:r.map(g=>g.id===e.id?f:g))!=null?h:[]}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=o=>{var l;return(l=Ui(t,o))==null?void 0:l.filter(c=>{const d=n.find(f=>f.id===c.id);if(d){const f=d.getFilterFn();if(Pj(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 Pj(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const SY=(e,t,n)=>n.reduce((r,o)=>{const l=o.getValue(e);return r+(typeof l=="number"?l:0)},0),CY=(e,t,n)=>{let r;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r>l||r===void 0&&l>=l)&&(r=l)}),r},EY=(e,t,n)=>{let r;return n.forEach(o=>{const l=o.getValue(e);l!=null&&(r<l||r===void 0&&l>=l)&&(r=l)}),r},wY=(e,t,n)=>{let r,o;return n.forEach(l=>{const c=l.getValue(e);c!=null&&(r===void 0?c>=c&&(r=o=c):(r>c&&(r=c),o<c&&(o=c)))}),[r,o]},RY=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let l=o.getValue(e);l!=null&&(l=+l)>=l&&(++n,r+=l)}),n)return r/n},jY=(e,t)=>{if(!t.length)return;const n=t.map(l=>l.getValue(e));if(!mY(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((l,c)=>l-c);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},TY=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),_Y=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,NY=(e,t)=>t.length,qx={sum:SY,min:CY,max:EY,extent:wY,mean:RY,median:jY,unique:TY,uniqueCount:_Y,count:NY},AY={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:Oa("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 qx.sum;if(Object.prototype.toString.call(r)==="[object Date]")return qx.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Pg(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:qx[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 o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function DY(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 OY={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Oa("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=at(n=>[tf(t,n)],n=>n.findIndex(r=>r.id===e.id),st(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=tf(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=tf(t,n);return((r=o[o.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=at(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let l=[];if(!(t!=null&&t.length))l=o;else{const c=[...t],d=[...o];for(;d.length&&c.length;){const f=c.shift(),h=d.findIndex(g=>g.id===f);h>-1&&l.push(d.splice(h,1)[0])}l=[...l,...d]}return DY(l,n,r)},st(e.options,"debugTable"))}},Zx=()=>({left:[],right:[]}),MY={getInitialState:e=>({columnPinning:Zx(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Oa("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var l,c;if(n==="right"){var d,f;return{left:((d=o==null?void 0:o.left)!=null?d:[]).filter(y=>!(r!=null&&r.includes(y))),right:[...((f=o==null?void 0:o.right)!=null?f:[]).filter(y=>!(r!=null&&r.includes(y))),...r]}}if(n==="left"){var h,g;return{left:[...((h=o==null?void 0:o.left)!=null?h:[]).filter(y=>!(r!=null&&r.includes(y))),...r],right:((g=o==null?void 0:o.right)!=null?g:[]).filter(y=>!(r!=null&&r.includes(y)))}}return{left:((l=o==null?void 0:o.left)!=null?l:[]).filter(y=>!(r!=null&&r.includes(y))),right:((c=o==null?void 0:o.right)!=null?c:[]).filter(y=>!(r!=null&&r.includes(y)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,l,c;return((o=r.columnDef.enablePinning)!=null?o:!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:o}=t.getState().columnPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>o==null?void 0:o.includes(d));return l?"left":c?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=at(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const l=[...r??[],...o??[]];return n.filter(c=>!l.includes(c.column.id))},st(t.options,"debugRows")),e.getLeftVisibleCells=at(()=>[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"})),st(t.options,"debugRows")),e.getRightVisibleCells=at(()=>[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"})),st(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?Zx():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Zx())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,l;return!!((o=r.left)!=null&&o.length||(l=r.right)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=at(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),st(e.options,"debugColumns")),e.getRightLeafColumns=at(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),st(e.options,"debugColumns")),e.getCenterLeafColumns=at(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(l=>!o.includes(l.id))},st(e.options,"debugColumns"))}};function IY(e){return e||(typeof document<"u"?document:null)}const km={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Kx=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),kY={getDefaultColumnDef:()=>km,getInitialState:e=>({columnSizing:{},columnSizingInfo:Kx(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Oa("columnSizing",e),onColumnSizingInfoChange:Oa("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const l=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:km.minSize,(r=l??e.columnDef.size)!=null?r:km.size),(o=e.columnDef.maxSize)!=null?o:km.maxSize)},e.getStart=at(n=>[n,tf(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,l)=>o+l.getSize(),0),st(t.options,"debugColumns")),e.getAfter=at(n=>[n,tf(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,l)=>o+l.getSize(),0),st(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},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=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var l;n+=(l=o.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),o=r==null?void 0:r.getCanResize();return l=>{if(!r||!o||(l.persist==null||l.persist(),Yx(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=Yx(l)?Math.round(l.touches[0].clientX):l.clientX,h={},g=(R,j)=>{typeof j=="number"&&(t.setColumnSizingInfo(_=>{var D,A;const O=t.options.columnResizeDirection==="rtl"?-1:1,T=(j-((D=_==null?void 0:_.startOffset)!=null?D:0))*O,M=Math.max(T/((A=_==null?void 0:_.startSize)!=null?A:0),-.999999);return _.columnSizingStart.forEach(V=>{let[Z,K]=V;h[Z]=Math.round(Math.max(K+K*M,0)*100)/100}),{..._,deltaOffset:T,deltaPercentage:M}}),(t.options.columnResizeMode==="onChange"||R==="end")&&t.setColumnSizing(_=>({..._,...h})))},y=R=>g("move",R),v=R=>{g("end",R),t.setColumnSizingInfo(j=>({...j,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},b=IY(n),E={moveHandler:R=>y(R.clientX),upHandler:R=>{b==null||b.removeEventListener("mousemove",E.moveHandler),b==null||b.removeEventListener("mouseup",E.upHandler),v(R.clientX)}},S={moveHandler:R=>(R.cancelable&&(R.preventDefault(),R.stopPropagation()),y(R.touches[0].clientX),!1),upHandler:R=>{var j;b==null||b.removeEventListener("touchmove",S.moveHandler),b==null||b.removeEventListener("touchend",S.upHandler),R.cancelable&&(R.preventDefault(),R.stopPropagation()),v((j=R.touches[0])==null?void 0:j.clientX)}},C=LY()?{passive:!1}:!1;Yx(l)?(b==null||b.addEventListener("touchmove",S.moveHandler,C),b==null||b.addEventListener("touchend",S.upHandler,C)):(b==null||b.addEventListener("mousemove",E.moveHandler,C),b==null||b.addEventListener("mouseup",E.upHandler,C)),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?Kx():(n=e.initialState.columnSizingInfo)!=null?n:Kx())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Lm=null;function LY(){if(typeof Lm=="boolean")return Lm;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 Lm=e,Lm}function Yx(e){return e.type==="touchstart"}const PY={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Oa("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 o=e.columns;return(n=o.length?o.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=at(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),st(t.options,"debugRows")),e.getVisibleCells=at(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],st(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>at(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(l=>l.getIsVisible==null?void 0:l.getIsVisible()),st(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((o,l)=>({...o,[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 tf(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const UY={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()}}},FY={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Oa("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,o,l;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((l=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?l:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ao.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Pg(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Ao[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},VY={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Oa("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o: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 o,l;e.setExpanded(r?{}:(o=(l=e.initialState)==null?void 0:l.expanded)!=null?o:{})},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(o=>!o.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 o;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=(o=n)!=null?o:!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,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.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()}}}},X0=0,J0=10,Wx=()=>({pageIndex:X0,pageSize:J0}),zY={getInitialState:e=>({...e,pagination:{...Wx(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Oa("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=l=>Ui(r,l);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Wx():(o=e.initialState.pagination)!=null?o:Wx())},e.setPageIndex=r=>{e.setPagination(o=>{let l=Ui(r,o.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)),{...o,pageIndex:l}})},e.resetPageIndex=r=>{var o,l;e.setPageIndex(r?X0:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageIndex)!=null?o:X0)},e.resetPageSize=r=>{var o,l;e.setPageSize(r?J0:(o=(l=e.initialState)==null||(l=l.pagination)==null?void 0:l.pageSize)!=null?o:J0)},e.setPageSize=r=>{e.setPagination(o=>{const l=Math.max(1,Ui(r,o.pageSize)),c=o.pageSize*o.pageIndex,d=Math.floor(c/l);return{...o,pageIndex:d,pageSize:l}})},e.setPageCount=r=>e.setPagination(o=>{var l;let c=Ui(r,(l=e.options.pageCount)!=null?l:-1);return typeof c=="number"&&(c=Math.max(-1,c)),{...o,pageCount:c}}),e.getPageOptions=at(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((l,c)=>c)),o},st(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-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}}},Qx=()=>({top:[],bottom:[]}),HY={getInitialState:e=>({rowPinning:Qx(),...e}),getDefaultOptions:e=>({onRowPinningChange:Oa("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const l=r?e.getLeafRows().map(f=>{let{id:h}=f;return h}):[],c=o?e.getParentRows().map(f=>{let{id:h}=f;return h}):[],d=new Set([...c,e.id,...l]);t.setRowPinning(f=>{var h,g;if(n==="bottom"){var y,v;return{top:((y=f==null?void 0:f.top)!=null?y:[]).filter(S=>!(d!=null&&d.has(S))),bottom:[...((v=f==null?void 0:f.bottom)!=null?v:[]).filter(S=>!(d!=null&&d.has(S))),...Array.from(d)]}}if(n==="top"){var b,E;return{top:[...((b=f==null?void 0:f.top)!=null?b:[]).filter(S=>!(d!=null&&d.has(S))),...Array.from(d)],bottom:((E=f==null?void 0:f.bottom)!=null?E:[]).filter(S=>!(d!=null&&d.has(S)))}}return{top:((h=f==null?void 0:f.top)!=null?h:[]).filter(S=>!(d!=null&&d.has(S))),bottom:((g=f==null?void 0:f.bottom)!=null?g:[]).filter(S=>!(d!=null&&d.has(S)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,l=n.some(d=>r==null?void 0:r.includes(d)),c=n.some(d=>o==null?void 0:o.includes(d));return l?"top":c?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const l=(n=o==="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?Qx():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:Qx())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,l;return!!((o=r.top)!=null&&o.length||(l=r.bottom)!=null&&l.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(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=at(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),st(e.options,"debugRows")),e.getBottomRows=at(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),st(e.options,"debugRows")),e.getCenterRows=at(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(l=>!o.has(l.id))},st(e.options,"debugRows"))}},$Y={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Oa("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},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(l=>{l.getCanSelect()&&(r[l.id]=!0)}):o.forEach(l=>{delete r[l.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(l=>{e1(o,l.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=at(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Xx(e,n):{rows:[],flatRows:[],rowsById:{}},st(e.options,"debugTable")),e.getFilteredSelectedRowModel=at(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Xx(e,n):{rows:[],flatRows:[],rowsById:{}},st(e.options,"debugTable")),e.getGroupedSelectedRowModel=at(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Xx(e,n):{rows:[],flatRows:[],rowsById:{}},st(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(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.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 o=e.getIsSelected();t.setRowSelection(l=>{var c;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return l;const d={...l};return e1(d,e.id,n,(c=r==null?void 0:r.selectChildren)!=null?c:!0,t),d})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Yb(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return t1(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return t1(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 o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},e1=(e,t,n,r,o)=>{var l;const c=o.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=>e1(e,d.id,n,r,o))};function Xx(e,t){const n=e.getState().rowSelection,r=[],o={},l=function(c,d){return c.map(f=>{var h;const g=Yb(f,n);if(g&&(r.push(f),o[f.id]=f),(h=f.subRows)!=null&&h.length&&(f={...f,subRows:l(f.subRows)}),g)return f}).filter(Boolean)};return{rows:l(t.rows),flatRows:r,rowsById:o}}function Yb(e,t){var n;return(n=t[e.id])!=null?n:!1}function t1(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,l=!1;return e.subRows.forEach(c=>{if(!(l&&!o)&&(c.getCanSelect()&&(Yb(c,t)?l=!0:o=!1),c.subRows&&c.subRows.length)){const d=t1(c,t);d==="all"?l=!0:(d==="some"&&(l=!0),o=!1)}}),o?"all":l?"some":!1}const n1=/([0-9]+)/gm,BY=(e,t,n)=>R3(Ki(e.getValue(n)).toLowerCase(),Ki(t.getValue(n)).toLowerCase()),GY=(e,t,n)=>R3(Ki(e.getValue(n)),Ki(t.getValue(n))),qY=(e,t,n)=>Wb(Ki(e.getValue(n)).toLowerCase(),Ki(t.getValue(n)).toLowerCase()),ZY=(e,t,n)=>Wb(Ki(e.getValue(n)),Ki(t.getValue(n))),KY=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},YY=(e,t,n)=>Wb(e.getValue(n),t.getValue(n));function Wb(e,t){return e===t?0:e>t?1:-1}function Ki(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function R3(e,t){const n=e.split(n1).filter(Boolean),r=t.split(n1).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),l=r.shift(),c=parseInt(o,10),d=parseInt(l,10),f=[c,d].sort();if(isNaN(f[0])){if(o>l)return 1;if(l>o)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 zd={alphanumeric:BY,alphanumericCaseSensitive:GY,text:qY,textCaseSensitive:ZY,datetime:KY,basic:YY},WY={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Oa("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const l=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(l)==="[object Date]")return zd.datetime;if(typeof l=="string"&&(r=!0,l.split(n1).length>1))return zd.alphanumeric}return r?zd.text:zd.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 Pg(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:zd[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=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 h=[],g,y=l?n:o==="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||o||(g="remove")),g==="add"){var v;h=[...c,{id:e.id,desc:y}],h.splice(0,h.length-((v=t.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else g==="toggle"?h=c.map(b=>b.id===e.id?{...b,desc:y}:b):g==="remove"?h=c.filter(b=>b.id!==e.id):h=[{id:e.id,desc:y}];return h})},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,o;const l=e.getFirstSortDir(),c=e.getIsSorted();return c?c!==l&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!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(o=>o.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(o=>o.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())}},QY=[vY,PY,OY,MY,xY,bY,UY,FY,WY,AY,VY,zY,HY,$Y,kY];function XY(e){var t,n;const r=[...QY,...(t=e._features)!=null?t:[]];let o={_features:r};const l=o._features.reduce((v,b)=>Object.assign(v,b.getDefaultOptions==null?void 0:b.getDefaultOptions(o)),{}),c=v=>o.options.mergeOptions?o.options.mergeOptions(l,v):{...l,...v};let f={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(v=>{var b;f=(b=v.getInitialState==null?void 0:v.getInitialState(f))!=null?b:f});const h=[];let g=!1;const y={_features:r,options:{...l,...e},initialState:f,_queue:v=>{h.push(v),g||(g=!0,Promise.resolve().then(()=>{for(;h.length;)h.shift()();g=!1}).catch(b=>setTimeout(()=>{throw b})))},reset:()=>{o.setState(o.initialState)},setOptions:v=>{const b=Ui(v,o.options);o.options=c(b)},getState:()=>o.options.state,setState:v=>{o.options.onStateChange==null||o.options.onStateChange(v)},_getRowId:(v,b,E)=>{var S;return(S=o.options.getRowId==null?void 0:o.options.getRowId(v,b,E))!=null?S:`${E?[E.id,b].join("."):b}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(v,b)=>{let E=(b?o.getPrePaginationRowModel():o.getRowModel()).rowsById[v];if(!E&&(E=o.getCoreRowModel().rowsById[v],!E))throw new Error;return E},_getDefaultColumnDef:at(()=>[o.options.defaultColumn],v=>{var b;return v=(b=v)!=null?b:{},{header:E=>{const S=E.header.column.columnDef;return S.accessorKey?S.accessorKey:S.accessorFn?S.id:null},cell:E=>{var S,C;return(S=(C=E.renderValue())==null||C.toString==null?void 0:C.toString())!=null?S:null},...o._features.reduce((E,S)=>Object.assign(E,S.getDefaultColumnDef==null?void 0:S.getDefaultColumnDef()),{}),...v}},st(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:at(()=>[o._getColumnDefs()],v=>{const b=function(E,S,C){return C===void 0&&(C=0),E.map(R=>{const j=yY(o,R,C,S),_=R;return j.columns=_.columns?b(_.columns,j,C+1):[],j})};return b(v)},st(e,"debugColumns")),getAllFlatColumns:at(()=>[o.getAllColumns()],v=>v.flatMap(b=>b.getFlatColumns()),st(e,"debugColumns")),_getAllFlatColumnsById:at(()=>[o.getAllFlatColumns()],v=>v.reduce((b,E)=>(b[E.id]=E,b),{}),st(e,"debugColumns")),getAllLeafColumns:at(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(v,b)=>{let E=v.flatMap(S=>S.getLeafColumns());return b(E)},st(e,"debugColumns")),getColumn:v=>o._getAllFlatColumnsById()[v]};Object.assign(o,y);for(let v=0;v<o._features.length;v++){const b=o._features[v];b==null||b.createTable==null||b.createTable(o)}return o}function sc(){return e=>at(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,l,c){l===void 0&&(l=0);const d=[];for(let h=0;h<o.length;h++){const g=Zb(e,e._getRowId(o[h],h,c),o[h],h,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(o[h],h),(f=g.originalSubRows)!=null&&f.length&&(g.subRows=r(g.originalSubRows,l+1,g))}}return d};return n.rows=r(t),n},st(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function JY(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function eW(e,t,n){return n.options.filterFromLeafRows?tW(e,t,n):nW(e,t,n)}function tW(e,t,n){var r;const o=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(f,h){h===void 0&&(h=0);const g=[];for(let v=0;v<f.length;v++){var y;let b=f[v];const E=Zb(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);if(E.columnFilters=b.columnFilters,(y=b.subRows)!=null&&y.length&&h<c){if(E.subRows=d(b.subRows,h+1),b=E,t(b)&&!E.subRows.length){g.push(b),l[b.id]=b,o.push(b);continue}if(t(b)||E.subRows.length){g.push(b),l[b.id]=b,o.push(b);continue}}else b=E,t(b)&&(g.push(b),l[b.id]=b,o.push(b))}return g};return{rows:d(e),flatRows:o,rowsById:l}}function nW(e,t,n){var r;const o=[],l={},c=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,d=function(f,h){h===void 0&&(h=0);const g=[];for(let v=0;v<f.length;v++){let b=f[v];if(t(b)){var y;if((y=b.subRows)!=null&&y.length&&h<c){const S=Zb(n,b.id,b.original,b.index,b.depth,void 0,b.parentId);S.subRows=d(b.subRows,h+1),b=S}g.push(b),o.push(b),l[b.id]=b}}return g};return{rows:d(e),flatRows:o,rowsById:l}}function Jf(){return e=>at(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let v=0;v<t.flatRows.length;v++)t.flatRows[v].columnFilters={},t.flatRows[v].columnFiltersMeta={};return t}const o=[],l=[];(n??[]).forEach(v=>{var b;const E=e.getColumn(v.id);if(!E)return;const S=E.getFilterFn();S&&o.push({id:v.id,filterFn:S,resolvedValue:(b=S.resolveFilterValue==null?void 0:S.resolveFilterValue(v.value))!=null?b:v.value})});const c=(n??[]).map(v=>v.id),d=e.getGlobalFilterFn(),f=e.getAllLeafColumns().filter(v=>v.getCanGlobalFilter());r&&d&&f.length&&(c.push("__global__"),f.forEach(v=>{var b;l.push({id:v.id,filterFn:d,resolvedValue:(b=d.resolveFilterValue==null?void 0:d.resolveFilterValue(r))!=null?b:r})}));let h,g;for(let v=0;v<t.flatRows.length;v++){const b=t.flatRows[v];if(b.columnFilters={},o.length)for(let E=0;E<o.length;E++){h=o[E];const S=h.id;b.columnFilters[S]=h.filterFn(b,S,h.resolvedValue,C=>{b.columnFiltersMeta[S]=C})}if(l.length){for(let E=0;E<l.length;E++){g=l[E];const S=g.id;if(g.filterFn(b,S,g.resolvedValue,C=>{b.columnFiltersMeta[S]=C})){b.columnFilters.__global__=!0;break}}b.columnFilters.__global__!==!0&&(b.columnFilters.__global__=!1)}}const y=v=>{for(let b=0;b<c.length;b++)if(v.columnFilters[c[b]]===!1)return!1;return!0};return eW(t.rows,y,e)},st(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Ug(e){return t=>at(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:l}=n;let{rows:c,flatRows:d,rowsById:f}=r;const h=o*l,g=h+o;c=c.slice(h,g);let y;t.options.paginateExpandedRows?y={rows:c,flatRows:d,rowsById:f}:y=JY({rows:c,flatRows:d,rowsById:f}),y.flatRows=[];const v=b=>{y.flatRows.push(b),b.subRows.length&&b.subRows.forEach(v)};return y.rows.forEach(v),y},st(t.options,"debugTable"))}function Fu(){return e=>at(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],l=r.filter(f=>{var h;return(h=e.getColumn(f.id))==null?void 0:h.getCanSort()}),c={};l.forEach(f=>{const h=e.getColumn(f.id);h&&(c[f.id]={sortUndefined:h.columnDef.sortUndefined,invertSorting:h.columnDef.invertSorting,sortingFn:h.getSortingFn()})});const d=f=>{const h=f.map(g=>({...g}));return h.sort((g,y)=>{for(let b=0;b<l.length;b+=1){var v;const E=l[b],S=c[E.id],C=S.sortUndefined,R=(v=E==null?void 0:E.desc)!=null?v:!1;let j=0;if(C){const _=g.getValue(E.id),D=y.getValue(E.id),A=_===void 0,O=D===void 0;if(A||O){if(C==="first")return A?-1:1;if(C==="last")return A?1:-1;j=A&&O?0:A?C:-C}}if(j===0&&(j=S.sortingFn(g,y,E.id)),j!==0)return R&&(j*=-1),S.invertSorting&&(j*=-1),j}return g.index-y.index}),h.forEach(g=>{var y;o.push(g),(y=g.subRows)!=null&&y.length&&(g.subRows=d(g.subRows))}),h};return{rows:d(n.rows),flatRows:o,rowsById:n.rowsById}},st(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 ju(e,t){return e?rW(e)?m.createElement(e,t):e:null}function rW(e){return aW(e)||typeof e=="function"||sW(e)}function aW(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function sW(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function oc(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=m.useState(()=>({current:XY(t)})),[r,o]=m.useState(()=>n.current.initialState);return n.current.setOptions(l=>({...l,...e,state:{...r,...e.state},onStateChange:c=>{o(c),e.onStateChange==null||e.onStateChange(c)}})),n.current}function ic({className:e,...t}){return a.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:a.jsx("table",{"data-slot":"table",className:ne("w-full caption-bottom text-sm",e),...t})})}function lc({className:e,...t}){return a.jsx("thead",{"data-slot":"table-header",className:ne("[&_tr]:border-b",e),...t})}function cc({className:e,...t}){return a.jsx("tbody",{"data-slot":"table-body",className:ne("[&_tr:last-child]:border-0",e),...t})}function Pn({className:e,...t}){return a.jsx("tr",{"data-slot":"table-row",className:ne("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function uc({className:e,...t}){return a.jsx("th",{"data-slot":"table-head",className:ne("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 Zr({className:e,...t}){return a.jsx("td",{"data-slot":"table-cell",className:ne("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}var oW=Symbol("radix.slottable");function iW(e){const t=({children:n})=>a.jsx(a.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=oW,t}var j3="AlertDialog",[lW]=cr(j3,[iN]),Yo=iN(),T3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Yo(t);return a.jsx(cg,{...r,...n,modal:!0})};T3.displayName=j3;var cW="AlertDialogTrigger",uW=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Yo(n);return a.jsx(nF,{...o,...r,ref:t})});uW.displayName=cW;var dW="AlertDialogPortal",_3=e=>{const{__scopeAlertDialog:t,...n}=e,r=Yo(t);return a.jsx(ug,{...r,...n})};_3.displayName=dW;var fW="AlertDialogOverlay",N3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Yo(n);return a.jsx(dg,{...o,...r,ref:t})});N3.displayName=fW;var mu="AlertDialogContent",[hW,mW]=lW(mu),pW=iW("AlertDialogContent"),A3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,l=Yo(n),c=m.useRef(null),d=dt(t,c),f=m.useRef(null);return a.jsx(XU,{contentName:mu,titleName:D3,docsSlug:"alert-dialog",children:a.jsx(hW,{scope:n,cancelRef:f,children:a.jsxs(fg,{role:"alertdialog",...l,...o,ref:d,onOpenAutoFocus:Te(o.onOpenAutoFocus,h=>{var g;h.preventDefault(),(g=f.current)==null||g.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[a.jsx(pW,{children:r}),a.jsx(yW,{contentRef:c})]})})})});A3.displayName=mu;var D3="AlertDialogTitle",O3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Yo(n);return a.jsx(Q1,{...o,...r,ref:t})});O3.displayName=D3;var M3="AlertDialogDescription",I3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Yo(n);return a.jsx(X1,{...o,...r,ref:t})});I3.displayName=M3;var gW="AlertDialogAction",k3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=Yo(n);return a.jsx(hg,{...o,...r,ref:t})});k3.displayName=gW;var L3="AlertDialogCancel",P3=m.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=mW(L3,n),l=Yo(n),c=dt(t,o);return a.jsx(hg,{...l,...r,ref:c})});P3.displayName=L3;var yW=({contentRef:e})=>{const t=`\`${mu}\` requires a description for the component to be accessible for screen reader users.
688
-
689
- You can add a description to the \`${mu}\` by passing a \`${M3}\` 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 \`${mu}\`. 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 m.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},vW=T3,xW=_3,bW=N3,SW=A3,CW=k3,EW=P3,wW=O3,RW=I3;function jW({...e}){return a.jsx(vW,{"data-slot":"alert-dialog",...e})}function TW({...e}){return a.jsx(xW,{"data-slot":"alert-dialog-portal",...e})}function _W({className:e,...t}){return a.jsx(bW,{"data-slot":"alert-dialog-overlay",className:ne("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 NW({className:e,...t}){return a.jsxs(TW,{children:[a.jsx(_W,{}),a.jsx(SW,{"data-slot":"alert-dialog-content",className:ne("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 AW({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function DW({className:e,...t}){return a.jsx("div",{"data-slot":"alert-dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function OW({className:e,...t}){return a.jsx(wW,{"data-slot":"alert-dialog-title",className:ne("text-lg font-semibold",e),...t})}function MW({className:e,...t}){return a.jsx(RW,{"data-slot":"alert-dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}function IW({className:e,...t}){return a.jsx(CW,{className:ne(Z1(),e),...t})}function kW({className:e,...t}){return a.jsx(EW,{className:ne(Z1({variant:"outline"}),e),...t})}const U3=["facebook","linkedin","tiktok","microsoft","connector","sql","blank"],F3={facebook:{title:"Facebook Ads",datamartTitle:"Facebook Ads Data Mart",connectorSourceTitle:"FacebookMarketing",definitionType:Fe.CONNECTOR,icon:mG},linkedin:{title:"LinkedIn Ads",datamartTitle:"LinkedIn Ads Data Mart",connectorSourceTitle:"LinkedInAds",definitionType:Fe.CONNECTOR,icon:pG},tiktok:{title:"TikTok Ads",datamartTitle:"TikTok Ads Data Mart",connectorSourceTitle:"TikTokAds",definitionType:Fe.CONNECTOR,icon:gG},microsoft:{title:"Microsoft Ads",datamartTitle:"Microsoft Ads Data Mart",connectorSourceTitle:"MicrosoftAds",definitionType:Fe.CONNECTOR,icon:yG},connector:{title:"Other connector",datamartTitle:"Connector-based Data Mart",definitionType:Fe.CONNECTOR,icon:G1},sql:{title:"SQL query",datamartTitle:"SQL-based Data Mart",definitionType:Fe.SQL,icon:B1},blank:{title:"Blank Data Mart",datamartTitle:"New Data Mart",icon:up}},Uj=U3.map(e=>({key:e,...F3[e]}));function LW(e){if(!e||!U3.includes(e))return;const t=e;return{key:t,...F3[t]}}function PW({children:e,className:t="",...n}){return a.jsx("div",{className:"dm-card",children:a.jsx("div",{className:ne("-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 UW({children:e,className:t="",...n}){return a.jsx("div",{className:ne("pb-2",t),...n,children:e})}function FW({children:e,className:t="",...n}){return a.jsx("h2",{className:ne("mb-6 text-4xl font-semibold xl:text-5xl",t),...n,children:e})}function VW({children:e,className:t="",...n}){return a.jsx("p",{className:ne("text-muted-foreground text-lg",t),...n,children:e})}function zW({children:e,rings:t=7,className:n="",...r}){return a.jsxs("div",{className:ne("relative flex w-full justify-center lg:w-[30%] 2xl:w-[35%]",n),...r,children:[a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:Array.from({length:t},(o,l)=>{const c=`${(16*(l+1)+24).toString()}vmin`;return a.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)})}),a.jsx("div",{className:"animate-glow-burst"}),a.jsx("div",{className:"animate-icon-entrance","aria-label":"Illustration",children:e})]})}function HW({children:e,className:t="",...n}){return a.jsx("div",{className:ne("w-full space-y-8 lg:w-[70%] 2xl:w-[65%]",t),...n,children:e})}function Jx({separator:e=!0,children:t,className:n="",...r}){return a.jsx("section",{className:ne("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 Fj({children:e,className:t="",...n}){return a.jsx("h3",{className:ne("mb-4 text-xl font-medium",t),...n,children:e})}function e0({children:e,className:t="",...n}){return a.jsx("div",{className:ne("flex flex-wrap items-center gap-4",t),...n,children:e})}function Pm({href:e,icon:t,title:n,variant:r="outline",size:o,className:l="",target:c,...d}){const f=r==="outline"?"lg":"sm",h=a.jsxs("span",{className:ne("flex items-center gap-2"),children:[t,n]});return e?a.jsx(xe,{asChild:!0,variant:r,size:o??f,className:ne(r==="ghost"?"text-muted-foreground":"",l),...d,children:a.jsx(ha,{to:e,target:c,children:h})}):a.jsx(xe,{variant:r,size:o??f,className:l,...d,children:h})}function $W(){const{scope:e}=Ko(),t=Uj.filter(r=>r.definitionType===Fe.CONNECTOR),n=Uj.filter(r=>r.definitionType!==Fe.CONNECTOR);return a.jsxs(PW,{children:[a.jsx(zW,{children:a.jsx(hG,{className:"animate-icon-entrance","aria-label":"Data Mart creation illustration"})}),a.jsxs(HW,{children:[a.jsxs(UW,{children:[a.jsx(FW,{children:"Let’s Build Your First Data Mart"}),a.jsx(VW,{children:"A Data Mart is the key element of self-service analytics — it provides both control for data analyst and freedom for business users. To get started, connect the source you need or query the data you already have in storage"})]}),a.jsxs(Jx,{children:[a.jsx(Fj,{children:"Connect a data source"}),a.jsx(e0,{children:t.map(r=>a.jsx(Pm,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key))})]}),a.jsxs(Jx,{children:[a.jsx(Fj,{children:"Use existing SQL or start from scratch"}),a.jsx(e0,{children:n.map((r,o)=>a.jsxs(a.Fragment,{children:[a.jsx(Pm,{href:e(`/data-marts/create?preset=${r.key}`),icon:r.icon&&a.jsx(r.icon,{className:"h-4 w-4"}),title:r.title,variant:"outline"},r.key),o<n.length-1&&a.jsx("span",{className:"text-muted-foreground text-sm",children:"or"})]}))})]}),a.jsx(Jx,{separator:!1,children:a.jsxs(e0,{children:[a.jsx(Pm,{href:"https://www.youtube.com/playlist?list=PLvcNVLV5BVbHHCekyAZBEIVnlC4i1qcHx",icon:a.jsx(D_,{className:"h-4 w-4"}),title:"Watch a 2-minute demo",variant:"ghost",target:"_blank"}),a.jsx(Pm,{href:"https://docs.owox.com/docs/getting-started/core-concepts/?utm_source=owox_data_marts&utm_medium=empty_data_marts_page&utm_campaign=help_buttons",icon:a.jsx(Nk,{className:"h-4 w-4"}),title:"Core concepts",variant:"ghost",target:"_blank"})]})})]})]})}function BW(){return a.jsx(hs,{className:"bg-muted/50 h-72 w-full rounded-md border-b border-gray-200 dark:border-white/10 dark:bg-white/4"})}const Yc={DEFAULT_SORTING_COLUMN:"createdAt",DEFAULT_EXCLUDED_COLUMNS:["actions"],STORAGE_KEYS:{SORTING_SUFFIX:"-sorting",COLUMN_VISIBILITY_SUFFIX:"-column-visibility"}},GW={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 Vu({columns:e,storageKeyPrefix:t,defaultSortingColumn:n=Yc.DEFAULT_SORTING_COLUMN,defaultColumnVisibility:r={},excludedColumnsFromSorting:o=Yc.DEFAULT_EXCLUDED_COLUMNS,excludedColumnsFromVisibility:l=Yc.DEFAULT_EXCLUDED_COLUMNS}){const c=m.useMemo(()=>({SORTING:`${t}${Yc.STORAGE_KEYS.SORTING_SUFFIX}`,COLUMN_VISIBILITY:`${t}${Yc.STORAGE_KEYS.COLUMN_VISIBILITY_SUFFIX}`}),[t]),d=m.useMemo(()=>GW.extractColumnIds(e),[e]),f=m.useMemo(()=>d.filter(S=>!o.includes(S)),[d,o]),h=m.useCallback(()=>{const S=Ii.get(c.SORTING,"json");return S&&Array.isArray(S)&&S.length>0?S:[{id:f.includes(n)?n:f[0]??Yc.DEFAULT_SORTING_COLUMN,desc:!0}]},[c.SORTING,f,n]),g=m.useCallback(()=>{const S=Ii.get(c.COLUMN_VISIBILITY,"json");if(S&&typeof S=="object"&&!Array.isArray(S)){const C={};for(const R of d)l.includes(R)||(C[R]=S[R]);return C}return r},[c.COLUMN_VISIBILITY,d,l,r]),[y,v]=m.useState(h),[b,E]=m.useState(g);return m.useEffect(()=>{y.length>0&&f.includes(y[0].id)&&Ii.set(c.SORTING,y)},[y,f,c.SORTING]),m.useEffect(()=>{const S={};for(const C of d){if(l.includes(C))continue;const R=b[C];typeof R=="boolean"&&(S[C]=R)}Ii.set(c.COLUMN_VISIBILITY,S)},[b,d,l,c.COLUMN_VISIBILITY]),{sorting:y,setSorting:v,columnVisibility:b,setColumnVisibility:E}}function qW({columns:e,data:t,deleteDataMart:n,refetchDataMarts:r,isLoading:o}){var O;const{navigate:l,scope:c}=Ko(),{sorting:d,setSorting:f,columnVisibility:h,setColumnVisibility:g}=Vu({columns:e,storageKeyPrefix:"data-mart-list",defaultColumnVisibility:{triggersCount:!1,reportsCount:!1}}),[y,v]=m.useState([]),[b,E]=m.useState({}),[S,C]=m.useState(!1),[R,j]=m.useState(!1),_=async()=>{try{j(!0);const M=A.getSelectedRowModel().rows.map(V=>V.original.id);for(const V of M)await n(V);on.success(`Successfully deleted ${String(M.length)} data mart${M.length!==1?"s":""}`),E({}),await r()}catch(T){console.error("Error deleting data marts:",T),on.error("Failed to delete some data marts. Please try again.")}finally{j(!1),C(!1)}},D=Object.keys(b).length>0,A=oc({data:t,columns:[{id:"select",size:40,header:({table:T})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsAllRowsSelected(),"data-state":T.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:T.getToggleAllRowsSelectedHandler(),children:T.getIsAllRowsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),cell:({row:T})=>a.jsx("button",{type:"button",role:"checkbox","aria-checked":T.getIsSelected(),"data-state":T.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:T.getToggleSelectedHandler(),children:T.getIsSelected()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),enableSorting:!1,enableHiding:!1},...e],getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:f,getSortedRowModel:Fu(),onColumnFiltersChange:v,getFilteredRowModel:Jf(),onColumnVisibilityChange:g,onRowSelectionChange:E,state:{sorting:d,columnFilters:y,columnVisibility:h,rowSelection:b},enableRowSelection:!0});return o?a.jsx("div",{children:a.jsx(BW,{})}):t.length?a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsxs("div",{className:"dm-card-toolbar-left",children:[D&&a.jsx(xe,{variant:"destructive",size:"sm",className:"dm-card-toolbar-btn-delete",onClick:()=>{C(!0)},disabled:R,children:a.jsx(Xs,{className:"h-4 w-4"})}),a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Jl,{className:"dm-card-toolbar-search-icon"}),a.jsx(Ht,{placeholder:"Search by title",value:(O=A.getColumn("title"))==null?void 0:O.getFilterValue(),onChange:T=>{var M;return(M=A.getColumn("title"))==null?void 0:M.setFilterValue(T.target.value)},className:"dm-card-toolbar-search-input"})]})]}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsx(ha,{to:c("/data-marts/create"),children:a.jsxs(xe,{variant:"outline",className:"dm-card-toolbar-btn-primary",children:[a.jsx(Pa,{className:"h-4 w-4"}),"New Data Mart"]})})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(ic,{className:"dm-card-table",role:"table","aria-label":"Data Marts table",children:[a.jsx(lc,{className:"dm-card-table-header",children:A.getHeaderGroups().map(T=>a.jsx(Pn,{className:"dm-card-table-header-row",children:T.headers.map(M=>a.jsx(uc,{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:ju(M.column.columnDef.header,M.getContext())},M.id))},T.id))}),a.jsx(cc,{className:"dm-card-table-body",children:A.getRowModel().rows.length?A.getRowModel().rows.map(T=>a.jsx(Pn,{"data-state":T.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 V=T.original.id;l(`/data-marts/${V}/data-setup`)},children:T.getVisibleCells().map(M=>a.jsx(Zr,{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:ju(M.column.columnDef.cell,M.getContext())},M.id))},T.id)):a.jsx(Pn,{children:a.jsx(Zr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(xe,{variant:"outline",size:"sm",onClick:()=>{A.previousPage()},disabled:!A.getCanPreviousPage(),children:"Previous"}),a.jsx(xe,{variant:"outline",size:"sm",onClick:()=>{A.nextPage()},disabled:!A.getCanNextPage(),children:"Next"})]}),a.jsx(jW,{open:S,onOpenChange:C,children:a.jsxs(NW,{children:[a.jsxs(AW,{children:[a.jsx(OW,{children:"Are you sure?"}),a.jsxs(MW,{children:["You're about to delete ",Object.keys(b).length," selected data mart",Object.keys(b).length!==1?"s":"",". This action cannot be undone."]})]}),a.jsxs(DW,{children:[a.jsx(kW,{disabled:R,children:"Cancel"}),a.jsx(IW,{onClick:()=>{_()},disabled:R,className:"bg-destructive hover:bg-destructive/90",children:R?"Deleting...":"Delete"})]})]})})]}):a.jsx($W,{})}function _l({column:e,children:t}){return a.jsxs(xe,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&a.jsx(ns,{className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&a.jsx(ka,{className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(ns,{className:"text-muted-foreground h-4 w-4"})})]})]})}function Qb({...e}){return a.jsx(cg,{"data-slot":"dialog",...e})}function ZW({...e}){return a.jsx(ug,{"data-slot":"dialog-portal",...e})}function KW({className:e,...t}){return a.jsx(dg,{"data-slot":"dialog-overlay",className:ne("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 Xb({className:e,children:t,showCloseButton:n=!0,...r}){return a.jsxs(ZW,{"data-slot":"dialog-portal",children:[a.jsx(KW,{}),a.jsxs(fg,{"data-slot":"dialog-content",className:ne("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,n&&a.jsxs(hg,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[a.jsx(xu,{}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Jb({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-header",className:ne("flex flex-col gap-2 text-center sm:text-left",e),...t})}function YW({className:e,...t}){return a.jsx("div",{"data-slot":"dialog-footer",className:ne("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function eS({className:e,...t}){return a.jsx(Q1,{"data-slot":"dialog-title",className:ne("text-lg leading-none font-semibold",e),...t})}function tS({className:e,...t}){return a.jsx(X1,{"data-slot":"dialog-description",className:ne("text-muted-foreground text-sm",e),...t})}const WW=Af("",{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 pu({className:e,variant:t,...n}){return t==="brand"?a.jsx(xe,{variant:"default",className:ne(WW({variant:t}),e),...n}):a.jsx(xe,{variant:t,className:e,...n})}const Tr=({open:e,onOpenChange:t,title:n,description:r,confirmLabel:o="Confirm",cancelLabel:l,onConfirm:c,onCancel:d,variant:f="destructive",children:h})=>{const g=()=>{t(!1),d==null||d()};return a.jsx(Qb,{open:e,onOpenChange:t,children:a.jsxs(Xb,{children:[a.jsxs(Jb,{children:[a.jsx(eS,{children:n}),a.jsx(tS,{children:r})]}),h,a.jsxs(YW,{children:[l&&a.jsx(pu,{variant:"secondary",onClick:g,children:l}),a.jsx(pu,{variant:f,onClick:c,children:o})]})]})})},QW=({row:e,onDeleteSuccess:t})=>{const{scope:n}=Ko(),[r,o]=m.useState(!1),[l,c]=m.useState(!1),{deleteDataMart:d,refreshList:f}=g3(),h=async()=>{try{await d(e.original.id),o(!1),await f(),t==null||t()}catch(g){console.error("Failed to delete data mart:",g)}};return a.jsxs("div",{className:"text-right",children:[a.jsxs(ur,{open:l,onOpenChange:c,children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{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:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(fr,{align:"end",children:[a.jsx(pt,{children:a.jsxs(ha,{to:n(`/data-marts/${e.original.id}/data-setup`),className:"flex gap-2 text-left",children:[a.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]})}),a.jsx(ma,{}),a.jsxs(pt,{onClick:()=>{o(!0)},children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]}),a.jsx(Tr,{open:r,onOpenChange:o,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 h(),variant:"destructive"})]})};var On=(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))(On||{});const Ti={[On.TITLE]:"Title",[On.DEFINITION_TYPE]:"Input Source",[On.STORAGE_TYPE]:"Storage",[On.STATUS]:"Status",[On.TRIGGERS_COUNT]:"Triggers",[On.REPORTS_COUNT]:"Reports",[On.CREATED_AT]:"Created at"};function XW({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=Ti[t.id]||t.id;return a.jsx(pt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const Vj={types:{[Fe.SQL]:{type:Fe.SQL,displayName:"SQL",icon:B1},[Fe.TABLE]:{type:Fe.TABLE,displayName:"Table",icon:vL},[Fe.VIEW]:{type:Fe.VIEW,displayName:"View",icon:Mk},[Fe.TABLE_PATTERN]:{type:Fe.TABLE_PATTERN,displayName:"Pattern",icon:F7},[Fe.CONNECTOR]:{type:Fe.CONNECTOR,displayName:"Connector",icon:G1}},getInfo(e){return e?this.types[e]:{type:null,displayName:"—",icon:()=>null}}},JW=({onDeleteSuccess:e,connectors:t=[]}={})=>[{accessorKey:On.TITLE,size:40,header:({column:n})=>a.jsx(_l,{column:n,children:Ti[On.TITLE]}),cell:({row:n})=>a.jsx("div",{children:n.getValue("title")})},{accessorFn:n=>{const r=n.definitionType;if(r===Fe.CONNECTOR){const o=n.definition,l=t.find(c=>c.name===o.connector.source.name);return(l==null?void 0:l.displayName)??(l==null?void 0:l.name)??"Unknown"}else{const{displayName:o}=Vj.getInfo(r);return o}},id:On.DEFINITION_TYPE,size:15,header:({column:n})=>a.jsx(_l,{column:n,children:Ti[On.DEFINITION_TYPE]}),cell:({row:n})=>{const r=n.original.definitionType;switch(r){case Fe.CONNECTOR:{const o=n.original.definition,l=t.find(c=>c.name===o.connector.source.name);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[(l==null?void 0:l.logoBase64)&&a.jsx(rc,{base64:l.logoBase64,size:18}),(l==null?void 0:l.displayName)??"Unknown"]})}default:{const{displayName:o,icon:l}=Vj.getInfo(r);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(l,{className:"h-4 w-4"}),o]})}}}},{accessorKey:On.STORAGE_TYPE,size:15,header:({column:n})=>a.jsx(_l,{column:n,children:Ti[On.STORAGE_TYPE]}),cell:({row:n})=>{const r=n.getValue("storageType"),o=n.original.storageTitle,{displayName:l,icon:c}=nl.getInfo(r),d=o??l;return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),d]})}},{accessorKey:On.CREATED_AT,size:15,header:({column:n})=>a.jsx(_l,{column:n,children:Ti[On.CREATED_AT]}),cell:({row:n})=>{const r=n.getValue("createdAt"),o=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(r);return a.jsx("div",{className:"text-muted-foreground",children:o})}},{accessorKey:On.STATUS,size:15,header:({column:n})=>a.jsx(_l,{column:n,children:Ti[On.STATUS]}),cell:({row:n})=>{const r=n.getValue("status");return a.jsx(Wf,{type:sY(r.code),variant:"ghost",showIcon:!1,children:r.displayName})}},{accessorKey:On.TRIGGERS_COUNT,size:15,header:({column:n})=>a.jsx(_l,{column:n,children:Ti[On.TRIGGERS_COUNT]}),cell:({row:n})=>{const r=n.getValue("triggersCount")>0?n.getValue("triggersCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{accessorKey:On.REPORTS_COUNT,size:15,header:({column:n})=>a.jsx(_l,{column:n,children:Ti[On.REPORTS_COUNT]}),cell:({row:n})=>{const r=n.getValue("reportsCount")>0?n.getValue("reportsCount"):"—";return a.jsx("div",{className:"text-muted-foreground",children:r})}},{id:"actions",size:80,header:({table:n})=>a.jsx(XW,{table:n}),cell:({row:n})=>a.jsx(QW,{row:n,onDeleteSuccess:e})}];var sr=(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))(sr||{});const eQ={connectors:[],connectorSpecification:null,connectorFields:null,loading:!1,loadingSpecification:!1,loadingFields:!1,error:null};function tQ(e,t){switch(t.type){case sr.FETCH_CONNECTORS_START:return{...e,loading:!0,error:null};case sr.FETCH_CONNECTORS_SUCCESS:return{...e,connectors:t.payload,loading:!1,error:null};case sr.FETCH_CONNECTORS_ERROR:return{...e,loading:!1,error:t.payload};case sr.FETCH_CONNECTOR_SPECIFICATION_START:return{...e,loadingSpecification:!0,error:null};case sr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS:return{...e,connectorSpecification:t.payload,loadingSpecification:!1,error:null};case sr.FETCH_CONNECTOR_SPECIFICATION_ERROR:return{...e,loadingSpecification:!1,error:t.payload};case sr.FETCH_CONNECTOR_FIELDS_START:return{...e,loadingFields:!0,error:null};case sr.FETCH_CONNECTOR_FIELDS_SUCCESS:return{...e,connectorFields:t.payload,loadingFields:!1,error:null};case sr.FETCH_CONNECTOR_FIELDS_ERROR:return{...e,loadingFields:!1,error:t.payload};default:return e}}const V3=m.createContext(void 0);function Tu({children:e}){const[t,n]=m.useReducer(tQ,eQ);return a.jsx(V3.Provider,{value:{state:t,dispatch:n},children:e})}function nQ(){const e=m.useContext(V3);if(!e)throw new Error("useConnectorContext must be used within a ConnectorContextProvider");return e}var fs=(e=>(e.STRING="string",e.NUMBER="number",e.BOOLEAN="boolean",e.OBJECT="object",e.ARRAY="array",e.DATE="date",e))(fs||{});class nf extends ac{constructor(){super("/connectors")}async getAvailableConnectors(){return this.get("/")}async getConnectorSpecification(t){return this.get(`/${t}/specification`)}async getConnectorFields(t){return this.get(`/${t}/fields`)}async exchangeCredentials(t,n){return this.post(`/${t}/oauth/exchange`,n)}async checkOAuthStatus(t,n){return this.get(`/${t}/oauth/status/${n}`)}async getOAuthSettings(t,n){return this.get(`/${t}/oauth/settings?path=${encodeURIComponent(n)}`)}}function z3(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 dc(){const{state:e,dispatch:t}=nQ(),n=m.useMemo(()=>z3(e.connectors),[e.connectors]),r=m.useCallback(async()=>{t({type:sr.FETCH_CONNECTORS_START});try{const d=await new nf().getAvailableConnectors();t({type:sr.FETCH_CONNECTORS_SUCCESS,payload:d})}catch(c){const d=c instanceof Error?c.message:"Unknown error";t({type:sr.FETCH_CONNECTORS_ERROR,payload:d}),Ue({event:"connector_error",category:"Connector",action:"ListError",label:d})}},[t]),o=m.useCallback(async c=>{t({type:sr.FETCH_CONNECTOR_SPECIFICATION_START});try{const f=await new nf().getConnectorSpecification(c);t({type:sr.FETCH_CONNECTOR_SPECIFICATION_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:sr.FETCH_CONNECTOR_SPECIFICATION_ERROR,payload:f}),Ue({event:"connector_error",category:"Connector",action:"SpecificationError",label:c})}},[t]),l=m.useCallback(async c=>{t({type:sr.FETCH_CONNECTOR_FIELDS_START});try{const f=await new nf().getConnectorFields(c);t({type:sr.FETCH_CONNECTOR_FIELDS_SUCCESS,payload:f})}catch(d){const f=d instanceof Error?d.message:"Unknown error";t({type:sr.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:o,fetchConnectorFields:l}}const rQ=()=>{const{items:e,loadDataMarts:t,deleteDataMart:n,refreshList:r,loading:o}=g3(),{connectors:l,fetchAvailableConnectors:c}=dc();return m.useEffect(()=>{c()},[c]),m.useEffect(()=>{t()},[t]),a.jsx(qW,{columns:JW({connectors:l}),data:e,deleteDataMart:n,refetchDataMarts:r,isLoading:o})};function zj(){return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Data Marts"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(AZ,{children:a.jsx(Tu,{children:a.jsx(rQ,{})})})})]})}const H3=m.createContext(void 0),Hd=e=>{const t=dY(e);return{...e,canPublish:t.length===0,validationErrors:t}};var es=(e=>(e.CONNECTED="CONNECTED",e.CONNECTED_WITH_DEFINITION_MISMATCH="CONNECTED_WITH_DEFINITION_MISMATCH",e.DISCONNECTED="DISCONNECTED",e))(es||{}),Cf=(e=>(e.NULLABLE="NULLABLE",e.REQUIRED="REQUIRED",e.REPEATED="REPEATED",e))(Cf||{}),$n=(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))($n||{}),nS=(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))(nS||{});const aQ=(e,t)=>!!(e!==Fe.CONNECTOR||t!==null&&t.fields.some(r=>r.status===es.CONNECTED)),$3={dataMart:null,isLoading:!1,error:null,runs:[]};function sQ(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:Hd(t.payload)};case"UPDATE_DATA_MART_TITLE_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Hd({...e.dataMart,title:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DESCRIPTION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Hd({...e.dataMart,description:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_STORAGE":return e.dataMart?{...e,dataMart:Hd({...e.dataMart,storage:t.payload,modifiedAt:new Date})}:e;case"UPDATE_DATA_MART_DEFINITION_SUCCESS":return e.dataMart?{...e,isLoading:!1,error:null,dataMart:Hd({...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 $3;default:return e}}function Wo(){const e=m.useContext(H3);if(e===void 0)throw new Error("useDataMartContext must be used within a DataMartProvider");return e}class oQ{mapFromDto(t){const n=t.config,r=t.credentials;let o="";return r&&Object.keys(r).length>0&&(o=JSON.stringify(r,null,2)),{id:t.id,title:t.title,type:ke.GOOGLE_BIGQUERY,createdAt:new Date(t.createdAt),modifiedAt:new Date(t.modifiedAt),credentials:{serviceAccount:o},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 iQ{mapFromDto(t){const n=t.config,r=t.credentials;return{id:t.id,title:t.title,type:ke.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 B3={getMapper(e){switch(e){case ke.GOOGLE_BIGQUERY:return new oQ;case ke.AWS_ATHENA:return new iQ;default:throw new Error(`Unknown storage type: ${e}`)}}};function ap(e){return B3.getMapper(e.type).mapFromDto(e)}function lQ(e){const t=B3.getMapper(e.type);return{title:e.title,...t.mapToUpdateRequest(e)}}function cQ(e){return{id:e.id,type:e.type,title:e.title,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt)}}function uQ(e){return{type:e}}let Um=null;async function dQ(){if(Um)return Um;const e=await fQ();return Um=z3(e),Um}async function fQ(){return await new nf().getAvailableConnectors()}async function hQ(e){const t=await dQ();return t.length===0?null:t.find(r=>r.name===e)??null}function mQ(e,t){const n=t.find(r=>r.name===e.source.name);return(n==null?void 0:n.displayName)??e.source.name}function pQ(e){return{sqlQuery:e.sqlQuery}}function gQ(e){return{sqlQuery:e.sqlQuery}}function yQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function vQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function xQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function bQ(e){return{fullyQualifiedName:e.fullyQualifiedName}}function SQ(e){return{pattern:e.pattern}}function CQ(e){return{pattern:e.pattern}}function EQ(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 wQ(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 RQ(e,t){if(!e||!t)return null;switch(e){case Fe.SQL:return gQ(t);case Fe.TABLE:return vQ(t);case Fe.VIEW:return bQ(t);case Fe.TABLE_PATTERN:return CQ(t);case Fe.CONNECTOR:{const n=wQ(t);return n.connector.info=await hQ(n.connector.source.name),n}default:return console.warn(`Unknown definition type: ${String(e)}`),null}}async function Wc(e){const t={id:e.id,title:e.title,description:e.description,status:GA.getInfo(e.status),storage:ap(e.storage),definitionType:e.definitionType,definition:await RQ(e.definitionType,e.definition),schema:e.schema,connectorState:e.connectorState??null,createdAt:new Date(e.createdAt),modifiedAt:new Date(e.modifiedAt),canPublish:!1,canActualizeSchema:!1,validationErrors:[]};return t.canActualizeSchema=aQ(t.definitionType,t.schema),t}function jQ(e){return{id:e.id,title:e.title}}const TQ=e=>({id:e.id,status:e.status,createdAt:new Date(e.createdAt),logs:e.logs??[],errors:e.errors??[],definitionRun:e.definitionRun,type:e.type,triggerType:e.runType,startedAt:e.startedAt?new Date(e.startedAt):null,finishedAt:e.finishedAt?new Date(e.finishedAt):null,reportDefinition:e.reportDefinition?e.reportDefinition:null,reportId:e.reportId,insightDefinition:e.insightDefinition?e.insightDefinition:null,insightId:e.insightId}),Hj=e=>e.runs.map(TQ);function G3({children:e}){const[t,n]=m.useReducer(sQ,$3),r=m.useCallback(async A=>{try{n({type:"FETCH_DATA_MART_START"});const O=await sn.getDataMartById(A),T=await Wc(O);n({type:"FETCH_DATA_MART_SUCCESS",payload:T})}catch(O){n({type:"FETCH_DATA_MART_ERROR",payload:Cn(O)})}},[]),o=m.useCallback(async A=>{try{n({type:"CREATE_DATA_MART_START"});const O=await sn.createDataMart(A),T=jQ(O);return n({type:"CREATE_DATA_MART_SUCCESS",payload:T}),Ue({event:"data_mart_created",category:"DataMart",action:"Create",label:T.id}),It.success("Data Mart created"),T}catch(O){const T=Cn(O);throw n({type:"CREATE_DATA_MART_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"CreateError",label:T.message}),O}},[]),l=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_START"});const T=await sn.updateDataMart(A,O),M=await Wc(T);n({type:"UPDATE_DATA_MART_SUCCESS",payload:M}),Ue({event:"data_mart_updated",category:"DataMart",action:"Update",label:M.id})}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateError",label:M.message})}},[]),c=m.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}),It.success("Data Mart deleted")}catch(O){const T=Cn(O);n({type:"DELETE_DATA_MART_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"DeleteError",label:T.message})}},[]),d=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_TITLE_START"}),await sn.updateDataMartTitle(A,O),n({type:"UPDATE_DATA_MART_TITLE_SUCCESS",payload:O}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateTitle",label:O}),It.success("Title updated")}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_TITLE_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateTitleError",label:M.message})}},[]),f=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_DESCRIPTION_START"}),await sn.updateDataMartDescription(A,O),n({type:"UPDATE_DATA_MART_DESCRIPTION_SUCCESS",payload:O??""}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateDescription"}),It.success("Description updated")}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_DESCRIPTION_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateDescriptionError",label:M.message})}},[]),h=m.useCallback(A=>{n({type:"UPDATE_DATA_MART_STORAGE",payload:A})},[]),g=m.useCallback(async(A,O,T)=>{try{n({type:"UPDATE_DATA_MART_DEFINITION_START"});let M;switch(O){case Fe.SQL:M={definitionType:O,definition:pQ(T)};break;case Fe.TABLE:M={definitionType:O,definition:yQ(T)};break;case Fe.VIEW:M={definitionType:O,definition:xQ(T)};break;case Fe.TABLE_PATTERN:M={definitionType:O,definition:SQ(T)};break;case Fe.CONNECTOR:{const K=T;let Y;for(const G of K.connector.source.configuration){const U=G;if(U._copiedFrom){Y=U._copiedFrom.dataMartId;break}}M={definitionType:Fe.CONNECTOR,definition:EQ(K),sourceDataMartId:Y};break}default:throw new Error(`Unsupported definition type: ${String(O)}`)}const V=await sn.updateDataMartDefinition(A,M),Z=await Wc(V);n({type:"UPDATE_DATA_MART_DEFINITION_SUCCESS",payload:{definitionType:O,definition:T}}),n({type:"UPDATE_DATA_MART_SUCCESS",payload:Z}),Ue({event:"data_mart_updated",category:"DataMart",action:"UpdateDefinition",label:O})}catch(M){const V=Cn(M);n({type:"UPDATE_DATA_MART_DEFINITION_ERROR",payload:V}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateDefinitionError",label:V.message})}},[]),y=m.useCallback(async A=>{try{n({type:"PUBLISH_DATA_MART_START"});const O=await sn.publishDataMart(A),T=await Wc(O);n({type:"PUBLISH_DATA_MART_SUCCESS",payload:T}),It.success("Data Mart published")}catch(O){const T=Cn(O);throw n({type:"PUBLISH_DATA_MART_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"PublishError",label:T.message}),O}},[]),v=m.useCallback(async(A,O=5,T=0,M)=>{try{M!=null&&M.silent||n({type:"FETCH_DATA_MART_RUNS_START"});const V=await sn.getDataMartRuns(A,O,T,M!=null&&M.silent?{skipLoadingIndicator:!0}:void 0),Z=Hj(V);return n({type:"FETCH_DATA_MART_RUNS_SUCCESS",payload:Z}),Z}catch(V){throw n({type:"FETCH_DATA_MART_RUNS_ERROR",payload:Cn(V)}),V}},[]),b=m.useCallback(async(A,O,T=5)=>{try{n({type:"LOAD_MORE_DATA_MART_RUNS_START"});const M=await sn.getDataMartRuns(A,T,O),V=Hj(M);return n({type:"LOAD_MORE_DATA_MART_RUNS_SUCCESS",payload:V}),V}catch(M){throw n({type:"LOAD_MORE_DATA_MART_RUNS_ERROR",payload:Cn(M)}),M}},[]),E=m.useCallback(async A=>{const O=It.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(T){It.dismiss(O);const M=Cn(T);n({type:"RUN_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"RunError",label:M.message})}},[]),S=m.useCallback(async(A,O)=>{try{await sn.cancelDataMartRun(A,O),await v(A),It.success("Data Mart run canceled")}catch(T){const M=Cn(T);n({type:"RUN_DATA_MART_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"CancelRunError",label:M.message})}},[v]),C=m.useCallback(async A=>{try{n({type:"ACTUALIZE_DATA_MART_SCHEMA_START"});const O=await sn.actualizeDataMartSchema(A),T=await Wc(O);n({type:"ACTUALIZE_DATA_MART_SCHEMA_SUCCESS",payload:T}),It.success("Output schema actualized")}catch(O){const T=Cn(O);n({type:"ACTUALIZE_DATA_MART_SCHEMA_ERROR",payload:T}),Ue({event:"data_mart_error",category:"DataMart",action:"ActualizeSchemaError",label:T.message})}},[]),R=m.useCallback(async(A,O)=>{try{n({type:"UPDATE_DATA_MART_SCHEMA_START"});const T=await sn.updateDataMartSchema(A,{schema:O}),M=await Wc(T);n({type:"UPDATE_DATA_MART_SCHEMA_SUCCESS",payload:M}),It.success("Output schema updated")}catch(T){const M=Cn(T);n({type:"UPDATE_DATA_MART_SCHEMA_ERROR",payload:M}),Ue({event:"data_mart_error",category:"DataMart",action:"UpdateSchemaError",label:M.message})}},[]),j=m.useCallback(()=>{n({type:"RESET"})},[]),_=m.useCallback(()=>t.error?t.error.message:null,[t.error]),D={...t,getDataMart:r,createDataMart:o,updateDataMart:l,deleteDataMart:c,updateDataMartTitle:d,updateDataMartDescription:f,updateDataMartStorage:h,updateDataMartDefinition:g,publishDataMart:y,runDataMart:E,cancelDataMartRun:S,actualizeDataMartSchema:C,updateDataMartSchema:R,getDataMartRuns:v,loadMoreDataMartRuns:b,getErrorMessage:_,reset:j};return a.jsx(H3.Provider,{value:D,children:e})}var eh=e=>e.type==="checkbox",Il=e=>e instanceof Date,la=e=>e==null;const q3=e=>typeof e=="object";var Jn=e=>!la(e)&&!Array.isArray(e)&&q3(e)&&!Il(e),Z3=e=>Jn(e)&&e.target?eh(e.target)?e.target.checked:e.target.value:e,_Q=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,K3=(e,t)=>e.has(_Q(t)),NQ=e=>{const t=e.constructor&&e.constructor.prototype;return Jn(t)&&t.hasOwnProperty("isPrototypeOf")},rS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ar(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(!(rS&&(e instanceof Blob||r))&&(n||Jn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!NQ(e))t=e;else for(const o in e)e.hasOwnProperty(o)&&(t[o]=ar(e[o]));else return e;return t}var Fg=e=>/^\w*$/.test(e),Mn=e=>e===void 0,aS=e=>Array.isArray(e)?e.filter(Boolean):[],sS=e=>aS(e.replace(/["|']|\]/g,"").split(/\.|\[/)),De=(e,t,n)=>{if(!t||!Jn(e))return n;const r=(Fg(t)?[t]:sS(t)).reduce((o,l)=>la(o)?o:o[l],e);return Mn(r)||r===e?Mn(e[t])?n:e[t]:r},Ta=e=>typeof e=="boolean",Xt=(e,t,n)=>{let r=-1;const o=Fg(t)?[t]:sS(t),l=o.length,c=l-1;for(;++r<l;){const d=o[r];let f=n;if(r!==c){const h=e[d];f=Jn(h)||Array.isArray(h)?h:isNaN(+o[r+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=f,e=e[d]}};const Up={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ms={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ro={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},oS=ye.createContext(null);oS.displayName="HookFormContext";const zu=()=>ye.useContext(oS),Y3=e=>{const{children:t,...n}=e;return ye.createElement(oS.Provider,{value:n},t)};var W3=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const l in e)Object.defineProperty(o,l,{get:()=>{const c=l;return t._proxyFormState[c]!==ms.all&&(t._proxyFormState[c]=!r||ms.all),n&&(n[c]=!0),e[c]}});return o};const iS=typeof window<"u"?ye.useLayoutEffect:ye.useEffect;function Q3(e){const t=zu(),{control:n=t.control,disabled:r,name:o,exact:l}=e||{},[c,d]=ye.useState(n._formState),f=ye.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return iS(()=>n._subscribe({name:o,formState:f.current,exact:l,callback:h=>{!r&&d({...n._formState,...h})}}),[o,r,l]),ye.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),ye.useMemo(()=>W3(c,n,f.current,!1),[c,n])}var Aa=e=>typeof e=="string",r1=(e,t,n,r,o)=>Aa(e)?(r&&t.watch.add(e),De(n,e,o)):Array.isArray(e)?e.map(l=>(r&&t.watch.add(l),De(n,l))):(r&&(t.watchAll=!0),n),a1=e=>la(e)||!q3(e);function ps(e,t,n=new WeakSet){if(a1(e)||a1(t))return e===t;if(Il(e)&&Il(t))return e.getTime()===t.getTime();const r=Object.keys(e),o=Object.keys(t);if(r.length!==o.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(!o.includes(l))return!1;if(l!=="ref"){const d=t[l];if(Il(c)&&Il(d)||Jn(c)&&Jn(d)||Array.isArray(c)&&Array.isArray(d)?!ps(c,d,n):c!==d)return!1}}return!0}function AQ(e){const t=zu(),{control:n=t.control,name:r,defaultValue:o,disabled:l,exact:c,compute:d}=e||{},f=ye.useRef(o),h=ye.useRef(d),g=ye.useRef(void 0),y=ye.useRef(n),v=ye.useRef(r);h.current=d;const[b,E]=ye.useState(()=>{const D=n._getWatch(r,f.current);return h.current?h.current(D):D}),S=ye.useCallback(D=>{const A=r1(r,n._names,D||n._formValues,!1,f.current);return h.current?h.current(A):A},[n._formValues,n._names,r]),C=ye.useCallback(D=>{if(!l){const A=r1(r,n._names,D||n._formValues,!1,f.current);if(h.current){const O=h.current(A);ps(O,g.current)||(E(O),g.current=O)}else E(A)}},[n._formValues,n._names,l,r]);iS(()=>((y.current!==n||!ps(v.current,r))&&(y.current=n,v.current=r,C()),n._subscribe({name:r,formState:{values:!0},exact:c,callback:D=>{C(D.values)}})),[n,c,r,C]),ye.useEffect(()=>n._removeUnmounted());const R=y.current!==n,j=v.current,_=ye.useMemo(()=>{if(l)return null;const D=!R&&!ps(j,r);return R||D?S():null},[l,R,r,j,S]);return _!==null?_:b}function DQ(e){const t=zu(),{name:n,disabled:r,control:o=t.control,shouldUnregister:l,defaultValue:c}=e,d=K3(o._names.array,n),f=ye.useMemo(()=>De(o._formValues,n,De(o._defaultValues,n,c)),[o,n,c]),h=AQ({control:o,name:n,defaultValue:f,exact:!0}),g=Q3({control:o,name:n,exact:!0}),y=ye.useRef(e),v=ye.useRef(void 0),b=ye.useRef(o.register(n,{...e.rules,value:h,...Ta(e.disabled)?{disabled:e.disabled}:{}}));y.current=e;const E=ye.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!De(g.errors,n)},isDirty:{enumerable:!0,get:()=>!!De(g.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!De(g.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!De(g.validatingFields,n)},error:{enumerable:!0,get:()=>De(g.errors,n)}}),[g,n]),S=ye.useCallback(_=>b.current.onChange({target:{value:Z3(_),name:n},type:Up.CHANGE}),[n]),C=ye.useCallback(()=>b.current.onBlur({target:{value:De(o._formValues,n),name:n},type:Up.BLUR}),[n,o._formValues]),R=ye.useCallback(_=>{const D=De(o._fields,n);D&&_&&(D._f.ref={focus:()=>_.focus&&_.focus(),select:()=>_.select&&_.select(),setCustomValidity:A=>_.setCustomValidity(A),reportValidity:()=>_.reportValidity()})},[o._fields,n]),j=ye.useMemo(()=>({name:n,value:h,...Ta(r)||g.disabled?{disabled:g.disabled||r}:{},onChange:S,onBlur:C,ref:R}),[n,r,g.disabled,S,C,R,h]);return ye.useEffect(()=>{const _=o._options.shouldUnregister||l,D=v.current;D&&D!==n&&!d&&o.unregister(D),o.register(n,{...y.current.rules,...Ta(y.current.disabled)?{disabled:y.current.disabled}:{}});const A=(O,T)=>{const M=De(o._fields,O);M&&M._f&&(M._f.mount=T)};if(A(n,!0),_){const O=ar(De(o._options.defaultValues,n,y.current.defaultValue));Xt(o._defaultValues,n,O),Mn(De(o._formValues,n))&&Xt(o._formValues,n,O)}return!d&&o.register(n),v.current=n,()=>{(d?_&&!o._state.action:_)?o.unregister(n):A(n,!1)}},[n,o,d,l]),ye.useEffect(()=>{o._setDisabledField({disabled:r,name:n})},[r,n,o]),ye.useMemo(()=>({field:j,formState:g,fieldState:E}),[j,g,E])}const OQ=e=>e.render(DQ(e));var lS=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},rf=e=>Array.isArray(e)?e:[e],$j=()=>{let e=[];return{get observers(){return e},next:o=>{for(const l of e)l.next&&l.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(l=>l!==o)}}),unsubscribe:()=>{e=[]}}};function X3(e,t){const n={};for(const r in e)if(e.hasOwnProperty(r)){const o=e[r],l=t[r];if(o&&Jn(o)&&l){const c=X3(o,l);Jn(c)&&(n[r]=c)}else e[r]&&(n[r]=l)}return n}var Vr=e=>Jn(e)&&!Object.keys(e).length,cS=e=>e.type==="file",gs=e=>typeof e=="function",Fp=e=>{if(!rS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},J3=e=>e.type==="select-multiple",uS=e=>e.type==="radio",MQ=e=>uS(e)||eh(e),t0=e=>Fp(e)&&e.isConnected;function IQ(e,t){const n=t.slice(0,-1).length;let r=0;for(;r<n;)e=Mn(e)?r++:e[t[r++]];return e}function kQ(e){for(const t in e)if(e.hasOwnProperty(t)&&!Mn(e[t]))return!1;return!0}function Qn(e,t){const n=Array.isArray(t)?t:Fg(t)?[t]:sS(t),r=n.length===1?e:IQ(e,n),o=n.length-1,l=n[o];return r&&delete r[l],o!==0&&(Jn(r)&&Vr(r)||Array.isArray(r)&&kQ(r))&&Qn(e,n.slice(0,-1)),e}var LQ=e=>{for(const t in e)if(gs(e[t]))return!0;return!1};function eD(e){return Array.isArray(e)||Jn(e)&&!LQ(e)}function s1(e,t={}){for(const n in e)eD(e[n])?(t[n]=Array.isArray(e[n])?[]:{},s1(e[n],t[n])):Mn(e[n])||(t[n]=!0);return t}function ru(e,t,n){n||(n=s1(t));for(const r in e)eD(e[r])?Mn(t)||a1(n[r])?n[r]=s1(e[r],Array.isArray(e[r])?[]:{}):ru(e[r],la(t)?{}:t[r],n[r]):n[r]=!ps(e[r],t[r]);return n}const Bj={value:!1,isValid:!1},Gj={value:!0,isValid:!0};var tD=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&&!Mn(e[0].attributes.value)?Mn(e[0].value)||e[0].value===""?Gj:{value:e[0].value,isValid:!0}:Gj:Bj}return Bj},nD=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Mn(e)?e:t?e===""?NaN:e&&+e:n&&Aa(e)?new Date(e):r?r(e):e;const qj={isValid:!1,value:null};var rD=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,qj):qj;function Zj(e){const t=e.ref;return cS(t)?t.files:uS(t)?rD(e.refs).value:J3(t)?[...t.selectedOptions].map(({value:n})=>n):eh(t)?tD(e.refs).value:nD(Mn(t.value)?e.ref.value:t.value,e)}var PQ=(e,t,n,r)=>{const o={};for(const l of e){const c=De(t,l);c&&Xt(o,l,c._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Vp=e=>e instanceof RegExp,$d=e=>Mn(e)?e:Vp(e)?e.source:Jn(e)?Vp(e.value)?e.value.source:e.value:e,Kj=e=>({isOnSubmit:!e||e===ms.onSubmit,isOnBlur:e===ms.onBlur,isOnChange:e===ms.onChange,isOnAll:e===ms.all,isOnTouch:e===ms.onTouched});const Yj="AsyncFunction";var UQ=e=>!!e&&!!e.validate&&!!(gs(e.validate)&&e.validate.constructor.name===Yj||Jn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===Yj)),FQ=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Wj=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const af=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const l=De(e,o);if(l){const{_f:c,...d}=l;if(c){if(c.refs&&c.refs[0]&&t(c.refs[0],o)&&!r)return!0;if(c.ref&&t(c.ref,c.name)&&!r)return!0;if(af(d,t))break}else if(Jn(d)&&af(d,t))break}}};function Qj(e,t,n){const r=De(e,n);if(r||Fg(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const l=o.join("."),c=De(t,l),d=De(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};o.pop()}return{name:n}}var VQ=(e,t,n,r)=>{n(e);const{name:o,...l}=e;return Vr(l)||Object.keys(l).length>=Object.keys(t).length||Object.keys(l).find(c=>t[c]===(!r||ms.all))},zQ=(e,t,n)=>!e||!t||e===t||rf(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r))),HQ=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,$Q=(e,t)=>!aS(De(e,t)).length&&Qn(e,t),BQ=(e,t,n)=>{const r=rf(De(e,n));return Xt(r,"root",t[n]),Xt(e,n,r),e};function Xj(e,t,n="validate"){if(Aa(e)||Array.isArray(e)&&e.every(Aa)||Ta(e)&&!e)return{type:n,message:Aa(e)?e:"",ref:t}}var Qc=e=>Jn(e)&&!Vp(e)?e:{value:e,message:""},Jj=async(e,t,n,r,o,l)=>{const{ref:c,refs:d,required:f,maxLength:h,minLength:g,min:y,max:v,pattern:b,validate:E,name:S,valueAsNumber:C,mount:R}=e._f,j=De(n,S);if(!R||t.has(S))return{};const _=d?d[0]:c,D=Y=>{o&&_.reportValidity&&(_.setCustomValidity(Ta(Y)?"":Y||""),_.reportValidity())},A={},O=uS(c),T=eh(c),M=O||T,V=(C||cS(c))&&Mn(c.value)&&Mn(j)||Fp(c)&&c.value===""||j===""||Array.isArray(j)&&!j.length,Z=lS.bind(null,S,r,A),K=(Y,G,U,H=Ro.maxLength,k=Ro.minLength)=>{const $=Y?G:U;A[S]={type:Y?H:k,message:$,ref:c,...Z(Y?H:k,$)}};if(l?!Array.isArray(j)||!j.length:f&&(!M&&(V||la(j))||Ta(j)&&!j||T&&!tD(d).isValid||O&&!rD(d).isValid)){const{value:Y,message:G}=Aa(f)?{value:!!f,message:f}:Qc(f);if(Y&&(A[S]={type:Ro.required,message:G,ref:_,...Z(Ro.required,G)},!r))return D(G),A}if(!V&&(!la(y)||!la(v))){let Y,G;const U=Qc(v),H=Qc(y);if(!la(j)&&!isNaN(j)){const k=c.valueAsNumber||j&&+j;la(U.value)||(Y=k>U.value),la(H.value)||(G=k<H.value)}else{const k=c.valueAsDate||new Date(j),$=be=>new Date(new Date().toDateString()+" "+be),q=c.type=="time",ie=c.type=="week";Aa(U.value)&&j&&(Y=q?$(j)>$(U.value):ie?j>U.value:k>new Date(U.value)),Aa(H.value)&&j&&(G=q?$(j)<$(H.value):ie?j<H.value:k<new Date(H.value))}if((Y||G)&&(K(!!Y,U.message,H.message,Ro.max,Ro.min),!r))return D(A[S].message),A}if((h||g)&&!V&&(Aa(j)||l&&Array.isArray(j))){const Y=Qc(h),G=Qc(g),U=!la(Y.value)&&j.length>+Y.value,H=!la(G.value)&&j.length<+G.value;if((U||H)&&(K(U,Y.message,G.message),!r))return D(A[S].message),A}if(b&&!V&&Aa(j)){const{value:Y,message:G}=Qc(b);if(Vp(Y)&&!j.match(Y)&&(A[S]={type:Ro.pattern,message:G,ref:c,...Z(Ro.pattern,G)},!r))return D(G),A}if(E){if(gs(E)){const Y=await E(j,n),G=Xj(Y,_);if(G&&(A[S]={...G,...Z(Ro.validate,G.message)},!r))return D(G.message),A}else if(Jn(E)){let Y={};for(const G in E){if(!Vr(Y)&&!r)break;const U=Xj(await E[G](j,n),_,G);U&&(Y={...U,...Z(G,U.message)},D(U.message),r&&(A[S]=Y))}if(!Vr(Y)&&(A[S]={ref:_,...Y},!r))return A}}return D(!0),A};const GQ={mode:ms.onSubmit,reValidateMode:ms.onChange,shouldFocusError:!0};function qQ(e={}){let t={...GQ,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:gs(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=Jn(t.defaultValues)||Jn(t.values)?ar(t.defaultValues||t.values)||{}:{},l=t.shouldUnregister?{}:ar(o),c={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,h=0;const g={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let y={...g};const v={array:$j(),state:$j()},b=t.criteriaMode===ms.all,E=F=>X=>{clearTimeout(h),h=setTimeout(F,X)},S=async F=>{if(!t.disabled&&(g.isValid||y.isValid||F)){const X=t.resolver?Vr((await T()).errors):await V(r,!0);X!==n.isValid&&v.state.next({isValid:X})}},C=(F,X)=>{!t.disabled&&(g.isValidating||g.validatingFields||y.isValidating||y.validatingFields)&&((F||Array.from(d.mount)).forEach(de=>{de&&(X?Xt(n.validatingFields,de,X):Qn(n.validatingFields,de))}),v.state.next({validatingFields:n.validatingFields,isValidating:!Vr(n.validatingFields)}))},R=(F,X=[],de,_e,Se=!0,Ee=!0)=>{if(_e&&de&&!t.disabled){if(c.action=!0,Ee&&Array.isArray(De(r,F))){const We=de(De(r,F),_e.argA,_e.argB);Se&&Xt(r,F,We)}if(Ee&&Array.isArray(De(n.errors,F))){const We=de(De(n.errors,F),_e.argA,_e.argB);Se&&Xt(n.errors,F,We),$Q(n.errors,F)}if((g.touchedFields||y.touchedFields)&&Ee&&Array.isArray(De(n.touchedFields,F))){const We=de(De(n.touchedFields,F),_e.argA,_e.argB);Se&&Xt(n.touchedFields,F,We)}(g.dirtyFields||y.dirtyFields)&&(n.dirtyFields=ru(o,l)),v.state.next({name:F,isDirty:K(F,X),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Xt(l,F,X)},j=(F,X)=>{Xt(n.errors,F,X),v.state.next({errors:n.errors})},_=F=>{n.errors=F,v.state.next({errors:n.errors,isValid:!1})},D=(F,X,de,_e)=>{const Se=De(r,F);if(Se){const Ee=De(l,F,Mn(de)?De(o,F):de);Mn(Ee)||_e&&_e.defaultChecked||X?Xt(l,F,X?Ee:Zj(Se._f)):U(F,Ee),c.mount&&S()}},A=(F,X,de,_e,Se)=>{let Ee=!1,We=!1;const ot={name:F};if(!t.disabled){if(!de||_e){(g.isDirty||y.isDirty)&&(We=n.isDirty,n.isDirty=ot.isDirty=K(),Ee=We!==ot.isDirty);const it=ps(De(o,F),X);We=!!De(n.dirtyFields,F),it?Qn(n.dirtyFields,F):Xt(n.dirtyFields,F,!0),ot.dirtyFields=n.dirtyFields,Ee=Ee||(g.dirtyFields||y.dirtyFields)&&We!==!it}if(de){const it=De(n.touchedFields,F);it||(Xt(n.touchedFields,F,de),ot.touchedFields=n.touchedFields,Ee=Ee||(g.touchedFields||y.touchedFields)&&it!==de)}Ee&&Se&&v.state.next(ot)}return Ee?ot:{}},O=(F,X,de,_e)=>{const Se=De(n.errors,F),Ee=(g.isValid||y.isValid)&&Ta(X)&&n.isValid!==X;if(t.delayError&&de?(f=E(()=>j(F,de)),f(t.delayError)):(clearTimeout(h),f=null,de?Xt(n.errors,F,de):Qn(n.errors,F)),(de?!ps(Se,de):Se)||!Vr(_e)||Ee){const We={..._e,...Ee&&Ta(X)?{isValid:X}:{},errors:n.errors,name:F};n={...n,...We},v.state.next(We)}},T=async F=>{C(F,!0);const X=await t.resolver(l,t.context,PQ(F||d.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return C(F),X},M=async F=>{const{errors:X}=await T(F);if(F)for(const de of F){const _e=De(X,de);_e?Xt(n.errors,de,_e):Qn(n.errors,de)}else n.errors=X;return X},V=async(F,X,de={valid:!0})=>{for(const _e in F){const Se=F[_e];if(Se){const{_f:Ee,...We}=Se;if(Ee){const ot=d.array.has(Ee.name),it=Se._f&&UQ(Se._f);it&&g.validatingFields&&C([Ee.name],!0);const xn=await Jj(Se,d.disabled,l,b,t.shouldUseNativeValidation&&!X,ot);if(it&&g.validatingFields&&C([Ee.name]),xn[Ee.name]&&(de.valid=!1,X))break;!X&&(De(xn,Ee.name)?ot?BQ(n.errors,xn,Ee.name):Xt(n.errors,Ee.name,xn[Ee.name]):Qn(n.errors,Ee.name))}!Vr(We)&&await V(We,X,de)}}return de.valid},Z=()=>{for(const F of d.unMount){const X=De(r,F);X&&(X._f.refs?X._f.refs.every(de=>!t0(de)):!t0(X._f.ref))&&le(F)}d.unMount=new Set},K=(F,X)=>!t.disabled&&(F&&X&&Xt(l,F,X),!ps(be(),o)),Y=(F,X,de)=>r1(F,d,{...c.mount?l:Mn(X)?o:Aa(F)?{[F]:X}:X},de,X),G=F=>aS(De(c.mount?l:o,F,t.shouldUnregister?De(o,F,[]):[])),U=(F,X,de={})=>{const _e=De(r,F);let Se=X;if(_e){const Ee=_e._f;Ee&&(!Ee.disabled&&Xt(l,F,nD(X,Ee)),Se=Fp(Ee.ref)&&la(X)?"":X,J3(Ee.ref)?[...Ee.ref.options].forEach(We=>We.selected=Se.includes(We.value)):Ee.refs?eh(Ee.ref)?Ee.refs.forEach(We=>{(!We.defaultChecked||!We.disabled)&&(Array.isArray(Se)?We.checked=!!Se.find(ot=>ot===We.value):We.checked=Se===We.value||!!Se)}):Ee.refs.forEach(We=>We.checked=We.value===Se):cS(Ee.ref)?Ee.ref.value="":(Ee.ref.value=Se,Ee.ref.type||v.state.next({name:F,values:ar(l)})))}(de.shouldDirty||de.shouldTouch)&&A(F,Se,de.shouldTouch,de.shouldDirty,!0),de.shouldValidate&&ie(F)},H=(F,X,de)=>{for(const _e in X){if(!X.hasOwnProperty(_e))return;const Se=X[_e],Ee=F+"."+_e,We=De(r,Ee);(d.array.has(F)||Jn(Se)||We&&!We._f)&&!Il(Se)?H(Ee,Se,de):U(Ee,Se,de)}},k=(F,X,de={})=>{const _e=De(r,F),Se=d.array.has(F),Ee=ar(X);Xt(l,F,Ee),Se?(v.array.next({name:F,values:ar(l)}),(g.isDirty||g.dirtyFields||y.isDirty||y.dirtyFields)&&de.shouldDirty&&v.state.next({name:F,dirtyFields:ru(o,l),isDirty:K(F,Ee)})):_e&&!_e._f&&!la(Ee)?H(F,Ee,de):U(F,Ee,de),Wj(F,d)&&v.state.next({...n,name:F}),v.state.next({name:c.mount?F:void 0,values:ar(l)})},$=async F=>{c.mount=!0;const X=F.target;let de=X.name,_e=!0;const Se=De(r,de),Ee=it=>{_e=Number.isNaN(it)||Il(it)&&isNaN(it.getTime())||ps(it,De(l,de,it))},We=Kj(t.mode),ot=Kj(t.reValidateMode);if(Se){let it,xn;const Ua=X.type?Zj(Se._f):Z3(F),bn=F.type===Up.BLUR||F.type===Up.FOCUS_OUT,Jo=!FQ(Se._f)&&!t.resolver&&!De(n.errors,de)&&!Se._f.deps||HQ(bn,De(n.touchedFields,de),n.isSubmitted,ot,We),Fn=Wj(de,d,bn);Xt(l,de,Ua),bn?(!X||!X.readOnly)&&(Se._f.onBlur&&Se._f.onBlur(F),f&&f(0)):Se._f.onChange&&Se._f.onChange(F);const Tn=A(de,Ua,bn),vr=!Vr(Tn)||Fn;if(!bn&&v.state.next({name:de,type:F.type,values:ar(l)}),Jo)return(g.isValid||y.isValid)&&(t.mode==="onBlur"?bn&&S():bn||S()),vr&&v.state.next({name:de,...Fn?{}:Tn});if(!bn&&Fn&&v.state.next({...n}),t.resolver){const{errors:_n}=await T([de]);if(Ee(Ua),_e){const ul=Qj(n.errors,r,de),Ns=Qj(_n,r,ul.name||de);it=Ns.error,de=Ns.name,xn=Vr(_n)}}else C([de],!0),it=(await Jj(Se,d.disabled,l,b,t.shouldUseNativeValidation))[de],C([de]),Ee(Ua),_e&&(it?xn=!1:(g.isValid||y.isValid)&&(xn=await V(r,!0)));_e&&(Se._f.deps&&(!Array.isArray(Se._f.deps)||Se._f.deps.length>0)&&ie(Se._f.deps),O(de,xn,it,Tn))}},q=(F,X)=>{if(De(n.errors,X)&&F.focus)return F.focus(),1},ie=async(F,X={})=>{let de,_e;const Se=rf(F);if(t.resolver){const Ee=await M(Mn(F)?F:Se);de=Vr(Ee),_e=F?!Se.some(We=>De(Ee,We)):de}else F?(_e=(await Promise.all(Se.map(async Ee=>{const We=De(r,Ee);return await V(We&&We._f?{[Ee]:We}:We)}))).every(Boolean),!(!_e&&!n.isValid)&&S()):_e=de=await V(r);return v.state.next({...!Aa(F)||(g.isValid||y.isValid)&&de!==n.isValid?{}:{name:F},...t.resolver||!F?{isValid:de}:{},errors:n.errors}),X.shouldFocus&&!_e&&af(r,q,F?Se:d.mount),_e},be=(F,X)=>{let de={...c.mount?l:o};return X&&(de=X3(X.dirtyFields?n.dirtyFields:n.touchedFields,de)),Mn(F)?de:Aa(F)?De(de,F):F.map(_e=>De(de,_e))},L=(F,X)=>({invalid:!!De((X||n).errors,F),isDirty:!!De((X||n).dirtyFields,F),error:De((X||n).errors,F),isValidating:!!De(n.validatingFields,F),isTouched:!!De((X||n).touchedFields,F)}),P=F=>{F&&rf(F).forEach(X=>Qn(n.errors,X)),v.state.next({errors:F?n.errors:{}})},W=(F,X,de)=>{const _e=(De(r,F,{_f:{}})._f||{}).ref,Se=De(n.errors,F)||{},{ref:Ee,message:We,type:ot,...it}=Se;Xt(n.errors,F,{...it,...X,ref:_e}),v.state.next({name:F,errors:n.errors,isValid:!1}),de&&de.shouldFocus&&_e&&_e.focus&&_e.focus()},te=(F,X)=>gs(F)?v.state.subscribe({next:de=>"values"in de&&F(Y(void 0,X),de)}):Y(F,X,!0),ue=F=>v.state.subscribe({next:X=>{zQ(F.name,X.name,F.exact)&&VQ(X,F.formState||g,Nr,F.reRenderRoot)&&F.callback({values:{...l},...n,...X,defaultValues:o})}}).unsubscribe,ve=F=>(c.mount=!0,y={...y,...F.formState},ue({...F,formState:y})),le=(F,X={})=>{for(const de of F?rf(F):d.mount)d.mount.delete(de),d.array.delete(de),X.keepValue||(Qn(r,de),Qn(l,de)),!X.keepError&&Qn(n.errors,de),!X.keepDirty&&Qn(n.dirtyFields,de),!X.keepTouched&&Qn(n.touchedFields,de),!X.keepIsValidating&&Qn(n.validatingFields,de),!t.shouldUnregister&&!X.keepDefaultValue&&Qn(o,de);v.state.next({values:ar(l)}),v.state.next({...n,...X.keepDirty?{isDirty:K()}:{}}),!X.keepIsValid&&S()},Ae=({disabled:F,name:X})=>{(Ta(F)&&c.mount||F||d.disabled.has(X))&&(F?d.disabled.add(X):d.disabled.delete(X))},we=(F,X={})=>{let de=De(r,F);const _e=Ta(X.disabled)||Ta(t.disabled);return Xt(r,F,{...de||{},_f:{...de&&de._f?de._f:{ref:{name:F}},name:F,mount:!0,...X}}),d.mount.add(F),de?Ae({disabled:Ta(X.disabled)?X.disabled:t.disabled,name:F}):D(F,!0,X.value),{..._e?{disabled:X.disabled||t.disabled}:{},...t.progressive?{required:!!X.required,min:$d(X.min),max:$d(X.max),minLength:$d(X.minLength),maxLength:$d(X.maxLength),pattern:$d(X.pattern)}:{},name:F,onChange:$,onBlur:$,ref:Se=>{if(Se){we(F,X),de=De(r,F);const Ee=Mn(Se.value)&&Se.querySelectorAll&&Se.querySelectorAll("input,select,textarea")[0]||Se,We=MQ(Ee),ot=de._f.refs||[];if(We?ot.find(it=>it===Ee):Ee===de._f.ref)return;Xt(r,F,{_f:{...de._f,...We?{refs:[...ot.filter(t0),Ee,...Array.isArray(De(o,F))?[{}]:[]],ref:{type:Ee.type,name:F}}:{ref:Ee}}}),D(F,!1,void 0,Ee)}else de=De(r,F,{}),de._f&&(de._f.mount=!1),(t.shouldUnregister||X.shouldUnregister)&&!(K3(d.array,F)&&c.action)&&d.unMount.add(F)}}},Ne=()=>t.shouldFocusError&&af(r,q,d.mount),Be=F=>{Ta(F)&&(v.state.next({disabled:F}),af(r,(X,de)=>{const _e=De(r,de);_e&&(X.disabled=_e._f.disabled||F,Array.isArray(_e._f.refs)&&_e._f.refs.forEach(Se=>{Se.disabled=_e._f.disabled||F}))},0,!1))},Qe=(F,X)=>async de=>{let _e;de&&(de.preventDefault&&de.preventDefault(),de.persist&&de.persist());let Se=ar(l);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:Ee,values:We}=await T();n.errors=Ee,Se=ar(We)}else await V(r);if(d.disabled.size)for(const Ee of d.disabled)Qn(Se,Ee);if(Qn(n.errors,"root"),Vr(n.errors)){v.state.next({errors:{}});try{await F(Se,de)}catch(Ee){_e=Ee}}else X&&await X({...n.errors},de),Ne(),setTimeout(Ne);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Vr(n.errors)&&!_e,submitCount:n.submitCount+1,errors:n.errors}),_e)throw _e},qt=(F,X={})=>{De(r,F)&&(Mn(X.defaultValue)?k(F,ar(De(o,F))):(k(F,X.defaultValue),Xt(o,F,ar(X.defaultValue))),X.keepTouched||Qn(n.touchedFields,F),X.keepDirty||(Qn(n.dirtyFields,F),n.isDirty=X.defaultValue?K(F,ar(De(o,F))):K()),X.keepError||(Qn(n.errors,F),g.isValid&&S()),v.state.next({...n}))},Dt=(F,X={})=>{const de=F?ar(F):o,_e=ar(de),Se=Vr(F),Ee=Se?o:_e;if(X.keepDefaultValues||(o=de),!X.keepValues){if(X.keepDirtyValues){const We=new Set([...d.mount,...Object.keys(ru(o,l))]);for(const ot of Array.from(We))De(n.dirtyFields,ot)?Xt(Ee,ot,De(l,ot)):k(ot,De(Ee,ot))}else{if(rS&&Mn(F))for(const We of d.mount){const ot=De(r,We);if(ot&&ot._f){const it=Array.isArray(ot._f.refs)?ot._f.refs[0]:ot._f.ref;if(Fp(it)){const xn=it.closest("form");if(xn){xn.reset();break}}}}if(X.keepFieldsRef)for(const We of d.mount)k(We,De(Ee,We));else r={}}l=t.shouldUnregister?X.keepDefaultValues?ar(o):{}:ar(Ee),v.array.next({values:{...Ee}}),v.state.next({values:{...Ee}})}d={mount:X.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},c.mount=!g.isValid||!!X.keepIsValid||!!X.keepDirtyValues||!t.shouldUnregister&&!Vr(Ee),c.watch=!!t.shouldUnregister,v.state.next({submitCount:X.keepSubmitCount?n.submitCount:0,isDirty:Se?!1:X.keepDirty?n.isDirty:!!(X.keepDefaultValues&&!ps(F,o)),isSubmitted:X.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Se?{}:X.keepDirtyValues?X.keepDefaultValues&&l?ru(o,l):n.dirtyFields:X.keepDefaultValues&&F?ru(o,F):X.keepDirty?n.dirtyFields:{},touchedFields:X.keepTouched?n.touchedFields:{},errors:X.keepErrors?n.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:o})},Zt=(F,X)=>Dt(gs(F)?F(l):F,X),jn=(F,X={})=>{const de=De(r,F),_e=de&&de._f;if(_e){const Se=_e.refs?_e.refs[0]:_e.ref;Se.focus&&(Se.focus(),X.shouldSelect&&gs(Se.select)&&Se.select())}},Nr=F=>{n={...n,...F}},Ve={control:{register:we,unregister:le,getFieldState:L,handleSubmit:Qe,setError:W,_subscribe:ue,_runSchema:T,_focusError:Ne,_getWatch:Y,_getDirty:K,_setValid:S,_setFieldArray:R,_setDisabledField:Ae,_setErrors:_,_getFieldArray:G,_reset:Dt,_resetDefaultValues:()=>gs(t.defaultValues)&&t.defaultValues().then(F=>{Zt(F,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:Z,_disableForm:Be,_subjects:v,_proxyFormState:g,get _fields(){return r},get _formValues(){return l},get _state(){return c},set _state(F){c=F},get _defaultValues(){return o},get _names(){return d},set _names(F){d=F},get _formState(){return n},get _options(){return t},set _options(F){t={...t,...F}}},subscribe:ve,trigger:ie,register:we,handleSubmit:Qe,watch:te,setValue:k,getValues:be,reset:Zt,resetField:qt,clearErrors:P,unregister:le,setError:W,setFocus:jn,getFieldState:L};return{...Ve,formControl:Ve}}function Qo(e={}){const t=ye.useRef(void 0),n=ye.useRef(void 0),[r,o]=ye.useState({isDirty:!1,isValidating:!1,isLoading:gs(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:gs(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:r},e.defaultValues&&!gs(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:c,...d}=qQ(e);t.current={...d,formState:r}}const l=t.current.control;return l._options=e,iS(()=>{const c=l._subscribe({formState:l._proxyFormState,callback:()=>o({...l._formState}),reRenderRoot:!0});return o(d=>({...d,isReady:!0})),l._formState.isReady=!0,c},[l]),ye.useEffect(()=>l._disableForm(e.disabled),[l,e.disabled]),ye.useEffect(()=>{e.mode&&(l._options.mode=e.mode),e.reValidateMode&&(l._options.reValidateMode=e.reValidateMode)},[l,e.mode,e.reValidateMode]),ye.useEffect(()=>{e.errors&&(l._setErrors(e.errors),l._focusError())},[l,e.errors]),ye.useEffect(()=>{e.shouldUnregister&&l._subjects.state.next({values:l._getWatch()})},[l,e.shouldUnregister]),ye.useEffect(()=>{if(l._proxyFormState.isDirty){const c=l._getDirty();c!==r.isDirty&&l._subjects.state.next({isDirty:c})}},[l,r.isDirty]),ye.useEffect(()=>{e.values&&!ps(e.values,n.current)?(l._reset(e.values,{keepFieldsRef:!0,...l._options.resetOptions}),n.current=e.values,o(c=>({...c}))):l._resetDefaultValues()},[l,e.values]),ye.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=W3(r,l),t.current}var ZQ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],KQ=ZQ.reduce((e,t)=>{const n=z1(`Primitive.${t}`),r=m.forwardRef((o,l)=>{const{asChild:c,...d}=o,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),a.jsx(f,{...d,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),YQ="Label",aD=m.forwardRef((e,t)=>a.jsx(KQ.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));aD.displayName=YQ;var WQ=aD;function Ma({className:e,...t}){return a.jsx(WQ,{"data-slot":"label",className:ne("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 rl=Y3,sD=m.createContext({}),kt=({...e})=>a.jsx(sD.Provider,{value:{name:e.name},children:a.jsx(OQ,{...e})}),th=()=>{const e=m.useContext(sD),t=m.useContext(oD),{getFieldState:n}=zu(),r=Q3({name:e.name}),o=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`,...o}},oD=m.createContext({});function _t({className:e="",...t}){const n=m.useId();return a.jsx(oD.Provider,{value:{id:n},children:a.jsx("div",{"data-slot":"form-item",className:ne("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 Rt({className:e="",tooltip:t,tooltipProps:n,children:r,...o}){const{error:l,formItemId:c}=th();return a.jsxs(Ma,{"data-slot":"form-label","data-error":!!l,className:ne("text-foreground flex items-center justify-between gap-2 text-sm font-medium","data-[error=true]:text-destructive",e),htmlFor:c,...o,children:[a.jsx("span",{children:r}),t&&a.jsxs(bt,{...n,children:[a.jsx(St,{asChild:!0,children:a.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:a.jsx(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:t})]})]})}function Nt({...e}){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=th();return a.jsx(tg,{"data-slot":"form-control",id:n,"aria-describedby":t?`${r} ${o}`:`${r}`,"aria-invalid":!!t,...e})}function wn({className:e,...t}){const{formDescriptionId:n}=th();return a.jsx("div",{"data-slot":"form-description",id:n,className:ne("text-muted-foreground text-sm",e),...t})}function Ft({className:e,...t}){const{error:n,formMessageId:r}=th(),o=n?String((n==null?void 0:n.message)??""):t.children;return o?a.jsx("p",{"data-slot":"form-message",id:r,className:ne("text-destructive text-sm",e),...t,children:o}):null}function al({children:e,className:t="",variant:n="default"}){const r=n==="light"?"flex-1 overflow-y-auto":"bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4";return a.jsx("div",{className:r,children:a.jsx("div",{className:ne("flex min-h-full flex-col gap-4",t),children:e})})}function sl({className:e="",children:t,variant:n="default"}){const r=n==="light"?"flex flex-col gap-1.5 pt-4":"flex flex-col gap-1.5 border-t px-4 py-3";return a.jsx("div",{className:ne(r,e),children:t})}function ua({title:e,children:t}){return a.jsxs("section",{className:"mb-4",children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function QQ({value:e,label:t,checked:n,onChange:r,disabled:o=!1,orientation:l="vertical",className:c=""}){const{formItemId:d}=th();return a.jsxs("label",{htmlFor:`${d}-${e}`,className:ne("flex cursor-pointer items-center gap-2 rounded-md py-1 pr-4 pl-2 text-sm",o&&"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:[a.jsx("input",{type:"radio",id:`${d}-${e}`,value:e,checked:n,onChange:r,disabled:o,className:ne("peer border-input ring-offset-background h-4 w-4 rounded-full border","checked:bg-primary checked:border-primary","focus-visible:ring-ring focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50")}),a.jsx("span",{className:ne("peer-disabled:cursor-not-allowed peer-disabled:opacity-50"),children:t})]})}function XQ({options:e,value:t,onChange:n,orientation:r="vertical",className:o=""}){return a.jsx("div",{tabIndex:-1,className:ne(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",o),children:e.map(l=>a.jsx(QQ,{value:l.value,label:l.label,checked:t===l.value,onChange:c=>n(c.target.value),disabled:l.disabled,orientation:r},l.value))})}const Xo=m.forwardRef(({children:e,className:t="",...n},r)=>a.jsx("form",{ref:r,className:ne("flex flex-1 flex-col overflow-hidden",t),...n,children:e}));Xo.displayName="AppForm";function eT(e,[t,n]){return Math.min(n,Math.max(t,e))}function o1(e){const t=JQ(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(tX);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function JQ(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=rX(o),d=nX(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var eX=Symbol("radix.slottable");function tX(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===eX}function nX(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function rX(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function aX(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return a.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=o1(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return a.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=o1(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),a.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function E(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},E,r]}function dS(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var sX=[" ","Enter","ArrowUp","ArrowDown"],oX=[" ","Enter"],Yl="Select",[Vg,zg,iX]=aX(Yl),[Hu]=cr(Yl,[iX,eo]),Hg=eo(),[lX,ol]=Hu(Yl),[cX,uX]=Hu(Yl),iD=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:l,value:c,defaultValue:d,onValueChange:f,dir:h,name:g,autoComplete:y,disabled:v,required:b,form:E}=e,S=Hg(t),[C,R]=m.useState(null),[j,_]=m.useState(null),[D,A]=m.useState(!1),O=Vf(h),[T,M]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:Yl}),[V,Z]=Gr({prop:c,defaultProp:d,onChange:f,caller:Yl}),K=m.useRef(null),Y=C?E||!!C.closest("form"):!0,[G,U]=m.useState(new Set),H=Array.from(G).map(k=>k.props.value).join(";");return a.jsx(ku,{...S,children:a.jsxs(lX,{required:b,scope:t,trigger:C,onTriggerChange:R,valueNode:j,onValueNodeChange:_,valueNodeHasChildren:D,onValueNodeHasChildrenChange:A,contentId:Ln(),value:V,onValueChange:Z,open:T,onOpenChange:M,dir:O,triggerPointerDownPosRef:K,disabled:v,children:[a.jsx(Vg.Provider,{scope:t,children:a.jsx(cX,{scope:e.__scopeSelect,onNativeOptionAdd:m.useCallback(k=>{U($=>new Set($).add(k))},[]),onNativeOptionRemove:m.useCallback(k=>{U($=>{const q=new Set($);return q.delete(k),q})},[]),children:n})}),Y?a.jsxs(DD,{"aria-hidden":!0,required:b,tabIndex:-1,name:g,autoComplete:y,value:V,onChange:k=>Z(k.target.value),disabled:v,form:E,children:[V===void 0?a.jsx("option",{value:""}):null,Array.from(G)]},H):null]})})};iD.displayName=Yl;var lD="SelectTrigger",cD=m.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,l=Hg(n),c=ol(lD,n),d=c.disabled||r,f=dt(t,c.onTriggerChange),h=zg(n),g=m.useRef("touch"),[y,v,b]=MD(S=>{const C=h().filter(_=>!_.disabled),R=C.find(_=>_.value===c.value),j=ID(C,S,R);j!==void 0&&c.onValueChange(j.value)}),E=S=>{d||(c.onOpenChange(!0),b()),S&&(c.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return a.jsx(Lu,{asChild:!0,...l,children:a.jsx(et.button,{type:"button",role:"combobox","aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":"none",dir:c.dir,"data-state":c.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":OD(c.value)?"":void 0,...o,ref:f,onClick:Te(o.onClick,S=>{S.currentTarget.focus(),g.current!=="mouse"&&E(S)}),onPointerDown:Te(o.onPointerDown,S=>{g.current=S.pointerType;const C=S.target;C.hasPointerCapture(S.pointerId)&&C.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(E(S),S.preventDefault())}),onKeyDown:Te(o.onKeyDown,S=>{const C=y.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&v(S.key),!(C&&S.key===" ")&&sX.includes(S.key)&&(E(),S.preventDefault())})})})});cD.displayName=lD;var uD="SelectValue",dD=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:l,placeholder:c="",...d}=e,f=ol(uD,n),{onValueNodeHasChildrenChange:h}=f,g=l!==void 0,y=dt(t,f.onValueNodeChange);return jr(()=>{h(g)},[h,g]),a.jsx(et.span,{...d,ref:y,style:{pointerEvents:"none"},children:OD(f.value)?a.jsx(a.Fragment,{children:c}):l})});dD.displayName=uD;var dX="SelectIcon",fD=m.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return a.jsx(et.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});fD.displayName=dX;var fX="SelectPortal",hD=e=>a.jsx(tc,{asChild:!0,...e});hD.displayName=fX;var Wl="SelectContent",mD=m.forwardRef((e,t)=>{const n=ol(Wl,e.__scopeSelect),[r,o]=m.useState();if(jr(()=>{o(new DocumentFragment)},[]),!n.open){const l=r;return l?ys.createPortal(a.jsx(pD,{scope:e.__scopeSelect,children:a.jsx(Vg.Slot,{scope:e.__scopeSelect,children:a.jsx("div",{children:e.children})})}),l):null}return a.jsx(gD,{...e,ref:t})});mD.displayName=Wl;var cs=10,[pD,il]=Hu(Wl),hX="SelectContentImpl",mX=o1("SelectContent.RemoveScroll"),gD=m.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:c,side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:E,hideWhenDetached:S,avoidCollisions:C,...R}=e,j=ol(Wl,n),[_,D]=m.useState(null),[A,O]=m.useState(null),T=dt(t,le=>D(le)),[M,V]=m.useState(null),[Z,K]=m.useState(null),Y=zg(n),[G,U]=m.useState(!1),H=m.useRef(!1);m.useEffect(()=>{if(_)return ig(_)},[_]),sg();const k=m.useCallback(le=>{const[Ae,...we]=Y().map(Qe=>Qe.ref.current),[Ne]=we.slice(-1),Be=document.activeElement;for(const Qe of le)if(Qe===Be||(Qe==null||Qe.scrollIntoView({block:"nearest"}),Qe===Ae&&A&&(A.scrollTop=0),Qe===Ne&&A&&(A.scrollTop=A.scrollHeight),Qe==null||Qe.focus(),document.activeElement!==Be))return},[Y,A]),$=m.useCallback(()=>k([M,_]),[k,M,_]);m.useEffect(()=>{G&&$()},[G,$]);const{onOpenChange:q,triggerPointerDownPosRef:ie}=j;m.useEffect(()=>{if(_){let le={x:0,y:0};const Ae=Ne=>{var Be,Qe;le={x:Math.abs(Math.round(Ne.pageX)-(((Be=ie.current)==null?void 0:Be.x)??0)),y:Math.abs(Math.round(Ne.pageY)-(((Qe=ie.current)==null?void 0:Qe.y)??0))}},we=Ne=>{le.x<=10&&le.y<=10?Ne.preventDefault():_.contains(Ne.target)||q(!1),document.removeEventListener("pointermove",Ae),ie.current=null};return ie.current!==null&&(document.addEventListener("pointermove",Ae),document.addEventListener("pointerup",we,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Ae),document.removeEventListener("pointerup",we,{capture:!0})}}},[_,q,ie]),m.useEffect(()=>{const le=()=>q(!1);return window.addEventListener("blur",le),window.addEventListener("resize",le),()=>{window.removeEventListener("blur",le),window.removeEventListener("resize",le)}},[q]);const[be,L]=MD(le=>{const Ae=Y().filter(Be=>!Be.disabled),we=Ae.find(Be=>Be.ref.current===document.activeElement),Ne=ID(Ae,le,we);Ne&&setTimeout(()=>Ne.ref.current.focus())}),P=m.useCallback((le,Ae,we)=>{const Ne=!H.current&&!we;(j.value!==void 0&&j.value===Ae||Ne)&&(V(le),Ne&&(H.current=!0))},[j.value]),W=m.useCallback(()=>_==null?void 0:_.focus(),[_]),te=m.useCallback((le,Ae,we)=>{const Ne=!H.current&&!we;(j.value!==void 0&&j.value===Ae||Ne)&&K(le)},[j.value]),ue=r==="popper"?i1:yD,ve=ue===i1?{side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:y,collisionBoundary:v,collisionPadding:b,sticky:E,hideWhenDetached:S,avoidCollisions:C}:{};return a.jsx(pD,{scope:n,content:_,viewport:A,onViewportChange:O,itemRefCallback:P,selectedItem:M,onItemLeave:W,itemTextRefCallback:te,focusSelectedItem:$,selectedItemText:Z,position:r,isPositioned:G,searchRef:be,children:a.jsx(If,{as:mX,allowPinchZoom:!0,children:a.jsx(Mf,{asChild:!0,trapped:j.open,onMountAutoFocus:le=>{le.preventDefault()},onUnmountAutoFocus:Te(o,le=>{var Ae;(Ae=j.trigger)==null||Ae.focus({preventScroll:!0}),le.preventDefault()}),children:a.jsx(ec,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:le=>le.preventDefault(),onDismiss:()=>j.onOpenChange(!1),children:a.jsx(ue,{role:"listbox",id:j.contentId,"data-state":j.open?"open":"closed",dir:j.dir,onContextMenu:le=>le.preventDefault(),...R,...ve,onPlaced:()=>U(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...R.style},onKeyDown:Te(R.onKeyDown,le=>{const Ae=le.ctrlKey||le.altKey||le.metaKey;if(le.key==="Tab"&&le.preventDefault(),!Ae&&le.key.length===1&&L(le.key),["ArrowUp","ArrowDown","Home","End"].includes(le.key)){let Ne=Y().filter(Be=>!Be.disabled).map(Be=>Be.ref.current);if(["ArrowUp","End"].includes(le.key)&&(Ne=Ne.slice().reverse()),["ArrowUp","ArrowDown"].includes(le.key)){const Be=le.target,Qe=Ne.indexOf(Be);Ne=Ne.slice(Qe+1)}setTimeout(()=>k(Ne)),le.preventDefault()}})})})})})})});gD.displayName=hX;var pX="SelectItemAlignedPosition",yD=m.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,l=ol(Wl,n),c=il(Wl,n),[d,f]=m.useState(null),[h,g]=m.useState(null),y=dt(t,T=>g(T)),v=zg(n),b=m.useRef(!1),E=m.useRef(!0),{viewport:S,selectedItem:C,selectedItemText:R,focusSelectedItem:j}=c,_=m.useCallback(()=>{if(l.trigger&&l.valueNode&&d&&h&&S&&C&&R){const T=l.trigger.getBoundingClientRect(),M=h.getBoundingClientRect(),V=l.valueNode.getBoundingClientRect(),Z=R.getBoundingClientRect();if(l.dir!=="rtl"){const Be=Z.left-M.left,Qe=V.left-Be,qt=T.left-Qe,Dt=T.width+qt,Zt=Math.max(Dt,M.width),jn=window.innerWidth-cs,Nr=eT(Qe,[cs,Math.max(cs,jn-Zt)]);d.style.minWidth=Dt+"px",d.style.left=Nr+"px"}else{const Be=M.right-Z.right,Qe=window.innerWidth-V.right-Be,qt=window.innerWidth-T.right-Qe,Dt=T.width+qt,Zt=Math.max(Dt,M.width),jn=window.innerWidth-cs,Nr=eT(Qe,[cs,Math.max(cs,jn-Zt)]);d.style.minWidth=Dt+"px",d.style.right=Nr+"px"}const K=v(),Y=window.innerHeight-cs*2,G=S.scrollHeight,U=window.getComputedStyle(h),H=parseInt(U.borderTopWidth,10),k=parseInt(U.paddingTop,10),$=parseInt(U.borderBottomWidth,10),q=parseInt(U.paddingBottom,10),ie=H+k+G+q+$,be=Math.min(C.offsetHeight*5,ie),L=window.getComputedStyle(S),P=parseInt(L.paddingTop,10),W=parseInt(L.paddingBottom,10),te=T.top+T.height/2-cs,ue=Y-te,ve=C.offsetHeight/2,le=C.offsetTop+ve,Ae=H+k+le,we=ie-Ae;if(Ae<=te){const Be=K.length>0&&C===K[K.length-1].ref.current;d.style.bottom="0px";const Qe=h.clientHeight-S.offsetTop-S.offsetHeight,qt=Math.max(ue,ve+(Be?W:0)+Qe+$),Dt=Ae+qt;d.style.height=Dt+"px"}else{const Be=K.length>0&&C===K[0].ref.current;d.style.top="0px";const qt=Math.max(te,H+S.offsetTop+(Be?P:0)+ve)+we;d.style.height=qt+"px",S.scrollTop=Ae-te+S.offsetTop}d.style.margin=`${cs}px 0`,d.style.minHeight=be+"px",d.style.maxHeight=Y+"px",r==null||r(),requestAnimationFrame(()=>b.current=!0)}},[v,l.trigger,l.valueNode,d,h,S,C,R,l.dir,r]);jr(()=>_(),[_]);const[D,A]=m.useState();jr(()=>{h&&A(window.getComputedStyle(h).zIndex)},[h]);const O=m.useCallback(T=>{T&&E.current===!0&&(_(),j==null||j(),E.current=!1)},[_,j]);return a.jsx(yX,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:b,onScrollButtonChange:O,children:a.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:D},children:a.jsx(et.div,{...o,ref:y,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});yD.displayName=pX;var gX="SelectPopperPosition",i1=m.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=cs,...l}=e,c=Hg(n);return a.jsx(Lf,{...c,...l,ref:t,align:r,collisionPadding:o,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)"}})});i1.displayName=gX;var[yX,fS]=Hu(Wl,{}),l1="SelectViewport",vD=m.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,l=il(l1,n),c=fS(l1,n),d=dt(t,l.onViewportChange),f=m.useRef(0);return a.jsxs(a.Fragment,{children:[a.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),a.jsx(Vg.Slot,{scope:n,children:a.jsx(et.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:Te(o.onScroll,h=>{const g=h.currentTarget,{contentWrapper:y,shouldExpandOnScrollRef:v}=c;if(v!=null&&v.current&&y){const b=Math.abs(f.current-g.scrollTop);if(b>0){const E=window.innerHeight-cs*2,S=parseFloat(y.style.minHeight),C=parseFloat(y.style.height),R=Math.max(S,C);if(R<E){const j=R+b,_=Math.min(E,j),D=j-_;y.style.height=_+"px",y.style.bottom==="0px"&&(g.scrollTop=D>0?D:0,y.style.justifyContent="flex-end")}}}f.current=g.scrollTop})})})]})});vD.displayName=l1;var xD="SelectGroup",[vX,xX]=Hu(xD),bD=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ln();return a.jsx(vX,{scope:n,id:o,children:a.jsx(et.div,{role:"group","aria-labelledby":o,...r,ref:t})})});bD.displayName=xD;var SD="SelectLabel",bX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xX(SD,n);return a.jsx(et.div,{id:o.id,...r,ref:t})});bX.displayName=SD;var zp="SelectItem",[SX,CD]=Hu(zp),ED=m.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:l,...c}=e,d=ol(zp,n),f=il(zp,n),h=d.value===r,[g,y]=m.useState(l??""),[v,b]=m.useState(!1),E=dt(t,j=>{var _;return(_=f.itemRefCallback)==null?void 0:_.call(f,j,r,o)}),S=Ln(),C=m.useRef("touch"),R=()=>{o||(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 a.jsx(SX,{scope:n,value:r,disabled:o,textId:S,isSelected:h,onItemTextChange:m.useCallback(j=>{y(_=>_||((j==null?void 0:j.textContent)??"").trim())},[]),children:a.jsx(Vg.ItemSlot,{scope:n,value:r,disabled:o,textValue:g,children:a.jsx(et.div,{role:"option","aria-labelledby":S,"data-highlighted":v?"":void 0,"aria-selected":h&&v,"data-state":h?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...c,ref:E,onFocus:Te(c.onFocus,()=>b(!0)),onBlur:Te(c.onBlur,()=>b(!1)),onClick:Te(c.onClick,()=>{C.current!=="mouse"&&R()}),onPointerUp:Te(c.onPointerUp,()=>{C.current==="mouse"&&R()}),onPointerDown:Te(c.onPointerDown,j=>{C.current=j.pointerType}),onPointerMove:Te(c.onPointerMove,j=>{var _;C.current=j.pointerType,o?(_=f.onItemLeave)==null||_.call(f):C.current==="mouse"&&j.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Te(c.onPointerLeave,j=>{var _;j.currentTarget===document.activeElement&&((_=f.onItemLeave)==null||_.call(f))}),onKeyDown:Te(c.onKeyDown,j=>{var D;((D=f.searchRef)==null?void 0:D.current)!==""&&j.key===" "||(oX.includes(j.key)&&R(),j.key===" "&&j.preventDefault())})})})})});ED.displayName=zp;var Xd="SelectItemText",wD=m.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...l}=e,c=ol(Xd,n),d=il(Xd,n),f=CD(Xd,n),h=uX(Xd,n),[g,y]=m.useState(null),v=dt(t,R=>y(R),f.onItemTextChange,R=>{var j;return(j=d.itemTextRefCallback)==null?void 0:j.call(d,R,f.value,f.disabled)}),b=g==null?void 0:g.textContent,E=m.useMemo(()=>a.jsx("option",{value:f.value,disabled:f.disabled,children:b},f.value),[f.disabled,f.value,b]),{onNativeOptionAdd:S,onNativeOptionRemove:C}=h;return jr(()=>(S(E),()=>C(E)),[S,C,E]),a.jsxs(a.Fragment,{children:[a.jsx(et.span,{id:f.textId,...l,ref:v}),f.isSelected&&c.valueNode&&!c.valueNodeHasChildren?ys.createPortal(l.children,c.valueNode):null]})});wD.displayName=Xd;var RD="SelectItemIndicator",jD=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return CD(RD,n).isSelected?a.jsx(et.span,{"aria-hidden":!0,...r,ref:t}):null});jD.displayName=RD;var c1="SelectScrollUpButton",TD=m.forwardRef((e,t)=>{const n=il(c1,e.__scopeSelect),r=fS(c1,e.__scopeSelect),[o,l]=m.useState(!1),c=dt(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const h=f.scrollTop>0;l(h)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),o?a.jsx(ND,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop-f.offsetHeight)}}):null});TD.displayName=c1;var u1="SelectScrollDownButton",_D=m.forwardRef((e,t)=>{const n=il(u1,e.__scopeSelect),r=fS(u1,e.__scopeSelect),[o,l]=m.useState(!1),c=dt(t,r.onScrollButtonChange);return jr(()=>{if(n.viewport&&n.isPositioned){let d=function(){const h=f.scrollHeight-f.clientHeight,g=Math.ceil(f.scrollTop)<h;l(g)};const f=n.viewport;return d(),f.addEventListener("scroll",d),()=>f.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),o?a.jsx(ND,{...e,ref:c,onAutoScroll:()=>{const{viewport:d,selectedItem:f}=n;d&&f&&(d.scrollTop=d.scrollTop+f.offsetHeight)}}):null});_D.displayName=u1;var ND=m.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,l=il("SelectScrollButton",n),c=m.useRef(null),d=zg(n),f=m.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return m.useEffect(()=>()=>f(),[f]),jr(()=>{var g;const h=d().find(y=>y.ref.current===document.activeElement);(g=h==null?void 0:h.ref.current)==null||g.scrollIntoView({block:"nearest"})},[d]),a.jsx(et.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:Te(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:Te(o.onPointerMove,()=>{var h;(h=l.onItemLeave)==null||h.call(l),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:Te(o.onPointerLeave,()=>{f()})})}),CX="SelectSeparator",AD=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return a.jsx(et.div,{"aria-hidden":!0,...r,ref:t})});AD.displayName=CX;var d1="SelectArrow",EX=m.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Hg(n),l=ol(d1,n),c=il(d1,n);return l.open&&c.position==="popper"?a.jsx(Pf,{...o,...r,ref:t}):null});EX.displayName=d1;var wX="SelectBubbleInput",DD=m.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=m.useRef(null),l=dt(r,o),c=dS(t);return m.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(f,"value").set;if(c!==t&&g){const y=new Event("change",{bubbles:!0});g.call(d,t),d.dispatchEvent(y)}},[c,t]),a.jsx(et.select,{...n,style:{...BN,...n.style},ref:l,defaultValue:t})});DD.displayName=wX;function OD(e){return e===""||e===void 0}function MD(e){const t=bs(e),n=m.useRef(""),r=m.useRef(0),o=m.useCallback(c=>{const d=n.current+c;t(d),(function f(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>f(""),1e3))})(d)},[t]),l=m.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,l]}function ID(e,t,n){const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,l=n?e.indexOf(n):-1;let c=RX(e,Math.max(l,0));o.length===1&&(c=c.filter(h=>h!==n));const f=c.find(h=>h.textValue.toLowerCase().startsWith(o.toLowerCase()));return f!==n?f:void 0}function RX(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var jX=iD,TX=cD,_X=dD,NX=fD,AX=hD,DX=mD,OX=vD,MX=bD,IX=ED,kX=wD,LX=jD,PX=TD,UX=_D,FX=AD;function Kr({...e}){return a.jsx(jX,{"data-slot":"select",...e})}function $g({...e}){return a.jsx(MX,{"data-slot":"select-group",...e})}function Yr({...e}){return a.jsx(_X,{"data-slot":"select-value",...e})}function Wr({className:e,size:t="default",children:n,...r}){return a.jsxs(TX,{"data-slot":"select-trigger","data-size":t,className:ne("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,a.jsx(NX,{asChild:!0,children:a.jsx(ka,{className:"size-4 opacity-50"})})]})}function Qr({className:e,children:t,position:n="popper",...r}){return a.jsx(AX,{children:a.jsxs(DX,{"data-slot":"select-content",className:ne("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[a.jsx(zX,{}),a.jsx(OX,{className:ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),a.jsx(HX,{})]})})}function Rn({className:e,children:t,...n}){return a.jsxs(IX,{"data-slot":"select-item",className:ne("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[a.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:a.jsx(LX,{children:a.jsx(lr,{className:"size-4"})})}),a.jsx(kX,{children:t})]})}function VX({className:e,...t}){return a.jsx(FX,{"data-slot":"select-separator",className:ne("bg-border pointer-events-none -mx-1 my-1 h-px",e),...t})}function zX({className:e,...t}){return a.jsx(PX,{"data-slot":"select-scroll-up-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(ns,{className:"size-4"})})}function HX({className:e,...t}){return a.jsx(UX,{"data-slot":"select-scroll-down-button",className:ne("flex cursor-default items-center justify-center py-1",e),...t,children:a.jsx(ka,{className:"size-4"})})}const $X=Jt({title:$t().min(1,"Title is required").max(100,"Title must be less than 100 characters"),storageId:$t().min(1,"Storage is required")});function BX(){const{createDataMart:e,isLoading:t,error:n}=Wo();return{handleCreate:m.useCallback(async o=>{try{return await e(o)}catch(l){return console.error(l),null}},[e]),isSubmitting:t,serverError:n}}function GX(e){const{getDataMart:t,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:o,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:h,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:v,reset:b,dataMart:E,isLoading:S,error:C,getErrorMessage:R,runs:j}=Wo();return m.useEffect(()=>(e?t(e):b(),()=>{b()}),[e,t,b]),{dataMart:E,isLoading:S,error:C,getErrorMessage:R,deleteDataMart:n,updateDataMartTitle:r,updateDataMartDescription:o,updateDataMartDefinition:l,updateDataMartSchema:c,actualizeDataMartSchema:d,publishDataMart:f,runDataMart:h,cancelDataMartRun:g,getDataMartRuns:y,loadMoreDataMartRuns:v,runs:j,getDataMart:t}}const tT=(e,t,n)=>{if(e&&"reportValidity"in e){const r=De(n,t);e.setCustomValidity(r&&r.message||""),e.reportValidity()}},f1=(e,t)=>{for(const n in t.fields){const r=t.fields[n];r&&r.ref&&"reportValidity"in r.ref?tT(r.ref,n,e):r&&r.refs&&r.refs.forEach(o=>tT(o,n,e))}},nT=(e,t)=>{t.shouldUseNativeValidation&&f1(e,t);const n={};for(const r in e){const o=De(t.fields,r),l=Object.assign(e[r]||{},{ref:o&&o.ref});if(qX(t.names||Object.keys(e),r)){const c=Object.assign({},De(n,r));Xt(c,"root",l),Xt(n,r,c)}else Xt(n,r,l)}return n},qX=(e,t)=>{const n=rT(t);return e.some(r=>rT(r).match(`^${n}\\.\\d+`))};function rT(e){return e.replace(/\]|\[/g,"")}function kD(e,t,n){function r(d,f){var h;Object.defineProperty(d,"_zod",{value:d._zod??{},enumerable:!1}),(h=d._zod).traits??(h.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 o=(n==null?void 0:n.Parent)??Object;class l extends o{}Object.defineProperty(l,"name",{value:e});function c(d){var f;const h=n!=null&&n.Parent?new l:this;r(h,d),(f=h._zod).deferred??(f.deferred=[]);for(const g of h._zod.deferred)g();return h}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:d=>{var f,h;return n!=null&&n.Parent&&d instanceof n.Parent?!0:(h=(f=d==null?void 0:d._zod)==null?void 0:f.traits)==null?void 0:h.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}class ZX extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const KX={};function LD(e){return KX}function YX(e,t){return typeof t=="bigint"?t.toString():t}const PD=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function Fm(e){return typeof e=="string"?e:e==null?void 0:e.message}function UD(e,t,n){var o,l,c,d,f,h;const r={...e,path:e.path??[]};if(!e.message){const g=Fm((c=(l=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:l.error)==null?void 0:c.call(l,e))??Fm((d=t==null?void 0:t.error)==null?void 0:d.call(t,e))??Fm((f=n.customError)==null?void 0:f.call(n,e))??Fm((h=n.localeError)==null?void 0:h.call(n,e))??"Invalid input";r.message=g}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}const FD=(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,YX,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},WX=kD("$ZodError",FD),VD=kD("$ZodError",FD,{Parent:Error}),QX=e=>(t,n,r,o)=>{const l=r?Object.assign(r,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},l);if(c instanceof Promise)throw new ZX;if(c.issues.length){const d=new((o==null?void 0:o.Err)??e)(c.issues.map(f=>UD(f,l,LD())));throw PD(d,o==null?void 0:o.callee),d}return c.value},XX=QX(VD),JX=e=>async(t,n,r,o)=>{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((o==null?void 0:o.Err)??e)(c.issues.map(f=>UD(f,l,LD())));throw PD(d,o==null?void 0:o.callee),d}return c.value},eJ=JX(VD);function aT(e,t){try{var n=e()}catch(r){return t(r)}return n&&n.then?n.then(void 0,t):n}function tJ(e,t){for(var n={};e.length;){var r=e[0],o=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:o};if("unionErrors"in r&&r.unionErrors.forEach(function(g){return g.errors.forEach(function(y){return e.push(y)})}),t){var f=n[c].types,h=f&&f[r.code];n[c]=lS(c,t,n,o,h?[].concat(h,r.message):r.message)}e.shift()}return n}function nJ(e,t){for(var n={};e.length;){var r=e[0],o=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:o};if(r.code==="invalid_union"&&r.errors.forEach(function(g){return g.forEach(function(y){return e.push(y)})}),t){var f=n[c].types,h=f&&f[r.code];n[c]=lS(c,t,n,o,h?[].concat(h,r.message):r.message)}e.shift()}return n}function ll(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,o,l){try{return Promise.resolve(aT(function(){return Promise.resolve(e[n.mode==="sync"?"parse":"parseAsync"](r,t)).then(function(c){return l.shouldUseNativeValidation&&f1({},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:nT(tJ(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,o,l){try{return Promise.resolve(aT(function(){return Promise.resolve((n.mode==="sync"?XX:eJ)(e,r,t)).then(function(c){return l.shouldUseNativeValidation&&f1({},l),{errors:{},values:n.raw?Object.assign({},r):c}})},function(c){if((function(d){return d instanceof WX})(c))return{values:{},errors:nT(nJ(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 zD=m.createContext(void 0);function rJ(){const e=m.useContext(zD);if(e===void 0)throw new Error("useDataStorageContext must be used within a DataStorageProvider");return e}var Pt=(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))(Pt||{});const aJ={dataStorages:[],currentDataStorage:null,loading:!1,error:null};function sJ(e,t){switch(t.type){case Pt.FETCH_STORAGES_START:case Pt.FETCH_STORAGE_START:case Pt.CREATE_STORAGE_START:case Pt.UPDATE_STORAGE_START:return{...e,error:null};case Pt.DELETE_STORAGE_START:return{...e,loading:!0,error:null};case Pt.FETCH_STORAGES_SUCCESS:return{...e,dataStorages:t.payload,loading:!1,error:null};case Pt.FETCH_STORAGE_SUCCESS:return{...e,currentDataStorage:t.payload,loading:!1,error:null};case Pt.CREATE_STORAGE_SUCCESS:return{...e,dataStorages:[...e.dataStorages,t.payload],loading:!1,error:null};case Pt.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 Pt.DELETE_STORAGE_SUCCESS:return{...e,dataStorages:e.dataStorages.filter(n=>n.id!==t.payload),loading:!1,error:null};case Pt.FETCH_STORAGES_ERROR:case Pt.FETCH_STORAGE_ERROR:case Pt.CREATE_STORAGE_ERROR:case Pt.UPDATE_STORAGE_ERROR:case Pt.DELETE_STORAGE_ERROR:return{...e,loading:!1,error:t.payload};case Pt.CLEAR_CURRENT_STORAGE:return{...e,currentDataStorage:null};case Pt.CLEAR_ERROR:return{...e,error:null};default:return e}}function hS({children:e}){const[t,n]=m.useReducer(sJ,aJ);return a.jsx(zD.Provider,{value:{state:t,dispatch:n},children:e})}class oJ extends ac{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 Bd=new oJ;function Bg(){const{state:e,dispatch:t}=rJ(),n=m.useCallback(async()=>{t({type:Pt.FETCH_STORAGES_START});try{const f=await Bd.getDataStorages();t({type:Pt.FETCH_STORAGES_SUCCESS,payload:f.map(cQ)})}catch(f){throw t({type:Pt.FETCH_STORAGES_ERROR,payload:Cn(f)}),f}},[t]),r=m.useCallback(async f=>{try{const h=await Bd.getDataStorageById(f),g=ap(h);t({type:Pt.FETCH_STORAGE_SUCCESS,payload:g})}catch(h){throw t({type:Pt.FETCH_STORAGE_ERROR,payload:Cn(h)}),h}},[t]),o=m.useCallback(async f=>{t({type:Pt.CREATE_STORAGE_START});try{const h=uQ(f),g=await Bd.createDataStorage(h),y=ap(g);return t({type:Pt.CREATE_STORAGE_SUCCESS,payload:y}),Ue({event:"data_storage_created",category:"DataStorage",action:"Create",label:y.type}),It.success("Storage created"),y}catch(h){return t({type:Pt.CREATE_STORAGE_ERROR,payload:Cn(h)}),null}},[t]),l=m.useCallback(async(f,h)=>{t({type:Pt.UPDATE_STORAGE_START});try{const g=lQ(h),y=await Bd.updateDataStorage(f,g),v=ap(y);return t({type:Pt.UPDATE_STORAGE_SUCCESS,payload:v}),Ue({event:"data_storage_updated",category:"DataStorage",action:"Update",label:v.type}),It.success("Storage updated"),v}catch(g){return t({type:Pt.UPDATE_STORAGE_ERROR,payload:Cn(g)}),null}},[t]),c=m.useCallback(async f=>{t({type:Pt.DELETE_STORAGE_START});try{await Bd.deleteDataStorage(f),t({type:Pt.DELETE_STORAGE_SUCCESS,payload:f}),Ue({event:"data_storage_deleted",category:"DataStorage",action:"Delete",label:f}),It.success("Storage deleted")}catch(h){throw t({type:Pt.DELETE_STORAGE_ERROR,payload:Cn(h)}),h}},[t]),d=m.useCallback(()=>{t({type:Pt.CLEAR_CURRENT_STORAGE})},[t]);return{dataStorages:e.dataStorages,currentDataStorage:e.currentDataStorage,loading:e.loading,error:e.error,fetchDataStorages:n,getDataStorageById:r,createDataStorage:o,updateDataStorage:l,deleteDataStorage:c,clearCurrentDataStorage:d}}const HD=({isOpen:e,onClose:t,onSelect:n})=>a.jsx(Qb,{open:e,onOpenChange:t,children:a.jsxs(Xb,{className:"sm:max-w-sm",children:[a.jsxs(Jb,{children:[a.jsx(eS,{children:"New Storage"}),a.jsx(tS,{children:"Choose the type of storage you want to create"})]}),a.jsx("div",{className:"flex flex-col gap-4 py-4",children:nl.getAllTypes().map(r=>{const o=r.icon,l=r.status===Do.ACTIVE;return a.jsxs(xe,{variant:"outline",className:"flex px-4 py-6",onClick:()=>void n(r.type),disabled:!l,children:[a.jsxs("span",{className:"flex flex-grow items-center gap-2",children:[a.jsx(o,{size:24}),a.jsx("span",{className:"font-medium",children:r.displayName})]}),!l&&a.jsx(gr,{variant:"secondary",children:"Coming soon"})]},r.type)})})]})});function iJ({initialData:e,onSuccess:t}){const{handleCreate:n,isSubmitting:r,serverError:o}=BX(),{dataStorages:l,loading:c,fetchDataStorages:d,createDataStorage:f,getDataStorageById:h}=Bg(),[g,y]=m.useState(!1);m.useEffect(()=>{d()},[d]);const v=Qo({resolver:ll($X),defaultValues:{title:(e==null?void 0:e.title)??"",storageId:""},mode:"onTouched"}),b=async C=>{const R=await n(C);R&&t&&t(R)},E=()=>{y(!0)},S=async C=>{try{const R=await f(C);R!=null&&R.id&&(await h(R.id),v.setValue("storageId",R.id))}catch(R){console.error("Failed to create storage:",R)}y(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(rl,{...v,children:a.jsxs(Xo,{onSubmit:C=>{v.handleSubmit(b)(C)},children:[a.jsxs(al,{variant:"light",children:[o&&a.jsx("div",{className:"rounded bg-red-100 p-3 text-red-700",children:o.message}),a.jsx(kt,{control:v.control,name:"title",render:({field:C})=>a.jsxs(_t,{children:[a.jsx(Rt,{children:"Title"}),a.jsx(Nt,{children:a.jsx(Ht,{id:"title",placeholder:"Enter title",...C,disabled:r})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:v.control,name:"storageId",render:({field:C})=>a.jsxs(_t,{children:[a.jsx(Rt,{children:"Storage"}),a.jsx(Nt,{children:a.jsxs(Kr,{onValueChange:R=>{R==="create_new"?E():C.onChange(R)},value:C.value,disabled:r||c,children:[a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{placeholder:"Select a storage"})}),a.jsx(Qr,{children:a.jsxs($g,{children:[c&&a.jsx(Rn,{value:"loading",disabled:!0,children:"Loading..."}),!c&&l.map(R=>{const j=nl.getInfo(R.type).icon;return a.jsx(Rn,{value:R.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(j,{size:20}),a.jsx("span",{children:R.title})]})},R.id)}),!c&&l.length>0&&a.jsx(VX,{}),a.jsx(Rn,{value:"create_new",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"flex h-5 w-5 items-center justify-center",children:a.jsx(Pa,{size:20})}),a.jsx("span",{children:"Create new storage"})]})})]})})]})}),a.jsx(Ft,{})]})})]}),a.jsxs(sl,{variant:"light",children:[a.jsx(xe,{type:"submit",children:"Create Data Mart"}),a.jsx(xe,{variant:"outline",type:"button",onClick:()=>{window.history.back()},children:"Go back"})]})]})}),a.jsx(HD,{isOpen:g,onClose:()=>{y(!1)},onSelect:C=>S(C)})]})}function lJ({title:e,onUpdate:t,className:n,errorMessage:r="Title cannot be empty",minWidth:o="200px"}){const[l,c]=m.useState(e),[d,f]=m.useState(!1),h=m.useRef(null);m.useEffect(()=>{c(e)},[e]),m.useEffect(()=>{h.current&&(h.current.style.height="auto",h.current.style.height=`${String(h.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(v){c(e),console.error(v)}finally{f(!1)}},y=v=>{if(v.key==="Enter"&&!v.shiftKey){if(v.preventDefault(),l.trim()===""){It.error(r),c(e);return}g()}else v.key==="Escape"&&c(e)};return a.jsx("h2",{className:ne("m-0 cursor-pointer p-0 hover:opacity-80",n),children:a.jsx(Zo,{ref:h,value:l,onChange:v=>{c(v.target.value);const b=v.target;b.style.height="auto",b.style.height=`${String(b.scrollHeight)}px`},onBlur:()=>void g(),onKeyDown:y,className:ne("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:o},disabled:d})})}var Dl=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.INCREMENTAL="INCREMENTAL",e))(Dl||{}),$D=(e=>(e.MANUAL_BACKFILL="MANUAL_BACKFILL",e.HIDE_IN_CONFIG_FORM="HIDE_IN_CONFIG_FORM",e))($D||{}),Gg="Tabs",[cJ]=cr(Gg,[bg]),BD=bg(),[uJ,mS]=cJ(Gg),GD=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:l,orientation:c="horizontal",dir:d,activationMode:f="automatic",...h}=e,g=Vf(d),[y,v]=Gr({prop:r,onChange:o,defaultProp:l??"",caller:Gg});return a.jsx(uJ,{scope:n,baseId:Ln(),value:y,onValueChange:v,orientation:c,dir:g,activationMode:f,children:a.jsx(et.div,{dir:g,"data-orientation":c,...h,ref:t})})});GD.displayName=Gg;var qD="TabsList",ZD=m.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,l=mS(qD,n),c=BD(n);return a.jsx(i4,{asChild:!0,...c,orientation:l.orientation,dir:l.dir,loop:r,children:a.jsx(et.div,{role:"tablist","aria-orientation":l.orientation,...o,ref:t})})});ZD.displayName=qD;var KD="TabsTrigger",YD=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...l}=e,c=mS(KD,n),d=BD(n),f=XD(c.baseId,r),h=JD(c.baseId,r),g=r===c.value;return a.jsx(l4,{asChild:!0,...d,focusable:!o,active:g,children:a.jsx(et.button,{type:"button",role:"tab","aria-selected":g,"aria-controls":h,"data-state":g?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:f,...l,ref:t,onMouseDown:Te(e.onMouseDown,y=>{!o&&y.button===0&&y.ctrlKey===!1?c.onValueChange(r):y.preventDefault()}),onKeyDown:Te(e.onKeyDown,y=>{[" ","Enter"].includes(y.key)&&c.onValueChange(r)}),onFocus:Te(e.onFocus,()=>{const y=c.activationMode!=="manual";!g&&!o&&y&&c.onValueChange(r)})})})});YD.displayName=KD;var WD="TabsContent",QD=m.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:l,...c}=e,d=mS(WD,n),f=XD(d.baseId,r),h=JD(d.baseId,r),g=r===d.value,y=m.useRef(g);return m.useEffect(()=>{const v=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(v)},[]),a.jsx(_r,{present:o||g,children:({present:v})=>a.jsx(et.div,{"data-state":g?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":f,hidden:!v,id:h,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:y.current?"0s":void 0},children:v&&l})})});QD.displayName=WD;function XD(e,t){return`${e}-trigger-${t}`}function JD(e,t){return`${e}-content-${t}`}var dJ=GD,fJ=ZD,hJ=YD,mJ=QD;function eO({className:e,...t}){return a.jsx(dJ,{"data-slot":"tabs",className:ne("flex flex-col gap-2",e),...t})}function tO({className:e,...t}){return a.jsx(fJ,{"data-slot":"tabs-list",className:ne("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...t})}function h1({className:e,...t}){return a.jsx(hJ,{"data-slot":"tabs-trigger",className:ne("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 pJ({className:e,...t}){return a.jsx(mJ,{"data-slot":"tabs-content",className:ne("flex-1 outline-none",e),...t})}var qg="Collapsible",[gJ,nO]=cr(qg),[yJ,pS]=gJ(qg),rO=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:l,onOpenChange:c,...d}=e,[f,h]=Gr({prop:r,defaultProp:o??!1,onChange:c,caller:qg});return a.jsx(yJ,{scope:n,disabled:l,contentId:Ln(),open:f,onOpenToggle:m.useCallback(()=>h(g=>!g),[h]),children:a.jsx(et.div,{"data-state":xS(f),"data-disabled":l?"":void 0,...d,ref:t})})});rO.displayName=qg;var aO="CollapsibleTrigger",gS=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=pS(aO,n);return a.jsx(et.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":xS(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:Te(e.onClick,o.onOpenToggle)})});gS.displayName=aO;var yS="CollapsibleContent",vS=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=pS(yS,e.__scopeCollapsible);return a.jsx(_r,{present:n||o.open,children:({present:l})=>a.jsx(vJ,{...r,ref:t,present:l})})});vS.displayName=yS;var vJ=m.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...l}=e,c=pS(yS,n),[d,f]=m.useState(r),h=m.useRef(null),g=dt(t,h),y=m.useRef(0),v=y.current,b=m.useRef(0),E=b.current,S=c.open||d,C=m.useRef(S),R=m.useRef(void 0);return m.useEffect(()=>{const j=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(j)},[]),jr(()=>{const j=h.current;if(j){R.current=R.current||{transitionDuration:j.style.transitionDuration,animationName:j.style.animationName},j.style.transitionDuration="0s",j.style.animationName="none";const _=j.getBoundingClientRect();y.current=_.height,b.current=_.width,C.current||(j.style.transitionDuration=R.current.transitionDuration,j.style.animationName=R.current.animationName),f(r)}},[c.open,r]),a.jsx(et.div,{"data-state":xS(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!S,...l,ref:g,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":E?`${E}px`:void 0,...e.style},children:S&&o})});function xS(e){return e?"open":"closed"}var sO=rO,xJ=gS,bJ=vS;const SJ=sO,CJ=gS,EJ=vS;function wJ({children:e,className:t="",...n}){return a.jsx("div",{className:ne("flex flex-1 flex-col overflow-hidden",t),...n,children:e})}function RJ({children:e,className:t="",...n}){return a.jsx("div",{className:ne("bg-muted dark:bg-sidebar flex-1 overflow-y-auto p-4",t),...n,children:a.jsx("div",{className:"flex min-h-full flex-col gap-4",children:e})})}function jJ({children:e,className:t="",variant:n="horizontal",...r}){const o=n==="vertical"?"flex flex-col gap-1.5 pt-4":"flex items-center justify-between border-t px-4 py-3";return a.jsx("div",{className:ne(o,t),...r,children:e})}function Jd({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step-item",className:ne("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 TJ({label:e,children:t,className:n="",options:r,value:o,onValueChange:l,required:c=!1,tooltip:d,...f}){return a.jsx("div",{"data-slot":"wizard-step-item-one-of",className:ne("group border-border flex flex-col gap-2 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4",n),...f,children:a.jsxs(eO,{value:o,onValueChange:l,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Hs,{required:c,tooltip:d,className:"w-full",children:e}),r.length>1&&a.jsx(tO,{children:r.map(h=>a.jsx(h1,{value:h.value,children:h.label},h.value))})]}),t]})})}function oO({title:e,children:t,defaultOpen:n=!1,className:r=""}){const[o,l]=m.useState(n);return a.jsxs(SJ,{open:o,onOpenChange:l,"data-slot":"wizard-collapsible",className:ne("group/collapsible flex flex-col gap-2 py-3",r),children:[a.jsx(CJ,{asChild:!0,children:a.jsxs("button",{type:"button",className:ne("flex cursor-pointer items-center gap-1"),children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx(La,{className:ne("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",o&&"rotate-90")})]})}),a.jsx(EJ,{className:"data-[state=open]:animate-collapsible-down data-[state=closed]:animate-collapsible-up overflow-hidden",children:a.jsx("div",{className:"flex flex-col gap-2 pt-2",children:t})})]})}function Hs({children:e,required:t=!1,tooltip:n,tooltipProps:r,className:o="",...l}){return a.jsxs(Ma,{"data-slot":"wizard-step-label",className:ne("text-foreground flex items-center justify-between gap-2 text-sm font-medium",o),...l,children:[t?a.jsxs(bt,{...r,children:[a.jsx(St,{asChild:!0,children:a.jsxs("span",{className:"flex items-center gap-1",children:[e,a.jsx("span",{className:"ml-1 text-red-500",children:"*"})]})}),a.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:"Required"})]}):a.jsx("span",{children:e}),n&&a.jsxs(bt,{...r,children:[a.jsx(St,{asChild:!0,children:a.jsx("button",{type:"button",tabIndex:-1,className:"pointer-events-none opacity-0 transition group-hover:pointer-events-auto group-hover:opacity-100","aria-label":"Help information",children:a.jsx(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors","aria-hidden":"true"})})}),a.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:n})]})]})}function Pl({title:e,children:t,className:n="",...r}){return a.jsxs("section",{"data-slot":"wizard-step-section",className:ne("mb-8",n),...r,children:[e&&a.jsx("h3",{className:"text-muted-foreground/75 mb-2 text-xs font-semibold tracking-wide uppercase",children:e}),a.jsx("div",{className:"flex flex-col gap-2",children:t})]})}function Yi({icon:e,title:t,subtitle:n,docUrl:r,variant:o="default",className:l,...c}){return o==="compact"?a.jsxs("div",{"data-slot":"wizard-step-hero",className:ne("border-border mb-6 flex items-center justify-between gap-4 border-b pb-4",l),...c,children:[a.jsxs("div",{className:"flex items-center gap-2",children:[e&&a.jsx("div",{children:e}),a.jsx("h2",{className:"text-md font-medium",children:t})]}),r!=null&&a.jsx(xe,{variant:"outline",asChild:!0,children:a.jsxs(ha,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(Uo,{className:"h-4 w-4"})]})})]}):a.jsxs("div",{"data-slot":"wizard-step-hero",className:ne("mb-6 flex flex-col items-center justify-center text-center",l),...c,children:[e&&a.jsx("div",{className:"mt-6 mb-3",children:e}),a.jsx("h2",{className:"text-xl font-medium",children:t}),n&&a.jsx("p",{className:"text-muted-foreground mt-2 text-sm",children:n}),r!=null&&a.jsx(xe,{variant:"outline",className:"mt-3 mb-6",asChild:!0,children:a.jsxs(ha,{to:r,target:"_blank",rel:"noopener noreferrer",children:["Documentation",a.jsx(Uo,{className:"h-4 w-4"})]})})]})}function Io({children:e,className:t="",...n}){return a.jsx("div",{"data-slot":"wizard-step",className:ne("space-y-4",t),...n,children:e})}function _J({children:e,className:t="",...n}){return a.jsx("div",{className:ne("grid grid-cols-1 gap-4 md:grid-cols-2",t),...n,children:e})}function NJ({icon:e,title:t,selected:n=!1,disabled:r=!1,onClick:o,onDoubleClick:l,className:c="",...d}){return a.jsxs("div",{className:ne("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:o,onDoubleClick:l,...d,children:[e&&a.jsx("span",{className:"shrink-0",children:e}),r?a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("span",{className:"cursor-not-allowed text-sm font-medium opacity-70",children:t})}),a.jsx(Ct,{side:"top",align:"center",children:"Coming soon"})]}):a.jsx("span",{className:"text-sm font-medium",children:t})]})}function iO({type:e,id:t,name:n,value:r,label:o,checked:l,selected:c=!1,disabled:d=!1,tooltip:f,rightIcon:h,onChange:g,className:y="",...v}){const b=S=>{g&&g(e==="checkbox"?S.target.checked:S.target.value)},E=m.useRef(null);return a.jsxs("div",{"data-slot":"wizard-step-card-item",onClick:S=>{if(d)return;const C=S.target;C.tagName==="INPUT"||C.tagName==="LABEL"||C.closest("label")||E.current&&E.current.click()},className:ne("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":"",y),children:[a.jsx("input",{ref:E,id:t,type:e,name:n,value:r,checked:l,disabled:d,onChange:b,className:ne("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"),...v}),o&&a.jsx(Hs,{htmlFor:t,className:ne("cursor-pointer",d&&"cursor-not-allowed"),children:o}),(f||h)&&a.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:[f&&a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx(Br,{className:"text-muted-foreground/75 pointer-events-none h-4 w-4 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100","data-tooltip-trigger":!0})}),a.jsx(Ct,{side:"top",align:"center",children:f})]}),h&&a.jsx("div",{className:"flex items-center",children:h})]})]})}function bS({variant:e="grid",items:t,className:n=""}){const r=t??(e==="grid"?12:6),o=e==="grid"?"grid grid-cols-1 gap-4 md:grid-cols-2":"flex flex-col gap-4";return a.jsx("div",{"data-slot":"wizard-step-loading",className:ne(o,n),children:Array.from({length:r}).map((l,c)=>a.jsx(hs,{className:"border-border h-12 rounded-md border-b bg-white dark:bg-white/4"},c))})}function sT(e){const t=AJ(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(OJ);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function AJ(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=IJ(o),d=MJ(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var DJ=Symbol("radix.slottable");function OJ(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===DJ}function MJ(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function IJ(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function kJ(e){const t=e+"CollectionProvider",[n,r]=cr(t),[o,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),c=S=>{const{scope:C,children:R}=S,j=ye.useRef(null),_=ye.useRef(new Map).current;return a.jsx(o,{scope:C,itemMap:_,collectionRef:j,children:R})};c.displayName=t;const d=e+"CollectionSlot",f=sT(d),h=ye.forwardRef((S,C)=>{const{scope:R,children:j}=S,_=l(d,R),D=dt(C,_.collectionRef);return a.jsx(f,{ref:D,children:j})});h.displayName=d;const g=e+"CollectionItemSlot",y="data-radix-collection-item",v=sT(g),b=ye.forwardRef((S,C)=>{const{scope:R,children:j,..._}=S,D=ye.useRef(null),A=dt(C,D),O=l(g,R);return ye.useEffect(()=>(O.itemMap.set(D,{ref:D,..._}),()=>void O.itemMap.delete(D))),a.jsx(v,{[y]:"",ref:A,children:j})});b.displayName=g;function E(S){const C=l(e+"CollectionConsumer",S);return ye.useCallback(()=>{const j=C.collectionRef.current;if(!j)return[];const _=Array.from(j.querySelectorAll(`[${y}]`));return Array.from(C.itemMap.values()).sort((O,T)=>_.indexOf(O.ref.current)-_.indexOf(T.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:c,Slot:h,ItemSlot:b},E,r]}var _s="Accordion",LJ=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[SS,PJ,UJ]=kJ(_s),[Zg]=cr(_s,[UJ,nO]),CS=nO(),lO=ye.forwardRef((e,t)=>{const{type:n,...r}=e,o=r,l=r;return a.jsx(SS.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?a.jsx(HJ,{...l,ref:t}):a.jsx(zJ,{...o,ref:t})})});lO.displayName=_s;var[cO,FJ]=Zg(_s),[uO,VJ]=Zg(_s,{collapsible:!1}),zJ=ye.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},collapsible:l=!1,...c}=e,[d,f]=Gr({prop:n,defaultProp:r??"",onChange:o,caller:_s});return a.jsx(cO,{scope:e.__scopeAccordion,value:ye.useMemo(()=>d?[d]:[],[d]),onItemOpen:f,onItemClose:ye.useCallback(()=>l&&f(""),[l,f]),children:a.jsx(uO,{scope:e.__scopeAccordion,collapsible:l,children:a.jsx(dO,{...c,ref:t})})})}),HJ=ye.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:o=()=>{},...l}=e,[c,d]=Gr({prop:n,defaultProp:r??[],onChange:o,caller:_s}),f=ye.useCallback(g=>d((y=[])=>[...y,g]),[d]),h=ye.useCallback(g=>d((y=[])=>y.filter(v=>v!==g)),[d]);return a.jsx(cO,{scope:e.__scopeAccordion,value:c,onItemOpen:f,onItemClose:h,children:a.jsx(uO,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(dO,{...l,ref:t})})})}),[$J,Kg]=Zg(_s),dO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:o,orientation:l="vertical",...c}=e,d=ye.useRef(null),f=dt(d,t),h=PJ(n),y=Vf(o)==="ltr",v=Te(e.onKeyDown,b=>{var M;if(!LJ.includes(b.key))return;const E=b.target,S=h().filter(V=>{var Z;return!((Z=V.ref.current)!=null&&Z.disabled)}),C=S.findIndex(V=>V.ref.current===E),R=S.length;if(C===-1)return;b.preventDefault();let j=C;const _=0,D=R-1,A=()=>{j=C+1,j>D&&(j=_)},O=()=>{j=C-1,j<_&&(j=D)};switch(b.key){case"Home":j=_;break;case"End":j=D;break;case"ArrowRight":l==="horizontal"&&(y?A():O());break;case"ArrowDown":l==="vertical"&&A();break;case"ArrowLeft":l==="horizontal"&&(y?O():A());break;case"ArrowUp":l==="vertical"&&O();break}const T=j%R;(M=S[T].ref.current)==null||M.focus()});return a.jsx($J,{scope:n,disabled:r,direction:o,orientation:l,children:a.jsx(SS.Slot,{scope:n,children:a.jsx(et.div,{...c,"data-orientation":l,ref:f,onKeyDown:r?void 0:v})})})}),Hp="AccordionItem",[BJ,ES]=Zg(Hp),fO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...o}=e,l=Kg(Hp,n),c=FJ(Hp,n),d=CS(n),f=Ln(),h=r&&c.value.includes(r)||!1,g=l.disabled||e.disabled;return a.jsx(BJ,{scope:n,open:h,disabled:g,triggerId:f,children:a.jsx(sO,{"data-orientation":l.orientation,"data-state":vO(h),...d,...o,ref:t,disabled:g,open:h,onOpenChange:y=>{y?c.onItemOpen(r):c.onItemClose(r)}})})});fO.displayName=Hp;var hO="AccordionHeader",mO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Kg(_s,n),l=ES(hO,n);return a.jsx(et.h3,{"data-orientation":o.orientation,"data-state":vO(l.open),"data-disabled":l.disabled?"":void 0,...r,ref:t})});mO.displayName=hO;var m1="AccordionTrigger",pO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Kg(_s,n),l=ES(m1,n),c=VJ(m1,n),d=CS(n);return a.jsx(SS.ItemSlot,{scope:n,children:a.jsx(xJ,{"aria-disabled":l.open&&!c.collapsible||void 0,"data-orientation":o.orientation,id:l.triggerId,...d,...r,ref:t})})});pO.displayName=m1;var gO="AccordionContent",yO=ye.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,o=Kg(_s,n),l=ES(gO,n),c=CS(n);return a.jsx(bJ,{role:"region","aria-labelledby":l.triggerId,"data-orientation":o.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}})});yO.displayName=gO;function vO(e){return e?"open":"closed"}var GJ=lO,qJ=fO,ZJ=mO,KJ=pO,YJ=yO;const wS={default:{itemClass:"border-b last:border-b-0",triggerClass:"focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",icon:null,chevronClass:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200",contentClass:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",contentInnerClass:"pt-0 pb-4",headerClass:"flex"},common:{itemClass:"overflow-hidden",triggerClass:"group focus-visible:ring-primary hover:bg-muted [&[data-state=open]]:bg-muted flex items-center gap-1 rounded-sm px-2 py-1 transition-all outline-none focus-visible:ring-2 [&[data-state=open]]:rounded-br-none [&[data-state=open]]:rounded-bl-none [&[data-state=open]]:font-semibold",icon:a.jsx(qk,{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}},xO=m.createContext("default");function Bn({variant:e="default",...t}){return a.jsx(xO.Provider,{value:e,children:a.jsx(GJ,{"data-slot":"accordion",...t})})}function RS(e){const t=m.useContext(xO);return e??t??"default"}function cn({className:e,variant:t,...n}){const r=RS(t),{itemClass:o}=wS[r];return a.jsx(qJ,{"data-slot":"accordion-item",className:ne(o,e),...n})}function un({className:e,children:t,variant:n,...r}){const o=RS(n),{triggerClass:l,icon:c,chevronClass:d,headerClass:f}=wS[o];return a.jsx(ZJ,{className:f,children:a.jsxs(KJ,{"data-slot":"accordion-trigger",className:ne(l,e),...r,children:[c,t,a.jsx(ka,{className:d,"aria-hidden":"true"})]})})}function dn({className:e,children:t,variant:n,...r}){const o=RS(n),{contentClass:l,contentInnerClass:c}=wS[o];return a.jsx(YJ,{"data-slot":"accordion-content",className:ne(l,e),...r,children:a.jsx("div",{className:c,children:t})})}function vn({href:e,children:t,className:n,...r}){return a.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:ne("text-muted-foreground hover:bg-muted inline-flex items-center px-1 font-medium hover:rounded-md",n),...r,children:[t,a.jsx(Uo,{className:"ml-1 inline h-3 w-3","aria-hidden":"true"})]})}function oT(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"connector-state-details",children:[a.jsx(un,{children:"What’s connector state?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"The connector state stores internal data between runs and updates automatically with each execution. It’s used to track progress and ensure consistent data processing across runs."}),a.jsx("p",{className:"mb-2",children:"Connector state is available only for connectors that support incremental runs, helping add only new or updated records since the last run without reloading existing data."}),a.jsxs("p",{className:"mb-2",children:["For more details, see the"," ",a.jsx(vn,{className:"underline",href:"https://docs.owox.com/?utm_source=owox_data_marts&utm_medium=manual_run_sheet&utm_campaign=tooltip_connector_state",children:"OWOX documentation"}),"."]})]})]})})}const Yg=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),o=new Map(r.map(y=>[y.type,y.value])),l=o.get("year")??"",c=o.get("month")??"",d=o.get("day")??"",f=o.get("hour")??"",h=o.get("minute")??"",g=o.get("second")??"";return`${l}-${c}-${d} ${f}:${h}:${g}`},Xc=e=>Yg(bO(e).toISOString()),bO=e=>{const t=e.trim();if(t.includes("T")||t.includes("Z")){const o=new Date(t);if(!isNaN(o.getTime()))return o}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},WJ=(e,t)=>{const n=t.getTime()-e.getTime(),r=Math.floor(n/1e3),o=Math.floor(r/60),l=Math.floor(o/60),c=o%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 QJ({configuration:e,connectorState:t}){const r=((e==null?void 0:e.connector.source.configuration)??[]).map((d,f)=>{const h=d;return typeof h._id=="string"?{id:h._id,index:f}:void 0}).filter(d=>!!d),o=(t==null?void 0:t.states)??[],l=new Map(o.map(d=>[d._id,d])),c=r.map(({id:d,index:f})=>{const h=l.get(d);return h?{state:h,index:f}:void 0}).filter(d=>!!d);return a.jsx(oO,{title:"State Info",children:c.length===0?a.jsxs(_t,{children:[a.jsx(Rt,{children:"Connector state"}),a.jsx(Nt,{children:a.jsx("div",{className:"bg-muted min-h-[70px] cursor-not-allowed overflow-auto rounded-md px-3 py-2 font-mono text-sm whitespace-pre-wrap opacity-70",children:"No state available"})}),a.jsx(wn,{children:a.jsx(oT,{})})]}):a.jsx(a.Fragment,{children:c.map(({state:d,index:f})=>{const h=d.at||"",g=h?Yg(bO(h).toISOString()):"—",y=d.state,v=(()=>{try{return JSON.stringify(y,null,2)}catch{return typeof y=="string"?y:'"—"'}})();return a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:`Created at ${g}`,children:`Connector state of configuration #${String(f+1)}`}),a.jsx(Nt,{children:a.jsx(jA,{value:v,displayOnly:!0,className:"bg-muted overflow-auto rounded-md text-sm",minHeightClass:"min-h-0",showCopyButton:!0})}),a.jsx(wn,{children:a.jsx(oT,{})})]},d._id)})})})}function XJ({configuration:e,onClose:t,onSubmit:n}){const[r,o]=m.useState(new Set),l=m.useId(),c=Qo({defaultValues:{runType:Dl.INCREMENTAL}}),{loading:d,loadingSpecification:f,connectorSpecification:h,fetchConnectorSpecification:g}=dc(),{dataMart:y}=Wo(),v=m.useCallback(async C=>{!r.has(C)&&!f&&(o(R=>new Set(R).add(C)),await g(C))},[r,f,g]);m.useEffect(()=>{e!=null&&e.connector.source.name&&v(e.connector.source.name)},[e,d,v]);const b=C=>{n&&n(C)},E=()=>{t&&t()},S=C=>{if(!C)return"text";switch(C){case fs.DATE:return"date";case fs.NUMBER:return"number";default:return"text"}};return f?a.jsx("div",{children:"Loading..."}):h?a.jsx(rl,{...c,children:a.jsxs(Xo,{id:l,noValidate:!0,onSubmit:C=>void c.handleSubmit(b)(C),children:[a.jsxs(al,{children:[a.jsxs(ua,{title:"General",children:[a.jsx(kt,{control:c.control,name:"runType",render:({field:C})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Select how you want to load data: incremental updates or full backfill for a period",children:"Run type"}),a.jsx(Nt,{children:a.jsxs(a.Fragment,{children:[a.jsx(XQ,{options:[{value:Dl.INCREMENTAL,label:"Incremental load"},{value:Dl.MANUAL_BACKFILL,label:"Backfill (custom period)"}],value:C.value,onChange:C.onChange,orientation:"horizontal"}),a.jsx(wn,{children:c.watch("runType")===Dl.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")===Dl.INCREMENTAL&&a.jsx(QJ,{configuration:e,connectorState:(y==null?void 0:y.connectorState)??null})]}),c.watch("runType")===Dl.MANUAL_BACKFILL&&a.jsx(ua,{title:"Run configuration",children:h.filter(C=>{var R;return(R=C.attributes)==null?void 0:R.includes($D.MANUAL_BACKFILL)}).map(C=>a.jsx(kt,{control:c.control,name:`data.${C.name}`,render:()=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:C.description,children:C.title??C.name}),a.jsx(Nt,{children:a.jsx(Ht,{id:C.name,placeholder:C.description,type:S(C.requiredType),defaultValue:typeof C.default=="string"||typeof C.default=="number"?C.default.toString():void 0,...c.register(`data.${C.name}`,{required:!0})})}),a.jsx(Ft,{})]},C.name)}))})]}),a.jsxs(sl,{children:[a.jsx(xe,{type:"submit",disabled:!c.formState.isValid||f,children:"Run"}),a.jsx(xe,{type:"button",variant:"outline",onClick:E,children:"Cancel"})]})]})}):a.jsx("div",{children:"No connector specification found"})}function JJ({isOpen:e,onClose:t,configuration:n,onSubmit:r}){return a.jsx($o,{open:e,onOpenChange:t,children:a.jsxs(Bo,{children:[a.jsx(Go,{children:a.jsx(qo,{children:"Manual Run"})}),a.jsx(XJ,{configuration:n,onClose:t,onSubmit:r})]})})}function SO({children:e,configuration:t,onManualRun:n,open:r}){const[o,l]=m.useState(r??!1),c=()=>{l(!0)},d=h=>{n(h),l(!1)},f=()=>e?a.jsx("div",{onClick:c,style:{cursor:"pointer"},children:e}):null;return a.jsxs(a.Fragment,{children:[f(),o&&a.jsx(Tu,{children:a.jsx(JJ,{isOpen:o,onClose:()=>{l(!1)},configuration:t,onSubmit:d})})]})}var Ul=(e=>(e.IDLE="IDLE",e.READY="READY",e.PROCESSING="PROCESSING",e.SUCCESS="SUCCESS",e.ERROR="ERROR",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED",e))(Ul||{});const eee=1e3;function tee(e,t){const[n,r]=m.useState(!1),[o,l]=m.useState(null),c=m.useRef(null),d=m.useRef(null),f=m.useRef(!0),h=m.useRef(t);h.current=t;const g=m.useCallback(C=>{f.current&&r(C)},[]),y=m.useCallback(C=>{f.current&&l(C)},[]),v=m.useCallback((C,R)=>{const j=C instanceof Error?C.message:"Schema actualization failed";It.dismiss(R),y(j),g(!1),c.current=null,d.current=null,It.error(j,{duration:void 0,id:R})},[y,g]),b=m.useCallback(async()=>{var R;const C=c.current;if((R=d.current)==null||R.abort(),C){It.dismiss(C);try{await sn.abortSchemaActualizeTrigger(e,C)}catch{}}c.current=null,d.current=null,g(!1)},[e,g]),E=m.useCallback(async(C,R)=>{var _;const j=D=>D===Ul.SUCCESS||D===Ul.ERROR||D===Ul.CANCELLED;for(;!R.aborted&&c.current===C;)try{const D=await sn.getSchemaActualizeTriggerStatus(e,C);if(j(D)){try{const A=await sn.getSchemaActualizeTriggerResponse(e,C);if(It.dismiss(C),A.success)(_=h.current)==null||_.call(h),It.success("Output schema actualized",{duration:void 0,id:C});else{const O=A.error??"Schema actualization failed";y(O),It.error(O,{duration:void 0,id:C})}}catch(A){const O=A instanceof Error?A.message:"Schema actualization failed";It.dismiss(C),y(O),It.error(O,{duration:void 0,id:C})}g(!1),c.current=null,d.current=null;return}await new Promise(A=>setTimeout(A,eee))}catch(D){v(D,C)}},[e,y,g,v]),S=m.useCallback(async()=>{c.current&&await b(),y(null),g(!0);try{const{triggerId:C}=await sn.createSchemaActualizeTrigger(e);It.loading("Synchronizing schema with the data storage state. This may take a while.",{duration:1/0,id:C}),c.current=C;const R=new AbortController;d.current=R;try{await E(C,R.signal)}catch(j){v(j,C)}}catch(C){g(!1),y(C instanceof Error?C.message:"Failed to start schema actualization")}},[e,b,E,y,g,v]);return m.useEffect(()=>(f.current=!0,()=>{var R;f.current=!1;const C=c.current;(R=d.current)==null||R.abort(),C&&(It.dismiss(C),sn.abortSchemaActualizeTrigger(e,C).catch(()=>{})),c.current=null,d.current=null}),[e]),{run:S,isLoading:n,cancel:b,error:o}}function nee({id:e}){const{navigate:t}=Ko(),{dataMart:n,deleteDataMart:r,updateDataMartTitle:o,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,publishDataMart:h,runDataMart:g,cancelDataMartRun:y,getDataMartRuns:v,loadMoreDataMartRuns:b,isLoading:E,error:S,getErrorMessage:C,runs:R,getDataMart:j}=GX(e),[_,D]=m.useState(!1),[A,O]=m.useState(!1),{id:T="",canPublish:M=!1,canActualizeSchema:V=!1,status:Z={code:null,displayName:"",description:""},title:K="",definition:Y=null,definitionType:G=null,validationErrors:U=[]}=n??{},H=m.useCallback(()=>{T&&j(T)},[T,j]),{run:k,isLoading:$}=tee(T,H),q=m.useCallback(async()=>{V&&await k()},[V,k]),ie=[{name:"Overview",path:"overview"},{name:"Data Setup",path:"data-setup"},{name:"Destinations",path:"reports"},{name:"Triggers",path:"triggers"},{name:"Run History",path:"run-history"}],be=m.useCallback(async W=>{T&&await o(T,W)},[T,o]),L=m.useCallback(async()=>{if(T){O(!0);try{await h(T),q()}catch(W){console.log(W instanceof Error?W.message:"Failed to publish Data Mart")}finally{O(!1)}}},[T,h,q]),P=m.useCallback(async W=>{if(T){if(Z.code!==Rr.PUBLISHED){on.error("Manual run is only available for published Data Marts");return}await g({id:T,payload:W})}},[T,Z,g]);return n?a.jsxs("div",{className:"px-12 py-6",children:[a.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-1 md:-ml-10",children:[a.jsx(pu,{onClick:()=>{t("/data-marts")},variant:"ghost",size:"sm","aria-label":"Back to Data Marts",title:"Back to Data Marts",className:"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200",children:a.jsx(M7,{className:"h-5 w-5"})}),a.jsx(lJ,{title:K,onUpdate:be,className:"text-2xl font-medium"})]}),a.jsxs("div",{className:"flex items-center gap-2"+(A?" opacity-50":""),style:{minWidth:"120px"},children:[a.jsxs("div",{className:"ml-4 flex items-center gap-2",children:[a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("div",{children:a.jsx(Wf,{type:Z.code===Rr.PUBLISHED?In.SUCCESS:In.NEUTRAL,variant:"subtle",children:Z.displayName})})}),a.jsx(Ct,{children:Z.code===Rr.PUBLISHED?"Your published Data Mart is ready for scheduled runs":"Draft Data Mart is not available for scheduled runs. Publish it to activate scheduling."})]}),Z.code===Rr.DRAFT&&a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("div",{children:a.jsxs(pu,{variant:"default",onClick:()=>{L()},disabled:A||!M,className:"ml-2 flex items-center gap-1",children:[a.jsx(ng,{className:"h-4 w-4"}),"Publish Data Mart"]})})}),!M&&a.jsxs(Ct,{children:[a.jsx("div",{children:"Cannot publish Data Mart. Fix the issues below."}),U.length>0&&a.jsx("ul",{className:"mt-1 list-disc space-y-1 pl-4",children:fY(U).map((W,te)=>a.jsx("li",{children:W},te))})]})]})]}),a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(pu,{variant:"ghost",children:a.jsx(xk,{className:"h-5 w-5"})})}),a.jsxs(fr,{align:"end",children:[G===Fe.CONNECTOR&&a.jsxs(a.Fragment,{children:[a.jsx(SO,{configuration:Y??null,onManualRun:W=>{P({runType:W.runType,data:W.data})},children:a.jsxs(pt,{onClick:W=>{W.preventDefault()},children:[a.jsx(rg,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})}),a.jsx(ma,{})]}),a.jsxs(pt,{onClick:()=>{D(!0)},children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600"}),a.jsx("span",{className:"text-red-600",children:"Delete Data Mart"})]})]})]})]})]}),a.jsx("div",{children:a.jsx("nav",{className:"-mb-px flex space-x-4 border-b","aria-label":"Tabs",role:"tablist",children:ie.map(W=>a.jsx(Nf,{to:W.path,className:({isActive:te})=>ne("border-b-2 px-4 py-2 text-sm font-medium whitespace-nowrap",te?"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:W.name},W.name))})}),a.jsx("div",{className:"pt-4",children:a.jsx(y_,{context:{dataMart:n,isLoading:E,error:S,getErrorMessage:C,updateDataMartDescription:l,updateDataMartDefinition:c,actualizeDataMartSchema:d,updateDataMartSchema:f,runDataMart:g,cancelDataMartRun:y,getDataMartRuns:v,loadMoreDataMartRuns:b,runs:R,getDataMart:j,runSchemaActualization:q,isSchemaActualizationLoading:$}})}),a.jsx(Tr,{open:_,onOpenChange:D,title:"Delete Data Mart",description:a.jsxs(a.Fragment,{children:["Are you sure you want to delete ",a.jsxs("strong",{children:['"',K,'"']}),"? This action cannot be undone."]}),confirmLabel:"Delete",cancelLabel:"Cancel",variant:"destructive",onConfirm:()=>{(async()=>{try{await r(T),D(!1),t("/data-marts")}catch(W){console.error("Failed to delete Data Mart:",W)}})()}})]}):a.jsxs("div",{className:"dm-page-content flex flex-col gap-4 py-4 md:py-8",children:[a.jsx(hs,{className:"h-16 w-full"},0),Array.from({length:3}).map((W,te)=>a.jsx(hs,{className:"h-48 w-full"},te+1))]})}function ree({description:e,onUpdate:t,className:n,placeholder:r="Add description...",minWidth:o="100%",minHeight:l="100px"}){const[c,d]=m.useState(e??""),[f,h]=m.useState(!1),[g,y]=m.useState(!1),v=m.useRef(null);m.useEffect(()=>{d(e??"")},[e]),m.useEffect(()=>{if(v.current&&f){v.current.focus();const R=v.current.value.length;v.current.setSelectionRange(R,R),b(v.current)}},[f]);const b=R=>{R.style.height="auto",R.style.height=`${String(R.scrollHeight)}px`},E=R=>{d(R.target.value),b(R.target)},S=async()=>{const R=c.trim();if(R===(e??"")){h(!1);return}try{y(!0),await t(R===""?null:R),h(!1)}catch(_){console.error("Failed to update description:",_),d(e??"")}finally{y(!1)}},C=R=>{R.key==="Enter"&&R.ctrlKey?(R.preventDefault(),S()):R.key==="Escape"&&(R.preventDefault(),d(e??""),h(!1))};return f?a.jsxs("div",{className:"w-full",children:[a.jsx(Zo,{ref:v,value:c,onChange:E,onBlur:()=>void S(),onKeyDown:C,placeholder:r,className:ne("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:o},disabled:g}),a.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[a.jsxs("span",{children:["Press"," ",a.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Ctrl+Enter"})," ","to save •"," "]}),a.jsxs("span",{children:[a.jsx("kbd",{className:"rounded border border-neutral-200 bg-neutral-100 px-1 py-0.5 font-sans dark:border-neutral-900 dark:bg-neutral-900",children:"Esc"})," ","to cancel •"," "]}),a.jsx("span",{children:"Changes are also saved when you click outside"})]})]}):a.jsx("div",{className:"flex w-full items-center gap-4 rounded-md border-b border-gray-200 bg-white transition-shadow duration-200 hover:shadow-sm dark:border-0 dark:bg-white/4",children:a.jsx("div",{onClick:()=>{h(!0)},className:ne("min-h-24 cursor-pointer rounded p-2 whitespace-pre-wrap","transition-colors duration-150",!e&&"text-gray-400 italic",n),style:{minWidth:o},children:e??r})})}function aee(){const{dataMart:e,updateDataMartDescription:t}=Ia(),n=async r=>{await t(e.id,r)};return a.jsx("div",{children:a.jsx(ree,{description:e.description,onUpdate:n,placeholder:"Add a description for this Data Mart..."})})}function iT(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 see(e){if(Array.isArray(e))return e}function oee(e,t,n){return(t=hee(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iee(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,l,c,d=[],f=!0,h=!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){h=!0,o=g}finally{try{if(!f&&n.return!=null&&(c=n.return(),Object(c)!==c))return}finally{if(h)throw o}}return d}}function lee(){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 lT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function cT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lT(Object(n),!0).forEach(function(r){oee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cee(e,t){if(e==null)return{};var n,r,o=uee(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)&&(o[n]=e[n])}return o}function uee(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 dee(e,t){return see(e)||iee(e,t)||mee(e,t)||lee()}function fee(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 hee(e){var t=fee(e,"string");return typeof t=="symbol"?t:t+""}function mee(e,t){if(e){if(typeof e=="string")return iT(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)?iT(e,t):void 0}}function pee(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function dT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?uT(Object(n),!0).forEach(function(r){pee(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):uT(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gee(){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(o,l){return l(o)},r)}}function ef(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(o,d))}}}function $p(e){return{}.toString.call(e).includes("Object")}function yee(e){return!Object.keys(e).length}function Ef(e){return typeof e=="function"}function vee(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function xee(e,t){return $p(t)||zi("changeType"),Object.keys(t).some(function(n){return!vee(e,n)})&&zi("changeField"),t}function bee(e){Ef(e)||zi("selectorType")}function See(e){Ef(e)||$p(e)||zi("handlerType"),$p(e)&&Object.values(e).some(function(t){return!Ef(t)})&&zi("handlersType")}function Cee(e){e||zi("initialIsRequired"),$p(e)||zi("initialType"),yee(e)&&zi("initialContent")}function Eee(e,t){throw new Error(e[t]||e.default)}var wee={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"},zi=ef(Eee)(wee),Vm={changes:xee,selector:bee,handler:See,initial:Cee};function Ree(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Vm.initial(e),Vm.handler(t);var n={current:e},r=ef(_ee)(n,t),o=ef(Tee)(n),l=ef(Vm.changes)(e),c=ef(jee)(n);function d(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(g){return g};return Vm.selector(h),h(n.current)}function f(h){gee(r,o,l,c)(h)}return[d,f]}function jee(e,t){return Ef(t)?t(e.current):t}function Tee(e,t){return e.current=dT(dT({},e.current),t),t}function _ee(e,t,n){return Ef(t)?t(e.current):Object.keys(n).forEach(function(r){var o;return(o=t[r])===null||o===void 0?void 0:o.call(t,e.current[r])}),n}var Nee={create:Ree},Aee={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.54.0/min/vs"}};function Dee(e){return function t(){for(var n=this,r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];return o.length>=e.length?e.apply(this,o):function(){for(var c=arguments.length,d=new Array(c),f=0;f<c;f++)d[f]=arguments[f];return t.apply(n,[].concat(o,d))}}}function Oee(e){return{}.toString.call(e).includes("Object")}function Mee(e){return e||fT("configIsRequired"),Oee(e)||fT("configType"),e.urls?(Iee(),{paths:{vs:e.urls.monacoBase}}):e}function Iee(){console.warn(CO.deprecation)}function kee(e,t){throw new Error(e[t]||e.default)}var CO={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
- `},fT=Dee(kee)(CO),Lee={config:Mee},Pee=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return function(o){return n.reduceRight(function(l,c){return c(l)},o)}};function EO(e,t){return Object.keys(t).forEach(function(n){t[n]instanceof Object&&e[n]&&Object.assign(t[n],EO(e[n],t[n]))}),cT(cT({},e),t)}var Uee={type:"cancelation",msg:"operation is manually canceled"};function n0(e){var t=!1,n=new Promise(function(r,o){e.then(function(l){return t?o(Uee):r(l)}),e.catch(o)});return n.cancel=function(){return t=!0},n}var Fee=["monaco"],Vee=Nee.create({config:Aee,isInitialized:!1,resolve:null,reject:null,monaco:null}),wO=dee(Vee,2),nh=wO[0],Wg=wO[1];function zee(e){var t=Lee.config(e),n=t.monaco,r=cee(t,Fee);Wg(function(o){return{config:EO(o.config,r),monaco:n}})}function Hee(){var e=nh(function(t){var n=t.monaco,r=t.isInitialized,o=t.resolve;return{monaco:n,isInitialized:r,resolve:o}});if(!e.isInitialized){if(Wg({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),n0(r0);if(window.monaco&&window.monaco.editor)return RO(window.monaco),e.resolve(window.monaco),n0(r0);Pee($ee,Gee)(qee)}return n0(r0)}function $ee(e){return document.body.appendChild(e)}function Bee(e){var t=document.createElement("script");return e&&(t.src=e),t}function Gee(e){var t=nh(function(r){var o=r.config,l=r.reject;return{config:o,reject:l}}),n=Bee("".concat(t.config.paths.vs,"/loader.js"));return n.onload=function(){return e()},n.onerror=t.reject,n}function qee(){var e=nh(function(n){var r=n.config,o=n.resolve,l=n.reject;return{config:r,resolve:o,reject:l}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(n){var r=n.m;RO(r),e.resolve(r)},function(n){e.reject(n)})}function RO(e){nh().monaco||Wg({monaco:e})}function Zee(){return nh(function(e){var t=e.monaco;return t})}var r0=new Promise(function(e,t){return Wg({resolve:e,reject:t})}),jO={config:zee,init:Hee,__getMonacoInstance:Zee},Kee={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},a0=Kee,Yee={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},Wee=Yee;function Qee({children:e}){return ye.createElement("div",{style:Wee.container},e)}var Xee=Qee,Jee=Xee;function ete({width:e,height:t,isEditorReady:n,loading:r,_ref:o,className:l,wrapperProps:c}){return ye.createElement("section",{style:{...a0.wrapper,width:e,height:t},...c},!n&&ye.createElement(Jee,null,r),ye.createElement("div",{ref:o,style:{...a0.fullWidth,...!n&&a0.hide},className:l}))}var tte=ete,TO=m.memo(tte);function nte(e){m.useEffect(e,[])}var _O=nte;function rte(e,t,n=!0){let r=m.useRef(!0);m.useEffect(r.current||!n?()=>{r.current=!1}:e,t)}var _a=rte;function sf(){}function lu(e,t,n,r){return ate(e,r)||ste(e,t,n,r)}function ate(e,t){return e.editor.getModel(NO(e,t))}function ste(e,t,n,r){return e.editor.createModel(t,n,r?NO(e,r):void 0)}function NO(e,t){return e.Uri.parse(t)}function ote({original:e,modified:t,language:n,originalLanguage:r,modifiedLanguage:o,originalModelPath:l,modifiedModelPath:c,keepCurrentOriginalModel:d=!1,keepCurrentModifiedModel:f=!1,theme:h="light",loading:g="Loading...",options:y={},height:v="100%",width:b="100%",className:E,wrapperProps:S={},beforeMount:C=sf,onMount:R=sf}){let[j,_]=m.useState(!1),[D,A]=m.useState(!0),O=m.useRef(null),T=m.useRef(null),M=m.useRef(null),V=m.useRef(R),Z=m.useRef(C),K=m.useRef(!1);_O(()=>{let H=jO.init();return H.then(k=>(T.current=k)&&A(!1)).catch(k=>(k==null?void 0:k.type)!=="cancelation"&&console.error("Monaco initialization: error:",k)),()=>O.current?U():H.cancel()}),_a(()=>{if(O.current&&T.current){let H=O.current.getOriginalEditor(),k=lu(T.current,e||"",r||n||"text",l||"");k!==H.getModel()&&H.setModel(k)}},[l],j),_a(()=>{if(O.current&&T.current){let H=O.current.getModifiedEditor(),k=lu(T.current,t||"",o||n||"text",c||"");k!==H.getModel()&&H.setModel(k)}},[c],j),_a(()=>{let H=O.current.getModifiedEditor();H.getOption(T.current.editor.EditorOption.readOnly)?H.setValue(t||""):t!==H.getValue()&&(H.executeEdits("",[{range:H.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),H.pushUndoStop())},[t],j),_a(()=>{var H,k;(k=(H=O.current)==null?void 0:H.getModel())==null||k.original.setValue(e||"")},[e],j),_a(()=>{let{original:H,modified:k}=O.current.getModel();T.current.editor.setModelLanguage(H,r||n||"text"),T.current.editor.setModelLanguage(k,o||n||"text")},[n,r,o],j),_a(()=>{var H;(H=T.current)==null||H.editor.setTheme(h)},[h],j),_a(()=>{var H;(H=O.current)==null||H.updateOptions(y)},[y],j);let Y=m.useCallback(()=>{var $;if(!T.current)return;Z.current(T.current);let H=lu(T.current,e||"",r||n||"text",l||""),k=lu(T.current,t||"",o||n||"text",c||"");($=O.current)==null||$.setModel({original:H,modified:k})},[n,t,o,e,r,l,c]),G=m.useCallback(()=>{var H;!K.current&&M.current&&(O.current=T.current.editor.createDiffEditor(M.current,{automaticLayout:!0,...y}),Y(),(H=T.current)==null||H.editor.setTheme(h),_(!0),K.current=!0)},[y,h,Y]);m.useEffect(()=>{j&&V.current(O.current,T.current)},[j]),m.useEffect(()=>{!D&&!j&&G()},[D,j,G]);function U(){var k,$,q,ie;let H=(k=O.current)==null?void 0:k.getModel();d||(($=H==null?void 0:H.original)==null||$.dispose()),f||((q=H==null?void 0:H.modified)==null||q.dispose()),(ie=O.current)==null||ie.dispose()}return ye.createElement(TO,{width:b,height:v,isEditorReady:j,loading:g,_ref:M,className:E,wrapperProps:S})}var ite=ote;m.memo(ite);function lte(e){let t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}var cte=lte,zm=new Map;function ute({defaultValue:e,defaultLanguage:t,defaultPath:n,value:r,language:o,path:l,theme:c="light",line:d,loading:f="Loading...",options:h={},overrideServices:g={},saveViewState:y=!0,keepCurrentModel:v=!1,width:b="100%",height:E="100%",className:S,wrapperProps:C={},beforeMount:R=sf,onMount:j=sf,onChange:_,onValidate:D=sf}){let[A,O]=m.useState(!1),[T,M]=m.useState(!0),V=m.useRef(null),Z=m.useRef(null),K=m.useRef(null),Y=m.useRef(j),G=m.useRef(R),U=m.useRef(),H=m.useRef(r),k=cte(l),$=m.useRef(!1),q=m.useRef(!1);_O(()=>{let L=jO.init();return L.then(P=>(V.current=P)&&M(!1)).catch(P=>(P==null?void 0:P.type)!=="cancelation"&&console.error("Monaco initialization: error:",P)),()=>Z.current?be():L.cancel()}),_a(()=>{var P,W,te,ue;let L=lu(V.current,e||r||"",t||o||"",l||n||"");L!==((P=Z.current)==null?void 0:P.getModel())&&(y&&zm.set(k,(W=Z.current)==null?void 0:W.saveViewState()),(te=Z.current)==null||te.setModel(L),y&&((ue=Z.current)==null||ue.restoreViewState(zm.get(l))))},[l],A),_a(()=>{var L;(L=Z.current)==null||L.updateOptions(h)},[h],A),_a(()=>{!Z.current||r===void 0||(Z.current.getOption(V.current.editor.EditorOption.readOnly)?Z.current.setValue(r):r!==Z.current.getValue()&&(q.current=!0,Z.current.executeEdits("",[{range:Z.current.getModel().getFullModelRange(),text:r,forceMoveMarkers:!0}]),Z.current.pushUndoStop(),q.current=!1))},[r],A),_a(()=>{var P,W;let L=(P=Z.current)==null?void 0:P.getModel();L&&o&&((W=V.current)==null||W.editor.setModelLanguage(L,o))},[o],A),_a(()=>{var L;d!==void 0&&((L=Z.current)==null||L.revealLine(d))},[d],A),_a(()=>{var L;(L=V.current)==null||L.editor.setTheme(c)},[c],A);let ie=m.useCallback(()=>{var L;if(!(!K.current||!V.current)&&!$.current){G.current(V.current);let P=l||n,W=lu(V.current,r||e||"",t||o||"",P||"");Z.current=(L=V.current)==null?void 0:L.editor.create(K.current,{model:W,automaticLayout:!0,...h},g),y&&Z.current.restoreViewState(zm.get(P)),V.current.editor.setTheme(c),d!==void 0&&Z.current.revealLine(d),O(!0),$.current=!0}},[e,t,n,r,o,l,h,g,y,c,d]);m.useEffect(()=>{A&&Y.current(Z.current,V.current)},[A]),m.useEffect(()=>{!T&&!A&&ie()},[T,A,ie]),H.current=r,m.useEffect(()=>{var L,P;A&&_&&((L=U.current)==null||L.dispose(),U.current=(P=Z.current)==null?void 0:P.onDidChangeModelContent(W=>{q.current||_(Z.current.getValue(),W)}))},[A,_]),m.useEffect(()=>{if(A){let L=V.current.editor.onDidChangeMarkers(P=>{var te;let W=(te=Z.current.getModel())==null?void 0:te.uri;if(W&&P.find(ue=>ue.path===W.path)){let ue=V.current.editor.getModelMarkers({resource:W});D==null||D(ue)}});return()=>{L==null||L.dispose()}}return()=>{}},[A,D]);function be(){var L,P;(L=U.current)==null||L.dispose(),v?y&&zm.set(l,Z.current.saveViewState()):(P=Z.current.getModel())==null||P.dispose(),Z.current.dispose()}return ye.createElement(TO,{width:b,height:E,isEditorReady:A,loading:f,_ref:K,className:S,wrapperProps:C})}var dte=ute,AO=m.memo(dte);function fte({initialValue:e,onChange:t}){const[n,r]=m.useState((e==null?void 0:e.sqlQuery)??""),{resolvedTheme:o}=Ob();m.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 a.jsx("div",{className:"shadow-xs",children:a.jsx(AO,{className:"overflow-hidden rounded-md border border-gray-200 dark:border-gray-200/4",height:"30vh",language:"sql",value:n,onChange:l,theme:o==="dark"?"vs-dark":"light",options:{selectOnLineNumbers:!0,hideCursorInOverviewRuler:!0,minimap:{enabled:!1},scrollBeyondLastLine:!1,overviewRulerBorder:!1}})})}function p1({icon:e,title:t,subtitle:n,rightContent:r,onClick:o,className:l}){const c=e;return a.jsxs("div",{className:ne("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",o&&"cursor-pointer dark:hover:bg-white/5",l),onClick:o,children:[a.jsxs("div",{className:"flex flex-grow items-start justify-center gap-3 px-6 py-5",children:[e&&a.jsx("div",{className:"flex items-center justify-center",children:a.jsx(c,{className:"h-6 w-6"})}),a.jsxs("div",{className:"flex flex-grow flex-col gap-1",children:[a.jsx("div",{className:"text-md font-medium",children:t}),n&&a.jsx("div",{className:"text-muted-foreground/60 text-sm",children:n})]})]}),a.jsxs("div",{className:"flex items-center justify-center gap-2 p-4",children:[r,o&&a.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:a.jsx(La,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})]})]})}var hT=1,hte=.9,mte=.8,pte=.17,s0=.1,o0=.999,gte=.9999,yte=.99,vte=/[\\\/_+.#"@\[\(\{&]/,xte=/[\\\/_+.#"@\[\(\{&]/g,bte=/[\s-]/,DO=/[\s-]/g;function g1(e,t,n,r,o,l,c){if(l===t.length)return o===e.length?hT:yte;var d=`${o},${l}`;if(c[d]!==void 0)return c[d];for(var f=r.charAt(l),h=n.indexOf(f,o),g=0,y,v,b,E;h>=0;)y=g1(e,t,n,r,h+1,l+1,c),y>g&&(h===o?y*=hT:vte.test(e.charAt(h-1))?(y*=mte,b=e.slice(o,h-1).match(xte),b&&o>0&&(y*=Math.pow(o0,b.length))):bte.test(e.charAt(h-1))?(y*=hte,E=e.slice(o,h-1).match(DO),E&&o>0&&(y*=Math.pow(o0,E.length))):(y*=pte,o>0&&(y*=Math.pow(o0,h-o))),e.charAt(h)!==t.charAt(l)&&(y*=gte)),(y<s0&&n.charAt(h-1)===r.charAt(l+1)||r.charAt(l+1)===r.charAt(l)&&n.charAt(h-1)!==r.charAt(l))&&(v=g1(e,t,n,r,h+1,l+2,c),v*s0>y&&(y=v*s0)),y>g&&(g=y),h=n.indexOf(f,h+1);return c[d]=g,g}function mT(e){return e.toLowerCase().replace(DO," ")}function Ste(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,g1(e,t,mT(e),mT(t),0,0,{})}var Gd='[cmdk-group=""]',i0='[cmdk-group-items=""]',Cte='[cmdk-group-heading=""]',OO='[cmdk-item=""]',pT=`${OO}:not([aria-disabled="true"])`,y1="cmdk-item-select",au="data-value",Ete=(e,t,n)=>Ste(e,t,n),MO=m.createContext(void 0),rh=()=>m.useContext(MO),IO=m.createContext(void 0),jS=()=>m.useContext(IO),kO=m.createContext(void 0),LO=m.forwardRef((e,t)=>{let n=su(()=>{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=su(()=>new Set),o=su(()=>new Map),l=su(()=>new Map),c=su(()=>new Set),d=PO(e),{label:f,children:h,value:g,onValueChange:y,filter:v,shouldFilter:b,loop:E,disablePointerSelection:S=!1,vimBindings:C=!0,...R}=e,j=Ln(),_=Ln(),D=Ln(),A=m.useRef(null),O=Ite();Ql(()=>{if(g!==void 0){let P=g.trim();n.current.value=P,T.emit()}},[g]),Ql(()=>{O(6,G)},[]);let T=m.useMemo(()=>({subscribe:P=>(c.current.add(P),()=>c.current.delete(P)),snapshot:()=>n.current,setState:(P,W,te)=>{var ue,ve,le,Ae;if(!Object.is(n.current[P],W)){if(n.current[P]=W,P==="search")Y(),Z(),O(1,K);else if(P==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let we=document.getElementById(D);we?we.focus():(ue=document.getElementById(j))==null||ue.focus()}if(O(7,()=>{var we;n.current.selectedItemId=(we=U())==null?void 0:we.id,T.emit()}),te||O(5,G),((ve=d.current)==null?void 0:ve.value)!==void 0){let we=W??"";(Ae=(le=d.current).onValueChange)==null||Ae.call(le,we);return}}T.emit()}},emit:()=>{c.current.forEach(P=>P())}}),[]),M=m.useMemo(()=>({value:(P,W,te)=>{var ue;W!==((ue=l.current.get(P))==null?void 0:ue.value)&&(l.current.set(P,{value:W,keywords:te}),n.current.filtered.items.set(P,V(W,te)),O(2,()=>{Z(),T.emit()}))},item:(P,W)=>(r.current.add(P),W&&(o.current.has(W)?o.current.get(W).add(P):o.current.set(W,new Set([P]))),O(3,()=>{Y(),Z(),n.current.value||K(),T.emit()}),()=>{l.current.delete(P),r.current.delete(P),n.current.filtered.items.delete(P);let te=U();O(4,()=>{Y(),(te==null?void 0:te.getAttribute("id"))===P&&K(),T.emit()})}),group:P=>(o.current.has(P)||o.current.set(P,new Set),()=>{l.current.delete(P),o.current.delete(P)}),filter:()=>d.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:j,inputId:D,labelId:_,listInnerRef:A}),[]);function V(P,W){var te,ue;let ve=(ue=(te=d.current)==null?void 0:te.filter)!=null?ue:Ete;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(ue=>{let ve=o.current.get(ue),le=0;ve.forEach(Ae=>{let we=P.get(Ae);le=Math.max(we,le)}),W.push([ue,le])});let te=A.current;H().sort((ue,ve)=>{var le,Ae;let we=ue.getAttribute("id"),Ne=ve.getAttribute("id");return((le=P.get(Ne))!=null?le:0)-((Ae=P.get(we))!=null?Ae:0)}).forEach(ue=>{let ve=ue.closest(i0);ve?ve.appendChild(ue.parentElement===ve?ue:ue.closest(`${i0} > *`)):te.appendChild(ue.parentElement===te?ue:ue.closest(`${i0} > *`))}),W.sort((ue,ve)=>ve[1]-ue[1]).forEach(ue=>{var ve;let le=(ve=A.current)==null?void 0:ve.querySelector(`${Gd}[${au}="${encodeURIComponent(ue[0])}"]`);le==null||le.parentElement.appendChild(le)})}function K(){let P=H().find(te=>te.getAttribute("aria-disabled")!=="true"),W=P==null?void 0:P.getAttribute(au);T.setState("value",W||void 0)}function Y(){var P,W,te,ue;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 Ae=(W=(P=l.current.get(le))==null?void 0:P.value)!=null?W:"",we=(ue=(te=l.current.get(le))==null?void 0:te.keywords)!=null?ue:[],Ne=V(Ae,we);n.current.filtered.items.set(le,Ne),Ne>0&&ve++}for(let[le,Ae]of o.current)for(let we of Ae)if(n.current.filtered.items.get(we)>0){n.current.filtered.groups.add(le);break}n.current.filtered.count=ve}function G(){var P,W,te;let ue=U();ue&&(((P=ue.parentElement)==null?void 0:P.firstChild)===ue&&((te=(W=ue.closest(Gd))==null?void 0:W.querySelector(Cte))==null||te.scrollIntoView({block:"nearest"})),ue.scrollIntoView({block:"nearest"}))}function U(){var P;return(P=A.current)==null?void 0:P.querySelector(`${OO}[aria-selected="true"]`)}function H(){var P;return Array.from(((P=A.current)==null?void 0:P.querySelectorAll(pT))||[])}function k(P){let W=H()[P];W&&T.setState("value",W.getAttribute(au))}function $(P){var W;let te=U(),ue=H(),ve=ue.findIndex(Ae=>Ae===te),le=ue[ve+P];(W=d.current)!=null&&W.loop&&(le=ve+P<0?ue[ue.length-1]:ve+P===ue.length?ue[0]:ue[ve+P]),le&&T.setState("value",le.getAttribute(au))}function q(P){let W=U(),te=W==null?void 0:W.closest(Gd),ue;for(;te&&!ue;)te=P>0?Ote(te,Gd):Mte(te,Gd),ue=te==null?void 0:te.querySelector(pT);ue?T.setState("value",ue.getAttribute(au)):$(P)}let ie=()=>k(H().length-1),be=P=>{P.preventDefault(),P.metaKey?ie():P.altKey?q(1):$(1)},L=P=>{P.preventDefault(),P.metaKey?k(0):P.altKey?q(-1):$(-1)};return m.createElement(et.div,{ref:t,tabIndex:-1,...R,"cmdk-root":"",onKeyDown:P=>{var W;(W=R.onKeyDown)==null||W.call(R,P);let te=P.nativeEvent.isComposing||P.keyCode===229;if(!(P.defaultPrevented||te))switch(P.key){case"n":case"j":{C&&P.ctrlKey&&be(P);break}case"ArrowDown":{be(P);break}case"p":case"k":{C&&P.ctrlKey&&L(P);break}case"ArrowUp":{L(P);break}case"Home":{P.preventDefault(),k(0);break}case"End":{P.preventDefault(),ie();break}case"Enter":{P.preventDefault();let ue=U();if(ue){let ve=new Event(y1);ue.dispatchEvent(ve)}}}}},m.createElement("label",{"cmdk-label":"",htmlFor:M.inputId,id:M.labelId,style:Lte},f),Qg(e,P=>m.createElement(IO.Provider,{value:T},m.createElement(MO.Provider,{value:M},P))))}),wte=m.forwardRef((e,t)=>{var n,r;let o=Ln(),l=m.useRef(null),c=m.useContext(kO),d=rh(),f=PO(e),h=(r=(n=f.current)==null?void 0:n.forceMount)!=null?r:c==null?void 0:c.forceMount;Ql(()=>{if(!h)return d.item(o,c==null?void 0:c.id)},[h]);let g=UO(o,l,[e.value,e.children,l],e.keywords),y=jS(),v=Wi(O=>O.value&&O.value===g.current),b=Wi(O=>h||d.filter()===!1?!0:O.search?O.filtered.items.get(o)>0:!0);m.useEffect(()=>{let O=l.current;if(!(!O||e.disabled))return O.addEventListener(y1,E),()=>O.removeEventListener(y1,E)},[b,e.onSelect,e.disabled]);function E(){var O,T;S(),(T=(O=f.current).onSelect)==null||T.call(O,g.current)}function S(){y.setState("value",g.current,!0)}if(!b)return null;let{disabled:C,value:R,onSelect:j,forceMount:_,keywords:D,...A}=e;return m.createElement(et.div,{ref:Pr(l,t),...A,id:o,"cmdk-item":"",role:"option","aria-disabled":!!C,"aria-selected":!!v,"data-disabled":!!C,"data-selected":!!v,onPointerMove:C||d.getDisablePointerSelection()?void 0:S,onClick:C?void 0:E},e.children)}),Rte=m.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:o,...l}=e,c=Ln(),d=m.useRef(null),f=m.useRef(null),h=Ln(),g=rh(),y=Wi(b=>o||g.filter()===!1?!0:b.search?b.filtered.groups.has(c):!0);Ql(()=>g.group(c),[]),UO(c,d,[e.value,e.heading,f]);let v=m.useMemo(()=>({id:c,forceMount:o}),[o]);return m.createElement(et.div,{ref:Pr(d,t),...l,"cmdk-group":"",role:"presentation",hidden:y?void 0:!0},n&&m.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Qg(e,b=>m.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},m.createElement(kO.Provider,{value:v},b))))}),jte=m.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,o=m.useRef(null),l=Wi(c=>!c.search);return!n&&!l?null:m.createElement(et.div,{ref:Pr(o,t),...r,"cmdk-separator":"",role:"separator"})}),Tte=m.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,o=e.value!=null,l=jS(),c=Wi(h=>h.search),d=Wi(h=>h.selectedItemId),f=rh();return m.useEffect(()=>{e.value!=null&&l.setState("search",e.value)},[e.value]),m.createElement(et.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":d,id:f.inputId,type:"text",value:o?e.value:c,onChange:h=>{o||l.setState("search",h.target.value),n==null||n(h.target.value)}})}),_te=m.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,l=m.useRef(null),c=m.useRef(null),d=Wi(h=>h.selectedItemId),f=rh();return m.useEffect(()=>{if(c.current&&l.current){let h=c.current,g=l.current,y,v=new ResizeObserver(()=>{y=requestAnimationFrame(()=>{let b=h.offsetHeight;g.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return v.observe(h),()=>{cancelAnimationFrame(y),v.unobserve(h)}}},[]),m.createElement(et.div,{ref:Pr(l,t),...o,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":r,id:f.listId},Qg(e,h=>m.createElement("div",{ref:Pr(c,f.listInnerRef),"cmdk-list-sizer":""},h)))}),Nte=m.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:l,container:c,...d}=e;return m.createElement(cg,{open:n,onOpenChange:r},m.createElement(ug,{container:c},m.createElement(dg,{"cmdk-overlay":"",className:o}),m.createElement(fg,{"aria-label":e.label,"cmdk-dialog":"",className:l},m.createElement(LO,{ref:t,...d}))))}),Ate=m.forwardRef((e,t)=>Wi(n=>n.filtered.count===0)?m.createElement(et.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),Dte=m.forwardRef((e,t)=>{let{progress:n,children:r,label:o="Loading...",...l}=e;return m.createElement(et.div,{ref:t,...l,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},Qg(e,c=>m.createElement("div",{"aria-hidden":!0},c)))}),$u=Object.assign(LO,{List:_te,Item:wte,Input:Tte,Group:Rte,Separator:jte,Dialog:Nte,Empty:Ate,Loading:Dte});function Ote(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Mte(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function PO(e){let t=m.useRef(e);return Ql(()=>{t.current=e}),t}var Ql=typeof window>"u"?m.useEffect:m.useLayoutEffect;function su(e){let t=m.useRef();return t.current===void 0&&(t.current=e()),t}function Wi(e){let t=jS(),n=()=>e(t.snapshot());return m.useSyncExternalStore(t.subscribe,n,n)}function UO(e,t,n,r=[]){let o=m.useRef(),l=rh();return Ql(()=>{var c;let d=(()=>{var h;for(let g of n){if(typeof g=="string")return g.trim();if(typeof g=="object"&&"current"in g)return g.current?(h=g.current.textContent)==null?void 0:h.trim():o.current}})(),f=r.map(h=>h.trim());l.value(e,d,f),(c=t.current)==null||c.setAttribute(au,d),o.current=d}),o}var Ite=()=>{let[e,t]=m.useState(),n=su(()=>new Map);return Ql(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,o)=>{n.current.set(r,o),t({})}};function kte(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Qg({asChild:e,children:t},n){return e&&m.isValidElement(t)?m.cloneElement(kte(t),{ref:t.ref},n(t.props.children)):n(t)}var Lte={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function FO({className:e,...t}){return a.jsx($u,{"data-slot":"command",className:ne("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...t})}function VO({className:e,...t}){return a.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[a.jsx(Jl,{className:"size-4 shrink-0 opacity-50"}),a.jsx($u.Input,{"data-slot":"command-input",className:ne("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 Pte({className:e,...t}){return a.jsx($u.List,{"data-slot":"command-list",className:ne("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function zO({...e}){return a.jsx($u.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function HO({className:e,...t}){return a.jsx($u.Group,{"data-slot":"command-group",className:ne("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 $O({className:e,...t}){return a.jsx($u.Item,{"data-slot":"command-item",className:ne("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function Ute(e){const t=Fte(e),n=m.forwardRef((r,o)=>{const{children:l,...c}=r,d=m.Children.toArray(l),f=d.find(zte);if(f){const h=f.props.children,g=d.map(y=>y===f?m.Children.count(h)>1?m.Children.only(null):m.isValidElement(h)?h.props.children:null:y);return a.jsx(t,{...c,ref:o,children:m.isValidElement(h)?m.cloneElement(h,void 0,g):null})}return a.jsx(t,{...c,ref:o,children:l})});return n.displayName=`${e}.Slot`,n}function Fte(e){const t=m.forwardRef((n,r)=>{const{children:o,...l}=n;if(m.isValidElement(o)){const c=$te(o),d=Hte(l,o.props);return o.type!==m.Fragment&&(d.ref=r?Pr(r,c):c),m.cloneElement(o,d)}return m.Children.count(o)>1?m.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Vte=Symbol("radix.slottable");function zte(e){return m.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Vte}function Hte(e,t){const n={...t};for(const r in t){const o=e[r],l=t[r];/^on[A-Z]/.test(r)?o&&l?n[r]=(...d)=>{const f=l(...d);return o(...d),f}:o&&(n[r]=o):r==="style"?n[r]={...o,...l}:r==="className"&&(n[r]=[o,l].filter(Boolean).join(" "))}return{...e,...n}}function $te(e){var r,o;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=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Xg="Popover",[BO]=cr(Xg,[eo]),ah=eo(),[Bte,cl]=BO(Xg),GO=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:l,modal:c=!1}=e,d=ah(t),f=m.useRef(null),[h,g]=m.useState(!1),[y,v]=Gr({prop:r,defaultProp:o??!1,onChange:l,caller:Xg});return a.jsx(ku,{...d,children:a.jsx(Bte,{scope:t,contentId:Ln(),triggerRef:f,open:y,onOpenChange:v,onOpenToggle:m.useCallback(()=>v(b=>!b),[v]),hasCustomAnchor:h,onCustomAnchorAdd:m.useCallback(()=>g(!0),[]),onCustomAnchorRemove:m.useCallback(()=>g(!1),[]),modal:c,children:n})})};GO.displayName=Xg;var qO="PopoverAnchor",Gte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(qO,n),l=ah(n),{onCustomAnchorAdd:c,onCustomAnchorRemove:d}=o;return m.useEffect(()=>(c(),()=>d()),[c,d]),a.jsx(Lu,{...l,...r,ref:t})});Gte.displayName=qO;var ZO="PopoverTrigger",KO=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(ZO,n),l=ah(n),c=dt(t,o.triggerRef),d=a.jsx(et.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":JO(o.open),...r,ref:c,onClick:Te(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?d:a.jsx(Lu,{asChild:!0,...l,children:d})});KO.displayName=ZO;var TS="PopoverPortal",[qte,Zte]=BO(TS,{forceMount:void 0}),YO=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,l=cl(TS,t);return a.jsx(qte,{scope:t,forceMount:n,children:a.jsx(_r,{present:n||l.open,children:a.jsx(tc,{asChild:!0,container:o,children:r})})})};YO.displayName=TS;var _u="PopoverContent",WO=m.forwardRef((e,t)=>{const n=Zte(_u,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,l=cl(_u,e.__scopePopover);return a.jsx(_r,{present:r||l.open,children:l.modal?a.jsx(Yte,{...o,ref:t}):a.jsx(Wte,{...o,ref:t})})});WO.displayName=_u;var Kte=Ute("PopoverContent.RemoveScroll"),Yte=m.forwardRef((e,t)=>{const n=cl(_u,e.__scopePopover),r=m.useRef(null),o=dt(t,r),l=m.useRef(!1);return m.useEffect(()=>{const c=r.current;if(c)return ig(c)},[]),a.jsx(If,{as:Kte,allowPinchZoom:!0,children:a.jsx(QO,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Te(e.onCloseAutoFocus,c=>{var d;c.preventDefault(),l.current||(d=n.triggerRef.current)==null||d.focus()}),onPointerDownOutside:Te(e.onPointerDownOutside,c=>{const d=c.detail.originalEvent,f=d.button===0&&d.ctrlKey===!0,h=d.button===2||f;l.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Te(e.onFocusOutside,c=>c.preventDefault(),{checkForDefaultPrevented:!1})})})}),Wte=m.forwardRef((e,t)=>{const n=cl(_u,e.__scopePopover),r=m.useRef(!1),o=m.useRef(!1);return a.jsx(QO,{...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,o.current=!1},onInteractOutside:l=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,l),l.defaultPrevented||(r.current=!0,l.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const c=l.target;((h=n.triggerRef.current)==null?void 0:h.contains(c))&&l.preventDefault(),l.detail.originalEvent.type==="focusin"&&o.current&&l.preventDefault()}})}),QO=m.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onInteractOutside:g,...y}=e,v=cl(_u,n),b=ah(n);return sg(),a.jsx(Mf,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:l,children:a.jsx(ec,{asChild:!0,disableOutsidePointerEvents:c,onInteractOutside:g,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:h,onDismiss:()=>v.onOpenChange(!1),children:a.jsx(Lf,{"data-state":JO(v.open),role:"dialog",id:v.contentId,...b,...y,ref:t,style:{...y.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)"}})})})}),XO="PopoverClose",Qte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=cl(XO,n);return a.jsx(et.button,{type:"button",...r,ref:t,onClick:Te(e.onClick,()=>o.onOpenChange(!1))})});Qte.displayName=XO;var Xte="PopoverArrow",Jte=m.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ah(n);return a.jsx(Pf,{...o,...r,ref:t})});Jte.displayName=Xte;function JO(e){return e?"open":"closed"}var ene=GO,tne=KO,nne=YO,rne=WO;function _S({...e}){return a.jsx(ene,{"data-slot":"popover",...e})}function NS({...e}){return a.jsx(tne,{"data-slot":"popover-trigger",...e})}function AS({className:e,align:t="center",sideOffset:n=4,...r}){return a.jsx(nne,{children:a.jsx(rne,{"data-slot":"popover-content",align:t,sideOffset:n,className:ne("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 DS({options:e,value:t,onValueChange:n,placeholder:r="Select an option",emptyMessage:o="No results found.",className:l,disabled:c=!1}){const[d,f]=m.useState(!1),[h,g]=m.useState(""),y=m.useMemo(()=>{const E={};return e.forEach(S=>{const C=S.group??"";Object.prototype.hasOwnProperty.call(E,C)||(E[C]=[]),E[C].push(S)}),E},[e]),v=e.find(E=>E.value===t),b=m.useCallback(E=>{n(E),requestAnimationFrame(()=>{g(""),f(!1)})},[n]);return a.jsxs(_S,{open:d,onOpenChange:f,modal:!0,children:[a.jsx(NS,{asChild:!0,children:a.jsxs(xe,{variant:"outline",role:"combobox","aria-expanded":d,className:ne("w-full justify-between",!t&&"text-muted-foreground",l),disabled:c,children:[v?v.label:r,a.jsx($1,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),a.jsx(AS,{className:"max-h-[300px] min-w-[300px] overflow-auto p-0",align:"start",sideOffset:5,children:a.jsxs(FO,{children:[a.jsx(VO,{placeholder:`Search ${r.toLowerCase()}...`,value:h,onValueChange:g}),a.jsx(zO,{children:o}),Object.entries(y).map(([E,S])=>a.jsx(HO,{heading:E,children:S.map(C=>a.jsxs($O,{value:C.value,onSelect:()=>{b(C.value)},keywords:[C.label],children:[a.jsx(lr,{className:ne("mr-2 h-4 w-4",t===C.value?"opacity-100":"opacity-0")}),C.label]},C.value))},E||"default"))]})})]})}function ane(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"service-account-details",children:[a.jsx(un,{children:"How do I get a Service Account JSON key?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"}),"."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Assign the ",a.jsx("strong",{children:"bigquery.dataEditor"})," and ",a.jsx("strong",{children:"bigquery.jobUser"})," ","roles to this service account to allow read, write, and create access to your project resources."]}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function sne(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"project-id-details",children:[a.jsx(un,{children:"How do I find my Project ID?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"This is the ID of your Google Cloud project. BigQuery usage costs will be charged to this project."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your billing project ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/",children:"Google Cloud Console"})," ","and sign in with your Google account."]}),a.jsx("li",{children:'Click the project selector dropdown at the top of the page (it shows the current project name or "Select a project").'}),a.jsxs("li",{children:["Find your project in the list. The ",a.jsx("strong",{children:"Project ID"})," is shown in the ID column."]}),a.jsx("li",{children:"If you don't see your project, use the search box to find it by name or ID."})]})]})]})})}function one(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"gbq-location-details",children:[a.jsx(un,{children:"How do I find my dataset location?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"BigQuery data is stored in specific regions. To avoid query errors, your SQL queries must process data stored in the same location."}),a.jsx("p",{className:"mb-2",children:"Here's how to check your dataset location:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/bigquery",children:"Google Cloud Console BigQuery page"}),"."]}),a.jsx("li",{children:"In the left panel, expand your project and find your datasets."}),a.jsxs("li",{children:["Click each dataset name to open its details. The ",a.jsx("strong",{children:"Data location"})," field shows the region where that dataset is stored (for example,"," ",a.jsx("code",{className:"text-sm font-semibold",children:"US"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"EU"}),","," ",a.jsx("code",{className:"text-sm font-semibold",children:"asia-northeast1"}),")."]}),a.jsx("li",{children:"Make sure all your datasets are stored in the same location. If they are in different locations, select the location where most of your data is stored or create separate Storage for each location."}),a.jsx("li",{children:"Put this location value in the field above."})]})]})]})})}const e5=e=>{try{const t=JSON.parse(e),{project_id:n,client_id:r,client_email:o}=t;return!n||!r||!o?null:{url:`https://console.cloud.google.com/iam-admin/serviceaccounts/details/${r}?project=${n}`,email:o}}catch{return null}},ine=({form:e})=>{const[t,n]=m.useState(!1);if(e.watch("type")!==ke.GOOGLE_BIGQUERY)return null;const r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},o=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?e5(l):null;return a.jsxs(a.Fragment,{children:[a.jsxs(ua,{title:"Connection Settings",children:[a.jsx(kt,{control:e.control,name:"config.projectId",render:({field:d})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Enter the ID of your Google Cloud project where BigQuery usage will be billed",children:"Project ID"}),a.jsx(Nt,{children:a.jsx(Ht,{...d,placeholder:"Enter a Project Id"})}),a.jsx(wn,{children:a.jsx(sne,{})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:e.control,name:"config.location",render:({field:d})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Choose the same region where your BigQuery data is stored to ensure queries work correctly",children:"Location"}),a.jsx(Nt,{children:a.jsx(DS,{options:UZ,value:d.value,onValueChange:d.onChange,placeholder:"Select a location",emptyMessage:"No locations found",className:"w-full"})}),a.jsx(wn,{children:a.jsx(one,{})}),a.jsx(Ft,{})]})})]}),a.jsx(ua,{title:"Authentication",children:a.jsx(kt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>a.jsxs(_t,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Rt,{tooltip:"Paste a JSON key from a service account that has access to the selected storage provider",children:"Service Account"}),!t&&l&&a.jsx(xe,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(xe,{variant:"ghost",size:"sm",onClick:o,type:"button",children:"Cancel"})]}),a.jsx(Nt,{children:!t&&c?a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx(vn,{href:c.url,children:c.email})}),a.jsx(Ct,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Zo,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(wn,{children:a.jsx(ane,{})}),a.jsx(Ft,{})]})})})]})};function lne(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"athena-region-details",children:[a.jsx(un,{children:"How do I find my Athena region?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"Athena queries run in a specific AWS region. You must select the region where your Athena service and data are located."}),a.jsx("p",{className:"mb-2",children:"Here's how to find your Athena region:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"}),"."]}),a.jsx("li",{children:"Look at the top right corner of the console. The selected region is shown in the region selector dropdown."}),a.jsx("li",{children:"Make sure to copy and paste the same region here in the form to avoid connection or query errors."})]})]})]})})}function cne(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"athena-output-bucket-details",children:[a.jsx(un,{children:"How do I find a bucket?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["Athena saves query results in an ",a.jsx("strong",{children:"S3 bucket"}),". You need to specify the bucket used for query output."]}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an S3 bucket for Athena output:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/s3/",children:"the AWS S3 console"}),"."]}),a.jsx("li",{children:"Look for an existing bucket used for Athena query results, or create a new one."}),a.jsx("li",{children:"If creating a new bucket, make sure it is in the same region as your Athena service."}),a.jsx("li",{children:"Enter the bucket name in this form field."})]})]})]})})}function une(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"athena-access-key-id-details",children:[a.jsx(un,{children:"How do I get my AWS Access Key ID?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"Before accessing your AWS Access Key ID, make sure you have a user with the necessary permissions to use Athena and Glue in your AWS account."}),a.jsxs("p",{className:"mb-4 text-sm",children:["Learn more about how to create a user in AWS ",a.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/?utm_source=owox_data_marts&utm_medium=storage_enity&utm_campaign=tooltip_aws",children:"in documentation"}),"."]}),a.jsx(Z_,{className:"my-4"}),a.jsx("p",{className:"mb-2",children:"The Access Key ID is part of your AWS credentials needed to connect and authenticate."}),a.jsx("p",{className:"mb-2",children:"Here's how to find or create an Access Key ID:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", find your existing keys or create a new access key."]}),a.jsx("li",{children:"When you create a new key, download and securely store the Access Key ID and Secret Access Key."})]})]})]})})}function dne(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"athena-secret-access-key-details",children:[a.jsx(un,{children:"How do I get my AWS Secret Access Key?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"The Secret Access Key is part of your AWS credentials needed to connect and authenticate. It is only shown when you create a new key."}),a.jsx("p",{className:"mb-2",children:"Here's how to get your Secret Access Key:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/iam/home#/security_credentials",children:"the AWS IAM Security Credentials page"}),"."]}),a.jsxs("li",{children:["Under ",a.jsx("strong",{children:"Access keys"}),", create a new access key if you don't have one or lost the secret key."]}),a.jsx("li",{children:"When you create a new key, copy and securely store the Secret Access Key — you won't be able to see it again."})]})]})]})})}const fne=({form:e})=>{const[t,n]=m.useState("");return m.useEffect(()=>{const r=e.getValues("credentials.accessKeyId");if(r){const o="_".repeat(r.length);n(o),e.setValue("credentials.secretAccessKey",o,{shouldDirty:!1})}},[e]),e.watch("type")!==ke.AWS_ATHENA?null:a.jsxs(a.Fragment,{children:[a.jsxs(ua,{title:"Connection Settings",children:[a.jsx(kt,{control:e.control,name:"config.region",render:({field:r})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Enter the AWS region where your Athena service is active",children:"Region"}),a.jsx(Nt,{children:a.jsx(Ht,{...r,placeholder:"Enter a region"})}),a.jsx(wn,{children:a.jsx(lne,{})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:e.control,name:"config.outputBucket",render:({field:r})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Specify the S3 bucket where Athena query results will be stored",children:"Output Bucket"}),a.jsx(Nt,{children:a.jsx(Ht,{...r,placeholder:"Enter an output bucket"})}),a.jsx(wn,{children:a.jsx(cne,{})}),a.jsx(Ft,{})]})})]}),a.jsxs(ua,{title:"Authentication",children:[a.jsx(kt,{control:e.control,name:"credentials.accessKeyId",render:({field:r})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Your AWS Access Key ID used for authentication",children:"Access Key ID"}),a.jsx(Nt,{children:a.jsx(Ht,{...r,placeholder:"Enter an access key id"})}),a.jsx(wn,{children:a.jsx(une,{})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:e.control,name:"credentials.secretAccessKey",render:({field:r})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Your AWS Secret Access Key used for authentication",children:"Secret Access Key"}),a.jsx(Nt,{children:a.jsx(Ht,{...r,type:"password",placeholder:t||"Enter a secret access key"})}),a.jsx(wn,{children:a.jsx(dne,{})}),a.jsx(Ft,{})]})})]})]})};function hne(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"bigquery-api-details",children:[a.jsx(un,{children:"How do I enable the BigQuery API?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["To run queries and process data in Google BigQuery, you need to enable the"," ",a.jsx(vn,{className:"underline",href:"https://console.cloud.google.com/apis/library/bigquery.googleapis.com",children:"BigQuery API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})})}function mne(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"athena-api-details",children:[a.jsx(un,{children:"How do I activate Athena API?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"AWS Athena is a serverless interactive query service. To use it, you need to activate Athena in your AWS account."}),a.jsx("p",{className:"mb-2",children:"Here's how to activate Athena:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open"," ",a.jsx(vn,{className:"underline",href:"https://console.aws.amazon.com/athena/",children:"the AWS Athena console"})," ","and sign in to your AWS account."]}),a.jsx("li",{children:"If you haven't used Athena before, you may need to set up a query result location (an S3 bucket)."}),a.jsx("li",{children:"You can start running queries immediately after setup."})]})]})]})})}function t5(e){return JSON.parse(JSON.stringify(e))}function pne({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const o=Qo({resolver:ll(rK),defaultValues:e}),{watch:l,control:c,formState:{isDirty:d,isSubmitting:f}}=o,h=l("type");ye.useEffect(()=>{r==null||r(d)},[d,r]);const g=async y=>{const{dirtyFields:v}=o.formState,b=t5(y);return v.credentials||delete b.credentials,t(b)};return a.jsx(rl,{...o,children:a.jsxs(Xo,{onSubmit:y=>{o.handleSubmit(g)(y)},noValidate:!0,children:[a.jsxs(al,{children:[a.jsxs(ua,{title:"General",children:[a.jsx(kt,{control:c,name:"title",render:({field:y})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Name the storage to clarify its purpose",children:"Title"}),a.jsx(Nt,{children:a.jsx(Ht,{...y,placeholder:"Storage title"})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:c,name:"type",render:({field:y})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"The selected source will be used to process data in your Data Marts",children:"Storage Type"}),a.jsx(Nt,{children:a.jsxs(Kr,{value:y.value,onValueChange:y.onChange,disabled:!!e,children:[a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{placeholder:"Select a storage type"})}),a.jsx(Qr,{children:a.jsx($g,{children:nl.getAllTypes().map(({type:v,displayName:b,icon:E,status:S})=>a.jsx(Rn,{value:v,disabled:S===Do.COMING_SOON,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(E,{size:20}),b]})},v))})})]})}),a.jsxs(wn,{children:[h===ke.GOOGLE_BIGQUERY&&a.jsx(hne,{}),h===ke.AWS_ATHENA&&a.jsx(mne,{})]}),a.jsx(Ft,{})]})})]}),h===ke.GOOGLE_BIGQUERY&&a.jsx(ine,{form:o}),h===ke.AWS_ATHENA&&a.jsx(fne,{form:o})]}),a.jsxs(sl,{children:[a.jsx(xe,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!d||f,children:"Save"}),a.jsx(xe,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function n5({isOpen:e,onClose:t,dataStorage:n,onSaveSuccess:r}){const{updateDataStorage:o}=Bg(),[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(E=>{f(E)},[]),v=async E=>{if(n){const S=await o(n.id,E);S&&(r(S),t())}},b=m.useRef(!1);return m.useEffect(()=>{const E=n?"Edit":"Create";e&&!b.current?(Ue({event:"data_storage_config_open",category:"DataStorage",action:E,label:n==null?void 0:n.type}),b.current=!0):!e&&b.current&&(Ue({event:"data_storage_config_close",category:"DataStorage",action:E,label:n==null?void 0:n.type}),b.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx($o,{open:e,onOpenChange:E=>{E||h()},children:a.jsxs(Bo,{children:[a.jsxs(Go,{children:[a.jsx(qo,{children:"Configure Storage Provider"}),a.jsx(Xi,{children:"Customize settings for your storage provider"})]}),a.jsx(pne,{initialData:n??void 0,onSubmit:v,onCancel:h,onDirtyChange:y})]})}),a.jsx(Tr,{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 gne=({dataStorage:e,onDataStorageChange:t})=>{const[n,r]=m.useState(!1),o=nl.getInfo(e.type),l=()=>{r(!0)},c=()=>{r(!1)},d=()=>{if(!XA(e))return a.jsxs("div",{className:"flex items-center space-x-2 text-sm",children:[a.jsx(ag,{className:"h-4 w-4 text-red-500"}),a.jsx("span",{className:"text-red-500",children:"Storage configuration is incomplete"})]});const h=(y,v)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:v})]}),g=(y,v,b)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[y,":"]})," ",a.jsx(vn,{href:b,onClick:E=>{E.stopPropagation()},children:v})]});switch(e.type){case ke.GOOGLE_BIGQUERY:{const y=e.config.projectId,v=e.config.location,b=`https://console.cloud.google.com/bigquery?project=${y}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[g("Project ID",y,b),a.jsx("span",{className:"text-muted-foreground",children:"•"}),h("Location",v)]})}case ke.AWS_ATHENA:{const y=e.config.region,v=e.config.outputBucket,b=`https://s3.console.aws.amazon.com/s3/buckets/${v}?region=${y}`;return a.jsxs("div",{className:"flex flex-wrap gap-2",children:[h("Region",y),a.jsx("span",{className:"text-muted-foreground",children:"•"}),g("Bucket",v,b)]})}default:return"Unknown storage type configuration"}};return a.jsxs(a.Fragment,{children:[a.jsx(p1,{title:e.title,icon:o.icon,subtitle:d(),onClick:l}),a.jsx(hS,{children:a.jsx(n5,{isOpen:n,onClose:c,dataStorage:e,onSaveSuccess:f=>{t&&t(f)}})})]})};function yne({initialType:e,onTypeSelect:t}){var c;const[n,r]=m.useState(e??null);m.useEffect(()=>{e!==void 0&&e!==n&&r(e)},[e,n]);const o=d=>{r(d),t(d)},l=[{type:Fe.SQL,label:"SQL",description:"SQL query"},{type:Fe.TABLE,label:"Table",description:"Existing table"},{type:Fe.VIEW,label:"View",description:"Existing view"},{type:Fe.TABLE_PATTERN,label:"Pattern",description:"Table pattern"},{type:Fe.CONNECTOR,label:"Connector",description:"Data import from Source to Storage"}];return a.jsxs("div",{className:"dm-card-block",children:[a.jsx(Ma,{className:"text-foreground",children:"Definition Type"}),a.jsxs(Kr,{value:n??"",onValueChange:d=>{o(d)},children:[a.jsx(Wr,{className:"dm-card-formcontrol w-full","aria-label":"Definition Type",children:a.jsx(Yr,{placeholder:"Select definition type",children:n&&((c=l.find(d=>d.type===n))==null?void 0:c.label)})}),a.jsx(Qr,{children:a.jsx($g,{children:l.map(d=>a.jsxs(Rn,{value:d.type,children:[d.label,a.jsx("span",{className:"text-muted-foreground/80 ml-2",children:d.description})]},d.type))})})]})]})}const vne=Jt({definitionType:ga(Fe.SQL),definition:Jt({sqlQuery:$t().min(1,"SQL query is required")})}),xne=e=>{const t=p3(e);return Jt({definitionType:ga(Fe.TABLE),definition:t})},bne=e=>{const t=p3(e);return Jt({definitionType:ga(Fe.VIEW),definition:t})},Sne=e=>{const t=uY(e);return Jt({definitionType:ga(Fe.TABLE_PATTERN),definition:t})},Cne=Jt({definitionType:ga(Fe.CONNECTOR),definition:Jt({connector:Jt({source:Jt({name:$t().min(1,"Connector name is required"),configuration:K0(QG(YG())).min(1,"At least one configuration is required"),node:$t().min(1,"Node is required"),fields:K0($t()).min(1,"At least one field is required")}),storage:Jt({fullyQualifiedName:$t().min(1,"fully qualified name is required")})})})}),Ene=(e,t)=>{if(!e)return Jt({definitionType:XG(Ng(Fe)),definition:Jt({}).optional()});switch(e){case Fe.SQL:return vne;case Fe.TABLE:return xne(t);case Fe.VIEW:return bne(t);case Fe.TABLE_PATTERN:return Sne(t);case Fe.CONNECTOR:return Cne;default:return Jt({})}};function wne({control:e}){return a.jsx(kt,{control:e,name:"definition.sqlQuery",render:({field:t})=>a.jsxs(_t,{className:"dm-card-block",children:[a.jsx(Rt,{className:"text-foreground",children:"SQL Query"}),a.jsx(Nt,{children:a.jsx(fte,{initialValue:{sqlQuery:t.value},onChange:n=>{t.onChange(n.sqlQuery)}})}),a.jsx(Ft,{})]})})}function Rne({control:e,storageType:t}){const n=e3(t),r=t3(t);return a.jsx(kt,{control:e,name:"definition.fullyQualifiedName",render:({field:o})=>a.jsxs(_t,{className:"dm-card-block",children:[a.jsx(Rt,{children:"Fully Qualified Table Name"}),a.jsx(Nt,{children:a.jsx(Ht,{placeholder:n,value:o.value||"",onChange:o.onChange,className:"dm-card-formcontrol"})}),a.jsx(wn,{className:"text-muted-foreground/75",children:r}),a.jsx(Ft,{})]})})}function jne({control:e,storageType:t}){const n=e3(t),r=t3(t);return a.jsx(kt,{control:e,name:"definition.fullyQualifiedName",render:({field:o})=>a.jsxs(_t,{className:"dm-card-block",children:[a.jsx(Rt,{children:"Fully Qualified View Name"}),a.jsx(Nt,{children:a.jsx(Ht,{placeholder:n,value:o.value||"",onChange:o.onChange,className:"dm-card-formcontrol"})}),a.jsx(wn,{className:"text-muted-foreground/75",children:r}),a.jsx(Ft,{})]})})}function Tne({control:e,storageType:t}){const n=lK(t),r=cK(t);return a.jsx(kt,{control:e,name:"definition.pattern",render:({field:o})=>a.jsxs(_t,{className:"dm-card-block",children:[a.jsx(Rt,{children:"Table Pattern"}),a.jsx(Nt,{children:a.jsx(Ht,{placeholder:n,value:o.value||"",onChange:o.onChange,className:"dm-card-formcontrol"})}),a.jsx(wn,{className:"text-muted-foreground/75",children:r}),a.jsx(Ft,{})]})})}const OS=e=>{switch(e){case Fe.SQL:return{sqlQuery:""};case Fe.TABLE:return{fullyQualifiedName:""};case Fe.VIEW:return{fullyQualifiedName:""};case Fe.TABLE_PATTERN:return{pattern:""};case Fe.CONNECTOR:return{connector:{source:{name:"",configuration:[],node:"",fields:[]},storage:{fullyQualifiedName:""}}};default:return{}}},_ne=Af("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 MS({className:e,variant:t,...n}){return a.jsx("div",{"data-slot":"alert",role:"alert",className:ne(_ne({variant:t}),e),...n})}function r5({className:e,...t}){return a.jsx("div",{"data-slot":"alert-title",className:ne("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",e),...t})}function IS({className:e,...t}){return a.jsx("div",{"data-slot":"alert-description",className:ne("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...t})}function Nne({connectors:e,selectedConnector:t,loading:n,error:r,onConnectorSelect:o,onConnectorDoubleClick:l}){return n?a.jsx(bS,{variant:"grid"}):r?a.jsxs(MS,{variant:"destructive",children:[a.jsx(Df,{className:"h-4 w-4"}),a.jsx(IS,{children:"Failed to load available connectors. Please try again."})]}):a.jsxs(Io,{children:[a.jsx(Pl,{title:"Choose Connector",children:a.jsx(_J,{children:e.map(c=>a.jsx(NJ,{icon:c.logoBase64?a.jsx(rc,{base64:c.logoBase64,size:20}):null,title:c.displayName,selected:(t==null?void 0:t.name)===c.name,onClick:()=>{o(c)},onDoubleClick:()=>{o(c),l==null||l(c)}},c.name))})}),e.length===0&&a.jsx(Yi,{icon:a.jsx(mf,{size:56,strokeWidth:1}),title:"No connectors available",subtitle:"Ask your administrator to configure connectors."})]})}function Ane({currentStep:e,totalSteps:t,canGoNext:n,canGoBack:r,isLoading:o=!1,onNext:l,onBack:c,onFinish:d,nextLabel:f="Next",backLabel:h="Back",finishLabel:g="Save"}){const y=e===t;return t===1?a.jsx("div",{className:"w-full",children:a.jsx(xe,{className:"w-full",variant:"default",onClick:d,disabled:!n||o,children:g})}):a.jsxs("div",{className:"flex w-full items-center justify-between gap-4",children:[a.jsx("div",{className:"flex-1",children:r&&a.jsxs(xe,{variant:"outline",onClick:c,disabled:o,children:[a.jsx(X7,{className:"h-4 w-4"}),h]})}),a.jsxs("div",{className:"text-muted-foreground/75 px-4 text-sm",children:["Step ",e," of ",t]}),a.jsx("div",{className:"flex flex-1 justify-end",children:y?a.jsx(xe,{variant:"default",onClick:d,disabled:!n||o,children:g}):a.jsxs(xe,{variant:"default",onClick:l,disabled:!n||o,children:[f,a.jsx(La,{className:"h-4 w-4"})]})})]})}function Fl({connector:e,size:t=24,variant:n="compact"}){return a.jsx(Yi,{icon:a.jsx(rc,{base64:e.logoBase64,size:t}),title:e.displayName,docUrl:e.docUrl,variant:n})}function gu({label:e}){return a.jsx("div",{className:"border-border text-muted-foreground mt-3 flex items-center justify-center gap-2 border-t pt-3 text-sm",children:a.jsx(xe,{variant:"outline",asChild:!0,children:a.jsxs(ha,{to:"https://github.com/OWOX/owox-data-marts/issues",target:"_blank",rel:"noopener noreferrer",children:[e," Open issue here",a.jsx(Uo,{className:"h-4 w-4"})]})})})}const v1="**********";function Dne({specification:e,configuration:t,onValueChange:n}){const{name:r,title:o}=e,l=o??r,c=r;return a.jsxs("div",{className:"flex items-center space-x-2",children:[a.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"}),a.jsx(Ma,{htmlFor:c,className:"cursor-pointer text-sm",children:a.jsx(Hs,{htmlFor:c,required:e.required,tooltip:e.description,children:l})})]})}function One({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o}=e,l=e.title??e.name;return a.jsx(Ht,{id:r,name:r,type:"number",value:t[r]||"",placeholder:o??`Enter ${l.toLowerCase()}`,onChange:c=>{const d=c.target.value,f=d===""?void 0:parseFloat(d);n(r,f)}})}function Mne({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o,default:l}=e,c=e.title??e.name;return a.jsx(Zo,{id:r,name:r,value:Array.isArray(t[r])?t[r].join(`
704
- `):Array.isArray(l)?l.join(`
705
- `):"",placeholder:o??`Enter ${c.toLowerCase()} (one per line)`,rows:4,onChange:d=>{const f=d.target.value.split(`
706
- `).filter(h=>h.trim());n(r,f)}})}function Ine({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o,default:l}=e,c=e.title??e.name,d=f=>{if(!f||typeof f!="string"&&typeof f!="number")return"";const h=typeof f=="string"?f:f.toString();try{const g=new Date(h);return isNaN(g.getTime())?"":g.toISOString().split("T")[0]}catch{return""}};return a.jsx(Ht,{id:r,name:r,type:"date",value:t[r]||d(l)||"",placeholder:o??`Enter ${c.toLowerCase()}`,onChange:f=>{n(r,f.target.value)}})}function kne({specification:e,configuration:t,onValueChange:n}){const{name:r,placeholder:o}=e,l=e.title??e.name;return a.jsx(Ht,{id:r,name:r,type:"text",value:t[r]||"",placeholder:o??`Enter ${l.toLowerCase()}`,onChange:c=>{n(r,c.target.value)}})}function Lne({specification:e,configuration:t,onValueChange:n}){const r=e.title??e.name,{name:o,placeholder:l,default:c}=e;return a.jsx(Zo,{id:o,name:o,value:t[o]&&typeof t[o]=="object"?JSON.stringify(t[o],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(o,f)}catch{n(o,d.target.value)}}})}function Pne({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:o}){const l=e.title??e.name,c=r&&!o;return a.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?v1: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 Une({specification:e,configuration:t,onValueChange:n,specOptions:r}){const{name:o,placeholder:l,default:c}=e,d=e.title??e.name,f=r.map(h=>({value:h,label:h}));return a.jsx(DS,{options:f,value:t[o]||c||"",onValueChange:h=>{n(o,h)},placeholder:l??`Select ${d.toLowerCase()}`,emptyMessage:"No options available",className:"w-full"})}function Fne(){const e=m.useRef(new nf),t=m.useCallback(async(o,l,c)=>await e.current.exchangeCredentials(o,{fieldPath:c,payload:l}),[]),n=m.useCallback(async(o,l)=>{try{return await e.current.checkOAuthStatus(o,l)}catch{return{valid:!1}}},[]),r=m.useCallback(async(o,l)=>await e.current.getOAuthSettings(o,l),[]);return{exchangeCredentials:t,checkStatus:n,getSettings:r}}let qd=null;function Vne({appId:e,scope:t,onSuccess:n,onError:r,disabled:o=!1,children:l}){const[c,d]=m.useState(!1),[f,h]=m.useState(!1),[g,y]=m.useState(null);m.useEffect(()=>{if(window.FB){h(!0);return}if(document.getElementById("facebook-jssdk")){const C=setInterval(()=>{window.FB&&(h(!0),clearInterval(C))},100);return()=>{clearInterval(C)}}if(!e)return;if(qd&&qd!==e){console.warn("Facebook SDK already initialized with different appId");return}qd??(qd=e),window.fbAsyncInit=function(){window.FB&&qd&&(window.FB.init({appId:qd,cookie:!0,xfbml:!0,version:"v23.0"}),h(!0))};const S=document.createElement("script");S.id="facebook-jssdk",S.src="https://connect.facebook.net/en_US/sdk.js",S.async=!0,S.defer=!0,S.crossOrigin="anonymous",document.body.appendChild(S)},[e]);const v=()=>{if(!window.FB||!f){const S=new Error("Facebook SDK not loaded or not ready");y(S.message),r==null||r(S);return}d(!0),y(null),window.FB.login(S=>{var C;if(S.status==="connected"&&S.authResponse){const{accessToken:R,expiresIn:j,userID:_}=S.authResponse;(C=window.FB)==null||C.api("/me?fields=name,email",D=>{const A={accessToken:R,expiresIn:j,userID:_,userName:D.name,userEmail:D.email};n(A),d(!1)})}else{const R=new Error("User cancelled login or did not fully authorize");y(R.message),r==null||r(R),d(!1)}},{scope:t})},b=o||c||!f,E=()=>c?"Connecting...":l||(f?"Continue with Facebook":"Loading...");return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsxs(xe,{type:"button",onClick:v,disabled:b,className:"flex items-center justify-center gap-2 rounded-md border-none bg-[#1877F2] px-4 py-2.5 text-sm font-semibold text-white hover:bg-[#166FE5] disabled:cursor-not-allowed disabled:opacity-60",children:[a.jsx("svg",{width:20,height:20,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M9.101 23.691v-7.98H6.627v-3.667h2.474v-1.58c0-4.085 1.848-5.978 5.858-5.978.401 0 .955.042 1.468.103a8.68 8.68 0 0 1 1.141.195v3.325a8.623 8.623 0 0 0-.653-.036 26.805 26.805 0 0 0-.733-.009c-.707 0-1.259.096-1.675.309a1.686 1.686 0 0 0-.679.622c-.258.42-.374.995-.374 1.752v1.297h3.919l-.386 2.103-.287 1.564h-3.246v8.245C19.396 23.238 24 18.179 24 12.044c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.628 3.874 10.35 9.101 11.647Z"})}),E()]}),g&&a.jsx("div",{className:"mt-1 text-xs text-red-600",children:g})]})}function zne({isLoading:e,status:t,settings:n,onOAuthSuccess:r}){const o=l=>{r({accessToken:l.accessToken})};return a.jsx("div",{className:"mt-2 mb-2",children:a.jsx(Vne,{appId:n==null?void 0:n.vars.AppId,scope:n==null?void 0:n.vars.Scopes,onSuccess:o,disabled:e,children:t!=null&&t.user?a.jsxs(a.Fragment,{children:["Authenticated as ",a.jsx("strong",{children:t.user.name??t.user.id})]}):"Continue with Facebook"})})}function a5({specification:e,option:t,configuration:n,onValueChange:r,connectorName:o,onSecretEditToggle:l,secretEditing:c={},isEditingExisting:d=!1}){const[f,h]=m.useState(!1),[g,y]=m.useState(null),[v,b]=m.useState(null),[E,S]=m.useState(null),C=m.useMemo(()=>{const G=n[e.name],U=t!=null&&t.value&&G?G[t.value]:G;return U==null?void 0:U._source_credential_id},[n,e.name,t==null?void 0:t.value]),R=m.useMemo(()=>t?`${e.name}.${t.value}`:e.name,[e.name,t]),j=m.useMemo(()=>{const G=n[e.name];if(t!=null&&t.value&&G){const U=G[t.value];return U&&typeof U=="object"&&!Array.isArray(U)?U:{}}return G&&typeof G=="object"&&!Array.isArray(G)?G:{}},[n,e.name,t==null?void 0:t.value]),_=m.useMemo(()=>{const G=j;return"_source_credential_id"in G?!1:!!(t!=null&&t.items&&Object.keys(t.items).some(H=>H in G&&G[H]!==void 0&&G[H]!==""))},[j,t]),[D,A]=m.useState(_);m.useEffect(()=>{const G="_source_credential_id"in j,U=(t==null?void 0:t.items)&&Object.keys(t.items).some(H=>H in j&&j[H]!==void 0&&j[H]!=="");G&&D?A(!1):U&&!D&&A(!0)},[j,t,D]);const O=(G,U)=>{if(!(t!=null&&t.value))return;const H=n[e.name]&&typeof n[e.name]=="object"?n[e.name]:{};r(e.name,{...H,[t.value]:{...typeof H[t.value]=="object"&&H[t.value]!==null?H[t.value]:{},[G]:U}})},{checkStatus:T,getSettings:M,exchangeCredentials:V}=Fne(),Z=async G=>{try{h(!0),S(null);const U=await V(o,G,R),H=n[e.name];t?r(e.name,{...H,[t.value]:{_source_credential_id:U.credentialId}}):r(e.name,{_source_credential_id:U.credentialId})}catch(U){const H=U instanceof Error?U.message:"Failed to exchange OAuth credentials";console.error("Failed to exchange OAuth credentials:",U),S(H)}finally{h(!1)}};m.useEffect(()=>{if(!C){y(null),h(!1);return}let G=!1;return(async()=>{try{h(!0);const H=await T(o,C);G||y(H)}catch(H){G||(console.error("Failed to validate credentials:",H),y({valid:!1}))}finally{G||h(!1)}})(),()=>{G=!0}},[C,o,T]),m.useEffect(()=>{(async()=>{try{const U=await M(o,R);b(U)}catch(U){console.error("Failed to fetch settings:",U),b(null)}})()},[o,R,M]);const K=!!(v!=null&&v.isEnabled);if((D||!K)&&(t!=null&&t.items))return a.jsxs("div",{className:"space-y-4",children:[Object.entries(t.items).map(([G,U])=>{const H=Array.isArray(U.attributes)?U.attributes.includes("SECRET")&&j[G]!==void 0:!1,k=c[e.name]??!1;return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Hs,{htmlFor:G,required:U.required,tooltip:U.description,className:"mb-2 justify-start",children:U.title??G}),H&&d&&l&&a.jsx(xe,{variant:"ghost",size:"sm",type:"button",onClick:()=>{l(e.name,!k)},children:k?"Cancel":"Edit"})]}),kS({specification:{...U,name:G},configuration:j,onValueChange:($,q)=>{O($,q)},flags:{isEditingExisting:d,isSecret:H,isSecretEditing:k},connectorName:o})]},G)}),K&&a.jsx(xe,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!1),h(!1)},className:"px-0",children:"Back to OAuth"})]});const Y=(()=>{switch(o){case"FacebookMarketing":return a.jsx(zne,{isLoading:f,status:g,settings:v,onOAuthSuccess:Z});default:return null}})();return a.jsxs("div",{className:"space-y-3",children:[Y,E&&a.jsx("div",{className:"text-destructive text-sm",children:E}),(t==null?void 0:t.items)&&Object.keys(t.items).length>0&&a.jsx(xe,{variant:"link",size:"sm",type:"button",onClick:()=>{r(e.name,{[t.value]:{}}),A(!0)},className:"px-0",children:"Manually"})]})}function kS({specification:e,configuration:t,onValueChange:n,flags:r,connectorName:o}){const{requiredType:l,options:c}=e,{isSecret:d=!1,isEditingExisting:f=!1,isSecretEditing:h=!1}=r??{};if(e.attributes&&Array.isArray(e.attributes)&&e.attributes.includes("OAUTH_FLOW"))return a.jsx(a5,{specification:e,configuration:t,onValueChange:n,connectorName:o});if(d)return a.jsx(Pne,{specification:e,configuration:t,onValueChange:n,isEditingExisting:f,isSecretEditing:h});if(c&&c.length>0)return a.jsx(Une,{specification:e,configuration:t,onValueChange:n,specOptions:c});switch(l){case fs.BOOLEAN:return a.jsx(Dne,{specification:e,configuration:t,onValueChange:n});case fs.NUMBER:return a.jsx(One,{specification:e,configuration:t,onValueChange:n});case fs.ARRAY:return a.jsx(Mne,{specification:e,configuration:t,onValueChange:n});case fs.OBJECT:return a.jsx(Lne,{specification:e,configuration:t,onValueChange:n});case fs.DATE:return a.jsx(Ine,{specification:e,configuration:t,onValueChange:n});case fs.STRING:default:return a.jsx(kne,{specification:e,configuration:t,onValueChange:n})}}function Hne({specification:e,configuration:t,isEditingExisting:n,isSecretEditing:r,isSecret:o,onValueChange:l,onSecretEditToggle:c,connectorName:d}){return a.jsxs(Jd,{children:[e.requiredType!==fs.BOOLEAN&&a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Hs,{htmlFor:e.name,required:e.required,tooltip:e.description,children:e.title??e.name}),o&&n&&a.jsx(xe,{variant:"ghost",size:"sm",type:"button",onClick:()=>{c(e.name,!r)},children:r?"Cancel":"Edit"})]}),kS({specification:e,configuration:t,onValueChange:l,flags:{isSecret:o,isEditingExisting:n,isSecretEditing:r},connectorName:d})]},e.name)}function $ne({specification:e,configuration:t,onValueChange:n,isEditingExisting:r,isSecretEditing:o,onSecretEditToggle:l,connectorName:c}){const d=m.useMemo(()=>{var b,E;const v=t[e.name];if(v&&typeof v=="object"){const S=Object.keys(v);if(S.length>0)return S[0]}return((E=(b=e.oneOf)==null?void 0:b[0])==null?void 0:E.value)??""},[t,e.name,e.oneOf]),[f,h]=m.useState(d);if(m.useEffect(()=>{h(d)},[d]),m.useEffect(()=>{if(f){const v=t[e.name];v&&typeof v=="object"&&f in v||n(e.name,{[f]:{}})}},[f,e.name]),!e.oneOf)return null;const g=v=>{h(v)},y=(v,b,E)=>{const S=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{};n(e.name,{[v]:{...typeof S[v]=="object"&&S[v]!==null?S[v]:{},[b]:E}})};return a.jsx(TJ,{label:e.title??e.name,options:e.oneOf.map(v=>({value:v.value,label:v.label})),value:f,onValueChange:g,children:e.oneOf.map(v=>{const b=v.attributes&&Array.isArray(v.attributes)&&v.attributes.includes("OAUTH_FLOW");return a.jsx(pJ,{value:v.value,children:b?a.jsx(a5,{specification:e,option:v,configuration:t,onValueChange:n,connectorName:c,onSecretEditToggle:l,secretEditing:{[e.name]:o},isEditingExisting:r}):Object.entries(v.items).map(([E,S])=>{const C=t[e.name]&&typeof t[e.name]=="object"?t[e.name]:{},R=Array.isArray(S.attributes)&&Object.keys(C)[0]===v.value?S.attributes.includes("SECRET"):!1,j=typeof t[e.name]=="object"&&t[e.name]!==null?t[e.name]:{},_=typeof j[v.value]=="object"&&j[v.value]!==null?j[v.value]:{};return a.jsxs("div",{className:"mb-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Hs,{htmlFor:E,required:S.required,tooltip:S.description,className:"mb-2 justify-start",children:E}),R&&r&&a.jsx(xe,{variant:"ghost",size:"sm",type:"button",onClick:()=>{l(e.name,!o)},children:o?"Cancel":"Edit"})]}),kS({specification:{...S,name:E},configuration:_,onValueChange:(D,A)=>{y(v.value,D,A)},flags:{isEditingExisting:r,isSecret:R,isSecretEditing:o},connectorName:c})]},E)})},v.value)})},e.name)}function gT(e,t,n,r,o,l,c){return e.map(d=>{const f=Array.isArray(d.attributes)?d.attributes.includes("SECRET"):!1,h=o[d.name];return d.oneOf&&d.requiredType===fs.OBJECT?a.jsx($ne,{specification:d,configuration:t,onValueChange:n,isEditingExisting:l,isSecretEditing:h,onSecretEditToggle:r,connectorName:c},d.name):a.jsx(Hne,{specification:d,configuration:t,isEditingExisting:l,isSecret:f,isSecretEditing:h,onValueChange:n,onSecretEditToggle:r,connectorName:c},d.name)})}function yT({collapsibleTitle:e,items:t,configuration:n,onValueChange:r,onSecretEditToggle:o,secretEditing:l,isEditingExisting:c,connectorName:d}){return e?a.jsx(oO,{title:e,children:gT(t,n,r,o,l,c,d)}):gT(t,n,r,o,l,c,d)}function Bne({currentConnectorName:e,onCopyConfiguration:t,connectorSpecification:n}){const[r,o]=m.useState([]),[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(async()=>{c(!0);try{const v=await sn.getDataMartsByConnectorName(e);o(v)}catch{o([])}finally{c(!1)}},[e]);m.useEffect(()=>{d&&h()},[d,h]);const g=(v,b)=>{const E=b._id;if(!E){console.error("Configuration does not have _id field");return}t({dataMartId:v.id,dataMartTitle:v.title,configId:E,configuration:b}),f(!1)},y=v=>{const E=[],S=R=>{if(!n)return!0;const j=n.find(_=>_.name===R);return(j==null?void 0:j.required)??!1},C=(R,j,_=0,D=!0)=>{if(R.startsWith("_")||D&&_===0&&!S(R))return;let A=null;if(j==null)A="N/A";else if(typeof j=="string")A=j;else if(typeof j=="number"||typeof j=="boolean")A=String(j);else if(Array.isArray(j))A=JSON.stringify(j);else if(typeof j=="object"){E.push({key:R,value:"{",indent:_}),Object.entries(j).forEach(([O,T])=>{C(O,T,_+1,!1)}),E.push({key:"",value:"}",indent:_});return}else A=JSON.stringify(j);E.push({key:R,value:A,indent:_})};for(const[R,j]of Object.entries(v))C(R,j);return a.jsx("div",{className:"space-y-1 font-mono text-xs",children:E.map(({key:R,value:j,indent:_},D)=>a.jsxs("div",{className:"flex gap-2",style:{paddingLeft:`${String(_*12)}px`},children:[R&&a.jsxs("span",{className:"font-medium",children:[R,":"]}),a.jsx("span",{className:"text-muted-foreground truncate",title:j,children:j})]},D))})};return a.jsx(vs,{children:a.jsxs(ur,{open:d,onOpenChange:f,children:[a.jsx(dr,{asChild:!0,children:a.jsxs(xe,{type:"button",variant:"ghost",size:"sm",className:"cursor-pointer",children:[a.jsx("span",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Copy from…"}),a.jsx(La,{className:ne("text-foreground/75 h-3.5 w-3.5 transition-transform duration-200",d&&"rotate-90")})]})}),a.jsx(fr,{side:"bottom",align:"end",className:"w-72",children:l?a.jsx(pt,{disabled:!0,children:"Loading…"}):r.length===0?a.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[a.jsx("div",{className:"bg-muted/70 rounded-full p-3",children:a.jsx(nL,{className:"text-muted-foreground h-6 w-6",strokeWidth:1.5})}),a.jsx("span",{className:"text-foreground text-sm font-medium",children:"No matching Data Marts"}),a.jsx("span",{className:"text-muted-foreground text-sm",children:"You can reuse configuration settings only from connector-based Data Marts that use the same source."})]}):a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"text-muted-foreground border-b p-2 text-sm",children:"Select one of your existing Data Marts to reuse its configuration settings."}),a.jsx("div",{children:r.map(v=>{const E=v.definition.connector.source.configuration;return E.length===0?null:E.length===1?a.jsxs(bt,{delayDuration:300,children:[a.jsx(St,{asChild:!0,children:a.jsxs(pt,{onSelect:()=>{g(v,E[0])},children:[a.jsx(up,{className:"text-foreground h-4 w-4"}),v.title]})}),a.jsx(Ct,{side:"right",className:"max-w-sm",children:y(E[0])})]},v.id):a.jsxs(vb,{children:[a.jsxs(xb,{className:"flex items-center gap-2",children:[a.jsx(up,{className:"text-foreground h-4 w-4"}),a.jsx("span",{children:v.title})]}),a.jsx(bb,{children:E.map((S,C)=>a.jsxs(bt,{delayDuration:300,children:[a.jsx(St,{asChild:!0,children:a.jsxs(pt,{onSelect:()=>{g(v,S)},children:["Configuration ",C+1]})}),a.jsx(Ct,{side:"right",className:"max-w-sm",children:y(S)})]},C))})]},v.id)})})]})})]})})}function vT({connector:e,connectorSpecification:t,onConfigurationChange:n,onValidationChange:r,initialConfiguration:o,loading:l=!1,isEditingExisting:c=!1}){const[d,f]=m.useState({}),h=m.useRef(!1),g=m.useRef(!1),[y,v]=m.useState({});m.useEffect(()=>{if(t){g.current=!0;const O={...o??{}};t.forEach(T=>{const M=Array.isArray(T.attributes)?T.attributes.includes("SECRET"):!1;O[T.name]===void 0&&T.default!==void 0&&(O[T.name]=T.default),c&&M&&(O[T.name]=v1)}),f(O),h.current=!0,setTimeout(()=>{g.current=!1},0)}},[t,o,c]),m.useEffect(()=>{h.current&&o&&Object.keys(o).length>0&&(g.current=!0,f({...o}),setTimeout(()=>{g.current=!1},0))},[o]),m.useEffect(()=>{h.current&&!g.current&&Object.keys(d).length>0&&(n==null||n(d))},[d,n]);const b=(O,T)=>{f(M=>({...M,[O]:T}))},E=m.useCallback(O=>!(O==null||typeof O=="string"&&O.trim()===""||typeof O=="number"&&isNaN(O)||Array.isArray(O)&&O.length===0),[]),S=m.useCallback((O,T)=>{var V,Z;if(typeof O!="object"||O===null)return E(O);if((V=T.attributes)!=null&&V.includes("OAUTH_FLOW")&&"_source_credential_id"in O)return!0;const M=(Z=T.oneOf)==null?void 0:Z.filter(K=>K.value===Object.keys(O)[0]);return M?M.every(K=>{var Y;if((Y=K.attributes)!=null&&Y.includes("OAUTH_FLOW")){const G=O[K.value];if(typeof G=="object"&&G!==null){if("_source_credential_id"in G)return!0;const U=Object.entries(K.items).filter(([,H])=>H.required);if(U.length>0)return U.every(([H])=>{const k=G[H];return E(k)})}return!1}return Object.entries(K.items).every(([,G])=>K.value in O?S(O[K.value],G):!1)}):E(O[T.name])},[E]),C=m.useCallback((O,T)=>{const M=T.filter(Y=>Y.required&&Y.oneOf),V=M.length===0?!0:M.some(Y=>S(O[Y.name],Y)),K=T.filter(Y=>Y.required&&Y.name!=="Fields").every(Y=>E(O[Y.name]));return V&&K},[E,S]),R=(O,T)=>{v(M=>({...M,[O]:T})),f(T?M=>({...M,[O]:""}):M=>({...M,[O]:v1}))},j=O=>{const T={...d};Object.entries(O.configuration).forEach(([M,V])=>{["_id","_copiedFrom"].includes(M)||(T[M]=V)}),T._copiedFrom={dataMartId:O.dataMartId,dataMartTitle:O.dataMartTitle,configId:O.configId},f(T)};if(m.useEffect(()=>{if(t&&r){const O=C(d,t);r(O)}},[d,t,r,C]),l)return a.jsx(bS,{variant:"list"});if(!t||t.length===0)return a.jsxs(Io,{children:[a.jsx(Fl,{connector:e}),a.jsx(Yi,{icon:a.jsx(mf,{size:56,strokeWidth:1}),title:"No configuration found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(gu,{label:"Need configuration?"})]});const _=[...t].filter(O=>{var T;return O.name!=="Fields"&&!((T=O.attributes)!=null&&T.includes("HIDE_IN_CONFIG_FORM"))}).sort((O,T)=>{const M=V=>{const Z=V.default!=null&&V.default!=="";return V.required&&!Z?1:V.required&&Z?2:!V.required&&!Z?3:4};return M(O)-M(T)}),D=_.filter(O=>{var T;return!((T=O.attributes)!=null&&T.includes("ADVANCED"))}),A=_.filter(O=>{var T;return(T=O.attributes)==null?void 0:T.includes("ADVANCED")});return a.jsx(a.Fragment,{children:a.jsxs(Io,{children:[a.jsx(Fl,{connector:e}),a.jsxs(Pl,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-muted-foreground/75 text-xs font-semibold tracking-wide uppercase",children:"Configure Settings"}),a.jsx(Bne,{currentConnectorName:e.name,onCopyConfiguration:j,connectorSpecification:t})]}),D.length>0&&a.jsx(yT,{items:D,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c,connectorName:e.name}),A.length>0&&a.jsx(yT,{collapsibleTitle:"Advanced Settings",items:A,configuration:d,onValueChange:b,onSecretEditToggle:R,secretEditing:y,isEditingExisting:c,connectorName:e.name})]})]})})}function Gne({connector:e,connectorFields:t,selectedField:n,connectorName:r,loading:o=!1,onFieldSelect:l}){const c=r?`Select data for ${r}`:"Select data";return o?a.jsx(bS,{variant:"list"}):!t||t.length===0?a.jsxs(Io,{children:[a.jsx(Fl,{connector:e}),a.jsx(Yi,{icon:a.jsx(mf,{size:56,strokeWidth:1}),title:r?`No nodes found for ${r}`:"No nodes found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(gu,{label:"Missing some data?"})]}):a.jsxs(Io,{children:[a.jsx(Fl,{connector:e}),a.jsxs(Pl,{title:c,children:[t.map(d=>a.jsx(iO,{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&&a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Table name:"})," ",d.destinationName??d.name]}),d.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",d.description]}),d.documentation&&a.jsxs(ha,{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",a.jsx(La,{className:"h-3 w-3"})]})]}),selected:n===d.name},d.name)),a.jsx(gu,{label:"Missing some data?"})]})]})}var Us=(e=>(e.ASC="asc",e.DESC="desc",e.ORIGINAL="original",e))(Us||{});function xT({connector:e,connectorFields:t,selectedField:n,selectedFields:r,onFieldToggle:o}){const l=m.useRef(null),[c,d]=m.useState(""),[f,h]=m.useState(Us.ORIGINAL),g=t==null?void 0:t.find(R=>R.name===n),y=m.useMemo(()=>(g==null?void 0:g.fields)??[],[g==null?void 0:g.fields]),v=m.useMemo(()=>(g==null?void 0:g.uniqueKeys)??[],[g==null?void 0:g.uniqueKeys]),b=m.useMemo(()=>{const R=new Map;return y.forEach((j,_)=>R.set(j.name,_)),R},[y]),E=m.useMemo(()=>{const R=y.filter(_=>_.name.toLowerCase().includes(c.toLowerCase().trim())),j=(_,D)=>{const A=v.includes(_.name),O=v.includes(D.name);if(A&&!O)return-1;if(!A&&O)return 1;if(f===Us.ASC)return _.name.localeCompare(D.name);if(f===Us.DESC)return D.name.localeCompare(_.name);const T=b.get(_.name)??0,M=b.get(D.name)??0;return T-M};return[...R].sort(j)},[y,c,v,f,b]),S=y.map(R=>R.name),C=r.filter(R=>S.includes(R)).length;return m.useEffect(()=>{if(v.length>0){const R=v.filter(j=>y.some(_=>_.name===j)&&!r.includes(j));R.length>0&&R.forEach(j=>{o(j,!0)})}},[n,v,y,r,o]),m.useEffect(()=>{const R=j=>{const D=(j.ctrlKey||j.metaKey)&&j.shiftKey&&j.key.toLowerCase()==="a",A=document.activeElement.tagName;if(!(A==="INPUT"||A==="TEXTAREA")&&D){j.preventDefault();const O=y.map(V=>V.name),M=O.filter(V=>!r.includes(V)).length>0;O.forEach(V=>{o(V,M)})}};return window.addEventListener("keydown",R),()=>{window.removeEventListener("keydown",R)}},[y,r,o]),!n||!t?a.jsxs(Io,{children:[a.jsx(Fl,{connector:e}),a.jsx(Yi,{icon:a.jsx(mf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(gu,{label:"Need fields?"})]}):y.length?a.jsx(Io,{children:a.jsxs(a.Fragment,{children:[a.jsx(Fl,{connector:e}),a.jsxs("div",{className:"border-border -mt-6 mb-6 flex w-full items-center gap-2 border-b",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Jl,{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()}}),a.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&&a.jsx("button",{type:"button",onClick:()=>{d("")},className:"text-muted-foreground hover:text-foreground absolute top-1/2 right-0 -translate-y-1/2",children:a.jsx(xu,{className:"h-4 w-4"})})]}),a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsxs(xe,{variant:"ghost",size:"icon","aria-label":"Sort fields",children:[f===Us.ASC&&a.jsx(xR,{className:"text-muted-foreground h-4 w-4"}),f===Us.DESC&&a.jsx(vR,{className:"text-muted-foreground h-4 w-4"}),f===Us.ORIGINAL&&a.jsx(bR,{className:"text-muted-foreground h-4 w-4"})]})}),a.jsxs(fr,{align:"end",children:[a.jsxs(pt,{onSelect:()=>{h(Us.ASC)},children:[a.jsx(xR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"A–Z"]}),a.jsxs(pt,{onSelect:()=>{h(Us.DESC)},children:[a.jsx(vR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Z–A"]}),a.jsxs(pt,{onSelect:()=>{h(Us.ORIGINAL)},children:[a.jsx(bR,{className:"text-muted-foreground mr-2 h-4 w-4"}),"Original"]})]})]})]}),a.jsxs(Pl,{title:`Selected ${String(C)} of ${String(S.length)} fields for "${n}" data`,children:[E.map(R=>{const j=v.includes(R.name);return a.jsx(iO,{type:"checkbox",id:`field-${R.name}`,name:"selectedFields",value:R.name,checked:r.includes(R.name),selected:r.includes(R.name)||j,disabled:j,onChange:_=>{o(R.name,_)},label:R.name,tooltip:a.jsxs("div",{className:"flex flex-col gap-2 py-1",children:[j&&a.jsxs("p",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-semibold",children:"Unique key"})," ",a.jsx(j0,{className:"text-secondary h-3 w-3"})]}),a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Type:"})," ",R.type]}),R.description&&a.jsxs("p",{children:[a.jsx("span",{className:"font-semibold",children:"Description:"})," ",R.description]})]}),rightIcon:j?a.jsx(j0,{className:"text-muted-foreground/75 h-4 w-4"}):void 0},R.name)}),E.length===0&&c&&a.jsxs("div",{className:"text-muted-foreground pt-8 pb-4 text-center text-sm",children:['No fields match "',c,'"']}),a.jsx(gu,{label:"Need another field?"})]})]})}):a.jsxs(Io,{children:[a.jsx(Fl,{connector:e}),a.jsx(Yi,{icon:a.jsx(mf,{size:56,strokeWidth:1}),title:"No fields found",subtitle:"This connector might not be fully implemented yet or there could be other issues."}),a.jsx(gu,{label:"Need fields?"})]})}const s5=m.createContext(void 0),o5={triggers:[],selectedTrigger:null,isLoading:!1,error:null};function qne(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 o5;default:return e}}class Zne extends ac{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 Jc=new Zne;var En=(e=>(e.REPORT_RUN="REPORT_RUN",e.CONNECTOR_RUN="CONNECTOR_RUN",e))(En||{});const cu={SCHEDULED_REPORT_RUN:"scheduled-report-run-config"};class x1{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!==En.REPORT_RUN)return t;const n=t.triggerConfig;if(!n.reportId)return t;try{const r=await No.getReportById(n.reportId),o=Al(r);return{...t,triggerConfig:{...n,report:o}}}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:En.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 Kne{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:En.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 l0={getMapper(e){switch(e){case En.REPORT_RUN:return new x1;case En.CONNECTOR_RUN:return new Kne;default:throw new Error(`Unknown scheduled trigger type: ${String(e)}`)}}},Zd={mapFromDto(e){return l0.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 En.REPORT_RUN:return new x1().enhanceWithReportData(n);case En.CONNECTOR_RUN:{const r=t.definition;return{...n,triggerConfig:{...n.triggerConfig,connector:r}}}default:return n}},async mapFromDtoListWithReportData(e,t){const n=new x1,r=this.mapFromDtoList(e),o=r.filter(c=>c.type===En.REPORT_RUN),l=await n.enhanceTriggersWithReportData(o);return r.map(c=>{switch(c.type){case En.REPORT_RUN:return l.find(d=>d.id===c.id)??c;case En.CONNECTOR_RUN:{const d=t.definition;return{...c,triggerConfig:{...c.triggerConfig,connector:d}}}default:return c}})},mapToCreateRequest(e){return l0.getMapper(e.type).mapToCreateRequest(e)},mapToUpdateRequest(e){return l0.getMapper(e.type).mapToUpdateRequest(e)}};function Yne({children:e}){const[t,n]=m.useReducer(qne,o5),{dataMart:r}=Wo(),{fetchAvailableConnectors:o}=dc();if(!r)throw new Error("Trigger provider must be used within a data mart context");const l=m.useCallback(async b=>{await o(),n({type:"FETCH_TRIGGERS_START"});try{const E=await Jc.getScheduledTriggers(b),S=await Zd.mapFromDtoListWithReportData(E,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:S})}catch(E){const S=E instanceof Error?E.message:"Failed to fetch scheduled triggers";n({type:"FETCH_TRIGGERS_ERROR",payload:S}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"ListError",label:S})}},[r,o]),c=m.useCallback(async(b,E)=>{n({type:"FETCH_TRIGGERS_START"});try{const C=(await Jc.getScheduledTriggers(b)).filter(j=>j.type===E),R=await Zd.mapFromDtoListWithReportData(C,r);n({type:"FETCH_TRIGGERS_SUCCESS",payload:R})}catch(S){const C=S instanceof Error?S.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]),d=m.useCallback(async(b,E)=>{n({type:"FETCH_TRIGGER_START"});try{const S=await Jc.getScheduledTrigger(b,E),C=await Zd.mapFromDtoWithReportData(S,r);n({type:"FETCH_TRIGGER_SUCCESS",payload:C})}catch(S){const C=S instanceof Error?S.message:"Failed to fetch scheduled trigger";n({type:"FETCH_TRIGGER_ERROR",payload:C}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"GetError",label:C})}},[r]),f=m.useCallback(async(b,E,S,C,R,j)=>{n({type:"CREATE_TRIGGER_START"});try{const _={type:E,cronExpression:S,timeZone:C,isActive:R,triggerConfig:j},D=await Jc.createScheduledTrigger(b,_),A=await Zd.mapFromDtoWithReportData(D,r);return n({type:"CREATE_TRIGGER_SUCCESS",payload:A}),Ue({event:"scheduled_trigger_created",category:"ScheduledTrigger",action:"Create",label:E}),on.success("Trigger created"),A}catch(_){const D=_ instanceof Error?_.message:"Failed to create scheduled trigger";throw n({type:"CREATE_TRIGGER_ERROR",payload:D}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"CreateError",label:D}),_}},[r]),h=m.useCallback(async(b,E,S,C,R)=>{n({type:"UPDATE_TRIGGER_START"});try{const j={cronExpression:S,timeZone:C,isActive:R},_=await Jc.updateScheduledTrigger(b,E,j),D=await Zd.mapFromDtoWithReportData(_,r);n({type:"UPDATE_TRIGGER_SUCCESS",payload:D}),Ue({event:"scheduled_trigger_updated",category:"ScheduledTrigger",action:"Update",label:D.type}),on.success("Trigger updated")}catch(j){const _=j instanceof Error?j.message:"Failed to update scheduled trigger";throw n({type:"UPDATE_TRIGGER_ERROR",payload:_}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"UpdateError",label:_}),j}},[r]),g=m.useCallback(async(b,E)=>{n({type:"DELETE_TRIGGER_START"});try{await Jc.deleteScheduledTrigger(b,E),n({type:"DELETE_TRIGGER_SUCCESS",payload:E}),Ue({event:"scheduled_trigger_deleted",category:"ScheduledTrigger",action:"Delete",label:E}),on.success("Trigger deleted")}catch(S){const C=S instanceof Error?S.message:"Failed to delete scheduled trigger";throw n({type:"DELETE_TRIGGER_ERROR",payload:C}),Ue({event:"scheduled_trigger_error",category:"ScheduledTrigger",action:"DeleteError",label:C}),S}},[]),y=m.useCallback(b=>{n({type:"SELECT_TRIGGER",payload:b})},[]),v=m.useCallback(()=>{n({type:"RESET"})},[]);return a.jsx(s5.Provider,{value:{...t,getScheduledTriggers:l,getScheduledTriggersByType:c,getScheduledTrigger:d,createScheduledTrigger:f,updateScheduledTrigger:h,deleteScheduledTrigger:g,selectScheduledTrigger:y,reset:v},children:e})}function i5(){const e=m.useContext(s5);if(e===void 0)throw new Error("useScheduledTriggerContext must be used within a ScheduledTriggerProvider");return e}function Wne(e){const{getScheduledTriggers:t,getScheduledTriggersByType:n,getScheduledTrigger:r,createScheduledTrigger:o,updateScheduledTrigger:l,deleteScheduledTrigger:c,selectScheduledTrigger:d,reset:f,triggers:h,selectedTrigger:g,isLoading:y,error:v}=i5();return m.useEffect(()=>(e?t(e):f(),()=>{f()}),[e,t,f]),{triggers:h,selectedTrigger:g,isLoading:y,error:v,getScheduledTriggers:b=>t(b),getScheduledTriggersByType:(b,E)=>n(b,E),getScheduledTrigger:(b,E)=>r(b,E),createScheduledTrigger:(b,E,S,C,R,j)=>o(b,E,S,C,R,j),updateScheduledTrigger:(b,E,S,C,R)=>l(b,E,S,C,R),deleteScheduledTrigger:(b,E)=>c(b,E),selectScheduledTrigger:d}}const Qne=Jt({type:ga(cu.SCHEDULED_REPORT_RUN),reportId:$t().min(1,"Report ID is required")}),Xne=KG(),Jne=Jt({type:Ng(En),cronExpression:$t().min(1,"Cron expression is required"),timeZone:$t().min(1,"Time zone is required"),isActive:ZG(),triggerConfig:WG([Qne,Xne])});function ere({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r}){const o=Qo({resolver:ll(Jne),defaultValues:{type:e?e.type:n??En.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:cu.SCHEDULED_REPORT_RUN,reportId:t??""}}});m.useEffect(()=>{t&&o.getValues("type")===En.REPORT_RUN&&o.setValue("triggerConfig",{type:cu.SCHEDULED_REPORT_RUN,reportId:t})},[t,o]),m.useEffect(()=>{n&&(o.setValue("type",n),n===En.REPORT_RUN?o.setValue("triggerConfig",{type:cu.SCHEDULED_REPORT_RUN,reportId:t??""}):o.setValue("triggerConfig",null))},[n,t,o]);const l=d=>{o.setValue("type",d),d===En.REPORT_RUN?o.setValue("triggerConfig",{type:cu.SCHEDULED_REPORT_RUN,reportId:t??""}):o.setValue("triggerConfig",null)},c=async d=>{try{await r(d)}catch(f){console.error("Error submitting form:",f)}};return{form:o,handleTypeChange:l,handleSubmit:o.handleSubmit(c),isDirty:o.formState.isDirty}}const tre=[je.GOOGLE_SHEETS,je.EMAIL,je.SLACK,je.MS_TEAMS,je.GOOGLE_CHAT];function nre({value:e,onChange:t,disabled:n}){const{reports:r,fetchReportsByDataMartId:o}=Ts(),{dataMart:l}=Wo();m.useEffect(()=>{l&&o(l.id)},[o,l]);const c=r.filter(d=>tre.includes(d.dataDestination.type));return a.jsxs(Kr,{value:e,onValueChange:t,disabled:n,children:[a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{placeholder:"Select a report"})}),a.jsx(Qr,{children:c.map(d=>{const f=Hr.getInfo(d.dataDestination.type).icon;return a.jsx(Rn,{value:d.id,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(f,{className:"h-4 w-4",size:16}),a.jsx("span",{children:d.title})]})},d.id)})})]})}var Jg="Switch",[rre]=cr(Jg),[are,sre]=rre(Jg),l5=m.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:o,defaultChecked:l,required:c,disabled:d,value:f="on",onCheckedChange:h,form:g,...y}=e,[v,b]=m.useState(null),E=dt(t,_=>b(_)),S=m.useRef(!1),C=v?g||!!v.closest("form"):!0,[R,j]=Gr({prop:o,defaultProp:l??!1,onChange:h,caller:Jg});return a.jsxs(are,{scope:n,checked:R,disabled:d,children:[a.jsx(et.button,{type:"button",role:"switch","aria-checked":R,"aria-required":c,"data-state":f5(R),"data-disabled":d?"":void 0,disabled:d,value:f,...y,ref:E,onClick:Te(e.onClick,_=>{j(D=>!D),C&&(S.current=_.isPropagationStopped(),S.current||_.stopPropagation())})}),C&&a.jsx(d5,{control:v,bubbles:!S.current,name:r,value:f,checked:R,required:c,disabled:d,form:g,style:{transform:"translateX(-100%)"}})]})});l5.displayName=Jg;var c5="SwitchThumb",u5=m.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,o=sre(c5,n);return a.jsx(et.span,{"data-state":f5(o.checked),"data-disabled":o.disabled?"":void 0,...r,ref:t})});u5.displayName=c5;var ore="SwitchBubbleInput",d5=m.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...o},l)=>{const c=m.useRef(null),d=dt(c,l),f=dS(n),h=sb(t);return m.useEffect(()=>{const g=c.current;if(!g)return;const y=window.HTMLInputElement.prototype,b=Object.getOwnPropertyDescriptor(y,"checked").set;if(f!==n&&b){const E=new Event("click",{bubbles:r});b.call(g,n),g.dispatchEvent(E)}},[f,n,r]),a.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...o,tabIndex:-1,ref:d,style:{...o.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});d5.displayName=ore;function f5(e){return e?"checked":"unchecked"}var ire=l5,lre=u5;function h5({className:e,...t}){return a.jsx(ire,{"data-slot":"switch",className:ne("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=unchecked]:bg-white/16",e),...t,children:a.jsx(lre,{"data-slot":"switch-thumb",className:ne("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 cre(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 b1(e,t="UTC"){const n=cre(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:o,day:l,month:c,dayOfWeek:d}=n;if(r.startsWith("*/")&&o==="*"&&l==="*"&&c==="*"&&d==="*"){const y=Number.parseInt(r.substring(2));if(!isNaN(y))return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:y,timezone:t}}if(r!=="*"&&o.startsWith("*/")&&l==="*"&&c==="*"&&d==="*"){const y=Number.parseInt(o.substring(2));if(!isNaN(y)&&r==="0")return{type:"interval",time:"09:00",weekdays:[1,2,3,4,5],monthDays:[1],customCron:e,intervalType:"hours",intervalValue:y,timezone:t}}const f=Number.parseInt(r),h=Number.parseInt(o),g=!isNaN(f)&&!isNaN(h)?`${h.toString().padStart(2,"0")}:${f.toString().padStart(2,"0")}`:"09:00";if(!isNaN(f)&&!isNaN(h)&&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(h)&&l==="*"&&c==="*"&&d!=="*"){const y=d.split(",").map(v=>Number.parseInt(v.trim())).filter(v=>!isNaN(v)&&v>=0&&v<=6);if(y.length>0)return{type:"weekly",time:g,weekdays:y,monthDays:[1],customCron:e,intervalType:"minutes",intervalValue:15,timezone:t}}if(!isNaN(f)&&!isNaN(h)&&l!=="*"&&c==="*"&&d==="*"){const y=l.split(",").map(v=>Number.parseInt(v.trim())).filter(v=>!isNaN(v)&&v>=1&&v<=31);if(y.length>0)return{type:"monthly",time:g,weekdays:[1,2,3,4,5],monthDays:y,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 m5({options:e,selected:t,onSelectionChange:n,placeholder:r="Select items...",searchPlaceholder:o="Search...",maxDisplayItems:l=3}){const[c,d]=m.useState(!1),f=y=>{const v=t.includes(y)?t.filter(b=>b!==y):[...t,y].sort((b,E)=>b-E);n(v)},h=(y,v)=>{v.preventDefault(),v.stopPropagation(),n(t.filter(b=>b!==y))},g=()=>{if(t.length===0)return a.jsx("span",{className:"text-muted-foreground text-sm",children:r});const y=t.map(v=>e.find(b=>b.value===v)).filter(Boolean);return y.length<=l?a.jsx("div",{className:"flex flex-wrap gap-1",children:y.map(v=>a.jsxs(gr,{variant:"secondary",className:"h-5 text-xs",children:[v.label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:b=>h(v.value,b),children:a.jsx(xu,{className:"h-2 w-2"})})]},v.value))}):a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs(gr,{variant:"secondary",className:"h-5 text-xs",children:[y[0].label,a.jsx("span",{className:"hover:bg-secondary-foreground/20 ml-1 inline-flex cursor-pointer items-center justify-center rounded-full p-0.5",onClick:v=>h(y[0].value,v),children:a.jsx(xu,{className:"h-2 w-2"})})]}),y.length>1&&a.jsxs(gr,{variant:"outline",className:"h-5 text-xs",children:["+",y.length-1]})]})};return a.jsxs(_S,{open:c,onOpenChange:d,modal:!0,children:[a.jsx(NS,{asChild:!0,children:a.jsxs(xe,{variant:"outline",role:"combobox","aria-expanded":c,className:"h-9 min-h-9 w-full justify-between bg-transparent py-1",children:[a.jsx("div",{className:"flex-1 text-left",children:g()}),a.jsx($1,{className:"ml-2 h-3 w-3 shrink-0 opacity-50"})]})}),a.jsx(AS,{className:"max-h-[400px] w-full overflow-y-auto p-0",style:{padding:0},children:a.jsxs(FO,{className:"h-full overflow-visible",children:[a.jsx(VO,{placeholder:o,className:"h-8"}),a.jsxs(Pte,{className:"h-full max-h-[350px] overflow-y-auto",children:[a.jsx(zO,{children:"No items found."}),a.jsx(HO,{className:"h-full overflow-visible",children:e.map(y=>a.jsxs($O,{value:y.value.toString(),onSelect:()=>f(y.value),className:"text-sm",children:[a.jsx(lr,{className:ne("mr-2 h-3 w-3",t.includes(y.value)?"opacity-100":"opacity-0")}),y.label]},y.value))})]})]})})]})}const p5=[{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"}],Hm=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return"UTC"}};function g5(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(o=>{var l;return(l=p5.find(c=>c.value===o))==null?void 0:l.label}).join(", ")} at ${n}`;case"monthly":{const o=[...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 ${o.length===1?o[0]:o.length===2?`${o[0]} and ${o[1]}`:`${o.slice(0,-1).join(", ")}, and ${o[o.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 ure(e,t,n=!0){const r=b1(e,t);return g5(r,n)}const dre=Array.from({length:31},(e,t)=>({value:t+1,label:`${String(t+1)}${t===0?"st":t===1?"nd":t===2?"rd":"th"}`})),S1=[5,10,15,30],C1=[1,2,3,4,6,8,12],fre=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Type"}),a.jsxs(Kr,{value:e,onValueChange:r=>{t(r)},disabled:n,children:[a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{})}),a.jsxs(Qr,{children:[a.jsx(Rn,{value:"daily",children:"Daily"}),a.jsx(Rn,{value:"weekly",children:"Weekly"}),a.jsx(Rn,{value:"monthly",children:"Monthly"}),a.jsx(Rn,{value:"interval",children:"Interval"})]})]})]}),hre=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Time"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(Ht,{className:"w-24",type:"time",value:e,onChange:r=>{t(r.target.value)},disabled:n})})]}),bT=({value:e,onChange:t,disabled:n,timezones:r})=>a.jsxs("div",{className:"w-full space-y-2",children:[a.jsx(Ma,{children:"Timezone"}),a.jsx("div",{className:"flex items-center gap-2",children:a.jsx(DS,{options:r,value:e,onValueChange:t,placeholder:"Select timezone",emptyMessage:"No timezones found",disabled:n,className:"w-full"})})]}),mre=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Days of Week"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(m5,{options:p5,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:3})})]}),pre=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Days of Month"}),a.jsx("div",{className:n?"pointer-events-none":"",children:a.jsx(m5,{options:dre,selected:e,onSelectionChange:t,placeholder:"Select days...",maxDisplayItems:4})})]}),gre=({intervalType:e,intervalValue:t,onTypeChange:n,onValueChange:r,disabled:o})=>a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Type"}),a.jsxs(Kr,{value:e,onValueChange:l=>{n(l)},disabled:o,children:[a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{})}),a.jsxs(Qr,{children:[a.jsx(Rn,{value:"minutes",children:"Minutes"}),a.jsx(Rn,{value:"hours",children:"Hours"})]})]})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ma,{children:"Every"}),a.jsxs(Kr,{value:t.toString(),onValueChange:l=>{r(Number.parseInt(l)||1)},disabled:o,children:[a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{})}),a.jsx(Qr,{children:(e==="minutes"?S1:C1).map(l=>a.jsxs(Rn,{value:l.toString(),children:[l," ",e==="minutes"?"min":"hr"]},l))})]})]})]}),yre=({value:e,onChange:t,disabled:n})=>a.jsxs("div",{className:"space-y-1",children:[a.jsx(Ma,{className:"text-sm",children:"Cron Expression"}),a.jsx(Ht,{value:e,onChange:r=>{t(r.target.value)},placeholder:"0 9 * * *",className:"h-9 font-mono text-sm",disabled:n}),a.jsx("p",{className:"text-muted-foreground text-xs",children:"Format: minute hour day month day-of-week"})]});function vre({cron:e="0 9 * * *",timezone:t,enabled:n=!0,onChange:r,className:o,showPreview:l=!0,showSaveButton:c=!1}){const[d,f]=m.useState(n),[h,g]=m.useState(t??Hm()),[y,v]=m.useState(!1),b=m.useMemo(()=>xZ.getTimezonesWithOffset().map(U=>({value:U.identifier,label:U.displayName,offset:U.offsetString,isDST:U.isDST})),[]),[E,S]=m.useState(()=>b1(e,h)),[C,R]=m.useState(""),[j,_]=m.useState("");m.useEffect(()=>{f(n)},[n]),m.useEffect(()=>{const U=t??Hm();g(U)},[t]),m.useEffect(()=>{if(e){const U=b1(e,h);S(U)}},[e,h]);const D=U=>{const[H,k]=U.time.split(":").map(Number);switch(U.type){case"daily":return`${String(k)} ${String(H)} * * *`;case"weekly":return`${String(k)} ${String(H)} * * ${U.weekdays.join(",")}`;case"monthly":return`${String(k)} ${String(H)} ${U.monthDays.join(",")} * *`;case"interval":return U.intervalType==="minutes"?`*/${String(U.intervalValue)} * * * *`:`0 */${String(U.intervalValue)} * * *`;case"custom":return U.customCron;default:return`${String(k)} ${String(H)} * * *`}},A=m.useCallback(U=>{S(H=>{if(H.intervalType===U)return console.log("Type unchanged, skipping update"),H;const $=(U==="minutes"?S1:C1)[0];return{...H,intervalType:U,intervalValue:$}})},[]),O=m.useCallback(U=>{S(H=>(H.intervalType==="minutes"?S1:C1).includes(U)?{...H,intervalValue:U}:H)},[]),T=m.useMemo(()=>U=>g5(U,d),[d]);m.useEffect(()=>{const U=D(E);R(U),_(T(E))},[E,d,h,T]);const M=m.useRef(""),V=m.useRef(""),Z=m.useRef(!1);m.useEffect(()=>{const U=D(E);r&&(M.current!==U||V.current!==h||Z.current!==d)&&(r({cron:U,timezone:h,enabled:d}),M.current=U,V.current=h,Z.current=d)},[E,h,d,r]);const K=U=>{f(U)},Y=U=>{g(U),S(H=>({...H,timezone:U}))},G=["daily","weekly","monthly"].includes(E.type);return a.jsxs("div",{className:o,children:[a.jsx("div",{className:"mb-4 space-y-4 pt-0",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-foreground flex items-center gap-1.5 font-medium",children:"Schedule Settings"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ma,{htmlFor:"schedule-enabled",className:"text-sm font-normal",children:d?"Enabled":"Disabled"}),a.jsx(h5,{id:"schedule-enabled",checked:d,onCheckedChange:K})]})]})}),a.jsxs("div",{className:"space-y-4 pt-0",children:[a.jsxs("div",{className:`space-y-4 ${d?"":"opacity-50"}`,children:[a.jsx(fre,{value:E.type,onChange:U=>{S(H=>({...H,type:U}))},disabled:!d}),E.type!=="custom"&&E.type!=="interval"&&a.jsxs("div",{className:"flex gap-3",children:[a.jsx(hre,{value:E.time,onChange:U=>{S(H=>({...H,time:U}))},disabled:!d}),G&&a.jsx(bT,{value:h,onChange:Y,disabled:!d,timezones:b})]}),(E.type==="interval"||E.type==="custom")&&a.jsx(bT,{value:h,onChange:Y,disabled:!d,timezones:b}),E.type==="weekly"&&a.jsx(mre,{value:E.weekdays,onChange:U=>{S(H=>({...H,weekdays:U}))},disabled:!d}),E.type==="monthly"&&a.jsx(pre,{value:E.monthDays,onChange:U=>{S(H=>({...H,monthDays:U}))},disabled:!d}),E.type==="interval"&&a.jsx(gre,{intervalType:E.intervalType,intervalValue:E.intervalValue,onTypeChange:A,onValueChange:O,disabled:!d}),E.type==="custom"&&a.jsx(yre,{value:E.customCron,onChange:U=>{S(H=>({...H,customCron:U}))},disabled:!d})]}),l&&a.jsxs(a.Fragment,{children:[a.jsx(Z_,{className:"my-3"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{v(!y)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(A_,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm font-medium",children:"Preview"})]}),y?a.jsx(ns,{className:"text-muted-foreground h-4 w-4"}):a.jsx(ka,{className:"text-muted-foreground h-4 w-4"})]}),y&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Status:"}),a.jsx(gr,{variant:d?"default":"secondary",className:"text-xs",children:d?"Enabled":"Disabled"})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Cron:"}),a.jsx(gr,{variant:"secondary",className:"font-mono text-xs",children:C})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Timezone:"}),a.jsx(gr,{variant:"outline",className:"text-xs",children:h})]}),a.jsxs("div",{className:"flex items-start justify-between gap-2",children:[a.jsx("span",{className:"text-muted-foreground text-xs",children:"Schedule:"}),a.jsx("span",{className:"flex-1 text-right text-xs",children:j})]})]}),d&&G&&h!==Hm()&&a.jsxs(MS,{className:"border-amber-200 bg-amber-50",children:[a.jsx(Df,{className:"h-4 w-4"}),a.jsx(r5,{children:"Time Zone"}),a.jsxs(IS,{children:["Schedule runs in ",h," (not your local ",Hm()," ","time). Execution time may differ from expected."]})]})]})]})]}),c&&a.jsx(xe,{className:"w-full",disabled:!d,children:"Save Schedule"})]})]})}function xre(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"trigger-type-options-description-details",children:[a.jsx(un,{children:"How do I choose a type?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Report Run"})," - runs a report to import data from the specified Data Storage into a Destination provider (e.g. Google Sheets document)."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Connector Run"})," - runs a connector (e.g., Facebook Ads) configured in the Data Mart to update raw data in the selected Data Storage."]})]})]})})}function bre(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"trigger-type-change-description-details",children:[a.jsx(un,{children:"How do I change the trigger type?"}),a.jsx(dn,{children:a.jsx("p",{children:"Trigger type cannot be changed after the trigger is created. If you need a different type, delete the existing trigger and create a new one with the desired type."})})]})})}function Sre(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"report-change-description-details",children:[a.jsx(un,{children:"How do I change a report?"}),a.jsx(dn,{children:a.jsx("p",{children:"The report cannot be changed after the trigger is created. If you need a different report, delete the existing trigger and create a new one with the desired report."})})]})})}function Cre(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"report-select-description-details",children:[a.jsx(un,{children:"How do I choose the report?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"For a Report Run trigger, select one of the available Destinations (e.g., a Google Sheets report)."}),a.jsxs("p",{children:["You can use an existing one or create a new one on the ",a.jsx("strong",{children:"Destinations"})," tab"," ","of this Data Mart."]})]})]})})}function Ere({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:r,onCancel:o,onDirtyChange:l}){const[c,d]=m.useState(!1),{form:f,handleTypeChange:h,handleSubmit:g,isDirty:y}=ere({initialData:e,preSelectedReportId:t,preSelectedType:n,onSubmit:async C=>{d(!0);try{await r(C)}finally{d(!1)}}});m.useEffect(()=>{l==null||l(y)},[y,l]);const{control:v,watch:b}=f,S=b("type")===En.REPORT_RUN;return a.jsx(rl,{...f,children:a.jsxs(Xo,{onSubmit:C=>void g(C),noValidate:!1,children:[a.jsxs(al,{children:[a.jsx(kt,{control:v,name:"type",render:({field:C})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Choose what you want this trigger to run - a report or a connector",children:"Trigger Type"}),a.jsxs(Kr,{onValueChange:R=>{C.onChange(R),h(R)},defaultValue:C.value,disabled:!!n||!!e||!!b("triggerConfig.reportId"),children:[a.jsx(Nt,{children:a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{placeholder:"Select trigger type"})})}),a.jsxs(Qr,{children:[a.jsx(Rn,{value:En.REPORT_RUN,children:"Report Run"}),a.jsx(Rn,{value:En.CONNECTOR_RUN,children:"Connector Run"})]})]}),a.jsx(wn,{children:e?a.jsx(bre,{}):a.jsx(xre,{})}),a.jsx(Ft,{})]})}),S&&a.jsx(kt,{control:v,name:"triggerConfig.reportId",render:({field:C})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Select the report that will be run by this trigger",children:"Report"}),a.jsx(Nt,{children:a.jsx(s3,{children:a.jsx(nre,{value:C.value,onChange:C.onChange,disabled:!!t||!!e})})}),a.jsx(wn,{children:e!=null&&e.triggerConfig?a.jsx(Sre,{}):a.jsx(Cre,{})}),a.jsx(Ft,{})]})}),a.jsx(vre,{showPreview:!1,cron:b("cronExpression"),timezone:b("timeZone"),enabled:b("isActive"),onChange:C=>{f.setValue("cronExpression",C.cron,{shouldDirty:!0}),f.setValue("timeZone",C.timezone,{shouldDirty:!0}),f.setValue("isActive",C.enabled,{shouldDirty:!0})},className:"border-border flex flex-col gap-1.5 rounded-md border-b bg-white px-4 py-3 transition-shadow duration-200 hover:shadow-sm dark:border-transparent dark:bg-white/4"})]}),a.jsxs(sl,{children:[a.jsx(xe,{variant:"default",type:"submit",className:"w-full","aria-label":e?"Save changes":"Create trigger",disabled:!y||c,children:c?e?"Saving...":"Creating...":e?"Save changes":"Create trigger"}),o&&a.jsx(xe,{variant:"outline",type:"button",onClick:o,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function wre({cronExpression:e,timeZone:t,isEnabled:n=!0}){const r=m.useMemo(()=>ure(e,t,n),[e,t,n]);return a.jsxs("div",{children:[a.jsx("div",{children:r}),n&&a.jsx("code",{className:"text-muted-foreground mt-1 block text-xs",children:t})]})}function Rre({table:e}){return a.jsx("div",{className:"text-right",children:a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(pt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta.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()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta.title??t.id})]})},t.id))})]})})}function jre({trigger:e,onEditTrigger:t,onDeleteTrigger:n}){const[r,o]=m.useState(!1),[l,c]=m.useState(!1),d=()=>{c(!1),n(e.id)};return a.jsxs("div",{className:"text-right",onClick:f=>{f.stopPropagation()},children:[a.jsxs(ur,{open:r,onOpenChange:o,children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${r?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(fr,{align:"end",children:[a.jsxs(pt,{onClick:()=>{t(e.id)},children:[a.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit trigger"]}),a.jsx(ma,{}),a.jsxs(pt,{onClick:()=>{c(!0)},children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete trigger"})]})]})]}),a.jsx(Tr,{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 Tre({connector:e}){const{connectors:t}=dc(),n=mQ(e,t);return a.jsx(a.Fragment,{children:n})}function y5({connector:e}){return a.jsx(Tre,{connector:e})}function _re(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 Nre=e=>{const{connectors:t}=dc();return m.useMemo(()=>t.find(n=>n.name===e),[t,e])},Are=ye.memo(function({connector:t,children:n}){const r=Nre(t.source.name),{dataMart:o,runs:l,getDataMartRuns:c}=Wo();m.useEffect(()=>{o!=null&&o.id&&c(o.id)},[o==null?void 0:o.id,c]);const d=m.useMemo(()=>r!=null&&r.logoBase64?a.jsx(rc,{base64:r.logoBase64,size:20}):null,[r==null?void 0:r.logoBase64]),f=m.useCallback(()=>{o!=null&&o.storage&&WZ(o.storage,t.storage.fullyQualifiedName)},[o==null?void 0:o.storage,t.storage.fullyQualifiedName]),h=m.useMemo(()=>_re(l),[l]),g=m.useMemo(()=>!h.lastRunDate||!h.lastRunStatus?null:{statusType:oY(h.lastRunStatus),statusText:lY(h.lastRunStatus),date:h.lastRunDate},[h]),y=m.useMemo(()=>(o==null?void 0:o.storage)&&QZ(o.storage),[o]),v=m.useMemo(()=>{const b=t.source.fields.length.toString();return`${t.source.node} • ${b} fields`},[t.source.node,t.source.fields.length]);return a.jsxs(Pb,{children:[a.jsx(Ub,{asChild:!0,children:a.jsx("span",{children:n})}),a.jsxs(Fb,{children:[a.jsxs(Vb,{children:[a.jsx(zb,{children:d}),a.jsxs(Hb,{children:[a.jsx($b,{children:a.jsx(y5,{connector:t})}),a.jsx(Bb,{children:v})]})]}),a.jsxs(Gb,{children:[a.jsxs(ki,{children:[a.jsx(Li,{children:"Last run status:"}),a.jsx(Pi,{children:g?a.jsx(Wf,{type:g.statusType,variant:"ghost",children:g.statusText}):"Not run yet"})]}),a.jsxs(ki,{children:[a.jsx(Li,{children:"Last run date:"}),a.jsx(Pi,{children:g?a.jsx(Zi,{date:g.date}):"Never run"})]}),a.jsxs(ki,{children:[a.jsx(Li,{children:"Total runs:"}),a.jsxs(Pi,{children:[h.totalRuns," runs",h.firstRunDate&&a.jsxs(a.Fragment,{children:[", since"," ",h.firstRunDate.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]})]})]}),a.jsx(qb,{children:a.jsxs(xe,{className:"w-full",variant:"default",onClick:f,title:"Open Storage","aria-label":"Open Storage",children:[y,a.jsx(Uo,{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 Dre(e){const t=e.triggerConfig,n=Hr.getInfo(t.report.dataDestination.type).icon;return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[a.jsx(n,{className:"h-4 w-4",size:16}),t.report.title,a.jsx(aY,{report:t.report,children:a.jsx(Br,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Ore(e){var o;const t=e.triggerConfig,{connector:n}=t.connector,r=(o=n.info)!=null&&o.logoBase64?a.jsx(rc,{base64:n.info.logoBase64,className:"h-4 w-4",size:16}):a.jsx(zl,{className:"h-4 w-4",size:16});return a.jsxs("div",{className:"group inline-flex items-center gap-2 whitespace-nowrap",children:[r,a.jsx(y5,{connector:n}),a.jsx(Are,{connector:n,children:a.jsx(Br,{className:"inline-block h-4 w-4 align-text-bottom opacity-0 transition-opacity duration-200 group-hover:opacity-100"})})]})}function Mre({trigger:e}){switch(e.type){case En.REPORT_RUN:return Dre(e);case En.CONNECTOR_RUN:return Ore(e);default:return a.jsx("div",{className:"text-muted-foreground text-sm",children:"—"})}}function Ire({onEditTrigger:e,onDeleteTrigger:t}){return[{accessorKey:"type",size:150,header:"Trigger Type",cell:({row:n})=>{const o=n.getValue("type")===En.REPORT_RUN?"Report Run":"Connector Run";return a.jsx(gr,{variant:"outline",children:o})},meta:{title:"Trigger Type"}},{accessorKey:"triggerConfig",size:35,header:"Run Target",cell:({row:n})=>a.jsx(Mre,{trigger:n.original}),meta:{title:"Run Target"}},{accessorKey:"cronExpression",size:20,header:"Schedule",cell:({row:n})=>{const r=n.getValue("cronExpression"),o=n.original.timeZone,l=n.getValue("isActive");return a.jsx(wre,{cronExpression:String(r),timeZone:o,isEnabled:l})},meta:{title:"Schedule"}},{accessorKey:"nextRun",size:15,header:"Next Run",cell:({row:n})=>{const r=n.original.nextRun;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Zi,{date:new Date(r)}):"Not scheduled"})},meta:{title:"Next Run"}},{accessorKey:"lastRun",size:15,header:"Last Run",cell:({row:n})=>{const r=n.original.lastRun;return a.jsx("div",{className:"text-sm",children:r?a.jsx(Zi,{date:new Date(r)}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"Never run"})})},meta:{title:"Last Run"}},{accessorKey:"isActive",size:15,header:"Trigger Status",cell:({row:n})=>{const r=n.getValue("isActive");return a.jsx(Wf,{type:r?In.SUCCESS:In.NEUTRAL,variant:"ghost",showIcon:!1,children:r?"Enabled":"Disabled"})},meta:{title:"Trigger Status"}},{id:"actions",size:80,header:({table:n})=>a.jsx(Rre,{table:n}),cell:({row:n})=>a.jsx(jre,{trigger:n.original,onEditTrigger:e,onDeleteTrigger:t}),meta:{title:"Actions"}}]}function kre({table:e,onPreviousClick:t,onNextClick:n}){return a.jsxs("div",{className:"dm-card-pagination",role:"navigation","aria-label":"Table pagination",children:[a.jsx(xe,{variant:"outline",size:"sm",onClick:t,disabled:!e.getCanPreviousPage(),"aria-label":"Go to previous page",children:"Previous"}),a.jsx(xe,{variant:"outline",size:"sm",onClick:n,disabled:!e.getCanNextPage(),"aria-label":"Go to next page",children:"Next"})]})}function LS({isOpen:e,onClose:t,dataMartId:n,preSelectedReportId:r,preSelectedType:o}){const{createScheduledTrigger:l,updateScheduledTrigger:c,selectedTrigger:d}=i5(),[f,h]=m.useState(!1),[g,y]=m.useState(!1),v=m.useCallback(()=>{g?h(!0):t()},[g,t]),b=m.useCallback(()=>{h(!1),y(!1),t()},[t]),E=m.useCallback(D=>{y(D)},[]),S=m.useCallback(()=>{y(!1),t()},[t]),C=!!d,R=m.useMemo(()=>d?{type:d.type,cronExpression:d.cronExpression,timeZone:d.timeZone,isActive:d.isActive,triggerConfig:d.type===En.REPORT_RUN?{type:cu.SCHEDULED_REPORT_RUN,reportId:d.triggerConfig.reportId}:null}:void 0,[d]),j=async D=>{C?await c(n,d.id,D.cronExpression,D.timeZone,D.isActive):await l(n,D.type,D.cronExpression,D.timeZone,D.isActive,D.triggerConfig),S()},_=m.useRef(!1);return m.useEffect(()=>{const D=C?"Edit":"Create",A=(d==null?void 0:d.type)??o;e&&!_.current?(Ue({event:"scheduled_trigger_config_open",category:"ScheduledTrigger",action:D,label:A}),_.current=!0):!e&&_.current&&(Ue({event:"scheduled_trigger_config_close",category:"ScheduledTrigger",action:D,label:A}),_.current=!1)},[e,C,d,o]),a.jsxs(a.Fragment,{children:[a.jsx($o,{open:e,onOpenChange:D=>{D||v()},children:a.jsxs(Bo,{children:[a.jsxs(Go,{children:[a.jsxs(qo,{children:[C?"Edit":"Create"," Scheduled Trigger"]}),a.jsx(Xi,{children:"Configure automatic runs for your reports or connectors."})]}),a.jsx(Ere,{preSelectedReportId:r,preSelectedType:o,initialData:R,onSubmit:j,onCancel:v,onDirtyChange:E})]})}),a.jsx(Tr,{open:f,onOpenChange:h,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:b,variant:"destructive"})]})}function Lre({triggers:e,dataMartId:t,onEditTrigger:n,onDeleteTrigger:r}){const[o,l]=m.useState(!1),c=m.useCallback(()=>{l(!1)},[]),d=m.useCallback(R=>{r(R)},[r]),f=m.useMemo(()=>Ire({onEditTrigger:n,onDeleteTrigger:d}),[n,d]),{sorting:h,setSorting:g,columnVisibility:y,setColumnVisibility:v}=Vu({columns:f,storageKeyPrefix:"data-mart-scheduled-triggers",defaultSortingColumn:"type"}),b=oc({data:e,columns:f,getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:g,getSortedRowModel:Fu(),getFilteredRowModel:Jf(),state:{sorting:h,columnVisibility:y},onColumnVisibilityChange:v,enableGlobalFilter:!0,enableColumnResizing:!1}),E=m.useCallback(()=>{b.previousPage()},[b]),S=m.useCallback(()=>{b.nextPage()},[b]);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(ic,{id:"scheduled-triggers-table",className:"dm-card-table",role:"table","aria-label":"Scheduled Triggers",children:[a.jsx(lc,{className:"dm-card-table-header",children:b.getHeaderGroups().map(R=>a.jsx(Pn,{className:"dm-card-table-header-row",children:R.headers.map(j=>a.jsx(uc,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",scope:"col",style:j.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:j.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(j.getSize())}%`},children:j.isPlaceholder?null:typeof j.column.columnDef.header=="function"?j.column.columnDef.header(j.getContext()):j.column.columnDef.header},j.id))},R.id))}),a.jsx(cc,{className:"dm-card-table-body",children:b.getRowModel().rows.length?b.getRowModel().rows.map((R,j)=>a.jsx(Pn,{onClick:()=>{n(R.original.id)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":j+1,children:R.getVisibleCells().map((_,D)=>a.jsx(Zr,{className:`whitespace-normal ${_.column.id==="actions"?"actions-cell":""}`,role:"cell","aria-colindex":D+1,style:_.column.id==="type"?{width:150,minWidth:150,maxWidth:150}:_.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(_.column.getSize())}%`},children:typeof _.column.columnDef.cell=="function"?_.column.columnDef.cell(_.getContext()):_.column.columnDef.cell},_.id))},R.id)):a.jsx(Pn,{children:a.jsx(Zr,{colSpan:f.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No scheduled triggers found."})})})})]})}),a.jsx(kre,{table:b,onPreviousClick:E,onNextClick:S}),a.jsx(LS,{isOpen:o,onClose:c,dataMartId:t})]})}function Pre({dataMartId:e}){const{triggers:t,deleteScheduledTrigger:n,selectScheduledTrigger:r,selectedTrigger:o}=Wne(e),[l,c]=m.useState(!1);m.useEffect(()=>{o&&c(!0)},[o]);const d=g=>{const y=t.find(v=>v.id===g);y&&r(y)},f=()=>{c(!1),r(null)},h=async g=>{try{await n(e,g)}catch(y){console.error("Error deleting trigger:",y)}};return a.jsxs(a.Fragment,{children:[a.jsx(Lre,{triggers:t,dataMartId:e,onEditTrigger:d,onDeleteTrigger:g=>void h(g)}),a.jsx(LS,{isOpen:l,onClose:f,dataMartId:e})]})}function PS(){return a.jsx("div",{className:"dm-card-block !gap-1.5 !py-3",children:a.jsxs("div",{className:"text-foreground flex items-start gap-1.5 text-sm",children:[a.jsx(M_,{className:"h-5 w-5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium",children:"Time Triggers"}),a.jsxs("p",{className:"text-muted-foreground",children:["Set up automatic runs in the ",a.jsx("span",{className:"font-medium",children:"Triggers"})," tab once you’ve saved and published this Data Mart."]})]})]})})}function Ure({dataStorageType:e,target:t,destinationName:n,connectorName:r,onTargetChange:o}){const l=n.replace(/[^a-zA-Z0-9_]/g,"_"),c=r.replace(/[^a-zA-Z0-9_]/g,"_").toLowerCase(),[d,f]=m.useState(""),[h,g]=m.useState(""),[y,v]=m.useState(null),[b,E]=m.useState(null),S=_=>_.trim()?/^[A-Za-z][A-Za-z0-9_]*$/.test(_)?null:"Use letters, numbers, and underscores; start with a letter":"This field is required",C=m.useCallback((_,D,A,O)=>{o({fullyQualifiedName:`${_}.${D}`,isValid:!!(_&&D&&A===null&&O===null)})},[o]);m.useEffect(()=>{let _="",D="";if(t!=null&&t.fullyQualifiedName){const V=t.fullyQualifiedName.split(".");_=V[0]??"",D=V[1]??""}else _=`${c}_owox`,D=l;const A=S(_),O=S(D);f(_),g(D),v(A),E(O);const T=`${_}.${D}`,M=!!(_&&D&&A===null&&O===null);((t==null?void 0:t.fullyQualifiedName)!==T||t.isValid!==M)&&C(_,D,A,O)},[t,l,c,C]);const R=_=>{f(_);const D=S(_);v(D),C(_,h,D,b)},j=_=>{g(_);const D=S(_);E(D),C(d,_,y,D)};return a.jsxs(Io,{children:[e===ke.GOOGLE_BIGQUERY&&a.jsxs(a.Fragment,{children:[a.jsx(Yi,{icon:a.jsx(wA,{}),title:"Google BigQuery",docUrl:"https://docs.owox.com/docs/storages/supported-storages/google-bigquery/",variant:"compact"}),a.jsxs(Pl,{title:"Choose where to store your data",children:[a.jsxs(Jd,{children:[a.jsx(Hs,{required:!0,htmlFor:"dataset-name",tooltip:"Enter dataset name for Google BigQuery where the connector data will be stored.",children:"Dataset name"}),a.jsx(Ht,{type:"text",id:"dataset-name",placeholder:"Enter dataset name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!y,"aria-describedby":y?"dataset-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Dataset is auto-created on first run if it doesn’t exist"}),y&&a.jsx("p",{id:"dataset-name-error",className:"text-destructive text-sm",children:y})]}),a.jsxs(Jd,{children:[a.jsx(Hs,{required:!0,htmlFor:"table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(Ht,{type:"text",id:"table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:h,"aria-invalid":!!b,"aria-describedby":b?"table-name-error":void 0,onChange:_=>{j(_.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&a.jsx("p",{id:"table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),e===ke.AWS_ATHENA&&a.jsxs(a.Fragment,{children:[a.jsx(Yi,{icon:a.jsx(RA,{}),title:"AWS Athena",docUrl:"https://docs.owox.com/docs/storages/supported-storages/aws-athena/",variant:"compact"}),a.jsxs(Pl,{title:"Choose where to store your data",children:[a.jsxs(Jd,{children:[a.jsx(Hs,{required:!0,htmlFor:"database-name",tooltip:"Enter database name for Amazon Athena where the connector data will be stored.",children:"Database name"}),a.jsx(Ht,{type:"text",id:"database-name",placeholder:"Enter database name",autoComplete:"off",className:"box-border w-full",value:d,"aria-invalid":!!y,"aria-describedby":y?"database-name-error":void 0,onChange:_=>{R(_.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Database is auto-created on first run if it doesn’t exist"}),y&&a.jsx("p",{id:"database-name-error",className:"text-destructive text-sm",children:y})]}),a.jsxs(Jd,{children:[a.jsx(Hs,{required:!0,htmlFor:"athena-table-name",tooltip:"Enter table name where the connector data will be stored.",children:"Table name"}),a.jsx(Ht,{type:"text",id:"athena-table-name",placeholder:"Enter table name",autoComplete:"off",className:"box-border w-full",value:h,"aria-invalid":!!b,"aria-describedby":b?"athena-table-name-error":void 0,onChange:_=>{j(_.target.value)},required:!0}),a.jsx("p",{className:"text-muted-foreground text-sm",children:"Table is auto-created on first run if it doesn’t exist"}),b&&a.jsx("p",{id:"athena-table-name-error",className:"text-destructive text-sm",children:b})]})]})]}),a.jsx(Pl,{title:"Schedule updates",children:a.jsx(PS,{})})]})}function Fre({onSubmit:e,dataStorageType:t,configurationOnly:n=!1,existingConnector:r=null,mode:o="full",initialStep:l,preselectedConnector:c,onDirtyChange:d}){const[f,h]=m.useState(!1),[g,y]=m.useState(null),[v,b]=m.useState(""),[E,S]=m.useState([]),[C,R]=m.useState(1),[j,_]=m.useState({}),[D,A]=m.useState(!1),[O,T]=m.useState(new Set),[M,V]=m.useState(new Set),{connectors:Z,connectorSpecification:K,connectorFields:Y,loading:G,loadingSpecification:U,loadingFields:H,error:k,fetchAvailableConnectors:$,fetchConnectorSpecification:q,fetchConnectorFields:ie}=dc();m.useEffect(()=>{d==null||d(f)},[f,d]);const[be,L]=m.useState(null),W=(n?[{id:1,title:"Configuration",description:"Set up connector parameters"}]:o==="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,te=m.useCallback(async Ve=>{!O.has(Ve)&&!U&&(T(F=>new Set(F).add(Ve)),await q(Ve))},[O,U,q]),ue=m.useCallback(async Ve=>{M.has(Ve)||(V(F=>new Set(F).add(Ve)),await ie(Ve))},[M,ie]);m.useEffect(()=>{if(!c||g||Z.length===0)return;const Ve=Z.find(F=>F.name===c);Ve&&(y(Ve),R(l??2),te(Ve.name),!n&&o!=="fields-only"&&ue(Ve.name))},[c,Z,g,l,n,o,te,ue]),m.useEffect(()=>{if(Z.length===0&&!G&&$(),r&&Z.length>0&&!g){const{source:Ve,storage:F}=r;b(Ve.node),S(Ve.fields),_(Ve.configuration[0]||{}),L({fullyQualifiedName:F.fullyQualifiedName,isValid:!0});const X=Z.find(de=>de.name===Ve.name);X&&(y(X),te(X.name),!n&&o!=="fields-only"&&ue(X.name),o==="fields-only"&&ue(X.name))}if(n&&Z.length>0&&!g&&!r){const Ve=Z[0];y(Ve),te(Ve.name)}},[o,r,Z,n,G,$,te,ue,g]);const ve=Ve=>{y(Ve),_({}),A(!1),h(!0),T(F=>{const X=new Set(F);return X.delete(Ve.name),X}),te(Ve.name),ue(Ve.name)},le=Ve=>{b(Ve),S([]),h(!0)},Ae=(Ve,F)=>{S(F?X=>X.includes(Ve)?X:[...X,Ve]:X=>X.filter(de=>de!==Ve)),h(!0)},we=(Ve,F)=>{S(F?X=>{const de=Ve.filter(_e=>!X.includes(_e));return[...X,...de]}:X=>X.filter(de=>!Ve.includes(de))),h(!0)},Ne=Ve=>{L(Ve),h(!0)},Be=m.useCallback(Ve=>{_(Ve),h(!0)},[]),Qe=m.useCallback(Ve=>{A(Ve)},[]);m.useEffect(()=>{K&&(K.some(F=>F.required&&F.name!=="Fields")||A(!0))},[K]);const qt=()=>{C<W&&R(C+1)},Dt=()=>{C>1&&R(C-1)},Zt=()=>{if(n)return g!==null&&D;if(o==="fields-only")switch(C){case 1:return E.length>0;default:return!1}switch(C){case 1:return g!==null;case 2:return D;case 3:return v!=="";case 4:return E.length>0;case 5:return be!==null&&be.fullyQualifiedName!==""&&be.isValid;default:return!1}},jn=()=>C>1,Nr=(Ve,F)=>{if(!Ve)return F;const X=Ve.find(de=>de.name===F);return(X==null?void 0:X.destinationName)??F},va=()=>{if(n&&C===1)return K&&g?a.jsx(vT,{connector:g,connectorSpecification:K,onConfigurationChange:Be,onValidationChange:Qe,initialConfiguration:j,loading:U,isEditingExisting:!!(r!=null&&r.source.configuration.length)}):null;if(o==="fields-only")switch(C){case 1:return g&&v&&Y?a.jsx(xT,{connector:g,connectorFields:Y,selectedField:v,selectedFields:E,onFieldToggle:Ae,onSelectAllFields:we}):null;default:return null}switch(C){case 1:return a.jsx(Nne,{connectors:Z,selectedConnector:g,loading:G,error:k,onConnectorSelect:ve,onConnectorDoubleClick:()=>{R(Ve=>Ve<W?Ve+1:Ve)}});case 2:return g&&K?a.jsx(vT,{connector:g,connectorSpecification:K,onConfigurationChange:Be,onValidationChange:Qe,initialConfiguration:j,loading:U,isEditingExisting:!1}):null;case 3:return g&&Y?a.jsx(Gne,{connectorFields:Y,connector:g,selectedField:v,connectorName:g.displayName,loading:H,onFieldSelect:le}):null;case 4:return g&&v&&Y?a.jsx(xT,{connector:g,connectorFields:Y,selectedField:v,selectedFields:E,onFieldToggle:Ae,onSelectAllFields:we}):null;case 5:return v&&Y?a.jsx(Ure,{dataStorageType:t,destinationName:Nr(Y,v),connectorName:(g==null?void 0:g.displayName)??"",target:be,onTargetChange:Ne}):null;default:return null}};return a.jsxs(wJ,{children:[a.jsx(RJ,{children:va()}),a.jsx(jJ,{variant:"horizontal",children:a.jsx(Ane,{currentStep:C,totalSteps:W,canGoNext:Zt(),canGoBack:jn(),isLoading:U||H,onNext:qt,onBack:Dt,onFinish:()=>{n&&g?e({source:{name:g.name,configuration:[j],node:(r==null?void 0:r.source.node)??v,fields:(r==null?void 0:r.source.fields)??E},storage:(r==null?void 0:r.storage)??{fullyQualifiedName:(r==null?void 0:r.storage.fullyQualifiedName)??""}}):o==="fields-only"&&r?e({source:{...r.source,fields:E},storage:r.storage}):g&&be&&e({source:{name:g.name,configuration:[j],node:v,fields:E},storage:{fullyQualifiedName:be.fullyQualifiedName}}),h(!1)}})})]})}const v5=20,x5=20;function b5({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 Vre(e=30,t=0){b5({vertical:x5+e,horizontal:v5+t})}function E1(){b5({vertical:x5,horizontal:v5})}function S5({isOpen:e,onClose:t,dataStorageType:n,onSubmit:r,configurationOnly:o=!1,existingConnector:l=null,mode:c="full",initialStep:d,preselectedConnector:f}){m.useEffect(()=>(e?Vre(55):E1(),()=>{E1()}),[e]);const[h,g]=m.useState(!1),[y,v]=m.useState(!1),b=m.useCallback(()=>{y?g(!0):t()},[y,t]),E=m.useCallback(()=>{g(!1),v(!1),t()},[t]),S=m.useCallback(C=>{v(C)},[]);return a.jsxs(a.Fragment,{children:[a.jsx($o,{open:e,onOpenChange:b,children:a.jsxs(Bo,{children:[a.jsxs(Go,{children:[a.jsx(qo,{children:c==="fields-only"?"Connector Fields":l!=null&&l.source.name?"Edit Connector":"Set Up Connector"}),a.jsx(Xi,{children:c==="fields-only"?"Select fields for your Data Mart":l!=null&&l.source.name?"Update configuration":"Follow these steps to set it up"})]}),a.jsx(Fre,{onSubmit:C=>{r(C),t()},dataStorageType:n,configurationOnly:o||c==="configuration-only",existingConnector:l,mode:c,initialStep:d,preselectedConnector:f,onDirtyChange:S})]})}),a.jsx(Tr,{open:h,onOpenChange:g,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:E,variant:"destructive"})]})}const US=({dataStorageType:e,onSubmit:t,children:n,configurationOnly:r=!1,existingConnector:o=null,preset:l,isOpen:c,onClose:d})=>{const[f,h]=m.useState(!1),[g,y]=m.useState(1),[v,b]=m.useState();m.useEffect(()=>{c!==void 0&&h(c)},[c]);const E=()=>{b(void 0),y(1),h(!0)},S=()=>{h(!1),d==null||d()};return m.useEffect(()=>{l&&(l==="connector"?(b(void 0),y(1),h(!0)):(b(l),y(2),h(!0)))},[l]),a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{onClick:E,style:{cursor:"pointer"},children:n}),a.jsx(Tu,{children:a.jsx(S5,{isOpen:f,onClose:S,dataStorageType:e,onSubmit:t,configurationOnly:r,existingConnector:o,initialStep:g,preselectedConnector:v})})]})};function zre({storageType:e,onSetupConnector:t,preset:n,isOpen:r,onClose:o}){return a.jsx(US,{dataStorageType:e,onSubmit:t,configurationOnly:!1,preset:n,isOpen:r,onClose:o,children:a.jsxs(xe,{type:"button",variant:"outline",className:"flex h-24 w-full cursor-pointer items-center justify-center gap-2 border-0 shadow-none dark:border-transparent dark:bg-transparent dark:hover:bg-white/4",children:[a.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:a.jsx(G1,{className:"h-4 w-4",strokeWidth:2.25})}),a.jsx("span",{children:"Setup Connector"}),a.jsx(La,{className:"h-6 w-6"})]})})}const Hre=e=>{switch(e){case ke.GOOGLE_BIGQUERY:return"Google BigQuery";case ke.AWS_ATHENA:return"AWS Athena";default:return e}},ou=e=>typeof e=="object"&&"connector"in e,Kd=e=>{if(!ou(e))return!1;const{source:t,storage:n}=e.connector,r=!!t.name&&!!t.configuration&&t.configuration.length>0&&!!t.node&&!!t.fields&&t.fields.length>0,o=!!n.fullyQualifiedName&&n.fullyQualifiedName.split(".").length===2;return r&&o};function $re({configIndex:e,connectorDef:t,onRemoveConfiguration:n,onUpdateConfiguration:r,totalConfigurations:o,dataStorage:l}){const c=nl.getInfo(l.type),{connectors:d,fetchAvailableConnectors:f}=dc();m.useEffect(()=>{f()},[f]);const h=E=>{const S=d.find(C=>C.name===E);if(S!=null&&S.logoBase64)return()=>a.jsx(rc,{base64:S.logoBase64,size:24})},g=()=>{const E=t.connector.source.node||"No node selected";return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-muted-foreground/75",children:"Data:"})," ",a.jsx("span",{className:"text-muted-foreground font-medium",children:E}),a.jsx("span",{className:"text-muted-foreground",children:"•"}),a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("span",{className:"text-muted-foreground flex items-center gap-1 font-medium",children:[a.jsx("span",{children:"Edit config"}),a.jsx(La,{className:"h-3 w-3"})]})}),a.jsx(Ct,{children:"Edit connector configuration"})]})]})},y=(E,S,C)=>a.jsxs("span",{children:[a.jsxs("span",{className:"text-muted-foreground/75",children:[E,":"]})," ",a.jsx(vn,{href:C,onClick:R=>{R.stopPropagation()},children:S})]}),v=()=>{switch(l.type){case ke.GOOGLE_BIGQUERY:{const E=l.config.projectId,S=t.connector.storage.fullyQualifiedName,C=S.split(".")[0],R=S.split(".")[1],j=`https://console.cloud.google.com/bigquery?project=${E}&ws=!1m4!1m3!3m2!1s${E}!2s${C}`,_=`https://console.cloud.google.com/bigquery?project=${E}&ws=!1m4!1m3!3m2!1s${E}!2s${C}!3s${R}`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Dataset",C,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,_),a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx(Br,{className:"h-4 w-4"})}),a.jsx(Ct,{children:"The dataset and table are automatically created during the first run of the data mart, if they don't already exist"})]})]})}case ke.AWS_ATHENA:{const E=l.config.region,S=t.connector.storage.fullyQualifiedName,[C,R]=S.split("."),j=`https://console.aws.amazon.com/athena/home?region=${E}#/query-editor`;return a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[y("Database",C,j),a.jsx("span",{className:"text-muted-foreground",children:"•"}),y("Table",R,j),a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx(Br,{className:"h-4 w-4"})}),a.jsx(Ct,{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"}},b=()=>o!==1;return a.jsxs("div",{className:"border-border flex w-full items-center rounded-lg border-1 p-1 dark:bg-white/2",children:[a.jsx("div",{className:"flex-grow",children:a.jsxs("div",{className:"grid grid-cols-2 items-center gap-4",children:[a.jsx(US,{dataStorageType:l.type,onSubmit:r(e),configurationOnly:!0,existingConnector:{source:{...t.connector.source,configuration:[t.connector.source.configuration[e]]},storage:t.connector.storage},children:a.jsx(p1,{icon:h(t.connector.source.name),title:t.connector.source.name||"Connector",subtitle:g(),className:"bg-background hover:bg-muted min-h-[80px] cursor-pointer border-0 transition-colors hover:shadow-none"})}),a.jsx(p1,{title:Hre(l.type),icon:c.icon,subtitle:v(),className:"bg-background min-h-[80px] cursor-default border-0 hover:shadow-none dark:bg-white/2"})]})}),a.jsx("div",{className:"shrink-0 px-4",children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("span",{children:a.jsx(xe,{type:"button",variant:"ghost",onClick:()=>{b()&&n(e)},disabled:!b(),children:a.jsx(Xs,{className:"h-4 w-4"})})})}),!b()&&a.jsx(Ct,{children:"Remove last configuration only after adding a new one."})]})})]})}function Bre({storageType:e,onAddConfiguration:t,existingConnector:n}){return a.jsx("div",{children:a.jsx(US,{dataStorageType:e,onSubmit:r=>{const o=r.source.configuration[0]||{};t(o)},configurationOnly:!0,existingConnector:n?{source:{...n.source,configuration:[]},storage:n.storage}:void 0,children:a.jsxs(xe,{type:"button",variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(Pa,{className:"h-4 w-4"}),a.jsx("span",{children:"Configuration"})]})})})}function Gre({control:e,storageType:t,preset:n,autoOpen:r=!1,saveDataMartDefinition:o}){const{dataMart:l,runDataMart:c}=Ia(),{setValue:d,getValues:f,trigger:h}=zu(),[g,y]=m.useState(!1),[v,b]=m.useState(!1);m.useEffect(()=>{r&&b(!0)},[r]);const E=(l==null?void 0:l.status)??Rr.DRAFT,S=async U=>{d("definition",U,{shouldDirty:!0,shouldTouch:!0}),await h("definition")&&o&&o()},C=async U=>{const H=U.source,k=U.storage;await S({connector:{source:H,storage:k}})},R=async U=>{if(l){if(l.status.code!==Rr.PUBLISHED){It.error("Manual run is only available for published data marts");return}await c({id:l.id,payload:U})}},j=U=>async H=>{const $=f().definition;if(typeof $=="object"&&ou($)){const q=[...$.connector.source.configuration];q[U]=H.source.configuration[0]||{};const ie={connector:{...$.connector,source:{...$.connector.source,configuration:q}}};await S(ie)}},_=async U=>{const k=f().definition;if(typeof k=="object"&&ou(k)){const $={connector:{...k.connector,source:{...k.connector.source,fields:U.source.fields}}};await S($)}y(!1)},D=U=>{R({runType:U.runType,data:U.data})},A=U=>{const H=U.connector.source.fields.length;return a.jsxs(xe,{type:"button",variant:"outline",onClick:()=>{y(!0)},className:"dm-card-table-add-field-btn cursor-pointer",children:[a.jsx(aL,{className:"h-4 w-4"}),a.jsxs("span",{children:["Edit Fields (",String(H),")"]})]})},[O,T]=m.useState(null),[M,V]=m.useState(!1),Z=U=>{T(U),V(!0)},K=async()=>{O!==null&&(await Y(O),T(null),V(!1))},Y=async U=>{const k=f().definition;if(ou(k)&&k.connector.source.configuration.length<=1){const $=OS(Fe.CONNECTOR);await S($)}if(typeof k=="object"&&ou(k)&&k.connector.source.configuration.length>1){const $={...k.connector.source,configuration:k.connector.source.configuration.filter((ie,be)=>be!==U)},q={connector:{...k.connector,source:$}};await S(q)}},G=async U=>{const k=f().definition;if(ou(k)){const $={...k.connector.source,configuration:[...k.connector.source.configuration,U]},q={connector:{...k.connector,source:$}};await S(q)}};return a.jsxs(a.Fragment,{children:[a.jsx(kt,{control:e,name:"definition",render:({field:U})=>a.jsxs(_t,{className:"dark:bg-white/2",children:[a.jsx(Nt,{children:a.jsx("div",{className:"space-y-3",children:!Kd(U.value)||E===Rr.DRAFT?a.jsx(zre,{storageType:t,onSetupConnector:H=>{C(H),b(!1)},preset:n,isOpen:v,onClose:()=>{b(!1)}}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Bre,{storageType:t,onAddConfiguration:H=>void G(H),existingConnector:Kd(U.value)?{source:U.value.connector.source,storage:U.value.connector.storage}:void 0}),Kd(U.value)&&A(U.value)]}),a.jsx("div",{className:"flex items-center gap-2",children:l&&l.definitionType===Fe.CONNECTOR&&a.jsx(SO,{configuration:l.definition,onManualRun:D,children:a.jsxs(xe,{variant:"outline",children:[a.jsx(rg,{className:"h-4 w-4"}),a.jsx("span",{children:"Manual Run..."})]})})})]}),a.jsx("div",{className:"space-y-3",children:Kd(U.value)&&(l!=null&&l.storage)?U.value.connector.source.configuration.map((H,k)=>{const $=U.value;return a.jsx(Tu,{children:a.jsx($re,{configIndex:k,connectorDef:$,dataStorage:l.storage,onRemoveConfiguration:q=>{Z(q)},onUpdateConfiguration:q=>j(q),dataMartStatus:typeof E=="object"?E.code:E,totalConfigurations:$.connector.source.configuration.length},k)},k)}):null})]})})}),a.jsx(Ft,{})]})}),a.jsx(Tu,{children:a.jsx(S5,{isOpen:g,onClose:()=>{y(!1)},onSubmit:U=>void _(U),dataStorageType:t,existingConnector:Kd(f().definition)?{source:f().definition.connector.source,storage:f().definition.connector.storage}:void 0,mode:"fields-only"})}),a.jsx(Tr,{open:M,onOpenChange:V,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:()=>{T(null)},variant:"destructive"})]})}function qre({definitionType:e,storageType:t,preset:n,saveDataMartDefinition:r}){const{control:o}=zu(),[l,c]=m.useState(!1);return m.useEffect(()=>{e===Fe.CONNECTOR&&!n?c(!0):c(!1)},[e,n]),a.jsxs("div",{className:"space-y-2",children:[e===Fe.SQL&&a.jsx(wne,{control:o}),e===Fe.TABLE&&a.jsx(Rne,{control:o,storageType:t}),e===Fe.VIEW&&a.jsx(jne,{control:o,storageType:t}),e===Fe.TABLE_PATTERN&&a.jsx(Tne,{control:o,storageType:t}),e===Fe.CONNECTOR&&a.jsx(Gre,{control:o,storageType:t,preset:n,autoOpen:l,saveDataMartDefinition:r})]})}function C5(){const[e]=f7(),t=e.get("preset");return m.useMemo(()=>{if(!t)return;const n=t.toLowerCase();return LW(n)},[t])}function Zre(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 Kre(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Yre(e){return!e||typeof e!="object"?!0:e.LICENSED_APP_EDITION==="COMMUNITY"}function Wre(e,t){const[n,r]=m.useState(e);return m.useEffect(()=>{const o=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(o)}},[e,t]),n}const Qre=1e3,Xre=[Ul.SUCCESS,Ul.ERROR,Ul.CANCELLED];function Jre(e){const[t,n]=m.useState(!1),[r,o]=m.useState(null),l=m.useRef({triggerId:null,abortController:null}),c=m.useCallback(y=>l.current.triggerId===y,[]),d=m.useCallback(y=>{o({isValid:!1,error:y instanceof Error?y.message:"Validation failed"}),n(!1)},[]),f=m.useCallback(async()=>{const{triggerId:y,abortController:v}=l.current;if(y){v==null||v.abort(),l.current={triggerId:null,abortController:null},o(null),n(!1);try{await sn.abortSqlDryRunTrigger(e,y)}catch(b){console.error("Failed to cancel trigger:",b)}}},[e]),h=m.useCallback(async(y,v)=>{for(;!v.aborted&&c(y);)try{const b=await sn.getSqlDryRunTriggerStatus(e,y);if(Xre.includes(b)){const E=await sn.getSqlDryRunTriggerResponse(e,y);o({isValid:E.isValid,error:E.error??void 0,bytes:E.bytes}),n(!1),l.current={triggerId:null,abortController:null};return}await new Promise(E=>setTimeout(E,Qre))}catch(b){d(b),l.current={triggerId:null,abortController:null};return}},[e,c,d]),g=m.useCallback(async y=>{await f(),n(!0),o(null);try{const{triggerId:v}=await sn.createSqlDryRunTrigger(e,y),b=new AbortController;l.current={triggerId:v,abortController:b},await h(v,b.signal)}catch(v){d(v)}},[e,f,h,d]);return m.useEffect(()=>()=>{const{triggerId:y,abortController:v}=l.current;v==null||v.abort(),y&&sn.abortSqlDryRunTrigger(e,y).catch(()=>{})},[e]),{validateSql:g,isLoading:t,result:r,cancel:f}}const eae=300;function tae({sql:e,dataMartId:t,debounceDelay:n=eae,className:r="",onValidationStateChange:o}){const l=Wre(e.trim(),n),{validateSql:c,isLoading:d,result:f,cancel:h}=Jre(t);m.useEffect(()=>{if(!l){h();const y={isLoading:!1,isValid:null,error:null,bytes:null};o==null||o(y);return}c(l)},[l,c,h,o]),m.useEffect(()=>{const y={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};o==null||o(y)},[d,f,o]);const g=()=>d?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(Of,{className:"h-4 w-4 animate-spin"}),a.jsx("span",{className:"text-sm",children:"Validating..."})]}):f?f.isValid?a.jsxs("div",{className:"flex h-5 items-center gap-2",children:[a.jsx(ok,{className:"h-4 w-4 text-green-600"}),a.jsx("span",{className:"text-sm font-medium text-green-600",children:"Valid SQL code"}),f.bytes!==void 0&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mx-1 text-gray-400",children:"•"}),a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(zl,{className:"h-3 w-3 text-gray-600"}),a.jsx("span",{className:"text-xs text-gray-600",children:Zre(f.bytes)})]})}),a.jsx(Ct,{children:a.jsx("p",{className:"text-xs",children:"This is an estimated volume and may differ from the actual value"})})]})]})]}):a.jsxs("div",{className:"flex h-9 items-center gap-2",children:[a.jsx(dp,{className:"h-4 w-4 flex-shrink-0 text-red-600"}),f.error&&a.jsx("span",{className:"text-xs text-red-500",children:f.error})]}):a.jsxs("div",{className:"flex h-5 items-center gap-2 text-gray-500",children:[a.jsx(zl,{className:"h-4 w-4"}),a.jsx("span",{className:"text-sm",children:"Type a query to get started"})]});return a.jsx("div",{className:`inline-flex h-9 items-center px-3 py-2 ${r}`,children:g()})}const nae={isValid:null,isLoading:!1,error:null},rae=(e,t)=>{if(e!==Fe.SQL)return"";const n=t;return(n==null?void 0:n.sqlQuery)??""},aae=e=>OS(e);function sae({definitionType:e,initialDefinitionType:t,setDefinitionType:n}){const{dataMart:r,updateDataMartDefinition:o,runSchemaActualization:l}=Ia(),c=C5();if(!r)throw new Error("Data mart not found");const{definition:d,id:f,storage:{type:h}}=r,[,g]=m.useState(nae),[y,v]=m.useState(!1),b=m.useCallback(()=>{if(!e)return;const G={definitionType:e,definition:OS(e)};return d?{definitionType:e,definition:d}:G},[e,d]),E=m.useCallback(()=>{if(!e)return;const G=Ene(e,h);return ll(G)},[e,h]),S=Qo({resolver:E(),defaultValues:b(),mode:"onChange"}),{handleSubmit:C,reset:R,watch:j,formState:{isDirty:_,isValid:D}}=S,A=j("definition"),O=rae(e,A);m.useEffect(()=>{e&&R(b())},[e,R,b]),m.useEffect(()=>{if(!e&&!t&&(c!=null&&c.definitionType)){n(c.definitionType);const G={definitionType:c.definitionType,definition:aae(c.definitionType)};R(G)}},[c,e,t,R,n]);const T=m.useCallback(G=>{g({isLoading:G.isLoading,isValid:G.isValid,error:G.error})},[]),M=m.useCallback(G=>{n(G)},[n]),V=m.useCallback(async G=>{if(e&&f)try{await o(f,G.definitionType,G.definition),v(!0),R(G)}catch(U){console.error("Failed to update data mart definition:",U)}},[f,e,o,R]);m.useEffect(()=>{y&&(v(!1),l==null||l())},[y,l]);const Z=m.useCallback(G=>{G==null||G.preventDefault(),C(V)(G)},[C,V]),K=m.useCallback(()=>{R(b())},[R,b]),Y=()=>e?a.jsxs("form",{onSubmit:Z,className:"space-y-4",children:[a.jsx(qre,{definitionType:e,storageType:h,preset:c==null?void 0:c.connectorSourceTitle,saveDataMartDefinition:Z}),e!==Fe.CONNECTOR&&a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsx(xe,{variant:"default",type:"submit",disabled:!D||!_,children:"Save"}),a.jsx(xe,{type:"button",variant:"ghost",onClick:K,disabled:!_,children:"Discard"}),e===Fe.SQL&&O&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"h-6 w-px bg-gray-300"}),a.jsx(tae,{sql:O,dataMartId:f,onValidationStateChange:T})]})]})]}):null;return a.jsx(Y3,{...S,children:a.jsxs("div",{className:"space-y-4",children:[!t&&a.jsx(yne,{initialType:e,onTypeSelect:M}),Y()]})})}function oae(e){switch(e){case ke.GOOGLE_BIGQUERY:return{type:"bigquery-data-mart-schema",fields:[]};case ke.AWS_ATHENA:return{type:"athena-data-mart-schema",fields:[]};default:throw new Error(`Unsupported storage type: ${e}`)}}function E5(e){return e.type==="bigquery-data-mart-schema"}function w5(e){return e.type==="athena-data-mart-schema"}function ST(e){return e!==null&&typeof e=="object"&&"mode"in e}function CT(e){return e!==null&&typeof e=="object"&&"isPrimaryKey"in e}function iae(e){return e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):""}function c0(e){return e==null?e:JSON.parse(JSON.stringify(e))}function lae(e){const t=c0(e),[n,r]=m.useState(t),[o,l]=m.useState(!1);m.useEffect(()=>{const f=c0(e);r(f),l(!1)},[e]);const c=m.useCallback(f=>{n?E5(n)&&f.every(ST)?(r({...n,fields:f}),l(!0)):w5(n)&&f.every(CT)&&(r({...n,fields:f}),l(!0)):f.length>0&&(ST(f[0])?(r({type:"bigquery-data-mart-schema",fields:f}),l(!0)):CT(f[0])&&(r({type:"athena-data-mart-schema",fields:f}),l(!0)))},[n]),d=m.useCallback(()=>{const f=c0(e);r(f),l(!1)},[e]);return{schema:n,isDirty:o,updateSchema:c,resetSchema:d,setIsDirty:l}}function cae(e,t){const n=m.useRef(!1),r=m.useRef(!1),[o,l]=m.useState("idle");return m.useEffect(()=>{e||(n.current||r.current)&&(l(t?"error":"success"),n.current=!1,r.current=!1)},[e,t]),{operationStatus:o,startSaveOperation:()=>{n.current=!0,l("idle")},startActualizeOperation:()=>{r.current=!0,l("idle")},resetOperationStatus:()=>{l("idle")}}}function uae(e){const t=m.useMemo(()=>Array.isArray(e)?Object.fromEntries(e.filter(o=>o.meta&&o.meta.hidden).map(o=>["id"in o&&o.id?o.id:"accessorKey"in o&&typeof o.accessorKey=="string"?o.accessorKey:void 0,!1]).filter(([o])=>o!==void 0)):{},[e]),[n,r]=m.useState({});return m.useEffect(()=>{r(t)},[t]),{columnVisibility:n,setColumnVisibility:r,defaultHiddenColumns:t}}function R5(e,t){const n=e.name?e.name.toLowerCase().includes(t):!1,r=e.alias?e.alias.toLowerCase().includes(t):!1,o=e.description?e.description.toLowerCase().includes(t):!1;if(n||r||o)return!0;const l=e;return l.fields&&l.fields.length>0?l.fields.some(c=>R5(c,t)):!1}function j5(e,t,n=""){const r=[];return e.forEach((o,l)=>{const c=n?`${n}.${String(l)}`:String(l),d=o.name?o.name.toLowerCase().includes(t):!1,f=o.alias?o.alias.toLowerCase().includes(t):!1,h=o.description?o.description.toLowerCase().includes(t):!1;if((d||f||h)&&r.push(c),o.fields&&o.fields.length>0){const g=j5(o.fields,t,c);g.length>0&&(r.includes(c)||r.push(c),r.push(...g))}}),r}function dae(e,t,n){const r=e.original;if(!n)return!0;const o=n.toLowerCase();return R5(r,o)}function fae(e){const[t,n]=m.useState(""),r=m.useCallback(l=>{n(l),e.setGlobalFilter(l)},[e]),o=t.toLowerCase();return{value:t,onChange:r,searchValue:o}}function hae(e){const[t,n]=m.useState(new Set),[r,o]=m.useState(null),l=m.useRef(""),c=m.useMemo(()=>{const E=S=>S.some(C=>C.type===$n.RECORD||C.type===$n.STRUCT||C.fields&&E(C.fields));return E(e)},[e]),d=m.useCallback(E=>{n(S=>{const C=new Set(S);return C.has(E)?C.delete(E):C.add(E),C})},[]),f=m.useCallback(()=>{const E=[],S=(C,R="")=>{C.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===$n.RECORD||j.type===$n.STRUCT)&&j.fields&&j.fields.length>0&&(E.push(D),S(j.fields,D))})};S(e),n(C=>E.every(j=>C.has(j))?new Set:new Set(E))},[e]),h=m.useMemo(()=>{const E=[],S=(C,R="",j=0)=>{C.forEach((_,D)=>{const A=R?`${R}.${String(D)}`:String(D),O=_.type===$n.RECORD||_.type===$n.STRUCT;E.push({..._,path:A,level:j}),O&&_.fields&&t.has(A)&&S(_.fields,A,j+1)})};return S(e),E},[e,t]),g=m.useCallback(E=>{if(E!==l.current)if(l.current=E,E){r===null&&o(new Set(t));const C=j5(e,E).filter(R=>{const j=R.split(".").map(Number);let _=e,D;for(let A=0;A<j.length;A++){if(D=_[j[A]],!D)return!1;if((D.type===$n.RECORD||D.type===$n.STRUCT)&&D.fields&&D.fields.length>0)return!0;A<j.length-1&&(_=D.fields??[])}return!1});n(R=>{const j=new Set(R);return C.forEach(_=>{j.add(_)}),j})}else r!==null&&(n(r),o(null))},[e,t,r]),y=m.useCallback(E=>{const S=h[E];return S.type===$n.RECORD||S.type===$n.STRUCT},[h]),v=m.useMemo(()=>e.map(E=>({...E,fields:void 0})),[e]),b=m.useMemo(()=>{const E=[],S=(C,R="")=>{C.forEach((j,_)=>{const D=R?`${R}.${String(_)}`:String(_);(j.type===$n.RECORD||j.type===$n.STRUCT)&&j.fields&&j.fields.length>0&&(E.push(D),S(j.fields,D))})};return S(e),E.length===0?!1:E.every(C=>t.has(C))},[e,t]);return{expandedRecords:t,hasRecordFields:c,toggleRecordExpansion:d,toggleAllRecords:f,flattenedFields:h,handleSearchChange:g,isRecordType:y,topLevelFields:v,allExpanded:b}}function mae(e,t,n,r){const o=m.useCallback((f,h)=>{if(n){const g=[...e],y=t[f].path;if(!y)g[f]={...g[f],...h};else{const v=y.split(".").map(Number);let b=g,E;for(let C=0;C<v.length-1;C++)E=b[v[C]],b=E.fields??[];const S=v[v.length-1];b[S]&&(b[S]={...b[S],...h})}n(g)}},[e,t,n]),l=m.useCallback(()=>{if(n){const f={name:"",type:$n.STRING,mode:Cf.NULLABLE,isPrimaryKey:!1,status:es.DISCONNECTED};n([...e,f])}},[e,n]),c=m.useCallback(f=>{if(n){const h=[...e],g=t[f].path;if(!g)h.splice(f,1);else{const y=g.split(".").map(Number);let v=h,b;for(let S=0;S<y.length-1;S++)b=v[y[S]],v=b.fields??[];const E=y[y.length-1];v.splice(E,1)}n(h)}},[e,t,n]),d=m.useCallback(f=>{var h,g;if(n&&r){const y=[...e],v=t[f].path,b={name:"",type:$n.STRING,mode:Cf.NULLABLE,isPrimaryKey:!1,status:es.DISCONNECTED};if(!v)(h=y[f]).fields??(h.fields=[]),y[f].fields.push(b);else{const E=v.split(".").map(Number);let S=y;for(let C=0;C<E.length;C++){const R=E[C];C===E.length-1?((g=S[R]).fields??(g.fields=[]),S[R].fields.push(b)):S=S[R].fields??[]}}n(y)}},[e,t,n,r]);return{updateField:o,handleAddRow:l,handleDeleteRow:c,handleAddNestedField:d}}function T5(e,t,n){return{handleDragEnd:m.useCallback(o=>{const{active:l,over:c}=o;if(!c||l.id===c.id||!t)return;if(!n){const v=Number(l.id),b=Number(c.id),E=[...e],[S]=E.splice(v,1);E.splice(b,0,S),t(E);return}const d=n.findIndex((v,b)=>(v.path??String(b))===l.id),f=n.findIndex((v,b)=>(v.path??String(b))===c.id);if(d===-1||f===-1)return;const h=n[d].path,g=n[f].path,y=[...e];if(!h&&!g){const[v]=y.splice(d,1);y.splice(f,0,v),t(y);return}if(h&&g){const v=h.split(".").map(Number),b=g.split(".").map(Number);if(v.length===b.length&&v.slice(0,-1).join(".")===b.slice(0,-1).join(".")){let E=y;for(let j=0;j<v.length-1;j++)E=E[v[j]].fields??[];const S=v[v.length-1],C=b[b.length-1],[R]=E.splice(S,1);E.splice(C,0,R),t(y)}}},[e,n,t])}}function pae(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return m.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ey=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bu(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function FS(e){return"nodeType"in e}function ya(e){var t,n;return e?Bu(e)?e:FS(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function VS(e){const{Document:t}=ya(e);return e instanceof t}function sh(e){return Bu(e)?!1:e instanceof ya(e).HTMLElement}function _5(e){return e instanceof ya(e).SVGElement}function Gu(e){return e?Bu(e)?e.document:FS(e)?VS(e)?e:sh(e)||_5(e)?e.ownerDocument:document:document:document}const Ws=ey?m.useLayoutEffect:m.useEffect;function zS(e){const t=m.useRef(e);return Ws(()=>{t.current=e}),m.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function gae(){const e=m.useRef(null),t=m.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=m.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function wf(e,t){t===void 0&&(t=[e]);const n=m.useRef(e);return Ws(()=>{n.current!==e&&(n.current=e)},t),n}function oh(e,t){const n=m.useRef();return m.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Bp(e){const t=zS(e),n=m.useRef(null),r=m.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function w1(e){const t=m.useRef();return m.useEffect(()=>{t.current=e},[e]),t.current}let u0={};function ih(e,t){return m.useMemo(()=>{if(t)return t;const n=u0[e]==null?0:u0[e]+1;return u0[e]=n,e+"-"+n},[e,t])}function N5(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((l,c)=>{const d=Object.entries(c);for(const[f,h]of d){const g=l[f];g!=null&&(l[f]=g+e*h)}return l},{...t})}}const yu=N5(1),Gp=N5(-1);function yae(e){return"clientX"in e&&"clientY"in e}function HS(e){if(!e)return!1;const{KeyboardEvent:t}=ya(e.target);return t&&e instanceof t}function vae(e){if(!e)return!1;const{TouchEvent:t}=ya(e.target);return t&&e instanceof t}function R1(e){if(vae(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 yae(e)?{x:e.clientX,y:e.clientY}:null}const Rf=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[Rf.Translate.toString(e),Rf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ET="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xae(e){return e.matches(ET)?e:e.querySelector(ET)}const bae={display:"none"};function Sae(e){let{id:t,value:n}=e;return ye.createElement("div",{id:t,style:bae},n)}function Cae(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={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 ye.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Eae(){const[e,t]=m.useState("");return{announce:m.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const A5=m.createContext(null);function wae(e){const t=m.useContext(A5);m.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Rae(){const[e]=m.useState(()=>new Set),t=m.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[m.useCallback(r=>{let{type:o,event:l}=r;e.forEach(c=>{var d;return(d=c[o])==null?void 0:d.call(c,l)})},[e]),t]}const jae={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
- `},Tae={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 _ae(e){let{announcements:t=Tae,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=jae}=e;const{announce:l,announcement:c}=Eae(),d=ih("DndLiveRegion"),[f,h]=m.useState(!1);if(m.useEffect(()=>{h(!0)},[]),wae(m.useMemo(()=>({onDragStart(y){let{active:v}=y;l(t.onDragStart({active:v}))},onDragMove(y){let{active:v,over:b}=y;t.onDragMove&&l(t.onDragMove({active:v,over:b}))},onDragOver(y){let{active:v,over:b}=y;l(t.onDragOver({active:v,over:b}))},onDragEnd(y){let{active:v,over:b}=y;l(t.onDragEnd({active:v,over:b}))},onDragCancel(y){let{active:v,over:b}=y;l(t.onDragCancel({active:v,over:b}))}}),[l,t])),!f)return null;const g=ye.createElement(ye.Fragment,null,ye.createElement(Sae,{id:r,value:o.draggable}),ye.createElement(Cae,{id:d,announcement:c}));return n?ys.createPortal(g,n):g}var or;(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"})(or||(or={}));function qp(){}function D5(e,t){return m.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 m.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Es=Object.freeze({x:0,y:0});function Nae(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Aae(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Dae(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Oae(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function wT(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 M5=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=wT(t,t.left,t.top),l=[];for(const c of r){const{id:d}=c,f=n.get(d);if(f){const h=Nae(wT(f),o);l.push({id:d,data:{droppableContainer:c,value:h}})}}return l.sort(Aae)};function Mae(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height),c=o-r,d=l-n;if(r<o&&n<l){const f=t.width*t.height,h=e.width*e.height,g=c*d,y=g/(f+h-g);return Number(y.toFixed(4))}return 0}const Iae=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const l of r){const{id:c}=l,d=n.get(c);if(d){const f=Mae(d,t);f>0&&o.push({id:c,data:{droppableContainer:l,value:f}})}}return o.sort(Dae)};function kae(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function I5(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Es}function Lae(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),l=1;l<r;l++)o[l-1]=arguments[l];return o.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 Pae=Lae(1);function Uae(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 Fae(e,t,n){const r=Uae(t);if(!r)return e;const{scaleX:o,scaleY:l,x:c,y:d}=r,f=e.left-c-(1-o)*parseFloat(n),h=e.top-d-(1-l)*parseFloat(n.slice(n.indexOf(" ")+1)),g=o?e.width/o:e.width,y=l?e.height/l:e.height;return{width:g,height:y,top:h,right:f+g,bottom:h+y,left:f}}const Vae={ignoreTransform:!1};function qu(e,t){t===void 0&&(t=Vae);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:h,transformOrigin:g}=ya(e).getComputedStyle(e);h&&(n=Fae(n,h,g))}const{top:r,left:o,width:l,height:c,bottom:d,right:f}=n;return{top:r,left:o,width:l,height:c,bottom:d,right:f}}function RT(e){return qu(e,{ignoreTransform:!0})}function zae(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Hae(e,t){return t===void 0&&(t=ya(e).getComputedStyle(e)),t.position==="fixed"}function $ae(e,t){t===void 0&&(t=ya(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const l=t[o];return typeof l=="string"?n.test(l):!1})}function $S(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(VS(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!sh(o)||_5(o)||n.includes(o))return n;const l=ya(e).getComputedStyle(o);return o!==e&&$ae(o,l)&&n.push(o),Hae(o,l)?n:r(o.parentNode)}return e?r(e):n}function k5(e){const[t]=$S(e,1);return t??null}function d0(e){return!ey||!e?null:Bu(e)?e:FS(e)?VS(e)||e===Gu(e).scrollingElement?window:sh(e)?e:null:null}function L5(e){return Bu(e)?e.scrollX:e.scrollLeft}function P5(e){return Bu(e)?e.scrollY:e.scrollTop}function j1(e){return{x:L5(e),y:P5(e)}}var pr;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(pr||(pr={}));function U5(e){return!ey||!e?!1:e===document.scrollingElement}function F5(e){const t={x:0,y:0},n=U5(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,l=e.scrollLeft<=t.x,c=e.scrollTop>=r.y,d=e.scrollLeft>=r.x;return{isTop:o,isLeft:l,isBottom:c,isRight:d,maxScroll:r,minScroll:t}}const Bae={x:.2,y:.2};function Gae(e,t,n,r,o){let{top:l,left:c,right:d,bottom:f}=n;r===void 0&&(r=10),o===void 0&&(o=Bae);const{isTop:h,isBottom:g,isLeft:y,isRight:v}=F5(e),b={x:0,y:0},E={x:0,y:0},S={height:t.height*o.y,width:t.width*o.x};return!h&&l<=t.top+S.height?(b.y=pr.Backward,E.y=r*Math.abs((t.top+S.height-l)/S.height)):!g&&f>=t.bottom-S.height&&(b.y=pr.Forward,E.y=r*Math.abs((t.bottom-S.height-f)/S.height)),!v&&d>=t.right-S.width?(b.x=pr.Forward,E.x=r*Math.abs((t.right-S.width-d)/S.width)):!y&&c<=t.left+S.width&&(b.x=pr.Backward,E.x=r*Math.abs((t.left+S.width-c)/S.width)),{direction:b,speed:E}}function qae(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:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function V5(e){return e.reduce((t,n)=>yu(t,j1(n)),Es)}function Zae(e){return e.reduce((t,n)=>t+L5(n),0)}function Kae(e){return e.reduce((t,n)=>t+P5(n),0)}function Yae(e,t){if(t===void 0&&(t=qu),!e)return;const{top:n,left:r,bottom:o,right:l}=t(e);k5(e)&&(o<=0||l<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Wae=[["x",["left","right"],Zae],["y",["top","bottom"],Kae]];class BS{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=$S(n),o=V5(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[l,c,d]of Wae)for(const f of c)Object.defineProperty(this,f,{get:()=>{const h=d(r),g=o[l]-h;return this.rect[f]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class of{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 o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Qae(e){const{EventTarget:t}=ya(e);return e instanceof t?e:Gu(e)}function f0(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 Xa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Xa||(Xa={}));function jT(e){e.preventDefault()}function Xae(e){e.stopPropagation()}var Gt;(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"})(Gt||(Gt={}));const z5={start:[Gt.Space,Gt.Enter],cancel:[Gt.Esc],end:[Gt.Space,Gt.Enter,Gt.Tab]},Jae=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Gt.Right:return{...n,x:n.x+25};case Gt.Left:return{...n,x:n.x-25};case Gt.Down:return{...n,y:n.y+25};case Gt.Up:return{...n,y:n.y-25}}};class H5{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 of(Gu(n)),this.windowListeners=new of(ya(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Xa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Yae(r),n(Es)}handleKeyDown(t){if(HS(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:l=z5,coordinateGetter:c=Jae,scrollBehavior:d="smooth"}=o,{code:f}=t;if(l.end.includes(f)){this.handleEnd(t);return}if(l.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:h}=r.current,g=h?{x:h.left,y:h.top}:Es;this.referenceCoordinates||(this.referenceCoordinates=g);const y=c(t,{active:n,context:r.current,currentCoordinates:g});if(y){const v=Gp(y,g),b={x:0,y:0},{scrollableAncestors:E}=r.current;for(const S of E){const C=t.code,{isTop:R,isRight:j,isLeft:_,isBottom:D,maxScroll:A,minScroll:O}=F5(S),T=qae(S),M={x:Math.min(C===Gt.Right?T.right-T.width/2:T.right,Math.max(C===Gt.Right?T.left:T.left+T.width/2,y.x)),y:Math.min(C===Gt.Down?T.bottom-T.height/2:T.bottom,Math.max(C===Gt.Down?T.top:T.top+T.height/2,y.y))},V=C===Gt.Right&&!j||C===Gt.Left&&!_,Z=C===Gt.Down&&!D||C===Gt.Up&&!R;if(V&&M.x!==y.x){const K=S.scrollLeft+v.x,Y=C===Gt.Right&&K<=A.x||C===Gt.Left&&K>=O.x;if(Y&&!v.y){S.scrollTo({left:K,behavior:d});return}Y?b.x=S.scrollLeft-K:b.x=C===Gt.Right?S.scrollLeft-A.x:S.scrollLeft-O.x,b.x&&S.scrollBy({left:-b.x,behavior:d});break}else if(Z&&M.y!==y.y){const K=S.scrollTop+v.y,Y=C===Gt.Down&&K<=A.y||C===Gt.Up&&K>=O.y;if(Y&&!v.x){S.scrollTo({top:K,behavior:d});return}Y?b.y=S.scrollTop-K:b.y=C===Gt.Down?S.scrollTop-A.y:S.scrollTop-O.y,b.y&&S.scrollBy({top:-b.y,behavior:d});break}}this.handleMove(t,yu(Gp(y,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()}}H5.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=z5,onActivation:o}=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(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function TT(e){return!!(e&&"distance"in e)}function _T(e){return!!(e&&"delay"in e)}class GS{constructor(t,n,r){var o;r===void 0&&(r=Qae(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=Gu(c),this.documentListeners=new of(this.document),this.listeners=new of(r),this.windowListeners=new of(ya(c)),this.initialCoordinates=(o=R1(l))!=null?o:Es,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(Xa.Resize,this.handleCancel),this.windowListeners.add(Xa.DragStart,jT),this.windowListeners.add(Xa.VisibilityChange,this.handleCancel),this.windowListeners.add(Xa.ContextMenu,jT),this.documentListeners.add(Xa.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(_T(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(TT(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:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Xa.Click,Xae,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Xa.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:l}=this,{onMove:c,options:{activationConstraint:d}}=l;if(!o)return;const f=(n=R1(t))!=null?n:Es,h=Gp(o,f);if(!r&&d){if(TT(d)){if(d.tolerance!=null&&f0(h,d.tolerance))return this.handleCancel();if(f0(h,d.distance))return this.handleStart()}if(_T(d)&&f0(h,d.tolerance))return this.handleCancel();this.handlePending(d,h);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===Gt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ese={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ty extends GS{constructor(t){const{event:n}=t,r=Gu(n.target);super(t,ese,r)}}ty.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 tse={move:{name:"mousemove"},end:{name:"mouseup"}};var T1;(function(e){e[e.RightClick=2]="RightClick"})(T1||(T1={}));class nse extends GS{constructor(t){super(t,tse,Gu(t.event.target))}}nse.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===T1.RightClick?!1:(r==null||r({event:n}),!0)}}];const h0={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class rse extends GS{constructor(t){super(t,h0)}static setup(){return window.addEventListener(h0.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(h0.move.name,t)};function t(){}}}rse.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var lf;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(lf||(lf={}));var Zp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Zp||(Zp={}));function ase(e){let{acceleration:t,activator:n=lf.Pointer,canScroll:r,draggingRect:o,enabled:l,interval:c=5,order:d=Zp.TreeOrder,pointerCoordinates:f,scrollableAncestors:h,scrollableAncestorRects:g,delta:y,threshold:v}=e;const b=ose({delta:y,disabled:!l}),[E,S]=gae(),C=m.useRef({x:0,y:0}),R=m.useRef({x:0,y:0}),j=m.useMemo(()=>{switch(n){case lf.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case lf.DraggableRect:return o}},[n,o,f]),_=m.useRef(null),D=m.useCallback(()=>{const O=_.current;if(!O)return;const T=C.current.x*R.current.x,M=C.current.y*R.current.y;O.scrollBy(T,M)},[]),A=m.useMemo(()=>d===Zp.TreeOrder?[...h].reverse():h,[d,h]);m.useEffect(()=>{if(!l||!h.length||!j){S();return}for(const O of A){if((r==null?void 0:r(O))===!1)continue;const T=h.indexOf(O),M=g[T];if(!M)continue;const{direction:V,speed:Z}=Gae(O,M,j,t,v);for(const K of["x","y"])b[K][V[K]]||(Z[K]=0,V[K]=0);if(Z.x>0||Z.y>0){S(),_.current=O,E(D,c),C.current=Z,R.current=V;return}}C.current={x:0,y:0},R.current={x:0,y:0},S()},[t,D,r,S,l,c,JSON.stringify(j),JSON.stringify(b),E,h,A,g,JSON.stringify(v)])}const sse={x:{[pr.Backward]:!1,[pr.Forward]:!1},y:{[pr.Backward]:!1,[pr.Forward]:!1}};function ose(e){let{delta:t,disabled:n}=e;const r=w1(t);return oh(o=>{if(n||!r||!o)return sse;const l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[pr.Backward]:o.x[pr.Backward]||l.x===-1,[pr.Forward]:o.x[pr.Forward]||l.x===1},y:{[pr.Backward]:o.y[pr.Backward]||l.y===-1,[pr.Forward]:o.y[pr.Forward]||l.y===1}}},[n,t,r])}function ise(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return oh(o=>{var l;return t==null?null:(l=r??o)!=null?l:null},[r,t])}function lse(e,t){return m.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,l=o.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,r)}));return[...n,...l]},[]),[e,t])}var jf;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(jf||(jf={}));var _1;(function(e){e.Optimized="optimized"})(_1||(_1={}));const NT=new Map;function cse(e,t){let{dragging:n,dependencies:r,config:o}=t;const[l,c]=m.useState(null),{frequency:d,measure:f,strategy:h}=o,g=m.useRef(e),y=C(),v=wf(y),b=m.useCallback(function(R){R===void 0&&(R=[]),!v.current&&c(j=>j===null?R:j.concat(R.filter(_=>!j.includes(_))))},[v]),E=m.useRef(null),S=oh(R=>{if(y&&!n)return NT;if(!R||R===NT||g.current!==e||l!=null){const j=new Map;for(let _ of e){if(!_)continue;if(l&&l.length>0&&!l.includes(_.id)&&_.rect.current){j.set(_.id,_.rect.current);continue}const D=_.node.current,A=D?new BS(f(D),D):null;_.rect.current=A,A&&j.set(_.id,A)}return j}return R},[e,l,n,y,f]);return m.useEffect(()=>{g.current=e},[e]),m.useEffect(()=>{y||b()},[n,y]),m.useEffect(()=>{l&&l.length>0&&c(null)},[JSON.stringify(l)]),m.useEffect(()=>{y||typeof d!="number"||E.current!==null||(E.current=setTimeout(()=>{b(),E.current=null},d))},[d,y,b,...r]),{droppableRects:S,measureDroppableContainers:b,measuringScheduled:l!=null};function C(){switch(h){case jf.Always:return!1;case jf.BeforeDragging:return n;default:return!n}}}function $5(e,t){return oh(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function use(e,t){return $5(e,t)}function dse(e){let{callback:t,disabled:n}=e;const r=zS(t),o=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:l}=window;return new l(r)},[r,n]);return m.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ny(e){let{callback:t,disabled:n}=e;const r=zS(t),o=m.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:l}=window;return new l(r)},[n]);return m.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function fse(e){return new BS(qu(e),e)}function AT(e,t,n){t===void 0&&(t=fse);const[r,o]=m.useState(null);function l(){o(f=>{if(!e)return null;if(e.isConnected===!1){var h;return(h=f??n)!=null?h:null}const g=t(e);return JSON.stringify(f)===JSON.stringify(g)?f:g})}const c=dse({callback(f){if(e)for(const h of f){const{type:g,target:y}=h;if(g==="childList"&&y instanceof HTMLElement&&y.contains(e)){l();break}}}}),d=ny({callback:l});return Ws(()=>{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 hse(e){const t=$5(e);return I5(e,t)}const DT=[];function mse(e){const t=m.useRef(e),n=oh(r=>e?r&&r!==DT&&e&&t.current&&e.parentNode===t.current.parentNode?r:$S(e):DT,[e]);return m.useEffect(()=>{t.current=e},[e]),n}function pse(e){const[t,n]=m.useState(null),r=m.useRef(e),o=m.useCallback(l=>{const c=d0(l.target);c&&n(d=>d?(d.set(c,j1(c)),new Map(d)):null)},[]);return m.useEffect(()=>{const l=r.current;if(e!==l){c(l);const d=e.map(f=>{const h=d0(f);return h?(h.addEventListener("scroll",o,{passive:!0}),[h,j1(h)]):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 h=d0(f);h==null||h.removeEventListener("scroll",o)})}},[o,e]),m.useMemo(()=>e.length?t?Array.from(t.values()).reduce((l,c)=>yu(l,c),Es):V5(e):Es,[e,t])}function OT(e,t){t===void 0&&(t=[]);const n=m.useRef(null);return m.useEffect(()=>{n.current=null},t),m.useEffect(()=>{const r=e!==Es;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Gp(e,n.current):Es}function gse(e){m.useEffect(()=>{if(!ey)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 yse(e,t){return m.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:l}=r;return n[o]=c=>{l(c,t)},n},{}),[e,t])}function B5(e){return m.useMemo(()=>e?zae(e):null,[e])}const MT=[];function vse(e,t){t===void 0&&(t=qu);const[n]=e,r=B5(n?ya(n):null),[o,l]=m.useState(MT);function c(){l(()=>e.length?e.map(f=>U5(f)?r:new BS(t(f),f)):MT)}const d=ny({callback:c});return Ws(()=>{d==null||d.disconnect(),c(),e.forEach(f=>d==null?void 0:d.observe(f))},[e]),o}function xse(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return sh(t)?t:e}function bse(e){let{measure:t}=e;const[n,r]=m.useState(null),o=m.useCallback(h=>{for(const{target:g}of h)if(sh(g)){r(y=>{const v=t(g);return y?{...y,width:v.width,height:v.height}:v});break}},[t]),l=ny({callback:o}),c=m.useCallback(h=>{const g=xse(h);l==null||l.disconnect(),g&&(l==null||l.observe(g)),r(g?t(g):null)},[t,l]),[d,f]=Bp(c);return m.useMemo(()=>({nodeRef:d,rect:n,setRef:f}),[n,d,f])}const Sse=[{sensor:ty,options:{}},{sensor:H5,options:{}}],Cse={current:{}},sp={draggable:{measure:RT},droppable:{measure:RT,strategy:jf.WhileDragging,frequency:_1.Optimized},dragOverlay:{measure:qu}};class cf 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 Ese={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new cf,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:qp},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:sp,measureDroppableContainers:qp,windowRect:null,measuringScheduled:!1},wse={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:qp,draggableNodes:new Map,over:null,measureDroppableContainers:qp},ry=m.createContext(wse),G5=m.createContext(Ese);function Rse(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new cf}}}function jse(e,t){switch(t.type){case or.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case or.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 or.DragEnd:case or.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case or.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new cf(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case or.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;const c=new cf(e.droppable.containers);return c.set(n,{...l,disabled:o}),{...e,droppable:{...e.droppable,containers:c}}}case or.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new cf(e.droppable.containers);return l.delete(n),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function Tse(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=m.useContext(ry),l=w1(r),c=w1(n==null?void 0:n.id);return m.useEffect(()=>{if(!t&&!r&&l&&c!=null){if(!HS(l)||document.activeElement===l.target)return;const d=o.get(c);if(!d)return;const{activatorNode:f,node:h}=d;if(!f.current&&!h.current)return;requestAnimationFrame(()=>{for(const g of[f.current,h.current]){if(!g)continue;const y=xae(g);if(y){y.focus();break}}})}},[r,t,o,c,l]),null}function _se(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,l)=>l({transform:o,...r}),n):n}function Nse(e){return m.useMemo(()=>({draggable:{...sp.draggable,...e==null?void 0:e.draggable},droppable:{...sp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...sp.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 Ase(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const l=m.useRef(!1),{x:c,y:d}=typeof o=="boolean"?{x:o,y:o}:o;Ws(()=>{if(!c&&!d||!t){l.current=!1;return}if(l.current||!r)return;const h=t==null?void 0:t.node.current;if(!h||h.isConnected===!1)return;const g=n(h),y=I5(g,r);if(c||(y.x=0),d||(y.y=0),l.current=!0,Math.abs(y.x)>0||Math.abs(y.y)>0){const v=k5(h);v&&v.scrollBy({top:y.y,left:y.x})}},[t,c,d,r,n])}const q5=m.createContext({...Es,scaleX:1,scaleY:1});var Ni;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ni||(Ni={}));const Z5=m.memo(function(t){var n,r,o,l;let{id:c,accessibility:d,autoScroll:f=!0,children:h,sensors:g=Sse,collisionDetection:y=Iae,measuring:v,modifiers:b,...E}=t;const S=m.useReducer(jse,void 0,Rse),[C,R]=S,[j,_]=Rae(),[D,A]=m.useState(Ni.Uninitialized),O=D===Ni.Initialized,{draggable:{active:T,nodes:M,translate:V},droppable:{containers:Z}}=C,K=T!=null?M.get(T):null,Y=m.useRef({initial:null,translated:null}),G=m.useMemo(()=>{var Sn;return T!=null?{id:T,data:(Sn=K==null?void 0:K.data)!=null?Sn:Cse,rect:Y}:null},[T,K]),U=m.useRef(null),[H,k]=m.useState(null),[$,q]=m.useState(null),ie=wf(E,Object.values(E)),be=ih("DndDescribedBy",c),L=m.useMemo(()=>Z.getEnabled(),[Z]),P=Nse(v),{droppableRects:W,measureDroppableContainers:te,measuringScheduled:ue}=cse(L,{dragging:O,dependencies:[V.x,V.y],config:P.droppable}),ve=ise(M,T),le=m.useMemo(()=>$?R1($):null,[$]),Ae=As(),we=use(ve,P.draggable.measure);Ase({activeNode:T!=null?M.get(T):null,config:Ae.layoutShiftCompensation,initialRect:we,measure:P.draggable.measure});const Ne=AT(ve,P.draggable.measure,we),Be=AT(ve?ve.parentElement:null),Qe=m.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}),qt=Z.getNodeFor((n=Qe.current.over)==null?void 0:n.id),Dt=bse({measure:P.dragOverlay.measure}),Zt=(r=Dt.nodeRef.current)!=null?r:ve,jn=O?(o=Dt.rect)!=null?o:Ne:null,Nr=!!(Dt.nodeRef.current&&Dt.rect),va=hse(Nr?null:Ne),Ve=B5(Zt?ya(Zt):null),F=mse(O?qt??ve:null),X=vse(F),de=_se(b,{transform:{x:V.x-va.x,y:V.y-va.y,scaleX:1,scaleY:1},activatorEvent:$,active:G,activeNodeRect:Ne,containerNodeRect:Be,draggingNodeRect:jn,over:Qe.current.over,overlayNodeRect:Dt.rect,scrollableAncestors:F,scrollableAncestorRects:X,windowRect:Ve}),_e=le?yu(le,V):null,Se=pse(F),Ee=OT(Se),We=OT(Se,[Ne]),ot=yu(de,Ee),it=jn?Pae(jn,de):null,xn=G&&it?y({active:G,collisionRect:it,droppableRects:W,droppableContainers:L,pointerCoordinates:_e}):null,Ua=Oae(xn,"id"),[bn,Jo]=m.useState(null),Fn=Nr?de:yu(de,We),Tn=kae(Fn,(l=bn==null?void 0:bn.rect)!=null?l:null,Ne),vr=m.useRef(null),_n=m.useCallback((Sn,pn)=>{let{sensor:Gn,options:xr}=pn;if(U.current==null)return;const er=M.get(U.current);if(!er)return;const Vn=Sn.nativeEvent,Ar=new Gn({active:U.current,activeNode:er,event:Vn,options:xr,context:Qe,onAbort(z){if(!M.get(z))return;const{onDragAbort:se}=ie.current,ge={id:z};se==null||se(ge),j({type:"onDragAbort",event:ge})},onPending(z,J,se,ge){if(!M.get(z))return;const{onDragPending:ze}=ie.current,Le={id:z,constraint:J,initialCoordinates:se,offset:ge};ze==null||ze(Le),j({type:"onDragPending",event:Le})},onStart(z){const J=U.current;if(J==null)return;const se=M.get(J);if(!se)return;const{onDragStart:ge}=ie.current,Re={activatorEvent:Vn,active:{id:J,data:se.data,rect:Y}};ys.unstable_batchedUpdates(()=>{ge==null||ge(Re),A(Ni.Initializing),R({type:or.DragStart,initialCoordinates:z,active:J}),j({type:"onDragStart",event:Re}),k(vr.current),q(Vn)})},onMove(z){R({type:or.DragMove,coordinates:z})},onEnd:Xr(or.DragEnd),onCancel:Xr(or.DragCancel)});vr.current=Ar;function Xr(z){return async function(){const{active:se,collisions:ge,over:Re,scrollAdjustedTranslate:ze}=Qe.current;let Le=null;if(se&&ze){const{cancelDrop:Ie}=ie.current;Le={activatorEvent:Vn,active:se,collisions:ge,delta:ze,over:Re},z===or.DragEnd&&typeof Ie=="function"&&await Promise.resolve(Ie(Le))&&(z=or.DragCancel)}U.current=null,ys.unstable_batchedUpdates(()=>{R({type:z}),A(Ni.Uninitialized),Jo(null),k(null),q(null),vr.current=null;const Ie=z===or.DragEnd?"onDragEnd":"onDragCancel";if(Le){const Pe=ie.current[Ie];Pe==null||Pe(Le),j({type:Ie,event:Le})}})}}},[M]),ul=m.useCallback((Sn,pn)=>(Gn,xr)=>{const er=Gn.nativeEvent,Vn=M.get(xr);if(U.current!==null||!Vn||er.dndKit||er.defaultPrevented)return;const Ar={active:Vn};Sn(Gn,pn.options,Ar)===!0&&(er.dndKit={capturedBy:pn.sensor},U.current=xr,_n(Gn,pn))},[M,_n]),Ns=lse(g,ul);gse(g),Ws(()=>{Ne&&D===Ni.Initializing&&A(Ni.Initialized)},[Ne,D]),m.useEffect(()=>{const{onDragMove:Sn}=ie.current,{active:pn,activatorEvent:Gn,collisions:xr,over:er}=Qe.current;if(!pn||!Gn)return;const Vn={active:pn,activatorEvent:Gn,collisions:xr,delta:{x:ot.x,y:ot.y},over:er};ys.unstable_batchedUpdates(()=>{Sn==null||Sn(Vn),j({type:"onDragMove",event:Vn})})},[ot.x,ot.y]),m.useEffect(()=>{const{active:Sn,activatorEvent:pn,collisions:Gn,droppableContainers:xr,scrollAdjustedTranslate:er}=Qe.current;if(!Sn||U.current==null||!pn||!er)return;const{onDragOver:Vn}=ie.current,Ar=xr.get(Ua),Xr=Ar&&Ar.rect.current?{id:Ar.id,rect:Ar.rect.current,data:Ar.data,disabled:Ar.disabled}:null,z={active:Sn,activatorEvent:pn,collisions:Gn,delta:{x:er.x,y:er.y},over:Xr};ys.unstable_batchedUpdates(()=>{Jo(Xr),Vn==null||Vn(z),j({type:"onDragOver",event:z})})},[Ua]),Ws(()=>{Qe.current={activatorEvent:$,active:G,activeNode:ve,collisionRect:it,collisions:xn,droppableRects:W,draggableNodes:M,draggingNode:Zt,draggingNodeRect:jn,droppableContainers:Z,over:bn,scrollableAncestors:F,scrollAdjustedTranslate:ot},Y.current={initial:jn,translated:it}},[G,ve,xn,it,M,Zt,jn,W,Z,bn,F,ot]),ase({...Ae,delta:V,draggingRect:it,pointerCoordinates:_e,scrollableAncestors:F,scrollableAncestorRects:X});const ei=m.useMemo(()=>({active:G,activeNode:ve,activeNodeRect:Ne,activatorEvent:$,collisions:xn,containerNodeRect:Be,dragOverlay:Dt,draggableNodes:M,droppableContainers:Z,droppableRects:W,over:bn,measureDroppableContainers:te,scrollableAncestors:F,scrollableAncestorRects:X,measuringConfiguration:P,measuringScheduled:ue,windowRect:Ve}),[G,ve,Ne,$,xn,Be,Dt,M,Z,W,bn,te,F,X,P,ue,Ve]),to=m.useMemo(()=>({activatorEvent:$,activators:Ns,active:G,activeNodeRect:Ne,ariaDescribedById:{draggable:be},dispatch:R,draggableNodes:M,over:bn,measureDroppableContainers:te}),[$,Ns,G,Ne,R,be,M,bn,te]);return ye.createElement(A5.Provider,{value:_},ye.createElement(ry.Provider,{value:to},ye.createElement(G5.Provider,{value:ei},ye.createElement(q5.Provider,{value:Tn},h)),ye.createElement(Tse,{disabled:(d==null?void 0:d.restoreFocus)===!1})),ye.createElement(_ae,{...d,hiddenTextDescribedById:be}));function As(){const Sn=(H==null?void 0:H.autoScrollEnabled)===!1,pn=typeof f=="object"?f.enabled===!1:f===!1,Gn=O&&!Sn&&!pn;return typeof f=="object"?{...f,enabled:Gn}:{enabled:Gn}}}),Dse=m.createContext(null),IT="button",Ose="Draggable";function Mse(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const l=ih(Ose),{activators:c,activatorEvent:d,active:f,activeNodeRect:h,ariaDescribedById:g,draggableNodes:y,over:v}=m.useContext(ry),{role:b=IT,roleDescription:E="draggable",tabIndex:S=0}=o??{},C=(f==null?void 0:f.id)===t,R=m.useContext(C?q5:Dse),[j,_]=Bp(),[D,A]=Bp(),O=yse(c,t),T=wf(n);Ws(()=>(y.set(t,{id:t,key:l,node:j,activatorNode:D,data:T}),()=>{const V=y.get(t);V&&V.key===l&&y.delete(t)}),[y,t]);const M=m.useMemo(()=>({role:b,tabIndex:S,"aria-disabled":r,"aria-pressed":C&&b===IT?!0:void 0,"aria-roledescription":E,"aria-describedby":g.draggable}),[r,b,S,C,E,g.draggable]);return{active:f,activatorEvent:d,activeNodeRect:h,attributes:M,isDragging:C,listeners:r?void 0:O,node:j,over:v,setNodeRef:_,setActivatorNodeRef:A,transform:R}}function Ise(){return m.useContext(G5)}const kse="Droppable",Lse={timeout:25};function Pse(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const l=ih(kse),{active:c,dispatch:d,over:f,measureDroppableContainers:h}=m.useContext(ry),g=m.useRef({disabled:n}),y=m.useRef(!1),v=m.useRef(null),b=m.useRef(null),{disabled:E,updateMeasurementsFor:S,timeout:C}={...Lse,...o},R=wf(S??r),j=m.useCallback(()=>{if(!y.current){y.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{h(Array.isArray(R.current)?R.current:[R.current]),b.current=null},C)},[C]),_=ny({callback:j,disabled:E||!c}),D=m.useCallback((M,V)=>{_&&(V&&(_.unobserve(V),y.current=!1),M&&_.observe(M))},[_]),[A,O]=Bp(D),T=wf(t);return m.useEffect(()=>{!_||!A.current||(_.disconnect(),y.current=!1,_.observe(A.current))},[A,_]),m.useEffect(()=>(d({type:or.RegisterDroppable,element:{id:r,key:l,disabled:n,node:A,rect:v,data:T}}),()=>d({type:or.UnregisterDroppable,key:l,id:r})),[r]),m.useEffect(()=>{n!==g.current.disabled&&(d({type:or.SetDroppableDisabled,id:r,key:l,disabled:n}),g.current.disabled=n)},[r,l,n,d]),{active:c,rect:v,isOver:(f==null?void 0:f.id)===r,node:A,over:f,setNodeRef:O}}function K5(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Use(e,t){return e.reduce((n,r,o)=>{const l=t.get(r);return l&&(n[o]=l),n},Array(e.length))}function $m(e){return e!==null&&e>=0}function Fse(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 Vse(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Y5=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const l=K5(t,r,n),c=t[o],d=l[o];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},Bm={scaleX:1,scaleY:1},W5=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:l,overIndex:c}=e;const d=(t=l[n])!=null?t:r;if(!d)return null;if(o===n){const h=l[c];return h?{x:0,y:n<c?h.top+h.height-(d.top+d.height):h.top-d.top,...Bm}:null}const f=zse(l,o,n);return o>n&&o<=c?{x:0,y:-d.height-f,...Bm}:o<n&&o>=c?{x:0,y:d.height+f,...Bm}:{x:0,y:0,...Bm}};function zse(e,t,n){const r=e[t],o=e[t-1],l=e[t+1];return r?n<t?o?r.top-(o.top+o.height):l?l.top-(r.top+r.height):0:l?l.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Q5="Sortable",X5=ye.createContext({activeIndex:-1,containerId:Q5,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Y5,disabled:{draggable:!1,droppable:!1}});function J5(e){let{children:t,id:n,items:r,strategy:o=Y5,disabled:l=!1}=e;const{active:c,dragOverlay:d,droppableRects:f,over:h,measureDroppableContainers:g}=Ise(),y=ih(Q5,n),v=d.rect!==null,b=m.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),E=c!=null,S=c?b.indexOf(c.id):-1,C=h?b.indexOf(h.id):-1,R=m.useRef(b),j=!Fse(b,R.current),_=C!==-1&&S===-1||j,D=Vse(l);Ws(()=>{j&&E&&g(b)},[j,b,E,g]),m.useEffect(()=>{R.current=b},[b]);const A=m.useMemo(()=>({activeIndex:S,containerId:y,disabled:D,disableTransforms:_,items:b,overIndex:C,useDragOverlay:v,sortedRects:Use(b,f),strategy:o}),[S,y,D.draggable,D.droppable,_,b,C,f,v,o]);return ye.createElement(X5.Provider,{value:A},t)}const Hse=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return K5(n,r,o).indexOf(t)},$se=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:l,newIndex:c,previousItems:d,previousContainerId:f,transition:h}=e;return!h||!r||d!==l&&o===c?!1:n?!0:c!==o&&t===f},Bse={duration:200,easing:"ease"},e6="transform",Gse=Rf.Transition.toString({property:e6,duration:0,easing:"linear"}),qse={roleDescription:"sortable"};function Zse(e){let{disabled:t,index:n,node:r,rect:o}=e;const[l,c]=m.useState(null),d=m.useRef(n);return Ws(()=>{if(!t&&n!==d.current&&r.current){const f=o.current;if(f){const h=qu(r.current,{ignoreTransform:!0}),g={x:f.left-h.left,y:f.top-h.top,scaleX:f.width/h.width,scaleY:f.height/h.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,r,o]),m.useEffect(()=>{l&&c(null)},[l]),l}function Kse(e){let{animateLayoutChanges:t=$se,attributes:n,disabled:r,data:o,getNewIndex:l=Hse,id:c,strategy:d,resizeObserverConfig:f,transition:h=Bse}=e;const{items:g,containerId:y,activeIndex:v,disabled:b,disableTransforms:E,sortedRects:S,overIndex:C,useDragOverlay:R,strategy:j}=m.useContext(X5),_=Yse(r,b),D=g.indexOf(c),A=m.useMemo(()=>({sortable:{containerId:y,index:D,items:g},...o}),[y,o,D,g]),O=m.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:T,node:M,isOver:V,setNodeRef:Z}=Pse({id:c,data:A,disabled:_.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...f}}),{active:K,activatorEvent:Y,activeNodeRect:G,attributes:U,setNodeRef:H,listeners:k,isDragging:$,over:q,setActivatorNodeRef:ie,transform:be}=Mse({id:c,data:A,attributes:{...qse,...n},disabled:_.draggable}),L=pae(Z,H),P=!!K,W=P&&!E&&$m(v)&&$m(C),te=!R&&$,ue=te&&W?be:null,le=W?ue??(d??j)({rects:S,activeNodeRect:G,activeIndex:v,overIndex:C,index:D}):null,Ae=$m(v)&&$m(C)?l({id:c,items:g,activeIndex:v,overIndex:C}):D,we=K==null?void 0:K.id,Ne=m.useRef({activeId:we,items:g,newIndex:Ae,containerId:y}),Be=g!==Ne.current.items,Qe=t({active:K,containerId:y,isDragging:$,isSorting:P,id:c,index:D,items:g,newIndex:Ne.current.newIndex,previousItems:Ne.current.items,previousContainerId:Ne.current.containerId,transition:h,wasDragging:Ne.current.activeId!=null}),qt=Zse({disabled:!Qe,index:D,node:M,rect:T});return m.useEffect(()=>{P&&Ne.current.newIndex!==Ae&&(Ne.current.newIndex=Ae),y!==Ne.current.containerId&&(Ne.current.containerId=y),g!==Ne.current.items&&(Ne.current.items=g)},[P,Ae,y,g]),m.useEffect(()=>{if(we===Ne.current.activeId)return;if(we&&!Ne.current.activeId){Ne.current.activeId=we;return}const Zt=setTimeout(()=>{Ne.current.activeId=we},50);return()=>clearTimeout(Zt)},[we]),{active:K,activeIndex:v,attributes:U,data:A,rect:T,index:D,newIndex:Ae,items:g,isOver:V,isSorting:P,isDragging:$,listeners:k,node:M,overIndex:C,over:q,setNodeRef:L,setActivatorNodeRef:ie,setDroppableNodeRef:Z,setDraggableNodeRef:H,transform:qt??le,transition:Dt()};function Dt(){if(qt||Be&&Ne.current.newIndex===D)return Gse;if(!(te&&!HS(Y)||!h)&&(P||Qe))return Rf.Transition.toString({...h,property:e6})}}function Yse(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}}Gt.Down,Gt.Right,Gt.Up,Gt.Left;function vu({value:e,placeholder:t="",onValueChange:n,minRows:r=1,isBold:o=!1,className:l,saveButtonText:c="Save",cancelButtonText:d="Discard"}){const[f,h]=m.useState(!1),[g,y]=m.useState(e),v=m.useRef(null),b=j=>{y(j.target.value)},E=()=>{n&&g!==e&&n(g.trim()),h(!1)},S=()=>{y(e),h(!1)},C=j=>{j.key==="Enter"&&!j.shiftKey?(r===1||j.ctrlKey)&&(j.preventDefault(),E()):j.key==="Escape"&&(j.preventDefault(),S())},R=j=>{h(j),j?(y(e),setTimeout(()=>{v.current&&v.current.focus()},0)):S()};return a.jsxs(_S,{open:f,onOpenChange:R,children:[a.jsx(NS,{asChild:!0,children:a.jsx("div",{className:ne("cursor-edit w-full min-w-[100px]",!e&&"text-gray-400",o&&"font-medium",l),children:e||t})}),a.jsxs(AS,{className:"w-auto max-w-[600px] min-w-[300px] p-2",align:"start",children:[a.jsx(Zo,{ref:v,value:g,onChange:b,onKeyDown:C,className:"min-h-[24px] resize-y",style:{minHeight:String(Math.max(r*24,24))+"px"},rows:r}),a.jsxs("div",{className:"mt-3 flex justify-end gap-2",children:[a.jsx(xe,{variant:"outline",size:"sm",onClick:S,className:"h-7 cursor-pointer px-2 text-xs",children:d}),a.jsx(xe,{size:"sm",onClick:E,className:"h-7 cursor-pointer px-2 text-xs",children:c})]})]})]})}function Wse({isAllExpanded:e,onToggle:t}){return a.jsx(xe,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,title:e?"Collapse all items":"Expand all items",children:e?a.jsx(nk,{className:"h-4 w-4"}):a.jsx($1,{className:"h-4 w-4"})})}function Qse({isExpanded:e,onToggle:t,ariaLabel:n}){return a.jsx(xe,{variant:"ghost",size:"icon",className:"h-5 w-5 cursor-pointer p-0",onClick:t,"aria-label":n??(e?"Collapse":"Expand"),children:e?a.jsx(ka,{className:"h-4 w-4"}):a.jsx(La,{className:"h-4 w-4"})})}function Xse({className:e="",...t}){return a.jsx("div",{...t,className:`flex cursor-grab items-center justify-center opacity-0 group-hover:opacity-100 active:cursor-grabbing ${e}`,children:a.jsx(Dk,{className:"h-4 w-4 text-gray-400"})})}function t6({id:e,children:t}){const{attributes:n,listeners:r,setNodeRef:o,transform:l,transition:c,isDragging:d}=Kse({id:e}),f={transform:Rf.Transform.toString(l),transition:c,opacity:d?.75:1},h=m.Children.toArray(t),g=[a.jsx(Zr,{className:"bg-background dark:bg-muted",style:{width:20,position:"sticky",left:0,zIndex:2,paddingTop:8,paddingBottom:8,paddingLeft:4,paddingRight:0},children:a.jsx(Xse,{...n,...r})},"drag-handle-cell"),...h.slice(1)];return a.jsx(Pn,{ref:o,style:f,className:"group",children:g})}function n6({row:e,onDeleteRow:t,onAddNestedField:n,isRecordType:r}){const[o,l]=m.useState(!1),c=()=>{t&&t(e.index),l(!1)},d=r&&n&&r(e.index),f=!!t,h=d&&f;return a.jsxs("div",{className:"px-3 text-right",children:[a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100","aria-label":"Row actions",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(fr,{align:"end",children:[d&&a.jsxs(pt,{className:"cursor-pointer",onClick:()=>{n(e.index)},children:[a.jsx(Pa,{className:"mr-2 h-4 w-4"}),"Add nested field"]}),h&&a.jsx(ma,{}),f&&a.jsxs(pt,{onClick:()=>{l(!0)},children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete field"})]})]})]}),a.jsx(Tr,{open:o,onOpenChange:l,title:"Delete field",description:"Are you sure you want to delete this field?",confirmLabel:"Delete",cancelLabel:"Cancel",onConfirm:c,variant:"destructive"})]})}function Jse({mode:e,onModeChange:t}){const n=Object.values(Cf),r=o=>{t&&t(o)};return a.jsxs(Kr,{value:e,onValueChange:r,children:[a.jsx(Wr,{className:"h-90 cursor-pointer",size:"sm",children:a.jsx(Yr,{placeholder:"Select field mode"})}),a.jsx(Qr,{className:"max-h-[300px]",children:n.map(o=>a.jsx(Rn,{value:o,children:o},o))})]})}var ay="Checkbox",[eoe]=cr(ay),[toe,qS]=eoe(ay);function noe(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:o,disabled:l,form:c,name:d,onCheckedChange:f,required:h,value:g="on",internal_do_not_use_render:y}=e,[v,b]=Gr({prop:n,defaultProp:o??!1,onChange:f,caller:ay}),[E,S]=m.useState(null),[C,R]=m.useState(null),j=m.useRef(!1),_=E?!!c||!!E.closest("form"):!0,D={checked:v,disabled:l,setChecked:b,control:E,setControl:S,name:d,form:c,value:g,hasConsumerStoppedPropagationRef:j,required:h,defaultChecked:Hi(o)?!1:o,isFormControl:_,bubbleInput:C,setBubbleInput:R};return a.jsx(toe,{scope:t,...D,children:roe(y)?y(D):r})}var r6="CheckboxTrigger",a6=m.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},o)=>{const{control:l,value:c,disabled:d,checked:f,required:h,setControl:g,setChecked:y,hasConsumerStoppedPropagationRef:v,isFormControl:b,bubbleInput:E}=qS(r6,e),S=dt(o,g),C=m.useRef(f);return m.useEffect(()=>{const R=l==null?void 0:l.form;if(R){const j=()=>y(C.current);return R.addEventListener("reset",j),()=>R.removeEventListener("reset",j)}},[l,y]),a.jsx(et.button,{type:"button",role:"checkbox","aria-checked":Hi(f)?"mixed":f,"aria-required":h,"data-state":u6(f),"data-disabled":d?"":void 0,disabled:d,value:c,...r,ref:S,onKeyDown:Te(t,R=>{R.key==="Enter"&&R.preventDefault()}),onClick:Te(n,R=>{y(j=>Hi(j)?!0:!j),E&&b&&(v.current=R.isPropagationStopped(),v.current||R.stopPropagation())})})});a6.displayName=r6;var s6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:l,required:c,disabled:d,value:f,onCheckedChange:h,form:g,...y}=e;return a.jsx(noe,{__scopeCheckbox:n,checked:o,defaultChecked:l,disabled:d,required:c,onCheckedChange:h,name:r,form:g,value:f,internal_do_not_use_render:({isFormControl:v})=>a.jsxs(a.Fragment,{children:[a.jsx(a6,{...y,ref:t,__scopeCheckbox:n}),v&&a.jsx(c6,{__scopeCheckbox:n})]})})});s6.displayName=ay;var o6="CheckboxIndicator",i6=m.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,l=qS(o6,n);return a.jsx(_r,{present:r||Hi(l.checked)||l.checked===!0,children:a.jsx(et.span,{"data-state":u6(l.checked),"data-disabled":l.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});i6.displayName=o6;var l6="CheckboxBubbleInput",c6=m.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:o,checked:l,defaultChecked:c,required:d,disabled:f,name:h,value:g,form:y,bubbleInput:v,setBubbleInput:b}=qS(l6,e),E=dt(n,b),S=dS(l),C=sb(r);m.useEffect(()=>{const j=v;if(!j)return;const _=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(_,"checked").set,O=!o.current;if(S!==l&&A){const T=new Event("click",{bubbles:O});j.indeterminate=Hi(l),A.call(j,Hi(l)?!1:l),j.dispatchEvent(T)}},[v,S,l,o]);const R=m.useRef(Hi(l)?!1:l);return a.jsx(et.input,{type:"checkbox","aria-hidden":!0,defaultChecked:c??R.current,required:d,disabled:f,name:h,value:g,form:y,...t,tabIndex:-1,ref:E,style:{...t.style,...C,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});c6.displayName=l6;function roe(e){return typeof e=="function"}function Hi(e){return e==="indeterminate"}function u6(e){return Hi(e)?"indeterminate":e?"checked":"unchecked"}function aoe({className:e,...t}){return a.jsx(s6,{"data-slot":"checkbox",className:ne("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(i6,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5"})})})}function d6({isPrimaryKey:e,onPrimaryKeyChange:t}){const n=!!e,r=o=>{t&&t(o)};return a.jsx(aoe,{className:"cursor-pointer",checked:n,onCheckedChange:r,"aria-label":"Primary Key"})}const kT={[es.CONNECTED]:{icon:ng,color:"text-green-500",label:"Connected",description:"Field is connected to the data source"},[es.CONNECTED_WITH_DEFINITION_MISMATCH]:{icon:ag,color:"text-orange-500",label:"Connected with issues",description:"Field is connected but has definition mismatches"},[es.DISCONNECTED]:{icon:Xk,color:"text-red-500",label:"Disconnected",description:"Field is not connected to the data source"}};function f6({status:e}){if(!e||!(e in kT))return null;const t=kT[e],{icon:n,color:r,label:o,description:l}=t,c=`schema-field-status-tooltip-${e}`;return a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx(n,{className:ne("h-5 w-5",r),role:"img","aria-label":o,"aria-describedby":c,tabIndex:0})}),a.jsxs(Ct,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs font-medium",children:o}),a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:l})]})]})})}function h6({type:e,storageType:t,onTypeChange:n}){const r=t===ke.GOOGLE_BIGQUERY?Object.values($n):Object.values(nS),o=l=>{n&&(ke.GOOGLE_BIGQUERY,n(l))};return a.jsxs(Kr,{value:e,onValueChange:o,children:[a.jsx(Wr,{className:"cursor-pointer",size:"sm",children:a.jsx(Yr,{placeholder:"Select field type"})}),a.jsx(Qr,{className:"max-h-[300px]",children:r.map(l=>a.jsx(Rn,{value:l,children:l},l))})]})}function soe({table:e}){return a.jsx("div",{className:"px-3 text-right",children:a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(pt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.columnDef.meta?t.columnDef.meta.title??t.id:t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.columnDef.meta?t.columnDef.meta.title??t.id:t.id})]})},t.id))})]})})}function ooe({id:e,placeholder:t="Search",value:n,onChange:r,debounceTime:o=500,className:l,"aria-label":c}){const[d,f]=m.useState(n),h=m.useRef(!0);m.useEffect(()=>{(n===""||h.current)&&(f(n),h.current=!1)},[n]);const g=m.useCallback(y=>{const v=y.target.value;f(v);const b=setTimeout(()=>{r(v)},o);return()=>{clearTimeout(b)}},[r,o]);return a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Jl,{className:"dm-card-toolbar-search-icon","aria-hidden":"true"}),a.jsx(Ht,{id:e,placeholder:t,value:d,onChange:g,className:l??"dm-card-toolbar-search-input","aria-label":c??t})]})}function ioe({searchInputId:e,onAddField:t,filterValue:n,onFilterChange:r,statusCounts:o,disabled:l=!1}){return a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsx(ooe,{id:e,placeholder:"Search fields",value:n,onChange:r,className:"dm-card-toolbar-search-input","aria-label":"Search fields"})}),a.jsxs("div",{className:"dm-card-toolbar-right",children:[o&&a.jsx("div",{className:"mr-3 flex items-center gap-3",children:Object.entries(o).map(([c,d])=>d===0?null:a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(f6,{status:c}),a.jsx("span",{className:"text-sm font-medium text-gray-500",children:d})]},c))}),a.jsxs(xe,{variant:"outline",className:"dm-card-table-add-field-btn cursor-pointer",onClick:t,disabled:l,"aria-label":"Add new field",children:[a.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})]})}const loe={dragHandle:{left:0,zIndex:1},status:{left:20,zIndex:1},name:{left:56,zIndex:1},actions:{right:0,zIndex:1}};function LT(e,t={}){const n=loe[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 coe({fields:e,columns:t,onAddRow:n,fieldsForStatusCount:r,onSearchChange:o,dragContext:l,dragContextProps:c,rowComponent:d=Pn,getRowId:f}){const{isSchemaActualizationLoading:h}=Ia(),g=t,y=l,v=d,{columnVisibility:b,setColumnVisibility:E}=uae(g),S=oc({data:e,columns:g,getCoreRowModel:sc(),getFilteredRowModel:Jf(),columnResizeMode:"onChange",enableColumnResizing:!0,state:{columnVisibility:b},onColumnVisibilityChange:E,enableGlobalFilter:!0,globalFilterFn:dae,defaultColumn:{enableResizing:!0,size:0,minSize:0}}),{value:C,onChange:R,searchValue:j}=fae(S),_=m.useRef("");m.useEffect(()=>{o&&j!==_.current&&(_.current=j,o(j))},[j,o]);const D=m.useMemo(()=>{const T={[es.CONNECTED]:0,[es.CONNECTED_WITH_DEFINITION_MISMATCH]:0,[es.DISCONNECTED]:0};return(r??e).forEach(V=>{V.status in T&&T[V.status]++}),T},[e,r]);return a.jsxs("div",{className:"space-y-4",children:[n&&a.jsx(ioe,{table:S,searchInputId:"schema-fields-search-input",onAddField:n,filterValue:C,onFilterChange:R,statusCounts:D,disabled:h}),a.jsx("div",{className:"dm-card-table-wrap mb-0",children:a.jsxs(ic,{id:"schema-fields-table",className:"w-full table-auto",role:"table",children:[a.jsx(lc,{className:"dm-card-table-header",children:S.getHeaderGroups().map(T=>a.jsx(Pn,{className:"dm-card-table-header-row",children:T.headers.map(M=>a.jsx(uc,{className:"bg-secondary dark:bg-background",style:LT(M.column.id,{width:M.getSize()!==0?M.getSize():void 0,whiteSpace:"nowrap",cursor:"default"}),children:M.isPlaceholder?null:typeof M.column.columnDef.header=="function"?M.column.columnDef.header(M.getContext()):M.column.columnDef.header},M.id))},T.id))}),a.jsx(cc,{className:"dm-card-table-body",children:S.getRowModel().rows.length?a.jsx(y,{...c,children:S.getRowModel().rows.map(T=>a.jsx(v,{id:f?f(T):T.index,row:T,children:T.getVisibleCells().map(M=>a.jsx(Zr,{className:"bg-background dark:bg-muted",style:LT(M.column.id,{width:M.column.getSize()!==0?M.column.getSize():void 0,whiteSpace:"pre",paddingTop:8,paddingBottom:8}),children:M.column.columnDef.cell&&typeof M.column.columnDef.cell=="function"?M.column.columnDef.cell(M.getContext()):null},M.id))},T.id))}):a.jsx(Pn,{children:a.jsx(Zr,{colSpan:g.length,className:"text-center text-gray-400",style:{whiteSpace:"nowrap"},children:"Output schema has no configured fields"})})})]})}),n&&a.jsxs(xe,{variant:"outline",className:"dm-card-table-add-field-btn bg-background dark:bg-muted w-full cursor-pointer rounded-t-none border-0",onClick:n,disabled:h,"aria-label":"Add new field",children:[a.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Field"]})]})}function m6({fields:e,onFieldsChange:t,onAddRow:n,createNewField:r,renderTypeCell:o,additionalColumns:l=[],fieldsForStatusCount:c,onSearchChange:d,nameColumnHeader:f,nameColumnCell:h,primaryKeyColumnCell:g,aliasColumnCell:y,descriptionColumnCell:v,actionsColumnCell:b,dragContext:E,dragContextProps:S,rowComponent:C,getRowId:R}){const j=m.useCallback((T,M)=>{if(t){const V=[...e];V[T]={...V[T],...M},t(V)}},[e,t]),_=m.useCallback(()=>{if(t){const T=r();t([...e,T])}},[e,t,r]),D=m.useCallback(T=>{if(t){const M=[...e];M.splice(T,1),t(M)}},[e,t]),A=m.useMemo(()=>[{id:"dragHandle",header:"",size:24,enableHiding:!1},{accessorKey:"status",header:"",size:36,cell:({row:T})=>a.jsx(f6,{status:T.getValue("status")}),enableHiding:!1},{accessorKey:"name",header:f??(()=>a.jsxs(bt,{children:[a.jsx(St,{className:"cursor-default",children:"Name"}),a.jsx(Ct,{children:"Field name in the output schema"})]})),size:80,cell:({row:T})=>h?h({row:T,updateField:j}):a.jsx(vu,{value:iae(T.getValue("name")),onValueChange:M=>{j(T.index,{name:M})},placeholder:"Field name is required",isBold:!0}),enableHiding:!1},{accessorKey:"isPrimaryKey",header:()=>a.jsxs(bt,{children:[a.jsx(St,{className:"cursor-default",children:"PK"}),a.jsx(Ct,{children:"Is field must be considered as a part of the output Primary Key"})]}),size:36,cell:({row:T})=>g?g({row:T,updateField:j}):a.jsx(d6,{isPrimaryKey:T.getValue("isPrimaryKey"),onPrimaryKeyChange:M=>{j(T.index,{isPrimaryKey:M})}}),enableHiding:!1},{accessorKey:"alias",header:()=>a.jsxs(bt,{children:[a.jsx(St,{className:"cursor-default",children:"Alias"}),a.jsx(Ct,{children:"Alternative name for the field"})]}),size:80,cell:({row:T})=>y?y({row:T,updateField:j}):a.jsx(vu,{value:T.getValue("alias"),onValueChange:M=>{j(T.index,{alias:M})},placeholder:"-"})},{accessorKey:"description",header:()=>a.jsxs(bt,{children:[a.jsx(St,{className:"cursor-default",children:"Description"}),a.jsx(Ct,{children:"Detailed information about the field"})]}),cell:({row:T})=>v?v({row:T,updateField:j}):a.jsx(vu,{value:T.getValue("description"),onValueChange:M=>{j(T.index,{description:M})},minRows:5,placeholder:"-"})},{id:"actions",header:({table:T})=>a.jsx(soe,{table:T}),cell:({row:T,table:M})=>b?b({row:T,table:M}):a.jsx(n6,{row:T,onDeleteRow:t?D:void 0}),size:40,enableResizing:!1,enableHiding:!1}],[j,D,t,f,h,g,y,v,b]),O=m.useMemo(()=>{const M={accessorKey:"type",header:()=>a.jsxs(bt,{children:[a.jsx(St,{className:"cursor-default pl-[12px]",children:"Type"}),a.jsx(Ct,{children:"Data type of the field"})]}),size:80,cell:Z=>o({row:Z.row,updateField:j}),enableHiding:!1},V=[...A];if(V.splice(3,0,M),l.length>0){const Z=[...l];Z.sort((K,Y)=>{const G=K.columnIndex??1/0,U=Y.columnIndex??1/0;return G-U}),Z.forEach(K=>{if(K.columnIndex!==void 0){const Y=Math.min(Math.max(0,K.columnIndex),V.length);V.splice(Y,0,K)}else V.splice(V.length-1,0,K)})}return V},[A,o,j,l]);return a.jsx(coe,{fields:e,columns:O,onFieldsChange:t,onAddRow:n??(t?_:void 0),fieldsForStatusCount:c,onSearchChange:d,dragContext:E,dragContextProps:S,rowComponent:C,getRowId:R})}function uoe({fields:e,onFieldsChange:t}){const{expandedRecords:n,hasRecordFields:r,toggleRecordExpansion:o,toggleAllRecords:l,flattenedFields:c,handleSearchChange:d,isRecordType:f,topLevelFields:h,allExpanded:g}=hae(e),{updateField:y,handleDeleteRow:v,handleAddNestedField:b,handleAddRow:E}=mae(e,c,t,K=>K),S=m.useCallback(()=>({name:"",type:$n.STRING,mode:Cf.NULLABLE,isPrimaryKey:!1,status:es.DISCONNECTED}),[]),C=m.useCallback(({row:K})=>a.jsx(h6,{type:K.getValue("type"),storageType:ke.GOOGLE_BIGQUERY,onTypeChange:Y=>{y(K.index,{type:Y})}}),[y]),R=m.useMemo(()=>[{accessorKey:"mode",header:()=>a.jsxs(bt,{children:[a.jsx(St,{className:"cursor-default pl-[12px]",children:"Mode"}),a.jsx(Ct,{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})=>a.jsx(Jse,{mode:K.getValue("mode"),onModeChange:Y=>{y(K.index,{mode:Y})}}),columnIndex:4}],[y]),j=m.useCallback(()=>a.jsxs("div",{className:"flex items-center",children:[r&&a.jsx(Wse,{isAllExpanded:g,onToggle:l}),a.jsxs(bt,{children:[a.jsx(St,{className:"cursor-default",children:"Name"}),a.jsx(Ct,{children:"Field name in the output schema"})]})]}),[r,g,l]),_=m.useCallback(({row:K})=>{const Y=c[K.index],U=(Y.type===$n.RECORD||Y.type===$n.STRUCT)&&Y.fields&&Y.fields.length>0,H=Y.path??"",k=Y.level??0,$=n.has(H);return a.jsxs("div",{className:"flex items-center",children:[k>0&&a.jsx("div",{style:{width:`${String(k*16-(U?4:0))}px`},className:"flex-shrink-0"}),U?a.jsx(Qse,{isExpanded:$,onToggle:()=>{o(H)},ariaLabel:$?"Collapse nested fields":"Expand nested fields"}):r&&a.jsx("div",{className:"w-5"}),a.jsx(vu,{value:K.getValue("name"),onValueChange:q=>{y(K.index,{name:q})},placeholder:"Field name is required",isBold:!0})]})},[c,n,r,o,y]),D=m.useCallback(({row:K})=>{const Y=c[K.index],G=Y.type===$n.RECORD||Y.type===$n.STRUCT;return(Y.level??0)===0&&!G?a.jsx(d6,{isPrimaryKey:K.getValue("isPrimaryKey"),onPrimaryKeyChange:H=>{y(K.index,{isPrimaryKey:H})}}):a.jsx("div",{})},[c,y]),A=m.useCallback(({row:K})=>a.jsx(vu,{value:K.getValue("description"),onValueChange:Y=>{y(K.index,{description:Y})},minRows:5,placeholder:"-"}),[y]),O=m.useCallback(({row:K})=>a.jsx(vu,{value:K.getValue("alias"),onValueChange:Y=>{y(K.index,{alias:Y})},placeholder:"-"}),[y]),T=m.useCallback(({row:K})=>a.jsx(n6,{row:K,onDeleteRow:t?v:void 0,onAddNestedField:t?b:void 0,isRecordType:f}),[t,v,b,f]),{handleDragEnd:M}=T5(e,t,c),V=m.useCallback(K=>{const Y=c[K.index];return Y.path??String(c.indexOf(Y))},[c]),Z=O5(D5(ty,{activationConstraint:{distance:5}}));return a.jsx(Z5,{sensors:Z,collisionDetection:M5,onDragEnd:M,children:a.jsx(m6,{fields:c,onFieldsChange:t,onAddRow:E,createNewField:S,renderTypeCell:C,additionalColumns:R,fieldsForStatusCount:h,onSearchChange:d,nameColumnHeader:j,nameColumnCell:_,primaryKeyColumnCell:D,aliasColumnCell:O,descriptionColumnCell:A,actionsColumnCell:T,dragContext:J5,dragContextProps:{items:c.map(K=>K.path??String(c.indexOf(K))),strategy:W5},rowComponent:t6,getRowId:V})})}function doe({fields:e,onFieldsChange:t}){const n=m.useCallback(()=>({name:"",type:nS.STRING,isPrimaryKey:!1,status:es.DISCONNECTED}),[]),r=m.useCallback(({row:c,updateField:d})=>a.jsx(h6,{type:c.getValue("type"),storageType:ke.AWS_ATHENA,onTypeChange:f=>{d(c.index,{type:f})}}),[]),{handleDragEnd:o}=T5(e,t),l=O5(D5(ty,{activationConstraint:{distance:5}}));return a.jsx(Z5,{sensors:l,collisionDetection:M5,onDragEnd:o,children:a.jsx(m6,{fields:e,onFieldsChange:t,createNewField:n,renderTypeCell:r,dragContext:J5,dragContextProps:{items:e.map((c,d)=>d),strategy:W5},rowComponent:t6})})}function foe({schema:e,storageType:t,onFieldsChange:n}){const r=m.useMemo(()=>{if(!e){const o=oae(t);return n(o.fields),o}return e},[e,t,n]);return E5(r)?a.jsx(uoe,{fields:r.fields,onFieldsChange:n}):w5(r)?a.jsx(doe,{fields:r.fields,onFieldsChange:n}):a.jsx("div",{className:"p-4 text-center",children:a.jsx("p",{children:"Unsupported schema type"})})}function hoe({definitionType:e}){const{dataMart:t,updateDataMartSchema:n,isLoading:r,error:o,runSchemaActualization:l,isSchemaActualizationLoading:c}=Ia(),{id:d="",schema:f}=t??{},{schema:h,isDirty:g,updateSchema:y,resetSchema:v}=lae(f),{operationStatus:b,startSaveOperation:E}=cae(r,o);m.useEffect(()=>{b==="success"&&v()},[b,v]);const S=m.useCallback(D=>{y(D)},[y]),C=m.useCallback(()=>{d&&h&&(E(),n(d,h).then(()=>{l==null||l()}))},[d,h,E,n,l]),R=m.useCallback(()=>{l==null||l()},[l]),j=m.useCallback(()=>{v()},[v]),_=r||c;return t?a.jsxs("div",{className:"space-y-4",children:[a.jsx(foe,{schema:h,storageType:t.storage.type,onFieldsChange:S}),a.jsxs("div",{className:"align-items-center mt-8 flex justify-between",children:[a.jsxs("div",{className:"flex space-x-4",children:[a.jsx(xe,{variant:"default",onClick:C,disabled:!g||_,children:"Save"}),a.jsx(xe,{type:"button",variant:"ghost",onClick:j,disabled:!g||_,children:"Discard"})]}),a.jsx(xe,{type:"button",variant:"outline",onClick:R,disabled:!e||_,children:"Refresh schema"})]})]}):a.jsx("div",{children:"Error: Data mart not found"})}function moe(){const e=p_(),{id:t,projectId:n}=e;return t?n?a.jsx("div",{className:"dm-page",children:a.jsx(G3,{children:a.jsx(nee,{id:t})})}):a.jsx("div",{className:"dm-page-header",children:"Project ID is required"}):a.jsx("div",{className:"dm-page-header",children:"Data Mart ID is required"})}function poe({className:e,...t}){return a.jsx("div",{"data-slot":"card",className:ne("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...t})}function goe({className:e,...t}){return a.jsx("div",{"data-slot":"card-header",className:ne("@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 yoe({className:e,...t}){return a.jsx("div",{"data-slot":"card-title",className:ne("leading-none font-semibold",e),...t})}function voe({className:e,...t}){return a.jsx("div",{"data-slot":"card-description",className:ne("text-muted-foreground text-sm",e),...t})}function xoe({className:e,...t}){return a.jsx("div",{"data-slot":"card-content",className:ne("px-6",e),...t})}function boe({className:e,...t}){return a.jsx("div",{"data-slot":"card-footer",className:ne("flex items-center px-6 [.border-t]:pt-6",e),...t})}const ZS=m.createContext({isCollapsed:!1,collapsible:!1,handleCollapse:()=>{throw new Error("CollapsibleCardContext: handleCollapse not implemented")}});function ko({icon:e,tooltip:t,subtitle:n,children:r}){const{isCollapsed:o}=m.useContext(ZS);return a.jsxs("div",{className:"flex items-center gap-2 self-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"text-foreground flex h-7 w-7 items-center justify-center rounded-sm bg-gray-200/50 transition-colors duration-200 group-hover:bg-gray-200/75 dark:bg-white/8 dark:group-hover:bg-white/10",children:a.jsx(e,{size:18})}),a.jsx(yoe,{className:"text-md text-foreground leading-none font-medium",children:r})]}),n&&a.jsx(voe,{className:ne("text-md text-muted-foreground/50",!o&&"hidden"),children:n}),t&&a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("div",{className:"pointer-events-none ml-2 flex items-center opacity-0 transition-opacity duration-200 group-hover:pointer-events-auto group-hover:opacity-100",children:[a.jsx(Br,{className:"text-muted-foreground/50 hover:text-muted-foreground size-4 shrink-0 transition-colors"}),a.jsx("span",{className:"sr-only",children:t})]})}),a.jsx(Ct,{children:a.jsx("p",{children:t})})]})})]})}ko.displayName="CollapsibleCardHeaderTitle";function sy({children:e,className:t}){const n=r=>{r.stopPropagation()};return a.jsx("div",{className:ne("flex items-center gap-2 self-center",t),onClick:n,children:e})}sy.displayName="CollapsibleCardHeaderActions";function Lo({children:e}){const{collapsible:t,isCollapsed:n,handleCollapse:r}=m.useContext(ZS);let o,l;return m.Children.forEach(e,c=>{if(m.isValidElement(c))switch(c.type){case ko:o=c;break;case sy:l=c;break}}),a.jsxs(goe,{className:ne("group flex items-start justify-between gap-4 px-4 py-4",t&&"cursor-pointer"),onClick:t?r:void 0,children:[o,a.jsxs("div",{className:"flex items-center gap-2",children:[l,t&&a.jsx("div",{className:ne("flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 hover:bg-gray-200/50 dark:hover:bg-white/4"),children:a.jsx("div",{className:ne("transform transition-transform duration-200",n?"rotate-0":"rotate-180"),children:a.jsx(ka,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})]})]})}Lo.displayName="CollapsibleCardHeader";function Po({children:e}){return a.jsx(xoe,{className:"px-4 pt-1",children:e})}Po.displayName="CollapsibleCardContent";function $i({left:e,right:t}){return a.jsxs(boe,{className:"flex items-center gap-2 px-4 py-4",children:[a.jsx("div",{className:"flex flex-grow items-center gap-2",children:e}),t&&a.jsx("div",{className:"flex items-center",children:t})]})}$i.displayName="CollapsibleCardFooter";const PT="collapsed-card-";function Vl({children:e,className:t,variant:n="default",collapsible:r=!1,defaultCollapsed:o=!1,onCollapsedChange:l,name:c}){const d=c?Ii.get(`${PT}${c}`,"boolean")??o:o,[f,h]=m.useState(d);m.useEffect(()=>{c&&Ii.set(`${PT}${c}`,f)},[f,c]);const g=()=>{const S=!f;h(S),l==null||l(S)};let y,v,b;m.Children.forEach(e,S=>{if(m.isValidElement(S))switch(S.type){case Lo:y=S;break;case Po:v=S;break;case $i:b=S;break}});const E={default:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none",dense:"rounded-md p-0 gap-0 bg-muted/50 dark:bg-white/4 border-0 border-b border-gray-200 dark:border-white/8 shadow-none text-sm",flat:"rounded-md p-0 gap-0 border-0 border-b-0 shadow-none"};return a.jsx(ZS.Provider,{value:{isCollapsed:f,collapsible:r,handleCollapse:g},children:a.jsxs(poe,{className:ne(E[n],t),children:[y,a.jsx("div",{className:ne("grid transition-all duration-200",f?"grid-rows-[0fr]":"grid-rows-[1fr]"),children:a.jsxs("div",{className:"overflow-hidden",children:[v,b]})})]})})}function Soe(){const{dataMart:e,updateDataMartStorage:t}=Wo(),n=(e==null?void 0:e.definitionType)??null,[r,o]=m.useState(n);return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs(Vl,{collapsible:!0,name:"data-storage",children:[a.jsx(Lo,{children:a.jsx(ko,{icon:zl,tooltip:"Configure where your data will be stored",children:"Storage"})}),a.jsx(Po,{children:(e==null?void 0:e.storage)&&a.jsx(gne,{dataStorage:e.storage,onDataStorageChange:t})}),a.jsx($i,{})]}),a.jsxs(Vl,{collapsible:!0,name:"input-source",children:[a.jsx(Lo,{children:a.jsx(ko,{icon:B1,tooltip:"Configure how to extract data from your data warehouse",children:"Input Source"})}),a.jsx(Po,{children:e&&a.jsx(sae,{definitionType:r,initialDefinitionType:n,setDefinitionType:o})}),a.jsx($i,{})]}),a.jsxs(Vl,{collapsible:!0,name:"output-schema",children:[a.jsx(Lo,{children:a.jsx(ko,{icon:dk,tooltip:"Configure your data mart output schema",children:"Output Schema"})}),a.jsx(Po,{children:e&&a.jsx(hoe,{definitionType:r})}),a.jsx($i,{})]})]})}function Coe({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,o]=m.useState(!1),[l,c]=m.useState(!1),[d,f]=m.useState(!1),{deleteReport:h,fetchReportsByDataMartId:g,runReport:y}=Ts(),v=`actions-menu-${e.original.id}`,b=m.useCallback(async()=>{try{await h(e.original.id),await g(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete Google Sheet:",R)}},[h,g,t,e.original.id,e.original.dataMart.id]),E=m.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=m.useCallback(async()=>{try{o(!0),await y(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{o(!1)}},[y,e.original.id]),C=m.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(ur,{open:l,onOpenChange:c,children:[a.jsx(dr,{asChild:!0,children:a.jsxs(xe,{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":v,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(fr,{id:v,align:"end",role:"menu",children:[a.jsxs(pt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem",children:[a.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),Lg(e.original.destinationConfig)&&a.jsxs(a.Fragment,{children:[a.jsx(ma,{}),a.jsxs(pt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(rg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(pt,{asChild:!0,children:a.jsxs("a",{href:Mb(e.original.destinationConfig.spreadsheetId,e.original.destinationConfig.sheetId),target:"_blank",rel:"noopener noreferrer",role:"menuitem",onClick:R=>{R.stopPropagation()},children:[a.jsx(jk,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Open document"]})})]}),a.jsx(ma,{}),a.jsxs(pt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Tr,{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 Eoe={[fn.SUCCESS]:{icon:ng,color:"text-green-500",label:"Success"},[fn.ERROR]:{icon:dp,color:"text-red-500",label:"Fail"},[fn.RUNNING]:{icon:Of,color:"text-primary animate-spin",label:"In progress"},[fn.CANCELLED]:{icon:dp,color:"text-gray-500",label:"Cancelled"}};function p6({status:e,error:t}){if(!e)return null;const n=Eoe[e],{icon:r,color:o,label:l}=n,c=`status-tooltip-${e}-${t?"error":"normal"}`,d=()=>e===fn.ERROR&&t?`${l}: ${t}`:l;return a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx(r,{className:ne("h-5 w-5",o),role:"img","aria-label":d(),"aria-describedby":c,tabIndex:0})}),a.jsxs(Ct,{id:c,side:"bottom",role:"tooltip",children:[a.jsx("div",{className:"text-xs",children:l}),e===fn.ERROR&&t&&a.jsx("div",{className:"mt-1 max-w-xs text-xs break-words whitespace-normal",children:t})]})]})})}function m0({column:e,children:t,label:n}){const r=e.getIsSorted(),o=m.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 a.jsxs(xe,{variant:"ghost",onClick:o,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(ns,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(ka,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(ns,{className:"text-muted-foreground h-4 w-4"})})]})]})}var Fi=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(Fi||{});const g6={[Fi.TITLE]:"Title",[Fi.LAST_RUN_DATE]:"Last Run Date",[Fi.LAST_RUN_STATUS]:"Last Run Status"};function woe({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=g6[t.id]||t.id;return a.jsx(pt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const UT=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},Roe=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:Fi.TITLE,header:({column:n})=>a.jsx(m0,{column:n,children:g6[Fi.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:Fi.LAST_RUN_DATE,header:({column:n})=>a.jsx(m0,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Zi,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:Fi.LAST_RUN_STATUS,header:({column:n})=>a.jsx(m0,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(p6,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(woe,{table:n}),cell:({row:n})=>a.jsx(Coe,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function joe({destination:e,onEditReport:t}){const{reports:n,setPollingConfig:r}=Ts(),o=m.useMemo(()=>n.filter(v=>v.dataDestination.type===je.GOOGLE_SHEETS&&v.dataDestination.id===e.id),[n,e.id]);m.useEffect(()=>{r({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[r]);const l=m.useMemo(()=>Roe({onDeleteSuccess:()=>{},onEditReport:t}),[t]),{sorting:c,setSorting:d,columnVisibility:f,setColumnVisibility:h}=Vu({columns:l,storageKeyPrefix:`data-mart-google-sheets-reports-${e.id}`,defaultSortingColumn:"lastRunDate"}),g=oc({data:o,columns:l,getCoreRowModel:sc(),onSortingChange:d,getSortedRowModel:Fu(),state:{sorting:c,columnVisibility:f},onColumnVisibilityChange:h}),y=`google-sheets-reports-table-${e.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(ic,{id:y,className:"dm-card-table",role:"table","aria-label":`${e.title} reports`,children:[a.jsx(lc,{className:"dm-card-table-header",children:g.getHeaderGroups().map(v=>a.jsx(Pn,{className:"dm-card-table-header-row",children:v.headers.map(b=>a.jsx(uc,{className:UT(b.column.columnDef._align),style:b.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(b.column.getSize())}%`},scope:"col",children:b.isPlaceholder?null:typeof b.column.columnDef.header=="function"?b.column.columnDef.header(b.getContext()):b.column.columnDef.header},b.id))},v.id))}),a.jsx(cc,{className:"dm-card-table-body",children:g.getRowModel().rows.length?g.getRowModel().rows.map((v,b)=>a.jsx(Pn,{onClick:()=>{const E=n.find(S=>S.id===v.original.id);E&&t(E)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":b+1,children:v.getVisibleCells().map((E,S)=>a.jsx(Zr,{className:`px-6 whitespace-normal ${UT(E.column.columnDef._align)}`,style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},role:"cell","aria-colindex":S+1,children:typeof E.column.columnDef.cell=="function"?E.column.columnDef.cell(E.getContext()):E.column.columnDef.cell},E.id))},v.id)):a.jsx(Pn,{children:a.jsx(Zr,{colSpan:l.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function Toe({row:e,onDeleteSuccess:t,onEditReport:n}){const[r,o]=m.useState(!1),[l,c]=m.useState(!1),[d,f]=m.useState(!1),{deleteReport:h,fetchReportsByDataMartId:g,runReport:y}=Ts(),v=`actions-menu-${e.original.id}`,b=m.useCallback(async()=>{try{await h(e.original.id),await g(e.original.dataMart.id),t==null||t(),f(!1)}catch(R){console.error("Failed to delete report:",R)}},[h,g,t,e.original.id,e.original.dataMart.id]),E=m.useCallback(()=>{n==null||n(e.original),c(!1)},[n,e.original]),S=m.useCallback(async()=>{try{o(!0),await y(e.original.id)}catch(R){console.error("Failed to run report:",R)}finally{o(!1)}},[y,e.original.id]),C=m.useCallback(()=>{f(!0),c(!1)},[]);return a.jsxs("div",{className:"text-right",onClick:R=>{R.stopPropagation()},children:[a.jsxs(ur,{open:l,onOpenChange:c,children:[a.jsx(dr,{asChild:!0,children:a.jsxs(xe,{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":v,children:[a.jsx("span",{className:"sr-only",children:"Open menu"}),a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon","aria-hidden":"true"})]})}),a.jsxs(fr,{id:v,align:"end",role:"menu",children:[a.jsxs(pt,{onClick:R=>{R.stopPropagation(),E()},role:"menuitem",children:[a.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),"Edit report"]}),a.jsx(ma,{}),a.jsxs(pt,{onClick:R=>{R.stopPropagation(),S()},disabled:r,role:"menuitem","aria-label":r?"Running report...":`Run report: ${e.original.title}`,children:[a.jsx(rg,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),r?"Running...":"Run report"]}),a.jsx(ma,{}),a.jsxs(pt,{onClick:R=>{R.stopPropagation(),C()},role:"menuitem","aria-label":`Delete report: ${e.original.title}`,children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete report"})]})]})]}),a.jsx(Tr,{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"})]})}function p0({column:e,children:t,label:n}){const r=e.getIsSorted(),o=m.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 a.jsxs(xe,{variant:"ghost",onClick:o,className:"group dm-card-table-header-row-btn","aria-label":`${d} - ${l()}. Click to sort.`,"aria-sort":c(),children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[r==="asc"&&a.jsx(ns,{className:"text-foreground h-4 w-4"}),r==="desc"&&a.jsx(ka,{className:"text-foreground h-4 w-4"}),!r&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(ns,{className:"text-muted-foreground h-4 w-4"})})]})]})}var Vi=(e=>(e.TITLE="title",e.LAST_RUN_DATE="lastRunDate",e.LAST_RUN_STATUS="lastRunStatus",e))(Vi||{});const y6={[Vi.TITLE]:"Title",[Vi.LAST_RUN_DATE]:"Last Run Date",[Vi.LAST_RUN_STATUS]:"Last Run Status"};function _oe({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>{const n=y6[t.id]||t.id;return a.jsx(pt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:n})]})},t.id)})})]})})}const FT=e=>{switch(e){case"right":return"text-right";case"center":return"text-center";default:return"text-left"}},Noe=({onDeleteSuccess:e,onEditReport:t}={})=>[{accessorKey:Vi.TITLE,header:({column:n})=>a.jsx(p0,{column:n,children:y6[Vi.TITLE]}),cell:({row:n})=>n.original.title,enableColumnFilter:!0,size:50},{accessorKey:Vi.LAST_RUN_DATE,header:({column:n})=>a.jsx(p0,{column:n,children:"Last Run Date"}),cell:({row:n})=>{const r=n.original.lastRunDate;return a.jsx("div",{className:"text-muted-foreground text-sm",children:r?a.jsx(Zi,{date:new Date(r)}):"Never run"})},size:25},{accessorKey:Vi.LAST_RUN_STATUS,header:({column:n})=>a.jsx(p0,{column:n,children:"Last Run Status"}),cell:({row:n})=>n.original.lastRunStatus?a.jsx(p6,{status:n.original.lastRunStatus,error:n.original.lastRunError}):a.jsx("span",{className:"text-muted-foreground text-sm",children:"—"}),size:25},{id:"actions",header:({table:n})=>a.jsx(_oe,{table:n}),cell:({row:n})=>a.jsx(Toe,{row:n,onDeleteSuccess:e,onEditReport:t}),size:80}];function Aoe({destinationType:e,destination:t,onEditReport:n}){const{reports:r,setPollingConfig:o}=Ts(),l=m.useMemo(()=>r.filter(b=>b.dataDestination.type===e&&b.dataDestination.id===t.id),[r,t.id,e]);m.useEffect(()=>{o({initialPollingIntervalMs:2e3,initialPollCount:3,regularPollingIntervalMs:5e3})},[o]);const c=m.useMemo(()=>Noe({onDeleteSuccess:()=>{},onEditReport:n}),[n]),{sorting:d,setSorting:f,columnVisibility:h,setColumnVisibility:g}=Vu({columns:c,storageKeyPrefix:`data-mart-email-reports-${t.id}`,defaultSortingColumn:"lastRunDate"}),y=oc({data:l,columns:c,getCoreRowModel:sc(),onSortingChange:f,getSortedRowModel:Fu(),state:{sorting:d,columnVisibility:h},onColumnVisibilityChange:g}),v=`email-reports-table-${t.id}`;return a.jsx("div",{className:"w-full",children:a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(ic,{id:v,className:"dm-card-table",role:"table","aria-label":`${t.title} reports`,children:[a.jsx(lc,{className:"dm-card-table-header",children:y.getHeaderGroups().map(b=>a.jsx(Pn,{className:"dm-card-table-header-row",children:b.headers.map(E=>a.jsx(uc,{className:FT(E.column.columnDef._align),style:E.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(E.column.getSize())}%`},scope:"col",children:E.isPlaceholder?null:typeof E.column.columnDef.header=="function"?E.column.columnDef.header(E.getContext()):E.column.columnDef.header},E.id))},b.id))}),a.jsx(cc,{className:"dm-card-table-body",children:y.getRowModel().rows.length?y.getRowModel().rows.map((b,E)=>a.jsx(Pn,{onClick:()=>{const S=r.find(C=>C.id===b.original.id);S&&n(S)},className:"dm-card-table-body-row group",role:"row","aria-rowindex":E+1,children:b.getVisibleCells().map((S,C)=>a.jsx(Zr,{className:`px-6 whitespace-normal ${FT(S.column.columnDef._align)}`,style:S.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(S.column.getSize())}%`},role:"cell","aria-colindex":C+1,children:typeof S.column.columnDef.cell=="function"?S.column.columnDef.cell(S.getContext()):S.column.columnDef.cell},S.id))},b.id)):a.jsx(Pn,{children:a.jsx(Zr,{colSpan:c.length,className:"dm-card-table-body-row-empty",role:"cell",children:a.jsx("span",{role:"status","aria-live":"polite",children:"No reports for this destination"})})})})]})})})}function Doe({children:e,className:t,...n}){return a.jsx("div",{className:ne("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 Ooe({children:e,className:t,...n}){return a.jsx("div",{className:ne("flex flex-grow flex-col gap-1 py-4",t),...n,children:e})}function Moe({children:e,className:t,...n}){return a.jsx("div",{className:ne("text-md font-medium",t),...n,children:e})}function Ioe({children:e,className:t,...n}){return a.jsx("div",{className:ne("text-muted-foreground text-sm",t),...n,children:e})}function koe({checked:e,disabled:t,loading:n,onCheckedChange:r,tooltipTextSwitchOn:o,tooltipTextSwitchOff:l,tooltipTextSwitchDisabled:c}){const d=t?c??"Disabled":e?o:l;return a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("div",{className:"flex items-center justify-center py-5 pl-6",onClick:f=>f.stopPropagation(),children:n?a.jsx(Of,{className:"text-muted-foreground h-5 w-5 animate-spin"}):a.jsx(h5,{checked:e,disabled:t,onCheckedChange:r})})}),a.jsx(Ct,{children:d})]})}function Loe({icon:e,className:t,...n}){return a.jsx("div",{className:ne("flex flex-shrink-0 items-center justify-center self-center p-4",t),...n,children:a.jsx("div",{className:"flex h-7 w-7 items-center justify-center rounded-full transition-colors duration-200 group-hover:bg-gray-200/50 dark:group-hover:bg-white/4",children:e??a.jsx(La,{className:"text-muted-foreground/75 dark:text-muted-foreground/50 h-4 w-4"})})})}function Poe(e){const{dataMart:t}=Ia(),{reports:n,createReport:r,deleteReport:o,fetchReportsByDataMartId:l}=Ts(),[c,d]=m.useState(!1),f=m.useMemo(()=>n.find(b=>b.dataDestination.type===je.LOOKER_STUDIO&&b.dataDestination.id===e.id),[n,e.id]),h=m.useMemo(()=>(t==null?void 0:t.status.code)===Rr.PUBLISHED,[t==null?void 0:t.status.code]),g=m.useMemo(()=>!!f,[f]),y=m.useMemo(()=>g?"Available in Looker Studio":"Not available in Looker Studio",[g]),v=m.useCallback(async b=>{if(!(!t||!h)){d(!0);try{if(b){const E={title:`Looker Studio Report - ${e.title}`,dataMartId:t.id,dataDestinationId:e.id,destinationConfig:{type:yr.LOOKER_STUDIO_CONFIG,cacheLifetime:300}};await r(E),await l(t.id)}else f&&(await o(f.id),await l(t.id))}catch(E){console.error("Failed to toggle Looker Studio report:",E)}finally{d(!1)}}},[t,h,e,f,r,o,l]);return{existingReport:f,isLoading:c,isEnabled:h,isChecked:g,dynamicTitle:y,handleSwitchChange:v}}function Uoe({destination:e,onEditReport:t,...n}){const{existingReport:r,isLoading:o,isEnabled:l,isChecked:c,dynamicTitle:d,handleSwitchChange:f}=Poe(e),h=m.useCallback(()=>{r&&t(r)},[r,t]);return a.jsxs(Doe,{className:r?"cursor-pointer dark:hover:bg-white/5":"",onClick:r?h:void 0,...n,children:[a.jsx(koe,{checked:c,disabled:!l,loading:o,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"}),a.jsxs(Ooe,{children:[a.jsx(Moe,{children:d}),a.jsx(Ioe,{children:c&&r?a.jsx(a.Fragment,{children:r.lastRunDate?a.jsxs(a.Fragment,{children:["Last fetched"," ",r.lastRunStatus===fn.SUCCESS&&"successfully ",a.jsx(Zi,{date:new Date(r.lastRunDate)}),r.lastRunStatus===fn.ERROR&&" but failed with error",r.lastRunError&&a.jsx("div",{className:"mt-1 text-red-600 dark:text-red-400",children:r.lastRunError})]}):"Waiting for Looker Studio to fetch data"}):"Switch on to enable access"})]}),c&&r&&a.jsx(Loe,{})]})}function Foe(){const{scope:e}=Ko();return a.jsx("div",{className:"dm-card",children:a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(H1,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Google Sheets, Looker Studio… and friends!"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"To send your Data Mart's data to your favorite tools, create a Destination first."}),a.jsx(xe,{variant:"outline",asChild:!0,children:a.jsxs(ha,{to:e("/data-destinations"),className:"flex items-center gap-1",children:["Go to Destinations",a.jsx(La,{className:"h-4 w-4"})]})})]})})}function Voe(){const[e,t]=m.useState(!1),[n,r]=m.useState(ln.CREATE),[o,l]=m.useState(null);return{isOpen:e,mode:n,editingReport:o,handleAddReport:()=>{r(ln.CREATE),l(null),t(!0),Ue({event:"report_open",category:"Report",action:"CreateReport",label:"ReportForm"})},handleEditReport:h=>{r(ln.EDIT),l(h),t(!0),Ue({event:"report_open",category:"Report",action:"EditReport",label:h.dataDestination.type})},handleCloseModal:()=>{t(!1),l(null),Ue({event:"report_close",category:"Report",action:n===ln.EDIT?"Edit":"Create",label:"ReportForm"})}}}const zoe=[je.GOOGLE_SHEETS,je.EMAIL,je.SLACK,je.MS_TEAMS,je.GOOGLE_CHAT];function Hoe({destination:e,dataMartStatus:t}){const{destinationInfo:n,isVisible:r}=FK(e),{isOpen:o,mode:l,editingReport:c,handleAddReport:d,handleEditReport:f,handleCloseModal:h}=Voe();return r?a.jsxs(a.Fragment,{children:[a.jsxs(Vl,{name:e.id,collapsible:!0,defaultCollapsed:!1,children:[a.jsxs(Lo,{children:[a.jsx(ko,{icon:n.icon,children:e.title}),a.jsx(sy,{children:zoe.includes(e.type)&&a.jsx($oe,{dataMartStatus:t,onAddReport:d})})]}),a.jsx(Po,{children:a.jsx(yie,{destination:e,onEditReport:f})}),a.jsx($i,{})]}),a.jsx(gie,{destination:e,isOpen:o,onClose:h,mode:l,initialReport:c})]}):null}function $oe({dataMartStatus:e,onAddReport:t}){const n=(e==null?void 0:e.code)===Rr.DRAFT;return a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("span",{children:a.jsxs(xe,{onClick:t,variant:"outline",size:"sm","aria-label":"Add new report",disabled:n,children:[a.jsx(Pa,{className:"h-4 w-4"}),"Add Report"]})})}),n&&a.jsx(Ct,{children:a.jsx("p",{children:"To create a report, publish the Data Mart first"})})]})}function Boe({elementId:e,isOpen:t,delay:n=100,selectText:r=!1}){m.useEffect(()=>{{const o=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(o)}}},[t,e,n,r])}const Goe=Jt({title:$t().min(1,"Title is required"),documentUrl:$t().refine(r3,"Enter a valid Google Sheets URL"),dataDestinationId:$t().min(1,"Destination is required")});function qoe({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:o}){const[l,c]=m.useState(null),[d,f]=m.useState(!1),{updateReport:h,createReport:g,error:y,clearError:v}=Ts();m.useEffect(()=>{d&&y&&(c(y),f(!1))},[y,d]);const b=Qo({resolver:ll(Goe),defaultValues:{title:(e==null?void 0:e.title)??"",documentUrl:e!=null&&e.destinationConfig&&Lg(e.destinationConfig)?`https://docs.google.com/spreadsheets/d/${e.destinationConfig.spreadsheetId}/edit#gid=${e.destinationConfig.sheetId}`:"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(o==null?void 0:o.id)??""},mode:"onTouched"}),{register:E,handleSubmit:S,formState:C,reset:R}=b,{errors:j,isDirty:_}=C,D=m.useCallback(async A=>{try{c(null),v(),f(!0);const{spreadsheetId:O,sheetId:T}=gK(A.documentUrl);if(!O){c("Invalid Google Sheets URL");return}let M;if(t===ln.CREATE)M=await g({title:A.title,dataMartId:n,dataDestinationId:A.dataDestinationId,destinationConfig:{type:yr.GOOGLE_SHEETS_CONFIG,spreadsheetId:O,sheetId:T}});else{if(!e){c("Initial report is required for edit mode");return}M=await h(e.id,{title:A.title,dataDestinationId:A.dataDestinationId,destinationConfig:{type:yr.GOOGLE_SHEETS_CONFIG,spreadsheetId:O,sheetId:T}})}if(!M||y){c(y??"An error occurred while submitting the form");return}r==null||r()}catch(O){console.error("Error submitting form:",O),c("An error occurred while submitting the form")}},[t,e,n,g,h,r,v,y]);return{form:b,register:E,handleSubmit:S,errors:j,isDirty:_,reset:R,formError:l,isSubmitting:d,setFormError:c,getValues:b.getValues,onSubmit:D}}function Zoe(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"service-account-details",children:[a.jsx(un,{children:"How do I get a correct document link?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"To get the correct Google Sheets document URL with a Sheet ID (GID), follow these steps:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Open your Google Sheets document and select the specific ",a.jsx("strong",{children:"sheet tab"})," ","where the data should be inserted."]}),a.jsxs("li",{children:["Share the document with the service account email and grant it ",a.jsx("strong",{children:"Editor"})," ","access."]}),a.jsxs("li",{children:["While the correct sheet is selected, copy the URL from your browser's address bar — it should include the ",a.jsx("code",{className:"text-sm font-semibold",children:"gid"})," of that sheet."]}),a.jsx("li",{children:"Paste this URL into the field above."})]})]})]})})}function g0(e){return"serviceAccount"in e}function v6({value:e,children:t,doNotTruncateContent:n}){const[r,o]=m.useState(!1),l=async()=>{e&&(await navigator.clipboard.writeText(e),o(!0),setTimeout(()=>o(!1),2e3))};return a.jsx(vs,{children:a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsxs("div",{role:"button",tabIndex:0,onClick:l,onKeyDown:c=>c.key==="Enter"&&l(),className:ne("flex cursor-pointer items-center justify-between gap-2 select-none","text-muted-foreground border-input rounded-md border px-3 py-1.5 text-sm","hover:bg-accent hover:text-accent-foreground transition-colors"),children:[a.jsx("span",{className:n?"w-[95%]":"truncate",children:t||e||"No data"}),r?a.jsx(lr,{className:"h-4 w-4 text-green-500"}):a.jsx(hf,{className:"h-4 w-4"})]})}),a.jsx(Ct,{children:a.jsx("p",{children:r?"Copied!":"Click to copy"})})]})})}const Koe=m.forwardRef(({initialReport:e,mode:t=ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:o,onCancel:l,preSelectedDestination:c},d)=>{const f="google-sheets-edit-form",h="google-sheets-title-input",g="google-sheets-document-url-input",y="google-sheets-data-destination-select",{dataMart:v}=Ia(),{scope:b}=Ko(),{dataDestinations:E,fetchDataDestinations:S,loading:C}=Xf(),[R,j]=m.useState([]);m.useEffect(()=>{v&&S()},[v,S]),m.useEffect(()=>{if(E.length>0){const K=E.filter(Y=>Y.type===je.GOOGLE_SHEETS);j(K)}},[E]),Boe({elementId:h,isOpen:!0,delay:150});const{isDirty:_,reset:D,form:A,isSubmitting:O,formError:T,onSubmit:M}=qoe({initialReport:e,mode:t,dataMartId:(v==null?void 0:v.id)??"",onSuccess:()=>{o==null||o()},preSelectedDestination:c});m.useEffect(()=>{r&&r(T)},[T,r]),m.useEffect(()=>{if(t===ln.EDIT&&e&&Lg(e.destinationConfig))D({title:e.title,documentUrl:Mb(e.destinationConfig.spreadsheetId,e.destinationConfig.sheetId),dataDestinationId:e.dataDestination.id});else if(t===ln.CREATE){const K=(c==null?void 0:c.id)??"";D({title:"",documentUrl:"",dataDestinationId:K})}},[e,t,D,c]),m.useEffect(()=>{n==null||n(_)},[_,n]);const V=A.watch("documentUrl"),Z=V&&r3(V.trim());return a.jsx(rl,{...A,children:a.jsxs(Xo,{id:f,ref:d,noValidate:!0,onSubmit:K=>void A.handleSubmit(M)(K),children:[a.jsxs(al,{children:[a.jsxs(ua,{title:"General",children:[a.jsx(kt,{control:A.control,name:"title",render:({field:K})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(Nt,{children:a.jsx(Ht,{id:h,placeholder:"Enter a report title",...K})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:A.control,name:"dataDestinationId",render:({field:K})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(Kr,{onValueChange:K.onChange,value:K.value,disabled:C||R.length===0,children:[a.jsx(Nt,{children:a.jsx(Wr,{id:y,className:"w-full max-w-full overflow-hidden",children:a.jsx(Yr,{className:"truncate",placeholder:"Select a destination",children:K.value&&R.length>0&&(()=>{const Y=R.find(G=>G.id===K.value);if(Y){const U=Hr.getInfo(Y.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(U,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:Y.title})})]})}return null})()})})}),a.jsx(Qr,{children:R.map(Y=>{const U=Hr.getInfo(Y.type).icon;return a.jsx(Rn,{value:Y.id,children:a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(U,{className:"flex-shrink-0",size:18}),a.jsxs("div",{className:"flex min-w-0 flex-col",children:[a.jsx("span",{className:"truncate",children:Y.title}),a.jsx("span",{className:"text-muted-foreground truncate text-xs",children:(g0(Y.credentials)&&$x(Y.credentials.serviceAccount))??"No email found"})]})]})},Y.id)})})]}),R.length===0&&!C&&a.jsxs(MS,{className:"mt-2",children:[a.jsx(Df,{className:"h-4 w-4"}),a.jsx(r5,{children:"No destinations available"}),a.jsxs(IS,{children:["You need to create a Destination before you can create a report."," ",a.jsx(ha,{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(G=>G.id===K.value);return Y?a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(Rt,{children:"Service Account Email"}),a.jsx(v6,{value:g0(Y.credentials)?$x(Y.credentials.serviceAccount)??"No email found":"",children:g0(Y.credentials)?$x(Y.credentials.serviceAccount):"No email found"})]}):null})(),a.jsx(Ft,{})]})}),a.jsx(kt,{control:A.control,name:"documentUrl",render:({field:K})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"The link must include the Sheet ID to insert data into the correct tab",children:"Document Link with Sheet ID (GID)"}),a.jsx(Nt,{children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ht,{id:g,placeholder:"Document URL",className:"flex-1",...K}),a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.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(V.trim(),"_blank","noopener,noreferrer")},disabled:!Z,"aria-label":Z?"Open document in new tab":"Document link is not valid",children:a.jsx(Uo,{className:"h-4 w-4","aria-hidden":"true"})})}),a.jsx(Ct,{side:"top",align:"center",role:"tooltip",children:Z?"Open document in new tab":"Enter a valid URL to enable link"})]})]})}),a.jsx(wn,{children:a.jsx(Zoe,{})}),a.jsx(Ft,{})]})})]}),a.jsx(ua,{title:"Automate Report Runs",children:a.jsx(PS,{})})]}),a.jsxs(sl,{children:[a.jsx(xe,{variant:"default",type:"submit",className:"w-full","aria-label":t===ln.CREATE?"Create new report":"Save changes to report",disabled:!_||O,children:O?t===ln.CREATE?"Creating...":"Saving...":t===ln.CREATE?"Create new report":"Save changes to report"}),l&&a.jsx(xe,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function Yoe({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:o}){const[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(b=>{f(b)},[]),v=m.useCallback(()=>{f(!1),t()},[t]);return a.jsxs(a.Fragment,{children:[a.jsx($o,{open:e,onOpenChange:b=>{b||h()},children:a.jsxs(Bo,{children:[a.jsxs(Go,{children:[a.jsx(qo,{children:r===ln.CREATE?"Create new report":"Edit report"}),a.jsx(Xi,{children:r===ln.CREATE?"Fill in the details to create a new Google Sheets report":"Update details of an existing Google Sheets report"})]}),a.jsx(Qf,{children:a.jsx(Koe,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:o})})]})}),a.jsx(Tr,{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 Woe=Jt({cacheLifetime:qG().min(300,"Cache time must be at least 5 minutes (300 seconds)")});function Qoe({initialReport:e,dataMartId:t,onSuccess:n,preSelectedDestination:r}){const[o,l]=m.useState(null),{createReport:c,updateReport:d}=Ts(),f=Qo({resolver:ll(Woe),defaultValues:{cacheLifetime:e!=null&&e.destinationConfig&&m3(e.destinationConfig)?e.destinationConfig.cacheLifetime:300},mode:"onTouched"});return{form:f,onSubmit:async g=>{try{l(null);const{cacheLifetime:y}=g,v={type:yr.LOOKER_STUDIO_CONFIG,cacheLifetime:y};e?await d(e.id,{title:"Looker Studio Report",dataDestinationId:e.dataDestination.id,destinationConfig:v}):await c({title:"Looker Studio Report",dataMartId:t,dataDestinationId:(r==null?void 0:r.id)??"",destinationConfig:v}),n==null||n()}catch(y){console.error("Error submitting form:",y),l("Failed to save report. Please try again.")}},formError:o,isSubmitting:f.formState.isSubmitting,isDirty:f.formState.isDirty,reset:f.reset}}function Xoe(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"cache-lifetime-details",children:[a.jsx(un,{children:"What is the Cache Lifetime for Looker Studio?"}),a.jsx(dn,{children:a.jsx("p",{className:"mb-2",children:"Cache Lifetime - defines the period during which results from previous query executions are served from storage-side cache, eliminating the need to re-execute the query"})})]})})}const Joe=[{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"}],eie=m.forwardRef(({initialReport:e,mode:t=ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:o,onCancel:l,preSelectedDestination:c},d)=>{const f="looker-studio-edit-form",{dataMart:h}=Ia(),{isDirty:g,reset:y,form:v,isSubmitting:b,formError:E,onSubmit:S}=Qoe({initialReport:e,dataMartId:(h==null?void 0:h.id)??"",onSuccess:()=>{o==null||o()},preSelectedDestination:c});return m.useEffect(()=>{r&&r(E)},[E,r]),m.useEffect(()=>{t===ln.EDIT&&e&&m3(e.destinationConfig)?y({cacheLifetime:e.destinationConfig.cacheLifetime}):t===ln.CREATE&&y({cacheLifetime:300})},[e,t,y]),m.useEffect(()=>{n==null||n(g)},[g,n]),a.jsx(rl,{...v,children:a.jsxs(Xo,{id:f,ref:d,noValidate:!0,onSubmit:C=>void v.handleSubmit(S)(C),children:[a.jsx(al,{children:a.jsx(ua,{title:"Cache Configuration",children:a.jsx(kt,{control:v.control,name:"cacheLifetime",render:({field:C})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Period during which query results are served from storage-side cache, avoiding re-execution",children:"Cache Lifetime"}),a.jsxs(Kr,{onValueChange:R=>{C.onChange(parseInt(R,10))},value:C.value.toString(),defaultValue:"300",children:[a.jsx(Nt,{children:a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{placeholder:"Select cache time"})})}),a.jsx(Qr,{children:Joe.map(R=>a.jsx(Rn,{value:R.value.toString(),children:R.label},R.value))})]}),a.jsx(Ft,{}),a.jsx(wn,{children:a.jsx(Xoe,{})})]})})})}),a.jsxs(sl,{children:[a.jsx(xe,{variant:"default",type:"submit",className:"w-full","aria-label":t===ln.CREATE?"Create":"Save changes",disabled:!g||b,children:b?t===ln.CREATE?"Creating...":"Saving...":t===ln.CREATE?"Create":"Save changes"}),l&&a.jsx(xe,{variant:"outline",type:"button",onClick:l,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})});function tie({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:o}){const[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(b=>{f(b)},[]),v=m.useCallback(()=>{f(!1),t()},[t]);return a.jsxs(a.Fragment,{children:[a.jsx($o,{open:e,onOpenChange:b=>{b||h()},children:a.jsxs(Bo,{children:[a.jsxs(Go,{children:[a.jsx(qo,{children:(o==null?void 0:o.title)??"Looker Studio"}),a.jsx(Xi,{children:r===ln.CREATE?"Set up Data Mart as a data source":"Update connection details"})]}),a.jsx(Qf,{children:a.jsx(eie,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:o})})]})}),a.jsx(Tr,{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 VT=({destination:e})=>{const n=Hr.getInfo(e.type).icon;return a.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[a.jsx(n,{className:"flex-shrink-0",size:18}),a.jsx("div",{className:"flex min-w-0 flex-col",children:a.jsx("span",{className:"truncate",children:e.title})})]})};function nie(e){return"to"in e}const rie=({destination:e})=>{if(!e)return null;const t=e.credentials,n=nie(t)&&t.to.length?t.to.join(", "):"";return a.jsxs("div",{className:"mt-2 flex flex-col gap-1",children:[a.jsx(Rt,{children:"Recipients of this report"}),a.jsx(v6,{doNotTruncateContent:!0,value:n,children:n||"No recipients found"})]})};var kl=(e=>(e.ALWAYS="ALWAYS",e.RESULT_IS_EMPTY="RESULT_IS_EMPTY",e.RESULT_IS_NOT_EMPTY="RESULT_IS_NOT_EMPTY",e))(kl||{});const aie=Jt({title:$t().min(1,"Title is required"),dataDestinationId:$t().min(1,"Destination is required"),reportCondition:Ng(kl),subject:$t().min(1,"Subject is required"),messageTemplate:$t().min(1,"Message body is required")});function sie({initialReport:e,mode:t,dataMartId:n,onSuccess:r,preSelectedDestination:o}){const[l,c]=m.useState(null),[d,f]=m.useState(!1),{updateReport:h,createReport:g,error:y,clearError:v}=Ts();m.useEffect(()=>{d&&y&&(c(y),f(!1))},[y,d]);const b=Qo({resolver:ll(aie),defaultValues:{title:(e==null?void 0:e.title)??"",dataDestinationId:(e==null?void 0:e.dataDestination.id)??(o==null?void 0:o.id)??"",reportCondition:e!=null&&e.destinationConfig&&Gx(e.destinationConfig)?e.destinationConfig.reportCondition:kl.ALWAYS,subject:e!=null&&e.destinationConfig&&Gx(e.destinationConfig)?e.destinationConfig.subject:"",messageTemplate:e!=null&&e.destinationConfig&&Gx(e.destinationConfig)?e.destinationConfig.messageTemplate:""},mode:"onTouched"}),{handleSubmit:E,formState:S,reset:C}=b,{isDirty:R,errors:j}=S,_=m.useCallback(async D=>{try{c(null),v(),f(!0);let A;const O={type:yr.EMAIL_CONFIG,reportCondition:D.reportCondition,subject:D.subject,messageTemplate:D.messageTemplate};if(t===ln.CREATE)A=await g({title:D.title,dataMartId:n,dataDestinationId:D.dataDestinationId,destinationConfig:O});else{if(!e){c("Initial report is required for edit mode");return}A=await h(e.id,{title:D.title,dataDestinationId:D.dataDestinationId,destinationConfig:O})}if(!A||y){c(y??"An error occurred while submitting the form");return}r==null||r()}catch(A){console.error("Error submitting form:",A),c("An error occurred while submitting the form")}},[t,e,n,g,h,r,v,y]);return{form:b,handleSubmit:E,errors:j,isDirty:R,reset:C,formError:l,isSubmitting:d,setFormError:c,onSubmit:_}}function oie({value:e,onChange:t,onBlur:n,height:r=240,theme:o="light",options:l,className:c,placeholder:d="Start writing your message…"}){const f=h=>{n&&h.onDidBlurEditorText(n)};return a.jsx(AO,{language:"markdown",height:r,value:e,onChange:h=>{t(h??"")},onMount:f,theme:o,options:{wordWrap:"on",minimap:{enabled:!1},lineNumbers:"off",folding:!1,scrollBeyondLastLine:!1,automaticLayout:!0,placeholder:d,...l},className:c})}function iie({html:e,loading:t=!1,error:n=null,height:r=240,className:o,emptyState:l=a.jsx("div",{className:"text-muted-foreground text-sm",children:"Nothing to preview"})}){let c="#fff",d="#000";if(typeof window<"u"){const f=getComputedStyle(document.documentElement),h=f.getPropertyValue("--background").trim(),g=f.getPropertyValue("--foreground").trim();h&&(c=h),g&&(d=g)}return a.jsxs("div",{className:`bg-background overflow-auto p-4 ${o??""}`,style:{height:r},children:[t&&a.jsx("div",{className:"text-muted-foreground text-sm",children:"Generating preview…"}),!t&&n&&a.jsxs("div",{className:"text-destructive text-sm",children:["Error: ",n]}),!t&&!n&&!e&&l,!t&&!n&&!!e&&a.jsx("iframe",{title:"Markdown preview",sandbox:"allow-popups allow-popups-to-escape-sandbox",srcDoc:`<!doctype html><html style="background:${c};color:${d}"><head><meta charset='utf-8'/><base target='_blank'></head><body>${e}</body></html>`,className:"h-full w-full border-0"})]})}function lie({value:e,onChange:t}){return a.jsx(eO,{value:e,onValueChange:n=>{t(n)},children:a.jsxs(tO,{children:[a.jsx(h1,{value:"markdown",children:"Markdown"}),a.jsx(h1,{value:"preview",children:"Preview"})]})})}function cie({markdown:e,enabled:t=!0,debounceMs:n=300,toHtml:r}){const[o,l]=m.useState(""),[c,d]=m.useState(!1),[f,h]=m.useState(null),g=m.useRef(null);return m.useEffect(()=>{var E;if(!t)return;const y=e;if(!y.trim()){l(""),h(null),d(!1);return}const v=new AbortController;(E=g.current)==null||E.abort(),g.current=v,d(!0),h(null);const b=setTimeout(()=>{r(y,v.signal).then(S=>{l(S)}).catch(S=>{if(v.signal.aborted)return;const C=S instanceof Error?S.message:"Failed to load preview";h(C)}).finally(()=>{v.signal.aborted||d(!1)})},n);return()=>{clearTimeout(b),v.abort()}},[e,t,n,r]),{html:o,loading:c,error:f}}function uie(e,t){return ca.post("/markdown/parse-to-html",{markdown:e},{headers:{"Content-Type":"application/json"},responseType:"text",signal:t}).then(n=>n.data)}function die(e){const t=m.useCallback(uie,[]);return cie({...e,toHtml:t})}function fie(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"message-details",children:[a.jsx(un,{children:"How can I format my message?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"You can format your message using Markdown — a simple text formatting syntax that lets you add structure and style without using complex editors."}),a.jsxs("p",{className:"mb-2",children:["For example:",a.jsx("br",{}),"**bold text** → ",a.jsx("b",{children:"bold text"}),a.jsx("br",{}),"__italic text__ → ",a.jsx("i",{children:"italic text"}),a.jsx("br",{}),"- list item → • list item"]}),a.jsxs("p",{children:["Use the Preview tab to see how your message will look after formatting.",a.jsx("br",{}),"If you’re new to Markdown, learn more from this"," ",a.jsx(vn,{className:"underline",href:"https://www.markdownguide.org/basic-syntax/",children:"quick guide"})]})]})]})})}function hie(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"sending-condition-details",children:[a.jsx(un,{children:"What are Data Mart Run results?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"A Data Mart Run result is the outcome of processing your Data Mart — for example, running an SQL query that retrieves data for your report."}),a.jsx("p",{children:"Before sending a report, OWOX automatically runs the Data Mart and checks its result. Depending on your settings, the report can be sent always, only if the result is not empty, or only if it’s empty."})]})]})})}const mie=[je.EMAIL,je.SLACK,je.GOOGLE_CHAT,je.MS_TEAMS],x6=m.forwardRef(({initialReport:e,mode:t=ln.EDIT,onDirtyChange:n,onFormErrorChange:r,onSubmit:o,onCancel:l,preSelectedDestination:c},d)=>{const f="email-report-edit-form",{dataMart:h}=Ia(),{dataDestinations:g,fetchDataDestinations:y,loading:v}=Xf(),[b,E]=m.useState([]);m.useEffect(()=>{h&&y()},[h,y]),m.useEffect(()=>{if(g.length>0){const k=c!=null&&c.type?[c.type]:mie,$=g.filter(q=>k.includes(q.type));E($)}},[g,c==null?void 0:c.type]);const{isDirty:S,reset:C,form:R,isSubmitting:j,formError:_,onSubmit:D}=sie({initialReport:e,mode:t,dataMartId:(h==null?void 0:h.id)??"",onSuccess:()=>{o==null||o()},preSelectedDestination:c});m.useEffect(()=>{r&&r(_)},[_,r]),m.useEffect(()=>{if(!(t===ln.EDIT&&e)){if(t===ln.CREATE){const k=(c==null?void 0:c.id)??"";C({title:"",dataDestinationId:k,reportCondition:kl.ALWAYS,subject:"",messageTemplate:""})}}},[e,t,C,c]),m.useEffect(()=>{n==null||n(S)},[S,n]);const A=m.useMemo(()=>[{value:kl.ALWAYS,label:"Send always"},{value:kl.RESULT_IS_EMPTY,label:"Send only when result is empty"},{value:kl.RESULT_IS_NOT_EMPTY,label:"Send only when result is not empty"}],[]),{resolvedTheme:O}=Ob(),T=O==="dark"?"vs-dark":"light",[M,V]=m.useState("markdown"),Z=R.watch("messageTemplate"),{html:K,loading:Y,error:G}=die({markdown:Z,enabled:M==="preview"}),U=R.watch("dataDestinationId"),H=m.useMemo(()=>U&&b.length>0?b.find(k=>k.id===U)??null:null,[U,b]);return a.jsx(rl,{...R,children:a.jsxs(Xo,{id:f,ref:d,noValidate:!0,onSubmit:k=>{R.handleSubmit(D)(k)},children:[a.jsxs(al,{children:[a.jsxs(ua,{title:"General",children:[a.jsx(kt,{control:R.control,name:"title",render:({field:k})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Add a title that reflects the report`s purpose",children:"Title"}),a.jsx(Nt,{children:a.jsx(Ht,{placeholder:"Enter a report title",...k})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:R.control,name:"dataDestinationId",render:({field:k})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Select one of your existing destinations",children:"Destination"}),a.jsxs(Kr,{onValueChange:k.onChange,value:k.value,disabled:v||b.length===0,children:[a.jsx(Nt,{children:a.jsx(Wr,{className:"w-full max-w-full overflow-hidden",children:a.jsx(Yr,{className:"truncate",placeholder:"Select a destination",children:H&&a.jsx(VT,{destination:H})})})}),a.jsx(Qr,{children:b.map($=>a.jsx(Rn,{value:$.id,children:a.jsx(VT,{destination:$})},$.id))})]}),a.jsx(rie,{destination:H}),a.jsx(Ft,{})]})})]}),a.jsxs(ua,{title:"Template",children:[a.jsx(kt,{control:R.control,name:"subject",render:({field:k})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Add a short, clear subject line for your report",children:"Subject"}),a.jsx(Nt,{children:a.jsx(Ht,{placeholder:"Enter a message title",...k})}),a.jsx(Ft,{})]})}),a.jsx(kt,{control:R.control,name:"messageTemplate",render:({field:k})=>a.jsxs(_t,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(Rt,{tooltip:"Write your report message in Markdown and check the final format in Preview",children:"Message"}),a.jsx(lie,{value:M,onChange:V})]}),a.jsx(Nt,{children:a.jsx("div",{className:"overflow-hidden rounded-md border",children:M==="markdown"?a.jsx(oie,{value:k.value,onChange:$=>{k.onChange($)},onBlur:k.onBlur,height:240,theme:T}):a.jsx(iie,{html:K,loading:Y,error:G,height:240})})}),a.jsx(wn,{children:a.jsx(fie,{})}),a.jsx(Ft,{})]})})]}),a.jsx(ua,{title:"Sending conditions",children:a.jsx(kt,{control:R.control,name:"reportCondition",render:({field:k})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Define when the report should be sent based on your Data Mart’s execution result",children:"Data Mart Run results"}),a.jsxs(Kr,{onValueChange:k.onChange,value:k.value,children:[a.jsx(Nt,{children:a.jsx(Wr,{className:"w-full max-w-full overflow-hidden",children:a.jsx(Yr,{})})}),a.jsx(Qr,{children:A.map($=>a.jsx(Rn,{value:$.value,children:$.label},$.value))})]}),a.jsx(wn,{children:a.jsx(hie,{})}),a.jsx(Ft,{})]})})}),a.jsx(ua,{title:"Automate Report Runs",children:a.jsx(PS,{})})]}),a.jsxs(sl,{children:[a.jsx(xe,{variant:"default",type:"submit",disabled:j,children:t===ln.CREATE?"Create new report":"Save changes to report"}),a.jsx(xe,{variant:"outline",type:"button",onClick:l,disabled:j,children:"Cancel"})]})]})})});x6.displayName="EmailReportEditForm";function pie({isOpen:e,onClose:t,initialReport:n,mode:r,preSelectedDestination:o}){const[l,c]=m.useState(!1),[d,f]=m.useState(!1),h=m.useCallback(()=>{d?c(!0):t()},[d,t]),g=m.useCallback(()=>{c(!1),f(!1),t()},[t]),y=m.useCallback(b=>{f(b)},[]),v=m.useCallback(()=>{f(!1),t()},[t]);return a.jsxs(a.Fragment,{children:[a.jsx($o,{open:e,onOpenChange:b=>{b||h()},children:a.jsxs(Bo,{children:[a.jsxs(Go,{children:[a.jsx(qo,{children:(o==null?void 0:o.title)??"Report"}),a.jsx(Xi,{children:r===ln.CREATE?"Fill in the details to create a new report":"Update details of an existing report"})]}),a.jsx(Qf,{children:a.jsx(x6,{initialReport:n,mode:r,onDirtyChange:y,onSubmit:v,onCancel:h,preSelectedDestination:o})})]})}),a.jsx(Tr,{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 gie({destination:e,isOpen:t,onClose:n,mode:r,initialReport:o}){switch(e.type){case je.GOOGLE_SHEETS:return a.jsx(Yoe,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:o??void 0});case je.LOOKER_STUDIO:return a.jsx(tie,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:o??void 0});case je.EMAIL:case je.SLACK:case je.GOOGLE_CHAT:case je.MS_TEAMS:return a.jsx(pie,{isOpen:t,onClose:n,mode:r,preSelectedDestination:e,initialReport:o??void 0});default:return null}}function yie({destination:e,onEditReport:t}){switch(e.type){case je.GOOGLE_SHEETS:return a.jsx(joe,{destination:e,onEditReport:t});case je.EMAIL:case je.SLACK:case je.GOOGLE_CHAT:case je.MS_TEAMS:return a.jsx(Aoe,{destinationType:e.type,destination:e,onEditReport:t});case je.LOOKER_STUDIO:return a.jsx(Uoe,{destination:e,onEditReport:t});default:return null}}function b6(){return a.jsx("div",{className:"flex flex-col gap-4",children:a.jsx("div",{className:"space-y-2 pb-4",children:Array.from({length:3}).map((e,t)=>a.jsx("div",{className:"border-border rounded-lg border p-4",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(hs,{className:"h-4 w-4 rounded-full"}),a.jsx(hs,{className:"h-4 w-40"}),a.jsx(hs,{className:"h-3 w-32"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(hs,{className:"h-6 w-16 rounded-full"}),a.jsx(hs,{className:"h-4 w-4"})]})]})},t))})})}function S6({enabled:e,intervalMs:t=5e3,onlyWhenVisible:n=!0,onTick:r}){const o=m.useRef(r);o.current=r;const l=m.useRef(null);m.useEffect(()=>{var f;if(!e)return;(f=l.current)==null||f.abort(),l.current=new AbortController;const c=()=>{if(!n||document.visibilityState==="visible"){const h=new AbortController;o.current(h.signal)}};c();const d=window.setInterval(c,t);return()=>{var h;window.clearInterval(d),(h=l.current)==null||h.abort()}},[e,t,n])}function vie({enabled:e=!0,intervalMs:t=5e3}={}){const{dataMart:n}=Ia(),{fetchReportsByDataMartId:r}=Ts(),o=n==null?void 0:n.id;m.useEffect(()=>{o&&r(o)},[o,r]),S6({enabled:!!o&&e,intervalMs:t,onTick:()=>{o&&r(o,{silent:!0})}})}function xie(){const{dataMart:e}=Ia(),{dataDestinations:t,isLoading:n}=VK();return vie({enabled:!0,intervalMs:5e3}),e?a.jsx("div",{className:"flex flex-col gap-4",children:n?a.jsx(b6,{}):t.length===0?a.jsx(Foe,{}):t.map(r=>a.jsx(Hoe,{destination:r,dataMartStatus:e.status},r.id))}):null}function bie(){return a.jsx(Qf,{children:a.jsx(s3,{children:a.jsx(xie,{})})})}function zT(){return a.jsxs(Vl,{children:[a.jsx(Lo,{children:a.jsx(ko,{icon:$7,tooltip:"Description of the Data Mart",children:"Description"})}),a.jsx(Po,{children:a.jsx(aee,{})}),a.jsx($i,{})]})}function Sie(){const{dataMart:e}=Wo(),[t,n]=m.useState(!1),r=m.useCallback(()=>{n(!0)},[]),o=m.useCallback(()=>{n(!1)},[]);return a.jsxs(Vl,{children:[a.jsxs(Lo,{children:[a.jsx(ko,{icon:M_,tooltip:"Time triggers allow you to schedule Data Mart runs at specific times",children:"Time triggers"}),a.jsx(sy,{children:a.jsxs(xe,{variant:"outline",onClick:r,"aria-label":"Add new trigger",children:[a.jsx(Pa,{className:"h-4 w-4","aria-hidden":"true"}),"Add Trigger"]})})]}),a.jsx(Po,{children:a.jsx(Tu,{children:a.jsx(Yne,{children:e&&a.jsxs(a.Fragment,{children:[a.jsx(Pre,{dataMartId:e.id}),a.jsx(LS,{isOpen:t,onClose:o,dataMartId:e.id})]})})})}),a.jsx($i,{})]})}function Cie(){const e=C5(),{navigate:t}=Ko(),n=r=>{const o=e?`/data-marts/${r.id}/data-setup?preset=${e.key}`:`/data-marts/${r.id}/data-setup`;t(o)};return a.jsx("div",{className:"flex h-full w-full items-center justify-center",children:a.jsx("div",{className:"m-auto w-lg",children:a.jsxs("div",{className:"bg-muted/50 dark:bg-sidebar rounded-xl border-b border-gray-200 p-12 pt-8 dark:border-gray-700/50",children:[a.jsx("h2",{className:"mb-4 text-xl font-medium",children:"Create Data Mart"}),a.jsx(hS,{children:a.jsx(G3,{children:a.jsx(iJ,{initialData:{title:(e==null?void 0:e.datamartTitle)??"New Data Mart"},onSuccess:n})})})]})})})}function C6({isOpen:e,onClose:t,id:n}){const{getDataStorageById:r,currentDataStorage:o,loading:l,clearCurrentDataStorage:c}=Bg();m.useEffect(()=>(e&&n&&r(n),()=>{e||c()}),[e,n,r,c]);const d=()=>{c(),t()};return a.jsx(Qb,{open:e,onOpenChange:f=>{f||d()},children:a.jsxs(Xb,{children:[a.jsxs(Jb,{children:[a.jsx(eS,{children:"Storage Details"}),a.jsx(tS,{children:"View detailed information about this storage."})]}),a.jsx("div",{className:"py-4",children:a.jsx(GZ,{dataStorage:o,isLoading:l})})]})})}function y0({column:e,children:t}){return a.jsxs(xe,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&a.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&a.jsx(ka,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}const Eie=({id:e,onViewDetails:t,onEdit:n,onDelete:r})=>{const[o,l]=m.useState(!1);return a.jsx("div",{className:"text-right",children:a.jsxs(ur,{open:o,onOpenChange:l,children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${o?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(fr,{align:"end",children:[a.jsxs(pt,{onClick:()=>t==null?void 0:t(e),children:[a.jsx(T_,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"View details"})]}),a.jsxs(pt,{onClick:()=>void(n==null?void 0:n(e)),children:[a.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),a.jsx(ma,{}),a.jsxs(pt,{onClick:()=>r==null?void 0:r(e),children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})};function wie({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(pt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.id})]})},t.id))})]})})}const Rie=({onViewDetails:e,onEdit:t,onDelete:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(y0,{column:r,children:"Title"}),cell:({row:r})=>{const o=r.getValue("title");return a.jsx("div",{children:o})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(y0,{column:r,children:"Type"}),cell:({row:r})=>{const o=r.getValue("type"),{displayName:l,icon:c}=nl.getInfo(o);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(y0,{column:r,children:"Created at"}),cell:({row:r})=>{const o=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(o);return a.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>a.jsx(wie,{table:r}),cell:({row:r})=>a.jsx(Eie,{id:r.original.id,onViewDetails:e,onEdit:t,onDelete:n})}];function jie({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(mk,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Storage"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"A Storage combines your data warehouse and access credentials — both required to start building Data Marts."}),a.jsxs(xe,{variant:"outline",onClick:e,children:[a.jsx(Pa,{className:"h-4 w-4"}),"New Storage"]})]})}function Tie({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var R;const{sorting:o,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Vu({columns:e,storageKeyPrefix:"data-storage-list"}),[f,h]=m.useState([]),[g,y]=m.useState({}),[v,b]=m.useState(!1),[E]=m.useState(null),S=oc({data:t,columns:[...e],getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:l,getSortedRowModel:Fu(),onColumnFiltersChange:h,getFilteredRowModel:Jf(),onColumnVisibilityChange:d,onRowSelectionChange:y,state:{sorting:o,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),C=(j,_)=>{_.target instanceof HTMLElement&&(_.target.closest('[role="checkbox"]')||_.target.closest(".actions-cell")||_.target.closest('[role="menuitem"]'))||n==null||n(j)};return t.length?a.jsxs("div",{children:[E&&a.jsx(C6,{isOpen:v,onClose:()=>{b(!1)},id:E.id}),a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Jl,{className:"dm-card-toolbar-search-icon"}),a.jsx(Ht,{placeholder:"Search by title",value:(R=S.getColumn("title"))==null?void 0:R.getFilterValue(),onChange:j=>{var _;return(_=S.getColumn("title"))==null?void 0:_.setFilterValue(j.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(xe,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(Pa,{className:"h-4 w-4"}),"New Storage"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(ic,{className:"dm-card-table",role:"table","aria-label":"Storages table",children:[a.jsx(lc,{className:"dm-card-table-header",children:S.getHeaderGroups().map(j=>a.jsx(Pn,{className:"dm-card-table-header-row",children:j.headers.map(_=>a.jsx(uc,{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:ju(_.column.columnDef.header,_.getContext())},_.id))},j.id))}),a.jsx(cc,{className:"dm-card-table-body",children:S.getRowModel().rows.length?S.getRowModel().rows.map(j=>a.jsx(Pn,{"data-state":j.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:_=>{const D=j.original.id;C(D,_)},children:j.getVisibleCells().map(_=>a.jsx(Zr,{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:ju(_.column.columnDef.cell,_.getContext())},_.id))},j.id)):a.jsx(Pn,{children:a.jsx(Zr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(xe,{variant:"outline",size:"sm",onClick:()=>{S.previousPage()},disabled:!S.getCanPreviousPage(),children:"Previous"}),a.jsx(xe,{variant:"outline",size:"sm",onClick:()=>{S.nextPage()},disabled:!S.getCanNextPage(),children:"Next"})]})]})]}):a.jsx("div",{className:"dm-card",children:a.jsx(jie,{onOpenTypeDialog:r})})}const _ie=({initialTypeDialogOpen:e=!1,onTypeDialogClose:t})=>{const[n,r]=m.useState(e),{dataStorages:o,currentDataStorage:l,clearCurrentDataStorage:c,fetchDataStorages:d,getDataStorageById:f,deleteDataStorage:h,createDataStorage:g}=Bg();m.useEffect(()=>{d()},[d]),m.useEffect(()=>{r(e)},[e]);const y=()=>{r(!1),t==null||t()},[v,b]=m.useState(!1),[E,S]=m.useState(!1),[C,R]=m.useState(null),[j,_]=m.useState(!1),[D,A]=m.useState(null),O=async k=>{try{const $=await g(k);y(),$!=null&&$.id&&(await f($.id),b(!0))}catch($){console.error("Failed to create storage:",$)}},T=k=>{A(k),_(!0)},M=()=>{_(!1),A(null)},V=async k=>{await f(k),b(!0)},Z=k=>{R(k),S(!0)},K=async()=>{if(C)try{await h(C),await d()}catch(k){console.error("Failed to delete storage:",k)}finally{S(!1),R(null)}},Y=async()=>{try{b(!1),await d()}catch(k){console.error("Failed to save storage:",k)}},G=()=>{b(!1),c()},U=o.map(k=>({id:k.id,title:k.title,type:k.type,createdAt:k.createdAt,modifiedAt:k.modifiedAt})),H=Rie({onViewDetails:T,onEdit:V,onDelete:Z});return a.jsxs("div",{children:[a.jsx(Tie,{columns:H,data:U,onEdit:V,onOpenTypeDialog:()=>{r(!0)}}),a.jsx(C6,{isOpen:j,onClose:M,id:D??""}),a.jsx(HD,{isOpen:n,onClose:y,onSelect:O}),a.jsx(n5,{isOpen:v,onClose:G,dataStorage:l,onSaveSuccess:()=>void Y()}),a.jsx(Tr,{open:E,onOpenChange:S,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"})]})},Nie=()=>{const[e,t]=m.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Storages"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(hS,{children:a.jsx(_ie,{initialTypeDialogOpen:e,onTypeDialogClose:()=>{t(!1)}})})})]})};function Aie({onOpenTypeDialog:e}){return a.jsxs("div",{className:"dm-empty-state",children:[a.jsx(H1,{className:"dm-empty-state-ico",strokeWidth:1}),a.jsx("h2",{className:"dm-empty-state-title",children:"Create your first Destination"}),a.jsx("p",{className:"dm-empty-state-subtitle",children:"A Destination combines your reporting tool and access credentials — both needed to deliver data from Data Marts to your reports and dashboards."}),a.jsxs(xe,{variant:"outline",onClick:e,children:[a.jsx(Pa,{className:"h-4 w-4"}),"New Destination"]})]})}function Die({columns:e,data:t,onEdit:n,onOpenTypeDialog:r}){var E;const{sorting:o,setSorting:l,columnVisibility:c,setColumnVisibility:d}=Vu({columns:e,storageKeyPrefix:"data-destination-list"}),[f,h]=m.useState([]),[g,y]=m.useState({}),v=oc({data:t,columns:[...e],getCoreRowModel:sc(),getPaginationRowModel:Ug(),onSortingChange:l,getSortedRowModel:Fu(),onColumnFiltersChange:h,getFilteredRowModel:Jf(),onColumnVisibilityChange:d,onRowSelectionChange:y,state:{sorting:o,columnFilters:f,columnVisibility:c,rowSelection:g},enableRowSelection:!0}),b=(S,C)=>{C.target instanceof HTMLElement&&(C.target.closest('[role="checkbox"]')||C.target.closest(".actions-cell")||C.target.closest('[role="menuitem"]'))||n==null||n(S)};return t.length?a.jsx("div",{children:a.jsxs("div",{className:"dm-card",children:[a.jsxs("div",{className:"dm-card-toolbar",children:[a.jsx("div",{className:"dm-card-toolbar-left",children:a.jsxs("div",{className:"dm-card-toolbar-search",children:[a.jsx(Jl,{className:"dm-card-toolbar-search-icon"}),a.jsx(Ht,{placeholder:"Search by title",value:(E=v.getColumn("title"))==null?void 0:E.getFilterValue(),onChange:S=>{var C;return(C=v.getColumn("title"))==null?void 0:C.setFilterValue(S.target.value)},className:"dm-card-toolbar-search-input"})]})}),a.jsx("div",{className:"dm-card-toolbar-right",children:a.jsxs(xe,{variant:"outline",className:"dm-card-toolbar-btn-primary",onClick:()=>{r==null||r()},children:[a.jsx(Pa,{className:"h-4 w-4"}),"New Destination"]})})]}),a.jsx("div",{className:"dm-card-table-wrap",children:a.jsxs(ic,{className:"dm-card-table",role:"table","aria-label":"Destinations table",children:[a.jsx(lc,{className:"dm-card-table-header",children:v.getHeaderGroups().map(S=>a.jsx(Pn,{className:"dm-card-table-header-row",children:S.headers.map(C=>a.jsx(uc,{className:"[&:has([role=checkbox])]:pl-6 [&>[role=checkbox]]:translate-y-[2px]",style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.getSize())}%`},children:C.isPlaceholder?null:ju(C.column.columnDef.header,C.getContext())},C.id))},S.id))}),a.jsx(cc,{className:"dm-card-table-body",children:v.getRowModel().rows.length?v.getRowModel().rows.map(S=>a.jsx(Pn,{"data-state":S.getIsSelected()&&"selected",className:"dm-card-table-body-row group",onClick:C=>{const R=S.original.id;b(R,C)},children:S.getVisibleCells().map(C=>a.jsx(Zr,{className:`[&:has([role=checkbox])]pr-0 px-6 whitespace-normal [&>[role=checkbox]]:translate-y-[2px] ${C.column.id==="actions"?"actions-cell":""} ${C.column.id==="createdAt"?"whitespace-nowrap":""}`,style:C.column.id==="actions"?{width:80,minWidth:80,maxWidth:80}:{width:`${String(C.column.getSize())}%`},children:ju(C.column.columnDef.cell,C.getContext())},C.id))},S.id)):a.jsx(Pn,{children:a.jsx(Zr,{colSpan:e.length+1,className:"dm-card-table-body-row-empty",children:"No results"})})})]})}),a.jsxs("div",{className:"dm-card-pagination",children:[a.jsx(xe,{variant:"outline",size:"sm",onClick:()=>{v.previousPage()},disabled:!v.getCanPreviousPage(),children:"Previous"}),a.jsx(xe,{variant:"outline",size:"sm",onClick:()=>{v.nextPage()},disabled:!v.getCanNextPage(),children:"Next"})]})]})}):a.jsx("div",{className:"dm-card",children:a.jsx(Aie,{onOpenTypeDialog:r})})}function v0({column:e,children:t}){return a.jsxs(xe,{variant:"ghost",onClick:()=>{e.toggleSorting(e.getIsSorted()==="asc")},className:"group dm-card-table-header-row-btn",children:[t,a.jsxs("span",{className:"flex h-4 w-4 items-center justify-center","aria-hidden":"true",children:[e.getIsSorted()==="asc"&&a.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),e.getIsSorted()==="desc"&&a.jsx(ka,{"data-testid":"lucide-arrow-up-down",className:"text-foreground h-4 w-4"}),!e.getIsSorted()&&a.jsx("span",{className:"opacity-0 transition-opacity duration-150 group-hover:opacity-100",children:a.jsx(ns,{"data-testid":"lucide-arrow-up-down",className:"text-muted-foreground h-4 w-4"})})]})]})}function KS(e){return"destinationSecretKey"in e}const Oie=({id:e,type:t,credentials:n,onEdit:r,onDelete:o,onRotateSecretKey:l})=>{const[c,d]=m.useState(!1),f=()=>{if(n&&KS(n)){const y=kb(n);navigator.clipboard.writeText(y),It.success("JSON Config copied to clipboard")}},h=t===je.LOOKER_STUDIO,g=n&&"destinationSecretKey"in n&&n.destinationSecretKey;return a.jsx(a.Fragment,{children:a.jsx("div",{className:"text-right",children:a.jsxs(ur,{open:c,onOpenChange:d,children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:`dm-card-table-body-row-actionbtn opacity-0 transition-opacity ${c?"opacity-100":"group-hover:opacity-100"}`,"aria-label":"Open menu",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsxs(fr,{align:"end",children:[a.jsxs(pt,{onClick:()=>void(r==null?void 0:r(e)),children:[a.jsx(Au,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Edit"})]}),h&&g&&a.jsxs(a.Fragment,{children:[a.jsx(ma,{}),a.jsxs(pt,{onClick:f,children:[a.jsx(hf,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Copy JSON Config"})]}),a.jsxs(pt,{onClick:()=>{l==null||l(e)},children:[a.jsx(j0,{className:"text-foreground h-4 w-4","aria-hidden":"true"}),a.jsx("span",{children:"Rotate Secret Key"})]})]}),a.jsx(ma,{}),a.jsxs(pt,{onClick:()=>o==null?void 0:o(e),children:[a.jsx(Xs,{className:"h-4 w-4 text-red-600","aria-hidden":"true"}),a.jsx("span",{className:"text-red-600",children:"Delete"})]})]})]})})})};function Mie({table:e}){return a.jsx("div",{className:"px-4 text-right",children:a.jsxs(ur,{children:[a.jsx(dr,{asChild:!0,children:a.jsx(xe,{variant:"ghost",className:"dm-card-table-body-row-actionbtn","aria-label":"Toggle columns",children:a.jsx(pa,{className:"dm-card-table-body-row-actionbtn-icon"})})}),a.jsx(fr,{align:"end",children:e.getAllColumns().filter(t=>t.getCanHide()&&t.id!=="actions").map(t=>a.jsx(pt,{className:"capitalize",children:a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("button",{type:"button",role:"checkbox","aria-checked":t.getIsVisible(),"data-state":t.getIsVisible()?"checked":"unchecked","aria-label":`Toggle column ${t.id}`,className:"peer border-input data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border bg-white shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 dark:bg-white/8",onClick:()=>{t.toggleVisibility(!t.getIsVisible())},children:t.getIsVisible()&&a.jsx("span",{"data-state":"checked","data-slot":"checkbox-indicator",className:"pointer-events-none flex items-center justify-center text-current transition-none",children:a.jsx(lr,{className:"size-3.5 text-white"})})}),a.jsx("span",{children:t.id})]})},t.id))})]})})}const Iie=({onEdit:e,onDelete:t,onRotateSecretKey:n}={})=>[{accessorKey:"title",size:50,header:({column:r})=>a.jsx(v0,{column:r,children:"Title"}),cell:({row:r})=>{const o=r.getValue("title");return a.jsx("div",{className:"overflow-hidden text-ellipsis",children:o})}},{accessorKey:"type",size:30,header:({column:r})=>a.jsx(v0,{column:r,children:"Type"}),cell:({row:r})=>{const o=r.getValue("type"),{displayName:l,icon:c}=Hr.getInfo(o);return a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2",children:[a.jsx(c,{size:18}),l]})}},{accessorKey:"createdAt",size:20,sortDescFirst:!0,header:({column:r})=>a.jsx(v0,{column:r,children:"Created at"}),cell:({row:r})=>{const o=r.getValue("createdAt"),l=new Intl.DateTimeFormat("en-US",{year:"numeric",month:"short",day:"numeric"}).format(o);return a.jsx("div",{className:"text-muted-foreground",children:l})}},{id:"actions",size:80,header:({table:r})=>a.jsx(Mie,{table:r}),cell:({row:r})=>a.jsx(Oie,{id:r.original.id,type:r.original.type,credentials:r.original.credentials,onEdit:e,onDelete:t,onRotateSecretKey:n})}];function kie(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"service-account-details",children:[a.jsx(un,{children:"How do I get a Service Account JSON key?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"To get the JSON key, you'll need to create or use an existing service account in Google Cloud."}),a.jsx("p",{className:"mb-2",children:"Here's what to do:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsxs("li",{children:["Go to"," ",a.jsx(vn,{href:"https://console.cloud.google.com/iam-admin/serviceaccounts",children:"Google Cloud Console"})," ","."]}),a.jsxs("li",{children:["Open ",a.jsx("strong",{children:"IAM & Admin → Service Accounts"}),"."]}),a.jsx("li",{children:"Create a new service account or select an existing one."}),a.jsxs("li",{children:["Open the Service Accounts page, go to the ",a.jsx("strong",{children:"Keys"})," tab, click"," ",a.jsx("strong",{children:"Add key"}),", and select ",a.jsx("strong",{children:"Create new key"}),"."]}),a.jsxs("li",{children:["Choose ",a.jsx("strong",{children:"JSON"})," format and click ",a.jsx("strong",{children:"Create"}),"."]}),a.jsx("li",{children:"Open the downloaded file, copy its entire content, and paste it into the field above."})]})]})]})})}function Lie({form:e}){const[t,n]=m.useState(!1),r=()=>{n(!0),e.setValue("credentials.serviceAccount","",{shouldDirty:!0})},o=()=>{n(!1),e.resetField("credentials.serviceAccount")},l=e.watch("credentials.serviceAccount"),c=l?e5(l):null;return a.jsx(kt,{control:e.control,name:"credentials.serviceAccount",render:({field:d})=>a.jsxs(_t,{children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx(Rt,{tooltip:"Paste a JSON key from a service account that has access to the selected destination provider",children:"Service Account"}),!t&&l&&a.jsx(xe,{variant:"ghost",size:"sm",onClick:r,type:"button",children:"Edit"}),t&&a.jsx(xe,{variant:"ghost",size:"sm",onClick:o,type:"button",children:"Cancel"})]}),a.jsx(Nt,{children:!t&&c?a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx(vn,{href:c.url,children:c.email})}),a.jsx(Ct,{children:a.jsx("p",{children:"View in Google Cloud Console"})})]}):a.jsx(Zo,{...d,className:"min-h-[150px] font-mono",rows:8,placeholder:"Paste your service account JSON here"})}),a.jsx(wn,{children:a.jsx(kie,{})}),a.jsx(Ft,{})]})})}function Pie(){return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsxs(cn,{value:"json-config-details",children:[a.jsx(un,{children:"What is the JSON Config for Looker Studio?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"The JSON Config contains the necessary credentials and configuration for connecting to Looker Studio."}),a.jsxs("ul",{className:"list-inside space-y-2 text-sm",children:[a.jsx("li",{children:"You need to copy this JSON config to use it in the Looker Studio Connector."}),a.jsx("li",{children:"If you need to rotate a previous secret key, you can use the corresponding function in the menu on the destinations list."})]})]})]})})}function Uie({form:e}){const t=e.getValues("credentials"),n=m.useMemo(()=>t&&KS(t)?t:{deploymentUrl:"",destinationId:"",destinationSecretKey:""},[t]),r=m.useMemo(()=>kb(n),[n]);return a.jsx(a.Fragment,{children:n.destinationSecretKey&&a.jsx(kt,{control:e.control,name:"credentials.destinationSecretKey",render:()=>a.jsxs(_t,{children:[a.jsx(Rt,{children:"JSON Config"}),a.jsx(Nt,{children:a.jsx(jA,{value:r,displayOnly:!0,keysToMask:["destinationSecretKey"],className:"bg-muted overflow-auto rounded-md text-sm",showCopyButton:!0})}),a.jsx(Ft,{}),a.jsx(wn,{children:a.jsx(Pie,{})})]})})})}const E6="credentials.to",Fie=/[,;\n]/,Vie=", ",w6="Enter emails separated by comma, semicolon or newline",zie="Emails list";function HT(e){const t=new Set,n=[];for(const r of e.split(Fie)){const o=r.trim();if(!o)continue;const l=o.toLowerCase();t.has(l)||(t.add(l),n.push(o))}return n}function x0(e){return e.join(Vie)}function $T(e,t){e.setValue(E6,t,{shouldDirty:!0,shouldTouch:!0})}function Hie({field:e,form:t}){const n=Array.isArray(e.value)?x0(e.value):"",[r,o]=m.useState(n),[l,c]=m.useState(!1),d=Array.isArray(e.value)?x0(e.value):"";m.useEffect(()=>{l||o(d)},[d,l]);const f=y=>{const v=y.target.value;o(v),$T(t,HT(v))},h=()=>{c(!0)},g=y=>{c(!1),e.onBlur();const v=HT(y.target.value);$T(t,v),o(x0(v))};return a.jsx(Zo,{name:e.name,ref:e.ref,onFocus:h,onBlur:g,value:r,onChange:f,className:"min-h-[150px] font-mono",rows:8,placeholder:w6})}function Gm({form:e,emailsFieldTitle:t=zie}){return a.jsx(kt,{control:e.control,name:E6,render:({field:n})=>a.jsxs(_t,{children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(Rt,{tooltip:w6,children:t})}),a.jsx(Nt,{children:a.jsx(Hie,{field:n,form:e})}),a.jsx(Ft,{})]})})}function $ie(){return a.jsxs(cn,{value:"sheets-api-details",children:[a.jsx(un,{children:"How do I enable the Google Sheets API?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Google Sheets, you need to enable the"," ",a.jsx(vn,{href:"https://console.cloud.google.com/apis/library/sheets.googleapis.com",children:"Google Sheets API"})," ","in your Google Cloud project."]}),a.jsx("p",{className:"mb-2",children:"Here's how to do it:"}),a.jsxs("ol",{className:"list-inside list-decimal space-y-2 text-sm",children:[a.jsx("li",{children:"Open the link above and make sure the correct project is selected."}),a.jsxs("li",{children:["If the API isn't enabled yet, click ",a.jsx("strong",{children:"Enable"}),"."]}),a.jsx("li",{children:"If it's already enabled, you'll see the API dashboard — that's fine."})]})]})]})}function Bie(){return a.jsxs(cn,{value:"looker-studio-details",children:[a.jsx(un,{children:"How do I connect to Looker Studio?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["To send data to Looker Studio, you need to provide a deployment URL that the"," ",a.jsx(vn,{className:"p-0",href:"https://datastudio.google.com/datasources/create?connectorId=AKfycbz6kcYn3qGuG0jVNFjcDnkXvVDiz4hewKdAFjOm-_d4VkKVcBidPjqZO991AvGL3FtM4A",children:"Looker Studio connector"})," ","will use to access your data."]}),a.jsx("p",{className:"mb-2",children:"Make sure the deployment URL is accessible from the internet and properly secured."}),a.jsx(vn,{className:"p-0",href:"https://docs.owox.com/docs/destinations/supported-destinations/looker-studio/?utm_source=owox_data_marts&utm_medium=destination_enity&utm_campaign=tooltip",children:"Learn more"})]})]})}function Gie(){return a.jsxs(cn,{value:"odata-details",children:[a.jsx(un,{children:"How do I use OData?"}),a.jsxs(dn,{children:[a.jsx("p",{className:"mb-2",children:"OData (Open Data Protocol) is an ISO/IEC approved, OASIS standard that defines a set of best practices for building and consuming RESTful APIs."}),a.jsx("p",{className:"mb-2",children:"This feature is coming soon."})]})]})}function qie(){return a.jsxs(cn,{value:"email-details",children:[a.jsx(un,{children:"How do I start sending Email?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports by email, first configure the ",a.jsx("strong",{children:"Email"})," destination in this form. Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Email block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, specify recipient addresses, add a message, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected addresses as formatted text."}),a.jsx("p",{className:"mb-2 text-sm",children:"Make sure recipients have permission to view the report data."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/manage-destinations/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-email",children:"OWOX documentation"}),"."]})]})]})}function Zie(){return a.jsxs(cn,{value:"slack-details",children:[a.jsx(un,{children:"How do I start sending to Slack?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Slack, first configure the ",a.jsx("strong",{children:"Slack"})," destination in this form. Then, go to your Data Mart page, open the ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Slack block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, choose the workspace, channel, message text, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsx("p",{className:"mb-2 text-sm",children:"Make sure OWOX has permission to post messages in the chosen channel."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/manage-destinations/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-slack",children:"OWOX documentation"}),"."]})]})]})}function Kie(){return a.jsxs(cn,{value:"msteams-details",children:[a.jsx(un,{children:"How do I start sending to Microsoft Teams?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Microsoft Teams, first configure the ",a.jsx("strong",{children:"Microsoft Teams"})," ","destination in this form. Then, go to your Data Mart page, open the"," ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Microsoft Teams block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, select the channel, add a message, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the selected channel as a message."}),a.jsx("p",{className:"mb-2 text-sm",children:"Make sure OWOX has permission to post messages in your Teams workspace."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/manage-destinations/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-microsoft-teams",children:"OWOX documentation"}),"."]})]})]})}function Yie(){return a.jsxs(cn,{value:"googlechat-details",children:[a.jsx(un,{children:"How do I start sending to Google Chat?"}),a.jsxs(dn,{children:[a.jsxs("p",{className:"mb-2",children:["To send reports to Google Chat, first configure the ",a.jsx("strong",{children:"Google Chat"})," ","destination in this form. Then, go to your Data Mart page, open the"," ",a.jsx("strong",{children:"Destinations"})," tab, and create a report in the Google Chat block."]}),a.jsx("p",{className:"mb-2",children:"In the report settings, select the channel, add a message, and define delivery conditions. The generated report will be delivered by OWOX Data Marts to the connected space as chat messages."}),a.jsxs("p",{className:"mb-2",children:["For more details, read the"," ",a.jsx(vn,{className:"underline",href:"https://docs.owox.com/docs/destinations/manage-destinations/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=tooltip-google-chat",children:"OWOX documentation"}),"."]})]})]})}const Wie={[je.GOOGLE_SHEETS]:$ie,[je.LOOKER_STUDIO]:Bie,[je.ODATA]:Gie,[je.EMAIL]:qie,[je.SLACK]:Zie,[je.MS_TEAMS]:Kie,[je.GOOGLE_CHAT]:Yie};function Qie({destinationType:e}){const t=Wie[e];return a.jsx(Bn,{variant:"common",type:"single",collapsible:!0,children:a.jsx(t,{})})}function Xie({form:e,initialData:t}){const{flags:n}=Eg();return a.jsx(kt,{control:e.control,name:"type",render:({field:r})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Select the destination to send your data",children:"Destination Type"}),a.jsxs(Kr,{onValueChange:r.onChange,defaultValue:r.value,disabled:!!t,children:[a.jsx(Nt,{children:a.jsx(Wr,{className:"w-full",children:a.jsx(Yr,{placeholder:"Select a destination type"})})}),a.jsx(Qr,{children:a.jsx($g,{children:Hr.getAllTypes().map(({type:o,displayName:l,icon:c,status:d})=>{const f=d===us.COMING_SOON,h=d===us.CLOUD_ONLY&&Yre(n);return a.jsx(a.Fragment,{children:h?a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("div",{children:a.jsx(Rn,{value:o,disabled:!0,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(c,{size:18}),l,a.jsx(gr,{variant:"secondary",children:"Cloud & Enterprise"})]})},o)})}),a.jsxs(Ct,{side:"left",align:"start",className:"w-[220px]",children:["Available only in"," ",a.jsxs(ha,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/owox-cloud-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["Cloud edition",a.jsx(Uo,{className:"h-3 w-3"})]})," ","or with"," ",a.jsxs(ha,{className:"inline-flex items-center gap-1 underline",target:"_blank",to:"https://docs.owox.com/docs/editions/self-managed-editions/?utm_source=owox_data_marts&utm_medium=destination_entity&utm_campaign=unavailable_select_item_tooltip",children:["an Enterprise plan",a.jsx(Uo,{className:"h-3 w-3"})]}),"."]})]}):a.jsx(Rn,{value:o,disabled:f,children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(c,{size:18}),l,f&&a.jsx(gr,{variant:"outline",children:d})]})},o)})})})})]}),a.jsx(wn,{children:a.jsx(Qie,{destinationType:r.value})}),a.jsx(Ft,{})]})})}function Jie({initialData:e,onSubmit:t,onCancel:n,onDirtyChange:r}){const o=Qo({resolver:ll(MK),defaultValues:e??{title:"New Destination",type:je.GOOGLE_SHEETS},mode:"onTouched"}),l=o.watch("type");m.useEffect(()=>{r==null||r(o.formState.isDirty)},[o.formState.isDirty,r]);const c=async d=>{const{dirtyFields:f}=o.formState,h=t5(d);return f.credentials||delete h.credentials,t(h)};return a.jsx(rl,{...o,children:a.jsxs(Xo,{onSubmit:d=>{o.handleSubmit(c)(d)},children:[a.jsxs(al,{children:[a.jsx(kt,{control:o.control,name:"title",render:({field:d})=>a.jsxs(_t,{children:[a.jsx(Rt,{tooltip:"Name the destination to clarify its purpose",children:"Title"}),a.jsx(Nt,{children:a.jsx(Ht,{placeholder:"Enter title",...d})}),a.jsx(Ft,{})]})}),a.jsx(Xie,{form:o,initialData:e}),l===je.GOOGLE_SHEETS&&a.jsx(Lie,{form:o}),l===je.LOOKER_STUDIO&&a.jsx(Uie,{form:o}),l===je.EMAIL&&a.jsx(Gm,{form:o,emailsFieldTitle:"Enter user emails list"}),l===je.SLACK&&a.jsx(Gm,{form:o,emailsFieldTitle:"Enter Slack channel emails list"}),l===je.MS_TEAMS&&a.jsx(Gm,{form:o,emailsFieldTitle:"Enter Microsoft Teams channel emails list"}),l===je.GOOGLE_CHAT&&a.jsx(Gm,{form:o,emailsFieldTitle:"Enter Google Chat channel emails list"})]}),a.jsxs(sl,{children:[a.jsxs(xe,{variant:"default",type:"submit",className:"w-full","aria-label":"Save",disabled:!o.formState.isDirty||o.formState.isSubmitting,children:[o.formState.isSubmitting&&a.jsx(Of,{className:"mr-2 h-4 w-4 animate-spin"}),"Save"]}),a.jsx(xe,{variant:"outline",type:"button",onClick:n,className:"w-full","aria-label":"Cancel",children:"Cancel"})]})]})})}function ele({isOpen:e,onClose:t,dataDestination:n,onSaveSuccess:r}){const{updateDataDestination:o,createDataDestination:l}=Xf(),[c,d]=m.useState(!1),[f,h]=m.useState(!1),g=m.useCallback(()=>{f?d(!0):t()},[f,t]),y=m.useCallback(()=>{d(!1),h(!1),t()},[t]),v=m.useCallback(S=>{h(S)},[]),b=async S=>{const C=i3.getMapper(S.type);if(n){const R=C.mapToUpdateRequest(S),j=await o(n.id,R);j&&r(j)}else{const R=C.mapToCreateRequest(S),j=await l(R);j&&r(j)}t()},E=m.useRef(!1);return m.useEffect(()=>{const S=n?"Edit":"Create";e&&!E.current?(Ue({event:"data_destination_config_open",category:"DataDestination",action:S,label:n==null?void 0:n.type}),E.current=!0):!e&&E.current&&(Ue({event:"data_destination_config_close",category:"DataDestination",action:S,label:n==null?void 0:n.type}),E.current=!1)},[e,n]),a.jsxs(a.Fragment,{children:[a.jsx($o,{open:e,onOpenChange:S=>{S||g()},children:a.jsxs(Bo,{children:[a.jsxs(Go,{children:[a.jsx(qo,{children:"Configure destination"}),a.jsx(Xi,{children:"Customize settings for your destination"})]}),a.jsx(Jie,{initialData:n??void 0,onSubmit:b,onCancel:g,onDirtyChange:v})]})}),a.jsx(Tr,{open:c,onOpenChange:d,title:"Unsaved Changes",description:"You have unsaved changes. Exit without saving?",confirmLabel:"Yes, leave now",cancelLabel:"No, stay here",onConfirm:y,variant:"destructive"})]})}const tle=({isCreateSheetInitiallyOpen:e=!1,onCreateSheetClose:t})=>{const{dataDestinations:n,currentDataDestination:r,clearCurrentDataDestination:o,fetchDataDestinations:l,getDataDestinationById:c,deleteDataDestination:d,rotateSecretKey:f}=Xf(),h=m.useCallback(()=>{o(),y(!0),t==null||t()},[o,t]),[g,y]=m.useState(!1),[v,b]=m.useState(!1),[E,S]=m.useState(!1),[C,R]=m.useState(null),[j,_]=m.useState(null);m.useEffect(()=>{l()},[l]),m.useEffect(()=>{e&&h()},[e,h]);const D=async G=>{await c(G),y(!0)},A=G=>{R(G),b(!0)},O=G=>{_(G),S(!0)},T=async()=>{if(j)try{const G=await f(j);if(KS(G.credentials)){It.success("New JSON Config copied to clipboard");const U=kb(G.credentials);navigator.clipboard.writeText(U)}await l()}catch(G){console.error("Failed to rotate secret key:",G)}finally{S(!1),_(null)}},M=async()=>{if(C)try{await d(C),await l()}catch(G){console.error("Failed to delete destination:",G)}finally{b(!1),R(null)}},V=async()=>{try{y(!1),await l()}catch(G){console.error("Failed to save destination:",G)}},Z=()=>{y(!1),o()},K=n.map(G=>({id:G.id,title:G.title,type:G.type,createdAt:G.createdAt,modifiedAt:G.modifiedAt,credentials:G.credentials})),Y=Iie({onEdit:D,onDelete:A,onRotateSecretKey:O});return a.jsxs("div",{children:[a.jsx(Die,{columns:Y,data:K,onEdit:D,onDelete:A,onRotateSecretKey:O,onOpenTypeDialog:h}),a.jsx(ele,{isOpen:g,onClose:Z,dataDestination:r,onSaveSuccess:()=>void V()}),a.jsx(Tr,{open:v,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"}),a.jsx(Tr,{open:E,onOpenChange:S,title:"Rotate Secret Key",description:"Rotating the secret key will invalidate the previous key",confirmLabel:"Rotate Key",cancelLabel:"Cancel",onConfirm:()=>void T(),onCancel:()=>{S(!1)},variant:"destructive",children:a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"mb-2",children:"After rotation, you will need to:"}),a.jsxs("ol",{className:"mb-2 list-decimal pl-5",children:[a.jsx("li",{children:"The new JSON Config will be automatically copied to your clipboard"}),a.jsx("li",{children:"Go to your Looker Studio Connector"}),a.jsx("li",{children:"Update the configuration with the new JSON Config"}),a.jsx("li",{children:"Save the changes to restore access to your data marts"})]}),a.jsx("p",{className:"font-semibold",children:"Are you sure you want to rotate the secret key?"})]})})]})},nle=()=>{const[e,t]=m.useState(!1);return a.jsxs("div",{className:"dm-page",children:[a.jsx("header",{className:"dm-page-header",children:a.jsx("h1",{className:"dm-page-header-title",children:"Destinations"})}),a.jsx("div",{className:"dm-page-content",children:a.jsx(Qf,{children:a.jsx(tle,{isCreateSheetInitiallyOpen:e,onCreateSheetClose:()=>{t(!1)}})})})]})};function rle({status:e}){switch(e){case ir.RUNNING:return a.jsx(gr,{variant:"secondary",className:"text-primary bg-primary/10",children:"Running"});case ir.SUCCESS:return a.jsx(gr,{variant:"secondary",className:"bg-green-50 text-green-600 dark:bg-green-950 dark:text-green-400",children:"Success"});case ir.FAILED:return a.jsx(gr,{variant:"secondary",className:"bg-red-50 text-red-600 dark:bg-red-950 dark:text-red-400",children:"Failed"});case ir.CANCELLED:return a.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Cancelled"});case ir.INTERRUPTED:return a.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Interrupted"});case ir.PENDING:return a.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Pending"});default:return a.jsx(gr,{variant:"secondary",className:"bg-gray-50 text-gray-500 dark:bg-gray-950 dark:text-gray-400",children:"Unknown"})}}var $r=(e=>(e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.SYSTEM="SYSTEM",e))($r||{}),ds=(e=>(e.STRUCTURED="structured",e.RAW="raw",e.CONFIGURATION="configuration",e))(ds||{});const BT=(e,t,n=!1)=>{var c,d,f,h;const r=e.split(`
714
- `).filter(g=>g.trim()!=="");if(r.length>=3){const g=r[0],y=r[1],v=r.slice(2).join(`
715
- `);if(g.includes("T")&&g.includes("Z")){const b=b0(v);return{id:`log-${t.toString()}`,timestamp:Xc(g),level:n?$r.ERROR:$r.INFO,message:b.message,metadata:{at:(c=b.metadata)!=null&&c.at?Xc(b.metadata.at):Xc(g),type:((d=b.metadata)==null?void 0:d.type)??(y!=="unknown"?y:null)}}}}const o=/^\[(.*?)\]\s*\[(.*?)\]\s*(.*)$/.exec(e);if(o){const g=b0(o[3]);return{id:`log-${t.toString()}`,timestamp:Xc(o[1]),level:n?$r.ERROR:o[2],message:g.message,metadata:(f=g.metadata)!=null&&f.at?{...g.metadata,at:Xc(g.metadata.at)}:g.metadata}}const l=b0(e);return{id:`log-${t.toString()}`,timestamp:"N/A",level:n?$r.ERROR:$r.INFO,message:l.message,metadata:(h=l.metadata)!=null&&h.at?{...l.metadata,at:Xc(l.metadata.at)}:l.metadata}},b0=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 o=Object.keys(r);if(o.length===1){const l=o[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}},R6=e=>{var t;return(t=e.metadata)!=null&&t.type?e.metadata.type:e.level},ale=(e,t)=>{var c,d;let n="",r="";switch(e.type){case Mr.CONNECTOR:n=t??"",r="connector";break;case Mr.LOOKER_STUDIO:n="Looker Studio data fetching",r="report";break;case Mr.GOOGLE_SHEETS_EXPORT:case Mr.EMAIL:case Mr.SLACK:case Mr.MS_TEAMS:case Mr.GOOGLE_CHAT:n=((c=e.reportDefinition)==null?void 0:c.title)??"",r="report";break;case Mr.INSIGHT:n=((d=e.insightDefinition)==null?void 0:d.title)??"",r="insight";break}return[Kre(`${e.triggerType} ${r} run`.trim()),n].join(" • ")},sle=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)},ole=e=>{const t=e.startedAt??e.createdAt;return Yg(t.toISOString())},ile=e=>{const t=GT(e.startedAt),n=GT(e.finishedAt);let r="";return e.startedAt&&e.finishedAt&&(r=WJ(e.startedAt,e.finishedAt)),{startedAt:t,finishedAt:n,duration:r}},GT=e=>e?Yg(e.toISOString()):"N/A";function lle({logViewType:e,setLogViewType:t,searchTerm:n,setSearchTerm:r,run:o,cancelDataMartRun:l,dataMartId:c}){const d=g=>{g.stopPropagation()},f=async g=>{if(g.stopPropagation(),c)try{await l(c,o.id),on.success("Data mart run cancelled successfully")}catch(y){on.error(y instanceof Error?y.message:"Failed to cancel data mart run")}},h=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 a.jsxs("div",{className:"bg-background border-border flex items-center justify-between rounded-lg border p-3",children:[a.jsxs("div",{className:"flex items-center gap-4",children:[a.jsxs("div",{className:"bg-background border-border flex items-center rounded-lg border",children:[a.jsx("button",{onClick:g=>{g.stopPropagation(),t(ds.STRUCTURED)},className:`${h(e===ds.STRUCTURED)} rounded-l-lg`,children:"Structured"}),a.jsx("button",{onClick:g=>{g.stopPropagation(),t(ds.RAW)},className:`${h(e===ds.RAW)} rounded-none`,children:"Raw"}),a.jsx("button",{onClick:g=>{g.stopPropagation(),t(ds.CONFIGURATION)},className:`${h(e===ds.CONFIGURATION)} rounded-r-lg`,children:"Configuration"})]}),e!==ds.CONFIGURATION&&a.jsxs("div",{className:"relative",children:[a.jsx(Jl,{className:"text-muted-foreground absolute top-2.5 left-2 h-4 w-4"}),a.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"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[o.status===ir.RUNNING&&a.jsxs(xe,{variant:"destructive",size:"sm",onClick:g=>void f(g),children:[a.jsx(xu,{className:"h-4 w-4"}),"Cancel"]}),a.jsxs(xe,{variant:"outline",size:"sm",onClick:g=>{g.stopPropagation(),sle(o)},className:"flex items-center gap-2",children:[a.jsx(yk,{className:"h-4 w-4"}),"JSON"]})]})]})}function cle(e){switch(e){case $r.INFO:return a.jsx(Br,{className:"h-3 w-3 text-blue-500"});case $r.WARNING:return a.jsx(ag,{className:"h-3 w-3 text-yellow-500"});case $r.ERROR:return a.jsx(dp,{className:"h-3 w-3 text-red-500"});case $r.SYSTEM:return a.jsx(Df,{className:"text-muted-foreground h-3 w-3"});default:return a.jsx(Br,{className:"text-muted-foreground h-3 w-3"})}}function ule(e){switch(e){case $r.INFO:return"text-blue-600 dark:text-blue-400";case $r.WARNING:return"text-yellow-600 dark:text-yellow-400";case $r.ERROR:return"text-red-600 dark:text-red-400";case $r.SYSTEM:return"text-muted-foreground";default:return"text-muted-foreground"}}function dle(e){return e===BA.SCHEDULED?a.jsx(K7,{size:18}):a.jsx(D_,{size:18})}function fle({logs:e}){const t=r=>{r.stopPropagation()},n=r=>{var o;return(o=r.metadata)!=null&&o.at?r.metadata.at:r.timestamp};return e.length===0?a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"text-muted-foreground p-8 text-center text-sm",children:"No logs found"})}):a.jsx("div",{className:"bg-background border-border rounded-lg border",children:a.jsx("div",{className:"max-h-96 overflow-y-auto",children:e.map((r,o)=>a.jsxs("div",{className:`border-border hover:bg-accent/30 flex items-start gap-3 border-b p-3 text-xs ${o===e.length-1?"border-b-0":""}`,onClick:t,children:[a.jsx("div",{className:"text-muted-foreground flex-shrink-0 font-mono text-xs",children:n(r)}),a.jsxs("div",{className:"flex min-w-0 flex-shrink-0 items-center gap-2",children:[cle(r.level),a.jsx("span",{className:`text-xs font-medium ${ule(r.level)}`,children:R6(r)})]}),a.jsx("div",{className:`min-w-0 flex-1 text-xs break-words ${r.level===$r.ERROR?"text-red-700 dark:text-red-300":"text-foreground"}`,children:r.message.includes(`
716
- `)?a.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap",children:r.message}):a.jsx("span",{children:r.message})})]},r.id))})})}var Kp=(e=>(e.ERROR="error",e.DEFAULT="default",e))(Kp||{});function Yp({text:e,section:t,variant:n="default",copiedSection:r,onCopy:o,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",h=c?"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-950/40":"text-foreground hover:bg-muted";return a.jsx("button",{onClick:g=>{o(e,t),g.stopPropagation()},className:`${f} ${h}`,title:`Copy ${t} to clipboard`,children:l?a.jsx(a.Fragment,{children:d?a.jsx(lr,{className:"h-3 w-3"}):a.jsx(hf,{className:"h-3 w-3"})}):d?a.jsxs(a.Fragment,{children:[a.jsx(lr,{className:"h-3 w-3"}),"Copied"]}):a.jsxs(a.Fragment,{children:[a.jsx(hf,{className:"h-3 w-3"}),"Copy"]})})}function YS(){const[e,t]=m.useState(null),n=async(o,l)=>{try{await navigator.clipboard.writeText(o),t(l),setTimeout(()=>{t(null)},2e3)}catch(c){console.error("Failed to copy text: ",c)}};return{copiedSection:e,copyToClipboard:n,handleCopy:(o,l)=>{n(o,l)}}}function hle({logs:e,errors:t}){const{copiedSection:n,handleCopy:r}=YS(),o=l=>{l.stopPropagation()};return a.jsxs("div",{className:"border-border space-y-4 rounded-lg border p-4",onClick:o,children:[t.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"flex items-center gap-2 text-sm font-medium text-red-600 dark:text-red-400",children:[a.jsx(Df,{className:"h-4 w-4 text-red-500"}),"Error Output:"]}),a.jsx(Yp,{text:t.join(`
717
- `),section:"errors",variant:Kp.ERROR,copiedSection:n,onCopy:r})]}),a.jsx("div",{className:"max-h-96 overflow-y-auto rounded-md bg-red-50 p-3 font-mono text-xs dark:border-red-800 dark:bg-red-950/40",children:t.map((l,c)=>a.jsx("div",{className:"mb-1 leading-relaxed text-red-700 dark:text-red-300",children:l},c))})]}),e.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[a.jsxs("h4",{className:"text-foreground flex items-center gap-2 text-sm font-medium",children:[a.jsx(Br,{className:"h-4 w-4 text-blue-500"}),"Standard Output:"]}),a.jsx(Yp,{text:e.join(`
718
- `),section:"logs",variant:Kp.DEFAULT,copiedSection:n,onCopy:r})]}),a.jsx("div",{className:"bg-muted max-h-96 overflow-y-auto rounded-md p-3 font-mono text-xs dark:bg-white/3",children:e.map((l,c)=>a.jsx("div",{className:"mb-1 leading-relaxed",children:l},c))})]})]})}function mle({definitionRun:e,reportDefinition:t,insightDefinition:n}){const{copiedSection:r,handleCopy:o}=YS(),l=c=>{c.stopPropagation()};return a.jsx("div",{className:"border-border rounded-lg border",onClick:l,children:e!=null?a.jsxs("div",{className:"p-4",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[a.jsx("h4",{className:"text-foreground text-sm font-medium",children:"Configuration:"}),a.jsx(Yp,{text:JSON.stringify(e,null,2),section:"configuration",variant:Kp.DEFAULT,copiedSection:r,onCopy:o})]}),a.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(e,null,2)}),t&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Report definition:"}),a.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(t,null,2)})]}),n&&a.jsxs(a.Fragment,{children:[a.jsx("h4",{className:"text-foreground mt-3 mb-3 text-sm font-medium",children:"Insight definition:"}),a.jsx("pre",{className:"bg-muted text-foreground overflow-x-auto rounded p-3 font-mono text-xs whitespace-pre-wrap dark:bg-white/3",children:JSON.stringify(n,null,2)})]})]}):a.jsx("div",{className:"text-muted-foreground p-8 text-center",children:"No configuration data available for this run"})})}const jo=18;function ple({type:e,base64Icon:t}){switch(e){case Mr.CONNECTOR:return t?a.jsx(rc,{base64:t,size:jo}):a.jsx(zl,{size:jo});case Mr.GOOGLE_SHEETS_EXPORT:{const n=Hr.getInfo(je.GOOGLE_SHEETS).icon;return a.jsx(n,{size:jo})}case Mr.LOOKER_STUDIO:{const n=Hr.getInfo(je.LOOKER_STUDIO).icon;return a.jsx(n,{size:jo})}case Mr.EMAIL:{const n=Hr.getInfo(je.EMAIL).icon;return a.jsx(n,{size:jo})}case Mr.SLACK:{const n=Hr.getInfo(je.SLACK).icon;return a.jsx(n,{size:jo})}case Mr.MS_TEAMS:{const n=Hr.getInfo(je.MS_TEAMS).icon;return a.jsx(n,{size:jo})}case Mr.GOOGLE_CHAT:{const n=Hr.getInfo(je.GOOGLE_CHAT).icon;return a.jsx(n,{size:jo})}default:return a.jsx(zl,{size:jo})}}function gle({run:e,isExpanded:t,onToggle:n,logViewType:r,setLogViewType:o,searchTerm:l,setSearchTerm:c,cancelDataMartRun:d,dataMartId:f,dataMartConnectorInfo:h}){const{copiedSection:g,handleCopy:y}=YS(),v=m.useMemo(()=>{if(e.logs.length===0&&e.errors.length===0)return[];const C=e.logs.map((_,D)=>BT(_,D)),R=e.errors.map((_,D)=>BT(_,e.logs.length+D,!0));return[...C,...R].filter(_=>{const D=R6(_);return l===""||_.message.toLowerCase().includes(l.toLowerCase())||D.toLowerCase().includes(l.toLowerCase())})},[e.logs,e.errors,l]),b=m.useCallback(()=>r===ds.STRUCTURED?a.jsx(fle,{logs:v}):r===ds.RAW?a.jsx(hle,{logs:e.logs,errors:e.errors}):a.jsx(mle,{definitionRun:e.definitionRun,reportDefinition:e.reportDefinition,insightDefinition:e.insightDefinition}),[r,v,e.logs,e.errors,e.definitionRun,e.reportDefinition,e.insightDefinition]),E=ole(e),S=ile(e);return a.jsxs("div",{className:"dm-card-block",children:[a.jsxs("div",{className:"flex cursor-pointer items-center justify-between",onClick:()=>{n(e.id)},children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{children:a.jsx(ple,{type:e.type,base64Icon:h==null?void 0:h.logoBase64})}),a.jsxs(bt,{children:[a.jsx(St,{asChild:!0,children:a.jsx("div",{className:"text-foreground align-center mr-12 flex items-center font-mono text-sm font-medium",children:E})}),a.jsx(Ct,{children:a.jsxs("div",{className:"space-y-1",children:[a.jsxs("div",{children:["Started At: ",S.startedAt]}),a.jsxs("div",{children:["Finished At: ",S.finishedAt]}),S.duration&&a.jsxs("div",{children:["Duration: ",S.duration]})]})})]}),a.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[dle(e.triggerType),ale(e,h==null?void 0:h.displayName)]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(rle,{status:e.status}),a.jsx(La,{className:`text-muted-foreground h-4 w-4 transition-transform ${t?"rotate-90":""}`})]})]}),t&&a.jsxs("div",{className:"border-border bg-muted/30 space-y-4 border-t p-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsxs("h3",{className:"text-foreground mr-2 font-medium",children:["Run ID: ",e.id]}),a.jsx(Yp,{text:e.id,section:"run-id",onCopy:y,copiedSection:g,iconOnly:!0})]}),a.jsx(lle,{logViewType:r,setLogViewType:o,searchTerm:l,setSearchTerm:c,run:e,cancelDataMartRun:d,dataMartId:f}),b()]})]})}function yle(){const{dataMart:t,getDataMartRuns:n,loadMoreDataMartRuns:r,cancelDataMartRun:o,runs:l=[],isLoading:c}=Ia(),[d,f]=m.useState(!1),[h,g]=m.useState(!0),[y,v]=m.useState(0),[b,E]=m.useState(null),[S,C]=m.useState(ds.STRUCTURED),[R,j]=m.useState(""),_=m.useCallback(async()=>{if(!(t!=null&&t.id))return;const T=await n(t.id,20,0);v(T.length),g(T.length===20)},[t==null?void 0:t.id,n,20]),D=m.useCallback(async()=>{if(!(t!=null&&t.id)||d)return;f(!0);const T=await r(t.id,y,20);v(M=>M+T.length),g(T.length===20),f(!1)},[t==null?void 0:t.id,r,y,d,20]);m.useEffect(()=>{t!=null&&t.id&&_()},[t==null?void 0:t.id,_]);const A=m.useMemo(()=>(t==null?void 0:t.definitionType)===Fe.CONNECTOR&&t.definition&&"connector"in t.definition?t.definition.connector.info??null:null,[t]),O=T=>{E(b===T?null:T)};return c?a.jsx(b6,{}):a.jsx("div",{className:"flex flex-col gap-4 pb-4",children:l.length===0?a.jsx("div",{className:"text-muted-foreground py-8 text-center",children:"No runs found for this Data Mart"}):a.jsxs("div",{className:"space-y-2",children:[l.map(T=>a.jsx(gle,{run:T,isExpanded:b===T.id,onToggle:O,logViewType:S,setLogViewType:C,searchTerm:R,setSearchTerm:j,cancelDataMartRun:o,dataMartId:t==null?void 0:t.id,dataMartConnectorInfo:A},T.id)),h&&a.jsx("div",{className:"flex justify-center pt-4",children:a.jsx(pu,{variant:"outline",size:"sm",onClick:()=>void D(),disabled:d,className:"flex items-center gap-2",children:d?a.jsxs(a.Fragment,{children:[a.jsx(uL,{className:"h-4 w-4 animate-spin"}),"Loading..."]}):"Load More"})})]})})}const vle=5e3,xle=20;function ble(){const{dataMart:e,getDataMartRuns:t}=Wo();return S6({enabled:!!(e!=null&&e.id),intervalMs:vle,onTick:()=>{e!=null&&e.id&&t(e.id,xle,0,{silent:!0})}}),a.jsx("div",{className:"flex flex-col gap-4",children:a.jsxs(Vl,{collapsible:!1,name:"run-history",children:[a.jsx(Lo,{children:a.jsx(ko,{icon:kk,tooltip:"View all Data Mart execution runs with detailed logs and errors",children:"Run History"})}),a.jsx(Po,{children:a.jsx(yle,{})})]})})}const Sle=[{path:"overview",element:a.jsx(zT,{})},{path:"data-setup",element:a.jsx(Soe,{})},{path:"reports",element:a.jsx(bie,{})},{path:"triggers",element:a.jsx(Sie,{})},{path:"run-history",element:a.jsx(ble,{})},{index:!0,element:a.jsx(zT,{})}];function Cle({to:e="/data-marts"}){const{user:t,status:n}=el();if(n===kr.LOADING)return a.jsx(hu,{fullScreen:!0,message:"Loading..."});if(n===kr.UNAUTHENTICATED||!t)return a.jsx(hu,{fullScreen:!0,message:"Authentication..."});if(t.projectId){const r=Cp(t.projectId,e);return a.jsx(kI,{to:r,replace:!0})}return a.jsx(hu,{fullScreen:!0,message:"Project not found"})}const Ele=[{index:!0,path:"/",element:a.jsx(Cle,{})},{path:"/ui/:projectId",element:a.jsx(jZ,{}),children:[{path:"about",element:a.jsx(TZ,{})},{index:!0,element:a.jsx(zj,{})},{path:"data-marts",element:a.jsx(zj,{})},{path:"data-marts/create",element:a.jsx(Cie,{})},{path:"data-marts/:id",element:a.jsx(moe,{}),children:Sle},{path:"data-storages",element:a.jsx(Nie,{})},{path:"data-destinations",element:a.jsx(nle,{})},{path:"*",element:a.jsx(kj,{})}]},{path:"*",element:a.jsx(kj,{})}],j6="gtm-script",T6="gtm-noscript",wle="GOOGLE_TAG_MANAGER_CONTAINER_ID";function Rle(){return!!document.getElementById(j6)}function jle(e){const t=document.createElement("script");return t.id=j6,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 Tle(e){const t=document.createElement("noscript");return t.id=T6,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 _le(e){if(Rle())return;const t=jle(e);document.head.prepend(t)}function Nle(e){if(document.getElementById(T6))return;const t=Tle(e);document.body.firstChild?document.body.insertBefore(t,document.body.firstChild):document.body.appendChild(t)}function Ale(e){try{_le(e),Nle(e)}catch(t){console.warn("Failed to initialize Google Tag Manager:",t)}}function Dle(e){return(e[wle]??"").trim()}function Ole(){const{flags:e,callState:t}=Eg();return m.useEffect(()=>{if(t!==Lr.LOADED||!e)return;const n=Dle(e);n&&Ale(n)},[e,t]),null}const Mle="INTERCOM_APP_ID",_6="intercom-widget-script";function Ile(){return!!document.getElementById(_6)}function kle(e,t){if(Ile()){t();return}const n=document.createElement("script");n.id=_6,n.src=`https://widget.intercom.io/widget/${e}`,n.async=!0,n.onload=()=>{t()},document.head.appendChild(n)}async function Lle(){try{return(await ca.post("/intercom/jwt")).data.token}catch(e){return console.warn("Failed to fetch Intercom JWT",e),null}}function Ple(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 Ule(e,t){if(!t)return;const n=Ple(e,t),r=await Lle();if(r){n.intercom_user_jwt=r;try{window.Intercom&&window.Intercom("boot",n)}catch(o){console.warn("Failed to boot Intercom",o)}}}function Fle(){const{flags:e,callState:t}=Eg(),{user:n}=el(),r=m.useRef(!1);return m.useEffect(()=>{if(r.current||t!==Lr.LOADED||!e)return;const o=e[Mle],l=(typeof o=="string"?o:"").trim();l&&kle(l,()=>{Ule(l,n).then(()=>{r.current=!0,E1()})})},[e,t,n]),null}function Vle({initialState:e,reducer:t,children:n}){const[r,o]=m.useReducer(t,e),l=m.useMemo(()=>o,[o]);return a.jsx(q4.Provider,{value:r,children:a.jsx(Z4.Provider,{value:l,children:n})})}function zle(e){return(t,n)=>{const r={...t};return Object.keys(e).forEach(o=>{const l=e[o],c=t[o],d=l(c,n);d!==c&&(r[o]=d)}),r}}const qT={id:null,title:null},N6="project/SET_PROJECT",Hle="project/CLEAR_PROJECT";function $le(e){return{type:N6,payload:e}}function Ble(e=qT,t){switch(t.type){case N6:{const{id:n,title:r}=t.payload;return{id:n,title:r??null}}case Hle:return{...qT};default:return e}}class Gle extends ac{getFlags(){return this.get("/flags")}}const qle=new Gle(""),A6={LICENSED_APP_EDITION:"COMMUNITY",MENU_GITHUB_COMMUNITY_VISIBLE:"true",MENU_UPGRADE_OPTIONS_VISIBLE:"true",MENU_FEEDBACK_VISIBLE:"true",MENU_ISSUES_VISIBLE:"true",MENU_LICENSE_VISIBLE:"true",MENU_DOCUMENTATION_COMMUNITY_EDITION_VISIBLE:"true",MENU_SLACK_COMMUNITY_VISIBLE:"true"},Zle={data:{...A6},callState:Lr.IDLE},D6="settings/LOAD_FLAGS",O6="settings/LOAD_FLAGS_SUCCESS",M6="settings/LOAD_FLAGS_ERROR";function Kle(){return{type:D6}}function Yle(e){return{type:O6,payload:e}}function Wle(e){return{type:M6,payload:e}}function Qle(e=Zle,t){switch(t.type){case D6:return{...e,callState:Lr.LOADING,error:void 0};case O6:return{...e,callState:Lr.LOADED,data:{...A6,...t.payload}};case M6:return{...e,callState:Lr.ERROR,error:t.payload};default:return e}}async function Xle(e){try{e(Kle());const t=await qle.getFlags();e(Yle(t))}catch(t){const n=t instanceof Error?t.message:"Failed to load settings";e(Wle(n))}}const I6="app/SET_READY";function Jle(e={ready:!1},t){switch(t.type){case I6:return{...e,ready:!!t.payload};default:return e}}const ece=zle({project:Ble,flags:Qle,app:Jle});function tce({children:e}){return a.jsx(Vle,{reducer:ece,initialState:{project:{id:null,title:null},flags:{data:null,callState:Lr.IDLE},app:{ready:!1}},children:e})}function nce({children:e}){const t=r$(),{user:n,status:r}=el(),o=bp(f=>f.flags),l=o.callState,c=bp(f=>f.app.ready);m.useEffect(()=>{r===kr.AUTHENTICATED&&(n!=null&&n.projectId)&&(t($le({id:n.projectId,title:n.projectTitle??null})),l===Lr.IDLE&&Xle(t))},[r,n==null?void 0:n.projectId,n==null?void 0:n.projectTitle,l,t]),m.useEffect(()=>{const f=r===kr.AUTHENTICATED&&!!(n!=null&&n.projectId)&&l===Lr.LOADED;t({type:I6,payload:f})},[r,n==null?void 0:n.projectId,l,t]);const d=m.useMemo(()=>a.jsx(hu,{fullScreen:!0,message:"Loading application..."}),[]);return c?a.jsx(a.Fragment,{children:e}):l===Lr.ERROR?a.jsx(hu,{fullScreen:!0,message:`Failed to load app flags: ${o.error??""}`}):d}function rce(){const e=o7(Ele);return a.jsx(YB,{children:a.jsx(tce,{children:a.jsxs(nce,{children:[a.jsx(Ole,{}),a.jsx(Fle,{}),a.jsx(x7,{router:e})]})})})}const k6=document.getElementById("root");if(!k6)throw new Error("Root element not found");e9.createRoot(k6).render(a.jsx(m.StrictMode,{children:a.jsx(rce,{})}));