PageSourceSearch

https://refraxion.ai/assets/index-DOf3nG7S.js

js refraxion.ai collected 2026-10-05 14:41:58 UTC 1,952,360 bytes, 973 lines download raw bytes

vendor: 6,403 bytes, lines 1-9
1var LZ=Object.defineProperty;var EM=e=>{throw TypeError(e)};var FZ=(e,t,n)=>t in e?LZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ud=(e,t,n)=>FZ(e,typeof t!="symbol"?t+"":t,n),IN=(e,t,n)=>t.has(e)||EM("Cannot "+n);var G=(e,t,n)=>(IN(e,t,"read from private field"),n?n.call(e):t.get(e)),Ye=(e,t,n)=>t.has(e)?EM("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),De=(e,t,n,r)=>(IN(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),gt=(e,t,n)=>(IN(e,t,"access private method"),n);var Xv=(e,t,n,r)=>({set _(a){De(e,t,a,n)},get _(){return G(e,t,r)}});function BZ(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const i=Object.getOwnPropertyDescriptor(r,a);i&&Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(a){if(a.ep)return;a.ep=!0;const i=n(a);fetch(a.href,i)}})();var Qv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var XF={exports:{}},oj={},QF={exports:{}},St={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its 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 Yy=Symbol.for("react.element"),zZ=Symbol.for("react.portal"),UZ=Symbol.for("react.fragment"),VZ=Symbol.for("react.strict_mode"),WZ=Symbol.for("react.profiler"),qZ=Symbol.for("react.provider"),HZ=Symbol.for("react.context"),KZ=Symbol.for("react.forward_ref"),GZ=Symbol.for("react.suspense"),YZ=Symbol.for("react.memo"),XZ=Symbol.for("react.lazy"),AM=Symbol.iterator;function QZ(e){return e===null||typeof e!="object"?null:(e=AM&&e[AM]||e["@@iterator"],typeof e=="function"?e:null)}var JF={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ZF=Object.assign,e6={};function dm(e,t,n){this.props=e,this.context=t,this.refs=e6,this.updater=n||JF}dm.prototype.isReactComponent={};dm.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};dm.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function t6(){}t6.prototype=dm.prototype;function KA(e,t,n){this.props=e,this.context=t,this.refs=e6,this.updater=n||JF}var GA=KA.prototype=new t6;GA.constructor=KA;ZF(GA,dm.prototype);GA.isPureReactComponent=!0;var PM=Array.isArray,n6=Object.prototype.hasOwnProperty,YA={current:null},r6={key:!0,ref:!0,__self:!0,__source:!0};function a6(e,t,n){var r,a={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)n6.call(t,r)&&!r6.hasOwnProperty(r)&&(a[r]=t[r]);var l=arguments.length-2;if(l===1)a.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];a.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)a[r]===void 0&&(a[r]=l[r]);return{$$typeof:Yy,type:e,key:i,ref:o,props:a,_owner:YA.current}}function JZ(e,t){return{$$typeof:Yy,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function XA(e){return typeof e=="object"&&e!==null&&e.$$typeof===Yy}function ZZ(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var kM=/\/+/g;function LN(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ZZ(""+e.key):t.toString(36)}function Jx(e,t,n,r,a){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Yy:case zZ:o=!0}}if(o)return o=e,a=a(o),e=r===""?"."+LN(o,0):r,PM(a)?(n="",e!=null&&(n=e.replace(kM,"$&/")+"/"),Jx(a,t,n,"",function(u){return u})):a!=null&&(XA(a)&&(a=JZ(a,n+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(kM,"$&/")+"/")+e)),t.push(a)),1;if(o=0,r=r===""?".":r+":",PM(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+LN(i,l);o+=Jx(i,t,n,c,a)}else if(c=QZ(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+LN(i,l++),o+=Jx(i,t,n,c,a);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Jv(e,t,n){if(e==null)return e;var r=[],a=0;return Jx(e,r,"","",function(i){return t.call(n,i,a++)}),r}function eee(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var pa={current:null},Zx={transition:null},tee={ReactCurrentDispatcher:pa,ReactCurrentBatchConfig:Zx,ReactCurrentOwner:YA};function s6(){throw Error("act(...) is not supported in production builds of React.")}St.Children={map:Jv,forEach:function(e,t,n){Jv(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Jv(e,function(){t++}),t},toArray:function(e){return Jv(e,function(t){return t})||[]},only:function(e){if(!XA(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};St.Component=dm;St.Fragment=UZ;St.Profiler=WZ;St.PureComponent=KA;St.StrictMode=VZ;St.Suspense=GZ;
vendor: 9,020 bytes, lines 9-33
9St.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tee;St.act=s6;St.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=ZF({},e.props),a=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=YA.current),t.key!==void 0&&(a=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)n6.call(t,c)&&!r6.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:Yy,type:e.type,key:a,ref:i,props:r,_owner:o}};St.createContext=function(e){return e={$$typeof:HZ,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:qZ,_context:e},e.Consumer=e};St.createElement=a6;St.createFactory=function(e){var t=a6.bind(null,e);return t.type=e,t};St.createRef=function(){return{current:null}};St.forwardRef=function(e){return{$$typeof:KZ,render:e}};St.isValidElement=XA;St.lazy=function(e){return{$$typeof:XZ,_payload:{_status:-1,_result:e},_init:eee}};St.memo=function(e,t){return{$$typeof:YZ,type:e,compare:t===void 0?null:t}};St.startTransition=function(e){var t=Zx.transition;Zx.transition={};try{e()}finally{Zx.transition=t}};St.unstable_act=s6;St.useCallback=function(e,t){return pa.current.useCallback(e,t)};St.useContext=function(e){return pa.current.useContext(e)};St.useDebugValue=function(){};St.useDeferredValue=function(e){return pa.current.useDeferredValue(e)};St.useEffect=function(e,t){return pa.current.useEffect(e,t)};St.useId=function(){return pa.current.useId()};St.useImperativeHandle=function(e,t,n){return pa.current.useImperativeHandle(e,t,n)};St.useInsertionEffect=function(e,t){return pa.current.useInsertionEffect(e,t)};St.useLayoutEffect=function(e,t){return pa.current.useLayoutEffect(e,t)};St.useMemo=function(e,t){return pa.current.useMemo(e,t)};St.useReducer=function(e,t,n){return pa.current.useReducer(e,t,n)};St.useRef=function(e){return pa.current.useRef(e)};St.useState=function(e){return pa.current.useState(e)};St.useSyncExternalStore=function(e,t,n){return pa.current.useSyncExternalStore(e,t,n)};St.useTransition=function(){return pa.current.useTransition()};St.version="18.3.1";QF.exports=St;var x=QF.exports;const L=$t(x),QA=BZ({__proto__:null,default:L},[x]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its 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 nee=x,ree=Symbol.for("react.element"),aee=Symbol.for("react.fragment"),see=Object.prototype.hasOwnProperty,iee=nee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,oee={key:!0,ref:!0,__self:!0,__source:!0};function i6(e,t,n){var r,a={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)see.call(t,r)&&!oee.hasOwnProperty(r)&&(a[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)a[r]===void 0&&(a[r]=t[r]);return{$$typeof:ree,type:e,key:i,ref:o,props:a,_owner:iee.current}}oj.Fragment=aee;oj.jsx=i6;oj.jsxs=i6;XF.exports=oj;var s=XF.exports,o6={exports:{}},us={},l6={exports:{}},c6={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its 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 */(function(e){function t(R,O){var F=R.length;R.push(O);e:for(;0<F;){var z=F-1>>>1,B=R[z];if(0<a(B,O))R[z]=O,R[F]=B,F=z;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var O=R[0],F=R.pop();if(F!==O){R[0]=F;e:for(var z=0,B=R.length,H=B>>>1;z<H;){var Y=2*(z+1)-1,ee=R[Y],V=Y+1,K=R[V];if(0>a(ee,F))V<B&&0>a(K,ee)?(R[z]=K,R[V]=F,z=V):(R[z]=ee,R[Y]=F,z=Y);else if(V<B&&0>a(K,F))R[z]=K,R[V]=F,z=V;else break e}}return O}function a(R,O){var F=R.sortIndex-O.sortIndex;return F!==0?F:R.id-O.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,p=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(R){for(var O=n(u);O!==null;){if(O.callback===null)r(u);else if(O.startTime<=R)r(u),O.sortIndex=O.expirationTime,t(c,O);else break;O=n(u)}}function j(R){if(g=!1,b(R),!p)if(n(c)!==null)p=!0,M(N);else{var O=n(u);O!==null&&$(j,O.startTime-R)}}function N(R,O){p=!1,g&&(g=!1,v(_),_=-1),m=!0;var F=h;try{for(b(O),f=n(c);f!==null&&(!(f.expirationTime>O)||R&&!P());){var z=f.callback;if(typeof z=="function"){f.callback=null,h=f.priorityLevel;var B=z(f.expirationTime<=O);O=e.unstable_now(),typeof B=="function"?f.callback=B:f===n(c)&&r(c),b(O)}else r(c);f=n(c)}if(f!==null)var H=!0;else{var Y=n(u);Y!==null&&$(j,Y.startTime-O),H=!1}return H}finally{f=null,h=F,m=!1}}var S=!1,C=null,_=-1,E=5,T=-1;function P(){return!(e.unstable_now()-T<E)}function k(){if(C!==null){var R=e.unstable_now();T=R;var O=!0;try{O=C(!0,R)}finally{O?D():(S=!1,C=null)}}else S=!1}var D;if(typeof w=="function")D=function(){w(k)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,I=A.port2;A.port1.onmessage=k,D=function(){I.postMessage(null)}}else D=function(){y(k,0)};function M(R){C=R,S||(S=!0,D())}function $(R,O){_=y(function(){R(e.unstable_now())},O)}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(R){R.callback=null},e.unstable_continueExecution=function(){p||m||(p=!0,M(N))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var O=3;break;default:O=h}var F=h;h=O;try{return R()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,O){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var F=h;h=R;try{return O()}finally{h=F}},e.unstable_scheduleCallback=function(R,O,F){var z=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?z+F:z):F=z,R){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=F+B,R={id:d++,callback:O,priorityLevel:R,startTime:F,expirationTime:B,sortIndex:-1},F>z?(R.sortIndex=F,t(u,R),n(c)===null&&R===n(u)&&(g?(v(_),_=-1):g=!0,$(j,F-z))):(R.sortIndex=B,t(c,R),p||m||(p=!0,M(N))),R},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(R){var O=h;return function(){var F=h;h=O;try{return R.apply(this,arguments)}finally{h=F}}}})(c6);l6.exports=c6;var lee=l6.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its 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 cee=x,is=lee;function Ae(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var u6=new Set,pg={};function Ed(e,t){sh(e,t),sh(e+"Capture",t)}function sh(e,t){for(pg[e]=t,e=0;e<t.length;e++)u6.add(t[e])}var Yo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),LC=Object.prototype.hasOwnProperty,uee=/^[: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]*$/,OM={},TM={};function dee(e){return LC.call(TM,e)?!0:LC.call(OM,e)?!1:uee.test(e)?TM[e]=!0:(OM[e]=!0,!1)}function fee(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function hee(e,t,n,r){if(t===null||typeof t>"u"||fee(e,t,n,r))return!0;
vendor: 5,203 bytes, lines 33-34
33if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ga(e,t,n,r,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Mr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Mr[e]=new ga(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Mr[t]=new ga(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Mr[e]=new ga(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Mr[e]=new ga(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Mr[e]=new ga(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Mr[e]=new ga(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Mr[e]=new ga(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Mr[e]=new ga(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Mr[e]=new ga(e,5,!1,e.toLowerCase(),null,!1,!1)});var JA=/[\-:]([a-z])/g;function ZA(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(JA,ZA);Mr[t]=new ga(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(JA,ZA);Mr[t]=new ga(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(JA,ZA);Mr[t]=new ga(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Mr[e]=new ga(e,1,!1,e.toLowerCase(),null,!1,!1)});Mr.xlinkHref=new ga("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Mr[e]=new ga(e,1,!1,e.toLowerCase(),null,!0,!0)});function eP(e,t,n,r){var a=Mr.hasOwnProperty(t)?Mr[t]:null;(a!==null?a.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(hee(t,n,a,r)&&(n=null),r||a===null?dee(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):a.mustUseProperty?e[a.propertyName]=n===null?a.type===3?!1:"":n:(t=a.attributeName,r=a.attributeNamespace,n===null?e.removeAttribute(t):(a=a.type,n=a===3||a===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var xl=cee.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Zv=Symbol.for("react.element"),of=Symbol.for("react.portal"),lf=Symbol.for("react.fragment"),tP=Symbol.for("react.strict_mode"),FC=Symbol.for("react.profiler"),d6=Symbol.for("react.provider"),f6=Symbol.for("react.context"),nP=Symbol.for("react.forward_ref"),BC=Symbol.for("react.suspense"),zC=Symbol.for("react.suspense_list"),rP=Symbol.for("react.memo"),Kl=Symbol.for("react.lazy"),h6=Symbol.for("react.offscreen"),MM=Symbol.iterator;function Xm(e){return e===null||typeof e!="object"?null:(e=MM&&e[MM]||e["@@iterator"],typeof e=="function"?e:null)}var An=Object.assign,FN;function Sp(e){if(FN===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);FN=t&&t[1]||""}return`
34`+FN+e}var BN=!1;function zN(e,t){if(!e||BN)return"";BN=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}
vendor: 4,301 bytes, lines 34-37
34catch(u){if(u&&r&&typeof u.stack=="string"){for(var a=u.stack.split(`
35`),i=r.stack.split(`
36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=`
37`+a[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{BN=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sp(e):""}function mee(e){switch(e.tag){case 5:return Sp(e.type);case 16:return Sp("Lazy");case 13:return Sp("Suspense");case 19:return Sp("SuspenseList");case 0:case 2:case 15:return e=zN(e.type,!1),e;case 11:return e=zN(e.type.render,!1),e;case 1:return e=zN(e.type,!0),e;default:return""}}function UC(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case lf:return"Fragment";case of:return"Portal";case FC:return"Profiler";case tP:return"StrictMode";case BC:return"Suspense";case zC:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f6:return(e.displayName||"Context")+".Consumer";case d6:return(e._context.displayName||"Context")+".Provider";case nP:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case rP:return t=e.displayName||null,t!==null?t:UC(e.type)||"Memo";case Kl:t=e._payload,e=e._init;try{return UC(e(t))}catch{}}return null}function pee(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return UC(t);case 8:return t===tP?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Tc(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function m6(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gee(e){var t=m6(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ex(e){e._valueTracker||(e._valueTracker=gee(e))}function p6(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=m6(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Tb(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function VC(e,t){var n=t.checked;return An({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function RM(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Tc(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function g6(e,t){t=t.checked,t!=null&&eP(e,"checked",t,!1)}function WC(e,t){g6(e,t);var n=Tc(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?qC(e,t.type,n):t.hasOwnProperty("defaultValue")&&qC(e,t.type,Tc(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}
vendor: 4,191 bytes, line 37
37function DM(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function qC(e,t,n){(t!=="number"||Tb(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cp=Array.isArray;function Af(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Tc(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function HC(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(Ae(91));return An({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function $M(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(Ae(92));if(Cp(n)){if(1<n.length)throw Error(Ae(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Tc(n)}}function y6(e,t){var n=Tc(t.value),r=Tc(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function IM(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function v6(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function KC(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?v6(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var tx,x6=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(tx=tx||document.createElement("div"),tx.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=tx.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gg(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bp={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},yee=["Webkit","ms","Moz","O"];Object.keys(Bp).forEach(function(e){yee.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bp[t]=Bp[e]})});function b6(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bp.hasOwnProperty(e)&&Bp[e]?(""+t).trim():t+"px"}function w6(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=b6(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var vee=An({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function GC(e,t){if(t){if(vee[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Ae(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Ae(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Ae(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Ae(62))}}function YC(e,t){if(e.indexOf("-")===-1)return typeof t.is=="str
37ing";switch(e){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 XC=null;function aP(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var QC=null,Pf=null,kf=null;function LM(e){if(e=Jy(e)){if(typeof QC!="function")throw Error(Ae(280));var t=e.stateNode;t&&(t=fj(t),QC(e.stateNode,e.type,t))}}function j6(e){Pf?kf?kf.push(e):kf=[e]:Pf=e}function N6(){if(Pf){var e=Pf,t=kf;if(kf=Pf=null,LM(e),t)for(e=0;e<t.length;e++)LM(t[e])}}function S6(e,t){return e(t)}function C6(){}var UN=!1;function _6(e,t,n){if(UN)return e(t,n);UN=!0;try{return S6(e,t,n)}finally{UN=!1,(Pf!==null||kf!==null)&&(C6(),N6())}}function yg(e,t){var n=e.stateNode;if(n===null)return null;var r=fj(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(Ae(231,t,typeof n));return n}var JC=!1;if(Yo)try{var Qm={};Object.defineProperty(Qm,"passive",{get:function(){JC=!0}}),window.addEventListener("test",Qm,Qm),window.removeEventListener("test",Qm,Qm)}catch{JC=!1}function xee(e,t,n,r,a,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var zp=!1,Mb=null,Rb=!1,ZC=null,bee={onError:function(e){zp=!0,Mb=e}};function wee(e,t,n,r,a,i,o,l,c){zp=!1,Mb=null,xee.apply(bee,arguments)}function jee(e,t,n,r,a,i,o,l,c){if(wee.apply(this,arguments),zp){if(zp){var u=Mb;zp=!1,Mb=null}else throw Error(Ae(198));Rb||(Rb=!0,ZC=u)}}function Ad(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function E6(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function FM(e){if(Ad(e)!==e)throw Error(Ae(188))}function Nee(e){var t=e.alternate;if(!t){if(t=Ad(e),t===null)throw Error(Ae(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var i=a.alternate;if(i===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===n)return FM(a),e;if(i===r)return FM(a),t;i=i.sibling}throw Error(Ae(188))}if(n.return!==r.return)n=a,r=i;else{for(var o=!1,l=a.child;l;){if(l===n){o=!0,n=a,r=i;break}if(l===r){o=!0,r=a,n=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===n){o=!0,n=i,r=a;break}if(l===r){o=!0,r=i,n=a;break}l=l.sibling}if(!o)throw Error(Ae(189))}}if(n.alternate!==r)throw Error(Ae(190))}if(n.tag!==3)throw Error(Ae(188));return n.stateNode.current===n?e:t}function A6(e){return e=Nee(e),e!==null?P6(e):null}function P6(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=P6(e);if(t!==null)return t;e=e.sibling}return null}var k6=is.unstable_scheduleCallback,BM=is.unstable_cancelCallback,See=is.unstable_shouldYield,Cee=is.unstable_requestPaint,Un=is.unstable_now,_ee=is.unstable_getCurrentPriorityLevel,sP=is.unstable_ImmediatePriority,O6=is.unstable_UserBlockingPriority,Db=is.unstable_NormalPriority,Eee=is.unstable_LowPriority,T6=is.unstable_IdlePriority,lj=null,Gi=null;function Aee(e){if(Gi&&typeof Gi.onCommitFiberRoot=="function")try{Gi.onCommitFiberRoot(lj,e,void 0,(e.current.flags&128)===128)}catch{}}var ni=Math.clz32?Math.clz32:Oee,Pee=Math.log,kee=Math.LN2;function Oee(e){return e>>>=0,e===0?32:31-(Pee(e)/kee|0)|0}var nx=64,rx=4194304;function _p(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function $b(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~a;l!==0?r=_p(l):(i&=o,i!==0&&(r=_p(i)))}else o=n&~a,o!==0?r=_p(o):i!==0&&(r=_p(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ni(t),a=1<<n,r|=e[n],t&=~a;return r}function Tee(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Mee(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-ni(i),l=1<<o,c=a[o];c===-1?(!(l&n)||l&r)&&(a[o]=Tee(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function e_(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function M6(){var e=nx;return nx<<=1,!(nx&4194240)&&(nx=64),e}function VN(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Xy(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ni(t),e[t]=n}function Ree(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-ni(n),i=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~i}}function iP(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ni(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var Kt=0;function R6(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var D6,oP,$6,I6,L6,t_=!1,ax=[],vc=null,xc=null,bc=null,vg=new Map,xg=new Map,Ql=[],Dee="mou
37sedown 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 submit".split(" ");function zM(e,t){switch(e){case"focusin":case"focusout":vc=null;break;case"dragenter":case"dragleave":xc=null;break;case"mouseover":case"mouseout":bc=null;break;case"pointerover":case"pointerout":vg.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":xg.delete(t.pointerId)}}function Jm(e,t,n,r,a,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[a]},t!==null&&(t=Jy(t),t!==null&&oP(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function $ee(e,t,n,r,a){switch(t){case"focusin":return vc=Jm(vc,e,t,n,r,a),!0;case"dragenter":return xc=Jm(xc,e,t,n,r,a),!0;case"mouseover":return bc=Jm(bc,e,t,n,r,a),!0;case"pointerover":var i=a.pointerId;return vg.set(i,Jm(vg.get(i)||null,e,t,n,r,a)),!0;case"gotpointercapture":return i=a.pointerId,xg.set(i,Jm(xg.get(i)||null,e,t,n,r,a)),!0}return!1}function F6(e){var t=ju(e.target);if(t!==null){var n=Ad(t);if(n!==null){if(t=n.tag,t===13){if(t=E6(n),t!==null){e.blockedOn=t,L6(e.priority,function(){$6(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function eb(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=n_(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);XC=r,n.target.dispatchEvent(r),XC=null}else return t=Jy(n),t!==null&&oP(t),e.blockedOn=n,!1;t.shift()}return!0}function UM(e,t,n){eb(e)&&n.delete(t)}function Iee(){t_=!1,vc!==null&&eb(vc)&&(vc=null),xc!==null&&eb(xc)&&(xc=null),bc!==null&&eb(bc)&&(bc=null),vg.forEach(UM),xg.forEach(UM)}function Zm(e,t){e.blockedOn===t&&(e.blockedOn=null,t_||(t_=!0,is.unstable_scheduleCallback(is.unstable_NormalPriority,Iee)))}function bg(e){function t(a){return Zm(a,e)}if(0<ax.length){Zm(ax[0],e);for(var n=1;n<ax.length;n++){var r=ax[n];r.blockedOn===e&&(r.blockedOn=null)}}for(vc!==null&&Zm(vc,e),xc!==null&&Zm(xc,e),bc!==null&&Zm(bc,e),vg.forEach(t),xg.forEach(t),n=0;n<Ql.length;n++)r=Ql[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Ql.length&&(n=Ql[0],n.blockedOn===null);)F6(n),n.blockedOn===null&&Ql.shift()}var Of=xl.ReactCurrentBatchConfig,Ib=!0;function Lee(e,t,n,r){var a=Kt,i=Of.transition;Of.transition=null;try{Kt=1,lP(e,t,n,r)}finally{Kt=a,Of.transition=i}}function Fee(e,t,n,r){var a=Kt,i=Of.transition;Of.transition=null;try{Kt=4,lP(e,t,n,r)}finally{Kt=a,Of.transition=i}}function lP(e,t,n,r){if(Ib){var a=n_(e,t,n,r);if(a===null)ZN(e,t,r,Lb,n),zM(e,r);else if($ee(a,e,t,n,r))r.stopPropagation();else if(zM(e,r),t&4&&-1<Dee.indexOf(e)){for(;a!==null;){var i=Jy(a);if(i!==null&&D6(i),i=n_(e,t,n,r),i===null&&ZN(e,t,r,Lb,n),i===a)break;a=i}a!==null&&r.stopPropagation()}else ZN(e,t,r,null,n)}}var Lb=null;function n_(e,t,n,r){if(Lb=null,e=aP(r),e=ju(e),e!==null)if(t=Ad(e),t===null)e=null;else if(n=t.tag,n===13){if(e=E6(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Lb=e,null}function B6(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(_ee()){case sP:return 1;case O6:return 4;case Db:case Eee:return 16;case T6:return 536870912;default:return 16}default:return 16}}var dc=null,cP=null,tb=null;function z6(){if(tb)return tb;
vendor: 9,128 bytes, line 37
37var e,t=cP,n=t.length,r,a="value"in dc?dc.value:dc.textContent,i=a.length;for(e=0;e<n&&t[e]===a[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===a[i-r];r++);return tb=a.slice(e,1<r?1-r:void 0)}function nb(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function sx(){return!0}function VM(){return!1}function ds(e){function t(n,r,a,i,o){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?sx:VM,this.isPropagationStopped=VM,this}return An(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=sx)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=sx)},persist:function(){},isPersistent:sx}),t}var fm={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},uP=ds(fm),Qy=An({},fm,{view:0,detail:0}),Bee=ds(Qy),WN,qN,ep,cj=An({},Qy,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dP,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ep&&(ep&&e.type==="mousemove"?(WN=e.screenX-ep.screenX,qN=e.screenY-ep.screenY):qN=WN=0,ep=e),WN)},movementY:function(e){return"movementY"in e?e.movementY:qN}}),WM=ds(cj),zee=An({},cj,{dataTransfer:0}),Uee=ds(zee),Vee=An({},Qy,{relatedTarget:0}),HN=ds(Vee),Wee=An({},fm,{animationName:0,elapsedTime:0,pseudoElement:0}),qee=ds(Wee),Hee=An({},fm,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kee=ds(Hee),Gee=An({},fm,{data:0}),qM=ds(Gee),Yee={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xee={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"},Qee={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jee(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qee[e])?!!t[e]:!1}function dP(){return Jee}var Zee=An({},Qy,{key:function(e){if(e.key){var t=Yee[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=nb(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Xee[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dP,charCode:function(e){return e.type==="keypress"?nb(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?nb(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ete=ds(Zee),tte=An({},cj,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),HM=ds(tte),nte=An({},Qy,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dP}),rte=ds(nte),ate=An({},fm,{propertyName:0,elapsedTime:0,pseudoElement:0}),ste=ds(ate),ite=An({},cj,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ote=ds(ite),lte=[9,13,27,32],fP=Yo&&"CompositionEvent"in window,Up=null;Yo&&"documentMode"in document&&(Up=document.documentMode);var cte=Yo&&"TextEvent"in window&&!Up,U6=Yo&&(!fP||Up&&8<Up&&11>=Up),KM=" ",GM=!1;function V6(e,t){switch(e){case"keyup":return lte.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function W6(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var cf=!1;function ute(e,t){switch(e){case"compositionend":return W6(t);case"keypress":return t.which!==32?null:(GM=!0,KM);case"textInput":return e=t.data,e===KM&&GM?null:e;default:return null}}function dte(e,t){if(cf)return e==="compositionend"||!fP&&V6(e,t)?(e=z6(),tb=cP=dc=null,cf=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return U6&&t.locale!=="ko"?null:t.data;default:return null}}var fte={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 YM(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!fte[e.type]:t==="textarea"}function q6(e,t,n,r){j6(r),t=Fb(t,"onChange"),0<t.length&&(n=new uP("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Vp=null,wg=null;function hte(e){n8(e,0)}function uj(e){var t=ff(e);if(p6(t))return e}function mte(e,t){if(e==="change")return t}var H6=!1;if(Yo){var KN;if(Yo){var GN="oninput"in document;if(!GN){var XM=document.createElement("div");XM.setAttribute("oninput","return;"),GN=typeof XM.oninput=="function"}KN=GN}else KN=!1;H6=KN&&(!document.documentMode||9<document.documentMode)}function QM(){Vp&&(Vp.detachEvent("onpropertychange",K6),wg=Vp=null)}function K6(e){if(e.propertyName==="value"&&uj(wg)){var t=[];q6(t,wg,e,aP(e)),_6(hte,t)}}function pte(e,t,n){e==="focusin"?(QM(),Vp=t,wg=n,Vp.attachEvent("onpropertychange",K6)):e==="focusout"&&QM()}function gte(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return uj(wg)}function yte(e,t){if(e==="click")return uj(t)}function vte(e,t){if(e==="input"||e==="change")return uj(t)}function xte(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var li=typeof Object.is=="function"?Object.is:xte;function jg(e,t){if(li(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!LC.call(t,a)||!li(e[a],t[a]))return!1}return!0}function JM(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ZM(e,t){var n=JM(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=JM(n)}}function G6(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?G6(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Y6(){for(var e=window,t=Tb();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tb(e.document)}return t}function hP(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function bte(e){var t=Y6(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&G6(n.ownerDocument.documentElement,n)){if(r!==null&&hP(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!e.extend&&i>r&&(a=r,r=i,i=a),a=ZM(n,i);var o=ZM(n,r);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var wte=Yo&&"documentMode"in document&&11>=document.documentMode,uf=null,r_=null,Wp=null,a_=!1;function eR(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;a_||uf==null||uf!==Tb(r)||(r=uf,"selectionStart"in r&&hP(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focu
vendor: 4,510 bytes, line 37
37sNode:r.focusNode,focusOffset:r.focusOffset}),Wp&&jg(Wp,r)||(Wp=r,r=Fb(r_,"onSelect"),0<r.length&&(t=new uP("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=uf)))}function ix(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var df={animationend:ix("Animation","AnimationEnd"),animationiteration:ix("Animation","AnimationIteration"),animationstart:ix("Animation","AnimationStart"),transitionend:ix("Transition","TransitionEnd")},YN={},X6={};Yo&&(X6=document.createElement("div").style,"AnimationEvent"in window||(delete df.animationend.animation,delete df.animationiteration.animation,delete df.animationstart.animation),"TransitionEvent"in window||delete df.transitionend.transition);function dj(e){if(YN[e])return YN[e];if(!df[e])return e;var t=df[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in X6)return YN[e]=t[n];return e}var Q6=dj("animationend"),J6=dj("animationiteration"),Z6=dj("animationstart"),e8=dj("transitionend"),t8=new Map,tR="abort auxClick 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(" ");function Fc(e,t){t8.set(e,t),Ed(t,[e])}for(var XN=0;XN<tR.length;XN++){var QN=tR[XN],jte=QN.toLowerCase(),Nte=QN[0].toUpperCase()+QN.slice(1);Fc(jte,"on"+Nte)}Fc(Q6,"onAnimationEnd");Fc(J6,"onAnimationIteration");Fc(Z6,"onAnimationStart");Fc("dblclick","onDoubleClick");Fc("focusin","onFocus");Fc("focusout","onBlur");Fc(e8,"onTransitionEnd");sh("onMouseEnter",["mouseout","mouseover"]);sh("onMouseLeave",["mouseout","mouseover"]);sh("onPointerEnter",["pointerout","pointerover"]);sh("onPointerLeave",["pointerout","pointerover"]);Ed("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ed("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ed("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ed("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ed("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ed("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ep="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(" "),Ste=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ep));function nR(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,jee(r,t,void 0,e),e.currentTarget=null}function n8(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var l=r[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;nR(a,l,u),i=c}else for(o=0;o<r.length;o++){if(l=r[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;nR(a,l,u),i=c}}}if(Rb)throw e=ZC,Rb=!1,ZC=null,e}function fn(e,t){var n=t[c_];n===void 0&&(n=t[c_]=new Set);var r=e+"__bubble";n.has(r)||(r8(t,e,2,!1),n.add(r))}function JN(e,t,n){var r=0;t&&(r|=4),r8(n,e,r,t)}var ox="_reactListening"+Math.random().toString(36).slice(2);function Ng(e){if(!e[ox]){e[ox]=!0,u6.forEach(function(n){n!=="selectionchange"&&(Ste.has(n)||JN(n,!1,e),JN(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ox]||(t[ox]=!0,JN("selectionchange",!1,t))}}function r8(e,t,n,r){switch(B6(t)){case 1:var a=Lee;break;case 4:a=Fee;break;default:a=lP}n=a.bind(null,t,n,e),a=void 0,!JC||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function ZN(e,t,n,r,a){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var l=r.stateNode.containerInfo;
vendor: 2,535 bytes, line 37
37if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=ju(l),o===null)return;if(c=o.tag,c===5||c===6){r=i=o;continue e}l=l.parentNode}}r=r.return}_6(function(){var u=i,d=aP(n),f=[];e:{var h=t8.get(e);if(h!==void 0){var m=uP,p=e;switch(e){case"keypress":if(nb(n)===0)break e;case"keydown":case"keyup":m=ete;break;case"focusin":p="focus",m=HN;break;case"focusout":p="blur",m=HN;break;case"beforeblur":case"afterblur":m=HN;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=WM;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Uee;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=rte;break;case Q6:case J6:case Z6:m=qee;break;case e8:m=ste;break;case"scroll":m=Bee;break;case"wheel":m=ote;break;case"copy":case"cut":case"paste":m=Kee;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=HM}var g=(t&4)!==0,y=!g&&e==="scroll",v=g?h!==null?h+"Capture":null:h;g=[];for(var w=u,b;w!==null;){b=w;var j=b.stateNode;if(b.tag===5&&j!==null&&(b=j,v!==null&&(j=yg(w,v),j!=null&&g.push(Sg(w,j,b)))),y)break;w=w.return}0<g.length&&(h=new m(h,p,null,n,d),f.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==XC&&(p=n.relatedTarget||n.fromElement)&&(ju(p)||p[Xo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(p=n.relatedTarget||n.toElement,m=u,p=p?ju(p):null,p!==null&&(y=Ad(p),p!==y||p.tag!==5&&p.tag!==6)&&(p=null)):(m=null,p=u),m!==p)){if(g=WM,j="onMouseLeave",v="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(g=HM,j="onPointerLeave",v="onPointerEnter",w="pointer"),y=m==null?h:ff(m),b=p==null?h:ff(p),h=new g(j,w+"leave",m,n,d),h.target=y,h.relatedTarget=b,j=null,ju(d)===u&&(g=new g(v,w+"enter",p,n,d),g.target=b,g.relatedTarget=y,j=g),y=j,m&&p)t:{for(g=m,v=p,w=0,b=g;b;b=Vd(b))w++;for(b=0,j=v;j;j=Vd(j))b++;for(;0<w-b;)g=Vd(g),w--;for(;0<b-w;)v=Vd(v),b--;for(;w--;){if(g===v||v!==null&&g===v.alternate)break t;g=Vd(g),v=Vd(v)}g=null}else g=null;m!==null&&rR(f,h,m,g,!1),p!==null&&y!==null&&rR(f,y,p,g,!0)}}
vendor: 4,595 bytes, lines 37-38
37e:{if(h=u?ff(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var N=mte;else if(YM(h))if(H6)N=vte;else{N=gte;var S=pte}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(N=yte);if(N&&(N=N(e,u))){q6(f,N,n,d);break e}S&&S(e,h,u),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&qC(h,"number",h.value)}switch(S=u?ff(u):window,e){case"focusin":(YM(S)||S.contentEditable==="true")&&(uf=S,r_=u,Wp=null);break;case"focusout":Wp=r_=uf=null;break;case"mousedown":a_=!0;break;case"contextmenu":case"mouseup":case"dragend":a_=!1,eR(f,n,d);break;case"selectionchange":if(wte)break;case"keydown":case"keyup":eR(f,n,d)}var C;if(fP)e:{switch(e){case"compositionstart":var _="onCompositionStart";break e;case"compositionend":_="onCompositionEnd";break e;case"compositionupdate":_="onCompositionUpdate";break e}_=void 0}else cf?V6(e,n)&&(_="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(_="onCompositionStart");_&&(U6&&n.locale!=="ko"&&(cf||_!=="onCompositionStart"?_==="onCompositionEnd"&&cf&&(C=z6()):(dc=d,cP="value"in dc?dc.value:dc.textContent,cf=!0)),S=Fb(u,_),0<S.length&&(_=new qM(_,e,null,n,d),f.push({event:_,listeners:S}),C?_.data=C:(C=W6(n),C!==null&&(_.data=C)))),(C=cte?ute(e,n):dte(e,n))&&(u=Fb(u,"onBeforeInput"),0<u.length&&(d=new qM("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=C))}n8(f,t)})}function Sg(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Fb(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=yg(e,n),i!=null&&r.unshift(Sg(e,i,a)),i=yg(e,t),i!=null&&r.push(Sg(e,i,a))),e=e.return}return r}function Vd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function rR(e,t,n,r,a){for(var i=t._reactName,o=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,a?(c=yg(n,i),c!=null&&o.unshift(Sg(n,c,l))):a||(c=yg(n,i),c!=null&&o.push(Sg(n,c,l)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Cte=/\r\n?/g,_te=/\u0000|\uFFFD/g;function aR(e){return(typeof e=="string"?e:""+e).replace(Cte,`
38`).replace(_te,"")}function lx(e,t,n){if(t=aR(t),aR(e)!==t&&n)throw Error(Ae(425))}function Bb(){}var s_=null,i_=null;function o_(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var l_=typeof setTimeout=="function"?setTimeout:void 0,Ete=typeof clearTimeout=="function"?clearTimeout:void 0,sR=typeof Promise=="function"?Promise:void 0,Ate=typeof queueMicrotask=="function"?queueMicrotask:typeof sR<"u"?function(e){return sR.resolve(null).then(e).catch(Pte)}:l_;function Pte(e){setTimeout(function(){throw e})}function eS(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),bg(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);bg(t)}function wc(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function iR(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var hm=Math.random().toString(36).slice(2),Fi="__reactFiber$"+hm,Cg="__reactProps$"+hm,Xo="__reactContainer$"+hm,c_="__reactEvents$"+hm,kte="__reactListeners$"+hm,Ote="__reactHandles$"+hm;function ju(e){var t=e[Fi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Xo]||n[Fi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=iR(e);e!==null;){if(n=e[Fi])return n;e=iR(e)}return t}e=n,n=e.parentNode}return null}function Jy(e){return e=e[Fi]||e[Xo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ff(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(Ae(33))}function fj(e){return e[Cg]||null}var u_=[],hf=-1;function Bc(e){return{current:e}}function gn(e){0>hf||(e.current=u_[hf],u_[hf]=null,hf--)}function ln(e,t){hf++,u_[hf]=e.current,e.current=t}var Mc={},Qr=Bc(Mc),Ra=Bc(!1),Qu=Mc;function ih(e,t){var n=e.type.contextTypes;if(!n)return Mc;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a
vendor: 28,335 bytes, lines 38-40
38),a}function Da(e){return e=e.childContextTypes,e!=null}function zb(){gn(Ra),gn(Qr)}function oR(e,t,n){if(Qr.current!==Mc)throw Error(Ae(168));ln(Qr,t),ln(Ra,n)}function a8(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(Ae(108,pee(e)||"Unknown",a));return An({},n,r)}function Ub(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mc,Qu=Qr.current,ln(Qr,e),ln(Ra,Ra.current),!0}function lR(e,t,n){var r=e.stateNode;if(!r)throw Error(Ae(169));n?(e=a8(e,t,Qu),r.__reactInternalMemoizedMergedChildContext=e,gn(Ra),gn(Qr),ln(Qr,e)):gn(Ra),ln(Ra,n)}var Ao=null,hj=!1,tS=!1;function s8(e){Ao===null?Ao=[e]:Ao.push(e)}function Tte(e){hj=!0,s8(e)}function zc(){if(!tS&&Ao!==null){tS=!0;var e=0,t=Kt;try{var n=Ao;for(Kt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ao=null,hj=!1}catch(a){throw Ao!==null&&(Ao=Ao.slice(e+1)),k6(sP,zc),a}finally{Kt=t,tS=!1}}return null}var mf=[],pf=0,Vb=null,Wb=0,ws=[],js=0,Ju=null,Mo=1,Ro="";function fu(e,t){mf[pf++]=Wb,mf[pf++]=Vb,Vb=e,Wb=t}function i8(e,t,n){ws[js++]=Mo,ws[js++]=Ro,ws[js++]=Ju,Ju=e;var r=Mo;e=Ro;var a=32-ni(r)-1;r&=~(1<<a),n+=1;var i=32-ni(t)+a;if(30<i){var o=a-a%5;i=(r&(1<<o)-1).toString(32),r>>=o,a-=o,Mo=1<<32-ni(t)+a|n<<a|r,Ro=i+e}else Mo=1<<i|n<<a|r,Ro=e}function mP(e){e.return!==null&&(fu(e,1),i8(e,1,0))}function pP(e){for(;e===Vb;)Vb=mf[--pf],mf[pf]=null,Wb=mf[--pf],mf[pf]=null;for(;e===Ju;)Ju=ws[--js],ws[js]=null,Ro=ws[--js],ws[js]=null,Mo=ws[--js],ws[js]=null}var as=null,rs=null,wn=!1,Ys=null;function o8(e,t){var n=Ss(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function cR(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,as=e,rs=wc(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,as=e,rs=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Ju!==null?{id:Mo,overflow:Ro}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ss(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,as=e,rs=null,!0):!1;default:return!1}}function d_(e){return(e.mode&1)!==0&&(e.flags&128)===0}function f_(e){if(wn){var t=rs;if(t){var n=t;if(!cR(e,t)){if(d_(e))throw Error(Ae(418));t=wc(n.nextSibling);var r=as;t&&cR(e,t)?o8(r,n):(e.flags=e.flags&-4097|2,wn=!1,as=e)}}else{if(d_(e))throw Error(Ae(418));e.flags=e.flags&-4097|2,wn=!1,as=e}}}function uR(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;as=e}function cx(e){if(e!==as)return!1;if(!wn)return uR(e),wn=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!o_(e.type,e.memoizedProps)),t&&(t=rs)){if(d_(e))throw l8(),Error(Ae(418));for(;t;)o8(e,t),t=wc(t.nextSibling)}if(uR(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(Ae(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){rs=wc(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}rs=null}}else rs=as?wc(e.stateNode.nextSibling):null;return!0}function l8(){for(var e=rs;e;)e=wc(e.nextSibling)}function oh(){rs=as=null,wn=!1}function gP(e){Ys===null?Ys=[e]:Ys.push(e)}var Mte=xl.ReactCurrentBatchConfig;function tp(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(Ae(309));var r=n.stateNode}if(!r)throw Error(Ae(147,e));var a=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(Ae(284));if(!n._owner)throw Error(Ae(290,e))}return e}function ux(e,t){throw e=Object.prototype.toString.call(t),Error(Ae(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function dR(e){var t=e._init;return t(e._payload)}function c8(e){function t(v,w){if(e){var b=v.deletions;b===null?(v.deletions=[w],v.flags|=16):b.push(w)}}function n(v,w){if(!e)return null;for(;w!==null;)t(v,w),w=w.sibling;return null}function r(v,w){for(v=new Map;w!==null;)w.key!==null?v.set(w.key,w):v.set(w.index,w),w=w.sibling;return v}function a(v,w){return v=Cc(v,w),v.index=0,v.sibling=null,v}function i(v,w,b){return v.index=b,e?(b=v.alternate,b!==null?(b=b.index,b<w?(v.flags|=2,w):b):(v.flags|=2,w)):(v.flags|=1048576,w)}function o(v){return e&&v.alternate===null&&(v.flags|=2),v}function l(v,w,b,j){return w===null||w.tag!==6?(w=lS(b,v.mode,j),w.return=v,w):(w=a(w,b),w.return=v,w)}function c(v,w,b,j){var N=b.type;return N===lf?d(v,w,b.props.children,j,b.key):w!==null&&(w.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Kl&&dR(N)===w.type)?(j=a(w,b.props),j.ref=tp(v,w,b),j.return=v,j):(j=cb(b.type,b.key,b.props,null,v.mode,j),j.ref=tp(v,w,b),j.return=v,j)}function u(v,w,b,j){return w===null||w.tag!==4||w.stateNode.containerInfo!==b.containerInfo||w.stateNode.implementation!==b.implementation?(w=cS(b,v.mode,j),w.return=v,w):(w=a(w,b.children||[]),w.return=v,w)}function d(v,w,b,j,N){return w===null||w.tag!==7?(w=Uu(b,v.mode,j,N),w.return=v,w):(w=a(w,b),w.return=v,w)}function f(v,w,b){if(typeof w=="string"&&w!==""||typeof w=="number")return w=lS(""+w,v.mode,b),w.return=v,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Zv:return b=cb(w.type,w.key,w.props,null,v.mode,b),b.ref=tp(v,null,w),b.return=v,b;case of:return w=cS(w,v.mode,b),w.return=v,w;case Kl:var j=w._init;return f(v,j(w._payload),b)}if(Cp(w)||Xm(w))return w=Uu(w,v.mode,b,null),w.return=v,w;ux(v,w)}return null}function h(v,w,b,j){var N=w!==null?w.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return N!==null?null:l(v,w,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Zv:return b.key===N?c(v,w,b,j):null;case of:return b.key===N?u(v,w,b,j):null;case Kl:return N=b._init,h(v,w,N(b._payload),j)}if(Cp(b)||Xm(b))return N!==null?null:d(v,w,b,j,null);ux(v,b)}return null}function m(v,w,b,j,N){if(typeof j=="string"&&j!==""||typeof j=="number")return v=v.get(b)||null,l(w,v,""+j,N);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case Zv:return v=v.get(j.key===null?b:j.key)||null,c(w,v,j,N);case of:return v=v.get(j.key===null?b:j.key)||null,u(w,v,j,N);case Kl:var S=j._init;return m(v,w,b,S(j._payload),N)}if(Cp(j)||Xm(j))return v=v.get(b)||null,d(w,v,j,N,null);ux(w,j)}return null}function p(v,w,b,j){for(var N=null,S=null,C=w,_=w=0,E=null;C!==null&&_<b.length;_++){C.index>_?(E=C,C=null):E=C.sibling;var T=h(v,C,b[_],j);if(T===null){C===null&&(C=E);break}e&&C&&T.alternate===null&&t(v,C),w=i(T,w,_),S===null?N=T:S.sibling=T,S=T,C=E}if(_===b.length)return n(v,C),wn&&fu(v,_),N;if(C===null){for(;_<b.length;_++)C=f(v,b[_],j),C!==null&&(w=i(C,w,_),S===null?N=C:S.sibling=C,S=C);return wn&&fu(v,_),N}for(C=r(v,C);_<b.length;_++)E=m(C,v,_,b[_],j),E!==null&&(e&&E.alternate!==null&&C.delete(E.key===null?_:E.key),w=i(E,w,_),S===null?N=E:S.sibling=E,S=E);return e&&C.forEach(function(P){return t(v,P)}),wn&&fu(v,_),N}function g(v,w,b,j){var N=Xm(b);if(typeof N!="function")throw Error(Ae(150));if(b=N.call(b),b==null)throw Error(Ae(151));for(var S=N=null,C=w,_=w=0,E=null,T=b.next();C!==null&&!T.done;_++,T=b.next()){C.index>_?(E=C,C=null):E=C.sibling;var P=h(v,C,T.value,j);if(P===null){C===null&&(C=E);break}e&&C&&P.alternate===null&&t(v,C),w=i(P,w,_),S===null?N=P:S.sibling=P,S=P,C=E}if(T.done)return n(v,C),wn&&fu(v,_),N;if(C===null){for(;!T.done;_++,T=b.next())T=f(v,T.value,j),T!==null&&(w=i(T,w,_),S===null?N=T:S.sibling=T,S=T);return wn&&fu(v,_),N}for(C=r(v,C);!T.done;_++,T=b.next())T=m(C,v,_,T.value,j),T!==null&&(e&&T.alternate!==null&&C.delete(T.key===null?_:T.key),w=i(T,w,_),S===null?N=T:S.sibling=T,S=T);return e&&C.forEach(function(k){return t(v,k)}),wn&&fu(v,_),N}function y(v,w,b,j){if(typeof b=="object"&&b!==null&&b.type===lf&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Zv:e:{for(var N=b.key,S=w;S!==null;){if(S.key===N){if(N=b.type,N===lf){if(S.tag===7){n(v,S.sibling),w=a(S,b.props.children),w.return=v,v=w;break e}}else if(S.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Kl&&dR(N)===S.type){n(v,S.sibling),w=a(S,b.props),w.ref=tp(v,S,b),w.return=v,v=w;break e}n(v,S);break}else t(v,S);S=S.sibling}b.type===lf?(w=Uu(b.props.children,v.mode,j,b.key),w.return=v,v=w):(j=cb(b.type,b.key,b.props,null,v.mode,j),j.ref=tp(v,w,b),j.return=v,v=j)}return o(v);case of:e:{for(S=b.key;w!==null;){if(w.key===S)if(w.tag===4&&w.stateNode.containerInfo===b.containerInfo&&w.stateNode.implementation===b.implementation){n(v,w.sibling),w=a(w,b.children||[]),w.return=v,v=w;break e}else{n(v,w);break}else t(v,w);w=w.sibling}w=cS(b,v.mode,j),w.return=v,v=w}return o(v);case Kl:return S=b._init,y(v,w,S(b._payload),j)}if(Cp(b))return p(v,w,b,j);if(Xm(b))return g(v,w,b,j);ux(v,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,w!==null&&w.tag===6?(n(v,w.sibling),w=a(w,b),w.return=v,v=w):(n(v,w),w=lS(b,v.mode,j),w.return=v,v=w),o(v)):n(v,w)}return y}var lh=c8(!0),u8=c8(!1),qb=Bc(null),Hb=null,gf=null,yP=null;function vP(){yP=gf=Hb=null}function xP(e){var t=qb.current;gn(qb),e._currentValue=t}function h_(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Tf(e,t){Hb=e,yP=gf=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(ka=!0),e.firstContext=null)}function ks(e){var t=e._currentValue;if(yP!==e)if(e={context:e,memoizedValue:t,next:null},gf===null){if(Hb===null)throw Error(Ae(308));gf=e,Hb.dependencies={lanes:0,firstContext:e}}else gf=gf.next=e;return t}var Nu=null;function bP(e){Nu===null?Nu=[e]:Nu.push(e)}function d8(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,bP(t)):(n.next=a.next,a.next=n),t.interleaved=n,Qo(e,r)}function Qo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Gl=!1;function wP(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function f8(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jc(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Dt&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Qo(e,n)}return a=r.interleaved,a===null?(t.next=t,bP(r)):(t.next=a.next,a.next=t),r.interleaved=t,Qo(e,n)}function rb(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,iP(e,n)}}function fR(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?a=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?a=i=t:i=i.next=t}else a=i=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Kb(e,t,n,r){var a=e.updateQueue;Gl=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=a.baseState;o=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var p=e,g=l;switch(h=t,m=n,g.tag){case 1:if(p=g.payload,typeof p=="function"){f=p.call(m,f,h);break e}f=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,h=typeof p=="function"?p.call(m,f,h):p,h==null)break e;f=An({},f,h);break e;case 2:Gl=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=a.effects,h===null?a.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,o|=h;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;h=l,l=h.next,h.next=null,a.lastBaseUpdate=h,a.shared.pending=null}}while(!0);if(d===null&&(c=f),a.baseState=c,a.firstBaseUpdate=u,a.lastBaseUpdate=d,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);ed|=o,e.lanes=o,e.memoizedState=f}}function hR(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(Ae(191,a));a.call(r)}}}var Zy={},Yi=Bc(Zy),_g=Bc(Zy),Eg=Bc(Zy);function Su(e){if(e===Zy)throw Error(Ae(174));return e}function jP(e,t){switch(ln(Eg,t),ln(_g,e),ln(Yi,Zy),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:KC(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=KC(t,e)}gn(Yi),ln(Yi,t)}function ch(){gn(Yi),gn(_g),gn(Eg)}function h8(e){Su(Eg.current);var t=Su(Yi.current),n=KC(t,e.type);t!==n&&(ln(_g,e),ln(Yi,n))}function NP(e){_g.current===e&&(gn(Yi),gn(_g))}var _n=Bc(0);function Gb(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var nS=[];function SP(){for(var e=0;e<nS.length;e++)nS[e]._workInProgressVersionPrimary=null;nS.length=0}var ab=xl.ReactCurrentDispatcher,rS=xl.ReactCurrentBatchConfig,Zu=0,En=null,rr=null,yr=null,Yb=!1,qp=!1,Ag=0,Rte=0;function Ir(){throw Error(Ae(321))}function CP(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!li(e[n],t[n]))return!1;return!0}function _P(e,t,n,r,a,i){if(Zu=i,En=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ab.current=e===null||e.memoizedState===null?Lte:Fte,e=n(r,a),qp){i=0;do{if(qp=!1,Ag=0,25<=i)throw Error(Ae(301));i+=1,yr=rr=null,t.updateQueue=null,ab.current=Bte,e=n(r,a)}while(qp)}if(ab.current=Xb,t=rr!==null&&rr.next!==null,Zu=0,yr=rr=En=null,Yb=!1,t)throw Error(Ae(300));return e}function EP(){var e=Ag!==0;return Ag=0,e}function Ri(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return yr===null?En.memoizedState=yr=e:yr=yr.next=e,yr}function Os(){if(rr===null){var e=En.alternate;e=e!==null?e.memoizedState:null}else e=rr.next;var t=yr===null?En.memoizedState:yr.next;if(t!==null)yr=t,rr=e;else{if(e===null)throw Error(Ae(310));rr=e,e={memoizedState:rr.memoizedState,baseState:rr.baseState,baseQueue:rr.baseQueue,queue:rr.queue,next:null},yr===null?En.memoizedState=yr=e:yr=yr.next=e}return yr}function Pg(e,t){return typeof t=="function"?t(e):t}function aS(e){var t=Os(),n=t.queue;if(n===null)throw Error(Ae(311));n.lastRenderedReducer=e;var r=rr,a=r.baseQueue,i=n.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}r.baseQueue=a=i,n.pending=null}if(a!==null){i=a.next,r=r.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((Zu&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,o=r):c=c.next=f,En.lanes|=d,ed|=d}u=u.next}while(u!==null&&u!==i);c===null?o=r:c.next=l,li(r,t.memoizedState)||(ka=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do i=a.lane,En.lanes|=i,ed|=i,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function sS(e){var t=Os(),n=t.queue;if(n===null)throw Error(Ae(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,i=t.memoizedState;if(a!==null){n.pending=null;var o=a=a.next;do i=e(i,o.action),o=o.next;while(o!==a);li(i,t.memoizedState)||(ka=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function m8(){}function p8(e,t){var n=En,r=Os(),a=t(),i=!li(r.memoizedState,a);if(i&&(r.memoizedState=a,ka=!0),r=r.queue,AP(v8.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||yr!==null&&yr.memoizedState.tag&1){if(n.flags|=2048,kg(9,y8.bind(null,n,r,a,t),void 0,null),Sr===null)throw Error(Ae(349));Zu&30||g8(n,t,a)}return a}function g8(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=En.updateQueue,t===null?(t={lastEffect:null,stores:null},En.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function y8(e,t,n,r){t.value=n,t.getSnapshot=r,x8(t)&&b8(e)}function v8(e,t,n){return n(function(){x8(t)&&b8(e)})}function x8(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!li(e,n)}catch{return!0}}function b8(e){var t=Qo(e,1);t!==null&&ri(t,e,1,-1)}function mR(e){var t=Ri();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Pg,lastRenderedState:e},t.queue=e,e=e.dispatch=Ite.bind(null,En,e),[t.memoizedState,e]}function kg(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=En.updateQueue,t===null?(t={lastEffect:null,stores:null},En.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function w8(){return Os().memoizedState}function sb(e,t,n,r){var a=Ri();En.flags|=e,a.memoizedState=kg(1|t,n,void 0,r===void 0?null:r)}function mj(e,t,n,r){var a=Os();r=r===void 0?null:r;var i=void 0;if(rr!==null){var o=rr.memoizedState;if(i=o.destroy,r!==null&&CP(r,o.deps)){a.memoizedState=kg(t,n,i,r);return}}En.flags|=e,a.memoizedState=kg(1|t,n,i,r)}function pR(e,t){return sb(8390656,8,e,t)}function AP(e,t){return mj(2048,8,e,t)}function j8(e,t){return mj(4,2,e,t)}function N8(e,t){return mj(4,4,e,t)}function S8(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function C8(e,t,n){return n=n!=null?n.concat([e]):null,mj(4,4,S8.bind(null,t,e),n)}function PP(){}function _8(e,t){var n=Os();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&CP(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function E8(e,t){var n=Os();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&CP(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function A8(e,t,n){return Zu&21?(li(n,t)||(n=M6(),En.lanes|=n,ed|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,ka=!0),e.memoizedState=n)}function Dte(e,t){var n=Kt;Kt=n!==0&&4>n?n:4,e(!0);var r=rS.transition;rS.transition={};try{e(!1),t()}finally{Kt=n,rS.transition=r}}function P8(){return Os().memoizedState}function $te(e,t,n){var r=Sc(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},k8(e))O8(t,n);else if(n=d8(e,t,n,r),n!==null){var a=ca();ri(n,e,r,a),T8(n,t,r)}}function Ite(e,t,n){var r=Sc(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(k8(e))O8(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,l=i(o,n);if(a.hasEagerState=!0,a.eagerState=l,li(l,o)){var c=t.interleaved;c===null?(a.next=a,bP(t)):(a.next=c.next,c.next=a),t.interleaved=a;return}}catch{}finally{}n=d8(e,t,a,r),n!==null&&(a=ca(),ri(n,e,r,a),T8(n,t,r))}}function k8(e){var t=e.alternate;return e===En||t!==null&&t===En}function O8(e,t){qp=Yb=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function T8(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,iP(e,n)}}var Xb={readContext:ks,useCallback:Ir,useContext:Ir,useEffect:Ir,useImperativeHandle:Ir,useInsertionEffect:Ir,useLayoutEffect:Ir,useMemo:Ir,useReducer:Ir,useRef:Ir,useState:Ir,useDebugValue:Ir,useDeferredValue:Ir,useTransition:Ir,useMutableSource:Ir,useSyncExternalStore:Ir,useId:Ir,unstable_isNewReconciler:!1},Lte={readContext:ks,useCallback:function(e,t){return Ri().memoizedState=[e,t===void 0?null:t],e},useContext:ks,useEffect:pR,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,sb(4194308,4,S8.bind(null,t,e),n)},useLayoutEffect:function(e,t){return sb(4194308,4,e,t)},useInsertionEffect:function(e,t){return sb(4,2,e,t)},useMemo:function(e,t){var n=Ri();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ri();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=$te.bind(null,En,e),[r.memoizedState,e]},useRef:function(e){var t=Ri();return e={current:e},t.memoizedState=e},useState:mR,useDebugValue:PP,useDeferredValue:function(e){return Ri().memoizedState=e},useTransition:function(){var e=mR(!1),t=e[0];return e=Dte.bind(null,e[1]),Ri().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=En,a=Ri();if(wn){if(n===void 0)throw Error(Ae(407));n=n()}else{if(n=t(),Sr===null)throw Error(Ae(349));Zu&30||g8(r,t,n)}a.memoizedState=n;var i={value:n,getSnapshot:t};return a.queue=i,pR(v8.bind(null,r,i,e),[e]),r.flags|=2048,kg(9,y8.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ri(),t=Sr.identifierPrefix;if(wn){var n=Ro,r=Mo;n=(r&~(1<<32-ni(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ag++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Rte++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Fte={readContext:ks,useCallback:_8,useContext:ks,useEffect:AP,useImperativeHandle:C8,useInsertionEffect:j8,useLayoutEffect:N8,useMemo:E8,useReducer:aS,useRef:w8,useState:function(){return aS(Pg)},useDebugValue:PP,useDeferredValue:function(e){var t=Os();return A8(t,rr.memoizedState,e)},useTransition:function(){var e=aS(Pg)[0],t=Os().memoizedState;return[e,t]},useMutableSource:m8,useSyncExternalStore:p8,useId:P8,unstable_isNewReconciler:!1},Bte={readContext:ks,useCallback:_8,useContext:ks,useEffect:AP,useImperativeHandle:C8,useInsertionEffect:j8,useLayoutEffect:N8,useMemo:E8,useReducer:sS,useRef:w8,useState:function(){return sS(Pg)},useDebugValue:PP,useDeferredValue:function(e){var t=Os();return rr===null?t.memoizedState=e:A8(t,rr.memoizedState,e)},useTransition:function(){var e=sS(Pg)[0],t=Os().memoizedState;return[e,t]},useMutableSource:m8,useSyncExternalStore:p8,useId:P8,unstable_isNewReconciler:!1};function Us(e,t){if(e&&e.defaultProps){t=An({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function m_(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:An({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pj={isMounted:function(e){return(e=e._reactInternals)?Ad(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=ca(),a=Sc(e),i=Bo(r,a);i.payload=t,n!=null&&(i.callback=n),t=jc(e,i,a),t!==null&&(ri(t,e,a,r),rb(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=ca(),a=Sc(e),i=Bo(r,a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=jc(e,i,a),t!==null&&(ri(t,e,a,r),rb(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=ca(),r=Sc(e),a=Bo(n,r);a.tag=2,t!=null&&(a.callback=t),t=jc(e,a,r),t!==null&&(ri(t,e,r,n),rb(t,e,r))}};function gR(e,t,n,r,a,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!jg(n,r)||!jg(a,i):!0}function M8(e,t,n){var r=!1,a=Mc,i=t.contextType;return typeof i=="object"&&i!==null?i=ks(i):(a=Da(t)?Qu:Qr.current,r=t.contextTypes,i=(r=r!=null)?ih(e,a):Mc),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=pj,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=i),t}function yR(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&pj.enqueueReplaceState(t,t.state,null)}function p_(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},wP(e);var i=t.contextType;typeof i=="object"&&i!==null?a.context=ks(i):(i=Da(t)?Qu:Qr.current,a.context=ih(e,i)),a.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(m_(e,t,i,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&pj.enqueueReplaceState(a,a.state,null),Kb(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function uh(e,t){try{var n="",r=t;do n+=mee(r),r=r.return;while(r);var a=n}catch(i){a=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:e,source:t,stack:a,digest:null}}function iS(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function g_(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var zte=typeof WeakMap=="function"?WeakMap:Map;function R8(e,t,n){n=Bo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Jb||(Jb=!0,__=r),g_(e,t)},n}function D8(e,t,n){n=Bo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){g_(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){g_(e,t),typeof r!="function"&&(Nc===null?Nc=new Set([this]):Nc.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function vR(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new zte;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=tne.bind(null,e,t,n),t.then(e,e))}function xR(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function bR(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bo(-1,1),t.tag=2,jc(n,t,1))),n.lanes|=1),e)}var Ute=xl.ReactCurrentOwner,ka=!1;function aa(e,t,n,r){t.child=e===null?u8(t,null,n,r):lh(t,e.child,n,r)}function wR(e,t,n,r,a){n=n.render;var i=t.ref;return Tf(t,a),r=_P(e,t,n,r,i,a),n=EP(),e!==null&&!ka?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Jo(e,t,a)):(wn&&n&&mP(t),t.flags|=1,aa(e,t,r,a),t.child)}function jR(e,t,n,r,a){if(e===null){var i=n.type;return typeof i=="function"&&!IP(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,$8(e,t,i,r,a)):(e=cb(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:jg,n(o,r)&&e.ref===t.ref)return Jo(e,t,a)}return t.flags|=1,e=Cc(i,r),e.ref=t.ref,e.return=t,t.child=e}function $8(e,t,n,r,a){if(e!==null){var i=e.memoizedProps;if(jg(i,r)&&e.ref===t.ref)if(ka=!1,t.pendingProps=r=i,(e.lanes&a)!==0)e.flags&131072&&(ka=!0);else return t.lanes=e.lanes,Jo(e,t,a)}return y_(e,t,n,r,a)}function I8(e,t,n){var r=t.pendingProps,a=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ln(vf,Ja),Ja|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null}
vendor: 7,774 bytes, line 40
40,t.updateQueue=null,ln(vf,Ja),Ja|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ln(vf,Ja),Ja|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ln(vf,Ja),Ja|=r;return aa(e,t,a,n),t.child}function L8(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function y_(e,t,n,r,a){var i=Da(n)?Qu:Qr.current;return i=ih(t,i),Tf(t,a),n=_P(e,t,n,r,i,a),r=EP(),e!==null&&!ka?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Jo(e,t,a)):(wn&&r&&mP(t),t.flags|=1,aa(e,t,n,a),t.child)}function NR(e,t,n,r,a){if(Da(n)){var i=!0;Ub(t)}else i=!1;if(Tf(t,a),t.stateNode===null)ib(e,t),M8(t,n,r),p_(t,n,r,a),r=!0;else if(e===null){var o=t.stateNode,l=t.memoizedProps;o.props=l;var c=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=ks(u):(u=Da(n)?Qu:Qr.current,u=ih(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==r||c!==u)&&yR(t,o,r,u),Gl=!1;var h=t.memoizedState;o.state=h,Kb(t,r,o,a),c=t.memoizedState,l!==r||h!==c||Ra.current||Gl?(typeof d=="function"&&(m_(t,n,d,r),c=t.memoizedState),(l=Gl||gR(t,n,l,r,h,c,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),o.props=r,o.state=c,o.context=u,r=l):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,f8(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Us(t.type,l),o.props=u,f=t.pendingProps,h=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=ks(c):(c=Da(n)?Qu:Qr.current,c=ih(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==f||h!==c)&&yR(t,o,r,c),Gl=!1,h=t.memoizedState,o.state=h,Kb(t,r,o,a);var p=t.memoizedState;l!==f||h!==p||Ra.current||Gl?(typeof m=="function"&&(m_(t,n,m,r),p=t.memoizedState),(u=Gl||gR(t,n,u,r,h,p,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,p,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,p,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),o.props=r,o.state=p,o.context=c,r=u):(typeof o.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return v_(e,t,n,r,i,a)}function v_(e,t,n,r,a,i){L8(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return a&&lR(t,n,!1),Jo(e,t,i);r=t.stateNode,Ute.current=t;var l=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=lh(t,e.child,null,i),t.child=lh(t,null,l,i)):aa(e,t,l,i),t.memoizedState=r.state,a&&lR(t,n,!0),t.child}function F8(e){var t=e.stateNode;t.pendingContext?oR(e,t.pendingContext,t.pendingContext!==t.context):t.context&&oR(e,t.context,!1),jP(e,t.containerInfo)}function SR(e,t,n,r,a){return oh(),gP(a),t.flags|=256,aa(e,t,n,r),t.child}var x_={dehydrated:null,treeContext:null,retryLane:0};function b_(e){return{baseLanes:e,cachePool:null,transitions:null}}function B8(e,t,n){var r=t.pendingProps,a=_n.current,i=!1,o=(t.flags&128)!==0,l;if((l=o)||(l=e!==null&&e.memoizedState===null?!1:(a&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ln(_n,a&1),e===null)return f_(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=vj(o,r,0,null),e=Uu(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=b_(n),t.memoizedState=x_,e):kP(t,o));if(a=e.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return Vte(e,t,o,r,l,a,n);if(i){i=r.fallback,o=t.mode,a=e.child,l=a.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Cc(a,c),r.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Cc(l,i):(i=Uu(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?b_(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=x_,r}return i=e.child,e=i.sibling,r=Cc(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function kP(e,t){return t=vj({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function dx(e,t,n,r){return r!==null&&gP(r),lh(t,e.child,null,n),e=kP(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Vte(e,t,n,r,a,i,o){if(n)return t.flags&256?(t.flags&=-257,r=iS(Error(Ae(422))),dx(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,a=t.mode,r=vj({mode:"visible",children:r.children},a,0,null),i=Uu(i,a,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&lh(t,e.child,null,o),t.child.memoizedState=b_(o),t.memoizedState=x_,i);if(!(t.mode&1))return dx(e,t,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(Ae(419)),r=iS(i,r,void 0),dx(e,t,o,r)}if(l=(o&e.childLanes)!==0,ka||l){if(r=Sr,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Qo(e,a),ri(r,e,a,-1))}return $P(),r=iS(Error(Ae(421))),dx(e,t,o,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=nne.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,rs=wc(a.nextSibling),as=t,wn=!0,Ys=null,e!==null&&(ws[js++]=Mo,ws[js++]=Ro,ws[js++]=Ju,Mo=e.id,Ro=e.overflow,Ju=t),t=kP(t,r.children),t.flags|=4096,t)}function CR(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),h_(e.return,t,n)}function oS(e,t,n,r,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function z8(e,t,n){var r=t.pendingProps,a=r.revealOrder,i=r.tail;if(aa(e,t,r.children,n),r=_n.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&CR(e,n,t);else if(e.tag===19)CR(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}
vendor: 6,214 bytes, line 40
40if(ln(_n,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Gb(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),oS(t,!1,a,n,i);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Gb(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}oS(t,!0,n,null,i);break;case"together":oS(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ib(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Jo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ed|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(Ae(153));if(t.child!==null){for(e=t.child,n=Cc(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Cc(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Wte(e,t,n){switch(t.tag){case 3:F8(t),oh();break;case 5:h8(t);break;case 1:Da(t.type)&&Ub(t);break;case 4:jP(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;ln(qb,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ln(_n,_n.current&1),t.flags|=128,null):n&t.child.childLanes?B8(e,t,n):(ln(_n,_n.current&1),e=Jo(e,t,n),e!==null?e.sibling:null);ln(_n,_n.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return z8(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ln(_n,_n.current),r)break;return null;case 22:case 23:return t.lanes=0,I8(e,t,n)}return Jo(e,t,n)}var U8,w_,V8,W8;U8=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};w_=function(){};V8=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,Su(Yi.current);var i=null;switch(n){case"input":a=VC(e,a),r=VC(e,r),i=[];break;case"select":a=An({},a,{value:void 0}),r=An({},r,{value:void 0}),i=[];break;case"textarea":a=HC(e,a),r=HC(e,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Bb)}GC(n,r);var o;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var l=a[u];for(o in l)l.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(pg.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=a!=null?a[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(pg.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&fn("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};W8=function(e,t,n,r){n!==r&&(t.flags|=4)};function np(e,t){if(!wn)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Lr(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function qte(e,t,n){var r=t.pendingProps;switch(pP(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lr(t),null;case 1:return Da(t.type)&&zb(),Lr(t),null;case 3:return r=t.stateNode,ch(),gn(Ra),gn(Qr),SP(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(cx(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ys!==null&&(P_(Ys),Ys=null))),w_(e,t),Lr(t),null;case 5:NP(t);var a=Su(Eg.current);if(n=t.type,e!==null&&t.stateNode!=null)V8(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(Ae(166));return Lr(t),null}if(e=Su(Yi.current),cx(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Fi]=t,r[Cg]=i,e=(t.mode&1)!==0,n){case"dialog":fn("cancel",r),fn("close",r);break;case"iframe":case"object":case"embed":fn("load",r);break;case"video":case"audio":for(a=0;a<Ep.length;a++)fn(Ep[a],r);break;case"source":fn("error",r);break;case"img":case"image":case"link":fn("error",r),fn("load",r);break;case"details":fn("toggle",r);break;case"input":RM(r,i),fn("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},fn("invalid",r);break;case"textarea":$M(r,i),fn("invalid",r)}GC(n,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&lx(r.textContent,l,e),a=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&lx(r.textContent,l,e),a=["children",""+l]):pg.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&fn("scroll",r)}switch(n){case"input":ex(r),DM(r,i,!0);break;case"textarea":ex(r),IM(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Bb)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=v6(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>
40",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Fi]=t,e[Cg]=r,U8(e,t,!1,!1),t.stateNode=e;e:{switch(o=YC(n,r),n){case"dialog":fn("cancel",e),fn("close",e),a=r;break;case"iframe":case"object":case"embed":fn("load",e),a=r;break;case"video":case"audio":for(a=0;a<Ep.length;a++)fn(Ep[a],e);a=r;break;case"source":fn("error",e),a=r;break;case"img":case"image":case"link":fn("error",e),fn("load",e),a=r;break;case"details":fn("toggle",e),a=r;break;case"input":RM(e,r),a=VC(e,r),fn("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=An({},r,{value:void 0}),fn("invalid",e);break;case"textarea":$M(e,r),a=HC(e,r),fn("invalid",e);break;default:a=r}GC(n,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?w6(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&x6(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&gg(e,c):typeof c=="number"&&gg(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(pg.hasOwnProperty(i)?c!=null&&i==="onScroll"&&fn("scroll",e):c!=null&&eP(e,i,c,o))}switch(n){case"input":ex(e),DM(e,r,!1);break;case"textarea":ex(e),IM(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Tc(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Af(e,!!r.multiple,i,!1):r.defaultValue!=null&&Af(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Bb)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Lr(t),null;case 6:if(e&&t.stateNode!=null)W8(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(Ae(166));if(n=Su(Eg.current),Su(Yi.current),cx(t)){if(r=t.stateNode,n=t.memoizedProps,r[Fi]=t,(i=r.nodeValue!==n)&&(e=as,e!==null))switch(e.tag){case 3:lx(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&lx(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Fi]=t,t.stateNode=r}return Lr(t),null;case 13:if(gn(_n),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(wn&&rs!==null&&t.mode&1&&!(t.flags&128))l8(),oh(),t.flags|=98560,i=!1;else if(i=cx(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(Ae(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(Ae(317));i[Fi]=t}else oh(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Lr(t),i=!1}else Ys!==null&&(P_(Ys),Ys=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||_n.current&1?ur===0&&(ur=3):$P())),t.updateQueue!==null&&(t.flags|=4),Lr(t),null);case 4:return ch(),w_(e,t),e===null&&Ng(t.stateNode.containerInfo),Lr(t),null;case 10:return xP(t.type._context),Lr(t),null;case 17:return Da(t.type)&&zb(),Lr(t),null;case 19:if(gn(_n),i=t.memoizedState,i===null)return Lr(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)np(i,!1);else{if(ur!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Gb(e),o!==null){for(t.flags|=128,np(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ln(_n,_n.current&1|2),t.child}e=e.sibling}i.tail!==null&&Un()>dh&&(t.flags|=128,r=!0,np(i,!1),t.lanes=4194304)}else{if(!r)if(e=Gb(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),np(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!wn)return Lr(t),null}else 2*Un()-i.renderingStartTime>dh&&n!==1073741824&&(t.flags|=128,r=!0,np(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Un(),t.sibling=null,n=_n.current,ln(_n,r?n&1|2:n&1),t):(Lr(t),null);case 22:case 23:return DP(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ja&1073741824&&(Lr(t),t.subtreeFlags&6&&(t.flags|=8192)):Lr(t),null;case 24:return null;case 25:return null}throw Error(Ae(156,t.tag))}function Hte(e,t){switch(pP(t),t.tag){case 1:return Da(t.type)&&zb(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;
vendor: 25,474 bytes, line 40
40case 3:return ch(),gn(Ra),gn(Qr),SP(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return NP(t),null;case 13:if(gn(_n),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Ae(340));oh()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return gn(_n),null;case 4:return ch(),null;case 10:return xP(t.type._context),null;case 22:case 23:return DP(),null;case 24:return null;default:return null}}var fx=!1,Wr=!1,Kte=typeof WeakSet=="function"?WeakSet:Set,Le=null;function yf(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Dn(e,t,r)}else n.current=null}function j_(e,t,n){try{n()}catch(r){Dn(e,t,r)}}var _R=!1;function Gte(e,t){if(s_=Ib,e=Y6(),hP(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(l=o+a),f!==i||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===a&&(l=o),h===i&&++d===r&&(c=o),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(i_={focusedElem:e,selectionRange:n},Ib=!1,Le=t;Le!==null;)if(t=Le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Le=e;else for(;Le!==null;){t=Le;try{var p=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(p!==null){var g=p.memoizedProps,y=p.memoizedState,v=t.stateNode,w=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:Us(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Ae(163))}}catch(j){Dn(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,Le=e;break}Le=t.return}return p=_R,_R=!1,p}function Hp(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&j_(t,n,i)}a=a.next}while(a!==r)}}function gj(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function N_(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function q8(e){var t=e.alternate;t!==null&&(e.alternate=null,q8(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Fi],delete t[Cg],delete t[c_],delete t[kte],delete t[Ote])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function H8(e){return e.tag===5||e.tag===3||e.tag===4}function ER(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||H8(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function S_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Bb));else if(r!==4&&(e=e.child,e!==null))for(S_(e,t,n),e=e.sibling;e!==null;)S_(e,t,n),e=e.sibling}function C_(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(C_(e,t,n),e=e.sibling;e!==null;)C_(e,t,n),e=e.sibling}var Pr=null,qs=!1;function Il(e,t,n){for(n=n.child;n!==null;)K8(e,t,n),n=n.sibling}function K8(e,t,n){if(Gi&&typeof Gi.onCommitFiberUnmount=="function")try{Gi.onCommitFiberUnmount(lj,n)}catch{}switch(n.tag){case 5:Wr||yf(n,t);case 6:var r=Pr,a=qs;Pr=null,Il(e,t,n),Pr=r,qs=a,Pr!==null&&(qs?(e=Pr,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Pr.removeChild(n.stateNode));break;case 18:Pr!==null&&(qs?(e=Pr,n=n.stateNode,e.nodeType===8?eS(e.parentNode,n):e.nodeType===1&&eS(e,n),bg(e)):eS(Pr,n.stateNode));break;case 4:r=Pr,a=qs,Pr=n.stateNode.containerInfo,qs=!0,Il(e,t,n),Pr=r,qs=a;break;case 0:case 11:case 14:case 15:if(!Wr&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&j_(n,t,o),a=a.next}while(a!==r)}Il(e,t,n);break;case 1:if(!Wr&&(yf(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Dn(n,t,l)}Il(e,t,n);break;case 21:Il(e,t,n);break;case 22:n.mode&1?(Wr=(r=Wr)||n.memoizedState!==null,Il(e,t,n),Wr=r):Il(e,t,n);break;default:Il(e,t,n)}}function AR(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Kte),t.forEach(function(r){var a=rne.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Is(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var i=e,o=t,l=o;e:for(;l!==null;){switch(l.tag){case 5:Pr=l.stateNode,qs=!1;break e;case 3:Pr=l.stateNode.containerInfo,qs=!0;break e;case 4:Pr=l.stateNode.containerInfo,qs=!0;break e}l=l.return}if(Pr===null)throw Error(Ae(160));K8(i,o,a),Pr=null,qs=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(u){Dn(a,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)G8(t,e),t=t.sibling}function G8(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Is(t,e),Oi(e),r&4){try{Hp(3,e,e.return),gj(3,e)}catch(g){Dn(e,e.return,g)}try{Hp(5,e,e.return)}catch(g){Dn(e,e.return,g)}}break;case 1:Is(t,e),Oi(e),r&512&&n!==null&&yf(n,n.return);break;case 5:if(Is(t,e),Oi(e),r&512&&n!==null&&yf(n,n.return),e.flags&32){var a=e.stateNode;try{gg(a,"")}catch(g){Dn(e,e.return,g)}}if(r&4&&(a=e.stateNode,a!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&g6(a,i),YC(l,o);var u=YC(l,i);for(o=0;o<c.length;o+=2){var d=c[o],f=c[o+1];d==="style"?w6(a,f):d==="dangerouslySetInnerHTML"?x6(a,f):d==="children"?gg(a,f):eP(a,d,f,u)}switch(l){case"input":WC(a,i);break;case"textarea":y6(a,i);break;case"select":var h=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Af(a,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?Af(a,!!i.multiple,i.defaultValue,!0):Af(a,!!i.multiple,i.multiple?[]:"",!1))}a[Cg]=i}catch(g){Dn(e,e.return,g)}}break;case 6:if(Is(t,e),Oi(e),r&4){if(e.stateNode===null)throw Error(Ae(162));a=e.stateNode,i=e.memoizedProps;try{a.nodeValue=i}catch(g){Dn(e,e.return,g)}}break;case 3:if(Is(t,e),Oi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{bg(t.containerInfo)}catch(g){Dn(e,e.return,g)}break;case 4:Is(t,e),Oi(e);break;case 13:Is(t,e),Oi(e),a=e.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(MP=Un())),r&4&&AR(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Wr=(u=Wr)||d,Is(t,e),Wr=u):Is(t,e),Oi(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(Le=e,d=e.child;d!==null;){for(f=Le=d;Le!==null;){switch(h=Le,m=h.child,h.tag){case 0:case 11:case 14:case 15:Hp(4,h,h.return);break;case 1:yf(h,h.return);var p=h.stateNode;if(typeof p.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,p.props=t.memoizedProps,p.state=t.memoizedState,p.componentWillUnmount()}catch(g){Dn(r,n,g)}}break;case 5:yf(h,h.return);break;case 22:if(h.memoizedState!==null){kR(f);continue}}m!==null?(m.return=h,Le=m):kR(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=b6("display",o))}catch(g){Dn(e,e.return,g)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(g){Dn(e,e.return,g)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Is(t,e),Oi(e),r&4&&AR(e);break;case 21:break;default:Is(t,e),Oi(e)}}function Oi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(H8(n)){var r=n;break e}n=n.return}throw Error(Ae(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(gg(a,""),r.flags&=-33);var i=ER(e);C_(e,i,a);break;case 3:case 4:var o=r.stateNode.containerInfo,l=ER(e);S_(e,l,o);break;default:throw Error(Ae(161))}}catch(c){Dn(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yte(e,t,n){Le=e,Y8(e)}function Y8(e,t,n){for(var r=(e.mode&1)!==0;Le!==null;){var a=Le,i=a.child;if(a.tag===22&&r){var o=a.memoizedState!==null||fx;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||Wr;l=fx;var u=Wr;if(fx=o,(Wr=c)&&!u)for(Le=a;Le!==null;)o=Le,c=o.child,o.tag===22&&o.memoizedState!==null?OR(a):c!==null?(c.return=o,Le=c):OR(a);for(;i!==null;)Le=i,Y8(i),i=i.sibling;Le=a,fx=l,Wr=u}PR(e)}else a.subtreeFlags&8772&&i!==null?(i.return=a,Le=i):PR(e)}}function PR(e){for(;Le!==null;){var t=Le;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Wr||gj(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Wr)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Us(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&hR(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}hR(t,o,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&bg(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(Ae(163))}Wr||t.flags&512&&N_(t)}catch(h){Dn(t,t.return,h)}}if(t===e){Le=null;break}if(n=t.sibling,n!==null){n.return=t.return,Le=n;break}Le=t.return}}function kR(e){for(;Le!==null;){var t=Le;if(t===e){Le=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Le=n;break}Le=t.return}}function OR(e){for(;Le!==null;){var t=Le;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{gj(4,t)}catch(c){Dn(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(c){Dn(t,a,c)}}var i=t.return;try{N_(t)}catch(c){Dn(t,i,c)}break;case 5:var o=t.return;try{N_(t)}catch(c){Dn(t,o,c)}}}catch(c){Dn(t,t.return,c)}if(t===e){Le=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Le=l;break}Le=t.return}}var Xte=Math.ceil,Qb=xl.ReactCurrentDispatcher,OP=xl.ReactCurrentOwner,As=xl.ReactCurrentBatchConfig,Dt=0,Sr=null,Gn=null,kr=0,Ja=0,vf=Bc(0),ur=0,Og=null,ed=0,yj=0,TP=0,Kp=null,Sa=null,MP=0,dh=1/0,_o=null,Jb=!1,__=null,Nc=null,hx=!1,fc=null,Zb=0,Gp=0,E_=null,ob=-1,lb=0;function ca(){return Dt&6?Un():ob!==-1?ob:ob=Un()}function Sc(e){return e.mode&1?Dt&2&&kr!==0?kr&-kr:Mte.transition!==null?(lb===0&&(lb=M6()),lb):(e=Kt,e!==0||(e=window.event,e=e===void 0?16:B6(e.type)),e):1}function ri(e,t,n,r){if(50<Gp)throw Gp=0,E_=null,Error(Ae(185));Xy(e,n,r),(!(Dt&2)||e!==Sr)&&(e===Sr&&(!(Dt&2)&&(yj|=n),ur===4&&Jl(e,kr)),$a(e,r),n===1&&Dt===0&&!(t.mode&1)&&(dh=Un()+500,hj&&zc()))}function $a(e,t){var n=e.callbackNode;Mee(e,t);var r=$b(e,e===Sr?kr:0);if(r===0)n!==null&&BM(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&BM(n),t===1)e.tag===0?Tte(TR.bind(null,e)):s8(TR.bind(null,e)),Ate(function(){!(Dt&6)&&zc()}),n=null;else{switch(R6(r)){case 1:n=sP;break;case 4:n=O6;break;case 16:n=Db;break;case 536870912:n=T6;break;default:n=Db}n=rB(n,X8.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function X8(e,t){if(ob=-1,lb=0,Dt&6)throw Error(Ae(327));var n=e.callbackNode;if(Mf()&&e.callbackNode!==n)return null;var r=$b(e,e===Sr?kr:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=e0(e,r);else{t=r;var a=Dt;Dt|=2;var i=J8();(Sr!==e||kr!==t)&&(_o=null,dh=Un()+500,zu(e,t));do try{Zte();break}catch(l){Q8(e,l)}while(!0);vP(),Qb.current=i,Dt=a,Gn!==null?t=0:(Sr=null,kr=0,t=ur)}if(t!==0){if(t===2&&(a=e_(e),a!==0&&(r=a,t=A_(e,a))),t===1)throw n=Og,zu(e,0),Jl(e,r),$a(e,Un()),n;if(t===6)Jl(e,r);else{if(a=e.current.alternate,!(r&30)&&!Qte(a)&&(t=e0(e,r),t===2&&(i=e_(e),i!==0&&(r=i,t=A_(e,i))),t===1))throw n=Og,zu(e,0),Jl(e,r),$a(e,Un()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(Ae(345));case 2:hu(e,Sa,_o);break;case 3:if(Jl(e,r),(r&130023424)===r&&(t=MP+500-Un(),10<t)){if($b(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){ca(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=l_(hu.bind(null,e,Sa,_o),t);break}hu(e,Sa,_o);break;case 4:if(Jl(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var o=31-ni(r);i=1<<o,o=t[o],o>a&&(a=o),r&=~i}if(r=a,r=Un()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Xte(r/1960))-r,10<r){e.timeoutHandle=l_(hu.bind(null,e,Sa,_o),r);break}hu(e,Sa,_o);break;case 5:hu(e,Sa,_o);break;default:throw Error(Ae(329))}}}return $a(e,Un()),e.callbackNode===n?X8.bind(null,e):null}function A_(e,t){var n=Kp;return e.current.memoizedState.isDehydrated&&(zu(e,t).flags|=256),e=e0(e,t),e!==2&&(t=Sa,Sa=n,t!==null&&P_(t)),e}function P_(e){Sa===null?Sa=e:Sa.push.apply(Sa,e)}function Qte(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],i=a.getSnapshot;a=a.value;try{if(!li(i(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Jl(e,t){for(t&=~TP,t&=~yj,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ni(t),r=1<<n;e[n]=-1,t&=~r}}function TR(e){if(Dt&6)throw Error(Ae(327));Mf();var t=$b(e,0);if(!(t&1))return $a(e,Un()),null;var n=e0(e,t);if(e.tag!==0&&n===2){var r=e_(e);r!==0&&(t=r,n=A_(e,r))}if(n===1)throw n=Og,zu(e,0),Jl(e,t),$a(e,Un()),n;if(n===6)throw Error(Ae(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,hu(e,Sa,_o),$a(e,Un()),null}function RP(e,t){var n=Dt;Dt|=1;try{return e(t)}finally{Dt=n,Dt===0&&(dh=Un()+500,hj&&zc())}}function td(e){fc!==null&&fc.tag===0&&!(Dt&6)&&Mf();var t=Dt;Dt|=1;var n=As.transition,r=Kt;try{if(As.transition=null,Kt=1,e)return e()}finally{Kt=r,As.transition=n,Dt=t,!(Dt&6)&&zc()}}function DP(){Ja=vf.current,gn(vf)}function zu(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ete(n)),Gn!==null)for(n=Gn.return;n!==null;){var r=n;switch(pP(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&zb();break;case 3:ch(),gn(Ra),gn(Qr),SP();break;case 5:NP(r);break;case 4:ch();break;case 13:gn(_n);break;case 19:gn(_n);break;case 10:xP(r.type._context);break;case 22:case 23:DP()}n=n.return}if(Sr=e,Gn=e=Cc(e.current,null),kr=Ja=t,ur=0,Og=null,TP=yj=ed=0,Sa=Kp=null,Nu!==null){for(t=0;t<Nu.length;t++)if(n=Nu[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=a,r.next=o}n.pending=r}Nu=null}return e}function Q8(e,t){do{var n=Gn;try{if(vP(),ab.current=Xb,Yb){for(var r=En.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Yb=!1}if(Zu=0,yr=rr=En=null,qp=!1,Ag=0,OP.current=null,n===null||n.return===null){ur=1,Og=t,Gn=null;break}e:{var i=e,o=n.return,l=n,c=t;if(t=kr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=xR(o);if(m!==null){m.flags&=-257,bR(m,o,l,i,t),m.mode&1&&vR(i,u,t),t=m,c=u;var p=t.updateQueue;if(p===null){var g=new Set;g.add(c),t.updateQueue=g}else p.add(c);break e}else{if(!(t&1)){vR(i,u,t),$P();break e}c=Error(Ae(426))}}else if(wn&&l.mode&1){var y=xR(o);if(y!==null){!(y.flags&65536)&&(y.flags|=256),bR(y,o,l,i,t),gP(uh(c,l));break e}}i=c=uh(c,l),ur!==4&&(ur=2),Kp===null?Kp=[i]:Kp.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=R8(i,c,t);fR(i,v);break e;case 1:l=c;var w=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Nc===null||!Nc.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var j=D8(i,l,t);fR(i,j);break e}}i=i.return}while(i!==null)}eB(n)}catch(N){t=N,Gn===n&&n!==null&&(Gn=n=n.return);continue}break}while(!0)}function J8(){var e=Qb.current;return Qb.current=Xb,e===null?Xb:e}function $P(){(ur===0||ur===3||ur===2)&&(ur=4),Sr===null||!(ed&268435455)&&!(yj&268435455)||Jl(Sr,kr)}function e0(e,t){var n=Dt;Dt|=2;var r=J8();(Sr!==e||kr!==t)&&(_o=null,zu(e,t));do try{Jte();break}catch(a){Q8(e,a)}while(!0);if(vP(),Dt=n,Qb.current=r,Gn!==null)throw Error(Ae(261));return Sr=null,kr=0,ur}function Jte(){for(;Gn!==null;)Z8(Gn)}function Zte(){for(;Gn!==null&&!See();)Z8(Gn)}function Z8(e){var t=nB(e.alternate,e,Ja);e.memoizedProps=e.pendingProps,t===null?eB(e):Gn=t,OP.current=null}function eB(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Hte(n,t),n!==null){n.flags&=32767,Gn=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ur=6,Gn=null;return}}else if(n=qte(n,t,Ja),n!==null){Gn=n;return}if(t=t.sibling,t!==null){Gn=t;return}Gn=t=e}while(t!==null);ur===0&&(ur=5)}function hu(e,t,n){var r=Kt,a=As.transition;try{As.transition=null,Kt=1,ene(e,t,n,r)}finally{As.transition=a,Kt=r}return null}function ene(e,t,n,r){do Mf();while(fc!==null);if(Dt&6)throw Error(Ae(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(Ae(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Ree(e,i),e===Sr&&(Gn=Sr=null,kr=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hx||(hx=!0,rB(Db,function(){return Mf(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=As.transition,As.transition=null;var o=Kt;Kt=1;var l=Dt;Dt|=4,OP.current=null,Gte(e,n),G8(n,e),bte(i_),Ib=!!s_,i_=s_=null,e.current=n,Yte(n),Cee(),Dt=l,Kt=o,As.transition=i}else e.current=n;if(hx&&(hx=!1,fc=e,Zb=a),i=e.pendingLanes,i===0&&(Nc=null),Aee(n.stateNode),$a(e,Un()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Jb)throw Jb=!1,e=__,__=null,e;return Zb&1&&e.tag!==0&&Mf(),i=e.pendingLanes,i&1?e===E_?Gp++:(Gp=0,E_=e):Gp=0,zc(),null}function Mf(){if(fc!==null){var e=R6(Zb),t=As.transition,n=Kt;try{if(As.transition=null,Kt=16>e?16:e,fc===null)var r=!1;else{if(e=fc,fc=null,Zb=0,Dt&6)throw Error(Ae(331));var a=Dt;for(Dt|=4,Le=e.current;Le!==null;){var i=Le,o=i.child;if(Le.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(Le=u;Le!==null;){var d=Le;switch(d.tag){case 0:case 11:case 15:Hp(8,d,i)}var f=d.child;if(f!==null)f.return=d,Le=f;else for(;Le!==null;){d=Le;var h=d.sibling,m=d.return;if(q8(d),d===u){Le=null;break}if(h!==null){h.return=m,Le=h;break}Le=m}}}var p=i.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(g!==null)}}Le=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,Le=o;else e:for(;Le!==null;){if(i=Le,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Hp(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,Le=v;break e}Le=i.return}}var w=e.current;for(Le=w;Le!==null;){o=Le;var b=o.child;if(o.subtreeFlags&2064&&b!==null)b.return=o,Le=b;else e:for(o=w;Le!==null;){if(l=Le,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:gj(9,l)}}catch(N){Dn(l,l.return,N)}if(l===o){Le=null;break e}var j=l.sibling;if(j!==null){j.return=l.return,Le=j;break e}Le=l.return}}if(Dt=a,zc(),Gi&&typeof Gi.onPostCommitFiberRoot=="function")try{Gi.onPostCommitFiberRoot(lj,e)}catch{}r=!0}return r}finally{Kt=n,As.transition=t}}return!1}function MR(e,t,n){t=uh(n,t),t=R8(e,t,1),e=jc(e,t,1),t=ca(),e!==null&&(Xy(e,1,t),$a(e,t))}function Dn(e,t,n){if(e.tag===3)MR(e,e,n);else for(;t!==null;){if(t.tag===3){MR(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Nc===null||!Nc.has(r))){e=uh(n,e),e=D8(t,e,1),t=jc(t,e,1),e=ca(),t!==null&&(Xy(t,1,e),$a(t,e));break}}t=t.return}}function tne(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=ca(),e.pingedLanes|=e.suspendedLanes&n,Sr===e&&(kr&n)===n&&(ur===4||ur===3&&(kr&130023424)===kr&&500>Un()-MP?zu(e,0):TP|=n),$a(e,t)}function tB(e,t){t===0&&(e.mode&1?(t=rx,rx<<=1,!(rx&130023424)&&(rx=4194304)):t=1);var n=ca();e=Qo(e,t),e!==null&&(Xy(e,t,n),$a(e,n))}function nne(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),tB(e,n)}function rne(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(Ae(314))}r!==null&&r.delete(t),tB(e,n)}var nB;nB=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ra.current)ka=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return ka=!1,Wte(e,t,n);ka=!!(e.flags&131072)}else ka=!1,wn&&t.flags&1048576&&i8(t,Wb,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ib(e,t),e=t.pendingProps;var a=ih(t,Qr.current);Tf(t,n),a=_P(null,t,r,e,a,n);var i=EP();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Da(r)?(i=!0,Ub(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,wP(t),a.updater=pj,t.stateNode=a,a._reactInternals=t,p_(t,r,e,n),t=v_(null,t,r,!0,i,n)):(t.tag=0,wn&&i&&mP(t),aa(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ib(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=sne(r),e=Us(r,e),a){case 0:t=y_(null,t,r,e,n);break e;case 1:t=NR(null,t,r,e,n);break e;case 11:t=wR(null,t,r,e,n);break e;case 14:t=jR(null,t,r,Us(r.type,e),n);break e}throw Error(Ae(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Us(r,a),y_(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Us(r,a),NR(e,t,r,a,n);case 3:e:{if(F8(t),e===null)throw Error(Ae(387));r=t.pendingProps,i=t.memoizedState,a=i.element,f8(e,t),Kb(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=uh(Error(Ae(423)),t),t=SR(e,t,r,n,a);break e}else if(r!==a){a=uh(Error(Ae(424)),t),t=SR(e,t,r,n,a);break e}else for(rs=wc(t.stateNode.containerInfo.firstChild),as=t,wn=!0,Ys=null,n=u8(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(oh(),r===a){t=Jo(e,t,n);break e}aa(e,t,r,n)}t=t.child}return t;case 5:return h8(t),e===null&&f_(t),r=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,o_(r,a)?o=null:i!==null&&o_(r,i)&&(t.flags|=32),L8(e,t),aa(e,t,o,n),t.child;case 6:return e===null&&f_(t),null;case 13:return B8(e,t,n);case 4:return jP(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=lh(t,null,r,n):aa(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Us(r,a),wR(e,t,r,a,n);case 7:return aa(e,t,t.pendingProps,n),t.child;case 8:return aa(e,t,t.pendingProps.children,n),t.child;case 12:return aa(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,ln(qb,r._currentValue),r._currentValue=o,i!==null)if(li(i.value,o)){if(i.children===a.children&&!Ra.current){t=Jo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=Bo(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),h_(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(Ae(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),h_(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}aa(e,t,a.children,n),t=t.child}return t;
vendor: 5,898 bytes, line 40
40case 9:return a=t.type,r=t.pendingProps.children,Tf(t,n),a=ks(a),r=r(a),t.flags|=1,aa(e,t,r,n),t.child;case 14:return r=t.type,a=Us(r,t.pendingProps),a=Us(r.type,a),jR(e,t,r,a,n);case 15:return $8(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Us(r,a),ib(e,t),t.tag=1,Da(r)?(e=!0,Ub(t)):e=!1,Tf(t,n),M8(t,r,a),p_(t,r,a,n),v_(null,t,r,!0,e,n);case 19:return z8(e,t,n);case 22:return I8(e,t,n)}throw Error(Ae(156,t.tag))};function rB(e,t){return k6(e,t)}function ane(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ss(e,t,n,r){return new ane(e,t,n,r)}function IP(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sne(e){if(typeof e=="function")return IP(e)?1:0;if(e!=null){if(e=e.$$typeof,e===nP)return 11;if(e===rP)return 14}return 2}function Cc(e,t){var n=e.alternate;return n===null?(n=Ss(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function cb(e,t,n,r,a,i){var o=2;if(r=e,typeof e=="function")IP(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case lf:return Uu(n.children,a,i,t);case tP:o=8,a|=8;break;case FC:return e=Ss(12,n,t,a|2),e.elementType=FC,e.lanes=i,e;case BC:return e=Ss(13,n,t,a),e.elementType=BC,e.lanes=i,e;case zC:return e=Ss(19,n,t,a),e.elementType=zC,e.lanes=i,e;case h6:return vj(n,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case d6:o=10;break e;case f6:o=9;break e;case nP:o=11;break e;case rP:o=14;break e;case Kl:o=16,r=null;break e}throw Error(Ae(130,e==null?e:typeof e,""))}return t=Ss(o,n,t,a),t.elementType=e,t.type=r,t.lanes=i,t}function Uu(e,t,n,r){return e=Ss(7,e,r,t),e.lanes=n,e}function vj(e,t,n,r){return e=Ss(22,e,r,t),e.elementType=h6,e.lanes=n,e.stateNode={isHidden:!1},e}function lS(e,t,n){return e=Ss(6,e,null,t),e.lanes=n,e}function cS(e,t,n){return t=Ss(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function ine(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=VN(0),this.expirationTimes=VN(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=VN(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function LP(e,t,n,r,a,i,o,l,c){return e=new ine(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ss(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wP(i),e}function one(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:of,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function aB(e){if(!e)return Mc;e=e._reactInternals;e:{if(Ad(e)!==e||e.tag!==1)throw Error(Ae(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Da(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(Ae(171))}if(e.tag===1){var n=e.type;if(Da(n))return a8(e,n,t)}return t}function sB(e,t,n,r,a,i,o,l,c){return e=LP(n,r,!0,e,a,i,o,l,c),e.context=aB(null),n=e.current,r=ca(),a=Sc(n),i=Bo(r,a),i.callback=t??null,jc(n,i,a),e.current.lanes=a,Xy(e,a,r),$a(e,r),e}function xj(e,t,n,r){var a=t.current,i=ca(),o=Sc(a);return n=aB(n),t.context===null?t.context=n:t.pendingContext=n,t=Bo(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=jc(a,t,o),e!==null&&(ri(e,a,o,i),rb(e,a,o)),o}function t0(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function RR(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function FP(e,t){RR(e,t),(e=e.alternate)&&RR(e,t)}function lne(){return null}var iB=typeof reportError=="function"?reportError:function(e){console.error(e)};function BP(e){this._internalRoot=e}bj.prototype.render=BP.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(Ae(409));xj(e,t,null,null)};bj.prototype.unmount=BP.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;td(function(){xj(null,e,null,null)}),t[Xo]=null}};function bj(e){this._internalRoot=e}bj.prototype.unstable_scheduleHydration=function(e){if(e){var t=I6();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ql.length&&t!==0&&t<Ql[n].priority;n++);Ql.splice(n,0,e),n===0&&F6(e)}};function zP(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function wj(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function DR(){}function cne(e,t,n,r,a){if(a){if(typeof r=="function"){var i=r;r=function(){var u=t0(o);i.call(u)}}var o=sB(t,r,e,0,null,!1,!1,"",DR);return e._reactRootContainer=o,e[Xo]=o.current,Ng(e.nodeType===8?e.parentNode:e),td(),o}for(;
vendor: 5,173 bytes, line 40
40a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var l=r;r=function(){var u=t0(c);l.call(u)}}var c=LP(e,0,!1,null,null,!1,!1,"",DR);return e._reactRootContainer=c,e[Xo]=c.current,Ng(e.nodeType===8?e.parentNode:e),td(function(){xj(t,c,n,r)}),c}function jj(e,t,n,r,a){var i=n._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=t0(o);l.call(c)}}xj(t,o,e,a)}else o=cne(n,t,e,a,r);return t0(o)}D6=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=_p(t.pendingLanes);n!==0&&(iP(t,n|1),$a(t,Un()),!(Dt&6)&&(dh=Un()+500,zc()))}break;case 13:td(function(){var r=Qo(e,1);if(r!==null){var a=ca();ri(r,e,1,a)}}),FP(e,1)}};oP=function(e){if(e.tag===13){var t=Qo(e,134217728);if(t!==null){var n=ca();ri(t,e,134217728,n)}FP(e,134217728)}};$6=function(e){if(e.tag===13){var t=Sc(e),n=Qo(e,t);if(n!==null){var r=ca();ri(n,e,t,r)}FP(e,t)}};I6=function(){return Kt};L6=function(e,t){var n=Kt;try{return Kt=e,t()}finally{Kt=n}};QC=function(e,t,n){switch(t){case"input":if(WC(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=fj(r);if(!a)throw Error(Ae(90));p6(r),WC(r,a)}}}break;case"textarea":y6(e,n);break;case"select":t=n.value,t!=null&&Af(e,!!n.multiple,t,!1)}};S6=RP;C6=td;var une={usingClientEntryPoint:!1,Events:[Jy,ff,fj,j6,N6,RP]},rp={findFiberByHostInstance:ju,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},dne={bundleType:rp.bundleType,version:rp.version,rendererPackageName:rp.rendererPackageName,rendererConfig:rp.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:xl.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=A6(e),e===null?null:e.stateNode},findFiberByHostInstance:rp.findFiberByHostInstance||lne,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mx=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mx.isDisabled&&mx.supportsFiber)try{lj=mx.inject(dne),Gi=mx}catch{}}us.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=une;us.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!zP(t))throw Error(Ae(200));return one(e,t,null,n)};us.createRoot=function(e,t){if(!zP(e))throw Error(Ae(299));var n=!1,r="",a=iB;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=LP(e,1,!1,null,null,n,!1,r,a),e[Xo]=t.current,Ng(e.nodeType===8?e.parentNode:e),new BP(t)};us.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(Ae(188)):(e=Object.keys(e).join(","),Error(Ae(268,e)));return e=A6(t),e=e===null?null:e.stateNode,e};us.flushSync=function(e){return td(e)};us.hydrate=function(e,t,n){if(!wj(t))throw Error(Ae(200));return jj(null,e,t,!0,n)};us.hydrateRoot=function(e,t,n){if(!zP(e))throw Error(Ae(405));var r=n!=null&&n.hydratedSources||null,a=!1,i="",o=iB;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=sB(t,null,e,1,n??null,a,!1,i,o),e[Xo]=t.current,Ng(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new bj(t)};us.render=function(e,t,n){if(!wj(t))throw Error(Ae(200));return jj(null,e,t,!1,n)};us.unmountComponentAtNode=function(e){if(!wj(e))throw Error(Ae(40));return e._reactRootContainer?(td(function(){jj(null,null,e,!1,function(){e._reactRootContainer=null,e[Xo]=null})}),!0):!1};us.unstable_batchedUpdates=RP;us.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!wj(n))throw Error(Ae(200));if(e==null||e._reactInternals===void 0)throw Error(Ae(38));return jj(e,t,n,!1,r)};us.version="18.3.1-next-f1338f8080-20240426";function oB(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(oB)}catch(e){console.error(e)}}oB(),o6.exports=us;var Cs=o6.exports;const lB=$t(Cs);var cB,$R=Cs;cB=$R.createRoot,$R.hydrateRoot;const fne=1,hne=1e6;let uS=0;function mne(){return uS=(uS+1)%Number.MAX_SAFE_INTEGER,uS.toString()}const dS=new Map,IR=e=>{if(dS.has(e))return;const t=setTimeout(()=>{dS.delete(e),Yp({type:"REMOVE_TOAST",toastId:e})},hne);dS.set(e,t)},pne=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,fne)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;
vendor: 14,037 bytes, line 40
40return n?IR(n):e.toasts.forEach(r=>{IR(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},ub=[];let db={toasts:[]};function Yp(e){db=pne(db,e),ub.forEach(t=>{t(db)})}function sn({...e}){const t=mne(),n=a=>Yp({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Yp({type:"DISMISS_TOAST",toastId:t});return Yp({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function uB(){const[e,t]=x.useState(db);return x.useEffect(()=>(ub.push(t),()=>{const n=ub.indexOf(t);n>-1&&ub.splice(n,1)}),[e]),{...e,toast:sn,dismiss:n=>Yp({type:"DISMISS_TOAST",toastId:n})}}function je(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e==null||e(a),n===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function LR(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Nj(...e){return t=>{let n=!1;const r=e.map(a=>{const i=LR(a,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let a=0;a<r.length;a++){const i=r[a];typeof i=="function"?i():LR(e[a],null)}}}}function qe(...e){return x.useCallback(Nj(...e),e)}function gne(e,t){const n=x.createContext(t),r=i=>{const{children:o,...l}=i,c=x.useMemo(()=>l,Object.values(l));return s.jsx(n.Provider,{value:c,children:o})};r.displayName=e+"Provider";function a(i){const o=x.useContext(n);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,a]}function kn(e,t=[]){let n=[];function r(i,o){const l=x.createContext(o),c=n.length;n=[...n,o];const u=f=>{var v;const{scope:h,children:m,...p}=f,g=((v=h==null?void 0:h[e])==null?void 0:v[c])||l,y=x.useMemo(()=>p,Object.values(p));return s.jsx(g.Provider,{value:y,children:m})};u.displayName=i+"Provider";function d(f,h){var g;const m=((g=h==null?void 0:h[e])==null?void 0:g[c])||l,p=x.useContext(m);if(p)return p;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[u,d]}const a=()=>{const i=n.map(o=>x.createContext(o));return function(l){const c=(l==null?void 0:l[e])||i;return x.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return a.scopeName=e,[r,yne(a,...t)]}function yne(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=r.reduce((l,{useScope:c,scopeName:u})=>{const f=c(i)[`__scope${u}`];return{...l,...f}},{});return x.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return n.scopeName=t.scopeName,n}function Rc(e){const t=xne(e),n=x.forwardRef((r,a)=>{const{children:i,...o}=r,l=x.Children.toArray(i),c=l.find(bne);if(c){const u=c.props.children,d=l.map(f=>f===c?x.Children.count(u)>1?x.Children.only(null):x.isValidElement(u)?u.props.children:null:f);return s.jsx(t,{...o,ref:a,children:x.isValidElement(u)?x.cloneElement(u,void 0,d):null})}return s.jsx(t,{...o,ref:a,children:i})});return n.displayName=`${e}.Slot`,n}var vne=Rc("Slot");function xne(e){const t=x.forwardRef((n,r)=>{const{children:a,...i}=n;if(x.isValidElement(a)){const o=jne(a),l=wne(i,a.props);return a.type!==x.Fragment&&(l.ref=r?Nj(r,o):o),x.cloneElement(a,l)}return x.Children.count(a)>1?x.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dB=Symbol("radix.slottable");function fB(e){const t=({children:n})=>s.jsx(s.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=dB,t}function bne(e){return x.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dB}function wne(e,t){const n={...t};for(const r in t){const a=e[r],i=t[r];/^on[A-Z]/.test(r)?a&&i?n[r]=(...l)=>{const c=i(...l);return a(...l),c}:a&&(n[r]=a):r==="style"?n[r]={...a,...i}:r==="className"&&(n[r]=[a,i].filter(Boolean).join(" "))}return{...e,...n}}function jne(e){var r,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function mm(e){const t=e+"CollectionProvider",[n,r]=kn(t),[a,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:y,children:v}=g,w=L.useRef(null),b=L.useRef(new Map).current;return s.jsx(a,{scope:y,itemMap:b,collectionRef:w,children:v})};o.displayName=t;const l=e+"CollectionSlot",c=Rc(l),u=L.forwardRef((g,y)=>{const{scope:v,children:w}=g,b=i(l,v),j=qe(y,b.collectionRef);return s.jsx(c,{ref:j,children:w})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",h=Rc(d),m=L.forwardRef((g,y)=>{const{scope:v,children:w,...b}=g,j=L.useRef(null),N=qe(y,j),S=i(d,v);return L.useEffect(()=>(S.itemMap.set(j,{ref:j,...b}),()=>void S.itemMap.delete(j))),s.jsx(h,{[f]:"",ref:N,children:w})});m.displayName=d;function p(g){const y=i(e+"CollectionConsumer",g);return L.useCallback(()=>{const w=y.collectionRef.current;if(!w)return[];const b=Array.from(w.querySelectorAll(`[${f}]`));return Array.from(y.itemMap.values()).sort((S,C)=>b.indexOf(S.ref.current)-b.indexOf(C.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:o,Slot:u,ItemSlot:m},p,r]}var Nne=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=Nne.reduce((e,t)=>{const n=Rc(`Primitive.${t}`),r=x.forwardRef((a,i)=>{const{asChild:o,...l}=a,c=o?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(c,{...l,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function UP(e,t){e&&Cs.flushSync(()=>e.dispatchEvent(t))}function In(e){const t=x.useRef(e);return x.useEffect(()=>{t.current=e}),x.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Sne(e,t=globalThis==null?void 0:globalThis.document){const n=In(e);x.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Cne="DismissableLayer",k_="dismissableLayer.update",_ne="dismissableLayer.pointerDownOutside",Ene="dismissableLayer.focusOutside",FR,hB=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pd=x.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...c}=e,u=x.useContext(hB),[d,f]=x.useState(null),h=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=x.useState({}),p=qe(t,C=>f(C)),g=Array.from(u.layers),[y]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(y),w=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,j=w>=v,N=Pne(C=>{const _=C.target,E=[...u.branches].some(T=>T.contains(_));!j||E||(a==null||a(C),o==null||o(C),C.defaultPrevented||l==null||l())},h),S=kne(C=>{const _=C.target;[...u.branches].some(T=>T.contains(_))||(i==null||i(C),o==null||o(C),C.defaultPrevented||l==null||l())},h);return Sne(C=>{w===u.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&l&&(C.preventDefault(),l()))},h),x.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(FR=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),BR(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=FR)}},[d,h,n,u]),x.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),BR())},[d,u]),x.useEffect(()=>{const C=()=>m({});return document.addEventListener(k_,C),()=>document.removeEventListener(k_,C)},[]),s.jsx(Pe.div,{...c,ref:p,style:{pointerEvents:b?j?"auto":"none":void 0,...e.style},onFocusCapture:je(e.onFocusCapture,S.onFocusCapture),onBlurCapture:je(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:je(e.onPointerDownCapture,N.onPointerDownCapture)})});Pd.displayName=Cne;var Ane="DismissableLayerBranch",mB=x.forwardRef((e,t)=>{const n=x.useContext(hB),r=x.useRef(null),a=qe(t,r);return x.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),s.jsx(Pe.div,{...e,ref:a})});mB.displayName=Ane;function Pne(e,t=globalThis==null?void 0:globalThis.document){const n=In(e),r=x.useRef(!1),a=x.useRef(()=>{});return x.useEffect(()=>{const i=l=>{if(l.target&&!r.current){let c=function(){pB(_ne,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=c,t.addEventListener("click",a.current,{once:!0})):c()}else t.removeEventListener("click",a.current);r.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function kne(e,t=globalThis==null?void 0:globalThis.document){const n=In(e),r=x.useRef(!1);return x.useEffect(()=>{const a=i=>{i.target&&!r.current&&pB(Ene,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function BR(){const e=new CustomEvent(k_);document.dispatchEvent(e)}function pB(e,t,n,{discrete:r}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?UP(a,i):a.dispatchEvent(i)}var One=Pd,Tne=mB,Fn=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},Mne="Portal",pm=x.forwardRef((e,t)=>{var l;const{container:n,...r}=e,[a,i]=x.useState(!1);Fn(()=>i(!0),[]);const o=n||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?lB.createPortal(s.jsx(Pe.div,{...r,ref:t}),o):null});pm.displayName=Mne;function Rne(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var Jn=e=>{const{present:t,children:n}=e,r=Dne(t),a=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),i=qe(r.ref,$ne(a));return typeof n=="function"||r.isPresent?x.cloneElement(a,{ref:i}):null};Jn.displayName="Presence";function Dne(e){const[t,n]=x.useState(),r=x.useRef(null),a=x.useRef(e),i=x.useRef("none"),o=e?"mounted":"unmounted",[l,c]=Rne(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=px(r.current);i.current=l==="mounted"?u:"none"},[l]),Fn(()=>{const u=r.current,d=a.current;if(d!==e){const h=i.current,m=px(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,c]),Fn(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,f=m=>{const g=px(r.current).includes(m.animationName);if(m.target===t&&g&&(c("ANIMATION_END"),!a.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},h=m=>{m.target===t&&(i.current=px(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",f),t.addEventListener("animationend",f),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",f),t.removeEventListener("animationend",f)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:x.useCallback(u=>{r.current=u?getComputedStyle(u):null,n(u)},[])}}function px(e){return(e==null?void 0:e.animationName)||"none"}function $ne(e){var r,a;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=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Ine=QA[" useInsertionEffect ".trim().toString()]||Fn;function fr({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,i,o]=Lne({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:a;{const d=x.useRef(e!==void 0);x.useEffect(()=>{const f=d.current;f!==l&&console.warn(`${r} is changing from ${f?"controlled":"uncontrolled"} to ${l?"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.`),d.current=l},[l,r])}const u=x.useCallback(d=>{var f;if(l){const h=Fne(d)?d(e):d;h!==e&&((f=o.current)==null||f.call(o,h))}else i(d)},[l,e,i,o]);return[c,u]}function Lne({defaultProp:e,onChange:t}){const[n,r]=x.useState(e),a=x.useRef(n),i=x.useRef(t);return Ine(()=>{i.current=t},[t]),x.useEffect(()=>{var o;a.current!==n&&((o=i.current)==null||o.call(i,n),a.current=n)},[n,a]),[n,r,i]}function Fne(e){return typeof e=="function"}var gB=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"}),Bne="VisuallyHidden",Sj=x.forwardRef((e,t)=>s.jsx(Pe.span,{...e,ref:t,style:{...gB,...e.style}}));Sj.displayName=Bne;var zne=Sj,VP="ToastProvider",[WP,Une,Vne]=mm("Toast"),[yB,znt]=kn("Toast",[Vne]),[Wne,Cj]=yB(VP),vB=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:i=50,children:o}=e,[l,c]=x.useState(null),[u,d]=x.useState(0),f=x.useRef(!1),h=x.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${VP}\`. Expected non-empty \`string\`.`),s.jsx(WP.Provider,{scope:t,children:s.jsx(Wne,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:x.useCallback(()=>d(m=>m+1),[]),onToastRemove:x.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:h,children:o})})};vB.displayName=VP;var xB="ToastViewport",qne=["F8"],O_="toast.viewportPause",T_="toast.viewportResume",bB=x.forwardRef((e,t)=>
40{const{__scopeToast:n,hotkey:r=qne,label:a="Notifications ({hotkey})",...i}=e,o=Cj(xB,n),l=Une(n),c=x.useRef(null),u=x.useRef(null),d=x.useRef(null),f=x.useRef(null),h=qe(t,f,o.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),p=o.toastCount>0;x.useEffect(()=>{const y=v=>{var b;r.length!==0&&r.every(j=>v[j]||v.code===j)&&((b=f.current)==null||b.focus())};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[r]),x.useEffect(()=>{const y=c.current,v=f.current;if(p&&y&&v){const w=()=>{if(!o.isClosePausedRef.current){const S=new CustomEvent(O_);v.dispatchEvent(S),o.isClosePausedRef.current=!0}},b=()=>{if(o.isClosePausedRef.current){const S=new CustomEvent(T_);v.dispatchEvent(S),o.isClosePausedRef.current=!1}},j=S=>{!y.contains(S.relatedTarget)&&b()},N=()=>{y.contains(document.activeElement)||b()};return y.addEventListener("focusin",w),y.addEventListener("focusout",j),y.addEventListener("pointermove",w),y.addEventListener("pointerleave",N),window.addEventListener("blur",w),window.addEventListener("focus",b),()=>{y.removeEventListener("focusin",w),y.removeEventListener("focusout",j),y.removeEventListener("pointermove",w),y.removeEventListener("pointerleave",N),window.removeEventListener("blur",w),window.removeEventListener("focus",b)}}},[p,o.isClosePausedRef]);const g=x.useCallback(({tabbingDirection:y})=>{const w=l().map(b=>{const j=b.ref.current,N=[j,...are(j)];return y==="forwards"?N:N.reverse()});return(y==="forwards"?w.reverse():w).flat()},[l]);return x.useEffect(()=>{const y=f.current;if(y){const v=w=>{var N,S,C;const b=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!b){const _=document.activeElement,E=w.shiftKey;if(w.target===y&&E){(N=u.current)==null||N.focus();return}const k=g({tabbingDirection:E?"backwards":"forwards"}),D=k.findIndex(A=>A===_);fS(k.slice(D+1))?w.preventDefault():E?(S=u.current)==null||S.focus():(C=d.current)==null||C.focus()}};return y.addEventListener("keydown",v),()=>y.removeEventListener("keydown",v)}},[l,g]),s.jsxs(Tne,{ref:c,role:"region","aria-label":a.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:p?void 0:"none"},children:[p&&s.jsx(M_,{ref:u,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"forwards"});fS(y)}}),s.jsx(WP.Slot,{scope:n,children:s.jsx(Pe.ol,{tabIndex:-1,...i,ref:h})}),p&&s.jsx(M_,{ref:d,onFocusFromOutsideViewport:()=>{const y=g({tabbingDirection:"backwards"});fS(y)}})]})});bB.displayName=xB;var wB="ToastFocusProxy",M_=x.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,i=Cj(wB,n);return s.jsx(Sj,{"aria-hidden":!0,tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:o=>{var u;const l=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(l))&&r()}})});M_.displayName=wB;var ev="Toast",Hne="toast.swipeStart",Kne="toast.swipeMove",Gne="toast.swipeCancel",Yne="toast.swipeEnd",jB=x.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:i,...o}=e,[l,c]=fr({prop:r,defaultProp:a??!0,onChange:i,caller:ev});return s.jsx(Jn,{present:n||l,children:s.jsx(Jne,{open:l,...o,ref:t,onClose:()=>c(!1),onPause:In(e.onPause),onResume:In(e.onResume),onSwipeStart:je(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:je(e.onSwipeMove,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${f}px`)}),onSwipeCancel:je(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:je(e.onSwipeEnd,u=>{const{x:d,y:f}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${f}px`),c(!1)})})})});jB.displayName=ev;var[Xne,Qne]=yB(ev,{onClose(){}}),Jne=x.forwardRef((e,t)=>
40{const{__scopeToast:n,type:r="foreground",duration:a,open:i,onClose:o,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:h,onSwipeEnd:m,...p}=e,g=Cj(ev,n),[y,v]=x.useState(null),w=qe(t,A=>v(A)),b=x.useRef(null),j=x.useRef(null),N=a||g.duration,S=x.useRef(0),C=x.useRef(N),_=x.useRef(0),{onToastAdd:E,onToastRemove:T}=g,P=In(()=>{var I;(y==null?void 0:y.contains(document.activeElement))&&((I=g.viewport)==null||I.focus()),o()}),k=x.useCallback(A=>{!A||A===1/0||(window.clearTimeout(_.current),S.current=new Date().getTime(),_.current=window.setTimeout(P,A))},[P]);x.useEffect(()=>{const A=g.viewport;if(A){const I=()=>{k(C.current),u==null||u()},M=()=>{const $=new Date().getTime()-S.current;C.current=C.current-$,window.clearTimeout(_.current),c==null||c()};return A.addEventListener(O_,M),A.addEventListener(T_,I),()=>{A.removeEventListener(O_,M),A.removeEventListener(T_,I)}}},[g.viewport,N,c,u,k]),x.useEffect(()=>{i&&!g.isClosePausedRef.current&&k(N)},[i,N,g.isClosePausedRef,k]),x.useEffect(()=>(E(),()=>T()),[E,T]);const D=x.useMemo(()=>y?PB(y):null,[y]);return g.viewport?s.jsxs(s.Fragment,{children:[D&&s.jsx(Zne,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),s.jsx(Xne,{scope:n,onClose:P,children:Cs.createPortal(s.jsx(WP.ItemSlot,{scope:n,children:s.jsx(One,{asChild:!0,onEscapeKeyDown:je(l,()=>{g.isFocusedToastEscapeKeyDownRef.current||P(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:s.jsx(Pe.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":g.swipeDirection,...p,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:je(e.onKeyDown,A=>{A.key==="Escape"&&(l==null||l(A.nativeEvent),A.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,P()))}),onPointerDown:je(e.onPointerDown,A=>{A.button===0&&(b.current={x:A.clientX,y:A.clientY})}),onPointerMove:je(e.onPointerMove,A=>{if(!b.current)return;const I=A.clientX-b.current.x,M=A.clientY-b.current.y,$=!!j.current,R=["left","right"].includes(g.swipeDirection),O=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,F=R?O(0,I):0,z=R?0:O(0,M),B=A.pointerType==="touch"?10:2,H={x:F,y:z},Y={originalEvent:A,delta:H};$?(j.current=H,gx(Kne,f,Y,{discrete:!1})):zR(H,g.swipeDirection,B)?(j.current=H,gx(Hne,d,Y,{discrete:!1}),A.target.setPointerCapture(A.pointerId)):(Math.abs(I)>B||Math.abs(M)>B)&&(b.current=null)}),onPointerUp:je(e.onPointerUp,A=>{const I=j.current,M=A.target;if(M.hasPointerCapture(A.pointerId)&&M.releasePointerCapture(A.pointerId),j.current=null,b.current=null,I){const $=A.currentTarget,R={originalEvent:A,delta:I};zR(I,g.swipeDirection,g.swipeThreshold)?gx(Yne,m,R,{discrete:!0}):gx(Gne,h,R,{discrete:!0}),$.addEventListener("click",O=>O.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}
40),Zne=e=>{const{__scopeToast:t,children:n,...r}=e,a=Cj(ev,t),[i,o]=x.useState(!1),[l,c]=x.useState(!1);return nre(()=>o(!0)),x.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:s.jsx(pm,{asChild:!0,children:s.jsx(Sj,{...r,children:i&&s.jsxs(s.Fragment,{children:[a.label," ",n]})})})},ere="ToastTitle",NB=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Pe.div,{...r,ref:t})});NB.displayName=ere;var tre="ToastDescription",SB=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return s.jsx(Pe.div,{...r,ref:t})});SB.displayName=tre;var CB="ToastAction",_B=x.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?s.jsx(AB,{altText:n,asChild:!0,children:s.jsx(qP,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${CB}\`. Expected non-empty \`string\`.`),null)});_B.displayName=CB;var EB="ToastClose",qP=x.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=Qne(EB,n);return s.jsx(AB,{asChild:!0,children:s.jsx(Pe.button,{type:"button",...r,ref:t,onClick:je(e.onClick,a.onClose)})})});qP.displayName=EB;var AB=x.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return s.jsx(Pe.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function PB(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),rre(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!a)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...PB(r))}}),t}function gx(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?UP(a,i):a.dispatchEvent(i)}var zR=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),i=r>a;return t==="left"||t==="right"?i&&r>n:!i&&a>n};function nre(e=()=>{}){const t=In(e);Fn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function rre(e){return e.nodeType===e.ELEMENT_NODE}function are(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function fS(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var sre=vB,kB=bB,OB=jB,TB=NB,MB=SB,RB=_B,DB=qP;function $B(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=$B(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ge(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=$B(e))&&(r&&(r+=" "),r+=t);return r}const UR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,VR=Ge,kd=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return VR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:i}=t,o=Object.keys(a).map(u=>{const d=n==null?void 0:n[u],f=i==null?void 0:i[u];if(d===null)return null;const h=UR(d)||UR(f);return a[u][h]}),l=n&&Object.entries(n).reduce((u,d)=>{let[f,h]=d;return h===void 0||(u[f]=h),u},{}),c=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:f,className:h,...m}=d;return Object.entries(m).every(p=>{let[g,y]=p;return Array.isArray(y)?y.includes({...i,...l}[g]):{...i,...l}[g]===y})?[...u,f,h]:u},[]);return VR(e,o,c,n==null?void 0:n.class,n==null?void 0:n.className)};/**
41 * @license lucide-react v0.462.0 - ISC
42 *
43 * This source code is licensed under the ISC license.
44 * See the LICENSE file in the root directory of this source tree.
45 */const ire=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),IB=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
46 * @license lucide-react v0.462.0 - ISC
47 *
48 * This source code is licensed under the ISC license.
49 * See the LICENSE file in the root directory of this source tree.
50 */var ore={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"};/**
51 * @license lucide-react v0.462.0 - ISC
52 *
53 * This source code is licensed under the ISC license.
54 * See the LICENSE file in the root directory of this source tree.
55 */const lre=x.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:i,iconNode:o,...l},c)=>x.createElement("svg",{ref:c,...ore,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:IB("lucide",a),...l},[...o.map(([u,d])=>x.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
56 * @license lucide-react v0.462.0 - ISC
57 *
58 * This source code is licensed under the ISC license.
59 * See the LICENSE file in the root directory of this source tree.
60 */const de=(e,t)=>{const n=x.forwardRef(({className:r,...a},i)=>x.createElement(lre,{ref:i,iconNode:t,className:IB(`lucide-${ire(e)}`,r),...a}));return n.displayName=`${e}`,n};/**
61 * @license lucide-react v0.462.0 - ISC
62 *
63 * This source code is licensed under the ISC license.
64 * See the LICENSE file in the root directory of this source tree.
65 */const ai=de("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l
65-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
66 * @license lucide-react v0.462.0 - ISC
67 *
68 * This source code is licensed under the ISC license.
69 * See the LICENSE file in the root directory of this source tree.
70 */const cre=de("AlignCenter",[["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 18H5",key:"18s9l3"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
71 * @license lucide-react v0.462.0 - ISC
72 *
73 * This source code is licensed under the ISC license.
74 * See the LICENSE file in the root directory of this source tree.
75 */const R_=de("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
76 * @license lucide-react v0.462.0 - ISC
77 *
78 * This source code is licensed under the ISC license.
79 * See the LICENSE file in the root directory of this source tree.
80 */const ure=de("AlignRight",[["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 18H7",key:"1ygte8"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/**
81 * @license lucide-react v0.462.0 - ISC
82 *
83 * This source code is licensed under the ISC license.
84 * See the LICENSE file in the root directory of this source tree.
85 */const dre=de("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
86 * @license lucide-react v0.462.0 - ISC
87 *
88 * This source code is licensed under the ISC license.
89 * See the LICENSE file in the root directory of this source tree.
90 */const Yr=de("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
91 * @license lucide-react v0.462.0 - ISC
92 *
93 * This source code is licensed under the ISC license.
94 * See the LICENSE file in the root directory of this source tree.
95 */const D_=de("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
96 * @license lucide-react v0.462.0 - ISC
97 *
98 * This source code is licensed under the ISC license.
99 * See the LICENSE file in the root directory of this source tree.
100 */const fre=de("ArrowUpDown",[["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"}]]);/**
101 * @license lucide-react v0.462.0 - ISC
102 *
103 * This source code is licensed under the ISC license.
104 * See the LICENSE file in the root directory of this source tree.
105 */const LB=de("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
106 * @license lucide-react v0.462.0 - ISC
107 *
108 * This source code is licensed under the ISC license.
109 * See the LICENSE file in the root directory of this source tree.
110 */const Vu=de("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
111 * @license lucide-react v0.462.0 - ISC
112 *
113 * This source code is licensed under the ISC license.
114 * See the LICENSE file in the root directory of this source tree.
115 */const $_=de("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
116 * @license lucide-react v0.462.0 - ISC
117 *
118 * This source code is licensed under the ISC license.
119 * See the LICENSE file in the root directory of this source tree.
120 */const hre=de("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
120],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
121 * @license lucide-react v0.462.0 - ISC
122 *
123 * This source code is licensed under the ISC license.
124 * See the LICENSE file in the root directory of this source tree.
125 */const mre=de("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
126 * @license lucide-react v0.462.0 - ISC
127 *
128 * This source code is licensed under the ISC license.
129 * See the LICENSE file in the root directory of this source tree.
130 */const Zs=de("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
131 * @license lucide-react v0.462.0 - ISC
132 *
133 * This source code is licensed under the ISC license.
134 * See the LICENSE file in the root directory of this source tree.
135 */const I_=de("ChartArea",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z",key:"q0gr47"}]]);/**
136 * @license lucide-react v0.462.0 - ISC
137 *
138 * This source code is licensed under the ISC license.
139 * See the LICENSE file in the root directory of this source tree.
140 */const Xn=de("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
141 * @license lucide-react v0.462.0 - ISC
142 *
143 * This source code is licensed under the ISC license.
144 * See the LICENSE file in the root directory of this source tree.
145 */const FB=de("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/**
146 * @license lucide-react v0.462.0 - ISC
147 *
148 * This source code is licensed under the ISC license.
149 * See the LICENSE file in the root directory of this source tree.
150 */const L_=de("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/**
151 * @license lucide-react v0.462.0 - ISC
152 *
153 * This source code is licensed under the ISC license.
154 * See the LICENSE file in the root directory of this source tree.
155 */const F_=de("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/**
156 * @license lucide-react v0.462.0 - ISC
157 *
158 * This source code is licensed under the ISC license.
159 * See the LICENSE file in the root directory of this source tree.
160 */const B_=de("ChartScatter",[["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}],["circle",{cx:"18.5",cy:"5.5",r:".5",fill:"currentColor",key:"lysivs"}],["circle",{cx:"11.5",cy:"11.5",r:".5",fill:"currentColor",key:"byv1b8"}],["circle",{cx:"7.5",cy:"16.5",r:".5",fill:"currentColor",key:"nkw3mc"}],["circle",{cx:"17.5",cy:"14.5",r:".5",fill:"currentColor",key:"1gjh6j"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}]]);/**
161 * @license lucide-react v0.462.0 - ISC
162 *
163 * This source code is licensed under the ISC license.
164 * See the LICENSE file in the root directory of this source tree.
165 */const bt=de("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
166 * @license lucide-react v0.462.0 - ISC
167 *
168 * This source code is licensed under the ISC license.
169 * See the LICENSE file in the root directory of this source tree.
170 */const Jr=de("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
171 * @license lucide-react v0.462.0 - ISC
172 *
173 * This source code is licensed under the ISC license.
174 * See the LICENSE file in the root directory of this source tree.
175 */const Wu=de("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
176 * @license lucide-react v0.462.0 - ISC
177 *
178 * This source code is licensed under the ISC license.
179 * See the LICENSE file in the root directory of this source tree.
180 */const si=de("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
181 * @license lucide-react v0.462.0 - ISC
182 *
183 * This source code is licensed under the ISC license.
184 * See the LICENSE file in the root directory of this source tree.
185 */const Zi=de("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
186 * @license lucide-react v0.462.0 - ISC
187 *
188 * This source code is licensed under the ISC license.
189 * See the LICENSE file in the root directory of this source tree.
190 */const Yn=de("CircleAlert",[["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"}]]);/**
191 * @license lucide-react v0.462.0 - ISC
192 *
193 * This source code is licensed under the ISC license.
194 * See the LICENSE file in the root directory of this source tree.
195 */const _j=de("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
196 * @license lucide-react v0.462.0 - ISC
197 *
198 * This source code is licensed under the ISC license.
199 * See the LICENSE file in the root directory of this source tree.
200 */const BB=de("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
201 * @license lucide-react v0.462.0 - ISC
202 *
203 * This source code is licensed under the ISC license.
204 * See the LICENSE file in the root directory of this source tree.
205 */const zB=de("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
206 * @license lucide-react v0.462.0 - ISC
207 *
208 * This source code is licensed under the ISC license.
209 * See the LICENSE file in the root directory of this source tree.
210 */const Ej=de("CircleX",[["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"}]]);/**
211 * @license lucide-react v0.462.0 - ISC
212 *
213 * This source code is licensed under the ISC license.
214 * See the LICENSE file in the root directory of this source tree.
215 */const UB=de("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/**
216 * @license lucide-react v0.462.0 - ISC
217 *
218 * This source code is licensed under the ISC license.
219 * See the LICENSE file in the root directory of this source tree.
220 */const Aj=de("Clipboard",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}]]);/**
221 * @license lucide-react v0.462.0 - ISC
222 *
223 * This source code is licensed under the ISC license.
224 * See the LICENSE file in the root directory of this source tree.
225 */const tv=de("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
226 * @license lucide-react v0.462.0 - ISC
227 *
228 * This source code is licensed under the ISC license.
229 * See the LICENSE file in the root directory of this source tree.
230 */const Pj=de("CodeXml",[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]]);/**
231 * @license lucide-react v0.462.0 - ISC
232 *
233 * This source code is licensed under the ISC license.
234 * See the LICENSE file in the root directory of this source tree.
235 */const HP=de("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/**
236 * @license lucide-react v0.462.0 - ISC
237 *
238 * This source code is licensed under the ISC license.
239 * See the LICENSE file in the root directory of this source tree.
240 */const z_=de("Columns3",[["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"}]]);/**
241 * @license lucide-react v0.462.0 - ISC
242 *
243 * This source code is licensed under the ISC license.
244 * See the LICENSE file in the root directory of this source tree.
245 */const VB=de("Cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);/**
246 * @license lucide-react v0.462.0 - ISC
247 *
248 * This source code is licensed under the ISC license.
249 * See the LICENSE file in the root directory of this source tree.
250 */const Od=de("Copy",[["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"}]]);/**
251 * @license lucide-react v0.462.0 - ISC
252 *
253 * This source code is licensed under the ISC license.
254 * See the LICENSE file in the root directory of this source tree.
255 */const Zo=de("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
256 * @license lucide-react v0.462.0 - ISC
257 *
258 * This source code is licensed under the ISC license.
259 * See the LICENSE file in the root directory of this source tree.
260 */const eo=de("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
261 * @license lucide-react v0.462.0 - ISC
262 *
263 * This source code is licensed under the ISC license.
264 * See the LICENSE file in the root directory of this source tree.
265 */const wt=de("Database",[["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"}]]);/**
266 * @license lucide-react v0.462.0 - ISC
267 *
268 * This source code is licensed under the ISC license.
269 * See the LICENSE file in the root directory of this source tree.
270 */const Tg=de("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
271 * @license lucide-react v0.462.0 - ISC
272 *
273 * This source code is licensed under the ISC license.
274 * See the LICENSE file in the root directory of this source tree.
275 */const ci=de("Download",[["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"}]]);/**
276 * @license lucide-react v0.462.0 - ISC
277 *
278 * This source code is licensed under the ISC license.
279 * See the LICENSE file in the root directory of this source tree.
280 */const pre=de("EllipsisVertical",[["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"}]]);/**
281 * @license lucide-react v0.462.0 - ISC
282 *
283 * This source code is licensed under the ISC license.
284 * See the LICENSE file in the root directory of this source tree.
285 */const fh=de("Ellipsis",[["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"}]]);/**
286 * @license lucide-react v0.462.0 - ISC
287 *
288 * This source code is licensed under the ISC license.
289 * See the LICENSE file in the root directory of this source tree.
290 */const xf=de("ExternalLink",[["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"}]]);/**
291 * @license lucide-react v0.462.0 - ISC
292 *
293 * This source code is licensed under the ISC license.
294 * See the LICENSE file in the root directory of this source tree.
295 */const gre=de("EyeOff",[["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"}]]);/**
296 * @license lucide-react v0.462.0 - ISC
297 *
298 * This source code is licensed under the ISC license.
299 * See the LICENSE file in the root directory of this source tree.
300 */const ui=de("Eye",[["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"}]]);/**
301 * @license lucide-react v0.462.0 - ISC
302 *
303 * This source code is licensed under the ISC license.
304 * See the LICENSE file in the root directory of this source tree.
305 */const _s=de("FileSpreadsheet",[["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:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/**
306 * @license lucide-react v0.462.0 - ISC
307 *
308 * This source code is licensed under the ISC license.
309 * See the LICENSE file in the root directory of this source tree.
310 */const di=de("FileText",[["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"}]]);/**
311 * @license lucide-react v0.462.0 - ISC
312 *
313 * This source code is licensed under the ISC license.
314 * See the LICENSE file in the root directory of this source tree.
315 */const Va=de("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
316 * @license lucide-react v0.462.0 - ISC
317 *
318 * This source code is licensed under the ISC license.
319 * See the LICENSE file in the root directory of this source tree.
320 */const WB=de("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
321 * @license lucide-react v0.462.0 - ISC
322 *
323 * This source code is licensed under the ISC license.
324 * See the LICENSE file in the root directory of this source tree.
325 */const yre=de("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/**
326 * @license lucide-react v0.462.0 - ISC
327 *
328 * This source code is licensed under the ISC license.
329 * See the LICENSE file in the root directory of this source tree.
330 */const gm=de("Grid3x3",[["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"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
331 * @license lucide-react v0.462.0 - ISC
332 *
333 * This source code is licensed under the ISC license.
334 * See the LICENSE file in the root directory of this source tree.
335 */const nv=de("GripVertical",[["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"}]]);/**
336 * @license lucide-react v0.462.0 - ISC
337 *
338 * This source code is licensed under the ISC license.
339 * See the LICENSE file in the root directory of this source tree.
340 */const qB=de("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}
340]]);/**
341 * @license lucide-react v0.462.0 - ISC
342 *
343 * This source code is licensed under the ISC license.
344 * See the LICENSE file in the root directory of this source tree.
345 */const nd=de("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);/**
346 * @license lucide-react v0.462.0 - ISC
347 *
348 * This source code is licensed under the ISC license.
349 * See the LICENSE file in the root directory of this source tree.
350 */const vre=de("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/**
351 * @license lucide-react v0.462.0 - ISC
352 *
353 * This source code is licensed under the ISC license.
354 * See the LICENSE file in the root directory of this source tree.
355 */const xre=de("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]);/**
356 * @license lucide-react v0.462.0 - ISC
357 *
358 * This source code is licensed under the ISC license.
359 * See the LICENSE file in the root directory of this source tree.
360 */const bre=de("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/**
361 * @license lucide-react v0.462.0 - ISC
362 *
363 * This source code is licensed under the ISC license.
364 * See the LICENSE file in the root directory of this source tree.
365 */const hh=de("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
366 * @license lucide-react v0.462.0 - ISC
367 *
368 * This source code is licensed under the ISC license.
369 * See the LICENSE file in the root directory of this source tree.
370 */const ym=de("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
371 * @license lucide-react v0.462.0 - ISC
372 *
373 * This source code is licensed under the ISC license.
374 * See the LICENSE file in the root directory of this source tree.
375 */const wre=de("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/**
376 * @license lucide-react v0.462.0 - ISC
377 *
378 * This source code is licensed under the ISC license.
379 * See the LICENSE file in the root directory of this source tree.
380 */const Mg=de("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/**
381 * @license lucide-react v0.462.0 - ISC
382 *
383 * This source code is licensed under the ISC license.
384 * See the LICENSE file in the root directory of this source tree.
385 */const jre=de("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
386 * @license lucide-react v0.462.0 - ISC
387 *
388 * This source code is licensed under the ISC license.
389 * See the LICENSE file in the root directory of this source tree.
390 */const Nre=de("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/**
391 * @license lucide-react v0.462.0 - ISC
392 *
393 * This source code is licensed under the ISC license.
394 * See the LICENSE file in the root directory of this source tree.
395 */const kj=de("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
396 * @license lucide-react v0.462.0 - ISC
397 *
398 * This source code is licensed under the ISC license.
399 * See the LICENSE file in the root directory of this source tree.
400 */const rd=de("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);/**
401 * @license lucide-react v0.462.0 - ISC
402 *
403 * This source code is licensed under the ISC license.
404 * See the LICENSE file in the root directory of this source tree.
405 */const HB=de("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
406 * @license lucide-react v0.462.0 - ISC
407 *
408 * This source code is licensed under the ISC license.
409 * See the LICENSE file in the root directory of this source tree.
410 */const KB=de("ListOrdered",[["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/**
411 * @license lucide-react v0.462.0 - ISC
412 *
413 * This source code is licensed under the ISC license.
414 * See the LICENSE file in the root directory of this source tree.
415 */const el=de("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/**
416 * @license lucide-react v0.462.0 - ISC
417 *
418 * This source code is licensed under the ISC license.
419 * See the LICENSE file in the root directory of this source tree.
420 */const Te=de("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
421 * @license lucide-react v0.462.0 - ISC
422 *
423 * This source code is licensed under the ISC license.
424 * See the LICENSE file in the root directory of this source tree.
425 */const qu=de("Lock",[["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"}]]);/**
426 * @license lucide-react v0.462.0 - ISC
427 *
428 * This source code is licensed under the ISC license.
429 * See the LICENSE file in the root directory of this source tree.
430 */const GB=de("LogOut",[["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"}]]);/**
431 * @license lucide-react v0.462.0 - ISC
432 *
433 * This source code is licensed under the ISC license.
434 * See the LICENSE file in the root directory of this source tree.
435 */const KP=de("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
436 * @license lucide-react v0.462.0 - ISC
437 *
438 * This source code is licensed under the ISC license.
439 * See the LICENSE file in the root directory of this source tree.
440 */const Sre=de("Menu",[["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"}]]);/**
441 * @license lucide-react v0.462.0 - ISC
442 *
443 * This source code is licensed under the ISC license.
444 * See the LICENSE file in the root directory of this source tree.
445 */const Cre=de("MessageCircleQuestion",[["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"}]]);/**
446 * @license lucide-react v0.462.0 - ISC
447 *
448 * This source code is licensed under the ISC license.
449 * See the LICENSE file in the root directory of this source tree.
450 */const YB=de("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
451 * @license lucide-react v0.462.0 - ISC
452 *
453 * This source code is licensed under the ISC license.
454 * See the LICENSE file in the root directory of this source tree.
455 */const Rg=de("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
456 * @license lucide-react v0.462.0 - ISC
457 *
458 * This source code is licensed under the ISC license.
459 * See the LICENSE file in the root directory of this source tree.
460 */const _re=de("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
461 * @license lucide-react v0.462.0 - ISC
462 *
463 * This source code is licensed under the ISC license.
464 * See the LICENSE file in the root directory of this source tree.
465 */const GP=de("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
466 * @license lucide-react v0.462.0 - ISC
467 *
468 * This source code is licensed under the ISC license.
469 * See the LICENSE file in the root directory of this source tree.
470 */const Ere=de("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
471 * @license lucide-react v0.462.0 - ISC
472 *
473 * This source code is licensed under the ISC license.
474 * See the LICENSE file in the root directory of this source tree.
475 */const Are=de("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
476 * @license lucide-react v0.462.0 - ISC
477 *
478 * This source code is licensed under the ISC license.
479 * See the LICENSE file in the root directory of this source tree.
480 */const Pre=de("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
481 * @license lucide-react v0.462.0 - ISC
482 *
483 * This source code is licensed under the ISC license.
484 * See the LICENSE file in the root directory of this source tree.
485 */const YP=de("Pen",[["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"}]]);/**
486 * @license lucide-react v0.462.0 - ISC
487 *
488 * This source code is licensed under the ISC license.
489 * See the LICENSE file in the root directory of this source tree.
490 */const XP=de("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
491 * @license lucide-react v0.462.0 - ISC
492 *
493 * This source code is licensed under the ISC license.
494 * See the LICENSE file in the root directory of this source tree.
495 */const kre=de("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}
495],["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"}]]);/**
496 * @license lucide-react v0.462.0 - ISC
497 *
498 * This source code is licensed under the ISC license.
499 * See the LICENSE file in the root directory of this source tree.
500 */const Ln=de("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
501 * @license lucide-react v0.462.0 - ISC
502 *
503 * This source code is licensed under the ISC license.
504 * See the LICENSE file in the root directory of this source tree.
505 */const Ore=de("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
506 * @license lucide-react v0.462.0 - ISC
507 *
508 * This source code is licensed under the ISC license.
509 * See the LICENSE file in the root directory of this source tree.
510 */const XB=de("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/**
511 * @license lucide-react v0.462.0 - ISC
512 *
513 * This source code is licensed under the ISC license.
514 * See the LICENSE file in the root directory of this source tree.
515 */const Tre=de("Redo2",[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]]);/**
516 * @license lucide-react v0.462.0 - ISC
517 *
518 * This source code is licensed under the ISC license.
519 * See the LICENSE file in the root directory of this source tree.
520 */const Vn=de("RefreshCw",[["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"}]]);/**
521 * @license lucide-react v0.462.0 - ISC
522 *
523 * This source code is licensed under the ISC license.
524 * See the LICENSE file in the root directory of this source tree.
525 */const QB=de("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
526 * @license lucide-react v0.462.0 - ISC
527 *
528 * This source code is licensed under the ISC license.
529 * See the LICENSE file in the root directory of this source tree.
530 */const Mre=de("Scale",[["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"}]]);/**
531 * @license lucide-react v0.462.0 - ISC
532 *
533 * This source code is licensed under the ISC license.
534 * See the LICENSE file in the root directory of this source tree.
535 */const Dg=de("ScrollText",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/**
536 * @license lucide-react v0.462.0 - ISC
537 *
538 * This source code is licensed under the ISC license.
539 * See the LICENSE file in the root directory of this source tree.
540 */const ii=de("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
541 * @license lucide-react v0.462.0 - ISC
542 *
543 * This source code is licensed under the ISC license.
544 * See the LICENSE file in the root directory of this source tree.
545 */const JB=de("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
546 * @license lucide-react v0.462.0 - ISC
547 *
548 * This source code is licensed under the ISC license.
549 * See the LICENSE file in the root directory of this source tree.
550 */const Oj=de("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
551 * @license lucide-react v0.462.0 - ISC
552 *
553 * This source code is licensed under the ISC license.
554 * See the LICENSE file in the root directory of this source tree.
555 */const QP=de("Settings",[["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"}]]);/**
556 * @license lucide-react v0.462.0 - ISC
557 *
558 * This source code is licensed under the ISC license.
559 * See the LICENSE file in the root directory of this source tree.
560 */const ZB=de("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/**
561 * @license lucide-react v0.462.0 - ISC
562 *
563 * This source code is licensed under the ISC license.
564 * See the LICENSE file in the root directory of this source tree.
565 */const Rre=de("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
566 * @license lucide-react v0.462.0 - ISC
567 *
568 * This source code is licensed under the ISC license.
569 * See the LICENSE file in the root directory of this source tree.
570 */const Uc=de("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
571 * @license lucide-react v0.462.0 - ISC
572 *
573 * This source code is licensed under the ISC license.
574 * See the LICENSE file in the root directory of this source tree.
575 */const hS=de("Sigma",[["path",{d:"M18 7V5a1 1 0 0 0-1-1H6.5a.5.5 0 0 0-.4.8l4.5 6a2 2 0 0 1 0 2.4l-4.5 6a.5.5 0 0 0 .4.8H17a1 1 0 0 0 1-1v-2",key:"wuwx1p"}]]);/**
576 * @license lucide-react v0.462.0 - ISC
577 *
578 * This source code is licensed under the ISC license.
579 * See the LICENSE file in the root directory of this source tree.
580 */const JP=de("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
581 * @license lucide-react v0.462.0 - ISC
582 *
583 * This source code is licensed under the ISC license.
584 * See the LICENSE file in the root directory of this source tree.
585 */const Ca=de("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
586 * @license lucide-react v0.462.0 - ISC
587 *
588 * This source code is licensed under the ISC license.
589 * See the LICENSE file in the root directory of this source tree.
590 */const ez=de("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
591 * @license lucide-react v0.462.0 - ISC
592 *
593 * This source code is licensed under the ISC license.
594 * See the LICENSE file in the root directory of this source tree.
595 */const U_=de("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
596 * @license lucide-react v0.462.0 - ISC
597 *
598 * This source code is licensed under the ISC license.
599 * See the LICENSE file in the root directory of this source tree.
600 */const ap=de("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/**
601 * @license lucide-react v0.462.0 - ISC
602 *
603 * This source code is licensed under the ISC license.
604 * See the LICENSE file in the root directory of this source tree.
605 */const Dre=de("Sun",[["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"}]]);/**
606 * @license lucide-react v0.462.0 - ISC
607 *
608 * This source code is licensed under the ISC license.
609 * See the LICENSE file in the root directory of this source tree.
610 */const xr=de("Table2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]);/**
611 * @license lucide-react v0.462.0 - ISC
612 *
613 * This source code is licensed under the ISC license.
614 * See the LICENSE file in the root directory of this source tree.
615 */const ZP=de("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
616 * @license lucide-react v0.462.0 - ISC
617 *
618 * This source code is licensed under the ISC license.
619 * See the LICENSE file in the root directory of this source tree.
620 */const pn=de("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
620],["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"}]]);/**
621 * @license lucide-react v0.462.0 - ISC
622 *
623 * This source code is licensed under the ISC license.
624 * See the LICENSE file in the root directory of this source tree.
625 */const ek=de("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/**
626 * @license lucide-react v0.462.0 - ISC
627 *
628 * This source code is licensed under the ISC license.
629 * See the LICENSE file in the root directory of this source tree.
630 */const Wa=de("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
631 * @license lucide-react v0.462.0 - ISC
632 *
633 * This source code is licensed under the ISC license.
634 * See the LICENSE file in the root directory of this source tree.
635 */const ad=de("TriangleAlert",[["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"}]]);/**
636 * @license lucide-react v0.462.0 - ISC
637 *
638 * This source code is licensed under the ISC license.
639 * See the LICENSE file in the root directory of this source tree.
640 */const sd=de("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
641 * @license lucide-react v0.462.0 - ISC
642 *
643 * This source code is licensed under the ISC license.
644 * See the LICENSE file in the root directory of this source tree.
645 */const $re=de("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/**
646 * @license lucide-react v0.462.0 - ISC
647 *
648 * This source code is licensed under the ISC license.
649 * See the LICENSE file in the root directory of this source tree.
650 */const Ire=de("Unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]);/**
651 * @license lucide-react v0.462.0 - ISC
652 *
653 * This source code is licensed under the ISC license.
654 * See the LICENSE file in the root directory of this source tree.
655 */const WR=de("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
656 * @license lucide-react v0.462.0 - ISC
657 *
658 * This source code is licensed under the ISC license.
659 * See the LICENSE file in the root directory of this source tree.
660 */const Lre=de("UserCheck",[["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"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
661 * @license lucide-react v0.462.0 - ISC
662 *
663 * This source code is licensed under the ISC license.
664 * See the LICENSE file in the root directory of this source tree.
665 */const Fre=de("UserPlus",[["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"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/**
666 * @license lucide-react v0.462.0 - ISC
667 *
668 * This source code is licensed under the ISC license.
669 * See the LICENSE file in the root directory of this source tree.
670 */const Bre=de("UserX",[["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"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
671 * @license lucide-react v0.462.0 - ISC
672 *
673 * This source code is licensed under the ISC license.
674 * See the LICENSE file in the root directory of this source tree.
675 */const n0=de("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
676 * @license lucide-react v0.462.0 - ISC
677 *
678 * This source code is licensed under the ISC license.
679 * See the LICENSE file in the root directory of this source tree.
680 */const tl=de("Users",[["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"}]]);/**
681 * @license lucide-react v0.462.0 - ISC
682 *
683 * This source code is licensed under the ISC license.
684 * See the LICENSE file in the root directory of this source tree.
685 */const zre=de("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
686 * @license lucide-react v0.462.0 - ISC
687 *
688 * This source code is licensed under the ISC license.
689 * See the LICENSE file in the root directory of this source tree.
690 */const tk=de("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}
vendor: 8,708 bytes, lines 690-705
690],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
691 * @license lucide-react v0.462.0 - ISC
692 *
693 * This source code is licensed under the ISC license.
694 * See the LICENSE file in the root directory of this source tree.
695 */const r0=de("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
696 * @license lucide-react v0.462.0 - ISC
697 *
698 * This source code is licensed under the ISC license.
699 * See the LICENSE file in the root directory of this source tree.
700 */const ua=de("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
701 * @license lucide-react v0.462.0 - ISC
702 *
703 * This source code is licensed under the ISC license.
704 * See the LICENSE file in the root directory of this source tree.
705 */const nk=de("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),rk="-",Ure=e=>{const t=Wre(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:o=>{const l=o.split(rk);return l[0]===""&&l.length!==1&&l.shift(),tz(l,t)||Vre(o)},getConflictingClassGroupIds:(o,l)=>{const c=n[o]||[];return l&&r[o]?[...c,...r[o]]:c}}},tz=(e,t)=>{var o;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?tz(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(rk);return(o=t.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},qR=/^\[(.+)\]$/,Vre=e=>{if(qR.test(e)){const t=qR.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Wre=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Hre(Object.entries(e.classGroups),n).forEach(([i,o])=>{V_(o,r,i,t)}),r},V_=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:HR(t,a);i.classGroupId=n;return}if(typeof a=="function"){if(qre(a)){V_(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([i,o])=>{V_(o,HR(t,i),n,r)})})},HR=(e,t)=>{let n=e;return t.split(rk).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},qre=e=>e.isThemeGetter,Hre=(e,t)=>t?e.map(([n,r])=>{const a=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[t+o,l])):i);return[n,a]}):e,Kre=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(i,o)=>{n.set(i,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return a(i,o),o},set(i,o){n.has(i)?n.set(i,o):a(i,o)}}},nz="!",Gre=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],i=t.length,o=l=>{const c=[];let u=0,d=0,f;for(let y=0;y<l.length;y++){let v=l[y];if(u===0){if(v===a&&(r||l.slice(y,y+i)===t)){c.push(l.slice(d,y)),d=y+i;continue}if(v==="/"){f=y;continue}}v==="["?u++:v==="]"&&u--}const h=c.length===0?l:l.substring(d),m=h.startsWith(nz),p=m?h.substring(1):h,g=f&&f>d?f-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:g}};return n?l=>n({className:l,parseClassName:o}):o},Yre=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},Xre=e=>({cache:Kre(e.cacheSize),parseClassName:Gre(e),...Ure(e)}),Qre=/\s+/,Jre=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,i=[],o=e.trim().split(Qre);let l="";for(let c=o.length-1;c>=0;c-=1){const u=o[c],{modifiers:d,hasImportantModifier:f,baseClassName:h,maybePostfixModifierPosition:m}=n(u);let p=!!m,g=r(p?h.substring(0,m):h);if(!g){if(!p){l=u+(l.length>0?" "+l:l);continue}if(g=r(h),!g){l=u+(l.length>0?" "+l:l);continue}p=!1}const y=Yre(d).join(":"),v=f?y+nz:y,w=v+g;if(i.includes(w))continue;i.push(w);const b=a(g,p);for(let j=0;j<b.length;++j){const N=b[j];i.push(v+N)}l=u+(l.length>0?" "+l:l)}return l};function Zre(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=rz(t))&&(r&&(r+=" "),r+=n);return r}const rz=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=rz(e[r]))&&(n&&(n+=" "),n+=t);return n};function eae(e,...t){let n,r,a,i=o;function o(c){const u=t.reduce((d,f)=>f(d),e());return n=Xre(u),r=n.cache.get,a=n.cache.set,i=l,l(c)}function l(c){const u=r(c);if(u)return u;const d=Jre(c,n);return a(c,d),d}return function(){return i(Zre.apply(null,arguments))}}const dn=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},az=/^\[(?:([a-z-]+):)?(.+)\]$/i,tae=/^\d+\/\d+$/,nae=new Set(["px","full","screen"]),rae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,aae=/\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$/,sae=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,iae=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,oae=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vo=e=>Rf(e)||nae.has(e)||tae.test(e),Ll=e=>vm(e,"length",pae),Rf=e=>!!e&&!Number.isNaN(Number(e)),mS=e=>vm(e,"number",Rf),sp=e=>!!e&&Number.isInteger(Number(e)),lae=e=>e.endsWith("%")&&Rf(e.slice(0,-1)),pt=e=>az.test(e),Fl=e=>rae.test(e),cae=new Set(["length","size","percentage"]),uae=e=>vm(e,cae,sz),dae=e=>vm(e,"position",sz),fae=new Set(["image","url"]),hae=e=>vm(e,fae,yae),mae=e=>vm(e,"",gae),ip=()=>!0,vm=(e,t,n)=>{const r=az.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},pae=e=>aae.test(e)&&!sae.test(e),sz=()=>!1,gae=e=>iae.test(e),yae=e=>oae.test(e),vae=()=>{const e=dn("colors"),t=dn("spacing"),n=dn("blur"),r=dn("brightness"),a=dn("borderColor"),i=dn("borderRadius"),o=dn("borderSpacing"),l=dn("borderWidth"),c=dn("contrast"),u=dn("grayscale"),d=dn("hueRotate"),f=dn("invert"),h=dn("gap"),m=dn("gradientColorStops"),p=dn("gradientColorStopPositions"),g=dn("inset"),y=dn("margin"),v=dn("opacity"),w=dn("padding"),b=dn("saturate"),j=dn("scale"),N=dn("sepia"),S=dn("skew"),C=dn("space"),_=dn("translate"),E=()=>["auto","contain","none"],T=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",pt,t],k=()=>[pt,t],D=()=>["",vo,Ll],A=()=>["auto",Rf,pt],I=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],$=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],R=()=>["start","end","center","between","around","evenly","stretch"],O=()=>["","0",pt],F=()=>["auto","avoid","all","avoid-page","page","left","right","column"],z=()=>[Rf,pt];return{cacheSize:500,separator:":",theme:{colors:[ip],spacing:[vo,Ll],blur:["none","",Fl,pt],brightness:z(),borderColor:[e],borderRadius:["none","","full",Fl,pt],borderSpacing:k(),borderWidth:D(),contrast:z(),grayscale:O(),hueRotate:z(),invert:O(),gap:k(),gradientColorStops:[e],gradientColorStopPositions:[lae,Ll],inset:P(),margin:P(),opacity:z(),padding:k(),saturate:z(),scale:z(),sepia:O(),skew:z(),space:k(),translate:k()},classGroups:{aspect:[{aspect:["auto","square","video",pt]}],container:["container"],columns:[{columns:[Fl]}],"break-after":[{"break-after":F()}],"break-before":[{"break-before":F()}],"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"],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:[...I(),pt]}],overflow:[{overflow:T()}],"overflow-x":[{"overflow-x":T()}],"overflow-y":[{"overflow-y":T()}],overscroll:[{overscroll:E()}],"overscroll-x":[{"overscroll-x":E()}],"overscroll-y":[{"overscroll-y":E()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}
vendor: 9,951 bytes, line 705
705],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",sp,pt]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",pt]}],grow:[{grow:O()}],shrink:[{shrink:O()}],order:[{order:["first","last","none",sp,pt]}],"grid-cols":[{"grid-cols":[ip]}],"col-start-end":[{col:["auto",{span:["full",sp,pt]},pt]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[ip]}],"row-start-end":[{row:["auto",{span:[sp,pt]},pt]}],"row-start":[{"row-start":A()}],"row-end":[{"row-end":A()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",pt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",pt]}],gap:[{gap:[h]}],"gap-x":[{"gap-x":[h]}],"gap-y":[{"gap-y":[h]}],"justify-content":[{justify:["normal",...R()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...R(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...R(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",pt,t]}],"min-w":[{"min-w":[pt,t,"min","max","fit"]}],"max-w":[{"max-w":[pt,t,"none","full","min","max","fit","prose",{screen:[Fl]},Fl]}],h:[{h:[pt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[pt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[pt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[pt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Fl,Ll]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mS]}],"font-family":[{font:[ip]}],"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:["tighter","tight","normal","wide","wider","widest",pt]}],"line-clamp":[{"line-clamp":["none",Rf,mS]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",vo,pt]}],"list-image":[{"list-image":["none",pt]}],"list-style-type":[{list:["none","disc","decimal",pt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",vo,Ll]}],"underline-offset":[{"underline-offset":["auto",vo,pt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",pt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",pt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...I(),dae]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uae]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},hae]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:M()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[vo,pt]}],"outline-w":[{outline:[vo,Ll]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[vo,Ll]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Fl,mae]}],"shadow-color":[{shadow:[ip]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...$(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":$()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",Fl,pt]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[b]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",pt]}],duration:[{duration:z()}],ease:[{ease:["linear","in","out","in-out",pt]}],delay:[{delay:z()}],animate:[{animate:["none","spin","ping","pulse","bounce",pt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[j]}],"scale-x":[{"scale-x":[j]}],"scale-y":[{"scale-y":[j]}],rotate:[{rotate:[sp,pt]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",pt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",pt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"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"]}
vendor: 4,657 bytes, line 705
705],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",pt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[vo,Ll,mS]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"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-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-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"],"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"]}}},xae=eae(vae);function te(...e){return xae(Ge(e))}const bae=sre,iz=x.forwardRef(({className:e,...t},n)=>s.jsx(kB,{ref:n,className:te("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));iz.displayName=kB.displayName;const wae=kd("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),oz=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx(OB,{ref:r,className:te(wae({variant:t}),e),...n}));oz.displayName=OB.displayName;const jae=x.forwardRef(({className:e,...t},n)=>s.jsx(RB,{ref:n,className:te("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors group-[.destructive]:border-muted/40 hover:bg-secondary group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 group-[.destructive]:focus:ring-destructive disabled:pointer-events-none disabled:opacity-50",e),...t}));jae.displayName=RB.displayName;const lz=x.forwardRef(({className:e,...t},n)=>s.jsx(DB,{ref:n,className:te("absolute right-2 top-2 rounded-md p-1 text-foreground
705/50 opacity-0 transition-opacity group-hover:opacity-100 group-[.destructive]:text-red-300 hover:text-foreground group-[.destructive]:hover:text-red-50 focus:opacity-100 focus:outline-none focus:ring-2 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:s.jsx(ua,{className:"h-4 w-4"})}));lz.displayName=DB.displayName;const cz=x.forwardRef(({className:e,...t},n)=>s.jsx(TB,{ref:n,className:te("text-sm font-semibold",e),...t}));cz.displayName=TB.displayName;const uz=x.forwardRef(({className:e,...t},n)=>s.jsx(MB,{ref:n,className:te("text-sm opacity-90",e),...t}));uz.displayName=MB.displayName;function Nae(){const{toasts:e}=uB();return s.jsxs(bae,{children:[e.map(function({id:t,title:n,description:r,action:a,...i}){return s.jsxs(oz,{...i,children:[s.jsxs("div",{className:"grid gap-1",children:[n&&s.jsx(cz,{children:n}),r&&s.jsx(uz,{children:r})]}),a,s.jsx(lz,{})]},t)}),s.jsx(iz,{})]})}var KR=["light","dark"],Sae="(prefers-color-scheme: dark)",Cae=x.createContext(void 0),_ae={setTheme:e=>{},themes:[]},Eae=()=>{var e;return(e=x.useContext(Cae))!=null?e:_ae};x.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:a,defaultTheme:i,value:o,attrs:l,nonce:c})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(p=>`'${p}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=a?KR.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=(p,g=!1,y=!0)=>{let v=o?o[p]:p,w=g?p+"|| ''":`'${v}'`,b="";return a&&y&&!g&&KR.includes(p)&&(b+=`d.style.colorScheme = '${p}';`),n==="class"?g||v?b+=`c.add(${w})`:b+="null":v&&(b+=`d[s](n,${w})`),b},m=e?`!function(){${d}${h(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${u})){var t='${Sae}',m=window.matchMedia(t);if(m.media!==t||m.matches){${h("dark")}}else{${h("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}${u?"":"else{"+h(i,!1,!1)+"}"}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${h(o?"x[e]":"e",!0)}}else{${h(i,!1,!1)};}${f}}catch(t){}}();`;return x.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var Aae=e=>{switch(e){case"success":return Oae;case"info":return Mae;case"warning":return Tae;case"error":return Rae;default:return null}},Pae=Array(12).fill(0),kae=({visible:e,className:t})=>L.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},L.createElement("div",{className:"sonner-spinner"},Pae.map((n,r)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),Oae=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Tae=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Mae=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Rae=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Dae=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),$ae=()=>{let[e,t]=L.useState(document.hidden);return L.useEffect(()=>{let n=()=>{t(document.hidden)};
705return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e},W_=1,Iae=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:n,...r}=e,a=typeof(e==null?void 0:e.id)=="number"||((t=e.id)==null?void 0:t.length)>0?e.id:W_++,i=this.toasts.find(l=>l.id===a),o=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...e,id:a,title:n}),{...l,...e,id:a,dismissible:o,title:n}):l):this.addToast({title:n,...r,dismissible:o,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(t=>{this.subscribers.forEach(n=>n({id:t.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>
705this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:typeof t.description!="function"?t.description:void 0}));let r=e instanceof Promise?e:e(),a=n!==void 0,i,o=r.then(async c=>{if(i=["resolve",c],L.isValidElement(c))a=!1,this.create({id:n,type:"default",message:c});else if(Fae(c)&&!c.ok){a=!1;let u=typeof t.error=="function"?await t.error(`HTTP error! status: ${c.status}`):t.error,d=typeof t.description=="function"?await t.description(`HTTP error! status: ${c.status}`):t.description;this.create({id:n,type:"error",message:u,description:d})}else if(t.success!==void 0){a=!1;let u=typeof t.success=="function"?await t.success(c):t.success,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"success",message:u,description:d})}}).catch(async c=>{if(i=["reject",c],t.error!==void 0){a=!1;let u=typeof t.error=="function"?await t.error(c):t.error,d=typeof t.description=="function"?await t.description(c):t.description;this.create({id:n,type:"error",message:u,description:d})}}).finally(()=>{var c;a&&(this.dismiss(n),n=void 0),(c=t.finally)==null||c.call(t)}),l=()=>new Promise((c,u)=>o.then(()=>i[0]==="reject"?u(i[1]):c(i[1])).catch(u));return typeof n!="string"&&typeof n!="number"?{unwrap:l}:Object.assign(n,{unwrap:l})},this.custom=(e,t)=>{let n=(t==null?void 0:t.id)||W_++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Na=new Iae,Lae=(e,t)=>{let n=(t==null?void 0:t.id)||W_++;return Na.addToast({title:e,...t,id:n}),n},Fae=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Bae=Lae,zae=()=>Na.toasts,Uae=()=>Na.getActiveToasts(),se=Object.assign(Bae,{success:Na.success,info:Na.info,warning:Na.warning,error:Na.error,custom:Na.custom,message:Na.message,promise:Na.promise,dismiss:Na.dismiss,loading:Na.loading},{getHistory:zae,getToasts:Uae});function Vae(e,{insertAt:t}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Vae(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
705left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
705:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
705--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
706`);function yx(e){return e.label!==void 0}var Wae=3,qae="32px",Hae="16px",GR=4e3,Kae=356,Gae=14,Yae=20,Xae=200;function Ls(...e){return e.filter(Boolean).join(" ")}function Qae(e){let[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}var Jae=e=>{var t,n,r,a,i,o,l,c,u,d,f;let{invert:h,toast:m,unstyled:p,interacting:g,setHeights:y,visibleToasts:v,heights:w,index:b,toasts:j,expanded:N,removeToast:S,defaultRichColors:C,closeButton:_,style:E,cancelButtonStyle:T,actionButtonStyle:P,className:k="",descriptionClassName:D="",duration:A,position:I,gap:M,loadingIcon:$,expandByDefault:R,classNames:O,icons:F,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:B}=e,[H,Y]=L.useState(null),[ee,V]=L.useState(null),[K,W]=L.useState(!1),[q,J]=L.useState(!1),[ie,X]=L.useState(!1),[ge,Se]=L.useState(!1),[ce,ye]=L.useState(!1),[Ie,Ue]=L.useState(0),[Ze,fe]=L.useState(0),Oe=L.useRef(m.duration||A||GR),Et=L.useRef(null),oe=L.useRef(null),Je=b===0,ut=b+1<=v,Q=m.type,he=m.dismissible!==!1,ve=m.className||"",xe=m.descriptionClassName||"",Ce=L.useMemo(()=>w.findIndex(Ve=>Ve.toastId===m.id)||0,[w,m.id]),Be=L.useMemo(()=>{var Ve;return(Ve=m.closeButton)!=null?Ve:_},[m.closeButton,_]),$r=L.useMemo(()=>m.duration||A||GR,[m.duration,A]),mr=L.useRef(0),At=L.useRef(0),Pi=L.useRef(0),Ha=L.useRef(null),[ru,Tl]=I.split("-"),Ml=L.useMemo(()=>w.reduce((Ve,lt,ft)=>ft>=Ce?Ve:Ve+lt.height,0),[w,Ce]),Rl=$ae(),au=m.invert||h,yn=Q==="loading";At.current=L.useMemo(()=>Ce*M+Ml,[Ce,Ml]),L.useEffect(()=>{Oe.current=$r},[$r]),L.useEffect(()=>{W(!0)},[]),L.useEffect(()=>{let Ve=oe.current;if(Ve){let lt=Ve.getBoundingClientRect().height;return fe(lt),y(ft=>[{toastId:m.id,height:lt,position:m.position},...ft]),()=>y(ft=>ft.filter(en=>en.toastId!==m.id))}},[y,m.id]),L.useLayoutEffect(()=>{if(!K)return;let Ve=oe.current,lt=Ve.style.height;Ve.style.height="auto";let ft=Ve.getBoundingClientRect().height;Ve.style.height=lt,fe(ft),y(en=>en.find(On=>On.toastId===m.id)?en.map(On=>On.toastId===m.id?{...On,height:ft}:On):[{toastId:m.id,height:ft,position:m.position},...en])},[K,m.title,m.description,y,m.id]);let Zt=L.useCallback(()=>{J(!0),Ue(At.current),y(Ve=>Ve.filter(lt=>lt.toastId!==m.id)),setTimeout(()=>{S(m)},Xae)},[m,S,y,At]);L.useEffect(()=>{if(m.promise&&Q==="loading"||m.duration===1/0||m.type==="loading")return;let Ve;return N||g||B&&Rl?(()=>{if(Pi.current<mr.current){let lt=new Date().getTime()-mr.current;Oe.current=Oe.current-lt}
706Pi.current=new Date().getTime()})():Oe.current!==1/0&&(mr.current=new Date().getTime(),Ve=setTimeout(()=>{var lt;(lt=m.onAutoClose)==null||lt.call(m,m),Zt()},Oe.current)),()=>clearTimeout(Ve)},[N,g,m,Q,B,Rl,Zt]),L.useEffect(()=>{m.delete&&Zt()},[Zt,m.delete]);function er(){var Ve,lt,ft;return F!=null&&F.loading?L.createElement("div",{className:Ls(O==null?void 0:O.loader,(Ve=m==null?void 0:m.classNames)==null?void 0:Ve.loader,"sonner-loader"),"data-visible":Q==="loading"},F.loading):$?L.createElement("div",{className:Ls(O==null?void 0:O.loader,(lt=m==null?void 0:m.classNames)==null?void 0:lt.loader,"sonner-loader"),"data-visible":Q==="loading"},$):L.createElement(kae,{className:Ls(O==null?void 0:O.loader,(ft=m==null?void 0:m.classNames)==null?void 0:ft.loader),visible:Q==="loading"})}return L.createElement("li",{tabIndex:0,ref:oe,className:Ls(k,ve,O==null?void 0:O.toast,(t=m==null?void 0:m.classNames)==null?void 0:t.toast,O==null?void 0:O.default,O==null?void 0:O[Q],(n=m==null?void 0:m.classNames)==null?void 0:n[Q]),"data-sonner-toast":"","data-rich-colors":(r=m.richColors)!=null?r:C,"data-styled":!(m.jsx||m.unstyled||p),"data-mounted":K,"data-promise":!!m.promise,"data-swiped":ce,"data-removed":q,"data-visible":ut,"data-y-position":ru,"data-x-position":Tl,"data-index":b,"data-front":Je,"data-swiping":ie,"data-dismissible":he,"data-type":Q,"data-invert":au,"data-swipe-out":ge,"data-swipe-direction":ee,"data-expanded":!!(N||R&&K),style:{"--index":b,"--toasts-before":b,"--z-index":j.length-b,"--offset":`${q?Ie:At.current}px`,"--initial-height":R?"auto":`${Ze}px`,...E,...m.style},onDragEnd:()=>{X(!1),Y(null),Ha.current=null},onPointerDown:Ve=>{yn||!he||(Et.current=new Date,Ue(At.current),Ve.target.setPointerCapture(Ve.pointerId),Ve.target.tagName!=="BUTTON"&&(X(!0),Ha.current={x:Ve.clientX,y:Ve.clientY}))},onPointerUp:()=>{var Ve,lt,ft,en;if(ge||!he)return;Ha.current=null;let On=Number(((Ve=oe.current)==null?void 0:Ve.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),zt=Number(((lt=oe.current)==null?void 0:lt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),qn=new Date().getTime()-((ft=Et.current)==null?void 0:ft.getTime()),tn=H==="x"?On:zt,Tn=Math.abs(tn)/qn;if(Math.abs(tn)>=Yae||Tn>.11){Ue(At.current),(en=m.onDismiss)==null||en.call(m,m),V(H==="x"?On>0?"right":"left":zt>0?"down":"up"),Zt(),Se(!0),ye(!1);return}X(!1),Y(null)},onPointerMove:Ve=>{var lt,ft,en,On;if(!Ha.current||!he||((lt=window.getSelection())==null?void 0:lt.toString().length)>0)return;let zt=Ve.clientY-Ha.current.y,qn=Ve.clientX-Ha.current.x,tn=(ft=e.swipeDirections)!=null?ft:Qae(I);!H&&(Math.abs(qn)>1||Math.abs(zt)>1)&&Y(Math.abs(qn)>Math.abs(zt)?"x":"y");let Tn={x:0,y:0};H==="y"?(tn.includes("top")||tn.includes("bottom"))&&(tn.includes("top")&&zt<0||tn.includes("bottom")&&zt>0)&&(Tn.y=zt):H==="x"&&(tn.includes("left")||tn.includes("right"))&&(tn.includes("left")&&qn<0||tn.includes("right")&&qn>0)&&(Tn.x=qn),(Math.abs(Tn.x)>0||Math.abs(Tn.y)>0)&&ye(!0),(en=oe.current)==null||en.style.setProperty("--swipe-amount-x",`${Tn.x}px`),(On=oe.current)==null||On.style.setProperty("--swipe-amount-y",`${Tn.y}px`)}},Be&&!m.jsx?L.createElement("button",{"aria-label":z,"data-disabled":yn,"data-close-button":!0,onClick:yn||!he?()=>{}:()=>{var Ve;Zt(),(Ve=m.onDismiss)==null||Ve.call(m,m)},className:Ls(O==null?void 0:O.closeButton,(a=m==null?void 0:m.classNames)==null?void 0:a.closeButton)},(i=F==null?void 0:F.close)!=null?i:Dae):null,m.jsx||x.isValidElement(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:L.createElement(L.Fragment,null,Q||m.icon||m.promise?L.createElement("div",{"data-icon":"",className:Ls(O==null?void 0:O.icon,(o=m==null?void 0:m.classNames)==null?void 0:o.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||er():null,m.type!=="loading"?m.
vendor: 5,905 bytes, line 706
706icon||(F==null?void 0:F[Q])||Aae(Q):null):null,L.createElement("div",{"data-content":"",className:Ls(O==null?void 0:O.content,(l=m==null?void 0:m.classNames)==null?void 0:l.content)},L.createElement("div",{"data-title":"",className:Ls(O==null?void 0:O.title,(c=m==null?void 0:m.classNames)==null?void 0:c.title)},typeof m.title=="function"?m.title():m.title),m.description?L.createElement("div",{"data-description":"",className:Ls(D,xe,O==null?void 0:O.description,(u=m==null?void 0:m.classNames)==null?void 0:u.description)},typeof m.description=="function"?m.description():m.description):null),x.isValidElement(m.cancel)?m.cancel:m.cancel&&yx(m.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||T,onClick:Ve=>{var lt,ft;yx(m.cancel)&&he&&((ft=(lt=m.cancel).onClick)==null||ft.call(lt,Ve),Zt())},className:Ls(O==null?void 0:O.cancelButton,(d=m==null?void 0:m.classNames)==null?void 0:d.cancelButton)},m.cancel.label):null,x.isValidElement(m.action)?m.action:m.action&&yx(m.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||P,onClick:Ve=>{var lt,ft;yx(m.action)&&((ft=(lt=m.action).onClick)==null||ft.call(lt,Ve),!Ve.defaultPrevented&&Zt())},className:Ls(O==null?void 0:O.actionButton,(f=m==null?void 0:m.classNames)==null?void 0:f.actionButton)},m.action.label):null))};function YR(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function Zae(e,t){let n={};return[e,t].forEach((r,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?Hae:qae;function c(u){["top","right","bottom","left"].forEach(d=>{n[`${o}-${d}`]=typeof u=="number"?`${u}px`:u})}typeof r=="number"||typeof r=="string"?c(r):typeof r=="object"?["top","right","bottom","left"].forEach(u=>{r[u]===void 0?n[`${o}-${u}`]=l:n[`${o}-${u}`]=typeof r[u]=="number"?`${r[u]}px`:r[u]}):c(l)}),n}var ese=x.forwardRef(function(e,t){let{invert:n,position:r="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:c,mobileOffset:u,theme:d="light",richColors:f,duration:h,style:m,visibleToasts:p=Wae,toastOptions:g,dir:y=YR(),gap:v=Gae,loadingIcon:w,icons:b,containerAriaLabel:j="Notifications",pauseWhenPageIsHidden:N}=e,[S,C]=L.useState([]),_=L.useMemo(()=>Array.from(new Set([r].concat(S.filter(B=>B.position).map(B=>B.position)))),[S,r]),[E,T]=L.useState([]),[P,k]=L.useState(!1),[D,A]=L.useState(!1),[I,M]=L.useState(d!=="system"?d:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),$=L.useRef(null),R=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),O=L.useRef(null),F=L.useRef(!1),z=L.useCallback(B=>{C(H=>{var Y;return(Y=H.find(ee=>ee.id===B.id))!=null&&Y.delete||Na.dismiss(B.id),H.filter(({id:ee})=>ee!==B.id)})},[]);return L.useEffect(()=>Na.subscribe(B=>{if(B.dismiss){C(H=>H.map(Y=>Y.id===B.id?{...Y,delete:!0}:Y));return}setTimeout(()=>{lB.flushSync(()=>{C(H=>{let Y=H.findIndex(ee=>ee.id===B.id);return Y!==-1?[...H.slice(0,Y),{...H[Y],...B},...H.slice(Y+1)]:[B,...H]})})})}),[]),L.useEffect(()=>{if(d!=="system"){M(d);return}if(d==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?M("dark"):M("light")),typeof window>"u")return;let B=window.matchMedia("(prefers-color-scheme: dark)");try{B.addEventListener("change",({matches:H})=>{M(H?"dark":"light")})}catch{B.addListener(({matches:Y})=>{try{M(Y?"dark":"light")}catch(ee){console.error(ee)}})}},[d]),L.useEffect(()=>{S.length<=1&&k(!1)},[S]),L.useEffect(()=>{let B=H=>{var Y,ee;a.every(V=>H[V]||H.code===V)&&(k(!0),(Y=$.current)==null||Y.focus()),H.code==="Escape"&&(document.activeElement===$.current||(ee=$.current)!=null&&ee.contains(document.activeElement))&&k(!1)};return document.addEventListener("keydown",B),()=>document.removeEventListener("keydown",B)},[a]),L.useEffect(()=>{if($.current)return()=>{O.current&&(O.current.focus({preventScroll:!0}),O.current=null,F.current=!1)}},[$.current]),L.createElement("section",{ref:t,"aria-label":`${j} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((B,H)=>{var Y;let[ee,V]=B.split("-");return S.length?L.createElement("ol",{key:B,dir:y==="auto"?YR():y,tabIndex:-1,ref:$,className:l,"data-sonner-toaster":!0,"data-theme":I,"data-y-position":ee,"data-lifted":P&&S.length>1&&!i,"data-x-position":V,style:{"--front-toast-height":`${((Y=E[0])==null?void 0:Y.height)||0}px`,"--width":`${Kae}px`,"--gap":`${v}px`,...m,...Zae(c,u)},onBlur:K=>{F.current&&!K.currentTarget.contains(K.relatedTarget)&&(F.current=!1,O.current&&(O.current.focus({preventScroll:!0}),O.current=null))},onFocus:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||F.current||(F.current=!0,O.current=K.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{D||k(!1)},onDragEnd:()=>k(!1),onPointerDown:K=>{K.target instanceof HTMLElement&&K.target.dataset.dismissible==="false"||A(!0)},onPointerUp:()=>A(!1)},S.filter(K=>!K.position&&H===0||K.position===B).map((K,W)=>{var q,J;return L.createElement(Jae,{key:K.id,icons:b,index:W,toast:K,defaultRichColors:f,duration:(q=g==null?void 0:g.duration)!=null?q:h,className:g==null?void 0:g.className,descriptionClassName:g==null?void 0:g.descriptionClassName,invert:n,visibleToasts:p,closeButton:(J=g==null?void 0:g.closeButton)!=null?J:o,interacting:D,position:B,style:g==null?void 0:g.style,unstyled:g==null?void 0:g.unstyled,classNames:g==null?void 0:g.classNames,cancelButtonStyle:g==null?void 0:g.cancelButtonStyle,actionButtonStyle:g==null?void 0:g.actionButtonStyle,removeToast:z,toasts:S.filter(ie=>ie.position==K.position),heights:E.filter(ie=>ie.position==K.position),setHeights:T,expandByDefault:i,gap:v,loadingIcon:w,exp
vendor: 5,921 bytes, line 706
706anded:P,pauseWhenPageIsHidden:N,swipeDirections:e.swipeDirections})})):null}))});const tse=({...e})=>{const{theme:t="system"}=Eae();return s.jsx(ese,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})};var nse=QA[" useId ".trim().toString()]||(()=>{}),rse=0;function Ia(e){const[t,n]=x.useState(nse());return Fn(()=>{e||n(r=>r??String(rse++))},[e]),e||(t?`radix-${t}`:"")}const ase=["top","right","bottom","left"],Dc=Math.min,es=Math.max,a0=Math.round,vx=Math.floor,Xi=e=>({x:e,y:e}),sse={left:"right",right:"left",bottom:"top",top:"bottom"},ise={start:"end",end:"start"};function q_(e,t,n){return es(e,Dc(t,n))}function nl(e,t){return typeof e=="function"?e(t):e}function rl(e){return e.split("-")[0]}function xm(e){return e.split("-")[1]}function ak(e){return e==="x"?"y":"x"}function sk(e){return e==="y"?"height":"width"}const ose=new Set(["top","bottom"]);function Vi(e){return ose.has(rl(e))?"y":"x"}function ik(e){return ak(Vi(e))}function lse(e,t,n){n===void 0&&(n=!1);const r=xm(e),a=ik(e),i=sk(a);let o=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=s0(o)),[o,s0(o)]}function cse(e){const t=s0(e);return[H_(e),t,H_(t)]}function H_(e){return e.replace(/start|end/g,t=>ise[t])}const XR=["left","right"],QR=["right","left"],use=["top","bottom"],dse=["bottom","top"];function fse(e,t,n){switch(e){case"top":case"bottom":return n?t?QR:XR:t?XR:QR;case"left":case"right":return t?use:dse;default:return[]}}function hse(e,t,n,r){const a=xm(e);let i=fse(rl(e),n==="start",r);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map(H_)))),i}function s0(e){return e.replace(/left|right|bottom|top/g,t=>sse[t])}function mse(e){return{top:0,right:0,bottom:0,left:0,...e}}function dz(e){return typeof e!="number"?mse(e):{top:e,right:e,bottom:e,left:e}}function i0(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function JR(e,t,n){let{reference:r,floating:a}=e;const i=Vi(t),o=ik(t),l=sk(o),c=rl(t),u=i==="y",d=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,h=r[l]/2-a[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-a.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-a.width,y:f};break;default:m={x:r.x,y:r.y}}switch(xm(t)){case"start":m[o]-=h*(n&&u?-1:1);break;case"end":m[o]+=h*(n&&u?-1:1);break}return m}const pse=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:i=[],platform:o}=n,l=i.filter(Boolean),c=await(o.isRTL==null?void 0:o.isRTL(t));let u=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:f}=JR(u,r,c),h=r,m={},p=0;for(let g=0;g<l.length;g++){const{name:y,fn:v}=l[g],{x:w,y:b,data:j,reset:N}=await v({x:d,y:f,initialPlacement:r,placement:h,strategy:a,middlewareData:m,rects:u,platform:o,elements:{reference:e,floating:t}});d=w??d,f=b??f,m={...m,[y]:{...m[y],...j}},N&&p<=50&&(p++,typeof N=="object"&&(N.placement&&(h=N.placement),N.rects&&(u=N.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:a}):N.rects),{x:d,y:f}=JR(u,h,c)),g=-1)}return{x:d,y:f,placement:h,strategy:a,middlewareData:m}};async function $g(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:i,rects:o,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=nl(t,e),p=dz(m),y=l[h?f==="floating"?"reference":"floating":f],v=i0(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:a,width:o.floating.width,height:o.floating.height}:o.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),j=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},N=i0(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:b,strategy:c}):w);return{top:(v.top-N.top+p.top)/j.y,bottom:(N.bottom-v.bottom+p.bottom)/j.y,left:(v.left-N.left+p.left)/j.x,right:(N.right-v.right+p.right)/j.x}}const gse=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=nl(e,t)||{};if(u==null)return{};const f=dz(d),h={x:n,y:r},m=ik(a),p=sk(m),g=await o.getDimensions(u),y=m==="y",v=y?"top":"left",w=y?"bottom":"right",b=y?"clientHeight":"clientWidth",j=i.reference[p]+i.reference[m]-h[m]-i.floating[p],N=h[m]-i.reference[m],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=S?S[b]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=l.floating[b]||i.floating[p]);const _=j/2-N/2,E=C/2-g[p]/2-1,T=Dc(f[v],E),P=Dc(f[w],E),k=T,D=C-g[p]-P,A=C/2-g[p]/2+_,I=q_(k,A,D),M=!c.arrow&&xm(a)!=null&&A!==I&&i.reference[p]/2-(A<k?T:P)-g[p]/2<0,$=M?A<k?A-k:A-D:0;return{[m]:h[m]+$,data:{[m]:I,centerOffset:A-I-$,...M&&{alignmentOffset:$}},reset:M}}}),yse=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...y}=nl(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=rl(a),w=Vi(l),b=rl(l)===l,j=await(c.isRTL==null?void 0:c.isRTL(u.floating)),N=h||
vendor: 5,306 bytes, line 706
706(b||!g?[s0(l)]:cse(l)),S=p!=="none";!h&&S&&N.push(...hse(l,g,p,j));const C=[l,...N],_=await $g(t,y),E=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&E.push(_[v]),f){const A=lse(a,o,j);E.push(_[A[0]],_[A[1]])}if(T=[...T,{placement:a,overflows:E}],!E.every(A=>A<=0)){var P,k;const A=(((P=i.flip)==null?void 0:P.index)||0)+1,I=C[A];if(I&&(!(f==="alignment"?w!==Vi(I):!1)||T.every(R=>R.overflows[0]>0&&Vi(R.placement)===w)))return{data:{index:A,overflows:T},reset:{placement:I}};let M=(k=T.filter($=>$.overflows[0]<=0).sort(($,R)=>$.overflows[1]-R.overflows[1])[0])==null?void 0:k.placement;if(!M)switch(m){case"bestFit":{var D;const $=(D=T.filter(R=>{if(S){const O=Vi(R.placement);return O===w||O==="y"}return!0}).map(R=>[R.placement,R.overflows.filter(O=>O>0).reduce((O,F)=>O+F,0)]).sort((R,O)=>R[1]-O[1])[0])==null?void 0:D[0];$&&(M=$);break}case"initialPlacement":M=l;break}if(a!==M)return{reset:{placement:M}}}return{}}}};function ZR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eD(e){return ase.some(t=>e[t]>=0)}const vse=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=nl(e,t);switch(r){case"referenceHidden":{const i=await $g(t,{...a,elementContext:"reference"}),o=ZR(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:eD(o)}}}case"escaped":{const i=await $g(t,{...a,altBoundary:!0}),o=ZR(i,n.floating);return{data:{escapedOffsets:o,escaped:eD(o)}}}default:return{}}}}},fz=new Set(["left","top"]);async function xse(e,t){const{placement:n,platform:r,elements:a}=e,i=await(r.isRTL==null?void 0:r.isRTL(a.floating)),o=rl(n),l=xm(n),c=Vi(n)==="y",u=fz.has(o)?-1:1,d=i&&c?-1:1,f=nl(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof p=="number"&&(m=l==="end"?p*-1:p),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const bse=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:i,placement:o,middlewareData:l}=t,c=await xse(t,e);return o===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}},wse=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:y=>{let{x:v,y:w}=y;return{x:v,y:w}}},...c}=nl(e,t),u={x:n,y:r},d=await $g(t,c),f=Vi(rl(a)),h=ak(f);let m=u[h],p=u[f];if(i){const y=h==="y"?"top":"left",v=h==="y"?"bottom":"right",w=m+d[y],b=m-d[v];m=q_(w,m,b)}if(o){const y=f==="y"?"top":"left",v=f==="y"?"bottom":"right",w=p+d[y],b=p-d[v];p=q_(w,p,b)}const g=l.fn({...t,[h]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[h]:i,[f]:o}}}}}},jse=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:i,middlewareData:o}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=nl(e,t),d={x:n,y:r},f=Vi(a),h=ak(f);let m=d[h],p=d[f];const g=nl(l,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const b=h==="y"?"height":"width",j=i.reference[h]-i.floating[b]+y.mainAxis,N=i.reference[h]+i.reference[b]-y.mainAxis;m<j?m=j:m>N&&(m=N)}if(u){var v,w;const b=h==="y"?"width":"height",j=fz.has(rl(a)),N=i.reference[f]-i.floating[b]+(j&&((v=o.offset)==null?void 0:v[f])||0)+(j?0:y.crossAxis),S=i.reference[f]+i.reference[b]+(j?0:((w=o.offset)==null?void 0:w[f])||0)-(j?y.crossAxis:0);p<N?p=N:p>S&&(p=S)}return{[h]:m,[f]:p}}}},Nse=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:i,platform:o,elements:l}=t,{apply:c=()=>{},...u}=nl(e,t),d=await $g(t,u),f=rl(a),h=xm(a),m=Vi(a)==="y",{width:p,height:g}=i.floating;let y,v;f==="top"||f==="bottom"?(y=f,v=h===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(v=f,y=h==="end"?"top":"bottom");const w=g-d.top-d.bottom,b=p-d.left-d.right,j=Dc(g-d[y],w),N=Dc(p-d[v],b),S=!t.middlewareData.shift;let C=j,_=N;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=b),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=w),S&&!h){const T=es(d.left,0),P=es(d.right,0),k=es(d.top,0),D=es(d.bottom,0);m?_=p-2*(T!==0||P!==0?T+P:es(d.left,d.right)):C=g-2*(k!==0||D!==0?k+D:es(d.top,d.bottom))}await c({...t,availableWidth:_,availableHeight:C});const E=await o.getDimensions(l.floating);return p!==E.width||g!==E.height?{reset:{rects:!0}}:{}}}};function Tj(){return typeof window<"u"}function bm(e){return hz(e)?(e.nodeName||"").toLowerCase():"#document"}function ss(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function io(e){var t;return(t=(hz(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function hz(e){return Tj()?e instanceof Node||e instanceof ss(e).Node:!1}function fi(e){return Tj()?e instanceof Element||e instanceof ss(e).Element:!1}function to(e){return Tj()?e instanceof HTMLElement||e instanceof ss(e).HTMLElement:!1}function tD(e){return!Tj()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ss(e).ShadowRoot}const Sse=new Set(["inline","contents"]);function rv(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=hi(e);
vendor: 4,143 bytes, line 706
706return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Sse.has(a)}const Cse=new Set(["table","td","th"]);function _se(e){return Cse.has(bm(e))}const Ese=[":popover-open",":modal"];function Mj(e){return Ese.some(t=>{try{return e.matches(t)}catch{return!1}})}const Ase=["transform","translate","scale","rotate","perspective"],Pse=["transform","translate","scale","rotate","perspective","filter"],kse=["paint","layout","strict","content"];function ok(e){const t=lk(),n=fi(e)?hi(e):e;return Ase.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)||Pse.some(r=>(n.willChange||"").includes(r))||kse.some(r=>(n.contain||"").includes(r))}function Ose(e){let t=$c(e);for(;to(t)&&!mh(t);){if(ok(t))return t;if(Mj(t))return null;t=$c(t)}return null}function lk(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Tse=new Set(["html","body","#document"]);function mh(e){return Tse.has(bm(e))}function hi(e){return ss(e).getComputedStyle(e)}function Rj(e){return fi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $c(e){if(bm(e)==="html")return e;const t=e.assignedSlot||e.parentNode||tD(e)&&e.host||io(e);return tD(t)?t.host:t}function mz(e){const t=$c(e);return mh(t)?e.ownerDocument?e.ownerDocument.body:e.body:to(t)&&rv(t)?t:mz(t)}function Ig(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=mz(e),i=a===((r=e.ownerDocument)==null?void 0:r.body),o=ss(a);if(i){const l=K_(o);return t.concat(o,o.visualViewport||[],rv(a)?a:[],l&&n?Ig(l):[])}return t.concat(a,Ig(a,[],n))}function K_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function pz(e){const t=hi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=to(e),i=a?e.offsetWidth:n,o=a?e.offsetHeight:r,l=a0(n)!==i||a0(r)!==o;return l&&(n=i,r=o),{width:n,height:r,$:l}}function ck(e){return fi(e)?e:e.contextElement}function Df(e){const t=ck(e);if(!to(t))return Xi(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:i}=pz(t);let o=(i?a0(n.width):n.width)/r,l=(i?a0(n.height):n.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const Mse=Xi(0);function gz(e){const t=ss(e);return!lk()||!t.visualViewport?Mse:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Rse(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ss(e)?!1:t}function id(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),i=ck(e);let o=Xi(1);t&&(r?fi(r)&&(o=Df(r)):o=Df(e));const l=Rse(i,n,r)?gz(i):Xi(0);let c=(a.left+l.x)/o.x,u=(a.top+l.y)/o.y,d=a.width/o.x,f=a.height/o.y;if(i){const h=ss(i),m=r&&fi(r)?ss(r):r;let p=h,g=K_(p);for(;g&&r&&m!==p;){const y=Df(g),v=g.getBoundingClientRect(),w=hi(g),b=v.left+(g.clientLeft+parseFloat(w.paddingLeft))*y.x,j=v.top+(g.clientTop+parseFloat(w.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=b,u+=j,p=ss(g),g=K_(p)}}return i0({width:d,height:f,x:c,y:u})}function uk(e,t){const n=Rj(e).scrollLeft;return t?t.left+n:id(io(e)).left+n}function yz(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:uk(e,r)),i=r.top+t.scrollTop;return{x:a,y:i}}function Dse(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const i=a==="fixed",o=io(r),l=t?Mj(t.floating):!1;if(r===o||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Xi(1);const d=Xi(0),f=to(r);if((f||!f&&!i)&&((bm(r)!=="body"||rv(o))&&(c=Rj(r)),to(r))){const m=id(r);u=Df(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const h=o&&!f&&!i?yz(o,c,!0):Xi(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}}function $se(e){return Array.from(e.getClientRects())}function Ise(e){const t=io(e),n=Rj(e),r=e.ownerDocument.body,a=es(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=es(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+uk(e);const l=-n.scrollTop;return hi(r).direction==="rtl"&&(o+=es(t.clientWidth,r.clientWidth)-a),{width:a,height:i,x:o,y:l}}
vendor: 4,897 bytes, line 706
706function Lse(e,t){const n=ss(e),r=io(e),a=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const u=lk();(!u||u&&t==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}return{width:i,height:o,x:l,y:c}}const Fse=new Set(["absolute","fixed"]);function Bse(e,t){const n=id(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,i=to(e)?Df(e):Xi(1),o=e.clientWidth*i.x,l=e.clientHeight*i.y,c=a*i.x,u=r*i.y;return{width:o,height:l,x:c,y:u}}function nD(e,t,n){let r;if(t==="viewport")r=Lse(e,n);else if(t==="document")r=Ise(io(e));else if(fi(t))r=Bse(t,n);else{const a=gz(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return i0(r)}function vz(e,t){const n=$c(e);return n===t||!fi(n)||mh(n)?!1:hi(n).position==="fixed"||vz(n,t)}function zse(e,t){const n=t.get(e);if(n)return n;let r=Ig(e,[],!1).filter(l=>fi(l)&&bm(l)!=="body"),a=null;const i=hi(e).position==="fixed";let o=i?$c(e):e;for(;fi(o)&&!mh(o);){const l=hi(o),c=ok(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&Fse.has(a.position)||rv(o)&&!c&&vz(e,o))?r=r.filter(d=>d!==o):a=l,o=$c(o)}return t.set(e,r),r}function Use(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Mj(t)?[]:zse(t,this._c):[].concat(n),r],l=o[0],c=o.reduce((u,d)=>{const f=nD(t,d,a);return u.top=es(f.top,u.top),u.right=Dc(f.right,u.right),u.bottom=Dc(f.bottom,u.bottom),u.left=es(f.left,u.left),u},nD(t,l,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Vse(e){const{width:t,height:n}=pz(e);return{width:t,height:n}}function Wse(e,t,n){const r=to(t),a=io(t),i=n==="fixed",o=id(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Xi(0);function u(){c.x=uk(a)}if(r||!r&&!i)if((bm(t)!=="body"||rv(a))&&(l=Rj(t)),r){const m=id(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else a&&u();i&&!r&&a&&u();const d=a&&!r&&!i?yz(a,l):Xi(0),f=o.left+l.scrollLeft-c.x-d.x,h=o.top+l.scrollTop-c.y-d.y;return{x:f,y:h,width:o.width,height:o.height}}function pS(e){return hi(e).position==="static"}function rD(e,t){if(!to(e)||hi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return io(e)===n&&(n=n.ownerDocument.body),n}function xz(e,t){const n=ss(e);if(Mj(e))return n;if(!to(e)){let a=$c(e);for(;a&&!mh(a);){if(fi(a)&&!pS(a))return a;a=$c(a)}return n}let r=rD(e,t);for(;r&&_se(r)&&pS(r);)r=rD(r,t);return r&&mh(r)&&pS(r)&&!ok(r)?n:r||Ose(e)||n}const qse=async function(e){const t=this.getOffsetParent||xz,n=this.getDimensions,r=await n(e.floating);return{reference:Wse(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hse(e){return hi(e).direction==="rtl"}const Kse={convertOffsetParentRelativeRectToViewportRelativeRect:Dse,getDocumentElement:io,getClippingRect:Use,getOffsetParent:xz,getElementRects:qse,getClientRects:$se,getDimensions:Vse,getScale:Df,isElement:fi,isRTL:Hse};function bz(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gse(e,t){let n=null,r;const a=io(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const u=e.getBoundingClientRect(),{left:d,top:f,width:h,height:m}=u;if(l||t(),!h||!m)return;const p=vx(f),g=vx(a.clientWidth-(d+h)),y=vx(a.clientHeight-(f+m)),v=vx(d),b={rootMargin:-p+"px "+-g+"px "+-y+"px "+-v+"px",threshold:es(0,Dc(1,c))||1};let j=!0;function N(S){const C=S[0].intersectionRatio;if(C!==c){if(!j)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}C===1&&!bz(u,e.getBoundingClientRect())&&o(),j=!1}try{n=new IntersectionObserver(N,{...b,root:a.ownerDocument})}catch{n=new IntersectionObserver(N,b)}n.observe(e)}return o(!0),i}function Yse(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=ck(e),d=a||i?[...u?Ig(u):[],...Ig(t)]:[];d.forEach(v=>{a&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const f=u&&l?Gse(u,n):null;let h=-1,m=null;o&&(m=new ResizeObserver(v=>{let[w]=v;w&&w.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let p,g=c?id(e):null;c&&y();function y(){const v=id(e);g&&!bz(g,v)&&n(),g=v,p=requestAnimationFrame(y)}return n(),()=>{var v;d.forEach(w=>{a&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(v=m)==null||v.disconnect(),m=null,c&&cancelAnimationFrame(p)}}const Xse=bse,Qse=wse,Jse=yse,Zse=Nse,eie=vse,aD=gse,tie=jse,nie=(e,t,n)=>{const r=new Map,a={platform:Kse,...n},i={...a.platform,_c:r};return pse(e,t,{...a,platform:i})};var rie=typeof document<"u",aie=function(){},fb=rie?x.useLayoutEffect:aie;function o0(e,t){if(e===t)return!0;
vendor: 4,167 bytes, line 706
706if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;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(!o0(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const i=a[r];if(!(i==="_owner"&&e.$$typeof)&&!o0(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function wz(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sD(e,t){const n=wz(e);return Math.round(t*n)/n}function gS(e){const t=x.useRef(e);return fb(()=>{t.current=e}),t}function sie(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=x.useState(r);o0(h,r)||m(r);const[p,g]=x.useState(null),[y,v]=x.useState(null),w=x.useCallback(R=>{R!==S.current&&(S.current=R,g(R))},[]),b=x.useCallback(R=>{R!==C.current&&(C.current=R,v(R))},[]),j=i||p,N=o||y,S=x.useRef(null),C=x.useRef(null),_=x.useRef(d),E=c!=null,T=gS(c),P=gS(a),k=gS(u),D=x.useCallback(()=>{if(!S.current||!C.current)return;const R={placement:t,strategy:n,middleware:h};P.current&&(R.platform=P.current),nie(S.current,C.current,R).then(O=>{const F={...O,isPositioned:k.current!==!1};A.current&&!o0(_.current,F)&&(_.current=F,Cs.flushSync(()=>{f(F)}))})},[h,t,n,P,k]);fb(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[u]);const A=x.useRef(!1);fb(()=>(A.current=!0,()=>{A.current=!1}),[]),fb(()=>{if(j&&(S.current=j),N&&(C.current=N),j&&N){if(T.current)return T.current(j,N,D);D()}},[j,N,D,T,E]);const I=x.useMemo(()=>({reference:S,floating:C,setReference:w,setFloating:b}),[w,b]),M=x.useMemo(()=>({reference:j,floating:N}),[j,N]),$=x.useMemo(()=>{const R={position:n,left:0,top:0};if(!M.floating)return R;const O=sD(M.floating,d.x),F=sD(M.floating,d.y);return l?{...R,transform:"translate("+O+"px, "+F+"px)",...wz(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:O,top:F}},[n,l,M.floating,d.x,d.y]);return x.useMemo(()=>({...d,update:D,refs:I,elements:M,floatingStyles:$}),[d,D,I,M,$])}const iie=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?aD({element:r.current,padding:a}).fn(n):{}:r?aD({element:r,padding:a}).fn(n):{}}}},oie=(e,t)=>({...Xse(e),options:[e,t]}),lie=(e,t)=>({...Qse(e),options:[e,t]}),cie=(e,t)=>({...tie(e),options:[e,t]}),uie=(e,t)=>({...Jse(e),options:[e,t]}),die=(e,t)=>({...Zse(e),options:[e,t]}),fie=(e,t)=>({...eie(e),options:[e,t]}),hie=(e,t)=>({...iie(e),options:[e,t]});var mie="Arrow",jz=x.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...i}=e;return s.jsx(Pe.svg,{...i,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});jz.displayName=mie;var pie=jz;function av(e){const[t,n]=x.useState(void 0);return Fn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;o=u.inlineSize,l=u.blockSize}else o=e.offsetWidth,l=e.offsetHeight;n({width:o,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var dk="Popper",[Nz,Vc]=kn(dk),[gie,Sz]=Nz(dk),Cz=e=>{const{__scopePopper:t,children:n}=e,[r,a]=x.useState(null);return s.jsx(gie,{scope:t,anchor:r,onAnchorChange:a,children:n})};Cz.displayName=dk;var _z="PopperAnchor",Ez=x.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,i=Sz(_z,n),o=x.useRef(null),l=qe(t,o);return x.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:s.jsx(Pe.div,{...a,ref:l})});Ez.displayName=_z;var fk="PopperContent",[yie,vie]=Nz(fk),Az=x.forwardRef((e,t)=>
vendor: 4,220 bytes, line 706
706{var K,W,q,J,ie,X;const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:p,...g}=e,y=Sz(fk,n),[v,w]=x.useState(null),b=qe(t,ge=>w(ge)),[j,N]=x.useState(null),S=av(j),C=(S==null?void 0:S.width)??0,_=(S==null?void 0:S.height)??0,E=r+(i!=="center"?"-"+i:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},P=Array.isArray(u)?u:[u],k=P.length>0,D={padding:T,boundary:P.filter(bie),altBoundary:k},{refs:A,floatingStyles:I,placement:M,isPositioned:$,middlewareData:R}=sie({strategy:"fixed",placement:E,whileElementsMounted:(...ge)=>Yse(...ge,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[oie({mainAxis:a+_,alignmentAxis:o}),c&&lie({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?cie():void 0,...D}),c&&uie({...D}),die({...D,apply:({elements:ge,rects:Se,availableWidth:ce,availableHeight:ye})=>{const{width:Ie,height:Ue}=Se.reference,Ze=ge.floating.style;Ze.setProperty("--radix-popper-available-width",`${ce}px`),Ze.setProperty("--radix-popper-available-height",`${ye}px`),Ze.setProperty("--radix-popper-anchor-width",`${Ie}px`),Ze.setProperty("--radix-popper-anchor-height",`${Ue}px`)}}),j&&hie({element:j,padding:l}),wie({arrowWidth:C,arrowHeight:_}),h&&fie({strategy:"referenceHidden",...D})]}),[O,F]=Oz(M),z=In(p);Fn(()=>{$&&(z==null||z())},[$,z]);const B=(K=R.arrow)==null?void 0:K.x,H=(W=R.arrow)==null?void 0:W.y,Y=((q=R.arrow)==null?void 0:q.centerOffset)!==0,[ee,V]=x.useState();return Fn(()=>{v&&V(window.getComputedStyle(v).zIndex)},[v]),s.jsx("div",{ref:A.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:$?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ee,"--radix-popper-transform-origin":[(J=R.transformOrigin)==null?void 0:J.x,(ie=R.transformOrigin)==null?void 0:ie.y].join(" "),...((X=R.hide)==null?void 0:X.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:s.jsx(yie,{scope:n,placedSide:O,onArrowChange:N,arrowX:B,arrowY:H,shouldHideArrow:Y,children:s.jsx(Pe.div,{"data-side":O,"data-align":F,...g,ref:b,style:{...g.style,animation:$?void 0:"none"}})})})});Az.displayName=fk;var Pz="PopperArrow",xie={top:"bottom",right:"left",bottom:"top",left:"right"},kz=x.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,i=vie(Pz,r),o=xie[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(pie,{...a,ref:n,style:{...a.style,display:"block"}})})});kz.displayName=Pz;function bie(e){return e!==null}var wie=e=>({name:"transformOrigin",options:e,fn(t){var y,v,w;const{placement:n,rects:r,middlewareData:a}=t,o=((y=a.arrow)==null?void 0:y.centerOffset)!==0,l=o?0:e.arrowWidth,c=o?0:e.arrowHeight,[u,d]=Oz(n),f={start:"0%",center:"50%",end:"100%"}[d],h=(((v=a.arrow)==null?void 0:v.x)??0)+l/2,m=(((w=a.arrow)==null?void 0:w.y)??0)+c/2;let p="",g="";return u==="bottom"?(p=o?f:`${h}px`,g=`${-c}px`):u==="top"?(p=o?f:`${h}px`,g=`${r.floating.height+c}px`):u==="right"?(p=`${-c}px`,g=o?f:`${m}px`):u==="left"&&(p=`${r.floating.width+c}px`,g=o?f:`${m}px`),{data:{x:p,y:g}}}});function Oz(e){const[t,n="center"]=e.split("-");return[t,n]}var Dj=Cz,sv=Ez,$j=Az,Ij=kz,[Lj,Unt]=kn("Tooltip",[Vc]),Fj=Vc(),Tz="TooltipProvider",jie=700,G_="tooltip.open",[Nie,hk]=Lj(Tz),Mz=e=>{const{__scopeTooltip:t,delayDuration:n=jie,skipDelayDuration:r=300,disableHoverableContent:a=!1,children:i}=e,o=x.useRef(!0),l=x.useRef(!1),c=x.useRef(0);return x.useEffect(()=>{const u=c.current;return()=>window.clearTimeout(u)},[]),s.jsx(Nie,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:x.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:x.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>
vendor: 5,070 bytes, line 706
706o.current=!0,r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:x.useCallback(u=>{l.current=u},[]),disableHoverableContent:a,children:i})};Mz.displayName=Tz;var Lg="Tooltip",[Sie,Bj]=Lj(Lg),Rz=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=e,c=hk(Lg,e.__scopeTooltip),u=Fj(t),[d,f]=x.useState(null),h=Ia(),m=x.useRef(0),p=o??c.disableHoverableContent,g=l??c.delayDuration,y=x.useRef(!1),[v,w]=fr({prop:r,defaultProp:a??!1,onChange:C=>{C?(c.onOpen(),document.dispatchEvent(new CustomEvent(G_))):c.onClose(),i==null||i(C)},caller:Lg}),b=x.useMemo(()=>v?y.current?"delayed-open":"instant-open":"closed",[v]),j=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,w(!0)},[w]),N=x.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),S=x.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,w(!0),m.current=0},g)},[g,w]);return x.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(Dj,{...u,children:s.jsx(Sie,{scope:t,contentId:h,open:v,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:x.useCallback(()=>{c.isOpenDelayedRef.current?S():j()},[c.isOpenDelayedRef,S,j]),onTriggerLeave:x.useCallback(()=>{p?N():(window.clearTimeout(m.current),m.current=0)},[N,p]),onOpen:j,onClose:N,disableHoverableContent:p,children:n})})};Rz.displayName=Lg;var Y_="TooltipTrigger",Dz=x.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,a=Bj(Y_,n),i=hk(Y_,n),o=Fj(n),l=x.useRef(null),c=qe(t,l,a.onTriggerChange),u=x.useRef(!1),d=x.useRef(!1),f=x.useCallback(()=>u.current=!1,[]);return x.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),s.jsx(sv,{asChild:!0,...o,children:s.jsx(Pe.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...r,ref:c,onPointerMove:je(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:je(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:je(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:je(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:je(e.onBlur,a.onClose),onClick:je(e.onClick,a.onClose)})})});Dz.displayName=Y_;var Cie="TooltipPortal",[Vnt,_ie]=Lj(Cie,{forceMount:void 0}),ph="TooltipContent",$z=x.forwardRef((e,t)=>{const n=_ie(ph,e.__scopeTooltip),{forceMount:r=n.forceMount,side:a="top",...i}=e,o=Bj(ph,e.__scopeTooltip);return s.jsx(Jn,{present:r||o.open,children:o.disableHoverableContent?s.jsx(Iz,{side:a,...i,ref:t}):s.jsx(Eie,{side:a,...i,ref:t})})}),Eie=x.forwardRef((e,t)=>{const n=Bj(ph,e.__scopeTooltip),r=hk(ph,e.__scopeTooltip),a=x.useRef(null),i=qe(t,a),[o,l]=x.useState(null),{trigger:c,onClose:u}=n,d=a.current,{onPointerInTransitChange:f}=r,h=x.useCallback(()=>{l(null),f(!1)},[f]),m=x.useCallback((p,g)=>{const y=p.currentTarget,v={x:p.clientX,y:p.clientY},w=Tie(v,y.getBoundingClientRect()),b=Mie(v,w),j=Rie(g.getBoundingClientRect()),N=$ie([...b,...j]);l(N),f(!0)},[f]);return x.useEffect(()=>()=>h(),[h]),x.useEffect(()=>{if(c&&d){const p=y=>m(y,d),g=y=>m(y,c);return c.addEventListener("pointerleave",p),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",g)}}},[c,d,m,h]),x.useEffect(()=>{if(o){const p=g=>{const y=g.target,v={x:g.clientX,y:g.clientY},w=(c==null?void 0:c.contains(y))||(d==null?void 0:d.contains(y)),b=!Die(v,o);w?h():b&&(h(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[c,d,o,u,h]),s.jsx(Iz,{...e,ref:i})}),[Aie,Pie]=Lj(Lg,{isInside:!1}),kie=fB("TooltipContent"),Iz=x.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=e,c=Bj(ph,n),u=Fj(n),{onClose:d}=c;return x.useEffect(()=>(document.addEventListener(G_,d),()=>document.removeEventListener(G_,d)),[d]),x.useEffect(()=>{if(c.trigger){const f=h=>{const m=h.target;m!=null&&m.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),s.jsx(Pd,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:s.jsxs($j,{"data-state":c.stateAttribute,...u,...l,ref:t,style:{...l.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:[s.jsx(kie,{children:r}),s.jsx(Aie,{scope:n,isInside:!0,children:s.jsx(zne,{id:c.contentId,role:"tooltip",children:a||r})})]})})});$z.displayName=ph;var Lz="TooltipArrow",Oie=x.forwardRef((e,t)=>
706{const{__scopeTooltip:n,...r}=e,a=Fj(n);return Pie(Lz,n).isInside?null:s.jsx(Ij,{...a,...r,ref:t})});Oie.displayName=Lz;function Tie(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),a=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,a,i)){case i:return"left";case a:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Mie(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 Rie(e){const{top:t,right:n,bottom:r,left:a}=e;return[{x:a,y:t},{x:n,y:t},{x:n,y:r},{x:a,y:r}]}function Die(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(a=!a)}return a}function $ie(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),Iie(t)}function Iie(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const a=e[r];for(;t.length>=2;){const i=t[t.length-1],o=t[t.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))t.pop();else break}t.push(a)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const a=e[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))n.pop();else break}n.push(a)}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 Lie=Mz,Fie=Rz,Bie=Dz,Fz=$z;const mk=Lie,Vt=Fie,Wt=Bie,Bt=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(Fz,{ref:r,sideOffset:t,className:te("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md 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",e),...n}));Bt.displayName=Fz.displayName;var wm=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},od=typeof window>"u"||"Deno"in globalThis;function sa(){}function zie(e,t){return typeof e=="function"?e(t):e}function X_(e){return typeof e=="number"&&e>=0&&e!==1/0}function Bz(e,t){return Math.max(e+(t||0)-Date.now(),0)}function _c(e,t){return typeof e=="function"?e(t):e}function xs(e,t){return typeof e=="function"?e(t):e}function iD(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:i,queryKey:o,stale:l}=e;if(o){if(r){if(t.queryHash!==pk(o,t.options))return!1}else if(!Fg(t.queryKey,o))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||i&&!i(t))}function oD(e,t){const{exact:n,status:r,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(ld(t.options.mutationKey)!==ld(i))return!1}else if(!Fg(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function pk(e,t){return((t==null?void 0:t.queryKeyHashFn)||ld)(e)}function ld(e){return JSON.stringify(e,(t,n)=>Q_(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function Fg(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Fg(e[n],t[n])):!1}function zz(e,t){if(e===t)return e;const n=lD(e)&&lD(t);if(n||Q_(e)&&Q_(t)){const r=n?e:Object.keys(e),a=r.length,i=n?t:Object.keys(t),o=i.length,l=n?[]:{},c=new Set(r);let u=0;for(let d=0;d<o;d++){const f=n?d:i[d];(!n&&c.has(f)||n)&&e[f]===void 0&&t[f]===void 0?(l[f]=void 0,u++):(l[f]=zz(e[f],t[f]),l[f]===e[f]&&e[f]!==void 0&&u++)}return a===o&&u===a?e:l}return t}function l0(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function lD(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Q_(e){if(!cD(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!cD(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function cD(e){return Object.prototype.toString.call(e)==="[object Object]"}function Uie(e){return new Promise(t=>{setTimeout(t,e)})}function J_(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?zz(e,t):t}function Vie(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function Wie(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var gk=Symbol();function Uz(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===gk?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Vz(e,t){return typeof e=="function"?e(...t):!!e}var Tu,tc,Kf,$F,qie=($F=class extends wm{constructor(){super();Ye(this,Tu);Ye(this,tc);Ye(this,Kf);De(this,Kf,t=>{if(!od&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){G(this,tc)||this.setEventListener(G(this,Kf))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,tc))==null||t.call(this),De(this,tc,void 0))}setEventListener(t){var n;De(this,Kf,t),(n=G(this,tc))==null||n.call(this),De(this,tc,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){G(this,Tu)!==t&&(De(this,Tu,t),this.onFocus())}onFocus(){const t=this.isFocused();
vendor: 4,936 bytes, line 706
706this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof G(this,Tu)=="boolean"?G(this,Tu):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Tu=new WeakMap,tc=new WeakMap,Kf=new WeakMap,$F),yk=new qie,Gf,nc,Yf,IF,Hie=(IF=class extends wm{constructor(){super();Ye(this,Gf,!0);Ye(this,nc);Ye(this,Yf);De(this,Yf,t=>{if(!od&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){G(this,nc)||this.setEventListener(G(this,Yf))}onUnsubscribe(){var t;this.hasListeners()||((t=G(this,nc))==null||t.call(this),De(this,nc,void 0))}setEventListener(t){var n;De(this,Yf,t),(n=G(this,nc))==null||n.call(this),De(this,nc,t(this.setOnline.bind(this)))}setOnline(t){G(this,Gf)!==t&&(De(this,Gf,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return G(this,Gf)}},Gf=new WeakMap,nc=new WeakMap,Yf=new WeakMap,IF),c0=new Hie;function Z_(){let e,t;const n=new Promise((a,i)=>{e=a,t=i});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}function Kie(e){return Math.min(1e3*2**e,3e4)}function Wz(e){return(e??"online")==="online"?c0.isOnline():!0}var qz=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function yS(e){return e instanceof qz}function Hz(e){let t=!1,n=0,r=!1,a;const i=Z_(),o=g=>{var y;r||(h(new qz(g)),(y=e.abort)==null||y.call(e))},l=()=>{t=!0},c=()=>{t=!1},u=()=>yk.isFocused()&&(e.networkMode==="always"||c0.isOnline())&&e.canRun(),d=()=>Wz(e.networkMode)&&e.canRun(),f=g=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,g),a==null||a(),i.resolve(g))},h=g=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,g),a==null||a(),i.reject(g))},m=()=>new Promise(g=>{var y;a=v=>{(r||u())&&g(v)},(y=e.onPause)==null||y.call(e)}).then(()=>{var g;a=void 0,r||(g=e.onContinue)==null||g.call(e)}),p=()=>{if(r)return;let g;const y=n===0?e.initialPromise:void 0;try{g=y??e.fn()}catch(v){g=Promise.reject(v)}Promise.resolve(g).then(f).catch(v=>{var S;if(r)return;const w=e.retry??(od?0:3),b=e.retryDelay??Kie,j=typeof b=="function"?b(n,v):b,N=w===!0||typeof w=="number"&&n<w||typeof w=="function"&&w(n,v);if(t||!N){h(v);return}n++,(S=e.onFail)==null||S.call(e,n,v),Uie(j).then(()=>u()?void 0:m()).then(()=>{t?h(v):p()})})};return{promise:i,cancel:o,continue:()=>(a==null||a(),i),cancelRetry:l,continueRetry:c,canStart:d,start:()=>(d()?p():m().then(p),i)}}var Gie=e=>setTimeout(e,0);function Yie(){let e=[],t=0,n=l=>{l()},r=l=>{l()},a=Gie;const i=l=>{t?e.push(l):a(()=>{n(l)})},o=()=>{const l=e;e=[],l.length&&a(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||o()}return c},batchCalls:l=>(...c)=>{i(()=>{l(...c)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{a=l}}}var ir=Yie(),Mu,LF,Kz=(LF=class{constructor(){Ye(this,Mu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),X_(this.gcTime)&&De(this,Mu,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(od?1/0:5*60*1e3))}clearGcTimeout(){G(this,Mu)&&(clearTimeout(G(this,Mu)),De(this,Mu,void 0))}},Mu=new WeakMap,LF),Xf,Ru,ys,Du,zr,qy,$u,Vs,Co,FF,Xie=(FF=class extends Kz{constructor(t){super();Ye(this,Vs);Ye(this,Xf);Ye(this,Ru);Ye(this,ys);Ye(this,Du);Ye(this,zr);Ye(this,qy);Ye(this,$u);De(this,$u,!1),De(this,qy,t.defaultOptions),this.setOptions(t.options),this.observers=[],De(this,Du,t.client),De(this,ys,G(this,Du).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,De(this,Xf,Qie(this.options)),this.state=t.state??G(this,Xf),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=G(this,zr))==null?void 0:t.promise}setOptions(t){this.options={...G(this,qy),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&G(this,ys).remove(this)}setData(t,n){const r=J_(this.state.data,t,this.options);return gt(this,Vs,Co).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){gt(this,Vs,Co).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=G(this,zr))==null?void 0:r.promise;return(a=G(this,zr))==null||a.cancel(t),n?n.then(sa).catch(sa):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(G(this,Xf))}isActive(){return this.observers.some(t=>xs(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gk||this.state.dataUpdateCount+this.state.errorUpdate
vendor: 1,274 bytes, line 706
706Count===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>_c(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Bz(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=G(this,zr))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=G(this,zr))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),G(this,ys).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(G(this,zr)&&(G(this,$u)?G(this,zr).cancel({revert:!0}):G(this,zr).cancelRetry()),this.scheduleGc()),G(this,ys).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||gt(this,Vs,Co).call(this,{type:"invalidate"})}
vendor: 9,010 bytes, line 706
706fetch(t,n){var u,d,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(G(this,zr))return G(this,zr).continueRetry(),G(this,zr).promise}if(t&&this.setOptions(t),!this.options.queryFn){const h=this.observers.find(m=>m.options.queryFn);h&&this.setOptions(h.options)}const r=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(De(this,$u,!0),r.signal)})},i=()=>{const h=Uz(this.options,n),p=(()=>{const g={client:G(this,Du),queryKey:this.queryKey,meta:this.meta};return a(g),g})();return De(this,$u,!1),this.options.persister?this.options.persister(h,p,this):h(p)},l=(()=>{const h={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:G(this,Du),state:this.state,fetchFn:i};return a(h),h})();(u=this.options.behavior)==null||u.onFetch(l,this),De(this,Ru,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=l.fetchOptions)==null?void 0:d.meta))&&gt(this,Vs,Co).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var m,p,g,y;yS(h)&&h.silent||gt(this,Vs,Co).call(this,{type:"error",error:h}),yS(h)||((p=(m=G(this,ys).config).onError)==null||p.call(m,h,this),(y=(g=G(this,ys).config).onSettled)==null||y.call(g,this.state.data,h,this)),this.scheduleGc()};return De(this,zr,Hz({initialPromise:n==null?void 0:n.initialPromise,fn:l.fetchFn,abort:r.abort.bind(r),onSuccess:h=>{var m,p,g,y;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(v){c(v);return}(p=(m=G(this,ys).config).onSuccess)==null||p.call(m,h,this),(y=(g=G(this,ys).config).onSettled)==null||y.call(g,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,m)=>{gt(this,Vs,Co).call(this,{type:"failed",failureCount:h,error:m})},onPause:()=>{gt(this,Vs,Co).call(this,{type:"pause"})},onContinue:()=>{gt(this,Vs,Co).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),G(this,zr).start()}},Xf=new WeakMap,Ru=new WeakMap,ys=new WeakMap,Du=new WeakMap,zr=new WeakMap,qy=new WeakMap,$u=new WeakMap,Vs=new WeakSet,Co=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Gz(r.data,this.options),fetchMeta:t.meta??null};case"success":return De(this,Ru,void 0),{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const a=t.error;return yS(a)&&a.revert&&G(this,Ru)?{...G(this,Ru),fetchStatus:"idle"}:{...r,error:a,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ir.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),G(this,ys).notify({query:this,type:"updated",action:t})})},FF);function Gz(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Wz(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Qie(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Di,BF,Jie=(BF=class extends wm{constructor(t={}){super();Ye(this,Di);this.config=t,De(this,Di,new Map)}build(t,n,r){const a=n.queryKey,i=n.queryHash??pk(a,n);let o=this.get(i);return o||(o=new Xie({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){G(this,Di).has(t.queryHash)||(G(this,Di).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=G(this,Di).get(t.queryHash);n&&(t.destroy(),n===t&&G(this,Di).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ir.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return G(this,Di).get(t)}getAll(){return[...G(this,Di).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>iD(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>iD(t,r)):n}notify(t){ir.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ir.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ir.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Di=new WeakMap,BF),$i,ea,Iu,Ii,Wl,zF,Zie=(zF=class extends Kz{constructor(t){super();Ye(this,Ii);Ye(this,$i);Ye(this,ea);Ye(this,Iu);this.mutationId=t.mutationId,De(this,ea,t.mutationCache),De(this,$i,[]),this.state=t.state||Yz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){G(this,$i).includes(t)||(G(this,$i).push(t),this.clearGcTimeout(),G(this,ea).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){De(this,$i,G(this,$i).filter(n=>n!==t)),this.scheduleGc(),G(this,ea).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){G(this,$i).length||(this.state.status==="pending"?this.scheduleGc():G(this,ea).remove(this))}continue(){var t;return((t=G(this,Iu))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,l,c,u,d,f,h,m,p,g,y,v,w,b,j,N,S,C,_;const n=()=>{gt(this,Ii,Wl).call(this,{type:"continue"})};De(this,Iu,Hz({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(E,T)=>{gt(this,Ii,Wl).call(this,{type:"failed",failureCount:E,error:T})},onPause:()=>{gt(this,Ii,Wl).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>G(this,ea).canRun(this)}));const r=this.state.status==="pending",a=!G(this,Iu).canStart();try{if(r)n();else{gt(this,Ii,Wl).call(this,{type:"pending",variables:t,isPaused:a}),await((o=(i=G(this,ea).config).onMutate)==null?void 0:o.call(i,t,this));const T=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t));T!==this.state.context&&gt(this,Ii,Wl).call(this,{type:"pending",context:T,variables:t,isPaused:a})}const E=await G(this,Iu).start();return await((d=(u=G(this,ea).config).onSuccess)==null?void 0:d.call(u,E,t,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,E,t,this.state.context)),await((p=(m=G(this,ea).config).onSettled)==null?void 0:p.call(m,E,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,E,null,t,this.state.context)),gt(this,Ii,Wl).call(this,{type:"success",data:E}),E}catch(E){try{throw await((w=(v=G(this,ea).config).onError)==null?void 0:w.call(v,E,t,this.state.context,this)),await((j=(b=this.options).onError)==null?void 0:j.call(b,E,t,this.state.context)),await((S=(N=G(this,ea).config).onSettled)==null?void 0:S.call(N,void 0,E,this.state.variables,this.state.context,this)),await((_=(C=this.options).onSettled)==null?void 0:_.call(C,void 0,E,t,this.state.context)),E}finally{gt(this,Ii,Wl).call(this,{type:"error",error:E})}}finally{G(this,ea).runNext(this)}}},$i=new WeakMap,ea=new WeakMap,Iu=new WeakMap,Ii=new WeakSet,Wl=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ir.batch(()=>{G(this,$i).forEach(r=>{r.onMutationUpdate(t)}),G(this,ea).notify({mutation:this,type:"updated",action:t})})},zF);function Yz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Po,Ws,Hy,UF,eoe=(UF=class extends wm{constructor(t={}){super();Ye(this,Po);Ye(this,Ws);Ye(this,Hy);this.config=t,De(this,Po,new Set),De(this,Ws,new Map),De(this,Hy,0)}build(t,n,r){const a=new Zie({mutationCache:this,mutationId:++Xv(this,Hy)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){G(this,Po).add(t);
706const n=xx(t);if(typeof n=="string"){const r=G(this,Ws).get(n);r?r.push(t):G(this,Ws).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(G(this,Po).delete(t)){const n=xx(t);if(typeof n=="string"){const r=G(this,Ws).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&G(this,Ws).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=xx(t);if(typeof n=="string"){const r=G(this,Ws).get(n),a=r==null?void 0:r.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=xx(t);if(typeof n=="string"){const a=(r=G(this,Ws).get(n))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ir.batch(()=>{G(this,Po).forEach(t=>{this.notify({type:"removed",mutation:t})}),G(this,Po).clear(),G(this,Ws).clear()})}getAll(){return Array.from(G(this,Po))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>oD(n,r))}findAll(t={}){return this.getAll().filter(n=>oD(t,n))}notify(t){ir.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ir.batch(()=>Promise.all(t.map(n=>n.continue().catch(sa))))}},Po=new WeakMap,Ws=new WeakMap,Hy=new WeakMap,UF);function xx(e){var t;return(t=e.options.scope)==null?void 0:t.id}function uD(e){return{onFetch:(t,n)=>{var d,f,h,m,p;const r=t.options,a=(h=(f=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((m=t.state.data)==null?void 0:m.pages)||[],o=((p=t.state.data)==null?void 0:p.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const u=async()=>{let g=!1;const y=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},v=Uz(t.options,t.fetchOptions),w=async(b,j,N)=>{if(g)return Promise.reject();if(j==null&&b.pages.length)return Promise.resolve(b);const C=(()=>{const P={client:t.client,queryKey:t.queryKey,pageParam:j,direction:N?"backward":"forward",meta:t.options.meta};return y(P),P})(),_=await v(C),{maxPages:E}=t.options,T=N?Wie:Vie;return{pages:T(b.pages,_,E),pageParams:T(b.pageParams,j,E)}};if(a&&i.length){const b=a==="backward",j=b?toe:dD,N={pages:i,pageParams:o},S=j(r,N);l=await w(N,S,b)}else{const b=e??i.length;do{const j=c===0?o[0]??r.initialPageParam:dD(r,l);if(c>0&&j==null)break;l=await w(l,j),c++}while(c<b)}return l};t.options.persister?t.fetchFn=()=>{var g,y;return(y=(g=t.options).persister)==null?void 0:y.call(g,u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function dD(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function toe(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Rn,rc,ac,Qf,Jf,sc,Zf,eh,VF,noe=(VF=class{constructor(e={}){Ye(this,Rn);Ye(this,rc);Ye(this,ac);Ye(this,Qf);Ye(this,Jf);Ye(this,sc);Ye(this,Zf);Ye(this,eh);De(this,Rn,e.queryCache||new Jie),De(this,rc,e.mutationCache||new eoe),De(this,ac,e.defaultOptions||{}),De(this,Qf,new Map),De(this,Jf,new Map),De(this,sc,0)}mount(){Xv(this,sc)._++,G(this,sc)===1&&(De(this,Zf,yk.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,Rn).onFocus())})),De(this,eh,c0.subscribe(async e=>{e&&(await this.resumePausedMutations(),G(this,Rn).onOnline())})))}unmount(){var e,t;Xv(this,sc)._--,G(this,sc)===0&&((e=G(this,Zf))==null||e.call(this),De(this,Zf,void 0),(t=G(this,eh))==null||t.call(this),De(this,eh,void 0))}isFetching(e){return G(this,Rn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return G(this,rc).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=G(this,Rn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=G(this,Rn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(_c(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return G(this,Rn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=G(this,Rn).get(r.queryHash),i=a==null?void 0:a.state.data,o=zie(t,i);if(o!==void 0)return G(this,Rn).build(this,r).setData(o,{...n,manual:!0})}
vendor: 13,110 bytes, line 706
706setQueriesData(e,t,n){return ir.batch(()=>G(this,Rn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=G(this,Rn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=G(this,Rn);ir.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=G(this,Rn);return ir.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ir.batch(()=>G(this,Rn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(sa).catch(sa)}invalidateQueries(e,t={}){return ir.batch(()=>(G(this,Rn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ir.batch(()=>G(this,Rn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,n);return n.throwOnError||(i=i.catch(sa)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(sa)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=G(this,Rn).build(this,t);return n.isStaleByTime(_c(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sa).catch(sa)}fetchInfiniteQuery(e){return e.behavior=uD(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sa).catch(sa)}ensureInfiniteQueryData(e){return e.behavior=uD(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return c0.isOnline()?G(this,rc).resumePausedMutations():Promise.resolve()}getQueryCache(){return G(this,Rn)}getMutationCache(){return G(this,rc)}getDefaultOptions(){return G(this,ac)}setDefaultOptions(e){De(this,ac,e)}setQueryDefaults(e,t){G(this,Qf).set(ld(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...G(this,Qf).values()],n={};return t.forEach(r=>{Fg(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){G(this,Jf).set(ld(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...G(this,Jf).values()],n={};return t.forEach(r=>{Fg(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...G(this,ac).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=pk(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===gk&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...G(this,ac).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){G(this,Rn).clear(),G(this,rc).clear()}},Rn=new WeakMap,rc=new WeakMap,ac=new WeakMap,Qf=new WeakMap,Jf=new WeakMap,sc=new WeakMap,Zf=new WeakMap,eh=new WeakMap,VF),wa,Ct,Ky,ta,Lu,th,ic,oc,Gy,nh,rh,Fu,Bu,lc,ah,qt,Ap,e2,t2,n2,r2,a2,s2,i2,Xz,WF,roe=(WF=class extends wm{constructor(t,n){super();Ye(this,qt);Ye(this,wa);Ye(this,Ct);Ye(this,Ky);Ye(this,ta);Ye(this,Lu);Ye(this,th);Ye(this,ic);Ye(this,oc);Ye(this,Gy);Ye(this,nh);Ye(this,rh);Ye(this,Fu);Ye(this,Bu);Ye(this,lc);Ye(this,ah,new Set);this.options=n,De(this,wa,t),De(this,oc,null),De(this,ic,Z_()),this.options.experimental_prefetchInRender||G(this,ic).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(G(this,Ct).addObserver(this),fD(G(this,Ct),this.options)?gt(this,qt,Ap).call(this):this.updateResult(),gt(this,qt,r2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return o2(G(this,Ct),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return o2(G(this,Ct),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,gt(this,qt,a2).call(this),gt(this,qt,s2).call(this),G(this,Ct).removeObserver(this)}setOptions(t){const n=this.options,r=G(this,Ct);if(this.options=G(this,wa).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof xs(this.options.enabled,G(this,Ct))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");gt(this,qt,i2).call(this),G(this,Ct).setOptions(this.options),n._defaulted&&!l0(this.options,n)&&G(this,wa).getQueryCache().notify({type:"observerOptionsUpdated",query:G(this,Ct),observer:this});const a=this.hasListeners();a&&hD(G(this,Ct),r,this.options,n)&&gt(this,qt,Ap).call(this),this.updateResult(),a&&(G(this,Ct)!==r||xs(this.options.enabled,G(this,Ct))!==xs(n.enabled,G(this,Ct))||_c(this.options.staleTime,G(this,Ct))!==_c(n.staleTime,G(this,Ct)))&&gt(this,qt,e2).call(this);const i=gt(this,qt,t2).call(this);a&&(G(this,Ct)!==r||xs(this.options.enabled,G(this,Ct))!==xs(n.enabled,G(this,Ct))||i!==G(this,lc))&&gt(this,qt,n2).call(this,i)}getOptimisticResult(t){const n=G(this,wa).getQueryCache().build(G(this,wa),t),r=this.createResult(n,t);return soe(this,r)&&(De(this,ta,r),De(this,th,this.options),De(this,Lu,G(this,Ct).state)),r}getCurrentResult(){return G(this,ta)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),Reflect.get(r,a))})}trackProp(t){G(this,ah).add(t)}getCurrentQuery(){return G(this,Ct)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=G(this,wa).defaultQueryOptions(t),r=G(this,wa).getQueryCache().build(G(this,wa),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return gt(this,qt,Ap).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),G(this,ta)))}createResult(t,n){var E;const r=G(this,Ct),a=this.options,i=G(this,ta),o=G(this,Lu),l=G(this,th),u=t!==r?t.state:G(this,Ky),{state:d}=t;let f={...d},h=!1,m;if(n._optimisticResults){const T=this.hasListeners(),P=!T&&fD(t,n),k=T&&hD(t,r,n,a);(P||k)&&(f={...f,...Gz(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:p,errorUpdatedAt:g,status:y}=f;m=f.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let T;i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData)?(T=i.data,v=!0):T=typeof n.placeholderData=="function"?n.placeholderData((E=G(this,rh))==null?void 0:E.state.data,G(this,rh)):n.placeholderData,T!==void 0&&(y="success",m=J_(i==null?void 0:i.data,T,n),h=!0)}if(n.select&&m!==void 0&&!v)if(i&&m===(o==null?void 0:o.data)&&n.select===G(this,Gy))m=G(this,nh);else try{De(this,Gy,n.select),m=n.select(m),m=J_(i==null?void 0:i.data,m,n),De(this,nh,m),De(this,oc,null)}catch(T){De(this,oc,T)}G(this,oc)&&(p=G(this,oc),m=G(this,nh),g=Date.now(),y="error");const w=f.fetchStatus==="fetching",b=y==="pending",j=y==="error",N=b&&w,S=m!==void 0,_={status:y,fetchStatus:f.fetchStatus,isPending:b,isSuccess:y==="success",isError:j,isInitialLoading:N,isLoading:N,data:m,dataUpdatedAt:f.dataUpdatedAt,error:p,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>u.dataUpdateCount||f.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!b,isLoadingError:j&&!S,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:j&&S,isStale:vk(t,n),refetch:this.refetch,promise:G(this,ic),isEnabled:xs(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const T=D=>{_.status==="error"?D.reject(_.error):_.data!==void 0&&D.resolve(_.data)},P=()=>{const D=De(this,ic,_.promise=Z_());T(D)},k=G(this,ic);switch(k.status){case"pending":t.queryHash===r.queryHash&&T(k);break;case"fulfilled":(_.status==="error"||_.data!==k.value)&&P();break;case"rejected":(_.status!=="error"||_.error!==k.reason)&&P();break}}return _}updateResult(){const t=G(this,ta),n=this.createResult(G(this,Ct),this.options);if(De(this,Lu,G(this,Ct).state),De(this,th,this.options),G(this,Lu).data!==void 0&&De(this,rh,G(this,Ct)),l0(n,t))return;De(this,ta,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!G(this,ah).size)return!0;const o=new Set(i??G(this,ah));return this.options.throwOnError&&o.add("error"),Object.keys(G(this,ta)).some(l=>{const c=l;return G(this,ta)[c]!==t[c]&&o.has(c)})};gt(this,qt,Xz).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&gt(this,qt,r2).call(this)}},wa=new WeakMap,Ct=new WeakMap,Ky=new WeakMap,ta=new WeakMap,Lu=new WeakMap,th=new WeakMap,ic=new WeakMap,oc=new WeakMap,Gy=new WeakMap,nh=new WeakMap,rh=new WeakMap,Fu=new WeakMap,Bu=new WeakMap,lc=new WeakMap,ah=new WeakMap,qt=new WeakSet,Ap=function(t){gt(this,qt,i2).call(this);let n=G(this,Ct).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(sa)),n},e2=function(){gt(this,qt,a2).call(this);const t=_c(this.options.staleTime,G(this,Ct));if(od||G(this,ta).isStale||!X_(t))return;const r=Bz(G(this,ta).dataUpdatedAt,t)+1;De(this,Fu,setTimeout(()=>{G(this,ta).isStale||this.updateResult()},r))},t2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(G(this,Ct)):this.options.refetchInterval)??!1},n2=function(t){gt(this,qt,s2).call(this),De(this,lc,t),!(od||xs(this.options.enabled,G(this,Ct))===!1||!X_(G(this,lc))||G(this,lc)===0)&&De(this,Bu,setInterval(()=>{(this.options.refetchIntervalInBackground||yk.isFocused())&&gt(this,qt,Ap).call(this)},G(this,lc)))},r2=function(){gt(this,qt,e2).call(this),gt(this,qt,n2).call(this,gt(this,qt,t2).call(this))},a2=function(){G(this,Fu)&&(clearTimeout(G(this,Fu)),De(this,Fu,void 0))},s2=function(){G(this,Bu)&&(clearInterval(G(this,Bu)),De(this,Bu,void 0))},i2=function(){const t=G(this,wa).getQueryCache().build(G(this,wa),this.options);if(t===G(this,Ct))return;const n=G(this,Ct);De(this,Ct,t),De(this,Ky,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Xz=function(t){ir.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(G(this,ta))}),G(this,wa).getQueryCache().notify({query:G(this,Ct),type:"observerResultsUpdated"})})},WF);function aoe(e,t){return xs(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function fD(e,t){return aoe(e,t)||e.state.data!==void 0&&o2(e,t,t.refetchOnMount)}function o2(e,t,n){if(xs(t.enabled,e)!==!1&&_c(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&vk(e,t)}return!1}function hD(e,t,n,r){return(e!==t||xs(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&vk(e,n)}function vk(e,t){return xs(t.enabled,e)!==!1&&e.isStaleByTime(_c(t.staleTime,e))}function soe(e,t){return!l0(e.getCurrentResult(),t)}var cc,uc,ja,ko,Go,hb,l2,qF,ioe=(qF=class extends wm{constructor(n,r){super();Ye(this,Go);Ye(this,cc);Ye(this,uc);Ye(this,ja);Ye(this,ko);De(this,cc,n),this.setOptions(r),this.bindMethods(),gt(this,Go,hb).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=G(this,cc).defaultMutationOptions(n),l0(this.options,r)||G(this,cc).getMutationCache().notify({type:"observerOptionsUpdated",mutation:G(this,ja),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ld(r.mutationKey)!==ld(this.options.mutationKey)?this.reset():((a=G(this,ja))==null?void 0:a.state.status)==="pending"&&G(this,ja).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=G(this,ja))==null||n.removeObserver(this)}onMutationUpdate(n){gt(this,Go,hb).call(this),gt(this,Go,l2).call(this,n)}getCurrentResult(){return G(this,uc)}reset(){var n;(n=G(this,ja))==null||n.removeObserver(this),De(this,ja,void 0),gt(this,Go,hb).call(this),gt(this,Go,l2).call(this)}mutate(n,r){var a;return De(this,ko,r),(a=G(this,ja))==null||a.removeObserver(this),De(this,ja,G(this,cc).getMutationCache().build(G(this,cc),this.options)),G(this,ja).addObserver(this),G(this,ja).execute(n)}},cc=new WeakMap,uc=new WeakMap,ja=new WeakMap,ko=new WeakMap,Go=new WeakSet,hb=function(){var r;const n=((r=G(this,ja))==null?void 0:r.state)??Yz();De(this,uc,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},l2=function(n){ir.batch(()=>{var r,a,i,o,l,c,u,d;if(G(this,ko)&&this.hasListeners()){const f=G(this,uc).variables,h=G(this,uc).context;(n==null?void 0:n.type)==="success"?((a=(r=G(this,ko)).onSuccess)==null||a.call(r,n.data,f,h),(o=(i=G(this,ko)).onSettled)==null||o.call(i,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((c=(l=G(this,ko)).onError)==null||c.call(l,n.error,f,h),(d=(u=G(this,ko)).onSettled)==null||d.call(u,void 0,n.error,f,h))}
706this.listeners.forEach(f=>{f(G(this,uc))})})},qF),Qz=x.createContext(void 0),ct=e=>{const t=x.useContext(Qz);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ooe=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(Qz.Provider,{value:e,children:t})),Jz=x.createContext(!1),loe=()=>x.useContext(Jz);Jz.Provider;function coe(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var uoe=x.createContext(coe()),doe=()=>x.useContext(uoe),foe=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},hoe=e=>{x.useEffect(()=>{e.clearReset()},[e])},moe=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Vz(n,[e.error,r])),poe=e=>{if(e.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...r)=>t(n(...r)):t(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},goe=(e,t)=>e.isLoading&&e.isFetching&&!t,yoe=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,mD=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function voe(e,t,n){var f,h,m,p,g;const r=loe(),a=doe(),i=ct(),o=i.defaultQueryOptions(e);(h=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||h.call(f,o),o._optimisticResults=r?"isRestoring":"optimistic",poe(o),foe(o,a),hoe(a);const l=!i.getQueryCache().get(o.queryHash),[c]=x.useState(()=>new t(i,o)),u=c.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(x.useSyncExternalStore(x.useCallback(y=>{const v=d?c.subscribe(ir.batchCalls(y)):sa;return c.updateResult(),v},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),x.useEffect(()=>{c.setOptions(o)},[o,c]),yoe(o,u))throw mD(o,c,a);if(moe({result:u,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw u.error;if((p=(m=i.getDefaultOptions().queries)==null?void 0:m._experimental_afterQuery)==null||p.call(m,o,u),o.experimental_prefetchInRender&&!od&&goe(u,r)){const y=l?mD(o,c,a):(g=i.getQueryCache().get(o.queryHash))==null?void 0:g.promise;y==null||y.catch(sa).finally(()=>{c.updateResult()})}return o.notifyOnChangeProps?u:c.trackResult(u)}function Qt(e,t){return voe(e,roe)}function Qe(e,t){const n=ct(),[r]=x.useState(()=>new ioe(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);
vendor: 5,504 bytes, lines 706-715
706const a=x.useSyncExternalStore(x.useCallback(o=>r.subscribe(ir.batchCalls(o)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=x.useCallback((o,l)=>{r.mutate(o,l).catch(sa)},[r]);if(a.error&&Vz(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/**
707 * @remix-run/router v1.23.0
708 *
709 * Copyright (c) Remix Software Inc.
710 *
711 * This source code is licensed under the MIT license found in the
712 * LICENSE.md file in the root directory of this source tree.
713 *
714 * @license MIT
715 */function Bg(){return Bg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bg.apply(this,arguments)}var hc;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(hc||(hc={}));const pD="popstate";function xoe(e){e===void 0&&(e={});function t(r,a){let{pathname:i,search:o,hash:l}=r.location;return c2("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:u0(a)}return woe(t,n,null,e)}function Wn(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Zz(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function boe(){return Math.random().toString(36).substr(2,8)}function gD(e,t){return{usr:e.state,key:e.key,idx:t}}function c2(e,t,n,r){return n===void 0&&(n=null),Bg({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?jm(t):t,{state:n,key:t&&t.key||r||boe()})}function u0(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function jm(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function woe(e,t,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,l=hc.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Bg({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=hc.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:v})}function h(y,v){l=hc.Push;let w=c2(g.location,y,v);u=d()+1;let b=gD(w,u),j=g.createHref(w);try{o.pushState(b,"",j)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(j)}i&&c&&c({action:l,location:g.location,delta:1})}function m(y,v){l=hc.Replace;let w=c2(g.location,y,v);u=d();let b=gD(w,u),j=g.createHref(w);o.replaceState(b,"",j),i&&c&&c({action:l,location:g.location,delta:0})}function p(y){let v=a.location.origin!=="null"?a.location.origin:a.location.href,w=typeof y=="string"?y:u0(y);return w=w.replace(/ $/,"%20"),Wn(v,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,v)}let g={get action(){return l},get location(){return e(a,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(pD,f),c=y,()=>{a.removeEventListener(pD,f),c=null}},createHref(y){return t(a,y)},createURL:p,encodeLocation(y){let v=p(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:m,go(y){return o.go(y)}};return g}var yD;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(yD||(yD={}));function joe(e,t,n){return n===void 0&&(n="/"),Noe(e,t,n,!1)}function Noe(e,t,n,r){let a=typeof t=="string"?jm(t):t,i=xk(a.pathname||"/",n);if(i==null)return null;let o=eU(e);Soe(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=Doe(i);l=Moe(o[c],u,r)}return l}function eU(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Wn(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Ec([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Wn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),eU(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Ooe(u,i.index),routesMeta:d})};return e.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of tU(i.path))a(i,o,c)}),t}function tU(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=tU(r.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Soe(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Toe(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Coe=/^:[\w-]+$/,_oe=3,Eoe=2,Aoe=1,Poe=10,koe=-2,vD=e=>e==="*";function Ooe(e,t){let n=e.split("/"),r=n.length;return n.some(vD)&&(r+=koe),t&&(r+=Eoe),n.filter(a=>!vD(a)).reduce((a,i)=>a+(Coe.test(i)?_oe:i===""?Aoe:Poe),r)}function Toe(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function Moe(e,t,n){let{routesMeta:r}=e,a={},i="/",o=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f
vendor: 7,148 bytes, lines 715-724
715=xD({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=xD({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(a,f.params),o.push({params:a,pathname:Ec([i,f.pathname]),pathnameBase:Foe(Ec([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Ec([i,f.pathnameBase]))}return o}function xD(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Roe(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let g=l[f]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const p=l[f];return m&&!p?u[h]=void 0:u[h]=(p||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:e}}function Roe(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Zz(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function Doe(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Zz(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function xk(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 $oe(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?jm(e):e;return{pathname:n?n.startsWith("/")?n:Ioe(n,t):t,search:Boe(r),hash:zoe(a)}}function Ioe(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function vS(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 Loe(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function bk(e,t){let n=Loe(e);return t?n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function wk(e,t,n,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=jm(e):(a=Bg({},e),Wn(!a.pathname||!a.pathname.includes("?"),vS("?","pathname","search",a)),Wn(!a.pathname||!a.pathname.includes("#"),vS("#","pathname","hash",a)),Wn(!a.search||!a.search.includes("#"),vS("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;a.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=$oe(a,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ec=e=>e.join("/").replace(/\/\/+/g,"/"),Foe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Boe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zoe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Uoe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const nU=["post","put","patch","delete"];new Set(nU);const Voe=["get",...nU];new Set(Voe);/**
716 * React Router v6.30.1
717 *
718 * Copyright (c) Remix Software Inc.
719 *
720 * This source code is licensed under the MIT license found in the
721 * LICENSE.md file in the root directory of this source tree.
722 *
723 * @license MIT
724 */function zg(){return zg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zg.apply(this,arguments)}const jk=x.createContext(null),Woe=x.createContext(null),Wc=x.createContext(null),zj=x.createContext(null),bl=x.createContext({outlet:null,matches:[],isDataRoute:!1}),rU=x.createContext(null);function qoe(e,t){let{relative:n}=t===void 0?{}:t;Nm()||Wn(!1);let{basename:r,navigator:a}=x.useContext(Wc),{hash:i,pathname:o,search:l}=sU(e,{relative:n}),c=o;return r!=="/"&&(c=o==="/"?r:Ec([r,o])),a.createHref({pathname:c,search:l,hash:i})}function Nm(){return x.useContext(zj)!=null}function oo(){return Nm()||Wn(!1),x.useContext(zj).location}function aU(e){x.useContext(Wc).static||x.useLayoutEffect(e)}function cn(){let{isDataRoute:e}=x.useContext(bl);return e?ale():Hoe()}function Hoe(){Nm()||Wn(!1);let e=x.useContext(jk),{basename:t,future:n,navigator:r}=x.useContext(Wc),{matches:a}=x.useContext(bl),{pathname:i}=oo(),o=JSON.stringify(bk(a,n.v7_relativeSplatPath)),l=x.useRef(!1);return aU(()=>{l.current=!0}),x.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=wk(u,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ec([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}function iv(){let{matches:e}=x.useContext(bl),t=e[e.length-1];return t?t.params:{}}function sU(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=x.useContext(Wc),{matches:a}=x.useContext(bl),{pathname:i}=oo(),o=JSON.stringify(bk(a,r.v7_relativeSplatPath));return x.useMemo(()=>wk(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function Koe(e,t){return Goe(e,t)}function Goe(e,t,n,r){Nm()||Wn(!1);let{navigator:a}=x.useContext(Wc),{matches:i}=x.useContext(bl),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=oo(),d;if(t){var f;let y=typeof t=="string"?jm(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||Wn(!1),d=y}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let y=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(y.length).join("/")}let p=joe(e,{pathname:m}),g=Zoe(p&&p.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:Ec([c,a.encodeLocation?a.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Ec([c,a.encodeLocation?a.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),i,n,r);return t&&g?x.createElement(zj.Provider,{value:{location:zg({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:hc.Pop}},g):g}function Yoe(){let e=rle(),t=Uoe(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return x.createElement(x.Fragment,null,x.createElement("h2",null,"Unexpected Application 
724Error!"),x.createElement("h3",{style:{fontStyle:"italic"}},t),n?x.createElement("pre",{style:a},n):null,null)}const Xoe=x.createElement(Yoe,null);class Qoe extends x.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?x.createElement(bl.Provider,{value:this.props.routeContext},x.createElement(rU.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Joe(e){let{routeContext:t,match:n,children:r}=e,a=x.useContext(jk);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),x.createElement(bl.Provider,{value:t},r)}function Zoe(e,t,n,r){var a;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(a=n)==null?void 0:a.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Wn(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=n,p=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||p){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let m,p=!1,g=null,y=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||Xoe,c&&(u<0&&h===0?(p=!0,y=null):u===h&&(p=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,h+1)),w=()=>{let b;return m?b=g:p?b=y:f.route.Component?b=x.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=d,x.createElement(Joe,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?x.createElement(Qoe,{location:n.location,revalidation:n.revalidation,component:g,error:m,children:w(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):w()},null)}var iU=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(iU||{}),d0=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(d0||{});function ele(e){let t=x.useContext(jk);return t||Wn(!1),t}function tle(e){let t=x.useContext(Woe);return t||Wn(!1),t}function nle(e){let t=x.useContext(bl);return t||Wn(!1),t}function oU(e){let t=nle(),n=t.matches[t.matches.length-1];return n.route.id||Wn(!1),n.route.id}function rle(){var e;let t=x.useContext(rU),n=tle(d0.UseRouteError),r=oU(d0.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function ale(){let{router:e}=ele(iU.UseNavigateStable),t=oU(d0.UseNavigateStable),n=x.useRef(!1);return aU(()=>{n.current=!0}),x.useCallback(function(a,i){i===void 0&&(i={}),n.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,zg({fromRouteId:t},i)))},[e,t])}function sle(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Pp(e){let{to:t,replace:n,state:r,relative:a}=e;Nm()||Wn(!1);let{future:i,static:o}=x.useContext(Wc),{matches:l}=x.useContext(bl),{pathname:c}=oo(),u=cn(),d=wk(t,bk(l,i.v7_relativeSplatPath),c,a==="path"),f=JSON.stringify(d);return x.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:a}),[u,f,a,n,r]),null}function Pt(e){Wn(!1)}function ile(e){let{basename:t="/",children:n=null,location:r,navigationType:a=hc.Pop,navigator:i,static:o=!1,future:l}=e;Nm()&&Wn(!1);
724let c=t.replace(/^\/*/,"/"),u=x.useMemo(()=>({basename:c,navigator:i,static:o,future:zg({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof r=="string"&&(r=jm(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:p="default"}=r,g=x.useMemo(()=>{let y=xk(d,c);return y==null?null:{location:{pathname:y,search:f,hash:h,state:m,key:p},navigationType:a}},[c,d,f,h,m,p,a]);return g==null?null:x.createElement(Wc.Provider,{value:u},x.createElement(zj.Provider,{children:n,value:g}))}function ole(e){let{children:t,location:n}=e;return Koe(u2(t),n)}new Promise(()=>{});function u2(e,t){t===void 0&&(t=[]);let n=[];return x.Children.forEach(e,(r,a)=>{if(!x.isValidElement(r))return;let i=[...t,a];if(r.type===x.Fragment){n.push.apply(n,u2(r.props.children,i));return}r.type!==Pt&&Wn(!1),!r.props.index||!r.props.children||Wn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=u2(r.props.children,i)),n.push(o)}),n}/**
725 * React Router DOM v6.30.1
726 *
727 * Copyright (c) Remix Software Inc.
728 *
729 * This source code is licensed under the MIT license found in the
730 * LICENSE.md file in the root directory of this source tree.
731 *
732 * @license MIT
733 */function d2(){return d2=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},d2.apply(this,arguments)}function lle(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function cle(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ule(e,t){return e.button===0&&(!t||t==="_self")&&!cle(e)}function f2(e){return e===void 0&&(e=""),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(a=>[n,a]):[[n,r]])},[]))}function dle(e,t){let n=f2(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(i=>{n.append(a,i)})}),n}const fle=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],hle="6";try{window.__reactRouterVersion=hle}catch{}const mle="startTransition",bD=QA[mle];function ple(e){let{basename:t,children:n,future:r,window:a}=e,i=x.useRef();i.current==null&&(i.current=xoe({window:a,v5Compat:!0}));let o=i.current,[l,c]=x.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=x.useCallback(f=>{u&&bD?bD(()=>c(f)):c(f)},[c,u]);return x.useLayoutEffect(()=>o.listen(d),[o,d]),x.useEffect(()=>sle(r),[r]),x.createElement(ile,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const gle=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",yle=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vt=x.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,h=lle(t,fle),{basename:m}=x.useContext(Wc),p,g=!1;if(typeof u=="string"&&yle.test(u)&&(p=u,gle))try{let b=new URL(window.location.href),j=u.startsWith("//")?new URL(b.protocol+u):new URL(u),N=xk(j.pathname,m);j.origin===b.origin&&N!=null?u=N+j.search+j.hash:g=!0}catch{}let y=qoe(u,{relative:a}),v=vle(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:a,viewTransition:f});function w(b){r&&r(b),b.defaultPrevented||v(b)}return x.createElement("a",d2({},h,{href:p||y,onClick:g||i?r:w,ref:n,target:c}))});var wD;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(wD||(wD={}));var jD;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(jD||(jD={}));function vle(e,t){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:l}=t===void 0?{}:t,c=cn(),u=oo(),d=sU(e,{relative:o});return x.useCallback(f=>{if(ule(f,n)){f.preventDefault();let h=r!==void 0?r:u0(u)===u0(d);c(e,{replace:h,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,r,a,n,e,i,o,l])}function ov(e){let t=x.useRef(f2(e)),n=x.useRef(!1),r=oo(),a=x.useMemo(()=>dle(r.search,n.current?null:t.current),[r.search]),i=cn(),o=x.useCallback((l,c)=>{const u=f2(typeof l=="function"?l(a):l);n.current=!0,i("?"+u,c)},[i,a]);return[a,o]}const ot=e=>typeof e=="string",op=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},ND=e=>
vendor: 4,974 bytes, line 733
733e==null?"":""+e,xle=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},ble=/###/g,SD=e=>e&&e.indexOf("###")>-1?e.replace(ble,"."):e,CD=e=>!e||ot(e),Xp=(e,t,n)=>{const r=ot(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(CD(e))return{};const i=SD(r[a]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++a}return CD(e)?{}:{obj:e,k:SD(r[a])}},_D=(e,t,n)=>{const{obj:r,k:a}=Xp(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let i=t[t.length-1],o=t.slice(0,t.length-1),l=Xp(e,o,Object);for(;l.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),l=Xp(e,o,Object),l!=null&&l.obj&&typeof l.obj[`${l.k}.${i}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=n},wle=(e,t,n,r)=>{const{obj:a,k:i}=Xp(e,t,Object);a[i]=a[i]||[],a[i].push(n)},f0=(e,t)=>{const{obj:n,k:r}=Xp(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},jle=(e,t,n)=>{const r=f0(e,n);return r!==void 0?r:f0(t,n)},lU=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?ot(e[r])||e[r]instanceof String||ot(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):lU(e[r],t[r],n):e[r]=t[r]);return e},Wd=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Nle={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const Sle=e=>ot(e)?e.replace(/[&<>"'\/]/g,t=>Nle[t]):e;class Cle{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const _le=[" ",",","?","!",";"],Ele=new Cle(20),Ale=(e,t,n)=>{t=t||"",n=n||"";const r=_le.filter(o=>t.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const a=Ele.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!a.test(e);if(!i){const o=e.indexOf(n);o>0&&!a.test(e.substring(0,o))&&(i=!0)}return i},h2=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let i=0;i<r.length;){if(!a||typeof a!="object")return;let o,l="";for(let c=i;c<r.length;++c)if(c!==i&&(l+=n),l+=r[c],o=a[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<r.length-1)continue;i+=c-i+1;break}a=o}return a},Ug=e=>e==null?void 0:e.replace("_","-"),Ple={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class h0{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||Ple,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(ot(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new h0(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new h0(this.logger,t)}}var Wi=new h0;let Uj=class{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,i])=>{for(let o=0;o<i;o++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,i])=>{for(let o=0;o<i;o++)a.apply(a,[t,...n])})}};class ED extends Uj{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){var u,d;const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,o=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;t.indexOf(".")>-1?l=t.split("."):(l=[t,n],r&&(Array.isArray(r)?l.push(...r):ot(r)&&i?l.push(...r.split(i)):l.push(r)));const c=f0(this.data,l);return!c&&!n&&!r&&t.indexOf(".")>-1&&(t=l[0],n=l[1],r=l.slice(2).join(".")),c||!o||!ot(r)?c:h2((d=(u=this.data)==null?void 0:u[t])==null?void 0:d[n],r,i)}addResource(t,n,r,a,i={silent:!1}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[t,n];r&&(l=l.concat(o?r.split(o):r)),t.indexOf(".")>-1&&(l=t.split("."),a=n,n=l[1]),this.addNamespaces(n),_D(this.data,l,a),i.silent||this.emit
vendor: 1,690 bytes, line 733
733("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const i in r)(ot(r[i])||Array.isArray(r[i]))&&this.addResource(t,n,i,r[i],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,i,o={silent:!1,skipCopy:!1}){let l=[t,n];t.indexOf(".")>-1&&(l=t.split("."),a=r,r=n,n=l[1]),this.addNamespaces(n);let c=f0(this.data,l)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?lU(c,r,i):c={...c,...r},_D(this.data,l,c),o.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var cU={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(i=>{var o;t=((o=this.processors[i])==null?void 0:o.process(t,n,r,a))??t}),t}};const uU=Symbol("i18next/PATH_KEY");function kle(){const e=[],t=Object.create(null);let n;return t.get=(r,a)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),a===uU?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function m2(e,t){const{[uU]:n}=e(kle());return n.join((t==null?void 0:t.keySeparator)??".")}const AD={},xS=e=>!ot(e)&&typeof e!="boolean"&&typeof e!="number";class m0 extends Uj{constructor(t,n={}){super(),xle(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
733i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Wi.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);if((a==null?void 0:a.res)===void 0)return!1;const i=xS(a.res);return!(r.returnObjects===!1&&i)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&t.indexOf(r)>-1,l=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Ale(t,r,a);if(o&&!l){const c=t.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:t,namespaces:ot(i)?[i]:i};const u=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),t=u.join(a)}return{key:t,namespaces:ot(i)?[i]:i}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=m2(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]);const i=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:l,namespaces:c}=this.extractFromKey(t[t.length-1],a),u=c[c.length-1];let d=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const f=a.lng||this.language,h=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((f==null?void 0:f.toLowerCase())==="cimode")return h?i?{res:`${u}${d}${l}`,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${d}${l}`:i?{res:l,usedKey:l,exactUsedKey:l,usedLng:f,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:l;const m=this.resolve(t,a);let p=m==null?void 0:m.res;const g=(m==null?void 0:m.usedKey)||l,y=(m==null?void 0:m.exactUsedKey)||l,v=["[object Number]","[object Function]","[object RegExp]"],w=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,b=!this.i18nFormat||this.i18nFormat.handleAsObject,j=a.count!==void 0&&!ot(a.count),N=m0.hasDefaultValue(a),S=j?this.pluralResolver.getSuffix(f,a.count,a):"",C=a.ordinal&&j?this.pluralResolver.getSuffix(f,a.count,{ordinal:!1}):"",_=j&&!a.ordinal&&a.count===0,E=_&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${S}`]||a[`defaultValue${C}`]||a.defaultValue;let T=p;b&&!p&&N&&(T=E);const P=xS(T),k=Object.prototype.toString.apply(T);if(b&&T&&P&&v.indexOf(k)<0&&!(ot(w)&&Array.isArray(T))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,T,{...a,ns:c}):`key '${l} (${this.language})' returned an object instead of string.`;return i?(m.res=D,m.usedParams=this.getUsedParamsDetails(a),m):D}if(o){const D=Array.isArray(T),A=D?[]:{},I=D?y:g;for(const M in T)if(Object.prototype.hasOwnProperty.call(T,M)){const $=`${I}${o}${M}`;N&&!p?A[M]=this.translate($,{...a,defaultValue:xS(E)?E[M]:void 0,joinArrays:!1,ns:c}):A[M]=this.translate($,{...a,joinArrays:!1,ns:c}),A[M]===$&&(A[M]=T[M])}p=A}}else if(b&&ot(w)&&Array.isArray(p))p=p.join(w),p&&(p=this.extendTranslation(p,t,a,r));else{let D=!1,A=!1;!this.isValidLookup(p)&&N&&(D=!0,p=E),this.isValidLookup(p)||(A=!0,p=l);const M=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&A?void 0:p,$=N&&E!==p&&this.options.updateMissing;if(A||D||$){if(this.logger.log($?"updateKey":"missingKey",f,u,l,$?E:p),o){const z=this.resolve(l,{...a,keySeparator:!1});z&&z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let R=[];const O=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&O&&O[0])for(let z=0;z<O.length;z++)R.push(O[z]);else this.options.saveMissingTo==="all"?R=this.languageUtils.toResolveHierarchy(a.lng||this.language):R.push(a.lng||this.language);const F=(z,B,H)=>{var ee;const Y=N&&H!==p?H:M;this.options.missingKeyHandler?this.options.missingKeyHandler(z,u,B,Y,$,a):(ee=this.backendConnector)!=null&&ee.saveMissing&&this.backendConnector.saveMissing(z,u,B,Y,$,a),this.emit
vendor: 32,951 bytes, line 733
733("missingKey",z,u,B,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?R.forEach(z=>{const B=this.pluralResolver.getSuffixes(z,a);_&&a[`defaultValue${this.options.pluralSeparator}zero`]&&B.indexOf(`${this.options.pluralSeparator}zero`)<0&&B.push(`${this.options.pluralSeparator}zero`),B.forEach(H=>{F([z],l+H,a[`defaultValue${H}`]||E)})}):F(R,l,E))}p=this.extendTranslation(p,t,a,m,r),A&&p===l&&this.options.appendNamespaceToMissingKey&&(p=`${u}${d}${l}`),(A||D)&&this.options.parseMissingKeyHandler&&(p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${l}`:l,D?p:void 0,a))}return i?(m.res=p,m.usedParams=this.getUsedParamsDetails(a),m):p}extendTranslation(t,n,r,a,i){var c,u;if((c=this.i18nFormat)!=null&&c.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=ot(t)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const m=t.match(this.interpolator.nestingRegexp);f=m&&m.length}let h=r.replace&&!ot(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),t=this.interpolator.interpolate(t,h,r.lng||this.language||a.usedLng,r),d){const m=t.match(this.interpolator.nestingRegexp),p=m&&m.length;f<p&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...m)=>(i==null?void 0:i[0])===m[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${m[0]} in key: ${n[0]}`),null):this.translate(...m,n),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,l=ot(o)?[o]:o;return t!=null&&(l!=null&&l.length)&&r.applyPostProcessor!==!1&&(t=cU.handle(l,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,i,o,l;return ot(t)&&(t=[t]),t.forEach(c=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(c,n),d=u.key;a=d;let f=u.namespaces;this.options.fallbackNS&&(f=f.concat(this.options.fallbackNS));const h=n.count!==void 0&&!ot(n.count),m=h&&!n.ordinal&&n.count===0,p=n.context!==void 0&&(ot(n.context)||typeof n.context=="number")&&n.context!=="",g=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);f.forEach(y=>{var v,w;this.isValidLookup(r)||(l=y,!AD[`${g[0]}-${y}`]&&((v=this.utils)!=null&&v.hasLoadedNamespace)&&!((w=this.utils)!=null&&w.hasLoadedNamespace(l))&&(AD[`${g[0]}-${y}`]=!0,this.logger.warn(`key "${a}" for languages "${g.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(b=>{var S;if(this.isValidLookup(r))return;o=b;const j=[d];if((S=this.i18nFormat)!=null&&S.addLookupKeys)this.i18nFormat.addLookupKeys(j,d,b,y,n);else{let C;h&&(C=this.pluralResolver.getSuffix(b,n.count,n));const _=`${this.options.pluralSeparator}zero`,E=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(h&&(n.ordinal&&C.indexOf(E)===0&&j.push(d+C.replace(E,this.options.pluralSeparator)),j.push(d+C),m&&j.push(d+_)),p){const T=`${d}${this.options.contextSeparator||"_"}${n.context}`;j.push(T),h&&(n.ordinal&&C.indexOf(E)===0&&j.push(T+C.replace(E,this.options.pluralSeparator)),j.push(T+C),m&&j.push(T+_))}}let N;for(;N=j.pop();)this.isValidLookup(r)||(i=N,r=this.getResource(b,y,N,n))}))})}),{res:r,usedKey:a,exactUsedKey:i,usedLng:o,usedNS:l}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!ot(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const i of n)delete a[i]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class PD{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Wi.create("languageUtils")}getScriptPartFromCode(t){if(t=Ug(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Ug(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(ot(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),ot(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],i=o=>{o&&(this.isSupportedCode(o)?a.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return ot(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):ot(t)&&i(this.formatLanguageCode(t)),r.forEach(o=>{a.indexOf(o)<0&&i(this.formatLanguageCode(o))}),a}}const kD={zero:0,one:1,two:2,few:3,many:4,other:5},OD={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Ole{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Wi.create("pluralResolver"),this.pluralRulesCache={}}addRule(t,n){this.rules[t]=n}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Ug(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:a});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),OD;if(!t.match(/-|_/))return OD;const c=this.languageUtils.getLanguagePartFromCode(t);o=this.getRule(c,n)}return this.pluralRulesCache[i]=o,o}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,i)=>kD[a]-kD[i]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const TD=(e,t,n,r=".",a=!0)=>{let i=jle(e,t,n);return!i&&a&&ot(n)&&(i=h2(e,n,r),i===void 0&&(i=h2(t,n,r))),i},bS=e=>e.replace(/\$/g,"$$$$");class Tle{constructor(t={}){var n;this.logger=Wi.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:i,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:u,unescapeSuffix:d,unescapePrefix:f,nestingPrefix:h,nestingPrefixEscaped:m,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:y,maxReplaces:v,alwaysFormat:w}=t.interpolation;this.escape=n!==void 0?n:Sle,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=i?Wd(i):o||"{{",this.suffix=l?Wd(l):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":f||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=h?Wd(h):m||Wd("$t("),this.nestingSuffix=p?Wd(p):g||Wd(")"),this.nestingOptionsSeparator=y||",",this.maxReplaces=v||1e3,this.alwaysFormat=w!==void 0?w:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var m;let i,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=p=>{if(p.indexOf(this.formatSeparator)<0){const w=TD(n,c,p,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(w,void 0,r,{...a,...n,interpolationkey:p}):w}const g=p.split(this.formatSeparator),y=g.shift().trim(),v=g.join(this.formatSeparator).trim();return this.format(TD(n,c,y,this.options.keySeparator,this.options.ignoreJSONStructure),v,r,{...a,...n,interpolationkey:y})};this.resetRegExp();const d=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,f=((m=a==null?void 0:a.interpolation)==null?void 0:m.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:p=>bS(p)},{regex:this.regexp,safeValue:p=>this.escapeValue?bS(this.escape(p)):bS(p)}].forEach(p=>{for(l=0;i=p.regex.exec(t);){const g=i[1].trim();if(o=u(g),o===void 0)if(typeof d=="function"){const v=d(t,i,a);o=ot(v)?v:""}else if(a&&Object.prototype.hasOwnProperty.call(a,g))o="";else if(f){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${g} for interpolating ${t}`),o="";else!ot(o)&&!this.useRawValueToEscape&&(o=ND(o));const y=p.safeValue(o);if(t=t.replace(i[0],y),f?(p.regex.lastIndex+=o.length,p.regex.lastIndex-=i[0].length):p.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,i,o;const l=(c,u)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const f=c.split(new RegExp(`${d}[ ]*{`));let h=`{${f[1]}`;c=f[0],h=this.interpolate(h,o);const m=h.match(/'/g),p=h.match(/"/g);(((m==null?void 0:m.length)??0)%2===0&&!p||p.length%2!==0)&&(h=h.replace(/'/g,'"'));try{o=JSON.parse(h),u&&(o={...u,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${d}${h}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;a=this.nestingRegexp.exec(t);){let c=[];o={...r},o=o.replace&&!ot(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(u!==-1&&(c=a[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),a[1]=a[1].slice(0,u)),i=n(l.call(this,a[1].trim(),o),o),i&&a[0]===t&&!ot(i))return i;ot(i)||(i=ND(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),i=""),c.length&&(i=c.reduce((d,f)=>this.format(d,f,r.lng,{...r,interpolationkey:a[1].trim()}),i.trim())),t=t.replace(a[0],i),this.regexp.lastIndex=0}return t}}const Mle=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),d=l.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:t,formatOptions:n}},MD=e=>{const t={};return(n,r,a)=>{let i=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(i={...i,[a.interpolationkey]:void 0});const o=r+JSON.stringify(i);let l=t[o];return l||(l=e(Ug(r),a),t[o]=l),l(n)}},Rle=e=>(t,n,r)=>e(Ug(n),r)(t);class Dle{constructor(t={}){this.logger=Wi.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?MD:Rle;this.formats={number:r((a,i)=>{const o=new Intl.NumberFormat(a,{...i});return l=>o.format(l)}),currency:r((a,i)=>{const o=new Intl.NumberFormat(a,{...i,style:"currency"});return l=>o.format(l)}),datetime:r((a,i)=>{const o=new Intl.DateTimeFormat(a,{...i});return l=>o.format(l)}),relativetime:r((a,i)=>{const o=new Intl.RelativeTimeFormat(a,{...i});return l=>o.format(l,i.range||"day")}),list:r((a,i)=>{const o=new Intl.ListFormat(a,{...i});return l=>o.format(l)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=MD(n)}format(t,n,r,a={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(l=>l.indexOf(")")>-1)){const l=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,l)].join(this.formatSeparator)}return i.reduce((l,c)=>{var f;const{formatName:u,formatOptions:d}=Mle(c);if(this.formats[u]){let h=l;try{const m=((f=a==null?void 0:a.formatParams)==null?void 0:f[a.interpolationkey])||{},p=m.locale||m.lng||a.locale||a.lng||r;h=this.formats[u](l,p,{...d,...a,...m})}catch(m){this.logger.warn(m)}return h}else this.logger.warn(`there was no format function for ${u}`);return l},t)}}const $le=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class Ile extends Uj{constructor(t,n,r,a={}){var i,o;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Wi.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,r,a.backend,a)}queueLoad(t,n,r,a){const i={},o={},l={},c={};return t.forEach(u=>{let d=!0;n.forEach(f=>{const h=`${u}|${f}`;!r.reload&&this.store.hasResourceBundle(u,f)?this.state[h]=2:this.state[h]<0||(this.state[h]===1?o[h]===void 0&&(o[h]=!0):(this.state[h]=1,d=!1,o[h]===void 0&&(o[h]=!0),i[h]===void 0&&(i[h]=!0),c[f]===void 0&&(c[f]=!0)))}),d||(l[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(t,n,r){const a=t.split("|"),i=a[0],o=a[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const l={};this.queue.forEach(c=>{wle(c.loaded,[i],o),$le(c,t),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{l[u]||(l[u]={});const d=c.loaded[u];d.length&&d.forEach(f=>{l[u][f]===void 0&&(l[u][f]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(t,n,r,a=0,i=this.retryTimeout,o){if(!t.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:i,callback:o});return}this.readingCalls++;const l=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const f=this.waitingReads.shift();this.read(f.lng,f.ns,f.fcName,f.tried,f.wait,f.callback)}if(u&&d&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,i*2,o)},i);return}o(u,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const u=c(t,n);u&&typeof u.then=="function"?u.then(d=>l(null,d)).catch(l):l(null,u)}catch(u){l(u)}return}return c(t,n,l)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();ot(t)&&(t=this.languageUtils.toResolveHierarchy(t)),ot(n)&&(n=[n]);const i=this.queueLoad(t,n,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${a} failed`,o),!o&&l&&this.logger.log(`${n}loaded namespace ${i} for language ${a}`,l),this.loaded(t,o,l)})}saveMissing(t,n,r,a,i,o={},l=()=>{}){var c,u,d,f,h;if((u=(c=this.services)==null?void 0:c.utils)!=null&&u.hasLoadedNamespace&&!((f=(d=this.services)==null?void 0:d.utils)!=null&&f.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((h=this.backend)!=null&&h.create){const m={...o,isUpdate:i},p=this.backend.create.bind(this.backend);if(p.length<6)try{let g;p.length===5?g=p(t,n,r,a,m):g=p(t,n,r,a),g&&typeof g.then=="function"?g.then(y=>l(null,y)).catch(l):l(null,g)}catch(g){l(g)}else p(t,n,r,a,l,m)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const RD=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),ot(e[1])&&(t.defaultValue=e[1]),ot(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),DD=e=>{var t,n;return ot(e.ns)&&(e.ns=[e.ns]),ot(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),ot(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},bx=()=>{},Lle=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Qp extends Uj{constructor(t={},n){if(super(),this.options=DD(t),this.services={},this.logger=Wi,this.modules={external:[]},Lle(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(ot(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=RD();this.options={...r,...this.options,...DD(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator);const a=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Wi.init(a(this.modules.logger),this.options):Wi.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Dle;const d=new PD(this.options);this.store=new ED(this.options.resources,this.options);const f=this.services;f.logger=Wi,f.resourceStore=this.store,f.languageUtils=d,f.pluralResolver=new Ole(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(f.formatter=a(u),f.formatter.init&&f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new Tle(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new Ile(a(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",(m,...p)=>{this.emit(m,...p)}),this.modules.languageDetector&&(f.languageDetector=a(this.modules.languageDetector),f.languageDetector.init&&f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=a(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new m0(this.services,this.options),this.translator.on("*",(m,...p)=>{this.emit(m,...p)}),this.modules.external.forEach(m=>{m.init&&m.init(this)})}if(this.format=this.options.interpolation.format,n||(n=bx),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const l=op(),c=()=>{const u=(d,f)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),l.resolve(f),n(d,f)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),l}loadResources(t,n=bx){var i,o;let r=n;const a=ot(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const l=[],c=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(f=>{f!=="cimode"&&l.indexOf(f)<0&&l.push(f)})};a?c(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,u=>c(u)),this.services.backendConnector.load(l,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(t,n,r){const a=op();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=bx),this.services.backendConnector.reload(t,n,i=>{a.resolve(),r(i)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&cU.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=op();this.emit("languageChanging",t);const a=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},i=(l,c)=>{c?this.isLanguageChangingTo===t&&(a(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(l,(...u)=>this.t(...u))},o=l=>{var d,f;!t&&!l&&this.services.languageDetector&&(l=[]);const c=ot(l)?l:l&&l[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(ot(l)?[l]:l);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),(f=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||f.call(d,u)),this.loadResources(u,h=>{i(h,u)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(t),r}getFixedT(t,n,r){const a=(i,o,...l)=>{let c;typeof o!="object"?c=this.options.overloadTranslationOptionHandler([i,o].concat(l)):c={...o},c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||a.keyPrefix);const u=this.options.keySeparator||".";let d;return c.keyPrefix&&Array.isArray(i)?d=i.map(f=>(typeof f=="function"&&(f=m2(f,{...this.options,...o})),`${c.keyPrefix}${u}${f}`)):(typeof i=="function"&&(i=m2(i,{...this.options,...o})),d=c.keyPrefix?`${c.keyPrefix}${u}${i}`:i),this.t(d,c)};return ot(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const u=this.services.backendConnector.state[`${l}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const l=n.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,t)&&(!a||o(i,t)))}loadNamespaces(t,n){const r=op();return this.options.ns?(ot(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=op();ot(t)&&(t=[t]);const a=this.options.preload||[],i=t.filter(o=>a.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=a.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(t){var a,i;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const o=new Intl.Locale(t);if(o&&o.getTextInfo){const l=o.getTextInfo();if(l&&l.direction)return l.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new PD(RD());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Qp(t,n);return r.createInstance=Qp.createInstance,r}cloneInstance(t={},n=bx){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},i=new Qp(a);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const l=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((d,f)=>(d[f]={...c[u][f]},d),c[u]),c),{});i.store=new ED(l,a),i.services.resourceStore=i.store}return i.translator=new m0(i.services,a),i.translator.on("*",(l,...c)=>{i.emit(l,...c)}),i.init(a,n),i.translator.options=a,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ya=Qp.createInstance();ya.createInstance;ya.dir;ya.init;ya.loadResources;ya.reloadResources;ya.use;ya.changeLanguage;ya.getFixedT;ya.t;ya.exists;ya.setDefaultNamespace;ya.hasLoadedNamespace;ya.loadNamespaces;ya.loadLanguages;const Fle=(e,t,n,r)=>{var i,o,l,c;const a=[n,{code:t,...r||{}}];if((o=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&o.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);cd(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(c=(l=e==null?void 0:e.services)==null?void 0:l.logger)!=null&&c.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},$D={},dU=(e,t,n,r)=>{cd(n)&&$D[n]||(cd(n)&&($D[n]=new Date),Fle(e,t,n,r))},fU=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},p2=(e,t,n)=>{e.loadNamespaces(t,fU(e,n))},ID=(e,t,n,r)=>{if(cd(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return p2(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,fU(e,r))},Ble=(e,t,n={})=>
733!t.languages||!t.languages.length?(dU(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),cd=e=>typeof e=="string",zle=e=>typeof e=="object"&&e!==null,Ule=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Vle={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Wle=e=>Vle[e],qle=e=>e.replace(Ule,Wle);let g2={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:qle};const Hle=(e={})=>{g2={...g2,...e}},Kle=()=>g2;let hU;const Gle=e=>{hU=e},Yle=()=>hU,Xle={type:"3rdParty",init(e){Hle(e.options.react),Gle(e)}},Qle=x.createContext();class Jle{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var mU={exports:{}},pU={};/**
734 * @license React
735 * use-sync-external-store-shim.production.js
736 *
737 * Copyright (c) Meta Platforms, Inc. and affiliates.
738 *
739 * This source code is licensed under the MIT license found in the
740 * LICENSE file in the root directory of this source tree.
741 */var gh=x;function Zle(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ece=typeof Object.is=="function"?Object.is:Zle,tce=gh.useState,nce=gh.useEffect,rce=gh.useLayoutEffect,ace=gh.useDebugValue;function sce(e,t){var n=t(),r=tce({inst:{value:n,getSnapshot:t}}),a=r[0].inst,i=r[1];return rce(function(){a.value=n,a.getSnapshot=t,wS(a)&&i({inst:a})},[e,n,t]),nce(function(){return wS(a)&&i({inst:a}),e(function(){wS(a)&&i({inst:a})})},[e]),ace(n),n}function wS(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ece(e,n)}catch{return!0}}function ice(e,t){return t()}var oce=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?ice:sce;pU.useSyncExternalStore=gh.useSyncExternalStore!==void 0?gh.useSyncExternalStore:oce;mU.exports=pU;var Nk=mU.exports;const lce=(e,t)=>cd(t)?t:zle(t)&&cd(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,cce={t:lce,ready:!1},uce=()=>()=>{},Cr=(e,t={})=>{var E,T,P;const{i18n:n}=t,{i18n:r,defaultNS:a}=x.useContext(Qle)||{},i=n||r||Yle();i&&!i.reportNamespaces&&(i.reportNamespaces=new Jle),i||dU(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const o=x.useMemo(()=>{var k;return{...Kle(),...(k=i==null?void 0:i.options)==null?void 0:k.react,...t}},[i,t]),{useSuspense:l,keyPrefix:c}=o,u=a||((E=i==null?void 0:i.options)==null?void 0:E.defaultNS),d=cd(u)?[u]:u||["translation"],f=x.useMemo(()=>d,d);(P=(T=i==null?void 0:i.reportNamespaces)==null?void 0:T.addUsedNamespaces)==null||P.call(T,f);const h=x.useRef(0),m=x.useCallback(k=>{if(!i)return uce;const{bindI18n:D,bindI18nStore:A}=o,I=()=>{h.current+=1,k()};return D&&i.on(D,I),A&&i.store.on(A,I),()=>{D&&D.split(" ").forEach(M=>i.off(M,I)),A&&A.split(" ").forEach(M=>i.store.off(M,I))}},[i,o]),p=x.useRef(),g=x.useCallback(()=>{if(!i)return cce;const k=!!(i.isInitialized||i.initializedStoreOnce)&&f.every(R=>Ble(R,i,o)),D=t.lng||i.language,A=h.current,I=p.current;if(I&&I.ready===k&&I.lng===D&&I.keyPrefix===c&&I.revision===A)return I;const $={t:i.getFixedT(D,o.nsMode==="fallback"?f:f[0],c),ready:k,lng:D,keyPrefix:c,revision:A};return p.current=$,$},[i,f,c,o,t.lng]),[y,v]=x.useState(0),{t:w,ready:b}=Nk.useSyncExternalStore(m,g,g);x.useEffect(()=>{if(i&&!b&&!l){const k=()=>v(D=>D+1);t.lng?ID(i,t.lng,f,k):p2(i,f,k)}},[i,t.lng,f,b,l,y]);const j=i||{},N=x.useRef(null),S=x.useRef(),C=k=>{const D=Object.getOwnPropertyDescriptors(k);D.__original&&delete D.__original;const A=Object.create(Object.getPrototypeOf(k),D);if(!Object.prototype.hasOwnProperty.call(A,"__original"))try{Object.defineProperty(A,"__original",{value:k,writable:!1,enumerable:!1,
741configurable:!1})}catch{}return A},_=x.useMemo(()=>{const k=j,D=k==null?void 0:k.language;let A=k;k&&(N.current&&N.current.__original===k?S.current!==D?(A=C(k),N.current=A,S.current=D):A=N.current:(A=C(k),N.current=A,S.current=D));const I=[w,A,b];return I.t=w,I.i18n=A,I.ready=b,I},[w,j,b,j.resolvedLanguage,j.language,j.languages]);if(i&&l&&!b)throw new Promise(k=>{const D=()=>k();t.lng?ID(i,t.lng,f,D):p2(i,f,D)});return _},{slice:dce,forEach:fce}=[];function hce(e){return fce.call(dce.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function mce(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const LD=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,pce=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},a=encodeURIComponent(t);let i=`${e}=${a}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!LD.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!LD.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invali
741d");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},FD={create(e,t,n,r){let a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),r&&(a.domain=r),document.cookie=pce(e,t,a)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let a=n[r];for(;a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(t)===0)return a.substring(t.length,a.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var gce={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return FD.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:a,cookieOptions:i}=t;n&&typeof document<"u"&&FD.create(n,e,r,a,i)}},yce={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:a}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(a=window.location.hash.substring(window.location.hash.indexOf("?")));const o=a.substring(1).split("&");for(let l=0;l<o.length;l++){const c=o[l].indexOf("=");c>0&&o[l].substring(0,c)===t&&(n=o[l].substring(c+1))}}return n}},vce={name:"hash",lookup(e){var a;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(t){const l=o.split("&");for(let c=0;c<l.length;c++){const u=l[c].indexOf("=");u>0&&l[c].substring(0,u)===t&&(r=l[c].substring(u+1))}}if(r)return r;if(!r&&n>-1){const l=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(l)?(a=l[typeof n=="number"?n:0])==null?void 0:a.replace("/",""):void 0}}}return r}};let qd=null;const BD=()=>
vendor: 4,828 bytes, line 741
741{if(qd!==null)return qd;try{if(qd=typeof window<"u"&&window.localStorage!==null,!qd)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{qd=!1}return qd};var xce={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&BD())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&BD()&&window.localStorage.setItem(n,e)}};let Hd=null;const zD=()=>{if(Hd!==null)return Hd;try{if(Hd=typeof window<"u"&&window.sessionStorage!==null,!Hd)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Hd=!1}return Hd};var bce={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&zD())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&zD()&&window.sessionStorage.setItem(n,e)}},wce={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:a}=navigator;if(n)for(let i=0;i<n.length;i++)t.push(n[i]);r&&t.push(r),a&&t.push(a)}return t.length>0?t:void 0}},jce={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},Nce={name:"path",lookup(e){var a;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(a=n[typeof t=="number"?t:0])==null?void 0:a.replace("/",""):void 0}},Sce={name:"subdomain",lookup(e){var a,i;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((i=(a=window.location)==null?void 0:a.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let gU=!1;try{document.cookie,gU=!0}catch{}const yU=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];gU||yU.splice(1,1);const Cce=()=>({order:yU,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class vU{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=hce(n,this.options||{},Cce()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=a=>a.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(gce),this.addDetector(yce),this.addDetector(xce),this.addDetector(bce),this.addDetector(wce),this.addDetector(jce),this.addDetector(Nce),this.addDetector(Sce),this.addDetector(vce)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let a=this.detectors[r].lookup(this.options);a&&typeof a=="string"&&(a=[a]),a&&(n=n.concat(a))}}),n=n.filter(r=>r!=null&&!mce(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}vU.type="languageDetector";const _ce={dashboard:"Dashboard",datasets:"Datasets",reports:"Reports",aiAnalyst:"AI Analyst",workbooks:"Workbooks",connectors:"Connectors",scheduledReports:"Scheduled Reports",sharedLinks:"Shared Links",subscription:"Subscription",usage:"API Usage",settings:"Settings"},Ece={signIn:"Sign In",signUp:"Sign Up",getStarted:"Get Started",logout:"Logout",forgotPassword:"Forgot Password?",rememberMe:"Remember me",noAccount:"Don't have an account?",hasAccount:"Already have an account?"},Ace={hero:{badge:"Trusted by 2,800+ businesses worldwide",title:"Transform Your Data Into",titleHighlight:"Actionable Business Insights",subtitle:"Refraxion combines powerful business intelligence with AI assistance to help you make data-driven decisions faster. No technical skills or coding required.",startTrial:"Start Free Trial",viewDemo:"View Live Demo",freeTrial:"14-day free trial",noCard:"No credit card required",cancelAnytime:"C
741ancel anytime"},socialProof:{activeUsers:"Active Users",reportsGenerated:"Reports Generated",userRating:"User Rating",uptime:"Uptime"},features:{heading:"Everything You Need for Data-Driven Decisions",subheading:"Powerful business intelligence tools designed for modern teams",dataConnectors:{title:"Universal Data Connectors",description:"Connect to CSV, Excel, SQL databases, Google Sheets, and 50+ data sources. Automatic data processing, validation, and real-time sync.",feature1:"Real-time data synchronization",feature2:"Automatic data validation",feature3:"Secure encrypted connections"},dashboards:{title:"Interactive Dashboards",description:"Create stunning visualizations and interactive dashboards in minutes. Share with stakeholders or export to PowerPoint, PDF, and Excel.",feature1:"Drag-and-drop builder",feature2:"20+ chart types",feature3:"Scheduled report delivery"},aiInsights:{title:"AI-Powered Insights",description:"Ask questions in plain English and get instant insights. Our AI analyzes patterns, detects anomalies, and provides actionable recommendations.",feature1:"Natural language queries",feature2:"Predictive analytics",feature3:"Automated insights delivery"}},benefits:{heading:"Why Leading Companies Choose Refraxion",faster:{title:"10x Faster Insights",description:"Reduce time from data to decision from weeks to minutes. Automated analysis means your team focuses on action, not data wrangling."},security:{title:"Enterprise-Grade Security",description:"SOC 2 Type II certified, GDPR compliant. Your data is encrypted at rest and in transit with bank-level security protocols."},collaboration:{title:"Built for Collaboration",description:"Real-time collaboration, role-based access, and shared dashboards. Keep your entire team aligned with live data updates."},scalable:{title:"Scales With You",description:"From startups to enterprises. Handle millions of data points with lightning-fast performance that grows with your business."}},testimonials:{heading:"Loved by Data Teams Worldwide",testimonial1:{quote:"Refraxion transformed how we analyze customer data. What used to take our team days now takes minutes. The AI insights are incredibly accurate.",author:"Sarah Martinez",role:"Head of Analytics, TechCorp"},testimonial2:{quote:"The no-code interface means our entire team can create reports without bothering IT. ROI was positive within the first month.",author:"James Chen",role:"VP Operations, GrowthCo"},testimonial3:{quote:"Best BI tool we've used. Powerful enough for our data scientists, simple enough for our sales team. Game changer.",author:"Emily Patel",role:"CTO, DataFlow Inc"}},faq:{heading:"Frequently Asked Questions",q1:{question:"Do I need technical skills to use Refraxion?",answer:"No technical skills required. Our no-code interface is designed for business users. Simply connect your data, ask questions in plain English, and get insights instantly."},q2:{question:"How long does it take to set up?",answer:"Most teams are up and running in under 15 minutes. Connect your data sources, and Refraxion automatically detects schemas and suggests visualizations."},q3:{question:"Is my data secure?",answer:"Absolutely. We're SOC 2 Type II certified and GDPR compliant. All data is encrypted end-to-end with bank-level security. You maintain full control of your data at all times."},q4:{question:"Can I cancel anytime?",answer:"Yes, cancel anytime with no penalties. We also offer a 14-day free trial with no credit card required, so you can test all features risk-free."}},cta:{badge:"Limited Time Offer",title:"Ready to Transform Your Data Into Competitive Advantage?",subtitle:"Join 2,800+ businesses already using Refraxion to make smarter, faster decisions. Start your 14-day free trial today.",button:"Start Free Trial",watchDemo:"Watch Demo",noCard:"No credit card required",fullAccess:"Full access to all features",quickSetup:"Setup in minutes"},footer:{copyright:"© 2024 Refraxion. All rights reserved."}},Pce={welcome:"Welcome back, {{name}}",subtitle:"Here's what's happening with your data today.",stats:{totalDatasets:"Total Datasets",activeReports:"Active Reports",aiInsights:"AI Insights",totalViews:"Total Views",uploadedThisWeek:"uploaded this week",sharedPublicly:"shared publicly",generatedThisMonth:"Generated this month",fromLastMonth:"from last month"},quickActions:{title:"Quick Actions",subtitle:"Get started with common tasks",uploadDataset:{title:"Upload Dataset",description:"Add new data to analyze"},createReport:{title:"Create Report",description:"Build a new visualization"},askAI:{title:"Ask AI",description:"Get insights from your data"}},recentActivity:{title:"Recent Activity",subtitle:"Your latest actions and updates"}},kce={title:"Datasets",subtitle:"Manage your data sources and files",upload:"Upload Dataset",search:"Search datasets...",filter:"Filter",noDatasets:"No datasets found",uploadFirst:"Upload your first dataset to get started",dialog:{title:"Upload New Dataset",description:"Description (Optional)",uploadTab:"Upload File",detailsTab:"Dataset Details",dropzone:"Drop your file here or",browse:"browse",supportedFormats:"Supported formats: CSV, Excel, JSON, XML, Parquet (Max 50MB)",datasetName:"Dataset Name",visibility:"Visibility",private:"🔒 Private",public:"🌍 Public",create:"Create Dataset"}},Oce={title:"Reports",subtitle:"Create and manage your data visualizations",create:"Create Report",search:"Search reports...",noReports:"No reports found",createFirst:"Create your first report to visualize your data"}
741,Tce={title:"AI Analyst",subtitle:"Ask questions about your data and get instant insights",poweredBy:"Powered by AI",placeholder:"Ask me anything about your data...",disclaimer:"AI responses may not always be accurate. Verify important information.",euDisclaimer:"This content is generated by an artificial intelligence system (EU AI Act, Art. 50). Results are automated and may contain errors. Always verify critical information before making decisions.",tryAsking:"Try asking:",suggestions:{salesTrends:"Show me sales trends for the last quarter",profitMargins:"Which products have the highest profit margins?",customerSegmentation:"Create a customer segmentation analysis",patterns:"Find patterns in customer behavior"}},Mce={title:"Data Connectors",subtitle:"Connect to external data sources",add:"Add Connector",types:{database:"Databases",api:"APIs",cloud:"Cloud Storage",business:"Business Apps"}},Rce={title:"Workbooks",description:"Create and manage your spreadsheets",create:"New Workbook",searchPlaceholder:"Search workbooks...",empty:"No workbooks yet",emptyDescription:"Create your first workbook to start building spreadsheets",createFirst:"Create your first workbook to get started with spreadsheets",createNew:"Create New Workbook",createDescription:"Create a new spreadsheet workbook",name:"Workbook Name",namePlaceholder:"Enter workbook name",descriptionLabel:"Description",descriptionPlaceholder:"Optional description",template:"Start from Template",selectTemplate:"Select a template",blankWorkbook:"Blank Workbook",sheets:"sheets",sheet:"sheet",error:"Error",nameRequired:"Please enter a workbook name",created:"Workbook created",createdDescription:"{{name}} has been created successfully",createError:"Failed to create workbook",deleted:"Workbook deleted",deletedDescription:"{{name}} has been deleted",deleteError:"Failed to delete workbook",deleteConfirm:"Delete Workbook",deleteConfirmDescription:'Are you sure you want to delete "{{name}}"? This action cannot be undone.',errorLoading:"Failed to load workbooks",errorLoadingDescription:"There was an error loading your workbooks. Please try again.",loadingSheet:"Loading spreadsheet...",notFound:"Workbook not found",backToList:"Back to Workbooks",saving:"Saving...",lastSaved:"Saved at {{time}}",nameSaved:"Name updated",nameSaveError:"Failed to update name",addSheet:"Add Sheet",sheetName:"Sheet Name",sheetNamePlaceholder:"Enter sheet name",sheetAdded:"Sheet added",sheetAddError:"Failed to add sheet",deleteSheet:"Delete Sheet",deleteSheetDescription:'Are you sure you want to delete "{{name}}"? This cannot be undone.',sheetDeleted:"Sheet deleted",sheetDeleteError:"Failed to delete sheet",convertToDataset:"Convert to Dataset",convertDescription:"Create a dataset from this sheet's data",datasetName:"Dataset Name",datasetNamePlaceholder:"Enter dataset name",converted:"Converted to dataset",convertedDescription:"Created dataset with {{rows}} rows",convertError:"Failed to convert to dataset",convert:"Convert",exportExcel:"Export as Excel",save:"Save",noChanges:"No changes",noChangesDescription:"No changes to save",noDataToSave:"No data to save",saved:"Saved",savedDescription:"Changes saved successfully",saveError:"Failed to save changes"},Dce={title:"Scheduled Reports",subtitle:"Automate report delivery",create:"Schedule Report",frequency:{daily:"Daily",weekly:"Weekly",monthly:"Monthly"}},$ce={privacyPolicy:"Privacy Policy",termsOfService:"Terms of Service",cookiePolicy:"Cookie Policy",legalNotice:"Legal Notice",lastUpdated:"Last updated: {{date}}",privacyContent:'This Privacy Policy describes how Refraxion ("we", "our", or "us") collects, uses, and protects your personal data in accordance with the General Data Protection Regulation (GDPR) and Spanish Organic Law 3/2018 (LOPDGDD).',termsContent:"These Terms of Service govern your use of the Refraxion platform. By accessing or using our services, you agree to be bound by these terms.",cookieContent:"This Cookie Policy explains how Refraxion uses cookies and similar technologies to recognize you when you visit our platform.",legalContent:"Legal notice and company information in compliance with Spanish Law 34/2002 (LSSI-CE).",dataController:"Data Controller",dataControllerDesc:"Refraxion is the data controller responsible for your personal data.",dataProcessing:"Data Processing",dataProcessingDesc:"We process your data for the following purposes: account management, service provision, analytics, and communication.",yourRights:"Your Rights",yourRightsDesc:"Under GDPR, you have the right to access, rectify, erase, restrict processing, data portability, and object to processing of your personal data.",contact:"Contact",contactDesc:"For any privacy-related inquiries, please contact us at [email protected].",cookieTypes:{essential:"Essential Cookies",essentialDesc:"Required for the platform to function. Cannot be disabled.",analytics:"Analytics Co
741okies",analyticsDesc:"Help us understand how you use the platform to improve it.",marketing:"Marketing Cookies",marketingDesc:"Used to deliver relevant advertisements and track campaign effectiveness."}},Ice={bannerTitle:"Cookie Preferences",bannerDescription:"We use cookies to enhance your experience. Essential cookies are always active. You can choose to enable analytics and marketing cookies.",essential:"Essential",analytics:"Analytics",marketing:"Marketing",acceptAll:"Accept All",acceptEssential:"Essential Only",savePreferences:"Save Preferences",manage:"Manage Cookies"},Lce={tabTitle:"Privacy",yourData:"Your Data",yourDataDesc:"Download or delete your personal data",exportData:"Export My Data",exportDataDesc:"Download a copy of all your personal data in JSON format (GDPR Art. 15/20).",exportButton:"Download My Data",deleteAccount:"Delete Account",deleteAccountDesc:"Permanently delete your account and all associated data. Active subscriptions will be automatically cancelled. Billing records are retained for 5 years as required by tax law.",deleteButton:"Delete My Account",deleteConfirm:"Are you sure you want to delete your account?",deleteConfirmDesc:"This action is irreversible. All your datasets, reports, workbooks, and other data will be permanently deleted. Type your username to confirm.",deleteTypeName:'Type "{{username}}" to confirm',consent:"Consent Management",consentDesc:"Manage your data processing consents (GDPR Art. 7)",consentAnalytics:"Analytics data processing",consentMarketing:"Marketing communications",consentAI:"AI-powered data analysis",legalLinks:"Legal Documents",legalLinksDesc:"Review our legal documents and policies"},Fce={save:"Save",cancel:"Cancel",delete:"Delete",edit:"Edit",view:"View",share:"Share",download:"Download",upload:"Upload",export:"Export",import:"Import",search:"Search",filter:"Filter",loading:"Loading...",error:"Error",success:"Success",comingSoon:"Coming Soon",today:"Today",yesterday:"Yesterday",daysAgo:"{{days}} days ago",retry:"Retry"},Bce={nav:_ce,auth:Ece,landing:Ace,dashboard:Pce,datasets:kce,reports:Oce,aiAnalyst:Tce,connectors:Mce,workbooks:Rce,scheduledReports:Dce,legal:$ce,cookies:Ice,privacy:Lce,common:Fce},zce={dashboard:"Panel",datasets:"Conjuntos de Datos",reports:"Reportes",aiAnalyst:"Analista IA",workbooks:"Libros de Trabajo",connectors:"Conectores",scheduledReports:"Reportes Programados",sharedLinks:"Enlaces Compartidos",subscription:"Suscripción",usage:"Consumo API",settings:"Configuración"},Uce={signIn:"Iniciar Sesión",signUp:"Registrarse",getStarted:"Comenzar",logout:"Cerrar Sesión",forgotPassword:"¿Olvidaste tu contraseña?",rememberMe:"Recordarme",noAccount:"¿No tienes cuenta?",hasAccount:"¿Ya tienes cuenta?"},Vce={hero:{badge:"Confiado por más de 2,800 empresas en todo el mund
741o",title:"Transforma Tus Datos en",titleHighlight:"Insights Empresariales Accionables",subtitle:"Refraxion combina inteligencia de negocios potente con asistencia de IA para ayudarte a tomar decisiones basadas en datos más rápido. No se requieren habilidades técnicas ni codificación.",startTrial:"Iniciar Prueba Gratis",viewDemo:"Ver Demo en Vivo",freeTrial:"Prueba gratis de 14 días",noCard:"Sin tarjeta de crédito",cancelAnytime:"Cancela cuando quieras"},socialProof:{activeUsers:"Usuarios Activos",reportsGenerated:"Reportes Generados",userRating:"Calificación",uptime:"Disponibilidad"},features:{heading:"Todo lo que Necesitas para Decisiones Basadas en Datos",subheading:"Herramientas de inteligencia empresarial diseñadas para equipos modernos",dataConnectors:{title:"Conectores de Datos Universales",description:"Conecta con CSV, Excel, bases de datos SQL, Google Sheets y más de 50 fuentes de datos. Procesamiento automático, validación y sincronización en tiempo real.",feature1:"Sincronización de datos en tiempo real",feature2:"Validación automática de datos",feature3:"Conexiones cifradas seguras"},dashboards:{title:"Dashboards Interactivos",description:"Crea visualizaciones impresionantes y dashboards interactivos en minutos. Comparte con stakeholders o exporta a PowerPoint, PDF y Excel.",feature1:"Constructor arrastrar y soltar",feature2:"Más de 20 tipos de gráficos",feature3:"Entrega programada de reportes"},aiInsights:{title:"Insights Impulsados por IA",description:"Haz preguntas en español sencillo y obtén insights instantáneos. Nuestra IA analiza patrones, detecta anomalías y proporciona recomendaciones accionables.",feature1:"Consultas en lenguaje natural",feature2:"Análisis predictivo",feature3:"Entrega automática de insights"}},benefits:{heading:"Por Qué las Empresas Líderes Eligen Refraxion",faster:{title:"Insights 10x Más Rápidos",description:"Reduce el tiempo desde los datos hasta la decisión de semanas a minutos. El análisis automatizado significa que tu equipo se enfoca en la acción, no en manipular datos."},security:{title:"Seguridad de Nivel Empresarial",description:"Certificado SOC 2 Type II, cumplimiento con GDPR. Tus datos están cifrados en reposo y en tránsito con protocolos de seguridad de nivel bancario."},collaboration:{title:"Diseñado para Colaboración",description:"Colaboración en tiempo real, acceso basado en roles y dashboards compartidos. Mantén a todo tu equipo alineado con actualizaciones de datos en vivo."},scalable:{title:"Escala Contigo",description:"Desde startups hasta empresas. Maneja millones de puntos de datos con rendimiento ultrarrápido que crece con tu negocio."}},testimonials:{heading:"Amado por Equipos de Datos en Todo el Mundo",testimonial1:{quote:"Refraxion transformó cómo analizamos los datos de clientes. Lo que solía tomar días a nuestro equipo ahora toma minutos. Los insights de IA son increíblemente precisos.",author:"Sarah Martinez",role:"Jefa de Análisis, TechCorp"},testimonial2:{quote:"La interfaz sin código significa que todo nuestro equipo puede crear reportes sin molestar a IT. El ROI fue positivo en el primer mes.",author:"James Chen",role:"VP de Operaciones, GrowthCo"},testimonial3:{quote:"La mejor herramienta de BI que hemos usado. Lo suficientemente potente para nuestros científicos de datos, lo suficientemente simple para nuestro equipo de ventas. Un cambio total.",author:"Emily Patel",role:"CTO, DataFlow Inc"}},faq:{heading:"Preguntas Frecuentes",q1:{question:"¿Necesito habilidades técnicas para usar Refraxion?",answer:"No se requieren habilidades técnicas. Nuestra interfaz sin código está diseña
741da para usuarios de negocios. Simplemente conecta tus datos, haz preguntas en español sencillo y obtén insights instantáneamente."},q2:{question:"¿Cuánto tiempo toma configurarlo?",answer:"La mayoría de los equipos están funcionando en menos de 15 minutos. Conecta tus fuentes de datos y Refraxion detecta automáticamente los esquemas y sugiere visualizaciones."},q3:{question:"¿Mis datos están seguros?",answer:"Absolutamente. Estamos certificados SOC 2 Type II y cumplimos con GDPR. Todos los datos están cifrados de extremo a extremo con seguridad de nivel bancario. Mantienes el control total de tus datos en todo momento."},q4:{question:"¿Puedo cancelar en cualquier momento?",answer:"Sí, cancela en cualquier momento sin penalizaciones. También ofrecemos una prueba gratis de 14 días sin requerir tarjeta de crédito, para que puedas probar todas las funciones sin riesgo."}},cta:{badge:"Oferta por Tiempo Limitado",title:"¿Listo para Transformar Tus Datos en Ventaja Competitiva?",subtitle:"Únete a más de 2,800 empresas que ya usan Refraxion para tomar decisiones más inteligentes y rápidas. Comienza tu prueba gratis de 14 días hoy.",button:"Iniciar Prueba Gratis",watchDemo:"Ver Demo",noCard:"Sin tarjeta de crédito",fullAccess:"Acceso completo a todas las funciones",quickSetup:"Configuración en minutos"},footer:{copyright:"© 2024 Refraxion. Todos los derechos reservados."}},Wce={welcome:"Bienvenido de nuevo, {{name}}",subtitle:"Esto es lo que está pasando con tus datos hoy.",stats:{totalDatasets:"Total de Conjuntos",activeReports:"Reportes Activos",aiInsights:"Insights de IA",totalViews:"Vistas Totales",uploadedThisWeek:"subidos esta semana",sharedPublicly:"compartidos públicamente",generatedThisMonth:"Generados este mes",fromLastMonth:"desde el mes pasado"},quickActions:{title:"Acciones Rápidas",subtitle:"Comienza con tareas comunes",uploadDataset:{title:"Subir Conjunto de Datos",description:"Agrega nuevos datos para analizar"},createReport:{title:"Crear Reporte",description:"Construye una nueva visualización"},askAI:{title:"Preguntar a IA",description:"Obtén insights de tus datos"}},recentActivity:{title:"Actividad Reciente",subtitle:"Tus últimas acciones y actualizaciones"}},qce={title:"Conjuntos de Datos",subtitle:"Gestiona tus fuentes de datos y archivos",upload:"Subir Conjunto",search:"Buscar conjuntos...",filter:"Filtrar",noDatasets:"No se encontraron conjuntos",uploadFirst:"Sube tu primer conjunto de datos para comenzar",dialog:{title:"Subir Nuevo Conjunto",description:"Descripción (Opcional)",uploadTab:"Subir Archivo",detailsTab:"Detalles del Conjunto",dropzone:"Suelta tu archivo aquí o",browse:"explora",supportedFormats:"Formatos soportados: CSV, Excel, JSON, XML, Parquet (Máx 50MB)",datasetName:"Nombre del Conjunto",visibility:"Visibilidad",private:"🔒 Privado",public:"🌍 Público",create:"Crear Conjunto"}},Hce={title:"Reportes",subtitle:"Crea y gestiona tus visualizaciones de datos",create:"Crear Reporte",search:"Buscar reportes...",noReports:"No se encontraron reportes",createFirst:"Crea tu primer reporte para visualizar tus datos"},Kce={title:"Analista IA",subtitle:"Haz preguntas sobre tus datos y obtén insights instantáneos",poweredBy:"Impulsado por IA",placeholder:"Pregúntame lo que quieras sobre tus datos...",disclaimer:"Las respuestas de IA pueden no ser siempre precisas. Verifica información importante.",euDisclaimer:"Este contenido es generado por un sistema de inteligencia artificial (EU AI Act, Art. 50). Los resultados son automatizados y pueden contener errores. Verifique siempre la información crítica antes de tomar decisiones.",tryAsking:"Intenta preguntar:",suggestions:{salesTrends:"Muéstrame tendencias de ventas del último trimestre",profitMargins:"¿Qué productos tienen los márgenes de beneficio más altos?",customerSegmentation:"Crea un análisis de segmentación de clientes",patterns:"Encuentra patrones en el comportamiento del cliente"}},Gce={title:"Conectores de Datos",subtitle:"Conecta a fuentes de datos externas",add:"Agregar Conector",types:{database:"Bases de Datos",api:"APIs",cloud:"Almacenamiento en la Nube",business:"Apps de Negocio"}},Yce={title:"Libros de Trabajo",description:"Crea y gestiona tus hojas de cálculo",create:"Nuevo Libro",searchPlaceholder:"Buscar libros...",empty:"No hay libros todavía",emptyDescription:"Crea tu primer libro de trabajo para comenzar",createFirst:"Crea tu primer libro de trabajo para comenzar con hojas de cálculo",createNew:"Crear Nuevo Libro",createDescription:"Crea un nuevo libro de trabajo con hojas de cálculo",name:"Nombre del Libro",namePlaceholder:"Ingresa el nombre del libro",descriptionLabel:"Descripción",descriptionPlaceholder:"Descripción opcional",template:"Comenzar desde Plantilla",selectTemplate:"Selecciona una plantilla",blankWorkbook:"Libro en Blanco",sheets:"hojas",sheet:"hoja",error:"Error",nameRequired:"Por favor ingresa un nombre para el libro",created:"Libro creado",createdDescription:"{{name}} ha sido creado exitosamente",createError:"Error al crear el libro",deleted:"Libro eliminado",deletedDescription:"{{name}} ha sido eliminado",deleteError:"Error al eliminar el libro",deleteConfirm:"Eliminar Libro",deleteConfirmDescription:'¿Estás seguro de que deseas eliminar "{{name}}"? Esta acción no se puede deshacer.',errorLoading:"Error al cargar los libros",errorLoadingDescription:"Hubo un error al cargar tus libros. Por favor intenta de nuevo.",loadingSheet:"Cargando hoja de cálculo...",notFound:"Libro no encontrado",backToList:"Volver a Libros",saving:"Guardando...",lastSaved:"Guardado a las {{time}}",nameSaved:"Nombre actualizado",nameSaveError:"Error al actualizar el nombre",addSheet:"Agregar Hoja",sheetName:"Nombre de Hoja",sheetNamePlaceholder:"Ingresa el nombre de la hoja",sheetAdded:"Hoja agregada",sheetAddError:"Error al agregar hoja",deleteSheet:"Eliminar Hoja",deleteSheetDescription:'¿Estás seguro de que deseas eliminar "{{name}}"? Esto no se puede deshacer.',sheetDeleted:"Hoja eliminada",sheetDeleteError:"Error al eliminar hoja",convertToDataset:"Convertir a Conjunto de Datos",convertDescription:"Crear un conjunto de datos con los datos de esta hoja",datasetName:"Nombre del Conjunto",datasetNamePlaceholder:"Ingresa el nombre del c
741onjunto",converted:"Convertido a conjunto de datos",convertedDescription:"Se creó un conjunto de datos con {{rows}} filas",convertError:"Error al convertir a conjunto de datos",convert:"Convertir",exportExcel:"Exportar como Excel",save:"Guardar",noChanges:"Sin cambios",noChangesDescription:"No hay cambios para guardar",noDataToSave:"No hay datos para guardar",saved:"Guardado",savedDescription:"Cambios guardados correctamente",saveError:"Error al guardar los cambios"},Xce={title:"Reportes Programados",subtitle:"Automatiza la entrega de reportes",create:"Programar Reporte",frequency:{daily:"Diario",weekly:"Semanal",monthly:"Mensual"}},Qce={privacyPolicy:"Política de Privacidad",termsOfService:"Términos de Servicio",cookiePolicy:"Política de Cookies",legalNotice:"Aviso Legal",lastUpdated:"Última actualización: {{date}}",privacyContent:'Esta Política de Privacidad describe cómo Refraxion ("nosotros") recopila, utiliza y protege sus datos personales de conformidad con el Reglamento General de Protección de Datos (RGPD) y la Ley Orgánica 3/2018 (LOPDGDD).',termsContent:"Estos Términos de Servicio rigen el uso de la plataforma Refraxion. Al acceder o utilizar nuestros servicios, acepta quedar vinculado por estos términos.",cookieContent:"Esta Política de Cookies explica cómo Refraxion utiliza cookies y tecnologías similares para reconocerle cuando visita nuestra plataforma.",legalContent:"Aviso legal e información de la empresa en cumplimiento de la Ley 34/2002 (LSSI-CE).",dataController:"Responsable del Tratamiento",dataControllerDesc:"Refraxion es el responsable del tratamiento de sus datos personales.",dataProcessing:"Tratamiento de Datos",dataProcessingDesc:"Tratamos sus datos con las siguientes finalidades: gestión de cuentas, prestación de servicios, análisis y comunicación.",yourRights:"Sus Derechos",yourRightsDesc:"Según el RGPD, tiene derecho a acceder, rectificar, suprimir, limitar el tratamiento, portabilidad y oposición al tratamiento de sus datos personales.",contact:"Contacto",contactDesc:"Para cualquier consulta relacionada con privacidad, contáctenos en [email protected].",cookieTypes:{essential:"Cookies Esenciales",essentialDesc:"Necesarias para el funcionamiento de la plataforma. No se pueden desactivar.",analytics:"Cookies Analíticas",analyticsDesc:"Nos ayudan a comprender cómo usa la plataforma para mejorarla.",marketing:"Cookies de Marketing",marketingDesc:"Se utilizan para ofrecer anuncios relevantes y medir la efectividad de las campañas."}},Jce={bannerTitle:"Preferencias de Cookies",bannerDescription:"Usamos cookies para mejorar su experiencia. Las cookies esenciales están siempre activas. Puede elegir activar las cookies analíticas y de marketing.",essential:"Esenciales",analytics:"Analíticas",marketing:"Marketing",acceptAll:"Aceptar Todas",acceptEssential:"Solo Esenciales",savePreferences:"Guardar Preferencias",manage:"Gestionar Cookies"},Zce={tabTitle:"Privacidad",yourData:"Tus Datos",yourDataDesc:"Descarga o elimina tus datos personales",exportData:"Exportar Mis Datos",exportDataDesc:"Descarga una copia de todos tus datos personales en formato JSON (RGPD Art. 15/20).",exportButton:"Descargar Mis Datos",deleteAccount:"Eliminar Cuenta",deleteAccountDesc:"Elimina permanentemente tu cuenta y todos los datos asociados. Las suscripciones activas se 
741cancelarán automáticamente. Los registros de facturación se conservan 5 años según la legislación fiscal.",deleteButton:"Eliminar Mi Cuenta",deleteConfirm:"¿Estás seguro de que quieres eliminar tu cuenta?",deleteConfirmDesc:"Esta acción es irreversible. Todos tus datasets, reportes, libros de trabajo y otros datos serán eliminados permanentemente. Escribe tu nombre de usuario para confirmar.",deleteTypeName:'Escribe "{{username}}" para confirmar',consent:"Gestión de Consentimientos",consentDesc:"Gestiona tus consentimientos de tratamiento de datos (RGPD Art. 7)",consentAnalytics:"Tratamiento de datos analíticos",consentMarketing:"Comunicaciones de marketing",consentAI:"Análisis de datos con IA",legalLinks:"Documentos Legales",legalLinksDesc:"Revisa nuestros documentos legales y políticas"},eue={save:"Guardar",cancel:"Cancelar",delete:"Eliminar",edit:"Editar",view:"Ver",share:"Compartir",download:"Descargar",upload:"Subir",export:"Exportar",import:"Importar",search:"Buscar",filter:"Filtrar",loading:"Cargando...",error:"Error",success:"Éxito",comingSoon:"Próximamente",today:"Hoy",yesterday:"Ayer",daysAgo:"Hace {{days}} días",retry:"Reintentar"},tue={nav:zce,auth:Uce,landing:Vce,dashboard:Wce,datasets:qce,reports:Hce,aiAnalyst:Kce,connectors:Gce,workbooks:Yce,sc
741heduledReports:Xce,legal:Qce,cookies:Jce,privacy:Zce,common:eue};ya.use(vU).use(Xle).init({resources:{en:{translation:Bce},es:{translation:tue}},fallbackLng:"en",detection:{order:["localStorage","navigator"],caches:["localStorage"]},interpolation:{escapeValue:!1}});class UD extends Error{constructor(t,n,r,a){super(t),this.detail=t,this.statusCode=n,this.errors=r,this.requestId=a,this.name="ApiError"}isNotFound(){return this.statusCode===404}isUnauthorized(){return this.statusCode===401}isForbidden(){return this.statusCode===403}isRateLimited(){return this.statusCode===429}isValidationError(){return this.statusCode===422}isServerError(){return this.statusCode>=500}}const Oa=[3,4,6,12],VD={"heading-1":{colSpan:12},"heading-2":{colSpan:12},"heading-3":{colSpan:6},paragraph:{colSpan:12},"bullet-list":{colSpan:6},"numbered-list":{colSpan:6},quote:{colSpan:12},callout:{colSpan:12},divider:{colSpan:12},metric:{colSpan:3},bar:{colSpan:6},line:{colSpan:6},pie:{colSpan:6},area:{colSpan:6},donut:{colSpan:6},scatter:{colSpan:6},default:{colSpan:6},"date-range":{colSpan:3},dropdown:{colSpan:3},"multi-select":{colSpan:3},list:{colSpan:4},"numeric-range":{colSpan:3}};function Ea(e){return VD[e]||VD.default}const nue={showTitle:!0,compact:!1,showClearButton:!0},y2=[{type:"date-range",name:"Date Range",description:"Filter by date range",icon:"Calendar",category:"date"},{type:"dropdown",name:"Dropdown",description:"Single selection dropdown",icon:"ChevronDown",category:"categorical"},{type:"multi-select",name:"Multi-Select",description:"Multiple selection with checkboxes",icon:"CheckSquare",category:"categorical"},{type:"list",name:"List",description:"Visible list with clickable items",icon:"List",category:"categorical"},{type:"numeric-range",name:"Numeric Range",description:"Slider for numeric values",icon:"SlidersHorizontal",category:"numeric"}];function Oo(e){return e.blockType==="text"}function rue(e){return e.blockType==="chart"||!e.blockType}function Li(e){return e.blockType==="filter"}const v2=[{type:"heading-1",name:"Heading 1",description:"Large section title",icon:"Heading1",category:"headings",defaultContent:"Main Title"},{type:"heading-2",name:"Heading 2",description:"Medium section header",icon:"Heading2",category:"headings",defaultContent:"Section Title"},{type:"heading-3",name:"Heading 3",description:"Small subsection header",icon:"Heading3",category:"headings",defaultContent:"Subsection"},{type:"paragraph",name:"Paragraph",description:"Regular text content",icon:"AlignLeft",category:"text",defaultContent:"Enter your text here..."},{type:"bullet-list",name:"Bullet List",description:"Unordered list of items",icon:"List",category:"text",defaultContent:""},{type:"numbered-list",name:"Numbered List",description:"Ordered list of items",icon:"ListOrdered",category:"text",defaultContent:""},{type:"quote",name:"Quote",description:"Blockquote for citations",icon:"Quote",category:"text",defaultContent:"Enter a quote or citation..."},{type:"callout",name:"Callout",description:"Highlighted information box",icon:"AlertCircle",category:"elements",defaultContent:"Important information goes here"},{type:"divider",name:"Divider",description:"Horizontal line separator",icon:"Minus",category:"elements",defaultContent:""},{type:"metric",name:"Metric Card",description:"Highlight a key number or KPI",icon:"Hash",category:"data",defaultContent:""}],p0={alignment:"left",fontSize:"base",fontWeight:"normal",calloutVariant:"info"};function x2(e,t){const n=v2.find(i=>i.type===e),a={id:`text-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,blockType:"text",type:e,content:(n==null?void 0:n.defaultContent)||"",style:{...p0},layout:Ea(e)};return e==="metric"&&(a.metricValue="0",a.metricLabel="Metric",a.metricTrend="neutral"),(e==="bullet-list"||e==="numbered-list")&&(a.listItems=["Item 1","Item 2","Item 3"]),e==="callout"&&(a.style={...p0,calloutVariant:"info"}),{...a,...t}}function aue(e,t,n){return{id:`chart-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,blockType:"chart",type:e,title:t,layout:Ea(e),...n}}function xU(e,t,n,r){const i={id:`filter-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,blockType:"filter",slicerType:t,column:e,title:n||`Filter: ${e}`,layout:Ea(t),style:{...nue}};switch(t){case"date-range":i.dateConfig={mode:"between"};break;case"dropdown":case"multi-select":case"list":i.categoricalConfig={showSearch:t!=="dropdown",showSelectAll:t==="multi-select",maxVisibleItems:t==="list"?8:10,selectedValues:[]};break;case"numeric-range":i.numericConfig={step:1};break}return{...i,...r}}function sue(e){var a,i,o,l,c,u,d,f,h,m;const t=lv(e),n=b2(e),r={colorScheme:((a=e.style_config)==null?void 0:a.color_scheme)||((i=e.style)==null?void 0:i.colorScheme)||"primary",showLegend:((o=e.style_config)==null?void 0:o.show_legend)??((l=e.style)==null?void 0:l.showLegend
741)??!0,showGrid:((c=e.style_config)==null?void 0:c.show_grid)??((u=e.style)==null?void 0:u.showGrid)??!0,showValues:((d=e.style_config)==null?void 0:d.show_values)??((f=e.style)==null?void 0:f.showValues)??!1,legendPosition:((h=e.style_config)==null?void 0:h.legend_position)||((m=e.style)==null?void 0:m.legendPosition)||"bottom"};return{id:e.id||`chart-${Date.now()}`,blockType:"chart",type:e.type,title:e.title||"Chart",x_column:n.xColumn,y_column:n.yColumn,aggregation:n.aggregation,groupBy:n.groupBy,data_config:e.data_config,style:r,style_config:e.style_config,layout:t,position:e.position}}function WD(e){return e.map((t,n)=>{var o,l,c,u,d,f,h,m,p,g,y,v,w,b,j,N,S,C,_;const r=Li(t)?t.slicerType:t.type,a=Ea(r),i={colSpan:((o=t.layout)==null?void 0:o.colSpan)||a.colSpan,rowSpan:((l=t.layout)==null?void 0:l.rowSpan)||1};return Oo(t)?{id:t.id,blockType:"text",type:t.type,content:t.content,metricValue:t.metricValue,metricLabel:t.metricLabel,metricTrend:t.metricTrend,metricChange:t.metricChange,listItems:t.listItems,style:t.style,layout:i,position:t.position||{row:Math.floor(n/2),col:n%2,width:i.colSpan===12?2:1,height:i.rowSpan||1}}:Li(t)?{id:t.id,type:"filter",blockType:"filter",slicerType:t.slicerType,column:t.column,title:t.title,filter_config:{date_config:t.dateConfig?{mode:t.dateConfig.mode,start_date:t.dateConfig.startDate,end_date:t.dateConfig.endDate,relative_days:t.dateConfig.relativeDays}:void 0,categorical_config:t.categoricalConfig?{show_search:t.categoricalConfig.showSearch,show_select_all:t.categoricalConfig.showSelectAll,max_visible_items:t.categoricalConfig.maxVisibleItems,selected_values:t.categoricalConfig.selectedValues}:void 0,numeric_config:t.numericConfig?{min:t.numericConfig.min,max:t.numericConfig.max,step:t.numericConfig.step,selected_min:t.numericConfig.selectedMin,selected_max:t.numericConfig.selectedMax}:void 0},style_config:{show_title:((c=t.style)==null?void 0:c.showTitle)??!0,compact:((u=t.style)==null?void 0:u.compact)??!1,show_clear_button:((d=t.style)==null?void 0:d.showClearButton)??!0},layout:i,position:t.position||{row:Math.floor(n/2),col:n%2,width:i.colSpan===12?2:1,height:i.rowSpan||1}}:{id:t.id,blockType:"chart",type:t.type,title:t.title,data_config:{x_column:t.x_column||((f=t.data_config)==null?void 0:f.x_column),y_column:t.y_column||((h=t.data_config)==null?void 0:h.y_column),aggregation:t.aggregation||((m=t.data_config)==null?void 0:m.aggregation)||"sum",group_by:t.groupBy||((p=t.data_config)==null?void 0:p.group_by)},style_config:{color_scheme:((g=t.style)==null?void 0:g.colorScheme)||((y=t.style_config)==null?void 0:y.color_scheme)||"primary",show_legend:((v=t.style)==null?void 0:v.showLegend)??((w=t.style_config)==null?void 0:w.show_legend)??!0,show_grid:((b=t.style)==null?void 0:b.showGrid)??((j=t.style_config)==null?void 0:j.show_grid)??!0,show_values:((N=t.style)==null?void 0:N.showValues)??((S=t.style_config)==null?void 0:S.show_values)??!1,legend_position:((C=t.style)==null?void 0:C.legendPosition)||((_=t.style_config)==null?void 0:_.legend_position)||"bottom"},layout:i,position:t.position||{row:Math.floor(n/2),col:n%2,width:i.colSpan===12?2:1,height:i.rowSpan||1}}})}function iue(e){return e.map(t=>{if(t.blockType==="text"){const n=lv(t),r=jU(t),a=wU(t);return{id:t.id,blockType:"text",type:t.type,content:r.content,metricValue:r.metricValue,metricLabel:r.metricLabel,metricTrend:r.metricTrend,metricChange:r.metricChange,listItems:r.listItems,style:a,layout:n,position:t.position}}else return t.blockType==="filter"?bU(t):sue(t)})}function bU(e){var a,i,o,l,c,u;const t=lv(e),n=e.filter_config||{},r={id:e.id||`filter-${Date.now()}`,blockType:"filter",slicerType:e.slicerType||e.slicer_type||"dropdown",column:e.column||"",title:e.title||`Filter: ${e.column||"Unknown"}`,layout:t,position:e.position,style:{showTitle:((a=e.style_config)==null?void 0:a.show_title)??((i=e.style)==null?void 0:i.showTitle)??!0,compact:((o=e.style_config)==null?void 0:o.compact)??((l=e.style)==null?void 0:l.compact)??!1,showClearButton:((c=e.style_config)==null?void 0:c.show_clear_button)??((u=e.style)==null?void 0:u.showClearButton)??!0}};return n.date_config&&(r.dateConfig={mode:n.date_config.mode||"between",startDate:n.date_config.start_date,endD
741ate:n.date_config.end_date,relativeDays:n.date_config.relative_days}),n.categorical_config&&(r.categoricalConfig={showSearch:n.categorical_config.show_search??!1,showSelectAll:n.categorical_config.show_select_all??!1,maxVisibleItems:n.categorical_config.max_visible_items??10,selectedValues:n.categorical_config.selected_values||[]}),n.numeric_config&&(r.numericConfig={min:n.numeric_config.min,max:n.numeric_config.max,step:n.numeric_config.step??1,selectedMin:n.numeric_config.selected_min,selectedMax:n.numeric_config.selected_max}),r}function oue(e){var t,n,r,a,i,o,l,c,u,d;return{colorScheme:((t=e.style_config)==null?void 0:t.color_scheme)||((n=e.style)==null?void 0:n.colorScheme)||"primary",showLegend:((r=e.style_config)==null?void 0:r.show_legend)??((a=e.style)==null?void 0:a.showLegend)??!0,showGrid:((i=e.style_config)==null?void 0:i.show_grid)??((o=e.style)==null?void 0:o.showGrid)??!0,showValues:((l=e.style_config)==null?void 0:l.show_values)??((c=e.style)==null?void 0:c.showValues)??!1,legendPosition:((u=e.style_config)==null?void 0:u.legend_position)||((d=e.style)==null?void 0:d.legendPosition)||"bottom"}}function wU(e){var t,n,r,a,i,o,l,c,u,d,f,h;return{alignment:((t=e.style_config)==null?void 0:t.alignment)||((n=e.style)==null?void 0:n.alignment)||"left",fontSize:((r=e.style_config)==null?void 0:r.font_size)||((a=e.style)==null?void 0:a.fontSize)||"base",fontWeight:((i=e.style_config)==null?void 0:i.font_weight)||((o=e.style)==null?void 0:o.fontWeight)||"normal",calloutVariant:((l=e.style_config)==null?void 0:l.callout_variant)||((c=e.style)==null?void 0:c.calloutVariant)||"info",textColor:((u=e.style_config)==null?void 0:u.text_color)||((d=e.style)==null?void 0:d.textColor),backgroundColor:((f=e.style_config)==null?void 0:f.background_color)||((h=e.style)==null?void 0:h.backgroundColor)}}function jU(e){var t,n,r,a,i,o;return{content:((t=e.text_config)==null?void 0:t.content)||e.content||"",listItems:((n=e.text_config)==null?void 0:n.list_items)||e.listItems||[],metricValue:((r=e.text_config)==null?void 0:r.metric_value)||e.metricValue,metricLabel:((a=e.text_config)==null?void 0:a.metric_label)||e.metricLabel,metricTrend:((i=e.text_config)==null?void 0:i.metric_trend)||e.metricTrend,metricChange:((o=e.text_config)==null?void 0:o.metric_change)||e.metricChange}}function b2(e){var t,n,r,a;return{xColumn:((t=e.data_config)==null?void 0:t.x_column)||e.x_column,yColumn:((n=e.data_config)==null?void 0:n.y_column)||e.y_column,aggregation:((r=e.data_config)==null?void 0:r.aggregation)||e.aggregation||"sum",groupBy:((a=e.data_config)==null?void 0:a.group_by)||e.groupBy}}function lue(e){return console.log("[SmartReport] Converting",e.length,"blocks from backend"),e.filter(t=>["text","chart","filter"].includes(t.blockType)?!0:(console.warn("[SmartReport] Skipping block with invalid blockType:",t.blockType,t),!1)).map(t=>{var a;const n=`${t.blockType}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,r={colSpan:Oa.includes(t.colSpan)?t.colSpan:6,rowSpan:t.rowSpan||1};switch(console.log("[SmartReport] Block:",t.blockType,t.type,{content:(a=t.content)==null?void 0:a.substring(0,50),metricValue:t.metricValue,x_column:t.x_column}),t.blockType){case"text":{let i=t.metricTrend;i==="positive"?i="up":i==="negative"?i="down":i&&i!=="up"&&i!=="down"&&i!=="neutral"&&(i="neutral");let o=t.content||"";return!o&&t.type==="paragraph"&&(o=t.title||t.metricLabel||" "),x2(t.type,{id:n,content:o,layout:r,metricValue:t.metricValue,metricLabel:t.metricLabel,metricTrend:i,metricChange:t.metricChange,listItems:t.listItems,style:{...p0,calloutVariant:t.calloutVariant||void 0,...t.style||{}}})}case"chart":return aue(t.type,t.title||"Chart",{id:n,x_column:t.x_column,y_column:t.y_column,aggregation:t.aggregation,groupBy:t.group_by,data_config:{x_column:t.x_column,y_column:t.y_column,aggregation:t.aggregation,group_by:t.group_by},layout:r});case"filter":return xU(t.column||"",t.slicerType||"dropdown",t.title,{id:n,layout:r});default:return console.warn("[SmartReport] Unknown blockType in switch (should not happen):",t.blockType),x2("paragraph",{id:n,content:t.content||"",layout:r})}})}function lv(e){var t,n;return(t=e.layout)!=null&&t.colSpan?{colSpan:e.layout.colSpan,rowSpan:e.layout.rowSpan||1}:(n=e.position)!=null&&n.width?{colSpan:e.position.width===2?12:6,rowSpan:e.position.height||1}:{...Ea(e.type),rowSpan:1}}function cue(e){const t=jU(e),n=wU(e),r=lv(e);return{id:e.id||`text-${Date.now()}`,blockType:"text",type:e.type,content:t.content,listItems:t.listItems,metricValue:t.metricValue,metricLabel:t.metricLabel,metricTrend:t.metricTrend,metricChange:t.metricChange,style:n,layout:r,position:e.position}}const jS=[{type:"postgresql",name:"PostgreSQL",description:"Open-source relational database",icon:"Database",defaultPort:5432,category:"database",available:!0},{type:"mysql",name:"MySQL",description:"Popular open-source database",icon:"Database",defaultPort:3306,category:"database",available:!0},{type:"mariadb",name:"MariaDB",description:"MySQL-compatible database fork",icon:"Database",defaultPort:3306,category:"database",available:!1}
741,{type:"sqlserver",name:"SQL Server",description:"Microsoft SQL Server database",icon:"Database",defaultPort:1433,category:"database",available:!1},{type:"oracle",name:"Oracle",description:"Oracle enterprise database",icon:"Database",defaultPort:1521,category:"database",available:!1},{type:"mongodb",name:"MongoDB",description:"NoSQL document database",icon:"Database",defaultPort:27017,category:"database",available:!1},{type:"redis",name:"Redis",description:"In-memory data store",icon:"Database",defaultPort:6379,category:"database",available:!1},{type:"sqlite",name:"SQLite",description:"Lightweight embedded database",icon:"Database",category:"database",available:!1},{type:"snowflake",name:"Snowflake",description:"Cloud data warehouse platform",icon:"Database",category:"data_warehouse",available:!1},{type:"bigquery",name:"BigQuery",description:"Google Cloud data warehouse",icon:"Database",category:"data_warehouse",available:!1},{type:"databricks",name:"Databricks",description:"Unified analytics platform",icon:"Database",category:"data_warehouse",available:!1},{type:"stripe",name:"Stripe",description:"Payment processing analytics",icon:"CreditCard",category:"api",available:!1},{type:"salesforce",name:"Salesforce",description:"CRM and sales data",icon:"Cloud",category:"api",available:!1},{type:"hubspot",name:"HubSpot",description:"Marketing and CRM platform",icon:"Target",category:"api",available:!1},{type:"odoo",name:"Odoo",description:"ERP and business apps (popular in Spain)",icon:"Briefcase",category:"api",available:!1},{type:"sap",name:"SAP",description:"Enterprise resource planning",icon:"Briefcase",category:"api",available:!1},{type:"google_analytics",name:"Google Analytics",description:"Web analytics data",icon:"BarChart",category:"api",available:!1},{type:"amazon_s3",name:"Amazon S3",description:"AWS cloud storage",icon:"Cloud",category:"storage",available:!1},{type:"google_drive",name:"Google Drive",description:"Google cloud storage",icon:"FolderOpen",category:"storage",available:!1},{type:"azure_blob",name:"Azure Blob",description:"Microsoft cloud storage",icon:"Cloud",category:"storage",available:!1},{type:"elasticsearch",name:"Elasticsearch",description:"Search and analytics engine",icon:"Search",category:"search",available:!1}];function uue(e){var t,n;return{name:e.name,index:e.index,celldata:((t=e.data)==null?void 0:t.celldata)||[],config:e.config||{},merge:(n=e.data)==null?void 0:n.merge,row:Math.max(e.row_count,100),column:Math.max(e.column_count,26),status:e.is_active?1:0}}function qD(e){var n,r,a,i,o;let t=[];return console.log("fortuneSheetToSheetData input:",{hasData:!!e.data,hasCelldata:!!e.celldata,dataIsArray:Array.isArray(e.data),celldataIsArray:Array.isArray(e.celldata),dataLength:(n=e.data)==null?void 0:n.length,celldataLength:(r=e.celldata)==null?void 0:r.length,firstRowOfData:(o=(i=(a=e.data)==null?void 0:a[0])==null?void 0:i.slice)==null?void 0:o.call(i,0,3)}),e.data&&Array.isArray(e.data)?(t=due(e.data),console.log("Converted matrix to celldata:",t.length,"cells")):e.celldata&&Array.isArray(e.celldata)&&(t=e.celldata,console.log("Using existing celldata:",t.length,"cells")),{data:{celldata:t,merge:e.merge},config:e.config||{}}}function due(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];if(r)for(let a=0;a<r.length;a++){const i=r[a];i!=null&&t.push({r:n,c:a,v:i})}}return t}const fue={queries:{staleTime:5*60*1e3,gcTime:30*60*1e3,retry:(e,t)=>{const n=t instanceof UD?t.statusCode:(t==null?void 0:t.status_code)??(t==null?void 0:t.statusCode);return n!==void 0&&n>=400&&n<500?!1:e<3},retryDelay:e=>Math.min(1e3*2**e,3e4),refetchOnWindowFocus:!0,refetchOnReconnect:!0,refetchOnMount:!0,networkMode:"offlineFirst"},mutations:{retry:(e,t)=>{const n=t instanceof UD?t.statusCode:(t==null?void 0:t.status_code)??(t==null?void 0:t.statusCode);return n!==void 0&&n>=400&&n<500?!1:e<2},networkMode:"online"}},NU=new noe({defaultOptions:fue});function HD(){NU.clear()}function SU(e,t){return function(){return e.apply(t,arguments)}}const{toString:hue}=Object.prototype,{getPrototypeOf:Sk}=Object,{iterator:Vj,toStringTag:CU}=Symbol,Wj=(e=>t=>{const n=hue.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),bi=e=>(e=e.toLowerCase(),t=>Wj(t)===e),qj=e=>t=>typeof t===e,{isArray:Sm}=Array,yh=qj("undefined");function cv(e){return e!==null&&!yh(e)&&e.constructor!==null&&!yh(e.constructor)&&La(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const _U=bi("ArrayBuffer");function mue(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&_U(e.buffer),t}const pue=qj("string"),La=qj("function"),EU=qj("number"),uv=e=>e!==null&&typeof e=="object",gue=e=>e===!0||e===!1,mb=e=>{if(Wj(e)!=="object")return!1;const t=Sk(e);
vendor: 4,361 bytes, line 741
741return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(CU in e)&&!(Vj in e)},yue=e=>{if(!uv(e)||cv(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},vue=bi("Date"),xue=bi("File"),bue=bi("Blob"),wue=bi("FileList"),jue=e=>uv(e)&&La(e.pipe),Nue=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||La(e.append)&&((t=Wj(e))==="formdata"||t==="object"&&La(e.toString)&&e.toString()==="[object FormData]"))},Sue=bi("URLSearchParams"),[Cue,_ue,Eue,Aue]=["ReadableStream","Request","Response","Headers"].map(bi),Pue=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function dv(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Sm(e))for(r=0,a=e.length;r<a;r++)t.call(null,e[r],r,e);else{if(cv(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),o=i.length;let l;for(r=0;r<o;r++)l=i[r],t.call(null,e[l],l,e)}}function AU(e,t){if(cv(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,a;for(;r-- >0;)if(a=n[r],t===a.toLowerCase())return a;return null}const Cu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,PU=e=>!yh(e)&&e!==Cu;function w2(){const{caseless:e,skipUndefined:t}=PU(this)&&this||{},n={},r=(a,i)=>{const o=e&&AU(n,i)||i;mb(n[o])&&mb(a)?n[o]=w2(n[o],a):mb(a)?n[o]=w2({},a):Sm(a)?n[o]=a.slice():(!t||!yh(a))&&(n[o]=a)};for(let a=0,i=arguments.length;a<i;a++)arguments[a]&&dv(arguments[a],r);return n}const kue=(e,t,n,{allOwnKeys:r}={})=>(dv(t,(a,i)=>{n&&La(a)?e[i]=SU(a,n):e[i]=a},{allOwnKeys:r}),e),Oue=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Tue=(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)},Mue=(e,t,n,r)=>{let a,i,o;const l={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),i=a.length;i-- >0;)o=a[i],(!r||r(o,e,t))&&!l[o]&&(t[o]=e[o],l[o]=!0);e=n!==!1&&Sk(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Rue=(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},Due=e=>{if(!e)return null;if(Sm(e))return e;let t=e.length;if(!EU(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},$ue=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Sk(Uint8Array)),Iue=(e,t)=>{const r=(e&&e[Vj]).call(e);let a;for(;(a=r.next())&&!a.done;){const i=a.value;t.call(e,i[0],i[1])}},Lue=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Fue=bi("HTMLFormElement"),Bue=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),KD=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),zue=bi("RegExp"),kU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};dv(n,(a,i)=>{let o;(o=t(a,i,e))!==!1&&(r[i]=o||a)}),Object.defineProperties(e,r)},Uue=e=>{kU(e,(t,n)=>{if(La(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(La(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+"'")})}})},Vue=(e,t)=>{const n={},r=a=>{a.forEach(i=>{n[i]=!0})};return Sm(e)?r(e):r(String(e).split(t)),n},Wue=()=>{},que=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Hue(e){return!!(e&&La(e.append)&&e[CU]==="FormData"&&e[Vj])}const Kue=e=>{const t=new Array(10),n=(r,a)=>{if(uv(r)){if(t.indexOf(r)>=0)return;if(cv(r))return r;if(!("toJSON"in r)){t[a]=r;const i=Sm(r)?[]:{};return dv(r,(o,l)=>{const c=n(o,a+1);!yh(c)&&(i[l]=c)}),t[a]=void 0,i}}return r};return n(e,0)},Gue=bi("AsyncFunction"),Yue=e=>e&&(uv(e)||La(e))&&La(e.then)&&La(e.catch),OU=((e,t)=>e?setImmediate:t?((n,r)=>(Cu.addEventListener("message",({source:a,data:i})=>{a===Cu&&i===n&&r.length&&r.shift()()},!1),a=>{r.push(a),Cu.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",La(Cu.postMessage)),Xue=typeof queueMicrotask<"u"?queueMicrotask.bind(Cu):typeof process<"u"&&process.nextTick||OU,Que=e=>e!=null&&La(e[Vj]),ae={isArray:Sm,isArrayBuffer:_U,isBuffer:cv,isFormData:Nue,isArrayBufferView:mue,isString:pue,isNumber:EU,isBoolean:gue,isObject:uv,isPlainObject:mb,isEmptyObject:yue,isReadableStream:Cue,isRequest:_ue,isResponse:Eue,
vendor: 5,226 bytes, line 741
741isHeaders:Aue,isUndefined:yh,isDate:vue,isFile:xue,isBlob:bue,isRegExp:zue,isFunction:La,isStream:jue,isURLSearchParams:Sue,isTypedArray:$ue,isFileList:wue,forEach:dv,merge:w2,extend:kue,trim:Pue,stripBOM:Oue,inherits:Tue,toFlatObject:Mue,kindOf:Wj,kindOfTest:bi,endsWith:Rue,toArray:Due,forEachEntry:Iue,matchAll:Lue,isHTMLForm:Fue,hasOwnProperty:KD,hasOwnProp:KD,reduceDescriptors:kU,freezeMethods:Uue,toObjectSet:Vue,toCamelCase:Bue,noop:Wue,toFiniteNumber:que,findKey:AU,global:Cu,isContextDefined:PU,isSpecCompliantForm:Hue,toJSONObject:Kue,isAsyncFn:Gue,isThenable:Yue,setImmediate:OU,asap:Xue,isIterable:Que};function mt(e,t,n,r,a){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),a&&(this.response=a,this.status=a.status?a.status:null)}ae.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:ae.toJSONObject(this.config),code:this.code,status:this.status}}});const TU=mt.prototype,MU={};["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=>{MU[e]={value:e}});Object.defineProperties(mt,MU);Object.defineProperty(TU,"isAxiosError",{value:!0});mt.from=(e,t,n,r,a,i)=>{const o=Object.create(TU);ae.toFlatObject(e,o,function(d){return d!==Error.prototype},u=>u!=="isAxiosError");const l=e&&e.message?e.message:"Error",c=t==null&&e?e.code:t;return mt.call(o,l,c,n,r,a),e&&o.cause==null&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",i&&Object.assign(o,i),o};const Jue=null;function j2(e){return ae.isPlainObject(e)||ae.isArray(e)}function RU(e){return ae.endsWith(e,"[]")?e.slice(0,-2):e}function GD(e,t,n){return e?e.concat(t).map(function(a,i){return a=RU(a),!n&&i?"["+a+"]":a}).join(n?".":""):t}function Zue(e){return ae.isArray(e)&&!e.some(j2)}const ede=ae.toFlatObject(ae,{},null,function(t){return/^is[A-Z]/.test(t)});function Hj(e,t,n){if(!ae.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ae.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,y){return!ae.isUndefined(y[g])});const r=n.metaTokens,a=n.visitor||d,i=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&ae.isSpecCompliantForm(t);if(!ae.isFunction(a))throw new TypeError("visitor must be a function");function u(p){if(p===null)return"";if(ae.isDate(p))return p.toISOString();if(ae.isBoolean(p))return p.toString();if(!c&&ae.isBlob(p))throw new mt("Blob is not supported. Use a Buffer instead.");return ae.isArrayBuffer(p)||ae.isTypedArray(p)?c&&typeof Blob=="function"?new Blob([p]):Buffer.from(p):p}function d(p,g,y){let v=p;if(p&&!y&&typeof p=="object"){if(ae.endsWith(g,"{}"))g=r?g:g.slice(0,-2),p=JSON.stringify(p);else if(ae.isArray(p)&&Zue(p)||(ae.isFileList(p)||ae.endsWith(g,"[]"))&&(v=ae.toArray(p)))return g=RU(g),v.forEach(function(b,j){!(ae.isUndefined(b)||b===null)&&t.append(o===!0?GD([g],j,i):o===null?g:g+"[]",u(b))}),!1}return j2(p)?!0:(t.append(GD(y,g,i),u(p)),!1)}const f=[],h=Object.assign(ede,{defaultVisitor:d,convertValue:u,isVisitable:j2});function m(p,g){if(!ae.isUndefined(p)){if(f.indexOf(p)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(p),ae.forEach(p,function(v,w){(!(ae.isUndefined(v)||v===null)&&a.call(t,v,ae.isString(w)?w.trim():w,g,h))===!0&&m(v,g?g.concat(w):[w])}),f.pop()}}if(!ae.isObject(e))throw new TypeError("data must be an object");return m(e),t}function YD(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ck(e,t){this._pairs=[],e&&Hj(e,this,t)}const DU=Ck.prototype;DU.append=function(t,n){this._pairs.push([t,n])};DU.toString=function(t){const n=t?function(r){return t.call(this,r,YD)}:YD;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function tde(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function $U(e,t,n){if(!t)return e;const r=n&&n.encode||tde;ae.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let i;if(a?i=a(t,n):i=ae.isURLSearchParams(t)?t.toString():new Ck(t,n).toString(r),i){const o=e.indexOf("#");o!==-1&&(e=e.slice(0,o)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class XD{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){ae.forEach(this.handlers,function(r){r!==null&&t(r)})}}const IU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},nde=typeof URLSearchParams<"u"?URLSearchParams:Ck,rde=typeof FormData<"u"?FormData:null,ade=typeof Blob<"u"?Blob:null,sde={isBrowser:!0,classes:{
vendor: 10,654 bytes, lines 741-743
741URLSearchParams:nde,FormData:rde,Blob:ade},protocols:["http","https","file","blob","url","data"]},_k=typeof window<"u"&&typeof document<"u",N2=typeof navigator=="object"&&navigator||void 0,ide=_k&&(!N2||["ReactNative","NativeScript","NS"].indexOf(N2.product)<0),ode=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",lde=_k&&window.location.href||"http://localhost",cde=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:_k,hasStandardBrowserEnv:ide,hasStandardBrowserWebWorkerEnv:ode,navigator:N2,origin:lde},Symbol.toStringTag,{value:"Module"})),Hr={...cde,...sde};function ude(e,t){return Hj(e,new Hr.classes.URLSearchParams,{visitor:function(n,r,a,i){return Hr.isNode&&ae.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}function dde(e){return ae.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function fde(e){const t={},n=Object.keys(e);let r;const a=n.length;let i;for(r=0;r<a;r++)i=n[r],t[i]=e[i];return t}function LU(e){function t(n,r,a,i){let o=n[i++];if(o==="__proto__")return!0;const l=Number.isFinite(+o),c=i>=n.length;return o=!o&&ae.isArray(a)?a.length:o,c?(ae.hasOwnProp(a,o)?a[o]=[a[o],r]:a[o]=r,!l):((!a[o]||!ae.isObject(a[o]))&&(a[o]=[]),t(n,r,a[o],i)&&ae.isArray(a[o])&&(a[o]=fde(a[o])),!l)}if(ae.isFormData(e)&&ae.isFunction(e.entries)){const n={};return ae.forEachEntry(e,(r,a)=>{t(dde(r),a,n,0)}),n}return null}function hde(e,t,n){if(ae.isString(e))try{return(t||JSON.parse)(e),ae.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const fv={transitional:IU,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,i=ae.isObject(t);if(i&&ae.isHTMLForm(t)&&(t=new FormData(t)),ae.isFormData(t))return a?JSON.stringify(LU(t)):t;if(ae.isArrayBuffer(t)||ae.isBuffer(t)||ae.isStream(t)||ae.isFile(t)||ae.isBlob(t)||ae.isReadableStream(t))return t;if(ae.isArrayBufferView(t))return t.buffer;if(ae.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ude(t,this.formSerializer).toString();if((l=ae.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Hj(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return i||a?(n.setContentType("application/json",!1),hde(t)):t}],transformResponse:[function(t){const n=this.transitional||fv.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(ae.isResponse(t)||ae.isReadableStream(t))return t;if(t&&ae.isString(t)&&(r&&!this.responseType||a)){const o=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(l){if(o)throw l.name==="SyntaxError"?mt.from(l,mt.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Hr.classes.FormData,Blob:Hr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ae.forEach(["delete","get","head","post","put","patch"],e=>{fv.headers[e]={}});const mde=ae.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"]),pde=e=>{const t={};let n,r,a;return e&&e.split(`
742`).forEach(function(o){a=o.indexOf(":"),n=o.substring(0,a).trim().toLowerCase(),r=o.substring(a+1).trim(),!(!n||t[n]&&mde[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},QD=Symbol("internals");function lp(e){return e&&String(e).trim().toLowerCase()}function pb(e){return e===!1||e==null?e:ae.isArray(e)?e.map(pb):String(e)}function gde(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 yde=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function NS(e,t,n,r,a){if(ae.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!ae.isString(t)){if(ae.isString(r))return t.indexOf(r)!==-1;if(ae.isRegExp(r))return r.test(t)}}function vde(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function xde(e,t){const n=ae.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,i,o){return this[r].call(this,t,a,i,o)},configurable:!0})})}class Fa{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function i(l,c,u){const d=lp(c);if(!d)throw new Error("header name must be a non-empty string");const f=ae.findKey(a,d);(!f||a[f]===void 0||u===!0||u===void 0&&a[f]!==!1)&&(a[f||c]=pb(l))}const o=(l,c)=>ae.forEach(l,(u,d)=>i(u,d,c));if(ae.isPlainObject(t)||t instanceof this.constructor)o(t,n);else if(ae.isString(t)&&(t=t.trim())&&!yde(t))o(pde(t),n);else if(ae.isObject(t)&&ae.isIterable(t)){let l={},c,u;for(const d of t){if(!ae.isArray(d))throw TypeError("Object iterator must return a key-value pair");l[u=d[0]]=(c=l[u])?ae.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}o(l,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=lp(t),t){const r=ae.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return gde(a);if(ae.isFunction(n))return n.call(this,a,r);if(ae.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=lp(t),t){const r=ae.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||NS(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function i(o){if(o=lp(o),o){const l=ae.findKey(r,o);l&&(!n||NS(r,r[l],l,n))&&(delete r[l],a=!0)}}return ae.isArray(t)?t.forEach(i):i(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const i=n[r];(!t||NS(this,this[i],i,t,!0))&&(delete this[i],a=!0)}return a}normalize(t){const n=this,r={};return ae.forEach(this,(a,i)=>{const o=ae.findKey(r,i);if(o){n[o]=pb(a),delete n[i];return}const l=t?vde(i):String(i).trim();l!==i&&delete n[i],n[l]=pb(a),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ae.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&ae.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(`
743`)}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(a=>r.set(a)),r}static accessor(t){const r=(this[QD]=this[QD]={accessors:{}}).accessors,a=this.prototype;function i(o){const l=lp(o);r[l]||(xde(a,o),r[l]=!0)}return ae.isArray(t)?t.forEach(i):i(t),this}}Fa.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ae.reduceDescriptors(Fa.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ae.freezeMethods(Fa);function SS(e,t){const n=this||fv,r=t||n,a=Fa.from(r.headers);let i=r.data;return ae.forEach(e,function(l){i=l.call(n,i,a.normalize(),t?t.status:void 0)}),a.normalize(),i}function FU(e){return!!(e&&e.__CANCEL__)}function Cm(e,t,n){mt.call(this,e??"canceled",mt.ERR_CANCELED,t,n),this.name="CanceledError"}ae.inherits(Cm,mt,{__CANCEL__:!0});function BU(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 bde(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function wde(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,i=0,o;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[i];o||(o=u),n[a]=c,r[a]=u;let f=i,h=0;for(;f!==a;)h+=n[f++],f=f%e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),u-o<t)return;const m=d&&u-d;return m?Math.round(h*1e3/m):void 0}}function jde(e,t){let n=0,r=1e3/t,a,i;const o=(u,d=Date.now())=>{n=d,a=null,i&&(clearTimeout(i),i=null),e(...u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?o(u,d):(a=u,i||(i=setTimeout(()=>{i=null,o(a)},r-f)))},()=>a&&o(a)]}const g0=(e,t,n=3)=>{let r=0;const a=wde(50,250);return jde(i=>{const o=i.loaded,l=i.lengthComputable?i.total:void 0,c=o-r,u=a(c),d=o<=l;r=o;const f={loaded:o,total:l,progress:l?o/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-o)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},JD=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ZD=e=>(...t)=>ae.asap(()=>e(...t)),Nde=Hr.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Hr.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Hr.origin),Hr.navigator&&/(msie|trident)/i.test(Hr.navigator.userAgent)):()=>!0,Sde=Hr.hasStandardBrowserEnv?{write(e,t,n,r,a,i,o){if(typeof document>"u")return;const l=[`${e}=${encodeURIComponent(t)}`];ae.isNumber(n)&&l.push(`expires=${new Date(n).toUTCString()}`),ae.isString(r)&&l.push(`path=${r}`),ae.isString(a)&&l.push(`domain=${a}`),i===!0&&l.push("secure"),ae.isString(o)&&l.push(`SameSite=${o}`),document.cookie=l.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 Cde(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function _de(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function zU(e,t,n){let r=!Cde(t);return e&&(r||n==!1)?_de(e,t):t}const e$=e=>e instanceof Fa?{...e}:e;function ud(e,t){t=t||{};const n={};function r(u,d,f,h){return ae.isPlainObject(u)&&ae.isPlainObject(d)?ae.merge.call({caseless:h},u,d):ae.isPlainObject(d)?ae.merge({},d):ae.isArray(d)?d.slice():d}function a(u,d,f,h){if(ae.isUndefined(d)){if(!ae.isUndefined(u))return r(void 0,u,f,h)}else return r(u,d,f,h)}function i(u,d){if(!ae.isUndefined(d))return r(void 0,d)}function o(u,d){if(ae.isUndefined(d)){if(!ae.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBo
vendor: 12,944 bytes, lines 743-746
743dyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l,headers:(u,d,f)=>a(e$(u),e$(d),f,!0)};return ae.forEach(Object.keys({...e,...t}),function(d){const f=c[d]||a,h=f(e[d],t[d],d);ae.isUndefined(h)&&f!==l||(n[d]=h)}),n}const UU=e=>{const t=ud({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:i,headers:o,auth:l}=t;if(t.headers=o=Fa.from(o),t.url=$U(zU(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&o.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),ae.isFormData(n)){if(Hr.hasStandardBrowserEnv||Hr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(ae.isFunction(n.getHeaders)){const c=n.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([d,f])=>{u.includes(d.toLowerCase())&&o.set(d,f)})}}if(Hr.hasStandardBrowserEnv&&(r&&ae.isFunction(r)&&(r=r(t)),r||r!==!1&&Nde(t.url))){const c=a&&i&&Sde.read(i);c&&o.set(a,c)}return t},Ede=typeof XMLHttpRequest<"u",Ade=Ede&&function(e){return new Promise(function(n,r){const a=UU(e);let i=a.data;const o=Fa.from(a.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=a,d,f,h,m,p;function g(){m&&m(),p&&p(),a.cancelToken&&a.cancelToken.unsubscribe(d),a.signal&&a.signal.removeEventListener("abort",d)}let y=new XMLHttpRequest;y.open(a.method.toUpperCase(),a.url,!0),y.timeout=a.timeout;function v(){if(!y)return;const b=Fa.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),N={data:!l||l==="text"||l==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:b,config:e,request:y};BU(function(C){n(C),g()},function(C){r(C),g()},N),y=null}"onloadend"in y?y.onloadend=v:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(v)},y.onabort=function(){y&&(r(new mt("Request aborted",mt.ECONNABORTED,e,y)),y=null)},y.onerror=function(j){const N=j&&j.message?j.message:"Network Error",S=new mt(N,mt.ERR_NETWORK,e,y);S.event=j||null,r(S),y=null},y.ontimeout=function(){let j=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const N=a.transitional||IU;a.timeoutErrorMessage&&(j=a.timeoutErrorMessage),r(new mt(j,N.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,e,y)),y=null},i===void 0&&o.setContentType(null),"setRequestHeader"in y&&ae.forEach(o.toJSON(),function(j,N){y.setRequestHeader(N,j)}),ae.isUndefined(a.withCredentials)||(y.withCredentials=!!a.withCredentials),l&&l!=="json"&&(y.responseType=a.responseType),u&&([h,p]=g0(u,!0),y.addEventListener("progress",h)),c&&y.upload&&([f,m]=g0(c),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",m)),(a.cancelToken||a.signal)&&(d=b=>{y&&(r(!b||b.type?new Cm(null,e,y):b),y.abort(),y=null)},a.cancelToken&&a.cancelToken.subscribe(d),a.signal&&(a.signal.aborted?d():a.signal.addEventListener("abort",d)));const w=bde(a.url);if(w&&Hr.protocols.indexOf(w)===-1){r(new mt("Unsupported protocol "+w+":",mt.ERR_BAD_REQUEST,e));return}y.send(i||null)})},Pde=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const i=function(u){if(!a){a=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof mt?d:new Cm(d instanceof Error?d.message:d))}};let o=t&&setTimeout(()=>{o=null,i(new mt(`timeout ${t} of ms exceeded`,mt.ETIMEDOUT))},t);const l=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>ae.asap(l),c}},kde=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,a;for(;r<n;)a=r+t,yield e.slice(r,a),r=a},Ode=async function*(e,t){for await(const n of Tde(e))yield*kde(n,t)},Tde=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()}},t$=(e,t,n,r)=>{const a=Ode(e,t);let i=0,o,l=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await a.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let h=i+=f;n(h)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),a.return()}},{highWaterMark:2})},n$=64*1024,{isFunction:wx}=ae,Mde=(({Request:e,Response:t})=>({Request:e,Response:t}))(ae.global),{ReadableStream:r$,TextEncoder:a$}=ae.global,s$=(e,...t)=>{try{return!!e(...t)}catch{return!1}},Rde=e=>{e=ae.merge.call({skipUndefined:!0},Mde,e);const{fetch:t,Request:n,Response:r}=e,a=t?wx(t):typeof fetch=="function",i=wx(n),o=wx(r);if(!a)return!1;const l=a&&wx(r$),c=a&&(typeof a$=="function"?(p=>g=>p.encode(g))(new a$):async p=>new Uint8Array(await new n(p).arrayBuffer())),u=i&&l&&s$(()=>{let p=!1;const g=new n(Hr.origin,{body:new r$,method:"POST",get duplex(){return p=!0,"half"}}).headers.has("Content-Type");return p&&!g}),d=o&&l&&s$(()=>ae.isReadableStream(new r("").body)),f={stream:d&&(p=>p.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(p=>{!f[p]&&(f[p]=(g,y)=>{let v=g&&g[p];if(v)return v.call(g);throw new mt(`Response type '${p}' is not supported`,mt.ERR_NOT_SUPPORT,y)})});const h=async p=>{if(p==null)return 0;if(ae.isBlob(p))return p.size;if(ae.isSpecCompliantForm(p))return(await new n(Hr.origin,{method:"POST",body:p}).arrayBuffer()).byteLength;if(ae.isArrayBufferView(p)||ae.isArrayBuffer(p))return p.byteLength;if(ae.isURLSearchParams(p)&&(p=p+""),ae.isString(p))return(await c(p)).byteLength},m=async(p,g)=>{const y=ae.toFiniteNumber(p.getContentLength());return y??h(g)};return async p=>{let{url:g,method:y,data:v,signal:w,cancelToken:b,timeout:j,onDownloadProgress:N,onUploadProgress:S,responseType:C,headers:_,withCredentials:E="same-origin",fetchOptions:T}=UU(p),P=t||fetch;C=C?(C+"").toLowerCase():"text";let k=Pde([w,b&&b.toAbortSignal()],j),D=null;const A=k&&k.unsubscribe&&(()=>{k.unsubscribe()});let I;try{if(S&&u&&y!=="get"&&y!=="head"&&(I=await m(_,v))!==0){let z=new n(g,{method:"POST",body:v,duplex:"half"}),B;if(ae.isFormData(v)&&(B=z.headers.get("content-type"))&&_.setContentType(B),z.body){const[H,Y]=JD(I,g0(ZD(S)));v=t$(z.body,n$,H,Y)}}ae.isString(E)||(E=E?"include":"omit");const M=i&&"credentials"in n.prototype,$={...T,signal:k,method:y.toUpperCase(),headers:_.normalize().toJSON(),body:v,duplex:"half",credentials:M?E:void 0};D=i&&new n(g,$);let R=await(i?P(D,T):P(g,$));const O=d&&(C==="stream"||C==="response");if(d&&(N||O&&A)){const z={};["status","statusText","headers"].forEach(ee=>{z[ee]=R[ee]});const B=ae.toFiniteNumber(R.headers.get("content-length")),[H,Y]=N&&JD(B,g0(ZD(N),!0))||[];R=new r(t$(R.body,n$,H,()=>{Y&&Y(),A&&A()}),z)}C=C||"text";let F=await f[ae.findKey(f,C)||"text"](R,p);return!O&&A&&A(),await new Promise((z,B)=>{BU(z,B,{data:F,headers:Fa.from(R.headers),status:R.status,statusText:R.statusText,config:p,request:D})})}catch(M){throw A&&A(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new mt("Network Error",mt.ERR_NETWORK,p,D),{cause:M.cause||M}):mt.from(M,M&&M.code,p,D)}}},Dde=new Map,VU=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,i=[r,a,n];let o=i.length,l=o,c,u,d=Dde;for(;l--;)c=i[l],u=d.get(c),u===void 0&&d.set(c,u=l?new Map:Rde(t)),d=u;return u};VU();const Ek={http:Jue,xhr:Ade,fetch:{get:VU}};ae.forEach(Ek,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const i$=e=>`- ${e}`,$de=e=>ae.isFunction(e)||e===null||e===!1;function Ide(e,t){e=ae.isArray(e)?e:[e];const{length:n}=e;let r,a;const i={};for(let o=0;o<n;o++){r=e[o];let l;if(a=r,!$de(r)&&(a=Ek[(l=String(r)).toLowerCase()],a===void 0))throw new mt(`Unknown adapter '${l}'`);if(a&&(ae.isFunction(a)||(a=a.get(t))))break;i[l||"#"+o]=a}if(!a){const o=Object.entries(i).map(([c,u])=>`adapter ${c} `+(u===!1?"is not supported by the environment":"is not available in the build"));let l=n?o.length>1?`since :
744`+o.map(i$).join(`
745`):" "+i$(o[0]):"as no adapter specified";throw new mt("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return a}const WU={getAdapter:Ide,adapters:Ek};function CS(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cm(null,e)}function o$(e){return CS(e),e.headers=Fa.from(e.headers),e.data=SS.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),WU.getAdapter(e.adapter||fv.adapter,e)(e).then(function(r){return CS(e),r.data=SS.call(e,e.transformResponse,r),r.headers=Fa.from(r.headers),r},function(r){return FU(r)||(CS(e),r&&r.response&&(r.response.data=SS.call(e,e.transformResponse,r.response),r.response.headers=Fa.from(r.response.headers))),Promise.reject(r)})}const qU="1.13.2",Kj={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Kj[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const l$={};Kj.transitional=function(t,n,r){function a(i,o){return"[Axios v"+qU+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,l)=>{if(t===!1)throw new mt(a(o," has been removed"+(n?" in "+n:"")),mt.ERR_DEPRECATED);return n&&!l$[o]&&(l$[o]=!0,console.warn(a(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,l):!0}};Kj.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Lde(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 a=r.length;for(;a-- >0;){const i=r[a],o=t[i];if(o){const l=e[i],c=l===void 0||o(l,i,e);if(c!==!0)throw new mt("option "+i+" must be "+c,mt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new mt("Unknown option "+i,mt.ERR_BAD_OPTION)}}const gb={assertOptions:Lde,validators:Kj},Ti=gb.validators;class Hu{constructor(t){this.defaults=t||{},this.interceptors={request:new XD,response:new XD}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const i=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
746`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ud(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:i}=n;r!==void 0&&gb.assertOptions(r,{silentJSONParsing:Ti.transitional(Ti.boolean),forcedJSONParsing:Ti.transitional(Ti.boolean),clarifyTimeoutError:Ti.transitional(Ti.boolean)},!1),a!=null&&(ae.isFunction(a)?n.paramsSerializer={serialize:a}:gb.assertOptions(a,{encode:Ti.function,serialize:Ti.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),gb.assertOptions(n,{baseUrl:Ti.spelling("baseURL"),withXsrfToken:Ti.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&ae.merge(i.common,i[n.method]);i&&ae.forEach(["delete","get","head","post","put","patch","common"],p=>{delete i[p]}),n.headers=Fa.concat(o,i);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const u=[];this.interceptors.response.forEach(function(g){u.push(g.fulfilled,g.rejected)});let d,f=0,h;if(!c){const p=[o$.bind(this),void 0];for(p.unshift(...l),p.push(...u),h=p.length,d=Promise.resolve(n);f<h;)d=d.then(p[f++],p[f++]);return d}h=l.length;let m=n;for(;f<h;){const p=l[f++],g=l[f++];try{m=p(m)}catch(y){g.call(this,y);break}}try{d=o$.call(this,m)}catch(p){return Promise.reject(p)}for(f=0,h=u.length;f<h;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=ud(this.defaults,t);const n=zU(t.baseURL,t.url,t.allowAbsoluteUrls);return $U(n,t.params,t.paramsSerializer)}}ae.forEach(["delete","get","head","options"],function(t){Hu.prototype[t]=function(n,r){return this.request(ud(r||{},{method:t,url:n,data:(r||{}).data}))}});ae.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,l){return this.request(ud(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Hu.prototype[t]=n(),Hu.prototype[t+"Form"]=n(!0)});class Ak{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(a=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](a);r._listeners=null}),this.promise.then=a=>{let i;const o=new Promise(l=>{r.subscribe(l),i=l}).then(a);return o.cancel=function(){r.unsubscribe(i)},o},t(function(i,o,l){r.reason||(r.reason=new Cm(i,o,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}
vendor: 2,978 bytes, line 746
746subscribe(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 Ak(function(a){t=a}),cancel:t}}}function Fde(e){return function(n){return e.apply(null,n)}}function Bde(e){return ae.isObject(e)&&e.isAxiosError===!0}const S2={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(S2).forEach(([e,t])=>{S2[t]=e});function HU(e){const t=new Hu(e),n=SU(Hu.prototype.request,t);return ae.extend(n,Hu.prototype,t,{allOwnKeys:!0}),ae.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return HU(ud(e,a))},n}const Pn=HU(fv);Pn.Axios=Hu;Pn.CanceledError=Cm;Pn.CancelToken=Ak;Pn.isCancel=FU;Pn.VERSION=qU;Pn.toFormData=Hj;Pn.AxiosError=mt;Pn.Cancel=Pn.CanceledError;Pn.all=function(t){return Promise.all(t)};Pn.spread=Fde;Pn.isAxiosError=Bde;Pn.mergeConfig=ud;Pn.AxiosHeaders=Fa;Pn.formToJSON=e=>LU(ae.isHTMLForm(e)?new FormData(e):e);Pn.getAdapter=WU.getAdapter;Pn.HttpStatusCode=S2;Pn.default=Pn;function Pk(e="/api/v1"){return typeof window<"u"?`${window.location.origin}${e}`:`http://localhost:8000${e}`}function kk(e="/api/v1"){return typeof window<"u"?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${e}`:`ws://localhost:8000${e}`}const zde={name:"development",production:!1,version:"2.0.0-local",buildCode:"LOCAL",api:{baseUrl:"http://localhost:8000/api/v1",wsUrl:"ws://localhost:8000/api/v1",version:"v1",timeout:3e4}
746,auth:{tokenRefreshBuffer:60,accessTokenKey:"refraxion_access_token",refreshTokenKey:"refraxion_refresh_token"},features:{enableAI:!0,enableAnalytics:!1,enableDebug:!0,enableWebSocket:!0,enablePayments:!1},stripe:{publicKey:"pk_test_51SQZFxCle9n0RxbfIPZ31mdzxwK66JDMYYkq3Na6LXOgNkbGkLx6X7vpidROV54lWaIFMAYopvpDn8wez8Di4AfO00Bcw1nwkE"},analytics:void 0},Ude={name:"development",production:!1,version:"2.0.0-dev",buildCode:"DEV",api:{baseUrl:Pk("/api/v1"),wsUrl:kk("/api/v1"),version:"v1",timeout:3e4},auth:{tokenRefreshBuffer:60,accessTokenKey:"refraxion_access_token",refreshTokenKey:"refraxion_refresh_token"},features:{enableAI:!0,enableAnalytics:!1,enableDebug:!0,enableWebSocket:!0,enablePayments:!1},stripe:{publicKey:"pk_test_51SQZFxCle9n0RxbfIPZ31mdzxwK66JDMYYkq3Na6LXOgNkbGkLx6X7vpidROV54lWaIFMAYopvpDn8wez8Di4AfO00Bcw1nwkE"},analytics:void 0},Vde={name:"production",production:!0,version:"2.0.0",buildCode:"PROD",api:{baseUrl:Pk("/api/v1"),wsUrl:kk("/api/v1"),version:"v1",timeout:3e4},auth:{tokenRefreshBuffer:120,accessTokenKey:"refraxion_access_token",refreshTokenKey:"refraxion_refresh_token"},features:{enableAI:!0,enableAnalytics:!0,enableDebug:!1,enableWebSocket:!0,enablePayments:!0},stripe:{publicKey:"pk_test_51SQZFxCle9n0RxbfIPZ31mdzxwK66JDMYYkq3Na6LXOgNkbGkLx6X7vpidROV54lWaIFMAYopvpDn8wez8Di4AfO00Bcw1nwkE"},analytics:{googleAnalyticsId:"",sentryDsn:""}},Wde={name:"staging",production:!1,version:"2.0.0-staging",buildCode:"STAGING",api:{baseUrl:Pk("/api/v1"),wsUrl:kk("/api/v1"),version:"v1",timeout:3e4}
746,auth:{tokenRefreshBuffer:60,accessTokenKey:"refraxion_access_token",refreshTokenKey:"refraxion_refresh_token"},features:{enableAI:!0,enableAnalytics:!0,enableDebug:!0,enableWebSocket:!0,enablePayments:!0},stripe:{publicKey:"pk_test_51SQZFxCle9n0RxbfIPZ31mdzxwK66JDMYYkq3Na6LXOgNkbGkLx6X7vpidROV54lWaIFMAYopvpDn8wez8Di4AfO00Bcw1nwkE"},analytics:{googleAnalyticsId:"",sentryDsn:""}};function qde(){const e="production";return["local","development","production","staging"].includes(e)?e:"production"}function Hde(e){switch(e){case"production":return Vde;case"staging":return Wde;case"development":return Ude;case"local":default:return zde}}const KU=qde(),Xt=Hde(KU);Xt.production;const Kde=KU==="local";Xt.name;Xt.name;Xt.features.enableDebug&&(console.log(`[Refraxion] Environment: ${Xt.name}`),console.log(`[Refraxion] API URL: ${Xt.api.baseUrl}`),console.log(`[Refraxion] WebSocket URL: ${Xt.api.wsUrl}`),console.log(`[Refraxion] Version: ${Xt.version} (${Xt.buildCode})`));const be=Xt.api.baseUrl,Gde=Xt.api.wsUrl;Xt.api.version;const vs={REGISTER:`${be}/auth/register`,LOGIN:`${be}/auth/login`,LOGOUT:`${be}/auth/logout`,REFRESH:`${be}/auth/refresh`,CHANGE_PASSWORD:`${be}/auth/change-password`,FORGOT_PASSWORD:`${be}/auth/forgot-password`,RESET_PASSWORD:`${be}/auth/reset-password`,VERIFY_EMAIL:`${be}/auth/verify-email`,GOOGLE_AUTHORIZE:`${be}/auth/google/authorize`,GOOGLE_CALLBACK:`${be}/auth/google/callback`},ra={ME:`${be}/users/me`,ME_EXPORT:`${be}/users/me/export`,ME_CONSENTS:`${be}/users/me/consents`,ME_UNLINK_GOOGLE:`${be}/users/me/unlink-google`,ME_STATS:`${be}/users/me/stats`,LIST:`${be}/users`,BY_ID:e=>`${be}/users/${e}`,ROLE:e=>`${be}/users/${e}/role`,ACTIVATE:e=>`${be}/users/${e}/activate`,DEACTIVATE:e=>`${be}/users/${e}/deactivate`,STATS:e=>`${be}/users/${e}/stats`,BULK_DELETE:`${be}/users/bulk`},Bl={LIST:`${be}/data-sources`,UPLOAD:`${be}/data-sources/upload`,BY_ID:e=>`${be}/data-sources/${e}`,PREVIEW:e=>`${be}/data-sources/${e}/preview`,DOWNLOAD:e=>`${be}/data-sources/${e}/download`},Fr={LIST:`${be}/reports`,CREATE:`${be}/reports`,BY_ID:e=>`${be}/reports/${e}`,EXPORT:e=>`${be}/reports/${e}/export`,STATS:`${be}/reports/stats/summary`,COLLABORATORS:e=>`${be}/reports/${e}/collaborators`,COLLABORATOR:(e,t)=>`${be}/reports/${e}/collaborators/${t}`},xo={LIST:`${be}/share-links`,CREATE:`${be}/share-links`,BY_ID:e=>`${be}/share-links/${e}`,STATS:`${be}/share-links/stats/summary`,PUBLIC:e=>`${be}/share-links/public/${e}`,VERIFY:e=>`${be}/share-links/public/${e}/verify`},Kd={PLANS:`${be}/subscriptions/plans`,CURRENT:`${be}/subscriptions/current`,CHECKOUT:`${be}/subscriptions/checkout`,PORTAL:`${be}/subscriptions/portal`,CANCEL:`${be}/subscriptions/cancel`,USAGE:`${be}/subscriptions/usage`},mu={CHAT:`${be}/ai/chat`,ANALYZE:`${be}/ai/analyze`,SUGGESTIONS:`${be}/ai/suggestions`,STATUS:`${be}/ai/status`,USAGE_HISTORY:`${be}/ai/usage-history`,WS:e=>`${Gde}/ai/ws/${e}`},Fs={CREATE:`${be}/visualizations/create`,TEMPLATES:`${be}/visualizations/templates`,CHART_TYPES:`${be}/visualizations/chart-types`,SUGGESTIONS:e=>`${be}/visualizations/suggestions/${e}`,SMART_SUGGESTIONS:(e,t)=>`${be}/visualizations/smart-suggestions/${e}${t?`?max_suggestions=${t}`:""}`,RENDER:`${be}/visualizations/render`,SMART_REPORT:e=>`${be}/visualizations/smart-report/${e}`},Yde={STATS:`${be}/dashboard/stats`,ADMIN_STATS:`${be}/dashboard/admin/stats`,ADMIN_AI_USAGE:`${be}/dashboard/admin/ai-usage`,ADMIN_AI_USAGE_ALERTS:`${be}/dashboard/admin/ai-usage/alerts`,ADMIN_RECENT_ACTIONS:`${be}/dashboard/admin/recent-actions`},Hn={LIST:`${be}/connectors`,CREATE:`${be}/connectors`,TEST:`${be}/connectors/test`,BY_ID:e=>`${be}/connectors/${e}`,TEST_EXISTING:e=>`${be}/connectors/${e}/test`,TABLES:e=>`${be}/connectors/${e}/tables`,TABLE_PREVIEW:(e,t)=>`${be}/connectors/${e}/tables/${t}/preview`,SYNC:e=>`${be}/connectors/${e}/sync`,INTROSPECT:e=>`${be}/connectors/${e}/introspect`,WITH_TABLES:e=>`${be}/connectors/${e}/with-tables`,SCHEMA:e=>`${be}/connectors/${e}/schema`,AI_QUERY:e=>`${be}/connectors/${e}/ai/query`,AI_HISTORY:e=>`${be}/connectors/${e}/ai/history`,AI_HISTORY_UPDATE:(e,t)=>`${be}/connectors/${e}/ai/history/${t}`,SAVED_QUERIES:e=>`${be}/connectors/${e}/saved-queries`,SAVED_QUERY_BY_ID:(e,t)=>`${be}/connectors/${e}/saved-queries/${t}`,SAVED_QUERY_EXECUTE:(e,t)=>`${be}/connectors/${e}/saved-queries/${t}/execute`},c$={FROM_CONNECTOR:`${be}/data-sources/from-connector`,SYNC:e=>`${be}/data-sources/${e}/sync`},Gd={SIMPLE:`${be}/data-sources/from-connector/simple`,VISUAL:`${be}/data-sources/from-connector/visual`,VISUAL_PREVIEW:`${be}/data-sources/from-connector/visual/preview`,ADVANCED:`${be}/data-sources/from-connector/advanced`,AI_GENERATE:`${be}/data-sources/from-connector/ai/generate`,AI_CREATE:`${be}/data-sources/from-connector/ai/create`},jx={SIMPLE:e=>`${be}/data-sources/${e}/update/simple`,VISUAL:e=>`${be}/data-sources/${e}/update/visual`,ADVANCED:e=>`${be}/data-sources/${e}/update/advanced`,AI:e=>`${be}/data-sources/${e}/update/ai`},Mi={LIST:`${be}/workbooks`,CREATE:`${be}/workbooks`,TEMPLATES:`${be}/workbooks/templates`,BY_ID:e=>`${be}/workbooks/${e}`,UPDATE:e=>`${be}/workbooks/${e}`,DELETE:e=>`${be}/workbooks/${e}`,ADD_SHEET:e=>`${be}/workbooks/${e}/sheets`,UPDATE_SHEET:(e,t)=>`${be}/workbooks/${e}/sheets/${t}`,DELETE_SHEET:(e,t)=>`${be}/workbooks/${e}/sheets/${t}`,CONVERT_TO_DATASET:e=>`${be}/workbooks/${e}/convert-to-dataset`},Ok=()=>localStorage.getItem(Xt.auth.accessTokenKey),Xde=()=>localStorage.getItem(Xt.auth.refreshTokenKey),Qde=(e,t)=>{localStorage.setItem(Xt.auth.accessTokenKey,e),t&&localStorage.setItem(Xt.auth.refreshTokenKey,t)},C2=()=>{localStorage.removeItem(Xt.auth.accessTokenKey),localStorage.removeItem(Xt.auth.refreshTokenKey)},ue=Pn.create({baseURL:Xt.api.baseUrl,timeout:Xt.api.timeout,headers:{"Content-Type":"application/json"}});ue.interceptors.request.use(async e=>{var n;const t=Ok();return t&&(e.headers.Authorization=`Bearer ${t}`),Xt.features.enableDebug&&console.log(`[API] ${(n=e.method)==null?void 0:n.toUpperCase()} ${e.url}`),e},e=>Promise.reject(e));let _S=!1,_2=[];
746function Jde(e){_2.push(e)}function Zde(e){_2.forEach(t=>t(e)),_2=[]}async function efe(){const e=Xde();if(!e)return null;try{const t=await Pn.post(vs.REFRESH,{refresh_token:e}),{access_token:n,refresh_token:r}=t.data;return Qde(n,r),n}catch{return C2(),null}}ue.interceptors.response.use(e=>(Xt.features.enableDebug&&console.log(`[API] Response ${e.status} from ${e.config.url}`),e),async e=>{var r,a,i,o,l,c,u;const t=e.config;if(((r=e.response)==null?void 0:r.status)===401&&t&&!t._retry){if(_S)return new Promise(d=>{Jde(f=>{t.headers.Authorization=`Bearer ${f}`,d(ue(t))})});t._retry=!0,_S=!0;try{const d=await efe();return d?(Zde(d),t.headers.Authorization=`Bearer ${d}`,ue(t)):(C2(),window.location.href="/auth/login",Promise.reject(e))}catch(d){return C2(),window.location.href="/auth/login",Promise.reject(d)}finally{_S=!1}}if(((a=e.response)==null?void 0:a.status)===429){const d=e.response.headers["retry-after"];console.warn(`[API] Rate limited. Retry after: ${d}s`)}const n={detail:((o=(i=e.response)==null?void 0:i.data)==null?void 0:o.detail)||e.message||"An error occurred",errors:(c=(l=e.response)==null?void 0:l.data)==null?void 0:c.errors,status_code:((u=e.response)==null?void 0:u.status)||500,timestamp:new Date().toISOString(),path:t==null?void 0:t.url};return Xt.features.enableDebug&&console.error(`[API] Error ${n.status_code}: ${n.detail}`),Promise.reject(n)});const Jp=Pn.create({baseURL:Xt.api.baseUrl,timeout:3e5,headers:{"Content-Type":"multipart/form-data"}}),Xs=Pn.create({baseURL:Xt.api.baseUrl,timeout:3e5,headers:{"Content-Type":"application/json"}});Jp.interceptors.request.use(async e=>{const t=Ok();return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e));var HF,KF;Jp.interceptors.response.use(e=>e,(KF=(HF=ue.interceptors.response.handlers)==null?void 0:HF[0])==null?void 0:KF.rejected);Xs.interceptors.request.use(async e=>{const t=Ok();return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e));var GF,YF;Xs.interceptors.response.use(e=>e,(YF=(GF=ue.interceptors.response.handlers)==null?void 0:GF[0])==null?void 0:YF.rejected);const E2={async getCurrentUser(){return(await ue.get(ra.ME)).data},async updateCurrentUser(e){return(await ue.put(ra.ME,e)).data},async deleteCurrentUser(){await ue.delete(ra.ME)},async getCurrentUserStats(){return(await ue.get(ra.ME_STATS)).data},async listUsers(e){return(await ue.get(ra.LIST,{params:e})).data},async getUserById(e){return(await ue.get(ra.BY_ID(e))).data},async updateUser(e,t){return(await ue.put(ra.BY_ID(e),t)).data},async deleteUser(e){await ue.delete(ra.BY_ID(e))},async updateUserRole(e,t){return(await ue.put(ra.ROLE(e),{role:t})).data},async bulkDeleteUsers(e){return(await ue.delete(ra.BULK_DELETE,{data:{ids:e}})).data}},$f={async register(e){return(await ue.post(vs.REGISTER,e)).data},async login(e){const t=new URLSearchParams;return t.append("username",e.username),t.append("password",e.password),e.remember_me!==void 0&&t.append("remember_me",String(e.remember_me)),(await ue.post(vs.LOGIN,t,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data},async refresh(e){return(await ue.post(vs.REFRESH,e||{})).data},async logout(){return(await ue.post(vs.LOGOUT)).data},async changePassword(e){return(await ue.post(vs.CHANGE_PASSWORD,e)).data},async forgotPassword(e){return(await ue.post(vs.FORGOT_PASSWORD,e)).data},async resetPassword(e){return(await ue.post(vs.RESET_PASSWORD,e)).data},async verifyEmail(e){return(await ue.post(vs.VERIFY_EMAIL,e)).data}};class kp extends Error{}kp.prototype.name="InvalidTokenError";function tfe(e){return decodeURIComponent(atob(e).replace(/(.)/g,(t,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function nfe(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return tfe(t)}catch{return atob(t)}}function rfe(e,t){if(typeof e!="string")throw new kp("Invalid token specified: must be a string");t||(t={});const n=t.header===!0?0:1,r=e.split(".")[n];if(typeof r!="string")throw new kp(`Invalid token specified: missing part #${n+1}`);let a;try{a=nfe(r)}
746catch(i){throw new kp(`Invalid token specified: invalid base64 for part #${n+1} (${i.message})`)}try{return JSON.parse(a)}catch(i){throw new kp(`Invalid token specified: invalid json for part #${n+1} (${i.message})`)}}class afe{constructor(){Ud(this,"storage");Ud(this,"memoryStorage",new Map);this.storage=this.getAvailableStorage()}getAvailableStorage(){try{const t=window.localStorage,n="__storage_test__";return t.setItem(n,n),t.removeItem(n),t}catch{return console.warn("[Storage] localStorage is not available, using memory fallback"),null}}get(t){try{return this.storage?this.storage.getItem(t):this.memoryStorage.get(t)??null}catch(n){return console.error("[Storage] Error getting item:",n),null}}getJSON(t){const n=this.get(t);if(!n)return null;try{return JSON.parse(n)}catch{return console.error("[Storage] Error parsing JSON for key:",t),null}}set(t,n){try{this.storage?this.storage.setItem(t,n):this.memoryStorage.set(t,n)}catch(r){console.error("[Storage] Error setting item:",r)}}setJSON(t,n){try{this.set(t,JSON.stringify(n))}catch(r){console.error("[Storage] Error stringifying value for key:",t,r)}}remove(t){try{this.storage?this.storage.removeItem(t):this.memoryStorage.delete(t)}catch(n){console.error("[Storage] Error removing item:",n)}}clear(){try{this.storage?this.storage.clear():this.memoryStorage.clear()}catch(t){console.error("[Storage] Error clearing storage:",t)}}has(t){return this.get(t)!==null}}const bo=new afe,ES="refraxion_user";class sfe{constructor(){Ud(this,"accessTokenKey",Xt.auth.accessTokenKey);Ud(this,"refreshTokenKey",Xt.auth.refreshTokenKey);
746Ud(this,"refreshBuffer",Xt.auth.tokenRefreshBuffer)}getAccessToken(){return bo.get(this.accessTokenKey)}getRefreshToken(){return bo.get(this.refreshTokenKey)}setTokens(t,n){bo.set(this.accessTokenKey,t),n&&bo.set(this.refreshTokenKey,n)}clearTokens(){bo.remove(this.accessTokenKey),bo.remove(this.refreshTokenKey)}decodeToken(t){try{return rfe(t)}catch(n){return console.error("[Auth] Error decoding token:",n),null}}isTokenExpired(t,n){const r=this.decodeToken(t);if(!r)return!0;const a=n??this.refreshBuffer,i=Math.floor(Date.now()/1e3);return r.exp<i+a}getTokenExpiresIn(t){const n=this.decodeToken(t);if(!n)return 0;const r=Math.floor(Date.now()/1e3);return Math.max(0,n.exp-r)}isAuthenticated(){const t=this.getAccessToken();return t?!this.isTokenExpired(t,0):!1}needsRefresh(){const t=this.getAccessToken();return t?this.isTokenExpired(t,this.refreshBuffer):!1}getCurrentUser(){const t=this.getAccessToken();return t?this.decodeToken(t):null}getUserId(){var t;return((t=this.getCurrentUser())==null?void 0:t.sub)??null}getUsername(){var t;return((t=this.getCurrentUser())==null?void 0:t.username)??null}getEmail(){var t;return((t=this.getCurrentUser())==null?void 0:t.email)??null}getPlan(){var t;return((t=this.getCurrentUser())==null?void 0:t.plan)??null}getRole(){var t;return((t=this.getCurrentUser())==null?void 0:t.role)??null}getScopes(){var t;return((t=this.getCurrentUser())==null?void 0:t.scopes)??[]}hasScope(t){const n=this.getScopes();return n.includes(t)||n.includes("admin:all")}hasAllScopes(t){return t.every(n=>this.hasScope(n))}hasAnyScope(t){return t.some(n=>this.hasScope(n))}isAdmin(){return this.getRole()==="ADMIN"}isModerator(){const t=this.getRole();return t==="MODERATOR"||t==="ADMIN"}hasPaidPlan(){const t=this.getPlan();return t!==null&&t!=="free"}hasProPlan(){const t=this.getPlan();return t==="pro"||t==="enterprise"}hasEnterprisePlan(){return this.getPlan()==="enterprise"}setUser(t){bo.setJSON(ES,t)}getUser(){return bo.getJSON(ES)}clearUser(){bo.remove(ES)}clearAuth(){this.clearTokens(),this.clearUser()}}const Xa=new sfe,re={users:{all:["users"],lists:()=>[...re.users.all,"list"],list:e=>[...re.users.lists(),e],details:()=>[...re.users.all,"detail"],detail:e=>[...re.users.details(),e],me:()=>[...re.users.all,"me"],stats:()=>[...re.users.all,"stats"]},dataSources:{all:["dataSources"],lists:()=>[...re.dataSources.all,"list"],list:e=>[...re.dataSources.lists(),e],details:()=>[...re.dataSources.all,"detail"],detail:e=>[...re.dataSources.details(),e],preview:e=>[...re.dataSources.detail(e),"preview"],columns:e=>[...re.dataSources.detail(e),"columns"]},reports:{all:["reports"],lists:()=>[...re.reports.all,"list"],list:e=>[...re.reports.lists(),e],details:()=>[...re.reports.all,"detail"],detail:e=>[...re.reports.details(),e],schedule:e=>[...re.reports.detail(e),"schedule"],collaborators:e=>[...re.reports.detail(e),"collaborators"],stats:()=>[...re.reports.all,"stats"]},shareLinks:{all:["shareLinks"],lists:()=>[...re.shareLinks.all,"list"],list:e=>[...re.shareLinks.lists(),e],details:()=>[...re.shareLinks.all,"detail"],detail:e=>[...re.shareLinks.details(),e],byToken:e=>[...re.shareLinks.all,"token",e]},subscriptions:{all:["subscriptions"],current:()=>[...re.subscriptions.all,"current"],plans:()=>[...re.subscriptions.all,"plans"],usage:()=>[...re.subscriptions.all,"usage"],history:()=>[...re.subscriptions.all,"history"]},visualizations:{all:["visualizations"],types:()=>[...re.visualizations.all,"types"],templates:()=>[...re.visualizations.all,"templates"],details:()=>[...re.visualizations.all,"detail"],detail:e=>[...re.visualizations.details(),e],suggestions:e=>[...re.visualizations.all,"suggestions",e],smartSuggestions:e=>[...re.visualizations.all,"smartSuggestions",e]},ai:{all:["ai"],suggestions:e=>[...re.ai.all,"suggestions",e],history:e=>[...re.ai.all,"history",e],usageHistory:e=>[...re.ai.all,"usage-history",e]},health:{all:["health"],general:()=>[...re.health.all,"general"],database:()=>[...re.health.all,"database"],aiService:()=>[...re.health.all,"ai"],stripe:()=>[...re.health.all,"stripe"]},dashboard:{all:["dashboard"],stats:()=>[...re.dashboard.all,"stats"]},connectors:{all:["connectors"],lists:()=>[...re.connectors.all,"list"],list:e=>[...re.connectors.lists(),e],details:()=>[...re.connectors.all,"detail"],detail:e=>[...re.connectors.details(),e],withTables:e=>[...re.connectors.detail(e),"withTables"],tables:e=>[...re.connectors.detail(e),"tables"],tablePreview:(e,t)=>[...re.connectors.tables(e),t,"preview"],schema:e=>[...re.connectors.detail(e),"schema"],aiHistory:(e,t)=>[...re.connectors.detail(e),"aiHistory",{favoritesOnly:t}],savedQueries:e=>[...re.connectors.detail(e),"savedQueries"]},workbooks:{all:["workbooks"],lists:()=>[...re.workbooks.all,"list"],list:e=>[...re.workbooks.lists(),e],details:()=>[...re.workbooks.all,"detail"],detail:e=>[...re.workbooks.details(),e],templates:()=>[...re.workbooks.all,"templates"]}},GU=x.createContext(null);function ife({children:e}){const t=ct(),n=cn(),r=Xa.getAccessToken()!==null,{data:a,isLoading:i,error:o,refetch:l}=Qt({queryKey:re.users.me(),queryFn:()=>E2.getCurrentUser(),enabled:r,staleTime:5*60*1e3,retry:1,refetchOnWindowFocus:!0}),c=x.useMemo(()=>r&&a!==void 0&&!o,[r,a,o]),u=x.useCallback(async g=>{const y=await $f.login(g);Xa.setTokens(y.access_token,y.refresh_token),Xa.setUser(y.user),t.setQueryData(re.users.me(),y.user),n("/dashboard",{replace:!0})},[t,n]),d=x.useCallback(async(g,y)=>{Xa.setTokens(g,y);const v=await E2.getCurrentUser();Xa.setUser(v),t.setQueryData(re.users.me(),v),n("/dashboard",{replace:!0})},[t,n]),f=x.useCallback(async g=>{const y=await $f.register(g);Xa.setTokens(y.access_token,y.refresh_token),Xa.setUser(y.user),t.setQueryData(re.users.me(),y.user),n("/dashboard",{replace:!0})},[t,n]),h=x.useCallback(async()=>{try{await $f.logout()}catch(g){console.error("Server logout failed:",g)}finally{Xa.clearAuth(),HD(),n("/auth/login",{replace:!0})}},[n]),m=x.useCallback(async()=>{await l()},[l]);x.useEffect(()=>{o&&o.statusCode===401&&(Xa.clearAuth(),HD())},[o]);const p=x.useMemo(()=>({isAuthenticated:c,isLoading:r&&i,user:a??null,accessToken:Xa.getAccessToken(),error:o?String(o):null,login:u,loginWithGoogle:d,register:f,logout:h,refreshUser:m}),[c,i,r,a,o,u,d,f,h,m]);return s.jsx(GU.Provider,{value:p,children:e})}function lo(){const e=x.useContext(GU);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e}const YU=x.createContext(null);function ofe({children:e}){const[t,n]=x.useState(()=>{if(typeof window<"u"){const i=localStorage.getItem("darkMode");if(i!==null)return i==="true"}return!1});x.useEffect(()=>{t?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"),localStorage.setItem("darkMode",String(t))},[t]);const r=x.useCallback(()=>{n(i=>!i)},[]),a=x.useCallback(i=>{n(i)},[]);return s.jsx(YU.Provider,{value:{darkMode:t,toggleDarkMode:r,setDarkMode:a},children:e})}function XU(){const e=x.useContext(YU);if(!e)throw new Error("useTheme must be used within a ThemeProvider");return e}function QU(){return s.jsx("div",{className:"flex min-h-screen items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading..."})]})})}const u$={USER:1,MODERATOR:2,ADMIN:3};function Er({children:e,requiredRole:t,requiredScopes:n,allowedPlans:r,redirectTo:a="/auth/login",forbiddenRedirectTo:i="/dashboard",loadingComponent:o,forbiddenComponent:l}){const{isAuthenticated:c,isLoading:u,user:d}=lo(),f=oo();if(u)return s.jsx(s.Fragment,{children:o??s.jsx(QU,{})});if(!c||!d)return s.jsx(Pp,{to:a,state:{from:f.pathname},replace:!0});if(t){const h=u$[d.role]??0,m=u$[t]??0;if(h<m)return l?s.jsx(s.Fragment,{children:l}):s.jsx(Pp,{to:i,replace:!0})}if(n&&n.length>0){const h=d.scopes??[];if(!n.every(p=>h.includes(p)))return l?s.jsx(s.Fragment,{children:l}):s.jsx(Pp,{to:i,replace:!0})}return r&&r.length>0&&!r.includes(d.plan)?l?s.jsx(s.Fragment,{children:l}):s.jsx(Pp,{to:i,replace:!0}):s.jsx(s.Fragment,{children:e})}function Yd({children:e,...t}){return s.jsx(Er,{requiredRole:"ADMIN",...t,children:e})}function AS({children:e,redirectTo:t="/dashboard"}){var o;const{isAuthenticated:n,isLoading:r}=lo(),a=oo();if(r)return s.jsx(QU,{});const i=((o=a.state)==null?void 0:o.from)??t;return n?s.jsx(Pp,{to:i,replace:!0}):s.jsx(s.Fragment,{children:e})}const Vg=kd("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),U=x.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},i)=>{const o=r?vne:"button";return s.jsx(o,{className:te(Vg({variant:t,size:n,className:e})),ref:i,...a})});U.displayName="Button";const Z=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:te("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));
vendor: 7,190 bytes, line 746
746Z.displayName="Card";const we=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:te("flex flex-col space-y-1.5 p-6",e),...t}));we.displayName="CardHeader";const Ne=x.forwardRef(({className:e,...t},n)=>s.jsx("h3",{ref:n,className:te("text-2xl font-semibold leading-none tracking-tight",e),...t}));Ne.displayName="CardTitle";const it=x.forwardRef(({className:e,...t},n)=>s.jsx("p",{ref:n,className:te("text-sm text-muted-foreground",e),...t}));it.displayName="CardDescription";const le=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:te("p-6 pt-0",e),...t}));le.displayName="CardContent";const lfe=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:te("flex items-center p-6 pt-0",e),...t}));lfe.displayName="CardFooter";const cfe=kd("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function $e({className:e,variant:t,...n}){return s.jsx("div",{className:te(cfe({variant:t}),e),...n})}var ufe=x.createContext(void 0);function wl(e){const t=x.useContext(ufe);return e||t||"ltr"}var PS=0;function Gj(){x.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??d$()),document.body.insertAdjacentElement("beforeend",e[1]??d$()),PS++,()=>{PS===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),PS--}},[])}function d$(){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 kS="focusScope.autoFocusOnMount",OS="focusScope.autoFocusOnUnmount",f$={bubbles:!1,cancelable:!0},dfe="FocusScope",hv=x.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[l,c]=x.useState(null),u=In(a),d=In(i),f=x.useRef(null),h=qe(t,g=>c(g)),m=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let g=function(b){if(m.paused||!l)return;const j=b.target;l.contains(j)?f.current=j:ql(f.current,{select:!0})},y=function(b){if(m.paused||!l)return;const j=b.relatedTarget;j!==null&&(l.contains(j)||ql(f.current,{select:!0}))},v=function(b){if(document.activeElement===document.body)for(const N of b)N.removedNodes.length>0&&ql(l)};document.addEventListener("focusin",g),document.addEventListener("focusout",y);const w=new MutationObserver(v);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",y),w.disconnect()}}},[r,l,m.paused]),x.useEffect(()=>{if(l){m$.add(m);const g=document.activeElement;if(!l.contains(g)){const v=new CustomEvent(kS,f$);l.addEventListener(kS,u),l.dispatchEvent(v),v.defaultPrevented||(ffe(yfe(JU(l)),{select:!0}),document.activeElement===g&&ql(l))}return()=>{l.removeEventListener(kS,u),setTimeout(()=>{const v=new CustomEvent(OS,f$);l.addEventListener(OS,d),l.dispatchEvent(v),v.defaultPrevented||ql(g??document.body,{select:!0}),l.removeEventListener(OS,d),m$.remove(m)},0)}}},[l,u,d,m]);const p=x.useCallback(g=>{if(!n&&!r||m.paused)return;const y=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,v=document.activeElement;if(y&&v){const w=g.currentTarget,[b,j]=hfe(w);b&&j?!g.shiftKey&&v===j?(g.preventDefault(),n&&ql(b,{select:!0})):g.shiftKey&&v===b&&(g.preventDefault(),n&&ql(j,{select:!0})):v===w&&g.preventDefault()}},[n,r,m.paused]);return s.jsx(Pe.div,{tabIndex:-1,...o,ref:h,onKeyDown:p})});hv.displayName=dfe;function ffe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ql(r,{select:t}),document.activeElement!==n)return}function hfe(e){const t=JU(e),n=h$(t,e),r=h$(t.reverse(),e);return[n,r]}function JU(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function h$(e,t){for(const n of e)if(!mfe(n,{upTo:t}))return n}function mfe(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 pfe(e){return e instanceof HTMLInputElement&&"select"in e}function ql(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pfe(e)&&t&&e.select()}}var m$=gfe();function gfe(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=p$(e,t),e.unshift(t)},remove(t){var n;e=p$(e,t),(n=e[0])==null||n.resume()}}}function p$(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function yfe(e){return e.filter(t=>t.tagName!=="A")}var TS="rovingFocusGroup.onEntryFocus",vfe={bubbles:!1,cancelable:!0},mv="RovingFocusGroup",[A2,ZU,xfe]=mm(mv),[bfe,qc]=kn(mv,[xfe]),[wfe,jfe]=bfe(mv),eV=x.forwardRef((e,t)=>s.jsx(A2.Provider,{scope:e.__scopeRovingFocusGroup,children:s.jsx(A2.Slot,{scope:e.__scopeRovingFocusGroup,children:s.jsx(Nfe,{...e,ref:t})})}));eV.displayName=mv;var Nfe=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...f}=e,h=x.useRef(null),m=qe(t,h),p=wl(i),[g,y]=fr({prop:o,defaultProp:l??null,onChange:c,caller:mv}),[v,w]=x.useState(!1),b=In(u),j=ZU(n),N=x.useRef(!1),[S,C]=x.useState(0);return x.useEffect(()=>{const _=h.current;if(_)return _.addEventListener(TS,b),()=>_.removeEventListener(TS,b)},[b]),s.jsx(wfe,{scope:n,orientation:r,dir:p,loop:a,currentTabStopId:g,onItemFocus:x.useCallback(_=>y(_),[y]),onItemShiftTab:x.useCallback(()=>w(!0),[]),onFocusableItemAdd:x.useCallback(()=>C(_=>_+1),[]),onFocusableItemRemove:x.useCallback(()=>C(_=>_-1),[]),children:s.jsx(Pe.div,{tabIndex:v||S===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:je(e.onMouseDown,()=>{N.current=!0}),onFocus:je(e.onFocus,_=>{const E=!N.current;if(_.target===_.currentTarget&&E&&!v){const T=new CustomEvent(TS,vfe);if(_.currentTarget.dispatchEvent(T),!T.defaultPrevented){const P=j().filter(M=>M.focusable),k=P.find(M=>M.active),D=P.find(M=>M.id===g),I=[k,D,...P].filter(Boolean).map(M=>M.ref.current);rV(I,d)}}N.current=!1}),onBlur:je(e.onBlur,()=>w(!1))})})}),tV="RovingFocusGroupItem",nV=x.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:i,children:o,...l}=e,c=Ia(),u=i||c,d=jfe(tV,n),f=d.currentTabStopId===u,h=ZU(n),{onFocusableItemAdd:m,onFocusableItemRemove:p,currentTabStopId:g}=d;return x.useEffect(()=>{if(r)return m(),()=>p()}
vendor: 4,382 bytes, line 746
746,[r,m,p]),s.jsx(A2.ItemSlot,{scope:n,id:u,focusable:r,active:a,children:s.jsx(Pe.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...l,ref:t,onMouseDown:je(e.onMouseDown,y=>{r?d.onItemFocus(u):y.preventDefault()}),onFocus:je(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:je(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=_fe(y,d.orientation,d.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=h().filter(j=>j.focusable).map(j=>j.ref.current);if(v==="last")b.reverse();else if(v==="prev"||v==="next"){v==="prev"&&b.reverse();const j=b.indexOf(y.currentTarget);b=d.loop?Efe(b,j+1):b.slice(j+1)}setTimeout(()=>rV(b))}}),children:typeof o=="function"?o({isCurrentTabStop:f,hasTabStop:g!=null}):o})})});nV.displayName=tV;var Sfe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Cfe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function _fe(e,t,n){const r=Cfe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Sfe[r]}function rV(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Efe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Yj=eV,Xj=nV,Afe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Xd=new WeakMap,Nx=new WeakMap,Sx={},MS=0,aV=function(e){return e&&(e.host||aV(e.parentNode))},Pfe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=aV(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})},kfe=function(e,t,n,r){var a=Pfe(t,Array.isArray(e)?e:[e]);Sx[n]||(Sx[n]=new WeakMap);var i=Sx[n],o=[],l=new Set,c=new Set(a),u=function(f){!f||l.has(f)||(l.add(f),u(f.parentNode))};a.forEach(u);var d=function(f){!f||c.has(f)||Array.prototype.forEach.call(f.children,function(h){if(l.has(h))d(h);else try{var m=h.getAttribute(r),p=m!==null&&m!=="false",g=(Xd.get(h)||0)+1,y=(i.get(h)||0)+1;Xd.set(h,g),i.set(h,y),o.push(h),g===1&&p&&Nx.set(h,!0),y===1&&h.setAttribute(n,"true"),p||h.setAttribute(r,"true")}catch(v){console.error("aria-hidden: cannot operate on ",h,v)}})};return d(t),l.clear(),MS++,function(){o.forEach(function(f){var h=Xd.get(f)-1,m=i.get(f)-1;Xd.set(f,h),i.set(f,m),h||(Nx.has(f)||f.removeAttribute(r),Nx.delete(f)),m||f.removeAttribute(n)}),MS--,MS||(Xd=new WeakMap,Xd=new WeakMap,Nx=new WeakMap,Sx={})}},Qj=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Afe(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live]"))),kfe(r,a,n,"aria-hidden")):function(){return null}},Bi=function(){return Bi=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Bi.apply(this,arguments)};function sV(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function Ofe(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var yb="right-scroll-bar-position",vb="width-before-scroll-bar",Tfe="with-scroll-bars-hidden",Mfe="--removed-body-scroll-bar-size";function RS(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Rfe(e,t){var n=x.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var Dfe=typeof window<"u"?x.useLayoutEffect:x.useEffect,g$=new WeakMap;function $fe(e,t){var n=Rfe(null,function(r){return e.forEach(function(a){return RS(a,r)})});return Dfe(function(){var r=g$.get(n);if(r){var a=new Set(r),i=new Set(e),o=n.current;a.forEach(function(l){i.has(l)||RS(l,null)}
vendor: 1,591 bytes, line 746
746),i.forEach(function(l){a.has(l)||RS(l,o)})}g$.set(n,e)},[e]),n}function Ife(e){return e}function Lfe(e,t){t===void 0&&(t=Ife);var n=[],r=!1,a={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var o=t(i,r);return n.push(o),function(){n=n.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(r=!0;n.length;){var o=n;n=[],o.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var o=[];if(n.length){var l=n;n=[],l.forEach(i),o=n}var c=function(){var d=o;o=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){o.push(d),u()},filter:function(d){return o=o.filter(d),n}}}};return a}function Ffe(e){e===void 0&&(e={});var t=Lfe(null);return t.options=Bi({async:!0,ssr:!1},e),t}var iV=function(e){var t=e.sideCar,n=sV(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 x.createElement(r,Bi({},n))};iV.isSideCarExport=!0;function Bfe(e,t){return e.useMedium(t),iV}var oV=Ffe(),DS=function(){},Jj=x.forwardRef(function(e,t){var n=x.useRef(null),r=x.useState({onScrollCapture:DS,onWheelCapture:DS,onTouchMoveCapture:DS}),a=r[0],i=r[1],o=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noRelative,p=e.noIsolation,g=e.inert,y=e.allowPinchZoom,v=e.as,w=v===void 0?"div":v,b=e.ga
vendor: 4,677 bytes, lines 746-783
746pMode,j=sV(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),N=h,S=$fe([n,t]),C=Bi(Bi({},j),a);return x.createElement(x.Fragment,null,d&&x.createElement(N,{sideCar:oV,removeScrollBar:u,shards:f,noRelative:m,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:b}),o?x.cloneElement(x.Children.only(l),Bi(Bi({},C),{ref:S})):x.createElement(w,Bi({},C,{className:c,ref:S}),l))});Jj.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Jj.classNames={fullWidth:vb,zeroRight:yb};var zfe=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function Ufe(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=zfe();return t&&e.setAttribute("nonce",t),e}function Vfe(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Wfe(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var qfe=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ufe())&&(Vfe(t,n),Wfe(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Hfe=function(){var e=qfe();return function(t,n){x.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lV=function(){var e=Hfe(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},Kfe={left:0,top:0,right:0,gap:0},$S=function(e){return parseInt(e||"",10)||0},Gfe=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[$S(n),$S(r),$S(a)]},Yfe=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kfe;var t=Gfe(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])}},Xfe=lV(),If="data-scroll-locked",Qfe=function(e,t,n,r){var a=e.left,i=e.top,o=e.right,l=e.gap;return n===void 0&&(n="margin"),`
747  .`.concat(Tfe,` {
748   overflow: hidden `).concat(r,`;
749   padding-right: `).concat(l,"px ").concat(r,`;
750  }
751  body[`).concat(If,`] {
752    overflow: hidden `).concat(r,`;
753    overscroll-behavior: contain;
754    `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
755    padding-left: `.concat(a,`px;
756    padding-top: `).concat(i,`px;
757    padding-right: `).concat(o,`px;
758    margin-left:0;
759    margin-top:0;
760    margin-right: `).concat(l,"px ").concat(r,`;
761    `),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
762  }
763  
764  .`).concat(yb,` {
765    right: `).concat(l,"px ").concat(r,`;
766  }
767  
768  .`).concat(vb,` {
769    margin-right: `).concat(l,"px ").concat(r,`;
770  }
771  
772  .`).concat(yb," .").concat(yb,` {
773    right: 0 `).concat(r,`;
774  }
775  
776  .`).concat(vb," .").concat(vb,` {
777    margin-right: 0 `).concat(r,`;
778  }
779  
780  body[`).concat(If,`] {
781    `).concat(Mfe,": ").concat(l,`px;
782  }
783`)},y$=function(){var e=parseInt(document.body.getAttribute(If)||"0",10);return isFinite(e)?e:0},Jfe=function(){x.useEffect(function(){return document.body.setAttribute(If,(y$()+1).toString()),function(){var e=y$()-1;e<=0?document.body.removeAttribute(If):document.body.setAttribute(If,e.toString())}},[])},Zfe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;Jfe();var i=x.useMemo(function(){return Yfe(a)},[a]);return x.createElement(Xfe,{styles:Qfe(i,!t,a,n?"":"!important")})},P2=!1;if(typeof window<"u")try{var Cx=Object.defineProperty({},"passive",{get:function(){return P2=!0,!0}});window.addEventListener("test",Cx,Cx),window.removeEventListener("test",Cx,Cx)}catch{P2=!1}var Qd=P2?{passive:!1}:!1,ehe=function(e){return e.tagName==="TEXTAREA"},cV=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ehe(e)&&n[t]==="visible")},the=function(e){return cV(e,"overflowY")},nhe=function(e){return cV(e,"overflowX")},v$=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=uV(e,r);if(a){var i=dV(e,r),o=i[1],l=i[2];if(o>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rhe=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},ahe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uV=function(e,t){return e==="v"?the(t):nhe(t)},dV=function(e,t){return e==="v"?rhe(t):ahe(t)},she=function(e,t){return e==="h"&&t==="rtl"?-1:1},ihe=function(e,t,n,r,a){var i=she(e,window.getComputedStyle(t).direction),o=i*r,l=n.target,c=t.contains(l),u=!1,d=o>0,f=0,h=0;
vendor: 2,142 bytes, lines 783-786
783do{if(!l)break;var m=dV(e,l),p=m[0],g=m[1],y=m[2],v=g-y-i*p;(p||v)&&uV(e,l)&&(f+=v,h+=p);var w=l.parentNode;l=w&&w.nodeType===Node.DOCUMENT_FRAGMENT_NODE?w.host:w}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!a)||!d&&(Math.abs(h)<1||!a))&&(u=!0),u},_x=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},x$=function(e){return[e.deltaX,e.deltaY]},b$=function(e){return e&&"current"in e?e.current:e},ohe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},lhe=function(e){return`
784  .block-interactivity-`.concat(e,` {pointer-events: none;}
785  .allow-interactivity-`).concat(e,` {pointer-events: all;}
786`)},che=0,Jd=[];function uhe(e){var t=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),a=x.useState(che++)[0],i=x.useState(lV)[0],o=x.useRef(e);x.useEffect(function(){o.current=e},[e]),x.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var g=Ofe([e.lockRef.current],(e.shards||[]).map(b$),!0).filter(Boolean);return g.forEach(function(y){return y.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),g.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=x.useCallback(function(g,y){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!o.current.allowPinchZoom;var v=_x(g),w=n.current,b="deltaX"in g?g.deltaX:w[0]-v[0],j="deltaY"in g?g.deltaY:w[1]-v[1],N,S=g.target,C=Math.abs(b)>Math.abs(j)?"h":"v";if("touches"in g&&C==="h"&&S.type==="range")return!1;var _=v$(C,S);if(!_)return!0;if(_?N=C:(N=C==="v"?"h":"v",_=v$(C,S)),!_)return!1;if(!r.current&&"changedTouches"in g&&(b||j)&&(r.current=N),!N)return!0;var E=r.current||N;return ihe(E,y,g,E==="h"?b:j,!0)},[]),c=x.useCallback(function(g){var y=g;if(!(!Jd.length||Jd[Jd.length-1]!==i)){var v="deltaY"in y?x$(y):_x(y),w=t.current.filter(function(N){return N.name===y.type&&(N.target===y.target||y.target===N.shadowParent)&&ohe(N.delta,v)})[0];if(w&&w.should){y.cancelable&&y.preventDefault();return}
vendor: 1,383 bytes, line 786
786if(!w){var b=(o.current.shards||[]).map(b$).filter(Boolean).filter(function(N){return N.contains(y.target)}),j=b.length>0?l(y,b[0]):!o.current.noIsolation;j&&y.cancelable&&y.preventDefault()}}},[]),u=x.useCallback(function(g,y,v,w){var b={name:g,delta:y,target:v,should:w,shadowParent:dhe(v)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(j){return j!==b})},1)},[]),d=x.useCallback(function(g){n.current=_x(g),r.current=void 0},[]),f=x.useCallback(function(g){u(g.type,x$(g),g.target,l(g,e.lockRef.current))},[]),h=x.useCallback(function(g){u(g.type,_x(g),g.target,l(g,e.lockRef.current))},[]);x.useEffect(function(){return Jd.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Qd),document.addEventListener("touchmove",c,Qd),document.addEventListener("touchstart",d,Qd),function(){Jd=Jd.filter(function(g){return g!==i}),document.removeEventListener("wheel",c,Qd),document.removeEventListener("touchmove",c,Qd),document.removeEventListener("touchstart",d,Qd)}},[]);var m=e.removeScrollBar,p=e.inert;return x.createElement(x.Fragment,null,p?x.createElement(i,{styles:lhe(a)}):null,m?x.createElement(Zfe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dhe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const fhe=Bfe(oV,uhe);
vendor: 14,231 bytes, line 786
786var pv=x.forwardRef(function(e,t){return x.createElement(Jj,Bi({},e,{ref:t,sideCar:fhe}))});pv.classNames=Jj.classNames;var k2=["Enter"," "],hhe=["ArrowDown","PageUp","Home"],fV=["ArrowUp","PageDown","End"],mhe=[...hhe,...fV],phe={ltr:[...k2,"ArrowRight"],rtl:[...k2,"ArrowLeft"]},ghe={ltr:["ArrowLeft"],rtl:["ArrowRight"]},gv="Menu",[Wg,yhe,vhe]=mm(gv),[Td,hV]=kn(gv,[vhe,Vc,qc]),Zj=Vc(),mV=qc(),[xhe,Md]=Td(gv),[bhe,yv]=Td(gv),pV=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:a,onOpenChange:i,modal:o=!0}=e,l=Zj(t),[c,u]=x.useState(null),d=x.useRef(!1),f=In(i),h=wl(a);return x.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",p,{capture:!0,once:!0}),document.addEventListener("pointermove",p,{capture:!0,once:!0})},p=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",p,{capture:!0}),document.removeEventListener("pointermove",p,{capture:!0})}},[]),s.jsx(Dj,{...l,children:s.jsx(xhe,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:u,children:s.jsx(bhe,{scope:t,onClose:x.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:h,modal:o,children:r})})})};pV.displayName=gv;var whe="MenuAnchor",Tk=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Zj(n);return s.jsx(sv,{...a,...r,ref:t})});Tk.displayName=whe;var Mk="MenuPortal",[jhe,gV]=Td(Mk,{forceMount:void 0}),yV=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:a}=e,i=Md(Mk,t);return s.jsx(jhe,{scope:t,forceMount:n,children:s.jsx(Jn,{present:n||i.open,children:s.jsx(pm,{asChild:!0,container:a,children:r})})})};yV.displayName=Mk;var Ps="MenuContent",[Nhe,Rk]=Td(Ps),vV=x.forwardRef((e,t)=>{const n=gV(Ps,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Md(Ps,e.__scopeMenu),o=yv(Ps,e.__scopeMenu);return s.jsx(Wg.Provider,{scope:e.__scopeMenu,children:s.jsx(Jn,{present:r||i.open,children:s.jsx(Wg.Slot,{scope:e.__scopeMenu,children:o.modal?s.jsx(She,{...a,ref:t}):s.jsx(Che,{...a,ref:t})})})})}),She=x.forwardRef((e,t)=>{const n=Md(Ps,e.__scopeMenu),r=x.useRef(null),a=qe(t,r);return x.useEffect(()=>{const i=r.current;if(i)return Qj(i)},[]),s.jsx(Dk,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:je(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Che=x.forwardRef((e,t)=>{const n=Md(Ps,e.__scopeMenu);return s.jsx(Dk,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),_he=Rc("MenuContent.ScrollLock"),Dk=x.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:p,...g}=e,y=Md(Ps,n),v=yv(Ps,n),w=Zj(n),b=mV(n),j=yhe(n),[N,S]=x.useState(null),C=x.useRef(null),_=qe(t,C,y.onContentChange),E=x.useRef(0),T=x.useRef(""),P=x.useRef(0),k=x.useRef(null),D=x.useRef("right"),A=x.useRef(0),I=p?pv:x.Fragment,M=p?{as:_he,allowPinchZoom:!0}:void 0,$=O=>{var K,W;const F=T.current+O,z=j().filter(q=>!q.disabled),B=document.activeElement,H=(K=z.find(q=>q.ref.current===B))==null?void 0:K.textValue,Y=z.map(q=>q.textValue),ee=Lhe(Y,F,H),V=(W=z.find(q=>q.textValue===ee))==null?void 0:W.ref.current;(function q(J){T.current=J,window.clearTimeout(E.current),J!==""&&(E.current=window.setTimeout(()=>q(""),1e3))})(F),V&&setTimeout(()=>V.focus())};x.useEffect(()=>()=>window.clearTimeout(E.current),[]),Gj();const R=x.useCallback(O=>{var z,B;return D.current===((z=k.current)==null?void 0:z.side)&&Bhe(O,(B=k.current)==null?void 0:B.area)},[]);return s.jsx(Nhe,{scope:n,searchRef:T,onItemEnter:x.useCallback(O=>{R(O)&&O.preventDefault()},[R]),onItemLeave:x.useCallback(O=>{var F;R(O)||((F=C.current)==null||F.focus(),S(null))},[R]),onTriggerLeave:x.useCallback(O=>{R(O)&&O.preventDefault()},[R]),pointerGraceTimerRef:P,onPointerGraceIntentChange:x.useCallback(O=>{k.current=O},[]),children:s.jsx(I,{...M,children:s.jsx(hv,{asChild:!0,trapped:a,onMountAutoFocus:je(i,O=>{var F;O.preventDefault(),(F=C.current)==null||F.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:s.jsx(Pd,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:s.jsx(Yj,{asChild:!0,...b,dir:v.dir,orientation:"vertical",loop:r,currentTabStopId:N,onCurrentTabStopIdChange:S,onEntryFocus:je(c,O=>{v.isUsingKeyboardRef.current||O.preventDefault()}),preventScrollOnEntryFocus:!0,children:s.jsx($j,{role:"menu","aria-orientation":"vertical","data-state":RV(y.open),"data-radix-menu-content":"",dir:v.dir,...w,...g,ref:_,style:{outline:"none",...g.style},onKeyDown:je(g.onKeyDown,O=>{const z=O.target.closest("[data-radix-menu-content]")===O.currentTarget,B=O.ctrlKey||O.altKey||O.metaKey,H=O.key.length===1;z&&(O.key==="Tab"&&O.preventDefault(),!B&&H&&$(O.key));const Y=C.current;if(O.target!==Y||!mhe.includes(O.key))return;O.preventDefault();const V=j().filter(K=>!K.disabled).map(K=>K.ref.current);fV.includes(O.key)&&V.reverse(),$he(V)}),onBlur:je(e.onBlur,O=>{O.currentTarget.contains(O.target)||(window.clearTimeout(E.current),T.current="")}),onPointerMove:je(e.onPointerMove,qg(O=>{const F=O.target,z=A.current!==O.clientX;if(O.currentTarget.contains(F)&&z){const B=O.clientX>A.current?"right":"left";D.current=B,A.current=O.clientX}}))})})})})})})});vV.displayName=Ps;var Ehe="MenuGroup",$k=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Pe.div,{role:"group",...r,ref:t})});$k.displayName=Ehe;var Ahe="MenuLabel",xV=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Pe.div,{...r,ref:t})});xV.displayName=Ahe;var y0="MenuItem",w$="menu.itemSelect",e1=x.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...a}=e,i=x.useRef(null),o=yv(y0,e.__scopeMenu),l=Rk(y0,e.__scopeMenu),c=qe(t,i),u=x.useRef(!1),d=()=>{const f=i.current;if(!n&&f){const h=new CustomEvent(w$,{bubbles:!0,cancelable:!0});f.addEventListener(w$,m=>r==null?void 0:r(m),{once:!0}),UP(f,h),h.defaultPrevented?u.current=!1:o.onClose()}};return s.jsx(bV,{...a,ref:c,disabled:n,onClick:je(e.onClick,d),onPointerDown:f=>{var h;(h=e.onPointerDown)==null||h.call(e,f),u.current=!0},onPointerUp:je(e.onPointerUp,f=>{var h;u.current||(h=f.currentTarget)==null||h.click()}),onKeyDown:je(e.onKeyDown,f=>{const h=l.searchRef.current!=="";n||h&&f.key===" "||k2.includes(f.key)&&(f.currentTarget.click(),f.preventDefault())})})});e1.displayName=y0;var bV=x.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:a,...i}=e,o=Rk(y0,n),l=mV(n),c=x.useRef(null),u=qe(t,c),[d,f]=x.useState(!1),[h,m]=x.useState("");return x.useEffect(()=>{const p=c.current;p&&m((p.textContent??"").trim())},[i.children]),s.jsx(Wg.ItemSlot,{scope:n,disabled:r,textValue:a??h,children:s.jsx(Xj,{asChild:!0,...l,focusable:!r,children:s.jsx(Pe.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:je(e.onPointerMove,qg(p=>{r?o.onItemLeave(p):(o.onItemEnter(p),p.defaultPrevented||p.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:je(e.onPointerLeave,qg(p=>o.onItemLeave(p))),onFocus:je(e.onFocus,()=>f(!0)),onBlur:je(e.onBlur,()=>f(!1))})})})}),Phe="MenuCheckboxItem",wV=x.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...a}=e;return s.jsx(_V,{scope:e.__scopeMenu,checked:n,children:s.jsx(e1,{role:"menuitemcheckbox","aria-checked":v0(n)?"mixed":n,...a,ref:t,"data-state":Lk(n),onSelect:je(a.onSelect,()=>r==null?void 0:r(v0(n)?!0:!n),{checkForDefaultPrevented:!1})})})});wV.displayName=Phe;var jV="MenuRadioGroup",[khe,Ohe]=Td(jV,{value:void 0,onValueChange:()=>{}}),NV=x.forwardRef((e,t)=>{const{value:n,onValueChange:r,...a}=e,i=In(r);return s.jsx(khe,{scope:e.__scopeMenu,value:n,onValueChange:i,children:s.jsx($k,{...a,ref:t})})});NV.displayName=jV;var SV="MenuRadioItem",CV=x.forwardRef((e,t)=>{const{value:n,...r}=e,a=Ohe(SV,e.__scopeMenu),i=n===a.value;return s.jsx(_V,{scope:e.__scopeMenu,checked:i,children:s.jsx(e1,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Lk(i),onSelect:je(r.onSelect,()=>{var o;return(o=a.onValueChange)==null?void 0:o.call(a,n)},{checkForDefaultPrevented:!1})})})});CV.displayName=SV;var Ik="MenuItemIndicator",[_V,The]=Td(Ik,{checked:!1}),EV=x.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...a}=e,i=The(Ik,n);return s.jsx(Jn,{present:r||v0(i.checked)||i.checked===!0,children:s.jsx(Pe.span,{...a,ref:t,"data-state":Lk(i.checked)})})});EV.displayName=Ik;var Mhe="MenuSeparator",AV=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return s.jsx(Pe.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});AV.displayName=Mhe;var Rhe="MenuArrow",PV=x.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,a=Zj(n);return s.jsx(Ij,{...a,...r,ref:t})});PV.displayName=Rhe;var Dhe="MenuSub",[Hnt,kV]=Td(Dhe),Op="MenuSubTrigger",OV=x.forwardRef((e,t)=>{const n=Md(Op,e.__scopeMenu),r=yv(Op,e.__scopeMenu),a=kV(Op,e.__scopeMenu),i=Rk(Op,e.__scopeMenu),o=x.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,u={__scopeMenu:e.__scopeMenu},d=x.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return x.useEffect(()=>d,[d]),x.useEffect(()=>{const f=l.current;return()=>{window.clearTimeout(f),c(null)}},[l,c]),s.jsx(Tk,{asChild:!0,...u,children:s.jsx(bV,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":RV(n.open),...e,ref:Nj(t,a.onTriggerChange),onClick:f=>{var h;(h=e.onClick)==null||h.call(e,f),!(e.disabled||f.defaultPrevented)&&(f.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:je(e.onPointerMove,qg(f=>{i.onItemEnter(f),!f.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(i.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:je(e.onPointerLeave,qg(f=>{var m,p;d();const h=(m=n.content)==null?void 0:m.getBoundingClientRect();if(h){const g=(p=n.content)==null?void 0:p.dataset.side,y=g==="right",v=y?-5:5,w=h[y?"left":"right"],b=h[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:f.clientX+v,y:f.clientY},{x:w,y:h.top},{x:b,y:h.top},{x:b,y:h.bottom},{x:w,y:h.bottom}],side:g}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(f),f.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:je(e.onKeyDown,f=>{var m;const h=i.searchRef.current!=="";e.disabled||h&&f.key===" "||phe[r.dir].includes(f.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),f.preventDefault())})})})});OV.displayName=Op;var TV="MenuSubContent",MV=x.forwardRef((e,t)=>{const n=gV(Ps,e.__scopeMenu),{forceMount:r=n.forceMount,...a}=e,i=Md(Ps,e.__scopeMenu),o=yv(Ps,e.__scopeMenu),l=kV(TV,e.__scopeMenu),c=x.useRef(null),u=qe(t,c);return s.jsx(Wg.Provider,{scope:e.__scopeMenu,children:s.jsx(Jn,{present:r||i.open,children:s.jsx(Wg.Slot,{scope:e.__scopeMenu,children:s.jsx(Dk,{id:l.contentId,"aria-labelledby":l.triggerId,...a,ref:u,align:"start",side:o.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var f;o.isUsingKeyboardRef.current&&((f=c.current)==null||f.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:je(e.onFocusOutside,d=>{d.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:je(e.onEscapeKeyDown,d=>{o.onClose(),d.preventDefault()}),onKeyDown:je(e.onKeyDown,d=>{var m;const f=d.currentTarget.contains(d.target),h=ghe[o.dir].includes(d.key);f&&h&&(i.onOpenChange(!1),(m=l.trigger)==null||m.focus(),d.preventDefault())})})})})})});MV.displayName=TV;function RV(e){return e?"open":"closed"}function v0(e){return e==="indeterminate"}function Lk(e){return v0(e)?"indeterminate":e?"checked":"unchecked"}function $he(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Ihe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Lhe(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=Ihe(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function Fhe(e,t){const{x:n,y:r}=e;let a=!1;for(let i=0,o=t.length-1;i<t.length;o=i++){const l=t[i],c=t[o],u=l.x,d=l.y,f=c.x,h=c.y;d>r!=h>r&&n<(f-u)*(r-d)/(h-d)+u&&(a=!a)}return a}function Bhe(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Fhe(n,t)}function qg(e){return t=>t.pointerType==="mouse"?e(t):void 0}var zhe=pV,Uhe=Tk,Vhe=yV,Whe=vV,qhe=$k,Hhe=xV,Khe=e1,Ghe=wV,Yhe=NV,Xhe=CV,Qhe=EV,Jhe=AV,Zhe=PV,eme=OV,tme=MV,t1="DropdownMenu",[nme,Knt]=kn(t1,[hV]),va=hV(),[rme,DV]=nme(t1),$V=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:a,defaultOpen:i,onOpenChange:o,modal:l=!0}=e,c=va(t),u=x.useRef(null),[d,f]=fr({prop:a,defaultProp:i??!1,onChange:o,caller:t1});return s.jsx(rme,{scope:t,triggerId:Ia(),triggerRef:u,contentId:Ia(),open:d,onOpenChange:f,onOpenToggle:x.useCallback(()=>f(h=>!h),[f]),modal:l,children:s.jsx(zhe,{...c,open:d,onOpenChange:f,dir:r,modal:l,children:n})})};$V.displayName=t1;var IV="DropdownMenuTrigger",LV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...a}=e,i=DV(IV,n),o=va(n);return s.jsx(Uhe,{asChild:!0,...o,children:s.jsx(Pe.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...a,ref:Nj(t,i.triggerRef),onPointerDown:je(e.onPointerDown,l=>{!r&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:je(e.onKeyDown,l=>{r||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});LV.displayName=IV;var ame="DropdownMenuPortal",FV=e=>{const{__scopeDropdownMenu:t,...n}=e,r=va(t);return s.jsx(Vhe,{...r,...n})};FV.displayName=ame;var BV="DropdownMenuContent",zV=x.forwardRef((e,t)=>
786{const{__scopeDropdownMenu:n,...r}=e,a=DV(BV,n),i=va(n),o=x.useRef(!1);return s.jsx(Whe,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...r,ref:t,onCloseAutoFocus:je(e.onCloseAutoFocus,l=>{var c;o.current||(c=a.triggerRef.current)==null||c.focus(),o.current=!1,l.preventDefault()}),onInteractOutside:je(e.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!a.modal||d)&&(o.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)"}})});zV.displayName=BV;var sme="DropdownMenuGroup",ime=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(qhe,{...a,...r,ref:t})});ime.displayName=sme;var ome="DropdownMenuLabel",UV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Hhe,{...a,...r,ref:t})});UV.displayName=ome;var lme="DropdownMenuItem",VV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Khe,{...a,...r,ref:t})});VV.displayName=lme;var cme="DropdownMenuCheckboxItem",WV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Ghe,{...a,...r,ref:t})});WV.displayName=cme;var ume="DropdownMenuRadioGroup",dme=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Yhe,{...a,...r,ref:t})});dme.displayName=ume;var fme="DropdownMenuRadioItem",qV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Xhe,{...a,...r,ref:t})});qV.displayName=fme;var hme="DropdownMenuItemIndicator",HV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Qhe,{...a,...r,ref:t})});HV.displayName=hme;var mme="DropdownMenuSeparator",KV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Jhe,{...a,...r,ref:t})});KV.displayName=mme;var pme="DropdownMenuArrow",gme=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(Zhe,{...a,...r,ref:t})});gme.displayName=pme;var yme="DropdownMenuSubTrigger",GV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(eme,{...a,...r,ref:t})});GV.displayName=yme;var vme="DropdownMenuSubContent",YV=x.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,a=va(n);return s.jsx(tme,{...a,...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)"}})});YV.displayName=vme;var xme=$V,bme=LV,wme=FV,XV=zV,QV=UV,JV=VV,ZV=WV,e7=qV,t7=HV,n7=KV,r7=GV,a7=YV;const da=xme,fa=bme,jme=x.forwardRef(({className:e,inset:t,children:n,...r},a)=>s.jsxs(r7,{ref:a,className:te("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent focus:bg-accent",t&&"pl-8",e),...r,children:[n,s.jsx(si,{className:"ml-auto h-4 w-4"})]}));jme.displayName=r7.displayName;const Nme=x.forwardRef(({className:e,...t},n)=>s.jsx(a7,{ref:n,className:te("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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),...t}));Nme.displayName=a7.displayName;const Xr=x.forwardRef(({className:e,sideOffset:t=4,...n},r)=>s.jsx(wme,{children:s.jsx(XV,{ref:r,sideOffset:t,className:te("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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]:sli
786de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Xr.displayName=XV.displayName;const Xe=x.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(JV,{ref:r,className:te("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",t&&"pl-8",e),...n}));Xe.displayName=JV.displayName;const Sme=x.forwardRef(({className:e,children:t,checked:n,...r},a)=>s.jsxs(ZV,{ref:a,className:te("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),checked:n,...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(t7,{children:s.jsx(bt,{className:"h-4 w-4"})})}),t]}));Sme.displayName=ZV.displayName;const Cme=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(e7,{ref:r,className:te("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(t7,{children:s.jsx(UB,{className:"h-2 w-2 fill-current"})})}),t]}));Cme.displayName=e7.displayName;const n1=x.forwardRef(({className:e,inset:t,...n},r)=>s.jsx(QV,{ref:r,className:te("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));n1.displayName=QV.displayName;const ha=x.forwardRef(({className:e,...t},n)=>s.jsx(n7,{ref:n,className:te("-mx-1 my-1 h-px bg-muted",e),...t}));ha.displayName=n7.displayName;const s7=()=>{const{i18n:e}=Cr(),t=[{code:"en",name:"English",flag:"🇺🇸"},{code:"es",name:"Español",flag:"🇪🇸"}],n=t.find(r=>r.code===e.language)||t[0];return s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",children:s.jsx(yre,{className:"h-5 w-5"})})}),s.jsx(Xr,{align:"end",children:t.map(r=>s.jsxs(Xe,{onClick:()=>e.changeLanguage(r.code),className:"cursor-pointer",children:[s.jsx("span",{className:"mr-2",children:r.flag}),r.name,n.code===r.code&&s.jsx("span",{className:"ml-auto text-primary",children:"✓"})]},r.code))})]})},_me=()=>{const e=cn(),{t}=Cr();return s.jsxs("div",{className:"min-h-screen bg-gradient-hero",children:[s.jsxs("header",{className:"container mx-auto px-4 py-16",children:[s.jsxs("nav",{className:"flex items-center justify-between mb-16",role:"navigation","aria-label":"Main navigation",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-gradient-primary flex items-center justify-center",children:s.jsx(wt,{className:"h-6 w-6 text-white","aria-hidden":"true"})}),s.jsx("span",{className:"text-2xl font-bold text-foreground",children:"Refraxion"})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx(s7,{}),s.jsx(U,{variant:"ghost",onClick:()=>e("/auth/login"),children:t("auth.signIn")}),s.jsx(U,{onClick:()=>e("/auth/register"),className:"bg-gradient-primary",children:t("auth.getStarted")})]})]}),s.jsxs("div",{className:"text-center max-w-4xl mx-auto space-y-8",children:[s.jsxs($e,{variant:"secondary",className:"mb-4",children:[s.jsx(ap,{className:"h-3 w-3 mr-1","aria-hidden":"true"})," ",t("landing.hero.badge")]}),s.jsxs("h1",{className:"text-5xl md:text-6xl font-bold text-foreground",children:[t("landing.hero.title")," ",s.jsx("span",{className:"bg-gradient-primary bg-clip-text text-transparent",children:t("landing.hero.titleHighlight")})]}),s.jsx("p",{className:"text-xl text-muted-foreground max-w-2xl mx-auto",children:t("landing.hero.subtitle")}),s.jsxs("div",{className:"flex items-center justify-center space-x-4 flex-wrap gap-4",children:[s.jsxs(U,{size:"lg",onClick:()=>e("/auth/register"),className:"bg-gradient-primary text-lg",children:[t("landing.hero.startTrial"),s.jsx(D_,{className:"ml-2 h-5 w-5","aria-hidden":"true"})]}),s.jsx(U,{size:"lg",variant:"outline",onClick:()=>
786e("/dashboard"),children:t("landing.hero.viewDemo")})]}),s.jsxs("div",{className:"flex items-center justify-center space-x-6 text-sm text-muted-foreground flex-wrap gap-2",children:[s.jsxs("span",{className:"flex items-center",children:[s.jsx(bt,{className:"h-4 w-4 mr-1 text-success","aria-hidden":"true"})," ",t("landing.hero.freeTrial")]}),s.jsxs("span",{className:"flex items-center",children:[s.jsx(bt,{className:"h-4 w-4 mr-1 text-success","aria-hidden":"true"})," ",t("landing.hero.noCard")]}),s.jsxs("span",{className:"flex items-center",children:[s.jsx(bt,{className:"h-4 w-4 mr-1 text-success","aria-hidden":"true"})," ",t("landing.hero.cancelAnytime")]})]})]})]}),s.jsx("section",{className:"container mx-auto px-4 py-12 border-y border-border/50","aria-label":"Social proof",children:s.jsxs("div",{className:"flex items-center justify-center space-x-12 text-center flex-wrap gap-8",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-foreground",children:"2,847"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:t("landing.socialProof.activeUsers")})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-foreground",children:"500K+"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:t("landing.socialProof.reportsGenerated")})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-foreground",children:"4.8/5"}),s.jsxs("div",{className:"text-sm text-muted-foreground flex items-center justify-center",children:[s.jsx(ap,{className:"h-4 w-4 fill-accent text-accent mr-1","aria-hidden":"true"})," ",t("landing.socialProof.userRating")]})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-3xl font-bold text-foreground",children:"99.9%"}),s.jsx("div",{className:"text-sm text-muted-foreground",children:t("landing.socialProof.uptime")})]})]})}),s.jsxs("main",{children:[s.jsxs("section",{className:"container mx-auto px-4 py-20","aria-labelledby":"features-heading",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("h2",{id:"features-heading",className:"text-3xl md:text-4xl font-bold text-foreground mb-4",children:t("landing.features.heading")}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:t("landing.features.subheading")})]}),s.jsxs("div",{className:"grid gap-8 md:grid-cols-3 max-w-6xl mx-auto",children:[s.jsxs(Z,{className:"p-8 hover:shadow-xl transition-shadow border-border/50",children:[s.jsx("div",{className:"h-12 w-12 rounded-lg bg-primary/10 flex items-center justify-center mb-4",children:s.jsx(wt,{className:"h-6 w-6 text-primary","aria-hidden":"true"})}),s.jsx("h3",{className:"text-xl font-bold text-foreground mb-2",children:t("landing.features.dataConnectors.title")}),s.jsx("p",{className:"text-muted-foreground mb-4",children:t("landing.features.dataConnectors.description")}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.dataConnectors.feature1")]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.dataConnectors.feature2")]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.dataConnectors.feature3")]})]})]}),s.jsxs(Z,{className:"p-8 hover:shadow-xl transition-shadow border-border/50",children:[s.jsx("div",{className:"h-12 w-12 rounded-lg bg-accent/10 flex items-center justify-center mb-4",children:s.jsx(Xn,{className:"h-6 w-6 text-accent","aria-hidden":"true"})}),s.jsx("h3",{className:"text-xl font-bold text-foreground mb-2",children:t("landing.features.dashboards.title")}),s.jsx("p",{className:"text-muted-foreground mb-4",children:t("landing.features.dashboards.description")}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.dashboards.feature1")]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.dashboards.feature2")]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.dashboards.feature3")]})]})]}),s.jsxs(Z,{className:"p-8 hover:shadow-xl transition-shadow border-border/50",children:[s.jsx("div",{className:"h-12 w-12 rounded-lg bg-success/10 flex items-center justify-center mb-4",children:s.jsx(Ca,{className:"h-6 w-6 text-success","aria-hidden":"true"})}),s.jsx("h3",{className:"text-xl font-bold text-foreground mb-2",children:t("landing.features.aiInsights.title")}),s.jsx("p",{className:"text-muted-foreground mb-4",children:t("landing.features.aiInsights.description")}),s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.aiInsights.feature1")]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.aiInsights.feature2")]}),s.jsxs("li",{className:"flex items-start",children:[s.jsx(bt,{className:"h-4 w-4 mr-2 text-success mt-0.5","aria-hidden":"true"})," ",t("landing.features.aiInsights.feature3")]})]})]})]})]}),s.jsx("section",{className:"bg-muted/30 py-20","aria-labelledby":"benefits-heading",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsx("div",{className:"text-center mb-12",children:s.jsx("h2",{id:"benef
786its-heading",className:"text-3xl md:text-4xl font-bold text-foreground mb-4",children:t("landing.benefits.heading")})}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[s.jsx(Z,{className:"p-6 border-border/50",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(nk,{className:"h-5 w-5 text-primary","aria-hidden":"true"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.benefits.faster.title")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.benefits.faster.description")})]})]})}),s.jsx(Z,{className:"p-6 border-border/50",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-accent/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Uc,{className:"h-5 w-5 text-accent","aria-hidden":"true"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.benefits.security.title")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.benefits.security.description")})]})]})}),s.jsx(Z,{className:"p-6 border-border/50",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-success/10 flex items-center justify-center flex-shrink-0",children:s.jsx(tl,{className:"h-5 w-5 text-success","aria-hidden":"true"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.benefits.collaboration.title")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.benefits.collaboration.description")})]})]})}),s.jsx(Z,{className:"p-6 border-border/50",children:s.jsxs("div",{className:"flex items-start space-x-4",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(Wa,{className:"h-5 w-5 text-primary","aria-hidden":"true"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.benefits.scalable.title")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.benefits.scalable.description")})]})]})})]})]})})}),s.jsxs("section",{className:"container mx-auto px-4 py-20","aria-labelledby":"testimonials-heading",children:[s.jsx("div",{className:"text-center mb-12",children:s.jsx("h2",{id:"testimonials-heading",className:"text-3xl md:text-4xl font-bold text-foreground mb-4",children:t("landing.testimonials.heading")})}),s.jsxs("div",{className:"grid md:grid-cols-3 gap-8 max-w-6xl mx-auto",children:[s.jsxs(Z,{className:"p-6 border-border/50",children:[s.jsx("div",{className:"flex items-center mb-4",children:[...Array(5)].map((n,r)=>s.jsx(ap,{className:"h-4 w-4 fill-accent text-accent","aria-hidden":"true"},r))}),s.jsxs("p",{className:"text-muted-foreground mb-4",children:['"',t("landing.testimonials.testimonial1.quote"),'"']}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx("span",{className:"text-sm font-bold text-primary",children:"SM"})}),s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold text-foreground",children:t("landing.testimonials.testimonial1.author")}),s.jsx("div",{className:"text-sm text-muted-foreground",children:t("landing.testimonials.testimonial1.role")})]})]})]}),s.jsxs(Z,{className:"p-6 border-border/50",children:[s.jsx("div",{className:"flex items-center mb-4",children:[...Array(5)].map((n,r)=>s.jsx(ap,{className:"h-4 w-4 fill-accent text-accent","aria-hidden":"true"},r))}),s.jsxs("p",{className:"text-muted-foreground mb-4",children:['"',t("landing.testimonials.testimonial2.quote"),'"']}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-accent/10 flex items-center justify-center",children:s.jsx("span",{className:"text-sm font-bold text-accent",children:"JC"})}),s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold text-foreground",children:t("landing.testimonials.testimonial2.author")}),s.jsx("div",{className:"text-sm text-muted-foreground",children:t("landing.testimonials.testimonial2.role")})]})]})]}),s.jsxs(Z,{className:"p-6 border-border/50",children:[s.jsx("div",{className:"flex items-center mb-4",children:[...Array(5)].map((n,r)=>s.jsx(ap,{className:"h-4 w-4 fill-accent text-accent","aria-hidden":"true"},r))}),s.jsxs("p",{className:"text-muted-foreground mb-4",children:['"',t("landing.testimonials.testimonial3.quote"),'"']}),s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-success/10 flex items-center justify-center",children:s.jsx("span",{className:"text-sm font-bold text-success",children:"EP"})}),s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold text-foreground",children:t("landing.testimonials.testimonial3.author")}),s.jsx("div",{className:"text-sm text-muted-foreground",children:t("landing.testimonials.testimonial3.role")})]})]})]})]})]}),s.jsx("section",{className:"bg-muted/30 py-20","aria-labelledby":"faq-heading",children:s.jsx("div",{className:"container mx-auto px-4",children:s.jsxs("div",{className:"max-w-3xl mx-auto",children:[s.jsx("div",{className:"text-center mb-12",children:s.jsx("h2",{id:"faq-heading",className:"text-3xl md:text-4xl font-bold text-foreground mb-4",children:t("landing.faq.heading")})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Z,{className:"p-6 border-border/50",children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.faq.q1.question")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.faq.q1.answer")})]}),s.jsxs(Z,{className:"p-6 border-border/50",children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.faq.q2.question")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.faq.q2.answer")})]}),s.jsxs(Z,{className:"p-6 border-border/50",children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.faq.q3.question")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.faq.q3.answer")})]}),s.jsxs(Z,{className:"p-6 border-border/50",children:[s.jsx("h3",{className:"text-lg font-bold text-foreground mb-2",children:t("landing.faq.q4.question")}),s.jsx("p",{className:"text-muted-foreground",children:t("landing.faq.q4.answer")})]})]})]})})})]}),s.jsx("section",{className:"container mx-auto px-4 py-20","aria-labelledby":"
786cta-heading",children:s.jsxs("div",{className:"bg-gradient-primary rounded-2xl p-12 text-center text-white max-w-4xl mx-auto shadow-2xl",children:[s.jsxs($e,{variant:"secondary",className:"mb-4 bg-white/20 text-white border-white/30",children:[s.jsx(tv,{className:"h-3 w-3 mr-1","aria-hidden":"true"})," ",t("landing.cta.badge")]}),s.jsx("h2",{id:"cta-heading",className:"text-3xl md:text-4xl font-bold mb-4",children:t("landing.cta.title")}),s.jsx("p",{className:"text-lg mb-8 text-white/90 max-w-2xl mx-auto",children:t("landing.cta.subtitle")}),s.jsxs("div",{className:"flex items-center justify-center space-x-4 flex-wrap gap-4",children:[s.jsxs(U,{size:"lg",variant:"secondary",onClick:()=>e("/auth/register"),className:"text-lg",children:[t("landing.cta.button"),s.jsx(D_,{className:"ml-2 h-5 w-5","aria-hidden":"true"})]}),s.jsx(U,{size:"lg",variant:"outline",onClick:()=>e("/dashboard"),className:"bg-white/10 text-white border-white/30 hover:bg-white/20",children:t("landing.cta.watchDemo")})]}),s.jsxs("div",{className:"flex items-center justify-center space-x-6 mt-6 text-sm text-white/80 flex-wrap gap-2",children:[s.jsxs("span",{className:"flex items-center",children:[s.jsx(bt,{className:"h-4 w-4 mr-1","aria-hidden":"true"})," ",t("landing.cta.noCard")]}),s.jsxs("span",{className:"flex items-center",children:[s.jsx(bt,{className:"h-4 w-4 mr-1","aria-hidden":"true"})," ",t("landing.cta.fullAccess")]}),s.jsxs("span",{className:"flex items-center",children:[s.jsx(bt,{className:"h-4 w-4 mr-1","aria-hidden":"true"})," ",t("landing.cta.quickSetup")]})]})]})}),s.jsx("footer",{className:"border-t border-border bg-card",children:s.jsx("div",{className:"container mx-auto px-4 py-8",children:s.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-gradient-primary flex items-center justify-center",children:s.jsx(wt,{className:"h-5 w-5 text-white"})}),s.jsx("span",{className:"text-lg font-bold text-foreground",children:"Refraxion"})]}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[s.jsx(vt,{to:"/privacy",className:"hover:text-foreground transition-colors",children:t("legal.privacyPolicy")}),s.jsx(vt,{to:"/terms",className:"hover:text-foreground transition-colors",children:t("legal.termsOfService")}),s.jsx(vt,{to:"/cookies",className:"hover:text-foreground transition-colors",children:t("legal.cookiePolicy")}),s.jsx(vt,{to:"/legal",className:"hover:text-foreground transition-colors",children:t("legal.legalNotice")})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:t("landing.footer.copyright")})]})})})]})},Eme=()=>{const e=oo();return x.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",e.pathname)},[e.pathname]),s.jsx("div",{className:"flex min-h-screen items-center justify-center bg-muted",children:s.jsxs("div",{className:"text-center",children:[s.jsx("h1",{className:"mb-4 text-4xl font-bold",children:"404"}),s.jsx("p",{className:"mb-4 text-xl text-muted-foreground",children:"Oops! Page not found"}),s.jsx("a",{href:"/",className:"text-primary underline hover:text-primary/90",children:"Return to Home"})]})})},Re=x.forwardRef(({className:e,type:t,...n},r)=>s.jsx("input",{type:t,className:te("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Re.displayName="Input";var Ame="Label",i7=x.forwardRef((e,t)=>s.jsx(Pe.label,{...e,ref:t,onMouseDown:n=>{var a;n.target.closest("button, input, select, textarea")||((a=e.onMouseDown)==null||a.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));i7.displayName=Ame;var o7=i7;const Pme=kd("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pe=x.forwardRef(({className:e,...t},n)=>s.jsx(o7,{ref:n,className:te(Pme(),e),...t}));pe.displayName=o7.displayName;function vv(e){const t=x.useRef({value:e,previous:e});return x.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var r1="Checkbox",[kme,Gnt]=kn(r1),[Ome,Fk]=kme(r1);function Tme(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:i,form:o,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=e,[h,m]=fr({prop:n,defaultProp:a??!1,onChange:c,caller:r1}
786),[p,g]=x.useState(null),[y,v]=x.useState(null),w=x.useRef(!1),b=p?!!o||!!p.closest("form"):!0,j={checked:h,disabled:i,setChecked:m,control:p,setControl:g,name:l,form:o,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:Ac(a)?!1:a,isFormControl:b,bubbleInput:y,setBubbleInput:v};return s.jsx(Ome,{scope:t,...j,children:Mme(f)?f(j):r})}var l7="CheckboxTrigger",c7=x.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:i,value:o,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:h,isFormControl:m,bubbleInput:p}=Fk(l7,e),g=qe(a,d),y=x.useRef(c);return x.useEffect(()=>{const v=i==null?void 0:i.form;if(v){const w=()=>f(y.current);return v.addEventListener("reset",w),()=>v.removeEventListener("reset",w)}},[i,f]),s.jsx(Pe.button,{type:"button",role:"checkbox","aria-checked":Ac(c)?"mixed":c,"aria-required":u,"data-state":m7(c),"data-disabled":l?"":void 0,disabled:l,value:o,...r,ref:g,onKeyDown:je(t,v=>{v.key==="Enter"&&v.preventDefault()}),onClick:je(n,v=>{f(w=>Ac(w)?!0:!w),p&&m&&(h.current=v.isPropagationStopped(),h.current||v.stopPropagation())})})});c7.displayName=l7;var Bk=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:i,required:o,disabled:l,value:c,onCheckedChange:u,form:d,...f}=e;return s.jsx(Tme,{__scopeCheckbox:n,checked:a,defaultChecked:i,disabled:l,required:o,onCheckedChange:u,name:r,form:d,value:c,internal_do_not_use_render:({isFormControl:h})=>s.jsxs(s.Fragment,{children:[s.jsx(c7,{...f,ref:t,__scopeCheckbox:n}),h&&s.jsx(h7,{__scopeCheckbox:n})]})})});Bk.displayName=r1;var u7="CheckboxIndicator",d7=x.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,i=Fk(u7,n);return s.jsx(Jn,{present:r||Ac(i.checked)||i.checked===!0,children:s.jsx(Pe.span,{"data-state":m7(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});d7.displayName=u7;var f7="CheckboxBubbleInput",h7=x.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:o,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:h,setBubbleInput:m}=Fk(f7,e),p=qe(n,m),g=vv(i),y=av(r);x.useEffect(()=>{const w=h;if(!w)return;const b=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(b,"checked").set,S=!a.current;if(g!==i&&N){const C=new Event("click",{bubbles:S});w.indeterminate=Ac(i),N.call(w,Ac(i)?!1:i),w.dispatchEvent(C)}},[h,g,i,a]);const v=x.useRef(Ac(i)?!1:i);return s.jsx(Pe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:o??v.current,required:l,disabled:c,name:u,value:d,form:f,...t,tabIndex:-1,ref:p,style:{...t.style,...y,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});h7.displayName=f7;function Mme(e){return typeof e=="function"}function Ac(e){return e==="indeterminate"}function m7(e){return Ac(e)?"indeterminate":e?"checked":"unchecked"}const Hc=x.forwardRef(({className:e,...t},n)=>s.jsx(Bk,{ref:n,className:te("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(d7,{className:te("flex items-center justify-center text-current"),children:s.jsx(bt,{className:"h-4 w-4"})})}));Hc.displayName=Bk.displayName;const Rme=()=>{const{login:e}=lo(),[t]=ov(),[n,r]=x.useState(!1),[a,i]=x.useState(!1),[o,l]=x.useState({email:"",password:"",remember:!1});t.get("error")&&!n&&t.delete("error");const u=()=>{i(!0),window.location.href=vs.GOOGLE_AUTHORIZE},d=async f=>{f.preventDefault(),r(!0);try{await e({username:o.email,password:o.password,remember_me:o.remember}),se.success("Welcome back!")}catch(h){const m=h,p=(m==null?void 0:m.detail)||"Invalid credentials. Please try again.";se.error(p)}finally{r(!1)}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-hero p-4",children:s.jsx("div",{className:"w-full max-w-md",children:s.jsxs("div",{className:"bg-card rounded-lg shadow-xl p-8 space-y-6",children:[s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-12 w-12 rounded-lg bg-gradient-primary flex items-center justify-center",children:s.jsx(wt,{className:"h-7 w-7 text-white"})})}),s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Welcome back"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Sign in to your Refraxion account"})]}),s.jsxs("form",{onSubmit:d,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"email",children:"Email or Username"}),s.jsx(Re,{id:"email",type:"text",placeholder:"Enter your email or username",value:o.email,onChange:f=>l({...o,email:f.target.value}),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(pe,{htmlFor:"password",children:"Password"}),s.jsx(vt,{to:"/auth/forgot-password",className:"text-sm text-primary hover:underline",children:"Forgot password?"})]}),s.jsx(Re,{id:"password",type:"password",placeholder:"Enter your password",value:o.password,onChange:f=>l({...o,password:f.target.value}),required:!0})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Hc,{id:"remember",checked:o.remember,onCheckedChange:f=>l({...o,remember:f})}),s.jsx("label",{htmlFor:"remember",className:"text-sm text-foreground cursor-pointer",children:"Remember me for 30 days"})]}),s.jsx(U,{type:"submit",className:"w-full",disabled:n,children:n?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Signing in..."]}):"Sign in"})]}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("span",{className:"w-full border-t border-border"})}),s.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:s.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"Or continue with"})})]}),s.jsx("div",{className:"grid grid-cols-1 gap-3",children:s.jsxs(U,{variant:"outline",type:"button",onClick:u,disabled:n||a,children:[a?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),s.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),s.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),s.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Google"]})}),s.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Don't have an account?"," ",s.jsx(vt,{to:"/auth/register",className:"font-medium text-primary hover:underline",children:"Sign up for free"})]})]})})})},Dme=()=>{const{register:e}=lo(),[t,n]=x.useState(!1),[r,a]=x.useState(!1),[i,o]=x.useState({username:"",email:"",password:"",confirmPassword:"",fullName:"",company:"",terms:!1}),l=()=>{a(!0),window.location.href=vs.GOOGLE_AUTHORIZE},c={length:i.password.length>=12,uppercase:/[A-Z]/.test(i.password),lowercase:/[a-z]/.test(i.password),digit:/\d/.test(i.password),special:/[!@#$%^&*(),.?":{}|<>]/.test(i.password)}
786,u=Object.values(c).filter(Boolean).length,d=async f=>{if(f.preventDefault(),i.password!==i.confirmPassword){se.error("Passwords do not match");return}if(!i.terms){se.error("Please accept the terms and conditions");return}if(u<5){se.error("Please create a stronger password");return}n(!0);try{await e({username:i.username,email:i.email,password:i.password,password_confirm:i.confirmPassword,full_name:i.fullName||void 0,company:i.company||void 0}),se.success("Account created successfully!")}catch(h){const m=h,p=(m==null?void 0:m.detail)||"Registration failed. Please try again.";se.error(p)}finally{n(!1)}};return s.jsxs("div",{className:"min-h-screen flex",children:[s.jsx("div",{className:"hidden lg:flex lg:w-1/2 bg-gradient-primary p-12 flex-col justify-center text-white",children:s.jsxs("div",{className:"max-w-lg",children:[s.jsx("div",{className:"h-12 w-12 rounded-lg bg-white/20 backdrop-blur-sm flex items-center justify-center mb-8",children:s.jsx(wt,{className:"h-7 w-7 text-white"})}),s.jsx("h2",{className:"text-4xl font-bold mb-6",children:"Transform Your Data into Insights"}),s.jsx("p",{className:"text-lg text-white/90 mb-8",children:"Join thousands of businesses using Refraxion to make data-driven decisions."}),s.jsx("div",{className:"space-y-4",children:["AI-powered analytics and insights","Create beautiful reports in minutes","Collaborate with your team seamlessly","Enterprise-grade security","24/7 customer support"].map((f,h)=>s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx("div",{className:"h-6 w-6 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center flex-shrink-0",children:s.jsx(bt,{className:"h-4 w-4 text-white"})}),s.jsx("span",{className:"text-white/90",children:f})]},h))})]})}),s.jsx("div",{className:"flex-1 flex items-center justify-center p-8 bg-background",children:s.jsxs("div",{className:"w-full max-w-md 
786space-y-6",children:[s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Create account"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Start your 14-day free trial. No credit card required."})]}),s.jsxs(U,{variant:"outline",type:"button",className:"w-full",onClick:l,disabled:t||r,children:[r?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsxs("svg",{className:"mr-2 h-4 w-4",viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),s.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),s.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),s.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),"Sign up with Google"]}),s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 flex items-center",children:s.jsx("span",{className:"w-full border-t border-border"})}),s.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:s.jsx("span",{className:"bg-background px-2 text-muted-foreground",children:"Or register with email"})})]}),s.jsxs("form",{onSubmit:d,className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"username",children:"Username *"}),s.jsx(Re,{id:"username",placeholder:"johndoe",value:i.username,onChange:f=>o({...i,username:f.target.value}),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"fullName",children:"Full Name"}),s.jsx(Re,{id:"fullName",placeholder:"John Doe",value:i.fullName,onChange:f=>o({...i,fullName:f.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"email",children:"Email *"}),s.jsx(Re,{id:"email",type:"email",placeholder:"[email protected]",value:i.email,onChange:f=>o({...i,email:f.target.value}),required:!0})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"company",children:"Company"}),s.jsx(Re,{id:"company",placeholder:"Acme Inc.",value:i.company,onChange:f=>o({...i,company:f.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"password",children:"Password *"}),s.jsx(Re,{id:"password",type:"password",placeholder:"Create a strong password",value:i.password,onChange:f=>o({...i,password:f.target.value}),required:!0}),i.password&&s.jsxs("div",{className:"space-y-2 mt-2",children:[s.jsx("div",{className:"flex gap-1",children:[1,2,3,4,5].map(f=>s.jsx("div",{className:te("h-1 flex-1 rounded-full transition-colors",f<=u?u<=2?"bg-destructive":u<=4?"bg-yellow-500":"bg-success":"bg-muted")},f))}),s.jsx("div",{className:"text-xs space-y-1",children:Object.entries({length:"At least 12 characters",uppercase:"One uppercase letter",lowercase:"One lowercase letter",digit:"One number",special:"One special character"}).map(([f,h])=>s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[c[f]?s.jsx(bt,{className:"h-3 w-3 text-success"}):s.jsx(ua,{className:"h-3 w-3 text-muted-foreground"}),s.jsx("span",{children:h})]},f))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"confirmPassword",children:"Confirm Password *"}),s.jsx(Re,{id:"confirmPassword",type:"password",placeholder:"Confirm your password",value:i.confirmPassword,onChange:f=>o({...i,confirmPassword:f.target.value}),className:te(i.confirmPassword&&i.password!==i.confirmPassword?"border-destructive focus-visible:ring-destructive":i.confirmPassword&&i.password===i.confirmPassword?"border-success focus-visible:ring-success":""),required:!0}),i.confirmPassword&&s.jsx("div",{className:"flex items-center gap-2 text-xs",children:i.password===i.confirmPassword?s.jsxs(s.Fragment,{children:[s.jsx(bt,{className:"h-3 w-3 text-success"}),s.jsx("span",{className:"text-success",children:"Passwords match"})]}):s.jsxs(s.Fragment,{children:[s.jsx(ua,{className:"h-3 w-3 text-destructive"}),s.jsx("span",{className:"text-destructive",children:"Passwords do not match"})]})})]}),s.jsxs("div",{className:"flex items-start space-x-2",children:[s.jsx(Hc,{id:"terms",checked:i.terms,onCheckedChange:f=>o({...i,terms:f})}),s.jsxs("label",{htmlFor:"terms",className:"text-sm text-foreground leading-none cursor-pointer",children:["I agree to the"," ",s.jsx(vt,{to:"#",className:"text-primary hover:underline",children:"Terms of Service"})," ","and"," ",s.jsx(vt,{to:"#",className:"text-primary hover:underline",children:"Privacy Policy"})]})]}),s.jsx(U,{type:"submit",className:"w-full",disabled:t||u<5||i.password!==i.confirmPassword||!i.terms,children:t?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Creating account..."]}):"Create account"})]}),s.jsxs("p",{className:"text-center text-sm text-muted-foreground",children:["Already have an account?"," ",s.jsx(vt,{to:"/auth/login",className:"font-medium text-primary hover:underline",children:"Sign in"})]})]})})]})};function $me(){return Qe({mutationFn:e=>$f.changePassword(e)})}function Ime(){return Qe({mutationFn:e=>$f.forgotPassword(e)})}function Lme(){const e=ct();return Qe({mutationFn:t=>$f.verifyEmail(t),onSuccess:()=>
786{e.invalidateQueries({queryKey:re.users.me()})}})}function Fme(){const e=ct();return Qe({mutationFn:t=>E2.updateCurrentUser(t),onSuccess:t=>{e.setQueryData(re.users.me(),t),Xa.setUser(t)}})}const Zr={async list(e){return(await ue.get(Bl.LIST,{params:e})).data},async getById(e){return(await ue.get(Bl.BY_ID(e))).data},async upload(e,t,n){const r=new FormData;return r.append("file",e),t!=null&&t.name&&r.append("name",t.name),t!=null&&t.description&&r.append("description",t.description),t!=null&&t.visibility&&r.append("visibility",t.visibility),(await ue.post(Bl.UPLOAD,r,{headers:{"Content-Type":"multipart/form-data"},onUploadProgress:i=>{if(n&&i.total){const o=Math.round(i.loaded*100/i.total);n(o)}}})).data},async update(e,t){return(await ue.put(Bl.BY_ID(e),t)).data},async delete(e){await ue.delete(Bl.BY_ID(e))},async getPreview(e,t){return(await ue.get(Bl.PREVIEW(e),{params:t})).data},async download(e,t){return(await ue.post(Bl.DOWNLOAD(e),t||{})).data},async downloadBlob(e,t){return(await ue.get(Bl.DOWNLOAD(e),{params:t?{format:t}:void 0,responseType:"blob"})).data},async createFromConnectorSimple(e){const t=new FormData;return t.append("connector_id",e.connector_id),t.append("table_name",e.table_name),t.append("name",e.name),e.schema_name&&t.append("schema_name",e.schema_name),e.description&&t.append("description",e.description),e.visibility&&t.append("visibility",e.visibility),e.row_limit&&t.append("row_limit",e.row_limit.toString()),(await Xs.post(Gd.SIMPLE,t,{headers:{"Content-Type":"multipart/form-data"}})).data},async createFromConnectorVisual(e){return(await Xs.post(Gd.VISUAL,e)).data},async previewVisualQuery(e){return(await ue.post(Gd.VISUAL_PREVIEW,e)).data},async createFromConnectorAdvanced(e){const t=new FormData;return t.append("connector_id",e.connector_id),t.append("name",e.name),t.append("sql_query",e.sql_query),e.description&&t.append("description",e.description),e.visibility&&t.append("visibility",e.visibility),(await Xs.post(Gd.ADVANCED,t,{headers:{"Content-Type":"multipart/form-data"}})).data},async generateAIQuery(e){const t=new FormData;return t.append("connector_id",e.connector_id),t.append("natural_language_query",e.natural_language_query),e.include_sample_data!==void 0&&t.append("include_sample_data",e.include_sample_data.toString()),e.max_tables!==void 0&&t.append("max_tables",e.max_tables.toString()),(await Jp.post(Gd.AI_GENERATE,t)).data},async createFromConnectorAI(e){const t=new FormData;return t.append("connector_id",e.connector_id),t.append("name",e.name),t.append("natural_language_query",e.natural_language_query),e.approved_sql&&t.append("approved_sql",e.approved_sql),e.description&&t.append("description",e.description),e.visibility&&t.append("visibility",e.visibility),(await Jp.post(Gd.AI_CREATE,t)).data},async updateSimpleDataset(e,t){const n=new FormData;return n.append("table_name",t.table_name),t.schema_name&&n.append("schema_name",t.schema_name),t.row_limit&&n.append("row_limit",t.row_limit.toString()),t.name&&n.append("name",t.name),t.description&&n.append("description",t.description),t.visibility&&n.append("visibility",t.visibility),(await Xs.put(jx.SIMPLE(e),n,{headers:{"Content-Type":"multipart/form-data"}})).data},async updateVisualDataset(e,t){return(await Xs.put(jx.VISUAL(e),t)).data},async updateAdvancedDataset(e,t){const n=new FormData;return n.append("sql_query",t.sql_query),t.name&&n.append("name",t.name),t.description&&n.append("description",t.description),t.visibility&&n.append("visibility",t.visibility),(await Xs.put(jx.ADVANCED(e),n,{headers:{"Content-Type":"multipart/form-data"}})).data},async updateAIAssistedDataset(e,t){const n=new FormData;return n.append("natural_language_query",t.natural_language_query),t.approved_sql&&n.append("approved_sql",t.approved_sql),t.name&&n.append("name",t.name),t.description&&n.append("description",t.description),t.visibility&&n.append("visibility",t.visibility),(await Jp.put(jx.AI(e),n)).data}};function Bme(){const e=ct();return Qe({mutationFn:({file:t,metadata:n,onProgress:r})=>Zr.upload(t,n,r),onSuccess:t=>{e.invalidateQueries({queryKey:re.dataSources.lists()}),e.setQueryData(re.dataSources.detail(t.id),t)}})}function p7(){const e=ct();return Qe({mutationFn:t=>Zr.delete(t),onSuccess:(t,n)=>{e.removeQueries({queryKey:re.dataSources.detail(n)}
786),e.invalidateQueries({queryKey:re.dataSources.lists()})}})}function zme(){return Qe({mutationFn:async({id:e,format:t,fileName:n})=>({blob:await Zr.downloadBlob(e,t),fileName:n||`data.${t||"csv"}`}),onSuccess:({blob:e,fileName:t})=>{const n=window.URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n)}})}const Ms={async list(e){return(await ue.get(Fr.LIST,{params:e})).data},async getById(e){return(await ue.get(Fr.BY_ID(e))).data},async create(e){return(await ue.post(Fr.CREATE,e)).data},async update(e,t){return(await ue.put(Fr.BY_ID(e),t)).data},async delete(e){await ue.delete(Fr.BY_ID(e))},async export(e,t){return(await ue.post(Fr.EXPORT(e),t)).data},async downloadExport(e,t){return(await ue.post(Fr.EXPORT(e),{format:t},{responseType:"blob"})).data},async getStats(){return(await ue.get(Fr.STATS)).data},async createSchedule(e,t){return(await ue.post(`${Fr.BY_ID(e)}/schedule`,t)).data},async getSchedule(e){try{return(await ue.get(`${Fr.BY_ID(e)}/schedule`)).data}catch{return null}},async updateSchedule(e,t){return(await ue.put(`${Fr.BY_ID(e)}/schedule`,t)).data},async deleteSchedule(e){await ue.delete(`${Fr.BY_ID(e)}/schedule`)},async publish(e){return this.update(e,{status:"published"})},async archive(e){return this.update(e,{status:"archived"})},async duplicate(e,t){const n=await this.getById(e);return this.create({name:t||`${n.name} (Copy)`,description:n.description,data_source_id:n.data_source_id,visibility:"PRIVATE",config:n.config})},async getCollaborators(e){return(await ue.get(Fr.COLLABORATORS(e))).data},async inviteCollaborator(e,t){return(await ue.post(Fr.COLLABORATORS(e),t)).data},async updateCollaborator(e,t,n){return(await ue.put(Fr.COLLABORATOR(e,t),n)).data},async removeCollaborator(e,t){return(await ue.delete(Fr.COLLABORATOR(e,t))).data}};function Ume(){const e=ct();return Qe({mutationFn:t=>Ms.create(t),onSuccess:()=>{e.invalidateQueries({queryKey:re.reports.all})}})}function Vme(){const e=ct();return Qe({mutationFn:({id:t,data:n})=>Ms.update(t,n),onSuccess:t=>{e.setQueryData(re.reports.detail(t.id),t),e.invalidateQueries({queryKey:re.reports.lists()})}})}function g7(){const e=ct();return Qe({mutationFn:t=>Ms.delete(t),onSuccess:(t,n)=>{e.removeQueries({queryKey:re.reports.detail(n)}),e.invalidateQueries({queryKey:re.reports.lists()})}})}function zk(){return Qe({mutationFn:({id:e,format:t})=>Ms.downloadExport(e,t),onSuccess:(e,{format:t})=>{const n=URL.createObjectURL(e),r=document.createElement("a");r.href=n,r.download=`report.${t}`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}})}function Wme(){const e=ct();return Qe({mutationFn:t=>Ms.archive(t),onSuccess:t=>{e.setQueryData(re.reports.detail(t.id),t),e.invalidateQueries({queryKey:re.reports.lists()})}})}function qme(){const e=ct();return Qe({mutationFn:({id:t,newName:n})=>Ms.duplicate(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:re.reports.all})}})}function Hme(e){const t=ct();return Qe({mutationFn:n=>Ms.inviteCollaborator(e,n),onSuccess:()=>{t.invalidateQueries({queryKey:re.reports.collaborators(e)})}})}function Kme(e){const t=ct();return Qe({mutationFn:({userId:n,data:r})=>Ms.updateCollaborator(e,n,r),onSuccess:()=>{t.invalidateQueries({queryKey:re.reports.collaborators(e)})}})}function Gme(e){const t=ct();return Qe({mutationFn:n=>Ms.removeCollaborator(e,n),onSuccess:()=>{t.invalidateQueries({queryKey:re.reports.collaborators(e)})}})}const y7={async create(e){return(await ue.post(Fs.CREATE,e)).data},async update(e,t){return(await ue.put(`${Fs.CREATE}/${e}`,t)).data},async delete(e){await ue.delete(`${Fs.CREATE}/${e}`)},async getTemplates(){return(await ue.get(Fs.TEMPLATES)).data},async getChartTypes(){return(await ue.get(Fs.CHART_TYPES)).data},async getSuggestions(e){return(await ue.get(Fs.SUGGESTIONS(e))).data},async getSmartSuggestions(e,t){return(await ue.get(Fs.SMART_SUGGESTIONS(e,t))).data},async generateSmartReport(e){return(await Xs.post(Fs.SMART_REPORT(e))).data},async render(e){return(await ue.post(Fs.RENDER,e)).data},async renderAsPng(e){return(await ue.post(Fs.RENDER,{...e,format:"png"},{responseType:"blob"})).data},async renderAsSvg(e){return(await ue.post(Fs.RENDER,{...e,format:"svg"})).data.svg||""}},v7={async chat(e){return(await ue.post(mu.CHAT,e)).data},async analyze(e){return(await ue.post(mu.ANALYZE,e)).data},async getSuggestions(e){return(await ue.get(mu.SUGGESTIONS,{params:{data_source_id:e}})).data.suggestions||[]},async getHistory(e){return(await ue.get(`${mu.CHAT}/history`,{params:e})).data},async getStatus(){return(await ue.get(mu.STATUS)).data},async getUsageHistory(e=30){return(await ue.get(mu.USAGE_HISTORY,{params:{days:e}})).data}},Uk={async list(e){return(await ue.get(xo.LIST,{params:e})).data},async getById(e){return(await ue.get(xo.BY_ID(e))).data},async create(e){return(await ue.post(xo.CREATE,e)).data},async update(e,t){return(await ue.put(xo.BY_ID(e),t)).data},async revoke(e){await ue.delete(xo.BY_ID(e))},async getStats(){return(await ue.get(xo.STATS)).data},async verifyToken(e){return(await ue.get(xo.VERIFY(e))).data},async verifyWithPassword(e,t){return(await ue.post(xo.VERIFY(e),t)).data}
786,async accessPublicResource(e){return(await ue.get(xo.PUBLIC(e))).data},async toggleActive(e,t){return this.update(e,{is_active:t})},async extendExpiration(e,t){return this.update(e,{expires_at:t})}};function Yme(){const e=ct();return Qe({mutationFn:t=>Uk.create(t),onSuccess:()=>{e.invalidateQueries({queryKey:re.shareLinks.all})}})}function Xme(){const e=ct();return Qe({mutationFn:t=>Uk.revoke(t),onSuccess:(t,n)=>{e.removeQueries({queryKey:re.shareLinks.detail(n)}),e.invalidateQueries({queryKey:re.shareLinks.lists()})}})}const xv={async getPlans(){const t=(await ue.get(Kd.PLANS)).data;return Array.isArray(t)?t:t.plans},async getCurrent(){return(await ue.get(Kd.CURRENT)).data},async createCheckout(e){return(await ue.post(Kd.CHECKOUT,e)).data},async getPortalUrl(){return(await ue.post(Kd.PORTAL,{return_url:`${window.location.origin}/dashboard/settings`})).data},async cancel(e){return(await ue.post(Kd.CANCEL,e)).data},async getUsage(){return(await ue.get(Kd.USAGE)).data},async redirectToCheckout(e,t){const{checkout_url:n}=await this.createCheckout({plan_id:e,interval:t,success_url:`${window.location.origin}/dashboard/subscription?success=true`,cancel_url:`${window.location.origin}/dashboard/subscription?cancelled=true`});window.location.href=n},async redirectToPortal(){const{portal_url:e}=await this.getPortalUrl();window.location.href=e}};function Qme(){return Qe({mutationFn:e=>xv.createCheckout(e),onSuccess:e=>{window.location.href=e.checkout_url}})}function x7(){return Qe({mutationFn:()=>xv.getPortalUrl(),onSuccess:e=>{window.location.href=e.portal_url}})}const co={async list(e){return(await ue.get(Mi.LIST,{params:e})).data},async getById(e){return(await ue.get(Mi.BY_ID(e))).data},async create(e){return(await ue.post(Mi.CREATE,e)).data},async update(e,t){return(await ue.put(Mi.UPDATE(e),t)).data},async delete(e){await ue.delete(Mi.DELETE(e))},async getTemplates(){return(await ue.get(Mi.TEMPLATES)).data},async addSheet(e,t){return(await ue.post(Mi.ADD_SHEET(e),t)).data},async updateSheet(e,t,n){return(await ue.put(Mi.UPDATE_SHEET(e,t),n)).data},async deleteSheet(e,t){await ue.delete(Mi.DELETE_SHEET(e,t))},async convertToDataset(e,t){return(await ue.post(Mi.CONVERT_TO_DATASET(e),t)).data}};function Jme(){const e=ct();return Qe({mutationFn:t=>co.create(t),onSuccess:()=>{e.invalidateQueries({queryKey:re.workbooks.all})}})}function Zme(){const e=ct();return Qe({mutationFn:({id:t,data:n})=>co.update(t,n),onSuccess:t=>{e.setQueryData(re.workbooks.detail(t.id),t),e.invalidateQueries({queryKey:re.workbooks.lists()})}})}function epe(){const e=ct();return Qe({mutationFn:t=>co.delete(t),onSuccess:(t,n)=>{e.removeQueries({queryKey:re.workbooks.detail(n)}),e.invalidateQueries({queryKey:re.workbooks.lists()})}})}function tpe(){const e=ct();return Qe({mutationFn:({workbookId:t,data:n})=>co.addSheet(t,n),onSuccess:(t,{workbookId:n})=>{e.invalidateQueries({queryKey:re.workbooks.detail(n)})}})}function npe(){const e=ct();return Qe({mutationFn:({workbookId:t,sheetId:n,data:r})=>co.updateSheet(t,n,r),onMutate:async({workbookId:t,sheetId:n,data:r})=>{await e.cancelQueries({queryKey:re.workbooks.detail(t)});const a=e.getQueryData(re.workbooks.detail(t));return e.setQueryData(re.workbooks.detail(t),i=>{var o;return i&&(console.log("=== Optimistic update ==="),console.log("Updating sheet:",n),console.log("New data:",r),{...i,sheets:(o=i.sheets)==null?void 0:o.map(l
786=>l.id===n?{...l,...r}:l)})}),{previousWorkbook:a}},onError:(t,{workbookId:n},r)=>{console.error("=== Sheet update failed, rolling back ===",t),r!=null&&r.previousWorkbook&&e.setQueryData(re.workbooks.detail(n),r.previousWorkbook),e.invalidateQueries({queryKey:re.workbooks.detail(n)})},onSuccess:(t,{workbookId:n,sheetId:r})=>{var a,i;console.log("=== Sheet update succeeded ==="),console.log("Response from server:",t),console.log("Saved celldata length:",(i=(a=t==null?void 0:t.data)==null?void 0:a.celldata)==null?void 0:i.length)}})}function rpe(){const e=ct();return Qe({mutationFn:({workbookId:t,sheetId:n})=>co.deleteSheet(t,n),onSuccess:(t,{workbookId:n})=>{e.invalidateQueries({queryKey:re.workbooks.detail(n)})}})}function b7(){const e=ct();return Qe({mutationFn:({workbookId:t,data:n})=>co.convertToDataset(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:re.dataSources.all})}})}const ape=()=>{const[e,t]=x.useState(""),[n,r]=x.useState(!1),a=Ime(),i=a.isPending,o=async l=>{l.preventDefault();try{await a.mutateAsync({email:e}),r(!0),se.success("Password reset link sent!")}catch{r(!0),se.success("If an account exists with this email, you'll receive a reset link.")}};return s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-hero p-4",children:s.jsx("div",{className:"w-full max-w-md",children:s.jsxs("div",{className:"bg-card rounded-lg shadow-xl p-8 space-y-6",children:[s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-12 w-12 rounded-lg bg-gradient-primary flex items-center justify-center",children:s.jsx(wt,{className:"h-7 w-7 text-white"})})}),s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Reset password"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:n?"Check your email for a reset link":"Enter your email to receive a password reset link"})]}),n?s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-20 w-20 rounded-full bg-success/10 flex items-center justify-center",children:s.jsx(KP,{className:"h-10 w-10 text-success"})})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["We've sent a password reset link to ",s.jsx("strong",{children:e})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Didn't receive the email? Check your spam folder or try again."})]}),s.jsx(U,{variant:"outline",className:"w-full",onClick:()=>r(!1),children:"Try another email"})]}):s.jsxs("form",{onSubmit:o,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"email",children:"Email address"}),s.jsx(Re,{id:"email",type:"email",placeholder:"Enter your email address",value:e,onChange:l=>t(l.target.value),required:!0})]}),s.jsx(U,{type:"submit",className:"w-full",disabled:i,children:i?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Sending link..."]}):"Send reset link"})]}),s.jsx("div",{className:"flex items-center justify-center",children:s.jsxs(vt,{to:"/auth/login",className:"flex items-center text-sm text-primary hover:underline",children:[s.jsx(Yr,{className:"mr-2 h-4 w-4"}),"Back to login"]})})]})})})},spe=()=>{const e=cn(),[t]=ov(),[n,r]=x.useState("loading"),a=t.get("token"),i=Lme();return x.useEffect(()=>{(async()=>{if(!a){r("error");return}try{await i.mutateAsync({token:a}),r("success"),se.success("Email verified successfully!"),setTimeout(()=>{e("/dashboard")},3e3)}catch{r("error"),se.error("Email verification failed. The link may be invalid or expired.")}})()},[a]),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-hero p-4",children:s.jsx("div",{className:"w-full max-w-md",children:s.jsxs("div",{className:"bg-card rounded-lg shadow-xl p-8 space-y-6",children:[s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-12 w-12 rounded-lg bg-gradient-primary flex items-center justify-center",children:s.jsx(wt,{className:"h-7 w-7 text-white"})})}),s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Email Verification"})]}),s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 space-y-4",children:[n==="loading"&&s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"h-16 w-16 text-primary animate-spin"}),s.jsx("p",{className:"text-center text-muted-foreground",children:"Verifying your email address..."})]}),n==="success"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-20 w-20 rounded-full bg-success/10 flex items-center justify-center",children:s.jsx(BB,{className:"h-12 w-12 text-success"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Email Verified!"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Your email has been successfully verified."}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Redirecting to dashboard in 3 seconds..."})]}),s.jsx(U,{onClick:()=>
786e("/dashboard"),className:"mt-4",children:"Go to Dashboard Now"})]}),n==="error"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"h-20 w-20 rounded-full bg-destructive/10 flex items-center justify-center",children:s.jsx(Ej,{className:"h-12 w-12 text-destructive"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Verification Failed"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"The verification link is invalid or has expired."}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Please request a new verification email."})]}),s.jsx(U,{variant:"outline",onClick:()=>e("/auth/login"),className:"mt-4",children:"Back to Login"})]})]})]})})})},ipe={oauth_not_configured:"Google sign-in is not available",oauth_exchange_failed:"Failed to sign in with Google. Please try again.",no_user_info:"Could not retrieve your Google account info",email_not_verified:"Your Google account email must be verified",account_deactivated:"Your account has been deactivated"},ope=()=>{const[e]=ov(),{loginWithGoogle:t}=lo(),n=cn(),r=x.useRef(!1);return x.useEffect(()=>{if(r.current)return;r.current=!0;const a=e.get("error");if(a){const l=ipe[a]||"Google sign-in failed";se.error(l),n("/auth/login",{replace:!0});return}const i=e.get("access_token"),o=e.get("refresh_token");if(!i){se.error("Invalid callback. Please try again."),n("/auth/login",{replace:!0});return}t(i,o||"").then(()=>se.success("Welcome!")).catch(()=>{se.error("Failed to complete sign-in"),n("/auth/login",{replace:!0})})},[e,t,n]),s.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-hero p-4",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-12 w-12 rounded-lg bg-gradient-primary flex items-center justify-center",children:s.jsx(wt,{className:"h-7 w-7 text-white"})})}),s.jsx(Te,{className:"h-8 w-8 animate-spin mx-auto text-primary"}),s.jsx("p",{className:"text-muted-foreground",children:"Signing in with Google..."})]})})};function lpe(){return Nk.useSyncExternalStore(cpe,()=>!0,()=>!1)}function cpe(){return()=>{}}var Vk="Avatar",[upe,Ynt]=kn(Vk),[dpe,w7]=upe(Vk),j7=x.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[a,i]=x.useState("idle");return s.jsx(dpe,{scope:n,imageLoadingStatus:a,onImageLoadingStatusChange:i,children:s.jsx(Pe.span,{...r,ref:t})})});j7.displayName=Vk;var N7="AvatarImage",S7=x.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:a=()=>{},...i}=e,o=w7(N7,n),l=fpe(r,i),c=In(u=>{a(u),o.onImageLoadingStatusChange(u)});return Fn(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?s.jsx(Pe.img,{...i,ref:t,src:r}):null});S7.displayName=N7;var C7="AvatarFallback",_7=x.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...a}=e,i=w7(C7,n),[o,l]=x.useState(r===void 0);return x.useEffect(()=>{if(r!==void 0){const c=window.setTimeout(()=>l(!0),r);return()=>window.clearTimeout(c)}},[r]),o&&i.imageLoadingStatus!=="loaded"?s.jsx(Pe.span,{...a,ref:t}):null});_7.displayName=C7;function j$(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function fpe(e,{referrerPolicy:t,crossOrigin:n}){const r=lpe(),a=x.useRef(null),i=r?(a.current||(a.current=new window.Image),a.current):null,[o,l]=x.useState(()=>j$(i,e));return Fn(()=>{l(j$(i,e))},[i,e]),Fn(()=>{const c=f=>()=>{l(f)};if(!i)return;const u=c("loaded"),d=c("error");return i.addEventListener("load",u),i.addEventListener("error",d),t&&(i.referrerPolicy=t),typeof n=="string"&&(i.crossOrigin=n),()=>{i.removeEventListener("load",u),i.removeEventListener("error",d)}},[i,n,t]),o}var E7=j7,A7=S7,P7=_7;const dd=x.forwardRef(({className:e,...t},n)=>s.jsx(E7,{ref:n,className:te("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));dd.displayName=E7.displayName;const a1=x.forwardRef(({className:e,...t},n)=>s.jsx(A7,{ref:n,className:te("aspect-square h-full w-full",e),...t}));a1.displayName=A7.displayName;const fd=x.forwardRef(({className:e,...t},n)=>s.jsx(P7,{ref:n,className:te("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));fd.displayName=P7.displayName;const hpe={async getStats(){return(await ue.get(Yde.STATS)).data}};function k7(){return Qt({queryKey:re.dashboard.stats(),queryFn:()=>hpe.getStats(),staleTime:30*1e3,placeholderData:e=>e})}const mpe=e=>{var n,r;const{t}=Cr();return[{name:t("nav.dashboard"),href:"/dashboard",icon:jre},{name:t("nav.datasets"),href:"/dashboard/datasets",icon:wt,badge:(n=e==null?void 0:e.total_datasets)==null?void 0:n.toString()},{name:t("nav.reports"),href:"/dashboard/reports",icon:di,badge:(r=e==null?void 0:e.total_reports)==null?void 0:r.toString()},{name:t("nav.aiAnalyst"),href:"/dashboard/ai-analyst",icon:Vu,badge:"NEW"},{name:t("nav.workbooks"),href:"/dashboard/workbooks",icon:xr},{name:t("nav.connectors"),href:"/dashboard/connectors",icon:HB},{name:t("nav.scheduledReports"),href:"/dashboard/scheduled-reports",icon:Zs},{name:t("nav.subscription"),href:"/dashboard/subscription",icon:Zo},{name:t("nav.usage"),href:"/dashboard/usage",icon:Xn},{name:t("nav.settings"),href:"/dashboard/settings",icon:QP}]},ppe=()=>[{name:"Admin Dashboard",href:"/dashboard/admin",icon:Uc},{name:"Users",href:"/dashboard/admin/users",icon:tl},{name:"AI Usage",href:"/dashboard/admin/ai-usage",icon:ai},{name:"Subscriptions",href:"/dashboard/admin/subscriptions",icon:Zo},{name:"Audit Logs",href:"/dashboard/admin/audit-logs",icon:Dg}],Mn=({children:e})=>{Cr();const t=oo(),n=cn(),{data:r}=k7(),a=mpe(r),i=ppe(),{user:o,logout:l}=lo(),{darkMode:c,toggleDarkMode:u}
786=XU(),[d,f]=x.useState(!1),h=(o==null?void 0:o.role)==="ADMIN",m=(o==null?void 0:o.full_name)||(o==null?void 0:o.username)||"User",p=m.split(" ").map(w=>w[0]).join("").toUpperCase().slice(0,2),g=(o==null?void 0:o.plan)||"free",y=()=>{const w=t.pathname.split("/").filter(Boolean);return w.map((b,j)=>({name:b.charAt(0).toUpperCase()+b.slice(1).replace(/-/g," "),href:"/"+w.slice(0,j+1).join("/"),current:j===w.length-1}))},v=async()=>{await l(),n("/auth/login")};return s.jsxs("div",{className:"min-h-screen bg-background",children:[d&&s.jsx("div",{className:"fixed inset-0 bg-black/50 z-40 lg:hidden",onClick:()=>f(!1)}),s.jsx("aside",{className:te("fixed inset-y-0 left-0 z-50 w-64 bg-card border-r border-border transform transition-transform duration-200 ease-in-out lg:translate-x-0",d?"translate-x-0":"-translate-x-full"),children:s.jsxs("div",{className:"flex flex-col h-full",children:[s.jsxs("div",{className:"flex items-center justify-between h-16 px-6 border-b border-border",children:[s.jsxs(vt,{to:"/dashboard",className:"flex items-center space-x-2",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-gradient-primary flex items-center justify-center",children:s.jsx(wt,{className:"h-5 w-5 text-white"})}),s.jsx("span",{className:"text-lg font-bold text-foreground",children:"Refraxion"})]}),s.jsx(U,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:()=>f(!1),children:s.jsx(ua,{className:"h-5 w-5"})})]}),s.jsxs("nav",{className:"flex-1 px-4 py-6 space-y-1 overflow-y-auto",children:[a.map(w=>{const b=t.pathname===w.href||t.pathname.startsWith(w.href+"/");return s.jsxs(vt,{to:w.href,className:te("flex items-center justify-between px-3 py-2 rounded-lg text-sm font-medium transition-colors",b?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:[s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(w.icon,{className:"h-5 w-5"}),s.jsx("span",{children:w.name})]}),w.badge&&s.jsx($e,{variant:b?"secondary":"outline",className:"text-xs",children:w.badge})]},w.name)}),h&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"mt-6 mb-2 px-3",children:s.jsx("p",{className:"text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:"Administration"})}),i.map(w=>{const b=t.pathname===w.href||t.pathname.startsWith(w.href+"/");return s.jsx(vt,{to:w.href,className:te("flex items-center justify-between px-3 py-2 rounded-lg text-sm font-medium transition-colors",b?"bg-primary text-primary-foreground":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:s.jsxs("div",{className:"flex items-center space-x-3",children:[s.jsx(w.icon,{className:"h-5 w-5"}),s.jsx("span",{children:w.name})]})},w.name)})]})]}),s.jsx("div",{className:"p-4 border-t border-border",children:s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsxs("button",{className:"flex items-center space-x-3 w-full px-3 py-2 rounded-lg hover:bg-accent transition-colors",children:[s.jsxs(dd,{className:"h-10 w-10",children:[s.jsx(a1,{src:o==null?void 0:o.avatar_url}),s.jsx(fd,{children:p})]}),s.jsxs("div",{className:"flex-1 text-left",children:[s.jsx("p",{className:"text-sm font-medium text-foreground truncate max-w-[140px]",children:m}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx($e,{variant:"secondary",className:"text-xs capitalize",children:g})})]})]})}),s.jsxs(Xr,{align:"end",className:"w-56",children:[s.jsx(n1,{children:"My Account"}),s.jsx(ha,{}),s.jsxs(Xe,{onClick:()=>n("/dashboard/settings"),children:[s.jsx(QP,{className:"mr-2 h-4 w-4"}),"Settings"]}),s.jsx(Xe,{onClick:u,children:c?s.jsxs(s.Fragment,{children:[s.jsx(Dre,{className:"mr-2 h-4 w-4"}),"Light Mode"]}):s.jsxs(s.Fragment,{children:[s.jsx(_re,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})}),s.jsx(ha,{}),s.jsxs(Xe,{onClick:v,children:[s.jsx(GB,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})})]})}),s.jsxs("div",{className:"lg:pl-64",children:[s.jsx("header",{className:"sticky top-0 z-30 bg-card border-b border-border",children:s.jsxs("div",{className:"flex items-center justify-between h-16 px-4 sm:px-6 lg:px-8",children:[s.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[s.jsx(U,{variant:"ghost",size:"icon",className:"lg:hidden",onClick:()=>f(!0),children:s.jsx(Sre,{className:"h-5 w-5"})}),s.jsx("nav",{className:"hidden sm:flex items-center space-x-2 text-sm",children:y().map((w,b)=>s.jsxs("div",{className:"flex items-center",children:[b>0&&s.jsx(si,{className:"h-4 w-4 mx-2 text-muted-foreground"}),s.jsx(vt,{to:w.href,className:te(w.current?"text-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:w.name})]},w.href))})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsxs("div",{className:"hidden md:block relative",children:[s.jsx(ii,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{type:"search",placeholder:"Search...",className:"pl-9 w-64"})]}),s.jsxs(U,{variant:"ghost",size:"icon",className:"relative",children:[s.jsx(LB,{className:"h-5 w-5"}),s.jsx("span",{className:"absolute top-1 right-1 h-2 w-2 rounded-full bg-destructive"})]}),s.jsx(s7,{}),g==="free"&&s.jsx(U,{variant:"default",size:"sm",className:"hidden sm:flex",onClick:()=>n("/dashboard/subscription"),children:"Upgrade to Pro"})]})]})}),s.jsx("main",{className:"p-4 sm:p-6 lg:p-8",children:e})]})]})};function s1(e){return Qt({queryKey:re.dataSources.list(e),queryFn:()=>Zr.list(e),staleTime:30*1e3,placeholderData:t=>t})}function gpe(e){return Qt({queryKey:re.dataSources.detail(e),queryFn:()=>Zr.getById(e),enabled:!!e,staleTime:5*60*1e3})}function Wk(e,t){return Qt({queryKey:re.dataSources.preview(e),queryFn:()=>Zr.getPreview(e,t),enabled:!!e,staleTime:5*60*1e3})}function O7(e){return Qt({queryKey:re.reports.list(e),queryFn:()=>Ms.list(e),staleTime:30*1e3,placeholderData:t=>t})}function T7(e){return Qt({queryKey:re.reports.detail(e),queryFn:()=>Ms.getById(e),enabled:!!e,staleTime:60*1e3})}function ype(e){return Qt({queryKey:re.reports.collaborators(e),queryFn:()=>Ms.getCollaborators(e),enabled:!!e,staleTime:30*1e3})}function vpe(e,t){return Qt({queryKey:re.visualizations.smartSuggestions(e),queryFn:()=>y7.getSmartSuggestions(e,t),enabled:!!e,staleTime:5*60*1e3,gcTime:10*60*1e3})}function xpe(){return Qe({mutationFn:e=>y7.generateSmartReport(e)})}function qk(){return Qt({queryKey:[...re.ai.all,"status"],queryFn:()=>v7.getStatus(),staleTime:30*1e3,refetchInterval:60*1e3})}function bpe(e=30){return Qt({queryKey:[...re.ai.all,"usage-history",e],queryFn:()=>v7.getUsageHistory(e),staleTime:60*1e3})}function M7(e){const{dataSourceId:t,onMessage:n,onError:r,onConnect:a,onDisconnect:i,autoConnect:o=!0}=e,[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,h]=x.useState([]),[m,p]=x.useState(null),g=x.useRef(null),y=x.useRef(null),v=x.useRef(0),w=5,b=()=>`msg_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,j=x.useCallback(P=>{h(k=>[...k,{...P,id:b(),timestamp:new Date}])},[]),N=x.useCallback(P=>{h(k=>{if(k.length===0)return k;const D=k.length-1;return[...k.slice(0,D),{...k[D],...P}]})},[]),S=x.useCallback(P=>{try{const k=JSON.parse(P.data);switch(n==null||n(k),k.type){case"connected":c(!0),p(null),v.current=0,j({role:"system",content:`Connected to AI Analyst for dataset: ${k.dataset_name}`});break;case"processing":d(!0),j({role:"assistant",content:"",isLoading:!0});break;case"response":d(!1),k.success&&k.answer?N({content:k.answer.text,answer:k.answer,isLoading:!1}):N({content:"Sorry, I couldn't process your request.",isLoading:!1,error:"Processing failed"});break;case"error":d(!1),p(k.message||"An error occurred"),N({content:k.message||"An error occurred",isLoading:!1,error:k.message});break;case"pong":break}}catch(k){console.error("Failed to parse WebSocket message:",k),p("Failed to parse message from server")}},[j,N,n]),C=x.useCallback(()=>{var D;if(((D=g.current)==null?void 0:D.readyState)===WebSocket.OPEN)return;g.current&&(g.current.close(),g.current=null);const P=Xa.getAccessToken();if(!P){p("Authentication required"),r==null||r(new Error("Authentication required"));return}const k=`${mu.WS(t)}?token=${P}`;try{const A=new WebSocket(k);A.onopen=()=>{console.log("WebSocket connected"),a==null||a()},A.onmessage=S,A.onerror=I=>{console.error("WebSocket error:",I),p("Connection error"),r==null||r(new Error("WebSocket connection error"))},A.onclose=I=>
786{if(console.log("WebSocket closed:",I.code,I.reason),c(!1),d(!1),i==null||i(),I.code!==1e3&&v.current<w){v.current++;const M=Math.min(1e3*Math.pow(2,v.current),3e4);console.log(`Reconnecting in ${M}ms (attempt ${v.current})`),y.current=setTimeout(C,M)}else I.code===1008&&p("Authentication failed. Please log in again.")},g.current=A}catch(A){console.error("Failed to create WebSocket:",A),p("Failed to connect"),r==null||r(A)}},[t,S,a,i,r]),_=x.useCallback(()=>{y.current&&(clearTimeout(y.current),y.current=null),v.current=w,g.current&&(g.current.close(1e3,"User disconnect"),g.current=null),c(!1),d(!1)},[]),E=x.useCallback(P=>{if(!g.current||g.current.readyState!==WebSocket.OPEN){p("Not connected");return}P.trim()&&(j({role:"user",content:P}),g.current.send(JSON.stringify({question:P})))},[j]),T=x.useCallback(()=>{h([])},[]);return x.useEffect(()=>(o&&t&&C(),()=>{_()}),[o,t,C,_]),x.useEffect(()=>{if(!l)return;const P=setInterval(()=>{var k;((k=g.current)==null?void 0:k.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(P)},[l]),{isConnected:l,isProcessing:u,messages:f,error:m,connect:C,disconnect:_,sendQuestion:E,clearMessages:T}}function wpe(e){return Qt({queryKey:re.shareLinks.list(e),queryFn:()=>Uk.list(e),staleTime:30*1e3,placeholderData:t=>t})}function jpe(){return Qt({queryKey:re.subscriptions.plans(),queryFn:()=>xv.getPlans(),staleTime:30*60*1e3})}function Npe(){return Qt({queryKey:re.subscriptions.current(),queryFn:()=>xv.getCurrent(),staleTime:60*1e3,retry:1})}function R7(){return Qt({queryKey:re.subscriptions.usage(),queryFn:()=>xv.getUsage(),staleTime:5*60*1e3,refetchInterval:10*60*1e3})}const uo={async list(e){return(await ue.get(Hn.LIST,{params:e})).data},async getById(e){return(await ue.get(Hn.BY_ID(e))).data},async getWithTables(e){return(await ue.get(Hn.WITH_TABLES(e))).data},async create(e){return(await ue.post(Hn.CREATE,e)).data},async update(e,t){return(await ue.put(Hn.BY_ID(e),t)).data},async delete(e){await ue.delete(Hn.BY_ID(e))},async testConnection(e){return(await ue.post(Hn.TEST,e)).data},async testExisting(e){return(await ue.post(Hn.TEST_EXISTING(e))).data},async listTables(e){return(await ue.get(Hn.TABLES(e))).data},async getTablePreview(e,t,n){return(await ue.get(Hn.TABLE_PREVIEW(e,t),{params:n})).data},async introspect(e){return(await Xs.post(Hn.INTROSPECT(e))).data},async syncConnector(e){return(await Xs.post(Hn.SYNC(e))).data},async createDataSourceFromConnector(e){return(await ue.post(c$.FROM_CONNECTOR,e)).data},async syncDataSource(e){return(await ue.post(c$.SYNC(e))).data},async getSchema(e){return(await ue.get(Hn.SCHEMA(e))).data},async executeAIQuery(e,t){return(await ue.post(Hn.AI_QUERY(e),t)).data},async getQueryHistory(e,t){return(await ue.get(Hn.AI_HISTORY(e),{params:t})).data},async updateQueryHistory(e,t,n){return(await ue.patch(Hn.AI_HISTORY_UPDATE(e,t),n)).data},async saveQuery(e,t){return(await ue.post(Hn.SAVED_QUERIES(e),t)).data},async getSavedQueries(e){return(await ue.get(Hn.SAVED_QUERIES(e))).data},async deleteSavedQuery(e,t){await ue.delete(Hn.SAVED_QUERY_BY_ID(e,t))},async executeSavedQuery(e,t,n){return(await ue.post(Hn.SAVED_QUERY_EXECUTE(e,t),void 0,{params:{max_rows:n}})).data}};function _m(e){return Qt({queryKey:re.connectors.list(e),queryFn:()=>uo.list(e),staleTime:30*1e3})}function Hk(e){return Qt({queryKey:re.connectors.tables(e),queryFn:()=>uo.listTables(e),enabled:!!e,staleTime:5*60*1e3})}function Spe(){const e=ct();return Qe({mutationFn:t=>uo.create(t),onSuccess:t=>{e.invalidateQueries({queryKey:re.connectors.lists()}),e.setQueryData(re.connectors.detail(t.id),t)}})}function Cpe(){const e=ct();return Qe({mutationFn:({id:t,data:n})=>uo.update(t,n),onSuccess:(t,{id:n})=>{e.setQueryData(re.connectors.detail(n),t),e.invalidateQueries({queryKey:re.connectors.lists()})}})}function _pe(){const e=ct();return Qe({mutationFn:t=>uo.delete(t),onSuccess:(t,n)=>{e.removeQueries({queryKey:re.connectors.detail(n)}),e.invalidateQueries({queryKey:re.connectors.lists()})}})}function Epe(){return Qe({mutationFn:e=>uo.testConnection(e)})}function Ape(){const e=ct();return Qe({mutationFn:t=>uo.testExisting(t),onSuccess:(t,n)=>
786{e.invalidateQueries({queryKey:re.connectors.detail(n)}),e.invalidateQueries({queryKey:re.connectors.lists()})}})}function D7(){const e=ct();return Qe({mutationFn:t=>uo.introspect(t),onSuccess:(t,n)=>{e.setQueryData(re.connectors.tables(n),t),e.invalidateQueries({queryKey:re.connectors.lists()}),e.invalidateQueries({queryKey:re.connectors.withTables(n)})}})}function Ppe(){const e=ct();return Qe({mutationFn:t=>uo.syncConnector(t),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:re.connectors.detail(n)}),e.invalidateQueries({queryKey:re.connectors.lists()}),e.invalidateQueries({queryKey:re.connectors.tables(n)}),e.invalidateQueries({queryKey:re.connectors.withTables(n)})}})}function kpe(){const e=ct();return Qe({mutationFn:t=>uo.createDataSourceFromConnector(t),onSuccess:t=>{e.invalidateQueries({queryKey:re.dataSources.lists()}),e.setQueryData(re.dataSources.detail(t.id),t)}})}function Ope(){const e=ct();return Qe({mutationFn:t=>Zr.createFromConnectorSimple(t),onSuccess:()=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dashboard.stats()})}})}function Tpe(){const e=ct();return Qe({mutationFn:t=>Zr.createFromConnectorVisual(t),onSuccess:()=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dashboard.stats()})}})}function $7(){return Qe({mutationFn:e=>Zr.previewVisualQuery(e)})}function Mpe(){const e=ct();return Qe({mutationFn:t=>Zr.createFromConnectorAdvanced(t),onSuccess:()=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dashboard.stats()})}})}function Rpe(){return Qe({mutationFn:e=>Zr.generateAIQuery(e)})}function Dpe(){const e=ct();return Qe({mutationFn:t=>Zr.createFromConnectorAI(t),onSuccess:()=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dashboard.stats()})}})}function $pe(){const e=ct();return Qe({mutationFn:({id:t,data:n})=>Zr.updateSimpleDataset(t,n),onSuccess:t=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dataSources.detail(t.dataset_id)})}})}function Ipe(){const e=ct();return Qe({mutationFn:({id:t,data:n})=>Zr.updateVisualDataset(t,n),onSuccess:t=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dataSources.detail(t.dataset_id)})}})}function Lpe(){const e=ct();return Qe({mutationFn:({id:t,data:n})=>Zr.updateAdvancedDataset(t,n),onSuccess:t=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dataSources.detail(t.dataset_id)})}})}function Fpe(){const e=ct();return Qe({mutationFn:({id:t,data:n})=>Zr.updateAIAssistedDataset(t,n),onSuccess:t=>{e.invalidateQueries({queryKey:re.dataSources.all}),e.invalidateQueries({queryKey:re.dataSources.detail(t.dataset_id)})}})}function I7(e){return Qt({queryKey:re.workbooks.list(e),queryFn:()=>co.list(e),staleTime:30*1e3,placeholderData:t=>t})}function Bpe(e){return Qt({queryKey:re.workbooks.detail(e),queryFn:()=>co.getById(e),enabled:!!e,staleTime:5*1e3,refetchOnMount:"always",refetchOnWindowFocus:!1})}function zpe(){return Qt({queryKey:re.workbooks.templates(),queryFn:()=>co.getTemplates(),staleTime:5*60*1e3})}const Upe=e=>{const t=new Date(e),r=new Date().getTime()-t.getTime(),a=Math.floor(r/(1e3*60)),i=Math.floor(r/(1e3*60*60)),o=Math.floor(r/(1e3*60*60*24));return a<1?"Just now":a<60?`${a} minute${a>1?"s":""} ago`:i<24?`${i} hour${i>1?"s":""} ago`:o<7?`${o} day${o>1?"s":""} ago`:o<30?`${Math.floor(o/7)} week${Math.floor(o/7)>1?"s":""} ago`:t.toLocaleDateString()},Vpe=()=>{const e=cn(),{user:t}=lo(),{data:n,isLoading:r}=k7(),a=x.useMemo(()=>{var c,u,d,f;const l=n;return[{title:"Total Datasets",value:((c=l==null?void 0:l.total_datasets)==null?void 0:c.toString())||"0",description:l!=null&&l.datasets_this_week&&l.datasets_this_week>0?`${l.datasets_this_week} uploaded this week`:"No uploads this week",icon:wt,color:"text-blue-600"},{title:"Active Reports",value:((u=l==null?void 0:l.total_reports)==null?void 0:u.toString())||"0",description:l!=null&&l.public_reports&&l.public_reports>0?`${l.public_reports} shared publicly`:"No public reports",icon:di,color:"text-green-600"},{title:"AI Insights",value:((d=l==null?void 0:l.total_visualizations)==null?void 0:d.toString())||"0",description:l!=null&&l.visualizations_this_month&&l.visualizations_this_month>0?`${l.visualizations_this_month} generated this month`:"Total visualizations",icon:Xn,color:"text-purple-600"},{title:"Total Views",value:((f=l==null?void 0:l.total_views)==null?void 0:f.toString())||"0",description:"View tracking coming soon",icon:Wa,color:"text-orange-600"}]},[n]),i=x.useMemo(()=>(n==null?void 0:n.recent_activity)||[],[n]),o=x.useMemo(()=>t!=null&&t.full_name?t.full_name.split(" ")[0]:(t==null?void 0:t.username)||"there",[t]);return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-bold text-foreground mb-2",children:["Welcome back, ",o," 👋"]}),s.jsx("p",{className:"text-muted-foreground",children:"Here's what's happening with your data today."})]}),s.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:a.map(l
vendor: 4,351 bytes, line 786
786=>s.jsxs(Z,{className:"hover:shadow-lg transition-shadow",children:[s.jsxs(we,{className:"flex flex-row items-center justify-between pb-2",children:[s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:l.title}),s.jsx(l.icon,{className:`h-5 w-5 ${l.color}`})]}),s.jsx(le,{children:r?s.jsx(Te,{className:"h-6 w-6 animate-spin text-muted-foreground"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"text-3xl font-bold text-foreground",children:l.value}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:l.description})]})})]},l.title))}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Quick Actions"}),s.jsx(it,{children:"Get started with common tasks"})]}),s.jsx(le,{children:s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs(U,{variant:"outline",className:"h-auto py-4 flex flex-col items-start space-y-2",onClick:()=>e("/dashboard/datasets"),children:[s.jsx(wt,{className:"h-5 w-5 text-primary"}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-semibold",children:"Upload Dataset"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Add new data to analyze"})]})]}),s.jsxs(U,{variant:"outline",className:"h-auto py-4 flex flex-col items-start space-y-2",onClick:()=>e("/dashboard/reports"),children:[s.jsx(di,{className:"h-5 w-5 text-primary"}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-semibold",children:"Create Report"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Build a new visualization"})]})]}),s.jsxs(U,{variant:"outline",className:"h-auto py-4 flex flex-col items-start space-y-2",onClick:()=>e("/dashboard/ai-analyst"),children:[s.jsx(Xn,{className:"h-5 w-5 text-primary"}),s.jsxs("div",{className:"text-left",children:[s.jsx("div",{className:"font-semibold",children:"Ask AI"}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Get insights from your data"})]})]})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Recent Activity"}),s.jsx(it,{children:"Your latest actions and updates"})]}),s.jsx(le,{children:r?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):i.length>0?s.jsx("div",{className:"space-y-4",children:i.map(l=>s.jsxs("div",{className:"flex items-center justify-between py-3 border-b border-border last:border-0",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("p",{className:"text-sm font-medium text-foreground",children:l.title}),s.jsx("p",{className:"text-xs text-muted-foreground",children:l.description})]}),s.jsx("span",{className:"text-xs text-muted-foreground",children:Upe(l.created_at)})]},l.id))}):s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx("p",{children:"No recent activity"}),s.jsx("p",{className:"text-xs mt-1",children:"Upload a dataset or create a report to get started"})]})})]})]})};var i1="Dialog",[L7,F7]=kn(i1),[Wpe,wi]=L7(i1),B7=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,l=x.useRef(null),c=x.useRef(null),[u,d]=fr({prop:r,defaultProp:a??!1,onChange:i,caller:i1});return s.jsx(Wpe,{scope:t,triggerRef:l,contentRef:c,contentId:Ia(),titleId:Ia(),descriptionId:Ia(),open:u,onOpenChange:d,onOpenToggle:x.useCallback(()=>d(f=>!f),[d]),modal:o,children:n})};B7.displayName=i1;var z7="DialogTrigger",U7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wi(z7,n),i=qe(t,a.triggerRef);return s.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Yk(a.open),...r,ref:i,onClick:je(e.onClick,a.onOpenToggle)})});U7.displayName=z7;var Kk="DialogPortal",[qpe,V7]=L7(Kk,{forceMount:void 0}),W7=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,i=wi(Kk,t);return s.jsx(qpe,{scope:t,forceMount:n,children:x.Children.map(r,o=>s.jsx(Jn,{present:n||i.open,children:s.jsx(pm,{asChild:!0,container:a,children:o})}))})};W7.displayName=Kk;var x0="DialogOverlay",q7=x.forwardRef((e,t)=>{const n=V7(x0,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=wi(x0,e.__scopeDialog);return i.modal?s.jsx(Jn,{present:r||i.open,children:s.jsx(Kpe,{...a,ref:t})}):null});q7.displayName=x0;var Hpe=Rc("DialogOverlay.RemoveScroll"),Kpe=x.forwardRef((e,t)=>
vendor: 4,655 bytes, lines 786-790
786{const{__scopeDialog:n,...r}=e,a=wi(x0,n);return s.jsx(pv,{as:Hpe,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(Pe.div,{"data-state":Yk(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),hd="DialogContent",H7=x.forwardRef((e,t)=>{const n=V7(hd,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,i=wi(hd,e.__scopeDialog);return s.jsx(Jn,{present:r||i.open,children:i.modal?s.jsx(Gpe,{...a,ref:t}):s.jsx(Ype,{...a,ref:t})})});H7.displayName=hd;var Gpe=x.forwardRef((e,t)=>{const n=wi(hd,e.__scopeDialog),r=x.useRef(null),a=qe(t,n.contentRef,r);return x.useEffect(()=>{const i=r.current;if(i)return Qj(i)},[]),s.jsx(K7,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=n.triggerRef.current)==null||o.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:je(e.onFocusOutside,i=>i.preventDefault())})}),Ype=x.forwardRef((e,t)=>{const n=wi(hd,e.__scopeDialog),r=x.useRef(!1),a=x.useRef(!1);return s.jsx(K7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),K7=x.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,l=wi(hd,n),c=x.useRef(null),u=qe(t,c);return Gj(),s.jsxs(s.Fragment,{children:[s.jsx(hv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Pd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Yk(l.open),...o,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(Qpe,{titleId:l.titleId}),s.jsx(Zpe,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Gk="DialogTitle",G7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wi(Gk,n);return s.jsx(Pe.h2,{id:a.titleId,...r,ref:t})});G7.displayName=Gk;var Y7="DialogDescription",X7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wi(Y7,n);return s.jsx(Pe.p,{id:a.descriptionId,...r,ref:t})});X7.displayName=Y7;var Q7="DialogClose",J7=x.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wi(Q7,n);return s.jsx(Pe.button,{type:"button",...r,ref:t,onClick:je(e.onClick,()=>a.onOpenChange(!1))})});J7.displayName=Q7;function Yk(e){return e?"open":"closed"}var Z7="DialogTitleWarning",[Xpe,eW]=gne(Z7,{contentName:hd,titleName:Gk,docsSlug:"dialog"}),Qpe=({titleId:e})=>{const t=eW(Z7),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
787
788If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
789
790For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return x.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Jpe="DialogDescriptionWarning",Zpe=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${eW(Jpe).contentName}}.`;return x.useEffect(()=>{var i;const a=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Xk=B7,Qk=U7,Jk=W7,bv=q7,wv=H7,jv=G7,Nv=X7,o1=J7;const br=Xk,l1=Qk,ege=Jk,tW=x.forwardRef(({className:e,...t},n)=>s.jsx(bv,{ref:n,className:te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));tW.displayName=bv.displayName;const or=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(ege,{children:[s.jsx(tW,{}),s.jsxs(wv,{ref:r,className:te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
790nded-lg",e),...n,children:[t,s.jsxs(o1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(ua,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));or.displayName=wv.displayName;const lr=({className:e,...t})=>s.jsx("div",{className:te("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});lr.displayName="DialogHeader";const _a=({className:e,...t})=>s.jsx("div",{className:te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});_a.displayName="DialogFooter";const cr=x.forwardRef(({className:e,...t},n)=>s.jsx(jv,{ref:n,className:te("text-lg font-semibold leading-none tracking-tight",e),...t}));cr.displayName=jv.displayName;const wr=x.forwardRef(({className:e,...t},n)=>s.jsx(Nv,{ref:n,className:te("text-sm text-muted-foreground",e),...t}));wr.displayName=Nv.displayName;var c1="Tabs",[tge,Xnt]=kn(c1,[qc]),nW=qc(),[nge,Zk]=tge(c1),rW=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=wl(l),[f,h]=fr({prop:r,onChange:a,defaultProp:i??"",caller:c1});return s.jsx(nge,{scope:n,baseId:Ia(),value:f,onValueChange:h,orientation:o,dir:d,activationMode:c,children:s.jsx(Pe.div,{dir:d,"data-orientation":o,...u,ref:t})})});rW.displayName=c1;var aW="TabsList",sW=x.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,i=Zk(aW,n),o=nW(n);return s.jsx(Yj,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:r,children:s.jsx(Pe.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:t})})});sW.displayName=aW;var iW="TabsTrigger",oW=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...i}=e,o=Zk(iW,n),l=nW(n),c=uW(o.baseId,r),u=dW(o.baseId,r),d=r===o.value;return s.jsx(Xj,{asChild:!0,...l,focusable:!a,active:d,children:s.jsx(Pe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:c,...i,ref:t,onMouseDown:je(e.onMouseDown,f=>{!a&&f.button===0&&f.ctrlKey===!1?o.onValueChange(r):f.preventDefault()}),onKeyDown:je(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&o.onValueChange(r)}),onFocus:je(e.onFocus,()=>{const f=o.activationMode!=="manual";!d&&!a&&f&&o.onValueChange(r)})})})});oW.displayName=iW;var lW="TabsContent",cW=x.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:i,...o}=e,l=Zk(lW,n),c=uW(l.baseId,r),u=dW(l.baseId,r),d=r===l.value,f=x.useRef(d);return x.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),s.jsx(Jn,{present:a||d,children:({present:h})=>s.jsx(Pe.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:u,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&i})})});cW.displayName=lW;function uW(e,t){return`${e}-trigger-${t}`}function dW(e,t){return`${e}-content-${t}`}var rge=rW,fW=sW,hW=oW,mW=cW;const fo=rge,ji=x.forwardRef(({className:e,...t},n)=>s.jsx(fW,{ref:n,className:te("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));
vendor: 4,485 bytes, lines 790-796
790ji.displayName=fW.displayName;const Rt=x.forwardRef(({className:e,...t},n)=>s.jsx(hW,{ref:n,className:te("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",e),...t}));Rt.displayName=hW.displayName;const Ft=x.forwardRef(({className:e,...t},n)=>s.jsx(mW,{ref:n,className:te("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Ft.displayName=mW.displayName;var pW="AlertDialog",[age,Qnt]=kn(pW,[F7]),jl=F7(),gW=e=>{const{__scopeAlertDialog:t,...n}=e,r=jl(t);return s.jsx(Xk,{...r,...n,modal:!0})};gW.displayName=pW;var sge="AlertDialogTrigger",yW=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=jl(n);return s.jsx(Qk,{...a,...r,ref:t})});yW.displayName=sge;var ige="AlertDialogPortal",vW=e=>{const{__scopeAlertDialog:t,...n}=e,r=jl(t);return s.jsx(Jk,{...r,...n})};vW.displayName=ige;var oge="AlertDialogOverlay",xW=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=jl(n);return s.jsx(bv,{...a,...r,ref:t})});xW.displayName=oge;var Lf="AlertDialogContent",[lge,cge]=age(Lf),uge=fB("AlertDialogContent"),bW=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,i=jl(n),o=x.useRef(null),l=qe(t,o),c=x.useRef(null);return s.jsx(Xpe,{contentName:Lf,titleName:wW,docsSlug:"alert-dialog",children:s.jsx(lge,{scope:n,cancelRef:c,children:s.jsxs(wv,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:je(a.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=c.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[s.jsx(uge,{children:r}),s.jsx(fge,{contentRef:o})]})})})});bW.displayName=Lf;var wW="AlertDialogTitle",jW=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=jl(n);return s.jsx(jv,{...a,...r,ref:t})});jW.displayName=wW;var NW="AlertDialogDescription",SW=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=jl(n);return s.jsx(Nv,{...a,...r,ref:t})});SW.displayName=NW;var dge="AlertDialogAction",CW=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=jl(n);return s.jsx(o1,{...a,...r,ref:t})});CW.displayName=dge;var _W="AlertDialogCancel",EW=x.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=cge(_W,n),i=jl(n),o=qe(t,a);return s.jsx(o1,{...i,...r,ref:o})});EW.displayName=_W;var fge=({contentRef:e})=>{const t=`\`${Lf}\` requires a description for the component to be accessible for screen reader users.
791
792You can add a description to the \`${Lf}\` by passing a \`${NW}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
793
794Alternatively, 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 \`${Lf}\`. 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.
795
796For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return x.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},hge=gW,mge=yW,pge=vW,AW=xW,PW=bW,kW=CW,OW=EW,TW=jW,MW=SW;const Ic=hge,b0=mge,gge=pge,RW=x.forwardRef(({className:e,...t},n)=>s.jsx(AW,{className:te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));RW.displayName=AW.displayName;const al=x.forwardRef(({className:e,...t},n)=>s.jsxs(gge,{children:[s.jsx(RW,{}),s.jsx(PW,{ref:n,className:te("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rou
796nded-lg",e),...t})]}));al.displayName=PW.displayName;const sl=({className:e,...t})=>s.jsx("div",{className:te("flex flex-col space-y-2 text-center sm:text-left",e),...t});sl.displayName="AlertDialogHeader";const il=({className:e,...t})=>s.jsx("div",{className:te("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});il.displayName="AlertDialogFooter";const ol=x.forwardRef(({className:e,...t},n)=>s.jsx(TW,{ref:n,className:te("text-lg font-semibold",e),...t}));ol.displayName=TW.displayName;const ll=x.forwardRef(({className:e,...t},n)=>s.jsx(MW,{ref:n,className:te("text-sm text-muted-foreground",e),...t}));ll.displayName=MW.displayName;const cl=x.forwardRef(({className:e,...t},n)=>s.jsx(kW,{ref:n,className:te(Vg(),e),...t}));cl.displayName=kW.displayName;const ul=x.forwardRef(({className:e,...t},n)=>s.jsx(OW,{ref:n,className:te(Vg({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));ul.displayName=OW.displayName;var eO="Progress",tO=100,[yge,Jnt]=kn(eO),[vge,xge]=yge(eO),DW=x.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:a,getValueLabel:i=bge,...o}=e;(a||a===0)&&!N$(a)&&console.error(wge(`${a}`,"Progress"));const l=N$(a)?a:tO;r!==null&&!S$(r,l)&&console.error(jge(`${r}`,"Progress"));const c=S$(r,l)?r:null,u=w0(c)?i(c,l):void 0;return s.jsx(vge,{scope:n,value:c,max:l,children:s.jsx(Pe.div,{"aria-valuemax":l,"aria-valuemin":0,"aria-valuenow":w0(c)?c:void 0,"aria-valuetext":u,role:"progressbar","data-state":LW(c,l),"data-value":c??void 0,"data-max":l,...o,ref:t})})});DW.displayName=eO;var $W="ProgressIndicator",IW=x.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,a=xge($W,n);return s.jsx(Pe.div,{"data-state":LW(a.value,a.max),"data-value":a.value??void 0,"data-max":a.max,...r,ref:t})});IW.displayName=$W;function bge(e,t){return`${Math.round(e/t*100)}%`}function LW(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function w0(e){return typeof e=="number"}function N$(e){return w0(e)&&!isNaN(e)&&e>0}function S$(e,t){return w0(e)&&!isNaN(e)&&e<=t&&e>=0}function wge(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${tO}\`.`}function jge(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
797  - a positive number
798  - less than the value passed to \`max\` (or ${tO} if no \`max\` prop is set)
799  - \`null\` or \`undefined\` if the progress is indeterminate.
800
801Defaulting to \`null\`.`}var FW=DW,Nge=IW;const _u=x.forwardRef(({className:e,value:t,...n},r)=>s.jsx(FW,{ref:r,className:te("relative h-4 w-full overflow-hidden rounded-full bg-secondary",e),...n,children:s.jsx(Nge,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));_u.displayName=FW.displayName;var u1="Collapsible",[Sge,BW]=kn(u1),[Cge,nO]=Sge(u1),zW=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:i,onOpenChange:o,...l}=e,[c,u]=fr({prop:r,defaultProp:a??!1,onChange:o,caller:u1});return s.jsx(Cge,{scope:n,disabled:i,contentId:Ia(),open:c,onOpenToggle:x.useCallback(()=>u(d=>!d),[u]),children:s.jsx(Pe.div,{"data-state":iO(c),"data-disabled":i?"":void 0,...l,ref:t})})});zW.displayName=u1;var UW="CollapsibleTrigger",rO=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=nO(UW,n);return s.jsx(Pe.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":iO(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:je(e.onClick,a.onOpenToggle)})});rO.displayName=UW;var aO="CollapsibleContent",sO=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=nO(aO,e.__scopeCollapsible);return s.jsx(Jn,{present:n||a.open,children:({present:i})=>s.jsx(_ge,{...r,ref:t,present:i})})});sO.displayName=aO;var _ge=x.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...i}=e,o=nO(aO,n),[l,c]=x.useState(r),u=x.useRef(null),d=qe(t,u),f=x.useRef(0),h=f.current,m=x.useRef(0),p=m.current,g=o.open||l,y=x.useRef(g),v=x.useRef(void 0);return x.useEffect(()=>{const w=requestAnimationFrame(()=>y.current=!1);return()=>cancelAnimationFrame(w)},[]),Fn(()=>{const w=u.current;if(w){v.current=v.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const b=w.getBoundingClientRect();f.current=b.height,m.current=b.width,y.current||(w.style.transitionDuration=v.current.transitionDuration,w.style.animationName=v.current.animationName),c(r)}},[o.open,r]),s.jsx(Pe.div,{"data-state":iO(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!g,...i,ref:d,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style},children:g&&a})});function iO(e){return e?"open":"closed"}var VW=zW,Ege=rO,Age=sO,Ni="Accordion",Pge=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[oO,kge,Oge]=mm(Ni),[d1,Znt]=kn(Ni,[Oge,BW]),lO=BW(),WW=L.forwardRef((e,t)=>
801{const{type:n,...r}=e,a=r,i=r;return s.jsx(oO.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?s.jsx(Dge,{...i,ref:t}):s.jsx(Rge,{...a,ref:t})})});WW.displayName=Ni;var[qW,Tge]=d1(Ni),[HW,Mge]=d1(Ni,{collapsible:!1}),Rge=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},collapsible:i=!1,...o}=e,[l,c]=fr({prop:n,defaultProp:r??"",onChange:a,caller:Ni});return s.jsx(qW,{scope:e.__scopeAccordion,value:L.useMemo(()=>l?[l]:[],[l]),onItemOpen:c,onItemClose:L.useCallback(()=>i&&c(""),[i,c]),children:s.jsx(HW,{scope:e.__scopeAccordion,collapsible:i,children:s.jsx(KW,{...o,ref:t})})})}),Dge=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...i}=e,[o,l]=fr({prop:n,defaultProp:r??[],onChange:a,caller:Ni}),c=L.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=L.useCallback(d=>l((f=[])=>f.filter(h=>h!==d)),[l]);return s.jsx(qW,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:u,children:s.jsx(HW,{scope:e.__scopeAccordion,collapsible:!0,children:s.jsx(KW,{...i,ref:t})})})}),[$ge,f1]=d1(Ni),KW=L.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:r,dir:a,orientation:i="vertical",...o}=e,l=L.useRef(null),c=qe(l,t),u=kge(n),f=wl(a)==="ltr",h=je(e.onKeyDown,m=>{var _;if(!Pge.includes(m.key))return;const p=m.target,g=u().filter(E=>{var T;return!((T=E.ref.current)!=null&&T.disabled)}),y=g.findIndex(E=>E.ref.current===p),v=g.length;if(y===-1)return;m.preventDefault();let w=y;const b=0,j=v-1,N=()=>{w=y+1,w>j&&(w=b)},S=()=>{w=y-1,w<b&&(w=j)};switch(m.key){case"Home":w=b;break;case"End":w=j;break;case"ArrowRight":i==="horizontal"&&(f?N():S());break;case"ArrowDown":i==="vertical"&&N();break;case"ArrowLeft":i==="horizontal"&&(f?S():N());break;case"ArrowUp":i==="vertical"&&S();break}const C=w%v;(_=g[C].ref.current)==null||_.focus()});return s.jsx($ge,{scope:n,disabled:r,direction:a,orientation:i,children:s.jsx(oO.Slot,{scope:n,children:s.jsx(Pe.div,{...o,"data-orientation":i,ref:c,onKeyDown:r?void 0:h})})})}),j0="AccordionItem",[Ige,cO]=d1(j0),GW=L.forwardRef((e,t)=>{const{__scopeAccordion:n,value:r,...a}=e,i=f1(j0,n),o=Tge(j0,n),l=lO(n),c=Ia(),u=r&&o.value.includes(r)||!1,d=i.disabled||e.disabled;return s.jsx(Ige,{scope:n,open:u,disabled:d,triggerId:c,children:s.jsx(VW,{"data-orientation":i.orientation,"data-state":e9(u),...l,...a,ref:t,disabled:d,open:u,onOpenChange:f=>{f?o.onItemOpen(r):o.onItemClose(r)}})})});GW.displayName=j0;var YW="AccordionHeader",XW=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=f1(Ni,n),i=cO(YW,n);return s.jsx(Pe.h3,{"data-orientation":a.orientation,"data-state":e9(i.open),"data-disabled":i.disabled?"":void 0,...r,ref:t})});XW.displayName=YW;var O2="AccordionTrigger",QW=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=f1(Ni,n),i=cO(O2,n),o=Mge(O2,n),l=lO(n);return s.jsx(oO.ItemSlot,{scope:n,children:s.jsx(Ege,{"aria-disabled":i.open&&!o.collapsible||void 0,"data-orientation":a.orientation,id:i.triggerId,...l,...r,ref:t})})});QW.displayName=O2;var JW="AccordionContent",ZW=L.forwardRef((e,t)=>{const{__scopeAccordion:n,...r}=e,a=f1(Ni,n),i=cO(JW,n),o=lO(n);return s.jsx(Age,{role:"region","aria-labelledby":i.triggerId,"data-orientation":a.orientation,...o,...r,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});ZW.displayName=JW;function e9(e){return e?"open":"closed"}var Lge=WW,Fge=GW,Bge=XW,t9=QW,n9=ZW;const zge=Lge,r9=x.forwardRef(({className:e,...t},n)=>s.jsx(Fge,{ref:n,className:te("border-b",e),...t}));r9.displayName="AccordionItem";const a9=x.forwardRef(({className:e,children:t,...n},r)=>s.jsx(Bge,{className:"flex",children:s.jsxs(t9,{ref:r,className:te("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,s.jsx(Jr,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));a9.displayName=t9.displayName;const s9=x.forwardRef(({className:e,children:t,...n},r)=>s.jsx(n9,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:s.jsx("div",{className:te("pb-4 pt-0",e),children:t})}));s9.displayName=n9.displayName;const Uge=({connector:e,selectedTables:t,onTableToggle:n,onSelectRelated:r,onSelectAll:a})=>{const{data:i=[],isLoading:o,isError:l,refetch:c}=Hk(e.id),u=D7(),d=async()=>{await u.mutateAsync(e.id),c()},f=p=>p?p>=1e6?`${(p/1e6).toFixed(1)}M`:p>=1e3?`${(p/1e3).toFixed(1)}
801K`:p.toLocaleString():"Unknown";if(o)return s.jsxs("div",{className:"flex items-center justify-center py-8",children:[s.jsx(Te,{className:"h-6 w-6 animate-spin text-primary"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tables..."})]});if(l)return s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[s.jsx(Yn,{className:"h-6 w-6 text-destructive"}),s.jsx("p",{className:"text-sm text-destructive",children:"Failed to load tables"}),s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>c(),children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Retry"]})]});if(i.length===0)return s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[s.jsx(wt,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"No tables found"}),s.jsxs(U,{variant:"outline",size:"sm",onClick:d,disabled:u.isPending,children:[u.isPending?s.jsx(Te,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh tables"]})]});const h=i.filter(p=>p.has_read_access!==!1),m=i.filter(p=>p.has_read_access===!1);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex justify-between mb-3",children:[s.jsxs(U,{variant:"ghost",size:"sm",className:"text-xs",onClick:d,disabled:u.isPending,children:[u.isPending?s.jsx(Te,{className:"h-3 w-3 mr-1 animate-spin"}):s.jsx(Vn,{className:"h-3 w-3 mr-1"}),"Refresh"]}),s.jsx(U,{variant:"ghost",size:"sm",className:"text-xs",onClick:()=>a(h),disabled:h.length===0,children:"Select all tables"})]}),s.jsx("div",{className:"space-y-2",children:i.map(p=>{const g=t.has(p.table_name),y=p.foreign_keys&&Object.keys(p.foreign_keys).length>0,v=p.has_read_access!==!1,w=y?Object.entries(p.foreign_keys).map(([b,j])=>({column:b,referencesTable:j.references_table||j.referencesTable,referencesColumn:j.references_column||j.referencesColumn})):[];return s.jsxs("div",{className:`flex items-center justify-between p-3 rounded-lg border transition-all ${v?g?"border-primary bg-primary/5":"border-border hover:border-primary/50":"border-border bg-muted/30 opacity-60"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Hc,{id:`${e.id}-${p.table_name}`,checked:g,onCheckedChange:()=>v&&n(p.table_name),disabled:!v}),s.jsxs("div",{children:[s.jsxs(pe,{htmlFor:`${e.id}-${p.table_name}`,className:`font-medium flex items-center gap-2 ${v?"cursor-pointer":"cursor-not-allowed"}`,children:[p.schema_name!=="public"&&s.jsxs("span",{className:"text-muted-foreground",children:[p.schema_name,"."]}),p.table_name,!v&&s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(qu,{className:"h-3 w-3 text-amber-500"})}),s.jsxs(Bt,{children:[s.jsx("p",{className:"text-xs",children:"No read permission on this table"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Contact your database administrator"})]})]}),y&&v&&s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(rd,{className:"h-3 w-3 text-accent"})}),s.jsxs(Bt,{children:[s.jsx("p",{className:"text-xs",children:"Has relationships with:"}),s.jsx("ul",{className:"text-xs",children:w.map((b,j)=>s.jsxs("li",{children:["→ ",b.referencesTable]},j))})]})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[v?f(p.row_count):"N/A"," rows • ",p.column_count||0," columns"]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[y&&v&&s.jsxs(U,{variant:"ghost",size:"sm",className:"text-xs h-7 text-accent hover:text-accent",onClick:()=>r(p),children:[s.jsx(rd,{className:"h-3 w-3 mr-1"}),"Select related"]}),g&&s.jsx(bt,{className:"h-4 w-4 text-primary"})]})]},p.id)})}),m.length>0&&s.jsxs("div",{className:"flex items-center gap-2 mt-3 p-2 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[s.jsx(qu,{className:"h-4 w-4 text-amber-500 flex-shrink-0"}),s.jsxs("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:[m.length," table",m.length!==1?"s":""," not available due to permission restrictions"]})]})]})},Vge=({onSelectionChange:e})=>{const t=cn(),{data:n=[],isLoading:r,isError:a,error:i,refetch:o}=_m(),[l,c]=x.useState(new Map),[u,d]=x.useState(),f=n.filter(g=>g.status==="connected"&&["postgresql","mysql","mongodb"].includes(g.type));x.useEffect(()=>{f.length>0&&!u&&d(f[0].id)},[f,u]);const h=(g,y)=>{c(v=>{const w=new Map(v),b=new Set(w.get(g)||[]);b.has(y)?b.delete(y):b.add(y),b.size===0?w.delete(g):w.set(g,b);const j=Array.from(w.entries()).map(([N,S])=>({databaseId:N,tableIds:Array.from(S)}));return e(j),w})},m=(g,y)=>{c(v=>{const w=new Map(v),b=new Set(y.map(N=>N.table_name));w.set(g.id,b);const j=Array.from(w.entries()).map(([N,S])=>({databaseId:N,tableIds:Array.from(S)}));return e(j),w})},p=()=>{let g=0;return l.forEach(y=>{g+=y.size}),g};if(r)return s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})});if(a){const g=(i==null?void 0:i.detail)||(i==null?void 0:i.message)||"";return g.includes("PRO")||g.includes("ENTERPRISE")||g.includes("plan")?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[s.jsx("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-amber-400 to-amber-600 flex items-center justify-center",children:s.jsx(eo,{className:"h-8 w-8 text-white"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Upgrade Required"}),s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm",children:["Database connectors are available on ",s.jsx("strong",{children:"PRO"})," and ",s.jsx("strong",{children:"ENTERPRISE"})," plans."]})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>t("/dashboard/subscription"),children:[s.jsx(eo,{className:"mr-2 h-4 w-4"}),"Upgrade Plan"]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx(Yn,{className:"h-12 w-12 text-destructive"}),s.jsx("p",{className:"text-lg font-medium",children:"Failed to load connectors"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:g||"An unexpected error occurred"}),s.jsxs(U,{onClick:()=>o(),children:[s.jsx(Vn,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Select one or more tables from your connected databases"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Tip: Select related tables for more powerful cross-table analysis with AI"})]}),p()>0&&s.jsxs($e,{variant:"default",className:"bg-primary",children:[p()," table",p()!==1?"s":""," selected"]})]}),f.length===0?s.jsxs("div",{className:"text-center py-8 border border-dashed rounded-lg",children:[s.jsx(wt,{className:"h-8 w-8 text-muted-foreground mx-auto mb-2"}),s.jsx("p",{className:"text-muted-foreground",children:"No connected databases found."}),s.jsx(U,{variant:"link",className:"mt-2",onClick:()=>t("/dashboard/connectors"),children:"Go to Connectors →"})]}):s.jsx(zge,{type:"single",collapsible:!0,value:u,onValueChange:d,children:f.map(g=>s.jsxs(r9,{value:g.id,className:"border rounded-lg mb-2",children:[s.jsx(a9,{className:"px-4 hover:no-underline hover:bg-muted/50",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 rounded-lg bg-primary/10 flex items-center justify-center",children:s.jsx(wt,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"text-left",children:[s.jsx("p",{className:"font-medium",children:g.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.host,":",g.port,"/",g.database," • ",g.type.toUpperCase()]})]})]})}),s.jsx(s9,{className:"px-4 pb-4",children:s.jsx(Uge,{connector:g,selectedTables:l.get(g.id)||new Set,onTableToggle:y=>h(g.id,y),onSelectRelated:y=>{},onSelectAll:y=>m(g,y)})})]},g.id))}),p()>0&&s.jsxs("div",{className:"p-3 bg-muted/50 rounded-lg",children:[s.jsxs("p",{className:"text-sm font-medium flex items-center gap-2",children:[s.jsx(ym,{className:"h-4 w-4 text-primary"}),"Selected tables for dataset:"]}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:Array.from(l.entries()).map(([g,y])=>{const v=f.find(w=>w.id===g);return Array.from(y).map(w=>s.jsxs($e,{variant:"secondary",className:"text-xs",children:[v==null?void 0:v.name," → ",w]},`${g}-${w}`))})})]})]})},Aa=x.forwardRef(({className:e,...t},n)=>s.jsx("textarea",{className:te("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm r
801ing-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));Aa.displayName="Textarea";var Wge="Separator",C$="horizontal",qge=["horizontal","vertical"],i9=x.forwardRef((e,t)=>{const{decorative:n,orientation:r=C$,...a}=e,i=Hge(r)?r:C$,l=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return s.jsx(Pe.div,{"data-orientation":i,...l,...a,ref:t})});i9.displayName=Wge;function Hge(e){return qge.includes(e)}var o9=i9;const Kr=x.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(o9,{ref:a,decorative:n,orientation:t,className:te("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Kr.displayName=o9.displayName;function Hg(e,[t,n]){return Math.min(n,Math.max(t,e))}var Kge=[" ","Enter","ArrowUp","ArrowDown"],Gge=[" ","Enter"],md="Select",[h1,m1,Yge]=mm(md),[Em,ert]=kn(md,[Yge,Vc]),p1=Vc(),[Xge,Kc]=Em(md),[Qge,Jge]=Em(md),l9=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:h,required:m,form:p}=e,g=p1(t),[y,v]=x.useState(null),[w,b]=x.useState(null),[j,N]=x.useState(!1),S=wl(u),[C,_]=fr({prop:r,defaultProp:a??!1,onChange:i,caller:md}),[E,T]=fr({prop:o,defaultProp:l,onChange:c,caller:md}
vendor: 17,711 bytes, line 801
801),P=x.useRef(null),k=y?p||!!y.closest("form"):!0,[D,A]=x.useState(new Set),I=Array.from(D).map(M=>M.props.value).join(";");return s.jsx(Dj,{...g,children:s.jsxs(Xge,{required:m,scope:t,trigger:y,onTriggerChange:v,valueNode:w,onValueNodeChange:b,valueNodeHasChildren:j,onValueNodeHasChildrenChange:N,contentId:Ia(),value:E,onValueChange:T,open:C,onOpenChange:_,dir:S,triggerPointerDownPosRef:P,disabled:h,children:[s.jsx(h1.Provider,{scope:t,children:s.jsx(Qge,{scope:e.__scopeSelect,onNativeOptionAdd:x.useCallback(M=>{A($=>new Set($).add(M))},[]),onNativeOptionRemove:x.useCallback(M=>{A($=>{const R=new Set($);return R.delete(M),R})},[]),children:n})}),k?s.jsxs(M9,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:E,onChange:M=>T(M.target.value),disabled:h,form:p,children:[E===void 0?s.jsx("option",{value:""}):null,Array.from(D)]},I):null]})})};l9.displayName=md;var c9="SelectTrigger",u9=x.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,i=p1(n),o=Kc(c9,n),l=o.disabled||r,c=qe(t,o.onTriggerChange),u=m1(n),d=x.useRef("touch"),[f,h,m]=D9(g=>{const y=u().filter(b=>!b.disabled),v=y.find(b=>b.value===o.value),w=$9(y,g,v);w!==void 0&&o.onValueChange(w.value)}),p=g=>{l||(o.onOpenChange(!0),m()),g&&(o.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return s.jsx(sv,{asChild:!0,...i,children:s.jsx(Pe.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":R9(o.value)?"":void 0,...a,ref:c,onClick:je(a.onClick,g=>{g.currentTarget.focus(),d.current!=="mouse"&&p(g)}),onPointerDown:je(a.onPointerDown,g=>{d.current=g.pointerType;const y=g.target;y.hasPointerCapture(g.pointerId)&&y.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(p(g),g.preventDefault())}),onKeyDown:je(a.onKeyDown,g=>{const y=f.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&h(g.key),!(y&&g.key===" ")&&Kge.includes(g.key)&&(p(),g.preventDefault())})})})});u9.displayName=c9;var d9="SelectValue",f9=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:i,placeholder:o="",...l}=e,c=Kc(d9,n),{onValueNodeHasChildrenChange:u}=c,d=i!==void 0,f=qe(t,c.onValueNodeChange);return Fn(()=>{u(d)},[u,d]),s.jsx(Pe.span,{...l,ref:f,style:{pointerEvents:"none"},children:R9(c.value)?s.jsx(s.Fragment,{children:o}):i})});f9.displayName=d9;var Zge="SelectIcon",h9=x.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return s.jsx(Pe.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});h9.displayName=Zge;var eye="SelectPortal",m9=e=>s.jsx(pm,{asChild:!0,...e});m9.displayName=eye;var pd="SelectContent",p9=x.forwardRef((e,t)=>{const n=Kc(pd,e.__scopeSelect),[r,a]=x.useState();if(Fn(()=>{a(new DocumentFragment)},[]),!n.open){const i=r;return i?Cs.createPortal(s.jsx(g9,{scope:e.__scopeSelect,children:s.jsx(h1.Slot,{scope:e.__scopeSelect,children:s.jsx("div",{children:e.children})})}),i):null}return s.jsx(y9,{...e,ref:t})});p9.displayName=pd;var zs=10,[g9,Gc]=Em(pd),tye="SelectContentImpl",nye=Rc("SelectContent.RemoveScroll"),y9=x.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:p,hideWhenDetached:g,avoidCollisions:y,...v}=e,w=Kc(pd,n),[b,j]=x.useState(null),[N,S]=x.useState(null),C=qe(t,K=>j(K)),[_,E]=x.useState(null),[T,P]=x.useState(null),k=m1(n),[D,A]=x.useState(!1),I=x.useRef(!1);x.useEffect(()=>{if(b)return Qj(b)},[b]),Gj();const M=x.useCallback(K=>{const[W,...q]=k().map(X=>X.ref.current),[J]=q.slice(-1),ie=document.activeElement;for(const X of K)if(X===ie||(X==null||X.scrollIntoView({block:"nearest"}),X===W&&N&&(N.scrollTop=0),X===J&&N&&(N.scrollTop=N.scrollHeight),X==null||X.focus(),document.activeElement!==ie))return},[k,N]),$=x.useCallback(()=>M([_,b]),[M,_,b]);x.useEffect(()=>{D&&$()},[D,$]);const{onOpenChange:R,triggerPointerDownPosRef:O}=w;x.useEffect(()=>{if(b){let K={x:0,y:0};const W=J=>{var ie,X;K={x:Math.abs(Math.round(J.pageX)-(((ie=O.current)==null?void 0:ie.x)??0)),y:Math.abs(Math.round(J.pageY)-(((X=O.current)==null?void 0:X.y)??0))}},q=J=>{K.x<=10&&K.y<=10?J.preventDefault():b.contains(J.target)||R(!1),document.removeEventListener("pointermove",W),O.current=null};return O.current!==null&&(document.addEventListener("pointermove",W),document.addEventListener("pointerup",q,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",q,{capture:!0})}}},[b,R,O]),x.useEffect(()=>{const K=()=>R(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[R]);const[F,z]=D9(K=>{const W=k().filter(ie=>!ie.disabled),q=W.find(ie=>ie.ref.current===document.activeElement),J=$9(W,K,q);J&&setTimeout(()=>J.ref.current.focus())}),B=x.useCallback((K,W,q)=>{const J=!I.current&&!q;(w.value!==void 0&&w.value===W||J)&&(E(K),J&&(I.current=!0))},[w.value]),H=x.useCallback(()=>b==null?void 0:b.focus(),[b]),Y=x.useCallback((K,W,q)=>{const J=!I.current&&!q;(w.value!==void 0&&w.value===W||J)&&P(K)},[w.value]),ee=r==="popper"?T2:v9,V=ee===T2?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:p,hideWhenDetached:g,avoidCollisions:y}:{};return s.jsx(g9,{scope:n,content:b,viewport:N,onViewportChange:S,itemRefCallback:B,selectedItem:_,onItemLeave:H,itemTextRefCallback:Y,focusSelectedItem:$,selectedItemText:T,position:r,isPositioned:D,searchRef:F,children:s.jsx(pv,{as:nye,allowPinchZoom:!0,children:s.jsx(hv,{asChild:!0,trapped:w.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:je(a,K=>{var W;(W=w.trigger)==null||W.focus({preventScroll:!0}),K.preventDefault()}),children:s.jsx(Pd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:s.jsx(ee,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:K=>K.preventDefault(),...v,...V,onPlaced:()=>A(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:je(v.onKeyDown,K=>{const W=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!W&&K.key.length===1&&z(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let J=k().filter(ie=>!ie.disabled).map(ie=>ie.ref.current);if(["ArrowUp","End"].includes(K.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ie=K.target,X=J.indexOf(ie);J=J.slice(X+1)}setTimeout(()=>M(J)),K.preventDefault()}})})})})})})});y9.displayName=tye;var rye="SelectItemAlignedPosition",v9=x.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,i=Kc(pd,n),o=Gc(pd,n),[l,c]=x.useState(null),[u,d]=x.useState(null),f=qe(t,C=>d(C)),h=m1(n),m=x.useRef(!1),p=x.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:w}=o,b=x.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&g&&y&&v){const C=i.trigger.getBoundingClientRect(),_=u.getBoundingClientRect(),E=i.valueNode.getBoundingClientRect(),T=v.getBoundingClientRect();if(i.dir!=="rtl"){const ie=T.left-_.left,X=E.left-ie,ge=C.left-X,Se=C.width+ge,ce=Math.max(Se,_.width),ye=window.innerWidth-zs,Ie=Hg(X,[zs,Math.max(zs,ye-ce)]);l.style.minWidth=Se+"px",l.style.left=Ie+"px"}else{const ie=_.right-T.right,X=window.innerWidth-E.right-ie,ge=window.innerWidth-C.right-X,Se=C.width+ge,ce=Math.max(Se,_.width),ye=window.innerWidth-zs,Ie=Hg(X,[zs,Math.max(zs,ye-ce)]);l.style.minWidth=Se+"px",l.style.right=Ie+"px"}const P=h(),k=window.innerHeight-zs*2,D=g.scrollHeight,A=window.getComputedStyle(u),I=parseInt(A.borderTopWidth,10),M=parseInt(A.paddingTop,10),$=parseInt(A.borderBottomWidth,10),R=parseInt(A.paddingBottom,10),O=I+M+D+R+$,F=Math.min(y.offsetHeight*5,O),z=window.getComputedStyle(g),B=parseInt(z.paddingTop,10),H=parseInt(z.paddingBottom,10),Y=C.top+C.height/2-zs,ee=k-Y,V=y.offsetHeight/2,K=y.offsetTop+V,W=I+M+K,q=O-W;if(W<=Y){const ie=P.length>0&&y===P[P.length-1].ref.current;l.style.bottom="0px";const X=u.clientHeight-g.offsetTop-g.offsetHeight,ge=Math.max(ee,V+(ie?H:0)+X+$),Se=W+ge;l.style.height=Se+"px"}else{const ie=P.length>0&&y===P[0].ref.current;l.style.top="0px";const ge=Math.max(Y,I+g.offsetTop+(ie?B:0)+V)+q;l.style.height=ge+"px",g.scrollTop=W-Y+g.offsetTop}l.style.margin=`${zs}px 0`,l.style.minHeight=F+"px",l.style.maxHeight=k+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[h,i.trigger,i.valueNode,l,u,g,y,v,i.dir,r]);Fn(()=>b(),[b]);const[j,N]=x.useState();Fn(()=>{u&&N(window.getComputedStyle(u).zIndex)},[u]);const S=x.useCallback(C=>{C&&p.current===!0&&(b(),w==null||w(),p.current=!1)},[b,w]);return s.jsx(sye,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:m,onScrollButtonChange:S,children:s.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:j},children:s.jsx(Pe.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});v9.displayName=rye;var aye="SelectPopperPosition",T2=x.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=zs,...i}=e,o=p1(n);return s.jsx($j,{...o,...i,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});T2.displayName=aye;var[sye,uO]=Em(pd,{}),M2="SelectViewport",x9=x.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,i=Gc(M2,n),o=uO(M2,n),l=qe(t,i.onViewportChange),c=x.useRef(0);return s.jsxs(s.Fragment,{children:[s.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}),s.jsx(h1.Slot,{scope:n,children:s.jsx(Pe.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:je(a.onScroll,u=>{const d=u.currentTarget,{contentWrapper:f,shouldExpandOnScrollRef:h}=o;if(h!=null&&h.current&&f){const m=Math.abs(c.current-d.scrollTop);if(m>0){const p=window.innerHeight-zs*2,g=parseFloat(f.style.minHeight),y=parseFloat(f.style.height),v=Math.max(g,y);if(v<p){const w=v+m,b=Math.min(p,w),j=w-b;f.style.height=b+"px",f.style.bottom==="0px"&&(d.scrollTop=j>0?j:0,f.style.justifyContent="flex-end")}}}c.current=d.scrollTop})})})]})});x9.displayName=M2;var b9="SelectGroup",[iye,oye]=Em(b9),w9=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Ia();return s.jsx(iye,{scope:n,id:a,children:s.jsx(Pe.div,{role:"group","aria-labelledby":a,...r,ref:t})})});w9.displayName=b9;var j9="SelectLabel",N9=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=oye(j9,n);return s.jsx(Pe.div,{id:a.id,...r,ref:t})});N9.displayName=j9;var N0="SelectItem",[lye,S9]=Em(N0),C9=x.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:i,...o}=e,l=Kc(N0,n),c=Gc(N0,n),u=l.value===r,[d,f]=x.useState(i??""),[h,m]=x.useState(!1),p=qe(t,w=>{var b;return(b=c.itemRefCallback)==null?void 0:b.call(c,w,r,a)}),g=Ia(),y=x.useRef("touch"),v=()=>{a||(l.onValueChange(r),l.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 s.jsx(lye,{scope:n,value:r,disabled:a,textId:g,isSelected:u,onItemTextChange:x.useCallback(w=>{f(b=>b||((w==null?void 0:w.textContent)??"").trim())},[]),children:s.jsx(h1.ItemSlot,{scope:n,value:r,disabled:a,textValue:d,children:s.jsx(Pe.div,{role:"option","aria-labelledby":g,"data-highlighted":h?"":void 0,"aria-selected":u&&h,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:p,onFocus:je(o.onFocus,()=>m(!0)),onBlur:je(o.onBlur,()=>m(!1)),onClick:je(o.onClick,()=>{y.current!=="mouse"&&v()}),onPointerUp:je(o.onPointerUp,()=>{y.current==="mouse"&&v()}),onPointerDown:je(o.onPointerDown,w=>{y.current=w.pointerType}),onPointerMove:je(o.onPointerMove,w=>{var b;y.current=w.pointerType,a?(b=c.onItemLeave)==null||b.call(c):y.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:je(o.onPointerLeave,w=>{var b;w.currentTarget===document.activeElement&&((b=c.onItemLeave)==null||b.call(c))}),onKeyDown:je(o.onKeyDown,w=>{var j;((j=c.searchRef)==null?void 0:j.current)!==""&&w.key===" "||(Gge.includes(w.key)&&v(),w.key===" "&&w.preventDefault())})})})})});C9.displayName=N0;var Tp="SelectItemText",_9=x.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...i}=e,o=Kc(Tp,n),l=Gc(Tp,n),c=S9(Tp,n),u=Jge(Tp,n),[d,f]=x.useState(null),h=qe(t,v=>f(v),c.onItemTextChange,v=>{var w;return(w=l.itemTextRefCallback)==null?void 0:w.call(l,v,c.value,c.disabled)}),m=d==null?void 0:d.textContent,p=x.useMemo(()=>s.jsx("option",{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return Fn(()=>(g(p),()=>y(p)),[g,y,p]),s.jsxs(s.Fragment,{children:[s.jsx(Pe.span,{id:c.textId,...i,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?Cs.createPortal(i.children,o.valueNode):null]})});_9.displayName=Tp;var E9="SelectItemIndicator",A9=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return S9(E9,n).isSelected?s.jsx(Pe.span,{"aria-hidden":!0,...r,ref:t}):null});A9.displayName=E9;var R2="SelectScrollUpButton",P9=x.forwardRef((e,t)=>{const n=Gc(R2,e.__scopeSelect),r=uO(R2,e.__scopeSelect),[a,i]=x.useState(!1),o=qe(t,r.onScrollButtonChange);return Fn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollTop>0;i(u)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(O9,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});P9.displayName=R2;var D2="SelectScrollDownButton",k9=x.forwardRef((e,t)=>{const n=Gc(D2,e.__scopeSelect),r=uO(D2,e.__scopeSelect),[a,i]=x.useState(!1),o=qe(t,r.onScrollButtonChange);return Fn(()=>{if(n.viewport&&n.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,d=Math.ceil(c.scrollTop)<u;i(d)};const c=n.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[n.viewport,n.isPositioned]),a?s.jsx(O9,{...e,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=n;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});k9.displayName=D2;var O9=x.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,i=Gc("SelectScrollButton",n),o=x.useRef(null),l=m1(n),c=x.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return x.useEffect(()=>()=>c(),[c]),Fn(()=>{var d;const u=l().find(f=>f.ref.current===document.activeElement);(d=u==null?void 0:u.ref.current)==null||d.scrollIntoView({block:"nearest"})},[l]),s.jsx(Pe.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:je(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:je(a.onPointerMove,()=>{var u;(u=i.onItemLeave)==null||u.call(i),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:je(a.onPointerLeave,()=>{c()})})}),cye="SelectSeparator",T9=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return s.jsx(Pe.div,{"aria-hidden":!0,...r,ref:t})});T9.displayName=cye;var $2="SelectArrow",uye=x.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=p1(n),i=Kc($2,n),o=Gc($2,n);return i.open&&o.position==="popper"?s.jsx(Ij,{...a,...r,ref:t}):null});uye.displayName=$2;var dye="SelectBubbleInput",M9=x.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=x.useRef(null),i=qe(r,a),o=vv(t);return x.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("change",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[o,t]),s.jsx(Pe.select,{...n,style:{...gB,...n.style},ref:i,defaultValue:t})});M9.displayName=dye;function R9(e){return e===""||e===void 0}function D9(e){const t=In(e),n=x.useRef(""),r=x.useRef(0),a=x.useCallback(o=>{const l=n.current+o;t(l),function c(u){n.current=u,window.clearTimeout(r.current),u!==""&&(r.current=window.setTimeout(()=>c(""),1e3))}(l)},[t]),i=x.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,i]}function $9(e,t,n){const a=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let o=fye(e,Math.max(i,0));a.length===1&&(o=o.filter(u=>u!==n));const c=o.find(u=>u.textValue.toLowerCase().startsWith(a.toLowerCase()));return c!==n?c:void 0}function fye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var hye=l9,I9=u9,mye=f9,pye=h9,gye=m9,L9=p9,yye=x9,vye=w9,F9=N9,B9=C9,xye=_9,bye=A9,z9=P9,U9=k9,V9=T9;const rt=hye,Ex=vye,st=mye,tt=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(I9,{ref:r,className:te("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm r
801ing-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,s.jsx(pye,{asChild:!0,children:s.jsx(Jr,{className:"h-4 w-4 opacity-50"})})]}));tt.displayName=I9.displayName;const W9=x.forwardRef(({className:e,...t},n)=>s.jsx(z9,{ref:n,className:te("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Zi,{className:"h-4 w-4"})}));W9.displayName=z9.displayName;const q9=x.forwardRef(({className:e,...t},n)=>s.jsx(U9,{ref:n,className:te("flex cursor-default items-center justify-center py-1",e),...t,children:s.jsx(Jr,{className:"h-4 w-4"})}));q9.displayName=U9.displayName;const nt=x.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>s.jsx(gye,{children:s.jsxs(L9,{ref:a,className:te("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",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:[s.jsx(W9,{}),s.jsx(yye,{className:te("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),s.jsx(q9,{})]})}));nt.displayName=L9.displayName;const Mp=x.forwardRef(({className:e,...t},n)=>s.jsx(F9,{ref:n,className:te("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));Mp.displayName=F9.displayName;const _e=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(B9,{ref:r,className:te("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground",e),...n,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(bye,{children:s.jsx(bt,{className:"h-4 w-4"})})}),s.jsx(xye,{children:t})]}));_e.displayName=B9.displayName;const wye=x.forwardRef(({className:e,...t},n)=>s.jsx(V9,{ref:n,className:te("-mx-1 my-1 h-px bg-muted",e),...t}));wye.displayName=V9.displayName;function jye(e,t){return x.useReducer((n,r)=>t[n][r]??n,e)}var dO="ScrollArea",[H9,trt]=kn(dO),[Nye,Rs]=H9(dO),K9=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:i=600,...o}=e,[l,c]=x.useState(null),[u,d]=x.useState(null),[f,h]=x.useState(null),[m,p]=x.useState(null),[g,y]=x.useState(null),[v,w]=x.useState(0),[b,j]=x.useState(0),[N,S]=x.useState(!1),[C,_]=x.useState(!1),E=qe(t,P=>c(P)),T=wl(a);return s.jsx(Nye,{scope:n,type:r,dir:T,scrollHideDelay:i,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:p,scrollbarXEnabled:N,onScrollbarXEnabledChange:S,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:C,onScrollbarYEnabledChange:_,onCornerWidthChange:w,onCornerHeightChange:j,children:s.jsx(Pe.div,{dir:T,...o,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":b+"px",...e.style}})})});K9.displayName=dO;var G9="ScrollAreaViewport",Y9=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...i}=e,o=Rs(G9,n),l=x.useRef(null),c=qe(t,l,o.onViewportChange);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),s.jsx(Pe.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...e.style},children:s.jsx("div",{ref:o.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});Y9.displayName=G9;var ho="ScrollAreaScrollbar",fO=x.forwardRef((e,t)=>
vendor: 4,434 bytes, line 801
801{const{forceMount:n,...r}=e,a=Rs(ho,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:o}=a,l=e.orientation==="horizontal";return x.useEffect(()=>(l?i(!0):o(!0),()=>{l?i(!1):o(!1)}),[l,i,o]),a.type==="hover"?s.jsx(Sye,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(Cye,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(X9,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(hO,{...r,ref:t}):null});fO.displayName=ho;var Sye=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rs(ho,e.__scopeScrollArea),[i,o]=x.useState(!1);return x.useEffect(()=>{const l=a.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),o(!0)},d=()=>{c=window.setTimeout(()=>o(!1),a.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Jn,{present:n||i,children:s.jsx(X9,{"data-state":i?"visible":"hidden",...r,ref:t})})}),Cye=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Rs(ho,e.__scopeScrollArea),i=e.orientation==="horizontal",o=y1(()=>c("SCROLL_END"),100),[l,c]=jye("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return x.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,a.scrollHideDelay,c]),x.useEffect(()=>{const u=a.viewport,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(c("SCROLL"),o()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[a.viewport,i,c,o]),s.jsx(Jn,{present:n||l!=="hidden",children:s.jsx(hO,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:je(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:je(e.onPointerLeave,()=>c("POINTER_LEAVE"))})})}),X9=x.forwardRef((e,t)=>{const n=Rs(ho,e.__scopeScrollArea),{forceMount:r,...a}=e,[i,o]=x.useState(!1),l=e.orientation==="horizontal",c=y1(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;o(l?u:d)}},10);return vh(n.viewport,c),vh(n.content,c),s.jsx(Jn,{present:r||i,children:s.jsx(hO,{"data-state":i?"visible":"hidden",...a,ref:t})})}),hO=x.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Rs(ho,e.__scopeScrollArea),i=x.useRef(null),o=x.useRef(0),[l,c]=x.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=tq(l.viewport,l.content),d={...r,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>i.current=h,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:h=>o.current=h};function f(h,m){return Oye(h,o.current,l,m)}return n==="horizontal"?s.jsx(_ye,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const h=a.viewport.scrollLeft,m=_$(h,l,a.dir);i.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{a.viewport&&(a.viewport.scrollLeft=h)},onDragScroll:h=>{a.viewport&&(a.viewport.scrollLeft=f(h,a.dir))}}):n==="vertical"?s.jsx(Eye,{...d,ref:t,onThumbPositionChange:()=>{if(a.viewport&&i.current){const h=a.viewport.scrollTop,m=_$(h,l);i.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{a.viewport&&(a.viewport.scrollTop=h)},onDragScroll:h=>{a.viewport&&(a.viewport.scrollTop=f(h))}}):null}),_ye=x.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,i=Rs(ho,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=qe(t,c,i.onScrollbarXChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(J9,{"data-orientation":"horizontal",...a,ref:u,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":g1(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,f)=>{if(i.viewport){const h=i.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),rq(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:C0(o.paddingLeft),paddingEnd:C0(o.paddingRight)}})}})}),Eye=x.forwardRef((e,t)=>
vendor: 6,536 bytes, line 801
801{const{sizes:n,onSizesChange:r,...a}=e,i=Rs(ho,e.__scopeScrollArea),[o,l]=x.useState(),c=x.useRef(null),u=qe(t,c,i.onScrollbarYChange);return x.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),s.jsx(J9,{"data-orientation":"vertical",...a,ref:u,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":g1(n)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,f)=>{if(i.viewport){const h=i.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),rq(h,f)&&d.preventDefault()}},onResize:()=>{c.current&&i.viewport&&o&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:C0(o.paddingTop),paddingEnd:C0(o.paddingBottom)}})}})}),[Aye,Q9]=H9(ho),J9=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:i,onThumbPointerUp:o,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:f,...h}=e,m=Rs(ho,n),[p,g]=x.useState(null),y=qe(t,E=>g(E)),v=x.useRef(null),w=x.useRef(""),b=m.viewport,j=r.content-r.viewport,N=In(d),S=In(c),C=y1(f,10);function _(E){if(v.current){const T=E.clientX-v.current.left,P=E.clientY-v.current.top;u({x:T,y:P})}}return x.useEffect(()=>{const E=T=>{const P=T.target;(p==null?void 0:p.contains(P))&&N(T,j)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[b,p,j,N]),x.useEffect(S,[r,S]),vh(p,C),vh(m.content,C),s.jsx(Aye,{scope:n,scrollbar:p,hasThumb:a,onThumbChange:In(i),onThumbPointerUp:In(o),onThumbPositionChange:S,onThumbPointerDown:In(l),children:s.jsx(Pe.div,{...h,ref:y,style:{position:"absolute",...h.style},onPointerDown:je(e.onPointerDown,E=>{E.button===0&&(E.target.setPointerCapture(E.pointerId),v.current=p.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),_(E))}),onPointerMove:je(e.onPointerMove,_),onPointerUp:je(e.onPointerUp,E=>{const T=E.target;T.hasPointerCapture(E.pointerId)&&T.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=w.current,m.viewport&&(m.viewport.style.scrollBehavior=""),v.current=null})})})}),S0="ScrollAreaThumb",Z9=x.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Q9(S0,e.__scopeScrollArea);return s.jsx(Jn,{present:n||a.hasThumb,children:s.jsx(Pye,{ref:t,...r})})}),Pye=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,i=Rs(S0,n),o=Q9(S0,n),{onThumbPositionChange:l}=o,c=qe(t,f=>o.onThumbChange(f)),u=x.useRef(void 0),d=y1(()=>{u.current&&(u.current(),u.current=void 0)},100);return x.useEffect(()=>{const f=i.viewport;if(f){const h=()=>{if(d(),!u.current){const m=Tye(f,l);u.current=m,l()}};return l(),f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[i.viewport,d,l]),s.jsx(Pe.div,{"data-state":o.hasThumb?"visible":"hidden",...a,ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:je(e.onPointerDownCapture,f=>{const m=f.target.getBoundingClientRect(),p=f.clientX-m.left,g=f.clientY-m.top;o.onThumbPointerDown({x:p,y:g})}),onPointerUp:je(e.onPointerUp,o.onThumbPointerUp)})});Z9.displayName=S0;var mO="ScrollAreaCorner",eq=x.forwardRef((e,t)=>{const n=Rs(mO,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(kye,{...e,ref:t}):null});eq.displayName=mO;var kye=x.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Rs(mO,n),[i,o]=x.useState(0),[l,c]=x.useState(0),u=!!(i&&l);return vh(a.scrollbarX,()=>{var f;const d=((f=a.scrollbarX)==null?void 0:f.offsetHeight)||0;a.onCornerHeightChange(d),c(d)}),vh(a.scrollbarY,()=>{var f;const d=((f=a.scrollbarY)==null?void 0:f.offsetWidth)||0;a.onCornerWidthChange(d),o(d)}),u?s.jsx(Pe.div,{...r,ref:t,style:{width:i,height:l,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function C0(e){return e?parseInt(e,10):0}function tq(e,t){const n=e/t;return isNaN(n)?0:n}function g1(e){const t=tq(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Oye(e,t,n,r="ltr"){const a=g1(n),i=a/2,o=t||i,l=a-o,c=n.scrollbar.paddingStart+o,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return nq([c,u],f)(e)}function _$(e,t,n="ltr"){const r=g1(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-a,o=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,o]:[o*-1,0],u=Hg(e,c);return nq([0,o],[0,l])(u)}function nq(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function rq(e,t){return e>0&&e<t}var Tye=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const i={left:e.scrollLeft,top:e.scrollTop},o=n.left!==i.left,l=n.top!==i.top;(o||l)&&t(),n=i,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function y1(e,t){const n=In(e),r=x.useRef(0);return x.useEffect(()=>()=>window.clearTimeout(r.current),[]),x.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function vh(e,t){const n=In(t);Fn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var aq=K9,Mye=Y9,Rye=eq;const Ba=x.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(aq,{ref:r,className:te("relative overflow-hidden",e),...n,children:[s.jsx(Mye,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(pO,{}),s.jsx(Rye,{})]}));Ba.displayName=aq.displayName;const pO=x.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(fO,{ref:r,orientation:t,className:te("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(Z9,{className:"relative flex-1 rounded-full bg-border"})}));pO.displayName=fO.displayName;const Dye=({connector:e,selectedTable:t,onTableSelect:n})=>{const[r,a]=x.useState(""),{data:i=[],isLoading:o,isError:l,refetch:c}=Hk(e.id),u=D7(),d=async()=>{await u.mutateAsync(e.id),c()},f=g=>g?g>=1e6?`${(g/1e6).toFixed(1)}M`:g>=1e3?`${(g/1e3).toFixed(1)}
801K`:g.toLocaleString():"Unknown",h=i.filter(g=>g.table_name.toLowerCase().includes(r.toLowerCase())||g.schema_name&&g.schema_name.toLowerCase().includes(r.toLowerCase())),m=h.filter(g=>g.has_read_access!==!1),p=h.filter(g=>g.has_read_access===!1);return o?s.jsxs("div",{className:"flex items-center justify-center py-8",children:[s.jsx(Te,{className:"h-6 w-6 animate-spin text-primary"}),s.jsx("span",{className:"ml-2 text-sm text-muted-foreground",children:"Loading tables..."})]}):l?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[s.jsx(Yn,{className:"h-6 w-6 text-destructive"}),s.jsx("p",{className:"text-sm text-destructive",children:"Failed to load tables"}),s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>c(),children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Retry"]})]}):i.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-2",children:[s.jsx(wt,{className:"h-6 w-6 text-muted-foreground"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"No tables found"}),s.jsxs(U,{variant:"outline",size:"sm",onClick:d,disabled:u.isPending,children:[u.isPending?s.jsx(Te,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh tables"]})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Re,{placeholder:"Search tables...",value:r,onChange:g=>a(g.target.value),className:"flex-1"}),s.jsx(U,{variant:"outline",size:"icon",onClick:d,disabled:u.isPending,children:u.isPending?s.jsx(Te,{className:"h-4 w-4 animate-spin"}):s.jsx(Vn,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"flex items-center justify-between text-xs text-muted-foreground",children:[s.jsxs("span",{children:[m.length," table",m.length!==1?"s":""," available"]}),p.length>0&&s.jsxs("span",{className:"text-amber-500",children:[p.length," restricted"]})]}),s.jsx(Ba,{className:"h-[300px] pr-4",children:s.jsxs("div",{className:"space-y-1",children:[h.map(g=>{const y=t===g.table_name,v=g.has_read_access!==!1;return s.jsxs("button",{onClick:()=>v&&n(g),disabled:!v,className:`w-full flex items-center justify-between p-3 rounded-lg border transition-all text-left ${v?y?"border-primary bg-primary/5 ring-1 ring-primary":"border-border hover:border-primary/50 hover:bg-muted/50":"border-border bg-muted/30 opacity-60 cursor-not-allowed"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:`h-8 w-8 rounded-lg flex items-center justify-center ${y?"bg-primary text-primary-foreground":"bg-muted"}`,children:s.jsx(xr,{className:"h-4 w-4"})}),s.jsxs("div",{children:[s.jsxs("p",{className:"font-medium text-sm flex items-center gap-2",children:[g.schema_name!=="public"&&s.jsxs("span",{className:"text-muted-foreground",children:[g.schema_name,"."]}),g.table_name,!v&&s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(qu,{className:"h-3 w-3 text-amber-500"})}),s.jsx(Bt,{children:s.jsx("p",{className:"text-xs",children:"No read permission"})})]})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[v?f(g.row_count):"N/A"," rows •"," ",g.column_count||0," columns"]})]})]}),y&&s.jsx(bt,{className:"h-5 w-5 text-primary"}),!y&&v&&s.jsx(si,{className:"h-4 w-4 text-muted-foreground"})]},`${g.schema_name}.${g.table_name}`)}),h.length===0&&r&&s.jsxs("p",{className:"text-sm text-muted-foreground text-center py-4",children:['No tables match "',r,'"']})]})}),p.length>0&&s.jsxs("div",{className:"flex items-center gap-2 p-2 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:[s.jsx(qu,{className:"h-4 w-4 text-amber-500 flex-shrink-0"}),s.jsxs("p",{className:"text-xs text-amber-700 dark:text-amber-400",children:[p.length," table",p.length!==1?"s":""," unavailable due to permission restrictions"]})]})]})},$ye=({onSelectionChange:e,initialConnectorId:t,initialTableName:n})=>{var b;const r=cn(),{data:a=[],isLoading:i,isError:o,error:l,refetch:c}=_m(),[u,d]=x.useState(t),[f,h]=x.useState(n||null),[m,p]=x.useState(null),g=a.filter(j=>j.status==="connected"&&["postgresql","mysql","mongodb","mariadb"].includes(j.t
801ype));x.useEffect(()=>{g.length===1&&!u&&d(g[0].id)},[g,u]);const y=j=>{d(j),h(null),p(null),e(null)},v=j=>{h(j.table_name),p(j),u&&e({connectorId:u,schemaName:j.schema_name||"public",tableName:j.table_name,tableInfo:j})},w=g.find(j=>j.id===u);if(i)return s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})});if(o){const j=(l==null?void 0:l.detail)||(l==null?void 0:l.message)||"";return j.includes("PRO")||j.includes("ENTERPRISE")||j.includes("plan")?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[s.jsx("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-amber-400 to-amber-600 flex items-center justify-center",children:s.jsx(eo,{className:"h-8 w-8 text-white"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Upgrade Required"}),s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm",children:["Database connectors are available on ",s.jsx("strong",{children:"PRO"})," and"," ",s.jsx("strong",{children:"ENTERPRISE"})," plans."]})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>r("/dashboard/subscription"),children:[s.jsx(eo,{className:"mr-2 h-4 w-4"}),"Upgrade Plan"]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx(Yn,{className:"h-12 w-12 text-destructive"}),s.jsx("p",{className:"text-lg font-medium",children:"Failed to load connectors"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:j||"An unexpected error occurred"}),s.jsxs(U,{onClick:()=>c(),children:[s.jsx(Vn,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}return g.length===0?s.jsxs("div",{className:"text-center py-8 border border-dashed rounded-lg",children:[s.jsx(wt,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),s.jsx("p",{className:"text-muted-foreground font-medium",children:"No connected databases found"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect a database first to create datasets from tables."}),s.jsx(U,{variant:"link",className:"mt-3",onClick:()=>r("/dashboard/connectors"),children:"Go to Connectors →"})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"connector-select",children:"Select Database Connection"}),s.jsxs(rt,{value:u,onValueChange:y,children:[s.jsx(tt,{id:"connector-select",children:s.jsx(st,{placeholder:"Choose a database connection"})}),s.jsx(nt,{children:g.map(j=>s.jsx(_e,{value:j.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-4 w-4 text-primary"}),s.jsx("span",{children:j.name}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",j.type.toUpperCase(),")"]})]})},j.id))})]}),w&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[w.host,":",w.port,"/",w.database]})]}),w&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(pe,{children:"Select Table"}),f&&s.jsx($e,{variant:"default",className:"bg-primary",children:f})]}),s.jsx(Dye,{connector:w,selectedTable:f,onTableSelect:v})]}),f&&m&&s.jsx("div",{className:"p-4 bg-primary/5 border border-primary/20 rounded-lg",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary flex items-center justify-center",children:s.jsx(xr,{className:"h-5 w-5 text-primary-foreground"})}),s.jsxs("div",{children:[s.jsxs("p",{className:"font-medium",children:[m.schema_name!=="public"&&s.jsxs("span",{className:"text-muted-foreground",children:[m.schema_name,"."]}),m.table_name]}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["from ",s.jsx("strong",{children:w==null?void 0:w.name})," •"," ",((b=m.row_count)==null?void 0:b.toLocaleString())||"Unknown"," rows •"," ",m.column_count||0," columns"]})]})]})})]})},xh=VW,bh=rO,wh=sO;var sq="Toggle",gO=x.forwardRef((e,t)=>
801{const{pressed:n,defaultPressed:r,onPressedChange:a,...i}=e,[o,l]=fr({prop:n,onChange:a,defaultProp:r??!1,caller:sq});return s.jsx(Pe.button,{type:"button","aria-pressed":o,"data-state":o?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:je(e.onClick,()=>{e.disabled||l(!o)})})});gO.displayName=sq;var iq=gO,Yc="ToggleGroup",[oq,nrt]=kn(Yc,[qc]),lq=qc(),yO=L.forwardRef((e,t)=>{const{type:n,...r}=e;if(n==="single"){const a=r;return s.jsx(Iye,{...a,ref:t})}if(n==="multiple"){const a=r;return s.jsx(Lye,{...a,ref:t})}throw new Error(`Missing prop \`type\` expected on \`${Yc}\``)});yO.displayName=Yc;var[cq,uq]=oq(Yc),Iye=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...i}=e,[o,l]=fr({prop:n,defaultProp:r??"",onChange:a,caller:Yc});return s.jsx(cq,{scope:e.__scopeToggleGroup,type:"single",value:L.useMemo(()=>o?[o]:[],[o]),onItemActivate:l,onItemDeactivate:L.useCallback(()=>l(""),[l]),children:s.jsx(dq,{...i,ref:t})})}),Lye=L.forwardRef((e,t)=>{const{value:n,defaultValue:r,onValueChange:a=()=>{},...i}=e,[o,l]=fr({prop:n,defaultProp:r??[],onChange:a,caller:Yc}),c=L.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=L.useCallback(d=>l((f=[])=>f.filter(h=>h!==d)),[l]);return s.jsx(cq,{scope:e.__scopeToggleGroup,type:"multiple",value:o,onItemActivate:c,onItemDeactivate:u,children:s.jsx(dq,{...i,ref:t})})});yO.displayName=Yc;var[Fye,Bye]=oq(Yc),dq=L.forwardRef((e,t)=>{const{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:a=!0,orientation:i,dir:o,loop:l=!0,...c}=e,u=lq(n),d=wl(o),f={role:"group",dir:d,...c};return s.jsx(Fye,{scope:n,rovingFocus:a,disabled:r,children:a?s.jsx(Yj,{asChild:!0,...u,orientation:i,dir:d,loop:l,children:s.jsx(Pe.div,{...f,ref:t})}):s.jsx(Pe.div,{...f,ref:t})})}),_0="ToggleGroupItem",fq=L.forwardRef((e,t)=>{const n=uq(_0,e.__scopeToggleGroup),r=Bye(_0,e.__scopeToggleGroup),a=lq(e.__scopeToggleGroup),i=n.value.includes(e.value),o=r.disabled||e.disabled,l={...e,pressed:i,disabled:o},c=L.useRef(null);return r.rovingFocus?s.jsx(Xj,{asChild:!0,...a,focusable:!o,active:i,ref:c,children:s.jsx(E$,{...l,ref:t})}):s.jsx(E$,{...l,ref:t})});fq.displayName=_0;var E$=L.forwardRef((e,t)=>{const{__scopeToggleGroup:n,value:r,...a}=e,i=uq(_0,n),o={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},l=i.type==="single"?o:void 0;return s.jsx(gO,{...l,...a,ref:t,onPressedChange:c=>{c?i.onItemActivate(r):i.onItemDeactivate(r)}})}),hq=yO,mq=fq;const pq=kd("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),zye=x.forwardRef(({className:e,variant:t,size:n,...r},a)=>s.jsx(iq,{ref:a,className:te(pq({variant:t,size:n,className:e})),...r}));zye.displayName=iq.displayName;const gq=x.createContext({size:"default",variant:"default"}),yq=x.forwardRef(({className:e,variant:t,size:n,children:r,...a},i)=>s.jsx(hq,{ref:i,className:te("flex items-center justify-center gap-1",e),...a,children:s.jsx(gq.Provider,{value:{variant:t,size:n},children:r})}));yq.displayName=hq.displayName;const I2=x.forwardRef(({className:e,children:t,variant:n,size:r,...a},i)=>{const o=x.useContext(gq);return s.jsx(mq,{ref:i,className:te(pq({variant:o.variant||n,size:o.size||r}),e),...a,children:t})});I2.displayName=mq.displayName;function Zn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Zn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Uye={value:()=>{}};function v1(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new xb(n)}function xb(e){this._=e}function Vye(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}xb.prototype=v1.prototype={constructor:xb,on:function(e,t){var n=this._,r=Vye(e+"",n),a,i=-1,o=r.length;if(arguments.length<2){for(;++i<o;)if((a=(e=r[i]).type)&&(a=Wye(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<o;)if(a=(e=r[i]).type)n[a]=A$(n[a],e.name,t);else if(t==null)for(a in n)n[a]=A$(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new xb(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,i;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,a=i.length;r<a;++r)i[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,i=r.length;a<i;++a)r[a].value.apply(t,n)}};function Wye(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function A$(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=Uye,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var L2="http://www.w3.org/1999/xhtml";const P$={svg:"http://www.w3.org/2000/svg",xhtml:L2,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function x1(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),P$.hasOwnProperty(t)?{space:P$[t],local:e}:e}function qye(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===L2&&t.documentElement.namespaceURI===L2?t.createElement(e):t.createElementNS(n,e)}}function Hye(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function vq(e){var t=x1(e);return(t.local?Hye:qye)(t)}function Kye(){}function vO(e){return e==null?Kye:function(){return this.querySelector(e)}}function Gye(e){typeof e!="function"&&(e=vO(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=new Array(o),c,u,d=0;d<o;++d)(c=i[d])&&(u=e.call(c,c.__data__,d,i))&&("__data__"in c&&(u.__data__=c.__data__),l[d]=u);return new os(r,this._parents)}function Yye(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Xye(){return[]}function xq(e){return e==null?Xye:function(){return this.querySelectorAll(e)}}function Qye(e){return function(){return Yye(e.apply(this,arguments))}}function Jye(e){typeof e=="function"?e=Qye(e):e=xq(e);for(var t=this._groups,n=t.length,r=[],a=[],i=0;i<n;++i)for(var o=t[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&(r.push(e.call(c,c.__data__,u,o)),a.push(c));return new os(r,a)}function bq(e){return function(){return this.matches(e)}}function wq(e){return function(t){return t.matches(e)}}var Zye=Array.prototype.find;function eve(e){return function(){return Zye.call(this.children,e)}}function tve(){return this.firstElementChild}function nve(e){return this.select(e==null?tve:eve(typeof e=="function"?e:wq(e)))}var rve=Array.prototype.filter;function ave(){return Array.from(this.children)}function sve(e){return function(){return rve.call(this.children,e)}}function ive(e){return this.selectAll(e==null?ave:sve(typeof e=="function"?e:wq(e)))}function ove(e){typeof e!="function"&&(e=bq(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new os(r,this._parents)}function jq(e){return new Array(e.length)}function lve(){return new os(this._enter||this._groups.map(jq),this._parents)}function E0(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}E0.prototype={constructor:E0,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function cve(e){return function(){return e}}function uve(e,t,n,r,a,i){for(var o=0,l,c=t.length,u=i.length;o<u;++o)(l=t[o])?(l.__data__=i[o],r[o]=l):n[o]=new E0(e,i[o]);for(;o<c;++o)(l=t[o])&&(a[o]=l)}function dve(e,t,n,r,a,i,o){var l,c,u=new Map,d=t.length,f=i.length,h=new Array(d),m;for(l=0;l<d;++l)(c=t[l])&&(h[l]=m=o.call(c,c.__data__,l,t)+"",u.has(m)?a[l]=c:u.set(m,c));for(l=0;l<f;++l)m=o.call(e,i[l],l,i)+"",(c=u.get(m))?(r[l]=c,c.__data__=i[l],u.delete(m)):n[l]=new E0(e,i[l]);for(l=0;l<d;++l)(c=t[l])&&u.get(h[l])===c&&(a[l]=c)}function fve(e){return e.__data__}function hve(e,t){if(!arguments.length)return Array.from(this,fve);var n=t?dve:uve,r=this._parents,a=this._groups;
vendor: 32,877 bytes, line 801
801typeof e!="function"&&(e=cve(e));for(var i=a.length,o=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=r[u],f=a[u],h=f.length,m=mve(e.call(d,d&&d.__data__,u,r)),p=m.length,g=l[u]=new Array(p),y=o[u]=new Array(p),v=c[u]=new Array(h);n(d,f,g,y,v,m,t);for(var w=0,b=0,j,N;w<p;++w)if(j=g[w]){for(w>=b&&(b=w+1);!(N=y[b])&&++b<p;);j._next=N||null}}return o=new os(o,r),o._enter=l,o._exit=c,o}function mve(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pve(){return new os(this._exit||this._groups.map(jq),this._parents)}function gve(e,t,n){var r=this.enter(),a=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?i.remove():n(i),r&&a?r.merge(a).order():a}function yve(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,i=r.length,o=Math.min(a,i),l=new Array(a),c=0;c<o;++c)for(var u=n[c],d=r[c],f=u.length,h=l[c]=new Array(f),m,p=0;p<f;++p)(m=u[p]||d[p])&&(h[p]=m);for(;c<a;++c)l[c]=n[c];return new os(l,this._parents)}function vve(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,i=r[a],o;--a>=0;)(o=r[a])&&(i&&o.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(o,i),i=o);return this}function xve(e){e||(e=bve);function t(f,h){return f&&h?e(f.__data__,h.__data__):!f-!h}for(var n=this._groups,r=n.length,a=new Array(r),i=0;i<r;++i){for(var o=n[i],l=o.length,c=a[i]=new Array(l),u,d=0;d<l;++d)(u=o[d])&&(c[d]=u);c.sort(t)}return new os(a,this._parents).order()}function bve(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function wve(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function jve(){return Array.from(this)}function Nve(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length;a<i;++a){var o=r[a];if(o)return o}return null}function Sve(){let e=0;for(const t of this)++e;return e}function Cve(){return!this.node()}function _ve(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],i=0,o=a.length,l;i<o;++i)(l=a[i])&&e.call(l,l.__data__,i,a);return this}function Eve(e){return function(){this.removeAttribute(e)}}function Ave(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Pve(e,t){return function(){this.setAttribute(e,t)}}function kve(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ove(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Tve(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Mve(e,t){var n=x1(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ave:Eve:typeof t=="function"?n.local?Tve:Ove:n.local?kve:Pve)(n,t))}function Nq(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Rve(e){return function(){this.style.removeProperty(e)}}function Dve(e,t,n){return function(){this.style.setProperty(e,t,n)}}function $ve(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ive(e,t,n){return arguments.length>1?this.each((t==null?Rve:typeof t=="function"?$ve:Dve)(e,t,n??"")):jh(this.node(),e)}function jh(e,t){return e.style.getPropertyValue(t)||Nq(e).getComputedStyle(e,null).getPropertyValue(t)}function Lve(e){return function(){delete this[e]}}function Fve(e,t){return function(){this[e]=t}}function Bve(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function zve(e,t){return arguments.length>1?this.each((t==null?Lve:typeof t=="function"?Bve:Fve)(e,t)):this.node()[e]}function Sq(e){return e.trim().split(/^|\s+/)}function xO(e){return e.classList||new Cq(e)}function Cq(e){this._node=e,this._names=Sq(e.getAttribute("class")||"")}Cq.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function _q(e,t){for(var n=xO(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function Eq(e,t){for(var n=xO(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function Uve(e){return function(){_q(this,e)}}function Vve(e){return function(){Eq(this,e)}}function Wve(e,t){return function(){(t.apply(this,arguments)?_q:Eq)(this,e)}}function qve(e,t){var n=Sq(e+"");if(arguments.length<2){for(var r=xO(this.node()),a=-1,i=n.length;++a<i;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?Wve:t?Uve:Vve)(n,t))}function Hve(){this.textContent=""}function Kve(e){return function(){this.textContent=e}}function Gve(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Yve(e){return arguments.length?this.each(e==null?Hve:(typeof e=="function"?Gve:Kve)(e)):this.node().textContent}function Xve(){this.innerHTML=""}function Qve(e){return function(){this.innerHTML=e}}function Jve(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Zve(e){return arguments.length?this.each(e==null?Xve:(typeof e=="function"?Jve:Qve)(e)):this.node().innerHTML}function exe(){this.nextSibling&&this.parentNode.appendChild(this)}function txe(){return this.each(exe)}function nxe(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function rxe(){return this.each(nxe)}function axe(e){var t=typeof e=="function"?e:vq(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function sxe(){return null}function ixe(e,t){var n=typeof e=="function"?e:vq(e),r=t==null?sxe:typeof t=="function"?t:vO(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function oxe(){var e=this.parentNode;e&&e.removeChild(this)}function lxe(){return this.each(oxe)}function cxe(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uxe(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dxe(e){return this.select(e?uxe:cxe)}function fxe(e){return arguments.length?this.property("__data__",e):this.node().__data__}function hxe(e){return function(t){e.call(this,t,this.__data__)}}function mxe(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function pxe(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,i;n<a;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function gxe(e,t,n){return function(){var r=this.__on,a,i=hxe(t);if(r){for(var o=0,l=r.length;o<l;++o)if((a=r[o]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=i,a.options=n),a.value=t;return}}this.addEventListener(e.type,i,n),a={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(a):this.__on=[a]}}function yxe(e,t,n){var r=mxe(e+""),a,i=r.length,o;if(arguments.length<2){var l=this.node().__on;if(l){for(var c=0,u=l.length,d;c<u;++c)for(a=0,d=l[c];a<i;++a)if((o=r[a]).type===d.type&&o.name===d.name)return d.value}return}for(l=t?gxe:pxe,a=0;a<i;++a)this.each(l(r[a],t,n));return this}function Aq(e,t,n){var r=Nq(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function vxe(e,t){return function(){return Aq(this,e,t)}}function xxe(e,t){return function(){return Aq(this,e,t.apply(this,arguments))}}function bxe(e,t){return this.each((typeof t=="function"?xxe:vxe)(e,t))}function*wxe(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,i=r.length,o;a<i;++a)(o=r[a])&&(yield o)}var Pq=[null];function os(e,t){this._groups=e,this._parents=t}function Sv(){return new os([[document.documentElement]],Pq)}function jxe(){return this}os.prototype=Sv.prototype={constructor:os,select:Gye,selectAll:Jye,selectChild:nve,selectChildren:ive,filter:ove,data:hve,enter:lve,exit:pve,join:gve,merge:yve,selection:jxe,order:vve,sort:xve,call:wve,nodes:jve,node:Nve,size:Sve,empty:Cve,each:_ve,attr:Mve,style:Ive,property:zve,classed:qve,text:Yve,html:Zve,raise:txe,lower:rxe,append:axe,insert:ixe,remove:lxe,clone:dxe,datum:fxe,on:yxe,dispatch:bxe,[Symbol.iterator]:wxe};function ts(e){return typeof e=="string"?new os([[document.querySelector(e)]],[document.documentElement]):new os([[e]],Pq)}function Nxe(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Hs(e,t){if(e=Nxe(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const Sxe={passive:!1},Kg={capture:!0,passive:!1};function IS(e){e.stopImmediatePropagation()}function Ff(e){e.preventDefault(),e.stopImmediatePropagation()}function kq(e){var t=e.document.documentElement,n=ts(e).on("dragstart.drag",Ff,Kg);"onselectstart"in t?n.on("selectstart.drag",Ff,Kg):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Oq(e,t){var n=e.document.documentElement,r=ts(e).on("dragstart.drag",null);t&&(r.on("click.drag",Ff,Kg),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Ax=e=>()=>e;function F2(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:i,x:o,y:l,dx:c,dy:u,dispatch:d}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:d}})}F2.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Cxe(e){return!e.ctrlKey&&!e.button}function _xe(){return this.parentNode}function Exe(e,t){return t??{x:e.x,y:e.y}}function Axe(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tq(){var e=Cxe,t=_xe,n=Exe,r=Axe,a={},i=v1("start","drag","end"),o=0,l,c,u,d,f=0;function h(j){j.on("mousedown.drag",m).filter(r).on("touchstart.drag",y).on("touchmove.drag",v,Sxe).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(j,N){if(!(d||!e.call(this,j,N))){var S=b(this,t.call(this,j,N),j,N,"mouse");S&&(ts(j.view).on("mousemove.drag",p,Kg).on("mouseup.drag",g,Kg),kq(j.view),IS(j),u=!1,l=j.clientX,c=j.clientY,S("start",j))}}function p(j){if(Ff(j),!u){var N=j.clientX-l,S=j.clientY-c;u=N*N+S*S>f}a.mouse("drag",j)}function g(j){ts(j.view).on("mousemove.drag mouseup.drag",null),Oq(j.view,u),Ff(j),a.mouse("end",j)}function y(j,N){if(e.call(this,j,N)){var S=j.changedTouches,C=t.call(this,j,N),_=S.length,E,T;for(E=0;E<_;++E)(T=b(this,C,j,N,S[E].identifier,S[E]))&&(IS(j),T("start",j,S[E]))}}function v(j){var N=j.changedTouches,S=N.length,C,_;for(C=0;C<S;++C)(_=a[N[C].identifier])&&(Ff(j),_("drag",j,N[C]))}function w(j){var N=j.changedTouches,S=N.length,C,_;for(d&&clearTimeout(d),d=setTimeout(function(){d=null},500),C=0;C<S;++C)(_=a[N[C].identifier])&&(IS(j),_("end",j,N[C]))}function b(j,N,S,C,_,E){var T=i.copy(),P=Hs(E||S,N),k,D,A;if((A=n.call(j,new F2("beforestart",{sourceEvent:S,target:h,identifier:_,active:o,x:P[0],y:P[1],dx:0,dy:0,dispatch:T}),C))!=null)return k=A.x-P[0]||0,D=A.y-P[1]||0,function I(M,$,R){var O=P,F;switch(M){case"start":a[_]=I,F=o++;break;case"end":delete a[_],--o;case"drag":P=Hs(R||$,N),F=o;break}T.call(M,j,new F2(M,{sourceEvent:$,subject:A,target:h,identifier:_,active:F,x:P[0]+k,y:P[1]+D,dx:P[0]-O[0],dy:P[1]-O[1],dispatch:T}),C)}}return h.filter=function(j){return arguments.length?(e=typeof j=="function"?j:Ax(!!j),h):e},h.container=function(j){return arguments.length?(t=typeof j=="function"?j:Ax(j),h):t},h.subject=function(j){return arguments.length?(n=typeof j=="function"?j:Ax(j),h):n},h.touchable=function(j){return arguments.length?(r=typeof j=="function"?j:Ax(!!j),h):r},h.on=function(){var j=i.on.apply(i,arguments);return j===i?h:j},h.clickDistance=function(j){return arguments.length?(f=(j=+j)*j,h):Math.sqrt(f)},h}function bO(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Mq(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Cv(){}var Gg=.7,A0=1/Gg,Bf="\\s*([+-]?\\d+)\\s*",Yg="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Qi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Pxe=/^#([0-9a-f]{3,8})$/,kxe=new RegExp(`^rgb\\(${Bf},${Bf},${Bf}\\)$`),Oxe=new RegExp(`^rgb\\(${Qi},${Qi},${Qi}\\)$`),Txe=new RegExp(`^rgba\\(${Bf},${Bf},${Bf},${Yg}\\)$`),Mxe=new RegExp(`^rgba\\(${Qi},${Qi},${Qi},${Yg}\\)$`),Rxe=new RegExp(`^hsl\\(${Yg},${Qi},${Qi}\\)$`),Dxe=new RegExp(`^hsla\\(${Yg},${Qi},${Qi},${Yg}\\)$`),k$={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};bO(Cv,gd,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:O$,formatHex:O$,formatHex8:$xe,formatHsl:Ixe,formatRgb:T$,toString:T$});function O$(){return this.rgb().formatHex()}function $xe(){return this.rgb().formatHex8()}function Ixe(){return Rq(this).formatHsl()}function T$(){return this.rgb().formatRgb()}function gd(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Pxe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?M$(t):n===3?new Ta(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Px(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Px(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kxe.exec(e))?new Ta(t[1],t[2],t[3],1):(t=Oxe.exec(e))?new Ta(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Txe.exec(e))?Px(t[1],t[2],t[3],t[4]):(t=Mxe.exec(e))?Px(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Rxe.exec(e))?$$(t[1],t[2]/100,t[3]/100,1):(t=Dxe.exec(e))?$$(t[1],t[2]/100,t[3]/100,t[4]):k$.hasOwnProperty(e)?M$(k$[e]):e==="transparent"?new Ta(NaN,NaN,NaN,0):null}function M$(e){return new Ta(e>>16&255,e>>8&255,e&255,1)}function Px(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ta(e,t,n,r)}function Lxe(e){return e instanceof Cv||(e=gd(e)),e?(e=e.rgb(),new Ta(e.r,e.g,e.b,e.opacity)):new Ta}function B2(e,t,n,r){return arguments.length===1?Lxe(e):new Ta(e,t,n,r??1)}function Ta(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}bO(Ta,B2,Mq(Cv,{brighter(e){return e=e==null?A0:Math.pow(A0,e),new Ta(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Gg:Math.pow(Gg,e),new Ta(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ta(Ku(this.r),Ku(this.g),Ku(this.b),P0(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:R$,formatHex:R$,formatHex8:Fxe,formatRgb:D$,toString:D$}));function R$(){return`#${Eu(this.r)}${Eu(this.g)}${Eu(this.b)}`}function Fxe(){return`#${Eu(this.r)}${Eu(this.g)}${Eu(this.b)}${Eu((isNaN(this.opacity)?1:this.opacity)*255)}`}function D$(){const e=P0(this.opacity);return`${e===1?"rgb(":"rgba("}${Ku(this.r)}, ${Ku(this.g)}, ${Ku(this.b)}${e===1?")":`, ${e})`}`}function P0(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ku(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Eu(e){return e=Ku(e),(e<16?"0":"")+e.toString(16)}function $$(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Js(e,t,n,r)}function Rq(e){if(e instanceof Js)return new Js(e.h,e.s,e.l,e.opacity);if(e instanceof Cv||(e=gd(e)),!e)return new Js;if(e instanceof Js)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),i=Math.max(t,n,r),o=NaN,l=i-a,c=(i+a)/2;return l?(t===i?o=(n-r)/l+(n<r)*6:n===i?o=(r-t)/l+2:o=(t-n)/l+4,l/=c<.5?i+a:2-i-a,o*=60):l=c>0&&c<1?0:o,new Js(o,l,c,e.opacity)}function Bxe(e,t,n,r){return arguments.length===1?Rq(e):new Js(e,t,n,r??1)}function Js(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}bO(Js,Bxe,Mq(Cv,{brighter(e){return e=e==null?A0:Math.pow(A0,e),new Js(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Gg:Math.pow(Gg,e),new Js(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new Ta(LS(e>=240?e-240:e+120,a,r),LS(e,a,r),LS(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new Js(I$(this.h),kx(this.s),kx(this.l),P0(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=P0(this.opacity);return`${e===1?"hsl(":"hsla("}${I$(this.h)}, ${kx(this.s)*100}%, ${kx(this.l)*100}%${e===1?")":`, ${e})`}`}}));function I$(e){return e=(e||0)%360,e<0?e+360:e}function kx(e){return Math.max(0,Math.min(1,e||0))}function LS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const wO=e=>()=>e;function zxe(e,t){return function(n){return e+n*t}}function Uxe(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function Vxe(e){return(e=+e)==1?Dq:function(t,n){return n-t?Uxe(t,n,e):wO(isNaN(t)?n:t)}}function Dq(e,t){var n=t-e;return n?zxe(e,n):wO(isNaN(e)?t:e)}const k0=function e(t){var n=Vxe(t);function r(a,i){var o=n((a=B2(a)).r,(i=B2(i)).r),l=n(a.g,i.g),c=n(a.b,i.b),u=Dq(a.opacity,i.opacity);return function(d){return a.r=o(d),a.g=l(d),a.b=c(d),a.opacity=u(d),a+""}}return r.gamma=e,r}(1);function Wxe(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(i){for(a=0;a<n;++a)r[a]=e[a]*(1-i)+t[a]*i;return r}}function qxe(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Hxe(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),i=new Array(n),o;for(o=0;o<r;++o)a[o]=zo(e[o],t[o]);for(;o<n;++o)i[o]=t[o];return function(l){for(o=0;o<r;++o)i[o]=a[o](l);return i}}function Kxe(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Qs(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gxe(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=zo(e[a],t[a]):r[a]=t[a];return function(i){for(a in n)r[a]=n[a](i);return r}}var z2=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,FS=new RegExp(z2.source,"g");function Yxe(e){return function(){return e}}function Xxe(e){return function(t){return e(t)+""}}function $q(e,t){var n=z2.lastIndex=FS.lastIndex=0,r,a,i,o=-1,l=[],c=[];for(e=e+"",t=t+"";(r=z2.exec(e))&&(a=FS.exec(t));)(i=a.index)>n&&(i=t.slice(n,i),l[o]?l[o]+=i:l[++o]=i),(r=r[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,c.push({i:o,x:Qs(r,a)})),n=FS.lastIndex;return n<t.length&&(i=t.slice(n),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?Xxe(c[0].x):Yxe(t):(t=c.length,function(u){for(var d=0,f;d<t;++d)l[(f=c[d]).i]=f.x(u);return l.join("")})}function zo(e,t){var n=typeof t,r;return t==null||n==="boolean"?wO(t):(n==="number"?Qs:n==="string"?(r=gd(t))?(t=r,k0):$q:t instanceof gd?k0:t instanceof Date?Kxe:qxe(t)?Wxe:Array.isArray(t)?Hxe:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Gxe:Qs)(e,t)}function jO(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}var L$=180/Math.PI,U2={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Iq(e,t,n,r,a,i){var o,l,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,c/=l),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:a,translateY:i,rotate:Math.atan2(t,e)*L$,skewX:Math.atan(c)*L$,scaleX:o,scaleY:l}}var Ox;function Qxe(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?U2:Iq(t.a,t.b,t.c,t.d,t.e,t.f)}function Jxe(e){return e==null||(Ox||(Ox=document.createElementNS("http://www.w3.org/2000/svg","g")),Ox.setAttribute("transform",e),!(e=Ox.transform.baseVal.consolidate()))?U2:(e=e.matrix,Iq(e.a,e.b,e.c,e.d,e.e,e.f))}function Lq(e,t,n,r){function a(u){return u.length?u.pop()+" ":""}function i(u,d,f,h,m,p){if(u!==f||d!==h){var g=m.push("translate(",null,t,null,n);p.push({i:g-4,x:Qs(u,f)},{i:g-2,x:Qs(d,h)})}else(f||h)&&m.push("translate("+f+t+h+n)}function o(u,d,f,h){u!==d?(u-d>180?d+=360:d-u>180&&(u+=360),h.push({i:f.push(a(f)+"rotate(",null,r)-2,x:Qs(u,d)})):d&&f.push(a(f)+"rotate("+d+r)}function l(u,d,f,h){u!==d?h.push({i:f.push(a(f)+"skewX(",null,r)-2,x:Qs(u,d)}):d&&f.push(a(f)+"skewX("+d+r)}function c(u,d,f,h,m,p){if(u!==f||d!==h){var g=m.push(a(m)+"scale(",null,",",null,")");p.push({i:g-4,x:Qs(u,f)},{i:g-2,x:Qs(d,h)})}else(f!==1||h!==1)&&m.push(a(m)+"scale("+f+","+h+")")}return function(u,d){var f=[],h=[];return u=e(u),d=e(d),i(u.translateX,u.translateY,d.translateX,d.translateY,f,h),o(u.rotate,d.rotate,f,h),l(u.skewX,d.skewX,f,h),c(u.scaleX,u.scaleY,d.scaleX,d.scaleY,f,h),u=d=null,function(m){for(var p=-1,g=h.length,y;++p<g;)f[(y=h[p]).i]=y.x(m);return f.join("")}}}var Zxe=Lq(Qxe,"px, ","px)","deg)"),ebe=Lq(Jxe,", ",")",")"),tbe=1e-12;function F$(e){return((e=Math.exp(e))+1/e)/2}function nbe(e){return((e=Math.exp(e))-1/e)/2}function rbe(e){return((e=Math.exp(2*e))-1)/(e+1)}const bb=function e(t,n,r){function a(i,o){var l=i[0],c=i[1],u=i[2],d=o[0],f=o[1],h=o[2],m=d-l,p=f-c,g=m*m+p*p,y,v;if(g<tbe)v=Math.log(h/u)/t,y=function(C){return[l+C*m,c+C*p,u*Math.exp(t*C*v)]};else{var w=Math.sqrt(g),b=(h*h-u*u+r*g)/(2*u*n*w),j=(h*h-u*u-r*g)/(2*h*n*w),N=Math.log(Math.sqrt(b*b+1)-b),S=Math.log(Math.sqrt(j*j+1)-j);v=(S-N)/t,y=function(C){var _=C*v,E=F$(N),T=u/(n*w)*(E*rbe(t*_+N)-nbe(N));return[l+T*m,c+T*p,u*E/F$(t*_+N)]}}return y.duration=v*1e3*t/Math.SQRT2,y}return a.rho=function(i){var o=Math.max(.001,+i),l=o*o,c=l*l;return e(o,l,c)},a}(Math.SQRT2,2,4);function abe(e,t){t===void 0&&(t=e,e=zo);for(var n=0,r=t.length-1,a=t[0],i=new Array(r<0?0:r);n<r;)i[n]=e(a,a=t[++n]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return i[l](o-l)}}var Nh=0,Rp=0,cp=0,Fq=1e3,O0,Dp,T0=0,yd=0,b1=0,Xg=typeof performance=="object"&&performance.now?performance:Date,Bq=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function NO(){return yd||(Bq(sbe),yd=Xg.now()+b1)}function sbe(){yd=0}function M0(){this._call=this._time=this._next=null}M0.prototype=zq.prototype={constructor:M0,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?NO():+n)+(t==null?0:+t),!this._next&&Dp!==this&&(Dp?Dp._next=this:O0=this,Dp=this),this._call=e,this._time=n,V2()},stop:function(){this._call&&(this._call=null,this._time=1/0,V2())}};function zq(e,t,n){var r=new M0;return r.restart(e,t,n),r}function ibe(){NO(),++Nh;for(var e=O0,t;e;)(t=yd-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Nh}function B$(){yd=(T0=Xg.now())+b1,Nh=Rp=0;try{ibe()}finally{Nh=0,lbe(),yd=0}}function obe(){var e=Xg.now(),t=e-T0;t>Fq&&(b1-=t,T0=e)}function lbe(){for(var e,t=O0,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:O0=n);Dp=e,V2(r)}function V2(e){if(!Nh){Rp&&(Rp=clearTimeout(Rp));var t=e-yd;t>24?(e<1/0&&(Rp=setTimeout(B$,e-Xg.now()-b1)),cp&&(cp=clearInterval(cp))):(cp||(T0=Xg.now(),cp=setInterval(obe,Fq)),Nh=1,Bq(B$))}}function z$(e,t,n){var r=new M0;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var cbe=v1("start","end","cancel","interrupt"),ube=[],Uq=0,U$=1,W2=2,wb=3,V$=4,q2=5,jb=6;function w1(e,t,n,r,a,i){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;dbe(e,n,{name:t,index:r,group:a,on:cbe,tween:ube,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:Uq})}function SO(e,t){var n=Si(e,t);if(n.state>Uq)throw new Error("too late; already scheduled");return n}function mo(e,t){var n=Si(e,t);if(n.state>wb)throw new Error("too late; already running");return n}function Si(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function dbe(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=zq(i,0,n.time);function i(u){n.state=U$,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var d,f,h,m;if(n.state!==U$)return c();for(d in r)if(m=r[d],m.name===n.name){if(m.state===wb)return z$(o);m.state===V$?(m.state=jb,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[d]):+d<t&&(m.state=jb,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete r[d])}if(z$(function(){n.state===wb&&(n.state=V$,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=W2,n.on.call("start",e,e.__data__,n.index,n.group),n.state===W2){for(n.state=wb,a=new Array(h=n.tween.length),d=0,f=-1;d<h;++d)(m=n.tween[d].value.call(e,e.__data__,n.index,n.group))&&(a[++f]=m);a.length=f+1}}function l(u){for(var d=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(c),n.state=q2,1),f=-1,h=a.length;++f<h;)a[f].call(e,d);n.state===q2&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=jb,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Nb(e,t){var n=e.__transition,r,a,i=!0,o;if(n){t=t==null?null:t+"";for(o in n){if((r=n[o]).name!==t){i=!1;continue}a=r.state>W2&&r.state<q2,r.state=jb,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[o]}i&&delete e.__transition}}function fbe(e){return this.each(function(){Nb(this,e)})}function hbe(e,t){var n,r;return function(){var a=mo(this,e),i=a.tween;if(i!==n){r=n=i;for(var o=0,l=r.length;o<l;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}a.tween=r}}function mbe(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var i=mo(this,e),o=i.tween;if(o!==r){a=(r=o).slice();for(var l={name:t,value:n},c=0,u=a.length;c<u;++c)if(a[c].name===t){a[c]=l;break}c===u&&a.push(l)}i.tween=a}}function pbe(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Si(this.node(),n).tween,a=0,i=r.length,o;a<i;++a)if((o=r[a]).name===e)return o.value;return null}return this.each((t==null?hbe:mbe)(n,e,t))}function CO(e,t,n){var r=e._id;return e.each(function(){var a=mo(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return Si(a,r).value[t]}}function Vq(e,t){var n;return(typeof t=="number"?Qs:t instanceof gd?k0:(n=gd(t))?(t=n,k0):$q)(e,t)}function gbe(e){return function(){this.removeAttribute(e)}}function ybe(e){return function(){this.removeAttributeNS(e.space,e.local)}}function vbe(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttribute(e);return o===a?null:o===r?i:i=t(r=o,n)}}function xbe(e,t,n){var r,a=n+"",i;return function(){var o=this.getAttributeNS(e.space,e.local);return o===a?null:o===r?i:i=t(r=o,n)}}function bbe(e,t,n){var r,a,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=l+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,l)))}}function wbe(e,t,n){var r,a,i;return function(){var o,l=n(this),c;return l==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=l+"",o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,l)))}}function jbe(e,t){var n=x1(e),r=n==="transform"?ebe:Vq;return this.attrTween(e,typeof t=="function"?(n.local?wbe:bbe)(n,r,CO(this,"attr."+e,t)):t==null?(n.local?ybe:gbe)(n):(n.local?xbe:vbe)(n,r,t))}function Nbe(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function Sbe(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Cbe(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Sbe(e,i)),n}return a._value=t,a}function _be(e,t){var n,r;function a(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&Nbe(e,i)),n}return a._value=t,a}function Ebe(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=x1(e);return this.tween(n,(r.local?Cbe:_be)(r,t))}function Abe(e,t){return function(){SO(this,e).delay=+t.apply(this,arguments)}}function Pbe(e,t){return t=+t,function(){SO(this,e).delay=t}}function kbe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Abe:Pbe)(t,e)):Si(this.node(),t).delay}function Obe(e,t){return function(){mo(this,e).duration=+t.apply(this,arguments)}}function Tbe(e,t){return t=+t,function(){mo(this,e).duration=t}}function Mbe(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Obe:Tbe)(t,e)):Si(this.node(),t).duration}function Rbe(e,t){if(typeof t!="function")throw new Error;return function(){mo(this,e).ease=t}}function Dbe(e){var t=this._id;return arguments.length?this.each(Rbe(t,e)):Si(this.node(),t).ease}function $be(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;mo(this,e).ease=n}}function Ibe(e){if(typeof e!="function")throw new Error;return this.each($be(this._id,e))}function Lbe(e){typeof e!="function"&&(e=bq(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var i=t[a],o=i.length,l=r[a]=[],c,u=0;u<o;++u)(c=i[u])&&e.call(c,c.__data__,u,i)&&l.push(c);return new dl(r,this._parents,this._name,this._id)}function Fbe(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,i=Math.min(r,a),o=new Array(r),l=0;l<i;++l)for(var c=t[l],u=n[l],d=c.length,f=o[l]=new Array(d),h,m=0;m<d;++m)(h=c[m]||u[m])&&(f[m]=h);for(;l<r;++l)o[l]=t[l];return new dl(o,this._parents,this._name,this._id)}function Bbe(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>
vendor: 5,234 bytes, line 801
801=0&&(t=t.slice(0,n)),!t||t==="start"})}function zbe(e,t,n){var r,a,i=Bbe(t)?SO:mo;return function(){var o=i(this,e),l=o.on;l!==r&&(a=(r=l).copy()).on(t,n),o.on=a}}function Ube(e,t){var n=this._id;return arguments.length<2?Si(this.node(),n).on.on(e):this.each(zbe(n,e,t))}function Vbe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Wbe(){return this.on("end.remove",Vbe(this._id))}function qbe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=vO(e));for(var r=this._groups,a=r.length,i=new Array(a),o=0;o<a;++o)for(var l=r[o],c=l.length,u=i[o]=new Array(c),d,f,h=0;h<c;++h)(d=l[h])&&(f=e.call(d,d.__data__,h,l))&&("__data__"in d&&(f.__data__=d.__data__),u[h]=f,w1(u[h],t,n,h,u,Si(d,n)));return new dl(i,this._parents,t,n)}function Hbe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xq(e));for(var r=this._groups,a=r.length,i=[],o=[],l=0;l<a;++l)for(var c=r[l],u=c.length,d,f=0;f<u;++f)if(d=c[f]){for(var h=e.call(d,d.__data__,f,c),m,p=Si(d,n),g=0,y=h.length;g<y;++g)(m=h[g])&&w1(m,t,n,g,h,p);i.push(h),o.push(d)}return new dl(i,o,t,n)}var Kbe=Sv.prototype.constructor;function Gbe(){return new Kbe(this._groups,this._parents)}function Ybe(e,t){var n,r,a;return function(){var i=jh(this,e),o=(this.style.removeProperty(e),jh(this,e));return i===o?null:i===n&&o===r?a:a=t(n=i,r=o)}}function Wq(e){return function(){this.style.removeProperty(e)}}function Xbe(e,t,n){var r,a=n+"",i;return function(){var o=jh(this,e);return o===a?null:o===r?i:i=t(r=o,n)}}function Qbe(e,t,n){var r,a,i;return function(){var o=jh(this,e),l=n(this),c=l+"";return l==null&&(c=l=(this.style.removeProperty(e),jh(this,e))),o===c?null:o===r&&c===a?i:(a=c,i=t(r=o,l))}}function Jbe(e,t){var n,r,a,i="style."+t,o="end."+i,l;return function(){var c=mo(this,e),u=c.on,d=c.value[i]==null?l||(l=Wq(t)):void 0;(u!==n||a!==d)&&(r=(n=u).copy()).on(o,a=d),c.on=r}}function Zbe(e,t,n){var r=(e+="")=="transform"?Zxe:Vq;return t==null?this.styleTween(e,Ybe(e,r)).on("end.style."+e,Wq(e)):typeof t=="function"?this.styleTween(e,Qbe(e,r,CO(this,"style."+e,t))).each(Jbe(this._id,e)):this.styleTween(e,Xbe(e,r,t),n).on("end.style."+e,null)}function e0e(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function t0e(e,t,n){var r,a;function i(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&e0e(e,o,n)),r}return i._value=t,i}function n0e(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,t0e(e,t,n??""))}function r0e(e){return function(){this.textContent=e}}function a0e(e){return function(){var t=e(this);this.textContent=t??""}}function s0e(e){return this.tween("text",typeof e=="function"?a0e(CO(this,"text",e)):r0e(e==null?"":e+""))}function i0e(e){return function(t){this.textContent=e.call(this,t)}}function o0e(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&i0e(a)),t}return r._value=e,r}function l0e(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,o0e(e))}function c0e(){for(var e=this._name,t=this._id,n=qq(),r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],l=o.length,c,u=0;u<l;++u)if(c=o[u]){var d=Si(c,t);w1(c,e,n,u,o,{time:d.time+d.delay+d.duration,delay:0,duration:d.duration,ease:d.ease})}return new dl(r,this._parents,e,n)}function u0e(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(i,o){var l={value:o},c={value:function(){--a===0&&i()}};n.each(function(){var u=mo(this,r),d=u.on;d!==e&&(t=(e=d).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(c)),u.on=t}),a===0&&i()})}var d0e=0;function dl(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function qq(){return++d0e}var wo=Sv.prototype;dl.prototype={constructor:dl,select:qbe,selectAll:Hbe,selectChild:wo.selectChild,selectChildren:wo.selectChildren,filter:Lbe,merge:Fbe,selection:Gbe,transition:c0e,call:wo.call,nodes:wo.nodes,node:wo.node,size:wo.size,empty:wo.empty,each:wo.each,on:Ube,attr:jbe,attrTween:Ebe,style:Zbe,styleTween:n0e,text:s0e,textTween:l0e,remove:Wbe,tween:pbe,delay:kbe,duration:Mbe,ease:Dbe,easeVarying:Ibe,end:u0e,[Symbol.iterator]:wo[Symbol.iterator]};function f0e(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var h0e={time:null,delay:0,duration:250,ease:f0e};function m0e(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function p0e(e){var t,n;e instanceof dl?(t=e._id,e=e._name):(t=qq(),(n=h0e).time=NO(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,i=0;i<a;++i)for(var o=r[i],l=o.length,c,u=0;u<l;++u)(c=o[u])&&w1(c,e,t,u,o,n||m0e(c,t));return new dl(r,this._parents,e,t)}Sv.prototype.interrupt=fbe;Sv.prototype.transition=p0e;const Tx=e=>()=>e;function g0e(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}
vendor: 9,991 bytes, line 801
801function Do(e,t,n){this.k=e,this.x=t,this.y=n}Do.prototype={constructor:Do,scale:function(e){return e===1?this:new Do(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Do(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var j1=new Do(1,0,0);Hq.prototype=Do.prototype;function Hq(e){for(;!e.__zoom;)if(!(e=e.parentNode))return j1;return e.__zoom}function BS(e){e.stopImmediatePropagation()}function up(e){e.preventDefault(),e.stopImmediatePropagation()}function y0e(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function v0e(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function W$(){return this.__zoom||j1}function x0e(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function b0e(){return navigator.maxTouchPoints||"ontouchstart"in this}function w0e(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),o>i?(i+o)/2:Math.min(0,i)||Math.max(0,o))}function Kq(){var e=y0e,t=v0e,n=w0e,r=x0e,a=b0e,i=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],l=250,c=bb,u=v1("start","zoom","end"),d,f,h,m=500,p=150,g=0,y=10;function v(A){A.property("__zoom",W$).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",T).filter(a).on("touchstart.zoom",P).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(A,I,M,$){var R=A.selection?A.selection():A;R.property("__zoom",W$),A!==R?N(A,I,M,$):R.interrupt().each(function(){S(this,arguments).event($).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},v.scaleBy=function(A,I,M,$){v.scaleTo(A,function(){var R=this.__zoom.k,O=typeof I=="function"?I.apply(this,arguments):I;return R*O},M,$)},v.scaleTo=function(A,I,M,$){v.transform(A,function(){var R=t.apply(this,arguments),O=this.__zoom,F=M==null?j(R):typeof M=="function"?M.apply(this,arguments):M,z=O.invert(F),B=typeof I=="function"?I.apply(this,arguments):I;return n(b(w(O,B),F,z),R,o)},M,$)},v.translateBy=function(A,I,M,$){v.transform(A,function(){return n(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof M=="function"?M.apply(this,arguments):M),t.apply(this,arguments),o)},null,$)},v.translateTo=function(A,I,M,$,R){v.transform(A,function(){var O=t.apply(this,arguments),F=this.__zoom,z=$==null?j(O):typeof $=="function"?$.apply(this,arguments):$;return n(j1.translate(z[0],z[1]).scale(F.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof M=="function"?-M.apply(this,arguments):-M),O,o)},$,R)};function w(A,I){return I=Math.max(i[0],Math.min(i[1],I)),I===A.k?A:new Do(I,A.x,A.y)}function b(A,I,M){var $=I[0]-M[0]*A.k,R=I[1]-M[1]*A.k;return $===A.x&&R===A.y?A:new Do(A.k,$,R)}function j(A){return[(+A[0][0]+ +A[1][0])/2,(+A[0][1]+ +A[1][1])/2]}function N(A,I,M,$){A.on("start.zoom",function(){S(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event($).end()}).tween("zoom",function(){var R=this,O=arguments,F=S(R,O).event($),z=t.apply(R,O),B=M==null?j(z):typeof M=="function"?M.apply(R,O):M,H=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),Y=R.__zoom,ee=typeof I=="function"?I.apply(R,O):I,V=c(Y.invert(B).concat(H/Y.k),ee.invert(B).concat(H/ee.k));return function(K){if(K===1)K=ee;else{var W=V(K),q=H/W[2];K=new Do(q,B[0]-W[0]*q,B[1]-W[1]*q)}F.zoom(null,K)}})}function S(A,I,M){return!M&&A.__zooming||new C(A,I)}function C(A,I){this.that=A,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(A,I),this.taps=0}C.prototype={event:function(A){return A&&(this.sourceEvent=A),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(A,I){return this.mouse&&A!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&A!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&A!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(A){var I=ts(this.that).datum();u.call(A,this.that,new g0e(A,{sourceEvent:this.sourceEvent,target:v,type:A,transform:this.that.__zoom,dispatch:u}),I)}};function _(A,...I){if(!e.apply(this,arguments))return;var M=S(this,I).event(A),$=this.__zoom,R=Math.max(i[0],Math.min(i[1],$.k*Math.pow(2,r.apply(this,arguments)))),O=Hs(A);if(M.wheel)(M.mouse[0][0]!==O[0]||M.mouse[0][1]!==O[1])&&(M.mouse[1]=$.invert(M.mouse[0]=O)),clearTimeout(M.wheel);else{if($.k===R)return;M.mouse=[O,$.invert(O)],Nb(this),M.start()}up(A),M.wheel=setTimeout(F,p),M.zoom("mouse",n(b(w($,R),M.mouse[0],M.mouse[1]),M.extent,o));function F(){M.wheel=null,M.end()}}function E(A,...I){if(h||!e.apply(this,arguments))return;var M=A.currentTarget,$=S(this,I,!0).event(A),R=ts(A.view).on("mousemove.zoom",B,!0).on("mouseup.zoom",H,!0),O=Hs(A,M),F=A.clientX,z=A.clientY;kq(A.view),BS(A),$.mouse=[O,this.__zoom.invert(O)],Nb(this),$.start();function B(Y){if(up(Y),!$.moved){var ee=Y.clientX-F,V=Y.clientY-z;$.moved=ee*ee+V*V>g}$.event(Y).zoom("mouse",n(b($.that.__zoom,$.mouse[0]=Hs(Y,M),$.mouse[1]),$.extent,o))}function H(Y){R.on("mousemove.zoom mouseup.zoom",null),Oq(Y.view,$.moved),up(Y),$.event(Y).end()}}function T(A,...I){if(e.apply(this,arguments)){var M=this.__zoom,$=Hs(A.changedTouches?A.changedTouches[0]:A,this),R=M.invert($),O=M.k*(A.shiftKey?.5:2),F=n(b(w(M,O),$,R),t.apply(this,I),o);up(A),l>0?ts(this).transition().duration(l).call(N,F,$,A):ts(this).call(v.transform,F,$,A)}}function P(A,...I){if(e.apply(this,arguments)){var M=A.touches,$=M.length,R=S(this,I,A.changedTouches.length===$).event(A),O,F,z,B;for(BS(A),F=0;F<$;++F)z=M[F],B=Hs(z,this),B=[B,this.__zoom.invert(B),z.identifier],R.touch0?!R.touch1&&R.touch0[2]!==B[2]&&(R.touch1=B,R.taps=0):(R.touch0=B,O=!0,R.taps=1+!!d);d&&(d=clearTimeout(d)),O&&(R.taps<2&&(f=B[0],d=setTimeout(function(){d=null},m)),Nb(this),R.start())}}function k(A,...I){if(this.__zooming){var M=S(this,I).event(A),$=A.changedTouches,R=$.length,O,F,z,B;for(up(A),O=0;O<R;++O)F=$[O],z=Hs(F,this),M.touch0&&M.touch0[2]===F.identifier?M.touch0[0]=z:M.touch1&&M.touch1[2]===F.identifier&&(M.touch1[0]=z);if(F=M.that.__zoom,M.touch1){var H=M.touch0[0],Y=M.touch0[1],ee=M.touch1[0],V=M.touch1[1],K=(K=ee[0]-H[0])*K+(K=ee[1]-H[1])*K,W=(W=V[0]-Y[0])*W+(W=V[1]-Y[1])*W;F=w(F,Math.sqrt(K/W)),z=[(H[0]+ee[0])/2,(H[1]+ee[1])/2],B=[(Y[0]+V[0])/2,(Y[1]+V[1])/2]}else if(M.touch0)z=M.touch0[0],B=M.touch0[1];else return;M.zoom("touch",n(b(F,z,B),M.extent,o))}}function D(A,...I){if(this.__zooming){var M=S(this,I).event(A),$=A.changedTouches,R=$.length,O,F;for(BS(A),h&&clearTimeout(h),h=setTimeout(function(){h=null},m),O=0;O<R;++O)F=$[O],M.touch0&&M.touch0[2]===F.identifier?delete M.touch0:M.touch1&&M.touch1[2]===F.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(F=Hs(F,this),Math.hypot(f[0]-F[0],f[1]-F[1])<y)){var z=ts(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return v.wheelDelta=function(A){return arguments.length?(r=typeof A=="function"?A:Tx(+A),v):r},v.filter=function(A){return arguments.length?(e=typeof A=="function"?A:Tx(!!A),v):e},v.touchable=function(A){return arguments.length?(a=typeof A=="function"?A:Tx(!!A),v):a},v.extent=function(A){return arguments.length?(t=typeof A=="function"?A:Tx([[+A[0][0],+A[0][1]],[+A[1][0],+A[1][1]]]),v):t},v.scaleExtent=function(A){return arguments.length?(i[0]=+A[0],i[1]=+A[1],v):[i[0],i[1]]},v.translateExtent=function(A){return arguments.length?(o[0][0]=+A[0][0],o[1][0]=+A[1][0],o[0][1]=+A[0][1],o[1][1]=+A[1][1],v):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},v.constrain=function(A){return arguments.length?(n=A,v):n},v.duration=function(A){return arguments.length?(l=+A,v):l},v.interpolate=function(A){return arguments.length?(c=A,v):c},v.on=function(){var A=u.on.apply(u,arguments);return A===u?v:A},v.clickDistance=function(A){return arguments.length?(g=(A=+A)*A,v):Math.sqrt(g)},v.tapDistance=function(A){return arguments.length?(y=+A,v):y},v}const no={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>
801`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},Qg=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Gq=["Enter"," ","Escape"],Yq={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var vd;(function(e){e.Strict="strict",e.Loose="loose"})(vd||(vd={}));var Gu;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Gu||(Gu={}));var Jg;(function(e){e.Partial="partial",e.Full="full"})(Jg||(Jg={}));const Xq={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Zl;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zl||(Zl={}));var Zg;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Zg||(Zg={}));var We;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(We||(We={}));const q$={[We.Left]:We.Right,[We.Right]:We.Left,[We.Top]:We.Bottom,[We.Bottom]:We.Top};function Qq(e){return e===null?null:e?"valid":"invalid"}const Jq=e=>"id"in e&&"source"in e&&"target"in e,j0e=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),_O=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_v=(e,t=[0,0])=>{const{width:n,height:r}=Nl(e),a=e.origin??t,i=n*a[0],o=r*a[1];return{x:e.position.x-i,y:e.position.y-o}},N0e=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const i=typeof a=="string";let o=!t.nodeLookup&&!i?a:void 0;t.nodeLookup&&(o=i?t.nodeLookup.get(a):_O(a)?a:t.nodeLookup.get(a.id));const l=o?R0(o,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return N1(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return S1(n)},Ev=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=N1(n,R0(a)),r=!0)}),r?S1(n):{x:0,y:0,width:0,height:0}},EO=(e,t,[n,r,a]=[0,0,1],i=!1,o=!1)=>{const l={...Pv(t,[n,r,a]),width:t.width/a,height:t.height/a},c=[];for(const u of e.values()){const{measured:d,selectable:f=!0,hidden:h=!1}=u;if(o&&!f||h)continue;const m=d.width??u.width??u.initialWidth??null,p=d.height??u.height??u.initialHeight??null,g=ey(l,Ch(u)),y=(m??0)*(p??0),v=i&&g>0;(!u.internals.handleBounds||v||g>=y||u.dragging)&&c.push(u)}return c},S0e=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function C0e(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}
801async function _0e({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:i},o){if(e.size===0)return Promise.resolve(!0);const l=C0e(e,o),c=Ev(l),u=AO(c,t,n,(o==null?void 0:o.minZoom)??a,(o==null?void 0:o.maxZoom)??i,(o==null?void 0:o.padding)??.1);return await r.setViewport(u,{duration:o==null?void 0:o.duration,ease:o==null?void 0:o.ease,interpolate:o==null?void 0:o.interpolate}),Promise.resolve(!0)}function Zq({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:i}){const o=n.get(e),l=o.parentId?n.get(o.parentId):void 0,{x:c,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},d=o.origin??r;let f=o.extent||a;if(o.extent==="parent"&&!o.expandParent)if(!l)i==null||i("005",no.error005());else{const m=l.measured.width,p=l.measured.height;m&&p&&(f=[[c,u],[c+m,u+p]])}else l&&_h(o.extent)&&(f=[[o.extent[0][0]+c,o.extent[0][1]+u],[o.extent[1][0]+c,o.extent[1][1]+u]]);const h=_h(f)?xd(t,f,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&(i==null||i("015",no.error015())),{position:{x:h.x-c+(o.measured.width??0)*d[0],y:h.y-u+(o.measured.height??0)*d[1]},positionAbsolute:h}}async function E0e({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const i=new Set(e.map(h=>h.id)),o=[];for(const h of n){if(h.deletable===!1)continue;const m=i.has(h.id),p=!m&&h.parentId&&o.find(g=>g.id===h.parentId);(m||p)&&o.push(h)}const l=new Set(t.map(h=>h.id)),c=r.filter(h=>h.deletable!==!1),d=S0e(o,c);for(const h of c)l.has(h.id)&&!d.find(p=>p.id===h.id)&&d.push(h);if(!a)return{edges:d,nodes:o};const f=await a({nodes:o,edges:d});return typeof f=="boolean"?f?{edges:d,nodes:o}:{edges:[],nodes:[]}:f}const Sh=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),xd=(e={x:0,y:0},t,n)=>({x:Sh(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Sh(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function eH(e,t,n){const{width:r,height:a}=Nl(n),{x:i,y:o}=n.internals.positionAbsolute;return xd(e,[[i,o],[i+r,o+a]],t)}const H$=(e,t,n)=>e<t?Sh(Math.abs(e-t),1,t)/t:e>n?-Sh(Math.abs(e-n),1,t)/t:0,tH=(e,t,n=15,r=40)=>{const a=H$(e.x,r,t.width-r)*n,i=H$(e.y,r,t.height-r)*n;return[a,i]},N1=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),H2=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),S1=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Ch=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=_O(e)?e.internals.positionAbsolute:_v(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},R0=(e,t=[0,0])=>{var a,i;const{x:n,y:r}=_O(e)?e.internals.positionAbsolute:_v(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},nH=(e,t)=>S1(N1(H2(e),H2(t))),ey=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},K$=e=>ei(e.width)&&ei(e.height)&&ei(e.x)&&ei(e.y),ei=e=>!isNaN(e)&&isFinite(e),A0e=(e,t)=>{},Av=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Pv=({x:e,y:t},[n,r,a],i=!1,o=[1,1])=>{const l={x:(e-n)/a,y:(t-r)/a};return i?Av(l,o):l},D0=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function Zd(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function P0e(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=Zd(e,n),a=Zd(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=Zd(e.top??e.y??0,n),a=Zd(e.bottom??e.y??0,n),i=Zd(e.left??e.x??0,t),o=Zd(e.right??e.x??0,t);return{top:r,right:o,bottom:a,left:i,x:i+o,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function k0e(e,t,n,r,a,i){const{x:o,y:l}=D0(e,[t,n,r]),{x:c,y:u}=D0({x:e.x+e.width,y:e.y+e.height},[t,n,r]),d=a-c,f=i-u;return{left:Math.floor(o),top:Math.floor(l),right:Math.floor(d),bottom:Math.floor(f)}}const AO=(e,t,n,r,a,i)=>{const o=P0e(i,t,n),l=(t-o.x)/e.width,c=(n-o.y)/e.height,u=Math.min(l,c),d=Sh(u,r,a),f=e.x+e.width/2,h=e.y+e.height/2,m=t/2-f*d,p=n/2-h*d,g=k0e(e,m,p,d,t,n),y={left:Math.min(g.left-o.left,0),top:Math.min(g.top-o.top,0),right:Math.min(g.right-o.right,0),bottom:Math.min(g.bottom-o.bottom,0)};return{x:m-y.left+y.right,y:p-y.top+y.bottom,zoom:d}},ty=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function _h(e){return e!=null&&e!=="parent"}function Nl(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function rH(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function aH(e,t={width:0,height:0},n,r,a){const i={...e},o=r.get(n);if(o){const l=o.origin||a;i.x+=o.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=o.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function G$(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function O0e(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function T0e(e){return{...Yq,...e||{}}}
801function Zp(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:i,y:o}=ti(e),l=Pv({x:i-((a==null?void 0:a.left)??0),y:o-((a==null?void 0:a.top)??0)},r),{x:c,y:u}=n?Av(l,t):l;return{xSnapped:c,ySnapped:u,...l}}const PO=e=>({width:e.offsetWidth,height:e.offsetHeight}),sH=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},M0e=["INPUT","SELECT","TEXTAREA"];function iH(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:M0e.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const oH=e=>"clientX"in e,ti=(e,t)=>{var i,o;const n=oH(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,a=n?e.clientY:(o=e.touches)==null?void 0:o[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},Y$=(e,t,n,r,a)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(o=>{const l=o.getBoundingClientRect();return{id:o.getAttribute("data-handleid"),type:e,nodeId:a,position:o.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...PO(o)}})};function lH({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:i,targetControlX:o,targetControlY:l}){const c=e*.125+a*.375+o*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,d=Math.abs(c-e),f=Math.abs(u-t);return[c,u,d,f]}function Mx(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function X$({pos:e,x1:t,y1:n,x2:r,y2:a,c:i}){switch(e){case We.Left:return[t-Mx(t-r,i),n];case We.Right:return[t+Mx(r-t,i),n];case We.Top:return[t,n-Mx(n-a,i)];case We.Bottom:return[t,n+Mx(a-n,i)]}}function cH({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:a,targetPosition:i=We.Top,curvature:o=.25}){const[l,c]=X$({pos:n,x1:e,y1:t,x2:r,y2:a,c:o}),[u,d]=X$({pos:i,x1:r,y1:a,x2:e,y2:t,c:o}),[f,h,m,p]=lH({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:l,sourceControlY:c,targetControlX:u,targetControlY:d});return[`M${e},${t} C${l},${c} ${u},${d} ${r},${a}`,f,h,m,p]}function uH({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,i=n<e?n+a:n-a,o=Math.abs(r-t)/2,l=r<t?r+o:r-o;return[i,l,a,o]}function R0e({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const o=a&&n?r+1e3:r,l=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return o+l}function D0e({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const i=N1(R0(e),R0(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const o={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return ey(o,S1(i))>0}const $0e=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,I0e=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),L0e=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||$0e;let a;return Jq(e)?a={...e}:a={...e,id:r(e)},I0e(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function dH({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,i,o,l]=uH({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,i,o,l]}const Q$={[We.Left]:{x:-1,y:0},[We.Right]:{x:1,y:0},[We.Top]:{x:0,y:-1},[We.Bottom]:{x:0,y:1}},F0e=({source:e,sourcePosition:t=We.Bottom,target:n})=>t===We.Left||t===We.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},J$=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function B0e({source:e,sourcePosition:t=We.Bottom,target:n,targetPosition:r=We.Top,center:a,offset:i,stepPosition:o}){const l=Q$[t],c=Q$[r],u={x:e.x+l.x*i,y:e.y+l.y*i},d={x:n.x+c.x*i,y:n.y+c.y*i},f=F0e({source:u,sourcePosition:t,target:d}),h=f.x!==0?"x":"y",m=f[h];let p=[],g,y;const v={x:0,y:0},w={x:0,y:0},[,,b,j]=uH({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[h]*c[h]===-1){h==="x"?(g=a.x??u.x+(d.x-u.x)*o,y=a.y??(u.y+d.y)/2):(g=a.x??(u.x+d.x)/2,y=a.y??u.y+(d.y-u.y)*o);const S=[{x:g,y:u.y},{x:g,y:d.y}],C=[{x:u.x,y},{x:d.x,y}];l[h]===m?p=h==="x"?S:C:p=h==="x"?C:S}else{const S=[{x:u.x,y:d.y}],C=[{x:d.x,y:u.y}];if(h==="x"?p=l.x===m?C:S:p=l.y===m?S:C,t===r){const k=Math.abs(e[h]-n[h]);if(k<=i){const D=Math.min(i-1,i-k);l[h]===m?v[h]=(u[h]>e[h]?-1:1)*D:w[h]=(d[h]>n[h]?-1:1)*D}}if(t!==r){const k=h==="x"?"y":"x",D=l[h]===c[k],A=u[k]>d[k],I=u[k]<d[k];(l[h]===1&&(!D&&A||D&&I)||l[h]!==1&&(!D&&I||D&&A))&&(p=h==="x"?S:C)}const _={x:u.x+v.x,y:u.y+v.y},E={x:d.x+w.x,y:d.y+w.y},T=Math.max(Math.abs(_.x-p[0].x),Math.abs(E.x-p[0].x)),P=Math.max(Math.abs(_.y-p[0].y),Math.abs(E.y-p[0].y));T>=P?(g=(_.x+E.x)/2,y=p[0].y):(g=p[0].x,y=(_.y+E.y)/2)}return[[e,{x:u.x+v.x,y:u.y+v.y},...p,{x:d.x+w.x,y:d.y+w.y},n],g,y,b,j]}function z0e(e,t,n,r){const a=Math.min(J$(e,t)/2,J$(t,n)/2,r),{x:i,y:o}=t;if(e.x===i&&i===n.x||e.y===o&&o===n.y)return`L${i} ${o}`;if(e.y===o){const u=e.x<n.x?-1:1,d=e.y<n.y?1:-1;return`L ${i+a*u},${o}Q ${i},${o} ${i},${o+a*d}`}const l=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${o+a*c}Q ${i},${o} ${i+a*l},${o}`}function $0({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:a,targetPosition:i=We.Top,borderRadius:o=5,centerX:l,centerY:c,offset:u=20,stepPosition:d=.5}){const[f,h,m,p,g]=B0e({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:i,center:{x:l,y:c},offset:u,stepPosition:d});return[f.reduce((v,w,b)=>{let j="";return b>0&&b<f.length-1?j=z0e(f[b-1],w,f[b+1],o):j=`${b===0?"M":"L"}${w.x} ${w.y}`,v+=j,v},""),h,m,p,g]}function Z$(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function U0e(e){var f;const{sourceNode:t,targetNode:n}=e;if(!Z$(t)||!Z$(n))return null;const r=t.internals.handleBounds||eI(t.handles),a=n.internals.handleBounds||eI(n.handles),i=tI((r==null?void 0:r.source)??[],e.sourceHandle),o=tI(e.connectionMode===vd.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!i||!o)return(f=e.onError)==null||f.call(e,"008",no.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||We.Bottom,c=(o==null?void 0:o.position)||We.Top,u=bd(t,i,l),d=bd(n,o,c);return{sourceX:u.x,sourceY:u.y,targetX:d.x,targetY:d.y,sourcePosition:l,targetPosition:c}}function eI(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function bd(e,t,n=We.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:o,height:l}=t??Nl(e);if(r)return{x:a+o/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case We.Top:return{x:a+o/2,y:i};case We.Right:return{x:a+o,y:i+l/2};case We.Bottom:return{x:a+o/2,y:i+l};case We.Left:return{x:a,y:i+l/2}}}function tI(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function K2(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function V0e(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const i=new Set;return e.reduce((o,l)=>
801([l.markerStart||r,l.markerEnd||a].forEach(c=>{if(c&&typeof c=="object"){const u=K2(c,t);i.has(u)||(o.push({id:u,color:c.color||n,...c}),i.add(u))}}),o),[]).sort((o,l)=>o.id.localeCompare(l.id))}const fH=1e3,W0e=10,kO={nodeOrigin:[0,0],nodeExtent:Qg,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},q0e={...kO,checkEquality:!0};function OO(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function H0e(e,t,n){const r=OO(kO,n);for(const a of e.values())if(a.parentId)MO(a,e,t,r);else{const i=_v(a,r.nodeOrigin),o=_h(a.extent)?a.extent:r.nodeExtent,l=xd(i,o,Nl(a));a.internals.positionAbsolute=l}}function K0e(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const i={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(i):a.type==="target"&&r.push(i)}return{source:n,target:r}}function TO(e){return e==="manual"}function G2(e,t,n,r={}){var u,d;const a=OO(q0e,r),i={i:0},o=new Map(t),l=a!=null&&a.elevateNodesOnSelect&&!TO(a.zIndexMode)?fH:0;let c=e.length>0;t.clear(),n.clear();for(const f of e){let h=o.get(f.id);if(a.checkEquality&&f===(h==null?void 0:h.internals.userNode))t.set(f.id,h);else{const m=_v(f,a.nodeOrigin),p=_h(f.extent)?f.extent:a.nodeExtent,g=xd(m,p,Nl(f));h={...a.defaults,...f,measured:{width:(u=f.measured)==null?void 0:u.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:g,handleBounds:K0e(f,h),z:hH(f,l,a.zIndexMode),userNode:f}},t.set(f.id,h)}(h.measured===void 0||h.measured.width===void 0||h.measured.height===void 0)&&!h.hidden&&(c=!1),f.parentId&&MO(h,t,n,r,i)}return c}function G0e(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function MO(e,t,n,r,a){const{elevateNodesOnSelect:i,nodeOrigin:o,nodeExtent:l,zIndexMode:c}=OO(kO,r),u=e.parentId,d=t.get(u);if(!d){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}G0e(e,n),a&&!d.parentId&&d.internals.rootParentIndex===void 0&&c==="auto"&&(d.internals.rootParentIndex=++a.i,d.internals.z=d.internals.z+a.i*W0e),a&&d.internals.rootParentIndex!==void 0&&(a.i=d.internals.rootParentIndex);const f=i&&!TO(c)?fH:0,{x:h,y:m,z:p}=Y0e(e,d,o,l,f,c),{positionAbsolute:g}=e.internals,y=h!==g.x||m!==g.y;(y||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:y?{x:h,y:m}:g,z:p}})}function hH(e,t,n){const r=ei(e.zIndex)?e.zIndex:0;return TO(n)?r:r+(e.selected?t:0)}function Y0e(e,t,n,r,a,i){const{x:o,y:l}=t.internals.positionAbsolute,c=Nl(e),u=_v(e,n),d=_h(e.extent)?xd(u,e.extent,c):u;let f=xd({x:o+d.x,y:l+d.y},r,c);e.extent==="parent"&&(f=eH(f,c,t));const h=hH(e,a,i),m=t.internals.z??0;return{x:f.x,y:f.y,z:m>=h?m+1:h}}function RO(e,t,n,r=[0,0]){var o;const a=[],i=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const u=((o=i.get(l.parentId))==null?void 0:o.expandedRect)??Ch(c),d=nH(u,l.rect);i.set(l.parentId,{expandedRect:d,parent:c})}return i.size>0&&i.forEach(({expandedRect:l,parent:c},u)=>{var b;const d=c.internals.positionAbsolute,f=Nl(c),h=c.origin??r,m=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,p=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,g=Math.max(f.width,Math.round(l.width)),y=Math.max(f.height,Math.round(l.height)),v=(g-f.width)*h[0],w=(y-f.height)*h[1];(m>0||p>0||v||w)&&(a.push({id:u,type:"position",position:{x:c.position.x-m+v,y:c.position.y-p+w}}),(b=n.get(u))==null||b.forEach(j=>{e.some(N=>N.id===j.id)||a.push({id:j.id,type:"position",position:{x:j.position.x+m,y:j.position.y+p}})})),(f.width<l.width||f.height<l.height||m||p)&&a.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:g+(m?h[0]*m-v:0),height:y+(p?h[1]*p-w:0)}})}),a}function X0e(e,t,n,r,a,i,o){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const u=[],d=window.getComputedStyle(l),{m22:f}=new window.DOMMatrixReadOnly(d.transform),h=[];for(const m of e.values()){const p=t.get(m.id);if(!p)continue;if(p.hidden){t.set(p.id,{...p,internals:{...p.internals,handleBounds:void 0}}),c=!0;continue}const g=PO(m.nodeElement),y=p.measured.width!==g.width||p.measured.height!==g.height;if(!!(g.width&&g.height&&(y||!p.internals.handleBounds||m.force))){const w=m.nodeElement.getBoundingClientRect(),b=_h(p.extent)?p.extent:i;let{positionAbsolute:j}=p.internals;p.parentId&&p.extent==="parent"?j=eH(j,g,t.get(p.parentId)):b&&(j=xd(j,b,g));const N={...p,measured:g,internals:{...p.internals,positionAbsolute:j,handleBounds:{source:Y$("source",m.nodeElement,w,f,p.id),target:Y$("target",m.nodeElement,w,f,p.id)}}};t.set(p.id,N),p.parentId&&MO(N,t,n,{nodeOrigin:a,zIndexMode:o}),c=!0,y&&(u.push({id:p.id,type:"dimensions",dimensions:g}),p.expandParent&&p.parentId&&h.push({id:p.id,parentId:p.parentId,rect:Ch(N,a)}))}}if(h.length>0){const m=RO(h,t,n,a);u.push(...m)}return{changes:u,updatedInternals:c}}async function Q0e({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,i]],r),l=!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2]);return Promise.resolve(l)}function nI(e,t,n,r,a,i){let o=a;const l=r.get(o)||new Map;r.set(o,l.set(n,t)),o=`${a}-${e}`;const c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),i){o=`${a}-${e}-${i}`;const u=r.get(o)||new Map;r.set(o,u.set(n,t))}}function mH(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:i,sourceHandle:o=null,targetHandle:l=null}=r,c={edgeId:r.id,source:a,target:i,sourceHandle:o,targetHandle:l},u=`${a}-${o}--${i}-${l}`,d=`${i}-${l}--${a}-${o}`;nI("source",c,d,e,a,o),nI("target",c,u,e,i,l),t.set(r.id,r)}}function pH(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:pH(n,t):!1}function rI(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;
801if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function J0e(e,t,n,r){const a=new Map;for(const[i,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!pH(o,e))&&(o.draggable||t&&typeof o.draggable>"u")){const l=e.get(i);l&&a.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return a}function zS({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var o,l,c;const a=[];for(const[u,d]of t){const f=(o=n.get(u))==null?void 0:o.internals.userNode;f&&a.push({...f,position:d.position,dragging:r})}if(!e)return[a[0],a];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((c=t.get(e))==null?void 0:c.position)||i.position,dragging:r}:a[0],a]}function Z0e({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const i={x:n-a.distance.x,y:r-a.distance.y},o=Av(i,t);return{x:o.x-i.x,y:o.y-i.y}}function ewe({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let i={x:null,y:null},o=0,l=new Map,c=!1,u={x:0,y:0},d=null,f=!1,h=null,m=!1,p=!1,g=null;function y({noDragClassName:w,handleSelector:b,domNode:j,isSelectable:N,nodeId:S,nodeClickDistance:C=0}){h=ts(j);function _({x:k,y:D}){const{nodeLookup:A,nodeExtent:I,snapGrid:M,snapToGrid:$,nodeOrigin:R,onNodeDrag:O,onSelectionDrag:F,onError:z,updateNodePositions:B}=t();i={x:k,y:D};let H=!1;const Y=l.size>1,ee=Y&&I?H2(Ev(l)):null,V=Y&&$?Z0e({dragItems:l,snapGrid:M,x:k,y:D}):null;for(const[K,W]of l){if(!A.has(K))continue;let q={x:k-W.distance.x,y:D-W.distance.y};$&&(q=V?{x:Math.round(q.x+V.x),y:Math.round(q.y+V.y)}:Av(q,M));let J=null;if(Y&&I&&!W.extent&&ee){const{positionAbsolute:ge}=W.internals,Se=ge.x-ee.x+I[0][0],ce=ge.x+W.measured.width-ee.x2+I[1][0],ye=ge.y-ee.y+I[0][1],Ie=ge.y+W.measured.height-ee.y2+I[1][1];J=[[Se,ye],[ce,Ie]]}const{position:ie,positionAbsolute:X}=Zq({nodeId:K,nextPosition:q,nodeLookup:A,nodeExtent:J||I,nodeOrigin:R,onError:z});H=H||W.position.x!==ie.x||W.position.y!==ie.y,W.position=ie,W.internals.positionAbsolute=X}if(p=p||H,!!H&&(B(l,!0),g&&(r||O||!S&&F))){const[K,W]=zS({nodeId:S,dragItems:l,nodeLookup:A});r==null||r(g,l,K,W),O==null||O(g,K,W),S||F==null||F(g,W)}}async function E(){if(!d)return;const{transform:k,panBy:D,autoPanSpeed:A,autoPanOnNodeDrag:I}=t();if(!I){c=!1,cancelAnimationFrame(o);return}const[M,$]=tH(u,d,A);(M!==0||$!==0)&&(i.x=(i.x??0)-M/k[2],i.y=(i.y??0)-$/k[2],await D({x:M,y:$})&&_(i)),o=requestAnimationFrame(E)}function T(k){var Y;const{nodeLookup:D,multiSelectionActive:A,nodesDraggable:I,transform:M,snapGrid:$,snapToGrid:R,selectNodesOnDrag:O,onNodeDragStart:F,onSelectionDragStart:z,unselectNodesAndEdges:B}=t();f=!0,(!O||!N)&&!A&&S&&((Y=D.get(S))!=null&&Y.selected||B()),N&&O&&S&&(e==null||e(S));const H=Zp(k.sourceEvent,{transform:M,snapGrid:$,snapToGrid:R,containerBounds:d});if(i=H,l=J0e(D,I,H,S),l.size>0&&(n||F||!S&&z)){const[ee,V]=zS({nodeId:S,dragItems:l,nodeLookup:D});n==null||n(k.sourceEvent,l,ee,V),F==null||F(k.sourceEvent,ee,V),S||z==null||z(k.sourceEvent,V)}}const P=Tq().clickDistance(C).on("start",k=>{const{domNode:D,nodeDragThreshold:A,transform:I,snapGrid:M,snapToGrid:$}=t();d=(D==null?void 0:D.getBoundingClientRect())||null,m=!1,p=!1,g=k.sourceEvent,A===0&&T(k),i=Zp(k.sourceEvent,{transform:I,snapGrid:M,snapToGrid:$,containerBounds:d}),u=ti(k.sourceEvent,d)}).on("drag",k=>{const{autoPanOnNodeDrag:D,transform:A,snapGrid:I,snapToGrid:M,nodeDragThreshold:$,nodeLookup:R}=t(),O=Zp(k.sourceEvent,{transform:A,snapGrid:I,snapToGrid:M,containerBounds:d});if(g=k.sourceEvent,(k.sourceEvent.type==="touchmove"&&k.sourceEvent.touches.length>1||S&&!R.has(S))&&(m=!0),!m){if(!c&&D&&f&&(c=!0,E()),!f){const F=ti(k.sourceEvent,d),z=F.x-u.x,B=F.y-u.y;Math.sqrt(z*z+B*B)>$&&T(k)}(i.x!==O.xSnapped||i.y!==O.ySnapped)&&l&&f&&(u=ti(k.sourceEvent,d),_(O))}}).on("end",k=>
801{if(!(!f||m)&&(c=!1,f=!1,cancelAnimationFrame(o),l.size>0)){const{nodeLookup:D,updateNodePositions:A,onNodeDragStop:I,onSelectionDragStop:M}=t();if(p&&(A(l,!1),p=!1),a||I||!S&&M){const[$,R]=zS({nodeId:S,dragItems:l,nodeLookup:D,dragging:!1});a==null||a(k.sourceEvent,l,$,R),I==null||I(k.sourceEvent,$,R),S||M==null||M(k.sourceEvent,R)}}}).filter(k=>{const D=k.target;return!k.button&&(!w||!rI(D,`.${w}`,j))&&(!b||rI(D,b,j))});h.call(P)}function v(){h==null||h.on(".drag",null)}return{update:y,destroy:v}}function twe(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())ey(a,Ch(i))>0&&r.push(i);return r}const nwe=250;function rwe(e,t,n,r){var l,c;let a=[],i=1/0;const o=twe(e,n,t+nwe);for(const u of o){const d=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((c=u.internals.handleBounds)==null?void 0:c.target)??[]];for(const f of d){if(r.nodeId===f.nodeId&&r.type===f.type&&r.id===f.id)continue;const{x:h,y:m}=bd(u,f,f.position,!0),p=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(m-e.y,2));p>t||(p<i?(a=[{...f,x:h,y:m}],i=p):p===i&&a.push({...f,x:h,y:m}))}}if(!a.length)return null;if(a.length>1){const u=r.type==="source"?"target":"source";return a.find(d=>d.type===u)??a[0]}return a[0]}function gH(e,t,n,r,a,i=!1){var u,d,f;
801const o=r.get(e);if(!o)return null;const l=a==="strict"?(u=o.internals.handleBounds)==null?void 0:u[t]:[...((d=o.internals.handleBounds)==null?void 0:d.source)??[],...((f=o.internals.handleBounds)==null?void 0:f.target)??[]],c=(n?l==null?void 0:l.find(h=>h.id===n):l==null?void 0:l[0])??null;return c&&i?{...c,...bd(o,c,c.position,!0)}:c}function yH(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function awe(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const vH=()=>!0;function swe(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:i,isTarget:o,domNode:l,nodeLookup:c,lib:u,autoPanOnConnect:d,flowId:f,panBy:h,cancelConnection:m,onConnectStart:p,onConnect:g,onConnectEnd:y,isValidConnection:v=vH,onReconnectEnd:w,updateConnection:b,getTransform:j,getFromHandle:N,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:_}){const E=sH(e.target);let T=0,P;const{x:k,y:D}=ti(e),A=yH(i,_),I=l==null?void 0:l.getBoundingClientRect();let M=!1;if(!I||!A)return;const $=gH(a,A,r,c,t);if(!$)return;let R=ti(e,I),O=!1,F=null,z=!1,B=null;function H(){if(!d||!I)return;const[ie,X]=tH(R,I,S);h({x:ie,y:X}),T=requestAnimationFrame(H)}const Y={...$,nodeId:a,type:A,position:$.position},ee=c.get(a);let K={inProgress:!0,isValid:null,from:bd(ee,Y,We.Left,!0),fromHandle:Y,fromPosition:Y.position,fromNode:ee,to:R,toHandle:null,toPosition:q$[Y.position],toNode:null,pointer:R};function W(){M=!0,b(K),p==null||p(e,{nodeId:a,handleId:r,handleType:A})}C===0&&W();function q(ie){if(!M){const{x:Ie,y:Ue}=ti(ie),Ze=Ie-k,fe=Ue-D;if(!(Ze*Ze+fe*fe>C*C))return;W()}if(!N()||!Y){J(ie);return}const X=j();R=ti(ie,I),P=rwe(Pv(R,X,!1,[1,1]),n,c,Y),O||(H(),O=!0);const ge=xH(ie,{handle:P,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:o?"target":"source",isValidConnection:v,doc:E,lib:u,flowId:f,nodeLookup:c});B=ge.handleDomNode,F=ge.connection,z=awe(!!P,ge.isValid);const Se=c.get(a),ce=Se?bd(Se,Y,We.Left,!0):K.from,ye={...K,from:ce,isValid:z,to:ge.toHandle&&z?D0({x:ge.toHandle.x,y:ge.toHandle.y},X):R,toHandle:ge.toHandle,toPosition:z&&ge.toHandle?ge.toHandle.position:q$[Y.position],toNode:ge.toHandle?c.get(ge.toHandle.nodeId):null,pointer:R};b(ye),K=ye}function J(ie){if(!("touches"in ie&&ie.touches.length>0)){if(M){(P||B)&&F&&z&&(g==null||g(F));const{inProgress:X,...ge}=K,Se={...ge,toPosition:K.toHandle?K.toPosition:null};y==null||y(ie,Se),i&&(w==null||w(ie,Se))}m(),cancelAnimationFrame(T),O=!1,z=!1,F=null,B=null,E.removeEventListener("mousemove",q),E.removeEventListener("mouseup",J),E.removeEventListener("touchmove",q),E.removeEventListener("touchend",J)}}E.addEventListener("mousemove",q),E.addEventListener("mouseup",J),E.addEventListener("touchmove",q),E.addEventListener("touchend",J)}function xH(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:i,doc:o,lib:l,flowId:c,isValidConnection:u=vH,nodeLookup:d}){const f=i==="target",h=t?o.querySelector(`.${l}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:m,y:p}=ti(e),g=o.elementFromPoint(m,p),y=g!=null&&g.classList.contains(`${l}-flow__handle`)?g:h,v={handleDomNode:y,isValid:!1,connection:null,toHandle:null};if(y){const w=yH(void 0,y),b=y.getAttribute("data-nodeid"),j=y.getAttribute("data-handleid"),N=y.classList.contains("connectable"),S=y.classList.contains("connectableend");if(!b||!w)return v;const C={source:f?b:r,sourceHandle:f?j:a,target:f?r:b,targetHandle:f?a:j};v.connection=C;const E=N&&S&&(n===vd.Strict?f&&w==="source"||!f&&w==="target":b!==r||j!==a);v.isValid=E&&u(C),v.toHandle=gH(b,w,j,d,n,!0)}return v}const Y2={onPointerDown:swe,isValid:xH};function iwe({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=ts(e);function i({translateExtent:l,width:c,height:u,zoomStep:d=1,pannable:f=!0,zoomable:h=!0,inversePan:m=!1}){const p=b=>{if(b.sourceEvent.type!=="wheel"||!t)return;const j=n(),N=b.sourceEvent.ctrlKey&&ty()?10:1,S=-b.sourceEvent.deltaY*(b.sourceEvent.deltaMode===1?.05:b.sourceEvent.deltaMode?1:.002)*d,C=j[2]*Math.pow(2,S*N);t.scaleTo(C)};let g=[0,0];const y=b=>{(b.sourceEvent.type==="mousedown"||b.sourceEvent.type==="touchstart")&&(g=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY])},v=b=>{const j=n();if(b.sourceEvent.type!=="mousemove"&&b.sourceEvent.type!=="touchmove"||!t)return;const N=[b.sourceEvent.clientX??b.sourceEvent.touches[0].clientX,b.sourceEvent.clientY??b.sourceEvent.touches[0].clientY],S=[N[0]-g[0],N[1]-g[1]];g=N;const C=r()*Math.max(j[2],Math.log(j[2]))*(m?-1:1),_={x:j[0]-S[0]*C,y:j[1]-S[1]*C},E=[[0,0],[c,u]];t.setViewportConstrained({x:_.x,y:_.y,zoom:j[2]},E,l)},w=Kq().on("start",y).on("zoom",f?v:null).on("zoom.wheel",h?p:null);a.call(w,{})}function o(){a.on("zoom",null)}return{update:i,destroy:o,pointer:Hs}}const C1=e=>({x:e.x,y:e.y,zoom:e.k}),US=({x:e,y:t,zoom:n})=>j1.translate(e,t).scale(n),bf=(e,t)=>e.target.closest(`.${t}`),bH=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),owe=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,VS=(e,t=0,n=owe,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},wH=e=>{const t=e.ctrlKey&&ty()?10:1;
801return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function lwe({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:i,zoomOnPinch:o,onPanZoomStart:l,onPanZoom:c,onPanZoomEnd:u}){return d=>{if(bf(d,t))return d.ctrlKey&&d.preventDefault(),!1;d.preventDefault(),d.stopImmediatePropagation();const f=n.property("__zoom").k||1;if(d.ctrlKey&&o){const y=Hs(d),v=wH(d),w=f*Math.pow(2,v);r.scaleTo(n,w,y,d);return}const h=d.deltaMode===1?20:1;let m=a===Gu.Vertical?0:d.deltaX*h,p=a===Gu.Horizontal?0:d.deltaY*h;!ty()&&d.shiftKey&&a!==Gu.Vertical&&(m=d.deltaY*h,p=0),r.translateBy(n,-(m/f)*i,-(p/f)*i,{internal:!0});const g=C1(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(c==null||c(d,g),e.panScrollTimeout=setTimeout(()=>{u==null||u(d,g),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,l==null||l(d,g))}}function cwe({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const i=r.type==="wheel",o=!t&&i&&!r.ctrlKey,l=bf(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),o||l)return null;r.preventDefault(),n.call(this,r,a)}}function uwe({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,o,l;if((i=r.sourceEvent)!=null&&i.internal)return;const a=C1(r.transform);e.mouseButton=((o=r.sourceEvent)==null?void 0:o.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function dwe({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return i=>{var o,l;e.usedRightMouseButton=!!(n&&bH(t,e.mouseButton??0)),(o=i.sourceEvent)!=null&&o.sync||r([i.transform.x,i.transform.y,i.transform.k]),a&&!((l=i.sourceEvent)!=null&&l.internal)&&(a==null||a(i.sourceEvent,C1(i.transform)))}}function fwe({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:i}){return o=>{var l;if(!((l=o.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&bH(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&i(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const c=C1(o.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(o.sourceEvent,c)},n?150:0)}}}function hwe({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:i,userSelectionActive:o,noWheelClassName:l,noPanClassName:c,lib:u,connectionInProgress:d}){return f=>{var y;const h=e||t,m=n&&f.ctrlKey,p=f.type==="wheel";if(f.button===1&&f.type==="mousedown"&&(bf(f,`${u}-flow__node`)||bf(f,`${u}-flow__edge`)))return!0;if(!r&&!h&&!a&&!i&&!n||o||d&&!p||bf(f,l)&&p||bf(f,c)&&(!p||a&&p&&!e)||!n&&f.ctrlKey&&p)return!1;if(!n&&f.type==="touchstart"&&((y=f.touches)==null?void 0:y.length)>1)return f.preventDefault(),!1;if(!h&&!a&&!m&&p||!r&&(f.type==="mousedown"||f.type==="touchstart")||Array.isArray(r)&&!r.includes(f.button)&&f.type==="mousedown")return!1;const g=Array.isArray(r)&&r.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||p)&&g}}function mwe({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:
801a,onPanZoom:i,onPanZoomStart:o,onPanZoomEnd:l,onDraggingChange:c}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},d=e.getBoundingClientRect(),f=Kq().scaleExtent([t,n]).translateExtent(r),h=ts(e).call(f);w({x:a.x,y:a.y,zoom:Sh(a.zoom,t,n)},[[0,0],[d.width,d.height]],r);const m=h.on("wheel.zoom"),p=h.on("dblclick.zoom");f.wheelDelta(wH);function g(P,k){return h?new Promise(D=>{f==null||f.interpolate((k==null?void 0:k.interpolate)==="linear"?zo:bb).transform(VS(h,k==null?void 0:k.duration,k==null?void 0:k.ease,()=>D(!0)),P)}):Promise.resolve(!1)}function y({noWheelClassName:P,noPanClassName:k,onPaneContextMenu:D,userSelectionActive:A,panOnScroll:I,panOnDrag:M,panOnScrollMode:$,panOnScrollSpeed:R,preventScrolling:O,zoomOnPinch:F,zoomOnScroll:z,zoomOnDoubleClick:B,zoomActivationKeyPressed:H,lib:Y,onTransformChange:ee,connectionInProgress:V,paneClickDistance:K,selectionOnDrag:W}){A&&!u.isZoomingOrPanning&&v();const q=I&&!H&&!A;f.clickDistance(W?1/0:!ei(K)||K<0?0:K);const J=q?lwe({zoomPanValues:u,noWheelClassName:P,d3Selection:h,d3Zoom:f,panOnScrollMode:$,panOnScrollSpeed:R,zoomOnPinch:F,onPanZoomStart:o,onPanZoom:i,onPanZoomEnd:l}):cwe({noWheelClassName:P,preventScrolling:O,d3ZoomHandler:m});if(h.on("wheel.zoom",J,{passive:!1}),!A){const X=uwe({zoomPanValues:u,onDraggingChange:c,onPanZoomStart:o});f.on("start",X);const ge=dwe({zoomPanValues:u,panOnDrag:M,onPaneContextMenu:!!D,onPanZoom:i,onTransformChange:ee});f.on("zoom",ge);const Se=fwe({zoomPanValues:u,panOnDrag:M,panOnScroll:I,onPaneContextMenu:D,onPanZoomEnd:l,onDraggingChange:c});f.on("end",Se)}const ie=hwe({zoomActivationKeyPressed:H,panOnDrag:M,zoomOnScroll:z,panOnScroll:I,zoomOnDoubleClick:B,zoomOnPinch:F,userSelectionActive:A,noPanClassName:k,noWheelClassName:P,lib:Y,connectionInProgress:V});f.filter(ie),B?h.on("dblclick.zoom",p):h.on("dblclick.zoom",null)}function v(){f.on("zoom",null)}async function w(P,k,D){const A=US(P),I=f==null?void 0:f.constrain()(A,k,D);return I&&await g(I),new Promise(M=>M(I))}async function b(P,k){const D=US(P);return await g(D,k),new Promise(A=>A(D))}function j(P){if(h){const k=US(P),D=h.property("__zoom");(D.k!==P.zoom||D.x!==P.x||D.y!==P.y)&&(f==null||f.transform(h,k,null,{sync:!0}))}}function N(){const P=h?Hq(h.node()):{x:0,y:0,k:1};return{x:P.x,y:P.y,zoom:P.k}}function S(P,k){return h?new Promise(D=>{f==null||f.interpolate((k==null?void 0:k.interpolate)==="linear"?zo:bb).scaleTo(VS(h,k==null?void 0:k.duration,k==null?void 0:k.ease,()=>D(!0)),P)}):Promise.resolve(!1)}function C(P,k){return h?new Promise(D=>{f==null||f.interpolate((k==null?void 0:k.interpolate)==="linear"?zo:bb).scaleBy(VS(h,k==null?void 0:k.duration,k==null?void 0:k.ease,()=>D(!0)),P)}):Promise.resolve(!1)}function _(P){f==null||f.scaleExtent(P)}function E(P){f==null||f.translateExtent(P)}function T(P){const k=!ei(P)||P<0?0:P;f==null||f.clickDistance(k)}return{update:y,destroy:v,setViewport:b,setViewportConstrained:w,getViewport:N,scaleTo:S,scaleBy:C,setScaleExtent:_,setTranslateExtent:E,syncViewport:j,setClickDistance:T}}var Eh;(function(e){e.Line="line",e.Handle="handle"})(Eh||(Eh={}));function pwe({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:i}){const o=e-t,l=n-r,c=[o>0?1:o<0?-1:0,l>0?1:l<0?-1:0];return o&&a&&(c[0]=c[0]*-1),l&&i&&(c[1]=c[1]*-1),c}function aI(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function zl(e,t){return Math.max(0,t-e)}function Ul(e,t){return Math.max(0,e-t)}function Rx(e,t,n){return Math.max(0,t-e,e-n)}function sI(e,t){return e?!t:t}function gwe(e,t,n,r,a,i,o,l){let{affectsX:c,affectsY:u}=t;const{isHorizontal:d,isVertical:f}=t,h=d&&f,{xSnapped:m,ySnapped:p}=n,{minWidth:g,maxWidth:y,minHeight:v,maxHeight:w}=r,{x:b,y:j,width:N,height:S,aspectRatio:C}=e;let _=Math.floor(d?m-e.pointerX:0),E=Math.floor(f?p-e.pointerY:0);const T=N+(c?-_:_),P=S+(u?-E:E),k=-i[0]*N,D=-i[1]*S;let A=Rx(T,g,y),I=Rx(P,v,w);if(o){let R=0,O=0;c&&_<0?R=zl(b+_+k,o[0][0]):!c&&_>0&&(R=Ul(b+T+k,o[1][0])),u&&E<0?O=zl(j+E+D,o[0][1]):!u&&E>0&&(O=Ul(j+P+D,o[1][1])),A=Math.max(A,R),I=Math.max(I,O)}if(l){let R=0,O=0;c&&_>0?R=Ul(b+_,l[0][0]):!c&&_<0&&(R=zl(b+T,l[1][0])),u&&E>0?O=Ul(j+E,l[0][1]):!u&&E<0&&(O=zl(j+P,l[1][1])),A=Math.max(A,R),I=Math.max(I,O)}if(a){if(d){const R=Rx(T/C,v,w)*C;if(A=Math.max(A,R),o){let O=0;!c&&!u||c&&!u&&h?O=Ul(j+D+T/C,o[1][1])*C:O=zl(j+D+(c?_:-_)/C,o[0][1])*C,A=Math.max(A,O)}if(l){let O=0;!c&&!u||c&&!u&&h?O=zl(j+T/C,l[1][1])*C:O=Ul(j+(c?_:-_)/C,l[0][1])*C,A=Math.max(A,O)}}if(f){const R=Rx(P*C,g,y)/C;if(I=Math.max(I,R),o){let O=0;!c&&!u||u&&!c&&h?O=Ul(b+P*C+k,o[1][0])/C:O=zl(b+(u?E:-E)*C+k,o[0][0])/C,I=Math.max(I,O)}if(l){let O=0;!c&&!u||u&&!c&&h?O=zl(b+P*C,l[1][0])/C:O=Ul(b+(u?E:-E)*C,l[0][0])/C,I=Math.max(I,O)}}}E=E+(E<0?I:-I),_=_+(_<0?A:-A),a&&(h?T>P*C?E=(sI(c,u)?-_:_)/C:_=(sI(c,u)?-E:E)*C:d?(E=_/C,u=c):(_=E*C,c=u));const M=c?b+_:b,$=u?j+E:j;return{width:N+(c?-_:_),height:S+(u?-E:E),x:i[0]*_*(c?-1:1)+M,y:i[1]*E*(u?-1:1)+$}}const jH={width:0,height:0,x:0,y:0},ywe={...jH,pointerX:0,pointerY:0,aspectRatio:1};function vwe(e){return[[0,0],[e.measured.width,e.measured.height]]}function xwe(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,i=e.measured.width??0,o=e.measured.height??0,l=n[0]*i,c=n[1]*o;return[[r-l,a-c],[r+i-l,a+o-c]]}function bwe({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const i=ts(e);let o={controlDirection:aI("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:d,keepAspectRatio:f,resizeDirection:h,onResizeStart:m,onResize:p,onResizeEnd:g,shouldResize:y}){let v={...jH},w={...ywe};o={boundaries:d,resizeDirection:h,keepAspectRatio:f,controlDirection:aI(u)};let b,j=null,N=[],S,C,_,E=!1;const T=Tq().on("start",P=>
801{const{nodeLookup:k,transform:D,snapGrid:A,snapToGrid:I,nodeOrigin:M,paneDomNode:$}=n();if(b=k.get(t),!b)return;j=($==null?void 0:$.getBoundingClientRect())??null;const{xSnapped:R,ySnapped:O}=Zp(P.sourceEvent,{transform:D,snapGrid:A,snapToGrid:I,containerBounds:j});v={width:b.measured.width??0,height:b.measured.height??0,x:b.position.x??0,y:b.position.y??0},w={...v,pointerX:R,pointerY:O,aspectRatio:v.width/v.height},S=void 0,b.parentId&&(b.extent==="parent"||b.expandParent)&&(S=k.get(b.parentId),C=S&&b.extent==="parent"?vwe(S):void 0),N=[],_=void 0;for(const[F,z]of k)if(z.parentId===t&&(N.push({id:F,position:{...z.position},extent:z.extent}),z.extent==="parent"||z.expandParent)){const B=xwe(z,b,z.origin??M);_?_=[[Math.min(B[0][0],_[0][0]),Math.min(B[0][1],_[0][1])],[Math.max(B[1][0],_[1][0]),Math.max(B[1][1],_[1][1])]]:_=B}m==null||m(P,{...v})}).on("drag",P=>{const{transform:k,snapGrid:D,snapToGrid:A,nodeOrigin:I}=n(),M=Zp(P.sourceEvent,{transform:k,snapGrid:D,snapToGrid:A,containerBounds:j}),$=[];if(!b)return;const{x:R,y:O,width:F,height:z}=v,B={},H=b.origin??I,{width:Y,height:ee,x:V,y:K}=gwe(w,o.controlDirection,M,o.boundaries,o.keepAspectRatio,H,C,_),W=Y!==F,q=ee!==z,J=V!==R&&W,ie=K!==O&&q;if(!J&&!ie&&!W&&!q)return;if((J||ie||H[0]===1||H[1]===1)&&(B.x=J?V:v.x,B.y=ie?K:v.y,v.x=B.x,v.y=B.y,N.length>0)){const ce=V-R,ye=K-O;for(const Ie of N)Ie.position={x:Ie.position.x-ce+H[0]*(Y-F),y:Ie.position.y-ye+H[1]*(ee-z)},$.push(Ie)}if((W||q)&&(B.width=W&&(!o.resizeDirection||o.resizeDirection==="horizontal")?Y:v.width,B.height=q&&(!o.resizeDirection||o.resizeDirection==="vertical")?ee:v.height,v.width=B.width,v.height=B.height),S&&b.expandParent){const ce=H[0]*(B.width??0);B.x&&B.x<ce&&(v.x=ce,w.x=w.x-(B.x-ce));const ye=H[1]*(B.height??0);B.y&&B.y<ye&&(v.y=ye,w.y=w.y-(B.y-ye))}const X=pwe({width:v.width,prevWidth:F,height:v.height,prevHeight:z,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),ge={...v,direction:X};(y==null?void 0:y(P,ge))!==!1&&(E=!0,p==null||p(P,ge),r(B,$))}).on("end",P=>{E&&(g==null||g(P,{...v}),a==null||a({...v}),E=!1)});i.call(T)}function c(){i.on(".drag",null)}return{update:l,destroy:c}}var NH={exports:{}},SH={};/**
802 * @license React
803 * use-sync-external-store-shim/with-selector.production.js
804 *
805 * Copyright (c) Meta Platforms, Inc. and affiliates.
806 *
807 * This source code is licensed under the MIT license found in the
808 * LICENSE file in the root directory of this source tree.
809 */var _1=x,wwe=Nk;function jwe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Nwe=typeof Object.is=="function"?Object.is:jwe,Swe=wwe.useSyncExternalStore,Cwe=_1.useRef,_we=_1.useEffect,Ewe=_1.useMemo,Awe=_1.useDebugValue;SH.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var i=Cwe(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=Ewe(function(){function c(m){if(!u){if(u=!0,d=m,m=r(m),a!==void 0&&o.hasValue){var p=o.value;if(a(p,m))return f=p}return f=m}if(p=f,Nwe(d,m))return p;var g=r(m);return a!==void 0&&a(p,g)?(d=m,p):(d=m,f=g)}var u=!1,d,f,h=n===void 0?null:n;return[function(){return c(t())},h===null?void 0:function(){return c(h())}]},[t,n,r,a]);var l=Swe(e,i[0],i[1]);return _we(function(){o.hasValue=!0,o.value=l},[l]),Awe(l),l};NH.exports=SH;var Pwe=NH.exports;const kwe=$t(Pwe),Owe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_ENV:"production",VITE_GA_ID:"",VITE_SENTRY_DSN:"",VITE_STRIPE_PUBLIC_KEY:"pk_test_51SQZFxCle9n0RxbfIPZ31mdzxwK66JDMYYkq3Na6LXOgNkbGkLx6X7vpidROV54lWaIFMAYopvpDn8wez8Di4AfO00Bcw1nwkE"},iI=e=>{let t;const n=new Set,r=(d,f)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const m=t;t=f??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(p=>p(t,m))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d)),destroy:()=>{(Owe?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,a,c);return c},Twe=e=>e?iI(e):iI,{useDebugValue:Mwe}=L,{useSyncExternalStoreWithSelector:Rwe}=kwe,Dwe=e=>e;function CH(e,t=Dwe,n){const r=Rwe(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Mwe(r),r}const oI=(e,t)=>{const n=Twe(e),r=(a,i=t)=>CH(n,a,i);return Object.assign(r,n),r},$we=(e,t)=>e?oI(e,t):oI;function Nn(e,t){if(Object.is(e,t))return!0;
vendor: 4,118 bytes, line 809
809if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const E1=x.createContext(null),Iwe=E1.Provider,_H=no.error001();function Tt(e,t){const n=x.useContext(E1);if(n===null)throw new Error(_H);return CH(n,e,t)}function Sn(){const e=x.useContext(E1);if(e===null)throw new Error(_H);return x.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const lI={display:"none"},Lwe={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},EH="react-flow__node-desc",AH="react-flow__edge-desc",Fwe="react-flow__aria-live",Bwe=e=>e.ariaLiveMessage,zwe=e=>e.ariaLabelConfig;function Uwe({rfId:e}){const t=Tt(Bwe);return s.jsx("div",{id:`${Fwe}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Lwe,children:t})}function Vwe({rfId:e,disableKeyboardA11y:t}){const n=Tt(zwe);return s.jsxs(s.Fragment,{children:[s.jsx("div",{id:`${EH}-${e}`,style:lI,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),s.jsx("div",{id:`${AH}-${e}`,style:lI,children:n["edge.a11yDescription.default"]}),!t&&s.jsx(Uwe,{rfId:e})]})}const mc=x.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},i)=>{const o=`${e}`.split("-");return s.jsx("div",{className:Zn(["react-flow__panel",n,...o]),style:r,ref:i,...a,children:t})});mc.displayName="Panel";function Wwe({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:s.jsx(mc,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:s.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const qwe=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Dx=e=>e.id;function Hwe(e,t){return Nn(e.selectedNodes.map(Dx),t.selectedNodes.map(Dx))&&Nn(e.selectedEdges.map(Dx),t.selectedEdges.map(Dx))}function Kwe({onSelectionChange:e}){const t=Sn(),{selectedNodes:n,selectedEdges:r}=Tt(qwe,Hwe);return x.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(i=>i(a))},[n,r,e]),null}const Gwe=e=>!!e.onSelectionChangeHandlers;function Ywe({onSelectionChange:e}){const t=Tt(Gwe);return e||t?s.jsx(Kwe,{onSelectionChange:e}):null}const PH=[0,0],Xwe={x:0,y:0,zoom:1},Qwe=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],cI=[...Qwe,"rfId"],Jwe=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setN
809odeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),uI={translateExtent:Qg,nodeOrigin:PH,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function Zwe(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:i,setNodeExtent:o,reset:l,setDefaultNodesAndEdges:c}=Tt(Jwe,Nn),u=Sn();x.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=uI,l()}),[]);const d=x.useRef(uI);return x.useEffect(()=>{for(const f of cI){const h=e[f],m=d.current[f];h!==m&&(typeof e[f]>"u"||(f==="nodes"?t(h):f==="edges"?n(h):f==="minZoom"?r(h):f==="maxZoom"?a(h):f==="translateExtent"?i(h):f==="nodeExtent"?o(h):f==="ariaLabelConfig"?u.setState({ariaLabelConfig:T0e(h)}):f==="fitView"?u.setState({fitViewQueued:h}):f==="fitViewOptions"?u.setState({fitViewOptions:h}):u.setState({[f]:h})))}d.current=e},cI.map(f=>e[f])),null}function dI(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function eje(e){var r;const[t,n]=x.useState(e==="system"?null:e);return x.useEffect(()=>{if(e!=="system"){n(e);return}const a=dI(),i=()=>n(a!=null&&a.matches?"dark":"light");return i(),a==null||a.addEventListener("change",i),()=>{a==null||a.removeEventListener("change",i)}},[e]),t!==null?t:(r=dI())!=null&&r.matches?"dark":"light"}const fI=typeof document<"u"?document:null;function ny(e=null,t={target:fI,actInsideInputWithModifier:!0}){const[n,r]=x.useState(!1),a=x.useRef(!1),i=x.useRef(new Set([])),[o,l]=x.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(f=>typeof f=="string").map(f=>f.replace("+",`
810`).replace(`
811
812`,`
813+`).split(`
814`)),d=u.reduce((f,h)=>f.concat(...h),[]);return[u,d]}return[[],[]]},[e]);return x.useEffect(()=>{const c=(t==null?void 0:t.target)??fI,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const d=m=>{var y,v;if(a.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!a.current||a.current&&!u)&&iH(m))return!1;const g=mI(m.code,l);if(i.current.add(m[g]),hI(o,i.current,!1)){const w=((v=(y=m.composedPath)==null?void 0:y.call(m))==null?void 0:v[0])||m.target,b=(w==null?void 0:w.nodeName)==="BUTTON"||(w==null?void 0:w.nodeName)==="A";t.preventDefault!==!1&&(a.current||!b)&&m.preventDefault(),r(!0)}},f=m=>{const p=mI(m.code,l);hI(o,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(m[p]),m.key==="Meta"&&i.current.clear(),a.current=!1},h=()=>{i.current.clear(),r(!1)};return c==null||c.addEventListener("keydown",d),c==null||c.addEventListener("keyup",f),window.addEventListener("blur",h),window.addEventListener("contextmenu",h),()=>{c==null||c.removeEventListener("keydown",d),c==null||c.removeEventListener("keyup",f),window.removeEventListener("blur",h),window.removeEventListener("contextmenu",h)}}},[e,r]),n}function hI(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function mI(e,t){return t.includes(e)?"code":"key"}const tje=()=>{const e=Sn();return x.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,i],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:i,maxZoom:o,panZoom:l}=e.getState(),c=AO(t,r,a,i,o,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(c,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:i,domNode:o}=e.getState();if(!o)return t;const{x:l,y:c}=o.getBoundingClientRect(),u={x:t.x-l,y:t.y-c}
814,d=n.snapGrid??a,f=n.snapToGrid??i;return Pv(u,r,f,d)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:i}=r.getBoundingClientRect(),o=D0(t,n);return{x:o.x+a,y:o.y+i}}}),[])};function kH(e,t){const n=[],r=new Map,a=[];for(const i of e)if(i.type==="add"){a.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const o=r.get(i.id);o?o.push(i):r.set(i.id,[i])}for(const i of t){const o=r.get(i.id);if(!o){n.push(i);continue}if(o[0].type==="remove")continue;if(o[0].type==="replace"){n.push({...o[0].item});continue}const l={...i};for(const c of o)nje(c,l);n.push(l)}return a.length&&a.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function nje(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function OH(e,t){return kH(e,t)}function TH(e,t){return kH(e,t)}function pu(e,t){return{id:e,type:"select",selected:t}}function wf(e,t=new Set,n=!1){const r=[];for(const[a,i]of e){const o=t.has(a);!(i.selected===void 0&&!o)&&i.selected!==o&&(n&&(i.selected=o),r.push(pu(i.id,o)))}return r}function pI({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,o]of e.entries()){const l=t.get(o.id),c=((a=l==null?void 0:l.internals)==null?void 0:a.userNode)??l;c!==void 0&&c!==o&&n.push({id:o.id,item:o,type:"replace"}),c===void 0&&n.push({item:o,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function gI(e){return{id:e.id,type:"remove"}}const yI=e=>j0e(e),rje=e=>Jq(e);function MH(e){return x.forwardRef(e)}const aje=typeof window<"u"?x.useLayoutEffect:x.useEffect;function vI(e){const[t,n]=x.useState(BigInt(0)),[r]=x.useState(()=>sje(()=>n(a=>a+BigInt(1))));return aje(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function sje(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const RH=x.createContext(null);function ije({children:e}){const t=Sn(),n=x.useCallback(l=>{const{nodes:c=[],setNodes:u,hasDefaultNodes:d,onNodesChange:f,nodeLookup:h,fitViewQueued:m,onNodesChangeMiddlewareMap:p}=t.getState();let g=c;for(const v of l)g=typeof v=="function"?v(g):v;let y=pI({items:g,lookup:h});for(const v of p.values())y=v(y);d&&u(g),y.length>0?f==null||f(y):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:v,nodes:w,setNodes:b}=t.getState();v&&b(w)})},[]),r=vI(n),a=x.useCallback(l=>{const{edges:c=[],setEdges:u,hasDefaultEdges:d,onEdgesChange:f,edgeLookup:h}=t.getState();let m=c;for(const p of l)m=typeof p=="function"?p(m):p;d?u(m):f&&f(pI({items:m,lookup:h}))},[]),i=vI(a),o=x.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return s.jsx(RH.Provider,{value:o,children:e})}function oje(){const e=x.useContext(RH);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const lje=e=>!!e.panZoom;function DO(){const e=tje(),t=Sn(),n=oje(),r=Tt(lje),a=x.useMemo(()=>{const i=f=>t.getState().nodeLookup.get(f),o=f=>{n.nodeQueue.push(f)},l=f=>{n.edgeQueue.push(f)},c=f=>{var v,w;const{nodeLookup:h,nodeOrigin:m}=t.getState(),p=yI(f)?f:h.get(f.id),g=p.parentId?aH(p.position,p.measured,p.parentId,h,m):p.position,y={...p,position:g,width:((v=p.measured)==null?void 0:v.width)??p.width,height:((w=p.measured)==null?void 0:w.height)??p.height};return Ch(y)},u=(f,h,m={replace:!1})=>{o(p=>p.map(g=>{if(g.id===f){const y=typeof h=="function"?h(g):h;return m.replace&&yI(y)?y:{...g,...y}}return g}))},d=(f,h,m={replace:!1})=>{l(p=>p.map(g=>{if(g.id===f){const y=typeof h=="function"?h(g):h;return m.replace&&rje(y)?y:{...g,...y}}return g}))};return{getNodes:()=>t.getState().nodes.map(f=>({...f})),getNode:f=>{var h;
814return(h=i(f))==null?void 0:h.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:f=[]}=t.getState();return f.map(h=>({...h}))},getEdge:f=>t.getState().edgeLookup.get(f),setNodes:o,setEdges:l,addNodes:f=>{const h=Array.isArray(f)?f:[f];n.nodeQueue.push(m=>[...m,...h])},addEdges:f=>{const h=Array.isArray(f)?f:[f];n.edgeQueue.push(m=>[...m,...h])},toObject:()=>{const{nodes:f=[],edges:h=[],transform:m}=t.getState(),[p,g,y]=m;return{nodes:f.map(v=>({...v})),edges:h.map(v=>({...v})),viewport:{x:p,y:g,zoom:y}}},deleteElements:async({nodes:f=[],edges:h=[]})=>{const{nodes:m,edges:p,onNodesDelete:g,onEdgesDelete:y,triggerNodeChanges:v,triggerEdgeChanges:w,onDelete:b,onBeforeDelete:j}=t.getState(),{nodes:N,edges:S}=await E0e({nodesToRemove:f,edgesToRemove:h,nodes:m,edges:p,onBeforeDelete:j}),C=S.length>0,_=N.length>0;if(C){const E=S.map(gI);y==null||y(S),w(E)}if(_){const E=N.map(gI);g==null||g(N),v(E)}return(_||C)&&(b==null||b({nodes:N,edges:S})),{deletedNodes:N,deletedEdges:S}},getIntersectingNodes:(f,h=!0,m)=>{const p=K$(f),g=p?f:c(f),y=m!==void 0;return g?(m||t.getState().nodes).filter(v=>{const w=t.getState().nodeLookup.get(v.id);if(w&&!p&&(v.id===f.id||!w.internals.positionAbsolute))return!1;const b=Ch(y?v:w),j=ey(b,g);return h&&j>0||j>=b.width*b.height||j>=g.width*g.height}):[]},isNodeIntersecting:(f,h,m=!0)=>{const g=K$(f)?f:c(f);if(!g)return!1;const y=ey(g,h);return m&&y>0||y>=h.width*h.height||y>=g.width*g.height},updateNode:u,updateNodeData:(f,h,m={replace:!1})=>{u(f,p=>{const g=typeof h=="function"?h(p):h;return m.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},m)},updateEdge:d,updateEdgeData:(f,h,m={replace:!1})=>{d(f,p=>{const g=typeof h=="function"?h(p):h;return m.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},m)},getNodesBounds:f=>{const{nodeLookup:h,nodeOrigin:m}=t.getState();return N0e(f,{nodeLookup:h,nodeOrigin:m})},getHandleConnections:({type:f,id:h,nodeId:m})=>{var p;return Array.from(((p=t.getState().connectionLookup.get(`${m}-${f}${h?`-${h}`:""}`))==null?void 0:p.values())??[])},getNodeConnections:({type:f,handleId:h,nodeId:m})=>{var p;return Array.from(((p=t.getState().connectionLookup.get(`${m}${f?h?`-${f}-${h}`:`-${f}`:""}`))==null?void 0:p.values())??[])},fitView:async f=>{const h=t.getState().fitViewResolver??O0e();return t.setState({fitViewQueued:!0,fitViewOptions:f,fitViewResolver:h}),n.nodeQueue.push(m=>[...m]),h.promise}}},[]);return x.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const xI=e=>e.selected,cje=typeof window<"u"?window:void 0;function uje({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=Sn(),{deleteElements:r}=DO(),a=ny(e,{actInsideInputWithModifier:!1}),i=ny(t,{target:cje});x.useEffect(()=>{if(a){const{edges:o,nodes:l}=n.getState();r({nodes:l.filter(xI),edges:o.filter(xI)}),n.setState({nodesSelectionActive:!1})}},[a]),x.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function dje(e){const t=Sn();x.useEffect(()=>{const n=()=>{var a,i,o,l;if(!e.current||!(((i=(a=e.current).checkVisibility)==null?void 0:i.call(a))??!0))return!1;const r=PO(e.current);(r.height===0||r.width===0)&&((l=(o=t.getState()).onError)==null||l.call(o,"004",no.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const A1={position:"absolute",width:"100%",height:"100%",top:0,left:0},fje=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function hje({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:i=Gu.Free,zoomOnDoubleClick:o=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:h,preventScrolling:m=!0,children:p,noWheelClassName:g,noPanClassName:y,onViewportChange:v,isControlledViewport:w,paneClickDistance:b,selectionOnDrag:j}){const N=Sn(),S=x.useRef(null),{userSelectionActive:C,lib:_,connectionInProgress:E}=Tt(fje,Nn),T=ny(h),P=x.useRef();dje(S);const k=x.useCallback(D=>{v==null||v({x:D[0],y:D[1],zoom:D[2]}),w||N.setState({transform:D})},[v,w]);return x.useEffect(()=>{if(S.current){P.current=mwe({domNode:S.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:M=>
814N.setState({paneDragging:M}),onPanZoomStart:(M,$)=>{const{onViewportChangeStart:R,onMoveStart:O}=N.getState();O==null||O(M,$),R==null||R($)},onPanZoom:(M,$)=>{const{onViewportChange:R,onMove:O}=N.getState();O==null||O(M,$),R==null||R($)},onPanZoomEnd:(M,$)=>{const{onViewportChangeEnd:R,onMoveEnd:O}=N.getState();O==null||O(M,$),R==null||R($)}});const{x:D,y:A,zoom:I}=P.current.getViewport();return N.setState({panZoom:P.current,transform:[D,A,I],domNode:S.current.closest(".react-flow")}),()=>{var M;(M=P.current)==null||M.destroy()}}},[]),x.useEffect(()=>{var D;(D=P.current)==null||D.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:i,zoomOnDoubleClick:o,panOnDrag:l,zoomActivationKeyPressed:T,preventScrolling:m,noPanClassName:y,userSelectionActive:C,noWheelClassName:g,lib:_,onTransformChange:k,connectionInProgress:E,selectionOnDrag:j,paneClickDistance:b})},[e,t,n,r,a,i,o,l,T,m,y,C,g,_,k,E,j,b]),s.jsx("div",{className:"react-flow__renderer",ref:S,style:A1,children:p})}const mje=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function pje(){const{userSelectionActive:e,userSelectionRect:t}=Tt(mje,Nn);return e&&t?s.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const WS=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},gje=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function yje({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Jg.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:i,onSelectionStart:o,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:h,onPaneMouseLeave:m,children:p}){const g=Sn(),{userSelectionActive:y,elementsSelectable:v,dragging:w,connectionInProgress:b}=Tt(gje,Nn),j=v&&(e||y),N=x.useRef(null),S=x.useRef(),C=x.useRef(new Set),_=x.useRef(new Set),E=x.useRef(!1),T=R=>{if(E.current||b){E.current=!1;return}c==null||c(R),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},P=R=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){R.preventDefault();return}u==null||u(R)},k=d?R=>d(R):void 0,D=R=>{E.current&&(R.stopPropagation(),E.current=!1)},A=R=>{var ee,V;const{domNode:O}=g.getState();if(S.current=O==null?void 0:O.getBoundingClientRect(),!S.current)return;const F=R.target===N.current;if(!F&&!!R.target.closest(".nokey")||!e||!(i&&F||t)||R.button!==0||!R.isPrimary)return;(V=(ee=R.target)==null?void 0:ee.setPointerCapture)==null||V.call(ee,R.pointerId),E.current=!1;const{x:H,y:Y}=ti(R.nativeEvent,S.current);g.setState({userSelectionRect:{width:0,height:0,startX:H,startY:Y,x:H,y:Y}}),F||(R.stopPropagation(),R.preventDefault())},I=R=>{const{userSelectionRect:O,transform:F,nodeLookup:z,edgeLookup:B,connectionLookup:H,triggerNodeChanges:Y,triggerEdgeChanges:ee,defaultEdgeOptions:V,resetSelectedElements:K}=g.getState();if(!S.current||!O)return;const{x:W,y:q}=ti(R.nativeEvent,S.current),{startX:J,startY:ie}=O;if(!E.current){const ye=t?0:a;if(Math.hypot(W-J,q-ie)<=ye)return;K(),o==null||o(R)}E.current=!0;const X={startX:J,startY:ie,x:W<J?W:J,y:q<ie?q:ie,width:Math.abs(W-J),height:Math.abs(q-ie)},ge=C.current,Se=_.current;C.current=new Set(EO(z,X,F,n===Jg.Partial,!0).map(ye=>ye.id)),_.current=new Set;const ce=(V==null?void 0:V.selectable)??!0;for(const ye of C.current){const Ie=H.get(ye);if(Ie)for(const{edgeId:Ue}of Ie.values()){const Ze=B.get(Ue);Ze&&(Ze.selectable??ce)&&_.current.add(Ue)}}if(!G$(ge,C.current)){const ye=wf(z,C.current,!0);Y(ye)}if(!G$(Se,_.current)){const ye=wf(B,_.current);ee(ye)}g.setState({userSelectionRect:X,userSelectionActive:!0,nodesSelectionActive:!1})},M=R=>{var O,F;R.button===0&&((F=(O=R.target)==null?void 0:O.releasePointerCapture)==null||F.call(O,R.pointerId),!y&&R.target===N.current&&g.getState().userSelectionRect&&(T==null||T(R)),g.setState({userSelectionActive:!1,userSelectionRect:null}),E.current&&(l==null||l(R),g.setState({nodesSelectionActive:C.current.size>0})))},$=r===!0||Array.isArray(r)&&r.includes(0);return s.jsxs("div",{className:Zn(["react-flow__pane",{draggable:$,dragging:w,selection:e}]),onClick:j?void 0:WS(T,N),onContextMenu:WS(P,N),onWheel:WS(k,N),onPointerEnter:j?void 0:f,onPointerMove:j?I:h,onPointerUp:j?M:void 0,onPointerDownCapture:j?A:void 0,onClickCapture:j?D:void 0,onPointerLeave:m,ref:N,style:A1,children:[p,s.jsx(pje,{})]})}function X2({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:i,multiSelectionActive:o,nodeLookup:l,onError:c}=t.getState(),u=l.get(e);if(!u){c==null||c("012",no.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&o)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var d;return(d=r==null?void 0:r.current)==null?void 0:d.blur()})):a([e])}function DH({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,no
814deId:a,isSelectable:i,nodeClickDistance:o}){const l=Sn(),[c,u]=x.useState(!1),d=x.useRef();return x.useEffect(()=>{d.current=ewe({getStoreItems:()=>l.getState(),onNodeMouseDown:f=>{X2({id:f,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),x.useEffect(()=>{var f,h;if(t)(f=d.current)==null||f.destroy();else if(e.current)return(h=d.current)==null||h.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:a,nodeClickDistance:o}),()=>{var m;(m=d.current)==null||m.destroy()}},[n,r,t,i,e,a]),c}const vje=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function $H(){const e=Sn();return x.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:i,nodesDraggable:o,onError:l,updateNodePositions:c,nodeLookup:u,nodeOrigin:d}=e.getState(),f=new Map,h=vje(o),m=a?i[0]:5,p=a?i[1]:5,g=n.direction.x*m*n.factor,y=n.direction.y*p*n.factor;for(const[,v]of u){if(!h(v))continue;let w={x:v.internals.positionAbsolute.x+g,y:v.internals.positionAbsolute.y+y};a&&(w=Av(w,i));const{position:b,positionAbsolute:j}=Zq({nodeId:v.id,nextPosition:w,nodeLookup:u,nodeExtent:r,nodeOrigin:d,onError:l});v.position=b,v.internals.positionAbsolute=j,f.set(v.id,v)}c(f)},[])}const $O=x.createContext(null),xje=$O.Provider;$O.Consumer;const IH=()=>x.useContext($O),bje=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),wje=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:i,connection:o}=r,{fromHandle:l,toHandle:c,isValid:u}=o,d=(c==null?void 0:c.nodeId)===e&&(c==null?void 0:c.id)===t&&(c==null?void 0:c.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:d,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:i===vd.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!a,valid:d&&u}};function jje({type:e="source",position:t=We.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:o,onConnect:l,children:c,className:u,onMouseDown:d,onTouchStart:f,...h},m){var I,M;const p=o||null,g=e==="target",y=Sn(),v=IH(),{connectOnClick:w,noPanClassName:b,rfId:j}=Tt(bje,Nn),{connectingFrom:N,connectingTo:S,clickConnecting:C,isPossibleEndHandle:_,connectionInProcess:E,clickConnectionInProcess:T,valid:P}=Tt(wje(v,p,e),Nn);v||(M=(I=y.getState()).onError)==null||M.call(I,"010",no.error010());const k=$=>{const{defaultEdgeOptions:R,onConnect:O,hasDefaultEdges:F}=y.getState(),z={...R,...$};if(F){const{edges:B,setEdges:H}=y.getState();H(L0e(z,B))}O==null||O(z),l==null||l(z)},D=$=>{if(!v)return;const R=oH($.nativeEvent);if(a&&(R&&$.button===0||!R)){const O=y.getState();Y2.onPointerDown($.nativeEvent,{handleDomNode:$.currentTarget,autoPanOnConnect:O.autoPanOnConnect,connectionMode:O.connectionMode,connectionRadius:O.connectionRadius,domNode:O.domNode,nodeLookup:O.nodeLookup,lib:O.lib,isTarget:g,handleId:p,nodeId:v,flowId:O.rfId,panBy:O.panBy,cancelConnection:O.cancelConnection,onConnectStart:O.onConnectStart,onConnectEnd:O.onConnectEnd,updateConnection:O.updateConnection,onConnect:k,isValidConnection:n||O.isValidConnection,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,autoPanSpeed:O.autoPanSpeed,dragThreshold:O.connectionDragThreshold})}R?d==null||d($):f==null||f($)},A=$=>{const{onClickConnectStart:R,onClickConnectEnd:O,connectionClickStartHandle:F,connectionMode:z,isValidConnection:B,lib:H,rfId:Y,nodeLookup:ee,connection:V}=y.getState();if(!v||!F&&!a)return;if(!F){R==null||R($.nativeEvent,{nodeId:v,handleId:p,handleType:e}),y.setState({connectionClickStartHandle:{nodeId:v,type:e,id:p}});return}const K=sH($.target),W=n||B,{connection:q,isValid:J}=Y2.isValid($.nativeEvent,{handle:{nodeId:v,id:p,type:e},connectionMode:z,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:W,flowId:Y,doc:K,lib:H,nodeLookup:ee});J&&q&&k(q);const ie=structuredClone(V);delete ie.inProgress,ie.toPosition=ie.toHandle?ie.toHandle.position:null,O==null||O($,ie),y.setState({connectionClickStartHandle:null})};return s.jsx("div",{"data-handleid":p,"data-nodeid":v,"data-handlepos":t,"data-id":`${j}-${v}-${p}-${e}`,className:Zn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,u,{source:!g,target:g,connectable:r,connectablestart:a,connectableend:i,clickconnecting:C,connectingfrom:N,connectingto:S,valid:P,connectionindicator:r&&(!E||_)&&(E||T?i:a)}]),onMouseDown:D,onTouchStart:D,onClick:w?A:void 0,ref:m,...h,children:c})}const Ah=x.memo(MH(jje));function Nje({data:e,isConnectable:t,sourcePosition:n=We.Bottom}){return s.jsxs(s.Fragment,{children:[e==null?void 0:e.label,s.jsx(Ah,{type:"source",position:n,isConnectable:t})]})}function Sje({data:e,isConnectable:t,targetPosition:n=We.Top,sourcePosition:r=We.Bottom}){return s.jsxs(s.Fragment,{children:[s.jsx(Ah,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,s.jsx(Ah,{type:"source",position:r,isConnectable:t})]})}function Cje(){return null}function _je({data:e,isConnectable:t,targetPosition:n=We.Top}){return s.jsxs(s.Fragment,{children:[s.jsx(Ah,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const I0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},bI={input:Nje,default:Sje,output:_je,group:Cje};function Eje(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const Aje=e=>{const{width:t,height:n,x:r,y:a}=Ev(e.nodeLookup,{filter:i=>!!i.selected});return{width:ei(t)?t:null,height:ei(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function Pje({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=Sn(),{width:a,height:i,transformString:o,userSelectionActive:l}=Tt(Aje,Nn),c=$H(),u=x.useRef(null);if(x.useEffect(()=>{var h;n||(h=u.current)==null||h.focus({preventScroll:!0})},[n]),DH({nodeRef:u}),l||!a||!i)return null;const d=e?h=>{const m=r.getState().nodes.filter(p=>p.selected);e(h,m)}:void 0,f=h=>{Object.prototype.hasOwnProperty.call(I0,h.key)&&(h.preventDefault(),c({direction:I0[h.key],factor:h.shiftKey?4:1}))};return s.jsx("div",{className:Zn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:o},children:s.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:a,height:i}})})}
814const wI=typeof window<"u"?window:void 0,kje=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function LH({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:o,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:p,panActivationKeyCode:g,zoomActivationKeyCode:y,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:j,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:_,defaultViewport:E,translateExtent:T,minZoom:P,maxZoom:k,preventScrolling:D,onSelectionContextMenu:A,noWheelClassName:I,noPanClassName:M,disableKeyboardA11y:$,onViewportChange:R,isControlledViewport:O}){const{nodesSelectionActive:F,userSelectionActive:z}=Tt(kje,Nn),B=ny(u,{target:wI}),H=ny(g,{target:wI}),Y=H||_,ee=H||j,V=d&&Y!==!0,K=B||z||V;return uje({deleteKeyCode:c,multiSelectionKeyCode:p}),s.jsx(hje,{onPaneContextMenu:i,elementsSelectable:v,zoomOnScroll:w,zoomOnPinch:b,panOnScroll:ee,panOnScrollSpeed:N,panOnScrollMode:S,zoomOnDoubleClick:C,panOnDrag:!B&&Y,defaultViewport:E,translateExtent:T,minZoom:P,maxZoom:k,zoomActivationKeyCode:y,preventScrolling:D,noWheelClassName:I,noPanClassName:M,onViewportChange:R,isControlledViewport:O,paneClickDistance:l,selectionOnDrag:V,children:s.jsxs(yje,{onSelectionStart:h,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:i,onPaneScroll:o,panOnDrag:Y,isSelecting:!!K,selectionMode:f,selectionKeyPressed:B,paneClickDistance:l,selectionOnDrag:V,children:[e,F&&s.jsx(Pje,{onSelectionContextMenu:A,noPanClassName:M,disableKeyboardA11y:$})]})})}LH.displayName="FlowRenderer";const Oje=x.memo(LH),Tje=e=>t=>e?EO(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function Mje(e){return Tt(x.useCallback(Tje(e),[e]),Nn)}const Rje=e=>e.updateNodeInternals;function Dje(){const e=Tt(Rje),[t]=x.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const i=a.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:a.target,force:!0})}),e(r)}));return x.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function $je({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=Sn(),i=x.useRef(null),o=x.useRef(null),l=x.useRef(e.sourcePosition),c=x.useRef(e.targetPosition),u=x.useRef(t),d=n&&!!e.internals.handleBounds;return x.useEffect(()=>{i.current&&!e.hidden&&(!d||o.current!==i.current)&&(o.current&&(r==null||r.unobserve(o.current)),r==null||r.observe(i.current),o.current=i.current)},[d,e.hidden]),x.useEffect(()=>()=>{o.current&&(r==null||r.unobserve(o.current),o.current=null)},[]),x.useEffect(()=>{if(i.current){const f=u.current!==t,h=l.current!==e.sourcePosition,m=c.current!==e.targetPosition;(f||h||m)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function Ije({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:i,onDoubleClick:o,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:h,noPanClassName:m,disableKeyboardA11y:p,rfId:g,nodeTypes:y,nodeClickDistance:v,onError:w}){const{node:b,internals:j,isParent:N}=Tt(W=>{const q=W.nodeLookup.get(e),J=W.parentLookup.has(e);return{node:q,internals:q.internals,isParent:J}},Nn);let S=b.type||"default",C=(y==null?void 0:y[S])||bI[S];C===void 0&&(w==null||w("003",no.error003(S)),S="default",C=(y==null?void 0:y.default)||bI.default);const _=!!(b.draggable||l&&typeof b.draggable>"u"),E=!!(b.selectable||c&&typeof b.selectable>"u"),T=!!(b.connectable||u&&typeof b.connectable>"u"),P=!!(b.focusable||d&&typeof b.focusable>"u"),k=Sn(),D=rH(b),A=$je({node:b,nodeType:S,hasDimensions:D,resizeObserver:f}),I=DH({nodeRef:A,disabled:b.hidden||!_,noDragClassName:h,handleSelector:b.dragHandle,nodeId:e,isSelectable:E,nodeClickDistance:v}),M=$H();if(b.hidden)return null;const $=Nl(b),R=Eje(b),O=E||_||t||n||r||a,F=n?W=>n(W,{...j.userNode}):void 0,z=r?W=>r(W,{...j.userNode}):void 0,B=a?W=>a(W,{...j.userNode}):void 0,H=i?W=>i(W,{...j.userNode}):void 0,Y=o?W=>o(W,{...j.userNode}):void 0,ee=W=>{const{selectNodesOnDrag:q,nodeDragThreshold:J}=k.getState();E&&(!q||!_||J>0)&&X2({id:e,store:k,nodeRef:A}),t&&t(W,{...j.userNode})},V=W=>{if(!(iH(W.nativeEvent)||p)){if(Gq.includes(W.key)&&E){const q=W.key==="Escape";X2({id:e,store:k,unselect:q,nodeRef:A})}else if(_&&b.selected&&Object.prototype.hasOwnProperty.call(I0,W.key)){W.preventDefault();const{ariaLabelConfig:q}=k.getState();k.setState({ariaLiveMessage:q["node.a11yDescription.ariaLiveMessage"]({direction:W.key.replace("Arrow","").toLowerCase(),x:~~j.positionAbsolute.x,y:~~j.positionAbsolute.y})}),M({direction:I0[W.key],factor:W.shiftKey?4:1})}}},K=()=>{var Se;if(p||!((Se=A.current)!=null&&Se.matches(":focus-visible")))return;const{transform:W,width:q,height:J,autoPanOnNodeFocus:ie,setCenter:X}=k.getState();if(!ie)return;EO(new Map([[e,b]]),{x:0,y:0,width:q,height:J},W,!0).length>0||X(b.position.x+$.width/2,b.position.y+$.height/2,{zoom:W[2]})};return s.jsx("div",{className:Zn(["react-flow__node",`react-flow__node-${S}`,{[m]:_},b.className,{selected:b.selected,selectable:E,parent:N,draggable:_,dragging:I}]),ref:A,style:{zIndex:j.z,transform:`translate(${j.positionAbsolute.x}px,${j.positionAbsolute.y}px)`,pointerEvents:O?"all":"none",visibility:D?"visible":"hidden",...b.style,...R},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:F,onMouseMove:z,onMouseLeave:B,onContextMenu:H,onClick:ee,onDoubleClick:Y,onKeyDown:P?V:void 0,tabIndex:P?0:void 0,onFocus:P?K:void 0,role:b.ariaRole??(P?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${EH}-${g}`,"aria-label":b.ariaLabel,...b.domAttributes,children:s.jsx(xje,{value:e,children:s.jsx(C,{id:e,data:b.data,type:S,positionAbsoluteX:j.positionAbsolute.x,positionAbsoluteY:j.positionAbsolute.y,selected:b.selected??!1,selectable:E,draggable:_,deletable:b.deletable??!0,isConnectable:T,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:I,dragHandle:b.dragHandle,zIndex:j.z,parentId:b.parentId,...$})})})}var Lje=x.memo(Ije);const Fje=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,no
814desFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function FH(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:i}=Tt(Fje,Nn),o=Mje(e.onlyRenderVisibleElements),l=Dje();return s.jsx("div",{className:"react-flow__nodes",style:A1,children:o.map(c=>s.jsx(Lje,{id:c,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}FH.displayName="NodeRenderer";const Bje=x.memo(FH);function zje(e){return Tt(x.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const i=n.nodeLookup.get(a.source),o=n.nodeLookup.get(a.target);i&&o&&D0e({sourceNode:i,targetNode:o,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),Nn)}const Uje=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return s.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Vje=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return s.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},jI={[Zg.Arrow]:Uje,[Zg.ArrowClosed]:Vje};function Wje(e){const t=Sn();return x.useMemo(()=>{var a,i;return Object.prototype.hasOwnProperty.call(jI,e)?jI[e]:((i=(a=t.getState()).onError)==null||i.call(a,"009",no.error009(e)),null)},[e])}const qje=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:i="strokeWidth",strokeWidth:o,orient:l="auto-start-reverse"})=>{const c=Wje(t);return c?s.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:s.jsx(c,{color:n,strokeWidth:o})}):null},BH=({defaultColor:e,rfId:t})=>{const n=Tt(i=>i.edges),r=Tt(i=>i.defaultEdgeOptions),a=x.useMemo(()=>V0e(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?s.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:s.jsx("defs",{children:a.map(i=>s.jsx(qje,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};BH.displayName="MarkerDefinitions";var Hje=x.memo(BH);function zH({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:i,labelBgPadding:o=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,h]=x.useState({x:1,y:0,width:0,height:0}),m=Zn(["react-flow__edge-textwrapper",u]),p=x.useRef(null);return x.useEffect(()=>{if(p.current){const g=p.current.getBBox();h({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?s.jsxs("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:m,visibility:f.width?"visible":"hidden",...d,children:[a&&s.jsx("rect",{width:f.width+2*o[0],x:-o[0],y:-o[1],height:f.height+2*o[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),s.jsx("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:p,style:r,children:n}),c]}):null}zH.displayName="EdgeText";const Kje=x.memo(zH);function P1({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c,interactionWidth:u=20,...d}){return s.jsxs(s.Fragment,{children:[s.jsx("path",{...d,d:e,fill:"none",className:Zn(["react-flow__edge-path",d.className])}),u?s.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&ei(t)&&ei(n)?s.jsx(Kje,{x:t,y:n,label:r,labelStyle:a,labelShowBg:i,labelBgStyle:o,labelBgPadding:l,labelBgBorderRadius:c}):null]})}function NI({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===We.Left||e===We.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function UH({sourceX:e,sourceY:t,sourcePosition:n=We.Bottom,targetX:r,targetY:a,targetPosition:i=We.Top}){const[o,l]=NI({pos:n,x1:e,y1:t,x2:r,y2:a}),[c,u]=NI({pos:i,x1:r,y1:a,x2:e,y2:t}),[d,f,h,m]=lH({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:o,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${o},${l} ${c},${u} ${r},${a}`,d,f,h,m]}function VH(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:o,targetPosition:l,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:g,markerStart:y,interactionWidth:v})=>
814{const[w,b,j]=UH({sourceX:n,sourceY:r,sourcePosition:o,targetX:a,targetY:i,targetPosition:l}),N=e.isInternal?void 0:t;return s.jsx(P1,{id:N,path:w,labelX:b,labelY:j,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:g,markerStart:y,interactionWidth:v})})}const Gje=VH({isInternal:!1}),WH=VH({isInternal:!0});Gje.displayName="SimpleBezierEdge";WH.displayName="SimpleBezierEdgeInternal";function qH(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,sourcePosition:m=We.Bottom,targetPosition:p=We.Top,markerEnd:g,markerStart:y,pathOptions:v,interactionWidth:w})=>{const[b,j,N]=$0({sourceX:n,sourceY:r,sourcePosition:m,targetX:a,targetY:i,targetPosition:p,borderRadius:v==null?void 0:v.borderRadius,offset:v==null?void 0:v.offset,stepPosition:v==null?void 0:v.stepPosition}),S=e.isInternal?void 0:t;return s.jsx(P1,{id:S,path:b,labelX:j,labelY:N,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:y,interactionWidth:w})})}const HH=qH({isInternal:!1}),KH=qH({isInternal:!0});HH.displayName="SmoothStepEdge";KH.displayName="SmoothStepEdgeInternal";function GH(e){return x.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return s.jsx(HH,{...n,id:r,pathOptions:x.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const Yje=GH({isInternal:!1}),YH=GH({isInternal:!0});Yje.displayName="StepEdge";YH.displayName="StepEdgeInternal";function XH(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:p,interactionWidth:g})=>{const[y,v,w]=dH({sourceX:n,sourceY:r,targetX:a,targetY:i}),b=e.isInternal?void 0:t;return s.jsx(P1,{id:b,path:y,labelX:v,labelY:w,label:o,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:m,markerStart:p,interactionWidth:g})})}const Xje=XH({isInternal:!1}),QH=XH({isInternal:!0});Xje.displayName="StraightEdge";QH.displayName="StraightEdgeInternal";function JH(e){return x.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:o=We.Bottom,targetPosition:l=We.Top,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:g,markerStart:y,pathOptions:v,interactionWidth:w})=>{const[b,j,N]=cH({sourceX:n,sourceY:r,sourcePosition:o,targetX:a,targetY:i,targetPosition:l,curvature:v==null?void 0:v.curvature}),S=e.isInternal?void 0:t;return s.jsx(P1,{id:S,path:b,labelX:j,labelY:N,label:c,labelStyle:u,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:m,style:p,markerEnd:g,markerStart:y,interactionWidth:w})})}const Qje=JH({isInternal:!1}),ZH=JH({isInternal:!0});Qje.displayName="BezierEdge";ZH.displayName="BezierEdgeInternal";const SI={default:ZH,straight:QH,step:YH,smoothstep:KH,simplebezier:WH},CI={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Jje=(e,t,n)=>n===We.Left?e-t:n===We.Right?e+t:e,Zje=(e,t,n)=>n===We.Top?e-t:n===We.Bottom?e+t:e,_I="react-flow__edgeupdater";function EI({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:i,onMouseOut:o,type:l}){return s.jsx("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:o,className:Zn([_I,`${_I}-${l}`]),cx:Jje(t,r,e),cy:Zje(n,r,e),r,stroke:"transparent",fill:"transparent"})}function e1e({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:i,targetY:o,sourcePosition:l,targetPosition:c,onReconnect:u,onReconnectStart:d,onReconnectEnd:f,setReconnecting:h,setUpdateHover:m}){const p=Sn(),g=(j,N)=>{if(j.button!==0)return;const{autoPanOnConnect:S,domNode:C,isValidConnection:_,connectionMode:E,connectionRadius:T,lib:P,onConnectStart:k,onConnectEnd:D,cancelConnection:A,nodeLookup:I,rfId:M,panBy:$,updateConnection:R}=p.getState(),O=N.type==="target",F=(H,Y)=>{h(!1),f==null||f(H,n,N.type,Y)},z=H=>u==null?void 0:u(n,H),B=(H,Y)=>{h(!0),d==null||d(j,n,N.type),k==null||k(H,Y)};Y2.onPointerDown(j.nativeEvent,{autoPanOnConnect:S,connectionMode:E,connectionRadius:T,domNode:C,handleId:N.id,nodeId:N.nodeId,nodeLookup:I,isTarget:O,edgeUpdaterType:N.type,lib:P,flowId:M,cancelConnection:A,panBy:$,isValidConnection:_,onConnect:z,onConnectStart:B,onConnectEnd:D,onReconnectEnd:F,updateConnection:R,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNo
814de:j.currentTarget})},y=j=>g(j,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),v=j=>g(j,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),w=()=>m(!0),b=()=>m(!1);return s.jsxs(s.Fragment,{children:[(e===!0||e==="source")&&s.jsx(EI,{position:l,centerX:r,centerY:a,radius:t,onMouseDown:y,onMouseEnter:w,onMouseOut:b,type:"source"}),(e===!0||e==="target")&&s.jsx(EI,{position:c,centerX:i,centerY:o,radius:t,onMouseDown:v,onMouseEnter:w,onMouseOut:b,type:"target"})]})}function t1e({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,rfId:p,edgeTypes:g,noPanClassName:y,onError:v,disableKeyboardA11y:w}){let b=Tt(X=>X.edgeLookup.get(e));const j=Tt(X=>X.defaultEdgeOptions);b=j?{...j,...b}:b;let N=b.type||"default",S=(g==null?void 0:g[N])||SI[N];S===void 0&&(v==null||v("011",no.error011(N)),N="default",S=(g==null?void 0:g.default)||SI.default);const C=!!(b.focusable||t&&typeof b.focusable>"u"),_=typeof f<"u"&&(b.reconnectable||n&&typeof b.reconnectable>"u"),E=!!(b.selectable||r&&typeof b.selectable>"u"),T=x.useRef(null),[P,k]=x.useState(!1),[D,A]=x.useState(!1),I=Sn(),{zIndex:M,sourceX:$,sourceY:R,targetX:O,targetY:F,sourcePosition:z,targetPosition:B}=Tt(x.useCallback(X=>{const ge=X.nodeLookup.get(b.source),Se=X.nodeLookup.get(b.target);if(!ge||!Se)return{zIndex:b.zIndex,...CI};const ce=U0e({id:e,sourceNode:ge,targetNode:Se,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:X.connectionMode,onError:v});return{zIndex:R0e({selected:b.selected,zIndex:b.zIndex,sourceNode:ge,targetNode:Se,elevateOnSelect:X.elevateEdgesOnSelect,zIndexMode:X.zIndexMode}),...ce||CI}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex]),Nn),H=x.useMemo(()=>b.markerStart?`url('#${K2(b.markerStart,p)}')`:void 0,[b.markerStart,p]),Y=x.useMemo(()=>b.markerEnd?`url('#${K2(b.markerEnd,p)}')`:void 0,[b.markerEnd,p]);if(b.hidden||$===null||R===null||O===null||F===null)return null;const ee=X=>{var ye;const{addSelectedEdges:ge,unselectNodesAndEdges:Se,multiSelectionActive:ce}=I.getState();E&&(I.setState({nodesSelectionActive:!1}),b.selected&&ce?(Se({nodes:[],edges:[b]}),(ye=T.current)==null||ye.blur()):ge([e])),a&&a(X,b)},V=i?X=>{i(X,{...b})}:void 0,K=o?X=>{o(X,{...b})}:void 0,W=l?X=>{l(X,{...b})}:void 0,q=c?X=>{c(X,{...b})}:void 0,J=u?X=>{u(X,{...b})}:void 0,ie=X=>{var ge;if(!w&&Gq.includes(X.key)&&E){const{unselectNodesAndEdges:Se,addSelectedEdges:ce}=I.getState();X.key==="Escape"?((ge=T.current)==null||ge.blur(),Se({edges:[b]})):ce([e])}};return s.jsx("svg",{style:{zIndex:M},children:s.jsxs("g",{className:Zn(["react-flow__edge",`react-flow__edge-${N}`,b.className,y,{selected:b.selected,animated:b.animated,inactive:!E&&!a,updating:P,selectable:E}]),onClick:ee,onDoubleClick:V,onContextMenu:K,onMouseEnter:W,onMouseMove:q,onMouseLeave:J,onKeyDown:C?ie:void 0,tabIndex:C?0:void 0,role:b.ariaRole??(C?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":C?`${AH}-${p}`:void 0,ref:T,...b.domAttributes,children:[!D&&s.jsx(S,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:$,sourceY:R,targetX:O,targetY:F,sourcePosition:z,targetPosition:B,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:H,markerEnd:Y,pathOptions:"pathOptions"in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),_&&s.jsx(e1e,{edge:b,isReconnectable:_,reconnectRadius:d,onReconnect:f,onReconnectStart:h,onReconnectEnd:m,sourceX:$,sourceY:R,targetX:O,targetY:F,sourcePosition:z,targetPosition:B,setUpdateHover:k,setReconnecting:A})]})})}var n1e=x.memo(t1e);const r1e=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function eK({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:i,onEdgeContextMenu:o,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:h,onReconnectStart:m,onReconnectEnd:p,disableKeyboardA11y:g}){const{edgesFocusable:y,edgesReconnectable:v,elementsSelectable:w,onError:b}=Tt(r1e,Nn),j=zje(t);return s.jsxs("div",{className:"react-flow__edges",children:[s.jsx(Hje,{defaultColor:e,rfId:n}),j.map(N=>s.jsx(n1e,{id:N,edgesFocusable:y,edgesReconnectable:v,elementsSelectable:w,noPanClassName:a,onReconnect:i,onContextMenu:o,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:h,onReconnectStart:m,onReconnectEnd:p,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:g},N))]})}eK.displayName="EdgeRenderer";
814const a1e=x.memo(eK),s1e=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function i1e({children:e}){const t=Tt(s1e);return s.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function o1e(e){const t=DO(),n=x.useRef(!1);x.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const l1e=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function c1e(e){const t=Tt(l1e),n=Sn();return x.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function u1e(e){return e.connection.inProgress?{...e.connection,to:Pv(e.connection.to,e.transform)}:{...e.connection}}function d1e(e){return u1e}function f1e(e){const t=d1e();return Tt(t,Nn)}const h1e=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function m1e({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:i,height:o,isValid:l,inProgress:c}=Tt(h1e,Nn);return!(i&&a&&c)?null:s.jsx("svg",{style:e,width:i,height:o,className:"react-flow__connectionline react-flow__container",children:s.jsx("g",{className:Zn(["react-flow__connection",Qq(l)]),children:s.jsx(tK,{style:t,type:n,CustomComponent:r,isValid:l})})})}const tK=({style:e,type:t=Zl.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:i,fromNode:o,fromHandle:l,fromPosition:c,to:u,toNode:d,toHandle:f,toPosition:h,pointer:m}=f1e();if(!a)return;if(n)return s.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:c,toPosition:h,connectionStatus:Qq(r),toNode:d,toHandle:f,pointer:m});let p="";const g={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:u.x,targetY:u.y,targetPosition:h};switch(t){case Zl.Bezier:[p]=cH(g);break;case Zl.SimpleBezier:[p]=UH(g);break;case Zl.Step:[p]=$0({...g,borderRadius:0});break;case Zl.SmoothStep:[p]=$0(g);break;default:[p]=dH(g)}return s.jsx("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};tK.displayName="ConnectionLine";const p1e={};function AI(e=p1e){x.useRef(e),Sn(),x.useEffect(()=>{},[e])}function g1e(){Sn(),x.useRef(!1),x.useEffect(()=>{},[])}function nK({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:i,onEdgeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:h,onSelectionEnd:m,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:y,connectionLineContainerStyle:v,selectionKeyCode:w,selectionOnDrag:b,selectionMode:j,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,deleteKeyCode:_,onlyRenderVisibleElements:E,elementsSelectable:T,defaultViewport:P,translateExtent:k,minZoom:D,maxZoom:A,preventScrolling:I,defaultMarkerColor:M,zoomOnScroll:$,zoomOnPinch:R,panOnScroll:O,panOnScrollSpeed:F,panOnScrollMode:z,zoomOnDoubleClick:B,panOnDrag:H,onPaneClick:Y,onPaneMouseEnter:ee,onPaneMouseMove:V,onPaneMouseLeave:K,onPaneScroll:W,onPaneContextMenu:q,paneClickDistance:J,nodeClickDistance:ie,onEdgeContextMenu:X,onEdgeMouseEnter:ge,onEdgeMouseMove:Se,onEdgeMouseLeave:ce,reconnectRadius:ye,onReconnect:Ie,onReconnectStart:Ue,onReconnectEnd:Ze,noDragClassName:fe,noWheelClassName:Oe,noPanClassName:Et,disableKeyboardA11y:oe,nodeExtent:Je,rfId:ut,viewport:Q,onViewportChange:he}){return AI(e),AI(t),g1e(),o1e(n),c1e(Q),s.jsx(Oje,{onPaneClick:Y,onPaneMouseEnter:ee,onPaneMouseMove:V,onPaneMouseLeave:K,onPaneContextMenu:q,onPaneScroll:W,paneClickDistance:J,deleteKeyCode:_,selectionKeyCode:w,selectionOnDrag:b,selectionMode:j,onSelectionStart:h,onSelectionEnd:m,multiSelectionKeyCode:N,panActivationKeyCode:S,zoomActivationKeyCode:C,elementsSelectable:T,zoomOnScroll:$,zoomOnPinch:R,zoomOnDoubleClick:B,panOnScroll:O,panOnScrollSpeed:F,panOnScrollMode:z,panOnDrag:H,defaultViewport:P,translateExtent:k,minZoom:D,maxZoom:A,onSelectionContextMenu:f,preventScrolling:I,noDragClassName:fe,noWheelClassName:Oe,noPanClassName:Et,disableKeyboardA11y:oe,onViewportChange:he,isControlledViewport:!!Q,children:s.jsxs(i1e,{children:[s.jsx(a1e,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:o,onReconnect:Ie,onReconnectStart:Ue,onReconnectEnd:Ze,onlyRenderVisibleElements:E,onEdgeContextMenu:X,onEdgeMouseEnter:ge,onEdgeMouseMove:Se,onEdgeMouseLeave:ce,reconnectRadius:ye,defaultMarkerColor:M,noPanClassName:Et,disableKeyboardA11y:oe,rfId:ut}),s.jsx(m1e,{style:g,type:p,component:y,containerStyle:v}),s.jsx("div",{className:"react-flow__edgelabel-renderer"}),s.jsx(Bje,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:ie,onlyRenderVisibleElements:E,noPanClassName:Et,noDragClassName:fe,disableKeyboardA11y:oe,nodeExtent:Je,rfId:ut}),s.jsx("div",{className:"react-flow__viewport-portal"})]})})}nK.displayName="GraphView";const y1e=x.memo(nK),PI=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c=.5,maxZoom:u=2,nodeOrigin:d,nodeExtent:f,zIndexMode:h="basic"}={})=>{const m=new Map,p=new Map,g=new Map,y=new Map,v=r??t??[],w=n??e??[],b=d??[0,0],j=f??Qg;mH(g,y,v);const N=G2(w,m,p,{nodeOrigin:b,nodeExtent:j,zIndexMode:h});let S=[0,0,1];if(o&&a&&i){const C=Ev(m,{filter:P=>!!((P.width||P.initialWidth)&&(P.height||P.initialHeight))}),{x:_,y:E,zoom:T}=AO(C,a,i,c,u,(l==null?void 0:l.padding)??.1);S=[_,E,T]}return{rfId:"1",width:a??0,height:i??0,transform:S,nodes:w,nodesInitialized:N,nodeLookup:m,parentLookup:p,edges:v,edgeLookup:y,connectionLookup:g,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:u,translateExtent:Qg,nodeExtent:j,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:vd.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGri
814d:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:l,fitViewResolver:null,connection:{...Xq},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:A0e,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Yq,zIndexMode:h,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},v1e=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h})=>$we((m,p)=>{async function g(){const{nodeLookup:y,panZoom:v,fitViewOptions:w,fitViewResolver:b,width:j,height:N,minZoom:S,maxZoom:C}=p();v&&(await _0e({nodes:y,width:j,height:N,panZoom:v,minZoom:S,maxZoom:C},w),b==null||b.resolve(!0),m({fitViewResolver:null}))}return{...PI({nodes:e,edges:t,width:a,height:i,fitView:o,fitViewOptions:l,minZoom:c,maxZoom:u,nodeOrigin:d,nodeExtent:f,defaultNodes:n,defaultEdges:r,zIndexMode:h}),setNodes:y=>{const{nodeLookup:v,parentLookup:w,nodeOrigin:b,elevateNodesOnSelect:j,fitViewQueued:N,zIndexMode:S}=p(),C=G2(y,v,w,{nodeOrigin:b,nodeExtent:f,elevateNodesOnSelect:j,checkEquality:!0,zIndexMode:S});N&&C?(g(),m({nodes:y,nodesInitialized:C,fitViewQueued:!1,fitViewOptions:void 0})):m({nodes:y,nodesInitialized:C})},setEdges:y=>{const{connectionLookup:v,edgeLookup:w}=p();mH(v,w,y),m({edges:y})},setDefaultNodesAndEdges:(y,v)=>{if(y){const{setNodes:w}=p();w(y),m({hasDefaultNodes:!0})}if(v){const{setEdges:w}=p();w(v),m({hasDefaultEdges:!0})}},updateNodeInternals:y=>{const{triggerNodeChanges:v,nodeLookup:w,parentLookup:b,domNode:j,nodeOrigin:N,nodeExtent:S,debug:C,fitViewQueued:_,zIndexMode:E}=p(),{changes:T,updatedInternals:P}=X0e(y,w,b,j,N,S,E);P&&(H0e(w,b,{nodeOrigin:N,nodeExtent:S,zIndexMode:E}),_?(g(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),(T==null?void 0:T.length)>0&&(C&&console.log("React Flow: trigger node changes",T),v==null||v(T)))},updateNodePositions:(y,v=!1)=>{const w=[];let b=[];const{nodeLookup:j,triggerNodeChanges:N,connection:S,updateConnection:C,onNodesChangeMiddlewareMap:_}=p();for(const[E,T]of y){const P=j.get(E),k=!!(P!=null&&P.expandParent&&(P!=null&&P.parentId)&&(T!=null&&T.position)),D={id:E,type:"position",position:k?{x:Math.max(0,T.position.x),y:Math.max(0,T.position.y)}:T.position,dragging:v};if(P&&S.inProgress&&S.fromNode.id===P.id){const A=bd(P,S.fromHandle,We.Left,!0);C({...S,from:A})}k&&P.parentId&&w.push({id:E,parentId:P.parentId,rect:{...T.internals.positionAbsolute,width:T.measured.width??0,height:T.measured.height??0}}),b.push(D)}if(w.length>0){const{parentLookup:E,nodeOrigin:T}=p(),P=RO(w,j,E,T);b.push(...P)}for(const E of _.values())b=E(b);N(b)},triggerNodeChanges:y=>{const{onNodesChange:v,setNodes:w,nodes:b,hasDefaultNodes:j,debug:N}=p();if(y!=null&&y.length){if(j){const S=OH(y,b);w(S)}N&&console.log("React Flow: trigger node changes",y),v==null||v(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:v,setEdges:w,edges:b,hasDefaultEdges:j,debug:N}=p();if(y!=null&&y.length){if(j){const S=TH(y,b);w(S)}N&&console.log("React Flow: trigger edge changes",y),v==null||v(y)}},addSelectedNodes:y=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:b,triggerNodeChanges:j,triggerEdgeChanges:N}=p();if(v){const S=y.map(C=>pu(C,!0));j(S);return}j(wf(b,new Set([...y]),!0)),N(wf(w))},addSelectedEdges:y=>{const{multiSelectionActive:v,edgeLookup:w,nodeLookup:b,triggerNodeChanges:j,triggerEdgeChanges:N}=p();if(v){const S=y.map(C=>pu(C,!0));N(S);return}N(wf(w,new Set([...y]))),j(wf(b,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:v}={})=>{const{edges:w,nodes:b,nodeLookup:j,triggerNodeChanges:N,triggerEdgeChanges:S}=p(),C=y||b,_=v||w,E=C.map(P=>{const k=j.get(P.id);return k&&(k.selected=!1),pu(P.id,!1)}),T=_.map(P=>pu(P.id,!1));N(E),S(T)},setMinZoom:y=>{const{panZoom:v,maxZoom:w}=p();v==null||v.setScaleExtent([y,w]),m({minZoom:y})}
814,setMaxZoom:y=>{const{panZoom:v,minZoom:w}=p();v==null||v.setScaleExtent([w,y]),m({maxZoom:y})},setTranslateExtent:y=>{var v;(v=p().panZoom)==null||v.setTranslateExtent(y),m({translateExtent:y})},resetSelectedElements:()=>{const{edges:y,nodes:v,triggerNodeChanges:w,triggerEdgeChanges:b,elementsSelectable:j}=p();if(!j)return;const N=v.reduce((C,_)=>_.selected?[...C,pu(_.id,!1)]:C,[]),S=y.reduce((C,_)=>_.selected?[...C,pu(_.id,!1)]:C,[]);w(N),b(S)},setNodeExtent:y=>{const{nodes:v,nodeLookup:w,parentLookup:b,nodeOrigin:j,elevateNodesOnSelect:N,nodeExtent:S,zIndexMode:C}=p();y[0][0]===S[0][0]&&y[0][1]===S[0][1]&&y[1][0]===S[1][0]&&y[1][1]===S[1][1]||(G2(v,w,b,{nodeOrigin:j,nodeExtent:y,elevateNodesOnSelect:N,checkEquality:!1,zIndexMode:C}),m({nodeExtent:y}))},panBy:y=>{const{transform:v,width:w,height:b,panZoom:j,translateExtent:N}=p();return Q0e({delta:y,panZoom:j,transform:v,translateExtent:N,width:w,height:b})},setCenter:async(y,v,w)=>{const{width:b,height:j,maxZoom:N,panZoom:S}=p();if(!S)return Promise.resolve(!1);const C=typeof(w==null?void 0:w.zoom)<"u"?w.zoom:N;return await S.setViewport({x:b/2-y*C,y:j/2-v*C,zoom:C},{duration:w==null?void 0:w.duration,ease:w==null?void 0:w.ease,interpolate:w==null?void 0:w.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...Xq}})},updateConnection:y=>{m({connection:y})},reset:()=>m({...PI()})}},Object.is);function x1e({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:i,initialMinZoom:o,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:h,children:m}){const[p]=x.useState(()=>v1e({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:i,fitView:u,minZoom:o,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:h}));return s.jsx(Iwe,{value:p,children:s.jsx(ije,{children:m})})}function b1e({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:i,height:o,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m}){return x.useContext(E1)?s.jsx(s.Fragment,{children:e}):s.jsx(x1e,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:i,initialHeight:o,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:h,zIndexMode:m,children:e})}const w1e={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function j1e({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:i,edgeTypes:o,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:h,onConnect:m,onConnectStart:p,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,onNodeMouseEnter:w,onNodeMouseMove:b,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:S,onNodeDragStart:C,onNodeDrag:_,onNodeDragStop:E,onNodesDelete:T,onEdgesDelete:P,onDelete:k,onSelectionChange:D,onSelectionDragStart:A,onSelectionDrag:I,onSelectionDragStop:M,onSelectionContextMenu:$,onSelectionStart:R,onSelectionEnd:O,onBeforeDelete:F,connectionMode:z,connectionLineType:B=Zl.Bezier,connectionLineStyle:H,connectionLineComponent:Y,connectionLineContainerStyle:ee,deleteKeyCode:V="Backspace",selectionKeyCode:K="Shift",selectionOnDrag:W=!1,selectionMode:q=Jg.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:ie=ty()?"Meta":"Control",zoomActivationKeyCode:X=ty()?"Meta":"Control",snapToGrid:ge,snapGrid:Se,onlyRenderVisibleElements:ce=!1,selectNodesOnDrag:ye,nodesDraggable:Ie,autoPanOnNodeFocus:Ue,nodesConnectable:Ze,nodesFocusable:fe,nodeOrigin:Oe=PH,edgesFocusable:Et,edgesReconnectable:oe,elementsSelectable:Je=!0,defaultViewport:ut
814=Xwe,minZoom:Q=.5,maxZoom:he=2,translateExtent:ve=Qg,preventScrolling:xe=!0,nodeExtent:Ce,defaultMarkerColor:Be="#b1b1b7",zoomOnScroll:$r=!0,zoomOnPinch:mr=!0,panOnScroll:At=!1,panOnScrollSpeed:Pi=.5,panOnScrollMode:Ha=Gu.Free,zoomOnDoubleClick:ru=!0,panOnDrag:Tl=!0,onPaneClick:Ml,onPaneMouseEnter:Rl,onPaneMouseMove:au,onPaneMouseLeave:yn,onPaneScroll:Zt,onPaneContextMenu:er,paneClickDistance:Ve=1,nodeClickDistance:lt=0,children:ft,onReconnect:en,onReconnectStart:On,onReconnectEnd:zt,onEdgeContextMenu:qn,onEdgeDoubleClick:tn,onEdgeMouseEnter:Tn,onEdgeMouseMove:fs,onEdgeMouseLeave:go,reconnectRadius:Ka=10,onNodesChange:ki,onEdgesChange:Dl,noDragClassName:ne="nodrag",noWheelClassName:ke="nowheel",noPanClassName:ht="nopan",fitView:xt,fitViewOptions:Ga,connectOnClick:su,attributionPosition:iu,proOptions:ou,defaultEdgeOptions:lu,elevateNodesOnSelect:$l=!0,elevateEdgesOnSelect:Bd=!1,disableKeyboardA11y:yo=!1,autoPanOnConnect:zd,autoPanOnNodeDrag:Kv,autoPanSpeed:Gv,connectionRadius:wZ,isValidConnection:jZ,onError:NZ,style:SZ,id:SM,nodeDragThreshold:CZ,connectionDragThreshold:_Z,viewport:EZ,onViewportChange:AZ,width:PZ,height:kZ,colorMode:OZ="light",debug:TZ,onScroll:Yv,ariaLabelConfig:MZ,zIndexMode:CM="basic",...RZ},DZ){const $N=SM||"1",$Z=eje(OZ),IZ=x.useCallback(_M=>{_M.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Yv==null||Yv(_M)},[Yv]);return s.jsx("div",{"data-testid":"rf__wrapper",...RZ,onScroll:IZ,style:{...SZ,...w1e},ref:DZ,className:Zn(["react-flow",a,$Z]),id:SM,role:"application",children:s.jsxs(b1e,{nodes:e,edges:t,width:PZ,height:kZ,fitView:xt,fitViewOptions:Ga,minZoom:Q,maxZoom:he,nodeOrigin:Oe,nodeExtent:Ce,zIndexMode:CM,children:[s.jsx(y1e,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:b,onNodeMouseLeave:j,onNodeContextMenu:N,onNodeDoubleClick:S,nodeTypes:i,edgeTypes:o,connectionLineType:B,connectionLineStyle:H,connectionLineComponent:Y,connectionLineContainerStyle:ee,selectionKeyCode:K,selectionOnDrag:W,selectionMode:q,deleteKeyCode:V,multiSelectionKeyCode:ie,panActivationKeyCode:J,zoomActivationKeyCode:X,onlyRenderVisibleElements:ce,defaultViewport:ut,translateExtent:ve,minZoom:Q,maxZoom:he,preventScrolling:xe,zoomOnScroll:$r,zoomOnPinch:mr,zoomOnDoubleClick:ru,panOnScroll:At,panOnScrollSpeed:Pi,panOnScrollMode:Ha,panOnDrag:Tl,onPaneClick:Ml,onPaneMouseEnter:Rl,onPaneMouseMove:au,onPaneMouseLeave:yn,onPaneScroll:Zt,onPaneContextMenu:er,paneClickDistance:Ve,nodeClickDistance:lt,onSelectionContextMenu:$,onSelectionStart:R,onSelectionEnd:O,onReconnect:en,onReconnectStart:On,onReconnectEnd:zt,onEdgeContextMenu:qn,onEdgeDoubleClick:tn,onEdgeMouseEnter:Tn,onEdgeMouseMove:fs,onEdgeMouseLeave:go,reconnectRadius:Ka,defaultMarkerColor:Be,noDragClassName:ne,noWheelClassName:ke,noPanClassName:ht,rfId:$N,disableKeyboardA11y:yo,nodeExtent:Ce,viewport:EZ,onViewportChange:AZ}),s.jsx(Zwe,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:p,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:v,nodesDraggable:Ie,autoPanOnNodeFocus:Ue,nodesConnectable:Ze,nodesFocusable:fe,edgesFocusable:Et,edgesReconnectable:oe,elementsSelectable:Je,elevateNodesOnSelect:$l,elevateEdgesOnSelect:Bd,minZoom:Q,maxZoom:he,nodeExtent:Ce,onNodesChange:ki,onEdgesChange:Dl,snapToGrid:ge,snapGrid:Se,connectionMode:z,translateExtent:ve,connectOnClick:su,defaultEdgeOptions:lu,fitView:xt,fitViewOptions:Ga,onNodesDelete:T,onEdgesDelete:P,onDelete:k,onNodeDragStart:C,onNodeDrag:_,onNodeDragStop:E,onSelectionDrag:I,onSelectionDragStart:A,onSelectionDragStop:M,onMove:d,onMoveStart:f,onMoveEnd:h,noPanClassName:ht,nodeOrigin:Oe,rfId:$N,autoPanOnConnect:zd,autoPanOnNodeDrag:Kv,autoPanSpeed:Gv,onError:NZ,connectionRadius:wZ,isValidConnection:jZ,selectNodesOnDrag:ye,nodeDragThreshold:CZ,connectionDragThreshold:_Z,onBeforeDelete:F,debug:TZ,ariaLabelConfig:MZ,zIndexMode:CM}),s.jsx(Ywe,{onSelectionChange:D}),ft,s.jsx(Wwe,{proOptions:ou,position:iu}),s.jsx(Vwe,{rfId:$N,disableKeyboardA11y:yo})]})})}var N1e=MH(j1e);function S1e(e){const[t,n]=x.useState(e),r=x.useCallback(a=>n(i=>OH(a,i)),[]);return[t,n,r]}function C1e(e){const[t,n]=x.useState(e),r=x.useCallback(a=>n(i=>TH(a,i)),[]);return[t,n,r]}function _1e({dimensions:e,lineWidth:t,variant:n,className:r}){return s.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Zn(["react-flow__background-pattern",n,r])})}function E1e({radius:e,className:t}){return s.jsx("circle",{cx:e,cy:e,r:e,className:Zn(["react-flow__background-pattern","dots",t])})}var Uo;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Uo||(Uo={}));const A1e={[Uo.Dots]:1,[Uo.Lines]:1,[Uo.Cross]:6},P1e=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function rK({id:e,variant:t=Uo.Dots,gap:n=20,size:r,lineWidth:a=1,offset:i=0,
vendor: 5,175 bytes, line 814
814color:o,bgColor:l,style:c,className:u,patternClassName:d}){const f=x.useRef(null),{transform:h,patternId:m}=Tt(P1e,Nn),p=r||A1e[t],g=t===Uo.Dots,y=t===Uo.Cross,v=Array.isArray(n)?n:[n,n],w=[v[0]*h[2]||1,v[1]*h[2]||1],b=p*h[2],j=Array.isArray(i)?i:[i,i],N=y?[b,b]:w,S=[j[0]*h[2]||1+N[0]/2,j[1]*h[2]||1+N[1]/2],C=`${m}${e||""}`;return s.jsxs("svg",{className:Zn(["react-flow__background",u]),style:{...c,...A1,"--xy-background-color-props":l,"--xy-background-pattern-color-props":o},ref:f,"data-testid":"rf__background",children:[s.jsx("pattern",{id:C,x:h[0]%w[0],y:h[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`,children:g?s.jsx(E1e,{radius:b/2,className:d}):s.jsx(_1e,{dimensions:N,lineWidth:a,variant:t,className:d})}),s.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${C})`})]})}rK.displayName="Background";const k1e=x.memo(rK);function O1e(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:s.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function T1e(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:s.jsx("path",{d:"M0 0h32v4.2H0z"})})}function M1e(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:s.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function R1e(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function D1e(){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:s.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function $x({children:e,className:t,...n}){return s.jsx("button",{type:"button",className:Zn(["react-flow__controls-button",t]),...n,children:e})}const $1e=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function aK({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:i,onZoomOut:o,onFitView:l,onInteractiveChange:c,className:u,children:d,position:f="bottom-left",orientation:h="vertical","aria-label":m}){const p=Sn(),{isInteractive:g,minZoomReached:y,maxZoomReached:v,ariaLabelConfig:w}=Tt($1e,Nn),{zoomIn:b,zoomOut:j,fitView:N}=DO(),S=()=>{b(),i==null||i()},C=()=>{j(),o==null||o()},_=()=>{N(a),l==null||l()},E=()=>{p.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c==null||c(!g)},T=h==="horizontal"?"horizontal":"vertical";return s.jsxs(mc,{className:Zn(["react-flow__controls",T,u]),position:f,style:e,"data-testid":"rf__controls","aria-label":m??w["controls.ariaLabel"],children:[t&&s.jsxs(s.Fragment,{children:[s.jsx($x,{onClick:S,className:"react-flow__controls-zoomin",title:w["controls.zoomIn.ariaLabel"],"aria-label":w["controls.zoomIn.ariaLabel"],disabled:v,children:s.jsx(O1e,{})}),s.jsx($x,{onClick:C,className:"react-flow__controls-zoomout",title:w["controls.zoomOut.ariaLabel"],"aria-label":w["controls.zoomOut.ariaLabel"],disabled:y,children:s.jsx(T1e,{})})]}),n&&s.jsx($x,{className:"react-flow__controls-fitview",onClick:_,title:w["controls.fitView.ariaLabel"],"aria-label":w["controls.fitView.ariaLabel"],children:s.jsx(M1e,{})}),r&&s.jsx($x,{className:"react-flow__controls-interactive",onClick:E,title:w["controls.interactive.ariaLabel"],"aria-label":w["controls.interactive.ariaLabel"],children:g?s.jsx(D1e,{}):s.jsx(R1e,{})}),d]})}aK.displayName="Controls";const I1e=x.memo(aK);function L1e({id:e,x:t,y:n,width:r,height:a,style:i,color:o,strokeColor:l,strokeWidth:c,className:u,borderRadius:d,shapeRendering:f,selected:h,onClick:m}){const{background:p,backgroundColor:g}=i||{},y=o||p||g;return s.jsx("rect",{className:Zn(["react-flow__minimap-node",{selected:h},u]),x:t,y:n,rx:d,ry:d,width:r,height:a,style:{fill:y,stroke:l,strokeWidth:c},shapeRendering:f,onClick:m?v=>m(v,e):void 0})}const F1e=x.memo(L1e),B1e=e=>e.nodes.map(t=>
814t.id),qS=e=>e instanceof Function?e:()=>e;function z1e({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:i=F1e,onClick:o}){const l=Tt(B1e,Nn),c=qS(t),u=qS(e),d=qS(n),f=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return s.jsx(s.Fragment,{children:l.map(h=>s.jsx(V1e,{id:h,nodeColorFunc:c,nodeStrokeColorFunc:u,nodeClassNameFunc:d,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:i,onClick:o,shapeRendering:f},h))})}function U1e({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:i,shapeRendering:o,NodeComponent:l,onClick:c}){const{node:u,x:d,y:f,width:h,height:m}=Tt(p=>{const{internals:g}=p.nodeLookup.get(e),y=g.userNode,{x:v,y:w}=g.positionAbsolute,{width:b,height:j}=Nl(y);return{node:y,x:v,y:w,width:b,height:j}},Nn);return!u||u.hidden||!rH(u)?null:s.jsx(l,{x:d,y:f,width:h,height:m,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:a,strokeColor:n(u),strokeWidth:i,shapeRendering:o,onClick:c,id:u.id})}const V1e=x.memo(U1e);var W1e=x.memo(z1e);const q1e=200,H1e=150,K1e=e=>!e.hidden,G1e=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?nH(Ev(e.nodeLookup,{filter:K1e}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Y1e="react-flow__minimap-desc";function sK({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:i=5,nodeStrokeWidth:o,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:h="bottom-right",onClick:m,onNodeClick:p,pannable:g=!1,zoomable:y=!1,ariaLabel:v,inversePan:w,zoomStep:b=1,offsetScale:j=5}){const N=Sn(),S=x.useRef(null),{boundingRect:C,viewBB:_,rfId:E,panZoom:T,translateExtent:P,flowWidth:k,flowHeight:D,ariaLabelConfig:A}=Tt(G1e,Nn),I=(e==null?void 0:e.width)??q1e,M=(e==null?void 0:e.height)??H1e,$=C.width/I,R=C.height/M,O=Math.max($,R),F=O*I,z=O*M,B=j*O,H=C.x-(F-C.width)/2-B,Y=C.y-(z-C.height)/2-B,ee=F+B*2,V=z+B*2,K=`${Y1e}-${E}`,W=x.useRef(0),q=x.useRef();W.current=O,x.useEffect(()=>{if(S.current&&T)return q.current=iwe({domNode:S.current,panZoom:T,getTransform:()=>N.getState().transform,getViewScale:()=>W.current}),()=>{var ge;(ge=q.current)==null||ge.destroy()}},[T]),x.useEffect(()=>{var ge;(ge=q.current)==null||ge.update({translateExtent:P,width:k,height:D,inversePan:w,pannable:g,zoomStep:b,zoomable:y})},[g,y,w,b,P,k,D]);const J=m?ge=>{var ye;const[Se,ce]=((ye=q.current)==null?void 0:ye.pointer(ge))||[0,0];m(ge,{x:Se,y:ce})}:void 0,ie=p?x.useCallback((ge,Se)=>{const ce=N.getState().nodeLookup.get(Se).internals.userNode;p(ge,ce)},[]):void 0,X=v??A["minimap.ariaLabel"];return s.jsx(mc,{position:h,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-width-props":typeof f=="number"?f*O:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o=="number"?o:void 0},className:Zn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:s.jsxs("svg",{width:I,height:M,viewBox:`${H} ${Y} ${ee} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":K,ref:S,onClick:J,children:[X&&s.jsx("title",{id:K,children:X}),s.jsx(W1e,{onClick:ie,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:a,nodeStrokeWidth:o,nodeComponent:l}),s.jsx("path",{className:"react-flow__minimap-mask",d:`M${H-B},${Y-B}h${ee+B*2}v${V+B*2}h${-ee-B*2}z
815        M${_.x},${_.y}h${_.width}v${_.height}h${-_.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}sK.displayName="MiniMap";const X1e=x.memo(sK),Q1e=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,J1e={[Eh.Line]:"right",[Eh.Handle]:"bottom-right"};
815function Z1e({nodeId:e,position:t,variant:n=Eh.Handle,className:r,style:a=void 0,children:i,color:o,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:h,autoScale:m=!0,shouldResize:p,onResizeStart:g,onResize:y,onResizeEnd:v}){const w=IH(),b=typeof e=="string"?e:w,j=Sn(),N=x.useRef(null),S=n===Eh.Handle,C=Tt(x.useCallback(Q1e(S&&m),[S,m]),Nn),_=x.useRef(null),E=t??J1e[n];x.useEffect(()=>{if(!(!N.current||!b))return _.current||(_.current=bwe({domNode:N.current,nodeId:b,getStoreItems:()=>{const{nodeLookup:P,transform:k,snapGrid:D,snapToGrid:A,nodeOrigin:I,domNode:M}=j.getState();return{nodeLookup:P,transform:k,snapGrid:D,snapToGrid:A,nodeOrigin:I,paneDomNode:M}},onChange:(P,k)=>{const{triggerNodeChanges:D,nodeLookup:A,parentLookup:I,nodeOrigin:M}=j.getState(),$=[],R={x:P.x,y:P.y},O=A.get(b);if(O&&O.expandParent&&O.parentId){const F=O.origin??M,z=P.width??O.measured.width??0,B=P.height??O.measured.height??0,H={id:O.id,parentId:O.parentId,rect:{width:z,height:B,...aH({x:P.x??O.position.x,y:P.y??O.position.y},{width:z,height:B},O.parentId,A,F)}},Y=RO([H],A,I,M);$.push(...Y),R.x=P.x?Math.max(F[0]*z,P.x):void 0,R.y=P.y?Math.max(F[1]*B,P.y):void 0}if(R.x!==void 0&&R.y!==void 0){const F={id:b,type:"position",position:{...R}};$.push(F)}if(P.width!==void 0&&P.height!==void 0){const z={id:b,type:"dimensions",resizing:!0,setAttributes:h?h==="horizontal"?"width":"height":!0,dimensions:{width:P.width,height:P.height}};$.push(z)}for(const F of k){const z={...F,type:"position"};$.push(z)}D($)},onEnd:({width:P,height:k})=>{const D={id:b,type:"dimensions",resizing:!1,dimensions:{width:P,height:k}};j.getState().triggerNodeChanges([D])}})),_.current.update({controlPosition:E,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:h,onResizeStart:g,onResize:y,onResizeEnd:v,shouldResize:p}),()=>{var P;(P=_.current)==null||P.destroy()}},[E,l,c,u,d,f,g,y,v,p]);const T=E.split("-");return s.jsx("div",{className:Zn(["react-flow__resize-control","nodrag",...T,n,r]),ref:N,style:{...a,scale:C,...o&&{[S?"backgroundColor":"borderColor"]:o}},children:i})}x.memo(Z1e);const eNe=e=>{const t=e.toLowerCase();return t.includes("int")||t.includes("numeric")||t.includes("decimal")||t.includes("float")||t.includes("double")?"text-blue-500":t.includes("char")||t.includes("text")||t.includes("string")?"text-green-500":t.includes("date")||t.includes("time")||t.includes("timestamp")?"text-purple-500":t.includes("bool")?"text-orange-500":t.includes("json")||t.includes("array")?"text-pink-500":"text-muted-foreground"},tNe=e=>e?e>=1e6?`${(e/1e6).toFixed(1)}M rows`:e>=1e3?`${(e/1e3).toFixed(1)}K rows`:`${e} rows`:"",iK=x.memo(({data:e,selected:t})=>{const[n,r]=x.useState(!0),[a,i]=x.useState(!1),o=a?e.columns:e.columns.slice(0,8),l=e.columns.length>8;return s.jsxs("div",{className:`
816        bg-card border-2 rounded-lg shadow-lg min-w-[220px] max-w-[280px]
817        transition-all duration-200
818        ${t?"border-primary ring-2 ring-primary/20":"border-border"}
819      `,children:[s.jsxs("div",{className:"flex items-center justify-between p-2 bg-muted/50 rounded-t-lg border-b cursor-move",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[s.jsx(nv,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),s.jsx("div",{className:"h-7 w-7 rounded bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(xr,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx("p",{className:"font-semibold text-sm truncate",children:e.tableName})}),s.jsx(Bt,{children:s.jsxs("p",{children:[e.schemaName,".",e.tableName]})})]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[e.alias!==e.tableName&&s.jsxs("span",{className:"text-primary",children:["as ",e.alias," · "]}),e.columns.length," cols",e.rowCount?` · ${tNe(e.rowCount)}`:""]})]})]}),s.jsxs("div",{className:"flex items-center gap-1 nodrag nopan",children:[s.jsx(U,{variant:"ghost",size:"icon",className:"h-6 w-6 nodrag nopan",onClick:()=>r(!n),children:n?s.jsx(Zi,{className:"h-3.5 w-3.5"}):s.jsx(Jr,{className:"h-3.5 w-3.5"})}),s.jsx(U,{variant:"ghost",size:"icon",className:"h-6 w-6 text-muted-foreground hover:text-destructive nodrag nopan",onClick:()=>e.onRemove(e.tableName),children:s.jsx(ua,{className:"h-3.5 w-3.5"})})]})]}),s.jsx(Ah,{type:"target",position:We.Left,className:"!w-3 !h-3 !bg-primary !border-2 !border-background"}),s.jsx(Ah,{type:"source",position:We.Right,className:"!w-3 !h-3 !bg-primary !border-2 !border-background"}),n&&s.jsxs("div",{className:"p-1 nodrag nopan",children:[s.jsx(Ba,{className:`nodrag nopan nowheel ${l&&a?"h-[200px]":""}`,children:s.jsx("div",{className:"space-y-0.5",children:o.map(c=>{const u=e.selectedColumns.includes(c.name);return s.jsxs("div",{className:`
820                      flex items-center gap-2 px-2 py-1 rounded text-xs
821                      hover:bg-muted/50 cursor-pointer transition-colors nodrag nopan
822                      ${u?"bg-primary/10":""}
823                    `,onClick:()=>e.onColumnToggle(e.tableName,c.name),children:[s.jsx(Hc,{checked:u,className:"h-3.5 w-3.5",onClick:d=>d.stopPropagation(),onCheckedChange:()=>e.onColumnToggle(e.tableName,c.name)}),s.jsx("div",{className:"w-4 flex justify-center",children:c.is_primary_key?s.jsxs(Vt,{children:[s.jsx(Wt,{children:s.jsx(wre,{className:"h-3 w-3 text-amber-500"})}),s.jsx(Bt,{children:"Primary Key"})]}):c.is_foreign_key?s.jsxs(Vt,{children:[s.jsx(Wt,{children:s.jsx(rd,{className:"h-3 w-3 text-blue-500"})}),s.jsx(Bt,{children:"Foreign Key"})]}
823):s.jsx(z_,{className:"h-3 w-3 text-muted-foreground/50"})}),s.jsx("span",{className:"flex-1 truncate font-medium",children:c.name}),s.jsx("span",{className:`text-[10px] ${eNe(c.type)}`,children:c.type.toLowerCase().split("(")[0]})]},c.name)})})}),l&&s.jsx(U,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs mt-1 nodrag nopan",onClick:()=>i(!a),children:a?"Show less":`Show ${e.columns.length-8} more columns`}),e.selectedColumns.length>0&&s.jsx("div",{className:"mt-1 px-2 py-1 bg-primary/5 rounded text-xs text-center",children:s.jsxs($e,{variant:"secondary",className:"text-[10px]",children:[e.selectedColumns.length," selected"]})})]})]})});iK.displayName="TableNode";const kI={inner:"#22c55e",left:"#3b82f6",right:"#8b5cf6",full:"#f59e0b"},oK=x.memo(({id:e,sourceX:t,sourceY:n,targetX:r,targetY:a,sourcePosition:i,targetPosition:o,data:l,markerEnd:c})=>{const[u]=$0({sourceX:t,sourceY:n,targetX:r,targetY:a,sourcePosition:i,targetPosition:o,borderRadius:8}),d=l==null?void 0:l.join,f=kI[(d==null?void 0:d.join_type)||"left"]||kI.left;return s.jsx("path",{id:e,d:u,fill:"none",stroke:f,strokeWidth:3,markerEnd:c,style:{pointerEvents:"none"}})});oK.displayName="JoinEdge";const Sb=Xk,nNe=Qk,rNe=Jk,lK=x.forwardRef(({className:e,...t},n)=>s.jsx(bv,{className:te("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));lK.displayName=bv.displayName;const aNe=kd("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4  border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),eg=x.forwardRef(({side:e="right",className:t,children:n,...r},a)=>s.jsxs(rNe,{children:[s.jsx(lK,{}),s.jsxs(wv,{ref:a,className:te(aNe({side:e}),t),...r,children:[n,s.jsxs(o1,{className:"absolute right-4 top-4 roun
823ded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",children:[s.jsx(ua,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));eg.displayName=wv.displayName;const tg=({className:e,...t})=>s.jsx("div",{className:te("flex flex-col space-y-2 text-center sm:text-left",e),...t});tg.displayName="SheetHeader";const ng=x.forwardRef(({className:e,...t},n)=>s.jsx(jv,{ref:n,className:te("text-lg font-semibold text-foreground",e),...t}));ng.displayName=jv.displayName;const cK=x.forwardRef(({className:e,...t},n)=>s.jsx(Nv,{ref:n,className:te("text-sm text-muted-foreground",e),...t}));cK.displayName=Nv.displayName;const sNe={tableNode:iK},iNe={joinEdge:oK},ef=[{value:"inner",label:"INNER JOIN",color:"#22c55e"},{value:"left",label:"LEFT JOIN",color:"#3b82f6"},{value:"right",label:"RIGHT JOIN",color:"#8b5cf6"},{value:"full",label:"FULL JOIN",color:"#f59e0b"}],oNe=({availableTables:e,tablesLoading:t,selectedTables:n,joins:r,selectedColumns:a,onAddTable:i,onRemoveTable:o,onUpdateJoins:l,onToggleColumn:c,onRefreshTables:u})=>{const[d,f,h]=S1e([]),[m,p,g]=C1e([]),[y,v]=x.useState(""),[w,b]=x.useState({isOpen:!1,sourceTable:"",targetTable:""}),[j,N]=x.useState({joinType:"left",leftColumn:"",rightColumn:""}),S=x.useMemo(()=>e.filter(D=>{var A;return D.has_read_access!==!1&&(D.table_name.toLowerCase().includes(y.toLowerCase())||((A=D.schema_name)==null?void 0:A.toLowerCase().includes(y.toLowerCase())))}),[e,y]),C=x.useMemo(()=>{const D=new Set(n.map(A=>A.tableName));return S.filter(A=>!D.has(A.table_name))},[S,n]);x.useEffect(()=>{const D=n.map((A,I)=>{const O=I%2,F=Math.floor(I/2),z=d.find(B=>B.id===A.tableName);return{id:A.tableName,type:"tableNode",position:(z==null?void 0:z.position)||{x:50+O*320,y:50+F*300},data:{label:A.tableName,schemaName:A.schemaName,tableName:A.tableName,alias:A.alias,columns:A.columns,rowCount:A.rowCount,selectedColumns:a.filter(B=>B.table===A.alias).map(B=>B.column),onColumnToggle:c,onRemove:o}}});f(D)},[n,a,c,o]);const _=x.useCallback((D,A)=>{b({isOpen:!0,sourceTable:D.left_table,targetTable:D.right_table,existingJoin:D,edgeId:`edge-${A}`}),N({joinType:D.join_type,leftColumn:D.left_column,rightColumn:D.right_column})},[]);x.useEffect(()=>{const D=r.map((A,I)=>{const M=ef.find(O=>O.value===A.join_type)||ef[1],$=n.find(O=>O.alias===A.left_table),R=n.find(O=>O.alias===A.right_table);return{id:`edge-${I}`,source:($==null?void 0:$.tableName)||A.left_table,target:(R==null?void 0:R.tableName)||A.right_table,type:"joinEdge",animated:!1,style:{stroke:M.color,strokeWidth:3},markerEnd:{type:Zg.ArrowClosed,color:M.color,width:20,height:20},data:{join:A,index:I,onLabelClick:()=>_(A,I)}}});p(D)},[r,n,_]);const E=x.useCallback(D=>{if(!D.source||!D.target)return;const A=n.find(M=>M.tableName===D.source),I=n.find(M=>M.tableName===D.target);!A||!I||(b({isOpen:!0,sourceTable:A.alias,targetTable:I.alias}),N({joinType:"left",leftColumn:"",rightColumn:""}))},[n]),T=x.useCallback(()=>{if(!j.leftColumn||!j.rightColumn)return;const D={join_type:j.joinType,left_table:w.sourceTable,left_column:j.leftColumn,right_table:w.targetTable,right_column:j.rightColumn};if(w.existingJoin){const A=r.map(I=>I.left_table===w.existingJoin.left_table&&I.right_table===w.existingJoin.right_table?D:I);l(A)}else l([...r,D]);b({isOpen:!1,sourceTable:"",targetTable:""})},[j,w,r,l]),P=x.useCallback(()=>{if(!w.existingJoin)return;const D=r.filter(A=>!(A.left_table===w.existingJoin.left_table&&A.right_table===w.existingJoin.right_table));l(D),b({isOpen:!1,sourceTable:"",targetTable:""})},[w,r,l]),k=D=>{const A=n.find(I=>I.alias===D);return(A==null?void 0:A.columns)||[]};return s.jsxs("div",{className:"h-[calc(95vh-280px)] min-h-[400px] w-full border rounded-lg overflow-hidden bg-muted/20 relative",children:[s.jsxs(N1e,{nodes:d,edges:m,onNodesChange:h,onEdgesChange:g,onConnect:E,nodeTypes:sNe,edgeTypes:iNe,connectionMode:vd.Loose,edgesFocusable:!1,edgesReconnectable:!1,fitView:!0,fitViewOptions:{padding:.2},minZoom:.3,maxZoom:1.5,defaultViewport:{x:0,y:0,zoom:.8},proOptions:{hideAttribution:!0},children:[s.jsx(k1e,{variant:Uo.Dots,gap:16,size:1}),s.jsx(I1e,{showInteractive:!1}),s.jsx(X1e,{nodeColor:D=>"#6366f1",maskColor:"rgba(0, 0, 0, 0.1)",className:"!bg-background !border"}),s.jsx(mc,{position:"top-left",className:"!m-2",children:s.jsxs(Sb,{children:[s.jsx(nNe,{asChild:!0,children:s.jsxs(U,{size:"sm",className:"shadow-lg",children:[s.jsx(Ln,{className:"h-4 w-4 mr-1"}),"Add Table"]})}),s.jsxs(eg,{side:"left",className:"w-[400px] sm:w-[450px] sm:max-w-[450px] overflow-hidden",children:[s.jsxs(tg,{children:[s.jsxs(ng,{className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-5 w-5"}),"Available Tables"]}),s.jsx(cK,{children:"Drag or click to add tables to your query"})]}),s.jsxs("div",{className:"mt-4 space-y-4 overflow-hidden",children:[s.jsxs("div",{className:"relative",children:[s.jsx(ii,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search tables...",value:y,onChange:D=>v(D.target.value),className:"pl-8"})]}),s.jsxs(U,{variant:"outline",size:"sm",className:"w-full",onClick:u,disabled:t,children:[t?s.jsx(Te,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh Tables"]}),s.jsx(mk,{children:s.jsx(Ba,{className:"h-[calc(100vh-280px)] w-full",children:s.jsx("div",{className:"space-y-2 pb-2 pr-4",children:t?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Te,{className:"h-6 w-6 animate-spin text-primary"})}):C.length===0?s.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:y?"No tables match your search":"All tables have been added"}):C.map(D=>s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsxs("button",{onClick:()=>i(D),className:"w-full flex items-center gap-3 p-3 rounded-lg border bg-card hover:bg-primary/10 hover:border-primary transition-all text-left overflow-hidden",children:[s.jsx("div",{className:"h-9 w-9 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx(xr,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium text-sm truncate",children:D.table_name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[D.column_count," columns",D.row_count?` · ${D.row_count.toLocaleStr
823ing()} rows`:""]})]}),s.jsx(Ln,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})]})}),s.jsxs(Bt,{side:"right",className:"max-w-[300px]",children:[s.jsx("p",{className:"font-medium",children:D.table_name}),D.schema_name&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Schema: ",D.schema_name]})]})]},`${D.schema_name}.${D.table_name}`))})})})]})]})]})}),n.length===0&&s.jsx(mc,{position:"top-center",className:"!m-4",children:s.jsxs("div",{className:"bg-card/95 backdrop-blur border rounded-lg p-4 shadow-lg text-center max-w-md",children:[s.jsx(wt,{className:"h-10 w-10 text-primary mx-auto mb-2"}),s.jsx("h3",{className:"font-semibold",children:"Start Building Your Query"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:'Click "Add Table" to select tables from your database. Connect them to create JOINs.'})]})}),n.length>0&&s.jsx(mc,{position:"bottom-left",className:"!m-2",children:s.jsxs("div",{className:"bg-card/95 backdrop-blur border rounded-lg p-2 shadow-sm",children:[s.jsx("p",{className:"text-xs font-medium mb-1 text-muted-foreground",children:"Join Types"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:ef.map(D=>s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("div",{className:"w-3 h-0.5 rounded",style:{backgroundColor:D.color}}),s.jsx("span",{className:"text-[10px]",children:D.label})]},D.value))})]})}),n.length>0&&s.jsx(mc,{position:"bottom-right",className:"!m-2",children:s.jsxs("div",{className:"bg-card/95 backdrop-blur border rounded-lg p-2 shadow-sm flex gap-3",children:[s.jsxs($e,{variant:"secondary",className:"text-xs",children:[n.length," table",n.length!==1?"s":""]}),s.jsxs($e,{variant:"secondary",className:"text-xs",children:[r.length," join",r.length!==1?"s":""]}),s.jsxs($e,{variant:"outline",className:"text-xs",children:[a.length," column",a.length!==1?"s":""]})]})})]}),r.length>0&&s.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-card/95 backdrop-blur border-t p-3",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(rd,{className:"h-4 w-4 text-primary"}),s.jsxs("span",{className:"text-sm font-medium",children:["Joins (",r.length,")"]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((D,A)=>{const I=ef.find(M=>M.value===D.join_type)||ef[1];return s.jsxs("div",{className:"flex items-center gap-2 bg-background border rounded-lg px-3 py-2 text-sm group",children:[s.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:I.color}}),s.jsx("span",{className:"font-medium",children:I.label}),s.jsxs("span",{className:"text-muted-foreground",children:[D.left_table,".",D.left_column," = ",D.right_table,".",D.right_column]}),s.jsxs("div",{className:"flex items-center gap-1 ml-2",children:[s.jsx(U,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>{b({isOpen:!0,sourceTable:D.left_table,targetTable:D.right_table,existingJoin:D,edgeId:`edge-${A}`}),N({joinType:D.join_type,leftColumn:D.left_column,rightColumn:D.right_column})},children:"Edit"}),s.jsx(U,{variant:"ghost",size:"sm",className:"h-6 px-2 text-xs text-destructive hover:text-destructive",onClick:()=>{const M=r.filter(($,R)=>R!==A);l(M)},children:s.jsx(pn,{className:"h-3 w-3"})})]})]},A)})})]}),s.jsx(br,{open:w.isOpen,onOpenChange:D=>!D&&b({isOpen:!1,sourceTable:"",targetTable:""}),children:s.jsxs(or,{className:"sm:max-w-md",children:[s.jsxs(lr,{children:[s.jsxs(cr,{className:"flex items-center gap-2",children:[s.jsx(rd,{className:"h-5 w-5"}),w.existingJoin?"Edit Join":"Configure Join"]}),s.jsxs(wr,{children:["Connect ",s.jsx("strong",{children:w.sourceTable})," to"," ",s.jsx("strong",{children:w.targetTable})]})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Join Type"}),s.jsxs(rt,{value:j.joinType,onValueChange:D=>N({...j,joinType:D}),children:[s.jsx(tt,{children:s.jsx(st,{})}),s.jsx(nt,{position:"popper",sideOffset:5,children:ef.map(D=>s.jsx(_e,{value:D.value,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:D.color}}),D.label]})},D.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{children:[w.sourceTable," Column"]}),s.jsxs(rt,{value:j.leftColumn,onValueChange:D=>N({...j,leftColumn:D}),children:[s.jsx(tt,{children:s.jsx(st,{placeholder:"Select column"})}),s.jsx(nt,{position:"popper",sideOffset:5,className:"max-h-[200px]",children:k(w.sourceTable).map(D=>s.jsxs(_e,{value:D.name,children:[D.name,s.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",D.type,")"]})]},D.name))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{children:[w.targetTable," Column"]}
823),s.jsxs(rt,{value:j.rightColumn,onValueChange:D=>N({...j,rightColumn:D}),children:[s.jsx(tt,{children:s.jsx(st,{placeholder:"Select column"})}),s.jsx(nt,{position:"popper",sideOffset:5,className:"max-h-[200px]",children:k(w.targetTable).map(D=>s.jsxs(_e,{value:D.name,children:[D.name,s.jsxs("span",{className:"text-muted-foreground ml-2 text-xs",children:["(",D.type,")"]})]},D.name))})]})]})]}),s.jsxs(_a,{className:"flex-row gap-2 sm:justify-between",children:[w.existingJoin&&s.jsxs(U,{variant:"destructive",size:"sm",onClick:P,children:[s.jsx(pn,{className:"h-4 w-4 mr-1"}),"Delete"]}),s.jsxs("div",{className:"flex gap-2 ml-auto",children:[s.jsx(U,{variant:"outline",onClick:()=>b({isOpen:!1,sourceTable:"",targetTable:""}),children:"Cancel"}),s.jsxs(U,{onClick:T,disabled:!j.leftColumn||!j.rightColumn,children:[w.existingJoin?"Update":"Create"," Join"]})]})]})]})})]})},lNe=[{value:"inner",label:"INNER JOIN",description:"Only matching rows"},{value:"left",label:"LEFT JOIN",description:"All from left + matching"},{value:"right",label:"RIGHT JOIN",description:"All from right + matching"},{value:"full",label:"FULL JOIN",description:"All rows from both"}],cNe=[{value:"none",label:"No aggregation"},{value:"sum",label:"SUM"},{value:"avg",label:"AVG"},{value:"count",label:"COUNT"},{value:"count_distinct",label:"COUNT DISTINCT"},{value:"min",label:"MIN"},{value:"max",label:"MAX"}],HS=[{value:"eq",label:"= (equals)",needsValue:!0},{value:"neq",label:"!= (not equals)",needsValue:!0},{value:"gt",label:"> (greater than)",needsValue:!0},{value:"gte",label:">= (greater or equal)",needsValue:!0},{value:"lt",label:"< (less than)",needsValue:!0},{value:"lte",label:"<= (less or equal)",needsValue:!0},{value:"like",label:"LIKE",needsValue:!0},{value:"not_like",label:"NOT LIKE",needsValue:!0},{value:"is_null",label:"IS NULL",needsValue:!1},{value:"is_not_null",label:"IS NOT NULL",needsValue:!1},{value:"between",label:"BETWEEN",needsValue:!0,needsValue2:!0}],jo=({title:e,icon:t,count:n,children:r,defaultOpen:a=!0})=>{const[i,o]=x.useState(a);return s.jsxs(xh,{open:i,onOpenChange:o,children:[s.jsx(bh,{asChild:!0,children:s.jsxs("button",{className:"flex items-center justify-between w-full p-3 rounded-lg bg-muted/50 hover:bg-muted transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(t,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"font-medium text-sm",children:e}),n!==void 0&&n>0&&s.jsx($e,{variant:"secondary",className:"ml-1",children:n})]}),i?s.jsx(Jr,{className:"h-4 w-4 text-muted-foreground"}):s.jsx(si,{className:"h-4 w-4 text-muted-foreground"})]})}),s.jsx(wh,{className:"pt-3",children:r})]})},uNe=({onConfigChange:e,initialConnectorId:t,initialQueryConfig:n})=>{const r=cn(),{data:a=[],isLoading:i,isError:o}=_m(),l=$7(),[c,u]=x.useState(t),[d,f]=x.useState(()=>n!=null&&n.tables?n.tables.map(Q=>({schema_name:Q.schema_name,table_name:Q.table_name,alias:Q.alias,selected_columns:Q.selected_columns||[]})):[]),[h,m]=x.useState(()=>(n==null?void 0:n.joins)||[]),[p,g]=x.useState(()=>(n==null?void 0:n.columns)||[]),[y,v]=x.useState(()=>(n==null?void 0:n.aggregations)||[]),[w,b]=x.useState(()=>(n==null?void 0:n.filters)||[]),[j,N]=x.useState(()=>(n==null?void 0:n.filter_logic)||"AND"),[S,C]=x.useState(()=>{var Q;return((Q=n==null?void 0:n.group_by)==null?void 0:Q.columns)||[]}),[_,E]=x.useState(()=>(n==null?void 0:n.order_by)||[]),[T,P]=x.useState(()=>n==null?void 0:n.limit),[k,D]=x.useState(null),[A,I]=x.useState("tables"),[M,$]=x.useState("canvas"),[R,O]=x.useState(!1),F=a.filter(Q=>Q.status==="connected"&&["postgresql","mysql","mongodb","mariadb"].includes(Q.type));F.find(Q=>Q.id===c);const{data:z=[],isLoading:B,refetch:H}=Hk(c||"");x.useEffect(()=>{F.length===1&&!c&&u(F[0].id)},[F,c]),x.useEffect(()=>{z.length>0&&d.length>0&&!R&&(f(Q=>Q.map(he=>{var xe,Ce;if((Ce=(xe=he.info)==null?void 0:xe.columns)!=null&&Ce.length)return he;const ve=z.find(Be=>Be.table_name===he.table_name&&(Be.schema_name===he.schema_name||he.schema_name==="public"));return ve?{...he,info:ve}:he})),O(!0))},[z,d.length,R]);const Y=x.useMemo(()=>({tables:d.map(Q=>({schema_name:Q.schema_name||"public",table_name:Q.table_name,alias:Q.alias,selected_columns:Q.selected_columns})),joins:h,columns:p,aggregations:y,filters:w,filter_logic:j,group_by:S.length>0?{columns:S}:void 0,order_by:_,limit:T}),[d,h,p,y,w,j,S,_,T]),ee=x.useMemo(()=>!(!c||d.length===0||d.length>1&&h.length<d.length-1),[c,d,h]);x.useEffect(()=>{c&&e({connectorId:c,queryConfig:Y,isValid:ee,previewData:k||void 0})},[c,Y,ee,k,e]);const V=Q=>{u(Q),f([]),m([]),g([]),v([]),b([]),C([]),E([]),D(null)},K=Q=>{const he=Q.table_name.charAt(0).toLowerCase()+(d.length+1),ve={schema_name:Q.schema_name||"public",table_name:Q.table_name,alias:he,selected_columns:[],info:Q};if(f(xe=>[...xe,ve]),d.length>0){const xe=d[d.length-1],Ce={join_type:"left",left_table:xe.alias||xe.table_name,left_column:"",right_table:he,right_column:""};m(Be=>[...Be,Ce])}},W=Q=>{const he=d[Q];m(ve=>ve.filter(xe=>xe.left_table!==he.alias&&xe.right_table!==he.alias)),g(ve=>ve.filter(xe=>xe.table!==he.alias)),v(ve=>ve.filter(xe=>xe.column.table!==he.alias)),b(ve=>ve.filter(xe=>xe.column.table!==he.alias)),C(ve=>ve.filter(xe=>xe.table!==he.alias)),E(ve=>ve.filter(xe=>xe.column.table!==he.alias)),f(ve=>ve.filter((xe,Ce)=>Ce!==Q))},q=(Q,he)=>{m(ve=>ve.map((xe,Ce)=>Ce===Q?{...xe,...he}:xe))},J=x.useCallback(Q=>{m(Q)},[]),ie=x.useCallback(Q=>{m(he=>he.filter((ve,xe)=>xe!==Q))},[]),X=x.useCallback((Q,he)=>{const ve=Q.alias||Q.table_name;g(xe=>xe.find(Be=>Be.table===ve&&Be.column===he)?xe.filter(Be=>!(Be.table===ve&&Be.column===he)):[...xe,{table:ve,column:he}])},[]),ge=x.useCallback(Q=>{f(he=>{const ve=he.findIndex(Ce=>Ce.table_name===Q);if(ve===-1)return he;const xe=he[ve];return m(Ce=>Ce.filter(Be=>Be.left_table!==xe.alias&&Be.right_table!==xe.alias)),g(Ce=>Ce.filter(Be=>Be.table!==xe.alias)),v(Ce=>Ce.filter(Be=>
823Be.column.table!==xe.alias)),b(Ce=>Ce.filter(Be=>Be.column.table!==xe.alias)),C(Ce=>Ce.filter(Be=>Be.table!==xe.alias)),E(Ce=>Ce.filter(Be=>Be.column.table!==xe.alias)),he.filter((Ce,Be)=>Be!==ve)})},[]),Se=x.useCallback((Q,he)=>{f(ve=>{const xe=ve.find(Ce=>Ce.alias===Q||Ce.table_name===Q);if(xe){const Ce=xe.alias||xe.table_name;g(Be=>Be.find(mr=>mr.table===Ce&&mr.column===he)?Be.filter(mr=>!(mr.table===Ce&&mr.column===he)):[...Be,{table:Ce,column:he}])}return ve})},[]),ce=()=>{var ve,xe,Ce;if(d.length===0)return;const Q=d[0],he=((Ce=(xe=(ve=Q.info)==null?void 0:ve.columns)==null?void 0:xe[0])==null?void 0:Ce.name)||"";v(Be=>[...Be,{column:{table:Q.alias||Q.table_name,column:he},function:"count",alias:`agg_${Be.length+1}`}])},ye=(Q,he)=>{v(ve=>ve.map((xe,Ce)=>Ce===Q?{...xe,...he}:xe))},Ie=Q=>{v(he=>he.filter((ve,xe)=>xe!==Q))},Ue=()=>{var ve,xe,Ce;if(d.length===0)return;const Q=d[0],he=((Ce=(xe=(ve=Q.info)==null?void 0:ve.columns)==null?void 0:xe[0])==null?void 0:Ce.name)||"";b(Be=>[...Be,{column:{table:Q.alias||Q.table_name,column:he},operator:"eq",value:""}])},Ze=(Q,he)=>{b(ve=>ve.map((xe,Ce)=>Ce===Q?{...xe,...he}:xe))},fe=Q=>{b(he=>he.filter((ve,xe)=>xe!==Q))},Oe=()=>{var ve,xe,Ce;if(d.length===0)return;const Q=d[0],he=((Ce=(xe=(ve=Q.info)==null?void 0:ve.columns)==null?void 0:xe[0])==null?void 0:Ce.name)||"";E(Be=>[...Be,{column:{table:Q.alias||Q.table_name,column:he},direction:"asc"}])},Et=(Q,he)=>{E(ve=>ve.map((xe,Ce)=>Ce===Q?{...xe,...he}:xe))},oe=Q=>{E(he=>he.filter((ve,xe)=>xe!==Q))},Je=async()=>{var Q;if(!(!c||!ee))try{const he=await l.mutateAsync({connector_id:c,query_config:Y,preview_rows:10});D(he),I("preview"),he.success||se.error("Preview failed",{description:((Q=he.warnings)==null?void 0:Q[0])||"Could not execute query"})}catch(he){const ve=he instanceof Error?he.message:"An error occurred";se.error("Preview failed",{description:ve})}},ut=x.useMemo(()=>{var he;const Q=[];for(const ve of d)if((he=ve.info)!=null&&he.columns)for(const xe of ve.info.columns)Q.push({table:ve,column:xe});return Q},[d]);return i?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})}):o?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[s.jsx(Yn,{className:"h-12 w-12 text-destructive"}),s.jsx("p",{className:"text-lg font-medium",children:"Failed to load connectors"}),s.jsx(U,{onClick:()=>r("/dashboard/connectors"),children:"Go to Connectors"})]}):F.length===0?s.jsxs("div",{className:"text-center py-8 border border-dashed rounded-lg",children:[s.jsx(wt,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),s.jsx("p",{className:"text-muted-foreground font-medium",children:"No connected databases found"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect a database first to create datasets."}),s.jsx(U,{variant:"link",className:"mt-3",onClick:()=>r("/dashboard/connectors"),children:"Go to Connectors"})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Database Connection"}),s.jsxs(rt,{value:c,onValueChange:V,children:[s.jsx(tt,{children:s.jsx(st,{placeholder:"Choose a database connection"})}),s.jsx(nt,{children:F.map(Q=>s.jsx(_e,{value:Q.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-4 w-4 text-primary"}),s.jsx("span",{children:Q.name}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",Q.type.toUpperCase(),")"]})]})},Q.id))})]})]}),c&&s.jsxs(fo,{value:A,onValueChange:I,className:"w-full",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs(ji,{className:"grid w-full grid-cols-4 flex-1",children:[s.jsxs(Rt,{value:"tables",className:"flex items-center gap-1",children:[s.jsx(xr,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:"Tables"}),d.length>0&&s.jsx($e,{variant:"secondary",className:"ml-1 h-5 px-1.5",children:d.length})]}),s.jsxs(Rt,{value:"columns",className:"flex items-center gap-1",children:[s.jsx(z_,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:"Columns"})]}),s.jsxs(Rt,{value:"transform",className:"flex items-center gap-1",children:[s.jsx(hS,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:"Transform"})]}),s.jsxs(Rt,{value:"preview",className:"flex items-center gap-1",children:[s.jsx(ui,{className:"h-3.5 w-3.5"}),s.jsx("span",{className:"hidden sm:inline",children:"Preview"})]})]}),A==="tables"&&s.jsxs(yq,{type:"single",value:M,onValueChange:Q=>Q&&$(Q),className:"ml-4",children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(I2,{value:"canvas","aria-label":"Canvas view",className:"h-9 px-3",children:s.jsx(Nre,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Visual canvas"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(I2,{value:"form","aria-label":"Form view",className:"h-9 px-3",children:s.jsx(Pre,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Form view"})]})]})]}
823),s.jsx(Ft,{value:"tables",className:"space-y-4 mt-4",children:M==="canvas"?s.jsx(mk,{children:s.jsx(oNe,{availableTables:z,tablesLoading:B,selectedTables:d.map(Q=>{var he,ve,xe;return{schemaName:Q.schema_name||"public",tableName:Q.table_name,alias:Q.alias,columns:((ve=(he=Q.info)==null?void 0:he.columns)==null?void 0:ve.map(Ce=>({name:Ce.name,type:Ce.type,nullable:Ce.nullable,is_primary_key:Ce.is_primary_key,is_foreign_key:!1})))||[],rowCount:(xe=Q.info)==null?void 0:xe.row_count}}),joins:h,selectedColumns:p,onAddTable:K,onRemoveTable:ge,onUpdateJoins:J,onToggleColumn:Se,onRefreshTables:()=>H()})}):s.jsxs(s.Fragment,{children:[s.jsx(jo,{title:"Available Tables",icon:wt,defaultOpen:!0,children:B?s.jsx("div",{className:"flex items-center justify-center py-4",children:s.jsx(Te,{className:"h-5 w-5 animate-spin"})}):s.jsx(Ba,{className:"h-[200px]",children:s.jsx("div",{className:"grid grid-cols-2 gap-2",children:z.filter(Q=>Q.has_read_access!==!1).map(Q=>{const he=d.some(ve=>ve.table_name===Q.table_name);return s.jsxs("button",{onClick:()=>!he&&K(Q),disabled:he,className:`flex items-center gap-2 p-2 rounded border text-left text-sm transition-all ${he?"border-primary bg-primary/10 opacity-60":"border-border hover:border-primary hover:bg-muted"}`,children:[s.jsx(xr,{className:"h-4 w-4 flex-shrink-0"}),s.jsx("span",{className:"truncate",children:Q.table_name}),he&&s.jsx(bt,{className:"h-3 w-3 ml-auto text-primary"})]},`${Q.schema_name}.${Q.table_name}`)})})})}),d.length>0&&s.jsx(jo,{title:"Selected Tables",icon:xr,count:d.length,children:s.jsx("div",{className:"space-y-2",children:d.map((Q,he)=>s.jsxs("div",{className:"flex items-center justify-between p-3 rounded-lg border bg-card",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-8 w-8 rounded bg-primary/10 flex items-center justify-center",children:s.jsx(xr,{className:"h-4 w-4 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-sm",children:Q.table_name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Alias: ",s.jsx("code",{className:"bg-muted px-1 rounded",children:Q.alias})]})]})]}),s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>W(he),className:"h-8 w-8 text-muted-foreground hover:text-destructive",children:s.jsx(pn,{className:"h-4 w-4"})})]},`${Q.schema_name}.${Q.table_name}`))})}),d.length>1&&s.jsx(jo,{title:"Join Conditions",icon:rd,count:h.length,children:s.jsx("div",{className:"space-y-3",children:h.map((Q,he)=>{var ve,xe,Ce,Be,$r,mr;return s.jsx(Z,{className:"border-dashed",children:s.jsxs(le,{className:"p-3 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsxs(rt,{value:Q.join_type,onValueChange:At=>q(he,{join_type:At}),children:[s.jsx(tt,{className:"w-[140px]",children:s.jsx(st,{})}),s.jsx(nt,{children:lNe.map(At=>s.jsx(_e,{value:At.value,children:At.label},At.value))})]}),s.jsxs($e,{variant:"outline",children:[Q.left_table," ↔ ",Q.right_table]}),s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>ie(he),className:"h-8 w-8 text-muted-foreground hover:text-destructive flex-shrink-0",children:s.jsx(pn,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs(rt,{value:Q.left_column,onValueChange:At=>q(he,{left_column:At}),children:[s.jsx(tt,{children:s.jsx(st,{placeholder:"Left column"})}),s.jsx(nt,{children:(Ce=(xe=(ve=d.find(At=>At.alias===Q.left_table))==null?void 0:ve.info)==null?void 0:xe.columns)==null?void 0:Ce.map(At=>s.jsx(_e,{value:At.name,children:At.name},At.name))})]}),s.jsxs(rt,{value:Q.right_column,onValueChange:At=>q(he,{right_column:At}),children:[s.jsx(tt,{children:s.jsx(st,{placeholder:"Right column"})}),s.jsx(nt,{children:(mr=($r=(Be=d.find(At=>At.alias===Q.right_table))==null?void 0:Be.info)==null?void 0:$r.columns)==null?void 0:mr.map(At=>s.jsx(_e,{value:At.name,children:At.name},At.name))})]})]}),(!Q.left_column||!Q.right_column)&&s.jsxs("p",{className:"text-xs text-amber-500 flex items-center gap-1",children:[s.jsx(Yn,{className:"h-3 w-3"}),"Select both columns for the join"]})]})},he)})})})]})}
823),s.jsx(Ft,{value:"columns",className:"space-y-4 mt-4",children:d.length===0?s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(z_,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"Select tables first to choose columns"})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:p.length===0?"All columns will be included (SELECT *)":`${p.length} column(s) selected`}),p.length>0&&s.jsx(U,{variant:"ghost",size:"sm",onClick:()=>g([]),children:"Clear selection"})]}),s.jsx(Ba,{className:"h-[300px]",children:s.jsx("div",{className:"space-y-4",children:d.map(Q=>{var he,ve;return s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 sticky top-0 bg-background py-1",children:[s.jsx(xr,{className:"h-4 w-4 text-primary"}),s.jsx("span",{className:"font-medium text-sm",children:Q.table_name}),s.jsx($e,{variant:"outline",className:"text-xs",children:Q.alias})]}),s.jsx("div",{className:"grid grid-cols-2 gap-1 pl-6",children:(ve=(he=Q.info)==null?void 0:he.columns)==null?void 0:ve.map(xe=>{const Ce=p.some(Be=>Be.table===Q.alias&&Be.column===xe.name);return s.jsxs("label",{className:"flex items-center gap-2 p-2 rounded hover:bg-muted cursor-pointer",children:[s.jsx(Hc,{checked:Ce,onCheckedChange:()=>X(Q,xe.name)}),s.jsx("span",{className:"text-sm truncate",children:xe.name}),s.jsx("span",{className:"text-xs text-muted-foreground",children:xe.type})]},xe.name)})})]},Q.alias)})})})]})}),s.jsx(Ft,{value:"transform",className:"space-y-4 mt-4",children:d.length===0?s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(hS,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"Select tables first to add transformations"})]}):s.jsxs(s.Fragment,{children:[s.jsx(jo,{title:"Aggregations",icon:hS,count:y.length,defaultOpen:y.length>0,children:s.jsxs("div",{className:"space-y-2",children:[y.map((Q,he)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(rt,{value:Q.function,onValueChange:ve=>ye(he,{function:ve}),children:[s.jsx(tt,{className:"w-[120px]",children:s.jsx(st,{})}),s.jsx(nt,{children:cNe.map(ve=>s.jsx(_e,{value:ve.value,children:ve.label},ve.value))})]}),s.jsxs(rt,{value:`${Q.column.table}.${Q.column.column}`,onValueChange:ve=>{const[xe,Ce]=ve.split(".");ye(he,{column:{table:xe,column:Ce}})},children:[s.jsx(tt,{className:"flex-1",children:s.jsx(st,{placeholder:"Select column"})}),s.jsx(nt,{children:ut.map(({table:ve,column:xe})=>s.jsxs(_e,{value:`${ve.alias}.${xe.name}`,children:[ve.alias,".",xe.name]},`${ve.alias}.${xe.name}`))})]}),s.jsx(Re,{value:Q.alias,onChange:ve=>ye(he,{alias:ve.target.value}),placeholder:"Alias",className:"w-[120px]"}),s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>Ie(he),className:"h-8 w-8",children:s.jsx(pn,{className:"h-4 w-4"})})]},he)),s.jsxs(U,{variant:"outline",size:"sm",onClick:ce,children:[s.jsx(Ln,{className:"h-4 w-4 mr-1"}),"Add Aggregation"]})]})}),s.jsx(jo,{title:"Filters (WHERE)",icon:Va,count:w.length,defaultOpen:w.length>0,children:s.jsxs("div",{className:"space-y-2",children:[w.length>1&&s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(pe,{className:"text-xs",children:"Combine with:"}),s.jsxs(rt,{value:j,onValueChange:Q=>N(Q),children:[s.jsx(tt,{className:"w-[80px] h-7",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"AND",children:"AND"}),s.jsx(_e,{value:"OR",children:"OR"})]})]})]}),w.map((Q,he)=>{var ve,xe;return s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsxs(rt,{value:`${Q.column.table}.${Q.column.column}`,onValueChange:Ce=>{const[Be,$r]=Ce.split(".");Ze(he,{column:{table:Be,column:$r}})},children:[s.jsx(tt,{className:"w-[150px]",children:s.jsx(st,{placeholder:"Column"})}),s.jsx(nt,{children:ut.map(({table:Ce,column:Be})=>s.jsxs(_e,{value:`${Ce.alias}.${Be.name}`,children:[Ce.alias,".",Be.name]},`${Ce.alias}.${Be.name}`))})]}),s.jsxs(rt,{value:Q.operator,onValueChange:Ce=>Ze(he,{operator:Ce}),children:[s.jsx(tt,{className:"w-[140px]",children:s.jsx(st,{})}),s.jsx(nt,{children:HS.map(Ce=>s.jsx(_e,{value:Ce.value,children:Ce.label},Ce.value))})]}),((ve=HS.find(Ce=>Ce.value===Q.operator))==null?void 0:ve.needsValue)&&s.jsx(Re,{value:String(Q.value||""),onChange:Ce=>Ze(he,{value:Ce.target.value}),placeholder:"Value",className:"w-[100px]"}),((xe=HS.find(Ce=>Ce.value===Q.operator))==null?void 0:xe.needsValue2)&&s.jsx(Re,{value:String(Q.value2||""),onChange:Ce=>Ze(he,{value2:Ce.target.value}),placeholder:"Value 2",className:"w-[100px]"}),s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>fe(he),className:"h-8 w-8",children:s.jsx(pn,{className:"h-4 w-4"})})]},he)}),s.jsxs(U,{variant:"outline",size:"sm",onClick:Ue,children:[s.jsx(Ln,{className:"h-4 w-4 mr-1"}),"Add Filter"]})]})}),s.jsx(jo,{title:"Order By",icon:fre,count:_.length,defaultOpen:_.length>0,children:s.jsxs("div",{className:"space-y-2",children:[_.map((Q,he)=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(rt,{value:`${Q.column.table}.${Q.column.column}`,onValueChange:ve=>{const[xe,Ce]=ve.split(".");Et(he,{column:{table:xe,column:Ce}})},children:[s.jsx(tt,{className:"flex-1",children:s.jsx(st,{placeholder:"Column"})}),s.jsx(nt,{children:ut.map(({table:ve,column:xe})=>s.jsxs(_e,{value:`${ve.alias}
823.${xe.name}`,children:[ve.alias,".",xe.name]},`${ve.alias}.${xe.name}`))})]}),s.jsxs(rt,{value:Q.direction,onValueChange:ve=>Et(he,{direction:ve}),children:[s.jsx(tt,{className:"w-[100px]",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"asc",children:"ASC"}),s.jsx(_e,{value:"desc",children:"DESC"})]})]}),s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>oe(he),className:"h-8 w-8",children:s.jsx(pn,{className:"h-4 w-4"})})]},he)),s.jsxs(U,{variant:"outline",size:"sm",onClick:Oe,children:[s.jsx(Ln,{className:"h-4 w-4 mr-1"}),"Add Order By"]})]})}),s.jsx(jo,{title:"Row Limit",icon:Va,defaultOpen:!1,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Re,{type:"number",value:T||"",onChange:Q=>P(Q.target.value?parseInt(Q.target.value):void 0),placeholder:"No limit",min:1,max:1e6,className:"w-[150px]"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"rows maximum"})]})})]})}),s.jsxs(Ft,{value:"preview",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Preview your query before creating the dataset"}),s.jsxs(U,{onClick:Je,disabled:!ee||l.isPending,children:[l.isPending?s.jsx(Te,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(XP,{className:"h-4 w-4 mr-2"}),"Run Preview"]})]}),!ee&&s.jsx("div",{className:"p-4 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:s.jsxs("p",{className:"text-sm text-amber-700 dark:text-amber-400 flex items-center gap-2",children:[s.jsx(Yn,{className:"h-4 w-4"}),d.length===0?"Select at least one table to preview":"Complete all join conditions to preview"]})}),k&&s.jsxs("div",{className:"space-y-4",children:[s.jsx(jo,{title:"Generated SQL",icon:Pj,defaultOpen:!0,children:s.jsx("pre",{className:"p-3 bg-muted rounded-lg text-xs overflow-x-auto whitespace-pre-wrap font-mono",children:k.generated_sql})}),k.success&&k.data.length>0&&s.jsxs(jo,{title:"Sample Data",icon:xr,defaultOpen:!0,children:[s.jsxs("div",{className:"text-xs text-muted-foreground mb-2",children:["Showing ",k.data.length," rows",k.total_rows&&` of ${k.total_rows.toLocaleString()} total`," • ",k.execution_time_ms,"ms"]}),s.jsx(Ba,{className:"h-[200px]",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-muted sticky top-0",children:s.jsx("tr",{children:k.columns.map(Q=>s.jsx("th",{className:"px-3 py-2 text-left font-medium text-xs",children:Q},Q))})}),s.jsx("tbody",{children:k.data.map((Q,he)=>s.jsx("tr",{className:"border-b border-border/50",children:k.columns.map(ve=>s.jsx("td",{className:"px-3 py-2 text-xs",children:String(Q[ve]??"")},ve))},he))})]})})]}),k.warnings.length>0&&s.jsx("div",{className:"p-3 bg-amber-500/10 border border-amber-500/20 rounded-lg",children:s.jsx("p",{className:"text-sm text-amber-700 dark:text-amber-400",children:k.warnings.join(", ")})})]})]})]}),c&&s.jsx("div",{className:`p-3 rounded-lg border ${ee?"bg-green-500/10 border-green-500/20":"bg-muted border-border"}`,children:s.jsxs("div",{className:"flex items-center gap-2",children:[ee?s.jsx(bt,{className:"h-4 w-4 text-green-500"}):s.jsx(Yn,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm",children:ee?`Ready to create dataset with ${d.length} table(s)`:d.length===0?"Select at least one table":"Complete all join conditions"})]})})]})},dNe=kd("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),fl=x.forwardRef(({className:e,variant:t,...n},r)=>s.jsx("div",{ref:r,role:"alert",className:te(dNe({variant:t}),e),...n}));fl.displayName="Alert";const Ph=x.forwardRef(({className:e,...t},n)=>s.jsx("h5",{ref:n,className:te("mb-1 font-medium leading-none tracking-tight",e),...t}));Ph.displayName="AlertTitle";const hl=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{ref:n,className:te("text-sm [&_p]:leading-relaxed",e),...t}));hl.displayName="AlertDescription";const fNe=["INSERT","UPDATE","DELETE","DROP","CREATE","ALTER","TRUNCATE","GRANT","REVOKE","EXEC","EXECUTE","CALL","INTO"],hNe=e=>{const t=e.trim();if(!t)return{isValid:!1,error:"Query cannot be empty"};if(!t.toUpperCase().startsWith("SELECT"))return{isValid:!1,error:"Query must start with SELECT"};const n=t.toUpperCase();for(const r of fNe)if(new RegExp(`\\b${r}\\b`,"i").test(n))return{isValid:!1,error:`Query cannot contain ${r} statements`};return n.includes("--")||n.includes(";")?{isValid:!1,error:"Query cannot contain comments (--) or multiple statements (;)"}:{isValid:!0}},mNe=({onQueryValidated:e,initialConnectorId:t,initialQuery:n=""})=>{const r=cn(),{data:a=[],isLoading:i,isError:o,error:l,refetch:c}
823=_m(),u=$7(),[d,f]=x.useState(t),[h,m]=x.useState(n),[p,g]=x.useState(null),[y,v]=x.useState(null),[w,b]=x.useState(!1),j=a.filter(T=>T.status==="connected"&&["postgresql","mysql","mongodb","mariadb"].includes(T.type)),N=j.find(T=>T.id===d);x.useEffect(()=>{j.length===1&&!d&&f(j[0].id)},[j,d]),x.useEffect(()=>{const T=hNe(h);g(T.error||null),b(T.isValid),v(null),!T.isValid&&d&&e({connectorId:d,sqlQuery:h,isValid:!1})},[h]);const S=T=>{f(T),v(null),e({connectorId:T,sqlQuery:h,isValid:!1})},C=x.useCallback(async()=>{if(!(!d||!w))try{se.success("Query syntax validated"),v({success:!0,generated_sql:h,columns:[],data:[],execution_time_ms:0,warnings:[]}),e({connectorId:d,sqlQuery:h,isValid:!0,previewData:void 0})}catch(T){const P=(T==null?void 0:T.message)||"Failed to validate query";g(P),se.error("Query validation failed",{description:P})}},[d,h,w,e]),_=()=>{navigator.clipboard.writeText(h),se.success("Query copied to clipboard")},E=()=>{m(`SELECT
824  column1,
825  column2,
826  COUNT(*) as count,
827  SUM(amount) as total
828FROM your_table
829WHERE status = 'active'
830GROUP BY column1, column2
831ORDER BY total DESC
832LIMIT 1000`)};if(i)return s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})});if(o){const T=(l==null?void 0:l.detail)||(l==null?void 0:l.message)||"";return T.includes("PRO")||T.includes("ENTERPRISE")||T.includes("plan")?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[s.jsx("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-amber-400 to-amber-600 flex items-center justify-center",children:s.jsx(eo,{className:"h-8 w-8 text-white"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Upgrade Required"}),s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm",children:["Database connectors are available on ",s.jsx("strong",{children:"PRO"})," and"," ",s.jsx("strong",{children:"ENTERPRISE"})," plans."]})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>r("/dashboard/subscription"),children:[s.jsx(eo,{className:"mr-2 h-4 w-4"}),"Upgrade Plan"]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx(Yn,{className:"h-12 w-12 text-destructive"}),s.jsx("p",{className:"text-lg font-medium",children:"Failed to load connectors"}),s.jsxs(U,{onClick:()=>c(),children:[s.jsx(Vn,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}return j.length===0?s.jsxs("div",{className:"text-center py-8 border border-dashed rounded-lg",children:[s.jsx(wt,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),s.jsx("p",{className:"text-muted-foreground font-medium",children:"No connected databases found"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect a database first to write custom SQL queries."}),s.jsx(U,{variant:"link",className:"mt-3",onClick:()=>r("/dashboard/connectors"),children:"Go to Connectors →"})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"connector-select",children:"Select Database Connection"}),s.jsxs(rt,{value:d,onValueChange:S,children:[s.jsx(tt,{id:"connector-select",children:s.jsx(st,{placeholder:"Choose a database connection"})}),s.jsx(nt,{children:j.map(T=>s.jsx(_e,{value:T.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-4 w-4 text-primary"}),s.jsx("span",{children:T.name}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",T.type.toUpperCase(),")"]})]})},T.id))})]}),N&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[N.host,":",N.port,"/",N.database]})]}),N&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(pe,{htmlFor:"sql-query",children:"SQL Query"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(U,{variant:"ghost",size:"sm",onClick:E,children:[s.jsx(Pj,{className:"h-4 w-4 mr-1"}),"Sample"]}),s.jsxs(U,{variant:"ghost",size:"sm",onClick:_,disabled:!h,children:[s.jsx(Od,{className:"h-4 w-4 mr-1"}),"Copy"]})]})]}),s.jsx(Aa,{id:"sql-query",value:h,onChange:T=>m(T.target.value),placeholder:`SELECT column1, column2, SUM(amount) as total
833FROM your_table
834WHERE condition = 'value'
835GROUP BY column1, column2
836ORDER BY total DESC
837LIMIT 1000`,className:"font-mono text-sm min-h-[200px] resize-y"}),p&&s.jsxs(fl,{variant:"destructive",children:[s.jsx(Yn,{className:"h-4 w-4"}),s.jsx(Ph,{children:"Invalid Query"}),s.jsx(hl,{children:p})]}),!p&&h&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[s.jsx(bt,{className:"h-4 w-4"}),"Query syntax looks valid"]})]}),s.jsxs(fl,{children:[s.jsx(ym,{className:"h-4 w-4"}),s.jsx(Ph,{children:"Query Guidelines"}),s.jsxs(hl,{className:"space-y-1",children:[s.jsx("p",{children:"• Only SELECT queries are allowed (no INSERT, UPDATE, DELETE)"}),s.jsx("p",{children:"• Results are limited to 1,000,000 rows maximum"}),s.jsx("p",{children:"• Query timeout is 60 seconds"}),s.jsx("p",{children:"• Use table names exactly as they appear in the database"})]})]}),s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs(U,{onClick:C,disabled:!w||u.isPending,className:"flex-1",children:[u.isPending?s.jsx(Te,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(XP,{className:"h-4 w-4 mr-2"}),"Validate Query"]})}),(y==null?void 0:y.success)&&s.jsx("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded-lg",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-green-500 flex items-center justify-center",children:s.jsx(bt,{className:"h-5 w-5 text-white"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-green-700 dark:text-green-300",children:"Query Validated"}),s.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:'Your query is ready. Click "Create Dataset" to proceed.'})]})]})})]})]})},Sl=x.forwardRef(({className:e,...t},n)=>s.jsx("div",{className:"relative w-full overflow-auto",children:s.jsx("table",{ref:n,className:te("w-full caption-bottom text-sm",e),...t})}));Sl.displayName="Table";const Cl=x.forwardRef(({className:e,...t},n)=>s.jsx("thead",{ref:n,className:te("[&_tr]:border-b",e),...t}));Cl.displayName="TableHeader";const _l=x.forwardRef(({className:e,...t},n)=>s.jsx("tbody",{ref:n,className:te("[&_tr:last-child]:border-0",e),...t}));_l.displayName="TableBody";const pNe=x.forwardRef(({className:e,...t},n)=>s.jsx("tfoot",{ref:n,className:te("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));pNe.displayName="TableFooter";const Rr=x.forwardRef(({className:e,...t},n)=>s.jsx("tr",{ref:n,className:te("border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50",e),...t}));Rr.displayName="TableRow";const jt=x.forwardRef(({className:e,...t},n)=>s.jsx("th",{ref:n,className:te("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));jt.displayName="TableHead";const Nt=x.forwardRef(({className:e,...t},n)=>s.jsx("td",{ref:n,className:te("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));
837Nt.displayName="TableCell";const gNe=x.forwardRef(({className:e,...t},n)=>s.jsx("caption",{ref:n,className:te("mt-4 text-sm text-muted-foreground",e),...t}));gNe.displayName="TableCaption";const yNe=["Show me total sales by category for the last month","List all customers who made more than 3 purchases","Find the top 10 products by revenue","Show average order value by region","Count active users by subscription plan"],vNe=({onQueryApproved:e,initialConnectorId:t})=>{var R;const n=cn(),{data:r=[],isLoading:a,isError:i,error:o,refetch:l}=_m(),c=Rpe(),[u,d]=x.useState(t),[f,h]=x.useState(""),[m,p]=x.useState(null),[g,y]=x.useState(""),[v,w]=x.useState(!1),[b,j]=x.useState(!1),[N,S]=x.useState(!0),[C,_]=x.useState(!0),E=r.filter(O=>O.status==="connected"&&["postgresql","mysql","mongodb","mariadb"].includes(O.type)),T=E.find(O=>O.id===u);x.useEffect(()=>{E.length===1&&!u&&d(E[0].id)},[E,u]);const P=O=>{d(O),p(null),y(""),j(!1),e({connectorId:O,naturalLanguageQuery:f,generatedSQL:"",isApproved:!1})},k=x.useCallback(async()=>{if(!(!u||!f.trim()))try{const O=await c.mutateAsync({connector_id:u,natural_language_query:f,include_sample_data:!0,max_tables:5});p(O),y(O.generated_sql),j(!1),w(!1),se.success("SQL generated successfully")}catch(O){const F=(O==null?void 0:O.message)||(O==null?void 0:O.detail)||"Failed to generate SQL";se.error("Generation failed",{description:F})}},[u,f,c]),D=()=>{if(!u||!m)return;const O=v?g:m.generated_sql;j(!0),e({connectorId:u,naturalLanguageQuery:f,generatedSQL:O,isApproved:!0,aiResponse:{...m,generated_sql:O}}),se.success("Query approved")},A=()=>{const O=v?g:(m==null?void 0:m.generated_sql)||"";navigator.clipboard.writeText(O),se.success("SQL copied to clipboard")},I=O=>{h(O),p(null),j(!1)},M=()=>{p(null),j(!1),k()},$=()=>{!v&&m&&y(m.generated_sql),w(!v),j(!1)};if(a)return s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})});if(i){const O=(o==null?void 0:o.detail)||(o==null?void 0:o.message)||"";return O.includes("PRO")||O.includes("ENTERPRISE")||O.includes("plan")?s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-4",children:[s.jsx("div",{className:"h-16 w-16 rounded-full bg-gradient-to-br from-amber-400 to-amber-600 flex items-center justify-center",children:s.jsx(eo,{className:"h-8 w-8 text-white"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Upgrade Required"}),s.jsxs("p",{className:"text-sm text-muted-foreground max-w-sm",children:["AI-powered database queries are available on ",s.jsx("strong",{children:"PRO"})," and"," ",s.jsx("strong",{children:"ENTERPRISE"})," plans."]})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>n("/dashboard/subscription"),children:[s.jsx(eo,{className:"mr-2 h-4 w-4"}),"Upgrade Plan"]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx(Yn,{className:"h-12 w-12 text-destructive"}),s.jsx("p",{className:"text-lg font-medium",children:"Failed to load connectors"}),s.jsxs(U,{onClick:()=>l(),children:[s.jsx(Vn,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}return E.length===0?s.jsxs("div",{className:"text-center py-8 border border-dashed rounded-lg",children:[s.jsx(wt,{className:"h-10 w-10 text-muted-foreground mx-auto mb-3"}),s.jsx("p",{className:"text-muted-foreground font-medium",children:"No connected databases found"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Connect a database first to use AI-powered queries."}),s.jsx(U,{variant:"link",className:"mt-3",onClick:()=>n("/dashboard/connectors"),children:"Go to Connectors →"})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"connector-select",children:"Select Database Connection"}),s.jsxs(rt,{value:u,onValueChange:P,children:[s.jsx(tt,{id:"connector-select",children:s.jsx(st,{placeholder:"Choose a database connection"})}),s.jsx(nt,{children:E.map(O=>s.jsx(_e,{value:O.id,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-4 w-4 text-primary"}),s.jsx("span",{children:O.name}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",O.type.toUpperCase(),")"]})]})},O.id))})]}),T&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:[T.host,":",T.port,"/",T.database]})]}),T&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{htmlFor:"nl-query",className:"flex items-center gap-2",children:[s.jsx(YB,{className:"h-4 w-4"}),"Describe what data you need"]}),s.jsx(Aa,{id:"nl-query",value:f,onChange:O=>{h(O.target.value),p(null),j(!1)},placeholder:"e.g., Show me total sales by category for the last month, sorted by highest to lowest",className:"min-h-[100px] resize-y"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(kj,{className:"h-4 w-4"}),"Try one of these examples:"]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:yNe.map((O,F)=>s.jsx(U,{variant:"outline",size:"sm",className:"text-xs h-7",onClick:()=>I(O),children:O.length>40?`${O.substring(0,40)}...`:O},F))})]}),s.jsxs(U,{onClick:k,disabled:!f.trim()||c.isPending,className:"w-full bg-gradient-primary",size:"lg",children:[c.isPending?s.jsx(Te,{className:"h-5 w-5 mr-2 animate-spin"}):s.jsx(Ca,{className:"h-5 w-5 mr-2"}),"Generate SQL with AI"]}),m&&s.jsxs("div",{className:"space-y-4 p-4 border rounded-lg bg-muted/30",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.jsx(Ca,{className:"h-4 w-4 text-primary"}),"AI Explanation"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:m.explanation})]}),m.tables_used.length>0&&s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx("span",{className:"text-xs text-muted-foreground",children:"Tables used:"}),m.tables_used.map(O=>s.jsxs($e,{variant:"secondary",className:"text-xs",children:[s.jsx(xr,{className:"h-3 w-3 mr-1"}),O]},O))]}),m.warnings.length>0&&s.jsxs(fl,{variant:"destructive",children:[s.jsx(Yn,{className:"h-4 w-4"}),s.jsx(Ph,{children:"Warnings"}),s.jsx(hl,{children:s.jsx("ul",{className:"list-disc pl-4 space-y-1",children:m.warnings.map((O,F)=>s.jsx("li",{className:"text-sm",children:O},F))})})]}),s.jsx(Kr,{}),s.jsxs(xh,{open:N,onOpenChange:S,children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(bh,{asChild:!0,children:s.jsxs(U,{variant:"ghost",size:"sm",className:"gap-2",children:[s.jsx(Pj,{className:"h-4 w-4"}),"Generated SQL",N?s.jsx(Zi,{className:"h-4 w-4"}):s.jsx(Jr,{className:"h-4 w-4"})]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(U,{variant:"ghost",size:"sm",onClick:$,children:[s.jsx(YP,{className:"h-4 w-4 mr-1"}),v?"Preview":"Edit"]}),s.jsxs(U,{variant:"ghost",size:"sm",onClick:A,children:[s.jsx(Od,{className:"h-4 w-4 mr-1"}),"Copy"]})]})]}),s.jsx(wh,{children:v?s.jsx(Aa,{value:g,onChange:O=>{y(O.target.value),j(!1)},className:"font-mono text-sm mt-2 min-h-[150px]"}):s.jsx("pre",{className:"bg-muted p-3 rounded-lg overflow-x-auto mt-2",children:s.jsx("code",{className:"text-sm",children:m.generated_sql})})})]}),m.sample_data&&m.sample_data.length>0&&s.jsxs(xh,{open:C,onOpenChange:_,children:[s.jsx(bh,{asChild:!0,children:s.jsxs(U,{variant:"ghost",size:"sm",className:"gap-2",children:[s.jsx(ui,{className:"h-4 w-4"}),"Sample Data (",m.sample_data.length," rows)",C?s.jsx(Zi,{className:"h-4 w-4"}):s.jsx(Jr,{className:"h-4 w-4"})]})}),s.jsx(wh,{children:s.jsxs(Ba,{className:"w-full mt-2",children:[s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsx(Rr,{children:(R=m.columns)==null?void 0:R.map(O=>s.jsx(jt,{className:"font-mono text-xs",children:O},O))})}),s.jsx(_l,{children:m.sample_data.slice(0,5).map((O,F)=>{var z;return s.jsx(Rr,{children:(z=m.columns)==null?void 0:z.map(B=>s.jsx(Nt,{className:"font-mono text-xs",children:String(O[B]??"")},B))},F)})})]}),s.jsx(pO,{orientation:"horizontal"})]})})]}),m.estimated_rows!==void 0&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(ym,{className:"h-4 w-4"}
837),"Estimated rows: ",m.estimated_rows.toLocaleString()]}),s.jsx(Kr,{}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs(U,{variant:"outline",onClick:M,disabled:c.isPending,className:"flex-1",children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Regenerate"]}),s.jsx(U,{onClick:D,disabled:b,className:"flex-1 bg-green-600 hover:bg-green-700",children:b?s.jsxs(s.Fragment,{children:[s.jsx(bt,{className:"h-4 w-4 mr-2"}),"Approved"]}):s.jsxs(s.Fragment,{children:[s.jsx(bt,{className:"h-4 w-4 mr-2"}),"Approve Query"]})})]})]}),b&&s.jsx("div",{className:"p-4 bg-green-500/10 border border-green-500/20 rounded-lg",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-green-500 flex items-center justify-center",children:s.jsx(bt,{className:"h-5 w-5 text-white"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium text-green-700 dark:text-green-300",children:"Query Approved"}),s.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:'Your AI-generated query is ready. Click "Create Dataset" to proceed.'})]})]})})]})]})},Q2={selectedMode:null,simpleSelection:null,visualConfig:null,advancedConfig:null,aiConfig:null,datasetName:"",datasetDescription:"",visibility:"private"},OI=[{id:"simple",title:"Simple",description:"Select a single table from your database",icon:xr,available:!0},{id:"visual",title:"Visual",description:"Join multiple tables with a visual builder",icon:Mg,available:!0},{id:"advanced",title:"Advanced",description:"Write your own custom SQL query",icon:Pj,available:!0},{id:"ai_assisted",title:"AI-Assisted",description:"Describe what you need in natural language",icon:Ca,available:!0}],xNe=e=>{var a;if(!e||!e.query_config)return Q2;const t=e.query_config,n=t.mode,r={...Q2,selectedMode:n,datasetName:e.name||"",datasetDescription:e.description||"",visibility:(e.visibility||"private").toLowerCase()};switch(n){case"simple":return{...r,simpleSelection:{connectorId:e.connector_id,schemaName:e.schema_name||"public",tableName:e.table_name||""}};case"visual":return{...r,visualConfig:t.visual_config?{connectorId:e.connector_id,queryConfig:t.visual_config,isValid:!0}:null};case"advanced":return{...r,advancedConfig:{connectorId:e.connector_id,sqlQuery:e.custom_query||"",isValid:!!e.custom_query}};case"ai_assisted":return{...r,aiConfig:{connectorId:e.connector_id,naturalLanguageQuery:((a=t.visual_config)==null?void 0:a.natural_language_query)||"",generatedSQL:e.custom_query||"",isApproved:!0}};default:return r}},uK=({open:e,onOpenChange:t,onSuccess:n,onBack:r,mode:a="create",existingDataset:i})=>{var O,F,z,B,H,Y,ee,V,K;const o=cn(),l=a==="edit",c=Ope(),u=Tpe(),d=Mpe(),f=Dpe(),h=$pe(),m=Ipe(),p=Lpe(),g=Fpe(),y=l&&i?xNe(i):Q2,v=l&&((O=i==null?void 0:i.query_config)!=null&&O.mode)?"configure":"mode",[w,b]=x.useState(v),[j,N]=x.useState(y),S=x.useCallback(()=>{b(v),N(y)},[v,y]),C=()=>{t(!1),setTimeout(S,200)},_=W=>{N(q=>({...q,selectedMode:W})),b("configure")},E=W=>{N(q=>({...q,simpleSelection:W,datasetName:W!=null&&W.tableName?`${W.tableName}_dataset`:q.datasetName}))},T=W=>{N(q=>({...q,visualConfig:W,datasetName:W.queryConfig.tables.length>0?`${W.queryConfig.tables.map(J=>J.table_name).join("_")}_dataset`:q.datasetName}))},P=W=>{N(q=>({...q,advancedConfig:W}))},k=W=>{N(q=>({...q,aiConfig:W,datasetName:W.naturalLanguageQuery?`AI_${W.naturalLanguageQuery.slice(0,30).replace(/\s+/g,"_")}`:q.datasetName}))},D=()=>{var W,q,J,ie;switch(j.selectedMode){case"simple":return!!((W=j.simpleSelection)!=null&&W.tableName);case"visual":return!!((q=j.visualConfig)!=null&&q.isValid);case"advanced":return!!((J=j.advancedConfig)!=null&&J.isValid);case"ai_assisted":return!!((ie=j.aiConfig)!=null&&ie.isApproved);default:return!1}},A=()=>D()&&j.datasetName.trim().length>0,I=()=>{D()&&b("details")},M=()=>{w==="details"?b("configure"):w==="configure"&&b("mode")},$=async()=>{if(A())try{let W;const q=j.visibility.toLowerCase();if(l&&i){switch(j.selectedMode){case"simple":if(!j.simpleSelection)return;W=await h.mutateAsync({id:i.id,data:{table_name:j.simpleSelection.tableName,schema_name:j.simpleSelection.schemaName,name:j.datasetName,description:j.datasetDescription||void 0,visibility:q}}
837);break;case"visual":if(!j.visualConfig)return;W=await m.mutateAsync({id:i.id,data:{query_config:j.visualConfig.queryConfig,name:j.datasetName,description:j.datasetDescription||void 0,visibility:q}});break;case"advanced":if(!j.advancedConfig)return;W=await p.mutateAsync({id:i.id,data:{sql_query:j.advancedConfig.sqlQuery,name:j.datasetName,description:j.datasetDescription||void 0,visibility:q}});break;case"ai_assisted":if(!j.aiConfig)return;W=await g.mutateAsync({id:i.id,data:{natural_language_query:j.aiConfig.naturalLanguageQuery,approved_sql:j.aiConfig.generatedSQL,name:j.datasetName,description:j.datasetDescription||void 0,visibility:q}});break;default:return}se.success("Dataset updated successfully",{description:`Updated "${j.datasetName}" with ${W.row_count.toLocaleString()} rows`}),C(),n==null||n(W.dataset_id)}else{switch(j.selectedMode){case"simple":if(!j.simpleSelection)return;W=await c.mutateAsync({connector_id:j.simpleSelection.connectorId,name:j.datasetName,description:j.datasetDescription||void 0,visibility:j.visibility,schema_name:j.simpleSelection.schemaName,table_name:j.simpleSelection.tableName});break;case"visual":if(!j.visualConfig)return;W=await u.mutateAsync({connector_id:j.visualConfig.connectorId,name:j.datasetName,description:j.datasetDescription||void 0,visibility:j.visibility,query_config:j.visualConfig.queryConfig});break;case"advanced":if(!j.advancedConfig)return;W=await d.mutateAsync({connector_id:j.advancedConfig.connectorId,name:j.datasetName,description:j.datasetDescription||void 0,visibility:j.visibility,sql_query:j.advancedConfig.sqlQuery});break;case"ai_assisted":if(!j.aiConfig)return;W=await f.mutateAsync({connector_id:j.aiConfig.connectorId,name:j.datasetName,description:j.datasetDescription||void 0,visibility:j.visibility,natural_language_query:j.aiConfig.naturalLanguageQuery,approved_sql:j.aiConfig.generatedSQL});break;default:return}se.success("Dataset created successfully",{description:`Created "${j.datasetName}" with ${W.row_count.toLocaleString()} rows`}),C(),n==null||n(W.dataset_id),o(`/dashboard/datasets/${W.dataset_id}`)}}catch(W){const q=W==null?void 0:W.detail;if((W==null?void 0:W.status_code)===413||typeof q=="object"&&(q!=null&&q.row_count)){const J=typeof q=="object"?q:{};se.error("Dataset exceeds row limit",{description:J.message||`Your plan allows up to ${(J.max_rows||0).toLocaleString()} rows. This dataset has ${(J.row_count||0).toLocaleString()} rows. ${J.upgrade_message||"Upgrade your plan to increase this limit."}`,duration:1e4})}else{const J=W instanceof Error?W.message:typeof q=="string"?q:l?"Failed to update dataset":"Failed to create dataset";se.error(l?"Dataset update failed":"Dataset creation failed",{description:J})}}},R=c.isPending||u.isPending||d.isPending||f.isPending||h.isPending||m.isPending||p.isPending||g.isPending;return s.jsx(br,{open:e,onOpenChange:t,children:s.jsxs(or,{className:`overflow-hidden flex flex-col ${j.selectedMode==="visual"&&w!=="mode"?"max-w-[95vw] w-[95vw] h-[95vh] max-h-[95vh]":"max-w-3xl max-h-[90vh]"}`,onInteractOutside:W=>W.preventDefault(),onPointerDownOutside:W=>W.preventDefault(),children:[s.jsxs(lr,{children:[s.jsxs(cr,{className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-5 w-5 text-primary"}),l?"Edit Dataset":"Create Dataset from Database"]}),s.jsxs(wr,{children:[w==="mode"&&"Choose how you want to create your dataset",w==="configure"&&(l?"Modify your data source configuration":"Configure your data source"),w==="details"&&(l?"Update dataset details":"Name and configure your dataset")]})]}),s.jsxs("div",{className:"flex items-center gap-2 px-1",children:[s.jsxs("div",{className:`flex items-center gap-2 ${w==="mode"?"text-primary font-medium":"text-muted-foreground"}`,children:[s.jsx("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs ${w==="mode"?"bg-primary text-primary-foreground":j.selectedMode?"bg-green-500 text-white":"bg-muted"}`,children:j.selectedMode?s.jsx(bt,{className:"h-4 w-4"}):"1"}),s.jsx("span",{className:"text-sm",children:"Mode"})]}),s.jsx(si,{className:"h-4 w-4 text-muted-foreground"}),s.jsxs("div",{className:`flex items-center gap-2 ${w==="configure"?"text-primary font-medium":"text-muted-foreground"}`,children:[s.jsx("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs ${w==="configure"?"bg-primary text-primary-foreground":D()?"bg-green-500 text-white":"bg-muted"}`,children:D()&&w!=="configure"?s.jsx(bt,{className:"h-4 w-4"}):"2"}),s.jsx("span",{className:"text-sm",children:"Configure"})]}),s.jsx(si,{className:"h-4 w-4 text-muted-foreground"}),s.jsxs("div",{className:`flex items-center gap-2 ${w==="details"?"text-primary font-medium":"text-muted-foreground"}`,children:[s.jsx("div",{className:`h-6 w-6 rounded-full flex items-center justify-center text-xs ${w==="details"?"bg-primary text-primary-foreground":"bg-muted"}`,children:"3"}),s.jsx("span",{className:"text-sm",children:"Details"})]})]}),s.jsx(Kr,{}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-1",children:[w==="mode"&&s.jsx("div",{className:"grid grid-cols-2 gap-4 py-4",children:OI.map(W=>{const q=W.icon;return s.jsxs("button",{onClick:()=>W.available&&_(W.id),disabled:!W.available,className:`relative p-4 rounded-lg border text-left transition-all ${W.available?"hover:border-primary hover:bg-primary/5 curs
837or-pointer":"opacity-50 cursor-not-allowed"} ${j.selectedMode===W.id?"border-primary bg-primary/5 ring-1 ring-primary":"border-border"}`,children:[W.comingSoon&&s.jsx($e,{variant:"secondary",className:"absolute top-2 right-2 text-xs",children:"Coming Soon"}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:`h-10 w-10 rounded-lg flex items-center justify-center ${j.selectedMode===W.id?"bg-primary text-primary-foreground":"bg-muted"}`,children:s.jsx(q,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-medium",children:W.title}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:W.description})]})]})]},W.id)})}),w==="configure"&&s.jsxs("div",{className:"py-4",children:[j.selectedMode==="simple"&&s.jsx($ye,{onSelectionChange:E,initialConnectorId:(F=j.simpleSelection)==null?void 0:F.connectorId,initialTableName:(z=j.simpleSelection)==null?void 0:z.tableName}),j.selectedMode==="visual"&&s.jsx(uNe,{onConfigChange:T,initialConnectorId:(B=j.visualConfig)==null?void 0:B.connectorId,initialQueryConfig:(H=j.visualConfig)==null?void 0:H.queryConfig}),j.selectedMode==="advanced"&&s.jsx(mNe,{onQueryValidated:P,initialConnectorId:(Y=j.advancedConfig)==null?void 0:Y.connectorId,initialQuery:(ee=j.advancedConfig)==null?void 0:ee.sqlQuery}),j.selectedMode==="ai_assisted"&&s.jsx(vNe,{onQueryApproved:k,initialConnectorId:(V=j.aiConfig)==null?void 0:V.connectorId})]}),w==="details"&&s.jsxs("div",{className:"py-4 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{htmlFor:"dataset-name",children:["Dataset Name ",s.jsx("span",{className:"text-destructive",children:"*"})]}),s.jsx(Re,{id:"dataset-name",value:j.datasetName,onChange:W=>N(q=>({...q,datasetName:W.target.value})),placeholder:"Enter a name for your dataset"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"dataset-description",children:"Description (optional)"}),s.jsx(Aa,{id:"dataset-description",value:j.datasetDescription,onChange:W=>N(q=>({...q,datasetDescription:W.target.value})),placeholder:"Describe what this dataset contains...",className:"min-h-[80px]"})]}),s.jsxs("div",{className:"p-4 bg-muted/50 rounded-lg space-y-2",children:[s.jsx("h4",{className:"font-medium text-sm",children:"Summary"}),s.jsxs("div",{className:"text-sm text-muted-foreground space-y-1",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Mode:"})," ",(K=OI.find(W=>W.id===j.selectedMode))==null?void 0:K.title]}),j.selectedMode==="simple"&&j.simpleSelection&&s.jsxs("p",{children:[s.jsx("strong",{children:"Table:"})," ",j.simpleSelection.schemaName,".",j.simpleSelection.tableName]}),j.selectedMode==="visual"&&j.visualConfig&&s.jsxs("p",{children:[s.jsx("strong",{children:"Tables:"})," ",j.visualConfig.queryConfig.tables.map(W=>W.table_name).join(", "),j.visualConfig.queryConfig.joins&&j.visualConfig.queryConfig.joins.length>0&&s.jsxs("span",{className:"text-xs ml-1",children:["(",j.visualConfig.queryConfig.joins.length," join",j.visualConfig.queryConfig.joins.length>1?"s":"",")"]})]}),j.selectedMode==="ai_assisted"&&j.aiConfig&&s.jsxs("p",{children:[s.jsx("strong",{children:"Query:"}),' "',j.aiConfig.naturalLanguageQuery,'"']})]})]})]})]}),s.jsx(Kr,{}),s.jsxs(_a,{className:"flex-row justify-between sm:justify-between",children:[s.jsx("div",{children:s.jsxs(U,{variant:"ghost",onClick:w==="mode"?r||C:M,disabled:R,children:[s.jsx(Wu,{className:"h-4 w-4 mr-2"}),"Back"]})}),s.jsxs("div",{className:"flex items-center gap-2",children:[w!=="mode"&&s.jsx(U,{variant:"outline",onClick:C,disabled:R,children:"Cancel"}),w==="configure"&&s.jsxs(U,{onClick:I,disabled:!D(),children:["Continue",s.jsx(si,{className:"h-4 w-4 ml-2"})]}),w==="details"&&s.jsxs(U,{onClick:$,disabled:!A()||R,children:[R?s.jsx(Te,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(bt,{className:"h-4 w-4 mr-2"}
vendor: 2,906 bytes, line 837
837),l?"Update Dataset":"Create Dataset"]})]})]})]})})};var IO="Radio",[bNe,dK]=kn(IO),[wNe,jNe]=bNe(IO),fK=x.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:a=!1,required:i,disabled:o,value:l="on",onCheck:c,form:u,...d}=e,[f,h]=x.useState(null),m=qe(t,y=>h(y)),p=x.useRef(!1),g=f?u||!!f.closest("form"):!0;return s.jsxs(wNe,{scope:n,checked:a,disabled:o,children:[s.jsx(Pe.button,{type:"button",role:"radio","aria-checked":a,"data-state":gK(a),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:m,onClick:je(e.onClick,y=>{a||c==null||c(),g&&(p.current=y.isPropagationStopped(),p.current||y.stopPropagation())})}),g&&s.jsx(pK,{control:f,bubbles:!p.current,name:r,value:l,checked:a,required:i,disabled:o,form:u,style:{transform:"translateX(-100%)"}})]})});fK.displayName=IO;var hK="RadioIndicator",mK=x.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...a}=e,i=jNe(hK,n);return s.jsx(Jn,{present:r||i.checked,children:s.jsx(Pe.span,{"data-state":gK(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:t})})});mK.displayName=hK;var NNe="RadioBubbleInput",pK=x.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=x.useRef(null),l=qe(o,i),c=vv(n),u=av(t);return x.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const p=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(p)}},[c,n,r]),s.jsx(Pe.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});pK.displayName=NNe;function gK(e){return e?"checked":"unchecked"}var SNe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],k1="RadioGroup",[CNe,rrt]=kn(k1,[qc,dK]),yK=qc(),vK=dK(),[_Ne,ENe]=CNe(k1),xK=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:a,value:i,required:o=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...h}=e,m=yK(n),p=wl(u),[g,y]=fr({prop:i,defaultProp:a??null,onChange:f,caller:k1});return s.jsx(_Ne,{scope:n,name:r,required:o,disabled:l,value:g,onValueChange:y,children:s.jsx(Yj,{asChild:!0,...m,orientation:c,dir:p,loop:d,children:s.jsx(Pe.div,{role:"radiogroup","aria-required":o,"aria-orientation":c,"data-disabled":l?"":void 0,dir:p,...h,ref:t})})})});xK.displayName=k1;var bK="RadioGroupItem",wK=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...a}=e,i=ENe(bK,n),o=i.disabled||r,l=yK(n),c=vK(n),u=x.useRef(null),d=qe(t,u),f=i.value===a.value,h=x.useRef(!1);return x.useEffect(()=>{const m=g=>{SNe.includes(g.key)&&(h.current=!0)},p=()=>h.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",p),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",p)}},[]),s.jsx(Xj,{asChild:!0,...l,focusable:!o,active:f,children:s.jsx(fK,{disabled:o,required:i.required,
837checked:f,...c,...a,name:i.name,ref:d,onCheck:()=>i.onValueChange(a.value),onKeyDown:je(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:je(a.onFocus,()=>{var m;h.current&&((m=u.current)==null||m.click())})})})});wK.displayName=bK;var ANe="RadioGroupIndicator",jK=x.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,a=vK(n);return s.jsx(mK,{...a,...r,ref:t})});jK.displayName=ANe;var NK=xK,SK=wK,PNe=jK;const J2=x.forwardRef(({className:e,...t},n)=>s.jsx(NK,{className:te("grid gap-2",e),...t,ref:n}));J2.displayName=NK.displayName;const Z2=x.forwardRef(({className:e,...t},n)=>s.jsx(SK,{ref:n,className:te("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:s.jsx(PNe,{className:"flex items-center justify-center",children:s.jsx(UB,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Z2.displayName=SK.displayName;const KS=e=>{if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]},GS=e=>{const t=new Date(e),r=new Date().getTime()-t.getTime(),a=Math.floor(r/(1e3*60*60*24));return a===0?"Today":a===1?"Yesterday":a<7?`${a} days ago`:a<30?`${Math.floor(a/7)} weeks ago`:t.toLocaleDateString()},YS=e=>{if(!e)return"DB";const t=e.toLowerCase();return{csv:"CSV",xlsx:"XLSX",xls:"XLS",json:"JSON",xml:"XML",parquet:"PRQ"}[t]||e.toUpperCase()},kNe=()=>{const e=cn(),t=x.useRef(null),{data:n,isLoading:r,refetch:a}=s1(),{data:i,isLoading:o}=I7(),l=Bme(),c=p7(),u=zme(),d=kpe(),f=b7(),[h,m]=x.useState("grid"),[p,g]=x.useState(""),[y,v]=x.useState("all"),[w,b]=x.useState(!1),[j,N]=x.useState(!1),[S,C]=x.useState(0),[_,E]=x.useState(!1),[T,P]=x.useState("file"),[k,D]=x.useState([]),[A,I]=x.useState("source"),[M,$]=x.useState("private"),[R,O]=x.useState(""),[F,z]=x.useState(""),[B,H]=x.useState(null),[Y,ee]=x.useState(null),[V,K]=x.useState(null),W=i||[],q=W.find(oe=>oe.id===Y),J=(q==null?void 0:q.sheets)||[],X=((n==null?void 0:n.items)||[]).filter(oe=>{var Q;const Je=oe.name.toLowerCase().includes(p.toLowerCase()),ut=y==="all"||((Q=oe.file_type)==null?void 0:Q.toLowerCase())===y;return Je&&ut}),ge=oe=>{H(oe),R||O(oe.name.replace(/\.[^/.]+$/,"")),I("details")},Se=oe=>{oe.target.files&&oe.target.files[0]&&ge(oe.target.files[0])},ce=oe=>{oe.preventDefault(),oe.stopPropagation(),oe.type==="dragenter"||oe.type==="dragover"?N(!0):oe.type==="dragleave"&&N(!1)},ye=oe=>{oe.preventDefault(),oe.stopPropagation(),N(!1),oe.dataTransfer.files&&oe.dataTransfer.files[0]&&ge(oe.dataTransfer.files[0])},Ie=async()=>{if(!R){se.error("Please enter a dataset name");return}if(T==="file"){if(!B){se.error("Please select a file to upload");return}try{C(0),await l.mutateAsync({file:B,metadata:{name:R,description:F||void 0,visibility:M},onProgress:C}),se.success(`Dataset "${R}" created successfully!`),b(!1),Ue()}catch(oe){const Je=oe;se.error((Je==null?void 0:Je.detail)||"Failed to upload dataset")}}else if(T==="workbook"){if(!Y||!V){se.error("Please select a workbook and sheet");return}try{await f.mutateAsync({workbookId:Y,data:{sheet_id:V,name:R,description:F||void 0,visibility:M.toUpperCase(),include_header:!0}}),se.success(`Dataset "${R}" created from workbook!`),b(!1),Ue(),a()}catch(oe){const Je=oe;se.error((Je==null?void 0:Je.detail)||"Failed to convert workbook to dataset")}}else{if(k.length===0){se.error("Please select at least one table");return}const oe=k.reduce((Je,ut)=>Je+ut.tableIds.length,0);if(oe===0){se.error("Please select at least one table");return}try{let Je=0;const ut=[];for(const Q of k)for(const he of Q.tableIds){const ve=oe===1?R:`${R} - ${he}`;try{await d.mutateAsync({connector_id:Q.databaseId,table_name:he,name:ve,description:F||void 0,visibility:M}),Je++}catch(xe){const Ce=xe;ut.push(`${he}: ${(Ce==null?void 0:Ce.detail)||"Failed"}`)}}Je>0&&se.success(Je===1?`Dataset "${R}" created successfully!`:`${Je} datasets created successfully!`),ut.length>0&&se.error(`Failed to create ${ut.length} dataset(s):
838${ut.join(`
839`)}`),Je>0&&(b(!1),Ue())}catch(Je){const ut=Je;se.error((ut==null?void 0:ut.detail)||"Failed to create datasets from connector")}}},Ue=()=>{O(""),z(""),$("private"),P("file"),I("source"),D([]),H(null),C(0),ee(null),K(null)}
839,Ze=async oe=>{try{await c.mutateAsync(oe.id),se.success(`Dataset "${oe.name}" deleted successfully`)}catch(Je){const ut=Je;se.error((ut==null?void 0:ut.detail)||"Failed to delete dataset")}},fe=async oe=>{try{await u.mutateAsync({id:oe.id,format:oe.file_type,fileName:oe.file_name}),se.success(`Downloading ${oe.file_name}...`)}catch(Je){const ut=Je;se.error((ut==null?void 0:ut.detail)||"Failed to download dataset")}},Oe=oe=>s.jsxs(Z,{className:"hover:shadow-lg transition-all hover:-translate-y-1",children:[s.jsx(we,{children:s.jsx("div",{className:"flex items-start justify-between gap-2",children:s.jsxs("div",{className:"flex items-center space-x-2 min-w-0 flex-1",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx("span",{className:"text-xs font-bold text-primary",children:YS(oe.file_type)})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx(Ne,{className:"text-base truncate",title:oe.name,children:oe.name}),s.jsx(it,{className:"text-xs truncate",children:oe.file_name})]})]})})}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Size"}),s.jsx("p",{className:"font-medium",children:KS(oe.file_size)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Rows"}),s.jsx("p",{className:"font-medium",children:oe.row_count.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Columns"}),s.jsx("p",{className:"font-medium",children:oe.column_count})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Created"}),s.jsx("p",{className:"font-medium",children:GS(oe.created_at)})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(U,{size:"sm",variant:"outline",className:"flex-1",onClick:()=>e(`/dashboard/datasets/${oe.id}`),children:[s.jsx(ui,{className:"mr-2 h-3 w-3"}),"View"]}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsx(U,{size:"sm",variant:"ghost",children:"•••"})}),s.jsxs(Xr,{children:[s.jsxs(Xe,{onClick:()=>fe(oe),children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),"Download"]}),s.jsxs(Ic,{children:[s.jsx(b0,{asChild:!0,children:s.jsxs(Xe,{onSelect:Je=>Je.preventDefault(),className:"text-destructive",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Delete"]})}),s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:"Delete Dataset"}),s.jsxs(ll,{children:['Are you sure you want to delete "',oe.name,'"? This action cannot be undone.']})]}),s.jsxs(il,{children:[s.jsx(ul,{children:"Cancel"}),s.jsx(cl,{onClick:()=>Ze(oe),className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})]})]})]})]})]})]},oe.id),Et=oe=>s.jsxs("div",{className:"flex items-center justify-between p-4 hover:bg-accent/50 transition-colors gap-4",children:[s.jsxs("div",{className:"flex items-center space-x-4 min-w-0 flex-1",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center flex-shrink-0",children:s.jsx("span",{className:"text-xs font-bold text-primary",children:YS(oe.file_type)})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("h3",{className:"font-medium text-foreground truncate",title:oe.name,children:oe.name}),s.jsxs("p",{className:"text-sm text-muted-foreground truncate",children:[oe.row_count.toLocaleString()," rows • ",oe.column_count," columns •"," ",KS(oe.file_size)]})]})]}),s.jsxs("div",{className:"flex items-center space-x-4",children:[s.jsx("span",{className:"text-sm text-muted-foreground hidden sm:block",children:GS(oe.created_at)}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsx(U,{size:"sm",variant:"ghost",children:"•••"})}),s.jsxs(Xr,{children:[s.jsxs(Xe,{onClick:()=>e(`/dashboard/datasets/${oe.id}`),children:[s.jsx(ui,{className:"mr-2 h-4 w-4"}),"View"]}),s.jsxs(Xe,{onClick:()=>fe(oe),children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),"Download"]}),s.jsxs(Ic,{children:[s.jsx(b0,{asChild:!0,children:s.jsxs(Xe,{onSelect:Je=>Je.preventDefault(),className:"text-destructive",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Delete"]})}),s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:"Delete Dataset"}),s.jsxs(ll,{children:['Are you sure you want to delete "',oe.name,'"? This action cannot be undone.']})]}),s.jsxs(il,{children:[s.jsx(ul,{children:"Cancel"}),s.jsx(cl,{onClick:()=>Ze(oe),className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})]})]})]})]})]},oe.id);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Datasets"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your data sources and files"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(U,{variant:"outline",onClick:()=>a(),disabled:r,children:[s.jsx(Vn,{className:`mr-2 h-4 w-4 ${r?"animate-spin":""}`}),"Refresh"]}),s.jsxs(br,{open:w,onOpenChange:b,children:[s.jsx(l1,{asChild:!0,children:s.jsxs(U,{className:"bg-gradient-primary",children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"New Dataset"]})}),s.jsxs(or,{className:"sm:max-w-2xl",children:[s.jsxs(lr,{children:[s.jsx(cr,{children:"Create New Dataset"}),s.jsx(wr,{children:"Upload a file or connect to a database table from your connectors"})]}),s.jsxs(fo,{value:A,onValueChange:I,className:"w-full",children:[s.jsxs(ji,{className:"grid w-full grid-cols-3",children:[s.jsx(Rt,{value:"source",children:"Data Source"}),s.jsx(Rt,{value:"configure",children:"Configure"}),s.jsx(Rt,{value:"details",children:"Details"})]}),s.jsx(Ft,{value:"source",className:"space-y-4",children:s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsx(Z,{className:`curs
839or-pointer transition-all hover:border-primary ${T==="file"?"border-primary bg-primary/5":""}`,onClick:()=>{P("file"),I("configure")},children:s.jsxs(le,{className:"p-6 text-center",children:[s.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center mx-auto mb-3",children:s.jsx(WR,{className:"h-6 w-6 text-primary"})}),s.jsx("h3",{className:"font-semibold text-foreground",children:"Upload File"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"CSV, Excel, JSON, XML, Parquet"}),T==="file"&&s.jsx("div",{className:"mt-2",children:s.jsx(bt,{className:"h-5 w-5 text-primary mx-auto"})})]})}),s.jsx(Z,{className:"cursor-pointer transition-all hover:border-primary border-border",onClick:()=>{b(!1),E(!0)},children:s.jsxs(le,{className:"p-6 text-center",children:[s.jsx("div",{className:"h-12 w-12 rounded-full bg-accent/10 flex items-center justify-center mx-auto mb-3",children:s.jsx(wt,{className:"h-6 w-6 text-accent"})}),s.jsx("h3",{className:"font-semibold text-foreground",children:"From Database"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"4 modes: Simple, Visual, SQL, AI"}),s.jsxs("div",{className:"flex items-center justify-center gap-1 mt-2",children:[s.jsx(Ca,{className:"h-3 w-3 text-primary"}),s.jsx("span",{className:"text-xs text-primary font-medium",children:"AI-Assisted"})]})]})}),s.jsx(Z,{className:`cursor-pointer transition-all hover:border-primary ${T==="workbook"?"border-primary bg-primary/5":""}`,onClick:()=>{P("workbook"),I("configure")},children:s.jsxs(le,{className:"p-6 text-center",children:[s.jsx("div",{className:"h-12 w-12 rounded-full bg-green-500/10 flex items-center justify-center mx-auto mb-3",children:s.jsx(_s,{className:"h-6 w-6 text-green-500"})}),s.jsx("h3",{className:"font-semibold text-foreground",children:"From Workbook"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Use existing spreadsheet"}),T==="workbook"&&s.jsx("div",{className:"mt-2",children:s.jsx(bt,{className:"h-5 w-5 text-primary mx-auto"})})]})})]})}),s.jsx(Ft,{value:"configure",className:"space-y-4",children:T==="file"?s.jsxs("div",{className:`border-2 border-dashed rounded-lg p-12 text-center transition-colors ${j?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onDragEnter:ce,onDragLeave:ce,onDragOver:ce,onDrop:ye,children:[s.jsx("input",{ref:t,type:"file",className:"hidden",accept:".csv,.xlsx,.xls,.json,.xml,.parquet",onChange:Se}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-16 w-16 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(WR,{className:"h-8 w-8 text-primary"})})}),B?s.jsxs("div",{children:[s.jsx("p",{className:"text-lg font-medium text-foreground",children:B.name}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:KS(B.size)}),s.jsx(U,{variant:"outline",className:"mt-4",onClick:()=>{var oe;return(oe=t.current)==null?void 0:oe.click()},children:"Choose Different File"})]}):s.jsxs("div",{children:[s.jsxs("p",{className:"text-lg font-medium text-foreground",children:["Drop your file here or"," ",s.jsx("button",{className:"text-primary hover:underline cursor-pointer",onClick:()=>{var oe;return(oe=t.current)==null?void 0:oe.click()},children:"browse"})]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Supported formats: CSV, Excel, JSON, XML, Parquet (Max 50MB)"})]})]})]}):T==="workbook"?s.jsx("div",{className:"space-y-4",children:o?s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"}),s.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading workbooks..."})]}):W.length===0?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"text-center py-12 space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-16 w-16 rounded-full bg-muted flex items-center justify-center",children:s.jsx(_s,{className:"h-8 w-8 text-muted-foreground"})})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-lg font-medium text-foreground",children:"No workbooks yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create a workbook first to use it as a dataset source"})]}),s.jsxs(U,{variant:"outline",onClick:()=>{b(!1),e("/dashboard/workbooks")},children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"Go to Workbooks"]})]}),s.jsx("div",{className:"flex justify-start pt-4 border-t",children:s.jsxs(U,{variant:"ghost",onClick:()=>I("source"),children:[s.jsx(Wu,{className:"h-4 w-4 mr-2"}),"Back"]})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx(pe,{className:"text-sm font-medium",children:"Select Workbook"}),s.jsx(Ba,{className:"h-[200px] mt-2 border rounded-md p-2",children:s.jsx(J2,{value:Y||"",onValueChange:oe=>{ee(oe),K(null);const Je=W.find(ut=>ut.id===oe);Je&&!R&&O(Je.name)},children:W.map(oe=>s.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg cursor-pointer border-2 transition-all ${Y===oe.id?"border-primary bg-primary/5":"border-transparent hover:border-muted-foreground
839/30 hover:bg-muted/50"}`,onClick:()=>{ee(oe.id),K(null),R||O(oe.name)},children:[s.jsx(Z2,{value:oe.id,id:oe.id}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-foreground truncate",children:oe.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[oe.sheet_count," sheet",oe.sheet_count!==1?"s":""," • ",GS(oe.last_edited_at)]})]}),s.jsx("div",{className:"h-8 w-8 rounded bg-green-500/10 flex items-center justify-center flex-shrink-0",children:s.jsx(_s,{className:"h-4 w-4 text-green-500"})})]},oe.id))})})]}),Y&&J.length>0&&s.jsxs("div",{children:[s.jsx(pe,{className:"text-sm font-medium",children:"Select Sheet"}),s.jsx(Ba,{className:"h-[150px] mt-2 border rounded-md p-2",children:s.jsx(J2,{value:V||"",onValueChange:oe=>{K(oe);const Je=J.find(ut=>ut.id===oe);Je&&q&&O(`${q.name} - ${Je.name}`)},children:J.map(oe=>s.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg cursor-pointer border-2 transition-all ${V===oe.id?"border-primary bg-primary/5":"border-transparent hover:border-muted-foreground/30 hover:bg-muted/50"}`,onClick:()=>{K(oe.id),q&&O(`${q.name} - ${oe.name}`)},children:[s.jsx(Z2,{value:oe.id,id:oe.id}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"font-medium text-foreground",children:oe.name}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[oe.row_count," rows • ",oe.column_count," columns"]})]}),s.jsx(xr,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"})]},oe.id))})})]}),s.jsxs("div",{className:"flex justify-between pt-4 border-t",children:[s.jsxs(U,{variant:"ghost",onClick:()=>I("source"),children:[s.jsx(Wu,{className:"h-4 w-4 mr-2"}),"Back"]}),Y&&V&&s.jsx(U,{onClick:()=>I("details"),className:"bg-gradient-primary",children:"Continue"})]})]})}):s.jsx("div",{className:"max-h-[400px] overflow-y-auto",children:s.jsx(Vge,{onSelectionChange:D})})}),s.jsx(Ft,{value:"details",className:"space-y-6",children:s.jsxs("div",{className:"space-y-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"dataset-name",className:"text-sm font-medium",children:"Dataset Name"}),s.jsx(Re,{id:"dataset-name",placeholder:"Enter dataset name",value:R,onChange:oe=>O(oe.target.value),className:"h-11"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"description",className:"text-sm font-medium",children:"Description (Optional)"}),s.jsx(Re,{id:"description",placeholder:"Add a description",value:F,onChange:oe=>z(oe.target.value),className:"h-11"})]}),T==="file"&&l.isPending&&s.jsxs("div",{className:"space-y-2 p-4 rounded-lg bg-muted/50",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(pe,{className:"text-sm",children:"Uploading..."}),s.jsxs("span",{className:"text-sm font-medium text-primary",children:[S,"%"]})]}),s.jsx(_u,{value:S,className:"h-2"})]}),T==="connector"&&d.isPending&&s.jsxs("div",{className:"flex items-center justify-center gap-3 py-4 px-4 rounded-lg bg-muted/50",children:[s.jsx(Te,{className:"h-5 w-5 animate-spin text-primary"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Creating datasets from selected tables..."})]}),T==="workbook"&&f.isPending&&s.jsxs("div",{className:"flex items-center justify-center gap-3 py-4 px-4 rounded-lg bg-muted/50",children:[s.jsx(Te,{className:"h-5 w-5 animate-spin text-primary"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Converting workbook to dataset..."})]}),s.jsxs("div",{className:"flex justify-between items-center pt-4 border-t",children:[s.jsxs(U,{variant:"ghost",onClick:()=>I("configure"),children:[s.jsx(Wu,{className:"h-4 w-4 mr-2"}),"Back"]}),s.jsx(U,{onClick:Ie,disabled:l.isPending||d.isPending||f.isPending||!R.trim(),className:"bg-gradient-primary min-w-[140px]",children:l.isPending||d.isPending||f.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),T==="file"?"Uploading...":T==="workbook"?"Converting...":"Creating..."]}):s.jsxs(s.Fragment,{children:[s.jsx(bt,{className:"mr-2 h-4 w-4"}),"Create Dataset"]})})]})]})})]})]})]})]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(ii,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search datasets...",className:"pl-9",value:p,onChange:oe=>g(oe.target.value)})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsxs(U,{variant:"outline",children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),y==="all"?"All Types":YS(y)]})}),s.jsxs(Xr,{children:[s.jsx(Xe,{onClick:()=>v("all"),children:"All Types"}),s.jsx(Xe,{onClick:()=>v("csv"),children:"CSV"}),s.jsx(Xe,{onClick:()=>v("xlsx"),children:"Excel"}),s.jsx(Xe,{onClick:()=>v("json"),children:"JSON"}),s.jsx(Xe,{onClick:()=>v("xml"),children:"XML"}),s.jsx(Xe,{onClick:()=>v("parquet"),children:"Parquet"})]})]}),s.jsxs("div",{className:"flex border border-border rounded-lg",children:[s.jsx(U,{variant:h==="grid"?"secondary":"ghost",size:"icon",onClick:()=>m("grid"),children:s.jsx(gm,{className:"h-4 w-4"})}),s.jsx(U,{variant:h==="list"?"secondary":"ghost",size:"icon",onClick:()=>m("list"),children:s.jsx(el,{className:"h-4 w-4"})})]})]})]}),r?s.jsxs("div",{className:"flex justify-center items-center py-12",children:[s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"}),s.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading datasets..."})]}):X.length===0?s.jsx(Z,{className:"p-12",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-24 w-24 rounded-full bg-muted flex items-center justify-center",children:s.jsx(Ln,{className:"h-12 w-12 text-muted-foreground"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"No datasets found"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:p?"Try adjusting your search":"Upload your first dataset to get started"})]}),s.jsxs(U,{onClick:()=>b(!0),className:"bg-gradient-primary",children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"Upload Your First Dataset"]})]})}):h==="grid"?s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:X.map(Oe)}):s.jsx(Z,{children:s.jsx("div",{className:"divide-y divide-border",children:X.map(Et)})}),s.jsx(uK,{open:_,onOpenChange:E,onSuccess:()=>a(),onBack:()=>{E(!1),b(!0)}})]})},ONe=e=>{if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(1))+" "+n[r]},TNe=e=>
839e.toLocaleString(),MNe=()=>{var b;const{id:e}=iv(),t=cn(),[n,r]=x.useState(!1),{data:a,isLoading:i,error:o,refetch:l}=gpe(e),{data:c,isLoading:u}=Wk(e,{limit:5}),d=p7();if(i)return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(U,{variant:"ghost",onClick:()=>t("/dashboard/datasets"),children:[s.jsx(Yr,{className:"mr-2 h-4 w-4"}),"Back to Datasets"]}),s.jsxs(Z,{className:"p-12 text-center",children:[s.jsx(Te,{className:"h-8 w-8 animate-spin mx-auto text-muted-foreground"}),s.jsx("p",{className:"text-muted-foreground mt-4",children:"Loading dataset..."})]})]});if(o||!a)return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(U,{variant:"ghost",onClick:()=>t("/dashboard/datasets"),children:[s.jsx(Yr,{className:"mr-2 h-4 w-4"}),"Back to Datasets"]}),s.jsxs(Z,{className:"p-12 text-center",children:[s.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Dataset not found"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"The dataset you're looking for doesn't exist."})]})]});const f=async()=>{try{await d.mutateAsync(a.id),se.success(`Dataset "${a.name}" deleted successfully`),t("/dashboard/datasets")}catch{se.error("Failed to delete dataset")}},h=()=>{se.success(`Downloading ${a.file_name}...`)},m=()=>{se.success("Share link copied to clipboard!")},p=j=>j?{csv:"CSV",xlsx:"Excel",xls:"Excel",json:"JSON",xml:"XML",parquet:"Parquet"}[j.toLowerCase()]||j.toUpperCase():"Database",g=((b=c==null?void 0:c.columns)==null?void 0:b.map(j=>j.name))||(a.columns?Object.keys(a.columns):[]),y=(c==null?void 0:c.data)||[],v=(a==null?void 0:a.source_type)==="connector",w=()=>{l()};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>t("/dashboard/datasets"),className:"flex-shrink-0",children:s.jsx(Yr,{className:"h-5 w-5"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("h1",{className:"text-3xl font-bold text-foreground truncate",title:a.name,children:a.name})}),s.jsx("p",{className:"text-muted-foreground mt-1 truncate",children:a.file_name})]})]}),s.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[s.jsxs(U,{className:"bg-gradient-primary",size:"sm",onClick:()=>t(`/dashboard/reports/new?dataset=${a.id}`),children:[s.jsx(Xn,{className:"mr-2 h-4 w-4"}),"Create Report"]}),v&&s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>r(!0),children:[s.jsx(YP,{className:"mr-2 h-4 w-4"}),"Edit"]}),s.jsxs(U,{variant:"outline",size:"sm",onClick:m,children:[s.jsx(ZB,{className:"mr-2 h-4 w-4"}),"Share"]}),s.jsxs(U,{variant:"outline",size:"sm",onClick:h,children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),"Download"]}),s.jsxs(Ic,{children:[s.jsx(b0,{asChild:!0,children:s.jsxs(U,{variant:"destructive",size:"sm",disabled:d.isPending,children:[d.isPending?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Delete"]})}),s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:"Delete Dataset"}),s.jsxs(ll,{children:['Are you sure you want to delete "',a.name,'"? This action cannot be undone and all associated reports will lose access to this data.']})]}),s.jsxs(il,{children:[s.jsx(ul,{children:"Cancel"}),s.jsx(cl,{onClick:f,className:"bg-destructive text-destructive-foreground",children:"Delete"})]})]})]})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Type"})}),s.jsx(le,{children:s.jsx("p",{className:"text-2xl font-bold",children:p(a.file_type)})})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Size"})}),s.jsx(le,{children:s.jsx("p",{className:"text-2xl font-bold",children:ONe(a.file_size)})})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Rows"})}),s.jsx(le,{children:s.jsx("p",{className:"text-2xl font-bold",children:TNe(a.row_count)})})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Columns"})}),s.jsx(le,{children:s.jsx("p",{className:"text-2xl font-bold",children:a.column_count})})]})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ne,{children:"Data Preview"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:u?"Loading...":`Showing first ${y.length} rows`})]})}),s.jsx(le,{children:u?s.jsx("div",{className:"flex items-center justify-center py-8",children:s.jsx(Te,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):y.length>0?s.jsx("div",{className:"rounded-md border overflow-x-auto",children:s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsx(Rr,{children:g.map(j=>s.jsx(jt,{children:j},j))})}),s.jsx(_l,{children:y.map((j,N)=>s.jsx(Rr,{children:g.map(S=>s.jsx(Nt,{children:j[S]!==null&&j[S]!==void 0?String(j[S]):""},S))},N))})]})}):s.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No preview data available"})})]}),v&&s.jsx(uK,{open:n,onOpenChange:r,mode:"edit",existingDataset:a,onSuccess:w})]})},RNe=()=>{const e=cn(),[t,n]=x.useState("grid"),[r,a]=x.useState(""),[i,o]=x.useState("all"),[l,c]=x.useState(null),{data:u,isLoading:d,error:f}=O7({search:r||void 0,status:i!=="all"?i:void 0}),h=g7(),m=qme(),p=Wme(),g=zk(),y=(u==null?void 0:u.items)||[],v=async()=>
839{if(l)try{await h.mutateAsync(l.id),sn({title:"Report deleted",description:`"${l.name}" has been deleted.`}),c(null)}catch{sn({title:"Error",description:"Failed to delete report. Please try again.",variant:"destructive"})}},w=async S=>{try{const C=await m.mutateAsync({id:S.id,newName:`${S.name} (Copy)`});sn({title:"Report duplicated",description:`Created "${C.name}".`})}catch{sn({title:"Error",description:"Failed to duplicate report. Please try again.",variant:"destructive"})}},b=async S=>{try{await p.mutateAsync(S.id),sn({title:"Report archived",description:`"${S.name}" has been archived.`})}catch{sn({title:"Error",description:"Failed to archive report. Please try again.",variant:"destructive"})}},j=async(S,C)=>{try{await g.mutateAsync({id:S.id,format:C}),sn({title:"Download started",description:`Downloading "${S.name}" as ${C.toUpperCase()}.`})}catch{sn({title:"Error",description:"Failed to download report. Please try again.",variant:"destructive"})}},N=S=>{const C=new Date(S),E=new Date().getTime()-C.getTime(),T=Math.floor(E/(1e3*60*60*24));return T===0?"Today":T===1?"Yesterday":T<7?`${T} days ago`:T<30?`${Math.floor(T/7)} weeks ago`:C.toLocaleDateString()};return f?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Reports"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Create and manage your data visualizations"})]}),s.jsx(Z,{className:"p-12",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-24 w-24 rounded-full bg-destructive/10 flex items-center justify-center",children:s.jsx(Xn,{className:"h-12 w-12 text-destructive"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Error loading reports"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Unable to load your reports. Please try again later."})]}),s.jsx(U,{onClick:()=>window.location.reload(),children:"Retry"})]})})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Reports"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Create and manage your data visualizations"})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>e("/dashboard/reports/new"),children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"Create Report"]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(ii,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search reports...",className:"pl-9",value:r,onChange:S=>a(S.target.value)})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsxs(U,{variant:"outline",children:[s.jsx(Va,{className:"mr-2 h-4 w-4"}),i==="all"?"Filter":i.charAt(0).toUpperCase()+i.slice(1)]})}),s.jsxs(Xr,{align:"end",children:[s.jsx(n1,{children:"Filter by Status"}),s.jsx(ha,{}),s.jsx(Xe,{onClick:()=>o("all"),children:"All Reports"}),s.jsx(Xe,{onClick:()=>o("published"),children:"Published"}),s.jsx(Xe,{onClick:()=>o("draft"),children:"Draft"}),s.jsx(Xe,{onClick:()=>o("archived"),children:"Archived"})]})]}),s.jsxs("div",{className:"flex border border-border rounded-lg",children:[s.jsx(U,{variant:t==="grid"?"secondary":"ghost",size:"icon",onClick:()=>n("grid"),children:s.jsx(gm,{className:"h-4 w-4"})}),s.jsx(U,{variant:t==="list"?"secondary":"ghost",size:"icon",onClick:()=>n("list"),children:s.jsx(el,{className:"h-4 w-4"})})]})]})]}),d?s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:[1,2,3].map(S=>s.jsxs(Z,{className:"animate-pulse",children:[s.jsx(we,{children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-muted"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"h-4 w-32 bg-muted rounded"}),s.jsx("div",{className:"h-3 w-24 bg-muted rounded"})]})]}),s.jsx("div",{className:"h-5 w-16 bg-muted rounded"})]})}),s.jsxs(le,{className:"space-y-4",children:[s.jsx("div",{className:"grid grid-cols-3 gap-4",children:[1,2,3].map(C=>s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"h-3 w-12 bg-muted rounded"}),s.jsx("div",{className:"h-4 w-8 bg-muted rounded"})]},C))}),s.jsx("div",{className:"h-8 w-full bg-muted rounded"})]})]},S))}):y.length>0?s.jsx("div",{className:t==="grid"?"grid gap-6 md:grid-cols-2 lg:grid-cols-3":"space-y-4",children:y.map(S=>s.jsxs(Z,{className:"hover:shadow-lg transition-all hover:-translate-y-1",children:[s.jsx(we,{children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-accent/10 flex items-center justify-center",children:s.jsx(Xn,{className:"h-5 w-5 text-accent"})}),s.jsxs("div",{children:[s.jsx(Ne,{className:"text-base",children:S.name}),s.jsx(it,{className:"text-xs",children:S.description||"No description"})]})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-8 w-8",children:s.jsx(fh,{className:"h-4 w-4"})})}),s.jsxs(Xr,{align:"end",children:[s.jsxs(Xe,{onClick:()=>e(`/dashboard/reports/${S.id}`),children:[s.jsx(ui,{className:"mr-2 h-4 w-4"}),"View"]}
839),s.jsxs(Xe,{onClick:()=>w(S),children:[s.jsx(Od,{className:"mr-2 h-4 w-4"}),"Duplicate"]}),s.jsx(ha,{}),s.jsxs(Xe,{onClick:()=>j(S,"pdf"),children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),"Download PDF"]}),s.jsxs(Xe,{onClick:()=>j(S,"xlsx"),children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),"Download Excel"]}),s.jsx(ha,{}),S.status!=="archived"&&s.jsxs(Xe,{onClick:()=>b(S),children:[s.jsx(dre,{className:"mr-2 h-4 w-4"}),"Archive"]}),s.jsxs(Xe,{onClick:()=>c(S),className:"text-destructive focus:text-destructive",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]})}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-3 gap-4 text-sm",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Views"}),s.jsx("p",{className:"font-medium",children:S.view_count||0})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Charts"}),s.jsx("p",{className:"font-medium",children:S.visualization_count||0})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-muted-foreground",children:"Created"}),s.jsx("p",{className:"font-medium text-xs",children:N(S.created_at)})]})]}),s.jsx(U,{size:"sm",variant:"outline",className:"w-full",onClick:()=>e(`/dashboard/reports/${S.id}`),children:"View Report"})]})]},S.id))}):s.jsx(Z,{className:"p-12",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-24 w-24 rounded-full bg-muted flex items-center justify-center",children:s.jsx(Xn,{className:"h-12 w-12 text-muted-foreground"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:r||i!=="all"?"No reports found":"No reports yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:r||i!=="all"?"Try adjusting your search or filter criteria":"Create your first report to visualize your data"})]}),!r&&i==="all"&&s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>e("/dashboard/reports/new"),children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"Create Your First Report"]})]})}),s.jsx(Ic,{open:!!l,onOpenChange:()=>c(null),children:s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:"Delete Report"}),s.jsxs(ll,{children:['Are you sure you want to delete "',l==null?void 0:l.name,'"? This action cannot be undone.']})]}),s.jsxs(il,{children:[s.jsx(ul,{children:"Cancel"}),s.jsx(cl,{onClick:v,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:h.isPending,children:h.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting..."]}):"Delete"})]})]})})]})},DNe=e=>e>=5?"default":e>=4?"secondary":"outline",$Ne=e=>`${Math.round(e*100)}%`;function INe({datasetId:e,onAddChart:t,onApplySmartReport:n,disabled:r=!1}){var w,b;const[a,i]=x.useState(null),[o,l]=x.useState(!1),c=xpe(),u=async()=>{if(e)try{const j=await c.mutateAsync(e),N=lue(j.blocks);n==null||n(N,j.report_title)}catch{se.error("Error al generar el reporte AI. Intenta de nuevo.")}},{data:d,isLoading:f,isError:h,error:m,refetch:p}=vpe(e);if(!e)return s.jsx(Z,{className:"border-dashed",children:s.jsxs(we,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{className:"h-5 w-5 text-primary"}),s.jsx(Ne,{className:"text-sm",children:"AI Suggestions"})]}),s.jsx(it,{className:"text-xs",children:"Select a dataset to get smart chart suggestions"})]})});if(f)return s.jsxs(Z,{children:[s.jsx(we,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{className:"h-5 w-5 text-primary animate-pulse"}),s.jsx(Ne,{className:"text-sm",children:"AI Suggestions"})]})}),s.jsx(le,{className:"pt-0",children:s.jsxs("div",{className:"flex flex-col items-center justify-center py-6 text-center",children:[s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary mb-2"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Analyzing your data..."}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Finding patterns and insights"})]})})]});if(h)return s.jsxs(Z,{className:"border-destructive/50",children:[s.jsx(we,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Yn,{className:"h-5 w-5 text-destructive"}),s.jsx(Ne,{className:"text-sm",children:"Analysis Error"})]})}),s.jsxs(le,{className:"pt-0",children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:(m==null?void 0:m.message)||"Could not analyze the dataset"}),s.jsx(U,{variant:"outline",size:"sm",onClick:()=>p(),children:"Try Again"})]})]});if(!((w=d==null?void 0:d.suggestions)!=null&&w.length))return s.jsxs(Z,{children:[s.jsx(we,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{className:"h-5 w-5 text-primary"}),s.jsx(Ne,{className:"text-sm",children:"AI Suggestions"})]})}),s.jsx(le,{className:"pt-0",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:"No chart suggestions available for this dataset. Try uploading a dataset with more varied data."})})]});const{suggestions:g,data_summary:y,correlations:v}=d;return s.jsxs(Z,{children:[s.jsxs(we,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Ca,{className:"h-5 w-5 text-primary"}),s.jsx(Ne,{className:"text-sm",children:"AI Suggestions"})]}),s.jsxs($e,{variant:"secondary",className:"text-xs",children:[g.length," charts"]})]}),s.jsx(it,{className:"text-xs",children:"Based on your data structure"})]}),s.jsxs(le,{className:"pt-0 space-y-3",children:[n&&s.jsx(Z,{className:"border-dashed border-2 border-primary/30 bg-primary/5",children:s.jsxs(le,{className:"p-4 text-center",children:[s.jsx(Ca,{className:"h-8 w-8 mx-auto mb-2 text-primary"}),s.jsx("h3",{className:"font-semibold text-sm mb-1",children:"Reporte Inteligente"}),s.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:"La IA analizará tus datos y generará un reporte ejecutivo completo con KPIs, gráficos, textos explicativos y filtros."}),s.jsx(U,{onClick:u,disabled:!e||c.isPending||r,className:"w-full",children:c.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"h-4 w-4 mr-2 animate-spin"}),"Generando reporte..."]}):s.jsxs(s.Fragment,{children:[s.jsx(zre,{className:"h-4 w-4 mr-2"}),"Generar Reporte AI"]})})]})}),s.jsxs(xh,{open:o,onOpenChange:l,children:[s.jsx(bh,{asChild:!0,children:s.jsxs(U,{variant:"ghost",size:"sm",className:"w-full justify-between p-2 h-auto",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx(Wa,{className:"h-3 w-3"}),s.jsx("span",{children:"Data Summary"})]}),o?s.jsx(Zi,{className:"h-3 w-3"}):s.jsx(Jr,{className:"h-3 w-3"})]})}),s.jsx(wh,{children:s.jsxs("div",{className:"rounded-md bg-muted/50 p-2 mt-1 space-y-1 text-xs",children:[s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Rows:"}),s.jsx("span",{className:"font-medium",children:y.row_count.toLocaleStr
839ing()})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Columns:"}),s.jsx("span",{className:"font-medium",children:y.column_count})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Numeric:"}),s.jsx("span",{className:"font-medium",children:y.numeric_columns.length})]}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"Categorical:"}),s.jsx("span",{className:"font-medium",children:y.categorical_columns.length})]}),((b=y.id_columns)==null?void 0:b.length)>0&&s.jsxs("div",{className:"flex justify-between",children:[s.jsx("span",{className:"text-muted-foreground",children:"ID columns:"}),s.jsxs("span",{className:"font-medium text-orange-500",title:y.id_columns.join(", "),children:[y.id_columns.length," excluded"]})]}),v.length>0&&s.jsx("div",{className:"pt-1 border-t border-border mt-1",children:s.jsxs("span",{className:"text-muted-foreground",children:[v.length," correlation",v.length>1?"s":""," found"]})})]})})]}),s.jsx("div",{className:"space-y-2",children:g.map((j,N)=>s.jsxs("div",{className:"rounded-lg border bg-card p-3 space-y-2 hover:border-primary/50 transition-colors",children:[s.jsxs("div",{className:"flex items-start justify-between gap-2",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx($e,{variant:DNe(j.priority),className:"text-xs",children:j.chart_type}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[$Ne(j.confidence)," match"]})]}),s.jsx("h4",{className:"text-sm font-medium truncate",children:j.title}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:j.description})]}),s.jsxs(U,{size:"sm",variant:"outline",className:"shrink-0",onClick:()=>t(j),disabled:r,children:[s.jsx(Ln,{className:"h-3 w-3 mr-1"}),"Add"]})]}),j.insight&&s.jsxs(xh,{open:a===`${j.chart_type}-${N}`,onOpenChange:S=>i(S?`${j.chart_type}-${N}`:null),children:[s.jsx(bh,{asChild:!0,children:s.jsxs(U,{variant:"ghost",size:"sm",className:"w-full justify-start p-1.5 h-auto text-xs text-primary hover:text-primary",children:[s.jsx(kj,{className:"h-3 w-3 mr-1.5"}),s.jsx("span",{children:"View Insight"}),a===`${j.chart_type}-${N}`?s.jsx(Zi,{className:"h-3 w-3 ml-auto"}):s.jsx(Jr,{className:"h-3 w-3 ml-auto"})]})}),s.jsx(wh,{children:s.jsx("div",{className:"rounded-md bg-primary/5 border border-primary/10 p-2 mt-1",children:s.jsx("p",{className:"text-xs text-foreground leading-relaxed",children:j.insight})})})]})]},`${j.chart_type}-${j.config.x_column}-${N}`))}),g.length>1&&s.jsxs(U,{variant:"default",size:"sm",className:"w-full bg-gradient-primary",onClick:()=>g.forEach(j=>t(j)),disabled:r,children:[s.jsx(Ca,{className:"h-4 w-4 mr-2"}),"Add All ",g.length," Charts"]})]})]})}const LNe=({reportId:e})=>{const[t,n]=x.useState(""),[r,a]=x.useState("view"),{data:i,isLoading:o}=ype(e),l=Hme(e),c=Kme(e),u=Gme(e),d=()=>{t.trim()&&l.mutate({email:t.trim(),permission:r},{onSuccess:()=>{se.success("Collaborator invited successfully"),n(""),a("view")},onError:p=>{var y,v;const g=((v=(y=p==null?void 0:p.response)==null?void 0:y.data)==null?void 0:v.detail)||"Failed to invite collaborator";se.error(g)}})},f=(p,g)=>{c.mutate({userId:p,data:{permission:g}},{onSuccess:()=>se.success("Permission updated"),onError:()=>se.error("Failed to update permission")})},h=(p,g)=>{u.mutate(p,{onSuccess:()=>se.success(`${g} removed`),onError:()=>se.error("Failed to remove collaborator")})},m=(i==null?void 0:i.collaborators)||[];return s.jsxs(Z,{children:[s.jsxs(we,{className:"pb-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tl,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(Ne,{className:"text-base",children:"Share Report"})]}),s.jsx(it,{children:"Invite collaborators to view or edit"})]}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Re,{type:"email",placeholder:"Email address",value:t,onChange:p=>n(p.target.value),onKeyDown:p=>p.key==="Enter"&&d(),className:"flex-1 h-9 text-sm"}),s.jsxs(rt,{value:r,onValueChange:p=>a(p),children:[s.jsx(tt,{className:"w-[90px] h-9",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"view",children:"View"}),s.jsx(_e,{value:"edit",children:"Edit"})]})]}),s.jsx(U,{size:"sm",onClick:d,disabled:!t.trim()||l.isPending,className:"h-9",children:s.jsx(Fre,{className:"h-4 w-4"})})]}),o?s.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading..."}):m.length===0?s.jsx("p",{className:"text-xs text-muted-foreground",children:"No collaborators yet"}):s.jsx("div",{className:"space-y-2",children:m.map(p=>s.jsxs("div",{className:"flex items-center justify-between gap-2 py-1.5 px-2 rounded-md bg-muted/50",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(Uc,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:p.full_name||p.username}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:p.email})]})]}),s.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[s.jsxs(rt,{value:p.permission,onValueChange:g=>f(p.user_id,g),children:[s.jsx(tt,{className:"h-7 w-[75px] text-xs",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"view",children:s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(ui,{className:"h-3 w-3"})," View"]})}),s.jsx(_e,{value:"edit",children:s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(U_,{className:"h-3 w-3"})," Edit"]})})]})]}),s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>h(p.user_id,p.username),disabled:u.isPending,children:s.jsx(pn,{className:"h-3.5 w-3.5 text-destructive"})})]})]}
839,p.user_id))}),m.length>0&&s.jsx("div",{className:"flex items-center gap-1 pt-1",children:s.jsxs($e,{variant:"secondary",className:"text-xs",children:[m.length," collaborator",m.length!==1?"s":""]})})]})]})},TI=[{type:"bar",name:"Bar Chart",description:"Compare values across categories",icon:Xn,category:"basic"},{type:"line",name:"Line Chart",description:"Show trends over time",icon:FB,category:"basic"},{type:"pie",name:"Pie Chart",description:"Show proportions of a whole",icon:F_,category:"basic"},{type:"area",name:"Area Chart",description:"Visualize cumulative totals",icon:I_,category:"basic"},{type:"stacked-bar",name:"Stacked Bar",description:"Compare parts within categories",icon:Mg,category:"comparison"},{type:"combo",name:"Combo Chart",description:"Combine bars and lines",icon:ai,category:"comparison",isNew:!0},{type:"donut",name:"Donut Chart",description:"Pie chart with center space",icon:F_,category:"composition"},{type:"stacked-area",name:"Stacked Area",description:"Show composition over time",icon:Mg,category:"composition"},{type:"treemap",name:"Treemap",description:"Hierarchical data visualization",icon:gm,category:"composition",isPro:!0},{type:"scatter",name:"Scatter Plot",description:"Show correlation between variables",icon:B_,category:"distribution"},{type:"bubble",name:"Bubble Chart",description:"Scatter with size dimension",icon:zB,category:"distribution"},{type:"histogram",name:"Histogram",description:"Show data distribution",icon:L_,category:"distribution"},{type:"kpi",name:"KPI Card",description:"Display key metric",icon:nd,category:"kpi"},{type:"radial",name:"Gauge",description:"Progress toward goal",icon:WB,category:"kpi"},{type:"table",name:"Data Table",description:"Tabular data view",icon:xr,category:"kpi"},{type:"radar",name:"Radar Chart",description:"Compare multiple dimensions",icon:ZP,category:"advanced",isPro:!0},{type:"funnel",name:"Funnel Chart",description:"Show stages in a process",icon:Wa,category:"advanced",isPro:!0}],FNe=["bar","line","pie","area"],MI={basic:{name:"Basic",description:"Essential charts for everyday analytics"},comparison:{name:"Comparison",description:"Compare values across dimensions"},composition:{name:"Composition",description:"Show parts of a whole"},distribution:{name:"Distribution",description:"Analyze data distribution"},kpi:{name:"KPI & Metrics",description:"Key performance indicators"},advanced:{name:"Advanced",description:"Complex visualizations"}};function BNe({onSelectChart:e,disabled:t=!1}){const[n,r]=x.useState(!1),[a,i]=x.useState("basic"),o=u=>{e(u),r(!1)},l=TI.reduce((u,d)=>(u[d.category]||(u[d.category]=[]),u[d.category].push(d),u),{}),c=TI.filter(u=>FNe.includes(u.type));return s.jsx("div",{className:"space-y-5",children:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-muted-foreground",children:[s.jsx(Xn,{className:"h-4 w-4"}),"Charts"]}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:c.map(u=>{const d=u.icon;return s.jsxs(U,{variant:"outline",className:"h-auto py-3 flex flex-col gap-1.5 items-center hover:border-primary hover:bg-primary/5 transition-all",onClick:()=>o(u.type),disabled:t,children:[s.jsx(d,{className:te("h-5 w-5",u.type==="bar"&&"text-primary",u.type==="line"&&"text-blue-500",u.type==="pie"&&"text-green-500",u.type==="area"&&"text-purple-500")}),s.jsx("span",{className:"text-xs",children:u.name.split(" ")[0]})]},u.type)})}),s.jsxs(br,{open:n,onOpenChange:r,children:[s.jsx(l1,{asChild:!0,children:s.jsxs(U,{variant:"ghost",className:"w-full text-sm text-muted-foreground hover:text-foreground",disabled:t,children:[s.jsx(fh,{className:"h-4 w-4 mr-2"}),"More chart types..."]})}),s.jsxs(or,{className:"max-w-3xl max-h-[85vh]",children:[s.jsxs(lr,{children:[s.jsxs(cr,{className:"flex items-center gap-2",children:[s.jsx(Xn,{className:"h-5 w-5 text-primary"}),"Choose Visualization"]}),s.jsx(wr,{children:"Select the best chart type to visualize your data insights"})]}),s.jsxs(fo,{value:a,onValueChange:i,className:"w-full",children:[s.jsx(ji,{className:"w-full justify-start flex-wrap h-auto gap-1 bg-transparent p-0 mb-4",children:Object.entries(MI).map(([u,d])=>s.jsx(Rt,{value:u,className:"data-[state=active]:bg-primary data-[state=active]:text-primary-foreground rounded-full px-4 py-1.5 text-sm",children:d.name},u))}),s.jsx(Ba,{className:"h-[450px] pr-4",children:Object.entries(l).map(([u,d])=>{var f;return s.jsxs(Ft,{value:u,className:"mt-0",children:[s.jsx("div",{className:"mb-3",children:s.jsx("p",{className:"text-sm text-muted-foreground",children:(f=MI[u])==null?void 0:f.description})}),s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:d.map(h=>{const m=h.icon;return s.jsxs("button",{className:te("group relative p-4 rounded-lg border-2 text-left transition-all","hover:border-primary hover:bg-primary/5","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2"),onClick:()=>o(h.type),children:[s.jsxs("div",{className:"absolute top-2 right-2 flex gap-1",children:[h.isNew&&s.jsx($e,{variant:"default",className:"text-[10px] px-1.5 py-0 bg-green-500",children:"NEW"}),h.isPro&&s.jsx($e,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:"PRO"})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("div",{className:te("w-10 h-10 rounded-lg flex items-center justify-center","bg-muted group-hover:bg-primary/10 transition-colors"),children:s.jsx(m,{className:te("h-5 w-5 text-muted-foreground","group-hover:text-primary transition-colors")})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-medium text-sm",children:h.name}),s.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2",children:h.description})]})]})]},h.type)})})]},u)})})]})]})]})]})})}const RI={"heading-1":vre,"heading-2":xre,"heading-3":bre,paragraph:R_,"bullet-list":el,"numbered-list":KB,quote:XB,callout:Yn,divider:Rg,metric:nd},zNe={info:{icon:ym,label:"Info",color:"bg-blue-50 border-blue-200 text-blue-700"}
839,warning:{icon:ad,label:"Warning",color:"bg-amber-50 border-amber-200 text-amber-700"},success:{icon:_j,label:"Success",color:"bg-green-50 border-green-200 text-green-700"},error:{icon:Ej,label:"Error",color:"bg-red-50 border-red-200 text-red-700"}};function UNe({block:e,onUpdate:t,onCancel:n,onSave:r,isNew:a=!1}){var p,g;const i=x.useMemo(()=>({...e,style:e.style||p0,listItems:e.listItems||[]}),[e]),o=y=>{t({...i,...y})},l=y=>{t({...i,style:{...i.style,...y}})},c=()=>{const y=[...i.listItems||[],""];o({listItems:y})},u=(y,v)=>{const w=[...i.listItems||[]];w[y]=v,o({listItems:w})},d=y=>{const v=(i.listItems||[]).filter((w,b)=>b!==y);o({listItems:v})},f=v2.find(y=>y.type===i.type),h=RI[i.type]||R_,m=()=>{switch(i.type){case"divider":return s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(Rg,{className:"h-8 w-8 mx-auto mb-2"}),s.jsx("p",{className:"text-sm",children:"Divider has no content to edit"})]});case"bullet-list":case"numbered-list":return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(pe,{className:"flex items-center gap-2",children:[i.type==="bullet-list"?s.jsx(el,{className:"h-4 w-4"}):s.jsx(KB,{className:"h-4 w-4"}),"List Items"]}),s.jsx("div",{className:"space-y-2",children:(i.listItems||[]).map((y,v)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"flex-shrink-0 w-6 h-9 flex items-center justify-center text-muted-foreground text-sm",children:i.type==="bullet-list"?"•":`${v+1}.`}),s.jsx(Re,{value:y,onChange:w=>u(v,w.target.value),placeholder:`Item ${v+1}`,className:"flex-1"}),s.jsx(U,{variant:"ghost",size:"icon",className:"h-9 w-9 text-destructive",onClick:()=>d(v),children:s.jsx(pn,{className:"h-4 w-4"})})]},v))}),s.jsxs(U,{variant:"outline",size:"sm",onClick:c,className:"w-full",children:[s.jsx(Ln,{className:"h-4 w-4 mr-2"}),"Add Item"]})]});case"metric":return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{htmlFor:"metric-value",className:"flex items-center gap-2",children:[s.jsx(nd,{className:"h-4 w-4"}),"Metric Value"]}),s.jsx(Re,{id:"metric-value",value:i.metricValue||"",onChange:y=>o({metricValue:y.target.value}),placeholder:"1,234",className:"text-2xl font-bold"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"metric-label",children:"Label"}),s.jsx(Re,{id:"metric-label",value:i.metricLabel||"",onChange:y=>o({metricLabel:y.target.value}),placeholder:"Total Sales"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"metric-trend",children:"Trend"}),s.jsxs(rt,{value:i.metricTrend||"neutral",onValueChange:y=>o({metricTrend:y}),children:[s.jsx(tt,{id:"metric-trend",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"up",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Wa,{className:"h-4 w-4 text-green-500"}),"Up"]})}),s.jsx(_e,{value:"down",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(ek,{className:"h-4 w-4 text-red-500"}),"Down"]})}),s.jsx(_e,{value:"neutral",children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Rg,{className:"h-4 w-4 text-muted-foreground"}),"Neutral"]})})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"metric-change",children:"Change %"}),s.jsx(Re,{id:"metric-change",value:i.metricChange||"",onChange:y=>o({metricChange:y.target.value}),placeholder:"+12.5%"})]})]})]});case"callout":return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Callout Type"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(zNe).map(([y,v])=>{var b;const w=v.icon;return s.jsxs(U,{variant:((b=i.style)==null?void 0:b.calloutVariant)===y?"default":"outline",size:"sm",className:"justify-start",onClick:()=>l({calloutVariant:y}),children:[s.jsx(w,{className:"h-4 w-4 mr-2"}),v.label]},y)})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"callout-content",children:"Content"}),s.jsx(Aa,{id:"callout-content",value:i.content,onChange:y=>o({content:y.target.value}),placeholder:"Enter callout content...",rows:3})]})]});default:return s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{htmlFor:"block-content",className:"flex items-center gap-2",children:[s.jsx(sd,{className:"h-4 w-4"}),"Content"]}),i.type==="paragraph"||i.type==="quote"?s.jsx(Aa,{id:"block-content",value:i.content,onChange:y=>o({content:y.target.value}),placeholder:"Enter text...",rows:4}):s.jsx(Re,{id:"block-content",value:i.content,onChange:y=>o({content:y.target.value}),placeholder:"Enter text...",className:te(i.type==="heading-1"&&"text-2xl font-bold",i.type==="heading-2"&&"text-xl font-semibold",i.type==="heading-3"&&"text-lg font-medium")})]})}};return s.jsxs(Z,{className:"w-full max-w-md border-2",children:[s.jsx(we,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ne,{className:"text-lg",children:a?"New Text Block":"Edit Text Block"}),s.jsxs($e,{variant:"outline",className:"font-normal",children:[s.jsx(h,{className:"h-3 w-3 mr-1"}),(f==null?void 0:f.name)||i.type]})]})}),s.jsxs(fo,{defaultValue:"content",className:"w-full",children:[s.jsx("div",{className:"px-6",children:s.jsxs(ji,{className:"grid w-full grid-cols-2",children:[s.jsx(Rt,{value:"content",children:"Content"}),s.jsx(Rt,{value:"style",children:"Style"})]})}),s.jsxs(le,{className:"pt-4",children:[s.jsxs(Ft,{value:"content",className:"mt-0 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Block Type"}
839),s.jsx("div",{className:"grid grid-cols-5 gap-1",children:v2.map(y=>{const v=RI[y.type];return s.jsxs(U,{variant:i.type===y.type?"default":"outline",size:"sm",className:"h-auto py-2 px-2 flex flex-col gap-1",onClick:()=>o({type:y.type}),title:y.description,children:[s.jsx(v,{className:"h-4 w-4"}),s.jsx("span",{className:"text-[9px] leading-tight",children:y.name.split(" ")[0]})]},y.type)})})]}),s.jsx(Kr,{}),m()]}),s.jsxs(Ft,{value:"style",className:"mt-0 space-y-4",children:[!["divider","bullet-list","numbered-list","metric"].includes(i.type)&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Text Alignment"}),s.jsx("div",{className:"flex gap-2",children:["left","center","right"].map(y=>{var w;const v=y==="left"?R_:y==="center"?cre:ure;return s.jsx(U,{variant:((w=i.style)==null?void 0:w.alignment)===y?"default":"outline",size:"sm",onClick:()=>l({alignment:y}),children:s.jsx(v,{className:"h-4 w-4"})},y)})})]}),["paragraph","quote"].includes(i.type)&&s.jsxs(s.Fragment,{children:[s.jsx(Kr,{}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"font-size",children:"Font Size"}),s.jsxs(rt,{value:((p=i.style)==null?void 0:p.fontSize)||"base",onValueChange:y=>l({fontSize:y}),children:[s.jsx(tt,{id:"font-size",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"sm",children:"Small"}),s.jsx(_e,{value:"base",children:"Normal"}),s.jsx(_e,{value:"lg",children:"Large"}),s.jsx(_e,{value:"xl",children:"Extra Large"})]})]})]})]}),!["divider"].includes(i.type)&&s.jsxs(s.Fragment,{children:[s.jsx(Kr,{}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"font-weight",children:"Font Weight"}),s.jsxs(rt,{value:((g=i.style)==null?void 0:g.fontWeight)||"normal",onValueChange:y=>l({fontWeight:y}),children:[s.jsx(tt,{id:"font-weight",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"normal",children:"Normal"}),s.jsx(_e,{value:"medium",children:"Medium"}),s.jsx(_e,{value:"semibold",children:"Semibold"}),s.jsx(_e,{value:"bold",children:"Bold"})]})]})]})]})]})]})]}),s.jsxs("div",{className:"flex justify-end gap-2 px-6 pb-6",children:[s.jsx(U,{variant:"outline",onClick:n,children:"Cancel"}),s.jsx(U,{onClick:r,children:a?"Add Block":"Save Changes"})]})]})}const VNe={info:{icon:ym,classes:"bg-blue-50 border-blue-200 text-blue-800 dark:bg-blue-950 dark:border-blue-800 dark:text-blue-200"},warning:{icon:ad,classes:"bg-amber-50 border-amber-200 text-amber-800 dark:bg-amber-950 dark:border-amber-800 dark:text-amber-200"},success:{icon:_j,classes:"bg-green-50 border-green-200 text-green-800 dark:bg-green-950 dark:border-green-800 dark:text-green-200"},error:{icon:Ej,classes:"bg-red-50 border-red-200 text-red-800 dark:bg-red-950 dark:border-red-800 dark:text-red-200"}},WNe={sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl"},qNe={normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},HNe={left:"text-left",center:"text-center",right:"text-right"};function rg({block:e,className:t,isPreview:n=!1}){const r=e.style||{},a=HNe[r.alignment||"left"],i=WNe[r.fontSize||"base"],o=qNe[r.fontWeight||"normal"];switch(e.type){case"heading-1":return s.jsx("h1",{className:te("text-3xl font-bold text-foreground leading-tight",a,t),children:e.content||"Heading 1"});case"heading-2":return s.jsx("h2",{className:te("text-2xl font-semibold text-foreground leading-tight",a,t),children:e.content||"Heading 2"});case"heading-3":return s.jsx("h3",{className:te("text-xl font-medium text-foreground leading-tight",a,t),children:e.content||"Heading 3"});case"paragraph":return s.jsx("p",{className:te("text-foreground leading-relaxed whitespace-pre-wrap",i,o,a,t),children:e.content||"Enter your text here..."});case"quote":return s.jsxs("blockquote",{className:te("border-l-4 border-primary pl-4 py-2 italic text-muted-foreground",i,a,t),children:[s.jsx(XB,{className:"h-4 w-4 mb-2 text-primary/50"}),e.content||"Quote text..."]});case"callout":const l=r.calloutVariant||"info",c=VNe[l],u=c.icon;return s.jsxs("div",{className:te("flex gap-3 p-4 rounded-lg border",c.classes,t),children:[s.jsx(u,{className:"h-5 w-5 flex-shrink-0 mt-0.5"}),s.jsx("div",{className:te("flex-1",i,o),children:e.content||"Callout content..."})]});case"divider":return s.jsx("hr",{className:te("border-t border-border my-4",t)});case"metric":const d=e.metricTrend==="up"?"text-green-600":e.metricTrend==="down"?"text-red-600":"text-blue-600",f=e.metricTrend==="up"?"bg-gradient-to-br from-green-50 to-emerald-50 border-l-4 border-l-green-500 dark:from-green-950/30 dark:to-emerald-950/30":e.metricTrend==="down"?"bg-gradient-to-br from-red-50 to-rose-50 border-l-4 border-l-red-500 dark:from-red-950/30 dark:to-rose-950/30":"bg-gradient-to-br from-blue-50 to-indigo-50 border-l-4 border-l-blue-500 dark:from-blue-950/30 dark:to-indigo-950/30",h=e.metricTrend==="up"?Wa:e.metricTrend==="down"?ek:Rg;return s.jsxs("div",{className:te("text-center py-4 px-2 rounded-md -m-4",f,t),children:[s.jsx("p",{className:"text-sm text-muted-foreground mb-1 font-medium",children:e.metricLabel||"Metric"}),s.jsx("p",{className:te("text-3xl font-bold",d),children:e.metricValue||"0"}),e.metricChange&&s.jsxs("div",{className:te("flex items-center justify-center gap-1 mt-2",d),children:[s.jsx(h,{className:"h-4 w-4"}),s.jsx("span",{className:"text-sm font-medium",children:e.metricChange})]})]});case"bullet-list":return s.jsxs("ul",{className:te("list-disc list-inside space-y-1",i,t),children:[(e.listItems||[]).map((m,p)=>s.jsx("li",{className:"text-foreground",children:m},p)),(!e.listItems||e.listItems.length===0)&&s.jsx("li",{className:"text-muted-foreground italic",children:"No items"})]});case"numbered-list":return s.jsxs("ol",{className:te("list-decimal list-inside space-y-1",i,t),children:[(e.listItems||[]).map((m,p)=>s.jsx("li",{className:"text-foreground",children:m},p)),(!e.listItems||e.listItems.length===0)&&s.jsx("li",{className:"text-muted-foreground italic",children:"No items"})]});default:return s.jsxs("div",{className:te("text-muted-foreground",t),children:["Unknown block type: ",e.type]})}}function KNe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>r=>{t.forEach(a=>a(r))},t)}const O1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Am(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function LO(e){return"nodeType"in e}function xa(e){var t,n;return e?Am(e)?e:LO(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function FO(e){const{Document:t}=xa(e);return e instanceof t}function kv(e){return Am(e)?!1:e instanceof xa(e).HTMLElement}function CK(e){return e instanceof xa(e).SVGElement}function Pm(e){return e?Am(e)?e.document:LO(e)?FO(e)?e:kv(e)||CK(e)?e.ownerDocument:document:document:document}const mi=O1?x.useLayoutEffect:x.useEffect;function T1(e){const t=x.useRef(e);return mi(()=>{t.current=e}),x.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function GNe(){const e=x.useRef(null),t=x.useCallback((r,a)=>{e.current=setInterval(r,a)},[]),n=x.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}
839function ry(e,t){t===void 0&&(t=[e]);const n=x.useRef(e);return mi(()=>{n.current!==e&&(n.current=e)},t),n}function Ov(e,t){const n=x.useRef();return x.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function L0(e){const t=T1(e),n=x.useRef(null),r=x.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,r]}function F0(e){const t=x.useRef();return x.useEffect(()=>{t.current=e},[e]),t.current}let XS={};function Tv(e,t){return x.useMemo(()=>{if(t)return t;const n=XS[e]==null?0:XS[e]+1;return XS[e]=n,e+"-"+n},[e,t])}function _K(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((i,o)=>{const l=Object.entries(o);for(const[c,u]of l){const d=i[c];d!=null&&(i[c]=d+e*u)}return i},{...t})}}const zf=_K(1),ay=_K(-1);function YNe(e){return"clientX"in e&&"clientY"in e}function M1(e){if(!e)return!1;const{KeyboardEvent:t}=xa(e.target);return t&&e instanceof t}function XNe(e){if(!e)return!1;const{TouchEvent:t}=xa(e.target);return t&&e instanceof t}function B0(e){if(XNe(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 YNe(e)?{x:e.clientX,y:e.clientY}:null}const ro=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[ro.Translate.toString(e),ro.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),DI="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function QNe(e){return e.matches(DI)?e:e.querySelector(DI)}const JNe={display:"none"};function ZNe(e){let{id:t,value:n}=e;return L.createElement("div",{id:t,style:JNe},n)}function eSe(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const a={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 L.createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":!0},n)}function tSe(){const[e,t]=x.useState("");return{announce:x.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const EK=x.createContext(null);function nSe(e){const t=x.useContext(EK);x.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function rSe(){const[e]=x.useState(()=>new Set),t=x.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[x.useCallback(r=>{let{type:a,event:i}=r;e.forEach(o=>{var l;return(l=o[a])==null?void 0:l.call(o,i)})},[e]),t]}const aSe={draggable:`
840    To pick up a draggable item, press the space bar.
841    While dragging, use the arrow keys to move the item.
842    Press space again to drop the item in its new position, or press escape to cancel.
843  `},sSe={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 iSe(e){let{announcements:t=sSe,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=aSe}=e;const{announce:i,announcement:o}=tSe(),l=Tv("DndLiveRegion"),[c,u]=x.useState(!1);if(x.useEffect(()=>{u(!0)},[]),nSe(x.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:m}=f;t.onDragMove&&i(t.onDragMove({active:h,over:m}))},onDragOver(f){let{active:h,over:m}=f;i(t.onDragOver({active:h,over:m}))},onDragEnd(f){let{active:h,over:m}=f;i(t.onDragEnd({active:h,over:m}))},onDragCancel(f){let{active:h,over:m}=f;
843i(t.onDragCancel({active:h,over:m}))}}),[i,t])),!c)return null;const d=L.createElement(L.Fragment,null,L.createElement(ZNe,{id:r,value:a.draggable}),L.createElement(eSe,{id:l,announcement:o}));return n?Cs.createPortal(d,n):d}var sr;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(sr||(sr={}));function z0(){}function $I(e,t){return x.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function oSe(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return x.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pi=Object.freeze({x:0,y:0});function AK(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function lSe(e,t){const n=B0(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function PK(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function cSe(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function II(e){let{left:t,top:n,height:r,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+r},{x:t+a,y:n+r}]}function kK(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function LI(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 uSe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=LI(t,t.left,t.top),i=[];for(const o of r){const{id:l}=o,c=n.get(l);if(c){const u=AK(LI(c),a);i.push({id:l,data:{droppableContainer:o,value:u}})}}return i.sort(PK)},dSe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=II(t),i=[];for(const o of r){const{id:l}=o,c=n.get(l);if(c){const u=II(c),d=a.reduce((h,m,p)=>h+AK(u[p],m),0),f=Number((d/4).toFixed(4));i.push({id:l,data:{droppableContainer:o,value:f}})}}return i.sort(PK)};function fSe(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=a-r,l=i-n;if(r<a&&n<i){const c=t.width*t.height,u=e.width*e.height,d=o*l,f=d/(c+u-d);return Number(f.toFixed(4))}return 0}const hSe=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const i of r){const{id:o}=i,l=n.get(o);if(l){const c=fSe(l,t);c>0&&a.push({id:o,data:{droppableContainer:i,value:c}})}}return a.sort(cSe)};function mSe(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function OK(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pi}function pSe(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];return a.reduce((o,l)=>({...o,top:o.top+e*l.y,bottom:o.bottom+e*l.y,left:o.left+e*l.x,right:o.right+e*l.x}),{...n})}}const gSe=pSe(1);function TK(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 ySe(e,t,n){const r=TK(t);if(!r)return e;const{scaleX:a,scaleY:i,x:o,y:l}=r,c=e.left-o-(1-a)*parseFloat(n),u=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=a?e.width/a:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:c+d,bottom:u+f,left:c}}const vSe={ignoreTransform:!1};function km(e,t){t===void 0&&(t=vSe);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=xa(e).getComputedStyle(e);u&&(n=ySe(n,u,d))}const{top:r,left:a,width:i,height:o,bottom:l,right:c}=n;return{top:r,left:a,width:i,height:o,bottom:l,right:c}}function FI(e){return km(e,{ignoreTransform:!0})}function xSe(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function bSe(e,t){return t===void 0&&(t=xa(e).getComputedStyle(e)),t.position==="fixed"}function wSe(e,t){t===void 0&&(t=xa(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const i=t[a];return typeof i=="string"?n.test(i):!1})}function R1(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(FO(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!kv(a)||CK(a)||n.includes(a))return n;const i=xa(e).getComputedStyle(a);return a!==e&&wSe(a,i)&&n.push(a),bSe(a,i)?n:r(a.parentNode)}return e?r(e):n}function MK(e){const[t]=R1(e,1);return t??null}function QS(e){return!O1||!e?null:Am(e)?e:LO(e)?FO(e)||e===Pm(e).scrollingElement?window:kv(e)?e:null:null}function RK(e){return Am(e)?e.scrollX:e.scrollLeft}function DK(e){return Am(e)?e.scrollY:e.scrollTop}function eE(e){return{x:RK(e),y:DK(e)}}var vr;
843(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(vr||(vr={}));function $K(e){return!O1||!e?!1:e===document.scrollingElement}function IK(e){const t={x:0,y:0},n=$K(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:a,isLeft:i,isBottom:o,isRight:l,maxScroll:r,minScroll:t}}const jSe={x:.2,y:.2};function NSe(e,t,n,r,a){let{top:i,left:o,right:l,bottom:c}=n;r===void 0&&(r=10),a===void 0&&(a=jSe);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=IK(e),m={x:0,y:0},p={x:0,y:0},g={height:t.height*a.y,width:t.width*a.x};return!u&&i<=t.top+g.height?(m.y=vr.Backward,p.y=r*Math.abs((t.top+g.height-i)/g.height)):!d&&c>=t.bottom-g.height&&(m.y=vr.Forward,p.y=r*Math.abs((t.bottom-g.height-c)/g.height)),!h&&l>=t.right-g.width?(m.x=vr.Forward,p.x=r*Math.abs((t.right-g.width-l)/g.width)):!f&&o<=t.left+g.width&&(m.x=vr.Backward,p.x=r*Math.abs((t.left+g.width-o)/g.width)),{direction:m,speed:p}}function SSe(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function LK(e){return e.reduce((t,n)=>zf(t,eE(n)),pi)}function CSe(e){return e.reduce((t,n)=>t+RK(n),0)}function _Se(e){return e.reduce((t,n)=>t+DK(n),0)}function FK(e,t){if(t===void 0&&(t=km),!e)return;const{top:n,left:r,bottom:a,right:i}=t(e);MK(e)&&(a<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ESe=[["x",["left","right"],CSe],["y",["top","bottom"],_Se]];class BO{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=R1(n),a=LK(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,l]of ESe)for(const c of o)Object.defineProperty(this,c,{get:()=>{const u=l(r),d=a[i]-u;return this.rect[c]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ag{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 a;(a=this.target)==null||a.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function ASe(e){const{EventTarget:t}=xa(e);return e instanceof t?e:Pm(e)}function JS(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 bs;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(bs||(bs={}));function BI(e){e.preventDefault()}function PSe(e){e.stopPropagation()}var _t;(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"})(_t||(_t={}));const BK={start:[_t.Space,_t.Enter],cancel:[_t.Esc],end:[_t.Space,_t.Enter,_t.Tab]},kSe=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case _t.Right:return{...n,x:n.x+25};case _t.Left:return{...n,x:n.x-25};case _t.Down:return{...n,y:n.y+25};case _t.Up:return{...n,y:n.y-25}}};class zO{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 ag(Pm(n)),this.windowListeners=new ag(xa(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(bs.Resize,this.handleCancel),this.windowListeners.add(bs.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(bs.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&FK(r),n(pi)}handleKeyDown(t){if(M1(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:i=BK,coordinateGetter:o=kSe,scrollBehavior:l="smooth"}
843=a,{code:c}=t;if(i.end.includes(c)){this.handleEnd(t);return}if(i.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:pi;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=ay(f,d),m={x:0,y:0},{scrollableAncestors:p}=r.current;for(const g of p){const y=t.code,{isTop:v,isRight:w,isLeft:b,isBottom:j,maxScroll:N,minScroll:S}=IK(g),C=SSe(g),_={x:Math.min(y===_t.Right?C.right-C.width/2:C.right,Math.max(y===_t.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(y===_t.Down?C.bottom-C.height/2:C.bottom,Math.max(y===_t.Down?C.top:C.top+C.height/2,f.y))},E=y===_t.Right&&!w||y===_t.Left&&!b,T=y===_t.Down&&!j||y===_t.Up&&!v;if(E&&_.x!==f.x){const P=g.scrollLeft+h.x,k=y===_t.Right&&P<=N.x||y===_t.Left&&P>=S.x;if(k&&!h.y){g.scrollTo({left:P,behavior:l});return}k?m.x=g.scrollLeft-P:m.x=y===_t.Right?g.scrollLeft-N.x:g.scrollLeft-S.x,m.x&&g.scrollBy({left:-m.x,behavior:l});break}else if(T&&_.y!==f.y){const P=g.scrollTop+h.y,k=y===_t.Down&&P<=N.y||y===_t.Up&&P>=S.y;if(k&&!h.x){g.scrollTo({top:P,behavior:l});return}k?m.y=g.scrollTop-P:m.y=y===_t.Down?g.scrollTop-N.y:g.scrollTop-S.y,m.y&&g.scrollBy({top:-m.y,behavior:l});break}}this.handleMove(t,zf(ay(f,this.referenceCoordinates),m))}}}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()}}zO.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=BK,onActivation:a}=t,{active:i}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function zI(e){return!!(e&&"distance"in e)}function UI(e){return!!(e&&"delay"in e)}class UO{constructor(t,n,r){var a;r===void 0&&(r=ASe(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:o}=i;this.props=t,this.events=n,this.document=Pm(o),this.documentListeners=new ag(this.document),this.listeners=new ag(r),this.windowListeners=new ag(xa(o)),this.initialCoordinates=(a=B0(i))!=null?a:pi,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(bs.Resize,this.handleCancel),this.windowListeners.add(bs.DragStart,BI),this.windowListeners.add(bs.VisibilityChange,this.handleCancel),this.windowListeners.add(bs.ContextMenu,BI),this.documentListeners.add(bs.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(UI(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(zI(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:a}=this.props;a(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(bs.Click,PSe,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(bs.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:a,props:i}=this,{onMove:o,options:{activationConstraint:l}}=i;if(!a)return;
843const c=(n=B0(t))!=null?n:pi,u=ay(a,c);if(!r&&l){if(zI(l)){if(l.tolerance!=null&&JS(u,l.tolerance))return this.handleCancel();if(JS(u,l.distance))return this.handleStart()}if(UI(l)&&JS(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),o(c)}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===_t.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const OSe={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class VO extends UO{constructor(t){const{event:n}=t,r=Pm(n.target);super(t,OSe,r)}}VO.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 tE;(function(e){e[e.RightClick=2]="RightClick"})(tE||(tE={}));class MSe extends UO{constructor(t){super(t,TSe,Pm(t.event.target))}}MSe.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===tE.RightClick?!1:(r==null||r({event:n}),!0)}}];const ZS={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class RSe extends UO{constructor(t){super(t,ZS)}static setup(){return window.addEventListener(ZS.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ZS.move.name,t)};function t(){}}}RSe.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return a.length>1?!1:(r==null||r({event:n}),!0)}}];var sg;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(sg||(sg={}));var U0;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(U0||(U0={}));function DSe(e){let{acceleration:t,activator:n=sg.Pointer,canScroll:r,draggingRect:a,enabled:i,interval:o=5,order:l=U0.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const m=ISe({delta:f,disabled:!i}),[p,g]=GNe(),y=x.useRef({x:0,y:0}),v=x.useRef({x:0,y:0}),w=x.useMemo(()=>{switch(n){case sg.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case sg.DraggableRect:return a}},[n,a,c]),b=x.useRef(null),j=x.useCallback(()=>{const S=b.current;if(!S)return;const C=y.current.x*v.current.x,_=y.current.y*v.current.y;S.scrollBy(C,_)},[]),N=x.useMemo(()=>l===U0.TreeOrder?[...u].reverse():u,[l,u]);x.useEffect(()=>{if(!i||!u.length||!w){g();return}for(const S of N){if((r==null?void 0:r(S))===!1)continue;const C=u.indexOf(S),_=d[C];if(!_)continue;const{direction:E,speed:T}=NSe(S,_,w,t,h);for(const P of["x","y"])m[P][E[P]]||(T[P]=0,E[P]=0);if(T.x>0||T.y>0){g(),b.current=S,p(j,o),y.current=T,v.current=E;return}}y.current={x:0,y:0},v.current={x:0,y:0},g()},[t,j,r,g,i,o,JSON.stringify(w),JSON.stringify(m),p,u,N,d,JSON.stringify(h)])}const $Se={x:{[vr.Backward]:!1,[vr.Forward]:!1},y:{[vr.Backward]:!1,[vr.Forward]:!1}};function ISe(e){let{delta:t,disabled:n}=e;const r=F0(t);return Ov(a=>{if(n||!r||!a)return $Se;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[vr.Backward]:a.x[vr.Backward]||i.x===-1,[vr.Forward]:a.x[vr.Forward]||i.x===1},y:{[vr.Backward]:a.y[vr.Backward]||i.y===-1,[vr.Forward]:a.y[vr.Forward]||i.y===1}}},[n,t,r])}function LSe(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Ov(a=>{var i;return t==null?null:(i=r??a)!=null?i:null},[r,t])}function FSe(e,t){return x.useMemo(()=>e.reduce((n,r)=>{const{sensor:a}=r,i=a.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...i]},[]),[e,t])}var sy;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(sy||(sy={}));var nE;(function(e){e.Optimized="optimized"})(nE||(nE={}));const VI=new Map;function BSe(e,t){let{dragging:n,dependencies:r,config:a}=t;const[i,o]=x.useState(null),{frequency:l,measure:c,strategy:u}=a,d=x.useRef(e),f=y(),h=ry(f),m=x.useCallback(function(v){v===void 0&&(v=[]),!h.current&&o(w=>w===null?v:w.concat(v.filter(b=>!w.includes(b))))},[h]),p=x.useRef(null),g=Ov(v=>{if(f&&!n)return VI;if(!v||v===VI||d.current!==e||i!=null){const w=new Map;for(let b of e){if(!b)continue;if(i&&i.length>0&&!i.includes(b.id)&&b.rect.current){w.set(b.id,b.rect.current);continue}const j=b.node.current,N=j?new BO(c(j),j):null;b.rect.current=N,N&&w.set(b.id,N)}return w}return v},[e,i,n,f,c]);return x.useEffect(()=>{d.current=e},[e]),x.useEffect(()=>{f||m()},[n,f]),x.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),x.useEffect(()=>{f||typeof l!="number"||p.current!==null||(p.current=setTimeout(()=>{m(),p.current=null},l))},[l,f,m,...r]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:i!=null};function y(){switch(u){case sy.Always:return!1;case sy.BeforeDragging:return n;default:return!n}}}function WO(e,t){return Ov(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function zSe(e,t){return WO(e,t)}function USe(e){let{callback:t,disabled:n}=e;const r=T1(t),a=x.useMemo(()=>
843{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return x.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function D1(e){let{callback:t,disabled:n}=e;const r=T1(t),a=x.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return x.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function VSe(e){return new BO(km(e),e)}function WI(e,t,n){t===void 0&&(t=VSe);const[r,a]=x.useState(null);function i(){a(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const d=t(e);return JSON.stringify(c)===JSON.stringify(d)?c:d})}const o=USe({callback(c){if(e)for(const u of c){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=D1({callback:i});return mi(()=>{i(),e?(l==null||l.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),o==null||o.disconnect())},[e]),r}function WSe(e){const t=WO(e);return OK(e,t)}const qI=[];function qSe(e){const t=x.useRef(e),n=Ov(r=>e?r&&r!==qI&&e&&t.current&&e.parentNode===t.current.parentNode?r:R1(e):qI,[e]);return x.useEffect(()=>{t.current=e},[e]),n}function HSe(e){const[t,n]=x.useState(null),r=x.useRef(e),a=x.useCallback(i=>{const o=QS(i.target);o&&n(l=>l?(l.set(o,eE(o)),new Map(l)):null)},[]);return x.useEffect(()=>{const i=r.current;if(e!==i){o(i);const l=e.map(c=>{const u=QS(c);return u?(u.addEventListener("scroll",a,{passive:!0}),[u,eE(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{o(e),o(i)};function o(l){l.forEach(c=>{const u=QS(c);u==null||u.removeEventListener("scroll",a)})}},[a,e]),x.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>zf(i,o),pi):LK(e):pi,[e,t])}
843function HI(e,t){t===void 0&&(t=[]);const n=x.useRef(null);return x.useEffect(()=>{n.current=null},t),x.useEffect(()=>{const r=e!==pi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ay(e,n.current):pi}function KSe(e){x.useEffect(()=>{if(!O1)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 GSe(e,t){return x.useMemo(()=>e.reduce((n,r)=>{let{eventName:a,handler:i}=r;return n[a]=o=>{i(o,t)},n},{}),[e,t])}function zK(e){return x.useMemo(()=>e?xSe(e):null,[e])}const KI=[];function YSe(e,t){t===void 0&&(t=km);const[n]=e,r=zK(n?xa(n):null),[a,i]=x.useState(KI);function o(){i(()=>e.length?e.map(c=>$K(c)?r:new BO(t(c),c)):KI)}const l=D1({callback:o});return mi(()=>{l==null||l.disconnect(),o(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),a}function UK(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return kv(t)?t:e}function XSe(e){let{measure:t}=e;const[n,r]=x.useState(null),a=x.useCallback(u=>{for(const{target:d}of u)if(kv(d)){r(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=D1({callback:a}),o=x.useCallback(u=>{const d=UK(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),r(d?t(d):null)},[t,i]),[l,c]=L0(o);return x.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const QSe=[{sensor:VO,options:{}},{sensor:zO,options:{}}],JSe={current:{}},Cb={draggable:{measure:FI},droppable:{measure:FI,strategy:sy.WhileDragging,frequency:nE.Optimized},dragOverlay:{measure:km}};class ig 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 ZSe={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ig,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:z0},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Cb,measureDroppableContainers:z0,windowRect:null,measuringScheduled:!1},VK={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:z0,draggableNodes:new Map,over:null,measureDroppableContainers:z0},Mv=x.createContext(VK),WK=x.createContext(ZSe);function eCe(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ig}}}function tCe(e,t){switch(t.type){case sr.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case sr.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case sr.DragEnd:case sr.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case sr.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new ig(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case sr.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new ig(e.droppable.containers);return o.set(n,{...i,disabled:a}),{...e,droppable:{...e.droppable,containers:o}}}case sr.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const i=new ig(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function nCe(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=x.useContext(Mv),i=F0(r),o=F0(n==null?void 0:n.id);return x.useEffect(()=>{if(!t&&!r&&i&&o!=null){if(!M1(i)||document.activeElement===i.target)return;const l=a.get(o);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[c.current,u.current]){if(!d)continue;const f=QNe(d);if(f){f.focus();break}}})}},[r,t,a,o,i]),null}function qK(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,i)=>i({transform:a,...r}),n):n}function rCe(e){return x.useMemo(()=>({draggable:{...Cb.draggable,...e==null?void 0:e.draggable},droppable:{...Cb.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Cb.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 aCe(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const i=x.useRef(!1),{x:o,y:l}=typeof a=="boolean"?{x:a,y:a}:a;mi(()=>
843{if(!o&&!l||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=OK(d,r);if(o||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=MK(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,o,l,r,n])}const $1=x.createContext({...pi,scaleX:1,scaleY:1});var Yl;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Yl||(Yl={}));const sCe=x.memo(function(t){var n,r,a,i;let{id:o,accessibility:l,autoScroll:c=!0,children:u,sensors:d=QSe,collisionDetection:f=hSe,measuring:h,modifiers:m,...p}=t;const g=x.useReducer(tCe,void 0,eCe),[y,v]=g,[w,b]=rSe(),[j,N]=x.useState(Yl.Uninitialized),S=j===Yl.Initialized,{draggable:{active:C,nodes:_,translate:E},droppable:{containers:T}}=y,P=C!=null?_.get(C):null,k=x.useRef({initial:null,translated:null}),D=x.useMemo(()=>{var yn;return C!=null?{id:C,data:(yn=P==null?void 0:P.data)!=null?yn:JSe,rect:k}:null},[C,P]),A=x.useRef(null),[I,M]=x.useState(null),[$,R]=x.useState(null),O=ry(p,Object.values(p)),F=Tv("DndDescribedBy",o),z=x.useMemo(()=>T.getEnabled(),[T]),B=rCe(h),{droppableRects:H,measureDroppableContainers:Y,measuringScheduled:ee}=BSe(z,{dragging:S,dependencies:[E.x,E.y],config:B.droppable}),V=LSe(_,C),K=x.useMemo(()=>$?B0($):null,[$]),W=au(),q=zSe(V,B.draggable.measure);aCe({activeNode:C!=null?_.get(C):null,config:W.layoutShiftCompensation,initialRect:q,measure:B.draggable.measure});const J=WI(V,B.draggable.measure,q),ie=WI(V?V.parentElement:null),X=x.useRef({activatorEvent:null,active:null,activeNode:V,collisionRect:null,collisions:null,droppableRects:H,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=T.getNodeFor((n=X.current.over)==null?void 0:n.id),Se=XSe({measure:B.dragOverlay.measure}),ce=(r=Se.nodeRef.current)!=null?r:V,ye=S?(a=Se.rect)!=null?a:J:null,Ie=!!(Se.nodeRef.current&&Se.rect),Ue=WSe(Ie?null:J),Ze=zK(ce?xa(ce):null),fe=qSe(S?ge??V:null),Oe=YSe(fe),Et=qK(m,{transform:{x:E.x-Ue.x,y:E.y-Ue.y,scaleX:1,scaleY:1},activatorEvent:$,active:D,activeNodeRect:J,containerNodeRect:ie,draggingNodeRect:ye,over:X.current.over,overlayNodeRect:Se.rect,scrollableAncestors:fe,scrollableAncestorRects:Oe,windowRect:Ze}),oe=K?zf(K,E):null,Je=HSe(fe),ut=HI(Je),Q=HI(Je,[J]),he=zf(Et,ut),ve=ye?gSe(ye,Et):null,xe=D&&ve?f({active:D,collisionRect:ve,droppableRects:H,droppableContainers:z,pointerCoordinates:oe}):null,Ce=kK(xe,"id"),[Be,$r]=x.useState(null),mr=Ie?Et:zf(Et,Q),At=mSe(mr,(i=Be==null?void 0:Be.rect)!=null?i:null,J),Pi=x.useRef(null),Ha=x.useCallback((yn,Zt)=>{let{sensor:er,options:Ve}=Zt;if(A.current==null)return;const lt=_.get(A.current);if(!lt)return;const ft=yn.nativeEvent,en=new er({active:A.current,activeNode:lt,event:ft,options:Ve,context:X,onAbort(zt){if(!_.get(zt))return;const{onDragAbort:tn}=O.current,Tn={id:zt};tn==null||tn(Tn),w({type:"onDragAbort",event:Tn})},onPending(zt,qn,tn,Tn){if(!_.get(zt))return;const{onDragPending:go}=O.current,Ka={id:zt,constraint:qn,initialCoordinates:tn,offset:Tn};go==null||go(Ka),w({type:"onDragPending",event:Ka})},onStart(zt){const qn=A.current;if(qn==null)return;const tn=_.get(qn);if(!tn)return;const{onDragStart:Tn}=O.current,fs={activatorEvent:ft,active:{id:qn,data:tn.data,rect:k}};Cs.unstable_batchedUpdates(()=>{Tn==null||Tn(fs),N(Yl.Initializing),v({type:sr.DragStart,initialCoordinates:zt,active:qn}),w({type:"onDragStart",event:fs}),M(Pi.current),R(ft)})},onMove(zt){v({type:sr.DragMove,coordinates:zt})},onEnd:On(sr.DragEnd),onCancel:On(sr.DragCancel)});Pi.current=en;function On(zt){return async function(){const{active:tn,collisions:Tn,over:fs,scrollAdjustedTranslate:go}=X.current;let Ka=null;if(tn&&go){const{cancelDrop:ki}=O.current;Ka={activatorEvent:ft,active:tn,collisions:Tn,delta:go,over:fs},zt===sr.DragEnd&&typeof ki=="function"&&await Promise.resolve(ki(Ka))&&(zt=sr.DragCancel)}A.current=null,Cs.unstable_batchedUpdates(()=>{v({type:zt}),N(Yl.Uninitialized),$r(null),M(null),R(null),Pi.current=null;
843const ki=zt===sr.DragEnd?"onDragEnd":"onDragCancel";if(Ka){const Dl=O.current[ki];Dl==null||Dl(Ka),w({type:ki,event:Ka})}})}}},[_]),ru=x.useCallback((yn,Zt)=>(er,Ve)=>{const lt=er.nativeEvent,ft=_.get(Ve);if(A.current!==null||!ft||lt.dndKit||lt.defaultPrevented)return;const en={active:ft};yn(er,Zt.options,en)===!0&&(lt.dndKit={capturedBy:Zt.sensor},A.current=Ve,Ha(er,Zt))},[_,Ha]),Tl=FSe(d,ru);KSe(d),mi(()=>{J&&j===Yl.Initializing&&N(Yl.Initialized)},[J,j]),x.useEffect(()=>{const{onDragMove:yn}=O.current,{active:Zt,activatorEvent:er,collisions:Ve,over:lt}=X.current;if(!Zt||!er)return;const ft={active:Zt,activatorEvent:er,collisions:Ve,delta:{x:he.x,y:he.y},over:lt};Cs.unstable_batchedUpdates(()=>{yn==null||yn(ft),w({type:"onDragMove",event:ft})})},[he.x,he.y]),x.useEffect(()=>{const{active:yn,activatorEvent:Zt,collisions:er,droppableContainers:Ve,scrollAdjustedTranslate:lt}=X.current;if(!yn||A.current==null||!Zt||!lt)return;const{onDragOver:ft}=O.current,en=Ve.get(Ce),On=en&&en.rect.current?{id:en.id,rect:en.rect.current,data:en.data,disabled:en.disabled}:null,zt={active:yn,activatorEvent:Zt,collisions:er,delta:{x:lt.x,y:lt.y},over:On};Cs.unstable_batchedUpdates(()=>{$r(On),ft==null||ft(zt),w({type:"onDragOver",event:zt})})},[Ce]),mi(()=>{X.current={activatorEvent:$,active:D,activeNode:V,collisionRect:ve,collisions:xe,droppableRects:H,draggableNodes:_,draggingNode:ce,draggingNodeRect:ye,droppableContainers:T,over:Be,scrollableAncestors:fe,scrollAdjustedTranslate:he},k.current={initial:ye,translated:ve}},[D,V,xe,ve,_,ce,ye,H,T,Be,fe,he]),DSe({...W,delta:E,draggingRect:ve,pointerCoordinates:oe,scrollableAncestors:fe,scrollableAncestorRects:Oe});const Ml=x.useMemo(()=>({active:D,activeNode:V,activeNodeRect:J,activatorEvent:$,collisions:xe,containerNodeRect:ie,dragOverlay:Se,draggableNodes:_,droppableContainers:T,droppableRects:H,over:Be,measureDroppableContainers:Y,scrollableAncestors:fe,scrollableAncestorRects:Oe,measuringConfiguration:B,measuringScheduled:ee,windowRect:Ze}),[D,V,J,$,xe,ie,Se,_,T,H,Be,Y,fe,Oe,B,ee,Ze]),Rl=x.useMemo(()=>({activatorEvent:$,activators:Tl,active:D,activeNodeRect:J,ariaDescribedById:{draggable:F},dispatch:v,draggableNodes:_,over:Be,measureDroppableContainers:Y}),[$,Tl,D,J,v,F,_,Be,Y]);return L.createElement(EK.Provider,{value:b},L.createElement(Mv.Provider,{value:Rl},L.createElement(WK.Provider,{value:Ml},L.createElement($1.Provider,{value:At},u)),L.createElement(nCe,{disabled:(l==null?void 0:l.restoreFocus)===!1})),L.createElement(iSe,{...l,hiddenTextDescribedById:F}));function au(){const yn=(I==null?void 0:I.autoScrollEnabled)===!1,Zt=typeof c=="object"?c.enabled===!1:c===!1,er=S&&!yn&&!Zt;return typeof c=="object"?{...c,enabled:er}:{enabled:er}}}),iCe=x.createContext(null),GI="button",oCe="Draggable";function lCe(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const i=Tv(oCe),{activators:o,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=x.useContext(Mv),{role:m=GI,roleDescription:p="draggable",tabIndex:g=0}=a??{},y=(c==null?void 0:c.id)===t,v=x.useContext(y?$1:iCe),[w,b]=L0(),[j,N]=L0(),S=GSe(o,t),C=ry(n);mi(()=>(f.set(t,{id:t,key:i,node:w,activatorNode:j,data:C}),()=>{const E=f.get(t);E&&E.key===i&&f.delete(t)}),[f,t]);const _=x.useMemo(()=>({role:m,tabIndex:g,"aria-disabled":r,"aria-pressed":y&&m===GI?!0:void 0,"aria-roledescription":p,"aria-describedby":d.draggable}),[r,m,g,y,p,d.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:_,isDragging:y,listeners:r?void 0:S,node:w,over:h,setNodeRef:b,setActivatorNodeRef:N,transform:v}}function HK(){return x.useContext(WK)}const cCe="Droppable",uCe={timeout:25};function dCe(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const i=Tv(cCe),{active:o,dispatch:l,over:c,measureDroppableContainers:u}=x.useContext(Mv),d=x.useRef({disabled:n}),f=x.useRef(!1),h=x.useRef(null),m=x.useRef(null),{disabled:p,updateMeasurementsFor:g,timeout:y}={...uCe,...a},v=ry(g??r),w=x.useCallback(()=>{if(!f.current){f.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{u(Array.isArray(v.current)?v.current:[v.current]),m.current=null},y)},[y]),b=D1({callback:w,disabled:p||!o}),j=x.useCallback((_,E)=>{b&&(E&&(b.unobserve(E),f.current=!1),_&&b.observe(_))},[b]),[N,S]=L0(j),C=ry(t);return x.useEffect(()=>{!b||!N.current||(b.disconnect(),f.current=!1,b.observe(N.current))},[N,b]),x.useEffect(()=>(l({type:sr.RegisterDroppable,element:{id:r,key:i,disabled:n,node:N,rect:h,data:C}}),()=>l({type:sr.UnregisterDroppable,key:i,id:r})),[r]),x.useEffect(()=>{n!==d.current.disabled&&(l({type:sr.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,l]),{active:o,rect:h,isOver:(c==null?void 0:c.id)===r,node:N,over:c,setNodeRef:S}}function fCe(e){let{animation:t,children:n}=e;const[r,a]=x.useState(null),[i,o]=x.useState(null),l=F0(n);return!n&&!r&&l&&a(l),mi(()=>
843{if(!i)return;const c=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(c==null||u==null){a(null);return}Promise.resolve(t(u,i)).then(()=>{a(null)})},[t,r,i]),L.createElement(L.Fragment,null,n,r?x.cloneElement(r,{ref:o}):null)}const hCe={x:0,y:0,scaleX:1,scaleY:1};function mCe(e){let{children:t}=e;return L.createElement(Mv.Provider,{value:VK},L.createElement($1.Provider,{value:hCe},t))}const pCe={position:"fixed",touchAction:"none"},gCe=e=>M1(e)?"transform 250ms ease":void 0,yCe=x.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:a,children:i,className:o,rect:l,style:c,transform:u,transition:d=gCe}=e;if(!l)return null;const f=a?u:{...u,scaleX:1,scaleY:1},h={...pCe,width:l.width,height:l.height,top:l.top,left:l.left,transform:ro.Transform.toString(f),transformOrigin:a&&r?lSe(r,l):void 0,transition:typeof d=="function"?d(r):d,...c};return L.createElement(n,{className:o,style:h,ref:t},i)}),vCe=e=>t=>{let{active:n,dragOverlay:r}=t;const a={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[l,c]of Object.entries(i.active))c!==void 0&&(a[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,c));if(i!=null&&i.dragOverlay)for(const[l,c]of Object.entries(i.dragOverlay))c!==void 0&&r.node.style.setProperty(l,c);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[c,u]of Object.entries(a))n.node.style.setProperty(c,u);o!=null&&o.active&&n.node.classList.remove(o.active)}},xCe=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ro.Transform.toString(t)},{transform:ro.Transform.toString(n)}]},bCe={duration:250,easing:"ease",keyframes:xCe,sideEffects:vCe({styles:{active:{opacity:"0"}}})};function wCe(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:a}=e;return T1((i,o)=>{if(t===null)return;const l=n.get(i);if(!l)return;const c=l.node.current;if(!c)return;const u=UK(o);if(!u)return;const{transform:d}=xa(o).getComputedStyle(o),f=TK(d);if(!f)return;const h=typeof t=="function"?t:jCe(t);return FK(c,a.draggable.measure),h({active:{id:i,data:l.data,node:c,rect:a.draggable.measure(c)},draggableNodes:n,dragOverlay:{node:o,rect:a.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:a,transform:f})})}function jCe(e){const{duration:t,easing:n,sideEffects:r,keyframes:a}={...bCe,...e};return i=>{let{active:o,dragOverlay:l,transform:c,...u}=i;if(!t)return;const d={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},f={scaleX:c.scaleX!==1?o.rect.width*c.scaleX/l.rect.width:1,scaleY:c.scaleY!==1?o.rect.height*c.scaleY/l.rect.height:1},h={x:c.x-d.x,y:c.y-d.y,...f},m=a({...u,active:o,dragOverlay:l,transform:{initial:c,final:h}}),[p]=m,g=m[m.length-1];if(JSON.stringify(p)===JSON.stringify(g))return;const y=r==null?void 0:r({active:o,dragOverlay:l,...u}),v=l.node.animate(m,{duration:t,easing:n,fill:"forwards"});return new Promise(w=>{v.onfinish=()=>{y==null||y(),w()}})}}let YI=0;function NCe(e){return x.useMemo(()=>{if(e!=null)return YI++,YI},[e])}const SCe=L.memo(e=>
843{let{adjustScale:t=!1,children:n,dropAnimation:r,style:a,transition:i,modifiers:o,wrapperElement:l="div",className:c,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:m,draggableNodes:p,droppableContainers:g,dragOverlay:y,over:v,measuringConfiguration:w,scrollableAncestors:b,scrollableAncestorRects:j,windowRect:N}=HK(),S=x.useContext($1),C=NCe(f==null?void 0:f.id),_=qK(o,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:m,draggingNodeRect:y.rect,over:v,overlayNodeRect:y.rect,scrollableAncestors:b,scrollableAncestorRects:j,transform:S,windowRect:N}),E=WO(h),T=wCe({config:r,draggableNodes:p,droppableContainers:g,measuringConfiguration:w}),P=E?y.setRef:void 0;return L.createElement(mCe,null,L.createElement(fCe,{animation:T},f&&C?L.createElement(yCe,{key:C,id:f.id,ref:P,as:l,activatorEvent:d,adjustScale:t,className:c,transition:i,rect:E,style:{zIndex:u,...a},transform:_},n):null))});function qO(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function CCe(e,t){return e.reduce((n,r,a)=>{const i=t.get(r);return i&&(n[a]=i),n},Array(e.length))}function Ix(e){return e!==null&&e>=0}function _Ce(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 ECe(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const HO=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const i=qO(t,r,n),o=t[a],l=i[a];return!l||!o?null:{x:l.left-o.left,y:l.top-o.top,scaleX:l.width/o.width,scaleY:l.height/o.height}},KK="Sortable",GK=L.createContext({activeIndex:-1,containerId:KK,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:HO,disabled:{draggable:!1,droppable:!1}});function ACe(e){let{children:t,id:n,items:r,strategy:a=HO,disabled:i=!1}=e;const{active:o,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:d}=HK(),f=Tv(KK,n),h=l.rect!==null,m=x.useMemo(()=>r.map(S=>typeof S=="object"&&"id"in S?S.id:S),[r]),p=o!=null,g=o?m.indexOf(o.id):-1,y=u?m.indexOf(u.id):-1,v=x.useRef(m),w=!_Ce(m,v.current),b=y!==-1&&g===-1||w,j=ECe(i);mi(()=>{w&&p&&d(m)},[w,m,p,d]),x.useEffect(()=>{v.current=m},[m]);const N=x.useMemo(()=>({activeIndex:g,containerId:f,disabled:j,disableTransforms:b,items:m,overIndex:y,useDragOverlay:h,sortedRects:CCe(m,c),strategy:a}),[g,f,j.draggable,j.droppable,b,m,y,c,h,a]);return L.createElement(GK.Provider,{value:N},t)}const PCe=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return qO(n,r,a).indexOf(t)},kCe=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:a,items:i,newIndex:o,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==i&&a===o?!1:n?!0:o!==a&&t===c},OCe={duration:200,easing:"ease"},YK="transform",TCe=ro.Transition.toString({property:YK,duration:0,easing:"linear"}),MCe={roleDescription:"sortable"};function RCe(e){let{disabled:t,index:n,node:r,rect:a}=e;const[i,o]=x.useState(null),l=x.useRef(n);return mi(()=>{if(!t&&n!==l.current&&r.current){const c=a.current;if(c){const u=km(r.current,{ignoreTransform:!0}),d={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(d.x||d.y)&&o(d)}}n!==l.current&&(l.current=n)},[t,n,r,a]),x.useEffect(()=>{i&&o(null)},[i]),i}function KO(e){let{animateLayoutChanges:t=kCe,attributes:n,disabled:r,data:a,getNewIndex:i=PCe,id:o,strategy:l,resizeObserverConfig:c,transition:u=OCe}=e;const{items:d,containerId:f,activeIndex:h,disabled:m,disableTransforms:p,sortedRects:g,overIndex:y,useDragOverlay:v,strategy:w}=x.useContext(GK),b=DCe(r,m),j=d.indexOf(o),N=x.useMemo(()=>({sortable:{containerId:f,index:j,items:d},...a}),[f,a,j,d]),S=x.useMemo(()=>d.slice(d.indexOf(o)),[d,o]),{rect:C,node:_,isOver:E,setNodeRef:T}=dCe({id:o,data:N,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:P,activatorEvent:k,activeNodeRect:D,attributes:A,setNodeRef:I,listeners:M,isDragging:$,over:R,setActivatorNodeRef:O,transform:F}=lCe({id:o,data:N,attributes:{...MCe,...n},disabled:b.draggable}),z=KNe(T,I),B=!!P,H=B&&!p&&Ix(h)&&Ix(y),Y=!v&&$,ee=Y&&H?F:null,K=H?ee??(l??w)({rects:g,activeNodeRect:D,activeIndex:h,overIndex:y,index:j}):null,W=Ix(h)&&Ix(y)?i({id:o,items:d,activeIndex:h,overIndex:y}):j,q=P==null?void 0:P.id,J=x.useRef({activeId:q,items:d,newIndex:W,containerId:f}),ie=d!==J.current.items,X=t({active:P,containerId:f,isDragging:$,
843isSorting:B,id:o,index:j,items:d,newIndex:J.current.newIndex,previousItems:J.current.items,previousContainerId:J.current.containerId,transition:u,wasDragging:J.current.activeId!=null}),ge=RCe({disabled:!X,index:j,node:_,rect:C});return x.useEffect(()=>{B&&J.current.newIndex!==W&&(J.current.newIndex=W),f!==J.current.containerId&&(J.current.containerId=f),d!==J.current.items&&(J.current.items=d)},[B,W,f,d]),x.useEffect(()=>{if(q===J.current.activeId)return;if(q!=null&&J.current.activeId==null){J.current.activeId=q;return}const ce=setTimeout(()=>{J.current.activeId=q},50);return()=>clearTimeout(ce)},[q]),{active:P,activeIndex:h,attributes:A,data:N,rect:C,index:j,newIndex:W,items:d,isOver:E,isSorting:B,isDragging:$,listeners:M,node:_,overIndex:y,over:R,setNodeRef:z,setActivatorNodeRef:O,setDroppableNodeRef:T,setDraggableNodeRef:I,transform:ge??K,transition:Se()};function Se(){if(ge||ie&&J.current.newIndex===j)return TCe;if(!(Y&&!M1(k)||!u)&&(B||X))return ro.Transition.toString({...u,property:YK})}}function DCe(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}}function V0(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const $Ce=[_t.Down,_t.Right,_t.Up,_t.Left],ICe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:a,droppableContainers:i,over:o,scrollableAncestors:l}}=t;if($Ce.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];i.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=a.get(f.id);if(h)switch(e.code){case _t.Down:r.top<h.top&&c.push(f);break;case _t.Up:r.top>h.top&&c.push(f);break;case _t.Left:r.left>h.left&&c.push(f);break;case _t.Right:r.left<h.left&&c.push(f);break}});const u=dSe({active:n,collisionRect:r,droppableRects:a,droppableContainers:c,pointerCoordinates:null});let d=kK(u,"id");if(d===(o==null?void 0:o.id)&&u.length>1&&(d=u[1].id),d!=null){const f=i.get(n.id),h=i.get(d),m=h?a.get(h.id):null,p=h==null?void 0:h.node.current;if(p&&m&&f&&h){const y=R1(p).some((S,C)=>l[C]!==S),v=XK(f,h),w=LCe(f,h),b=y||!v?{x:0,y:0}:{x:w?r.width-m.width:0,y:w?r.height-m.height:0},j={x:m.left,y:m.top};return b.x&&b.y?j:ay(j,b)}}}};function XK(e,t){return!V0(e)||!V0(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function LCe(e,t){return!V0(e)||!V0(t)||!XK(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function GO({position:e,onResize:t,canExpand:n,canShrink:r,disabled:a}){const[i,o]=x.useState(!1),l=x.useRef(0),c=u=>{if(a)return;u.preventDefault(),u.stopPropagation(),o(!0),l.current=u.clientX;const d=h=>{const m=h.clientX-l.current,p=50;e==="right"?m>p&&n?(t("expand"),l.current=h.clientX):m<-p&&r&&(t("shrink"),l.current=h.clientX):m<-p&&n?(t("expand"),l.current=h.clientX):m>p&&r&&(t("shrink"),l.current=h.clientX)},f=()=>{o(!1),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",f)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",f)};return a||!n&&!r?null:s.jsx("div",{className:te("absolute top-0 bottom-0 w-2 cursor-ew-resize z-10","opacity-0 group-hover:opacity-100 transition-opacity","hover:bg-primary/20",i&&"opacity-100 bg-primary/30",e==="left"?"-left-1":"-right-1"),onMouseDown:c,children:s.jsx("div",{className:te("absolute top-1/2 -translate-y-1/2 w-1 h-8 rounded-full","bg-primary/40",e==="left"?"left-0":"right-0")})})}function FCe({block:e}){var h;const t=Oo(e),n=Li(e),r=n?e.slicerType:e.type,a=((h=e.layout)==null?void 0:h.colSpan)||Ea(r).colSpan,i=()=>{var p,g,y;if(t){const v=e,w={"heading-1":"Heading 1","heading-2":"Heading 2","heading-3":"Heading 3",paragraph:"Paragraph","bullet-list":"Bullet List","numbered-list":"Numbered List",quote:"Quote",callout:"Callout",divider:"Divider",metric:"Metric"};return{title:((p=v.content)==null?void 0:p.slice(0,30))||w[v.type]||"Text Block",subtitle:w[v.type]||"Text",icon:s.jsx(sd,{className:"h-5 w-5"}),color:"text-muted-foreground",bgColor:"bg-muted/50"}}if(n){const v=e,w={"date-range":"Date Range",dropdown:"Dropdown","multi-select":"Multi-Select",list:"List","numeric-range":"Numeric Range"};return{title:v.title||"Filter",subtitle:w[v.slicerType]||"Filter",icon:s.jsx(Va,{className:"h-5 w-5"}),color:"text-primary",bgColor:"bg-primary/10"}}const m=e;return{title:m.title||"Chart",subtitle:((g=m.type)==null?void 0:g.charAt(0).toUpperCase())+((y=m.type)==null?void 0:y.slice(1))||"Chart",icon:s.jsx(Xn,{className:"h-5 w-5"}),color:"text-primary",bgColor:"bg-primary/10"}},{title:o,subtitle:l,icon:c,color:u,bgColor:d}=i(),f={3:"w-[180px]",4:"w-[220px]",6:"w-[280px]",12:"w-[350px]"}[a]||"w-[280px]";return s.jsx("div",{className:te(f,"pointer-events-none"),children:s.jsx(Z,{className:"shadow-2xl border-2 border-primary bg-background/95 backdrop-blur-sm",children:s.jsx(le,{className:"p-4",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:te("flex items-center justify-center w-10 h-10 rounded-lg shrink-0",d,u),children:c}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:"font-medium text-sm truncate text-foreground",children:o}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:l})]}
843),s.jsx(nv,{className:"h-4 w-4 text-muted-foreground/50 shrink-0"})]})})})})}const BCe=["paragraph","heading-1","heading-2","heading-3"];function zCe({block:e,onEdit:t,onDelete:n,onDuplicate:r,onCopy:a,onResize:i,renderContent:o,disabled:l,isDragging:c,isOver:u,isSelected:d,onSelect:f,inlineEditing:h,onInlineTextChange:m,onInlineEditEnd:p,onStartInlineEdit:g}){var R;const y=x.useRef(null),v=BCe.includes(e.type);x.useEffect(()=>{h&&y.current&&(y.current.focus(),y.current.style.height="auto",y.current.style.height=y.current.scrollHeight+"px")},[h]);const{attributes:w,listeners:b,setNodeRef:j,transform:N,transition:S,isDragging:C,isOver:_}=KO({id:e.id,disabled:l}),E={transform:ro.Translate.toString(N),transition:S},T=((R=e.layout)==null?void 0:R.colSpan)||Ea(e.type).colSpan,P=Oa.indexOf(T),k=P>0,D=P<Oa.length-1,A=O=>{O==="expand"&&D?i(e.id,Oa[P+1]):O==="shrink"&&k&&i(e.id,Oa[P-1])},I={3:"col-span-3",4:"col-span-4",6:"col-span-6",12:"col-span-12"}[T]||"col-span-6",M=c||C,$=u||_;return s.jsxs("div",{ref:j,style:E,className:te(I,"relative group transition-all duration-200",M&&"opacity-0",$&&"ring-2 ring-primary ring-offset-2 rounded-lg",d&&"ring-2 ring-primary/50 rounded-lg"),onClick:O=>{O.stopPropagation(),f()},children:[$&&s.jsx("div",{className:"absolute -top-2 left-0 right-0 h-1 bg-primary rounded-full animate-pulse"}),s.jsx(GO,{position:"right",onResize:A,canExpand:D,canShrink:k,disabled:l}),s.jsxs("div",{className:te("relative rounded-lg transition-colors",e.type==="divider"&&"p-0 min-h-[8px] border-transparent group-hover:border-border border",["heading-1","heading-2","heading-3","paragraph","quote","bullet-list","numbered-list"].includes(e.type)&&"p-4 min-h-[40px] border border-transparent group-hover:border-border group-hover:bg-card",["metric","callout"].includes(e.type)&&"p-4 min-h-[60px] border bg-card",!["divider","heading-1","heading-2","heading-3","paragraph","quote","bullet-list","numbered-list","metric","callout"].includes(e.type)&&"p-4 min-h-[60px] border bg-card"),children:[s.jsxs("div",{className:te("absolute -top-3 left-1/2 -translate-x-1/2 flex gap-0.5 z-20","opacity-0 group-hover:opacity-100 transition-all duration-200",d&&"opacity-100","bg-background border rounded-lg shadow-sm px-1 py-0.5"),children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx("button",{className:"cursor-grab active:cursor-grabbing touch-none p-1.5 rounded hover:bg-muted",...w,...b,children:s.jsx(nv,{className:"h-3.5 w-3.5 text-muted-foreground"})})}),s.jsx(Bt,{children:"Drag to move"})]}),s.jsx("div",{className:"w-px bg-border my-1"}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),t(e)},disabled:l,children:s.jsx(Oj,{className:"h-3.5 w-3.5"})})}),s.jsx(Bt,{children:"Edit"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),r(e)},disabled:l,children:s.jsx(Od,{className:"h-3.5 w-3.5"})})}),s.jsx(Bt,{children:"Duplicate (Ctrl+D)"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:O=>{O.stopPropagation(),a(e)},disabled:l,children:s.jsx(Aj,{className:"h-3.5 w-3.5"})})}),s.jsx(Bt,{children:"Copy (Ctrl+C)"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:O=>{O.stopPropagation(),n(e.id)},disabled:l,children:s.jsx(pn,{className:"h-3.5 w-3.5"})})}),s.jsx(Bt,{children:"Delete (Del)"})]})]}),h&&v?s.jsx("textarea",{ref:y,className:te("w-full bg-transparent border-none outline-none resize-none",e.type==="heading-1"&&"text-3xl font-bold",e.type==="heading-2"&&"text-2xl font-semibold",e.type==="heading-3"&&"text-xl font-medium",e.type==="paragraph"&&"text-sm"),value:e.content,onChange:O=>{m==null||m(O.target.value),O.target.style.height="auto",O.target.style.height=O.target.scrollHeight+"px"},onBlur:()=>p==null?void 0:p(),onKeyDown:O=>{O.key==="Escape"&&(O.preventDefault(),p==null||p())},placeholder:"Type your text here...",rows:1,style:{minHeight:"1.5em"}}):s.jsx("div",{onDoubleClick:()=>{v&&!l&&(g==null||g())},children:o(e)})]})]})}function UCe({block:e,onEdit:t,onDelete:n,onDuplicate:r,onCopy:a,onResize:i,renderContent:o,disabled:l,isDragging:c,isOver:u,isSelected:d,onSelect:f}){var D;
843const{attributes:h,listeners:m,setNodeRef:p,transform:g,transition:y,isDragging:v,isOver:w}=KO({id:e.id,disabled:l}),b={transform:ro.Translate.toString(g),transition:y},j=((D=e.layout)==null?void 0:D.colSpan)||Ea(e.type).colSpan,N=Oa.indexOf(j),S=N>0,C=N<Oa.length-1,_=A=>{A==="expand"&&C?i(e.id,Oa[N+1]):A==="shrink"&&S&&i(e.id,Oa[N-1])},E={3:"col-span-3",4:"col-span-4",6:"col-span-6",12:"col-span-12"}[j]||"col-span-6",T=`${e.x_column||"?"} × ${e.y_column||"?"}`,P=c||v,k=u||w;return s.jsxs("div",{ref:p,style:b,className:te(E,"relative group transition-all duration-200",P&&"opacity-0",k&&"ring-2 ring-primary ring-offset-2 rounded-lg",d&&"ring-2 ring-primary/50 rounded-lg"),onClick:A=>{A.stopPropagation(),f()},children:[k&&s.jsx("div",{className:"absolute -top-2 left-0 right-0 h-1 bg-primary rounded-full animate-pulse"}),s.jsx(GO,{position:"right",onResize:_,canExpand:C,canShrink:S,disabled:l}),s.jsxs(Z,{className:"h-full",children:[s.jsx(we,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx("button",{className:"cursor-grab active:cursor-grabbing touch-none p-1 rounded hover:bg-muted -ml-1 shrink-0",...h,...m,children:s.jsx(nv,{className:"h-4 w-4 text-muted-foreground"})})}),s.jsx(Bt,{children:"Drag to move"})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xn,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),s.jsx(Ne,{className:"text-sm truncate",children:e.title})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate capitalize",children:T})]})]}),s.jsxs("div",{className:te("flex gap-0.5 transition-opacity shrink-0",d?"opacity-100":"opacity-0 group-hover:opacity-100"),children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:A=>{A.stopPropagation(),t(e)},disabled:l,children:s.jsx(Oj,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Edit chart"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:A=>{A.stopPropagation(),r(e)},disabled:l,children:s.jsx(Od,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Duplicate (Ctrl+D)"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:A=>{A.stopPropagation(),a(e)},disabled:l,children:s.jsx(Aj,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Copy (Ctrl+C)"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:A=>{A.stopPropagation(),n(e.id)},disabled:l,children:s.jsx(pn,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Delete (Del)"})]})]})]})}),s.jsx(le,{children:o(e)})]})]})}function VCe({block:e,onEdit:t,onDelete:n,onDuplicate:r,onCopy:a,onResize:i,renderContent:o,disabled:l,isDragging:c,isOver:u,isSelected:d,onSelect:f}){var k;const{attributes:h,listeners:m,setNodeRef:p,transform:g,transition:y,isDragging:v,isOver:w}=KO({id:e.id,disabled:l}),b={transform:ro.Translate.toString(g),transition:y},j=((k=e.layout)==null?void 0:k.colSpan)||Ea(e.slicerType).colSpan,N=Oa.indexOf(j),S=N>0,C=N<Oa.length-1,_=D=>{D==="expand"&&C?i(e.id,Oa[N+1]):D==="shrink"&&S&&i(e.id,Oa[N-1])},E={3:"col-span-3",4:"col-span-4",6:"col-span-6",12:"col-span-12"}[j]||"col-span-3",T=c||v,P=u||w;return s.jsxs("div",{ref:p,style:b,className:te(E,"relative group transition-all duration-200",T&&"opacity-0",P&&"ring-2 ring-primary ring-offset-2 rounded-lg",d&&"ring-2 ring-primary/50 rounded-lg"),onClick:D=>{D.stopPropagation(),f()},children:[P&&s.jsx("div",{className:"absolute -top-2 left-0 right-0 h-1 bg-primary rounded-full animate-pulse"}),s.jsx(GO,{position:"right",onResize:_,canExpand:C,canShrink:S,disabled:l}),s.jsxs(Z,{className:"h-full border-primary/30",children:[s.jsx(we,{className:"pb-2",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx("button",{className:"cursor-grab active:cursor-grabbing touch-none p-1 rounded hover:bg-muted -ml-1 shrink-0",...h,...m,children:s.jsx(nv,{className:"h-4 w-4 text-muted-foreground"})})}),s.jsx(Bt,{children:"Drag to move"})]}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Va,{className:"h-3.5 w-3.5 text-primary shrink-0"}),s.jsx(Ne,{className:"text-sm truncate",children:e.title})]}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:e.column||"No column selected"})]})]}),s.jsxs("div",{className:te("flex gap-0.5 transition-opacity shrink-0",d?"opacity-100":"opacity-0 group-hover:opacity-100"),children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D=>{D.stopPropagation(),t(e)},disabled:l,children:s.jsx(Oj,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Edit filter"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D=>{D.stopPropagation(),r(e)},disabled:l,children:s.jsx(Od,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Duplicate (Ctrl+D)"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7",onClick:D=>{D.stopPropagation(),a(e)},disabled:l,children:s.jsx(Aj,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Copy (Ctrl+C)"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive",onClick:D=>{D.stopPropagation(),n(e.id)},disabled:l,children:s.jsx(pn,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Delete (Del)"})]})]})]})}),s.jsx(le,{children:o(e)})]})]})}function XI({onInsert:e,disabled:t}
843){const[n,r]=x.useState(!1);return s.jsxs("div",{className:"col-span-12 h-8 flex items-center justify-center group relative",onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:[s.jsx("div",{className:"absolute inset-x-4 top-1/2 h-px bg-border opacity-0 group-hover:opacity-100 transition-opacity"}),s.jsxs("div",{className:te("flex gap-2 z-10 transition-all duration-200",n?"opacity-100 scale-100":"opacity-0 scale-95"),children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsxs(U,{variant:"outline",size:"sm",className:"h-7 px-3 bg-background",onClick:()=>e("text"),disabled:t,children:[s.jsx(sd,{className:"h-3.5 w-3.5 mr-1"}),"Text"]})}),s.jsx(Bt,{children:"Add text block"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsxs(U,{variant:"outline",size:"sm",className:"h-7 px-3 bg-background",onClick:()=>e("chart"),disabled:t,children:[s.jsx(Xn,{className:"h-3.5 w-3.5 mr-1"}),"Chart"]})}),s.jsx(Bt,{children:"Add chart"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsxs(U,{variant:"outline",size:"sm",className:"h-7 px-3 bg-background",onClick:()=>e("filter"),disabled:t,children:[s.jsx(Va,{className:"h-3.5 w-3.5 mr-1"}),"Filter"]})}),s.jsx(Bt,{children:"Add filter/slicer"})]})]})]})}function WCe({blocks:e,onBlocksChange:t,onEditBlock:n,onDeleteBlock:r,onDuplicateBlock:a,onInsertBlock:i,renderBlockContent:o,copiedBlock:l,onCopyBlock:c,onPasteBlock:u,canUndo:d,canRedo:f,onUndo:h,onRedo:m,selectedBlockId:p,onSelectBlock:g,disabled:y=!1,inlineEditingBlockId:v,onInlineTextChange:w,onInlineEditEnd:b,onStartInlineEdit:j}){const[N,S]=x.useState(null),C=x.useRef(null);x.useEffect(()=>{const D=A=>{if(A.target instanceof HTMLInputElement||A.target instanceof HTMLTextAreaElement)return;const M=navigator.platform.toUpperCase().indexOf("MAC")>=0?A.metaKey:A.ctrlKey;if(M&&A.key==="z"&&!A.shiftKey){A.preventDefault(),d&&h();return}if(M&&A.key==="z"&&A.shiftKey||M&&A.key==="y"){A.preventDefault(),f&&m();return}if(M&&A.key==="c"&&p){A.preventDefault();const $=e.find(R=>R.id===p);$&&c($);return}if(M&&A.key==="v"&&l){A.preventDefault(),u();return}if(M&&A.key==="d"&&p){A.preventDefault();const $=e.find(R=>R.id===p);$&&a($);return}if((A.key==="Delete"||A.key==="Backspace")&&p){A.preventDefault(),r(p),g(null);return}if(A.key==="Escape"){g(null);return}};return document.addEventListener("keydown",D),()=>document.removeEventListener("keydown",D)},[e,p,l,d,f,h,m,c,u,a,r,g]);const _=oSe($I(VO,{activationConstraint:{distance:8}}),$I(zO,{coordinateGetter:ICe})),E=x.useCallback(D=>{S(D.active.id)},[]),T=x.useCallback(D=>{const{active:A,over:I}=D;if(S(null),I&&A.id!==I.id){const M=e.findIndex(R=>R.id===A.id),$=e.findIndex(R=>R.id===I.id);t(qO(e,M,$))}},[e,t]),P=x.useCallback((D,A)=>{t(e.map(I=>I.id===D?{...I,layout:{colSpan:A}}:I))},[e,t]),k=N?e.find(D=>D.id===N):null;return e.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-[500px] text-center",children:[s.jsx("div",{className:"h-24 w-24 rounded-full bg-muted flex items-center justify-center mb-4",children:s.jsx(Ln,{className:"h-12 w-12 text-muted-foreground"})}),s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"No content yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1 max-w-sm",children:"Add charts, text blocks, or filters to start building your report"}),s.jsxs("div",{className:"flex gap-2 mt-4 flex-wrap justify-center",children:[s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>i(-1,"text"),disabled:y,children:[s.jsx(sd,{className:"h-4 w-4 mr-2"}),"Add Text"]}),s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>i(-1,"chart"),disabled:y,children:[s.jsx(Xn,{className:"h-4 w-4 mr-2"}),"Add Chart"]}),s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>i(-1,"filter"),disabled:y,children:[s.jsx(Va,{className:"h-4 w-4 mr-2"}),"Add Filter"]})]})]}):s.jsxs("div",{ref:C,onClick:()=>g(null),className:"relative",children:[s.jsxs("div",{className:"flex items-center gap-1 mb-3 p-1 bg-muted/50 rounded-lg w-fit",children:[s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:D=>{D.stopPropagation(),h()},disabled:!d||y,children:s.jsx($re,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Undo (Ctrl+Z)"})]}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:D=>{D.stopPropagation(),m()},disabled:!f||y,children:s.jsx(Tre,{className:"h-4 w-4"})})}),s.jsx(Bt,{children:"Redo (Ctrl+Shift+Z)"})]}),s.jsx("div",{className:"w-px h-5 bg-border mx-1"}),s.jsxs(Vt,{children:[s.jsx(Wt,{asChild:!0,children:s.jsxs(U,{variant:"ghost",size:"sm",className:"h-8 px-2 gap-1",onClick:D=>{D.stopPropagation(),u()},disabled:!l||y,children:[s.jsx(Aj,{className:"h-4 w-4"}),s.jsx("span",{className:"text-xs",children:"Paste"})]})}),s.jsx(Bt,{children:l?`Paste "${Oo(l)?"Text block":l.title}" (Ctrl+V)`:"Nothing to paste"})]}),p&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-px h-5 bg-border mx-1"}),s.jsx("span",{className:"text-xs text-muted-foreground px-2",children:"1 selected"})]})]}),s.jsxs(sCe,{sensors:_,collisionDetection:uSe,onDragStart:E,onDragEnd:T,children:[s.jsx(ACe,{items:e.map(D=>D.id),strategy:HO,children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(XI,{onInsert:D=>i(-1,D),disabled:y}),s.jsx("div",{className:"grid grid-cols-12 gap-4",children:e.map(D=>Oo(D)?s.jsx(zCe,{block:D,onEdit:n,onDelete:r,onDuplicate:a,onCopy:c,onResize:P,renderContent:o,disabled:y,isDragging:N===D.id,isSelected:p===D.id,onSelect:()=>g(D.id),inlineEditing:v===D.id,onInlineTextChange:A=>w==null?void 0:w(D.id,A),onInlineEditEnd:b,onStartInlineEdit:()=>j==null?void 0:j(D.id)},D.id):Li(D)?s.jsx(VCe,{block:D,onEdit:n,onDelete:r,onDuplicate:a,onCopy:c,onResize:P,renderContent:o,disabled:y,isDragging:N===D.id,isSelected:p===D.id,onSelect:()=>g(D.id)},D.id):s.jsx(UCe,{block:D,onEdit:n,onDelete:r,onDuplicate:a,onCopy:c,onResize:P,renderContent:o,disabled:y,isDragging:N===D.id,isSelected:p===D.id,onSelect:()=>g(D.id)},D.id))}),s.jsx(XI,{onInsert:D=>i(e.length-1,D),disabled:y})]})}),s.jsx(SCe,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:k?s.jsx(FCe,{block:k}):null})]})]})}const YO=x.createContext(null);function qCe(e,t){return!e||e.length===0||!t||t.length===0?e:e.filter(n=>t.every(r=>{const a=n[r.column];if(a==null)return r.value.type==="categorical"?r.value.selected.length===0:!0;
843switch(r.value.type){case"date-range":{const i=HCe(a);if(!i||isNaN(i.getTime()))return!0;const{start:o,end:l}=r.value;return!(o&&i<o||l&&i>l)}case"categorical":{const{selected:i}=r.value;return i.length===0?!0:i.includes(String(a))}case"numeric-range":{const i=KCe(a);if(i===null||isNaN(i))return!0;const{min:o,max:l}=r.value;return!(o!==void 0&&i<o||l!==void 0&&i>l)}default:return!0}}))}function HCe(e){if(e instanceof Date)return e;if(typeof e=="string"||typeof e=="number"){const t=new Date(e);return isNaN(t.getTime())?null:t}return null}function KCe(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=parseFloat(e);return isNaN(t)?null:t}return null}function QK({children:e}){const[t,n]=x.useState(()=>new Map),r=x.useMemo(()=>Array.from(t.values()),[t]),a=x.useMemo(()=>r.some(f=>{switch(f.value.type){case"date-range":return f.value.start!==void 0||f.value.end!==void 0;case"categorical":return f.value.selected.length>0;case"numeric-range":return f.value.min!==void 0||f.value.max!==void 0;default:return!1}}),[r]),i=x.useCallback((f,h,m,p)=>{n(g=>{const y=new Map(g);return y.set(f,{blockId:f,column:h,slicerType:m,value:p}),y})},[]),o=x.useCallback(f=>{n(h=>{const m=new Map(h);return m.delete(f),m})},[]),l=x.useCallback(()=>{n(new Map)},[]),c=x.useCallback(f=>qCe(f,r),[r]),u=x.useCallback(f=>t.get(f),[t]),d={activeFilters:r,setFilter:i,clearFilter:o,clearAllFilters:l,getFilteredData:c,hasActiveFilters:a,getFilter:u};return s.jsx(YO.Provider,{value:d,children:e})}function JK(){const e=x.useContext(YO);if(!e)throw new Error("useFilter must be used within a FilterProvider");return e}function GCe(){return x.useContext(YO)}function Mt(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function ls(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function ia(e,t){const n=Mt(e);return isNaN(t)?ls(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function gi(e,t){const n=Mt(e);if(isNaN(t))return ls(e,NaN);if(!t)return n;const r=n.getDate(),a=ls(e,n.getTime());a.setMonth(n.getMonth()+t+1,0);const i=a.getDate();return r>=i?a:(n.setFullYear(a.getFullYear(),a.getMonth(),r),n)}const XO=6048e5,YCe=864e5;let XCe={};function Rv(){return XCe}function ao(e,t){var l,c,u,d;const n=Rv(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=Mt(e),i=a.getDay(),o=(i<r?7:0)+i-r;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function wd(e){return ao(e,{weekStartsOn:1})}function ZK(e){const t=Mt(e),n=t.getFullYear(),r=ls(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const a=wd(r),i=ls(e,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);const o=wd(i);return t.getTime()>=a.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function Vo(e){const t=Mt(e);return t.setHours(0,0,0,0),t}function W0(e){const t=Mt(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function qi(e,t){const n=Vo(e),r=Vo(t),a=+n-W0(n),i=+r-W0(r);return Math.round((a-i)/YCe)}function QCe(e){const t=ZK(e),n=ls(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),wd(n)}function rE(e,t){const n=t*7;return ia(e,n)}function JCe(e,t){return gi(e,t*12)}function ZCe(e){let t;return e.forEach(function(n){const r=Mt(n);(t===void 0||t<r||isNaN(Number(r)))&&(t=r)}),t||new Date(NaN)}function e_e(e){let t;return e.forEach(n=>{const r=Mt(n);(!t||t>r||isNaN(+r))&&(t=r)}),t||new Date(NaN)}function Ma(e,t){const n=Vo(e),r=Vo(t);return+n==+r}function QO(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function t_e(e){if(!QO(e)&&typeof e!="number")return!1;const t=Mt(e);return!isNaN(Number(t))}function iy(e,t){const n=Mt(e),r=Mt(t),a=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return a*12+i}function n_e(e,t,n){const r=ao(e,n),a=ao(t,n),i=+r-W0(r),o=+a-W0(a);return Math.round((i-o)/XO)}function eC(e){const t=Mt(e);return t.setHours(23,59,59,999),t}function JO(e){const t=Mt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function za(e){const t=Mt(e);return t.setDate(1),t.setHours(0,0,0,0),t}function eG(e){const t=Mt(e),n=ls(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ZO(e,t){var l,c,u,d;
vendor: 4,203 bytes, line 843
843const n=Rv(),r=(t==null?void 0:t.weekStartsOn)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??n.weekStartsOn??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,a=Mt(e),i=a.getDay(),o=(i<r?-7:0)+6-(i-r);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function tG(e){return ZO(e,{weekStartsOn:1})}const r_e={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},a_e=(e,t,n)=>{let r;const a=r_e[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r};function Uf(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const s_e={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},i_e={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},o_e={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},l_e={date:Uf({formats:s_e,defaultWidth:"full"}),time:Uf({formats:i_e,defaultWidth:"full"}),dateTime:Uf({formats:o_e,defaultWidth:"full"})},c_e={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},u_e=(e,t,n,r)=>c_e[e];function zi(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let a;if(r==="formatting"&&e.formattingValues){const o=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):o;a=e.formattingValues[l]||e.formattingValues[o]}else{const o=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;a=e.values[l]||e.values[o]}const i=e.argumentCallback?e.argumentCallback(t):t;return a[i]}}const d_e={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},f_e={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},h_e={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},m_e={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},p_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},g_e={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},y_e=(e,t)=>
vendor: 9,953 bytes, line 843
843{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},v_e={ordinalNumber:y_e,era:zi({values:d_e,defaultWidth:"wide"}),quarter:zi({values:f_e,defaultWidth:"wide",argumentCallback:e=>e-1}),month:zi({values:h_e,defaultWidth:"wide"}),day:zi({values:m_e,defaultWidth:"wide"}),dayPeriod:zi({values:p_e,defaultWidth:"wide",formattingValues:g_e,defaultFormattingWidth:"wide"})};function Ui(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(a);if(!i)return null;const o=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?b_e(l,f=>f.test(o)):x_e(l,f=>f.test(o));let u;u=e.valueCallback?e.valueCallback(c):c,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(o.length);return{value:u,rest:d}}}function x_e(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function b_e(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function nG(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const a=r[0],i=t.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=n.valueCallback?n.valueCallback(o):o;const l=t.slice(a.length);return{value:o,rest:l}}}const w_e=/^(\d+)(th|st|nd|rd)?/i,j_e=/\d+/i,N_e={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},S_e={any:[/^b/i,/^(a|c)/i]},C_e={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},__e={any:[/1/i,/2/i,/3/i,/4/i]},E_e={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},A_e={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},P_e={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},k_e={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},O_e={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},T_e={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},M_e={ordinalNumber:nG({matchPattern:w_e,parsePattern:j_e,valueCallback:e=>parseInt(e,10)}),era:Ui({matchPatterns:N_e,defaultMatchWidth:"wide",parsePatterns:S_e,defaultParseWidth:"any"}),quarter:Ui({matchPatterns:C_e,defaultMatchWidth:"wide",parsePatterns:__e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ui({matchPatterns:E_e,defaultMatchWidth:"wide",parsePatterns:A_e,defaultParseWidth:"any"}),day:Ui({matchPatterns:P_e,defaultMatchWidth:"wide",parsePatterns:k_e,defaultParseWidth:"any"}),dayPeriod:Ui({matchPatterns:O_e,defaultMatchWidth:"any",parsePatterns:T_e,defaultParseWidth:"any"})},rG={code:"en-US",formatDistance:a_e,formatLong:l_e,formatRelative:u_e,localize:v_e,match:M_e,options:{weekStartsOn:0,firstWeekContainsDate:1}};function R_e(e){const t=Mt(e);return qi(t,eG(t))+1}function aG(e){const t=Mt(e),n=+wd(t)-+QCe(t);return Math.round(n/XO)+1}function sG(e,t){var d,f,h,m;const n=Mt(e),r=n.getFullYear(),a=Rv(),i=(t==null?void 0:t.firstWeekContainsDate)??((f=(d=t==null?void 0:t.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??a.firstWeekContainsDate??((m=(h=a.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,o=ls(e,0);o.setFullYear(r+1,0,i),o.setHours(0,0,0,0);const l=ao(o,t),c=ls(e,0);c.setFullYear(r,0,i),c.setHours(0,0,0,0);const u=ao(c,t);return n.getTime()>=l.getTime()?r+1:n.getTime()>=u.getTime()?r:r-1}function D_e(e,t){var l,c,u,d;const n=Rv(),r=(t==null?void 0:t.firstWeekContainsDate)??((c=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??n.firstWeekContainsDate??((d=(u=n.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,a=sG(e,t),i=ls(e,0);return i.setFullYear(a,0,r),i.setHours(0,0,0,0),ao(i,t)}function iG(e,t){const n=Mt(e),r=+ao(n,t)-+D_e(n,t);return Math.round(r/XO)+1}function Ht(e,t){const n=e<0?"-":"",r=Math.abs(e).toString().padStart(t,"0");return n+r}const Vl={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return Ht(t==="yy"?r%100:r,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ht(n+1,2)},d(e,t){return Ht(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ht(e.getHours()%12||12,t.length)},H(e,t){return Ht(e.getHours(),t.length)},m(e,t){return Ht(e.getMinutes(),t.length)},s(e,t){return Ht(e.getSeconds(),t.length)},S(e,t){const n=t.length,r=e.getMilliseconds(),a=Math.trunc(r*Math.pow(10,n-3));return Ht(a,t.length)}},tf={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},QI={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});case"GGGG":default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const r=e.getFullYear(),a=r>0?r:1-r;return n.ordinalNumber(a,{unit:"year"})}return Vl.y(e,t)},Y:function(e,t,n,r){const a=sG(e,r),i=a>0?a:1-a;if(t==="YY"){const o=i%100;return Ht(o,2)}return t==="Yo"?n.ordinalNumber(i,{unit:"year"}):Ht(i,t.length)},R:function(e,t){const n=ZK(e);return Ht(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ht(n,t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return Ht(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return Ht(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return Vl.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return Ht(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=iG(e,r);return t==="wo"?n.ordinalNumber(a,{unit:"week"}):Ht(a,t.length)},I:function(e,t,n){const r=aG(e);return t==="Io"?n.ordinalNumber(r,{unit:"week"}):Ht(r,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Vl.d(e,t)},D:function(e,t,n){const r=R_e(e);return t==="Do"?n.ordinalNumber(r,{unit:"dayOfYear"}):Ht(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});case"EEEE":default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return Ht(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});case"eeee":default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),i=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return Ht(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});case"cccc":default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=r===0?7:r;switch(t){case"i":return String(a);case"ii":return Ht(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});case"iiii":default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const a=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(r===12?a=tf.noon:r===0?a=tf.midnight:a=r/12>
vendor: 4,390 bytes, line 843
843=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(r>=17?a=tf.evening:r>=12?a=tf.afternoon:r>=4?a=tf.morning:a=tf.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let r=e.getHours()%12;return r===0&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return Vl.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Vl.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return t==="Ko"?n.ordinalNumber(r,{unit:"hour"}):Ht(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t==="ko"?n.ordinalNumber(r,{unit:"hour"}):Ht(r,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Vl.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Vl.s(e,t)},S:function(e,t){return Vl.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(r===0)return"Z";switch(t){case"X":return ZI(r);case"XXXX":case"XX":return gu(r);case"XXXXX":case"XXX":default:return gu(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return ZI(r);case"xxxx":case"xx":return gu(r);case"xxxxx":case"xxx":default:return gu(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+JI(r,":");case"OOOO":default:return"GMT"+gu(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+JI(r,":");case"zzzz":default:return"GMT"+gu(r,":")}},t:function(e,t,n){const r=Math.trunc(e.getTime()/1e3);return Ht(r,t.length)},T:function(e,t,n){const r=e.getTime();return Ht(r,t.length)}};function JI(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),i=r%60;return i===0?n+String(a):n+String(a)+t+Ht(i,2)}function ZI(e,t){return e%60===0?(e>0?"-":"+")+Ht(Math.abs(e)/60,2):gu(e,t)}function gu(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Ht(Math.trunc(r/60),2),i=Ht(r%60,2);return n+a+t+i}const e4=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},oG=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},$_e=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return e4(e,t);let i;switch(r){case"P":i=t.dateTime({width:"short"});break;case"PP":i=t.dateTime({width:"medium"});break;case"PPP":i=t.dateTime({width:"long"});break;case"PPPP":default:i=t.dateTime({width:"full"});break}return i.replace("{{date}}",e4(r,t)).replace("{{time}}",oG(a,t))},I_e={p:oG,P:$_e},L_e=/^D+$/,F_e=/^Y+$/,B_e=["D","DD","YY","YYYY"];function z_e(e){return L_e.test(e)}function U_e(e){return F_e.test(e)}function V_e(e,t,n){const r=W_e(e,t,n);if(console.warn(r),B_e.includes(e))throw new RangeError(r)}function W_e(e,t,n){const r=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const q_e=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,H_e=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,K_e=/^'([^]*?)'?$/,G_e=/''/g,Y_e=/[a-zA-Z]/;function Xc(e,t,n){var d,f,h,m,p,g,y,v;const r=Rv(),a=(n==null?void 0:n.locale)??r.locale??rG,i=(n==null?void 0:n.firstWeekContainsDate)??((f=(d=n==null?void 0:n.locale)==null?void 0:d.options)==null?void 0:f.firstWeekContainsDate)??r.firstWeekContainsDate??((m=(h=r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??1,o=(n==null?void 0:n.weekStartsOn)??((g=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??r.weekStartsOn??((v=(y=r.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??0,l=Mt(e);
843if(!t_e(l))throw new RangeError("Invalid time value");let c=t.match(H_e).map(w=>{const b=w[0];if(b==="p"||b==="P"){const j=I_e[b];return j(w,a.formatLong)}return w}).join("").match(q_e).map(w=>{if(w==="''")return{isToken:!1,value:"'"};const b=w[0];if(b==="'")return{isToken:!1,value:X_e(w)};if(QI[b])return{isToken:!0,value:w};if(b.match(Y_e))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return{isToken:!1,value:w}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(w=>{if(!w.isToken)return w.value;const b=w.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&U_e(b)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&z_e(b))&&V_e(b,t,String(e));const j=QI[b[0]];return j(l,b,a.localize,u)}).join("")}function X_e(e){const t=e.match(K_e);return t?t[1].replace(G_e,"'"):e}function Q_e(e){const t=Mt(e),n=t.getFullYear(),r=t.getMonth(),a=ls(e,0);return a.setFullYear(n,r+1,0),a.setHours(0,0,0,0),a.getDate()}function J_e(e){return Math.trunc(+Mt(e)/1e3)}function Z_e(e){const t=Mt(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function e2e(e,t){return n_e(Z_e(e),za(e),t)+1}function aE(e,t){const n=Mt(e),r=Mt(t);return n.getTime()>r.getTime()}function lG(e,t){const n=Mt(e),r=Mt(t);return+n<+r}function eT(e,t){const n=Mt(e),r=Mt(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function t2e(e,t){const n=Mt(e),r=Mt(t);return n.getFullYear()===r.getFullYear()}function _b(e,t){return ia(e,-t)}function tC(e,t){const n=Mt(e),r=n.getFullYear(),a=n.getDate(),i=ls(e,0);i.setFullYear(r,t,15),i.setHours(0,0,0,0);const o=Q_e(i);return n.setMonth(t,Math.min(a,o)),n}function t4(e,t){const n=Mt(e);return isNaN(+n)?ls(e,NaN):(n.setFullYear(t),n)}const n2e={lessThanXSeconds:{one:"menos de un segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"medio minuto",lessThanXMinutes:{one:"menos de un minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"alrededor de 1 hora",other:"alrededor de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 día",other:"{{count}} días"},aboutXWeeks:{one:"alrededor de 1 semana",other:"alrededor de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"alrededor de 1 mes",other:"alrededor de {{count}} meses"},xMonths:{one:"1 mes",other:"{{count}} meses"},aboutXYears:{one:"alrededor de 1 año",other:"alrededor de {{count}} años"},xYears:{one:"1 año",other:"{{count}} años"},overXYears:{one:"más de 1 año",other:"más de {{count}} años"},almostXYears:{one:"casi 1 año",other:"casi {{count}} años"}},r2e=(e,t,n)=>{let r;const a=n2e[e];return typeof a=="string"?r=a:t===1?r=a.one:r=a.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"en "+r:"hace "+r:r},a2e={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/y"},s2e={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},i2e={full:"{{date}} 'a las' {{time}}",long:"{{date}} 'a las' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},o2e={date:Uf({formats:a2e,defaultWidth:"full"}),time:Uf({formats:s2e,defaultWidth:"full"}),dateTime:Uf({formats:i2e,defaultWidth:"full"})},l2e={lastWeek:"'el' eeee 'pasado a la' p",yesterday:"'ayer a la' p",today:"'hoy a la' p",tomorrow:"'mañana a la' p",nextWeek:"eeee 'a la' p",other:"P"},c2e={lastWeek:"'el' eeee 'pasado a las' p",yesterday:"'ayer a las' p",today:"'hoy a las' p",tomorrow:"'mañana a las' p",nextWeek:"eeee 'a las' p",other:"P"},u2e=(e,t,n,r)=>t.getHours()!==1?c2e[e]:l2e[e],d2e={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","después de cristo"]},f2e={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},h2e={narrow:["e","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],wide:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"]},m2e={narrow:["d","l","m","m","j","v","s"],short:["do","lu","ma","mi","ju","vi","sá"],abbreviated:["dom","lun","mar","mié","jue","vie","sáb"],wide:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"]},p2e={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"mañana",afternoon:"tarde",evening:"tarde",night:"noche"}},g2e={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},abbreviated:{am:"AM",pm:"PM",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"},wide:{am:"a.m.",pm:"p.m.",midnight:"medianoche",noon:"mediodia",morning:"de la mañana",afternoon:"de la tarde",evening:"de la tarde",night:"de la noche"}},y2e=(e,t)=>
843Number(e)+"º",v2e={ordinalNumber:y2e,era:zi({values:d2e,defaultWidth:"wide"}),quarter:zi({values:f2e,defaultWidth:"wide",argumentCallback:e=>Number(e)-1}),month:zi({values:h2e,defaultWidth:"wide"}),day:zi({values:m2e,defaultWidth:"wide"}),dayPeriod:zi({values:p2e,defaultWidth:"wide",formattingValues:g2e,defaultFormattingWidth:"wide"})},x2e=/^(\d+)(º)?/i,b2e=/\d+/i,w2e={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|a\.?\s?e\.?\s?c\.?|d\.?\s?c\.?|e\.?\s?c\.?)/i,wide:/^(antes de cristo|antes de la era com[uú]n|despu[eé]s de cristo|era com[uú]n)/i},j2e={any:[/^ac/i,/^dc/i],wide:[/^(antes de cristo|antes de la era com[uú]n)/i,/^(despu[eé]s de cristo|era com[uú]n)/i]},N2e={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},S2e={any:[/1/i,/2/i,/3/i,/4/i]},C2e={narrow:/^[efmajsond]/i,abbreviated:/^(ene|feb|mar|abr|may|jun|jul|ago|sep|oct|nov|dic)/i,wide:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i},_2e={narrow:[/^e/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^en/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i]},E2e={narrow:/^[dlmjvs]/i,short:/^(do|lu|ma|mi|ju|vi|s[áa])/i,abbreviated:/^(dom|lun|mar|mi[ée]|jue|vie|s[áa]b)/i,wide:/^(domingo|lunes|martes|mi[ée]rcoles|jueves|viernes|s[áa]bado)/i},A2e={narrow:[/^d/i,/^l/i,/^m/i,/^m/i,/^j/i,/^v/i,/^s/i],any:[/^do/i,/^lu/i,/^ma/i,/^mi/i,/^ju/i,/^vi/i,/^sa/i]},P2e={narrow:/^(a|p|mn|md|(de la|a las) (mañana|tarde|noche))/i,any:/^([ap]\.?\s?m\.?|medianoche|mediodia|(de la|a las) (mañana|tarde|noche))/i},k2e={any:{am:/^a/i,pm:/^p/i,midnight:/^mn/i,noon:/^md/i,morning:/mañana/i,afternoon:/tarde/i,evening:/tarde/i,night:/noche/i}},O2e={ordinalNumber:nG({matchPattern:x2e,parsePattern:b2e,valueCallback:function(e){return parseInt(e,10)}}),era:Ui({matchPatterns:w2e,defaultMatchWidth:"wide",parsePatterns:j2e,defaultParseWidth:"any"}),quarter:Ui({matchPatterns:N2e,defaultMatchWidth:"wide",parsePatterns:S2e,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Ui({matchPatterns:C2e,defaultMatchWidth:"wide",parsePatterns:_2e,defaultParseWidth:"any"}),day:Ui({matchPatterns:E2e,defaultMatchWidth:"wide",parsePatterns:A2e,defaultParseWidth:"any"}),dayPeriod:Ui({matchPatterns:P2e,defaultMatchWidth:"any",parsePatterns:k2e,defaultParseWidth:"any"})},dp={code:"es",formatDistance:r2e,formatLong:o2e,formatRelative:u2e,localize:v2e,match:O2e,options:{weekStartsOn:1,firstWeekContainsDate:1}};var at=function(){return at=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},at.apply(this,arguments)};function T2e(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function cG(e,t,n){for(var r=0,a=t.length,i;r<a;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}function Dv(e){return e.mode==="multiple"}function $v(e){return e.mode==="range"}function I1(e){return e.mode==="single"}var M2e={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function R2e(e,t){return Xc(e,"LLLL y",t)}function D2e(e,t){return Xc(e,"d",t)}function $2e(e,t){return Xc(e,"LLLL",t)}function I2e(e){return"".concat(e)}function L2e(e,t){return Xc(e,"cccccc",t)}function F2e(e,t){return Xc(e,"yyyy",t)}var B2e=Object.freeze({__proto__:null,formatCaption:R2e,formatDay:D2e,formatMonthCaption:$2e,formatWeekNumber:I2e,formatWeekdayName:L2e,formatYearC
843aption:F2e}),z2e=function(e,t,n){return Xc(e,"do MMMM (EEEE)",n)},U2e=function(){return"Month: "},V2e=function(){return"Go to next month"},W2e=function(){return"Go to previous month"},q2e=function(e,t){return Xc(e,"cccc",t)},H2e=function(e){return"Week n. ".concat(e)},K2e=function(){return"Year: "},G2e=Object.freeze({__proto__:null,labelDay:z2e,labelMonthDropdown:U2e,labelNext:V2e,labelPrevious:W2e,labelWeekNumber:H2e,labelWeekday:q2e,labelYearDropdown:K2e});function Y2e(){var e="buttons",t=M2e,n=rG,r={},a={},i=1,o={},l=new Date;return{captionLayout:e,classNames:t,formatters:B2e,labels:G2e,locale:n,modifiersClassNames:r,modifiers:a,numberOfMonths:i,styles:o,today:l,mode:"default"}}function X2e(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,a=e.toMonth,i=e.fromDate,o=e.toDate;return r?i=za(r):t&&(i=new Date(t,0,1)),a?o=JO(a):n&&(o=new Date(n,11,31)),{fromDate:i?Vo(i):void 0,toDate:o?Vo(o):void 0}}var uG=x.createContext(void 0);function Q2e(e){var t,n=e.initialProps,r=Y2e(),a=X2e(n),i=a.fromDate,o=a.toDate,l=(t=n.captionLayout)!==null&&t!==void 0?t:r.captionLayout;l!=="buttons"&&(!i||!o)&&(l="buttons");var c;(I1(n)||Dv(n)||$v(n))&&(c=n.onSelect);var u=at(at(at({},r),n),{captionLayout:l,classNames:at(at({},r.classNames),n.classNames),components:at({},n.components),formatters:at(at({},r.formatters),n.formatters),fromDate:i,labels:at(at({},r.labels),n.labels),mode:n.mode||r.mode,modifiers:at(at({},r.modifiers),n.modifiers),modifiersClassNames:at(at({},r.modifiersClassNames),n.modifiersClassNames),onSelect:c,styles:at(at({},r.styles),n.styles),toDate:o});return s.jsx(uG.Provider,{value:u,children:e.children})}function un(){var e=x.useContext(uG);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function dG(e){var t=un(),n=t.locale,r=t.classNames,a=t.styles,i=t.formatters.formatCaption;return s.jsx("div",{className:r.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function J2e(e){return s.jsx("svg",at({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:s.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function fG(e){var t,n,r=e.onChange,a=e.value,i=e.children,o=e.caption,l=e.className,c=e.style,u=un(),d=(n=(t=u.components)===null||t===void 0?void 0:t.IconDropdown)!==null&&n!==void 0?n:J2e;return s.jsxs("div",{className:l,style:c,children:[s.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),s.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:a,onChange:r,children:i}),s.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[o,s.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function Z2e(e){var t,n=un(),r=n.fromDate,a=n.toDate,i=n.styles,o=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!r)return s.jsx(s.Fragment,{});if(!a)return s.jsx(s.Fragment,{});var f=[];if(t2e(r,a))for(var h=za(r),m=r.getMonth();m<=a.getMonth();m++)f.push(tC(h,m));else for(var h=za(new Date),m=0;m<=11;m++)f.push(tC(h,m));var p=function(y){var v=Number(y.target.value),w=tC(za(e.displayMonth),v);e.onChange(w)},g=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:fG;return s.jsx(g,{name:"months","aria-label":d(),className:c.dropdown_month,style:i.dropdown_month,onChange:p,value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:o}),children:f.map(function(y){return s.jsx("option",{value:y.getMonth(),children:l(y,{locale:o})},y.getMonth())})})}function eEe(e){var t,n=e.displayMonth,r=un(),a=r.fromDate,i=r.toDate,o=r.locale,l=r.styles,c=r.classNames,u=r.components,d=r.formatters.formatYearC
843aption,f=r.labels.labelYearDropdown,h=[];if(!a)return s.jsx(s.Fragment,{});if(!i)return s.jsx(s.Fragment,{});for(var m=a.getFullYear(),p=i.getFullYear(),g=m;g<=p;g++)h.push(t4(eG(new Date),g));var y=function(w){var b=t4(za(n),Number(w.target.value));e.onChange(b)},v=(t=u==null?void 0:u.Dropdown)!==null&&t!==void 0?t:fG;return s.jsx(v,{name:"years","aria-label":f(),className:c.dropdown_year,style:l.dropdown_year,onChange:y,value:n.getFullYear(),caption:d(n,{locale:o}),children:h.map(function(w){return s.jsx("option",{value:w.getFullYear(),children:d(w,{locale:o})},w.getFullYear())})})}function tEe(e,t){var n=x.useState(e),r=n[0],a=n[1],i=t===void 0?r:t;return[i,a]}function nEe(e){var t=e.month,n=e.defaultMonth,r=e.today,a=t||n||r||new Date,i=e.toDate,o=e.fromDate,l=e.numberOfMonths,c=l===void 0?1:l;if(i&&iy(i,a)<0){var u=-1*(c-1);a=gi(i,u)}return o&&iy(a,o)<0&&(a=o),za(a)}function rEe(){var e=un(),t=nEe(e),n=tEe(t,e.month),r=n[0],a=n[1],i=function(o){var l;if(!e.disableNavigation){var c=za(o);a(c),(l=e.onMonthChange)===null||l===void 0||l.call(e,c)}};return[r,i]}function aEe(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,a=za(e),i=za(gi(a,r)),o=iy(i,a),l=[],c=0;c<o;c++){var u=gi(a,c);l.push(u)}return n&&(l=l.reverse()),l}function sEe(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=r?i:1,l=za(e);if(!n)return gi(l,o);var c=iy(n,e);if(!(c<i))return gi(l,o)}}function iEe(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,a=t.numberOfMonths,i=a===void 0?1:a,o=r?i:1,l=za(e);if(!n)return gi(l,-o);var c=iy(l,n);if(!(c<=0))return gi(l,-o)}}var hG=x.createContext(void 0);function oEe(e){var t=un(),n=rEe(),r=n[0],a=n[1],i=aEe(r,t),o=sEe(r,t),l=iEe(r,t),c=function(f){return i.some(function(h){return eT(f,h)})},u=function(f,h){c(f)||(h&&lG(f,h)?a(gi(f,1+t.numberOfMonths*-1)):a(f))},d={currentMonth:r,displayMonths:i,goToMonth:a,goToDate:u,previousMonth:l,nextMonth:o,isDateDisplayed:c};return s.jsx(hG.Provider,{value:d,children:e.children})}function Iv(){var e=x.useContext(hG);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function n4(e){var t,n=un(),r=n.classNames,a=n.styles,i=n.components,o=Iv().goToMonth,l=function(d){o(gi(d,e.displayIndex?-e.dis
843playIndex:0))},c=(t=i==null?void 0:i.CaptionLabel)!==null&&t!==void 0?t:dG,u=s.jsx(c,{id:e.id,displayMonth:e.displayMonth});return s.jsxs("div",{className:r.caption_dropdowns,style:a.caption_dropdowns,children:[s.jsx("div",{className:r.vhidden,children:u}),s.jsx(Z2e,{onChange:l,displayMonth:e.displayMonth}),s.jsx(eEe,{onChange:l,displayMonth:e.displayMonth})]})}function lEe(e){return s.jsx("svg",at({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function cEe(e){return s.jsx("svg",at({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:s.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var q0=x.forwardRef(function(e,t){var n=un(),r=n.classNames,a=n.styles,i=[r.button_reset,r.button];e.className&&i.push(e.className);var o=i.join(" "),l=at(at({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),s.jsx("button",at({},e,{ref:t,type:"button",className:o,style:l}))});function uEe(e){var t,n,r=un(),a=r.dir,i=r.locale,o=r.classNames,l=r.styles,c=r.labels,u=c.labelPrevious,d=c.labelNext,f=r.components;if(!e.nextMonth&&!e.previousMonth)return s.jsx(s.Fragment,{});var h=u(e.previousMonth,{locale:i}),m=[o.nav_button,o.nav_button_previous].join(" "),p=d(e.nextMonth,{locale:i}),g=[o.nav_button,o.nav_button_next].join(" "),y=(t=f==null?void 0:f.IconRight)!==null&&t!==void 0?t:cEe,v=(n=f==null?void 0:f.IconLeft)!==null&&n!==void 0?n:lEe;return s.jsxs("div",{className:o.nav,style:l.nav,children:[!e.hidePrevious&&s.jsx(q0,{name:"previous-month","aria-label":h,className:m,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:a==="rtl"?s.jsx(y,{className:o.nav_icon,style:l.nav_icon}):s.jsx(v,{className:o.nav_icon,style:l.nav_icon})}),!e.hideNext&&s.jsx(q0,{name:"next-month","aria-label":p,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:a==="rtl"?s.jsx(v,{className:o.nav_icon,style:l.nav_icon}):s.jsx(y,{className:o.nav_icon,style:l.nav_icon})})]})}function r4(e){var t=un().numberOfMonths,n=Iv(),r=n.previousMonth,a=n.nextMonth,i=n.goToMonth,o=n.displayMonths,l=o.findIndex(function(p){return eT(e.displayMonth,p)}),c=l===0,u=l===o.length-1,d=t>1&&(c||!u),f=t>1&&(u||!c),h=function(){r&&i(r)},m=function(){a&&i(a)};return s.jsx(uEe,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:f,nextMonth:a,previousMonth:r,onPreviousClick:h,onNextClick:m})}function dEe(e){var t,n=un(),r=n.classNames,a=n.disableNavigation,i=n.styles,o=n.captionLayout,l=n.components,c=(t=l==null?void 0:l.CaptionLabel)!==null&&t!==void 0?t:dG,u;return a?u=s.jsx(c,{id:e.id,displayMonth:e.displayMonth}):o==="dropdown"?u=s.jsx(n4,{displayMonth:e.displayMonth,id:e.id}):o==="dropdown-buttons"?u=s.jsxs(s.Fragment,{children:[s.jsx(n4,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),s.jsx(r4,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):u=s.jsxs(s.Fragment,{children:[s.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(r4,{displayMonth:e.displayMonth,id:e.id})]}),s.jsx("div",{className:r.caption,style:i.caption,children:u})}function fEe(e){var t=un(),n=t.footer,r=t.styles,a=t.classNames.tfoot;return n?s.jsx("tfoot",{className:a,style:r.tfoot,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,children:n})})}):s.jsx(s.Fragment,{})}function hEe(e,t,n){for(var r=n?wd(new Date):ao(new Date,{locale:e,weekStartsOn:t}),a=[],i=0;i<7;i++){var o=ia(r,i);a.push(o)}return a}function mEe(){var e=un(),t=e.classNames,n=e.styles,r=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,o=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=hEe(a,i,o);return s.jsxs("tr",{style:n.head_row,className:t.head_row,children:[r&&s.jsx("td",{style:n.head_cell,className:t.head_cell}),u.map(function(d,f){return s.jsx("th",{scope:"col",className:t.head_cell,style:n.head_cell,"aria-label":c(d,{locale:a}),children:l(d,{locale:a})},f)})]})}function pEe(){var e,t=un(),n=t.classNames,r=t.styles,a=t.components,i=(e=a==null?void 0:a.HeadRow)!==null&&e!==void 0?e:mEe;return s.jsx("thead",{style:r.head,className:n.head,children:s.jsx(i,{})})}function gEe(e){var t=un(),n=t.locale,r=t.formatters.formatDay;return s.jsx(s.Fragment,{children:r(e.date,{locale:n})})}var tT=x.createContext(void 0);function yEe(e){if(!Dv(e.initialProps)){var t={selected:void 0,modifiers:{disabled:[]}};return s.jsx(tT.Provider,{value:t,children:e.children})}return s.jsx(vEe,{initialProps:e.initialProps,children:e.children})}function vEe(e){var t=e.initialProps,n=e.children,r=t.selected,a=t.min,i=t.max,o=function(u,d,f){var h,m;(h=t.onDayClick)===null||h===void 0||h.call(t,u,d,f);var p=!!(d.selected&&a&&(r==null?void 0:r.length)===a);if(!p){var g=!!(!d.selected&&i&&(r==null?void 0:r.length)===i);if(!g){var y=r?cG([],r):[];if(d.selected){var v=y.findIndex(function(w){return Ma(u,w)});y.splice(v,1)}else y.push(u);(m=t.onSelect)===null||m===void 0||m.call(t,y,u,d,f)}}},l={disabled:[]};r&&l.disabled.push(function(u){var d=i&&r.length>i-1,f=r.some(function(h){return Ma(h,u)});return!!(d&&!f)});var c={selected:r,onDayClick:o,modifiers:l};return s.jsx(tT.Provider,{value:c,children:n})}function nT(){var e=x.useContext(tT);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}function xEe(e,t){var n=t||{},r=n.from,a=n.to;return r&&a?Ma(a,e)&&Ma(r,e)?void 0:Ma(a,e)?{from:a,to:void 0}:Ma(r,e)?void 0:aE(r,e)?{from:e,to:a}:{from:r,to:e}:a?aE(e,a)?{from:a,to:e}:{from:e,to:a}:r?lG(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var rT=x.createContext(void 0);function bEe(e){if(!$v(e.initialProps)){var t={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(rT.Provider,{value:t,children:e.children})}return s.jsx(wEe,{initialProps:e.initialProps,children:e.children})}function wEe(e){var t=e.initialProps,n=e.children,r=t.selected,a=r||{},i=a.from,o=a.to,l=t.min,c=t.max,u=function(m,p,g){var y,v;(y=t.onDayClick)===null||y===void 0||y.call(t,m,p,g);var w=xEe(m,r);(v=t.onSelect)===null||v===void 0||v.call(t,w,m,p,g)},d={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(d.range_start=[i],o?(d.range_end=[o],Ma(i,o)||(d.range_middle=[{after:i,before:o}])):d.range_end=[i]):o&&(d.range_start=[o],d.range_end=[o]),l&&(i&&!o&&d.disabled.push({after:_b(i,l-1),before:ia(i,l-1)}),i&&o&&d.disabled.push({after:i,before:ia(i,l-1)}),!i&&o&&d.disabled.push({after:_b(o,l-1),before:ia(o,l-1)})),c){if(i&&!o&&(d.disabled.push({before:ia(i,-c+1)}),d.disabled.push({after:ia(i,c-1)})),i&&o){var f=qi(o,i)+1,h=c-f;d.disabled.push({before:_b(i,h)}),d.disabled.push({after:ia(o,h)})}!i&&o&&(d.disabled.push({before:ia(o,-c+1)}),d.disabled.push({after:ia(o,c-1)}))}return s.jsx(rT.Provider,{value:{selected:r,onDayClick:u,modifiers:d},children:n})}function aT(){var e=x.useContext(rT);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function Eb(e){return Array.isArray(e)?cG([],e):e!==void 0?[e]:[]}function jEe(e){var t={};return Object.entries(e).forEach(function(n){var r=n[0],a=n[1];t[r]=Eb(a)}),t}var yi;(function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"})(yi||(yi={}));var NEe=yi.Selected,No=yi.Disabled,SEe=yi.Hidden,CEe=yi.Today,nC=yi.RangeEnd,rC=yi.RangeMiddle,aC=yi.RangeStart,_Ee=yi.Outside;function EEe(e,t,n){var r,a=(r={},r[NEe]=Eb(e.selected),r[No]=Eb(e.disabled),r[SEe]=Eb(e.hidden),r[CEe]=[e.today],r[nC]=[],r[rC]=[],r[aC]=[],r[_Ee]=[],r);return e.fromDate&&a[No].push({before:e.fromDate}),e.toDate&&a[No].push({after:e.toDate}),Dv(e)?a[No]=a[No].concat(t.modifiers[No]):$v(e)&&(a[No]=a[No].concat(n.modifiers[No]),a[aC]=n.modifiers[aC],a[rC]=n.modifiers[rC],a[nC]=n.modifiers[nC]),a}var mG=x.createContext(void 0);function AEe(e){var t=un(),n=nT(),r=aT(),a=EEe(t,n,r),i=jEe(t.modifiers),o=at
843(at({},a),i);return s.jsx(mG.Provider,{value:o,children:e.children})}function pG(){var e=x.useContext(mG);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function PEe(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function kEe(e){return!!(e&&typeof e=="object"&&"from"in e)}function OEe(e){return!!(e&&typeof e=="object"&&"after"in e)}function TEe(e){return!!(e&&typeof e=="object"&&"before"in e)}function MEe(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function REe(e,t){var n,r=t.from,a=t.to;if(r&&a){var i=qi(a,r)<0;i&&(n=[a,r],r=n[0],a=n[1]);var o=qi(e,r)>=0&&qi(a,e)>=0;return o}return a?Ma(a,e):r?Ma(r,e):!1}function DEe(e){return QO(e)}function $Ee(e){return Array.isArray(e)&&e.every(QO)}function IEe(e,t){return t.some(function(n){if(typeof n=="boolean")return n;if(DEe(n))return Ma(e,n);if($Ee(n))return n.includes(e);if(kEe(n))return REe(e,n);if(MEe(n))return n.dayOfWeek.includes(e.getDay());if(PEe(n)){var r=qi(n.before,e),a=qi(n.after,e),i=r>0,o=a<0,l=aE(n.before,n.after);return l?o&&i:i||o}return OEe(n)?qi(e,n.after)>0:TEe(n)?qi(n.before,e)>0:typeof n=="function"?n(e):!1})}function sT(e,t,n){var r=Object.keys(t).reduce(function(i,o){var l=t[o];return IEe(e,l)&&i.push(o),i},[]),a={};return r.forEach(function(i){return a[i]=!0}),n&&!eT(e,n)&&(a.outside=!0),a}function LEe(e,t){for(var n=za(e[0]),r=JO(e[e.length-1]),a,i,o=n;o<=r;){var l=sT(o,t),c=!l.disabled&&!l.hidden;if(!c){o=ia(o,1);continue}if(l.selected)return o;l.today&&!i&&(i=o),a||(a=o),o=ia(o,1)}return i||a}var FEe=365;function gG(e,t){var n=t.moveBy,r=t.direction,a=t.context,i=t.modifiers,o=t.retry,l=o===void 0?{count:0,lastFocused:e}:o,c=a.weekStartsOn,u=a.fromDate,d=a.toDate,f=a.locale,h={day:ia,week:rE,month:gi,year:JCe,startOfWeek:function(y){return a.ISOWeek?wd(y):ao(y,{locale:f,weekStartsOn:c})},endOfWeek:function(y){return a.ISOWeek?tG(y):ZO(y,{locale:f,weekStartsOn:c})}},m=h[n](e,r==="after"?1:-1);r==="before"&&u?m=ZCe([u,m]):r==="after"&&d&&(m=e_e([d,m]));var p=!0;if(i){var g=sT(m,i);p=!g.disabled&&!g.hidden}return p?m:l.count>FEe?l.lastFocused:gG(m,{moveBy:n,direction:r,context:a,modifiers:i,retry:at(at({},l),{count:l.count+1})})}var yG=x.createContext(void 0);function BEe(e){var t=Iv(),n=pG(),r=x.useState(),a=r[0],i=r[1],o=x.useState(),l=o[0],c=o[1],u=LEe(t.displayMonths,n),d=a??(l&&t.isDateDisplayed(l))?l:u,f=function(){c(a),i(void 0)},h=function(y){i(y)},m=un(),p=function(y,v){if(a){var w=gG(a,{moveBy:y,direction:v,context:m,modifiers:n});Ma(a,w)||(t.goToDate(w,a),h(w))}},g={focusedDay:a,focusTarget:d,blur:f,focus:h,focusDayAfter:function(){return p("day","after")},focusDayBefore:function(){return p("day","before")},focusWeekAfter:function(){return p("week","after")},focusWeekBefore:function(){return p("week","before")},focusMonthBefore:function(){return p("month","before")},focusMonthAfter:function(){return p("month","after")},focusYearBefore:function(){return p("year","before")},focusYearAfter:function(){return p("year","after")},focusStartOfWeek:function(){return p("startOfWeek","before")},focusEndOfWeek:function(){return p("endOfWeek","after")}};return s.jsx(yG.Provider,{value:g,children:e.children})}function iT(){var e=x.useContext(yG);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}function zEe(e,t){var n=pG(),r=sT(e,n,t);return r}var oT=x.createContext(void 0);function UEe(e){if(!I1(e.initialProps)){var t={selected:void 0};return s.jsx(oT.Provider,{value:t,children:e.children})}return s.jsx(VEe,{initialProps:e.initialProps,children:e.children})}function VEe(e){var t=e.initialProps,n=e.children,r=function(i,o,l){var c,u,d;if((c=t.onDayClick)===null||c===void 0||c.call(t,i,o,l),o.selected&&!t.required){(u=t.onSelect)===null||u===void 0||u.call(t,void 0,i,o,l);return}(d=t.onSelect)===null||d===void 0||d.call(t,i,i,o,l)},a={selected:t.selected,onDayClick:r};return s.jsx(oT.Provider,{value:a,children:n})}function vG(){var e=x.useContext(oT);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function WEe(e,t){var n=un(),r=vG(),a=nT(),i=aT(),o=iT(),l=o.focusDayAfter,c=o.focusDayBefore,u=o.focusWeekAfter,d=o.focusWeekBefore,f=o.blur,h=o.focus,m=o.focusMonthBefore,p=o.focusMonthAfter,g=o.focusYearBefore,y=o.focusYearAfter,v=o.focusStartOfWeek,w=o.focusEndOfWeek,b=function($){var R,O,F,z;I1(n)?(R=r.onDayClick)===null||R===void 0||R.call(r,e,t,$):Dv(n)?(O=a.onDayCl
843ick)===null||O===void 0||O.call(a,e,t,$):$v(n)?(F=i.onDayClick)===null||F===void 0||F.call(i,e,t,$):(z=n.onDayClick)===null||z===void 0||z.call(n,e,t,$)},j=function($){var R;h(e),(R=n.onDayFocus)===null||R===void 0||R.call(n,e,t,$)},N=function($){var R;f(),(R=n.onDayBlur)===null||R===void 0||R.call(n,e,t,$)},S=function($){var R;(R=n.onDayMouseEnter)===null||R===void 0||R.call(n,e,t,$)},C=function($){var R;(R=n.onDayMouseLeave)===null||R===void 0||R.call(n,e,t,$)},_=function($){var R;(R=n.onDayPointerEnter)===null||R===void 0||R.call(n,e,t,$)},E=function($){var R;(R=n.onDayPointerLeave)===null||R===void 0||R.call(n,e,t,$)},T=function($){var R;(R=n.onDayTouchCancel)===null||R===void 0||R.call(n,e,t,$)},P=function($){var R;(R=n.onDayTouchEnd)===null||R===void 0||R.call(n,e,t,$)},k=function($){var R;(R=n.onDayTouchMove)===null||R===void 0||R.call(n,e,t,$)},D=function($){var R;(R=n.onDayTouchStart)===null||R===void 0||R.call(n,e,t,$)},A=function($){var R;(R=n.onDayKeyUp)===null||R===void 0||R.call(n,e,t,$)},I=function($){var R;switch($.key){case"ArrowLeft":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?l():c();break;case"ArrowRight":$.preventDefault(),$.stopPropagation(),n.dir==="rtl"?c():l();break;case"ArrowDown":$.preventDefault(),$.stopPropagation(),u();break;case"ArrowUp":$.preventDefault(),$.stopPropagation(),d();break;case"PageUp":$.preventDefault(),$.stopPropagation(),$.shiftKey?g():m();break;case"PageDown":$.preventDefault(),$.stopPropagation(),$.shiftKey?y():p();break;case"Home":$.preventDefault(),$.stopPropagation(),v();break;case"End":$.preventDefault(),$.stopPropagation(),w();break}(R=n.onDayKeyDown)===null||R===void 0||R.call(n,e,t,$)},M={onClick:b,onFocus:j,onBlur:N,onKeyDown:I,onKeyUp:A,onMouseEnter:S,onMouseLeave:C,onPointerEnter:_,onPointerLeave:E,onTouchCancel:T,onTouchEnd:P,onTouchMove:k,onTouchStart:D};return M}function qEe(){var e=un(),t=vG(),n=nT(),r=aT(),a=I1(e)?t.selected:Dv(e)?n.selected:$v(e)?r.selected:void 0;return a}function HEe(e){return Object.values(yi).includes(e)}function KEe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(r){var a=e.modifiersClassNames[r];if(a)n.push(a);else if(HEe(r)){var i=e.classNames["day_".concat(r)];i&&n.push(i)}}),n}function GEe(e,t){var n=at({},e.styles.day);return Object.keys(t).forEach(function(r){var a;n=at(at({},n),(a=e.modifiersStyles)===null||a===void 0?void 0:a[r])}),n}function YEe(e,t,n){var r,a,i,o=un(),l=iT(),c=zEe(e,t),u=WEe(e,c),d=qEe(),f=!!(o.onDayCl
843ick||o.mode!=="default");x.useEffect(function(){var S;c.outside||l.focusedDay&&f&&Ma(l.focusedDay,e)&&((S=n.current)===null||S===void 0||S.focus())},[l.focusedDay,e,n,f,c.outside]);var h=KEe(o,c).join(" "),m=GEe(o,c),p=!!(c.outside&&!o.showOutsideDays||c.hidden),g=(i=(a=o.components)===null||a===void 0?void 0:a.DayContent)!==null&&i!==void 0?i:gEe,y=s.jsx(g,{date:e,displayMonth:t,activeModifiers:c}),v={style:m,className:h,children:y,role:"gridcell"},w=l.focusTarget&&Ma(l.focusTarget,e)&&!c.outside,b=l.focusedDay&&Ma(l.focusedDay,e),j=at(at(at({},v),(r={disabled:c.disabled,role:"gridcell"},r["aria-selected"]=c.selected,r.tabIndex=b||w?0:-1,r)),u),N={isButton:f,isHidden:p,activeModifiers:c,selectedDays:d,buttonProps:j,divProps:v};return N}function XEe(e){var t=x.useRef(null),n=YEe(e.date,e.displayMonth,t);return n.isHidden?s.jsx("div",{role:"gridcell"}):n.isButton?s.jsx(q0,at({name:"day",ref:t},n.buttonProps)):s.jsx("div",at({},n.divProps))}function QEe(e){var t=e.number,n=e.dates,r=un(),a=r.onWeekNumberClick,i=r.styles,o=r.classNames,l=r.locale,c=r.labels.labelWeekNumber,u=r.formatters.formatWeekNumber,d=u(Number(t),{locale:l});if(!a)return s.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:d});var f=c(Number(t),{locale:l}),h=function(m){a(t,n,m)};return s.jsx(q0,{name:"week-number","aria-label":f,className:o.weeknumber,style:i.weeknumber,onClick:h,children:d})}function JEe(e){var t,n,r=un(),a=r.styles,i=r.classNames,o=r.showWeekNumber,l=r.components,c=(t=l==null?void 0:l.Day)!==null&&t!==void 0?t:XEe,u=(n=l==null?void 0:l.WeekNumber)!==null&&n!==void 0?n:QEe,d;return o&&(d=s.jsx("td",{className:i.cell,style:a.cell,children:s.jsx(u,{number:e.weekNumber,dates:e.dates})})),s.jsxs("tr",{className:i.row,style:a.row,children:[d,e.dates.map(function(f){return s.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:s.jsx(c,{displayMonth:e.displayMonth,date:f})},J_e(f))})]})}function a4(e,t,n){for(var r=n!=null&&n.ISOWeek?tG(t):ZO(t,n),a=n!=null&&n.ISOWeek?wd(e):ao(e,n),i=qi(r,a),o=[],l=0;l<=i;l++)o.push(ia(a,l));var c=o.reduce(function(u,d){var f=n!=null&&n.ISOWeek?aG(d):iG(d,n),h=u.find(function(m){return m.weekNumber===f});return h?(h.dates.push(d),u):(u.push({weekNumber:f,dates:[d]}),u)},[]);return c}function ZEe(e,t){var n=a4(za(e),JO(e),t);if(t!=null&&t.useFixedWeeks){var r=e2e(e,t);if(r<6){var a=n[n.length-1],i=a.dates[a.dates.length-1],o=rE(i,6-r),l=a4(rE(i,1),o,t);n.push.apply(n,l)}}return n}function eAe(e){var t,n,r,a=un(),i=a.locale,o=a.classNames,l=a.styles,c=a.hideHead,u=a.fixedWeeks,d=a.components,f=a.weekStartsOn,h=a.firstWeekContainsDate,m=a.ISOWeek,p=ZEe(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:m,locale:i,weekStartsOn:f,firstWeekContainsDate:h}),g=(t=d==null?void 0:d.Head)!==null&&t!==void 0?t:pEe,y=(n=d==null?void 0:d.Row)!==null&&n!==void 0?n:JEe,v=(r=d==null?void 0:d.Footer)!==null&&r!==void 0?r:fEe;return s.jsxs("table",{id:e.id,className:o.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&s.jsx(g,{}),s.jsx("tbody",{className:o.tbody,style:l.tbody,children:p.map(function(w){return s.jsx(y,{displayMonth:e.displayMonth,dates:w.dates,weekNumber:w.weekNumber},w.weekNumber)})}),s.jsx(v,{displayMonth:e.displayMonth})]})}function tAe(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var nAe=tAe()?x.useLayoutEffect:x.useEffect,sC=!1,rAe=0;function s4(){return"react-day-picker-".concat(++rAe)}function aAe(e){var t,n=e??(sC?s4():null),r=x.useState(n),a=r[0],i=r[1];return nAe(function(){a===null&&i(s4())},[]),x.useEffect(function(){sC===!1&&(sC=!0)},[]),(t=e??a)!==null&&t!==void 0?t:void 0}function sAe(e){var t,n,r=un(),a=r.dir,i=r.classNames,o=r.styles,l=r.components,c=Iv().displayMonths,u=aAe(r.id?"".concat(r.id,"-").concat(e.displayIndex):void 0),d=r.id?"".concat(r.id,"-grid-").concat(e.displayIndex):void 0,f=[i.month],h=o.month,m=e.displayIndex===0,p=e.displayIndex===c.length-1,g=!m&&!p;a==="rtl"&&(t=[m,p],p=t[0],m=t[1]),m&&(f.push(i.caption_start),h=at(at({},h),o.caption_start)),p&&(f.push(i.caption_end),h=at(at({},h),o.caption_end)),g&&(f.push(i.caption_between),h=at(at({},h),o.caption_between));var y=(n=l==null?void 0:l.Caption)!==null&&n!==void 0?n:dEe;return s.jsxs("div",{className:f.join(" "),style:h,children:[s.jsx(y,{id:u,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),s.jsx(eAe,{id:d,"aria-labelledby":u,displayMonth:e.displayMonth})]},e.displayIndex)}function iAe(e){var t=un(),n=t.classNames,r=t.styles;return s.jsx("div",{className:n.months,style:r.months,children:e.children})}function oAe(e){var t,n,r=e.initialProps,a=un(),i=iT(),o=Iv(),l=x.useState(!1),c=l[0],u=l[1];x.useEffect(function(){a.initialFocus&&i.focusTarget&&(c||(i.focus(i.focusTarget),u(!0)))},[a.initialFocus,c,i.focus,i.focusTarget,i]);var d=[a.classNames.root,a.className];a.numberOfMonths>1&&d.push(a.classNames.multiple_months),a.showWeekNumber&&d.push(a.classNames.with_weeknumber);var f=at(at({},a.styles.root),a.style),h=Object.keys(r).filter(function(p){return p.startsWith("data-")}).reduce(function(p,g){var y;return at(at({},p),(y={},y[g]=r[g],y))},{}),m=(n=(t=r.components)===null||t===void 0?void 0:t.Months)!==null&&n!==void 0?n:iAe;return s.jsx("div",at({className:d.join(" "),style:f,dir:a.dir,id:a.id,nonce:r.nonce,title:r.title,lang:r.lang},h,{children:s.jsx(m,{children:o.displayMonths.map(function(p,g){return s.jsx(sAe,{displayIndex:g,displayMonth:p},g)})})}))}function lAe(e){var t=e.children,n=T2e(e,["children"]);return s.jsx(Q2e,{initialProps:n,children:s.jsx(oEe,{children:s.jsx(UEe,{initialProps:n,children:s.jsx(yEe,{initialProps:n,children:s.jsx(bEe,{initialProps:n,children:s.jsx(AEe,{children:s.jsx(BEe,{children:t})})})})})})})}function cAe(e){return s.jsx(lAe,at({},e,{children:s.jsx(oAe,{initialProps:e})}))}function $p({className:e,classNames:t,showOutsideDays:n=!0,...r}){return s.jsx(cAe,{showOutsideDays:n,className:te("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
843ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:te(Vg({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:te(Vg({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:({...a})=>s.jsx(Wu,{className:"h-4 w-4"}),IconRight:({...a})=>s.jsx(si,{className:"h-4 w-4"})},...r})}$p.displayName="Calendar";var L1="Popover",[xG,art]=kn(L1,[Vc]),Lv=Vc(),[uAe,Qc]=xG(L1),bG=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:i,modal:o=!1}=e,l=Lv(t),c=x.useRef(null),[u,d]=x.useState(!1),[f,h]=fr({prop:r,defaultProp:a??!1,onChange:i,caller:L1});return s.jsx(Dj,{...l,children:s.jsx(uAe,{scope:t,contentId:Ia(),triggerRef:c,open:f,onOpenChange:h,onOpenToggle:x.useCallback(()=>h(m=>!m),[h]),hasCustomAnchor:u,onCustomAnchorAdd:x.useCallback(()=>d(!0),[]),onCustomAnchorRemove:x.useCallback(()=>d(!1),[]),modal:o,children:n})})};bG.displayName=L1;var wG="PopoverAnchor",dAe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Qc(wG,n),i=Lv(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return x.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(sv,{...i,...r,ref:t})});dAe.displayName=wG;var jG="PopoverTrigger",NG=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Qc(jG,n),i=Lv(n),o=qe(t,a.triggerRef),l=s.jsx(Pe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":AG(a.open),...r,ref:o,onClick:je(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(sv,{asChild:!0,...i,children:l})});NG.displayName=jG;var lT="PopoverPortal",[fAe,hAe]=xG(lT,{forceMount:void 0}),SG=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,i=Qc(lT,t);return s.jsx(fAe,{scope:t,forceMount:n,children:s.jsx(Jn,{present:n||i.open,children:s.jsx(pm,{asChild:!0,container:a,children:r})})})};SG.displayName=lT;var kh="PopoverContent",CG=x.forwardRef((e,t)=>{const n=hAe(kh,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,i=Qc(kh,e.__scopePopover);return s.jsx(Jn,{present:r||i.open,children:i.modal?s.jsx(pAe,{...a,ref:t}):s.jsx(gAe,{...a,ref:t})})});CG.displayName=kh;var mAe=Rc("PopoverContent.RemoveScroll"),pAe=x.forwardRef((e,t)=>{const n=Qc(kh,e.__scopePopover),r=x.useRef(null),a=qe(t,r),i=x.useRef(!1);return x.useEffect(()=>{const o=r.current;if(o)return Qj(o)},[]),s.jsx(pv,{as:mAe,allowPinchZoom:!0,children:s.jsx(_G,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:je(e.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=n.triggerRef.current)==null||l.focus()}),onPointerDownOutside:je(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,u=l.button===2||c;i.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:je(e.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),gAe=x.forwardRef((e,t)=>{const n=Qc(kh,e.__scopePopover),r=x.useRef(!1),a=x.useRef(!1);return s.jsx(_G,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(r.current||(l=n.triggerRef.current)==null||l.focus(),i.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:i=>{var c,u;(c=e.onInteractOutside)==null||c.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),_G=x.forwardRef((e,t)=>
843{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...f}=e,h=Qc(kh,n),m=Lv(n);return Gj(),s.jsx(hv,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Pd,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:s.jsx($j,{"data-state":AG(h.open),role:"dialog",id:h.contentId,...m,...f,ref:t,style:{...f.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)"}})})})}),EG="PopoverClose",yAe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Qc(EG,n);return s.jsx(Pe.button,{type:"button",...r,ref:t,onClick:je(e.onClick,()=>a.onOpenChange(!1))})});yAe.displayName=EG;var vAe="PopoverArrow",xAe=x.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=Lv(n);return s.jsx(Ij,{...a,...r,ref:t})});xAe.displayName=vAe;function AG(e){return e?"open":"closed"}var bAe=bG,wAe=NG,jAe=SG,PG=CG;const Ip=bAe,Lp=wAe,jf=x.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>s.jsx(jAe,{children:s.jsx(PG,{ref:a,align:t,sideOffset:n,className:te("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground 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),...r})}));jf.displayName=PG.displayName;const iC=[{value:7,label:"Last 7 days"},{value:14,label:"Last 14 days"},{value:30,label:"Last 30 days"},{value:60,label:"Last 60 days"},{value:90,label:"Last 90 days"},{value:365,label:"Last year"}];
843function NAe({config:e,onChange:t,compact:n=!1,disabled:r=!1}){const[a,i]=x.useState((e==null?void 0:e.mode)||"between"),[o,l]=x.useState(e!=null&&e.startDate?new Date(e.startDate):void 0),[c,u]=x.useState(e!=null&&e.endDate?new Date(e.endDate):void 0),[d,f]=x.useState((e==null?void 0:e.relativeDays)||30);x.useEffect(()=>{let y,v;switch(a){case"between":y=o?Vo(o):void 0,v=c?eC(c):void 0;break;case"before":v=c?eC(c):void 0;break;case"after":y=o?Vo(o):void 0;break;case"relative":y=Vo(_b(new Date,d)),v=eC(new Date);break}t(y,v)},[a,o,c,d,t]);const h=()=>{l(void 0),u(void 0),f(30)},m=y=>y?Xc(y,"PP",{locale:dp}):"Select date",p=()=>{var y;switch(a){case"between":return o&&c?`${m(o)} - ${m(c)}`:o?`From ${m(o)}`:c?`Until ${m(c)}`:"Select range";case"before":return c?`Before ${m(c)}`:"Select date";case"after":return o?`After ${m(o)}`:"Select date";case"relative":return((y=iC.find(v=>v.value===d))==null?void 0:y.label)||"Select period"}},g=o||c||a==="relative"&&d>0;return n?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Ip,{children:[s.jsx(Lp,{asChild:!0,children:s.jsxs(U,{variant:"outline",size:"sm",className:te("justify-start text-left font-normal flex-1",!g&&"text-muted-foreground"),disabled:r,children:[s.jsx(Zs,{className:"mr-2 h-4 w-4"}),s.jsx("span",{className:"truncate",children:p()})]})}),s.jsx(jf,{className:"w-auto p-0",align:"start",children:s.jsxs("div",{className:"p-3 space-y-3",children:[s.jsxs(rt,{value:a,onValueChange:y=>i(y),children:[s.jsx(tt,{className:"w-full",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"between",children:"Between"}),s.jsx(_e,{value:"before",children:"Before"}),s.jsx(_e,{value:"after",children:"After"}),s.jsx(_e,{value:"relative",children:"Relative"})]})]}),a==="relative"?s.jsxs(rt,{value:String(d),onValueChange:y=>f(Number(y)),children:[s.jsx(tt,{children:s.jsx(st,{})}),s.jsx(nt,{children:iC.map(y=>s.jsx(_e,{value:String(y.value),children:y.label},y.value))})]}):s.jsx($p,{mode:a==="between"?"range":"single",selected:a==="between"?{from:o,to:c}:a==="after"?o:c,onSelect:y=>{a==="between"?(l(y==null?void 0:y.from),u(y==null?void 0:y.to)):a==="after"?l(y):u(y)},locale:dp,numberOfMonths:1})]})})]}),g&&s.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:h,disabled:r,children:s.jsx(ua,{className:"h-4 w-4"})})]}):s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(rt,{value:a,onValueChange:y=>i(y),children:[s.jsx(tt,{className:"w-[140px]",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"between",children:"Between"}),s.jsx(_e,{value:"before",children:"Before"}),s.jsx(_e,{value:"after",children:"After"}),s.jsx(_e,{value:"relative",children:"Relative"})]})]}),g&&s.jsxs(U,{variant:"ghost",size:"sm",onClick:h,disabled:r,children:[s.jsx(ua,{className:"h-4 w-4 mr-1"}),"Clear"]})]}),a==="relative"?s.jsxs(rt,{value:String(d),onValueChange:y=>f(Number(y)),disabled:r,children:[s.jsx(tt,{children:s.jsx(st,{})}),s.jsx(nt,{children:iC.map(y=>s.jsx(_e,{value:String(y.value),children:y.label},y.value))})]}):a==="between"?s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("div",{children:[s.jsx(pe,{className:"text-xs text-muted-foreground mb-1 block",children:"From"}),s.jsxs(Ip,{children:[s.jsx(Lp,{asChild:!0,children:s.jsxs(U,{variant:"outline",className:te("w-full justify-start text-left font-normal",!o&&"text-muted-foreground"),disabled:r,children:[s.jsx(Zs,{className:"mr-2 h-4 w-4"}),o?m(o):"Start"]})}),s.jsx(jf,{className:"w-auto p-0",align:"start",children:s.jsx($p,{mode:"single",selected:o,onSelect:l,locale:dp})})]})]}),s.jsxs("div",{children:[s.jsx(pe,{className:"text-xs text-muted-foreground mb-1 block",children:"To"}),s.jsxs(Ip,{children:[s.jsx(Lp,{asChild:!0,children:s.jsxs(U,{variant:"outline",className:te("w-full justify-start text-left font-normal",!c&&"text-muted-foreground"),disabled:r,children:[s.jsx(Zs,{className:"mr-2 h-4 w-4"}),c?m(c):"End"]})}),s.jsx(jf,{className:"w-auto p-0",align:"start",children:s.jsx($p,{mode:"single",selected:c,onSelect:u,locale:dp,disabled:y=>o?y<o:!1})})]})]})]}):s.jsxs(Ip,{children:[s.jsx(Lp,{asChild:!0,children:s.jsxs(U,{variant:"outline",className:te("w-full justify-start text-left font-normal",!(a==="after"?o:c)&&"text-muted-foreground"),disabled:r,children:[s.jsx(Zs,{className:"mr-2 h-4 w-4"}),a==="after"?o?m(o):"Select date":c?m(c):"Select date"]})}),s.jsx(jf,{className:"w-auto p-0",align:"start",children:s.jsx($p,{mode:"single",selected:a==="after"?o:c,onSelect:a==="after"?l:u,locale:dp})})]}),g&&s.jsx("div",{className:"text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded",children:p()})]})}function SAe({slicerType:e,values:t,selectedValues:n,onChange:r,config:a,compact:i=!1,disabled:o=!1}){const[l,c]=x.useState(""),u=x.useMemo(()=>
843{if(!l.trim())return t;const v=l.toLowerCase();return t.filter(w=>w.toLowerCase().includes(v))},[t,l]),d=x.useCallback(v=>{e==="dropdown"?r(n.includes(v)?[]:[v]):n.includes(v)?r(n.filter(w=>w!==v)):r([...n,v])},[e,n,r]),f=x.useCallback(()=>{const v=new Set([...n,...u]);r(Array.from(v))},[u,n,r]),h=x.useCallback(()=>{r([]),c("")},[r]),m=(a==null?void 0:a.maxVisibleItems)||8,p=(a==null?void 0:a.showSearch)??!0,g=(a==null?void 0:a.showSelectAll)??(e==="multi-select"||e==="list"),y=()=>n.length===0?"All":n.length===1?n[0]:`${n.length} selected`;return e==="dropdown"?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(rt,{value:n[0]||"",onValueChange:v=>r(v?[v]:[]),disabled:o,children:[s.jsx(tt,{className:te("w-full",i&&"h-8"),children:s.jsx(st,{placeholder:"All"})}),s.jsxs(nt,{children:[p&&s.jsx("div",{className:"p-2 pb-0",children:s.jsxs("div",{className:"relative mb-2",children:[s.jsx(ii,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search...",value:l,onChange:v=>c(v.target.value),className:"pl-8 h-8",onKeyDown:v=>v.stopPropagation()})]})}),s.jsxs(Ba,{className:p?"h-[200px]":"max-h-[300px]",children:[u.map(v=>s.jsx(_e,{value:v,children:v},v)),u.length===0&&s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No results found"})]})]})]}),n.length>0&&s.jsx(U,{variant:"ghost",size:"sm",className:te("p-0",i?"h-8 w-8":"h-9 w-9"),onClick:h,disabled:o,children:s.jsx(ua,{className:"h-4 w-4"})})]}):e==="multi-select"?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(Ip,{children:[s.jsx(Lp,{asChild:!0,children:s.jsxs(U,{variant:"outline",role:"combobox",className:te("w-full justify-between",i&&"h-8",n.length===0&&"text-muted-foreground"),disabled:o,children:[s.jsx("span",{className:"truncate",children:y()}),s.jsx(Jr,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),s.jsxs(jf,{className:"w-[250px] p-0",align:"start",children:[s.jsxs("div",{className:"p-2 space-y-2",children:[p&&s.jsxs("div",{className:"relative",children:[s.jsx(ii,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search...",value:l,onChange:v=>c(v.target.value),className:"pl-8 h-8"})]}),g&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs flex-1",onClick:f,children:"Select All"}),s.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs flex-1",onClick:h,children:"Clear"})]})]}),s.jsx(Ba,{className:"h-[200px]",children:s.jsxs("div",{className:"p-2 space-y-1",children:[u.map(v=>{const w=n.includes(v);return s.jsxs("div",{className:te("flex items-center space-x-2 px-2 py-1.5 rounded-md cursor-pointer hover:bg-muted/50",w&&"bg-primary/10"),onClick:()=>d(v),children:[s.jsx(Hc,{checked:w,onCheckedChange:()=>d(v)}),s.jsx("span",{className:"text-sm truncate flex-1",children:v})]},v)}),u.length===0&&s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No results found"})]})}),n.length>0&&s.jsxs("div",{className:"border-t px-3 py-2 text-xs text-muted-foreground",children:[n.length," of ",t.length," selected"]})]})]}),n.length>0&&s.jsx(U,{variant:"ghost",size:"sm",className:te("p-0",i?"h-8 w-8":"h-9 w-9"),onClick:h,disabled:o,children:s.jsx(ua,{className:"h-4 w-4"})})]}):s.jsxs("div",{className:"space-y-2",children:[p&&s.jsxs("div",{className:"relative",children:[s.jsx(ii,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search...",value:l,onChange:v=>c(v.target.value),className:"pl-8 h-8",disabled:o})]}),g&&s.jsxs("div",{className:"flex gap-2",children:[s.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs flex-1",onClick:f,disabled:o,children:"Select All"}),s.jsx(U,{variant:"ghost",size:"sm",className:"h-7 text-xs flex-1",onClick:h,disabled:o,children:"Clear"})]}),s.jsx(Ba,{className:te("border rounded-md",i?"h-[120px]":"h-[180px]"),children:s.jsxs("div",{className:"p-1 space-y-0.5",children:[u.slice(0,m*2).map(v=>{const w=n.includes(v);return s.jsxs("div",{className:te("flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer transition-colors",w?"bg-primary text-primary-foreground":"hover:bg-muted/50",o&&"pointer-events-none opacity-50"),onClick:()=>!o&&d(v),children:[w&&s.jsx(bt,{className:"h-3.5 w-3.5 shrink-0"}),s.jsx("span",{className:te("text-sm truncate",w&&"font-medium"),children:v})]},v)}),u.length===0&&s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No results found"}),u.length>m*2&&s.jsxs("div",{className:"px-2 py-1 text-center text-xs text-muted-foreground",children:["+",u.length-m*2," more items"]})]})}),n.length>0&&!i&&s.jsxs("div",{className:"flex flex-wrap gap-1",children:[n.slice(0,3).map(v
843=>s.jsxs($e,{variant:"secondary",className:"text-xs",children:[v,s.jsx("button",{className:"ml-1 hover:text-destructive",onClick:()=>d(v),disabled:o,children:s.jsx(ua,{className:"h-3 w-3"})})]},v)),n.length>3&&s.jsxs($e,{variant:"outline",className:"text-xs",children:["+",n.length-3," more"]})]})]})}var kG=["PageUp","PageDown"],OG=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],TG={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Om="Slider",[sE,CAe,_Ae]=mm(Om),[MG,srt]=kn(Om,[_Ae]),[EAe,F1]=MG(Om),RG=x.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:c=0,defaultValue:u=[r],value:d,onValueChange:f=()=>{},onValueCommit:h=()=>{},inverted:m=!1,form:p,...g}=e,y=x.useRef(new Set),v=x.useRef(0),b=o==="horizontal"?AAe:PAe,[j=[],N]=fr({prop:d,defaultProp:u,onChange:P=>{var D;(D=[...y.current][v.current])==null||D.focus(),f(P)}}),S=x.useRef(j);function C(P){const k=RAe(j,P);T(P,k)}function _(P){T(P,v.current)}function E(){const P=S.current[v.current];j[v.current]!==P&&h(j)}function T(P,k,{commit:D}={commit:!1}){const A=LAe(i),I=FAe(Math.round((P-r)/i)*i+r,A),M=Hg(I,[r,a]);N(($=[])=>{const R=TAe($,M,k);if(IAe(R,c*i)){v.current=R.indexOf(M);const O=String(R)!==String($);return O&&D&&h(R),O?R:$}else return $})}return s.jsx(EAe,{scope:e.__scopeSlider,name:n,disabled:l,min:r,max:a,valueIndexToChangeRef:v,thumbs:y.current,values:j,orientation:o,form:p,children:s.jsx(sE.Provider,{scope:e.__scopeSlider,children:s.jsx(sE.Slot,{scope:e.__scopeSlider,children:s.jsx(b,{"aria-disabled":l,"data-disabled":l?"":void 0,...g,ref:t,onPointerDown:je(g.onPointerDown,()=>{l||(S.current=j)}),min:r,max:a,inverted:m,onSlideStart:l?void 0:C,onSlideMove:l?void 0:_,onSlideEnd:l?void 0:E,onHomeKeyDown:()=>!l&&T(r,0,{commit:!0}),onEndKeyDown:()=>!l&&T(a,j.length-1,{commit:!0}),onStepKeyDown:({event:P,direction:k})=>{if(!l){const I=kG.includes(P.key)||P.shiftKey&&OG.includes(P.key)?10:1,M=v.current,$=j[M],R=i*I*k;T($+R,M,{commit:!0})}}})})})})});RG.displayName=Om;var[DG,$G]=MG(Om,{startEdge:"left",endEdge:"right",size:"width",direction:1}),AAe=x.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:c,onStepKeyDown:u,...d}=e,[f,h]=x.useState(null),m=qe(t,b=>h(b)),p=x.useRef(void 0),g=wl(a),y=g==="ltr",v=y&&!i||!y&&i;function w(b){const j=p.current||f.getBoundingClientRect(),N=[0,j.width],C=cT(N,v?[n,r]:[r,n]);return p.current=j,C(b-j.left)}return s.jsx(DG,{scope:e.__scopeSlider,startEdge:v?"left":"right",endEdge:v?"right":"left",direction:v?1:-1,size:"width",children:s.jsx(IG,{dir:g,"data-orientation":"horizontal",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:b=>{const j=w(b.clientX);o==null||o(j)},onSlideMove:b=>{const j=w(b.clientX);l==null||l(j)},onSlideEnd:()=>{p.current=void 0,c==null||c()},onStepKeyDown:b=>{const N=TG[v?"from-left":"from-right"].includes(b.key);u==null||u({event:b,direction:N?-1:1})}})})}),PAe=x.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:l,onStepKeyDown:c,...u}=e,d=x.useRef(null),f=qe(t,d),h=x.useRef(void 0),m=!a;function p(g){const y=h.current||d.current.getBoundingClientRect(),v=[0,y.height],b=cT(v,m?[r,n]:[n,r]);return h.current=y,b(g-y.top)}return s.jsx(DG,{scope:e.__scopeSlider,startEdge:m?"bottom":"top",endEdge:m?"top":"bottom",size:"height",direction:m?1:-1,children:s.jsx(IG,{"data-orientation":"vertical",...u,ref:f,style:{...u.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{const y=p(g.clientY);i==null||i(y)},onSlideMove:g=>{const y=p(g.clientY);o==null||o(y)},onSlideEnd:()=>{h.current=void 0,l==null||l()},onStepKeyDown:g=>{const v=TG[m?"from-bottom":"from-top"].includes(g.key);c==null||c({event:g,direction:v?-1:1})}})})}),IG=x.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:c,...u}=e,d=F1(Om,n);return s.jsx(Pe.span,{...u,ref:t,onKeyDown:je(e.onKeyDown,f=>{f.key==="Home"?(o(f),f.preventDefault()):f.key==="End"?(l(f),f.preventDefault()):kG.concat(OG).includes(f.key)&&(c(f),f.preventDefault())}),onPointerDown:je(e.onPointerDown,f=>{const h=f.target;h.setPointerCapture(f.pointerId),f.preventDefault(),d.thumbs.has(h)?h.focus():r(f)}),onPointerMove:je(e.onPointerMove,f=>{f.target.hasPointerCapture(f.pointerId)&&a(f)}),onPointerUp:je(e.onPointerUp,f=>{const h=f.target;h.hasPointerCapture(f.pointerId)&&(h.releasePointerCapture(f.pointerId),i(f))})})}),LG="SliderTrack",FG=x.forwardRef((e,t)=>
843{const{__scopeSlider:n,...r}=e,a=F1(LG,n);return s.jsx(Pe.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});FG.displayName=LG;var iE="SliderRange",BG=x.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=F1(iE,n),i=$G(iE,n),o=x.useRef(null),l=qe(t,o),c=a.values.length,u=a.values.map(h=>VG(h,a.min,a.max)),d=c>1?Math.min(...u):0,f=100-Math.max(...u);return s.jsx(Pe.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:l,style:{...e.style,[i.startEdge]:d+"%",[i.endEdge]:f+"%"}})});BG.displayName=iE;var oE="SliderThumb",zG=x.forwardRef((e,t)=>{const n=CAe(e.__scopeSlider),[r,a]=x.useState(null),i=qe(t,l=>a(l)),o=x.useMemo(()=>r?n().findIndex(l=>l.ref.current===r):-1,[n,r]);return s.jsx(kAe,{...e,ref:i,index:o})}),kAe=x.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...i}=e,o=F1(oE,n),l=$G(oE,n),[c,u]=x.useState(null),d=qe(t,w=>u(w)),f=c?o.form||!!c.closest("form"):!0,h=av(c),m=o.values[r],p=m===void 0?0:VG(m,o.min,o.max),g=MAe(r,o.values.length),y=h==null?void 0:h[l.size],v=y?DAe(y,p,l.direction):0;return x.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${p}% + ${v}px)`},children:[s.jsx(sE.ItemSlot,{scope:e.__scopeSlider,children:s.jsx(Pe.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":o.min,"aria-valuenow":m,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:d,style:m===void 0?{display:"none"}:e.style,onFocus:je(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),f&&s.jsx(UG,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:m},r)]})});zG.displayName=oE;var OAe="RadioBubbleInput",UG=x.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=x.useRef(null),i=qe(a,r),o=vv(t);return x.useEffect(()=>{const l=a.current;if(!l)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==t&&d){const f=new Event("input",{bubbles:!0});d.call(l,t),l.dispatchEvent(f)}},[o,t]),s.jsx(Pe.input,{style:{display:"none"},...n,ref:i,defaultValue:t})});UG.displayName=OAe;function TAe(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,i)=>a-i)}function VG(e,t,n){const i=100/(n-t)*(e-t);return Hg(i,[0,100])}function MAe(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function RAe(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function DAe(e,t,n){const r=e/2,i=cT([0,50],[0,r]);return(r-i(t)*n)*n}function $Ae(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function IAe(e,t){if(t>0){const n=$Ae(e);return Math.min(...n)>=t}return!0}function cT(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function LAe(e){return(String(e).split(".")[1]||"").length}function FAe(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var WG=RG,BAe=FG,zAe=BG,UAe=zG;const lE=x.forwardRef(({className:e,...t},n)=>s.jsxs(WG,{ref:n,className:te("relative flex w-full touch-none select-none items-center",e),...t,children:[s.jsx(BAe,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:s.jsx(zAe,{className:"absolute h-full bg-primary"})}),s.jsx(UAe,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]}));lE.displayName=WG.displayName;function VAe({config:e,values:t,onChange:n,compact:r=!1,disabled:a=!1}){const i=x.useMemo(()=>{let N=e==null?void 0:e.min,S=e==null?void 0:e.max,C=(e==null?void 0:e.step)??1;if(t&&t.length>0){const _=t.filter(E=>!isNaN(E)&&isFinite(E));if(_.length>0){N===void 0&&(N=Math.min(..._)),S===void 0&&(S=Math.max(..._));const E=S-N;E<=1?C=.01:E<=10?C=.1:E<=100?C=1:E<=1e3?C=10:C=100}}return{min:N??0,max:S??100,step:C}},[e==null?void 0:e.min,e==null?void 0:e.max,e==null?void 0:e.step,t]),[o,l]=x.useState(e==null?void 0:e.selectedMin),[c,u]=x.useState(e==null?void 0:e.selectedMax),[d,f]=x.use
843State(o!==void 0?String(o):""),[h,m]=x.useState(c!==void 0?String(c):"");x.useEffect(()=>{n(o,c)},[o,c,n]),x.useEffect(()=>{f(o!==void 0?String(o):""),m(c!==void 0?String(c):"")},[o,c]);const p=x.useCallback(N=>{const[S,C]=N;l(S!==i.min?S:void 0),u(C!==i.max?C:void 0)},[i.min,i.max]),g=x.useCallback(N=>{const S=N.target.value;if(f(S),S==="")l(void 0);else{const C=parseFloat(S);isNaN(C)||l(Math.max(i.min,Math.min(C,c??i.max)))}},[i.min,i.max,c]),y=x.useCallback(N=>{const S=N.target.value;if(m(S),S==="")u(void 0);else{const C=parseFloat(S);isNaN(C)||u(Math.min(i.max,Math.max(C,o??i.min)))}},[i.min,i.max,o]),v=x.useCallback(()=>{l(void 0),u(void 0),f(""),m("")},[]),w=[o??i.min,c??i.max],b=o!==void 0||c!==void 0,j=N=>i.step<1?N.toFixed(2):N.toLocaleString();return r?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsx(lE,{value:w,min:i.min,max:i.max,step:i.step,onValueChange:p,disabled:a,className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[s.jsx("span",{children:j(w[0])}),s.jsx("span",{children:j(w[1])})]})]}),b&&s.jsx(U,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0",onClick:v,disabled:a,children:s.jsx(ua,{className:"h-4 w-4"})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"px-1",children:s.jsx(lE,{value:w,min:i.min,max:i.max,step:i.step,onValueChange:p,disabled:a,className:"w-full"})}),s.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground px-1",children:[s.jsx("span",{children:j(i.min)}),s.jsx("span",{children:j(i.max)})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx(pe,{className:"text-xs text-muted-foreground mb-1 block",children:"Min"}),s.jsx(Re,{type:"number",value:d,onChange:g,placeholder:String(i.min),min:i.min,max:c??i.max,step:i.step,disabled:a,className:"h-8"})]}),s.jsxs("div",{children:[s.jsx(pe,{className:"text-xs text-muted-foreground mb-1 block",children:"Max"}),s.jsx(Re,{type:"number",value:h,onChange:y,placeholder:String(i.max),min:o??i.min,max:i.max,step:i.step,disabled:a,className:"h-8"})]})]}),b&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"text-xs text-muted-foreground bg-muted/50 px-2 py-1 rounded",children:["Range: ",j(o??i.min)," - ",j(c??i.max)]}),s.jsxs(U,{variant:"ghost",size:"sm",className:"h-7 text-xs",onClick:v,disabled:a,children:[s.jsx(ua,{className:"h-3 w-3 mr-1"}),"Clear"]})]})]})}const WAe={"date-range":Zs,dropdown:Jr,"multi-select":ez,list:el,"numeric-range":JP};function cE({block:e,data:t,isSelected:n=!1,onClick:r,editMode:a=!0,compact:i=!1,disabled:o=!1}){var j,N;const l=GCe(),c=x.useMemo(()=>{if(!t||t.length===0||!e.column)return[];const S=new Set;return t.forEach(C=>{const _=C[e.column];_!=null&&_!==""&&S.add(String(_))}),Array.from(S).sort((C,_)=>C.localeCompare(_))},[t,e.column]),u=x.useMemo(()=>!t||t.length===0||!e.column?[]:t.map(S=>{const C=S[e.column];return typeof C=="number"?C:parseFloat(C)}).filter(S=>!isNaN(S)&&isFinite(S)),[t,e.column]),d=l==null?void 0:l.getFilter(e.id),f=x.useMemo(()=>{var S;return(d==null?void 0:d.value.type)==="categorical"?d.value.selected:((S=e.categoricalConfig)==null?void 0:S.selectedValues)||[]},[d,(j=e.categoricalConfig)==null?void 0:j.selectedValues]),h=x.useCallback((S,C)=>{l&&(!S&&!C?l.clearFilter(e.id):l.setFilter(e.id,e.column,e.slicerType,{type:"date-range",start:S,end:C}))},[l,e.id,e.column,e.slicerType]),m=x.useCallback(S=>{l&&(S.length===0?l.clearFilter(e.id):l.setFilter(e.id,e.column,e.slicerType,{type:"categorical",selected:S}))},[l,e.id,e.column,e.slicerType]),p=x.useCallback((S,C)=>{l&&(S===void 0&&C===void 0?l.clearFilter(e.id):l.setFilter(e.id,e.column,e.slicerType,{type:"numeric-range",min:S,max:C}))},[l,e.id,e.column,e.slicerType]),g=x.useCallback(()=>{l==null||l.clearFilter(e.id)},[l,e.id]),y=x.useMemo(()=>{if(!d)return!1;switch(d.value.type){case"date-range":return d.value.start!==void 0||d.value.end!==void 0;case"categorical":return d.value.selected.length>0;case"numeric-range":return d.value.min!==void 0||d.value.max!==void 0;default:return!1}},[d]),v=WAe[e.slicerType]||Va,w=()=>
843{if(!e.column)return s.jsx("div",{className:"text-sm text-muted-foreground text-center py-4",children:"Select a column to filter"});switch(e.slicerType){case"date-range":return s.jsx(NAe,{config:e.dateConfig,onChange:h,compact:i,disabled:o});case"dropdown":case"multi-select":case"list":return s.jsx(SAe,{slicerType:e.slicerType,values:c,selectedValues:f,onChange:m,config:e.categoricalConfig,compact:i,disabled:o});case"numeric-range":return s.jsx(VAe,{config:e.numericConfig,values:u,onChange:p,compact:i,disabled:o});default:return s.jsxs("div",{className:"text-sm text-muted-foreground text-center py-4",children:["Unknown filter type: ",e.slicerType]})}},b=((N=e.style)==null?void 0:N.showTitle)??!0;return s.jsxs(Z,{className:te("h-full transition-all duration-200",n&&"ring-2 ring-primary ring-offset-2",a&&"cursor-pointer hover:shadow-md",y&&"border-primary/50 bg-primary/5"),onClick:r,children:[b&&s.jsxs(we,{className:te("pb-2",i&&"p-3 pb-1"),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Ne,{className:te("flex items-center gap-2",i?"text-sm":"text-base"),children:[s.jsx(v,{className:te("text-primary",i?"h-4 w-4":"h-5 w-5")}),s.jsx("span",{className:"truncate",children:e.title})]}),y&&s.jsx(U,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:S=>{S.stopPropagation(),g()},children:s.jsx(ua,{className:"h-3.5 w-3.5"})})]}),e.column&&s.jsx($e,{variant:"outline",className:"text-xs mt-1 w-fit",children:e.column})]}),s.jsx(le,{className:te(i?"p-3 pt-2":"p-4 pt-2"),children:w()})]})}var B1="Switch",[qAe,irt]=kn(B1),[HAe,KAe]=qAe(B1),qG=x.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:i,required:o,disabled:l,value:c="on",onCheckedChange:u,form:d,...f}=e,[h,m]=x.useState(null),p=qe(t,b=>m(b)),g=x.useRef(!1),y=h?d||!!h.closest("form"):!0,[v,w]=fr({prop:a,defaultProp:i??!1,onChange:u,caller:B1});return s.jsxs(HAe,{scope:n,checked:v,disabled:l,children:[s.jsx(Pe.button,{type:"button",role:"switch","aria-checked":v,"aria-required":o,"data-state":YG(v),"data-disabled":l?"":void 0,disabled:l,value:c,...f,ref:p,onClick:je(e.onClick,b=>{w(j=>!j),y&&(g.current=b.isPropagationStopped(),g.current||b.stopPropagation())})}),y&&s.jsx(GG,{control:h,bubbles:!g.current,name:r,value:c,checked:v,required:o,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});qG.displayName=B1;var HG="SwitchThumb",KG=x.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=KAe(HG,n);return s.jsx(Pe.span,{"data-state":YG(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});KG.displayName=HG;var GAe="SwitchBubbleInput",GG=x.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},i)=>{const o=x.useRef(null),l=qe(o,i),c=vv(n),u=av(t);return x.useEffect(()=>{const d=o.current;if(!d)return;const f=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(f,"checked").set;if(c!==n&&m){const p=new Event("click",{bubbles:r});m.call(d,n),d.dispatchEvent(p)}},[c,n,r]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:l,style:{...a.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});GG.displayName=GAe;function YG(e){return e?"checked":"unchecked"}var XG=qG,YAe=KG;const xn=x.forwardRef(({className:e,...t},n)=>s.jsx(XG,{className:te("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e),...t,ref:n,children:s.jsx(YAe,{className:te("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));xn.displayName=XG.displayName;const Lx={date:"Date columns",numeric:"Numeric columns",categorical:"Text columns",text:"Text columns"};function Ab({label:e,value:t,onChange:n,columns:r,placeholder:a="Select column",showTypes:i,allowNone:o=!1,noneLabel:l="None",disabled:c=!1,className:u,description:d}){const f=i||["date","numeric","categorical","text"],h=f.includes("date")?r.date||[]:[],m=f.includes("numeric")?r.numeric||[]:[],p=f.includes("categorical")?r.categorical||r.text||[]:[],g=f.includes("text")&&!f.includes("categorical")?r.text||[]:[],y=h.length>0||m.length>0||p.length>0||g.length>0;return s.jsxs("div",{className:te("space-y-2",u),children:[s.jsx(pe,{children:e}),d&&s.jsx("p",{className:"text-xs text-muted-foreground",children:d}
843),s.jsxs(rt,{value:t||"",onValueChange:n,disabled:c,children:[s.jsx(tt,{children:s.jsx(st,{placeholder:a})}),s.jsxs(nt,{children:[o&&s.jsx(_e,{value:"__none__",children:s.jsx("div",{className:"flex items-center gap-2 text-muted-foreground",children:l})}),h.length>0&&s.jsxs(Ex,{children:[s.jsx(Mp,{children:Lx.date}),h.map(v=>s.jsx(_e,{value:v.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zs,{className:"h-4 w-4 text-muted-foreground"}),v.name]})},v.name))]}),m.length>0&&s.jsxs(Ex,{children:[s.jsx(Mp,{children:Lx.numeric}),m.map(v=>s.jsx(_e,{value:v.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(JP,{className:"h-4 w-4 text-muted-foreground"}),v.name]})},v.name))]}),p.length>0&&s.jsxs(Ex,{children:[s.jsx(Mp,{children:Lx.categorical}),p.map(v=>s.jsx(_e,{value:v.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(el,{className:"h-4 w-4 text-muted-foreground"}),v.name]})},v.name))]}),g.length>0&&s.jsxs(Ex,{children:[s.jsx(Mp,{children:Lx.text}),g.map(v=>s.jsx(_e,{value:v.name,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(el,{className:"h-4 w-4 text-muted-foreground"}),v.name]})},v.name))]}),!y&&!o&&s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No columns available"})]})]})]})}function XAe(e){const t=y2.map(n=>({type:n.type,recommended:!1}));switch(e){case"date":return t.map(n=>({...n,recommended:n.type==="date-range"}));case"number":return t.map(n=>({...n,recommended:n.type==="numeric-range"}));case"string":case"boolean":default:return t.map(n=>({...n,recommended:["dropdown","multi-select","list"].includes(n.type)}))}}const QAe={"date-range":Zs,dropdown:Jr,"multi-select":ez,list:el,"numeric-range":JP};function JAe({block:e,columns:t,onUpdate:n,className:r}){var f,h,m,p,g,y,v,w;const a=(b,j)=>{n({...e,[b]:j})},i=(b,j)=>{n({...e,style:{...e.style,[b]:j}})},o=b=>{n({...e,layout:{...e.layout,colSpan:b}})},l=t.find(b=>b.name===e.column),c=(l==null?void 0:l.type)||"unknown",u=XAe(c),d=x.useMemo(()=>({date:t.filter(b=>b.type==="date"),numeric:t.filter(b=>b.type==="number"),categorical:t.filter(b=>b.type==="string"||b.type==="unknown")}),[t]);return s.jsxs(Z,{className:te("w-full",r),children:[s.jsx(we,{className:"pb-3",children:s.jsxs(Ne,{className:"text-lg flex items-center gap-2",children:[s.jsx(Oj,{className:"h-5 w-5"}),"Filter Settings"]})}),s.jsx(le,{children:s.jsxs(fo,{defaultValue:"data",className:"w-full",children:[s.jsxs(ji,{className:"grid w-full grid-cols-2",children:[s.jsxs(Rt,{value:"data",className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-4 w-4"}),"Data"]}),s.jsxs(Rt,{value:"style",className:"flex items-center gap-2",children:[s.jsx(GP,{className:"h-4 w-4"}),"Style"]})]}),s.jsxs(Ft,{value:"data",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"title",children:"Title"}),s.jsx(Re,{id:"title",value:e.title,onChange:b=>a("title",b.target.value),placeholder:"Filter title"})]}),s.jsx(Ab,{label:"Column",value:e.column,onChange:b=>a("column",b),columns:d}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Filter Type"}),s.jsxs(rt,{value:e.slicerType,onValueChange:b=>a("slicerType",b),children:[s.jsx(tt,{children:s.jsx(st,{})}),s.jsx(nt,{children:u.map(({type:b,recommended:j})=>{const N=y2.find(C=>C.type===b),S=QAe[b];return s.jsx(_e,{value:b,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(S,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{children:N==null?void 0:N.name}),j&&s.jsx("span",{className:"text-xs text-primary",children:"(Recommended)"})]})},b)})})]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:(f=y2.find(b=>b.type===e.slicerType))==null?void 0:f.description})]}),s.jsx(Kr,{}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Width"}),s.jsxs(rt,{value:String(((h=e.layout)==null?void 0:h.colSpan)||3),onValueChange:b=>o(Number(b)),children:[s.jsx(tt,{children:s.jsx(st,{})}),s.jsx(nt,{children:Oa.map(b=>s.jsx(_e,{value:String(b),children:b===3?"Quarter width (3/12)":b===4?"Third width (4/12)":b===6?"Half width (6/12)":"Full width (12/12)"},b))})]})]})]}
843),s.jsxs(Ft,{value:"style",className:"space-y-4 mt-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Show Title"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Display the filter title"})]}),s.jsx(xn,{checked:((m=e.style)==null?void 0:m.showTitle)??!0,onCheckedChange:b=>i("showTitle",b)})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Compact Mode"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Use smaller, compact layout"})]}),s.jsx(xn,{checked:((p=e.style)==null?void 0:p.compact)??!1,onCheckedChange:b=>i("compact",b)})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Show Clear Button"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Show button to clear selection"})]}),s.jsx(xn,{checked:((g=e.style)==null?void 0:g.showClearButton)??!0,onCheckedChange:b=>i("showClearButton",b)})]}),(e.slicerType==="dropdown"||e.slicerType==="multi-select"||e.slicerType==="list")&&s.jsxs(s.Fragment,{children:[s.jsx(Kr,{}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Show Search"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Enable search within values"})]}),s.jsx(xn,{checked:((y=e.categoricalConfig)==null?void 0:y.showSearch)??!0,onCheckedChange:b=>{var j,N,S;return a("categoricalConfig",{...e.categoricalConfig,showSearch:b,showSelectAll:((j=e.categoricalConfig)==null?void 0:j.showSelectAll)??!1,maxVisibleItems:((N=e.categoricalConfig)==null?void 0:N.maxVisibleItems)??10,selectedValues:((S=e.categoricalConfig)==null?void 0:S.selectedValues)??[]})}})]}),(e.slicerType==="multi-select"||e.slicerType==="list")&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Show Select All"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:'Show "Select All" button'})]}),s.jsx(xn,{checked:((v=e.categoricalConfig)==null?void 0:v.showSelectAll)??!1,onCheckedChange:b=>{var j,N,S;return a("categoricalConfig",{...e.categoricalConfig,showSearch:((j=e.categoricalConfig)==null?void 0:j.showSearch)??!0,showSelectAll:b,maxVisibleItems:((N=e.categoricalConfig)==null?void 0:N.maxVisibleItems)??10,selectedValues:((S=e.categoricalConfig)==null?void 0:S.selectedValues)??[]})}})]})]}),e.slicerType==="numeric-range"&&s.jsxs(s.Fragment,{children:[s.jsx(Kr,{}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Step Size"}),s.jsx(Re,{type:"number",value:((w=e.numericConfig)==null?void 0:w.step)??1,onChange:b=>a("numericConfig",{...e.numericConfig,step:parseFloat(b.target.value)||1}),min:.01,step:.01}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Increment step for the slider"})]})]})]})]})})]})}const uE={primary:{name:"Primary",colors:["hsl(262, 83%, 58%)","hsl(239, 84%, 67%)","hsl(221, 83%, 53%)","hsl(199, 89%, 48%)","hsl(173, 80%, 40%)","hsl(160, 84%, 39%)"],preview:"linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%)"},ocean:{name:"Ocean",colors:["hsl(199, 89%, 48%)","hsl(187, 85%, 53%)","hsl(173, 80%, 40%)","hsl(160, 84%, 39%)","hsl(142, 71%, 45%)","hsl(158, 64%, 52%)"],preview:"linear-gradient(135deg, #0EA5E9 0%, #22D3EE 100%)"},sunset:{name:"Sunset",colors:["hsl(0, 84%, 60%)","hsl(25, 95%, 53%)","hsl(45, 93%, 47%)","hsl(38, 92%, 50%)","hsl(32, 95%, 44%)","hsl(15, 90%, 55%)"],preview:"linear-gradient(135deg, #EF4444 0%, #F97316 50%, #FBBF24 100%)"},forest:{name:"Forest",colors:["hsl(142, 71%, 45%)","hsl(158, 64%, 52%)","hsl(172, 66%, 50%)","hsl(168, 76%, 42%)","hsl(162, 63%, 41%)","hsl(149, 61%, 39%)"],preview:"linear-gradient(135deg, #22C55E 0%, #34D399 100%)"},purple:{name:"Purple Dream",colors:["hsl(271, 91%, 65%)","hsl(292, 84%, 61%)","hsl(330, 81%, 60%)","hsl(340, 82%, 52%)","hsl(350, 89%, 60%)","hsl(280, 85%, 58%)"],preview:"linear-gradient(135deg, #A855F7 0%, #EC4899 100%)"},monochrome:{name:"Monochrome",colors:["hsl(0, 0%, 15%)","hsl(0, 0%, 35%)","hsl(0, 0%, 50%)","hsl(0, 0%, 65%)","hsl(0, 0%, 80%)","hsl(0, 0%, 25%)"],preview:"linear-gradient(135deg, #262626 0%, #737373 100%)"}},i4="primary",ZAe=(e=i4)=>{var t;return((t=uE[e])==null?void 0:t.colors)||uE[i4].colors},QG=(e,t,n,r="sum",a={})=>{const{sortByValue:i=!0,sortDirection:o="desc",limit:l=15}=a;if(!e||e.length===0||!t)return[];const c=new Map;e.forEach(d=>{const f=String(d[t]??"Unknown"),h=parseFloat(String(d[n]??0))||0;c.has(f)||c.set(f,{sum:0,count:0,values:[]});const m=c.get(f);m.sum+=h,m.count+=1,m.values.push(h)});const u=[];
843return c.forEach((d,f)=>{let h;switch(r){case"avg":h=d.count>0?d.sum/d.count:0;break;case"count":h=d.count;break;case"min":h=d.values.length>0?Math.min(...d.values):0;break;case"max":h=d.values.length>0?Math.max(...d.values):0;break;case"sum":default:h=d.sum}u.push({name:f,value:Math.round(h*100)/100})}),i&&u.sort((d,f)=>o==="desc"?f.value-d.value:d.value-f.value),l>0?u.slice(0,l):u},Vf={colorScheme:"primary",showLegend:!0,showGrid:!0,showValues:!1,legendPosition:"bottom"},uT=280,ePe=()=>({backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}),tPe=(e="bottom")=>{const t={top:{verticalAlign:"top",align:"center"},bottom:{verticalAlign:"bottom",align:"center"},left:{verticalAlign:"middle",align:"left"},right:{verticalAlign:"middle",align:"right"}};return t[e]||t.bottom},fp={bar:{icon:Xn,label:"Bar Chart"},column:{icon:Xn,label:"Column Chart"},line:{icon:FB,label:"Line Chart"},area:{icon:I_,label:"Area Chart"},pie:{icon:F_,label:"Pie Chart"},donut:{icon:zB,label:"Donut Chart"},scatter:{icon:B_,label:"Scatter Plot"},bubble:{icon:B_,label:"Bubble Chart"},"stacked-bar":{icon:Mg,label:"Stacked Bar"},"stacked-column":{icon:Mg,label:"Stacked Column"},"stacked-area":{icon:I_,label:"Stacked Area"},combo:{icon:ai,label:"Combo Chart"},radar:{icon:ZP,label:"Radar Chart"},radial:{icon:WB,label:"Radial Gauge"},treemap:{icon:gm,label:"Treemap"},funnel:{icon:L_,label:"Funnel Chart"},histogram:{icon:L_,label:"Histogram"},table:{icon:xr,label:"Data Table"},kpi:{icon:nd,label:"KPI Card"}};function nPe({chart:e,columns:t,onUpdate:n,onCancel:r,onSave:a,isNew:i=!1}){var m;const[o,l]=x.useState("data"),c=x.useMemo(()=>({numeric:(t==null?void 0:t.numeric)||[],categorical:(t==null?void 0:t.categorical)||[],date:(t==null?void 0:t.date)||[],all:(t==null?void 0:t.all)||[]}),[t]),u=x.useMemo(()=>({...e,style:e.style||Vf}),[e]),d=p=>{n({...u,...p})},f=p=>{n({...u,style:{...u.style,...p}})},h=x.useMemo(()=>c.categorical.filter(p=>p.name!==u.x_column&&p.name!==u.y_column),[c.categorical,u.x_column,u.y_column]);return s.jsxs(Z,{className:"w-full max-w-md border-2",children:[s.jsx(we,{className:"pb-3",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ne,{className:"text-lg",children:i?"New Chart":"Edit Chart"}),s.jsx($e,{variant:"outline",className:"font-normal",children:((m=fp[u.type])==null?void 0:m.label)||u.type})]})}),s.jsxs(fo,{value:o,onValueChange:l,className:"w-full",children:[s.jsx("div",{className:"px-6",children:s.jsxs(ji,{className:"grid w-full grid-cols-2",children:[s.jsx(Rt,{value:"data",children:"Data"}),s.jsx(Rt,{value:"style",children:"Style"})]})}),s.jsxs(le,{className:"pt-4",children:[s.jsxs(Ft,{value:"data",className:"mt-0 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{htmlFor:"chart-title",className:"flex items-center gap-2",children:[s.jsx(sd,{className:"h-4 w-4"}),"Chart Title"]}),s.jsx(Re,{id:"chart-title",value:u.title,onChange:p=>d({title:p.target.value}),placeholder:"Enter chart title"})]}),s.jsx(Kr,{}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Chart Type"}),s.jsx("div",{className:"grid grid-cols-4 gap-2",children:Object.keys(fp).map(p=>{const g=fp[p],y=g.icon;return s.jsxs(U,{variant:u.type===p?"default":"outline",size:"sm",className:"h-auto py-3 flex flex-col gap-1",onClick:()=>{var S,C;const v=(S=fp[u.type])==null?void 0:S.label,w=(C=fp[p])==null?void 0:C.label,b=u.type,j=`${b.charAt(0).toUpperCase()+b.slice(1)} Chart`,N=!u.title||u.title===v||u.title===j;d({type:p,...N&&w?{title:w}:{}})},children:[s.jsx(y,{className:"h-5 w-5"}),s.jsx("span",{className:"text-[10px]",children:g.label.split(" ")[0]})]},p)})})]}),s.jsx(Kr,{}),(()=>{const p=u.type,g=["bar","column","stacked-bar","stacked-column","line","area","stacked-area","combo","histogram","scatter","bubble"].includes(p),y=["pie","donut","funnel","treemap"].includes(p),v=["radar","radial"].includes(p),w=p==="kpi",b=p==="table"||p==="heatmap",j=g?"X-Axis (Category)":w?void 0:"Category",N=g?"Y-Axis (Value)":"Value (Metric)",S=g||y||v,C=g&&h.length>0;return s.jsxs(s.Fragment,{children:[!w&&j&&s.jsx(Ab,{label:j,value:u.x_column,onChange:_=>d({x_column:_}),columns:{date:c.date,categorical:c.categorical,numeric:b?c.numeric:[]}}),s.jsx(Ab,{label:w?"Metric Column":N,value:u.y_column,onChange:_=>d({y_column:_}),columns:{numeric:c.numeric},showTypes:["numeric"]}),S&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"aggregation",children:"Aggregation"}),s.jsxs(rt,{value:u.aggregation||"sum",onValueChange:_=>d({aggregation:_}),children:[s.jsx(tt,{id:"aggregation",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"sum",children:"Sum (Total)"}),s.jsx(_e,{value:"avg",children:"Average (Mean)"}),s.jsx(_e,{value:"count",children:"Count"}),s.jsx(_e,{value:"min",children:"Minimum"}),s.jsx(_e,{value:"max",children:"Maximum"})]})]})]}),C&&s.jsx(Ab,{label:"Group By (optional)",value:u.groupBy||"__none__",onCh
843ange:_=>d({groupBy:_==="__none__"?void 0:_}),columns:{categorical:h},showTypes:["categorical"],allowNone:!0,noneLabel:"None"})]})})()]}),s.jsxs(Ft,{value:"style",className:"mt-0 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pe,{className:"flex items-center gap-2",children:[s.jsx(GP,{className:"h-4 w-4"}),"Color Scheme"]}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(uE).map(([p,g])=>s.jsxs(U,{variant:u.style.colorScheme===p?"default":"outline",size:"sm",className:"h-auto py-2 flex flex-col gap-1",onClick:()=>f({colorScheme:p}),children:[s.jsx("div",{className:"w-full h-2 rounded-full",style:{background:g.preview}}),s.jsx("span",{className:"text-xs",children:g.name})]},p))})]}),s.jsx(Kr,{}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(pe,{htmlFor:"show-legend",className:"flex items-center gap-2 cursor-pointer",children:[u.style.showLegend?s.jsx(ui,{className:"h-4 w-4"}):s.jsx(gre,{className:"h-4 w-4"}),"Show Legend"]}),s.jsx(xn,{id:"show-legend",checked:u.style.showLegend,onCheckedChange:p=>f({showLegend:p})})]}),u.style.showLegend&&s.jsxs("div",{className:"space-y-2 pl-6",children:[s.jsx(pe,{htmlFor:"legend-position",className:"text-sm text-muted-foreground",children:"Legend Position"}),s.jsxs(rt,{value:u.style.legendPosition||"bottom",onValueChange:p=>f({legendPosition:p}),children:[s.jsx(tt,{id:"legend-position",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"top",children:"Top"}),s.jsx(_e,{value:"bottom",children:"Bottom"}),s.jsx(_e,{value:"left",children:"Left"}),s.jsx(_e,{value:"right",children:"Right"})]})]})]}),s.jsx(Kr,{}),u.type!=="pie"&&s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(pe,{htmlFor:"show-grid",className:"flex items-center gap-2 cursor-pointer",children:[s.jsx(gm,{className:"h-4 w-4"}),"Show Grid Lines"]}),s.jsx(xn,{id:"show-grid",checked:u.style.showGrid,onCheckedChange:p=>f({showGrid:p})})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(pe,{htmlFor:"show-values",className:"flex items-center gap-2 cursor-pointer",children:[s.jsx(sd,{className:"h-4 w-4"}),"Show Data Values"]}),s.jsx(xn,{id:"show-values",checked:u.style.showValues,onCheckedChange:p=>f({showValues:p})})]})]})]})]}),s.jsxs("div",{className:"flex justify-end gap-2 px-6 pb-6",children:[s.jsx(U,{variant:"outline",onClick:r,children:"Cancel"}),s.jsx(U,{onClick:a,children:i?"Add Chart":"Save Changes"})]})]})}var rPe=Array.isArray,ba=rPe,aPe=typeof Qv=="object"&&Qv&&Qv.Object===Object&&Qv,JG=aPe,sPe=JG,iPe=typeof self=="object"&&self&&self.Object===Object&&self,oPe=sPe||iPe||Function("return this")(),Ci=oPe,lPe=Ci,cPe=lPe.Symbol,Tm=cPe,o4=Tm,ZG=Object.prototype,uPe=ZG.hasOwnProperty,dPe=ZG.toString,hp=o4?o4.toStringTag:void 0;function fPe(e){var t=uPe.call(e,hp),n=e[hp];try{e[hp]=void 0;var r=!0}catch{}var a=dPe.call(e);return r&&(t?e[hp]=n:delete e[hp]),a}var hPe=fPe,mPe=Object.prototype,pPe=mPe.toString;function gPe(e){return pPe.call(e)}var yPe=gPe,l4=Tm,vPe=hPe,xPe=yPe,bPe="[object Null]",wPe="[object Undefined]",c4=l4?l4.toStringTag:void 0;function jPe(e){return e==null?e===void 0?wPe:bPe:c4&&c4 in Object(e)?vPe(e):xPe(e)}var El=jPe;function NPe(e){return e!=null&&typeof e=="object"}var _i=NPe,SPe=El,CPe=_i,_Pe="[object Symbol]";function EPe(e){return typeof e=="symbol"||CPe(e)&&SPe(e)==_Pe}var Mm=EPe,APe=ba,PPe=Mm,kPe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,OPe=/^\w*$/;function TPe(e,t){if(APe(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||PPe(e)?!0:OPe.test(e)||!kPe.test(e)||t!=null&&e in Object(t)}var dT=TPe;function MPe(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ei=MPe;const Rm=$t(Ei);var RPe=El,DPe=Ei,$Pe="[object AsyncFunction]",IPe="[object Function]",LPe="[object GeneratorFunction]",FPe="[object Proxy]";function BPe(e){if(!DPe(e))return!1;var t=RPe(e);return t==IPe||t==LPe||t==$Pe||t==FPe}var fT=BPe;const ze=$t(fT);var zPe=Ci,UPe=zPe["__core-js_shared__"],VPe=UPe,oC=VPe,u4=function(){var e=/[^.]+$/.exec(oC&&oC.keys&&oC.keys.IE_PROTO||"");
vendor: 4,289 bytes, line 843
843return e?"Symbol(src)_1."+e:""}();function WPe(e){return!!u4&&u4 in e}var qPe=WPe,HPe=Function.prototype,KPe=HPe.toString;function GPe(e){if(e!=null){try{return KPe.call(e)}catch{}try{return e+""}catch{}}return""}var eY=GPe,YPe=fT,XPe=qPe,QPe=Ei,JPe=eY,ZPe=/[\\^$.*+?()[\]{}|]/g,eke=/^\[object .+?Constructor\]$/,tke=Function.prototype,nke=Object.prototype,rke=tke.toString,ake=nke.hasOwnProperty,ske=RegExp("^"+rke.call(ake).replace(ZPe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ike(e){if(!QPe(e)||XPe(e))return!1;var t=YPe(e)?ske:eke;return t.test(JPe(e))}var oke=ike;function lke(e,t){return e==null?void 0:e[t]}var cke=lke,uke=oke,dke=cke;function fke(e,t){var n=dke(e,t);return uke(n)?n:void 0}var Rd=fke,hke=Rd,mke=hke(Object,"create"),z1=mke,d4=z1;function pke(){this.__data__=d4?d4(null):{},this.size=0}var gke=pke;function yke(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var vke=yke,xke=z1,bke="__lodash_hash_undefined__",wke=Object.prototype,jke=wke.hasOwnProperty;function Nke(e){var t=this.__data__;if(xke){var n=t[e];return n===bke?void 0:n}return jke.call(t,e)?t[e]:void 0}var Ske=Nke,Cke=z1,_ke=Object.prototype,Eke=_ke.hasOwnProperty;function Ake(e){var t=this.__data__;return Cke?t[e]!==void 0:Eke.call(t,e)}var Pke=Ake,kke=z1,Oke="__lodash_hash_undefined__";function Tke(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=kke&&t===void 0?Oke:t,this}var Mke=Tke,Rke=gke,Dke=vke,$ke=Ske,Ike=Pke,Lke=Mke;function Dm(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Dm.prototype.clear=Rke;Dm.prototype.delete=Dke;Dm.prototype.get=$ke;Dm.prototype.has=Ike;Dm.prototype.set=Lke;var Fke=Dm;function Bke(){this.__data__=[],this.size=0}var zke=Bke;function Uke(e,t){return e===t||e!==e&&t!==t}var U1=Uke,Vke=U1;function Wke(e,t){for(var n=e.length;n--;)if(Vke(e[n][0],t))return n;return-1}var V1=Wke,qke=V1,Hke=Array.prototype,Kke=Hke.splice;function Gke(e){var t=this.__data__,n=qke(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():Kke.call(t,n,1),--this.size,!0}var Yke=Gke,Xke=V1;function Qke(e){var t=this.__data__,n=Xke(t,e);return n<0?void 0:t[n][1]}var Jke=Qke,Zke=V1;function eOe(e){return Zke(this.__data__,e)>-1}var tOe=eOe,nOe=V1;function rOe(e,t){var n=this.__data__,r=nOe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var aOe=rOe,sOe=zke,iOe=Yke,oOe=Jke,lOe=tOe,cOe=aOe;function $m(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}$m.prototype.clear=sOe;$m.prototype.delete=iOe;$m.prototype.get=oOe;$m.prototype.has=lOe;$m.prototype.set=cOe;var W1=$m,uOe=Rd,dOe=Ci,fOe=uOe(dOe,"Map"),hT=fOe,f4=Fke,hOe=W1,mOe=hT;function pOe(){this.size=0,this.__data__={hash:new f4,map:new(mOe||hOe),string:new f4}}var gOe=pOe;function yOe(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var vOe=yOe,xOe=vOe;function bOe(e,t){var n=e.__data__;return xOe(t)?n[typeof t=="string"?"string":"hash"]:n.map}var q1=bOe,wOe=q1;function jOe(e){var t=wOe(this,e).delete(e);return this.size-=t?1:0,t}var NOe=jOe,SOe=q1;function COe(e){return SOe(this,e).get(e)}var _Oe=COe,EOe=q1;function AOe(e){return EOe(this,e).has(e)}var POe=AOe,kOe=q1;function OOe(e,t){var n=kOe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var TOe=OOe,MOe=gOe,ROe=NOe,DOe=_Oe,$Oe=POe,IOe=TOe;function Im(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Im.prototype.clear=MOe;Im.prototype.delete=ROe;Im.prototype.get=DOe;Im.prototype.has=$Oe;Im.prototype.set=IOe;var mT=Im,tY=mT,LOe="Expected a function";function pT(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(LOe);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],i=n.cache;if(i.has(a))return i.get(a);var o=e.apply(this,r);return n.cache=i.set(a,o)||i,o};return n.cache=new(pT.Cache||tY),n}pT.Cache=tY;var nY=pT;const FOe=$t(nY);var BOe=nY,zOe=500;function UOe(e){var t=BOe(e,function(r){return n.size===zOe&&n.clear(),r}),n=t.cache;return t}var VOe=UOe,WOe=VOe,qOe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,HOe=/\\(\\)?/g,KOe=WOe(function(e){var t=[];
843return e.charCodeAt(0)===46&&t.push(""),e.replace(qOe,function(n,r,a,i){t.push(a?i.replace(HOe,"$1"):r||n)}),t}),GOe=KOe;function YOe(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var H1=YOe,h4=Tm,XOe=H1,QOe=ba,JOe=Mm,ZOe=1/0,m4=h4?h4.prototype:void 0,p4=m4?m4.toString:void 0;function rY(e){if(typeof e=="string")return e;if(QOe(e))return XOe(e,rY)+"";if(JOe(e))return p4?p4.call(e):"";var t=e+"";return t=="0"&&1/e==-ZOe?"-0":t}var eTe=rY,tTe=eTe;function nTe(e){return e==null?"":tTe(e)}var aY=nTe,rTe=ba,aTe=dT,sTe=GOe,iTe=aY;function oTe(e,t){return rTe(e)?e:aTe(e,t)?[e]:sTe(iTe(e))}var K1=oTe,lTe=Mm,cTe=1/0;function uTe(e){if(typeof e=="string"||lTe(e))return e;var t=e+"";return t=="0"&&1/e==-cTe?"-0":t}var Fv=uTe,dTe=K1,fTe=Fv;function hTe(e,t){t=dTe(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[fTe(t[n++])];return n&&n==r?e:void 0}var G1=hTe,mTe=G1;function pTe(e,t,n){var r=e==null?void 0:mTe(e,t);return r===void 0?n:r}var sY=pTe;const Ua=$t(sY);function gTe(e){return e==null}var yTe=gTe;const Ke=$t(yTe);var vTe=El,xTe=ba,bTe=_i,wTe="[object String]";function jTe(e){return typeof e=="string"||!xTe(e)&&bTe(e)&&vTe(e)==wTe}var NTe=jTe;const Lc=$t(NTe);var iY={exports:{}},Gt={};/**
844 * @license React
845 * react-is.production.min.js
846 *
847 * Copyright (c) Facebook, Inc. and its affiliates.
848 *
849 * This source code is licensed under the MIT license found in the
850 * LICENSE file in the root directory of this source tree.
851 */var gT=Symbol.for("react.element"),yT=Symbol.for("react.portal"),Y1=Symbol.for("react.fragment"),X1=Symbol.for("react.strict_mode"),Q1=Symbol.for("react.profiler"),J1=Symbol.for("react.provider"),Z1=Symbol.for("react.context"),STe=Symbol.for("react.server_context"),eN=Symbol.for("react.forward_ref"),tN=Symbol.for("react.suspense"),nN=Symbol.for("react.suspense_list"),rN=Symbol.for("react.memo"),aN=Symbol.for("react.lazy"),CTe=Symbol.for("react.offscreen"),oY;oY=Symbol.for("react.module.reference");function Ds(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case gT:switch(e=e.type,e){case Y1:case Q1:case X1:case tN:case nN:return e;default:switch(e=e&&e.$$typeof,e){case STe:case Z1:case eN:case aN:case rN:case J1:return e;default:return t}}case yT:return t}}}Gt.ContextConsumer=Z1;Gt.ContextProvider=J1;Gt.Element=gT;Gt.ForwardRef=eN;Gt.Fragment=Y1;Gt.Lazy=aN;Gt.Memo=rN;Gt.Portal=yT;Gt.Profiler=Q1;Gt.StrictMode=X1;Gt.Suspense=tN;Gt.SuspenseList=nN;Gt.isAsyncMode=function(){return!1};Gt.isConcurrentMode=function(){return!1};Gt.isContextConsumer=function(e){return Ds(e)===Z1};Gt.isContextProvider=function(e){return Ds(e)===J1};Gt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===gT};Gt.isForwardRef=function(e){return Ds(e)===eN};Gt.isFragment=function(e){return Ds(e)===Y1};Gt.isLazy=function(e){return Ds(e)===aN};Gt.isMemo=function(e){return Ds(e)===rN};Gt.isPortal=function(e){return Ds(e)===yT};Gt.isProfiler=function(e){return Ds(e)===Q1};Gt.isStrictMode=function(e){return Ds(e)===X1};Gt.isSuspense=function(e){return Ds(e)===tN};Gt.isSuspenseList=function(e){return Ds(e)===nN};Gt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Y1||e===Q1||e===X1||e===tN||e===nN||e===CTe||typeof e=="object"&&e!==null&&(e.$$typeof===aN||e.$$typeof===rN||e.$$typeof===J1||e.$$typeof===Z1||e.$$typeof===eN||e.$$typeof===oY||e.getModuleId!==void 0)};Gt.typeOf=Ds;iY.exports=Gt;var _Te=iY.exports,ETe=El,ATe=_i,PTe="[object Number]";function kTe(e){return typeof e=="number"||ATe(e)&&ETe(e)==PTe}var lY=kTe;const cY=$t(lY);var OTe=lY;function TTe(e){return OTe(e)&&e!=+e}var MTe=TTe;const Jc=$t(MTe);var Nr=function(t){return t===0?0:t>0?1:-1},Au=function(t){return Lc(t)&&t.indexOf("%")===t.length-1},Ee=function(t){return cY(t)&&!Jc(t)},RTe=function(t){return Ke(t)},dr=function(t){return Ee(t)||Lc(t)},DTe=0,Al=function(t){var n=++DTe;return"".concat(t||"").concat(n)},oa=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ee(t)&&!Lc(t))return r;var i;if(Au(t)){var o=t.indexOf("%");i=n*parseFloat(t.slice(0,o))/100}else i=+t;return Jc(i)&&(i=r),a&&i>n&&(i=n),i},ec=function(t){if(!t)return null;var n=Object.keys(t);
vendor: 5,475 bytes, line 851
851return n&&n.length?t[n[0]]:null},$Te=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a<n;a++)if(!r[t[a]])r[t[a]]=!0;else return!0;return!1},yt=function(t,n){return Ee(t)&&Ee(n)?function(r){return t+r*(n-t)}:function(){return n}};function H0(e,t,n){return!e||!e.length?null:e.find(function(r){return r&&(typeof t=="function"?t(r):Ua(r,t))===n})}var ITe=function(t){if(!t||!t.length)return null;for(var n=t.length,r=0,a=0,i=0,o=0,l=1/0,c=-1/0,u=0,d=0,f=0;f<n;f++)u=t[f].cx||0,d=t[f].cy||0,r+=u,a+=d,i+=u*d,o+=u*u,l=Math.min(l,u),c=Math.max(c,u);var h=n*o!==r*r?(n*i-r*a)/(n*o-r*r):0;return{xmin:l,xmax:c,a:h,b:(a-h*r)/n}},LTe=function(t,n){return Ee(t)&&Ee(n)?t-n:Lc(t)&&Lc(n)?t.localeCompare(n):t instanceof Date&&n instanceof Date?t.getTime()-n.getTime():String(t).localeCompare(String(n))};function Wf(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function dE(e){"@babel/helpers - typeof";return dE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dE(e)}var FTe=["viewBox","children"],BTe=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],g4=["points","pathLength"],lC={svg:FTe,polygon:g4,polyline:g4},vT=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
851ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],K0=function(t,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var r=t;if(x.isValidElement(t)&&(r=t.props),!Rm(r))return null;var a={};return Object.keys(r).forEach(function(i){vT.includes(i)&&(a[i]=n||function(o){return r[i](r,o)})}),a},zTe=function(t,n,r){return function(a){return t(n,r,a),null}},vi=function(t,n,r){if(!Rm(t)||dE(t)!=="object")return null;var a=null;return Object.keys(t).forEach(function(i){var o=t[i];vT.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=zTe(o,n,r))}),a},UTe=["children"],VTe=["children"];function y4(e,t){if(e==null)return{};var n=WTe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WTe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fE(e){"@babel/helpers - typeof";return fE=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fE(e)}var v4={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"}
vendor: 4,488 bytes, line 851
851,Wo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},x4=null,cC=null,sN=function e(t){if(t===x4&&Array.isArray(cC))return cC;var n=[];return x.Children.forEach(t,function(r){Ke(r)||(_Te.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),cC=n,x4=t,n};function Or(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return Wo(a)}):r=[Wo(t)],sN(e).forEach(function(a){var i=Ua(a,"type.displayName")||Ua(a,"type.name");r.indexOf(i)!==-1&&n.push(a)}),n}function Vr(e,t){var n=Or(e,t);return n&&n[0]}var hE=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!Ee(r)||r<=0||!Ee(a)||a<=0)},qTe=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],uY=function(t){return t&&t.type&&Lc(t.type)&&qTe.indexOf(t.type)>=0},dY=function(t){return t&&fE(t)==="object"&&"clipDot"in t},HTe=function(t,n,r,a){var i,o=(i=lC==null?void 0:lC[a])!==null&&i!==void 0?i:[];return n.startsWith("data-")||!ze(t)&&(a&&o.includes(n)||BTe.includes(n))||r&&vT.includes(n)},KTe=function(t){var n=[];return sN(t).forEach(function(r){uY(r)&&n.push(r)}),n},Me=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(x.isValidElement(t)&&(a=t.props),!Rm(a))return null;var i={};return Object.keys(a).forEach(function(o){var l;HTe((l=a)===null||l===void 0?void 0:l[o],o,n,r)&&(i[o]=a[o])}),i},mE=function e(t,n){if(t===n)return!0;var r=x.Children.count(t);if(r!==x.Children.count(n))return!1;if(r===0)return!0;if(r===1)return b4(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var i=t[a],o=n[a];if(Array.isArray(i)||Array.isArray(o)){if(!e(i,o))return!1}else if(!b4(i,o))return!1}return!0},b4=function(t,n){if(Ke(t)&&Ke(n))return!0;if(!Ke(t)&&!Ke(n)){var r=t.props||{},a=r.children,i=y4(r,UTe),o=n.props||{},l=o.children,c=y4(o,VTe);return a&&l?Wf(i,c)&&mE(a,l):!a&&!l?Wf(i,c):!1}return!1},w4=function(t,n){var r=[],a={};return sN(t).forEach(function(i,o){if(uY(i))r.push(i);else if(i){var l=Wo(i.type),c=n[l]||{},u=c.handler,d=c.once;if(u&&(!d||!a[l])){var f=u(i,l,o);r.push(f),a[l]=!0}}}),r},GTe=function(t){var n=t&&t.type;return n&&v4[n]?v4[n]:null},YTe=function(t,n){return sN(n).indexOf(t)},XTe=["children","width","height","viewBox","className","style","title","desc"];function pE(){return pE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pE.apply(this,arguments)}function QTe(e,t){if(e==null)return{};var n=JTe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JTe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function G0(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,i=e.className,o=e.style,l=e.title,c=e.desc,u=QTe(e,XTe),d=a||{width:n,height:r,x:0,y:0},f=Ge("recharts-surface",i);return L.createElement("svg",pE({},Me(u,!0,"svg"),{className:f,width:n,height:r,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),L.createElement("title",null,l),L.createElement("desc",null,c),t)}var ZTe=["children","className"];function gE(){return gE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gE.apply(this,arguments)}function eMe(e,t){if(e==null)return{};var n=tMe(e,t),r,a;
851if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tMe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var He=L.forwardRef(function(e,t){var n=e.children,r=e.className,a=eMe(e,ZTe),i=Ge("recharts-layer",r);return L.createElement("g",gE({className:i},Me(a,!0),{ref:t}),n)}),oi=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),i=2;i<r;i++)a[i-2]=arguments[i]};function nMe(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(a);++r<a;)i[r]=e[r+t];return i}var fY=nMe,rMe=fY;function aMe(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:rMe(e,t,n)}var sMe=aMe,iMe="\\ud800-\\udfff",oMe="\\u0300-\\u036f",lMe="\\ufe20-\\ufe2f",cMe="\\u20d0-\\u20ff",uMe=oMe+lMe+cMe,dMe="\\ufe0e\\ufe0f",fMe="\\u200d",hMe=RegExp("["+fMe+iMe+uMe+dMe+"]");function mMe(e){return hMe.test(e)}var hY=mMe;function pMe(e){return e.split("")}var gMe=pMe,mY="\\ud800-\\udfff",yMe="\\u0300-\\u036f",vMe="\\ufe20-\\ufe2f",xMe="\\u20d0-\\u20ff",bMe=yMe+vMe+xMe,wMe="\\ufe0e\\ufe0f",jMe="["+mY+"]",yE="["+bMe+"]",vE="\\ud83c[\\udffb-\\udfff]",NMe="(?:"+yE+"|"+vE+")",pY="[^"+mY+"]",gY="(?:\\ud83c[\\udde6-\\uddff]){2}",yY="[\\ud800-\\udbff][\\udc00-\\udfff]",SMe="\\u200d",vY=NMe+"?",xY="["+wMe+"]?",CMe="(?:"+SMe+"(?:"+[pY,gY,yY].join("|")+")"+xY+vY+")*",_Me=xY+vY+CMe,EMe="(?:"+[pY+yE+"?",yE,gY,yY,jMe].join("|")+")",AMe=RegExp(vE+"(?="+vE+")|"+EMe+_Me,"g");function PMe(e){return e.match(AMe)||[]}var kMe=PMe,OMe=gMe,TMe=hY,MMe=kMe;function RMe(e){return TMe(e)?MMe(e):OMe(e)}var DMe=RMe,$Me=sMe,IMe=hY,LMe=DMe,FMe=aY;function BMe(e){return function(t){t=FMe(t);var n=IMe(t)?LMe(t):void 0,r=n?n[0]:t.charAt(0),a=n?$Me(n,1).join(""):t.slice(1);return r[e]()+a}}var zMe=BMe,UMe=zMe,VMe=UMe("toUpperCase"),WMe=VMe;const iN=$t(WMe);function on(e){return function(){return e}}const bY=Math.cos,Y0=Math.sin,Ai=Math.sqrt,X0=Math.PI,oN=2*X0,xE=Math.PI,bE=2*xE,yu=1e-6,qMe=bE-yu;function wY(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function HMe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return wY;const n=10**t;return function(r){this._+=r[0];for(let a=1,i=r.length;a<i;++a)this._+=Math.round(arguments[a]*n)/n+r[a]}}class KMe{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?wY:HMe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,a){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+a}`}bezierCurveTo(t,n,r,a,i,o){this._append`C${+t},${+n},${+r},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(t,n,r,a,i){if(t=+t,n=+n,r=+r,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=r-t,u=a-n,d=o-t,f=l-n,h=d*d+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(h>yu)if(!(Math.abs(f*c-u*d)>yu)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-o,p=a-l,g=c*c+u*u,y=m*m+p*p,v=Math.sqrt(g),w=Math.sqrt(h),b=i*Math.tan((xE-Math.acos((g+h-y)/(2*v*w)))/2),j=b/w,N=b/v;Math.abs(j-1)>yu&&this._append`L${t+j*d},${n+j*f}`,this._append`A${i},${i},0,0,${+(f*m>d*p)},${this._x1=t+N*c},${this._y1=n+N*u}`}}arc(t,n,r,a,i,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(a),c=r*Math.sin(a),u=t+l,d=n+c,f=1^o,h=o?a-i:i-a;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>yu||Math.abs(this._y1-d)>yu)&&this._append`L${u},${d}`,r&&(h<0&&(h=h%bE+bE),h>qMe?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:h>yu&&this._append`A${r},${r},0,${+(h>=xE)},${f},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function xT(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new KMe(t)}function bT(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function jY(e){this._context=e}jY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function lN(e){return new jY(e)}function NY(e){return e[0]}function SY(e){return e[1]}function CY(e,t){var n=on(!0),r=null,a=lN,i=null,o=xT(l);e=typeof e=="function"?e:e===void 0?NY:on(e),t=typeof t=="function"?t:t===void 0?SY:on(t);function l(c){var u,d=(c=bT(c)).length,f,h=!1,m;
vendor: 10,797 bytes, line 851
851for(r==null&&(i=a(m=o())),u=0;u<=d;++u)!(u<d&&n(f=c[u],u,c))===h&&((h=!h)?i.lineStart():i.lineEnd()),h&&i.point(+e(f,u,c),+t(f,u,c));if(m)return i=null,m+""||null}return l.x=function(c){return arguments.length?(e=typeof c=="function"?c:on(+c),l):e},l.y=function(c){return arguments.length?(t=typeof c=="function"?c:on(+c),l):t},l.defined=function(c){return arguments.length?(n=typeof c=="function"?c:on(!!c),l):n},l.curve=function(c){return arguments.length?(a=c,r!=null&&(i=a(r)),l):a},l.context=function(c){return arguments.length?(c==null?r=i=null:i=a(r=c),l):r},l}function Fx(e,t,n){var r=null,a=on(!0),i=null,o=lN,l=null,c=xT(u);e=typeof e=="function"?e:e===void 0?NY:on(+e),t=typeof t=="function"?t:on(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?SY:on(+n);function u(f){var h,m,p,g=(f=bT(f)).length,y,v=!1,w,b=new Array(g),j=new Array(g);for(i==null&&(l=o(w=c())),h=0;h<=g;++h){if(!(h<g&&a(y=f[h],h,f))===v)if(v=!v)m=h,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),p=h-1;p>=m;--p)l.point(b[p],j[p]);l.lineEnd(),l.areaEnd()}v&&(b[h]=+e(y,h,f),j[h]=+t(y,h,f),l.point(r?+r(y,h,f):b[h],n?+n(y,h,f):j[h]))}if(w)return l=null,w+""||null}function d(){return CY().defined(a).curve(o).context(i)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:on(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:on(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:on(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:on(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:on(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:on(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(a=typeof f=="function"?f:on(!!f),u):a},u.curve=function(f){return arguments.length?(o=f,i!=null&&(l=o(i)),u):o},u.context=function(f){return arguments.length?(f==null?i=l=null:l=o(i=f),u):i},u}class _Y{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function GMe(e){return new _Y(e,!0)}function YMe(e){return new _Y(e,!1)}const wT={draw(e,t){const n=Ai(t/X0);e.moveTo(n,0),e.arc(0,0,n,0,oN)}},XMe={draw(e,t){const n=Ai(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},EY=Ai(1/3),QMe=EY*2,JMe={draw(e,t){const n=Ai(t/QMe),r=n*EY;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},ZMe={draw(e,t){const n=Ai(t),r=-n/2;e.rect(r,r,n,n)}},eRe=.8908130915292852,AY=Y0(X0/10)/Y0(7*X0/10),tRe=Y0(oN/10)*AY,nRe=-bY(oN/10)*AY,rRe={draw(e,t){const n=Ai(t*eRe),r=tRe*n,a=nRe*n;e.moveTo(0,-n),e.lineTo(r,a);for(let i=1;i<5;++i){const o=oN*i/5,l=bY(o),c=Y0(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*a,c*r+l*a)}e.closePath()}},uC=Ai(3),aRe={draw(e,t){const n=-Ai(t/(uC*3));e.moveTo(0,n*2),e.lineTo(-uC*n,-n),e.lineTo(uC*n,-n),e.closePath()}},hs=-.5,ms=Ai(3)/2,wE=1/Ai(12),sRe=(wE/2+1)*3,iRe={draw(e,t){const n=Ai(t/sRe),r=n/2,a=n*wE,i=r,o=n*wE+n,l=-i,c=o;e.moveTo(r,a),e.lineTo(i,o),e.lineTo(l,c),e.lineTo(hs*r-ms*a,ms*r+hs*a),e.lineTo(hs*i-ms*o,ms*i+hs*o),e.lineTo(hs*l-ms*c,ms*l+hs*c),e.lineTo(hs*r+ms*a,hs*a-ms*r),e.lineTo(hs*i+ms*o,hs*o-ms*i),e.lineTo(hs*l+ms*c,hs*c-ms*l),e.closePath()}};function oRe(e,t){let n=null,r=xT(a);e=typeof e=="function"?e:on(e||wT),t=typeof t=="function"?t:on(t===void 0?64:+t);function a(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return a.type=function(i){return arguments.length?(e=typeof i=="function"?i:on(i),a):e},a.size=function(i){return arguments.length?(t=typeof i=="function"?i:on(+i),a):t},a.context=function(i){return arguments.length?(n=i??null,a):n},a}function Q0(){}function J0(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function PY(e){this._context=e}PY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:J0(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:J0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lRe(e){return new PY(e)}function kY(e){this._context=e}kY.prototype={areaStart:Q0,areaEnd:Q0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:J0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cRe(e){return new kY(e)}function OY(e){this._context=e}OY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:J0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uRe(e){return new OY(e)}function TY(e){this._context=e}TY.prototype={areaStart:Q0,areaEnd:Q0,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function dRe(e){return new TY(e)}function j4(e){return e<0?-1:1}function N4(e,t,n){var r=e._x1-e._x0,a=t-e._x1,i=(e._y1-e._y0)/(r||a<0&&-0),o=(n-e._y1)/(a||r<0&&-0),l=(i*a+o*r)/(r+a);return(j4(i)+j4(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function S4(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function dC(e,t,n){var r=e._x0,a=e._y0,i=e._x1,o=e._y1,l=(i-r)/3;e._context.bezierCurveTo(r+l,a+l*t,i-l,o-l*n,i,o)}function Z0(e){this._context=e}Z0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:dC(this,this._t0,S4(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,dC(this,S4(this,n=N4(this,e,t)),n);break;default:dC(this,this._t0,n=N4(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function MY(e){this._context=new RY(e)}(MY.prototype=Object.create(Z0.prototype)).point=function(e,t){Z0.prototype.point.call(this,t,e)};function RY(e){this._context=e}RY.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,i){this._context.bezierCurveTo(t,e,r,n,i,a)}};function fRe(e){return new Z0(e)}function hRe(e){return new MY(e)}function DY(e){this._context=e}DY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=C4(e),a=C4(t),i=0,o=1;o<n;++i,++o)this._context.bezierCurveTo(r[0][i],a[0][i],r[1][i],a[1][i],e[o],t[o]);(this._line||this._line!==0&&n===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}};function C4(e){var t,n=e.length-1,r,a=new Array(n),i=new Array(n),o=new Array(n);for(a[0]=0,i[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)a[t]=1,i[t]=4,o[t]=4*e[t]+2*e[t+1];for(a[n-1]=2,i[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=a[t]/i[t-1],i[t]-=r,o[t]-=r*o[t-1];for(a[n-1]=o[n-1]/i[n-1],t=n-2;t>=0;--t)a[t]=(o[t]-a[t+1])/i[t];for(i[n-1]=(e[n]+a[n-1])/2,t=0;t<n-1;++t)i[t]=2*e[t+1]-a[t+1];return[a,i]}function mRe(e){return new DY(e)}function cN(e,t){this._context=e,this._t=t}cN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;
vendor: 9,187 bytes, lines 851-854
851default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function pRe(e){return new cN(e,.5)}function gRe(e){return new cN(e,0)}function yRe(e){return new cN(e,1)}function Oh(e,t){if((o=e.length)>1)for(var n=1,r,a,i=e[t[0]],o,l=i.length;n<o;++n)for(a=i,i=e[t[n]],r=0;r<l;++r)i[r][1]+=i[r][0]=isNaN(a[r][1])?a[r][0]:a[r][1]}function jE(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function vRe(e,t){return e[t]}function xRe(e){const t=[];return t.key=e,t}function bRe(){var e=on([]),t=jE,n=Oh,r=vRe;function a(i){var o=Array.from(e.apply(this,arguments),xRe),l,c=o.length,u=-1,d;for(const f of i)for(l=0,++u;l<c;++l)(o[l][u]=[0,+r(f,o[l].key,u,i)]).data=f;for(l=0,d=bT(t(o));l<c;++l)o[d[l]].index=l;return n(o,d),o}return a.keys=function(i){return arguments.length?(e=typeof i=="function"?i:on(Array.from(i)),a):e},a.value=function(i){return arguments.length?(r=typeof i=="function"?i:on(+i),a):r},a.order=function(i){return arguments.length?(t=i==null?jE:typeof i=="function"?i:on(Array.from(i)),a):t},a.offset=function(i){return arguments.length?(n=i??Oh,a):n},a}function wRe(e,t){if((r=e.length)>0){for(var n,r,a=0,i=e[0].length,o;a<i;++a){for(o=n=0;n<r;++n)o+=e[n][a][1]||0;if(o)for(n=0;n<r;++n)e[n][a][1]/=o}Oh(e,t)}}function jRe(e,t){if((a=e.length)>0){for(var n=0,r=e[t[0]],a,i=r.length;n<i;++n){for(var o=0,l=0;o<a;++o)l+=e[o][n][1]||0;r[n][1]+=r[n][0]=-l/2}Oh(e,t)}}function NRe(e,t){if(!(!((o=e.length)>0)||!((i=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,i,o;r<i;++r){for(var l=0,c=0,u=0;l<o;++l){for(var d=e[t[l]],f=d[r][1]||0,h=d[r-1][1]||0,m=(f-h)/2,p=0;p<l;++p){var g=e[t[p]],y=g[r][1]||0,v=g[r-1][1]||0;m+=y-v}c+=f,u+=m*f}a[r-1][1]+=a[r-1][0]=n,c&&(n-=u/c)}a[r-1][1]+=a[r-1][0]=n,Oh(e,t)}}function oy(e){"@babel/helpers - typeof";return oy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oy(e)}var SRe=["type","size","sizeType"];function NE(){return NE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NE.apply(this,arguments)}function _4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function E4(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?_4(Object(n),!0).forEach(function(r){CRe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function CRe(e,t,n){return t=_Re(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _Re(e){var t=ERe(e,"string");return oy(t)=="symbol"?t:t+""}function ERe(e,t){if(oy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(oy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ARe(e,t){if(e==null)return{};var n=PRe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function PRe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var $Y={symbolCircle:wT,symbolCross:XMe,symbolDiamond:JMe,symbolSquare:ZMe,symbolStar:rRe,symbolTriangle:aRe,symbolWye:iRe},kRe=Math.PI/180,ORe=function(t){var n="symbol".concat(iN(t));return $Y[n]||wT},TRe=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*kRe;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},MRe=function(t,n){$Y["symbol".concat(iN(t))]=n},uN=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,i=a===void 0?64:a,o=t.sizeType,l=o===void 0?"area":o,c=ARe(t,SRe),u=E4(E4({},c),{},{type:r,size:i,sizeType:l}),d=function(){var y=ORe(r),v=oRe().type(y).size(TRe(i,l,r));return v()},f=u.className,h=u.cx,m=u.cy,p=Me(u,!0);return h===+h&&m===+m&&i===+i?L.createElement("path",NE({},p,{className:Ge("recharts-symbols",f),transform:"translate(".concat(h,", ").concat(m,")"),d:d()})):null};uN.registerSymbol=MRe;function Th(e){"@babel/helpers - typeof";return Th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Th(e)}function SE(){return SE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SE.apply(this,arguments)}function A4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function RRe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?A4(Object(n),!0).forEach(function(r){ly(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A4(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function DRe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $Re(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LY(r.key),r)}}function IRe(e,t,n){return t&&$Re(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function LRe(e,t,n){return t=ew(t),FRe(e,IY()?Reflect.construct(t,n||[],ew(e).constructor):t.apply(e,n))}function FRe(e,t){if(t&&(Th(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BRe(e)}function BRe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IY(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IY=function(){return!!e})()}function ew(e){return ew=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ew(e)}function zRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CE(e,t)}function CE(e,t){return CE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},CE(e,t)}function ly(e,t,n){return t=LY(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LY(e){var t=URe(e,"string");return Th(t)=="symbol"?t:t+""}function URe(e,t){if(Th(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Th(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ps=32,jT=function(e){function t(){return DRe(this,t),LRe(this,t,arguments)}return zRe(t,e),IRe(t,[{key:"renderIcon",value:function(r){var a=this.props.inactiveColor,i=ps/2,o=ps/6,l=ps/3,c=r.inactive?a:r.color;if(r.type==="plainline")return L.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:r.payload.strokeDasharray,x1:0,y1:i,x2:ps,y2:i,className:"recharts-legend-icon"});if(r.type==="line")return L.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
852            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
853            H`).concat(ps,"M").concat(2*l,",").concat(i,`
854            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(r.type==="rect")return L.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(ps/8,"h").concat(ps,"v").concat(ps*3/4,"h").concat(-ps,"z"),className:"recharts-legend-icon"});if(L.isValidElement(r.legendIcon)){var u=RRe({},r);return delete u.legendIcon,L.cloneElement(r.legendIcon,u)}return L.createElement(uN,{fill:c,cx:i,cy:i,size:ps,sizeType:"diameter",type:r.type})}},{key:"renderItems",value:function(){var r=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,c=a.formatter,u=a.inactiveColor,d={x:0,y:0,width:ps,height:ps}
854,f={display:l==="horizontal"?"inline-block":"block",marginRight:10},h={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(m,p){var g=m.formatter||c,y=Ge(ly(ly({"recharts-legend-item":!0},"legend-item-".concat(p),!0),"inactive",m.inactive));if(m.type==="none")return null;var v=ze(m.value)?null:m.value;oi(!ze(m.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var w=m.inactive?u:m.color;return L.createElement("li",SE({className:y,style:f,key:"legend-item-".concat(p)},vi(r.props,m,p)),L.createElement(G0,{width:o,height:o,viewBox:d,style:h},r.renderIcon(m)),L.createElement("span",{className:"recharts-legend-item-text",style:{color:w}},g?g(v,m,p):v))})}},{key:"render",value:function(){var r=this.props,a=r.payload,i=r.layout,o=r.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return L.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(x.PureComponent);ly(jT,"displayName","Legend");ly(jT,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var VRe=W1;function WRe(){this.__data__=new VRe,this.size=0}var qRe=WRe;function HRe(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var KRe=HRe;function GRe(e){return this.__data__.get(e)}var YRe=GRe;function XRe(e){return this.__data__.has(e)}var QRe=XRe,JRe=W1,ZRe=hT,eDe=mT,tDe=200;function nDe(e,t){var n=this.__data__;if(n instanceof JRe){var r=n.__data__;if(!ZRe||r.length<tDe-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new eDe(r)}return n.set(e,t),this.size=n.size,this}var rDe=nDe,aDe=W1,sDe=qRe,iDe=KRe,oDe=YRe,lDe=QRe,cDe=rDe;function Lm(e){var t=this.__data__=new aDe(e);this.size=t.size}Lm.prototype.clear=sDe;Lm.prototype.delete=iDe;Lm.prototype.get=oDe;Lm.prototype.has=lDe;Lm.prototype.set=cDe;var NT=Lm,uDe="__lodash_hash_undefined__";function dDe(e){return this.__data__.set(e,uDe),this}var fDe=dDe;function hDe(e){return this.__data__.has(e)}var mDe=hDe,pDe=mT,gDe=fDe,yDe=mDe;function tw(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new pDe;++t<n;)this.add(e[t])}tw.prototype.add=tw.prototype.push=gDe;tw.prototype.has=yDe;var FY=tw;function vDe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var BY=vDe;function xDe(e,t){return e.has(t)}var zY=xDe,bDe=FY,wDe=BY,jDe=zY,NDe=1,SDe=2;function CDe(e,t,n,r,a,i){var o=n&NDe,l=e.length,c=t.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(e),d=i.get(t);if(u&&d)return u==t&&d==e;var f=-1,h=!0,m=n&SDe?new bDe:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var p=e[f],g=t[f];if(r)var y=o?r(g,p,f,t,e,i):r(p,g,f,e,t,i);if(y!==void 0){if(y)continue;h=!1;break}if(m){if(!wDe(t,function(v,w){if(!jDe(m,w)&&(p===v||a(p,v,n,r,i)))return m.push(w)})){h=!1;break}}else if(!(p===g||a(p,g,n,r,i))){h=!1;break}}return i.delete(e),i.delete(t),h}var UY=CDe,_De=Ci,EDe=_De.Uint8Array,VY=EDe;function ADe(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var PDe=ADe;function kDe(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var ST=kDe,P4=Tm,k4=VY,ODe=U1,TDe=UY,MDe=PDe,RDe=ST,DDe=1,$De=2,IDe="[object Boolean]",LDe="[object Date]",FDe="[object Error]",BDe="[object Map]",zDe="[object Number]",UDe="[object RegExp]",VDe="[object Set]",WDe="[object String]",qDe="[object Symbol]",HDe="[object ArrayBuffer]",KDe="[object DataView]",O4=P4?P4.prototype:void 0,fC=O4?O4.valueOf:void 0;function GDe(e,t,n,r,a,i,o){switch(n){case KDe:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case HDe:return!(e.byteLength!=t.byteLength||!i(new k4(e),new k4(t)));case IDe:case LDe:case zDe:return ODe(+e,+t);case FDe:return e.name==t.name&&e.message==t.message;case UDe:case WDe:return e==t+"";case BDe:var l=MDe;case VDe:var c=r&DDe;if(l||(l=RDe),e.size!=t.size&&!c)return!1;var u=o.get(e);if(u)return u==t;r|=$De,o.set(e,t);var d=TDe(l(e),l(t),r,a,i,o);return o.delete(e),d;
vendor: 4,530 bytes, line 854
854case qDe:if(fC)return fC.call(e)==fC.call(t)}return!1}var YDe=GDe;function XDe(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var CT=XDe,QDe=CT,JDe=ba;function ZDe(e,t,n){var r=t(e);return JDe(e)?r:QDe(r,n(e))}var WY=ZDe;function e$e(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}var t$e=e$e;function n$e(){return[]}var qY=n$e,r$e=t$e,a$e=qY,s$e=Object.prototype,i$e=s$e.propertyIsEnumerable,T4=Object.getOwnPropertySymbols,o$e=T4?function(e){return e==null?[]:(e=Object(e),r$e(T4(e),function(t){return i$e.call(e,t)}))}:a$e,_T=o$e;function l$e(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var c$e=l$e,u$e=El,d$e=_i,f$e="[object Arguments]";function h$e(e){return d$e(e)&&u$e(e)==f$e}var m$e=h$e,M4=m$e,p$e=_i,HY=Object.prototype,g$e=HY.hasOwnProperty,y$e=HY.propertyIsEnumerable,v$e=M4(function(){return arguments}())?M4:function(e){return p$e(e)&&g$e.call(e,"callee")&&!y$e.call(e,"callee")},ET=v$e,nw={exports:{}};function x$e(){return!1}var b$e=x$e;nw.exports;(function(e,t){var n=Ci,r=b$e,a=t&&!t.nodeType&&t,i=a&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===a,l=o?n.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||r;e.exports=u})(nw,nw.exports);var AT=nw.exports,w$e=9007199254740991,j$e=/^(?:0|[1-9]\d*)$/;function N$e(e,t){var n=typeof e;return t=t??w$e,!!t&&(n=="number"||n!="symbol"&&j$e.test(e))&&e>-1&&e%1==0&&e<t}var PT=N$e,S$e=9007199254740991;function C$e(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=S$e}var kT=C$e,_$e=El,E$e=kT,A$e=_i,P$e="[object Arguments]",k$e="[object Array]",O$e="[object Boolean]",T$e="[object Date]",M$e="[object Error]",R$e="[object Function]",D$e="[object Map]",$$e="[object Number]",I$e="[object Object]",L$e="[object RegExp]",F$e="[object Set]",B$e="[object String]",z$e="[object WeakMap]",U$e="[object ArrayBuffer]",V$e="[object DataView]",W$e="[object Float32Array]",q$e="[object Float64Array]",H$e="[object Int8Array]",K$e="[object Int16Array]",G$e="[object Int32Array]",Y$e="[object Uint8Array]",X$e="[object Uint8ClampedArray]",Q$e="[object Uint16Array]",J$e="[object Uint32Array]",hn={};hn[W$e]=hn[q$e]=hn[H$e]=hn[K$e]=hn[G$e]=hn[Y$e]=hn[X$e]=hn[Q$e]=hn[J$e]=!0;hn[P$e]=hn[k$e]=hn[U$e]=hn[O$e]=hn[V$e]=hn[T$e]=hn[M$e]=hn[R$e]=hn[D$e]=hn[$$e]=hn[I$e]=hn[L$e]=hn[F$e]=hn[B$e]=hn[z$e]=!1;function Z$e(e){return A$e(e)&&E$e(e.length)&&!!hn[_$e(e)]}var eIe=Z$e;function tIe(e){return function(t){return e(t)}}var dN=tIe,rw={exports:{}};rw.exports;(function(e,t){var n=JG,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i&&n.process,l=function(){try{var c=a&&a.require&&a.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();e.exports=l})(rw,rw.exports);var OT=rw.exports,nIe=eIe,rIe=dN,R4=OT,D4=R4&&R4.isTypedArray,aIe=D4?rIe(D4):nIe,KY=aIe,sIe=c$e,iIe=ET,oIe=ba,lIe=AT,cIe=PT,uIe=KY,dIe=Object.prototype,fIe=dIe.hasOwnProperty;function hIe(e,t){var n=oIe(e),r=!n&&iIe(e),a=!n&&!r&&lIe(e),i=!n&&!r&&!a&&uIe(e),o=n||r||a||i,l=o?sIe(e.length,String):[],c=l.length;for(var u in e)(t||fIe.call(e,u))&&!(o&&(u=="length"||a&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||cIe(u,c)))&&l.push(u);return l}var GY=hIe,mIe=Object.prototype;function pIe(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||mIe;return e===n}var TT=pIe;function gIe(e,t){return function(n){return e(t(n))}}var YY=gIe,yIe=YY,vIe=yIe(Object.keys,Object),xIe=vIe,bIe=TT,wIe=xIe,jIe=Object.prototype,NIe=jIe.hasOwnProperty;function SIe(e){if(!bIe(e))return wIe(e);var t=[];for(var n in Object(e))NIe.call(e,n)&&n!="constructor"&&t.push(n);return t}var CIe=SIe,_Ie=fT,EIe=kT;function AIe(e){return e!=null&&EIe(e.length)&&!_Ie(e)}var Fm=AIe,PIe=GY,kIe=CIe,OIe=Fm;function TIe(e){return OIe(e)?PIe(e):kIe(e)}var Bm=TIe,MIe=WY,RIe=_T,DIe=Bm;function $Ie(e){return MIe(e,DIe,RIe)}var XY=$Ie,$4=XY,IIe=1,LIe=Object.prototype,FIe=LIe.hasOwnProperty;function BIe(e,t,n,r,a,i){var o=n&IIe,l=$4(e),c=l.length,u=$4(t),d=u.length;if(c!=d&&!o)return!1;for(var f=c;f--;){var h=l[f];if(!(o?h in t:FIe.call(t,h)))return!1}var m=i.get(e),p=i.get(t);if(m&&p)return m==t&&p==e;var g=!0;i.set(e,t),i.set(t,e);for(var y=o;++f<c;){h=l[f];var v=e[h],w=t[h];if(r)var b=o?r(w,v,h,t,e,i):r(v,w,h,e,t,i);if(!(b===void 0?v===w||a(v,w,n,r,i):b)){g=!1;break}y||(y=h=="constructor")}if(g&&!y){var j=e.constructor,N=t.constructor;j!=N&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof N=="function"&&N instanceof N)&&(g=!1)}return i.delete(e),i.delete(t),g}
vendor: 5,349 bytes, line 854
854var zIe=BIe,UIe=Rd,VIe=Ci,WIe=UIe(VIe,"DataView"),qIe=WIe,HIe=Rd,KIe=Ci,GIe=HIe(KIe,"Promise"),YIe=GIe,XIe=Rd,QIe=Ci,JIe=XIe(QIe,"Set"),QY=JIe,ZIe=Rd,e4e=Ci,t4e=ZIe(e4e,"WeakMap"),n4e=t4e,_E=qIe,EE=hT,AE=YIe,PE=QY,kE=n4e,JY=El,zm=eY,I4="[object Map]",r4e="[object Object]",L4="[object Promise]",F4="[object Set]",B4="[object WeakMap]",z4="[object DataView]",a4e=zm(_E),s4e=zm(EE),i4e=zm(AE),o4e=zm(PE),l4e=zm(kE),vu=JY;(_E&&vu(new _E(new ArrayBuffer(1)))!=z4||EE&&vu(new EE)!=I4||AE&&vu(AE.resolve())!=L4||PE&&vu(new PE)!=F4||kE&&vu(new kE)!=B4)&&(vu=function(e){var t=JY(e),n=t==r4e?e.constructor:void 0,r=n?zm(n):"";if(r)switch(r){case a4e:return z4;case s4e:return I4;case i4e:return L4;case o4e:return F4;case l4e:return B4}return t});var fN=vu,hC=NT,c4e=UY,u4e=YDe,d4e=zIe,U4=fN,V4=ba,W4=AT,f4e=KY,h4e=1,q4="[object Arguments]",H4="[object Array]",Bx="[object Object]",m4e=Object.prototype,K4=m4e.hasOwnProperty;function p4e(e,t,n,r,a,i){var o=V4(e),l=V4(t),c=o?H4:U4(e),u=l?H4:U4(t);c=c==q4?Bx:c,u=u==q4?Bx:u;var d=c==Bx,f=u==Bx,h=c==u;if(h&&W4(e)){if(!W4(t))return!1;o=!0,d=!1}if(h&&!d)return i||(i=new hC),o||f4e(e)?c4e(e,t,n,r,a,i):u4e(e,t,c,n,r,a,i);if(!(n&h4e)){var m=d&&K4.call(e,"__wrapped__"),p=f&&K4.call(t,"__wrapped__");if(m||p){var g=m?e.value():e,y=p?t.value():t;return i||(i=new hC),a(g,y,n,r,i)}}return h?(i||(i=new hC),d4e(e,t,n,r,a,i)):!1}var g4e=p4e,y4e=g4e,G4=_i;function ZY(e,t,n,r,a){return e===t?!0:e==null||t==null||!G4(e)&&!G4(t)?e!==e&&t!==t:y4e(e,t,n,r,ZY,a)}var MT=ZY,v4e=NT,x4e=MT,b4e=1,w4e=2;function j4e(e,t,n,r){var a=n.length,i=a,o=!r;if(e==null)return!i;for(e=Object(e);a--;){var l=n[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<i;){l=n[a];var c=l[0],u=e[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in e))return!1}else{var f=new v4e;if(r)var h=r(u,d,c,e,t,f);if(!(h===void 0?x4e(d,u,b4e|w4e,r,f):h))return!1}}return!0}var N4e=j4e,S4e=Ei;function C4e(e){return e===e&&!S4e(e)}var eX=C4e,_4e=eX,E4e=Bm;function A4e(e){for(var t=E4e(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,_4e(a)]}return t}var P4e=A4e;function k4e(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var tX=k4e,O4e=N4e,T4e=P4e,M4e=tX;function R4e(e){var t=T4e(e);return t.length==1&&t[0][2]?M4e(t[0][0],t[0][1]):function(n){return n===e||O4e(n,e,t)}}var D4e=R4e;function $4e(e,t){return e!=null&&t in Object(e)}var I4e=$4e,L4e=K1,F4e=ET,B4e=ba,z4e=PT,U4e=kT,V4e=Fv;function W4e(e,t,n){t=L4e(t,e);for(var r=-1,a=t.length,i=!1;++r<a;){var o=V4e(t[r]);if(!(i=e!=null&&n(e,o)))break;e=e[o]}return i||++r!=a?i:(a=e==null?0:e.length,!!a&&U4e(a)&&z4e(o,a)&&(B4e(e)||F4e(e)))}var q4e=W4e,H4e=I4e,K4e=q4e;function G4e(e,t){return e!=null&&K4e(e,t,H4e)}var Y4e=G4e,X4e=MT,Q4e=sY,J4e=Y4e,Z4e=dT,eLe=eX,tLe=tX,nLe=Fv,rLe=1,aLe=2;function sLe(e,t){return Z4e(e)&&eLe(t)?tLe(nLe(e),t):function(n){var r=Q4e(n,e);return r===void 0&&r===t?J4e(n,e):X4e(t,r,rLe|aLe)}}var iLe=sLe;function oLe(e){return e}var Um=oLe;function lLe(e){return function(t){return t==null?void 0:t[e]}}var cLe=lLe,uLe=G1;function dLe(e){return function(t){return uLe(t,e)}}var fLe=dLe,hLe=cLe,mLe=fLe,pLe=dT,gLe=Fv;function yLe(e){return pLe(e)?hLe(gLe(e)):mLe(e)}var vLe=yLe,xLe=D4e,bLe=iLe,wLe=Um,jLe=ba,NLe=vLe;function SLe(e){return typeof e=="function"?e:e==null?wLe:typeof e=="object"?jLe(e)?bLe(e[0],e[1]):xLe(e):NLe(e)}var po=SLe;function CLe(e,t,n,r){for(var a=e.length,i=n+(r?1:-1);r?i--:++i<a;)if(t(e[i],i,e))return i;return-1}var nX=CLe;function _Le(e){return e!==e}var ELe=_Le;function ALe(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}var PLe=ALe,kLe=nX,OLe=ELe,TLe=PLe;function MLe(e,t,n){return t===t?TLe(e,t,n):kLe(e,OLe,n)}var RLe=MLe,DLe=RLe;function $Le(e,t){var n=e==null?0:e.length;return!!n&&DLe(e,t,0)>-1}var ILe=$Le;function LLe(e,t,n){for(var r=-1,a=e==null?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}var FLe=LLe;function BLe(){}var zLe=BLe,mC=QY,ULe=zLe,VLe=ST,WLe=1/0,qLe=mC&&1/VLe(new mC([,-0]))[1]==WLe?function(e){return new mC(e)}:ULe,HLe=qLe,KLe=FY,GLe=ILe,YLe=FLe,XLe=zY,QLe=HLe,JLe=ST,ZLe=200;function e3e(e,t,n){var r=-1,a=GLe,i=e.length,o=!0,l=[],c=l;if(n)o=!1,a=YLe;else if(i>=ZLe){var u=t?null:QLe(e);if(u)return JLe(u);o=!1,a=XLe,c=new KLe}else c=t?[]:l;e:for(;++r<i;){var d=e[r],f=t?t(d):d;if(d=n||d!==0?d:0,o&&f===f){for(var h=c.length;h--;)if(c[h]===f)continue e;t&&c.push(f),l.push(d)}else a(c,f,n)||(c!==l&&c.push(f),l.push(d))}return l}var t3e=e3e,n3e=po,r3e=t3e;function a3e(e,t){return e&&e.length?r3e(e,n3e(t)):[]}var s3e=a3e;const Y4=$t(s3e);function rX(e,t,n){return t===!0?Y4(e,n):ze(t)?Y4(e,t):e}function Mh(e){"@babel/helpers - typeof";return Mh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mh(e)}var i3e=["ref"];function X4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function So(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?X4(Object(n),!0).forEach(function(r){hN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X4(Object(n)).forEac
vendor: 5,692 bytes, line 854
854h(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function o3e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q4(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sX(r.key),r)}}function l3e(e,t,n){return t&&Q4(e.prototype,t),n&&Q4(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c3e(e,t,n){return t=aw(t),u3e(e,aX()?Reflect.construct(t,n||[],aw(e).constructor):t.apply(e,n))}function u3e(e,t){if(t&&(Mh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d3e(e)}function d3e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(aX=function(){return!!e})()}function aw(e){return aw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},aw(e)}function f3e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OE(e,t)}function OE(e,t){return OE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},OE(e,t)}function hN(e,t,n){return t=sX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sX(e){var t=h3e(e,"string");return Mh(t)=="symbol"?t:t+""}function h3e(e,t){if(Mh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Mh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function m3e(e,t){if(e==null)return{};var n=p3e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function p3e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function g3e(e){return e.value}function y3e(e,t){if(L.isValidElement(e))return L.cloneElement(e,t);if(typeof e=="function")return L.createElement(e,t);t.ref;var n=m3e(t,i3e);return L.createElement(jT,n)}var J4=1,vn=function(e){function t(){var n;o3e(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=c3e(this,t,[].concat(a)),hN(n,"lastBoundingBox",{width:-1,height:-1}),n}return f3e(t,e),l3e(t,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();return r.height=this.wrapperNode.offsetHeight,r.width=this.wrapperNode.offsetWidth,r}return null}},{key:"updateBBox",value:function(){var r=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>J4||Math.abs(a.height-this.lastBoundingBox.height)>J4)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?So({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,c=a.margin,u=a.chartWidth,d=a.chartHeight,f,h;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(o==="center"&&i==="vertical"){var m=this.getBBoxSnapshot();f={left:((u||0)-m.width)/2}}else f=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(l==="middle"){var p=this.getBBoxSnapshot();h={top:((d||0)-p.height)/2}}else h=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return So(So({},f),h)}},{key:"render",value:function(){var r=this,a=this.props,i=a.content,o=a.width,l=a.height,c=a.wrapperStyle,u=a.payloadUniqBy,d=a.payload,f=So(So({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return L.createElement("div",{className:"recharts-legend-wrapper",style:f,ref:function(m){r.wrapperNode=m}},y3e(i,So(So({},this.props),{},{payload:rX(d,u,g3e)})))}}],[{key:"getWithHeight",value:function(r,a){var i=So(So({},this.defaultProps),r.props),o=i.layout;return o==="vertical"&&Ee(r.props.height)?{height:r.props.height}:o==="horizontal"?{width:r.props.width||a}:null}}])}(x.PureComponent);hN(vn,"displayName","Legend");hN(vn,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Z4=Tm,v3e=ET,x3e=ba,eL=Z4?Z4.isConcatSpreadable:void 0;function b3e(e){return x3e(e)||v3e(e)||!!(eL&&e&&e[eL])}var w3e=b3e,j3e=CT,N3e=w3e;function iX(e,t,n,r,a){var i=-1,o=e.length;for(n||(n=N3e),a||(a=[]);++i<o;){var l=e[i];t>0&&n(l)?t>1?iX(l,t-1,n,r,a):j3e(a,l):r||(a[a.length]=l)}return a}var RT=iX;function S3e(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),l=o.length;l--;){var c=o[e?l:++a];if(n(i[c],c,i)===!1)break}return t}}var C3e=S3e,_3e=C3e,E3e=_3e(),A3e=E3e,P3e=A3e,k3e=Bm;function O3e(e,t){return e&&P3e(e,t,k3e)}
vendor: 4,112 bytes, lines 854-855
854var oX=O3e,T3e=Fm;function M3e(e,t){return function(n,r){if(n==null)return n;if(!T3e(n))return e(n,r);for(var a=n.length,i=t?a:-1,o=Object(n);(t?i--:++i<a)&&r(o[i],i,o)!==!1;);return n}}var R3e=M3e,D3e=oX,$3e=R3e,I3e=$3e(D3e),DT=I3e,L3e=DT,F3e=Fm;function B3e(e,t){var n=-1,r=F3e(e)?Array(e.length):[];return L3e(e,function(a,i,o){r[++n]=t(a,i,o)}),r}var lX=B3e;function z3e(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var U3e=z3e,tL=Mm;function V3e(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,i=tL(e),o=t!==void 0,l=t===null,c=t===t,u=tL(t);if(!l&&!u&&!i&&e>t||i&&o&&c&&!l&&!u||r&&o&&c||!n&&c||!a)return 1;if(!r&&!i&&!u&&e<t||u&&n&&a&&!r&&!i||l&&n&&a||!o&&a||!c)return-1}return 0}var W3e=V3e,q3e=W3e;function H3e(e,t,n){for(var r=-1,a=e.criteria,i=t.criteria,o=a.length,l=n.length;++r<o;){var c=q3e(a[r],i[r]);if(c){if(r>=l)return c;var u=n[r];return c*(u=="desc"?-1:1)}}return e.index-t.index}var K3e=H3e,pC=H1,G3e=G1,Y3e=po,X3e=lX,Q3e=U3e,J3e=dN,Z3e=K3e,e5e=Um,t5e=ba;function n5e(e,t,n){t.length?t=pC(t,function(i){return t5e(i)?function(o){return G3e(o,i.length===1?i[0]:i)}:i}):t=[e5e];var r=-1;t=pC(t,J3e(Y3e));var a=X3e(e,function(i,o,l){var c=pC(t,function(u){return u(i)});return{criteria:c,index:++r,value:i}});return Q3e(a,function(i,o){return Z3e(i,o,n)})}var r5e=n5e;function a5e(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var s5e=a5e,i5e=s5e,nL=Math.max;function o5e(e,t,n){return t=nL(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=nL(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),i5e(e,this,l)}}var cX=o5e;function l5e(e){return function(){return e}}var c5e=l5e,u5e=Rd,d5e=function(){try{var e=u5e(Object,"defineProperty");return e({},"",{}),e}catch{}}(),uX=d5e,f5e=c5e,rL=uX,h5e=Um,m5e=rL?function(e,t){return rL(e,"toString",{configurable:!0,enumerable:!1,value:f5e(t),writable:!0})}:h5e,p5e=m5e,g5e=800,y5e=16,v5e=Date.now;function x5e(e){var t=0,n=0;return function(){var r=v5e(),a=y5e-(r-n);if(n=r,a>0){if(++t>=g5e)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var b5e=x5e,w5e=p5e,j5e=b5e,N5e=j5e(w5e),dX=N5e,S5e=Um,C5e=cX,_5e=dX;function E5e(e,t){return _5e(C5e(e,t,S5e),e+"")}var A5e=E5e,P5e=U1,k5e=Fm,O5e=PT,T5e=Ei;function M5e(e,t,n){if(!T5e(n))return!1;var r=typeof t;return(r=="number"?k5e(n)&&O5e(t,n.length):r=="string"&&t in n)?P5e(n[t],e):!1}var mN=M5e,R5e=RT,D5e=r5e,$5e=A5e,aL=mN,I5e=$5e(function(e,t){if(e==null)return[];var n=t.length;return n>1&&aL(e,t[0],t[1])?t=[]:n>2&&aL(t[0],t[1],t[2])&&(t=[t[0]]),D5e(e,R5e(t,1),[])}),L5e=I5e;const $T=$t(L5e);function cy(e){"@babel/helpers - typeof";return cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cy(e)}function TE(){return TE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TE.apply(this,arguments)}function F5e(e,t){return V5e(e)||U5e(e,t)||z5e(e,t)||B5e()}function B5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
855In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z5e(e,t){if(e){if(typeof e=="string")return sL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sL(e,t)}}function sL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function U5e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}
vendor: 9,736 bytes, line 855
855finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function V5e(e){if(Array.isArray(e))return e}function iL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?iL(Object(n),!0).forEach(function(r){W5e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):iL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function W5e(e,t,n){return t=q5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function q5e(e){var t=H5e(e,"string");return cy(t)=="symbol"?t:t+""}function H5e(e,t){if(cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function K5e(e){return Array.isArray(e)&&dr(e[0])&&dr(e[1])?e.join(" ~ "):e}var G5e=function(t){var n=t.separator,r=n===void 0?" : ":n,a=t.contentStyle,i=a===void 0?{}:a,o=t.itemStyle,l=o===void 0?{}:o,c=t.labelStyle,u=c===void 0?{}:c,d=t.payload,f=t.formatter,h=t.itemSorter,m=t.wrapperClassName,p=t.labelClassName,g=t.label,y=t.labelFormatter,v=t.accessibilityLayer,w=v===void 0?!1:v,b=function(){if(d&&d.length){var k={padding:0,margin:0},D=(h?$T(d,h):d).map(function(A,I){if(A.type==="none")return null;var M=gC({display:"block",paddingTop:4,paddingBottom:4,color:A.color||"#000"},l),$=A.formatter||f||K5e,R=A.value,O=A.name,F=R,z=O;if($&&F!=null&&z!=null){var B=$(R,O,A,I,d);if(Array.isArray(B)){var H=F5e(B,2);F=H[0],z=H[1]}else F=B}return L.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:M},dr(z)?L.createElement("span",{className:"recharts-tooltip-item-name"},z):null,dr(z)?L.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,L.createElement("span",{className:"recharts-tooltip-item-value"},F),L.createElement("span",{className:"recharts-tooltip-item-unit"},A.unit||""))});return L.createElement("ul",{className:"recharts-tooltip-item-list",style:k},D)}return null},j=gC({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),N=gC({margin:0},u),S=!Ke(g),C=S?g:"",_=Ge("recharts-default-tooltip",m),E=Ge("recharts-tooltip-label",p);S&&y&&d!==void 0&&d!==null&&(C=y(g,d));var T=w?{role:"status","aria-live":"assertive"}:{};return L.createElement("div",TE({className:_,style:j},T),L.createElement("p",{className:E,style:N},L.isValidElement(C)?C:"".concat(C)),b())};function uy(e){"@babel/helpers - typeof";return uy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uy(e)}function zx(e,t,n){return t=Y5e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Y5e(e){var t=X5e(e,"string");return uy(t)=="symbol"?t:t+""}function X5e(e,t){if(uy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(uy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mp="recharts-tooltip-wrapper",Q5e={visibility:"hidden"};function J5e(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Ge(mp,zx(zx(zx(zx({},"".concat(mp,"-right"),Ee(n)&&t&&Ee(t.x)&&n>=t.x),"".concat(mp,"-left"),Ee(n)&&t&&Ee(t.x)&&n<t.x),"".concat(mp,"-bottom"),Ee(r)&&t&&Ee(t.y)&&r>=t.y),"".concat(mp,"-top"),Ee(r)&&t&&Ee(t.y)&&r<t.y))}function oL(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,i=e.position,o=e.reverseDirection,l=e.tooltipDimension,c=e.viewBox,u=e.viewBoxDimension;if(i&&Ee(i[r]))return i[r];var d=n[r]-l-a,f=n[r]+a;if(t[r])return o[r]?d:f;if(o[r]){var h=d,m=c[r];return h<m?Math.max(f,c[r]):Math.max(d,c[r])}var p=f+l,g=c[r]+u;return p>g?Math.max(d,c[r]):Math.max(f,c[r])}function Z5e(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function eFe(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,i=e.reverseDirection,o=e.tooltipBox,l=e.useTranslate3d,c=e.viewBox,u,d,f;return o.height>0&&o.width>0&&n?(d=oL({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),f=oL({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=Z5e({translateX:d,translateY:f,useTranslate3d:l})):u=Q5e,{cssProperties:u,cssClasses:J5e({translateX:d,translateY:f,coordinate:n})}}function Rh(e){"@babel/helpers - typeof";return Rh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rh(e)}function lL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function cL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lL(Object(n),!0).forEach(function(r){RE(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nFe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hX(r.key),r)}}function rFe(e,t,n){return t&&nFe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function aFe(e,t,n){return t=sw(t),sFe(e,fX()?Reflect.construct(t,n||[],sw(e).constructor):t.apply(e,n))}function sFe(e,t){if(t&&(Rh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iFe(e)}function iFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fX=function(){return!!e})()}function sw(e){return sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},sw(e)}function oFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ME(e,t)}function ME(e,t){return ME=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},ME(e,t)}function RE(e,t,n){return t=hX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hX(e){var t=lFe(e,"string");return Rh(t)=="symbol"?t:t+""}function lFe(e,t){if(Rh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Rh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uL=1,cFe=function(e){function t(){var n;tFe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=aFe(this,t,[].concat(a)),RE(n,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),RE(n,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;n.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=n.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=n.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),n}return oFe(t,e),rFe(t,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var r=this.wrapperNode.getBoundingClientRect();(Math.abs(r.width-this.state.lastBoundingBox.width)>uL||Math.abs(r.height-this.state.lastBoundingBox.height)>uL)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.children,d=a.coordinate,f=a.hasPayload,h=a.isAnimationActive,m=a.offset,p=a.position,g=a.reverseDirection,y=a.useTranslate3d,v=a.viewB
855ox,w=a.wrapperStyle,b=eFe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:m,position:p,reverseDirection:g,tooltipBox:this.state.lastBoundingBox,useTranslate3d:y,viewBox:v}),j=b.cssClasses,N=b.cssProperties,S=cL(cL({transition:h&&i?"transform ".concat(l,"ms ").concat(c):void 0},N),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&f?"visible":"hidden",position:"absolute",top:0,left:0},w);return L.createElement("div",{tabIndex:-1,className:j,style:S,ref:function(_){r.wrapperNode=_}},u)}}])}(x.PureComponent),uFe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Tr={isSsr:uFe(),get:function(t){return Tr[t]},set:function(t,n){if(typeof t=="string")Tr[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(a){Tr[a]=t[a]})}}};function Dh(e){"@babel/helpers - typeof";return Dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dh(e)}function dL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function fL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?dL(Object(n),!0).forEach(function(r){IT(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dFe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fFe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pX(r.key),r)}}function hFe(e,t,n){return t&&fFe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function mFe(e,t,n){return t=iw(t),pFe(e,mX()?Reflect.construct(t,n||[],iw(e).constructor):t.apply(e,n))}function pFe(e,t){if(t&&(Dh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return gFe(e)}function gFe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mX(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mX=function(){return!!e})()}function iw(e){return iw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},iw(e)}function yFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&DE(e,t)}function DE(e,t){return DE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},DE(e,t)}function IT(e,t,n){return t=pX(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pX(e){var t=vFe(e,"string");return Dh(t)=="symbol"?t:t+""}function vFe(e,t){if(Dh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xFe(e){return e.dataKey}function bFe(e,t){return L.isValidElement(e)?L.cloneElement(e,t):typeof e=="function"?L.createElement(e,t):L.createElement(G5e,t)}var kt=function(e){function t(){return dFe(this,t),mFe(this,t,arguments)}return yFe(t,e),hFe(t,[{key:"render",value:function(){var r=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,c=a.animationEasing,u=a.content,d=a.coordinate,f=a.filterNull,h=a.isAnimationActive,m=a.offset,p=a.payload,g=a.payloadUniqBy,y=a.position,v=a.reverseDirection,w=a.useTranslate3d,b=a.viewB
vendor: 14,466 bytes, lines 855-861
855ox,j=a.wrapperStyle,N=p??[];f&&N.length&&(N=rX(p.filter(function(C){return C.value!=null&&(C.hide!==!0||r.props.includeHidden)}),g,xFe));var S=N.length>0;return L.createElement(cFe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:h,active:i,coordinate:d,hasPayload:S,offset:m,position:y,reverseDirection:v,useTranslate3d:w,viewBox:b,wrapperStyle:j},bFe(u,fL(fL({},this.props),{},{payload:N})))}}])}(x.PureComponent);IT(kt,"displayName","Tooltip");IT(kt,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Tr.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wFe=Ci,jFe=function(){return wFe.Date.now()},NFe=jFe,SFe=/\s/;function CFe(e){for(var t=e.length;t--&&SFe.test(e.charAt(t)););return t}var _Fe=CFe,EFe=_Fe,AFe=/^\s+/;function PFe(e){return e&&e.slice(0,EFe(e)+1).replace(AFe,"")}var kFe=PFe,OFe=kFe,hL=Ei,TFe=Mm,mL=NaN,MFe=/^[-+]0x[0-9a-f]+$/i,RFe=/^0b[01]+$/i,DFe=/^0o[0-7]+$/i,$Fe=parseInt;function IFe(e){if(typeof e=="number")return e;if(TFe(e))return mL;if(hL(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=hL(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=OFe(e);var n=RFe.test(e);return n||DFe.test(e)?$Fe(e.slice(2),n?2:8):MFe.test(e)?mL:+e}var gX=IFe,LFe=Ei,yC=NFe,pL=gX,FFe="Expected a function",BFe=Math.max,zFe=Math.min;function UFe(e,t,n){var r,a,i,o,l,c,u=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(FFe);t=pL(t)||0,LFe(n)&&(d=!!n.leading,f="maxWait"in n,i=f?BFe(pL(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h);function m(S){var C=r,_=a;return r=a=void 0,u=S,o=e.apply(_,C),o}function p(S){return u=S,l=setTimeout(v,t),d?m(S):o}function g(S){var C=S-c,_=S-u,E=t-C;return f?zFe(E,i-_):E}function y(S){var C=S-c,_=S-u;return c===void 0||C>=t||C<0||f&&_>=i}function v(){var S=yC();if(y(S))return w(S);l=setTimeout(v,g(S))}function w(S){return l=void 0,h&&r?m(S):(r=a=void 0,o)}function b(){l!==void 0&&clearTimeout(l),u=0,r=c=a=l=void 0}function j(){return l===void 0?o:w(yC())}function N(){var S=yC(),C=y(S);if(r=arguments,a=this,c=S,C){if(l===void 0)return p(c);if(f)return clearTimeout(l),l=setTimeout(v,t),m(c)}return l===void 0&&(l=setTimeout(v,t)),o}return N.cancel=b,N.flush=j,N}var VFe=UFe,WFe=VFe,qFe=Ei,HFe="Expected a function";function KFe(e,t,n){var r=!0,a=!0;if(typeof e!="function")throw new TypeError(HFe);return qFe(n)&&(r="leading"in n?!!n.leading:r,a="trailing"in n?!!n.trailing:a),WFe(e,t,{leading:r,maxWait:t,trailing:a})}var GFe=KFe;const yX=$t(GFe);function dy(e){"@babel/helpers - typeof";return dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dy(e)}function gL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ux(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gL(Object(n),!0).forEach(function(r){YFe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YFe(e,t,n){return t=XFe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XFe(e){var t=QFe(e,"string");return dy(t)=="symbol"?t:t+""}function QFe(e,t){if(dy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(dy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JFe(e,t){return n6e(e)||t6e(e,t)||e6e(e,t)||ZFe()}function ZFe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
856In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e6e(e,t){if(e){if(typeof e=="string")return yL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yL(e,t)}}function yL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function t6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function n6e(e){if(Array.isArray(e))return e}var Cn=x.forwardRef(function(e,t){var n=e.aspect,r=e.initialDimension,a=r===void 0?{width:-1,height:-1}:r,i=e.width,o=i===void 0?"100%":i,l=e.height,c=l===void 0?"100%":l,u=e.minWidth,d=u===void 0?0:u,f=e.minHeight,h=e.maxHeight,m=e.children,p=e.debounce,g=p===void 0?0:p,y=e.id,v=e.className,w=e.onResize,b=e.style,j=b===void 0?{}:b,N=x.useRef(null),S=x.useRef();S.current=w,x.useImperativeHandle(t,function(){return Object.defineProperty(N.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current},configurable:!0})});var C=x.useState({containerWidth:a.width,containerHeight:a.height}),_=JFe(C,2),E=_[0],T=_[1],P=x.useCallback(function(D,A){T(function(I){var M=Math.round(D),$=Math.round(A);return I.containerWidth===M&&I.containerHeight===$?I:{containerWidth:M,containerHeight:$}})},[]);x.useEffect(function(){var D=function(O){var F,z=O[0].contentRect,B=z.width,H=z.height;P(B,H),(F=S.current)===null||F===void 0||F.call(S,B,H)};g>0&&(D=yX(D,g,{trailing:!0,leading:!1}));var A=new ResizeObserver(D),I=N.current.getBoundingClientRect(),M=I.width,$=I.height;return P(M,$),A.observe(N.current),function(){A.disconnect()}},[P,g]);var k=x.useMemo(function(){var D=E.containerWidth,A=E.containerHeight;if(D<0||A<0)return null;oi(Au(o)||Au(c),`The width(%s) and height(%s) are both fixed numbers,
857       maybe you don't need to use a ResponsiveContainer.`,o,c),oi(!n||n>0,"The aspect(%s) must be greater than zero.",n);var I=Au(o)?D:o,M=Au(c)?A:c;n&&n>0&&(I?M=I/n:M&&(I=M*n),h&&M>h&&(M=h)),oi(I>0||M>0,`The width(%s) and height(%s) of chart should be greater than 0,
858       please check the style of container, or the props width(%s) and height(%s),
859       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
860       height and width.`,I,M,o,c,d,f,n);var $=!Array.isArray(m)&&Wo(m.type).endsWith("Chart");return L.Children.map(m,function(R){return L.isValidElement(R)?x.cloneElement(R,Ux({width:I,height:M},$?{style:Ux({height:"100%",width:"100%",maxHeight:M,maxWidth:I},R.props.style)}:{})):R})},[n,m,c,h,f,d,E,o]);return L.createElement("div",{id:y?"".concat(y):void 0,className:Ge("recharts-responsive-container",v),style:Ux(Ux({},j),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:h}),ref:N},k)}),Pa=function(t){return null};Pa.displayName="Cell";function fy(e){"@babel/helpers - typeof";return fy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fy(e)}function vL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $E(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?vL(Object(n),!0).forEach(function(r){r6e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function r6e(e,t,n){return t=a6e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a6e(e){var t=s6e(e,"string");return fy(t)=="symbol"?t:t+""}function s6e(e,t){if(fy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(fy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nf={widthCache:{},cacheCount:0},i6e=2e3,o6e={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},xL="recharts_measurement_span";function l6e(e){var t=$E({},e);return Object.keys(t).forEach(function(n){t[n]||delete t[n]}),t}var qf=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Tr.isSsr)return{width:0,height:0};var r=l6e(n),a=JSON.stringify({text:t,copyStyle:r});if(nf.widthCache[a])return nf.widthCache[a];try{var i=document.getElementById(xL);i||(i=document.createElement("span"),i.setAttribute("id",xL),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=$E($E({},o6e),r);Object.assign(i.style,o),i.textContent="".concat(t);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return nf.widthCache[a]=c,++nf.cacheCount>i6e&&(nf.cacheCount=0,nf.widthCache={}),c}catch{return{width:0,height:0}}},c6e=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function hy(e){"@babel/helpers - typeof";return hy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hy(e)}function ow(e,t){return h6e(e)||f6e(e,t)||d6e(e,t)||u6e()}function u6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
861In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d6e(e,t){if(e){if(typeof e=="string")return bL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bL(e,t)}}function bL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function f6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function h6e(e){if(Array.isArray(e))return e}function m6e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function wL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g6e(r.key),r)}}function p6e(e,t,n){return t&&wL(e.prototype,t),n&&wL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g6e(e){var t=y6e(e,"string");return hy(t)=="symbol"?t:t+""}function y6e(e,t){if(hy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(hy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var jL=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,NL=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,v6e=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,x6e=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,vX={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},b6e=Object.keys(vX),Nf="NaN";function w6e(e,t){return e*vX[t]}var Vx=function(){function e(t,n){m6e(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),n!==""&&!v6e.test(n)&&(this.num=NaN,this.unit=""),b6e.includes(n)&&(this.num=w6e(t,n),this.unit="px")}return p6e(e,[{key:"add",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num+n.num,this.unit)}},{key:"subtract",value:function(n){return this.unit!==n.unit?new e(NaN,""):new e(this.num-n.num,this.unit)}},{key:"multiply",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num*n.num,this.unit||n.unit)}},{key:"divide",value:function(n){return this.unit!==""&&n.unit!==""&&this.unit!==n.unit?new e(NaN,""):new e(this.num/n.num,this.unit||n.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(n){var r,a=(r=x6e.exec(n))!==null&&r!==void 0?r:[],i=ow(a,3),o=i[1],l=i[2];return new e(parseFloat(o),l??"")}}])}();function xX(e){if(e.includes(Nf))return Nf;for(var t=e;t.includes("*")||t.includes("/");){var n,r=(n=jL.exec(t))!==null&&n!==void 0?n:[],a=ow(r,4),i=a[1],o=a[2],l=a[3],c=Vx.parse(i??""),u=Vx.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return Nf;t=t.replace(jL,d.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var f,h=(f=NL.exec(t))!==null&&f!==void 0?f:[],m=ow(h,4),p=m[1],g=m[2],y=m[3],v=Vx.parse(p??""),w=Vx.parse(y??""),b=g==="+"?v.add(w):v.subtract(w);if(b.isNaN())return Nf;t=t.replace(NL,b.toString())}return t}var SL=/\(([^()]*)\)/;function j6e(e){for(var t=e;t.includes("(");){var n=SL.exec(t),r=ow(n,2),a=r[1];t=t.replace(SL,xX(a))}return t}function N6e(e){var t=e.replace(/\s+/g,"");return t=j6e(t),t=xX(t),t}function S6e(e){try{return N6e(e)}catch{return Nf}}function vC(e){var t=S6e(e.slice(5,-1));return t===Nf?"":t}var C6e=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],_6e=["dx","dy","angle","className","breakAll"];function IE(){return IE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IE.apply(this,arguments)}function CL(e,t){if(e==null)return{};var n=E6e(e,t),r,a;
861if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function E6e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _L(e,t){return O6e(e)||k6e(e,t)||P6e(e,t)||A6e()}function A6e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
862In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function P6e(e,t){if(e){if(typeof e=="string")return EL(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return EL(e,t)}}function EL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function k6e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function O6e(e){if(Array.isArray(e))return e}var bX=/[ \f\n\r\t\v\u2028\u2029]+/,wX=function(t){var n=t.children,r=t.breakAll,a=t.style;try{var i=[];Ke(n)||(r?i=n.toString().split(""):i=n.toString().split(bX));var o=i.map(function(c){return{word:c,width:qf(c,a).width}}),l=r?0:qf(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},T6e=function(t,n,r,a,i){var o=t.maxLines,l=t.children,c=t.style,u=t.breakAll,d=Ee(o),f=l,h=function(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return I.reduce(function(M,$){var R=$.word,O=$.width,F=M[M.length-1];if(F&&(a==null||i||F.width+O+r<Number(a)))F.words.push(R),F.width+=O+r;else{var z={words:[R],width:O};M.push(z)}return M},[])},m=h(n),p=function(I){return I.reduce(function(M,$){return M.width>$.width?M:$})};if(!d)return m;for(var g="…",y=function(I){var M=f.slice(0,I),$=wX({breakAll:u,style:c,children:M+g}).wordsWithComputedWidth,R=h($),O=R.length>o||p(R).width>Number(a);return[O,R]},v=0,w=f.length-1,b=0,j;v<=w&&b<=f.length-1;){var N=Math.floor((v+w)/2),S=N-1,C=y(S),_=_L(C,2),E=_[0],T=_[1],P=y(N),k=_L(P,1),D=k[0];if(!E&&!D&&(v=N+1),E&&D&&(w=N-1),!E&&D){j=T;break}b++}return j||m},AL=function(t){var n=Ke(t)?[]:t.toString().split(bX);return[{words:n}]},M6e=function(t){var n=t.width,r=t.scaleToFit,a=t.children,i=t.style,o=t.breakAll,l=t.maxLines;if((n||r)&&!Tr.isSsr){var c,u,d=wX({breakAll:o,children:a,style:i});if(d){var f=d.wordsWithComputedWidth,h=d.spaceWidth;c=f,u=h}else return AL(a);return T6e({breakAll:o,children:a,maxLines:l,style:i},c,u,n,r)}return AL(a)},PL="#808080",jd=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.lineHeight,l=o===void 0?"1em":o,c=t.capHeight,u=c===void 0?"0.71em":c,d=t.scaleToFit,f=d===void 0?!1:d,h=t.textAnchor,m=h===void 0?"start":h,p=t.verticalAnchor,g=p===void 0?"end":p,y=t.fill,v=y===void 0?PL:y,w=CL(t,C6e),b=x.useMemo(function(){return M6e({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:f,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,f,w.style,w.width]),j=w.dx,N=w.dy,S=w.angle,C=w.className,_=w.breakAll,E=CL(w,_6e);if(!dr(r)||!dr(i))return null;var T=r+(Ee(j)?j:0),P=i+(Ee(N)?N:0),k;switch(g){case"start":k=vC("calc(".concat(u,")"));break;case"middle":k=vC("calc(".concat((b.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:k=vC("calc(".concat(b.length-1," * -").concat(l,")"));break}var D=[];if(f){var A=b[0].width,I=w.width;D.push("scale(".concat((Ee(I)?I/A:1)/A,")"))}return S&&D.push("rotate(".concat(S,", ").concat(T,", ").concat(P,")")),D.length&&(E.transform=D.join(" ")),L.createElement("text",IE({},Me(E,!0),{x:T,y:P,className:Ge("recharts-text",C),textAnchor:m,fill:v.includes("url")?PL:v}),b.map(function(M,$){var R=M.words.join(_?"":" ");return L.createElement("tspan",{x:T,dy:$===0?k:l,key:"".concat(R,"-").concat($)},R)}))};function Pc(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function R6e(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function LT(e){let t,n,r;e.length!==2?(t=Pc,n=(l,c)=>Pc(e(l),c),r=(l,c)=>e(l)-c):(t=e===Pc||e===R6e?e:D6e,n=e,r=e);function a(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<0?u=f+1:d=f}while(u<d)}return u}function i(l,c,u=0,d=l.length){if(u<d){if(t(c,c)!==0)return d;do{const f=u+d>>>1;n(l[f],c)<=0?u=f+1:d=f}while(u<d)}return u}function o(l,c,u=0,d=l.length){const f=a(l,c,u,d-1);return f>u&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:a,center:o,right:i}}function D6e(){return 0}function jX(e){return e===null?NaN:+e}function*$6e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const I6e=LT(Pc),Bv=I6e.right;LT(jX).center;class kL extends Map{constructor(t,n=B6e){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(OL(this,t))}has(t){return super.has(OL(this,t))}set(t,n){return super.set(L6e(this,t),n)}delete(t){return super.delete(F6e(this,t))}}function OL({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function L6e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function F6e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function B6e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function z6e(e=Pc){if(e===Pc)return NX;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function NX(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}const U6e=Math.sqrt(50),V6e=Math.sqrt(10),W6e=Math.sqrt(2);
862function lw(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),i=r/Math.pow(10,a),o=i>=U6e?10:i>=V6e?5:i>=W6e?2:1;let l,c,u;return a<0?(u=Math.pow(10,-a)/o,l=Math.round(e*u),c=Math.round(t*u),l/u<e&&++l,c/u>t&&--c,u=-u):(u=Math.pow(10,a)*o,l=Math.round(e/u),c=Math.round(t/u),l*u<e&&++l,c*u>t&&--c),c<l&&.5<=n&&n<2?lw(e,t,n*2):[l,c,u]}function LE(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[a,i,o]=r?lw(t,e,n):lw(e,t,n);if(!(i>=a))return[];const l=i-a+1,c=new Array(l);if(r)if(o<0)for(let u=0;u<l;++u)c[u]=(i-u)/-o;else for(let u=0;u<l;++u)c[u]=(i-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(a+u)/-o;else for(let u=0;u<l;++u)c[u]=(a+u)*o;return c}function FE(e,t,n){return t=+t,e=+e,n=+n,lw(e,t,n)[2]}function BE(e,t,n){t=+t,e=+e,n=+n;const r=t<e,a=r?FE(t,e,n):FE(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function TL(e,t){let n;for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);return n}function ML(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function SX(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?NX:z6e(a);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),h=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),m=Math.max(n,Math.floor(t-u*f/c+h)),p=Math.min(r,Math.floor(t+(c-u)*f/c+h));SX(e,t,m,p,a)}const i=e[t];let o=n,l=r;for(pp(e,n,t),a(e[r],i)>0&&pp(e,n,r);o<l;){for(pp(e,o,l),++o,--l;a(e[o],i)<0;)++o;for(;a(e[l],i)>0;)--l}a(e[n],i)===0?pp(e,n,l):(++l,pp(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function pp(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function q6e(e,t,n){if(e=Float64Array.from($6e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return ML(e);if(t>=1)return TL(e);var r,a=(r-1)*t,i=Math.floor(a),o=TL(SX(e,i).subarray(0,i+1)),l=ML(e.subarray(i+1));return o+(l-o)*(a-i)}}function H6e(e,t,n=jX){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,i=Math.floor(a),o=+n(e[i],i,e),l=+n(e[i+1],i+1,e);return o+(l-o)*(a-i)}}function K6e(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(a);++r<a;)i[r]=e+r*n;return i}function $s(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function Pl(e,t){switch(arguments.length){case 0:break;case 1:{typeof e=="function"?this.interpolator(e):this.range(e);break}default:{this.domain(e),typeof t=="function"?this.interpolator(t):this.range(t);break}}return this}const zE=Symbol("implicit");function FT(){var e=new kL,t=[],n=[],r=zE;function a(i){let o=e.get(i);if(o===void 0){if(r!==zE)return r;e.set(i,o=t.push(i)-1)}return n[o%n.length]}return a.domain=function(i){if(!arguments.length)return t.slice();t=[],e=new kL;for(const o of i)e.has(o)||e.set(o,t.push(o)-1);return a},a.range=function(i){return arguments.length?(n=Array.from(i),a):n.slice()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return FT(t,n).unknown(r)},$s.apply(a,arguments),a}function my(){var e=FT().unknown(void 0),t=e.domain,n=e.range,r=0,a=1,i,o,l=!1,c=0,u=0,d=.5;delete e.unknown;function f(){var h=t().length,m=a<r,p=m?a:r,g=m?r:a;i=(g-p)/Math.max(1,h-c+u*2),l&&(i=Math.floor(i)),p+=(g-p-i*(h-c))*d,o=i*(1-c),l&&(p=Math.round(p),o=Math.round(o));var y=K6e(h).map(function(v){return p+i*v});return n(m?y.reverse():y)}return e.domain=function(h){return arguments.length?(t(h),f()):t()},e.range=function(h){return arguments.length?([r,a]=h,r=+r,a=+a,f()):[r,a]},e.rangeRound=function(h){return[r,a]=h,r=+r,a=+a,l=!0,f()},e.bandwidth=function(){return o},e.step=function(){return i},e.round=function(h){return arguments.length?(l=!!h,f()):l},e.padding=function(h){return arguments.length?(c=Math.min(1,u=+h),f()):c},e.paddingInner=function(h){return arguments.length?(c=Math.min(1,h),f()):c},e.paddingOuter=function(h){return arguments.length?(u=+h,f()):u},e.align=function(h){return arguments.length?(d=Math.max(0,Math.min(1,h)),f()):d}
vendor: 8,453 bytes, line 862
862,e.copy=function(){return my(t(),[r,a]).round(l).paddingInner(c).paddingOuter(u).align(d)},$s.apply(f(),arguments)}function CX(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return CX(t())},e}function og(){return CX(my.apply(null,arguments).paddingInner(1))}function G6e(e){return function(){return e}}function cw(e){return+e}var RL=[0,1];function la(e){return e}function UE(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:G6e(isNaN(t)?NaN:.5)}function Y6e(e,t){var n;return e>t&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function X6e(e,t,n){var r=e[0],a=e[1],i=t[0],o=t[1];return a<r?(r=UE(a,r),i=n(o,i)):(r=UE(r,a),i=n(i,o)),function(l){return i(r(l))}}function Q6e(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),i=new Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)a[o]=UE(e[o],e[o+1]),i[o]=n(t[o],t[o+1]);return function(l){var c=Bv(e,l,1,r)-1;return i[c](a[c](l))}}function zv(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function pN(){var e=RL,t=RL,n=zo,r,a,i,o=la,l,c,u;function d(){var h=Math.min(e.length,t.length);return o!==la&&(o=Y6e(e[0],e[h-1])),l=h>2?Q6e:X6e,c=u=null,f}function f(h){return h==null||isNaN(h=+h)?i:(c||(c=l(e.map(r),t,n)))(r(o(h)))}return f.invert=function(h){return o(a((u||(u=l(t,e.map(r),Qs)))(h)))},f.domain=function(h){return arguments.length?(e=Array.from(h,cw),d()):e.slice()},f.range=function(h){return arguments.length?(t=Array.from(h),d()):t.slice()},f.rangeRound=function(h){return t=Array.from(h),n=jO,d()},f.clamp=function(h){return arguments.length?(o=h?!0:la,d()):o!==la},f.interpolate=function(h){return arguments.length?(n=h,d()):n},f.unknown=function(h){return arguments.length?(i=h,f):i},function(h,m){return r=h,a=m,d()}}function BT(){return pN()(la,la)}function J6e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function uw(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function $h(e){return e=uw(Math.abs(e)),e?e[1]:NaN}function Z6e(e,t){return function(n,r){for(var a=n.length,i=[],o=0,l=e[0],c=0;a>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),i.push(n.substring(a-=l,a+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return i.reverse().join(t)}}function e8e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var t8e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function py(e){if(!(t=t8e.exec(e)))throw new Error("invalid format: "+e);var t;return new zT({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}py.prototype=zT.prototype;function zT(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}zT.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function n8e(e){e:for(var t=e.length,n=1,r=-1,a;n<t;++n)switch(e[n]){case".":r=a=n;break;case"0":r===0&&(r=n),a=n;break;default:if(!+e[n])break e;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var _X;function r8e(e,t){var n=uw(e,t);if(!n)return e+"";var r=n[0],a=n[1],i=a-(_X=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=r.length;return i===o?r:i>o?r+new Array(i-o+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+uw(e,Math.max(0,t+i-1))[0]}function DL(e,t){var n=uw(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const $L={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:J6e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>DL(e*100,t),r:DL,s:r8e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function IL(e){return e}var LL=Array.prototype.map,FL=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function a8e(e){var t=e.grouping===void 0||e.thousands===void 0?IL:Z6e(LL.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?IL:e8e(LL.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f){f=py(f);var h=f.fill,m=f.align,p=f.sign,g=f.symbol,y=f.zero,v=f.width,w=f.comma,b=f.precision,j=f.trim,N=f.type;N==="n"?(w=!0,N="g"):$L[N]||(b===void 0&&(b=12),j=!0,N="g"),(y||h==="0"&&m==="=")&&(y=!0,h="0",m="=");var S=g==="$"?n:g==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():"",C=g==="$"?r:/[%p]/.test(N)?o:"",_=$L[N],E=/[defgprs%]/.test(N);b=b===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,b)):Math.max(0,Math.min(20,b));function T(P){var k=S,D=C,A,I,M;if(N==="c")D=_(P)+D,P="";else{P=+P;var $=P<0||1/P<0;if(P=isNaN(P)?c:_(Math.abs(P),b),j&&(P=n8e(P)),$&&+P==0&&p!=="+"&&($=!1),k=($?p==="("?p:l:p==="-"||p==="("?"":p)+k,D=(N==="s"?FL[8+_X/3]:"")+D+($&&p==="("?")":""),E){for(A=-1,I=P.length;++A<I;)if(M=P.charCodeAt(A),48>M||M>57){D=(M===46?a+P.slice(A+1):P.slice(A))+D,P=P.slice(0,A);break}}}w&&!y&&(P=t(P,1/0));var R=k.length+P.length+D.length,O=R<v?new Array(v-R+1).join(h):"";switch(w&&y&&(P=t(O+P,O.length?v-D.length:1/0),O=""),m){case"<":P=k+P+D+O;break;case"=":P=k+O+P+D;break;case"^":P=O.slice(0,R=O.length>>1)+k+P+D+O.slice(R);break;default:P=O+k+P+D;break}return i(P)}return T.toString=function(){return f+""},T}function d(f,h){var m=u((f=py(f),f.type="f",f)),p=Math.max(-8,Math.min(8,Math.floor($h(h)/3)))*3,g=Math.pow(10,-p),y=FL[8+p/3];return function(v){return m(g*v)+y}}return{format:u,formatPrefix:d}}var Wx,UT,EX;s8e({thousands:",",grouping:[3],currency:["$",""]});function s8e(e){return Wx=a8e(e),UT=Wx.format,EX=Wx.formatPrefix,Wx}function i8e(e){return Math.max(0,-$h(Math.abs(e)))}function o8e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor($h(t)/3)))*3-$h(Math.abs(e)))}function l8e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,$h(t)-$h(e))+1}function AX(e,t,n,r){var a=BE(e,t,n),i;switch(r=py(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=o8e(a,o))&&(r.precision=i),EX(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=l8e(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=i8e(a))&&(r.precision=i-(r.type==="%")*2);break}}return UT(r)}function Zc(e){var t=e.domain;return e.ticks=function(n){var r=t();return LE(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return AX(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,i=r.length-1,o=r[a],l=r[i],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=a,a=i,i=u);d-- >0;){if(u=FE(o,l,n),u===c)return r[a]=o,r[i]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function dw(){var e=BT();return e.copy=function(){return zv(e,dw())},$s.apply(e,arguments),Zc(e)}function PX(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,cw),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return PX(e).unknown(t)},e=arguments.length?Array.from(e,cw):[0,1],Zc(n)}function kX(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],i=e[r],o;return i<a&&(o=n,n=r,r=o,o=a,a=i,i=o),e[n]=t.floor(a),e[r]=t.ceil(i),e}function BL(e){return Math.log(e)}function zL(e){return Math.exp(e)}function c8e(e){return-Math.log(-e)}function u8e(e){return-Math.exp(-e)}function d8e(e){return isFinite(e)?+("1e"+e):e<0?0:e}function f8e(e){return e===10?d8e:e===Math.E?Math.exp:t=>Math.pow(e,t)}
vendor: 4,104 bytes, line 862
862function h8e(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function UL(e){return(t,n)=>-e(-t,n)}function VT(e){const t=e(BL,zL),n=t.domain;let r=10,a,i;function o(){return a=h8e(r),i=f8e(r),n()[0]<0?(a=UL(a),i=UL(i),e(c8e,u8e)):e(BL,zL),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d<u;f&&([u,d]=[d,u]);let h=a(u),m=a(d),p,g;const y=l==null?10:+l;let v=[];if(!(r%1)&&m-h<y){if(h=Math.floor(h),m=Math.ceil(m),u>0){for(;h<=m;++h)for(p=1;p<r;++p)if(g=h<0?p/i(-h):p*i(h),!(g<u)){if(g>d)break;v.push(g)}}else for(;h<=m;++h)for(p=r-1;p>=1;--p)if(g=h>0?p/i(-h):p*i(h),!(g<u)){if(g>d)break;v.push(g)}v.length*2<y&&(v=LE(u,d,y))}else v=LE(h,m,Math.min(m-h,y)).map(i);return f?v.reverse():v},t.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=py(c)).precision==null&&(c.trim=!0),c=UT(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/i(Math.round(a(d)));return f*r<r-.5&&(f*=r),f<=u?c(d):""}},t.nice=()=>n(kX(n(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),t}function OX(){const e=VT(pN()).domain([1,10]);return e.copy=()=>zv(e,OX()).base(e.base()),$s.apply(e,arguments),e}function VL(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function WL(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function WT(e){var t=1,n=e(VL(t),WL(t));return n.constant=function(r){return arguments.length?e(VL(t=+r),WL(t)):t},Zc(n)}function TX(){var e=WT(pN());return e.copy=function(){return zv(e,TX()).constant(e.constant())},$s.apply(e,arguments)}function qL(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function m8e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function p8e(e){return e<0?-e*e:e*e}function qT(e){var t=e(la,la),n=1;function r(){return n===1?e(la,la):n===.5?e(m8e,p8e):e(qL(n),qL(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},Zc(t)}function HT(){var e=qT(pN());return e.copy=function(){return zv(e,HT()).exponent(e.exponent())},$s.apply(e,arguments),e}function g8e(){return HT.apply(null,arguments).exponent(.5)}function HL(e){return Math.sign(e)*e*e}function y8e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function MX(){var e=BT(),t=[0,1],n=!1,r;function a(i){var o=y8e(e(i));return isNaN(o)?r:n?Math.round(o):o}return a.invert=function(i){return e.invert(HL(i))},a.domain=function(i){return arguments.length?(e.domain(i),a):e.domain()},a.range=function(i){return arguments.length?(e.range((t=Array.from(i,cw)).map(HL)),a):t.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(n=!!i,a):n},a.clamp=function(i){return arguments.length?(e.clamp(i),a):e.clamp()},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return MX(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},$s.apply(a,arguments),Zc(a)}function RX(){var e=[],t=[],n=[],r;function a(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o<l;)n[o-1]=H6e(e,o/l);return i}function i(o){return o==null||isNaN(o=+o)?r:t[Bv(n,o)]}return i.invertExtent=function(o){var l=t.indexOf(o);return l<0?[NaN,NaN]:[l>0?n[l-1]:e[0],l<n.length?n[l]:e[e.length-1]]},i.domain=function(o){if(!arguments.length)return e.slice();e=[];for(let l of o)l!=null&&!isNaN(l=+l)&&e.push(l);return e.sort(Pc),a()},i.range=function(o){return arguments.length?(t=Array.from(o),a()):t.slice()},i.unknown=function(o){return arguments.length?(r=o,i):r},i.quantiles=function(){return n.slice()},i.copy=function(){return RX().domain(e).range(t).unknown(r)},$s.apply(i,arguments)}function DX(){var e=0,t=1,n=1,r=[.5],a=[0,1],i;function o(c){return c!=null&&c<=c?a[Bv(r,c,0,n)]:i}function l(){var c=-1;for(r=new Array(n);++c<n;)r[c]=((c+1)*t-(c-n)*e)/(n+1);return o}return o.domain=function(c){return arguments.length?([e,t]=c,e=+e,t=+t,l()):[e,t]},o.range=function(c){return arguments.length?(n=(a=Array.from(c)).length-1,l(
862)):a.slice()},o.invertExtent=function(c){var u=a.indexOf(c);return u<0?[NaN,NaN]:u<1?[e,r[0]]:u>=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return DX().domain([e,t]).range(a).unknown(i)},$s.apply(Zc(o),arguments)}function $X(){var e=[.5],t=[0,1],n,r=1;function a(i){return i!=null&&i<=i?t[Bv(e,i,0,r)]:n}return a.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(i){var o=t.indexOf(i);return[e[o-1],e[o]]},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return $X().domain(e).range(t).unknown(n)},$s.apply(a,arguments)}const xC=new Date,bC=new Date;function hr(e,t,n,r){function a(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(e(i=new Date(+i)),i),a.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),a.round=i=>{const o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(t(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const c=[];if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let u;do c.push(u=new Date(+i)),t(i,l),e(i);while(u<i&&i<o);return c},a.filter=i=>hr(o=>{if(o>=o)for(;e(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!i(o););else for(;--l>=0;)for(;t(o,1),!i(o););}),n&&(a.count=(i,o)=>(xC.setTime(+i),bC.setTime(+o),e(xC),e(bC),Math.floor(n(xC,bC))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(r?o=>r(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const fw=hr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);fw.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?hr(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):fw);fw.range;
vendor: 4,325 bytes, line 862
862const $o=1e3,Es=$o*60,Io=Es*60,ml=Io*24,KT=ml*7,KL=ml*30,wC=ml*365,Pu=hr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*$o)},(e,t)=>(t-e)/$o,e=>e.getUTCSeconds());Pu.range;const GT=hr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$o)},(e,t)=>{e.setTime(+e+t*Es)},(e,t)=>(t-e)/Es,e=>e.getMinutes());GT.range;const YT=hr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Es)},(e,t)=>(t-e)/Es,e=>e.getUTCMinutes());YT.range;const XT=hr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*$o-e.getMinutes()*Es)},(e,t)=>{e.setTime(+e+t*Io)},(e,t)=>(t-e)/Io,e=>e.getHours());XT.range;const QT=hr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Io)},(e,t)=>(t-e)/Io,e=>e.getUTCHours());QT.range;const Uv=hr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Es)/ml,e=>e.getDate()-1);Uv.range;const gN=hr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ml,e=>e.getUTCDate()-1);gN.range;const IX=hr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ml,e=>Math.floor(e/ml));IX.range;function Dd(e){return hr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Es)/KT)}const yN=Dd(0),hw=Dd(1),v8e=Dd(2),x8e=Dd(3),Ih=Dd(4),b8e=Dd(5),w8e=Dd(6);yN.range;hw.range;v8e.range;x8e.range;Ih.range;b8e.range;w8e.range;function $d(e){return hr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/KT)}const vN=$d(0),mw=$d(1),j8e=$d(2),N8e=$d(3),Lh=$d(4),S8e=$d(5),C8e=$d(6);vN.range;mw.range;j8e.range;N8e.range;Lh.range;S8e.range;C8e.range;const JT=hr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());JT.range;const ZT=hr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ZT.range;const pl=hr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());pl.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:hr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});pl.range;const gl=hr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());gl.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:hr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});gl.range;function LX(e,t,n,r,a,i){const o=[[Pu,1,$o],[Pu,5,5*$o],[Pu,15,15*$o],[Pu,30,30*$o],[i,1,Es],[i,5,5*Es],[i,15,15*Es],[i,30,30*Es],[a,1,Io],[a,3,3*Io],[a,6,6*Io],[a,12,12*Io],[r,1,ml],[r,2,2*ml],[n,1,KT],[t,1,KL],[t,3,3*KL],[e,1,wC]];function l(u,d,f){const h=d<u;h&&([u,d]=[d,u]);const m=f&&typeof f.range=="function"?f:c(u,d,f),p=m?m.range(u,+d+1):[];return h?p.reverse():p}function c(u,d,f){const h=Math.abs(d-u)/f,m=LT(([,,y])=>y).right(o,h);if(m===o.length)return e.every(BE(u/wC,d/wC,f));if(m===0)return fw.every(Math.max(BE(u,d,f),1));const[p,g]=o[h/o[m-1][2]<o[m][2]/h?m-1:m];return p.every(g)}return[l,c]}const[_8e,E8e]=LX(gl,ZT,vN,IX,QT,YT),[A8e,P8e]=LX(pl,JT,yN,Uv,XT,GT);function jC(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function NC(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function gp(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function k8e(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,i=e.days,o=e.shortDays,l=e.months,c=e.shortMonths,u=yp(a),d=vp(a),f=yp(i),h=vp(i),m=yp(o),p=vp(o),g=yp(l),y=vp(l),v=yp(c),w=vp(c),b={a:$,A:R,b:O,B:F,c:null,d:ZL,e:ZL,f:Z8e,g:cBe,G:dBe,H:X8e,I:Q8e,j:J8e,L:FX,m:eBe,M:tBe,p:z,q:B,Q:n3,s:r3,S:nBe,u:rBe,U:aBe,V:sBe,w:iBe,W:oBe,x:null,X:null,y:lBe,Y:uBe,Z:fBe,"%":t3}
vendor: 4,200 bytes, line 862
862,j={a:H,A:Y,b:ee,B:V,c:null,d:e3,e:e3,f:gBe,g:_Be,G:ABe,H:hBe,I:mBe,j:pBe,L:zX,m:yBe,M:vBe,p:K,q:W,Q:n3,s:r3,S:xBe,u:bBe,U:wBe,V:jBe,w:NBe,W:SBe,x:null,X:null,y:CBe,Y:EBe,Z:PBe,"%":t3},N={a:T,A:P,b:k,B:D,c:A,d:QL,e:QL,f:H8e,g:XL,G:YL,H:JL,I:JL,j:U8e,L:q8e,m:z8e,M:V8e,p:E,q:B8e,Q:G8e,s:Y8e,S:W8e,u:D8e,U:$8e,V:I8e,w:R8e,W:L8e,x:I,X:M,y:XL,Y:YL,Z:F8e,"%":K8e};b.x=S(n,b),b.X=S(r,b),b.c=S(t,b),j.x=S(n,j),j.X=S(r,j),j.c=S(t,j);function S(q,J){return function(ie){var X=[],ge=-1,Se=0,ce=q.length,ye,Ie,Ue;for(ie instanceof Date||(ie=new Date(+ie));++ge<ce;)q.charCodeAt(ge)===37&&(X.push(q.slice(Se,ge)),(Ie=GL[ye=q.charAt(++ge)])!=null?ye=q.charAt(++ge):Ie=ye==="e"?" ":"0",(Ue=J[ye])&&(ye=Ue(ie,Ie)),X.push(ye),Se=ge+1);return X.push(q.slice(Se,ge)),X.join("")}}function C(q,J){return function(ie){var X=gp(1900,void 0,1),ge=_(X,q,ie+="",0),Se,ce;if(ge!=ie.length)return null;if("Q"in X)return new Date(X.Q);if("s"in X)return new Date(X.s*1e3+("L"in X?X.L:0));if(J&&!("Z"in X)&&(X.Z=0),"p"in X&&(X.H=X.H%12+X.p*12),X.m===void 0&&(X.m="q"in X?X.q:0),"V"in X){if(X.V<1||X.V>53)return null;"w"in X||(X.w=1),"Z"in X?(Se=NC(gp(X.y,0,1)),ce=Se.getUTCDay(),Se=ce>4||ce===0?mw.ceil(Se):mw(Se),Se=gN.offset(Se,(X.V-1)*7),X.y=Se.getUTCFullYear(),X.m=Se.getUTCMonth(),X.d=Se.getUTCDate()+(X.w+6)%7):(Se=jC(gp(X.y,0,1)),ce=Se.getDay(),Se=ce>4||ce===0?hw.ceil(Se):hw(Se),Se=Uv.offset(Se,(X.V-1)*7),X.y=Se.getFullYear(),X.m=Se.getMonth(),X.d=Se.getDate()+(X.w+6)%7)}else("W"in X||"U"in X)&&("w"in X||(X.w="u"in X?X.u%7:"W"in X?1:0),ce="Z"in X?NC(gp(X.y,0,1)).getUTCDay():jC(gp(X.y,0,1)).getDay(),X.m=0,X.d="W"in X?(X.w+6)%7+X.W*7-(ce+5)%7:X.w+X.U*7-(ce+6)%7);return"Z"in X?(X.H+=X.Z/100|0,X.M+=X.Z%100,NC(X)):jC(X)}}function _(q,J,ie,X){for(var ge=0,Se=J.length,ce=ie.length,ye,Ie;ge<Se;){if(X>=ce)return-1;if(ye=J.charCodeAt(ge++),ye===37){if(ye=J.charAt(ge++),Ie=N[ye in GL?J.charAt(ge++):ye],!Ie||(X=Ie(q,ie,X))<0)return-1}else if(ye!=ie.charCodeAt(X++))return-1}return X}function E(q,J,ie){var X=u.exec(J.slice(ie));return X?(q.p=d.get(X[0].toLowerCase()),ie+X[0].length):-1}function T(q,J,ie){var X=m.exec(J.slice(ie));return X?(q.w=p.get(X[0].toLowerCase()),ie+X[0].length):-1}function P(q,J,ie){var X=f.exec(J.slice(ie));return X?(q.w=h.get(X[0].toLowerCase()),ie+X[0].length):-1}function k(q,J,ie){var X=v.exec(J.slice(ie));return X?(q.m=w.get(X[0].toLowerCase()),ie+X[0].length):-1}function D(q,J,ie){var X=g.exec(J.slice(ie));return X?(q.m=y.get(X[0].toLowerCase()),ie+X[0].length):-1}function A(q,J,ie){return _(q,t,J,ie)}function I(q,J,ie){return _(q,n,J,ie)}function M(q,J,ie){return _(q,r,J,ie)}function $(q){return o[q.getDay()]}function R(q){return i[q.getDay()]}function O(q){return c[q.getMonth()]}function F(q){return l[q.getMonth()]}function z(q){return a[+(q.getHours()>=12)]}function B(q){return 1+~~(q.getMonth()/3)}function H(q){return o[q.getUTCDay()]}function Y(q){return i[q.getUTCDay()]}function ee(q){return c[q.getUTCMonth()]}function V(q){return l[q.getUTCMonth()]}function K(q){return a[+(q.getUTCHours()>=12)]}function W(q){return 1+~~(q.getUTCMonth()/3)}return{format:function(q){var J=S(q+="",b);return J.toString=function(){return q},J},parse:function(q){var J=C(q+="",!1);return J.toString=function(){return q},J},utcFormat:function(q){var J=S(q+="",j);return J.toString=function(){return q},J},utcParse:function(q){var J=C(q+="",!0);return J.toString=function(){return q},J}}}var GL={"-":"",_:" ",0:"0"},_r=/^\s*\d+/,O8e=/^%/,T8e=/[\\^$*+?|[\]().{}]/g;function Lt(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",i=a.length;return r+(i<n?new Array(n-i+1).join(t)+a:a)}function M8e(e){return e.replace(T8e,"\\$&")}function yp(e){return new RegExp("^(?:"+e.map(M8e).join("|")+")","i")}function vp(e){return new Map(e.map((t,n)=>[t.toLowerCase(),n]))}function R8e(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function D8e(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function $8e(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function I8e(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function L8e(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}
862function YL(e,t,n){var r=_r.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function XL(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function F8e(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function B8e(e,t,n){var r=_r.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function z8e(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function QL(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function U8e(e,t,n){var r=_r.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function JL(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function V8e(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function W8e(e,t,n){var r=_r.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function q8e(e,t,n){var r=_r.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function H8e(e,t,n){var r=_r.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function K8e(e,t,n){var r=O8e.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function G8e(e,t,n){var r=_r.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Y8e(e,t,n){var r=_r.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function ZL(e,t){return Lt(e.getDate(),t,2)}function X8e(e,t){return Lt(e.getHours(),t,2)}function Q8e(e,t){return Lt(e.getHours()%12||12,t,2)}function J8e(e,t){return Lt(1+Uv.count(pl(e),e),t,3)}function FX(e,t){return Lt(e.getMilliseconds(),t,3)}function Z8e(e,t){return FX(e,t)+"000"}function eBe(e,t){return Lt(e.getMonth()+1,t,2)}function tBe(e,t){return Lt(e.getMinutes(),t,2)}function nBe(e,t){return Lt(e.getSeconds(),t,2)}function rBe(e){var t=e.getDay();return t===0?7:t}function aBe(e,t){return Lt(yN.count(pl(e)-1,e),t,2)}function BX(e){var t=e.getDay();return t>=4||t===0?Ih(e):Ih.ceil(e)}function sBe(e,t){return e=BX(e),Lt(Ih.count(pl(e),e)+(pl(e).getDay()===4),t,2)}function iBe(e){return e.getDay()}function oBe(e,t){return Lt(hw.count(pl(e)-1,e),t,2)}function lBe(e,t){return Lt(e.getFullYear()%100,t,2)}function cBe(e,t){return e=BX(e),Lt(e.getFullYear()%100,t,2)}function uBe(e,t){return Lt(e.getFullYear()%1e4,t,4)}function dBe(e,t){var n=e.getDay();return e=n>=4||n===0?Ih(e):Ih.ceil(e),Lt(e.getFullYear()%1e4,t,4)}function fBe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Lt(t/60|0,"0",2)+Lt(t%60,"0",2)}function e3(e,t){return Lt(e.getUTCDate(),t,2)}function hBe(e,t){return Lt(e.getUTCHours(),t,2)}function mBe(e,t){return Lt(e.getUTCHours()%12||12,t,2)}function pBe(e,t){return Lt(1+gN.count(gl(e),e),t,3)}function zX(e,t){return Lt(e.getUTCMilliseconds(),t,3)}function gBe(e,t){return zX(e,t)+"000"}function yBe(e,t){return Lt(e.getUTCMonth()+1,t,2)}function vBe(e,t){return Lt(e.getUTCMinutes(),t,2)}function xBe(e,t){return Lt(e.getUTCSeconds(),t,2)}function bBe(e){var t=e.getUTCDay();return t===0?7:t}function wBe(e,t){return Lt(vN.count(gl(e)-1,e),t,2)}function UX(e){var t=e.getUTCDay();return t>=4||t===0?Lh(e):Lh.ceil(e)}function jBe(e,t){return e=UX(e),Lt(Lh.count(gl(e),e)+(gl(e).getUTCDay()===4),t,2)}function NBe(e){return e.getUTCDay()}function SBe(e,t){return Lt(mw.count(gl(e)-1,e),t,2)}function CBe(e,t){return Lt(e.getUTCFullYear()%100,t,2)}function _Be(e,t){return e=UX(e),Lt(e.getUTCFullYear()%100,t,2)}function EBe(e,t){return Lt(e.getUTCFullYear()%1e4,t,4)}function ABe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Lh(e):Lh.ceil(e),Lt(e.getUTCFullYear()%1e4,t,4)}function PBe(){return"+0000"}function t3(){return"%"}function n3(e){return+e}function r3(e){return Math.floor(+e/1e3)}var rf,VX,WX;kBe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function kBe(e){return rf=k8e(e),VX=rf.format,rf.parse,WX=rf.utcFormat,rf.utcParse,rf}function OBe(e){return new Date(e)}function TBe(e){return e instanceof Date?+e:+new Date(+e)}function eM(e,t,n,r,a,i,o,l,c,u){var d=BT(),f=d.invert,h=d.domain,m=u(".%L"),p=u(":%S"),g=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),w=u("%b %d"),b=u("%B"),j=u("%Y");function N(S){return(c(S)<S?m:l(S)<S?p:o(S)<S?g:i(S)<S?y:r(S)<S?a(S)<S?v:w:n(S)<S?b:j)(S)}return d.invert=function(S){return new Date(f(S))},d.domain=function(S){return arguments.length?h(Array.from(S,TBe)):h().map(OBe)},d.ticks=function(S){var C=h();return e(C[0],C[C.length-1],S??10)},d.tickFormat=function(S,C){return C==null?N:u(C)},d.nice=function(S){var C=h();return(!S||typeof S.range!="function")&&(S=t(C[0],C[C.length-1],S??10)),S?h(kX(C,S)):d},d.copy=function(){return zv(d,eM(e,t,n,r,a,i,o,l,c,u))},d}function MBe(){return $s.apply(eM(A8e,P8e,pl,JT,yN,Uv,XT,GT,Pu,VX).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function RBe(){return $s.apply(eM(_8e,E8e,gl,ZT,vN,gN,QT,YT,Pu,WX).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function xN(){var e=0,t=1,n,r,a,i,o=la,l=!1,c;function u(f){return f==null||isNaN(f=+f)?c:o(a===0?.5:(f=(i(f)-n)*a,l?Math.max(0,Math.min(1,f)):f))}u.domain=function(f){return arguments.length?([e,t]=f,n=i(e=+e),r=i(t=+t),a=n===r?0:1/(r-n),u):[e,t]},u.clamp=function(f){return arguments.length?(l=!!f,u):l},u.interpolator=function(f){return arguments.length?(o=f,u):o};function d(f){return function(h){var m,p;return arguments.length?([m,p]=h,o=f(m,p),u):[o(0),o(1)]}}return u.range=d(zo),u.rangeRound=d(jO),u.unknown=function(f){return arguments.length?(c=f,u):c},function(f){return i=f,n=f(e),r=f(t),a=n===r?0:1/(r-n),u}}function eu(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function qX(){var e=Zc(xN()(la));return e.copy=function(){return eu(e,qX())},Pl.apply(e,arguments)}function HX(){var e=VT(xN()).domain([1,10]);return e.copy=function(){return eu(e,HX()).base(e.base())},Pl.apply(e,arguments)}function KX(){var e=WT(xN());return e.copy=function(){return eu(e,KX()).constant(e.constant())},Pl.apply(e,arguments)}function tM(){var e=qT(xN());return e.copy=function(){return eu(e,tM()).exponent(e.exponent())},Pl.apply(e,arguments)}function DBe(){return tM.apply(null,arguments).exponent(.5)}function GX(){var e=[],t=la;function n(r){if(r!=null&&!isNaN(r=+r))return t((Bv(e,r,1)-1)/(e.length-1))}return n.domain=function(r){if(!arguments.length)return e.slice();e=[];for(let a of r)a!=null&&!isNaN(a=+a)&&e.push(a);return e.sort(Pc),n},n.interpolator=function(r){return arguments.length?(t=r,n):t},n.range=function(){return e.map((r,a)=>t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,i)=>q6e(e,i/r))},n.copy=function(){return GX(t).domain(e)},Pl.apply(n,arguments)}function bN(){var e=0,t=.5,n=1,r=1,a,i,o,l,c,u=la,d,f=!1,h;function m(g){return isNaN(g=+g)?h:(g=.5+((g=+d(g))-i)*(r*g<r*i?l:c),u(f?Math.max(0,Math.min(1,g)):g))}m.domain=function(g){return arguments.length?([e,t,n]=g,a=d(e=+e),i=d(t=+t),o=d(n=+n),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),r=i<a?-1:1,m):[e,t,n]},m.clamp=function(g){return arguments.length?(f=!!g,m):f},m.interpolator=function(g){return arguments.length?(u=g,m):u};function p(g){return function(y){var v,w,b;return arguments.length?([v,w,b]=y,u=abe(g,[v,w,b]),m):[u(0),u(.5),u(1)]}}return m.range=p(zo),m.rangeRound=p(jO),m.unknown=function(g){return arguments.length?(h=g,m):h},function(g){return d=g,a=g(e),i=g(t),o=g(n),l=a===i?0:.5/(i-a),c=i===o?0:.5/(o-i),r=i<a?-1:1,m}}function YX(){var e=Zc(bN()(la));return e.copy=function(){return eu(e,YX())},Pl.apply(e,arguments)}function XX(){var e=VT(bN()).domain([.1,1,10]);return e.copy=function(){return eu(e,XX()).base(e.base())},Pl.apply(e,arguments)}function QX(){var e=WT(bN());return e.copy=function(){return eu(e,QX()).constant(e.constant())},Pl.apply(e,arguments)}function nM(){var e=qT(bN());return e.copy=function(){return eu(e,nM()).exponent(e.exponent())},Pl.apply(e,arguments)}function $Be(){return nM.apply(null,arguments).exponent(.5)}const a3=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:my,scaleDiverging:YX,scaleDivergingLog:XX,scaleDivergingPow:nM,scaleDivergingSqrt:$Be,scaleDivergingSymlog:QX,scaleIdentity:PX,scaleImplicit:zE,scaleLinear:dw,scaleLog:OX,scaleOrdinal:FT,scalePoint:og,scalePow:HT,scaleQuantile:RX,scaleQuantize:DX,scaleRadial:MX,scaleSequential:qX,scaleSequentialLog:HX,scaleSequentialPow:tM,scaleSequentialQuantile:GX,scaleSequentialSqrt:DBe,scaleSequentialSymlog:KX,scaleSqrt:g8e,scaleSymlog:TX,scaleThreshold:$X,scaleTime:MBe,scaleUtc:RBe,tickFormat:AX},Symbol.toStringTag,{value:"Module"}));var IBe=Mm;function LBe(e,t,n){for(var r=-1,a=e.length;++r<a;){var i=e[r],o=t(i);if(o!=null&&(l===void 0?o===o&&!IBe(o):n(o,l)))var l=o,c=i}return c}var wN=LBe;function FBe(e,t){return e>t}var JX=FBe,BBe=wN,zBe=JX,UBe=Um;function VBe(e){return e&&e.length?BBe(e,UBe,zBe):void 0}var WBe=VBe;const pc=$t(WBe);function qBe(e,t){return e<t}var ZX=qBe,HBe=wN,KBe=ZX,GBe=Um;function YBe(e){return e&&e.length?HBe(e,GBe,KBe):void 0}var XBe=YBe;const jN=$t(XBe);var QBe=H1,JBe=po,ZBe=lX,eze=ba;function tze(e,t){var n=eze(e)?QBe:ZBe;return n(e,JBe(t))}var nze=tze,rze=RT,aze=nze;function sze(e,t){return rze(aze(e,t),1)}var ize=sze;const oze=$t(ize);var lze=MT;function cze(e,t){return lze(e,t)}var uze=cze;const xi=$t(uze);
vendor: 62,382 bytes, lines 862-889
862var Vm=1e9,dze={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},aM,jn=!0,Ts="[DecimalError] ",Yu=Ts+"Invalid argument: ",rM=Ts+"Exponent out of range: ",Wm=Math.floor,xu=Math.pow,fze=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ns,gr=1e7,mn=7,eQ=9007199254740991,pw=Wm(eQ/mn),Fe={};Fe.absoluteValue=Fe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Fe.comparedTo=Fe.cmp=function(e){var t,n,r,a,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(r=i.d.length,a=e.d.length,t=0,n=r<a?r:a;t<n;++t)if(i.d[t]!==e.d[t])return i.d[t]>e.d[t]^i.s<0?1:-1;return r===a?0:r>a^i.s<0?1:-1};Fe.decimalPlaces=Fe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*mn;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Fe.dividedBy=Fe.div=function(e){return qo(this,new this.constructor(e))};Fe.dividedToIntegerBy=Fe.idiv=function(e){var t=this,n=t.constructor;return Jt(qo(t,new n(e),0,1),n.precision)};Fe.equals=Fe.eq=function(e){return!this.cmp(e)};Fe.exponent=function(){return Qn(this)};Fe.greaterThan=Fe.gt=function(e){return this.cmp(e)>0};Fe.greaterThanOrEqualTo=Fe.gte=function(e){return this.cmp(e)>=0};Fe.isInteger=Fe.isint=function(){return this.e>this.d.length-2};Fe.isNegative=Fe.isneg=function(){return this.s<0};Fe.isPositive=Fe.ispos=function(){return this.s>0};Fe.isZero=function(){return this.s===0};Fe.lessThan=Fe.lt=function(e){return this.cmp(e)<0};Fe.lessThanOrEqualTo=Fe.lte=function(e){return this.cmp(e)<1};Fe.logarithm=Fe.log=function(e){var t,n=this,r=n.constructor,a=r.precision,i=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(ns))throw Error(Ts+"NaN");if(n.s<1)throw Error(Ts+(n.s?"NaN":"-Infinity"));return n.eq(ns)?new r(0):(jn=!1,t=qo(gy(n,i),gy(e,i),i),jn=!0,Jt(t,a))};Fe.minus=Fe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?rQ(t,e):tQ(t,(e.s=-e.s,e))};Fe.modulo=Fe.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Ts+"NaN");return n.s?(jn=!1,t=qo(n,e,0,1).times(e),jn=!0,n.minus(t)):Jt(new r(n),a)};Fe.naturalExponential=Fe.exp=function(){return nQ(this)};Fe.naturalLogarithm=Fe.ln=function(){return gy(this)};Fe.negated=Fe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Fe.plus=Fe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?tQ(t,e):rQ(t,(e.s=-e.s,e))};Fe.precision=Fe.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Yu+e);if(t=Qn(a)+1,r=a.d.length-1,n=r*mn+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Fe.squareRoot=Fe.sqrt=function(){var e,t,n,r,a,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Ts+"NaN")}for(e=Qn(l),jn=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=Hi(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Wm((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(a.toString()),n=c.precision,a=o=n+3;;)if(i=r,r=i.plus(qo(l,i,o+2)).times(.5),Hi(i.d).slice(0,o)===(t=Hi(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),a==o&&t=="4999"){if(Jt(i,n+1,0),i.times(i).eq(l)){r=i;break}}else if(t!="9999")break;o+=4}return jn=!0,Jt(r,n)};Fe.times=Fe.mul=function(e){var t,n,r,a,i,o,l,c,u,d=this,f=d.constructor,h=d.d,m=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=h.length,u=m.length,c<u&&(i=h,h=m,m=i,o=c,c=u,u=o),i=[],o=c+u,r=o;r--;)i.push(0);for(r=u;--r>=0;){for(t=0,a=c+r;a>r;)l=i[a]+m[r]*h[a-r-1]+t,i[a--]=l%gr|0,t=l/gr|0;i[a]=(i[a]+t)%gr|0}for(;!i[--o];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,jn?Jt(e,f.precision):e};Fe.toDecimalPlaces=Fe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(so(e,0,Vm),t===void 0?t=r.rounding:so(t,0,8),Jt(n,e+Qn(n)+1,t))};Fe.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=Nd(r,!0):(so(e,0,Vm),t===void 0?t=a.rounding:so(t,0,8),r=Jt(new a(r),e+1,t),n=Nd(r,!0,e+1)),n};Fe.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?Nd(a):(so(e,0,Vm),t===void 0?t=i.rounding:so(t,0,8),r=Jt(new i(a),e+Qn(a)+1,t),n=Nd(r.abs(),!1,e+Qn(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Fe.toInteger=Fe.toint=function(){var e=this,t=e.constructor;return Jt(new t(e),Qn(e)+1,t.rounding)};Fe.toNumber=function(){return+this};Fe.toPower=Fe.pow=function(e){var t,n,r,a,i,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(ns);if(l=new c(l),!l.s){if(e.s<1)throw Error(Ts+"Infinity");return l}if(l.eq(ns))return l;if(r=c.precision,e.eq(ns))return Jt(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,i=l.s,o){if((n=d<0?-d:d)<=eQ){for(a=new c(ns),t=Math.ceil(r/mn+4),jn=!1;n%2&&(a=a.times(l),i3(a.d,t)),n=Wm(n/2),n!==0;)l=l.times(l),i3(l.d,t);return jn=!0,e.s<0?new c(ns).div(a):Jt(a,r)}}else if(i<0)throw Error(Ts+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,jn=!1,a=e.times(gy(l,r+u)),jn=!0,a=nQ(a),a.s=i,a};Fe.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return e===void 0?(n=Qn(a),r=Nd(a,n<=i.toExpNeg||n>=i.toExpPos)):(so(e,1,Vm),t===void 0?t=i.rounding:so(t,0,8),a=Jt(new i(a),e,t),n=Qn(a),r=Nd(a,e<=n||n<=i.toExpNeg,e)),r};Fe.toSignificantDigits=Fe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(so(e,1,Vm),t===void 0?t=r.rounding:so(t,0,8)),Jt(new r(n),e,t)};Fe.toString=Fe.valueOf=Fe.val=Fe.toJSON=Fe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Qn(e),n=e.constructor;return Nd(e,t<=n.toExpNeg||t>=n.toExpPos)};function tQ(e,t){var n,r,a,i,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),jn?Jt(t,f):t;if(c=e.d,u=t.d,o=e.e,a=t.e,c=c.slice(),i=o-a,i){for(i<0?(r=c,i=-i,l=u.length):(r=u,a=o,l=c.length),o=Math.ceil(f/mn),l=o>l?o+1:l+1,i>l&&(i=l,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,r=u,u=c,c=r),n=0;i;)n=(c[--i]=c[i]+u[i]+n)/gr|0,c[i]%=gr;for(n&&(c.unshift(n),++a),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=a,jn?Jt(t,f):t}function so(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Yu+e)}function Hi(e){var t,n,r,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,t=1;t<a;t++)r=e[t]+"",n=mn-r.length,n&&(i+=Xl(n)),i+=r;o=e[t],r=o+"",n=mn-r.length,n&&(i+=Xl(n))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var qo=function(){function e(r,a){var i,o=0,l=r.length;for(r=r.slice();l--;)i=r[l]*a+o,r[l]=i%gr|0,o=i/gr|0;return o&&r.unshift(o),r}function t(r,a,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(r[l]!=a[l]){c=r[l]>a[l]?1:-1;break}return c}function n(r,a,i){for(var o=0;i--;)r[i]-=o,o=r[i]<a[i]?1:0,r[i]=o*gr+r[i]-a[i];for(;!r[0]&&r.length>1;)r.shift()}return function(r,a,i,o){var l,c,u,d,f,h,m,p,g,y,v,w,b,j,N,S,C,_,E=r.constructor,T=r.s==a.s?1:-1,P=r.d,k=a.d;if(!r.s)return new E(r);if(!a.s)throw Error(Ts+"Division by zero");for(c=r.e-a.e,C=k.length,N=P.length,m=new E(T),p=m.d=[],u=0;k[u]==(P[u]||0);)++u;if(k[u]>(P[u]||0)&&--c,i==null?w=i=E.precision:o?w=i+(Qn(r)-Qn(a))+1:w=i,w<0)return new E(0);if(w=w/mn+2|0,u=0,C==1)for(d=0,k=k[0],w++;(u<N||d)&&w--;u++)b=d*gr+(P[u]||0),p[u]=b/k|0,d=b%k|0;else{for(d=gr/(k[0]+1)|0,d>1&&(k=e(k,d),P=e(P,d),C=k.length,N=P.length),j=C,g=P.slice(0,C),y=g.length;y<C;)g[y++]=0;_=k.slice(),_.unshift(0),S=k[0],k[1]>=gr/2&&++S;do d=0,l=t(k,g,C,y),l<0?(v=g[0],C!=y&&(v=v*gr+(g[1]||0)),d=v/S|0,d>1?(d>=gr&&(d=gr-1),f=e(k,d),h=f.length,y=g.length,l=t(f,g,h,y),l==1&&(d--,n(f,C<h?_:k,h))):(d==0&&(l=d=1),f=k.slice()),h=f.length,h<y&&f.unshift(0),n(g,f,y),l==-1&&(y=g.length,l=t(k,g,C,y),l<1&&(d++,n(g,C<y?_:k,y))),y=g.length):l===0&&(d++,g=[0]),p[u++]=d,l&&g[0]?g[y++]=P[j]||0:(g=[P[j]],y=1);while((j++<N||g[0]!==void 0)&&w--)}return p[0]||p.shift(),m.e=c,Jt(m,o?i+Qn(m)+1:i)}}();function nQ(e,t){var n,r,a,i,o,l,c=0,u=0,d=e.constructor,f=d.precision;if(Qn(e)>16)throw Error(rM+Qn(e));if(!e.s)return new d(ns);for(t==null?(jn=!1,l=f):l=t,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(xu(2,u))/Math.LN10*2+5|0,l+=r,n=a=i=new d(ns),d.precision=l;;){if(a=Jt(a.times(e),l),n=n.times(++c),o=i.plus(qo(a,n,l)),Hi(o.d).slice(0,l)===Hi(i.d).slice(0,l)){for(;u--;)i=Jt(i.times(i),l);return d.precision=f,t==null?(jn=!0,Jt(i,f)):i}i=o}}function Qn(e){for(var t=e.e*mn,n=e.d[0];n>=10;n/=10)t++;return t}function SC(e,t,n){if(t>e.LN10.sd())throw jn=!0,n&&(e.precision=n),Error(Ts+"LN10 precision limit exceeded");return Jt(new e(e.LN10),t)}function Xl(e){for(var t="";e--;)t+="0";return t}function gy(e,t){var n,r,a,i,o,l,c,u,d,f=1,h=10,m=e,p=m.d,g=m.constructor,y=g.precision;if(m.s<1)throw Error(Ts+(m.s?"NaN":"-Infinity"));if(m.eq(ns))return new g(0);if(t==null?(jn=!1,u=y):u=t,m.eq(10))return t==null&&(jn=!0),SC(g,u);if(u+=h,g.precision=u,n=Hi(p),r=n.charAt(0),i=Qn(m),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)m=m.times(e),n=Hi(m.d),r=n.charAt(0),f++;i=Qn(m),r>1?(m=new g("0."+n),i++):m=new g(r+"."+n.slice(1))}else return c=SC(g,u+2,y).times(i+""),m=gy(new g(r+"."+n.slice(1)),u-h).plus(c),g.precision=y,t==null?(jn=!0,Jt(m,y)):m;for(l=o=m=qo(m.minus(ns),m.plus(ns),u),d=Jt(m.times(m),u),a=3;;){if(o=Jt(o.times(d),u),c=l.plus(qo(o,new g(a),u)),Hi(c.d).slice(0,u)===Hi(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(SC(g,u+2,y).times(i+""))),l=qo(l,new g(f),u),g.precision=y,t==null?(jn=!0,Jt(l,y)):l;l=c,a+=2}}function s3(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=Wm(n/mn),e.d=[],r=(n+1)%mn,n<0&&(r+=mn),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=mn;r<a;)e.d.push(+t.slice(r,r+=mn));t=t.slice(r),r=mn-t.length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),jn&&(e.e>pw||e.e<-pw))throw Error(rM+n)}else e.s=0,e.e=0,e.d=[0];return e}function Jt(e,t,n){var r,a,i,o,l,c,u,d,f=e.d;for(o=1,i=f[0];i>=10;i/=10)o++;if(r=t-o,r<0)r+=mn,a=t,u=f[d=0];else{if(d=Math.ceil((r+1)/mn),i=f.length,d>=i)return e;for(u=i=f[d],o=1;i>=10;i/=10)o++;r%=mn,a=r-mn+o}if(n!==void 0&&(i=xu(10,o-a-1),l=u/i%10|0,c=t<0||f[d+1]!==void 0||u%i,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?a>0?u/xu(10,o-a):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(i=Qn(e),f.length=1,t=t-i-1,f[0]=xu(10,(mn-t%mn)%mn),e.e=Wm(-t/mn)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,i=1,d--):(f.length=d+1,i=xu(10,mn-r),f[d]=a>0?(u/xu(10,o-a)%xu(10,a)|0)*i:0),c)for(;;)if(d==0){(f[0]+=i)==gr&&(f[0]=1,++e.e);break}else{if(f[d]+=i,f[d]!=gr)break;f[d--]=0,i=1}for(r=f.length;f[--r]===0;)f.pop();if(jn&&(e.e>pw||e.e<-pw))throw Error(rM+Qn(e));return e}function rQ(e,t){var n,r,a,i,o,l,c,u,d,f,h=e.constructor,m=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),jn?Jt(t,m):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),a=Math.max(Math.ceil(m/mn),l)+2,o>a&&(o=a,n.length=1),n.reverse(),a=o;a--;)n.push(0);n.reverse()}else{for(a=c.length,l=f.length,d=a<l,d&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}o=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>o;){if(c[--a]<f[a]){for(i=a;i&&c[--i]===0;)c[i]=gr-1;--c[i],c[a]+=gr}c[a]-=f[a]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(t.d=c,t.e=r,jn?Jt(t,m):t):new h(0)}function Nd(e,t,n){var r,a=Qn(e),i=Hi(e.d),o=i.length;return t?(n&&(r=n-o)>0?i=i.charAt(0)+"."+i.slice(1)+Xl(r):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Xl(-a-1)+i,n&&(r=n-o)>0&&(i+=Xl(r))):a>=o?(i+=Xl(a+1-o),n&&(r=n-a-1)>0&&(i=i+"."+Xl(r))):((r=a+1)<o&&(i=i.slice(0,r)+"."+i.slice(r)),n&&(r=n-o)>0&&(a+1===o&&(i+="."),i+=Xl(r))),e.s<0?"-"+i:i}function i3(e,t){if(e.length>t)return e.length=t,!0}function aQ(e){var t,n,r;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Yu+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return s3(o,i.toString())}else if(typeof i!="string")throw Error(Yu+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,fze.test(i))s3(o,i);else throw Error(Yu+i)}if(a.prototype=Fe,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=aQ,a.config=a.set=hze,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return a.config(e),a}function hze(e){if(!e||typeof e!="object")throw Error(Ts+"Object expected");var t,n,r,a=["precision",1,Vm,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if((r=e[n=a[t]])!==void 0)if(Wm(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Yu+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Yu+n+": "+r);return this}var aM=aQ(dze);ns=new aM(1);const Yt=aM;function mze(e){return vze(e)||yze(e)||gze(e)||pze()}function pze(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
863In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gze(e,t){if(e){if(typeof e=="string")return VE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return VE(e,t)}}function yze(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function vze(e){if(Array.isArray(e))return VE(e)}function VE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var xze=function(t){return t},sQ={"@@functional/placeholder":!0},iQ=function(t){return t===sQ},o3=function(t){return function n(){return arguments.length===0||arguments.length===1&&iQ(arguments.length<=0?void 0:arguments[0])?n:t.apply(void 0,arguments)}},bze=function e(t,n){return t===1?n:o3(function(){for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==sQ}).length;return o>=t?n.apply(void 0,a):e(t-o,o3(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=a.map(function(f){return iQ(f)?c.shift():f});return n.apply(void 0,mze(d).concat(c))}))})},NN=function(t){return bze(t.length,t)},WE=function(t,n){for(var r=[],a=t;a<n;++a)r[a-t]=a;return r},wze=NN(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(n){return t[n]}).map(e)}),jze=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(!n.length)return xze;var a=n.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},qE=function(t){return Array.isArray(t)?t.reverse():t.split("").reverse.join("")},oQ=function(t){var n=null,r=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return n&&i.every(function(l,c){return l===n[c]})||(n=i,r=t.apply(void 0,i)),r}};function Nze(e){var t;return e===0?t=1:t=Math.floor(new Yt(e).abs().log(10).toNumber())+1,t}function Sze(e,t,n){for(var r=new Yt(e),a=0,i=[];r.lt(t)&&a<1e5;)i.push(r.toNumber()),r=r.add(n),a++;return i}var Cze=NN(function(e,t,n){var r=+e,a=+t;return r+n*(a-r)}),_ze=NN(function(e,t,n){var r=t-+e;return r=r||1/0,(n-e)/r}),Eze=NN(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const SN={rangeStep:Sze,getDigitCount:Nze,interpolateNumber:Cze,uninterpolateNumber:_ze,uninterpolateTruncation:Eze};function HE(e){return kze(e)||Pze(e)||lQ(e)||Aze()}function Aze(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
864In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pze(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function kze(e){if(Array.isArray(e))return KE(e)}function yy(e,t){return Mze(e)||Tze(e,t)||lQ(e,t)||Oze()}function Oze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
865In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lQ(e,t){if(e){if(typeof e=="string")return KE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return KE(e,t)}}function KE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Tze(e,t){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,i=void 0;try{for(var o=e[Symbol.iterator](),l;!(r=(l=o.next()).done)&&(n.push(l.value),!(t&&n.length===t));r=!0);}catch(c){a=!0,i=c}finally{try{!r&&o.return!=null&&o.return()}finally{if(a)throw i}}return n}}function Mze(e){if(Array.isArray(e))return e}function cQ(e){var t=yy(e,2),n=t[0],r=t[1],a=n,i=r;return n>r&&(a=r,i=n),[a,i]}function uQ(e,t,n){if(e.lte(0))return new Yt(0);var r=SN.getDigitCount(e.toNumber()),a=new Yt(10).pow(r),i=e.div(a),o=r!==1?.05:.1,l=new Yt(Math.ceil(i.div(o).toNumber())).add(n).mul(o),c=l.mul(a);return t?c:new Yt(Math.ceil(c))}function Rze(e,t,n){var r=1,a=new Yt(e);if(!a.isint()&&n){var i=Math.abs(e);i<1?(r=new Yt(10).pow(SN.getDigitCount(e)-1),a=new Yt(Math.floor(a.div(r).toNumber())).mul(r)):i>1&&(a=new Yt(Math.floor(e)))}else e===0?a=new Yt(Math.floor((t-1)/2)):n||(a=new Yt(Math.floor(e)));var o=Math.floor((t-1)/2),l=jze(wze(function(c){return a.add(new Yt(c-o).mul(r)).toNumber()}),WE);return l(0,t)}function dQ(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new Yt(0),tickMin:new Yt(0),tickMax:new Yt(0)};var i=uQ(new Yt(t).sub(e).div(n-1),r,a),o;e<=0&&t>=0?o=new Yt(0):(o=new Yt(e).add(t).div(2),o=o.sub(new Yt(o).mod(i)));var l=Math.ceil(o.sub(e).div(i).toNumber()),c=Math.ceil(new Yt(t).sub(o).div(i).toNumber()),u=l+c+1;return u>n?dQ(e,t,n,r,a+1):(u<n&&(c=t>0?c+(n-u):c,l=t>0?l:l+(n-u)),{step:i,tickMin:o.sub(new Yt(l).mul(i)),tickMax:o.add(new Yt(c).mul(i))})}function Dze(e){var t=yy(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=cQ([n,r]),c=yy(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var f=d===1/0?[u].concat(HE(WE(0,a-1).map(function(){return 1/0}))):[].concat(HE(WE(0,a-1).map(function(){return-1/0})),[d]);return n>r?qE(f):f}if(u===d)return Rze(u,a,i);var h=dQ(u,d,o,i),m=h.step,p=h.tickMin,g=h.tickMax,y=SN.rangeStep(p,g.add(new Yt(.1).mul(m)),m);return n>r?qE(y):y}function $ze(e,t){var n=yy(e,2),r=n[0],a=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=cQ([r,a]),l=yy(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[r,a];if(c===u)return[c];var d=Math.max(t,2),f=uQ(new Yt(u).sub(c).div(d-1),i,0),h=[].concat(HE(SN.rangeStep(new Yt(c),new Yt(u).sub(new Yt(.99).mul(f)),f)),[u]);return r>a?qE(h):h}var Ize=oQ(Dze),Lze=oQ($ze),Fze="Invariant failed";function Sd(e,t){throw new Error(Fze)}var Bze=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Fh(e){"@babel/helpers - typeof";return Fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fh(e)}function gw(){return gw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gw.apply(this,arguments)}function zze(e,t){return qze(e)||Wze(e,t)||Vze(e,t)||Uze()}function Uze(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
866In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vze(e,t){if(e){if(typeof e=="string")return l3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l3(e,t)}}function l3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wze(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function qze(e){if(Array.isArray(e))return e}function Hze(e,t){if(e==null)return{};var n=Kze(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Kze(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Gze(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yze(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mQ(r.key),r)}}function Xze(e,t,n){return t&&Yze(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Qze(e,t,n){return t=yw(t),Jze(e,fQ()?Reflect.construct(t,n||[],yw(e).constructor):t.apply(e,n))}function Jze(e,t){if(t&&(Fh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zze(e)}function Zze(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(fQ=function(){return!!e})()}function yw(e){return yw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},yw(e)}function eUe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&GE(e,t)}function GE(e,t){return GE=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},GE(e,t)}function hQ(e,t,n){return t=mQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mQ(e){var t=tUe(e,"string");return Fh(t)=="symbol"?t:t+""}function tUe(e,t){if(Fh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qm=function(e){function t(){return Gze(this,t),Qze(this,t,arguments)}return eUe(t,e),Xze(t,[{key:"render",value:function(){var r=this.props,a=r.offset,i=r.layout,o=r.width,l=r.dataKey,c=r.data,u=r.dataPointFormatter,d=r.xAxis,f=r.yAxis,h=Hze(r,Bze),m=Me(h,!1);this.props.direction==="x"&&d.type!=="number"&&Sd();var p=c.map(function(g){var y=u(g,l),v=y.x,w=y.y,b=y.value,j=y.errorVal;if(!j)return null;var N=[],S,C;if(Array.isArray(j)){var _=zze(j,2);S=_[0],C=_[1]}else S=C=j;if(i==="vertical"){var E=d.scale,T=w+a,P=T+o,k=T-o,D=E(b-S),A=E(b+C);N.push({x1:A,y1:P,x2:A,y2:k}),N.push({x1:D,y1:T,x2:A,y2:T}),N.push({x1:D,y1:P,x2:D,y2:k})}else if(i==="horizontal"){var I=f.scale,M=v+a,$=M-o,R=M+o,O=I(b-S),F=I(b+C);N.push({x1:$,y1:F,x2:R,y2:F}),N.push({x1:M,y1:O,x2:M,y2:F}),N.push({x1:$,y1:O,x2:R,y2:O})}return L.createElement(He,gw({className:"recharts-errorBar",key:"bar-".concat(N.map(function(z){return"".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))},m),N.map(function(z){return L.createElement("line",gw({},z,{key:"line-".concat(z.x1,"-").concat(z.x2,"-").concat(z.y1,"-").concat(z.y2)}))}))});return L.createElement(He,{className:"recharts-errorBars"},p)}}])}(L.Component);hQ(qm,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});hQ(qm,"displayName","ErrorBar");function vy(e){"@babel/helpers - typeof";return vy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vy(e)}function c3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function cu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?c3(Object(n),!0).forEach(function(r){nUe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function nUe(e,t,n){return t=rUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rUe(e){var t=aUe(e,"string");return vy(t)=="symbol"?t:t+""}function aUe(e,t){if(vy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(vy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var pQ=function(t){var n=t.children,r=t.formattedGraphicalItems,a=t.legendWidth,i=t.legendContent,o=Vr(n,vn);if(!o)return null;var l=vn.defaultProps,c=l!==void 0?cu(cu({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(r||[]).reduce(function(d,f){var h=f.item,m=f.props,p=m.sectors||m.data||[];return d.concat(p.map(function(g){return{type:o.props.iconType||h.props.legendType,value:g.name,color:g.fill,payload:g}}))},[]):u=(r||[]).map(function(d){var f=d.item,h=f.type.defaultProps,m=h!==void 0?cu(cu({},h),f.props):{},p=m.dataKey,g=m.name,y=m.legendType,v=m.hide;return{inactive:v,dataKey:p,type:c.iconType||y||"square",color:sM(f),value:g||p,payload:m}}),cu(cu(cu({},c),vn.getWithHeight(o,a)),{},{payload:u,item:o})};function xy(e){"@babel/helpers - typeof";return xy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xy(e)}function u3(e){return lUe(e)||oUe(e)||iUe(e)||sUe()}function sUe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
867In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iUe(e,t){if(e){if(typeof e=="string")return YE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return YE(e,t)}}function oUe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lUe(e){if(Array.isArray(e))return YE(e)}function YE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?d3(Object(n),!0).forEach(function(r){Hf(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hf(e,t,n){return t=cUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cUe(e){var t=uUe(e,"string");return xy(t)=="symbol"?t:t+""}function uUe(e,t){if(xy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(xy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ot(e,t,n){return Ke(e)||Ke(t)?n:dr(t)?Ua(e,t,n):ze(t)?t(e):n}function lg(e,t,n,r){var a=oze(e,function(l){return Ot(l,t)});if(n==="number"){var i=a.filter(function(l){return Ee(l)||parseFloat(l)});return i.length?[jN(i),pc(i)]:[1/0,-1/0]}var o=r?a.filter(function(l){return!Ke(l)}):a;return o.map(function(l){return dr(l)||l instanceof Date?l:""})}var dUe=function(t){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var d=u>0?a[u-1].coordinate:a[l-1].coordinate,f=a[u].coordinate,h=u>=l-1?a[0].coordinate:a[u+1].coordinate,m=void 0;if(Nr(f-d)!==Nr(h-f)){var p=[];if(Nr(h-f)===Nr(c[1]-c[0])){m=h;var g=f+c[1]-c[0];p[0]=Math.min(g,(g+d)/2),p[1]=Math.max(g,(g+d)/2)}else{m=d;var y=h+c[1]-c[0];p[0]=Math.min(f,(y+f)/2),p[1]=Math.max(f,(y+f)/2)}var v=[Math.min(f,(m+f)/2),Math.max(f,(m+f)/2)];if(t>v[0]&&t<=v[1]||t>=p[0]&&t<=p[1]){o=a[u].index;break}}else{var w=Math.min(d,h),b=Math.max(d,h);if(t>(w+f)/2&&t<=(b+f)/2){o=a[u].index;break}}}else for(var j=0;j<l;j++)if(j===0&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j>0&&j<l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2&&t<=(r[j].coordinate+r[j+1].coordinate)/2||j===l-1&&t>(r[j].coordinate+r[j-1].coordinate)/2){o=r[j].index;break}return o},sM=function(t){var n,r=t,a=r.type.displayName,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?$n($n({},t.type.defaultProps),t.props):t.props,o=i.stroke,l=i.fill,c;switch(a){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},fUe=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var d=i[l[c]].stackGroups,f=Object.keys(d),h=0,m=f.length;h<m;h++){var p=d[f[h]],g=p.items,y=p.cateAxisId,v=g.filter(function(C){return Wo(C.type).indexOf("Bar")>=0});if(v&&v.length){var w=v[0].type.defaultProps,b=w!==void 0?$n($n({},w),v[0].props):v[0].props,j=b.barSize,N=b[y];o[N]||(o[N]=[]);var S=Ke(j)?n:j;o[N].push({item:v[0],stackList:v.slice(1),barSize:Ke(S)?void 0:oa(S,r,0)})}}return o},hUe=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,i=t.sizeList,o=i===void 0?[]:i,l=t.maxBarSize,c=o.length;if(c<1)return null;var u=oa(n,a,0,!0),d,f=[];if(o[0].barSize===+o[0].barSize){var h=!1,m=a/c,p=o.reduce(function(j,N){return j+N.barSize||0},0);p+=(c-1)*u,p>=a&&(p-=(c-1)*u,u=0),p>=a&&m>0&&(h=!0,m*=.9,p=c*m);var g=(a-p)/2>>0,y={offset:g-u,size:0};d=o.reduce(function(j,N){var S={item:N.item,position:{offset:y.offset+y.size+u,size:h?m:N.barSize}},C=[].concat(u3(j),[S]);return y=C[C.length-1].position,N.stackList&&N.stackList.length&&N.stackList.forEach(function(_){C.push({item:_,position:y})}),C},f)}else{var v=oa(r,a,0,!0);a-2*v-(c-1)*u<=0&&(u=0);var w=(a-2*v-(c-1)*u)/c;w>1&&(w>>=0);var b=l===+l?Math.min(w,l):w;d=o.reduce(function(j,N,S){var C=[].concat(u3(j),[{item:N.item,position:{offset:v+(w+u)*S+(w-b)/2,size:b}}]);return N.stackList&&N.stackList.length&&N.stackList.forEach(function(_){C.push({item:_,position:C[C.length-1].position})}),C},f)}return d},mUe=function(t,n,r,a){var i=r.children,o=r.width,l=r.margin,c=o-(l.left||0)-(l.right||0),u=pQ({children:i,legendWidth:c});if(u){var d=a||{},f=d.width,h=d.height,m=u.align,p=u.verticalAlign,g=u.layout;if((g==="vertical"||g==="horizontal"&&p==="middle")&&m!=="center"&&Ee(t[m]))return $n($n({},t),{},Hf({},m,t[m]+(f||0)));if((g==="horizontal"||g==="vertical"&&m==="center")&&p!=="middle"&&Ee(t[p]))return $n($n({},t),{},Hf({},p,t[p]+(h||0)))}return t},pUe=function(t,n,r){return Ke(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},gQ=function(t,n,r,a,i){var o=n.props.children,l=Or(o,qm).filter(function(u){return pUe(a,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return t.reduce(function(u,d){var f=Ot(d,r);if(Ke(f))return u;var h=Array.isArray(f)?[jN(f),pc(f)]:[f,f],m=c.reduce(function(p,g){var y=Ot(d,g,0),v=h[0]-Math.abs(Array.isArray(y)?y[0]:y),w=h[1]+Math.abs(Array.isArray(y)?y[1]:y);return[Math.min(v,p[0]),Math.max(w,p[1])]},[1/0,-1/0]);return[Math.min(m[0],u[0]),Math.max(m[1],u[1])]},[1/0,-1/0])}return null},gUe=function(t,n,r,a,i){var o=n.map(function(l){return gQ(t,l,r,i,a)}).filter(function(l){return!Ke(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},yQ=function(t,n,r,a,i){var o=n.map(function(c){var u=c.props.dataKey;return r==="number"&&u&&gQ(t,c,u,a)||lg(t,u,r,i)});if(r==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,f=u.length;d<f;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},vQ=function(t,n){return t==="horizontal"&&n==="xAxis"||t==="vertical"&&n==="yAxis"||t==="centric"&&n==="angleAxis"||t==="radial"&&n==="radiusAxis"},xQ=function(t,n,r,a){if(a)return t.map(function(c){return c.coordinate});var i,o,l=t.map(function(c){return c.coordinate===n&&(i=!0),c.coordinate===r&&(o=!0),c.coordinate});return i||l.push(n),o||l.push(r),l},Lo=function(t,n,r){if(!t)return null;var a=t.scale,i=t.duplicateDomain,o=t.type,l=t.range,c=t.realScaleType==="scaleBand"?a.bandwidth()/2:2,u=(n||r)&&o==="category"&&a.bandwidth?a.bandwidth()/c:0;if(u=t.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Nr(l[0]-l[1])*2*u:u,n&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(f){var h=i?i.indexOf(f):f;return{coordinate:a(h)+u,value:f,offset:u}});return d.filter(function(f){return!Jc(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,h){return{coordinate:a(f)+u,value:f,index:h,offset:u}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(f){return{coordinate:a(f)+u,value:f,offset:u}}):a.domain().map(function(f,h){return{coordinate:a(f)+u,value:i?i[f]:f,index:h,offset:u}})},CC=new WeakMap,qx=function(t,n){if(typeof n!="function")return t;CC.has(t)||CC.set(t,new WeakMap);var r=CC.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},bQ=function(t,n,r){var a=t.scale,i=t.type,o=t.layout,l=t.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:my(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:dw(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:og(),realScaleType:"point"}:i==="category"?{scale:my(),realScaleType:"band"}:{scale:dw(),realScaleType:"linear"};if(Lc(a)){var c="scale".concat(iN(a));return{scale:(a3[c]||og)(),realScaleType:a3[c]?c:"point"}}return ze(a)?{scale:a}:{scale:og(),realScaleType:"point"}},f3=1e-4,wQ=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),i=Math.min(a[0],a[1])-f3,o=Math.max(a[0],a[1])+f3,l=t(n[0]),c=t(n[r-1]);(l<i||l>o||c<i||c>o)&&t.domain([n[0],n[r-1]])}},jQ=function(t,n){if(!t)return null;for(var r=0,a=t.length;r<a;r++)if(t[r].item===n)return t[r].position;return null},NQ=function(t,n){if(!n||n.length!==2||!Ee(n[0])||!Ee(n[1]))return t;var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]),i=[t[0],t[1]];return(!Ee(t[0])||t[0]<r)&&(i[0]=r),(!Ee(t[1])||t[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<r&&(i[1]=r),i},yUe=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0,l=0;l<n;++l){var c=Jc(t[l][r][1])?t[l][r][0]:t[l][r][1];c>=0?(t[l][r][0]=i,t[l][r][1]=i+c,i=t[l][r][1]):(t[l][r][0]=o,t[l][r][1]=o+c,o=t[l][r][1])}},vUe=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r<a;++r)for(var i=0,o=0;o<n;++o){var l=Jc(t[o][r][1])?t[o][r][0]:t[o][r][1];l>=0?(t[o][r][0]=i,t[o][r][1]=i+l,i=t[o][r][1]):(t[o][r][0]=0,t[o][r][1]=0)}},xUe={sign:yUe,expand:wRe,none:Oh,silhouette:jRe,wiggle:NRe,positive:vUe},bUe=function(t,n,r){var a=n.map(function(l){return l.props.dataKey}),i=xUe[r],o=bRe().keys(a).value(function(l,c){return+Ot(l,c,0)}).order(jE).offset(i);return o(t)},wUe=function(t,n,r,a,i,o){if(!t)return null;var l=o?n.reverse():n,c={},u=l.reduce(function(f,h){var m,p=(m=h.type)!==null&&m!==void 0&&m.defaultProps?$n($n({},h.type.defaultProps),h.props):h.props,g=p.stackId,y=p.hide;if(y)return f;var v=p[r],w=f[v]||{hasStack:!1,stackGroups:{}};if(dr(g)){var b=w.stackGroups[g]||{numericAxisId:r,cateAxisId:a,items:[]};b.items.push(h),w.hasStack=!0,w.stackGroups[g]=b}else w.stackGroups[Al("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[h]};return $n($n({},f),{},Hf({},v,w))},c),d={};return Object.keys(u).reduce(function(f,h){var m=u[h];if(m.hasStack){var p={};m.stackGroups=Object.keys(m.stackGroups).reduce(function(g,y){var v=m.stackGroups[y];return $n($n({},g),{},Hf({},y,{numericAxisId:r,cateAxisId:a,items:v.items,stackedData:bUe(t,v.items,i)}))},p)}return $n($n({},f),{},Hf({},h,m))},d)},SQ=function(t,n){var r=n.realScaleType,a=n.type,i=n.tickCount,o=n.originalDomain,l=n.allowDecimals,c=r||n.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=t.domain();if(!u.length)return null;var d=Ize(u,i,l);return t.domain([jN(d),pc(d)]),{niceTicks:d}}if(i&&a==="number"){var f=t.domain(),h=Lze(f,i,l);return{niceTicks:h}}return null};function Bh(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,i=e.index,o=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ke(a[t.dataKey])){var l=H0(n,"value",a[t.dataKey]);if(l)return l.coordinate+r/2}return n[i]?n[i].coordinate+r/2:null}var c=Ot(a,Ke(o)?t.dataKey:o);return Ke(c)?null:t.scale(c)}var vw=function(t){var n=t.axis,r=t.ticks,a=t.offset,i=t.bandSize,o=t.entry,l=t.index;if(n.type==="category")return r[l]?r[l].coordinate+a:null;var c=Ot(o,n.dataKey,n.domain[l]);return Ke(c)?null:n.scale(c)-i/2+a},CQ=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return a<=0&&i>=0?0:i<0?i:a}return r[0]},jUe=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?$n($n({},t.type.defaultProps),t.props):t.props,i=a.stackId;if(dr(i)){var o=n[i];if(o){var l=o.items.indexOf(t);return l>=0?o.stackedData[l]:null}}return null},NUe=function(t){return t.reduce(function(n,r){return[jN(r.concat([n[0]]).filter(Ee)),pc(r.concat([n[1]]).filter(Ee))]},[1/0,-1/0])},_Q=function(t,n,r){return Object.keys(t).reduce(function(a,i){var o=t[i],l=o.stackedData,c=l.reduce(function(u,d){var f=NUe(d.slice(n,r+1));return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]);return[Math.min(c[0],a[0]),Math.max(c[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},h3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,m3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,XE=function(t,n,r){if(ze(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(Ee(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(h3.test(t[0])){var i=+h3.exec(t[0])[1];a[0]=n[0]-i}else ze(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(Ee(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(m3.test(t[1])){var o=+m3.exec(t[1])[1];a[1]=n[1]+o}else ze(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},xw=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var i=$T(n,function(f){return f.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var u=i[l],d=i[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return r?void 0:0},p3=function(t,n,r){return!t||!t.length||xi(t,Ua(r,"type.defaultProps.domain"))?n:t},iM=function(t,n){var r=t.type.defaultProps?$n($n({},t.type.defaultProps),t.props):t.props,a=r.dataKey,i=r.name,o=r.unit,l=r.formatter,c=r.tooltipType,u=r.chartType,d=r.hide;return $n($n({},Me(t,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:sM(t),value:Ot(n,a),type:c,payload:n,chartType:u,hide:d})};function by(e){"@babel/helpers - typeof";return by=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},by(e)}function g3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Eo(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g3(Object(n),!0).forEach(function(r){EQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EQ(e,t,n){return t=SUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SUe(e){var t=CUe(e,"string");return by(t)=="symbol"?t:t+""}function CUe(e,t){if(by(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(by(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _Ue(e,t){return kUe(e)||PUe(e,t)||AUe(e,t)||EUe()}function EUe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
868In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AUe(e,t){if(e){if(typeof e=="string")return y3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return y3(e,t)}}function y3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PUe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function kUe(e){if(Array.isArray(e))return e}var bw=Math.PI/180,OUe=function(t){return t*180/Math.PI},It=function(t,n,r,a){return{x:t+Math.cos(-bw*a)*r,y:n+Math.sin(-bw*a)*r}},AQ=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},oM=function(t,n,r,a,i){var o=t.width,l=t.height,c=t.startAngle,u=t.endAngle,d=oa(t.cx,o,o/2),f=oa(t.cy,l,l/2),h=AQ(o,l,r),m=oa(t.innerRadius,h,0),p=oa(t.outerRadius,h,h*.8),g=Object.keys(n);return g.reduce(function(y,v){var w=n[v],b=w.domain,j=w.reversed,N;if(Ke(w.range))a==="angleAxis"?N=[c,u]:a==="radiusAxis"&&(N=[m,p]),j&&(N=[N[1],N[0]]);else{N=w.range;var S=N,C=_Ue(S,2);c=C[0],u=C[1]}var _=bQ(w,i),E=_.realScaleType,T=_.scale;T.domain(b).range(N),wQ(T);var P=SQ(T,Eo(Eo({},w),{},{realScaleType:E})),k=Eo(Eo(Eo({},w),P),{},{range:N,radius:p,realScaleType:E,scale:T,cx:d,cy:f,innerRadius:m,outerRadius:p,startAngle:c,endAngle:u});return Eo(Eo({},y),{},EQ({},v,k))},{})},TUe=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return Math.sqrt(Math.pow(r-i,2)+Math.pow(a-o,2))},MUe=function(t,n){var r=t.x,a=t.y,i=n.cx,o=n.cy,l=TUe({x:r,y:a},{x:i,y:o});if(l<=0)return{radius:l};var c=(r-i)/l,u=Math.acos(c);return a>o&&(u=2*Math.PI-u),{radius:l,angle:OUe(u),angleInRadian:u}},RUe=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),i=Math.floor(r/360),o=Math.min(a,i);return{startAngle:n-o*360,endAngle:r-o*360}},DUe=function(t,n){var r=n.startAngle,a=n.endAngle,i=Math.floor(r/360),o=Math.floor(a/360),l=Math.min(i,o);return t+l*360},v3=function(t,n){var r=t.x,a=t.y,i=MUe({x:r,y:a},n),o=i.radius,l=i.angle,c=n.innerRadius,u=n.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=RUe(n),f=d.startAngle,h=d.endAngle,m=l,p;if(f<=h){for(;m>h;)m-=360;for(;m<f;)m+=360;p=m>=f&&m<=h}else{for(;m>f;)m-=360;for(;m<h;)m+=360;p=m>=h&&m<=f}return p?Eo(Eo({},n),{},{radius:o,angle:DUe(m,n)}):null},PQ=function(t){return!x.isValidElement(t)&&!ze(t)&&typeof t!="boolean"?t.className:""};function wy(e){"@babel/helpers - typeof";return wy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wy(e)}var $Ue=["offset"];function IUe(e){return zUe(e)||BUe(e)||FUe(e)||LUe()}function LUe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
869In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function FUe(e,t){if(e){if(typeof e=="string")return QE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return QE(e,t)}}function BUe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zUe(e){if(Array.isArray(e))return QE(e)}function QE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function UUe(e,t){if(e==null)return{};var n=VUe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function VUe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function x3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x3(Object(n),!0).forEach(function(r){WUe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function WUe(e,t,n){return t=qUe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qUe(e){var t=HUe(e,"string");return wy(t)=="symbol"?t:t+""}function HUe(e,t){if(wy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(wy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function jy(){return jy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jy.apply(this,arguments)}var KUe=function(t){var n=t.value,r=t.formatter,a=Ke(t.children)?n:t.children;return ze(r)?r(a):a},GUe=function(t,n){var r=Nr(n-t),a=Math.min(Math.abs(n-t),360);return r*a},YUe=function(t,n,r){var a=t.position,i=t.viewBox,o=t.offset,l=t.className,c=i,u=c.cx,d=c.cy,f=c.innerRadius,h=c.outerRadius,m=c.startAngle,p=c.endAngle,g=c.clockWise,y=(f+h)/2,v=GUe(m,p),w=v>=0?1:-1,b,j;a==="insideStart"?(b=m+w*o,j=g):a==="insideEnd"?(b=p-w*o,j=!g):a==="end"&&(b=p+w*o,j=g),j=v<=0?j:!j;var N=It(u,d,y,b),S=It(u,d,y,b+(j?1:-1)*359),C="M".concat(N.x,",").concat(N.y,`
870    A`).concat(y,",").concat(y,",0,1,").concat(j?0:1,`,
871    `).concat(S.x,",").concat(S.y),_=Ke(t.id)?Al("recharts-radial-line-"):t.id;return L.createElement("text",jy({},r,{dominantBaseline:"central",className:Ge("recharts-radial-bar-label",l)}),L.createElement("defs",null,L.createElement("path",{id:_,d:C})),L.createElement("textPath",{xlinkHref:"#".concat(_)},n))},XUe=function(t){var n=t.viewBox,r=t.offset,a=t.position,i=n,o=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,f=i.endAngle,h=(d+f)/2;if(a==="outside"){var m=It(o,l,u+r,h),p=m.x,g=m.y;return{x:p,y:g,textAnchor:p>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var y=(c+u)/2,v=It(o,l,y,h),w=v.x,b=v.y;return{x:w,y:b,textAnchor:"middle",verticalAnchor:"middle"}},QUe=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,i=t.position,o=n,l=o.x,c=o.y,u=o.width,d=o.height,f=d>=0?1:-1,h=f*a,m=f>0?"end":"start",p=f>0?"start":"end",g=u>=0?1:-1,y=g*a,v=g>0?"end":"start",w=g>0?"start":"end";if(i==="top"){var b={x:l+u/2,y:c-f*a,textAnchor:"middle",verticalAnchor:m};return nr(nr({},b),r?{height:Math.max(c-r.y,0),width:u}:{})}if(i==="bottom"){var j={x:l+u/2,y:c+d+h,textAnchor:"middle",verticalAnchor:p};return nr(nr({},j),r?{height:Math.max(r.y+r.height-(c+d),0),width:u}:{})}if(i==="left"){var N={x:l-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return nr(nr({},N),r?{width:Math.max(N.x-r.x,0),height:d}:{})}if(i==="right"){var S={x:l+u+y,y:c+d/2,textAnchor:w,verticalAnchor:"middle"};return nr(nr({},S),r?{width:Math.max(r.x+r.width-S.x,0),height:d}:{})}var C=r?{width:u,height:d}:{};return i==="insideLeft"?nr({x:l+y,y:c+d/2,textAnchor:w,verticalAnchor:"middle"},C):i==="insideRight"?nr({x:l+u-y,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},C):i==="insideTop"?nr({x:l+u/2,y:c+h,textAnchor:"middle",verticalAnchor:p},C):i==="insideBottom"?nr({x:l+u/2,y:c+d-h,textAnchor:"middle",verticalAnchor:m},C):i==="insideTopLeft"?nr({x:l+y,y:c+h,textAnchor:w,verticalAnchor:p},C):i==="insideTopRight"?nr({x:l+u-y,y:c+h,textAnchor:v,verticalAnchor:p},C):i==="insideBottomLeft"?nr({x:l+y,y:c+d-h,textAnchor:w,verticalAnchor:m},C):i==="insideBottomRight"?nr({x:l+u-y,y:c+d-h,textAnchor:v,verticalAnchor:m},C):Rm(i)&&(Ee(i.x)||Au(i.x))&&(Ee(i.y)||Au(i.y))?nr({x:l+oa(i.x,u),y:c+oa(i.y,d),textAnchor:"end",verticalAnchor:"end"},C):nr({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},C)},JUe=function(t){return"cx"in t&&Ee(t.cx)};function jr(e){var t=e.offset,n=t===void 0?5:t,r=UUe(e,$Ue),a=nr({offset:n},r),i=a.viewBox,o=a.position,l=a.value,c=a.children,u=a.content,d=a.className,f=d===void 0?"":d,h=a.textBreakAll;if(!i||Ke(l)&&Ke(c)&&!x.isValidElement(u)&&!ze(u))return null;if(x.isValidElement(u))return x.cloneElement(u,a);var m;if(ze(u)){if(m=x.createElement(u,a),x.isValidElement(m))return m}else m=KUe(a);var p=JUe(i),g=Me(a,!0);if(p&&(o==="insideStart"||o==="insideEnd"||o==="end"))return YUe(a,m,g);var y=p?XUe(a):QUe(a);return L.createElement(jd,jy({className:Ge("recharts-label",f)},g,y,{breakAll:h}),m)}jr.displayName="Label";var kQ=function(t){var n=t.cx,r=t.cy,a=t.angle,i=t.startAngle,o=t.endAngle,l=t.r,c=t.radius,u=t.innerRadius,d=t.outerRadius,f=t.x,h=t.y,m=t.top,p=t.left,g=t.width,y=t.height,v=t.clockWise,w=t.labelViewBox;if(w)return w;if(Ee(g)&&Ee(y)){if(Ee(f)&&Ee(h))return{x:f,y:h,width:g,height:y};if(Ee(m)&&Ee(p))return{x:m,y:p,width:g,height:y}}return Ee(f)&&Ee(h)?{x:f,y:h,width:0,height:0}:Ee(n)&&Ee(r)?{cx:n,cy:r,startAngle:i||a||0,endAngle:o||a||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:t.viewBox?t.viewBox:{}},ZUe=function(t,n){return t?t===!0?L.createElement(jr,{key:"label-implicit",viewBox:n}):dr(t)?L.createElement(jr,{key:"label-implicit",viewBox:n,value:t}):x.isValidElement(t)?t.type===jr?x.cloneElement(t,{key:"label-implicit",viewBox:n}):L.createElement(jr,{key:"label-implicit",content:t,viewBox:n}):ze(t)?L.createElement(jr,{key:"label-implicit",content:t,viewBox:n}):Rm(t)?L.createElement(jr,jy({viewBox:n},t,{key:"label-implicit"})):null:null},eVe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,i=kQ(t),o=Or(a,jr).map(function(c,u){return x.cloneElement(c,{viewBox:n||i,key:"label-".concat(u)})});if(!r)return o;var l=ZUe(t.label,n||i);return[l].concat(IUe(o))};jr.parseViewBox=kQ;jr.renderCallByParent=eVe;function tVe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var OQ=tVe;const TQ=$t(OQ);function Ny(e){"@babel/helpers - typeof";return Ny=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ny(e)}var nVe=["valueAccessor"],rVe=["data","dataKey","clockWise","id","textBreakAll"];function aVe(e){return lVe(e)||oVe(e)||iVe(e)||sVe()}function sVe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
872In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iVe(e,t){if(e){if(typeof e=="string")return JE(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JE(e,t)}}function oVe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lVe(e){if(Array.isArray(e))return JE(e)}function JE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ww(){return ww=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ww.apply(this,arguments)}function b3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function w3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b3(Object(n),!0).forEach(function(r){cVe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function cVe(e,t,n){return t=uVe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uVe(e){var t=dVe(e,"string");return Ny(t)=="symbol"?t:t+""}function dVe(e,t){if(Ny(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ny(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function j3(e,t){if(e==null)return{};var n=fVe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fVe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var hVe=function(t){return Array.isArray(t.value)?TQ(t.value):t.value};function ma(e){var t=e.valueAccessor,n=t===void 0?hVe:t,r=j3(e,nVe),a=r.data,i=r.dataKey,o=r.clockWise,l=r.id,c=r.textBreakAll,u=j3(r,rVe);return!a||!a.length?null:L.createElement(He,{className:"recharts-label-list"},a.map(function(d,f){var h=Ke(i)?n(d,f):Ot(d&&d.payload,i),m=Ke(l)?{}:{id:"".concat(l,"-").concat(f)};return L.createElement(jr,ww({},Me(d,!0),u,m,{parentViewBox:d.parentViewBox,value:h,textBreakAll:c,viewBox:jr.parseViewBox(Ke(o)?d:w3(w3({},d),{},{clockWise:o})),key:"label-".concat(f),index:f}))}))}ma.displayName="LabelList";function mVe(e,t){return e?e===!0?L.createElement(ma,{key:"labelList-implicit",data:t}):L.isValidElement(e)||ze(e)?L.createElement(ma,{key:"labelList-implicit",data:t,content:e}):Rm(e)?L.createElement(ma,ww({data:t},e,{key:"labelList-implicit"})):null:null}function pVe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Or(r,ma).map(function(o,l){return x.cloneElement(o,{data:t,key:"labelList-".concat(l)})});if(!n)return a;var i=mVe(e.label,t);return[i].concat(aVe(a))}ma.renderCallByParent=pVe;function Sy(e){"@babel/helpers - typeof";return Sy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sy(e)}function ZE(){return ZE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ZE.apply(this,arguments)}function N3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function S3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N3(Object(n),!0).forEach(function(r){gVe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gVe(e,t,n){return t=yVe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yVe(e){var t=vVe(e,"string");return Sy(t)=="symbol"?t:t+""}function vVe(e,t){if(Sy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Sy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var xVe=function(t,n){var r=Nr(n-t),a=Math.min(Math.abs(n-t),359.999);return r*a},Hx=function(t){var n=t.cx,r=t.cy,a=t.radius,i=t.angle,o=t.sign,l=t.isExternal,c=t.cornerRadius,u=t.cornerIsExternal,d=c*(l?1:-1)+a,f=Math.asin(c/d)/bw,h=u?i:i+o*f,m=It(n,r,d,h),p=It(n,r,a,h),g=u?i-o*f:i,y=It(n,r,d*Math.cos(f*bw),g);return{center:m,circleTangency:p,lineTangency:y,theta:f}},MQ=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.startAngle,l=t.endAngle,c=xVe(o,l),u=o+c,d=It(n,r,i,o),f=It(n,r,i,u),h="M ".concat(d.x,",").concat(d.y,`
873    A `).concat(i,",").concat(i,`,0,
874    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
875    `).concat(f.x,",").concat(f.y,`
876  `);if(a>0){var m=It(n,r,a,o),p=It(n,r,a,u);h+="L ".concat(p.x,",").concat(p.y,`
877            A `).concat(a,",").concat(a,`,0,
878            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
879            `).concat(m.x,",").concat(m.y," Z")}else h+="L ".concat(n,",").concat(r," Z");return h},bVe=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.cornerRadius,l=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=Nr(d-u),h=Hx({cx:n,cy:r,radius:i,angle:u,sign:f,cornerRadius:o,cornerIsExternal:c}),m=h.circleTangency,p=h.lineTangency,g=h.theta,y=Hx({cx:n,cy:r,radius:i,angle:d,sign:-f,cornerRadius:o,cornerIsExternal:c}),v=y.circleTangency,w=y.lineTangency,b=y.theta,j=c?Math.abs(u-d):Math.abs(u-d)-g-b;if(j<0)return l?"M ".concat(p.x,",").concat(p.y,`
880        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
881        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
882      `):MQ({cx:n,cy:r,innerRadius:a,outerRadius:i,startAngle:u,endAngle:d});var N="M ".concat(p.x,",").concat(p.y,`
883    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(m.x,",").concat(m.y,`
884    A`).concat(i,",").concat(i,",0,").concat(+(j>180),",").concat(+(f<0),",").concat(v.x,",").concat(v.y,`
885    A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(w.x,",").concat(w.y,`
886  `);if(a>0){var S=Hx({cx:n,cy:r,radius:a,angle:u,sign:f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),C=S.circleTangency,_=S.lineTangency,E=S.theta,T=Hx({cx:n,cy:r,radius:a,angle:d,sign:-f,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),P=T.circleTangency,k=T.lineTangency,D=T.theta,A=c?Math.abs(u-d):Math.abs(u-d)-E-D;if(A<0&&o===0)return"".concat(N,"L").concat(n,",").concat(r,"Z");N+="L".concat(k.x,",").concat(k.y,`
887      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,`
888      A`).concat(a,",").concat(a,",0,").concat(+(A>180),",").concat(+(f>0),",").concat(C.x,",").concat(C.y,`
889      A`).concat(o,",").concat(o,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,"Z")}else N+="L".concat(n,",").concat(r,"Z");return N},wVe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},RQ=function(t){var n=S3(S3({},wVe),t),r=n.cx,a=n.cy,i=n.innerRadius,o=n.outerRadius,l=n.cornerRadius,c=n.forceCornerRadius,u=n.cornerIsExternal,d=n.startAngle,f=n.endAngle,h=n.className;if(o<i||d===f)return null;var m=Ge("recharts-sector",h),p=o-i,g=oa(l,p,0,!0),y;return g>0&&Math.abs(d-f)<360?y=bVe({cx:r,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(g,p/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:f}):y=MQ({cx:r,cy:a,innerRadius:i,outerRadius:o,startAngle:d,endAngle:f}),L.createElement("path",ZE({},Me(n,!0),{className:m,d:y,role:"img"}))};function Cy(e){"@babel/helpers - typeof";return Cy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cy(e)}function eA(){return eA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}
889,eA.apply(this,arguments)}function C3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function _3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C3(Object(n),!0).forEach(function(r){jVe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function jVe(e,t,n){return t=NVe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function NVe(e){var t=SVe(e,"string");return Cy(t)=="symbol"?t:t+""}function SVe(e,t){if(Cy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Cy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var E3={curveBasisClosed:cRe,curveBasisOpen:uRe,curveBasis:lRe,curveBumpX:GMe,curveBumpY:YMe,curveLinearClosed:dRe,curveLinear:lN,curveMonotoneX:fRe,curveMonotoneY:hRe,curveNatural:mRe,curveStep:pRe,curveStepAfter:yRe,curveStepBefore:gRe},Kx=function(t){return t.x===+t.x&&t.y===+t.y},xp=function(t){return t.x},bp=function(t){return t.y},CVe=function(t,n){if(ze(t))return t;var r="curve".concat(iN(t));return(r==="curveMonotone"||r==="curveBump")&&n?E3["".concat(r).concat(n==="vertical"?"Y":"X")]:E3[r]||lN},_Ve=function(t){var n=t.type,r=n===void 0?"linear":n,a=t.points,i=a===void 0?[]:a,o=t.baseLine,l=t.layout,c=t.connectNulls,u=c===void 0?!1:c,d=CVe(r,l),f=u?i.filter(function(g){return Kx(g)}):i,h;if(Array.isArray(o)){var m=u?o.filter(function(g){return Kx(g)}):o,p=f.map(function(g,y){return _3(_3({},g),{},{base:m[y]})});return l==="vertical"?h=Fx().y(bp).x1(xp).x0(function(g){return g.base.x}):h=Fx().x(xp).y1(bp).y0(function(g){return g.base.y}),h.defined(Kx).curve(d),h(p)}return l==="vertical"&&Ee(o)?h=Fx().y(bp).x1(xp).x0(o):Ee(o)?h=Fx().x(xp).y1(bp).y0(o):h=CY().x(xp).y(bp),h.defined(Kx).curve(d),h(f)},kc=function(t){var n=t.className,r=t.points,a=t.path,i=t.pathRef;if((!r||!r.length)&&!a)return null;var o=r&&r.length?_Ve(t):a;return x.createElement("path",eA({},Me(t,!1),K0(t),{className:Ge("recharts-curve",n),d:o,ref:i}))},DQ={exports:{}},EVe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",AVe=EVe,PVe=AVe;function $Q(){}function IQ(){}IQ.resetWarningCache=$Q;var kVe=function(){function e(r,a,i,o,l,c){if(c!==PVe){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:IQ,resetWarningCache:$Q};return n.PropTypes=n,n};DQ.exports=kVe();var OVe=DQ.exports;const Ut=$t(OVe);var TVe=Object.getOwnPropertyNames,MVe=Object.getOwnPropertySymbols,RVe=Object.prototype.hasOwnProperty;function A3(e,t){return function(r,a,i){return e(r,a,i)&&t(r,a,i)}}function Gx(e){return function(n,r,a){if(!n||!r||typeof n!="object"||typeof r!="object")return e(n,r,a);var i=a.cache,o=i.get(n),l=i.get(r);if(o&&l)return o===r&&l===n;i.set(n,r),i.set(r,n);var c=e(n,r,a);return i.delete(n),i.delete(r),c}}function P3(e){return TVe(e).concat(MVe(e))}var DVe=Object.hasOwn||function(e,t){return RVe.call(e,t)};function Id(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var $Ve="__v",IVe="__o",LVe="_owner",k3=Object.getOwnPropertyDescriptor,O3=Object.keys;function FVe(e,t,n){var r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function BVe(e,t){return Id(e.getTime(),t.getTime())}function zVe(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function UVe(e,t){return e===t}function T3(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.entries(),o,l,c=0;(o=i.next())&&!o.done;){for(var u=t.entries(),d=!1,f=0;(l=u.next())&&!l.done;){if(a[f]){f++;continue}var h=o.value,m=l.value;if(n.equals(h[0],m[0],c,f,e,t,n)&&n.equals(h[1],m[1],h[0],m[0],e,t,n)){d=a[f]=!0;break}f++}if(!d)return!1;c++}return!0}var VVe=Id;function WVe(e,t,n){var r=O3(e),a=r.length;if(O3(t).length!==a)return!1;for(;a-- >0;)if(!LQ(e,t,n,r[a]))return!1;return!0}
889function wp(e,t,n){var r=P3(e),a=r.length;if(P3(t).length!==a)return!1;for(var i,o,l;a-- >0;)if(i=r[a],!LQ(e,t,n,i)||(o=k3(e,i),l=k3(t,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function qVe(e,t){return Id(e.valueOf(),t.valueOf())}function HVe(e,t){return e.source===t.source&&e.flags===t.flags}function M3(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),i=e.values(),o,l;(o=i.next())&&!o.done;){for(var c=t.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!a[d]&&n.equals(o.value,l.value,o.value,l.value,e,t,n)){u=a[d]=!0;break}d++}if(!u)return!1}return!0}function KVe(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function GVe(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function LQ(e,t,n,r){return(r===LVe||r===IVe||r===$Ve)&&(e.$$typeof||t.$$typeof)?!0:DVe(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var YVe="[object Arguments]",XVe="[object Boolean]",QVe="[object Date]",JVe="[object Error]",ZVe="[object Map]",e7e="[object Number]",t7e="[object Object]",n7e="[object RegExp]",r7e="[object Set]",a7e="[object String]",s7e="[object URL]",i7e=Array.isArray,R3=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,D3=Object.assign,o7e=Object.prototype.toString.call.bind(Object.prototype.toString);function l7e(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,i=e.areMapsEqual,o=e.areNumbersEqual,l=e.areObjectsEqual,c=e.arePrimitiveWrappersEqual,u=e.areRegExpsEqual,d=e.areSetsEqual,f=e.areTypedArraysEqual,h=e.areUrlsEqual;return function(p,g,y){if(p===g)return!0;if(p==null||g==null)return!1;var v=typeof p;if(v!==typeof g)return!1;if(v!=="object")return v==="number"?o(p,g,y):v==="function"?a(p,g,y):!1;var w=p.constructor;if(w!==g.constructor)return!1;if(w===Object)return l(p,g,y);if(i7e(p))return t(p,g,y);if(R3!=null&&R3(p))return f(p,g,y);if(w===Date)return n(p,g,y);if(w===RegExp)return u(p,g,y);if(w===Map)return i(p,g,y);if(w===Set)return d(p,g,y);var b=o7e(p);return b===QVe?n(p,g,y):b===n7e?u(p,g,y):b===ZVe?i(p,g,y):b===r7e?d(p,g,y):b===t7e?typeof p.then!="function"&&typeof g.then!="function"&&l(p,g,y):b===s7e?h(p,g,y):b===JVe?r(p,g,y):b===YVe?l(p,g,y):b===XVe||b===e7e||b===a7e?c(p,g,y):!1}}function c7e(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?wp:FVe,areDatesEqual:BVe,areErrorsEqual:zVe,areFunctionsEqual:UVe,areMapsEqual:r?A3(T3,wp):T3,areNumbersEqual:VVe,areObjectsEqual:r?wp:WVe,arePrimitiveWrappersEqual:qVe,areRegExpsEqual:HVe,areSetsEqual:r?A3(M3,wp):M3,areTypedArraysEqual:r?wp:KVe,areUrlsEqual:GVe};if(n&&(a=D3({},a,n(a))),t){var i=Gx(a.areArraysEqual),o=Gx(a.areMapsEqual),l=Gx(a.areObjectsEqual),c=Gx(a.areSetsEqual);a=D3({},a,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return a}function u7e(e){return function(t,n,r,a,i,o,l){return e(t,n,l)}}function d7e(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,i=e.strict;if(r)return function(c,u){var d=r(),f=d.cache,h=f===void 0?t?new WeakMap:void 0:f,m=d.meta;return n(c,u,{cache:h,equals:a,meta:m,strict:i})};if(t)return function(c,u){return n(c,u,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var o={cache:void 0,equals:a,meta:void 0,strict:i};return function(c,u){return n(c,u,o)}}var f7e=tu();tu({strict:!0});tu({circular:!0});tu({circular:!0,strict:!0});tu({createInternalComparator:function(){return Id}});tu({strict:!0,createInternalComparator:function(){return Id}});tu({circular:!0,createInternalComparator:function(){return Id}});tu({circular:!0,createInternalComparator:function(){return Id},strict:!0});function tu(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,i=e.strict,o=i===void 0?!1:i,l=c7e(e),c=l7e(l),u=r?r(c):u7e(c);return d7e({circular:n,comparator:c,createState:a,equals:u,strict:o})}function h7e(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function $3(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(i){n<0&&(n=i),i-n>t?(e(i),n=-1):h7e(a)};requestAnimationFrame(r)}function tA(e){"@babel/helpers - typeof";return tA=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tA(e)}function m7e(e){return v7e(e)||y7e(e)||g7e(e)||p7e()}
vendor: 64,283 bytes, lines 889-908
889function p7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
890In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g7e(e,t){if(e){if(typeof e=="string")return I3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return I3(e,t)}}function I3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function y7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function v7e(e){if(Array.isArray(e))return e}function x7e(){var e={},t=function(){return null},n=!1,r=function a(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var o=i,l=m7e(o),c=l[0],u=l.slice(1);if(typeof c=="number"){$3(a.bind(null,u),c);return}a(c),$3(a.bind(null,u));return}tA(i)==="object"&&(e=i,t(e)),typeof i=="function"&&i()}};return{stop:function(){n=!0},start:function(i){n=!1,r(i)},subscribe:function(i){return t=i,function(){t=function(){return null}}}}}function _y(e){"@babel/helpers - typeof";return _y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_y(e)}function L3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function F3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?L3(Object(n),!0).forEach(function(r){FQ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function FQ(e,t,n){return t=b7e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b7e(e){var t=w7e(e,"string");return _y(t)==="symbol"?t:String(t)}function w7e(e,t){if(_y(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_y(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var j7e=function(t,n){return[Object.keys(t),Object.keys(n)].reduce(function(r,a){return r.filter(function(i){return a.includes(i)})})},N7e=function(t){return t},S7e=function(t){return t.replace(/([A-Z])/g,function(n){return"-".concat(n.toLowerCase())})},cg=function(t,n){return Object.keys(n).reduce(function(r,a){return F3(F3({},r),{},FQ({},a,t(a,n[a])))},{})},B3=function(t,n,r){return t.map(function(a){return"".concat(S7e(a)," ").concat(n,"ms ").concat(r)}).join(",")};function C7e(e,t){return A7e(e)||E7e(e,t)||BQ(e,t)||_7e()}function _7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
891In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function E7e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function A7e(e){if(Array.isArray(e))return e}function P7e(e){return T7e(e)||O7e(e)||BQ(e)||k7e()}function k7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
892In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BQ(e,t){if(e){if(typeof e=="string")return nA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return nA(e,t)}}function O7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function T7e(e){if(Array.isArray(e))return nA(e)}function nA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var jw=1e-4,zQ=function(t,n){return[0,3*t,3*n-6*t,3*t-3*n+1]},UQ=function(t,n){return t.map(function(r,a){return r*Math.pow(n,a)}).reduce(function(r,a){return r+a})},z3=function(t,n){return function(r){var a=zQ(t,n);return UQ(a,r)}},M7e=function(t,n){return function(r){var a=zQ(t,n),i=[].concat(P7e(a.map(function(o,l){return o*l}).slice(1)),[0]);return UQ(i,r)}},U3=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0],i=n[1],o=n[2],l=n[3];if(n.length===1)switch(n[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var c=n[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(y){return parseFloat(y)}),d=C7e(u,4);a=d[0],i=d[1],o=d[2],l=d[3]}}}var f=z3(a,o),h=z3(i,l),m=M7e(a,o),p=function(v){return v>1?1:v<0?0:v},g=function(v){for(var w=v>1?1:v,b=w,j=0;j<8;++j){var N=f(b)-w,S=m(b);if(Math.abs(N-w)<jw||S<jw)return h(b);b=p(b-N/S)}return h(b)};return g.isStepper=!1,g},R7e=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,i=a===void 0?8:a,o=t.dt,l=o===void 0?17:o,c=function(d,f,h){var m=-(d-f)*r,p=h*i,g=h+(m-p)*l/1e3,y=h*l/1e3+d;return Math.abs(y-f)<jw&&Math.abs(g)<jw?[f,0]:[y,g]};return c.isStepper=!0,c.dt=l,c},D7e=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var a=n[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return U3(a);case"spring":return R7e();default:if(a.split("(")[0]==="cubic-bezier")return U3(a)}return typeof a=="function"?a:null};function Ey(e){"@babel/helpers - typeof";return Ey=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ey(e)}function V3(e){return L7e(e)||I7e(e)||VQ(e)||$7e()}function $7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
893In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function L7e(e){if(Array.isArray(e))return aA(e)}function W3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W3(Object(n),!0).forEach(function(r){rA(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rA(e,t,n){return t=F7e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F7e(e){var t=B7e(e,"string");return Ey(t)==="symbol"?t:String(t)}function B7e(e,t){if(Ey(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ey(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function z7e(e,t){return W7e(e)||V7e(e,t)||VQ(e,t)||U7e()}function U7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
894In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VQ(e,t){if(e){if(typeof e=="string")return aA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return aA(e,t)}}function aA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function V7e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function W7e(e){if(Array.isArray(e))return e}var Nw=function(t,n,r){return t+(n-t)*r},sA=function(t){var n=t.from,r=t.to;return n!==r},q7e=function e(t,n,r){var a=cg(function(i,o){if(sA(o)){var l=t(o.from,o.to,o.velocity),c=z7e(l,2),u=c[0],d=c[1];return Ar(Ar({},o),{},{from:u,velocity:d})}return o},n);return r<1?cg(function(i,o){return sA(o)?Ar(Ar({},o),{},{velocity:Nw(o.velocity,a[i].velocity,r),from:Nw(o.from,a[i].from,r)}):o},n):e(t,a,r-1)};const H7e=function(e,t,n,r,a){var i=j7e(e,t),o=i.reduce(function(y,v){return Ar(Ar({},y),{},rA({},v,[e[v],t[v]]))},{}),l=i.reduce(function(y,v){return Ar(Ar({},y),{},rA({},v,{from:e[v],velocity:0,to:t[v]}))},{}),c=-1,u,d,f=function(){return null},h=function(){return cg(function(v,w){return w.from},l)},m=function(){return!Object.values(l).filter(sA).length},p=function(v){u||(u=v);var w=v-u,b=w/n.dt;l=q7e(n,l,b),a(Ar(Ar(Ar({},e),t),h())),u=v,m()||(c=requestAnimationFrame(f))},g=function(v){d||(d=v);var w=(v-d)/r,b=cg(function(N,S){return Nw.apply(void 0,V3(S).concat([n(w)]))},o);if(a(Ar(Ar(Ar({},e),t),b)),w<1)c=requestAnimationFrame(f);else{var j=cg(function(N,S){return Nw.apply(void 0,V3(S).concat([n(1)]))},o);a(Ar(Ar(Ar({},e),t),j))}};return f=n.isStepper?p:g,function(){return requestAnimationFrame(f),function(){cancelAnimationFrame(c)}}};function zh(e){"@babel/helpers - typeof";return zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zh(e)}var K7e=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function G7e(e,t){if(e==null)return{};var n=Y7e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Y7e(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,i;for(i=0;i<r.length;i++)a=r[i],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function _C(e){return Z7e(e)||J7e(e)||Q7e(e)||X7e()}function X7e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
895In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Q7e(e,t){if(e){if(typeof e=="string")return iA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return iA(e,t)}}function J7e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Z7e(e){if(Array.isArray(e))return iA(e)}function iA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function q3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Bs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?q3(Object(n),!0).forEach(function(r){Fp(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Fp(e,t,n){return t=WQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eWe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tWe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,WQ(r.key),r)}}function nWe(e,t,n){return t&&tWe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function WQ(e){var t=rWe(e,"string");return zh(t)==="symbol"?t:String(t)}function rWe(e,t){if(zh(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zh(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function aWe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oA(e,t)}function oA(e,t){return oA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},oA(e,t)}function sWe(e){var t=iWe();return function(){var r=Sw(e),a;if(t){var i=Sw(this).constructor;a=Reflect.construct(r,arguments,i)}else a=r.apply(this,arguments);return lA(this,a)}}function lA(e,t){if(t&&(zh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cA(e)}function cA(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iWe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Sw(e){return Sw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Sw(e)}var Dr=function(e){aWe(n,e);var t=sWe(n);function n(r,a){var i;eWe(this,n),i=t.call(this,r,a);var o=i.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,f=o.steps,h=o.children,m=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(cA(i)),i.changeStyle=i.changeStyle.bind(cA(i)),!l||m<=0)return i.state={style:{}},typeof h=="function"&&(i.state={style:d}),lA(i);if(f&&f.length)i.state={style:f[0].style};else if(u){if(typeof h=="function")return i.state={style:u},lA(i);i.state={style:c?Fp({},c,u):u}}else i.state={style:{}};return i}return nWe(n,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,f=i.from,h=this.state.style;if(l){if(!o){var m={style:c?Fp({},c,d):d};this.state&&h&&(c&&h[c]!==d||!c&&h!==d)&&this.setState(m);return}if(!(f7e(a.to,d)&&a.canBegin&&a.isActive)){var p=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=p||u?f:a.to;if(this.state&&h){var y={style:c?Fp({},c,g):g};(c&&h[c]!==g||!c&&h!==g)&&this.setState(y)}this.runAnimation(Bs(Bs({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,l=a.to,c=a.duration,u=a.easing,d=a.begin,f=a.onAnimationEnd,h=a.onAnimationStart,m=H7e(o,l,D7e(u),c,this.changeStyle),p=function(){i.stopJSAnimation=m()};this.manager.start([h,d,p,c,f])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,c=a.onAnimationStart,u=o[0],d=u.style,f=u.duration,h=f===void 0?0:f,m=function(g,y,v){if(v===0)return g;var w=y.duration,b=y.easing,j=b===void 0?"ease":b,N=y.style,S=y.properties,C=y.onAnimationEnd,_=v>0?o[v-1]:y,E=S||Object.keys(N);if(typeof j=="function"||j==="spring")return[].concat(_C(g),[i.runJSAnimation.bind(i,{from:_.style,to:N,duration:w,easing:j}),w]);var T=B3(E,w,j),P=Bs(Bs(Bs({},_.style),N),{},{transition:T});return[].concat(_C(g),[P,w,C]).filter(N7e)};return this.manager.start([c].concat(_C(o.reduce(m,[d,Math.max(h,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=x7e());var i=a.begin,o=a.duration,l=a.attributeName,c=a.to,u=a.easing,d=a.onAnimationStart,f=a.onAnimationEnd,h=a.steps,m=a.children,p=this.manager;if(this.unSubscribe=p.subscribe(this.handleStyleChange),typeof u=="function"||typeof m=="function"||u==="spring"){this.runJSAnimation(a);return}if(h.length>1){this.runStepAnimation(a);return}var g=l?Fp({},l,c):c,y=B3(Object.keys(g),o,u);p.start([d,i,Bs(Bs({},g),{},{transition:y}),o,f])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var c=G7e(a,K7e),u=x.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!l||u===0||o<=0)return i;var f=function(m){var p=m.props,g=p.style,y=g===void 0?{}:g,v=p.className,w=x.cloneElement(m,Bs(Bs({},c),{},{style:Bs(Bs({},y),d),className:v}));return w};return u===1?f(x.Children.only(i)):L.createElement("div",null,x.Children.map(i,function(h){return f(h)}))}}]),n}(x.PureComponent);Dr.displayName="Animate";Dr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Dr.propTypes={from:Ut.oneOfType([Ut.object,Ut.string]),to:Ut.oneOfType([Ut.object,Ut.string]),attributeName:Ut.string,duration:Ut.number,begin:Ut.number,easing:Ut.oneOfType([Ut.string,Ut.func]),steps:Ut.arrayOf(Ut.shape({duration:Ut.number.isRequired,style:Ut.object.isRequired,easing:Ut.oneOfType([Ut.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ut.func]),properties:Ut.arrayOf("string"),onAnimationEnd:Ut.func})),children:Ut.oneOfType([Ut.node,Ut.func]),isActive:Ut.bool,canBegin:Ut.bool,onAnimationEnd:Ut.func,shouldReAnimate:Ut.bool,onAnimationStart:Ut.func,onAnimationReStart:Ut.func};function Ay(e){"@babel/helpers - typeof";return Ay=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ay(e)}function Cw(){return Cw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cw.apply(this,arguments)}function oWe(e,t){return dWe(e)||uWe(e,t)||cWe(e,t)||lWe()}function lWe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
896In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cWe(e,t){if(e){if(typeof e=="string")return H3(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return H3(e,t)}}function H3(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uWe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function dWe(e){if(Array.isArray(e))return e}function K3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function G3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?K3(Object(n),!0).forEach(function(r){fWe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):K3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function fWe(e,t,n){return t=hWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hWe(e){var t=mWe(e,"string");return Ay(t)=="symbol"?t:t+""}function mWe(e,t){if(Ay(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ay(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Y3=function(t,n,r,a,i){var o=Math.min(Math.abs(r)/2,Math.abs(a)/2),l=a>=0?1:-1,c=r>=0?1:-1,u=a>=0&&r>=0||a<0&&r<0?1:0,d;if(o>0&&i instanceof Array){for(var f=[0,0,0,0],h=0,m=4;h<m;h++)f[h]=i[h]>o?o:i[h];d="M".concat(t,",").concat(n+l*f[0]),f[0]>0&&(d+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(u,",").concat(t+c*f[0],",").concat(n)),d+="L ".concat(t+r-c*f[1],",").concat(n),f[1]>0&&(d+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(u,`,
897        `).concat(t+r,",").concat(n+l*f[1])),d+="L ".concat(t+r,",").concat(n+a-l*f[2]),f[2]>0&&(d+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(u,`,
898        `).concat(t+r-c*f[2],",").concat(n+a)),d+="L ".concat(t+c*f[3],",").concat(n+a),f[3]>0&&(d+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(u,`,
899        `).concat(t,",").concat(n+a-l*f[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var p=Math.min(o,i);d="M ".concat(t,",").concat(n+l*p,`
900            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+c*p,",").concat(n,`
901            L `).concat(t+r-c*p,",").concat(n,`
902            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r,",").concat(n+l*p,`
903            L `).concat(t+r,",").concat(n+a-l*p,`
904            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t+r-c*p,",").concat(n+a,`
905            L `).concat(t+c*p,",").concat(n+a,`
906            A `).concat(p,",").concat(p,",0,0,").concat(u,",").concat(t,",").concat(n+a-l*p," Z")}else d="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return d},pWe=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,i=n.x,o=n.y,l=n.width,c=n.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),f=Math.min(o,o+c),h=Math.max(o,o+c);return r>=u&&r<=d&&a>=f&&a<=h}return!1},gWe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},CN=function(t){var n=G3(G3({},gWe),t),r=x.useRef(),a=x.useState(-1),i=oWe(a,2),o=i[0],l=i[1];x.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var j=r.current.getTotalLength();j&&l(j)}catch{}},[]);var c=n.x,u=n.y,d=n.width,f=n.height,h=n.radius,m=n.className,p=n.animationEasing,g=n.animationDuration,y=n.animationBegin,v=n.isAnimationActive,w=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||d===0||f===0)return null;var b=Ge("recharts-rectangle",m);return w?L.createElement(Dr,{canBegin:o>0,from:{width:d,height:f,x:c,y:u},to:{width:d,height:f,x:c,y:u},duration:g,animationEasing:p,isActive:w},function(j){var N=j.width,S=j.height,C=j.x,_=j.y;return L.createElement(Dr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,isActive:v,easing:p},L.createElement("path",Cw({},Me(n,!0),{className:b,d:Y3(C,_,N,S,h),ref:r})))}):L.createElement("path",Cw({},Me(n,!0),{className:b,d:Y3(c,u,d,f,h)}))},yWe=["points","className","baseLinePoints","connectNulls"];function Sf(){return Sf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Sf.apply(this,arguments)}function vWe(e,t){if(e==null)return{};var n=xWe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function xWe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function X3(e){return NWe(e)||jWe(e)||wWe(e)||bWe()}function bWe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
907In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wWe(e,t){if(e){if(typeof e=="string")return uA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return uA(e,t)}}function jWe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NWe(e){if(Array.isArray(e))return uA(e)}function uA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Q3=function(t){return t&&t.x===+t.x&&t.y===+t.y},SWe=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){Q3(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),Q3(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},ug=function(t,n){var r=SWe(t);n&&(r=[r.reduce(function(i,o){return[].concat(X3(i),X3(o))},[])]);var a=r.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},CWe=function(t,n,r){var a=ug(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ug(n.reverse(),r).slice(1))},lM=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,i=t.connectNulls,o=vWe(t,yWe);if(!n||!n.length)return null;var l=Ge("recharts-polygon",r);if(a&&a.length){var c=o.stroke&&o.stroke!=="none",u=CWe(n,a,i);return L.createElement("g",{className:l},L.createElement("path",Sf({},Me(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?L.createElement("path",Sf({},Me(o,!0),{fill:"none",d:ug(n,i)})):null,c?L.createElement("path",Sf({},Me(o,!0),{fill:"none",d:ug(a,i)})):null)}var d=ug(n,i);return L.createElement("path",Sf({},Me(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function dA(){return dA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dA.apply(this,arguments)}var Hm=function(t){var n=t.cx,r=t.cy,a=t.r,i=t.className,o=Ge("recharts-dot",i);return n===+n&&r===+r&&a===+a?x.createElement("circle",dA({},Me(t,!1),K0(t),{className:o,cx:n,cy:r,r:a})):null};function Py(e){"@babel/helpers - typeof";return Py=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Py(e)}var _We=["x","y","top","left","width","height","className"];function fA(){return fA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fA.apply(this,arguments)}function J3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function EWe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?J3(Object(n),!0).forEach(function(r){AWe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):J3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function AWe(e,t,n){return t=PWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PWe(e){var t=kWe(e,"string");return Py(t)=="symbol"?t:t+""}function kWe(e,t){if(Py(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Py(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function OWe(e,t){if(e==null)return{};var n=TWe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TWe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var MWe=function(t,n,r,a,i,o){return"M".concat(t,",").concat(i,"v").concat(a,"M").concat(o,",").concat(n,"h").concat(r)},RWe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,i=a===void 0?0:a,o=t.top,l=o===void 0?0:o,c=t.left,u=c===void 0?0:c,d=t.width,f=d===void 0?0:d,h=t.height,m=h===void 0?0:h,p=t.className,g=OWe(t,_We),y=EWe({x:r,y:i,top:l,left:u,width:f,height:m},g);return!Ee(r)||!Ee(i)||!Ee(f)||!Ee(m)||!Ee(l)||!Ee(u)?null:L.createElement("path",fA({},Me(y,!0),{className:Ge("recharts-cross",p),d:MWe(r,i,f,m,l,u)}))},DWe=["cx","cy","innerRadius","outerRadius","gridType","radialLines"];function ky(e){"@babel/helpers - typeof";return ky=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ky(e)}function $We(e,t){if(e==null)return{};var n=IWe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function IWe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function yl(){return yl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yl.apply(this,arguments)}function Z3(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Oy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z3(Object(n),!0).forEach(function(r){LWe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z3(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LWe(e,t,n){return t=FWe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FWe(e){var t=BWe(e,"string");return ky(t)=="symbol"?t:t+""}function BWe(e,t){if(ky(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ky(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var zWe=function(t,n,r,a){var i="";return a.forEach(function(o,l){var c=It(n,r,t,o);l?i+="L ".concat(c.x,",").concat(c.y):i+="M ".concat(c.x,",").concat(c.y)}),i+="Z",i},UWe=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,i=t.outerRadius,o=t.polarAngles,l=t.radialLines;if(!o||!o.length||!l)return null;var c=Oy({stroke:"#ccc"},Me(t,!1));return L.createElement("g",{className:"recharts-polar-grid-angle"},o.map(function(u){var d=It(n,r,a,u),f=It(n,r,i,u);return L.createElement("line",yl({},c,{key:"line-".concat(u),x1:d.x,y1:d.y,x2:f.x,y2:f.y}))}))},VWe=function(t){var n=t.cx,r=t.cy,a=t.radius,i=t.index,o=Oy(Oy({stroke:"#ccc"},Me(t,!1)),{},{fill:"none"});return L.createElement("circle",yl({},o,{className:Ge("recharts-polar-grid-concentric-circle",t.className),key:"circle-".concat(i),cx:n,cy:r,r:a}))},WWe=function(t){var n=t.radius,r=t.index,a=Oy(Oy({stroke:"#ccc"},Me(t,!1)),{},{fill:"none"});return L.createElement("path",yl({},a,{className:Ge("recharts-polar-grid-concentric-polygon",t.className),key:"path-".concat(r),d:zWe(n,t.cx,t.cy,t.polarAngles)}))},qWe=function(t){var n=t.polarRadius,r=t.gridType;return!n||!n.length?null:L.createElement("g",{className:"recharts-polar-grid-concentric"},n.map(function(a,i){var o=i;return r==="circle"?L.createElement(VWe,yl({key:o},t,{radius:a,index:i})):L.createElement(WWe,yl({key:o},t,{radius:a,index:i}))}))},qQ=function(t){var n=t.cx,r=n===void 0?0:n,a=t.cy,i=a===void 0?0:a,o=t.innerRadius,l=o===void 0?0:o,c=t.outerRadius,u=c===void 0?0:c,d=t.gridType,f=d===void 0?"polygon":d,h=t.radialLines,m=h===void 0?!0:h,p=$We(t,DWe);return u<=0?null:L.createElement("g",{className:"recharts-polar-grid"},L.createElement(UWe,yl({cx:r,cy:i,innerRadius:l,outerRadius:u,gridType:f,radialLines:m},p)),L.createElement(qWe,yl({cx:r,cy:i,innerRadius:l,outerRadius:u,gridType:f,radialLines:m},p)))};qQ.displayName="PolarGrid";var HWe=wN,KWe=JX,GWe=po;function YWe(e,t){return e&&e.length?HWe(e,GWe(t),KWe):void 0}var XWe=YWe;const QWe=$t(XWe);var JWe=wN,ZWe=po,e9e=ZX;function t9e(e,t){return e&&e.length?JWe(e,ZWe(t),e9e):void 0}var n9e=t9e;const r9e=$t(n9e);var a9e=["cx","cy","angle","ticks","axisLine"],s9e=["ticks","tick","angle","tickFormatter","stroke"];function Uh(e){"@babel/helpers - typeof";return Uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uh(e)}function dg(){return dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},dg.apply(this,arguments)}function e5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function uu(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?e5(Object(n),!0).forEach(function(r){_N(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):e5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function t5(e,t){if(e==null)return{};var n=i9e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function i9e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function o9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,KQ(r.key),r)}}function l9e(e,t,n){return t&&n5(e.prototype,t),n&&n5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c9e(e,t,n){return t=_w(t),u9e(e,HQ()?Reflect.construct(t,n||[],_w(e).constructor):t.apply(e,n))}function u9e(e,t){if(t&&(Uh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d9e(e)}function d9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function HQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HQ=function(){return!!e})()}function _w(e){return _w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},_w(e)}function f9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hA(e,t)}function hA(e,t){return hA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},hA(e,t)}function _N(e,t,n){return t=KQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KQ(e){var t=h9e(e,"string");return Uh(t)=="symbol"?t:t+""}function h9e(e,t){if(Uh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Uh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ld=function(e){function t(){return o9e(this,t),c9e(this,t,arguments)}return f9e(t,e),l9e(t,[{key:"getTickValueCoord",value:function(r){var a=r.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return It(l,c,a,o)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,a;switch(r){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,l=r.ticks,c=QWe(l,function(d){return d.coordinate||0}),u=r9e(l,function(d){return d.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.angle,l=r.ticks,c=r.axisLine,u=t5(r,a9e),d=l.reduce(function(p,g){return[Math.min(p[0],g.coordinate),Math.max(p[1],g.coordinate)]},[1/0,-1/0]),f=It(a,i,d[0],o),h=It(a,i,d[1],o),m=uu(uu(uu({},Me(u,!1)),{},{fill:"none"},Me(c,!1)),{},{x1:f.x,y1:f.y,x2:h.x,y2:h.y});return L.createElement("line",dg({className:"recharts-polar-radius-axis-line"},m))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,l=a.angle,c=a.tickFormatter,u=a.stroke,d=t5(a,s9e),f=this.getTickTextAnchor(),h=Me(d,!1),m=Me(o,!1),p=i.map(function(g,y){var v=r.getTickValueCoord(g),w=uu(uu(uu(uu({textAnchor:f,transform:"rotate(".concat(90-l,", ").concat(v.x,", ").concat(v.y,")")},h),{},{stroke:"none",fill:u},m),{},{index:y},v),{},{payload:g});return L.createElement(He,dg({className:Ge("recharts-polar-radius-axis-tick",PQ(o)),key:"tick-".concat(g.coordinate)},vi(r.props,g,y)),t.renderTickItem(o,w,c?c(g.value,y):g.value))});return L.createElement(He,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.axisLine,o=r.tick;return!a||!a.length?null:L.createElement(He,{className:Ge("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),jr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,a,i){var o;return L.isValidElement(r)?o=L.cloneElement(r,a):ze(r)?o=r(a):o=L.createElement(jd,dg({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(x.PureComponent);_N(Ld,"displayName","PolarRadiusAxis");_N(Ld,"axisType","radiusAxis");_N(Ld,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function Vh(e){"@babel/helpers - typeof";return Vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vh(e)}function bu(){return bu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bu.apply(this,arguments)}function r5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function du(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?r5(Object(n),!0).forEach(function(r){EN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function m9e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YQ(r.key),r)}}function p9e(e,t,n){return t&&a5(e.prototype,t),n&&a5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g9e(e,t,n){return t=Ew(t),y9e(e,GQ()?Reflect.construct(t,n||[],Ew(e).constructor):t.apply(e,n))}function y9e(e,t){if(t&&(Vh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v9e(e)}function v9e(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function GQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GQ=function(){return!!e})()}function Ew(e){return Ew=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ew(e)}function x9e(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&mA(e,t)}function mA(e,t){return mA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},mA(e,t)}function EN(e,t,n){return t=YQ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YQ(e){var t=b9e(e,"string");return Vh(t)=="symbol"?t:t+""}function b9e(e,t){if(Vh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var w9e=Math.PI/180,s5=1e-5,Fd=function(e){function t(){return m9e(this,t),g9e(this,t,arguments)}return x9e(t,e),p9e(t,[{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.cx,o=a.cy,l=a.radius,c=a.orientation,u=a.tickSize,d=u||8,f=It(i,o,l,r.coordinate),h=It(i,o,l+(c==="inner"?-1:1)*d,r.coordinate);return{x1:f.x,y1:f.y,x2:h.x,y2:h.y}}},{key:"getTickTextAnchor",value:function(r){var a=this.props.orientation,i=Math.cos(-r.coordinate*w9e),o;return i>s5?o=a==="outer"?"start":"end":i<-s5?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,i=r.cy,o=r.radius,l=r.axisLine,c=r.axisLineType,u=du(du({},Me(this.props,!1)),{},{fill:"none"},Me(l,!1));if(c==="circle")return L.createElement(Hm,bu({className:"recharts-polar-angle-axis-line"},u,{cx:a,cy:i,r:o}));var d=this.props.ticks,f=d.map(function(h){return It(a,i,o,h.coordinate)});return L.createElement(lM,bu({className:"recharts-polar-angle-axis-line"},u,{points:f}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,i=a.ticks,o=a.tick,l=a.tickLine,c=a.tickFormatter,u=a.stroke,d=Me(this.props,!1),f=Me(o,!1),h=du(du({},d),{},{fill:"none"},Me(l,!1)),m=i.map(function(p,g){var y=r.getTickLineCoord(p),v=r.getTickTextAnchor(p),w=du(du(du({textAnchor:v},d),{},{stroke:"none",fill:u},f),{},{index:g,payload:p,x:y.x2,y:y.y2});return L.createElement(He,bu({className:Ge("recharts-polar-angle-axis-tick",PQ(o)),key:"tick-".concat(p.coordinate)},vi(r.props,p,g)),l&&L.createElement("line",bu({className:"recharts-polar-angle-axis-tick-line"},h,y)),o&&t.renderTickItem(o,w,c?c(p.value,g):p.value))});return L.createElement(He,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var r=this.props,a=r.ticks,i=r.radius,o=r.axisLine;return i<=0||!a||!a.length?null:L.createElement(He,{className:Ge("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,i){var o;return L.isValidElement(r)?o=L.cloneElement(r,a):ze(r)?o=r(a):o=L.createElement(jd,bu({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(x.PureComponent);EN(Fd,"displayName","PolarAngleAxis");EN(Fd,"axisType","angleAxis");EN(Fd,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var j9e=YY,N9e=j9e(Object.getPrototypeOf,Object),cM=N9e,S9e=El,C9e=cM,_9e=_i,E9e="[object Object]",A9e=Function.prototype,P9e=Object.prototype,XQ=A9e.toString,k9e=P9e.hasOwnProperty,O9e=XQ.call(Object);function T9e(e){if(!_9e(e)||S9e(e)!=E9e)return!1;var t=C9e(e);if(t===null)return!0;var n=k9e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&XQ.call(n)==O9e}var QQ=T9e;const M9e=$t(QQ);var R9e=El,D9e=_i,$9e="[object Boolean]";function I9e(e){return e===!0||e===!1||D9e(e)&&R9e(e)==$9e}var L9e=I9e;const F9e=$t(L9e);function Ty(e){"@babel/helpers - typeof";return Ty=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ty(e)}function Aw(){return Aw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Aw.apply(this,arguments)}function B9e(e,t){return W9e(e)||V9e(e,t)||U9e(e,t)||z9e()}function z9e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
908In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U9e(e,t){if(e){if(typeof e=="string")return i5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return i5(e,t)}}function i5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function V9e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function W9e(e){if(Array.isArray(e))return e}function o5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function l5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?o5(Object(n),!0).forEach(function(r){q9e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function q9e(e,t,n){return t=H9e(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H9e(e){var t=K9e(e,"string");return Ty(t)=="symbol"?t:t+""}function K9e(e,t){if(Ty(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ty(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var c5=function(t,n,r,a,i){var o=r-a,l;return l="M ".concat(t,",").concat(n),l+="L ".concat(t+r,",").concat(n),l+="L ".concat(t+r-o/2,",").concat(n+i),l+="L ".concat(t+r-o/2-a,",").concat(n+i),l+="L ".concat(t,",").concat(n," Z"),l},G9e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Y9e=function(t){var n=l5(l5({},G9e),t),r=x.useRef(),a=x.useState(-1),i=B9e(a,2),o=i[0],l=i[1];x.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var b=r.current.getTotalLength();b&&l(b)}catch{}},[]);var c=n.x,u=n.y,d=n.upperWidth,f=n.lowerWidth,h=n.height,m=n.className,p=n.animationEasing,g=n.animationDuration,y=n.animationBegin,v=n.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||f!==+f||h!==+h||d===0&&f===0||h===0)return null;var w=Ge("recharts-trapezoid",m);return v?L.createElement(Dr,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:h,x:c,y:u},to:{upperWidth:d,lowerWidth:f,height:h,x:c,y:u},duration:g,animationEasing:p,isActive:v},function(b){var j=b.upperWidth,N=b.lowerWidth,S=b.height,C=b.x,_=b.y;return L.createElement(Dr,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:y,duration:g,easing:p},L.createElement("path",Aw({},Me(n,!0),{className:w,d:c5(C,_,j,N,S),ref:r})))}):L.createElement("g",null,L.createElement("path",Aw({},Me(n,!0),{className:w,d:c5(c,u,d,f,h)})))},X9e=["option","shapeType","propTransformer","activeClassName","isActive"];function My(e){"@babel/helpers - typeof";return My=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},My(e)}function Q9e(e,t){if(e==null)return{};var n=J9e(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function J9e(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function u5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Pw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?u5(Object(n),!0).forEach(function(r){Z9e(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Z9e(e,t,n){return t=eqe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eqe(e){var t=tqe(e,"string");return My(t)=="symbol"?t:t+""}function tqe(e,t){if(My(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(My(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nqe(e,t){return Pw(Pw({},t),e)}function rqe(e,t){return e==="symbols"}function d5(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return L.createElement(CN,n);case"trapezoid":return L.createElement(Y9e,n);case"sector":return L.createElement(RQ,n);case"symbols":if(rqe(t))return L.createElement(uN,n);break;default:return null}}function JQ(e){return x.isValidElement(e)?e.props:e}function Wh(e){var t=e.option,n=e.shapeType,r=e.propTransformer,a=r===void 0?nqe:r,i=e.activeClassName,o=i===void 0?"recharts-active-shape":i,l=e.isActive,c=Q9e(e,X9e),u;if(x.isValidElement(t))u=x.cloneElement(t,Pw(Pw({},c),JQ(t)));else if(ze(t))u=t(c);else if(M9e(t)&&!F9e(t)){var d=a(t,c);u=L.createElement(d5,{shapeType:n,elementProps:d})}else{var f=c;u=L.createElement(d5,{shapeType:n,elementProps:f})}return l?L.createElement(He,{className:o},u):u}function AN(e,t){return t!=null&&"trapezoids"in e.props}function PN(e,t){return t!=null&&"sectors"in e.props}function Ry(e,t){return t!=null&&"points"in e.props}function aqe(e,t){var n,r,a=e.x===(t==null||(n=t.labelViewBox)===null||n===void 0?void 0:n.x)||e.x===t.x,i=e.y===(t==null||(r=t.labelViewBox)===null||r===void 0?void 0:r.y)||e.y===t.y;return a&&i}function sqe(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function iqe(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function oqe(e,t){var n;return AN(e,t)?n=aqe:PN(e,t)?n=sqe:Ry(e,t)&&(n=iqe),n}function lqe(e,t){var n;return AN(e,t)?n="trapezoids":PN(e,t)?n="sectors":Ry(e,t)&&(n="points"),n}function cqe(e,t){if(AN(e,t)){var n;return(n=t.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}if(PN(e,t)){var r;return(r=t.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}return Ry(e,t)?t.payload:{}}function uqe(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=lqe(n,t),i=cqe(n,t),o=r.filter(function(c,u){var d=xi(i,c),f=n.props[a].filter(function(p){var g=oqe(n,t);return g(p,t)}),h=n.props[a].indexOf(f[f.length-1]),m=u===h;return d&&m}),l=r.indexOf(o[o.length-1]);return l}var Pb;function qh(e){"@babel/helpers - typeof";return qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qh(e)}function Cf(){return Cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cf.apply(this,arguments)}function f5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function an(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?f5(Object(n),!0).forEach(function(r){Ns(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function dqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,eJ(r.key),r)}}function fqe(e,t,n){return t&&h5(e.prototype,t),n&&h5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hqe(e,t,n){return t=kw(t),mqe(e,ZQ()?Reflect.construct(t,n||[],kw(e).constructor):t.apply(e,n))}function mqe(e,t){if(t&&(qh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pqe(e)}function pqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZQ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZQ=function(){return!!e})()}function kw(e){return kw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},kw(e)}function gqe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pA(e,t)}function pA(e,t){return pA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},pA(e,t)}function Ns(e,t,n){return t=eJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eJ(e){var t=yqe(e,"string");return qh(t)=="symbol"?t:t+""}function yqe(e,t){if(qh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var cs=function(e){function t(n){var r;return dqe(this,t),r=hqe(this,t,[n]),Ns(r,"pieRef",null),Ns(r,"sectorRefs",[]),Ns(r,"id",Al("recharts-pie-")),Ns(r,"handleAnimationEnd",function(){var a=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),ze(a)&&a()}),Ns(r,"handleAnimationStart",function(){var a=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),ze(a)&&a()}),r.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},r}return gqe(t,e),fqe(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,d=Me(this.props,!1),f=Me(o,!1),h=Me(l,!1),m=o&&o.offsetRadius||20,p=r.map(function(g,y){var v=(g.startAngle+g.endAngle)/2,w=It(g.cx,g.cy,g.outerRadius+m,v),b=an(an(an(an({},d),g),{},{stroke:"none"},f),{},{index:y,textAnchor:t.getTextAnchor(w.x,g.cx)},w),j=an(an(an(an({},d),g),{},{fill:"none",stroke:g.fill},h),{},{index:y,points:[It(g.cx,g.cy,g.outerRadius,v),w]}),N=c;return Ke(c)&&Ke(u)?N="value":Ke(c)&&(N=u),L.createElement(He,{key:"label-".concat(g.startAngle,"-").concat(g.endAngle,"-").concat(g.midAngle,"-").concat(y)},l&&t.renderLabelLineItem(l,j,"line"),t.renderLabelItem(o,b,Ot(g,N)))});return L.createElement(He,{className:"recharts-pie-labels"},p)}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return r.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&r.length!==1)return null;var f=a.isActiveIndex(d),h=c&&a.hasActiveIndex()?c:null,m=f?o:h,p=an(an({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return L.createElement(He,Cf({ref:function(y){y&&!a.sectorRefs.includes(y)&&a.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},vi(a.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),L.createElement(Wh,Cf({option:m,isActive:f,shapeType:"sector"},p)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.sectors,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state,h=f.prevSectors,m=f.prevIsAnimationActive;return L.createElement(Dr,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(m),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(p){var g=p.t,y=[],v=i&&i[0],w=v.startAngle;return i.forEach(function(b,j){var N=h&&h[j],S=j>0?Ua(b,"paddingAngle",0):0;if(N){var C=yt(N.endAngle-N.startAngle,b.endAngle-b.startAngle),_=an(an({},b),{},{startAngle:w+S,endAngle:w+C(g)+S});y.push(_),w=_.endAngle}else{var E=b.endAngle,T=b.startAngle,P=yt(0,E-T),k=P(g),D=an(an({},b),{},{startAngle:w+S,endAngle:w+k+S});y.push(D),w=D.endAngle}}),L.createElement(He,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,i=r.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!xi(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,i=a.hide,o=a.sectors,l=a.className,c=a.label,u=a.cx,d=a.cy,f=a.innerRadius,h=a.outerRadius,m=a.isAnimationActive,p=this.state.isAnimationFinished;if(i||!o||!o.length||!Ee(u)||!Ee(d)||!Ee(f)||!Ee(h))return null;var g=Ge("recharts-pie",l);return L.createElement(He,{tabIndex:this.props.rootTabIndex,className:g,ref:function(v){r.pieRef=v}},this.renderSectors(),c&&this.renderLabels(o),jr.renderCallByParent(this.props,null,!1),(!m||p)&&ma.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,a,i){if(L.isValidElement(r))return L.cloneElement(r,a);if(ze(r))return r(a);var o=Ge("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return L.createElement(kc,Cf({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(r,a,i){if(L.isValidElement(r))return L.cloneElement(r,a);var o=i;if(ze(r)&&(o=r(a),L.isValidElement(o)))return o;var l=Ge("recharts-pie-label-text",typeof r!="boolean"&&!ze(r)?r.className:"");return L.createElement(jd,Cf({},a,{alignmentBaseline:"middle",className:l}),o)}}])}(x.PureComponent);Pb=cs;Ns(cs,"displayName","Pie");Ns(cs,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Tr.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Ns(cs,"parseDeltaAngle",function(e,t){var n=Nr(t-e),r=Math.min(Math.abs(t-e),360);return n*r});Ns(cs,"getRealPieData",function(e){var t=e.data,n=e.children,r=Me(e,!1),a=Or(n,Pa);return t&&t.length?t.map(function(i,o){return an(an(an({payload:i},r),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return an(an({},r),i.props)}):[]});Ns(cs,"parseCoordinateOfPie",function(e,t){var n=t.top,r=t.left,a=t.width,i=t.height,o=AQ(a,i),l=r+oa(e.cx,a,a/2),c=n+oa(e.cy,i,i/2),u=oa(e.innerRadius,o,0),d=oa(e.outerRadius,o,o*.8),f=e.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:f}});Ns(cs,"getComposedData",function(e){var t=e.item,n=e.offset,r=t.type.defaultProps!==void 0?an(an({},t.type.defaultProps),t.props):t.props,a=Pb.getRealPieData(r);if(!a||!a.length)return null;var i=r.cornerRadius,o=r.startAngle,l=r.endAngle,c=r.paddingAngle,u=r.dataKey,d=r.nameKey,f=r.valueKey,h=r.tooltipType,m=Math.abs(r.minAngle),p=Pb.parseCoordinateOfPie(r,n),g=Pb.parseDeltaAngle(o,l),y=Math.abs(g),v=u;Ke(u)&&Ke(f)?(oi(!1,`Use "dataKey" to specify the value of pie,
909      the props "valueKey" will be deprecated in 1.1.0`),v="value"):Ke(u)&&(oi(!1,`Use "dataKey" to specify the value of pie,
910      the props "valueKey" will be deprecated in 1.1.0`),v=f);var w=a.filter(function(_){return Ot(_,v,0)!==0}).length,b=(y>=360?w:w-1)*c,j=y-w*m-b,N=a.reduce(function(_,E){var T=Ot(E,v,0);return _+(Ee(T)?T:0)},0),S;if(N>0){var C;S=a.map(function(_,E){var T=Ot(_,v,0),P=Ot(_,d,E),k=(Ee(T)?T:0)/N,D;E?D=C.endAngle+Nr(g)*c*(T!==0?1:0):D=o;var A=D+Nr(g)*((T!==0?m:0)+k*j),I=(D+A)/2,M=(p.innerRadius+p.outerRadius)/2,$=[{name:P,value:T,payload:_,dataKey:v,type:h}],R=It(p.cx,p.cy,M,I);return C=an(an(an({percent:k,cornerRadius:i,name:P,tooltipPayload:$,midAngle:I,middleRadius:M,tooltipPosition:R},_),p),{},{value:Ot(_,v),startAngle:D,endAngle:A,payload:_,paddingAngle:Nr(g)*c}),C})}return an(an({},p),{},{sectors:S,data:a})});function vqe(e){return e&&e.length?e[0]:void 0}var xqe=vqe,bqe=xqe;const wqe=$t(bqe);var jqe=["key"];function Hh(e){"@babel/helpers - typeof";return Hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Hh(e)}function Nqe(e,t){if(e==null)return{};var n=Sqe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sqe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ow(){return Ow=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ow.apply(this,arguments)}function m5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function na(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?m5(Object(n),!0).forEach(function(r){To(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Cqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function p5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nJ(r.key),r)}}function _qe(e,t,n){return t&&p5(e.prototype,t),n&&p5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Eqe(e,t,n){return t=Tw(t),Aqe(e,tJ()?Reflect.construct(t,n||[],Tw(e).constructor):t.apply(e,n))}function Aqe(e,t){if(t&&(Hh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pqe(e)}function Pqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tJ=function(){return!!e})()}function Tw(e){return Tw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Tw(e)}function kqe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gA(e,t)}function gA(e,t){return gA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},gA(e,t)}function To(e,t,n){return t=nJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nJ(e){var t=Oqe(e,"string");return Hh(t)=="symbol"?t:t+""}function Oqe(e,t){if(Hh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vv=function(e){function t(){var n;Cqe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Eqe(this,t,[].concat(a)),To(n,"state",{isAnimationFinished:!1}),To(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ze(o)&&o()}),To(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ze(o)&&o()}),To(n,"handleMouseEnter",function(o){var l=n.props.onMouseEnter;l&&l(n.props,o)}),To(n,"handleMouseLeave",function(o){var l=n.props.onMouseLeave;l&&l(n.props,o)}),n}return kqe(t,e),_qe(t,[{key:"renderDots",value:function(r){var a=this.props,i=a.dot,o=a.dataKey,l=Me(this.props,!1),c=Me(i,!0),u=r.map(function(d,f){var h=na(na(na({key:"dot-".concat(f),r:3},l),c),{},{dataKey:o,cx:d.x,cy:d.y,index:f,payload:d});return t.renderDotItem(i,h)});return L.createElement(He,{className:"recharts-radar-dots"},u)}},{key:"renderPolygonStatically",value:function(r){var a=this.props,i=a.shape,o=a.dot,l=a.isRange,c=a.baseLinePoints,u=a.connectNulls,d;return L.isValidElement(i)?d=L.cloneElement(i,na(na({},this.props),{},{points:r})):ze(i)?d=i(na(na({},this.props),{},{points:r})):d=L.createElement(lM,Ow({},Me(this.props,!0),{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave,points:r,baseLinePoints:l?c:null,connectNulls:u})),L.createElement(He,{className:"recharts-radar-polygon"},d,o?this.renderDots(r):null)}},{key:"renderPolygonWithAnimation",value:function(){var r=this,a=this.props,i=a.points,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state.prevPoints;return L.createElement(Dr,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"radar-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var m=h.t,p=f&&f.length/i.length,g=i.map(function(y,v){var w=f&&f[Math.floor(v*p)];if(w){var b=yt(w.x,y.x),j=yt(w.y,y.y);return na(na({},y),{},{x:b(m),y:j(m)})}var N=yt(y.cx,y.x),S=yt(y.cy,y.y);return na(na({},y),{},{x:N(m),y:S(m)})});return r.renderPolygonStatically(g)})}},{key:"renderPolygon",value:function(){var r=this.props,a=r.points,i=r.isAnimationActive,o=r.isRange,l=this.state.prevPoints;return i&&a&&a.length&&!o&&(!l||!xi(l,a))?this.renderPolygonWithAnimation():this.renderPolygonStatically(a)}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.className,o=r.points,l=r.isAnimationActive;if(a||!o||!o.length)return null;var c=this.state.isAnimationFinished,u=Ge("recharts-radar",i);return L.createElement(He,{className:u},this.renderPolygon(),(!l||c)&&ma.renderCallByParent(this.props,o))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"renderDotItem",value:function(r,a){var i;if(L.isValidElement(r))i=L.cloneElement(r,a);else if(ze(r))i=r(a);else{var o=a.key,l=Nqe(a,jqe);i=L.createElement(Hm,Ow({},l,{key:o,className:Ge("recharts-radar-dot",typeof r!="boolean"?r.className:"")}))}return i}}])}
vendor: 160,236 bytes, lines 910-915
910(x.PureComponent);To(Vv,"displayName","Radar");To(Vv,"defaultProps",{angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendType:"rect",isAnimationActive:!Tr.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});To(Vv,"getComposedData",function(e){var t=e.radiusAxis,n=e.angleAxis,r=e.displayedData,a=e.dataKey,i=e.bandSize,o=n.cx,l=n.cy,c=!1,u=[],d=n.type!=="number"?i??0:0;r.forEach(function(h,m){var p=Ot(h,n.dataKey,m),g=Ot(h,a),y=n.scale(p)+d,v=Array.isArray(g)?TQ(g):g,w=Ke(v)?void 0:t.scale(v);Array.isArray(g)&&g.length>=2&&(c=!0),u.push(na(na({},It(o,l,w,y)),{},{name:p,value:g,cx:o,cy:l,radius:w,angle:y,payload:h}))});var f=[];return c&&u.forEach(function(h){if(Array.isArray(h.value)){var m=wqe(h.value),p=Ke(m)?void 0:t.scale(m);f.push(na(na({},h),{},{radius:p},It(o,l,p,h.angle)))}else f.push(h)}),{points:u,isRange:c,baseLinePoints:f}});function Dy(e){"@babel/helpers - typeof";return Dy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dy(e)}function yA(){return yA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yA.apply(this,arguments)}function g5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function EC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?g5(Object(n),!0).forEach(function(r){Tqe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):g5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Tqe(e,t,n){return t=Mqe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mqe(e){var t=Rqe(e,"string");return Dy(t)=="symbol"?t:t+""}function Rqe(e,t){if(Dy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Dy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function y5(e){return typeof e=="string"?parseInt(e,10):e}function Dqe(e,t){var n="".concat(t.cx||e.cx),r=Number(n),a="".concat(t.cy||e.cy),i=Number(a);return EC(EC(EC({},t),e),{},{cx:r,cy:i})}function v5(e){return L.createElement(Wh,yA({shapeType:"sector",propTransformer:Dqe},e))}var $qe=["shape","activeShape","activeIndex","cornerRadius"],Iqe=["value","background"];function Kh(e){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kh(e)}function Mw(){return Mw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Mw.apply(this,arguments)}function x5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function pr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?x5(Object(n),!0).forEach(function(r){Xu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function b5(e,t){if(e==null)return{};var n=Lqe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lqe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Fqe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function w5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,aJ(r.key),r)}}function Bqe(e,t,n){return t&&w5(e.prototype,t),n&&w5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function zqe(e,t,n){return t=Rw(t),Uqe(e,rJ()?Reflect.construct(t,n||[],Rw(e).constructor):t.apply(e,n))}function Uqe(e,t){if(t&&(Kh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Vqe(e)}function Vqe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rJ=function(){return!!e})()}function Rw(e){return Rw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Rw(e)}function Wqe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vA(e,t)}function vA(e,t){return vA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},vA(e,t)}function Xu(e,t,n){return t=aJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aJ(e){var t=qqe(e,"string");return Kh(t)=="symbol"?t:t+""}function qqe(e,t){if(Kh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Kh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Wv=function(e){function t(){var n;Fqe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=zqe(this,t,[].concat(a)),Xu(n,"state",{isAnimationFinished:!1}),Xu(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ze(o)&&o()}),Xu(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ze(o)&&o()}),n}return Wqe(t,e),Bqe(t,[{key:"getDeltaAngle",value:function(){var r=this.props,a=r.startAngle,i=r.endAngle,o=Nr(i-a),l=Math.min(Math.abs(i-a),360);return o*l}},{key:"renderSectorsStatically",value:function(r){var a=this,i=this.props,o=i.shape,l=i.activeShape,c=i.activeIndex,u=i.cornerRadius,d=b5(i,$qe),f=Me(d,!1);return r.map(function(h,m){var p=m===c,g=pr(pr(pr(pr({},f),{},{cornerRadius:y5(u)},h),vi(a.props,h,m)),{},{className:"recharts-radial-bar-sector ".concat(h.className),forceCornerRadius:d.forceCornerRadius,cornerIsExternal:d.cornerIsExternal,isActive:p,option:p?l:o});return L.createElement(v5,Mw({},g,{key:"sector-".concat(m)}))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state.prevData;return L.createElement(Dr,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"radialBar-".concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(h){var m=h.t,p=i.map(function(g,y){var v=f&&f[y];if(v){var w=yt(v.startAngle,g.startAngle),b=yt(v.endAngle,g.endAngle);return pr(pr({},g),{},{startAngle:w(m),endAngle:b(m)})}var j=g.endAngle,N=g.startAngle,S=yt(N,j);return pr(pr({},g),{},{endAngle:S(m)})});return L.createElement(He,null,r.renderSectorsStatically(p))})}},{key:"renderSectors",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!xi(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"renderBackground",value:function(r){var a=this,i=this.props.cornerRadius,o=Me(this.props.background,!1);return r.map(function(l,c){l.value;var u=l.background,d=b5(l,Iqe);if(!u)return null;var f=pr(pr(pr(pr(pr({cornerRadius:y5(i)},d),{},{fill:"#eee"},u),o),vi(a.props,l,c)),{},{index:c,className:Ge("recharts-radial-bar-background-sector",o==null?void 0:o.className),option:u,isActive:!1});return L.createElement(v5,Mw({},f,{key:"sector-".concat(c)}))})}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.data,o=r.className,l=r.background,c=r.isAnimationActive;if(a||!i||!i.length)return null;var u=this.state.isAnimationFinished,d=Ge("recharts-area",o);return L.createElement(He,{className:d},l&&L.createElement(He,{className:"recharts-radial-bar-background"},this.renderBackground(i)),L.createElement(He,{className:"recharts-radial-bar-sectors"},this.renderSectors()),(!c||u)&&ma.renderCallByParent(pr({},this.props),i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])}(x.PureComponent);Xu(Wv,"displayName","RadialBar");Xu(Wv,"defaultProps",{angleAxisId:0,radiusAxisId:0,minPointSize:0,hide:!1,legendType:"rect",data:[],isAnimationActive:!Tr.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease",forceCornerRadius:!1,cornerIsExternal:!1});Xu(Wv,"getComposedData",function(e){var t=e.item,n=e.props,r=e.radiusAxis,a=e.radiusAxisTicks,i=e.angleAxis,o=e.angleAxisTicks,l=e.displayedData,c=e.dataKey,u=e.stackedData,d=e.barPosition,f=e.bandSize,h=e.dataStartIndex,m=jQ(d,t);if(!m)return null;var p=i.cx,g=i.cy,y=n.layout,v=t.props,w=v.children,b=v.minPointSize,j=y==="radial"?i:r,N=u?j.scale.domain():null,S=CQ({numericAxis:j}),C=Or(w,Pa),_=l.map(function(E,T){var P,k,D,A,I,M;if(u?P=NQ(u[h+T],N):(P=Ot(E,c),Array.isArray(P)||(P=[S,P])),y==="radial"){k=vw({axis:r,ticks:a,bandSize:f,offset:m.offset,entry:E,index:T}),I=i.scale(P[1]),A=i.scale(P[0]),D=k+m.size;var $=I-A;if(Math.abs(b)>0&&Math.abs($)<Math.abs(b)){var R=Nr($||b)*(Math.abs(b)-Math.abs($));I+=R}M={background:{cx:p,cy:g,innerRadius:k,outerRadius:D,startAngle:n.startAngle,endAngle:n.endAngle}}}else{k=r.scale(P[0]),D=r.scale(P[1]),A=vw({axis:i,ticks:o,bandSize:f,offset:m.offset,entry:E,index:T}),I=A+m.size;var O=D-k;if(Math.abs(b)>0&&Math.abs(O)<Math.abs(b)){var F=Nr(O||b)*(Math.abs(b)-Math.abs(O));D+=F}}return pr(pr(pr(pr({},E),M),{},{payload:E,value:u?P:P[1],cx:p,cy:g,innerRadius:k,outerRadius:D,startAngle:A,endAngle:I},C&&C[T]&&C[T].props),{},{tooltipPayload:[iM(t,E)],tooltipPosition:It(p,g,(k+D)/2,(A+I)/2)})});return{data:_,layout:y}});var Hqe=Math.ceil,Kqe=Math.max;function Gqe(e,t,n,r){for(var a=-1,i=Kqe(Hqe((t-e)/(n||1)),0),o=Array(i);i--;)o[r?i:++a]=e,e+=n;return o}var Yqe=Gqe,Xqe=gX,j5=1/0,Qqe=17976931348623157e292;function Jqe(e){if(!e)return e===0?e:0;if(e=Xqe(e),e===j5||e===-j5){var t=e<0?-1:1;return t*Qqe}return e===e?e:0}var sJ=Jqe,Zqe=Yqe,eHe=mN,AC=sJ;function tHe(e){return function(t,n,r){return r&&typeof r!="number"&&eHe(t,n,r)&&(n=r=void 0),t=AC(t),n===void 0?(n=t,t=0):n=AC(n),r=r===void 0?t<n?1:-1:AC(r),Zqe(t,n,r,e)}}var nHe=tHe,rHe=nHe,aHe=rHe(),sHe=aHe;const Dw=$t(sHe);function $y(e){"@babel/helpers - typeof";return $y=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$y(e)}function N5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function S5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?N5(Object(n),!0).forEach(function(r){iJ(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function iJ(e,t,n){return t=iHe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iHe(e){var t=oHe(e,"string");return $y(t)=="symbol"?t:t+""}function oHe(e,t){if($y(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if($y(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lHe=["Webkit","Moz","O","ms"],cHe=function(t,n){var r=t.replace(/(\w)/,function(i){return i.toUpperCase()}),a=lHe.reduce(function(i,o){return S5(S5({},i),{},iJ({},o+r,n))},{});return a[t]=n,a};function Gh(e){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gh(e)}function $w(){return $w=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$w.apply(this,arguments)}function C5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function PC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?C5(Object(n),!0).forEach(function(r){Qa(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function uHe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lJ(r.key),r)}}function dHe(e,t,n){return t&&_5(e.prototype,t),n&&_5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fHe(e,t,n){return t=Iw(t),hHe(e,oJ()?Reflect.construct(t,n||[],Iw(e).constructor):t.apply(e,n))}function hHe(e,t){if(t&&(Gh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mHe(e)}function mHe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(oJ=function(){return!!e})()}function Iw(e){return Iw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Iw(e)}function pHe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xA(e,t)}function xA(e,t){return xA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},xA(e,t)}function Qa(e,t,n){return t=lJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lJ(e){var t=gHe(e,"string");return Gh(t)=="symbol"?t:t+""}function gHe(e,t){if(Gh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Gh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yHe=function(t){var n=t.data,r=t.startIndex,a=t.endIndex,i=t.x,o=t.width,l=t.travellerWidth;if(!n||!n.length)return{};var c=n.length,u=og().domain(Dw(0,c)).range([i,i+o-l]),d=u.domain().map(function(f){return u(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(r),endX:u(a),scale:u,scaleValues:d}},E5=function(t){return t.changedTouches&&!!t.changedTouches.length},Cd=function(e){function t(n){var r;return uHe(this,t),r=fHe(this,t,[n]),Qa(r,"handleDrag",function(a){r.leaveTimer&&(clearTimeout(r.leaveTimer),r.leaveTimer=null),r.state.isTravellerMoving?r.handleTravellerMove(a):r.state.isSlideMoving&&r.handleSlideDrag(a)}),Qa(r,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&r.handleDrag(a.changedTouches[0])}),Qa(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),r.detachDragEndListener()}),Qa(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Qa(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Qa(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Qa(r,"handleSlideDragStart",function(a){var i=E5(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return pHe(t,e),dHe(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,i=r.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,f=Math.min(a,i),h=Math.max(a,i),m=t.getIndexInRange(o,f),p=t.getIndexInRange(o,h);return{startIndex:m-m%c,endIndex:p===d?d:p-p%c}}},{key:"getTextOfTick",value:function(r){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,c=Ot(i[r],l,r);return ze(o)?o(c,r):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,c=this.props,u=c.x,d=c.width,f=c.travellerWidth,h=c.startIndex,m=c.endIndex,p=c.onChange,g=r.pageX-i;g>0?g=Math.min(g,u+d-f-l,u+d-f-o):g<0&&(g=Math.max(g,u-o,u-l));var y=this.getIndex({startX:o+g,endX:l+g});(y.startIndex!==h||y.endIndex!==m)&&p&&p(y),this.setState({startX:o+g,endX:l+g,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var i=E5(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,c=a.startX,u=this.state[o],d=this.props,f=d.x,h=d.width,m=d.travellerWidth,p=d.onChange,g=d.gap,y=d.data,v={startX:this.state.startX,endX:this.state.endX},w=r.pageX-i;w>0?w=Math.min(w,f+h-m-u):w<0&&(w=Math.max(w,f-u)),v[o]=u+w;var b=this.getIndex(v),j=b.startIndex,N=b.endIndex,S=function(){var _=y.length-1;return o==="startX"&&(l>c?j%g===0:N%g===0)||l<c&&N===_||o==="endX"&&(l>c?N%g===0:j%g===0)||l>c&&N===_};this.setState(Qa(Qa({},o,u+w),"brushMoveStartX",r.pageX),function(){p&&S()&&p(b)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var i=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[a],f=l.indexOf(d);if(f!==-1){var h=f+r;if(!(h===-1||h>=l.length)){var m=l[h];a==="startX"&&m>=u||a==="endX"&&m<=c||this.setState(Qa({},a,m),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,c=r.fill,u=r.stroke;return L.createElement("rect",{stroke:u,fill:c,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,c=r.data,u=r.children,d=r.padding,f=x.Children.only(u);return f?L.cloneElement(f,{x:a,y:i,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(r,a){var i,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,f=c.height,h=c.traveller,m=c.ariaLabel,p=c.data,g=c.startIndex,y=c.endIndex,v=Math.max(r,this.props.x),w=PC(PC({},Me(this.props,!1)),{},{x:v,y:u,width:d,height:f}),b=m||"Min value: ".concat((i=p[g])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=p[y])===null||o===void 0?void 0:o.name);return L.createElement(He,{tabIndex:0,role:"slider","aria-label":b,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(N){["ArrowLeft","ArrowRight"].includes(N.key)&&(N.preventDefault(),N.stopPropagation(),l.handleTravellerMoveKeyboard(N.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(h,w))}},{key:"renderSlide",value:function(r,a){var i=this.props,o=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(r,a)+u,f=Math.max(Math.abs(a-r)-u,0);return L.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:f,height:l})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,i=r.endIndex,o=r.y,l=r.height,c=r.travellerWidth,u=r.stroke,d=this.state,f=d.startX,h=d.endX,m=5,p={pointerEvents:"none",fill:u};return L.createElement(He,{className:"recharts-brush-texts"},L.createElement(jd,$w({textAnchor:"end",verticalAnchor:"middle",x:Math.min(f,h)-m,y:o+l/2},p),this.getTextOfTick(a)),L.createElement(jd,$w({textAnchor:"start",verticalAnchor:"middle",x:Math.max(f,h)+c+m,y:o+l/2},p),this.getTextOfTick(i)))}},{key:"render",value:function(){var r=this.props,a=r.data,i=r.className,o=r.children,l=r.x,c=r.y,u=r.width,d=r.height,f=r.alwaysShowText,h=this.state,m=h.startX,p=h.endX,g=h.isTextActive,y=h.isSlideMoving,v=h.isTravellerMoving,w=h.isTravellerFocused;if(!a||!a.length||!Ee(l)||!Ee(c)||!Ee(u)||!Ee(d)||u<=0||d<=0)return null;var b=Ge("recharts-brush",i),j=L.Children.count(o)===1,N=cHe("userSelect","none");return L.createElement(He,{className:b,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:N},this.renderBackground(),j&&this.renderPanorama(),this.renderSlide(m,p),this.renderTravellerLayer(m,"startX"),this.renderTravellerLayer(p,"endX"),(g||y||v||w||f)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,i=r.y,o=r.width,l=r.height,c=r.stroke,u=Math.floor(i+l/2)-1;return L.createElement(L.Fragment,null,L.createElement("rect",{x:a,y:i,width:o,height:l,fill:c,stroke:"none"}),L.createElement("line",{x1:a+1,y1:u,x2:a+o-1,y2:u,fill:"none",stroke:"#fff"}),L.createElement("line",{x1:a+1,y1:u+2,x2:a+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var i;return L.isValidElement(r)?i=L.cloneElement(r,a):ze(r)?i=r(a):i=t.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(r,a){var i=r.data,o=r.width,l=r.x,c=r.travellerWidth,u=r.updateId,d=r.startIndex,f=r.endIndex;if(i!==a.prevData||u!==a.prevUpdateId)return PC({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?yHe({data:i,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:f}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||c!==a.prevTravellerWidth)){a.scale.range([l,l+o-c]);var h=a.scale.domain().map(function(m){return a.scale(m)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:h}}return null}},{key:"getIndexInRange",value:function(r,a){for(var i=r.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);r[c]>a?l=c:o=c}return a>=r[l]?l:o}}])}(x.PureComponent);Qa(Cd,"displayName","Brush");Qa(Cd,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var vHe=DT;function xHe(e,t){var n;return vHe(e,function(r,a,i){return n=t(r,a,i),!n}),!!n}var bHe=xHe,wHe=BY,jHe=po,NHe=bHe,SHe=ba,CHe=mN;function _He(e,t,n){var r=SHe(e)?wHe:NHe;return n&&CHe(e,t,n)&&(t=void 0),r(e,jHe(t))}var EHe=_He;const AHe=$t(EHe);var Ji=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},A5=uX;function PHe(e,t,n){t=="__proto__"&&A5?A5(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var uM=PHe,kHe=uM,OHe=oX,THe=po;function MHe(e,t){var n={};return t=THe(t),OHe(e,function(r,a,i){kHe(n,a,t(r,a,i))}),n}var RHe=MHe;const DHe=$t(RHe);function $He(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}var IHe=$He,LHe=DT;function FHe(e,t){var n=!0;return LHe(e,function(r,a,i){return n=!!t(r,a,i),n}),n}var BHe=FHe,zHe=IHe,UHe=BHe,VHe=po,WHe=ba,qHe=mN;function HHe(e,t,n){var r=WHe(e)?zHe:UHe;return n&&qHe(e,t,n)&&(t=void 0),r(e,VHe(t))}var KHe=HHe;const cJ=$t(KHe);var GHe=["x","y"];function Iy(e){"@babel/helpers - typeof";return Iy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Iy(e)}function bA(){return bA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bA.apply(this,arguments)}function P5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function jp(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?P5(Object(n),!0).forEach(function(r){YHe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YHe(e,t,n){return t=XHe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XHe(e){var t=QHe(e,"string");return Iy(t)=="symbol"?t:t+""}function QHe(e,t){if(Iy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Iy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function JHe(e,t){if(e==null)return{};var n=ZHe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZHe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function eKe(e,t){var n=e.x,r=e.y,a=JHe(e,GHe),i="".concat(n),o=parseInt(i,10),l="".concat(r),c=parseInt(l,10),u="".concat(t.height||a.height),d=parseInt(u,10),f="".concat(t.width||a.width),h=parseInt(f,10);return jp(jp(jp(jp(jp({},t),a),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:h,name:t.name,radius:t.radius})}function k5(e){return L.createElement(Wh,bA({shapeType:"rectangle",propTransformer:eKe,activeClassName:"recharts-active-bar"},e))}var tKe=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var i=Ee(r)||RTe(r);return i?t(r,a):(i||Sd(),n)}},nKe=["value","background"],uJ;function Yh(e){"@babel/helpers - typeof";return Yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yh(e)}function rKe(e,t){if(e==null)return{};var n=aKe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aKe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Lw(){return Lw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lw.apply(this,arguments)}function O5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Kn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?O5(Object(n),!0).forEach(function(r){gc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fJ(r.key),r)}}function iKe(e,t,n){return t&&T5(e.prototype,t),n&&T5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oKe(e,t,n){return t=Fw(t),lKe(e,dJ()?Reflect.construct(t,n||[],Fw(e).constructor):t.apply(e,n))}function lKe(e,t){if(t&&(Yh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return cKe(e)}function cKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dJ=function(){return!!e})()}function Fw(e){return Fw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fw(e)}function uKe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wA(e,t)}function wA(e,t){return wA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},wA(e,t)}function gc(e,t,n){return t=fJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fJ(e){var t=dKe(e,"string");return Yh(t)=="symbol"?t:t+""}function dKe(e,t){if(Yh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Yh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gr=function(e){function t(){var n;sKe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=oKe(this,t,[].concat(a)),gc(n,"state",{isAnimationFinished:!1}),gc(n,"id",Al("recharts-bar-")),gc(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),o&&o()}),gc(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),o&&o()}),n}return uKe(t,e),iKe(t,[{key:"renderRectanglesStatically",value:function(r){var a=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,d=Me(this.props,!1);return r&&r.map(function(f,h){var m=h===c,p=m?u:o,g=Kn(Kn(Kn({},d),f),{},{isActive:m,option:p,index:h,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return L.createElement(He,Lw({className:"recharts-bar-rectangle"},vi(a.props,f,h),{key:"rectangle-".concat(f==null?void 0:f.x,"-").concat(f==null?void 0:f.y,"-").concat(f==null?void 0:f.value,"-").concat(h)}),L.createElement(k5,g))})}},{key:"renderRectanglesWithAnimation",value:function(){var r=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,c=a.animationBegin,u=a.animationDuration,d=a.animationEasing,f=a.animationId,h=this.state.prevData;return L.createElement(Dr,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(f),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(m){var p=m.t,g=i.map(function(y,v){var w=h&&h[v];if(w){var b=yt(w.x,y.x),j=yt(w.y,y.y),N=yt(w.width,y.width),S=yt(w.height,y.height);return Kn(Kn({},y),{},{x:b(p),y:j(p),width:N(p),height:S(p)})}if(o==="horizontal"){var C=yt(0,y.height),_=C(p);return Kn(Kn({},y),{},{y:y.y+y.height-_,height:_})}var E=yt(0,y.width),T=E(p);return Kn(Kn({},y),{},{width:T})});return L.createElement(He,null,r.renderRectanglesStatically(g))})}},{key:"renderRectangles",value:function(){var r=this.props,a=r.data,i=r.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!xi(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var r=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,c=Me(this.props.background,!1);return i.map(function(u,d){u.value;var f=u.background,h=rKe(u,nKe);if(!f)return null;var m=Kn(Kn(Kn(Kn(Kn({},h),{},{fill:"#eee"},f),c),vi(r.props,u,d)),{},{onAnimationStart:r.handleAnimationStart,onAnimationEnd:r.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return L.createElement(k5,Lw({key:"background-bar-".concat(d),option:r.props.background,isActive:d===l},m))})}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=Or(d,qm);if(!f)return null;var h=u==="vertical"?o[0].height/2:o[0].width/2,m=function(y,v){var w=Array.isArray(y.value)?y.value[1]:y.value;return{x:y.x,y:y.y,value:w,errorVal:Ot(y,v)}},p={clipPath:r?"url(#clipPath-".concat(a,")"):null};return L.createElement(He,p,f.map(function(g){return L.cloneElement(g,{key:"error-bar-".concat(a,"-").concat(g.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:h,dataPointFormatter:m})}))}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.data,o=r.className,l=r.xAxis,c=r.yAxis,u=r.left,d=r.top,f=r.width,h=r.height,m=r.isAnimationActive,p=r.background,g=r.id;if(a||!i||!i.length)return null;var y=this.state.isAnimationFinished,v=Ge("recharts-bar",o),w=l&&l.allowDataOverflow,b=c&&c.allowDataOverflow,j=w||b,N=Ke(g)?this.id:g;return L.createElement(He,{className:v},w||b?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(N)},L.createElement("rect",{x:w?u:u-f/2,y:b?d:d-h/2,width:w?f:f*2,height:b?h:h*2}))):null,L.createElement(He,{className:"recharts-bar-rectangles",clipPath:j?"url(#clipPath-".concat(N,")"):null},p?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(j,N),(!m||y)&&ma.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curData:r.data,prevData:a.curData}:r.data!==a.curData?{curData:r.data}:null}}])}(x.PureComponent);uJ=Gr;gc(Gr,"displayName","Bar");gc(Gr,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Tr.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});gc(Gr,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,i=e.xAxis,o=e.yAxis,l=e.xAxisTicks,c=e.yAxisTicks,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,m=jQ(r,n);if(!m)return null;var p=t.layout,g=n.type.defaultProps,y=g!==void 0?Kn(Kn({},g),n.props):n.props,v=y.dataKey,w=y.children,b=y.minPointSize,j=p==="horizontal"?o:i,N=u?j.scale.domain():null,S=CQ({numericAxis:j}),C=Or(w,Pa),_=f.map(function(E,T){var P,k,D,A,I,M;u?P=NQ(u[d+T],N):(P=Ot(E,v),Array.isArray(P)||(P=[S,P]));var $=tKe(b,uJ.defaultProps.minPointSize)(P[1],T);if(p==="horizontal"){var R,O=[o.scale(P[0]),o.scale(P[1])],F=O[0],z=O[1];k=vw({axis:i,ticks:l,bandSize:a,offset:m.offset,entry:E,index:T}),D=(R=z??F)!==null&&R!==void 0?R:void 0,A=m.size;var B=F-z;if(I=Number.isNaN(B)?0:B,M={x:k,y:o.y,width:A,height:o.height},Math.abs($)>0&&Math.abs(I)<Math.abs($)){var H=Nr(I||$)*(Math.abs($)-Math.abs(I));D-=H,I+=H}}else{var Y=[i.scale(P[0]),i.scale(P[1])],ee=Y[0],V=Y[1];if(k=ee,D=vw({axis:o,ticks:c,bandSize:a,offset:m.offset,entry:E,index:T}),A=V-ee,I=m.size,M={x:i.x,y:D,width:i.width,height:I},Math.abs($)>0&&Math.abs(A)<Math.abs($)){var K=Nr(A||$)*(Math.abs($)-Math.abs(A));A+=K}}return Kn(Kn(Kn({},E),{},{x:k,y:D,width:A,height:I,value:u?P:P[1],payload:E,background:M},C&&C[T]&&C[T].props),{},{tooltipPayload:[iM(n,E)],tooltipPosition:{x:k+A/2,y:D+I/2}})});return Kn({data:_,layout:p},h)});function Ly(e){"@babel/helpers - typeof";return Ly=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ly(e)}function fKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function M5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hJ(r.key),r)}}function hKe(e,t,n){return t&&M5(e.prototype,t),n&&M5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function R5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ks(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?R5(Object(n),!0).forEach(function(r){kN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):R5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kN(e,t,n){return t=hJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hJ(e){var t=mKe(e,"string");return Ly(t)=="symbol"?t:t+""}function mKe(e,t){if(Ly(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ly(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qv=function(t,n,r,a,i){var o=t.width,l=t.height,c=t.layout,u=t.children,d=Object.keys(n),f={left:r.left,leftMirror:r.left,right:o-r.right,rightMirror:o-r.right,top:r.top,topMirror:r.top,bottom:l-r.bottom,bottomMirror:l-r.bottom},h=!!Vr(u,Gr);return d.reduce(function(m,p){var g=n[p],y=g.orientation,v=g.domain,w=g.padding,b=w===void 0?{}:w,j=g.mirror,N=g.reversed,S="".concat(y).concat(j?"Mirror":""),C,_,E,T,P;if(g.type==="number"&&(g.padding==="gap"||g.padding==="no-gap")){var k=v[1]-v[0],D=1/0,A=g.categoricalDomain.sort(LTe);if(A.forEach(function(Y,ee){ee>0&&(D=Math.min((Y||0)-(A[ee-1]||0),D))}),Number.isFinite(D)){var I=D/k,M=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(C=I*M/2),g.padding==="no-gap"){var $=oa(t.barCategoryGap,I*M),R=I*M/2;C=R-$-(R-$)/M*$}}}a==="xAxis"?_=[r.left+(b.left||0)+(C||0),r.left+r.width-(b.right||0)-(C||0)]:a==="yAxis"?_=c==="horizontal"?[r.top+r.height-(b.bottom||0),r.top+(b.top||0)]:[r.top+(b.top||0)+(C||0),r.top+r.height-(b.bottom||0)-(C||0)]:_=g.range,N&&(_=[_[1],_[0]]);var O=bQ(g,i,h),F=O.scale,z=O.realScaleType;F.domain(v).range(_),wQ(F);var B=SQ(F,Ks(Ks({},g),{},{realScaleType:z}));a==="xAxis"?(P=y==="top"&&!j||y==="bottom"&&j,E=r.left,T=f[S]-P*g.height):a==="yAxis"&&(P=y==="left"&&!j||y==="right"&&j,E=f[S]-P*g.width,T=r.top);var H=Ks(Ks(Ks({},g),B),{},{realScaleType:z,x:E,y:T,scale:F,width:a==="xAxis"?r.width:g.width,height:a==="yAxis"?r.height:g.height});return H.bandSize=xw(H,B),!g.hide&&a==="xAxis"?f[S]+=(P?-1:1)*H.height:g.hide||(f[S]+=(P?-1:1)*H.width),Ks(Ks({},m),{},kN({},p,H))},{})},mJ=function(t,n){var r=t.x,a=t.y,i=n.x,o=n.y;return{x:Math.min(r,i),y:Math.min(a,o),width:Math.abs(i-r),height:Math.abs(o-a)}},pKe=function(t){var n=t.x1,r=t.y1,a=t.x2,i=t.y2;return mJ({x:n,y:r},{x:a,y:i})},pJ=function(){function e(t){fKe(this,e),this.scale=t}return hKe(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(n)+l}default:return this.scale(n)}if(a){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+c}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],i=r[r.length-1];return a<=i?n>=a&&n<=i:n>=i&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])}();kN(pJ,"EPS",1e-4);var dM=function(t){var n=Object.keys(t).reduce(function(r,a){return Ks(Ks({},r),{},kN({},a,pJ.create(t[a])))},{});return Ks(Ks({},n),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return DHe(a,function(c,u){return n[u].apply(c,{bandAware:o,position:l})})},isInRange:function(a){return cJ(a,function(i,o){return n[o].isInRange(i)})}})};function gKe(e){return(e%180+180)%180}var yKe=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=gKe(a),o=i*Math.PI/180,l=Math.atan(r/n),c=o>l&&o<Math.PI-l?r/Math.sin(o):n/Math.cos(o);return Math.abs(c)},vKe=po,xKe=Fm,bKe=Bm;function wKe(e){return function(t,n,r){var a=Object(t);if(!xKe(t)){var i=vKe(n);t=bKe(t),n=function(l){return i(a[l],l,a)}}var o=e(t,n,r);return o>-1?a[i?t[o]:o]:void 0}}var jKe=wKe,NKe=sJ;function SKe(e){var t=NKe(e),n=t%1;return t===t?n?t-n:t:0}var CKe=SKe,_Ke=nX,EKe=po,AKe=CKe,PKe=Math.max;function kKe(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:AKe(n);return a<0&&(a=PKe(r+a,0)),_Ke(e,EKe(t),a)}var OKe=kKe,TKe=jKe,MKe=OKe,RKe=TKe(MKe),DKe=RKe;const $Ke=$t(DKe);var IKe=FOe(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),fM=x.createContext(void 0),hM=x.createContext(void 0),gJ=x.createContext(void 0),yJ=x.createContext({}),vJ=x.createContext(void 0),xJ=x.createContext(0),bJ=x.createContext(0),D5=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,i=n.offset,o=t.clipPathId,l=t.children,c=t.width,u=t.height,d=IKe(i);return L.createElement(fM.Provider,{value:r},L.createElement(hM.Provider,{value:a},L.createElement(yJ.Provider,{value:i},L.createElement(gJ.Provider,{value:d},L.createElement(vJ.Provider,{value:o},L.createElement(xJ.Provider,{value:u},L.createElement(bJ.Provider,{value:c},l)))))))},LKe=function(){return x.useContext(vJ)},wJ=function(t){var n=x.useContext(fM);n==null&&Sd();var r=n[t];return r==null&&Sd(),r},FKe=function(){var t=x.useContext(fM);return ec(t)},BKe=function(){var t=x.useContext(hM),n=$Ke(t,function(r){return cJ(r.domain,Number.isFinite)});return n||ec(t)},jJ=function(t){var n=x.useContext(hM);n==null&&Sd();var r=n[t];return r==null&&Sd(),r},zKe=function(){var t=x.useContext(gJ);return t},UKe=function(){return x.useContext(yJ)},mM=function(){return x.useContext(bJ)},pM=function(){return x.useContext(xJ)};function Xh(e){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xh(e)}function VKe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function WKe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,SJ(r.key),r)}}function qKe(e,t,n){return t&&WKe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function HKe(e,t,n){return t=Bw(t),KKe(e,NJ()?Reflect.construct(t,n||[],Bw(e).constructor):t.apply(e,n))}function KKe(e,t){if(t&&(Xh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GKe(e)}function GKe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function NJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(NJ=function(){return!!e})()}function Bw(e){return Bw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bw(e)}function YKe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jA(e,t)}function jA(e,t){return jA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},jA(e,t)}function $5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function I5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?$5(Object(n),!0).forEach(function(r){gM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function gM(e,t,n){return t=SJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SJ(e){var t=XKe(e,"string");return Xh(t)=="symbol"?t:t+""}function XKe(e,t){if(Xh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Xh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function QKe(e,t){return tGe(e)||eGe(e,t)||ZKe(e,t)||JKe()}function JKe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
911In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZKe(e,t){if(e){if(typeof e=="string")return L5(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return L5(e,t)}}function L5(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function eGe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function tGe(e){if(Array.isArray(e))return e}function NA(){return NA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},NA.apply(this,arguments)}var nGe=function(t,n){var r;return L.isValidElement(t)?r=L.cloneElement(t,n):ze(t)?r=t(n):r=L.createElement("line",NA({},n,{className:"recharts-reference-line-line"})),r},rGe=function(t,n,r,a,i,o,l,c,u){var d=i.x,f=i.y,h=i.width,m=i.height;if(r){var p=u.y,g=t.y.apply(p,{position:o});if(Ji(u,"discard")&&!t.y.isInRange(g))return null;var y=[{x:d+h,y:g},{x:d,y:g}];return c==="left"?y.reverse():y}if(n){var v=u.x,w=t.x.apply(v,{position:o});if(Ji(u,"discard")&&!t.x.isInRange(w))return null;var b=[{x:w,y:f+m},{x:w,y:f}];return l==="top"?b.reverse():b}if(a){var j=u.segment,N=j.map(function(S){return t.apply(S,{position:o})});return Ji(u,"discard")&&AHe(N,function(S){return!t.isInRange(S)})?null:N}return null};function aGe(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,i=e.yAxisId,o=e.shape,l=e.className,c=e.alwaysShow,u=LKe(),d=wJ(a),f=jJ(i),h=zKe();if(!u||!h)return null;oi(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=dM({x:d.scale,y:f.scale}),p=dr(t),g=dr(n),y=r&&r.length===2,v=rGe(m,p,g,y,h,e.position,d.orientation,f.orientation,e);if(!v)return null;var w=QKe(v,2),b=w[0],j=b.x,N=b.y,S=w[1],C=S.x,_=S.y,E=Ji(e,"hidden")?"url(#".concat(u,")"):void 0,T=I5(I5({clipPath:E},Me(e,!0)),{},{x1:j,y1:N,x2:C,y2:_});return L.createElement(He,{className:Ge("recharts-reference-line",l)},nGe(o,T),jr.renderCallByParent(e,pKe({x1:j,y1:N,x2:C,y2:_})))}var yM=function(e){function t(){return VKe(this,t),HKe(this,t,arguments)}return YKe(t,e),qKe(t,[{key:"render",value:function(){return L.createElement(aGe,this.props)}}])}(L.Component);gM(yM,"displayName","ReferenceLine");gM(yM,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function SA(){return SA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},SA.apply(this,arguments)}function Qh(e){"@babel/helpers - typeof";return Qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qh(e)}function F5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function B5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?F5(Object(n),!0).forEach(function(r){ON(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iGe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_J(r.key),r)}}function oGe(e,t,n){return t&&iGe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function lGe(e,t,n){return t=zw(t),cGe(e,CJ()?Reflect.construct(t,n||[],zw(e).constructor):t.apply(e,n))}function cGe(e,t){if(t&&(Qh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return uGe(e)}function uGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function CJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(CJ=function(){return!!e})()}function zw(e){return zw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zw(e)}function dGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&CA(e,t)}function CA(e,t){return CA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},CA(e,t)}function ON(e,t,n){return t=_J(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _J(e){var t=fGe(e,"string");return Qh(t)=="symbol"?t:t+""}function fGe(e,t){if(Qh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hGe=function(t){var n=t.x,r=t.y,a=t.xAxis,i=t.yAxis,o=dM({x:a.scale,y:i.scale}),l=o.apply({x:n,y:r},{bandAware:!0});return Ji(t,"discard")&&!o.isInRange(l)?null:l},TN=function(e){function t(){return sGe(this,t),lGe(this,t,arguments)}return dGe(t,e),oGe(t,[{key:"render",value:function(){var r=this.props,a=r.x,i=r.y,o=r.r,l=r.alwaysShow,c=r.clipPathId,u=dr(a),d=dr(i);if(oi(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var f=hGe(this.props);if(!f)return null;var h=f.x,m=f.y,p=this.props,g=p.shape,y=p.className,v=Ji(this.props,"hidden")?"url(#".concat(c,")"):void 0,w=B5(B5({clipPath:v},Me(this.props,!0)),{},{cx:h,cy:m});return L.createElement(He,{className:Ge("recharts-reference-dot",y)},t.renderDot(g,w),jr.renderCallByParent(this.props,{x:h-o,y:m-o,width:2*o,height:2*o}))}}])}(L.Component);ON(TN,"displayName","ReferenceDot");ON(TN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});ON(TN,"renderDot",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):ze(e)?n=e(t):n=L.createElement(Hm,SA({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"})),n});function _A(){return _A=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_A.apply(this,arguments)}function Jh(e){"@babel/helpers - typeof";return Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jh(e)}function z5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function U5(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?z5(Object(n),!0).forEach(function(r){MN(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mGe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pGe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,AJ(r.key),r)}}function gGe(e,t,n){return t&&pGe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function yGe(e,t,n){return t=Uw(t),vGe(e,EJ()?Reflect.construct(t,n||[],Uw(e).constructor):t.apply(e,n))}function vGe(e,t){if(t&&(Jh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xGe(e)}function xGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function EJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EJ=function(){return!!e})()}function Uw(e){return Uw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Uw(e)}function bGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&EA(e,t)}function EA(e,t){return EA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},EA(e,t)}function MN(e,t,n){return t=AJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AJ(e){var t=wGe(e,"string");return Jh(t)=="symbol"?t:t+""}function wGe(e,t){if(Jh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Jh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jGe=function(t,n,r,a,i){var o=i.x1,l=i.x2,c=i.y1,u=i.y2,d=i.xAxis,f=i.yAxis;if(!d||!f)return null;var h=dM({x:d.scale,y:f.scale}),m={x:t?h.x.apply(o,{position:"start"}):h.x.rangeMin,y:r?h.y.apply(c,{position:"start"}):h.y.rangeMin},p={x:n?h.x.apply(l,{position:"end"}):h.x.rangeMax,y:a?h.y.apply(u,{position:"end"}):h.y.rangeMax};return Ji(i,"discard")&&(!h.isInRange(m)||!h.isInRange(p))?null:mJ(m,p)},RN=function(e){function t(){return mGe(this,t),yGe(this,t,arguments)}return bGe(t,e),gGe(t,[{key:"render",value:function(){var r=this.props,a=r.x1,i=r.x2,o=r.y1,l=r.y2,c=r.className,u=r.alwaysShow,d=r.clipPathId;oi(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var f=dr(a),h=dr(i),m=dr(o),p=dr(l),g=this.props.shape;if(!f&&!h&&!m&&!p&&!g)return null;var y=jGe(f,h,m,p,this.props);if(!y&&!g)return null;var v=Ji(this.props,"hidden")?"url(#".concat(d,")"):void 0;return L.createElement(He,{className:Ge("recharts-reference-area",c)},t.renderRect(g,U5(U5({clipPath:v},Me(this.props,!0)),y)),jr.renderCallByParent(this.props,y))}}])}(L.Component);MN(RN,"displayName","ReferenceArea");MN(RN,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});MN(RN,"renderRect",function(e,t){var n;return L.isValidElement(e)?n=L.cloneElement(e,t):ze(e)?n=e(t):n=L.createElement(CN,_A({},t,{className:"recharts-reference-area-rect"})),n});function PJ(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],a=0;a<e.length;a+=t)r.push(e[a]);return r}function NGe(e,t,n){var r={width:e.width+t.width,height:e.height+t.height};return yKe(r,n)}function SGe(e,t,n){var r=n==="width",a=e.x,i=e.y,o=e.width,l=e.height;return t===1?{start:r?a:i,end:r?a+o:i+l}:{start:r?a+o:i+l,end:r?a:i}}function Vw(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-a)<=0}function CGe(e,t){return PJ(e,t+1)}function _Ge(e,t,n,r,a){for(var i=(r||[]).slice(),o=t.start,l=t.end,c=0,u=1,d=o,f=function(){var p=r==null?void 0:r[c];if(p===void 0)return{v:PJ(r,u)};var g=c,y,v=function(){return y===void 0&&(y=n(p,g)),y},w=p.coordinate,b=c===0||Vw(e,w,v,d,l);b||(c=0,d=o,u+=1),b&&(d=w+e*(v()/2+a),c+=u)},h;u<=i.length;)if(h=f(),h)return h.v;return[]}function Fy(e){"@babel/helpers - typeof";return Fy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fy(e)}function V5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ur(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?V5(Object(n),!0).forEach(function(r){EGe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function EGe(e,t,n){return t=AGe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AGe(e){var t=PGe(e,"string");return Fy(t)=="symbol"?t:t+""}function PGe(e,t){if(Fy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Fy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function kGe(e,t,n,r,a){for(var i=(r||[]).slice(),o=i.length,l=t.start,c=t.end,u=function(h){var m=i[h],p,g=function(){return p===void 0&&(p=n(m,h)),p};if(h===o-1){var y=e*(m.coordinate+e*g()/2-c);i[h]=m=Ur(Ur({},m),{},{tickCoord:y>0?m.coordinate-y*e:m.coordinate})}else i[h]=m=Ur(Ur({},m),{},{tickCoord:m.coordinate});var v=Vw(e,m.tickCoord,g,l,c);v&&(c=m.tickCoord-e*(g()/2+a),i[h]=Ur(Ur({},m),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function OGe(e,t,n,r,a,i){var o=(r||[]).slice(),l=o.length,c=t.start,u=t.end;if(i){var d=r[l-1],f=n(d,l-1),h=e*(d.coordinate+e*f/2-u);o[l-1]=d=Ur(Ur({},d),{},{tickCoord:h>0?d.coordinate-h*e:d.coordinate});var m=Vw(e,d.tickCoord,function(){return f},c,u);m&&(u=d.tickCoord-e*(f/2+a),o[l-1]=Ur(Ur({},d),{},{isShow:!0}))}for(var p=i?l-1:l,g=function(w){var b=o[w],j,N=function(){return j===void 0&&(j=n(b,w)),j};if(w===0){var S=e*(b.coordinate-e*N()/2-c);o[w]=b=Ur(Ur({},b),{},{tickCoord:S<0?b.coordinate-S*e:b.coordinate})}else o[w]=b=Ur(Ur({},b),{},{tickCoord:b.coordinate});var C=Vw(e,b.tickCoord,N,c,u);C&&(c=b.tickCoord+e*(N()/2+a),o[w]=Ur(Ur({},b),{},{isShow:!0}))},y=0;y<p;y++)g(y);return o}function vM(e,t,n){var r=e.tick,a=e.ticks,i=e.viewBox,o=e.minTickGap,l=e.orientation,c=e.interval,u=e.tickFormatter,d=e.unit,f=e.angle;if(!a||!a.length||!r)return[];if(Ee(c)||Tr.isSsr)return CGe(a,typeof c=="number"&&Ee(c)?c:0);var h=[],m=l==="top"||l==="bottom"?"width":"height",p=d&&m==="width"?qf(d,{fontSize:t,letterSpacing:n}):{width:0,height:0},g=function(b,j){var N=ze(u)?u(b.value,j):b.value;return m==="width"?NGe(qf(N,{fontSize:t,letterSpacing:n}),p,f):qf(N,{fontSize:t,letterSpacing:n})[m]},y=a.length>=2?Nr(a[1].coordinate-a[0].coordinate):1,v=SGe(i,y,m);return c==="equidistantPreserveStart"?_Ge(y,v,g,a,o):(c==="preserveStart"||c==="preserveStartEnd"?h=OGe(y,v,g,a,o,c==="preserveStartEnd"):h=kGe(y,v,g,a,o),h.filter(function(w){return w.isShow}))}var TGe=["viewBox"],MGe=["viewBox"],RGe=["ticks"];function Zh(e){"@babel/helpers - typeof";return Zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zh(e)}function _f(){return _f=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_f.apply(this,arguments)}function W5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function tr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?W5(Object(n),!0).forEach(function(r){xM(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):W5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function kC(e,t){if(e==null)return{};var n=DGe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DGe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function $Ge(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function q5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,OJ(r.key),r)}}function IGe(e,t,n){return t&&q5(e.prototype,t),n&&q5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LGe(e,t,n){return t=Ww(t),FGe(e,kJ()?Reflect.construct(t,n||[],Ww(e).constructor):t.apply(e,n))}function FGe(e,t){if(t&&(Zh(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return BGe(e)}function BGe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function kJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(kJ=function(){return!!e})()}function Ww(e){return Ww=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ww(e)}function zGe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&AA(e,t)}function AA(e,t){return AA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},AA(e,t)}function xM(e,t,n){return t=OJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function OJ(e){var t=UGe(e,"string");return Zh(t)=="symbol"?t:t+""}function UGe(e,t){if(Zh(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Zh(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Km=function(e){function t(n){var r;return $Ge(this,t),r=LGe(this,t,[n]),r.state={fontSize:"",letterSpacing:""},r}return zGe(t,e),IGe(t,[{key:"shouldComponentUpdate",value:function(r,a){var i=r.viewBox,o=kC(r,TGe),l=this.props,c=l.viewBox,u=kC(l,MGe);return!Wf(i,c)||!Wf(o,u)||!Wf(a,this.state)}},{key:"componentDidMount",value:function(){var r=this.layerReference;if(r){var a=r.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(r){var a=this.props,i=a.x,o=a.y,l=a.width,c=a.height,u=a.orientation,d=a.tickSize,f=a.mirror,h=a.tickMargin,m,p,g,y,v,w,b=f?-1:1,j=r.tickSize||d,N=Ee(r.tickCoord)?r.tickCoord:r.coordinate;switch(u){case"top":m=p=r.coordinate,y=o+ +!f*c,g=y-b*j,w=g-b*h,v=N;break;case"left":g=y=r.coordinate,p=i+ +!f*l,m=p-b*j,v=m-b*h,w=N;break;case"right":g=y=r.coordinate,p=i+ +f*l,m=p+b*j,v=m+b*h,w=N;break;default:m=p=r.coordinate,y=o+ +f*c,g=y+b*j,w=g+b*h,v=N;break}return{line:{x1:m,y1:g,x2:p,y2:y},tick:{x:v,y:w}}}},{key:"getTickTextAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var r=this.props,a=r.orientation,i=r.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.x,i=r.y,o=r.width,l=r.height,c=r.orientation,u=r.mirror,d=r.axisLine,f=tr(tr(tr({},Me(this.props,!1)),Me(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var h=+(c==="top"&&!u||c==="bottom"&&u);f=tr(tr({},f),{},{x1:a,y1:i+h*l,x2:a+o,y2:i+h*l})}else{var m=+(c==="left"&&!u||c==="right"&&u);f=tr(tr({},f),{},{x1:a+m*o,y1:i,x2:a+m*o,y2:i+l})}return L.createElement("line",_f({},f,{className:Ge("recharts-cartesian-axis-line",Ua(d,"className"))}))}},{key:"renderTicks",value:function(r,a,i){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,f=l.tickFormatter,h=l.unit,m=vM(tr(tr({},this.props),{},{ticks:r}),a,i),p=this.getTickTextAnchor(),g=this.getTickVerticalAnchor(),y=Me(this.props,!1),v=Me(d,!1),w=tr(tr({},y),{},{fill:"none"},Me(c,!1)),b=m.map(function(j,N){var S=o.getTickLineCoord(j),C=S.line,_=S.tick,E=tr(tr(tr(tr({textAnchor:p,verticalAnchor:g},y),{},{stroke:"none",fill:u},v),_),{},{index:N,payload:j,visibleTicksCount:m.length,tickFormatter:f});return L.createElement(He,_f({className:"recharts-cartesian-axis-tick",key:"tick-".concat(j.value,"-").concat(j.coordinate,"-").concat(j.tickCoord)},vi(o.props,j,N)),c&&L.createElement("line",_f({},w,C,{className:Ge("recharts-cartesian-axis-tick-line",Ua(c,"className"))})),d&&t.renderTickItem(d,E,"".concat(ze(f)?f(j.value,N):j.value).concat(h||"")))});return L.createElement("g",{className:"recharts-cartesian-axis-ticks"},b)}},{key:"render",value:function(){var r=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,c=a.ticksGenerator,u=a.className,d=a.hide;if(d)return null;var f=this.props,h=f.ticks,m=kC(f,RGe),p=h;return ze(c)&&(p=h&&h.length>0?c(this.props):c(m)),o<=0||l<=0||!p||!p.length?null:L.createElement(He,{className:Ge("recharts-cartesian-axis",u),ref:function(y){r.layerReference=y}},i&&this.renderAxisLine(),this.renderTicks(p,this.state.fontSize,this.state.letterSpacing),jr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,i){var o,l=Ge(a.className,"recharts-cartesian-axis-tick-value");return L.isValidElement(r)?o=L.cloneElement(r,tr(tr({},a),{},{className:l})):ze(r)?o=r(tr(tr({},a),{},{className:l})):o=L.createElement(jd,_f({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(x.Component);xM(Km,"displayName","CartesianAxis");xM(Km,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var VGe=["x1","y1","x2","y2","key"],WGe=["offset"];function _d(e){"@babel/helpers - typeof";return _d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_d(e)}function H5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function qr(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?H5(Object(n),!0).forEach(function(r){qGe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):H5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function qGe(e,t,n){return t=HGe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HGe(e){var t=KGe(e,"string");return _d(t)=="symbol"?t:t+""}function KGe(e,t){if(_d(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(_d(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ku(){return ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ku.apply(this,arguments)}function K5(e,t){if(e==null)return{};var n=GGe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GGe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var YGe=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,i=t.y,o=t.width,l=t.height,c=t.ry;return L.createElement("rect",{x:a,y:i,ry:c,width:o,height:l,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function TJ(e,t){var n;if(L.isValidElement(e))n=L.cloneElement(e,t);else if(ze(e))n=e(t);else{var r=t.x1,a=t.y1,i=t.x2,o=t.y2,l=t.key,c=K5(t,VGe),u=Me(c,!1);u.offset;var d=K5(u,WGe);n=L.createElement("line",ku({},d,{x1:r,y1:a,x2:i,y2:o,fill:"none",key:l}))}return n}function XGe(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,i=e.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=qr(qr({},e),{},{x1:t,y1:l,x2:t+n,y2:l,key:"line-".concat(c),index:c});return TJ(a,u)});return L.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function QGe(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,i=e.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,c){var u=qr(qr({},e),{},{x1:l,y1:t,x2:l,y2:t+n,key:"line-".concat(c),index:c});return TJ(a,u)});return L.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function JGe(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,i=e.width,o=e.height,l=e.horizontalPoints,c=e.horizontal,u=c===void 0?!0:c;if(!u||!t||!t.length)return null;var d=l.map(function(h){return Math.round(h+a-a)}).sort(function(h,m){return h-m});a!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var p=!d[m+1],g=p?a+o-h:d[m+1]-h;if(g<=0)return null;var y=m%t.length;return L.createElement("rect",{key:"react-".concat(m),y:h,x:r,height:g,width:i,stroke:"none",fill:t[y],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},f)}function ZGe(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,i=e.x,o=e.y,l=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(h){return Math.round(h+i-i)}).sort(function(h,m){return h-m});i!==d[0]&&d.unshift(0);var f=d.map(function(h,m){var p=!d[m+1],g=p?i+l-h:d[m+1]-h;if(g<=0)return null;var y=m%r.length;return L.createElement("rect",{key:"react-".concat(m),x:h,y:o,width:g,height:c,stroke:"none",fill:r[y],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return L.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var eYe=function(t,n){var r=t.xAxis,a=t.width,i=t.height,o=t.offset;return xQ(vM(qr(qr(qr({},Km.defaultProps),r),{},{ticks:Lo(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,n)},tYe=function(t,n){var r=t.yAxis,a=t.width,i=t.height,o=t.offset;return xQ(vM(qr(qr(qr({},Km.defaultProps),r),{},{ticks:Lo(r,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,n)},af={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Fo(e){var t,n,r,a,i,o,l=mM(),c=pM(),u=UKe(),d=qr(qr({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:af.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:af.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:af.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:af.horizontalFill,vertical:(i=e.vertical)!==null&&i!==void 0?i:af.vertical,verticalFill:(o=e.verticalFill)!==null&&o!==void 0?o:af.verticalFill,x:Ee(e.x)?e.x:u.left,y:Ee(e.y)?e.y:u.top,width:Ee(e.width)?e.width:u.width,height:Ee(e.height)?e.height:u.height}),f=d.x,h=d.y,m=d.width,p=d.height,g=d.syncWithTicks,y=d.horizontalValues,v=d.verticalValues,w=FKe(),b=BKe();if(!Ee(m)||m<=0||!Ee(p)||p<=0||!Ee(f)||f!==+f||!Ee(h)||h!==+h)return null;var j=d.verticalCoordinatesGenerator||eYe,N=d.horizontalCoordinatesGenerator||tYe,S=d.horizontalPoints,C=d.verticalPoints;if((!S||!S.length)&&ze(N)){var _=y&&y.length,E=N({yAxis:b?qr(qr({},b),{},{ticks:_?y:b.ticks}):void 0,width:l,height:c,offset:u},_?!0:g);oi(Array.isArray(E),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(_d(E),"]")),Array.isArray(E)&&(S=E)}if((!C||!C.length)&&ze(j)){var T=v&&v.length,P=j({xAxis:w?qr(qr({},w),{},{ticks:T?v:w.ticks}):void 0,width:l,height:c,offset:u},T?!0:g);oi(Array.isArray(P),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(_d(P),"]")),Array.isArray(P)&&(C=P)}return L.createElement("g",{className:"recharts-cartesian-grid"},L.createElement(YGe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),L.createElement(XGe,ku({},d,{offset:u,horizontalPoints:S,xAxis:w,yAxis:b})),L.createElement(QGe,ku({},d,{offset:u,verticalPoints:C,xAxis:w,yAxis:b})),L.createElement(JGe,ku({},d,{horizontalPoints:S})),L.createElement(ZGe,ku({},d,{verticalPoints:C})))}Fo.displayName="CartesianGrid";var nYe=["type","layout","connectNulls","ref"],rYe=["key"];function em(e){"@babel/helpers - typeof";return em=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},em(e)}function G5(e,t){if(e==null)return{};var n=aYe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function aYe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function fg(){return fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fg.apply(this,arguments)}function Y5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Ya(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Y5(Object(n),!0).forEach(function(r){Gs(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Y5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function sf(e){return lYe(e)||oYe(e)||iYe(e)||sYe()}function sYe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
912In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iYe(e,t){if(e){if(typeof e=="string")return PA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return PA(e,t)}}function oYe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lYe(e){if(Array.isArray(e))return PA(e)}function PA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cYe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,RJ(r.key),r)}}function uYe(e,t,n){return t&&X5(e.prototype,t),n&&X5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function dYe(e,t,n){return t=qw(t),fYe(e,MJ()?Reflect.construct(t,n||[],qw(e).constructor):t.apply(e,n))}function fYe(e,t){if(t&&(em(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hYe(e)}function hYe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function MJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(MJ=function(){return!!e})()}function qw(e){return qw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},qw(e)}function mYe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&kA(e,t)}function kA(e,t){return kA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},kA(e,t)}function Gs(e,t,n){return t=RJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RJ(e){var t=pYe(e,"string");return em(t)=="symbol"?t:t+""}function pYe(e,t){if(em(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(em(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vl=function(e){function t(){var n;cYe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=dYe(this,t,[].concat(a)),Gs(n,"state",{isAnimationFinished:!0,totalLength:0}),Gs(n,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),Gs(n,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(v,w){return v+w});if(!u)return n.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),f=o%u,h=l-o,m=[],p=0,g=0;p<c.length;g+=c[p],++p)if(g+c[p]>f){m=[].concat(sf(c.slice(0,p)),[f-g]);break}var y=m.length%2===0?[0,h]:[h];return[].concat(sf(t.repeat(c,d)),sf(m),y).map(function(v){return"".concat(v,"px")}).join(", ")}),Gs(n,"id",Al("recharts-line-")),Gs(n,"pathRef",function(o){n.mainCurve=o}),Gs(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),Gs(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return mYe(t,e),uYe(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,f=Or(d,qm);if(!f)return null;var h=function(g,y){return{x:g.x,y:g.y,value:g.value,errorVal:Ot(g.payload,y)}},m={clipPath:r?"url(#clipPath-".concat(a,")"):null};return L.createElement(He,m,f.map(function(p){return L.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:h})}))}},{key:"renderDots",value:function(r,a,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,f=Me(this.props,!1),h=Me(c,!0),m=u.map(function(g,y){var v=Ya(Ya(Ya({key:"dot-".concat(y),r:3},f),h),{},{index:y,cx:g.x,cy:g.y,value:g.value,dataKey:d,payload:g.payload,points:u});return t.renderDotItem(c,v)}),p={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return L.createElement(He,fg({className:"recharts-line-dots",key:"dots"},p),m)}},{key:"renderCurveStatically",value:function(r,a,i,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var f=G5(l,nYe),h=Ya(Ya(Ya({},Me(f,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(i,")"):null,points:r},o),{},{type:c,layout:u,connectNulls:d});return L.createElement(kc,fg({},h,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var i=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,h=o.animationEasing,m=o.animationId,p=o.animateNewValues,g=o.width,y=o.height,v=this.state,w=v.prevPoints,b=v.totalLength;return L.createElement(Dr,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"line-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var N=j.t;if(w){var S=w.length/l.length,C=l.map(function(k,D){var A=Math.floor(D*S);if(w[A]){var I=w[A],M=yt(I.x,k.x),$=yt(I.y,k.y);return Ya(Ya({},k),{},{x:M(N),y:$(N)})}if(p){var R=yt(g*2,k.x),O=yt(y/2,k.y);return Ya(Ya({},k),{},{x:R(N),y:O(N)})}return Ya(Ya({},k),{},{x:k.x,y:k.y})});return i.renderCurveStatically(C,r,a)}var _=yt(0,b),E=_(N),T;if(c){var P="".concat(c).split(/[,\s]+/gim).map(function(k){return parseFloat(k)});T=i.getStrokeDasharray(E,b,P)}else T=i.generateSimpleStrokeDasharray(b,E);return i.renderCurveStatically(l,r,a,{strokeDasharray:T})})}},{key:"renderCurve",value:function(r,a){var i=this.props,o=i.points,l=i.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!xi(u,o))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(o,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,o=a.dot,l=a.points,c=a.className,u=a.xAxis,d=a.yAxis,f=a.top,h=a.left,m=a.width,p=a.height,g=a.isAnimationActive,y=a.id;if(i||!l||!l.length)return null;var v=this.state.isAnimationFinished,w=l.length===1,b=Ge("recharts-line",c),j=u&&u.allowDataOverflow,N=d&&d.allowDataOverflow,S=j||N,C=Ke(y)?this.id:y,_=(r=Me(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=_.r,T=E===void 0?3:E,P=_.strokeWidth,k=P===void 0?2:P,D=dY(o)?o:{},A=D.clipDot,I=A===void 0?!0:A,M=T*2+k;return L.createElement(He,{className:b},j||N?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(C)},L.createElement("rect",{x:j?h:h-m/2,y:N?f:f-p/2,width:j?m:m*2,height:N?p:p*2})),!I&&L.createElement("clipPath",{id:"clipPath-dots-".concat(C)},L.createElement("rect",{x:h-M/2,y:f-M/2,width:m+M,height:p+M}))):null,!w&&this.renderCurve(S,C),this.renderErrorBar(S,C),(w||o)&&this.renderDots(S,I,C),(!g||v)&&ma.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var i=r.length%2!==0?[].concat(sf(r),[0]):r,o=[],l=0;l<a;++l)o=[].concat(sf(o),sf(i));return o}},{key:"renderDotItem",value:function(r,a){var i;if(L.isValidElement(r))i=L.cloneElement(r,a);else if(ze(r))i=r(a);else{var o=a.key,l=G5(a,rYe),c=Ge("recharts-line-dot",typeof r!="boolean"?r.className:"");i=L.createElement(Hm,fg({key:o},l,{className:c}))}return i}}])}(x.PureComponent);Gs(vl,"displayName","Line");Gs(vl,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Tr.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});Gs(vl,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,i=e.yAxisTicks,o=e.dataKey,l=e.bandSize,c=e.displayedData,u=e.offset,d=t.layout,f=c.map(function(h,m){var p=Ot(h,o);return d==="horizontal"?{x:Bh({axis:n,ticks:a,bandSize:l,entry:h,index:m}),y:Ke(p)?null:r.scale(p),value:p,payload:h}:{x:Ke(p)?null:n.scale(p),y:Bh({axis:r,ticks:i,bandSize:l,entry:h,index:m}),value:p,payload:h}});return Ya({points:f,layout:d},u)});var gYe=["layout","type","stroke","connectNulls","isRange","ref"],yYe=["key"],DJ;function tm(e){"@babel/helpers - typeof";return tm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tm(e)}function $J(e,t){if(e==null)return{};var n=vYe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vYe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ou.apply(this,arguments)}function Q5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Hl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Q5(Object(n),!0).forEach(function(r){Ki(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function xYe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function J5(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,LJ(r.key),r)}}function bYe(e,t,n){return t&&J5(e.prototype,t),n&&J5(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wYe(e,t,n){return t=Hw(t),jYe(e,IJ()?Reflect.construct(t,n||[],Hw(e).constructor):t.apply(e,n))}function jYe(e,t){if(t&&(tm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NYe(e)}function NYe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function IJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(IJ=function(){return!!e})()}function Hw(e){return Hw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Hw(e)}function SYe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&OA(e,t)}function OA(e,t){return OA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},OA(e,t)}function Ki(e,t,n){return t=LJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LJ(e){var t=CYe(e,"string");return tm(t)=="symbol"?t:t+""}function CYe(e,t){if(tm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(tm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var kl=function(e){function t(){var n;xYe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=wYe(this,t,[].concat(a)),Ki(n,"state",{isAnimationFinished:!0}),Ki(n,"id",Al("recharts-area-")),Ki(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ze(o)&&o()}),Ki(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ze(o)&&o()}),n}return SYe(t,e),bYe(t,[{key:"renderDots",value:function(r,a,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,f=c.dataKey,h=Me(this.props,!1),m=Me(u,!0),p=d.map(function(y,v){var w=Hl(Hl(Hl({key:"dot-".concat(v),r:3},h),m),{},{index:v,cx:y.x,cy:y.y,dataKey:f,value:y.value,payload:y.payload,points:d});return t.renderDotItem(u,w)}),g={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return L.createElement(He,Ou({className:"recharts-area-dots"},g),p)}},{key:"renderHorizontalRect",value:function(r){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=r*Math.abs(c-u),f=pc(o.map(function(h){return h.y||0}));return Ee(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(pc(i.map(function(h){return h.y||0})),f)),Ee(f)?L.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(f+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(r){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=r*Math.abs(c-u),f=pc(o.map(function(h){return h.x||0}));return Ee(i)&&typeof i=="number"?f=Math.max(i,f):i&&Array.isArray(i)&&i.length&&(f=Math.max(pc(i.map(function(h){return h.x||0})),f)),Ee(f)?L.createElement("rect",{x:0,y:c<u?c:c-d,width:f+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(r){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(r):this.renderHorizontalRect(r)}},{key:"renderAreaStatically",value:function(r,a,i,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,f=l.connectNulls,h=l.isRange;l.ref;var m=$J(l,gYe);return L.createElement(He,{clipPath:i?"url(#clipPath-".concat(o,")"):null},L.createElement(kc,Ou({},Me(m,!0),{points:r,connectNulls:f,type:u,baseLine:a,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&L.createElement(kc,Ou({},Me(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:r})),d!=="none"&&h&&L.createElement(kc,Ou({},Me(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:f,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(r,a){var i=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,f=o.animationDuration,h=o.animationEasing,m=o.animationId,p=this.state,g=p.prevPoints,y=p.prevBaseLine;return L.createElement(Dr,{begin:d,duration:f,isActive:u,easing:h,from:{t:0},to:{t:1},key:"area-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var w=v.t;if(g){var b=g.length/l.length,j=l.map(function(_,E){var T=Math.floor(E*b);if(g[T]){var P=g[T],k=yt(P.x,_.x),D=yt(P.y,_.y);return Hl(Hl({},_),{},{x:k(w),y:D(w)})}return _}),N;if(Ee(c)&&typeof c=="number"){var S=yt(y,c);N=S(w)}else if(Ke(c)||Jc(c)){var C=yt(y,0);N=C(w)}else N=c.map(function(_,E){var T=Math.floor(E*b);if(y[T]){var P=y[T],k=yt(P.x,_.x),D=yt(P.y,_.y);return Hl(Hl({},_),{},{x:k(w),y:D(w)})}return _});return i.renderAreaStatically(j,N,r,a)}return L.createElement(He,null,L.createElement("defs",null,L.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(w))),L.createElement(He,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,c,r,a)))})}},{key:"renderArea",value:function(r,a){var i=this.props,o=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,d=u.prevPoints,f=u.prevBaseLine,h=u.totalLength;return c&&o&&o.length&&(!d&&h>0||!xi(d,o)||!xi(f,l))?this.renderAreaWithAnimation(r,a):this.renderAreaStatically(o,l,r,a)}},{key:"render",value:function(){var r,a=this.props,i=a.hide,o=a.dot,l=a.points,c=a.className,u=a.top,d=a.left,f=a.xAxis,h=a.yAxis,m=a.width,p=a.height,g=a.isAnimationActive,y=a.id;if(i||!l||!l.length)return null;var v=this.state.isAnimationFinished,w=l.length===1,b=Ge("recharts-area",c),j=f&&f.allowDataOverflow,N=h&&h.allowDataOverflow,S=j||N,C=Ke(y)?this.id:y,_=(r=Me(o,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},E=_.r,T=E===void 0?3:E,P=_.strokeWidth,k=P===void 0?2:P,D=dY(o)?o:{},A=D.clipDot,I=A===void 0?!0:A,M=T*2+k;return L.createElement(He,{className:b},j||N?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(C)},L.createElement("rect",{x:j?d:d-m/2,y:N?u:u-p/2,width:j?m:m*2,height:N?p:p*2})),!I&&L.createElement("clipPath",{id:"clipPath-dots-".concat(C)},L.createElement("rect",{x:d-M/2,y:u-M/2,width:m+M,height:p+M}))):null,w?null:this.renderArea(S,C),(o||w)&&this.renderDots(S,I,C),(!g||v)&&ma.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,curBaseLine:r.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:r.points!==a.curPoints||r.baseLine!==a.curBaseLine?{curPoints:r.points,curBaseLine:r.baseLine}:null}}])}(x.PureComponent);DJ=kl;Ki(kl,"displayName","Area");Ki(kl,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Tr.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ki(kl,"getBaseValue",function(e,t,n,r){var a=e.layout,i=e.baseValue,o=t.props.baseValue,l=o??i;if(Ee(l)&&typeof l=="number")return l;var c=a==="horizontal"?r:n,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),f=Math.min(u[0],u[1]);return l==="dataMin"?f:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Ki(kl,"getComposedData",function(e){var t=e.props,n=e.item,r=e.xAxis,a=e.yAxis,i=e.xAxisTicks,o=e.yAxisTicks,l=e.bandSize,c=e.dataKey,u=e.stackedData,d=e.dataStartIndex,f=e.displayedData,h=e.offset,m=t.layout,p=u&&u.length,g=DJ.getBaseValue(t,n,r,a),y=m==="horizontal",v=!1,w=f.map(function(j,N){var S;p?S=u[d+N]:(S=Ot(j,c),Array.isArray(S)?v=!0:S=[g,S]);var C=S[1]==null||p&&Ot(j,c)==null;return y?{x:Bh({axis:r,ticks:i,bandSize:l,entry:j,index:N}),y:C?null:a.scale(S[1]),value:S,payload:j}:{x:C?null:r.scale(S[1]),y:Bh({axis:a,ticks:o,bandSize:l,entry:j,index:N}),value:S,payload:j}}),b;return p||v?b=w.map(function(j){var N=Array.isArray(j.value)?j.value[0]:null;return y?{x:j.x,y:N!=null&&j.y!=null?a.scale(N):null}:{x:N!=null?r.scale(N):null,y:j.y}}):b=y?a.scale(g):r.scale(g),Hl({points:w,baseLine:b,layout:m,isRange:v},h)});Ki(kl,"renderDotItem",function(e,t){var n;if(L.isValidElement(e))n=L.cloneElement(e,t);else if(ze(e))n=e(t);else{var r=Ge("recharts-area-dot",typeof e!="boolean"?e.className:""),a=t.key,i=$J(t,yYe);n=L.createElement(Hm,Ou({},i,{key:a,className:r}))}return n});function nm(e){"@babel/helpers - typeof";return nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nm(e)}function _Ye(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EYe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zJ(r.key),r)}}function AYe(e,t,n){return t&&EYe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function PYe(e,t,n){return t=Kw(t),kYe(e,FJ()?Reflect.construct(t,n||[],Kw(e).constructor):t.apply(e,n))}function kYe(e,t){if(t&&(nm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return OYe(e)}function OYe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function FJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FJ=function(){return!!e})()}function Kw(e){return Kw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Kw(e)}function TYe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&TA(e,t)}function TA(e,t){return TA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},TA(e,t)}function BJ(e,t,n){return t=zJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zJ(e){var t=MYe(e,"string");return nm(t)=="symbol"?t:t+""}function MYe(e,t){if(nm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(nm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gm=function(e){function t(){return _Ye(this,t),PYe(this,t,arguments)}return TYe(t,e),AYe(t,[{key:"render",value:function(){return null}}])}(x.Component);BJ(Gm,"displayName","ZAxis");BJ(Gm,"defaultProps",{zAxisId:0,range:[64,64],scale:"auto",type:"number"});var RYe=["option","isActive"];function hg(){return hg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hg.apply(this,arguments)}function DYe(e,t){if(e==null)return{};var n=$Ye(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $Ye(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function IYe(e){var t=e.option,n=e.isActive,r=DYe(e,RYe);return typeof t=="string"?x.createElement(Wh,hg({option:x.createElement(uN,hg({type:t},r)),isActive:n,shapeType:"symbols"},r)):x.createElement(Wh,hg({option:t,isActive:n,shapeType:"symbols"},r))}function rm(e){"@babel/helpers - typeof";return rm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rm(e)}function mg(){return mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},mg.apply(this,arguments)}function Z5(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function gs(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Z5(Object(n),!0).forEach(function(r){yc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z5(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function LYe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,VJ(r.key),r)}}function FYe(e,t,n){return t&&eF(e.prototype,t),n&&eF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function BYe(e,t,n){return t=Gw(t),zYe(e,UJ()?Reflect.construct(t,n||[],Gw(e).constructor):t.apply(e,n))}function zYe(e,t){if(t&&(rm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return UYe(e)}function UYe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function UJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UJ=function(){return!!e})()}function Gw(e){return Gw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Gw(e)}function VYe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&MA(e,t)}function MA(e,t){return MA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},MA(e,t)}function yc(e,t,n){return t=VJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function VJ(e){var t=WYe(e,"string");return rm(t)=="symbol"?t:t+""}function WYe(e,t){if(rm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(rm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ym=function(e){function t(){var n;LYe(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=BYe(this,t,[].concat(a)),yc(n,"state",{isAnimationFinished:!1}),yc(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0})}),yc(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1})}),yc(n,"id",Al("recharts-scatter-")),n}return VYe(t,e),FYe(t,[{key:"renderSymbolsStatically",value:function(r){var a=this,i=this.props,o=i.shape,l=i.activeShape,c=i.activeIndex,u=Me(this.props,!1);return r.map(function(d,f){var h=c===f,m=h?l:o,p=gs(gs({},u),d);return L.createElement(He,mg({className:"recharts-scatter-symbol",key:"symbol-".concat(d==null?void 0:d.cx,"-").concat(d==null?void 0:d.cy,"-").concat(d==null?void 0:d.size,"-").concat(f)},vi(a.props,d,f),{role:"img"}),L.createElement(IYe,mg({option:m,isActive:h,key:"symbol-".concat(f)},p)))})}},{key:"renderSymbolsWithAnimation",value:function(){var r=this,a=this.props,i=a.points,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state.prevPoints;return L.createElement(Dr,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(h){var m=h.t,p=i.map(function(g,y){var v=f&&f[y];if(v){var w=yt(v.cx,g.cx),b=yt(v.cy,g.cy),j=yt(v.size,g.size);return gs(gs({},g),{},{cx:w(m),cy:b(m),size:j(m)})}var N=yt(0,g.size);return gs(gs({},g),{},{size:N(m)})});return L.createElement(He,null,r.renderSymbolsStatically(p))})}},{key:"renderSymbols",value:function(){var r=this.props,a=r.points,i=r.isAnimationActive,o=this.state.prevPoints;return i&&a&&a.length&&(!o||!xi(o,a))?this.renderSymbolsWithAnimation():this.renderSymbolsStatically(a)}},{key:"renderErrorBar",value:function(){var r=this.props.isAnimationActive;if(r&&!this.state.isAnimationFinished)return null;var a=this.props,i=a.points,o=a.xAxis,l=a.yAxis,c=a.children,u=Or(c,qm);return u?u.map(function(d,f){var h=d.props,m=h.direction,p=h.dataKey;return L.cloneElement(d,{key:"".concat(m,"-").concat(p,"-").concat(i[f]),data:i,xAxis:o,yAxis:l,layout:m==="x"?"vertical":"horizontal",dataPointFormatter:function(y,v){return{x:y.cx,y:y.cy,value:m==="x"?+y.node.x:+y.node.y,errorVal:Ot(y,v)}}})}):null}},{key:"renderLine",value:function(){var r=this.props,a=r.points,i=r.line,o=r.lineType,l=r.lineJointType,c=Me(this.props,!1),u=Me(i,!1),d,f;if(o==="joint")d=a.map(function(b){return{x:b.cx,y:b.cy}});else if(o==="fitting"){var h=ITe(a),m=h.xmin,p=h.xmax,g=h.a,y=h.b,v=function(j){return g*j+y};d=[{x:m,y:v(m)},{x:p,y:v(p)}]}var w=gs(gs(gs({},c),{},{fill:"none",stroke:c&&c.fill},u),{},{points:d});return L.isValidElement(i)?f=L.cloneElement(i,w):ze(i)?f=i(w):f=L.createElement(kc,mg({},w,{type:l})),L.createElement(He,{className:"recharts-scatter-line",key:"recharts-scatter-line"},f)}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.points,o=r.line,l=r.className,c=r.xAxis,u=r.yAxis,d=r.left,f=r.top,h=r.width,m=r.height,p=r.id,g=r.isAnimationActive;if(a||!i||!i.length)return null;var y=this.state.isAnimationFinished,v=Ge("recharts-scatter",l),w=c&&c.allowDataOverflow,b=u&&u.allowDataOverflow,j=w||b,N=Ke(p)?this.id:p;return L.createElement(He,{className:v,clipPath:j?"url(#clipPath-".concat(N,")"):null},w||b?L.createElement("defs",null,L.createElement("clipPath",{id:"clipPath-".concat(N)},L.createElement("rect",{x:w?d:d-h/2,y:b?f:f-m/2,width:w?h:h*2,height:b?m:m*2}))):null,o&&this.renderLine(),this.renderErrorBar(),L.createElement(He,{key:"recharts-scatter-symbols"},this.renderSymbols()),(!g||y)&&ma.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}}])}(x.PureComponent);yc(Ym,"displayName","Scatter");yc(Ym,"defaultProps",{xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!Tr.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"});yc(Ym,"getComposedData",function(e){var t=e.xAxis,n=e.yAxis,r=e.zAxis,a=e.item,i=e.displayedData,o=e.xAxisTicks,l=e.yAxisTicks,c=e.offset,u=a.props.tooltipType,d=Or(a.props.children,Pa),f=Ke(t.dataKey)?a.props.dataKey:t.dataKey,h=Ke(n.dataKey)?a.props.dataKey:n.dataKey,m=r&&r.dataKey,p=r?r.range:Gm.defaultProps.range,g=p&&p[0],y=t.scale.bandwidth?t.scale.bandwidth():0,v=n.scale.bandwidth?n.scale.bandwidth():0,w=i.map(function(b,j){var N=Ot(b,f),S=Ot(b,h),C=!Ke(m)&&Ot(b,m)||"-",_=[{name:Ke(t.dataKey)?a.props.name:t.name||t.dataKey,unit:t.unit||"",value:N,payload:b,dataKey:f,type:u},{name:Ke(n.dataKey)?a.props.name:n.name||n.dataKey,unit:n.unit||"",value:S,payload:b,dataKey:h,type:u}];C!=="-"&&_.push({name:r.name||r.dataKey,unit:r.unit||"",value:C,payload:b,dataKey:m,type:u});var E=Bh({axis:t,ticks:o,bandSize:y,entry:b,index:j,dataKey:f}),T=Bh({axis:n,ticks:l,bandSize:v,entry:b,index:j,dataKey:h}),P=C!=="-"?r.scale(C):g,k=Math.sqrt(Math.max(P,0)/Math.PI);return gs(gs({},b),{},{cx:E,cy:T,x:E-k,y:T-k,xAxis:t,yAxis:n,zAxis:r,width:2*k,height:2*k,size:P,node:{x:N,y:S,z:C},tooltipPayload:_,tooltipPosition:{x:E,y:T},payload:b},d&&d[j]&&d[j].props)});return gs({points:w},c)});function am(e){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},am(e)}function qYe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function HYe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,HJ(r.key),r)}}function KYe(e,t,n){return t&&HYe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function GYe(e,t,n){return t=Yw(t),YYe(e,WJ()?Reflect.construct(t,n||[],Yw(e).constructor):t.apply(e,n))}function YYe(e,t){if(t&&(am(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return XYe(e)}function XYe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function WJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WJ=function(){return!!e})()}function Yw(e){return Yw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Yw(e)}function QYe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&RA(e,t)}function RA(e,t){return RA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},RA(e,t)}function qJ(e,t,n){return t=HJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HJ(e){var t=JYe(e,"string");return am(t)=="symbol"?t:t+""}function JYe(e,t){if(am(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(am(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DA(){return DA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DA.apply(this,arguments)}function ZYe(e){var t=e.xAxisId,n=mM(),r=pM(),a=wJ(t);return a==null?null:x.createElement(Km,DA({},a,{className:Ge("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(o){return Lo(o,!0)}}))}var Bn=function(e){function t(){return qYe(this,t),GYe(this,t,arguments)}return QYe(t,e),KYe(t,[{key:"render",value:function(){return x.createElement(ZYe,this.props)}}])}(x.Component);qJ(Bn,"displayName","XAxis");qJ(Bn,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function sm(e){"@babel/helpers - typeof";return sm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sm(e)}function eXe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tXe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YJ(r.key),r)}}function nXe(e,t,n){return t&&tXe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function rXe(e,t,n){return t=Xw(t),aXe(e,KJ()?Reflect.construct(t,n||[],Xw(e).constructor):t.apply(e,n))}function aXe(e,t){if(t&&(sm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sXe(e)}function sXe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function KJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KJ=function(){return!!e})()}function Xw(e){return Xw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Xw(e)}function iXe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$A(e,t)}function $A(e,t){return $A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},$A(e,t)}function GJ(e,t,n){return t=YJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YJ(e){var t=oXe(e,"string");return sm(t)=="symbol"?t:t+""}function oXe(e,t){if(sm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(sm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function IA(){return IA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},IA.apply(this,arguments)}var lXe=function(t){var n=t.yAxisId,r=mM(),a=pM(),i=jJ(n);return i==null?null:x.createElement(Km,IA({},i,{className:Ge("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:r,height:a},ticksGenerator:function(l){return Lo(l,!0)}}))},zn=function(e){function t(){return eXe(this,t),rXe(this,t,arguments)}return iXe(t,e),nXe(t,[{key:"render",value:function(){return x.createElement(lXe,this.props)}}])}(x.Component);GJ(zn,"displayName","YAxis");GJ(zn,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function tF(e){return fXe(e)||dXe(e)||uXe(e)||cXe()}function cXe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
913In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uXe(e,t){if(e){if(typeof e=="string")return LA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return LA(e,t)}}function dXe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fXe(e){if(Array.isArray(e))return LA(e)}function LA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var FA=function(t,n,r,a,i){var o=Or(t,yM),l=Or(t,TN),c=[].concat(tF(o),tF(l)),u=Or(t,RN),d="".concat(a,"Id"),f=a[0],h=n;if(c.length&&(h=c.reduce(function(g,y){if(y.props[d]===r&&Ji(y.props,"extendDomain")&&Ee(y.props[f])){var v=y.props[f];return[Math.min(g[0],v),Math.max(g[1],v)]}return g},h)),u.length){var m="".concat(f,"1"),p="".concat(f,"2");h=u.reduce(function(g,y){if(y.props[d]===r&&Ji(y.props,"extendDomain")&&Ee(y.props[m])&&Ee(y.props[p])){var v=y.props[m],w=y.props[p];return[Math.min(g[0],v,w),Math.max(g[1],v,w)]}return g},h)}return i&&i.length&&(h=i.reduce(function(g,y){return Ee(y)?[Math.min(g[0],y),Math.max(g[1],y)]:g},h)),h},XJ={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function a(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new a(d,f||c,h),p=n?n+u:u;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],m]:c._events[p].push(m):(c._events[p]=m,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,m=f.length,p=new Array(m);h<m;h++)p[h]=f[h].fn;return p},l.prototype.listenerCount=function(u){var d=n?n+u:u,f=this._events[d];return f?f.fn?1:f.length:0},l.prototype.emit=function(u,d,f,h,m,p){var g=n?n+u:u;if(!this._events[g])return!1;var y=this._events[g],v=arguments.length,w,b;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),v){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,f),!0;case 4:return y.fn.call(y.context,d,f,h),!0;case 5:return y.fn.call(y.context,d,f,h,m),!0;case 6:return y.fn.call(y.context,d,f,h,m,p),!0}for(b=1,w=new Array(v-1);b<v;b++)w[b-1]=arguments[b];y.fn.apply(y.context,w)}else{var j=y.length,N;for(b=0;b<j;b++)switch(y[b].once&&this.removeListener(u,y[b].fn,void 0,!0),v){case 1:y[b].fn.call(y[b].context);break;case 2:y[b].fn.call(y[b].context,d);break;case 3:y[b].fn.call(y[b].context,d,f);break;case 4:y[b].fn.call(y[b].context,d,f,h);break;default:if(!w)for(N=1,w=new Array(v-1);N<v;N++)w[N-1]=arguments[N];y[b].fn.apply(y[b].context,w)}}return!0},l.prototype.on=function(u,d,f){return i(this,u,d,f,!1)},l.prototype.once=function(u,d,f){return i(this,u,d,f,!0)},l.prototype.removeListener=function(u,d,f,h){var m=n?n+u:u;if(!this._events[m])return this;if(!d)return o(this,m),this;var p=this._events[m];if(p.fn)p.fn===d&&(!h||p.once)&&(!f||p.context===f)&&o(this,m);else{for(var g=0,y=[],v=p.length;g<v;g++)(p[g].fn!==d||h&&!p[g].once||f&&p[g].context!==f)&&y.push(p[g]);y.length?this._events[m]=y.length===1?y[0]:y:o(this,m)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&o(this,d)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=n,l.EventEmitter=l,e.exports=l})(XJ);var hXe=XJ.exports;const mXe=$t(hXe);var OC=new mXe,TC="recharts.syncMouseEvents";function By(e){"@babel/helpers - typeof";return By=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},By(e)}function pXe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gXe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,QJ(r.key),r)}}function yXe(e,t,n){return t&&gXe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function MC(e,t,n){return t=QJ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QJ(e){var t=vXe(e,"string");return By(t)=="symbol"?t:t+""}function vXe(e,t){if(By(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(By(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var xXe=function(){function e(){pXe(this,e),MC(this,"activeIndex",0),MC(this,"coordinateList",[]),MC(this,"layout","horizontal")}return yXe(e,[{key:"setDetails",value:function(n){var r,a=n.coordinateList,i=a===void 0?null:a,o=n.container,l=o===void 0?null:o,c=n.layout,u=c===void 0?null:c,d=n.offset,f=d===void 0?null:d,h=n.mouseHandlerCallback,m=h===void 0?null:h;this.coordinateList=(r=i??this.coordinateList)!==null&&r!==void 0?r:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=f??this.offset,this.mouseHandlerCallback=m??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(n){if(this.coordinateList.length!==0)switch(n.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(n){this.activeIndex=n}},{key:"spoofMouse",value:function(){var n,r;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,c=this.coordinateList[this.activeIndex].coordinate,u=((n=window)===null||n===void 0?void 0:n.scrollX)||0,d=((r=window)===null||r===void 0?void 0:r.scrollY)||0,f=i+c+u,h=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:f,pageY:h})}}}])}();function bXe(e,t,n){if(n==="number"&&t===!0&&Array.isArray(e)){var r=e==null?void 0:e[0],a=e==null?void 0:e[1];if(r&&a&&Ee(r)&&Ee(a))return!0}return!1}function wXe(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-a,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function JJ(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,i=e.endAngle,o=It(t,n,r,a),l=It(t,n,r,i);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:a,endAngle:i}}function jXe(e,t,n){var r,a,i,o;if(e==="horizontal")r=t.x,i=r,a=n.top,o=n.top+n.height;else if(e==="vertical")a=t.y,o=a,r=n.left,i=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e==="centric"){var l=t.cx,c=t.cy,u=t.innerRadius,d=t.outerRadius,f=t.angle,h=It(l,c,u,f),m=It(l,c,d,f);r=h.x,a=h.y,i=m.x,o=m.y}else return JJ(t);return[{x:r,y:a},{x:i,y:o}]}function zy(e){"@babel/helpers - typeof";return zy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zy(e)}function nF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Yx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?nF(Object(n),!0).forEach(function(r){NXe(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function NXe(e,t,n){return t=SXe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SXe(e){var t=CXe(e,"string");return zy(t)=="symbol"?t:t+""}function CXe(e,t){if(zy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(zy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _Xe(e){var t,n,r=e.element,a=e.tooltipEventType,i=e.isActive,o=e.activeCoordinate,l=e.activePayload,c=e.offset,u=e.activeTooltipIndex,d=e.tooltipAxisBandSize,f=e.layout,h=e.chartName,m=(t=r.props.cursor)!==null&&t!==void 0?t:(n=r.type.defaultProps)===null||n===void 0?void 0:n.cursor;if(!r||!m||!i||!o||h!=="ScatterChart"&&a!=="axis")return null;var p,g=kc;if(h==="ScatterChart")p=o,g=RWe;else if(h==="BarChart")p=wXe(f,o,c,d),g=CN;else if(f==="radial"){var y=JJ(o),v=y.cx,w=y.cy,b=y.radius,j=y.startAngle,N=y.endAngle;p={cx:v,cy:w,startAngle:j,endAngle:N,innerRadius:b,outerRadius:b},g=RQ}else p={points:jXe(f,o,c)},g=kc;var S=Yx(Yx(Yx(Yx({stroke:"#ccc",pointerEvents:"none"},c),p),Me(m,!1)),{},{payload:l,payloadIndex:u,className:Ge("recharts-tooltip-cursor",m.className)});return x.isValidElement(m)?x.cloneElement(m,S):x.createElement(g,S)}var EXe=["item"],AXe=["children","className","width","height","style","compact","title","desc"];function im(e){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},im(e)}function Ef(){return Ef=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ef.apply(this,arguments)}function rF(e,t){return OXe(e)||kXe(e,t)||eZ(e,t)||PXe()}function PXe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
914In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kXe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function OXe(e){if(Array.isArray(e))return e}function aF(e,t){if(e==null)return{};var n=TXe(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TXe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function MXe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function RXe(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,tZ(r.key),r)}}function DXe(e,t,n){return t&&RXe(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function $Xe(e,t,n){return t=Qw(t),IXe(e,ZJ()?Reflect.construct(t,n||[],Qw(e).constructor):t.apply(e,n))}function IXe(e,t){if(t&&(im(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LXe(e)}function LXe(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ZJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZJ=function(){return!!e})()}function Qw(e){return Qw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Qw(e)}function FXe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BA(e,t)}function BA(e,t){return BA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},BA(e,t)}function om(e){return UXe(e)||zXe(e)||eZ(e)||BXe()}function BXe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
915In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eZ(e,t){if(e){if(typeof e=="string")return zA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zA(e,t)}}function zXe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function UXe(e){if(Array.isArray(e))return zA(e)}function zA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function sF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function me(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?sF(Object(n),!0).forEach(function(r){et(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function et(e,t,n){return t=tZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tZ(e){var t=VXe(e,"string");return im(t)=="symbol"?t:t+""}function VXe(e,t){if(im(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(im(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WXe={xAxis:["bottom","top"],yAxis:["left","right"]},qXe={width:"100%",height:"100%"},nZ={x:0,y:0};function Xx(e){return e}var HXe=function(t,n){return n==="horizontal"?t.x:n==="vertical"?t.y:n==="centric"?t.angle:t.radius},KXe=function(t,n,r,a){var i=n.find(function(d){return d&&d.index===r});if(i){if(t==="horizontal")return{x:i.coordinate,y:a.y};if(t==="vertical")return{x:a.x,y:i.coordinate};if(t==="centric"){var o=i.coordinate,l=a.radius;return me(me(me({},a),It(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,u=a.angle;return me(me(me({},a),It(a.cx,a.cy,c,u)),{},{angle:u,radius:c})}return nZ},DN=function(t,n){var r=n.graphicalItems,a=n.dataStartIndex,i=n.dataEndIndex,o=(r??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(om(l),om(u)):l},[]);return o.length>0?o:t&&t.length&&Ee(a)&&Ee(i)?t.slice(a,i+1):[]};function rZ(e){return e==="number"?[0,"auto"]:void 0}var UA=function(t,n,r,a){var i=t.graphicalItems,o=t.tooltipAxis,l=DN(n,t);return r<0||!i||!i.length||r>=l.length?null:i.reduce(function(c,u){var d,f=(d=u.props.data)!==null&&d!==void 0?d:n;f&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(f=f.slice(t.dataStartIndex,t.dataEndIndex+1));var h;if(o.dataKey&&!o.allowDuplicatedCategory){var m=f===void 0?l:f;h=H0(m,o.dataKey,a)}else h=f&&f[r]||l[r];return h?[].concat(om(c),[iM(u,h)]):c},[])},iF=function(t,n,r,a){var i=a||{x:t.chartX,y:t.chartY},o=HXe(i,r),l=t.orderedTooltipTicks,c=t.tooltipAxis,u=t.tooltipTicks,d=dUe(o,l,u,c);if(d>=0&&u){var f=u[d]&&u[d].value,h=UA(t,n,d,f),m=KXe(r,l,d,i);return{activeTooltipIndex:d,activeLabel:f,activePayload:h,activeCoordinate:m}}return null},GXe=function(t,n){var r=n.axes,a=n.graphicalItems,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=t.stackOffset,m=vQ(d,i);return r.reduce(function(p,g){var y,v=g.type.defaultProps!==void 0?me(me({},g.type.defaultProps),g.props):g.props,w=v.type,b=v.dataKey,j=v.allowDataOverflow,N=v.allowDuplicatedCategory,S=v.scale,C=v.ticks,_=v.includeHidden,E=v[o];if(p[E])return p;var T=DN(t.data,{graphicalItems:a.filter(function(B){var H,Y=o in B.props?B.props[o]:(H=B.type.defaultProps)===null||H===void 0?void 0:H[o];return Y===E}),dataStartIndex:c,dataEndIndex:u}),P=T.length,k,D,A;bXe(v.domain,j,w)&&(k=XE(v.domain,null,j),m&&(w==="number"||S!=="auto")&&(A=lg(T,b,"category")));var I=rZ(w);if(!k||k.length===0){var M,$=(M=v.domain)!==null&&M!==void 0?M:I;if(b){if(k=lg(T,b,w),w==="category"&&m){var R=$Te(k);N&&R?(D=k,k=Dw(0,P)):N||(k=p3($,k,g).reduce(function(B,H){return B.indexOf(H)>=0?B:[].concat(om(B),[H])},[]))}else if(w==="category")N?k=k.filter(function(B){return B!==""&&!Ke(B)}):k=p3($,k,g).reduce(function(B,H){return B.indexOf(H)>=0||H===""||Ke(H)?B:[].concat(om(B),[H])},[]);else if(w==="number"){var O=gUe(T,a.filter(function(B){var H,Y,ee=o in B.props?B.props[o]:(H=B.type.defaultProps)===null||H===void 0?void 0:H[o],V="hide"in B.props?B.props.hide:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y.hide;return ee===E&&(_||!V)}),b,i,d);O&&(k=O)}m&&(w==="number"||S!=="auto")&&(A=lg(T,b,"category"))}else m?k=Dw(0,P):l&&l[E]&&l[E].hasStack&&w==="number"?k=h==="expand"?[0,1]:_Q(l[E].stackGroups,c,u):k=yQ(T,a.filter(function(B){var H=o in B.props?B.props[o]:B.type.defaultProps[o],Y="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return H===E&&(_||!Y)}),w,d,!0);if(w==="number")k=FA(f,k,E,i,C),$&&(k=XE($,k,j));else if(w==="category"&&$){var F=$,z=k.every(function(B){return F.indexOf(B)>=0});z&&(k=F)}}return me(me({},p),{},et({},E,me(me({},v),{},{axisType:i,domain:k,categoricalDomain:A,duplicateDomain:D,originalDomain:(y=v.domain)!==null&&y!==void 0?y:I,isCategorical:m,layout:d})))},{})},YXe=function(t,n){var r=n.graphicalItems,a=n.Axis,i=n.axisType,o=n.axisIdKey,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.layout,f=t.children,h=DN(t.data,{graphicalItems:r,dataStartIndex:c,dataEndIndex:u}),m=h.length,p=vQ(d,i),g=-1;return r.reduce(function(y,v){var w=v.type.defaultProps!==void 0?me(me({},v.type.defaultProps),v.props):v.props,b=w[o],j=rZ("number");if(!y[b]){g++;var N;return p?N=Dw(0,m):l&&l[b]&&l[b].hasStack?(N=_Q(l[b].stackGroups,c,u),N=FA(f,N,b,i)):(N=XE(j,yQ(h,r.filter(function(S){var C,_,E=o in S.props?S.props[o]:(C=S.type.defaultProps)===null||C===void 0?void 0:C[o],T="hide"in S.props?S.props.hide:(_=S.type.defaultProps)===null||_===void 0?void 0:_.hide;return E===b&&!T}),"number",d),a.defaultProps.allowDataOverflow),N=FA(f,N,b,i)),me(me({},y),{},et({},b,me(me({axisType:i},a.defaultProps),{},{hide:!0,orientation:Ua(WXe,"".concat(i,".").concat(g%2),null),domain:N,originalDomain:j,isCategorical:p,layout:d})))}return y},{})},XXe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,i=n.AxisComp,o=n.graphicalItems,l=n.stackGroups,c=n.dataStartIndex,u=n.dataEndIndex,d=t.children,f="".concat(a,"Id"),h=Or(d,i),m={};return h&&h.length?m=GXe(t,{axes:h,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(m=YXe(t,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:f,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),m},QXe=function(t){var n=ec(t),r=Lo(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:$T(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:xw(n,r)}},oF=function(t){var n=t.children,r=t.defaultShowTooltip,a=Vr(n,Cd),i=0,o=0;return t.data&&t.data.length!==0&&(o=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!r}},JXe=function(t){return!t||!t.length?!1:t.some(function(n){var r=Wo(n&&n.type);return r&&r.indexOf("Bar")>=0})},lF=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},ZXe=function(t,n){var r=t.props,a=t.graphicalItems,i=t.xAxisMap,o=i===void 0?{}:i,l=t.yAxisMap,c=l===void 0?{}:l,u=r.width,d=r.height,f=r.children,h=r.margin||{},m=Vr(f,Cd),p=Vr(f,vn),g=Object.keys(c).reduce(function(N,S){var C=c[S],_=C.orientation;return!C.mirror&&!C.hide?me(me({},N),{},et({},_,N[_]+C.width)):N},{left:h.left||0,right:h.right||0}),y=Object.keys(o).reduce(function(N,S){var C=o[S],_=C.orientation;return!C.mirror&&!C.hide?me(me({},N),{},et({},_,Ua(N,"".concat(_))+C.height)):N},{top:h.top||0,bottom:h.bottom||0}),v=me(me({},y),g),w=v.bottom;m&&(v.bottom+=m.props.height||Cd.defaultProps.height),p&&n&&(v=mUe(v,a,r,n));var b=u-v.left-v.right,j=d-v.top-v.bottom;return me(me({brushBottom:w},v),{},{width:Math.max(b,0),height:Math.max(j,0)})},eQe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},Ol=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,i=a===void 0?"axis":a,o=t.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=t.axisComponents,u=t.legendContent,d=t.formatAxisMap,f=t.defaultProps,h=function(v,w){var b=w.graphicalItems,j=w.stackGroups,N=w.offset,S=w.updateId,C=w.dataStartIndex,_=w.dataEndIndex,E=v.barSize,T=v.layout,P=v.barGap,k=v.barCategoryGap,D=v.maxBarSize,A=lF(T),I=A.numericAxisName,M=A.cateAxisName,$=JXe(b),R=[];return b.forEach(function(O,F){var z=DN(v.data,{graphicalItems:[O],dataStartIndex:C,dataEndIndex:_}),B=O.type.defaultProps!==void 0?me(me({},O.type.defaultProps),O.props):O.props,H=B.dataKey,Y=B.maxBarSize,ee=B["".concat(I,"Id")],V=B["".concat(M,"Id")],K={},W=c.reduce(function(Oe,Et){var oe=w["".concat(Et.axisType,"Map")],Je=B["".concat(Et.axisType,"Id")];oe&&oe[Je]||Et.axisType==="zAxis"||Sd();var ut=oe[Je];return me(me({},Oe),{},et(et({},Et.axisType,ut),"".concat(Et.axisType,"Ticks"),Lo(ut)))},K),q=W[M],J=W["".concat(M,"Ticks")],ie=j&&j[ee]&&j[ee].hasStack&&jUe(O,j[ee].stackGroups),X=Wo(O.type).indexOf("Bar")>=0,ge=xw(q,J),Se=[],ce=$&&fUe({barSize:E,stackGroups:j,totalSize:eQe(W,M)});if(X){var ye,Ie,Ue=Ke(Y)?D:Y,Ze=(ye=(Ie=xw(q,J,!0))!==null&&Ie!==void 0?Ie:Ue)!==null&&ye!==void 0?ye:0;Se=hUe({barGap:P,barCategoryGap:k,bandSize:Ze!==ge?Ze:ge,sizeList:ce[V],maxBarSize:Ue}),Ze!==ge&&(Se=Se.map(function(Oe){return me(me({},Oe),{},{position:me(me({},Oe.position),{},{offset:Oe.position.offset-Ze/2})})}))}var fe=O&&O.type&&O.type.getComposedData;fe&&R.push({props:me(me({},fe(me(me({},W),{},{displayedData:z,props:v,dataKey:H,item:O,bandSize:ge,barPosition:Se,offset:N,stackedData:ie,layout:T,dataStartIndex:C,dataEndIndex:_}))),{},et(et(et({key:O.key||"item-".concat(F)},I,W[I]),M,W[M]),"animationId",S)),childIndex:YTe(O,v.children),item:O})}),R},m=function(v,w){var b=v.props,j=v.dataStartIndex,N=v.dataEndIndex,S=v.updateId;if(!hE({props:b}))return null;var C=b.children,_=b.layout,E=b.stackOffset,T=b.data,P=b.reverseStackOrder,k=lF(_),D=k.numericAxisName,A=k.cateAxisName,I=Or(C,r),M=wUe(T,I,"".concat(D,"Id"),"".concat(A,"Id"),E,P),$=c.reduce(function(B,H){var Y="".concat(H.axisType,"Map");return me(me({},B),{},et({},Y,XXe(b,me(me({},H),{},{graphicalItems:I,stackGroups:H.axisType===D&&M,dataStartIndex:j,dataEndIndex:N}))))},{}),R=ZXe(me(me({},$),{},{props:b,graphicalItems:I}),w==null?void 0:w.legendBBox);Object.keys($).forEach(function(B){$[B]=d(b,$[B],R,B.replace("Map",""),n)});var O=$["".concat(A,"Map")],F=QXe(O),z=h(b,me(me({},$),{},{dataStartIndex:j,dataEndIndex:N,updateId:S,graphicalItems:I,stackGroups:M,offset:R}));return me(me({formattedGraphicalItems:z,graphicalItems:I,offset:R,stackGroups:M},F),$)},p=function(y){function v(w){var b,j,N;return MXe(this,v),N=$Xe(this,v,[w]),et(N,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),et(N,"accessibilityManager",new xXe),et(N,"handleLegendBBoxUpdate",function(S){if(S){var C=N.state,_=C.dataStartIndex,E=C.dataEndIndex,T=C.updateId;N.setState(me({legendBBox:S},m({props:N.props,dataStartIndex:_,dataEndIndex:E,updateId:T},me(me({},N.state),{},{legendBBox:S}))))}}),et(N,"handleReceiveSyncEvent",function(S,C,_){if(N.props.syncId===S){if(_===N.eventEmitterSymbol&&typeof N.props.syncMethod!="function")return;N.applySyncEvent(C)}}),et(N,"handleBrushChange",function(S){var C=S.startIndex,_=S.endIndex;if(C!==N.state.dataStartIndex||_!==N.state.dataEndIndex){var E=N.state.updateId;N.setState(function(){return me({dataStartIndex:C,dataEndIndex:_},m({props:N.props,dataStartIndex:C,dataEndIndex:_,updateId:E},N.state))}),N.triggerSyncEvent({dataStartIndex:C,dataEndIndex:_})}}),et(N,"handleMouseEnter",function(S){var C=N.getMouseInfo(S);if(C){var _=me(me({},C),{},{isTooltipActive:!0});N.setState(_),N.triggerSyncEvent(_);var E=N.props.onMouseEnter;ze(E)&&E(_,S)}}),et(N,"triggeredAfterMouseMove",function(S){var C=N.getMouseInfo(S),_=C?me(me({},C),{},{isTooltipActive:!0}):{isTooltipActive:!1};N.setState(_),N.triggerSyncEvent(_);var E=N.props.onMouseMove;ze(E)&&E(_,S)}),et(N,"handleItemMouseEnter",function(S){N.setState(function(){return{isTooltipActive:!0,activeItem:S,activePayload:S.tooltipPayload,activeCoordinate:S.tooltipPosition||{x:S.cx,y:S.cy}}})}),et(N,"handleItemMouseLeave",function(){N.setState(function(){return{isTooltipActive:!1}})}),et(N,"handleMouseMove",function(S){S.persist(),N.throttleTriggeredAfterMouseMove(S)}),et(N,"handleMouseLeave",function(S){N.throttleTriggeredAfterMouseMove.cancel();var C={isTooltipActive:!1};N.setState(C),N.triggerSyncEvent(C);var _=N.props.onMouseLeave;ze(_)&&_(C,S)}),et(N,"handleOuterEvent",function(S){var C=GTe(S),_=Ua(N.props,"".concat(C));if(C&&ze(_)){var E,T;/.*touch.*/i.test(C)?T=N.getMouseInfo(S.changedTouches[0]):T=N.getMouseInfo(S),_((E=T)!==null&&E!==void 0?E:{},S)}}),et(N,"handleClick",function(S){var C=N.getMouseInfo(S);if(C){var _=me(me({},C),{},{isTooltipActive:!0});N.setState(_),N.triggerSyncEvent(_);var E=N.props.onClick;ze(E)&&E(_,S)}}),et(N,"handleMouseDown",function(S){var C=N.props.onMouseDown;if(ze(C)){var _=N.getMouseInfo(S);C(_,S)}}),et(N,"handleMouseUp",function(S){var C=N.props.onMouseUp;if(ze(C)){var _=N.getMouseInfo(S);C(_,S)}}),et(N,"handleTouchMove",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&N.throttleTriggeredAfterMouseMove(S.changedTouches[0])}),et(N,"handleTouchStart",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&N.handleMouseDown(S.changedTouches[0])}),et(N,"handleTouchEnd",function(S){S.changedTouches!=null&&S.changedTouches.length>0&&N.handleMouseUp(S.changedTouches[0])}),et(N,"handleDoubleClick",function(S){var C=N.props.onDoubleClick;if(ze(C)){var _=N.getMouseInfo(S);C(_,S)}}),et(N,"handleContextMenu",function(S){var C=N.props.onContextMenu;if(ze(C)){var _=N.getMouseInfo(S);C(_,S)}}),et(N,"triggerSyncEvent",function(S){N.props.syncId!==void 0&&OC.emit(TC,N.props.syncId,S,N.eventEmitterSymbol)}),et(N,"applySyncEvent",function(S){var C=N.props,_=C.layout,E=C.syncMethod,T=N.state.updateId,P=S.dataStartIndex,k=S.dataEndIndex;if(S.dataStartIndex!==void 0||S.dataEndIndex!==void 0)N.setState(me({dataStartIndex:P,dataEndIndex:k},m({props:N.props,dataStartIndex:P,dataEndIndex:k,updateId:T},N.state)));else if(S.activeTooltipIndex!==void 0){var D=S.chartX,A=S.chartY,I=S.activeTooltipIndex,M=N.state,$=M.offset,R=M.tooltipTicks;if(!$)return;if(typeof E=="function")I=E(R,S);else if(E==="value"){I=-1;for(var O=0;O<R.length;O++)if(R[O].value===S.activeLabel){I=O;break}}var F=me(me({},$),{},{x:$.left,y:$.top}),z=Math.min(D,F.x+F.width),B=Math.min(A,F.y+F.height),H=R[I]&&R[I].value,Y=UA(N.state,N.props.data,I),ee=R[I]?{x:_==="horizontal"?R[I].coordinate:z,y:_==="horizontal"?B:R[I].coordinate}:nZ;N.setState(me(me({},S),{},{activeLabel:H,activeCoordinate:ee,activePayload:Y,activeTooltipIndex:I}))}else N.setState(S)}),et(N,"renderCursor",function(S){var C,_=N.state,E=_.isTooltipActive,T=_.activeCoordinate,P=_.activePayload,k=_.offset,D=_.activeTooltipIndex,A=_.tooltipAxisBandSize,I=N.getTooltipEventType(),M=(C=S.props.active)!==null&&C!==void 0?C:E,$=N.props.layout,R=S.key||"_recharts-cursor";return L.createElement(_Xe,{key:R,activeCoordinate:T,activePayload:P,activeTooltipIndex:D,chartName:n,element:S,isActive:M,layout:$,offset:k,tooltipAxisBandSize:A,tooltipEventType:I})}),et(N,"renderPolarAxis",function(S,C,_){var E=Ua(S,"type.axisType"),T=Ua(N.state,"".concat(E,"Map")),P=S.type.defaultProps,k=P!==void 0?me(me({},P),S.props):S.props,D=T&&T[k["".concat(E,"Id")]];return x.cloneElement(S,me(me({},D),{},{className:Ge(E,D.className),key:S.key||"".concat(C,"-").concat(_),ticks:Lo(D,!0)}))}),et(N,"renderPolarGrid",function(S){var C=S.props,_=C.radialLines,E=C.polarAngles,T=C.polarRadius,P=N.state,k=P.radiusAxisMap,D=P.angleAxisMap,A=ec(k),I=ec(D),M=I.cx,$=I.cy,R=I.innerRadius,O=I.outerRadius;return x.cloneElement(S,{polarAngles:Array.isArray(E)?E:Lo(I,!0).map(function(F){return F.coordinate}),polarRadius:Array.isArray(T)?T:Lo(A,!0).map(function(F){return F.coordinate}),cx:M,cy:$,innerRadius:R,outerRadius:O,key:S.key||"polar-grid",radialLines:_})}),et(N,"renderLegend",function(){var S=N.state.formattedGraphicalItems,C=N.props,_=C.children,E=C.width,T=C.height,P=N.props.margin||{},k=E-(P.left||0)-(P.right||0),D=pQ({children:_,formattedGraphicalItems:S,legendWidth:k,legendContent:u});if(!D)return null;var A=D.item,I=aF(D,EXe);return x.cloneElement(A,me(me({},I),{},{chartWidth:E,chartHeight:T,margin:P,onBBoxUpdate:N.handleLegendBBoxUpdate}))}),et(N,"renderTooltip",function(){var S,C=N.props,_=C.children,E=C.accessibilityLayer,T=Vr(_,kt);if(!T)return null;var P=N.state,k=P.isTooltipActive,D=P.activeCoordinate,A=P.activePayload,I=P.activeLabel,M=P.offset,$=(S=T.props.active)!==null&&S!==void 0?S:k;return x.cloneElement(T,{viewBox:me(me({},M),{},{x:M.left,y:M.top}),active:$,label:I,payload:$?A:[],coordinate:D,accessibilityLayer:E})}),et(N,"renderBrush",function(S){var C=N.props,_=C.margin,E=C.data,T=N.state,P=T.offset,k=T.dataStartIndex,D=T.dataEndIndex,A=T.updateId;return x.cloneElement(S,{key:S.key||"_recharts-brush",onChange:qx(N.handleBrushChange,S.props.onChange),data:E,x:Ee(S.props.x)?S.props.x:P.left,y:Ee(S.props.y)?S.props.y:P.top+P.height+P.brushBottom-(_.bottom||0),width:Ee(S.props.width)?S.props.width:P.width,startIndex:k,endIndex:D,updateId:"brush-".concat(A)})}),et(N,"renderReferenceElement",function(S,C,_){if(!S)return null;var E=N,T=E.clipPathId,P=N.state,k=P.xAxisMap,D=P.yAxisMap,A=P.offset,I=S.type.defaultProps||{},M=S.props,$=M.xAxisId,R=$===void 0?I.xAxisId:$,O=M.yAxisId,F=O===void 0?I.yAxisId:O;return x.cloneElement(S,{key:S.key||"".concat(C,"-").concat(_),xAxis:k[R],yAxis:D[F],viewBox:{x:A.left,y:A.top,width:A.width,height:A.height},clipPathId:T})}),et(N,"renderActivePoints",function(S){var C=S.item,_=S.activePoint,E=S.basePoint,T=S.childIndex,P=S.isRange,k=[],D=C.props.key,A=C.item.type.defaultProps!==void 0?me(me({},C.item.type.defaultProps),C.item.props):C.item.props,I=A.activeDot,M=A.dataKey,$=me(me({index:T,dataKey:M,cx:_.x,cy:_.y,r:4,fill:sM(C.item),strokeWidth:2,stroke:"#fff",payload:_.payload,value:_.value},Me(I,!1)),K0(I));return k.push(v.renderActiveDot(I,$,"".concat(D,"-activePoint-").concat(T))),E?k.push(v.renderActiveDot(I,me(me({},$),{},{cx:E.x,cy:E.y}),"".concat(D,"-basePoint-").concat(T))):P&&k.push(null),k}),et(N,"renderGraphicChild",function(S,C,_){var E=N.filterFormatItem(S,C,_);if(!E)return null;var T=N.getTooltipEventType(),P=N.state,k=P.isTooltipActive,D=P.tooltipAxis,A=P.activeTooltipIndex,I=P.activeLabel,M=N.props.children,$=Vr(M,kt),R=E.props,O=R.points,F=R.isRange,z=R.baseLine,B=E.item.type.defaultProps!==void 0?me(me({},E.item.type.defaultProps),E.item.props):E.item.props,H=B.activeDot,Y=B.hide,ee=B.activeBar,V=B.activeShape,K=!!(!Y&&k&&$&&(H||ee||V)),W={};T!=="axis"&&$&&$.props.trigger==="click"?W={onClick:qx(N.handleItemMouseEnter,S.props.onClick)}:T!=="axis"&&(W={onMouseLeave:qx(N.handleItemMouseLeave,S.props.onMouseLeave),onMouseEnter:qx(N.handleItemMouseEnter,S.props.onMouseEnter)});var q=x.cloneElement(S,me(me({},E.props),W));function J(Et){return typeof D.dataKey=="function"?D.dataKey(Et.payload):null}if(K)if(A>=0){var ie,X;if(D.dataKey&&!D.allowDuplicatedCategory){var ge=typeof D.dataKey=="function"?J:"payload.".concat(D.dataKey.toString());ie=H0(O,ge,I),X=F&&z&&H0(z,ge,I)}else ie=O==null?void 0:O[A],X=F&&z&&z[A];if(V||ee){var Se=S.props.activeIndex!==void 0?S.props.activeIndex:A;return[x.cloneElement(S,me(me(me({},E.props),W),{},{activeIndex:Se})),null,null]}if(!Ke(ie))return[q].concat(om(N.renderActivePoints({item:E,activePoint:ie,basePoint:X,childIndex:A,isRange:F})))}else{var ce,ye=(ce=N.getItemByXY(N.state.activeCoordinate))!==null&&ce!==void 0?ce:{graphicalItem:q},Ie=ye.graphicalItem,Ue=Ie.item,Ze=Ue===void 0?S:Ue,fe=Ie.childIndex,Oe=me(me(me({},E.props),W),{},{activeIndex:fe});return[x.cloneElement(Ze,Oe),null,null]}return F?[q,null,null]:[q,null]}),et(N,"renderCustomized",function(S,C,_){return x.cloneElement(S,me(me({key:"recharts-customized-".concat(_)},N.props),N.state))}),et(N,"renderMap",{CartesianGrid:{handler:Xx,once:!0},ReferenceArea:{handler:N.renderReferenceElement},ReferenceLine:{handler:Xx},ReferenceDot:{handler:N.renderReferenceElement},XAxis:{handler:Xx},YAxis:{handler:Xx},Brush:{handler:N.renderBrush,once:!0},Bar:{handler:N.renderGraphicChild},Line:{handler:N.renderGraphicChild},Area:{handler:N.renderGraphicChild},Radar:{handler:N.renderGraphicChild},RadialBar:{handler:N.renderGraphicChild},Scatter:{handler:N.renderGraphicChild},Pie:{handler:N.renderGraphicChild},Funnel:{handler:N.renderGraphicChild},Tooltip:{handler:N.renderCursor,once:!0},PolarGrid:{handler:N.renderPolarGrid,once:!0},PolarAngleAxis:{handler:N.renderPolarAxis},PolarRadiusAxis:{handler:N.renderPolarAxis},Customized:{handler:N.renderCustomized}}),N.clipPathId="".concat((b=w.id)!==null&&b!==void 0?b:Al("recharts"),"-clip"),N.throttleTriggeredAfterMouseMove=yX(N.triggeredAfterMouseMove,(j=w.throttleDelay)!==null&&j!==void 0?j:1e3/60),N.state={},N}return FXe(v,y),DXe(v,[{key:"componentDidMount",value:function(){var b,j;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(b=this.props.margin.left)!==null&&b!==void 0?b:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var b=this.props,j=b.children,N=b.data,S=b.height,C=b.layout,_=Vr(j,kt);if(_){var E=_.props.defaultIndex;if(!(typeof E!="number"||E<0||E>this.state.tooltipTicks.length-1)){var T=this.state.tooltipTicks[E]&&this.state.tooltipTicks[E].value,P=UA(this.state,N,E,T),k=this.state.tooltipTicks[E].coordinate,D=(this.state.offset.top+S)/2,A=C==="horizontal",I=A?{x:k,y:D}:{y:k,x:D},M=this.state.formattedGraphicalItems.find(function(R){var O=R.item;return O.type.name==="Scatter"});M&&(I=me(me({},I),M.props.points[E].tooltipPosition),P=M.props.points[E].tooltipPayload);var $={activeTooltipIndex:E,isTooltipActive:!0,activeLabel:T,activePayload:P,activeCoordinate:I};this.setState($),this.renderCursor(_),this.accessibilityManager.setIndex(E)}}}},{key:"getSnapshotBeforeUpdate",value:function(b,j){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==j.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==b.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==b.margin){var N,S;this.accessibilityManager.setDetails({offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(S=this.props.margin.top)!==null&&S!==void 0?S:0}})}return null}},{key:"componentDidUpdate",value:function(b){mE([Vr(b.children,kt)],[Vr(this.props.children,kt)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var b=Vr(this.props.children,kt);if(b&&typeof b.props.shared=="boolean"){var j=b.props.shared?"axis":"item";return l.indexOf(j)>=0?j:i}return i}},{key:"getMouseInfo",value:function(b){if(!this.container)return null;var j=this.container,N=j.getBoundingClientRect(),S=c6e(N),C={chartX:Math.round(b.pageX-S.left),chartY:Math.round(b.pageY-S.top)},_=N.width/j.offsetWidth||1,E=this.inRange(C.chartX,C.chartY,_);if(!E)return null;var T=this.state,P=T.xAxisMap,k=T.yAxisMap,D=this.getTooltipEventType(),A=iF(this.state,this.props.data,this.props.layout,E);if(D!=="axis"&&P&&k){var I=ec(P).scale,M=ec(k).scale,$=I&&I.invert?I.invert(C.chartX):null,R=M&&M.invert?M.invert(C.chartY):null;return me(me({},C),{},{xValue:$,yValue:R},A)}return A?me(me({},C),A):null}},{key:"inRange",value:function(b,j){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,S=this.props.layout,C=b/N,_=j/N;if(S==="horizontal"||S==="vertical"){var E=this.state.offset,T=C>=E.left&&C<=E.left+E.width&&_>=E.top&&_<=E.top+E.height;return T?{x:C,y:_}:null}var P=this.state,k=P.angleAxisMap,D=P.radiusAxisMap;if(k&&D){var A=ec(k);return v3({x:C,y:_},A)}return null}},{key:"parseEventsOfWrapper",value:function(){var b=this.props.children,j=this.getTooltipEventType(),N=Vr(b,kt),S={};N&&j==="axis"&&(N.props.trigger==="click"?S={onClick:this.handleClick}:S={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var C=K0(this.props,this.handleOuterEvent);return me(me({},C),S)}},{key:"addListener",value:function(){OC.on(TC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){OC.removeListener(TC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(b,j,N){for(var S=this.state.formattedGraphicalItems,C=0,_=S.length;C<_;C++){var E=S[C];if(E.item===b||E.props.key===b.key||j===Wo(E.item.type)&&N===E.childIndex)return E}return null}},{key:"renderClipPath",value:function(){var b=this.clipPathId,j=this.state.offset,N=j.left,S=j.top,C=j.height,_=j.width;return L.createElement("defs",null,L.createElement("clipPath",{id:b},L.createElement("rect",{x:N,y:S,height:C,width:_})))}},{key:"getXScales",value:function(){var b=this.state.xAxisMap;return b?Object.entries(b).reduce(function(j,N){var S=rF(N,2),C=S[0],_=S[1];return me(me({},j),{},et({},C,_.scale))},{}):null}},{key:"getYScales",value:function(){var b=this.state.yAxisMap;return b?Object.entries(b).reduce(function(j,N){var S=rF(N,2),C=S[0],_=S[1];return me(me({},j),{},et({},C,_.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(b){var j;return(j=this.state.xAxisMap)===null||j===void 0||(j=j[b])===null||j===void 0?void 0:j.scale}},{key:"getYScaleByAxisId",value:function(b){var j;return(j=this.state.yAxisMap)===null||j===void 0||(j=j[b])===null||j===void 0?void 0:j.scale}},{key:"getItemByXY",value:function(b){var j=this.state,N=j.formattedGraphicalItems,S=j.activeItem;if(N&&N.length)for(var C=0,_=N.length;C<_;C++){var E=N[C],T=E.props,P=E.item,k=P.type.defaultProps!==void 0?me(me({},P.type.defaultProps),P.props):P.props,D=Wo(P.type);if(D==="Bar"){var A=(T.data||[]).find(function(R){return pWe(b,R)});if(A)return{graphicalItem:E,payload:A}}else if(D==="RadialBar"){var I=(T.data||[]).find(function(R){return v3(b,R)});if(I)return{graphicalItem:E,payload:I}}else if(AN(E,S)||PN(E,S)||Ry(E,S)){var M=uqe({graphicalItem:E,activeTooltipItem:S,itemData:k.data}),$=k.activeIndex===void 0?M:k.activeIndex;return{graphicalItem:me(me({},E),{},{childIndex:$}),payload:Ry(E,S)?k.data[M]:E.props.data[M]}}}return null}},{key:"render",value:function(){var b=this;if(!hE(this))return null;var j=this.props,N=j.children,S=j.className,C=j.width,_=j.height,E=j.style,T=j.compact,P=j.title,k=j.desc,D=aF(j,AXe),A=Me(D,!1);if(T)return L.createElement(D5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement(G0,Ef({},A,{width:C,height:_,title:P,desc:k}),this.renderClipPath(),w4(N,this.renderMap)));if(this.props.accessibilityLayer){var I,M;A.tabIndex=(I=this.props.tabIndex)!==null&&I!==void 0?I:0,A.role=(M=this.props.role)!==null&&M!==void 0?M:"application",A.onKeyDown=function(R){b.accessibilityManager.keyboardEvent(R)},A.onFocus=function(){b.accessibilityManager.focus()}}var $=this.parseEventsOfWrapper();return L.createElement(D5,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},L.createElement("div",Ef({className:Ge("recharts-wrapper",S),style:me({position:"relative",cursor:"default",width:C,height:_},E)},$,{ref:function(O){b.container=O}}),L.createElement(G0,Ef({},A,{width:C,height:_,title:P,desc:k,style:qXe}),this.renderClipPath(),w4(N,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(x.Component);et(p,"displayName",n),et(p,"defaultProps",me({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),et(p,"getDerivedStateFromProps",function(y,v){var w=y.dataKey,b=y.data,j=y.children,N=y.width,S=y.height,C=y.layout,_=y.stackOffset,E=y.margin,T=v.dataStartIndex,P=v.dataEndIndex;if(v.updateId===void 0){var k=oF(y);return me(me(me({},k),{},{updateId:0},m(me(me({props:y},k),{},{updateId:0}),v)),{},{prevDataKey:w,prevData:b,prevWidth:N,prevHeight:S,prevLayout:C,prevStackOffset:_,prevMargin:E,prevChildren:j})}if(w!==v.prevDataKey||b!==v.prevData||N!==v.prevWidth||S!==v.prevHeight||C!==v.prevLayout||_!==v.prevStackOffset||!Wf(E,v.prevMargin)){var D=oF(y),A={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},I=me(me({},iF(v,b,C)),{},{updateId:v.updateId+1}),M=me(me(me({},D),A),I);return me(me(me({},M),m(me({props:y},M),v)),{},{prevDataKey:w,prevData:b,prevWidth:N,prevHeight:S,prevLayout:C,prevStackOffset:_,prevMargin:E,prevChildren:j})}if(!mE(j,v.prevChildren)){var $,R,O,F,z=Vr(j,Cd),B=z&&($=(R=z.props)===null||R===void 0?void 0:R.startIndex)!==null&&$!==void 0?$:T,H=z&&(O=(F=z.props)===null||F===void 0?void 0:F.endIndex)!==null&&O!==void 0?O:P,Y=B!==T||H!==P,ee=!Ke(b),V=ee&&!Y?v.updateId:v.updateId+1;return me(me({updateId:V},m(me(me({props:y},v),{},{updateId:V,dataStartIndex:B,dataEndIndex:H}),v)),{},{prevChildren:j,dataStartIndex:B,dataEndIndex:H})}return null}),et(p,"renderActiveDot",function(y,v,w){var b;return x.isValidElement(y)?b=x.cloneElement(y,v):ze(y)?b=y(v):b=L.createElement(Hm,v),L.createElement(He,{className:"recharts-active-dot",ke
vendor: 5,229 bytes, line 915
915y:w},b)});var g=x.forwardRef(function(v,w){return L.createElement(p,Ef({},v,{ref:w}))});return g.displayName=p.displayName,g},bM=Ol({chartName:"LineChart",GraphicalChild:vl,axisComponents:[{axisType:"xAxis",AxisComp:Bn},{axisType:"yAxis",AxisComp:zn}],formatAxisMap:qv}),Oc=Ol({chartName:"BarChart",GraphicalChild:Gr,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:Bn},{axisType:"yAxis",AxisComp:zn}],formatAxisMap:qv}),Uy=Ol({chartName:"PieChart",GraphicalChild:cs,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Fd},{axisType:"radiusAxis",AxisComp:Ld}],formatAxisMap:oM,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function tQe(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var nQe=tQe,rQe=uM,aQe=U1,sQe=Object.prototype,iQe=sQe.hasOwnProperty;function oQe(e,t,n){var r=e[t];(!(iQe.call(e,t)&&aQe(r,n))||n===void 0&&!(t in e))&&rQe(e,t,n)}var aZ=oQe,lQe=aZ,cQe=uM;function uQe(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var l=t[i],c=r?r(n[l],e[l],l,n,e):void 0;c===void 0&&(c=e[l]),a?cQe(n,l,c):lQe(n,l,c)}return n}var Hv=uQe,dQe=Hv,fQe=Bm;function hQe(e,t){return e&&dQe(t,fQe(t),e)}var mQe=hQe;function pQe(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var gQe=pQe,yQe=Ei,vQe=TT,xQe=gQe,bQe=Object.prototype,wQe=bQe.hasOwnProperty;function jQe(e){if(!yQe(e))return xQe(e);var t=vQe(e),n=[];for(var r in e)r=="constructor"&&(t||!wQe.call(e,r))||n.push(r);return n}var NQe=jQe,SQe=GY,CQe=NQe,_Qe=Fm;function EQe(e){return _Qe(e)?SQe(e,!0):CQe(e)}var wM=EQe,AQe=Hv,PQe=wM;function kQe(e,t){return e&&AQe(t,PQe(t),e)}var OQe=kQe,Jw={exports:{}};Jw.exports;(function(e,t){var n=Ci,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,i=a&&a.exports===r,o=i?n.Buffer:void 0,l=o?o.allocUnsafe:void 0;function c(u,d){if(d)return u.slice();var f=u.length,h=l?l(f):new u.constructor(f);return u.copy(h),h}e.exports=c})(Jw,Jw.exports);var TQe=Jw.exports;function MQe(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var RQe=MQe,DQe=Hv,$Qe=_T;function IQe(e,t){return DQe(e,$Qe(e),t)}var LQe=IQe,FQe=CT,BQe=cM,zQe=_T,UQe=qY,VQe=Object.getOwnPropertySymbols,WQe=VQe?function(e){for(var t=[];e;)FQe(t,zQe(e)),e=BQe(e);return t}:UQe,sZ=WQe,qQe=Hv,HQe=sZ;function KQe(e,t){return qQe(e,HQe(e),t)}var GQe=KQe,YQe=WY,XQe=sZ,QQe=wM;function JQe(e){return YQe(e,QQe,XQe)}var iZ=JQe,ZQe=Object.prototype,eJe=ZQe.hasOwnProperty;function tJe(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&eJe.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var nJe=tJe,cF=VY;function rJe(e){var t=new e.constructor(e.byteLength);return new cF(t).set(new cF(e)),t}var jM=rJe,aJe=jM;function sJe(e,t){var n=t?aJe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var iJe=sJe,oJe=/\w*$/;function lJe(e){var t=new e.constructor(e.source,oJe.exec(e));return t.lastIndex=e.lastIndex,t}var cJe=lJe,uF=Tm,dF=uF?uF.prototype:void 0,fF=dF?dF.valueOf:void 0;function uJe(e){return fF?Object(fF.call(e)):{}}var dJe=uJe,fJe=jM;function hJe(e,t){var n=t?fJe(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var mJe=hJe,pJe=jM,gJe=iJe,yJe=cJe,vJe=dJe,xJe=mJe,bJe="[object Boolean]",wJe="[object Date]",jJe="[object Map]",NJe="[object Number]",SJe="[object RegExp]",CJe="[object Set]",_Je="[object String]",EJe="[object Symbol]",AJe="[object ArrayBuffer]",PJe="[object DataView]",kJe="[object Float32Array]",OJe="[object Float64Array]",TJe="[object Int8Array]",MJe="[object Int16Array]",RJe="[object Int32Array]",DJe="[object Uint8Array]",$Je="[object Uint8ClampedArray]",IJe="[object Uint16Array]",LJe="[object Uint32Array]";function FJe(e,t,n){var r=e.constructor;switch(t){case AJe:return pJe(e);case bJe:case wJe:return new r(+e);case PJe:return gJe(e,n);case kJe:case OJe:case TJe:case MJe:case RJe:case DJe:case $Je:case IJe:case LJe:return xJe(e,n);case jJe:return new r;case NJe:case _Je:return new r(e);case SJe:return yJe(e);case CJe:return new r;case EJe:return vJe(e)}}var BJe=FJe,zJe=Ei,hF=Object.create,UJe=function(){function e(){}return function(t){if(!zJe(t))return{};if(hF)return hF(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),VJe=UJe,WJe=VJe,qJe=cM,HJe=TT;function KJe(e){return typeof e.constructor=="function"&&!HJe(e)?WJe(qJe(e)):{}}var GJe=KJe,YJe=fN,XJe=_i,QJe="[object Map]";function JJe(e){return XJe(e)&&YJe(e)==QJe}var ZJe=JJe,eZe=ZJe,tZe=dN,mF=OT,pF=mF&&mF.isMap,nZe=pF?tZe(pF):eZe,rZe=nZe,aZe=fN,sZe=_i,iZe="[object Set]";function oZe(e){return sZe(e)&&aZe(e)==iZe}var lZe=oZe,cZe=lZe,uZe=dN,gF=OT,yF=gF&&gF.isSet,dZe=yF?uZe(yF):cZe,fZe=dZe,hZe=NT,mZe=nQe,pZe=aZ,gZe=mQe,yZe=OQe,vZe=TQe,xZe=RQe,bZe=LQe,wZe=GQe,jZe=XY,NZe=iZ,SZe=fN,CZe=nJe,_Ze=BJe,EZe=GJe,AZe=ba,PZe=AT,kZe=rZe,OZe=Ei,TZe=fZe,MZe=Bm,RZe=wM,DZe=1,$Ze=2,IZe=4,oZ="[object Arguments]",LZe="[object Array]",FZe="[object Boolean]",BZe="[object Date]",zZe="[object Error]",lZ="[object Function]",UZe="[object GeneratorFunction]",VZe="[object Map]",WZe="[object Number]",cZ="[object Object]",qZe
915="[object RegExp]",HZe="[object Set]",KZe="[object String]",GZe="[object Symbol]",YZe="[object WeakMap]",XZe="[object ArrayBuffer]",QZe="[object DataView]",JZe="[object Float32Array]",ZZe="[object Float64Array]",eet="[object Int8Array]",tet="[object Int16Array]",net="[object Int32Array]",ret="[object Uint8Array]",aet="[object Uint8ClampedArray]",set="[object Uint16Array]",iet="[object Uint32Array]",nn={};nn[oZ]=nn[LZe]=nn[XZe]=nn[QZe]=nn[FZe]=nn[BZe]=nn[JZe]=nn[ZZe]=nn[eet]=nn[tet]=nn[net]=nn[VZe]=nn[WZe]=nn[cZ]=nn[qZe]=nn[HZe]=nn[KZe]=nn[GZe]=nn[ret]=nn[aet]=nn[set]=nn[iet]=!0;nn[zZe]=nn[lZ]=nn[YZe]=!1;function kb(e,t,n,r,a,i){var o,l=t&DZe,c=t&$Ze,u=t&IZe;if(n&&(o=a?n(e,r,a,i):n(e)),o!==void 0)return o;if(!OZe(e))return e;var d=AZe(e);if(d){if(o=CZe(e),!l)return xZe(e,o)}else{var f=SZe(e),h=f==lZ||f==UZe;if(PZe(e))return vZe(e,l);if(f==cZ||f==oZ||h&&!a){if(o=c||h?{}:EZe(e),!l)return c?wZe(e,yZe(o,e)):bZe(e,gZe(o,e))}else{if(!nn[f])return a?e:{};o=_Ze(e,f,l)}}i||(i=new hZe);var m=i.get(e);if(m)return m;i.set(e,o),TZe(e)?e.forEach(function(y){o.add(kb(y,t,n,y,e,i))}):kZe(e)&&e.forEach(function(y,v){o.set(v,kb(y,t,n,v,e,i))});var p=u?c?NZe:jZe:c?RZe:MZe,g=d?void 0:p(e);return mZe(g||e,function(y,v){g&&(v=y,y=e[v]),pZe(o,v,kb(y,t,n,v,e,i))}),o}var oet=kb,cet=G1,uet=fY;function det(e,t){return t.length<2?e:cet(e,uet(t,0,-1))}var fet=det,het=K1,met=OQ,pet=fet,get=Fv;function yet(e,t){return t=het(t,e),e=pet(e,t),e==null||delete e[get(met(t))]}var vet=yet,xet=QQ;function bet(e){return xet(e)?void 0:e}var wet=bet,jet=RT;function Net(e){var t=e==null?0:e.length;return t?jet(e,1):[]}var Cet=Net,_et=Cet,Eet=cX,Aet=dX;function Pet(e){return Aet(Eet(e,void 0,_et),e+"")}var ket=Pet,Oet=H1,Tet=oet,Met=vet,Ret=K1,Det=Hv,$et=wet,Iet=ket,Let=iZ,Fet=1,Bet=2,zet=4,Uet=Iet(function(e,t){var n={};if(e==null)return n;var r=!1;t=Oet(t,function(i){return i=Ret(i,e),r||(r=i.length>1),i}),Det(e,Let(e),n),r&&(n=Tet(n,Fet|Bet|zet,$et));for(var a=t.length;a--;)Met(n,t[a]);return n}),Vet=Uet;const uZ=$t(Vet);var Wet=["#1890FF","#66B5FF","#41D9C7","#2FC25B","#6EDB8F","#9AE65C","#FACC14","#E6965C","#57AD71","#223273","#738AE6","#7564CC","#8543E0","#A877ED","#5C8EE6","#13C2C2","#70E0E0","#5CA3E6","#3436C7","#8082FF","#DD81E6","#F04864","#FA7D92","#D598D9"],qet=["width","height","className","style","children","type"];function lm(e){"@babel/helpers - typeof";return lm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lm(e)}function Zw(){return Zw=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zw.apply(this,arguments)}function Het(e,t){if(e==null)return{};var n=Ket(e,t),r,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(a=0;a<i.length;a++)r=i[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ket(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Get(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fZ(r.key),r)}}function Yet(e,t,n){return t&&vF(e.prototype,t),n&&vF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xet(e,t,n){return t=ej(t),Qet(e,dZ()?Reflect.construct(t,n||[],ej(e).constructor):t.apply(e,n))}function Qet(e,t){if(t&&(lm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jet(e)}function Jet(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function dZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dZ=function(){return!!e})()}
915function ej(e){return ej=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ej(e)}function Zet(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&VA(e,t)}function VA(e,t){return VA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},VA(e,t)}function xF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xF(Object(n),!0).forEach(function(r){Ho(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ho(e,t,n){return t=fZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fZ(e){var t=ett(e,"string");return lm(t)=="symbol"?t:t+""}function ett(e,t){if(lm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(lm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Vy="value",RC=function e(t){var n=t.depth,r=t.node,a=t.index,i=t.valueKey,o=r.children,l=n+1,c=o&&o.length?o.map(function(d,f){return e({depth:l,node:d,index:f,valueKey:i})}):null,u;return o&&o.length?u=c.reduce(function(d,f){return d+f[Vy]},0):u=Jc(r[i])||r[i]<=0?0:r[i],rn(rn({},r),{},Ho(Ho(Ho({children:c},Vy,u),"depth",n),"index",a))},ttt=function(t){return{x:t.x,y:t.y,width:t.width,height:t.height}},ntt=function(t,n){var r=n<0?0:n;return t.map(function(a){var i=a[Vy]*r;return rn(rn({},a),{},{area:Jc(i)||i<=0?0:i})})},rtt=function(t,n,r){var a=n*n,i=t.area*t.area,o=t.reduce(function(u,d){return{min:Math.min(u.min,d.area),max:Math.max(u.max,d.area)}},{min:1/0,max:0}),l=o.min,c=o.max;return i?Math.max(a*c*r/i,i/(a*l*r)):1/0},att=function(t,n,r,a){var i=n?Math.round(t.area/n):0;(a||i>r.height)&&(i=r.height);for(var o=r.x,l,c=0,u=t.length;c<u;c++)l=t[c],l.x=o,l.y=r.y,l.height=i,l.width=Math.min(i?Math.round(l.area/i):0,r.x+r.width-o),o+=l.width;return l.width+=r.x+r.width-o,rn(rn({},r),{},{y:r.y+i,height:r.height-i})},stt=function(t,n,r,a){var i=n?Math.round(t.area/n):0;(a||i>r.width)&&(i=r.width);for(var o=r.y,l,c=0,u=t.length;c<u;c++)l=t[c],l.x=r.x,l.y=o,l.width=i,l.height=Math.min(i?Math.round(l.area/i):0,r.y+r.height-o),o+=l.height;return l&&(l.height+=r.y+r.height-o),rn(rn({},r),{},{x:r.x+i,width:r.width-i})},bF=function(t,n,r,a){return n===r.width?att(t,n,r,a):stt(t,n,r,a)},DC=function e(t,n){var r=t.children;if(r&&r.length){var a=ttt(t),i=[],o=1/0,l,c,u=Math.min(a.width,a.height),d=ntt(r,a.width*a.height/t[Vy]),f=d.slice();for(i.area=0;f.length>0;)i.push(l=f[0]),i.area+=l.area,c=rtt(i,u,n),c<=o?(f.shift(),o=c):(i.area-=i.pop().area,a=bF(i,u,a,!1),u=Math.min(a.width,a.height),i.length=i.area=0,o=1/0);return i.length&&(a=bF(i,u,a,!0),i.length=i.area=0),rn(rn({},t),{},{children:d.map(function(h){return e(h,n)})})}return t},itt={isTooltipActive:!1,isAnimationFinished:!1,activeNode:null,formatRoot:null,currentRoot:null,nestIndex:[]},NM=function(e){function t(){var n;Get(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Xet(this,t,[].concat(a)),Ho(n,"state",rn({},itt)),Ho(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ze(o)&&o()}),Ho(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ze(o)&&o()}),n}return Zet(t,e),Yet(t,[{key:"handleMouseEnter",value:function(r,a){a.persist();var i=this.props,o=i.onMouseEnter,l=i.children,c=Vr(l,kt);c?this.setState({isTooltipActive:!0,activeNode:r},function(){o&&o(r,a)}):o&&o(r,a)}},{key:"handleMouseLeave",value:function(r,a){a.persist();var i=this.props,o=i.onMouseLeave,l=i.children,c=Vr(l,kt);c?this.setState({isTooltipActive:!1,activeNode:null},function(){o&&o(r,a)}):o&&o(r,a)}},{key:"handleClick",value:function(r){var a=this.props,i=a.onClick,o=a.type;if(o==="nest"&&r.children){var l=this.props,c=l.width,u=l.height,d=l.dataKey,f=l.aspectRatio,h=RC({depth:0,node:rn(rn({},r),{},{x:0,y:0,width:c,height:u}),index:0,valueKey:d}),m=DC(h,f),p=this.state.nestIndex;p.push(r),this.setState({formatRoot:m,currentRoot:h,nestIndex:p})}i&&i(r)}},{key:"handleNestIndex",value:function(r,a){var i=this.state.nestIndex,o=this.props,l=o.width,c=o.height,u=o.dataKey,d=o.aspectRatio,f=RC({depth:0,node:rn(rn({},r),{},{x:0,y:0,width:l,height:c}),index:0,valueKey:u}),h=DC(f,d);i=i.slice(0,a+1),this.setState({formatRoot:h,currentRoot:r,nestIndex:i})}},{key:"renderItem",value:function(r,a,i){var o=this,l=this.props,c=l.isAnimationActive,u=l.animationBegin,d=l.animationDuration,f=l.animationEasing,h=l.isUpdateAnimationActive,m=l.type,p=l.animationId,g=l.colorPanel,y=this.state.isAnimationFinished,v=a.width,w=a.height,b=a.x,j=a.y,N=a.depth,S=parseInt("".concat((Math.random()*2-1)*v),10),C={};return(i||m==="nest")&&(C={onMouseEnter:this.handleMouseEnter.bind(this,a),onMouseLeave:this.handleMouseLeave.bind(this,a),onClick:this.handleClick.bind(this,a)}),c?L.createElement(Dr,{begin:u,duration:d,isActive:c,easing:f,key:"treemap-".concat(p),from:{x:b,y:j,width:v,height:w},to:{x:b,y:j,width:v,height:w},onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(_){var E=_.x,T=_.y,P=_.width,k=_.height;return L.createElement(Dr,{from:"translate(".concat(S,"px, ").concat(S,"px)"),to:"translate(0, 0)",attributeName:"transform",begin:u,easing:f,isActive:c,duration:d},L.createElement(He,C,function(){return N>2&&!y?null:o.constructor.renderContentItem(r,rn(rn({},a),{},{isAnimationActive:c,isUpdateAnimationActive:!h,width:P,height:k,x:E,y:T}),m,g)}()))}):L.createElement(He,C,this.constructor.renderContentItem(r,rn(rn({},a),{},{isAnimationActive:!1,isUpdateAnimationActive:!1,width:v,height:w,x:b,y:j}),m,g))}},{key:"renderNode",value:function(r,a){var i=this,o=this.props,l=o.content,c=o.type,u=rn(rn(rn({},Me(this.props,!1)),a),{},{root:r}),d=!a.children||!a.children.length,f=this.state.currentRoot,h=(f.children||[]).filter(function(m){return m.depth===a.depth&&m.name===a.name});return!h.length&&r.depth&&c==="nest"?null:L.createElement(He,{key:"recharts-treemap-node-".concat(u.x,"-").concat(u.y,"-").concat(u.name),className:"recharts-treemap-depth-".concat(a.depth)},this.renderItem(l,u,d),a.children&&a.children.length?a.children.map(function(m){return i.renderNode(a,m)}):null)}},{key:"renderAllNodes",value:function(){var r=this.state.formatRoot;return r?this.renderNode(r,r):null}},{key:"renderTooltip",value:function(){var r=this.props,a=r.children,i=r.nameKey,o=Vr(a,kt);if(!o)return null;var l=this.props,c=l.width,u=l.height,d=this.state,f=d.isTooltipActive,h=d.activeNode,m={x:0,y:0,width:c,height:u},p=h?{x:h.x+h.width/2,y:h.y+h.height/2}:null,g=f&&h?[{payload:h,name:Ot(h,i,""),value:Ot(h,Vy)}]:[];return L.cloneElement(o,{viewBox:m,active:f,coordinate:p,label:"",payload:g})}},{key:"renderNestIndex",value:function(){var r=this,a=this.props,i=a.nameKey,o=a.nestIndexContent,l=this.state.nestIndex;return L.createElement("div",{className:"recharts-treemap-nest-index-wrapper",style:{marginTop:"8px",textAlign:"center"}},l.map(function(c,u){var d=Ua(c,i,"root"),f=null;return L.isValidElement(o)&&(f=L.cloneElement(o,c,u)),ze(o)?f=o(c,u):f=d,L.createElement("div",{onClick:r.handleNestIndex.bind(r,c,u),key:"nest-index-".concat(Al()),className:"recharts-treemap-nest-index-box",style:{cursor:"pointer",display:"inline-block",padding:"0 7px",background:"#000",color:"#fff",marginRight:"3px"}},f)}))}},{key:"render",value:function(){if(!hE(this))return null;var r=this.props,a=r.width,i=r.height,o=r.className,l=r.style,c=r.children,u=r.type,d=Het(r,qet),f=Me(d,!1);return L.createElement("div",{className:Ge("recharts-wrapper",o),style:rn(rn({},l),{}
915,{position:"relative",cursor:"default",width:a,height:i}),role:"region"},L.createElement(G0,Zw({},f,{width:a,height:u==="nest"?i-30:i}),this.renderAllNodes(),KTe(c)),this.renderTooltip(),u==="nest"&&this.renderNestIndex())}}],[{key:"getDerivedStateFromProps",value:function(r,a){if(r.data!==a.prevData||r.type!==a.prevType||r.width!==a.prevWidth||r.height!==a.prevHeight||r.dataKey!==a.prevDataKey||r.aspectRatio!==a.prevAspectRatio){var i=RC({depth:0,node:{children:r.data,x:0,y:0,width:r.width,height:r.height},index:0,valueKey:r.dataKey}),o=DC(i,r.aspectRatio);return rn(rn({},a),{},{formatRoot:o,currentRoot:i,nestIndex:[i],prevAspectRatio:r.aspectRatio,prevData:r.data,prevWidth:r.width,prevHeight:r.height,prevDataKey:r.dataKey,prevType:r.type})}return null}},{key:"renderContentItem",value:function(r,a,i,o){if(L.isValidElement(r))return L.cloneElement(r,a);if(ze(r))return r(a);var l=a.x,c=a.y,u=a.width,d=a.height,f=a.index,h=null;u>10&&d>10&&a.children&&i==="nest"&&(h=L.createElement(lM,{points:[{x:l+2,y:c+d/2},{x:l+6,y:c+d/2+3},{x:l+2,y:c+d/2+6}]}));var m=null,p=qf(a.name);u>20&&d>20&&p.width<u&&p.height<d&&(m=L.createElement("text",{x:l+8,y:c+d/2+7,fontSize:14},a.name));var g=o||Wet;return L.createElement("g",null,L.createElement(CN,Zw({fill:a.depth<2?g[f%g.length]:"rgba(255,255,255,0)",stroke:"#fff"},uZ(a,"children"),{role:"img"})),h,m)}}])}(x.PureComponent);Ho(NM,"displayName","Treemap");Ho(NM,"defaultProps",{aspectRatio:.5*(1+Math.sqrt(5)),dataKey:"value",type:"flat",isAnimationActive:!Tr.isSsr,isUpdateAnimationActive:!Tr.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"linear"});var ott=Ol({chartName:"RadarChart",GraphicalChild:Vv,axisComponents:[{axisType:"angleAxis",AxisComp:Fd},{axisType:"radiusAxis",AxisComp:Ld}],formatAxisMap:oM,defaultProps:{layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),ltt=Ol({chartName:"ScatterChart",GraphicalChild:Ym,defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],axisComponents:[{axisType:"xAxis",AxisComp:Bn},{axisType:"yAxis",AxisComp:zn},{axisType:"zAxis",AxisComp:Gm}],formatAxisMap:qv}),ctt=Ol({chartName:"AreaChart",GraphicalChild:kl,axisComponents:[{axisType:"xAxis",AxisComp:Bn},{axisType:"yAxis",AxisComp:zn}],formatAxisMap:qv}),utt=Ol({chartName:"RadialBarChart",GraphicalChild:Wv,legendContent:"children",defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"angleAxis",AxisComp:Fd},{axisType:"radiusAxis",AxisComp:Ld}],formatAxisMap:oM,defaultProps:{layout:"radial",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}
915),dtt=Ol({chartName:"ComposedChart",GraphicalChild:[vl,kl,Gr,Ym],axisComponents:[{axisType:"xAxis",AxisComp:Bn},{axisType:"yAxis",AxisComp:zn},{axisType:"zAxis",AxisComp:Gm}],formatAxisMap:qv});function Wy(e){"@babel/helpers - typeof";return Wy=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wy(e)}function WA(){return WA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},WA.apply(this,arguments)}function wF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $C(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?wF(Object(n),!0).forEach(function(r){ftt(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function ftt(e,t,n){return t=htt(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function htt(e){var t=mtt(e,"string");return Wy(t)=="symbol"?t:t+""}function mtt(e,t){if(Wy(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Wy(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ptt(e,t){var n="".concat(t.x||e.x),r=parseInt(n,10),a="".concat(t.y||e.y),i=parseInt(a,10),o="".concat((t==null?void 0:t.height)||(e==null?void 0:e.height)),l=parseInt(o,10);return $C($C($C({},t),JQ(e)),{},{height:l,x:r,y:i})}function gtt(e){return L.createElement(Wh,WA({shapeType:"trapezoid",propTransformer:ptt},e))}var qA;function jF(e,t){return btt(e)||xtt(e,t)||vtt(e,t)||ytt()}function ytt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
916In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vtt(e,t){if(e){if(typeof e=="string")return NF(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return NF(e,t)}}function NF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xtt(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,i,o,l=[],c=!0,u=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(d){u=!0,a=d}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(u)throw a}}return l}}function btt(e){if(Array.isArray(e))return e}function cm(e){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},cm(e)}function tj(){return tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tj.apply(this,arguments)}function SF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function ar(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?SF(Object(n),!0).forEach(function(r){Ko(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):SF(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function wtt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function CF(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,mZ(r.key),r)}}
vendor: 4,504 bytes, line 916
916function jtt(e,t,n){return t&&CF(e.prototype,t),n&&CF(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ntt(e,t,n){return t=nj(t),Stt(e,hZ()?Reflect.construct(t,n||[],nj(e).constructor):t.apply(e,n))}function Stt(e,t){if(t&&(cm(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ctt(e)}function Ctt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hZ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(hZ=function(){return!!e})()}function nj(e){return nj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nj(e)}function _tt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&HA(e,t)}function HA(e,t){return HA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},HA(e,t)}function Ko(e,t,n){return t=mZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mZ(e){var t=Ett(e,"string");return cm(t)=="symbol"?t:t+""}function Ett(e,t){if(cm(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(cm(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var nu=function(e){function t(){var n;wtt(this,t);for(var r=arguments.length,a=new Array(r),i=0;i<r;i++)a[i]=arguments[i];return n=Ntt(this,t,[].concat(a)),Ko(n,"state",{isAnimationFinished:!1}),Ko(n,"handleAnimationEnd",function(){var o=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),ze(o)&&o()}),Ko(n,"handleAnimationStart",function(){var o=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),ze(o)&&o()}),n}return _tt(t,e),jtt(t,[{key:"isActiveIndex",value:function(r){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(r)!==-1:r===a}},{key:"renderTrapezoidsStatically",value:function(r){var a=this,i=this.props,o=i.shape,l=i.activeShape;return r.map(function(c,u){var d=a.isActiveIndex(u)?l:o,f=ar(ar({},c),{},{isActive:a.isActiveIndex(u),stroke:c.stroke});return L.createElement(He,tj({className:"recharts-funnel-trapezoid"},vi(a.props,c,u),{key:"trapezoid-".concat(c==null?void 0:c.x,"-").concat(c==null?void 0:c.y,"-").concat(c==null?void 0:c.name,"-").concat(c==null?void 0:c.value),role:"img"}),L.createElement(gtt,tj({option:d},f)))})}},{key:"renderTrapezoidsWithAnimation",value:function(){var r=this,a=this.props,i=a.trapezoids,o=a.isAnimationActive,l=a.animationBegin,c=a.animationDuration,u=a.animationEasing,d=a.animationId,f=this.state.prevTrapezoids;return L.createElement(Dr,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"funnel-".concat(d),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(h){var m=h.t,p=i.map(function(g,y){var v=f&&f[y];if(v){var w=yt(v.x,g.x),b=yt(v.y,g.y),j=yt(v.upperWidth,g.upperWidth),N=yt(v.lowerWidth,g.lowerWidth),S=yt(v.height,g.height);return ar(ar({},g),{},{x:w(m),y:b(m),upperWidth:j(m),lowerWidth:N(m),height:S(m)})}var C=yt(g.x+g.upperWidth/2,g.x),_=yt(g.y+g.height/2,g.y),E=yt(0,g.upperWidth),T=yt(0,g.lowerWidth),P=yt(0,g.height);return ar(ar({},g),{},{x:C(m),y:_(m),upperWidth:E(m),lowerWidth:T(m),height:P(m)})});return L.createElement(He,null,r.renderTrapezoidsStatically(p))})}},{key:"renderTrapezoids",value:function(){var r=this.props,a=r.trapezoids,i=r.isAnimationActive,o=this.state.prevTrapezoids;return i&&a&&a.length&&(!o||!xi(o,a))?this.renderTrapezoidsWithAnimation():this.renderTrapezoidsStatically(a)}},{key:"render",value:function(){var r=this.props,a=r.hide,i=r.trapezoids,o=r.className,l=r.isAnimationActive,c=this.state.isAnimationFinished;if(a||!i||!i.length)return null;var u=Ge("recharts-trapezoids",o);return L.createElement(He,{className:u},this.renderTrapezoids(),(!l||c)&&ma.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curTrapezoids:r.trapezoids,prevTrapezoids:a.curTrapezoids}:r.trapezoids!==a.curTrapezoids?{curTrapezoids:r.trapezoids}:null}}])}
916(x.PureComponent);qA=nu;Ko(nu,"displayName","Funnel");Ko(nu,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",labelLine:!0,hide:!1,isAnimationActive:!Tr.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",lastShapeType:"triangle"});Ko(nu,"getRealFunnelData",function(e){var t=e.props,n=t.data,r=t.children,a=Me(e.props,!1),i=Or(r,Pa);return n&&n.length?n.map(function(o,l){return ar(ar(ar({payload:o},a),o),i&&i[l]&&i[l].props)}):i&&i.length?i.map(function(o){return ar(ar({},a),o.props)}):[]});Ko(nu,"getRealWidthHeight",function(e,t){var n=e.props.width,r=t.width,a=t.height,i=t.left,o=t.right,l=t.top,c=t.bottom,u=a,d=r;return cY(n)?d=n:Lc(n)&&(d=d*parseFloat(n)/100),{realWidth:d-i-o-50,realHeight:u-c-l,offsetX:(r-d)/2,offsetY:(a-u)/2}});Ko(nu,"getComposedData",function(e){var t=e.item,n=e.offset,r=qA.getRealFunnelData(t),a=t.props,i=a.dataKey,o=a.nameKey,l=a.tooltipType,c=a.lastShapeType,u=a.reversed,d=n.left,f=n.top,h=qA.getRealWidthHeight(t,n),m=h.realHeight,p=h.realWidth,g=h.offsetX,y=h.offsetY,v=Math.max.apply(null,r.map(function(S){return Ot(S,i,0)})),w=r.length,b=m/w,j={x:n.left,y:n.top,width:n.width,height:n.height},N=r.map(function(S,C){var _=Ot(S,i,0),E=Ot(S,o,C),T=_,P;if(C!==w-1){if(P=Ot(r[C+1],i,0),P instanceof Array){var k=P,D=jF(k,1);P=D[0]}}else if(_ instanceof Array&&_.length===2){var A=jF(_,2);T=A[0],P=A[1]}else c==="rectangle"?P=T:P=0;var I=(v-T)*p/(2*v)+f+25+g,M=b*C+d+y,$=T/v*p,R=P/v*p,O=[{name:E,value:T,payload:S,dataKey:i,type:l}],F={x:I+$/2,y:M+b/2};return ar(ar({x:I,y:M,width:Math.max($,R),upperWidth:$,lowerWidth:R,height:b,name:E,val:T,tooltipPayload:O,tooltipPosition:F},uZ(S,"width")),{},{payload:S,parentViewBox:j,labelViewBox:{x:I+($-R)/4,y:M,width:Math.abs($-R)/2+Math.min($,R),height:b}})});return u&&(N=N.map(function(S,C){var _=S.y-C*b+(w-1-C)*b;return ar(ar({},S),{},{upperWidth:S.lowerWidth,lowerWidth:S.upperWidth,x:S.x-(S.lowerWidth-S.upperWidth)/2,y:S.y-C*b+(w-1-C)*b,tooltipPosition:ar(ar({},S.tooltipPosition),{},{y:_+b/2}),labelViewBox:ar(ar({},S.labelViewBox),{},{y:_})})})),{trapezoids:N,data:r}});var Att=Ol({chartName:"FunnelChart",GraphicalChild:nu,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",axisComponents:[],defaultProps:{layout:"centric"}});function um({type:e,data:t,title:n,xColumn:r,yColumn:a,xLabel:i,yLabel:o,style:l={},height:c=uT,isLoading:u=!1}){const[d,f]=x.useState(void 0),h=(()=>{var R;if(t.length<2)return t;const $=(R=t[0])==null?void 0:R.name;return typeof $=="string"&&!isNaN(Date.parse($))?[...t].sort((O,F)=>new Date(O.name).getTime()-new Date(F.name).getTime()):t})(),m={...Vf,...l},p=ZAe(m.colorScheme),g=p[0],y=ePe(),v=m.showLegend?tPe(m.legendPosition):null,w=h.length>10,b=i??r??"",j=o??a??"",N={fontSize:12,fill:"hsl(var(--muted-foreground))"},S=b?{value:b,position:"insideBottom",offset:-5,style:N}:void 0,C=j?{value:j,angle:-90,position:"insideLeft",style:N}:void 0;if(u)return s.jsx("div",{className:"flex items-center justify-center",style:{height:c},children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"})});if(!t||t.length===0)return s.jsxs("div",{className:"flex flex-col items-center justify-center text-muted-foreground",style:{height:c},children:[s.jsx("p",{className:"text-sm",children:"No data available"}),r&&a&&s.jsxs("p",{className:"text-xs mt-1",children:[r," × ",a]})]});const _=m.showGrid?s.jsx(Fo,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}):null,E={stroke:"hsl(var(--muted-foreground))",fontSize:11},T=a||"Value",P=($,R=12)=>typeof $!="string"?$:$.length>R?`${$.slice(0,R)}…`:$,k=$=>$<=10?0:$<=20?1:$<=50?Math.floor($/10)-1:Math.floor($/8)-1,D=w?s.jsx(Cd,{dataKey:"name",height:20,stroke:"hsl(var(--border))",fill:"hsl(var(--background))",travellerWidth:8,tickFormatter:()=>"",y:c-30}):null,A=e==null?void 0:e.toLowerCase(),M=v&&!["bar","stacked-bar","column","stacked-column","line","area","stacked-area","combo","histogram","scatter","bubble"].includes(A);switch(A){case"bar":case"stacked-bar":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(Oc,{data:h,layout:"vertical",margin:{left:20},children:[_,s.jsx(Bn,{type:"number",...E,label:j?{value:j,position:"insideBottom",offset:-5,style:N}:void 0}),s.jsx(zn,{type:"category",dataKey:"name",...E,width:120,tick:{fontSize:10}
916,tickFormatter:O=>P(O,16),label:S?{...S,position:"insideLeft",angle:-90,offset:-10}:void 0}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v}),s.jsx(Gr,{dataKey:"value",fill:g,radius:[0,4,4,0],name:T,label:m.showValues?{position:"right",fontSize:10}:!1}),D]})});case"column":case"stacked-column":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(Oc,{data:h,margin:{bottom:w?45:20},children:[_,s.jsx(Bn,{dataKey:"name",...E,angle:-45,textAnchor:"end",height:80,interval:k(h.length),tickFormatter:O=>P(O),tick:{fontSize:10},label:S}),s.jsx(zn,{...E,label:C}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v}),s.jsx(Gr,{dataKey:"value",fill:g,radius:[4,4,0,0],name:T,label:m.showValues?{position:"top",fontSize:10}:!1}),D]})});case"line":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(bM,{data:h,margin:{bottom:w?45:20},children:[_,s.jsx(Bn,{dataKey:"name",...E,angle:-45,textAnchor:"end",height:80,interval:k(h.length),tickFormatter:O=>P(O),tick:{fontSize:10},label:S}),s.jsx(zn,{...E,label:C}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v}),s.jsx(vl,{type:"monotone",dataKey:"value",stroke:g,strokeWidth:2,dot:{fill:g,strokeWidth:2,r:4},name:T,label:m.showValues?{position:"top",fontSize:10}:!1}),D]})});case"area":case"stacked-area":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(ctt,{data:h,margin:{bottom:w?45:20},children:[_,s.jsx(Bn,{dataKey:"name",...E,angle:-45,textAnchor:"end",height:80,interval:k(h.length),tickFormatter:O=>P(O),tick:{fontSize:10},label:S}),s.jsx(zn,{...E,label:C}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v}),s.jsx(kl,{type:"monotone",dataKey:"value",stroke:g,fill:`${g}40`,name:T}),D]})});case"pie":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(Uy,{children:[s.jsx(cs,{data:t,cx:"50%",cy:"50%",innerRadius:0,outerRadius:Math.min(c*.35,100),paddingAngle:2,dataKey:"value",nameKey:"name",activeIndex:d,activeShape:{outerRadius:Math.min(c*.35,100)+8},onMouseEnter:(O,F)=>f(F),onMouseLeave:()=>f(void 0),label:m.showValues?({name:O,percent:F})=>`${O} (${(F*100).toFixed(0)}%)`:!1,labelLine:m.showValues,children:t.map((O,F)=>s.jsx(Pa,{fill:p[F%p.length]},`cell-${F}`))}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v})]})});case"donut":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(Uy,{children:[s.jsx(cs,{data:t,cx:"50%",cy:"50%",innerRadius:Math.min(c*.2,50),outerRadius:Math.min(c*.35,90),paddingAngle:3,dataKey:"value",nameKey:"name",activeIndex:d,activeShape:{outerRadius:Math.min(c*.35,90)+8},onMouseEnter:(O,F)=>f(F),onMouseLeave:()=>f(void 0),label:m.showValues?({name:O,percent:F})=>`${O} (${(F*100).toFixed(0)}%)`:!1,labelLine:m.showValues,children:t.map((O,F)=>s.jsx(Pa,{fill:p[F%p.length]},`cell-${F}`))}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v})]})});case"scatter":case"bubble":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(ltt,{children:[_,s.jsx(Bn,{dataKey:"name",type:"category",...E,label:S}),s.jsx(zn,{dataKey:"value",...E,label:C}),A==="bubble"&&s.jsx(Gm,{type:"number",range:[60,400]}),s.jsx(kt,{contentStyle:y,cursor:{strokeDasharray:"3 3"}}),M&&s.jsx(vn,{...v}),s.jsx(Ym,{name:T,data:h,fill:g})]})});case"radar":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(ott,{cx:"50%",cy:"50%",outerRadius:"70%",data:t,children:[s.jsx(qQ,{stroke:"hsl(var(--border))"}),s.jsx(Fd,{dataKey:"name",stroke:"hsl(var(--muted-foreground))",tick:{fontSize:10}}),s.jsx(Ld,{stroke:"hsl(var(--muted-foreground))",tick:{fontSize:10}}),s.jsx(Vv,{name:T,dataKey:"value",stroke:g,fill:g,fillOpacity:.5}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v})]})});case"radial":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(utt,{cx:"50%",cy:"50%",innerRadius:"20%",outerRadius:"90%",barSize:20,data:t,startAngle:180,endAngle:0,children:[s.jsx(Wv,{background:!0,dataKey:"value",cornerRadius:10,children:t.map((O,F)=>s.jsx(Pa,{fill:p[F%p.length]},`cell-${F}`))}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v})]})});case"combo":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(dtt,{data:h,margin:{bottom:w?45:20},children:[_,s.jsx(Bn,{dataKey:"name",...E,angle:-45,textAnchor:"end",height:80,interval:k(h.length),tickFormatter:O=>P(O),tick:{fontSize:10},label:S}),s.jsx(zn,{...E,label:C}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v}),s.jsx(Gr,{dataKey:"value",fill:g,radius:[4,4,0,0],name:T}),s.jsx(vl,{type:"monotone",dataKey:"value",stroke:p[1]||"#ff7300",strokeWidth:2,dot:!1}),D]})});case"funnel":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(Att,{children:[s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v}),s.jsxs(nu,{dataKey:"value",data:t,isAnimationActive:!0,children:[t.map((O,F)=>s.jsx(Pa,{fill:p[F%p.length]},`cell-${F}`)),s.jsx(ma,{position:"center",fill:"#fff",stroke:"none",dataKey:"name",fontSize:11})]})]})});case"treemap":return s.jsx(Cn,{width:"100%",height:c,children:s.jsx(NM,{data:t,dataKey:"value",aspectRatio:4/3,stroke:"#fff",fill:g,children:t.map((O,F)=>s.jsx(Pa,{fill:p[F%p.length]},`cell-${F}`))})});case"histogram":return s.jsx(Cn,{width:"100%",height:c,children:s.jsxs(Oc,{data:h,barGap:0,barCategoryGap:0,margin:{bottom:w?45:20},children:[_,s.jsx(Bn,{dataKey:"name",...E,angle:-45,textAnchor:"end",height:80,interval:k(h.length),tickFormatter:O=>P(O),tick:{fontSize:10},label:S}),s.jsx(zn,{...E,label:C}),s.jsx(kt,{contentStyle:y}),M&&s.jsx(vn,{...v}),s.jsx(Gr,{dataKey:"value",fill:g,name:T}),D]})});case"heatmap":const $=Math.max(...t.map(O=>O.value||0),1);return s.jsx("div",{className:"overflow-auto",style:{maxHeight:c},children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"sticky top-0 bg-card",children:s.jsxs("tr",{className:"border-b",children:[s.jsx("th",{className:"text-left p-2 font-medium",children:r||"Category"}),s.jsx("th",{className:"text-right p-2 font-medium",children:a||"Value"})]})}),s.jsx("tbody",{children:t.map((O,F)=>{var B;const z=(O.value||0)/$;return s.jsxs("tr",{className:"border-b border-border/50",children:[s.jsx("td",{className:"p-2",children:O.name}),s.jsx("td",{className:"p-2 text-right font-mono",style:{backgroundColor:`${g}${Math.round(z*80).toString(16).padStart(2,"0")}`}
916,children:(B=O.value)==null?void 0:B.toLocaleString()})]},F)})})]})});case"table":return s.jsx("div",{className:"overflow-auto",style:{maxHeight:c},children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"sticky top-0 bg-card",children:s.jsxs("tr",{className:"border-b",children:[s.jsx("th",{className:"text-left p-2 font-medium",children:r||"Category"}),s.jsx("th",{className:"text-right p-2 font-medium",children:a||"Value"})]})}),s.jsx("tbody",{children:t.map((O,F)=>{var z;return s.jsxs("tr",{className:"border-b border-border/50 hover:bg-muted/50",children:[s.jsx("td",{className:"p-2",children:O.name}),s.jsx("td",{className:"p-2 text-right font-mono",children:(z=O.value)==null?void 0:z.toLocaleString()})]},F)})})]})});case"kpi":const R=t.reduce((O,F)=>O+(F.value||0),0);return s.jsxs("div",{className:"flex flex-col items-center justify-center space-y-2",style:{height:c},children:[s.jsx("span",{className:"text-5xl font-bold",style:{color:g},children:R.toLocaleString()}),s.jsx("span",{className:"text-muted-foreground text-sm",children:n||T})]});default:return s.jsx("div",{className:"flex items-center justify-center text-muted-foreground",style:{height:c},children:s.jsxs("p",{className:"text-sm",children:['Chart type "',e,'" not supported']})})}}const Ptt=e=>({3:"col-span-3",4:"col-span-4",6:"col-span-6",12:"col-span-12"})[e]||"col-span-6",_F=e=>["int","float","number","int64","float64","int32","float32","numeric","decimal"].some(n=>e.toLowerCase().includes(n)),EF=e=>["str","string","object","category","text","varchar"].some(n=>e.toLowerCase().includes(n)),AF=e=>["date","datetime","timestamp","time"].some(n=>e.toLowerCase().includes(n)),PF=({chart:e,previewData:t,isLoadingPreview:n,selectedDataset:r})=>{const a=JK(),i=x.useMemo(()=>{if(!(t!=null&&t.data)||!e.x_column)return[];let l=t.data;a!=null&&a.hasActiveFilters&&(l=a.getFilteredData(l));const c=e.type==="pie"&&!e.y_column?"count":e.aggregation||"sum";return QG(l,e.x_column,e.y_column||e.x_column,c,{sortByValue:!0,sortDirection:"desc",limit:15})},[t==null?void 0:t.data,e,a==null?void 0:a.hasActiveFilters,a==null?void 0:a.getFilteredData,a==null?void 0:a.activeFilters]),o=e.style||Vf;return s.jsx(um,{type:e.type,data:i,title:e.title,xColumn:e.x_column,yColumn:e.y_column,style:o,height:uT,isLoading:n&&!!r})},ktt=()=>{var ki,Dl;const e=cn(),[t]=ov(),{id:n}=iv(),r=!!n,[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(""),[d,f]=x.useState([]),[h,m]=x.useState(!1),[p,g]=x.useState(!1),[y,v]=x.useState(null),[w,b]=x.useState(!1),[j,N]=x.useState(!1),[S,C]=x.useState(null),[_,E]=x.useState(!1),[T,P]=x.useState(!1),[k,D]=x.useState(null),[A,I]=x.useState(!1),[M,$]=x.useState(-1),[R,O]=x.useState(null),[F,z]=x.useState(!1),[B,H]=x.useState(!1),[Y,ee]=x.useState([]),[V,K]=x.useState(-1),W=x.useRef(!1),[q,J]=x.useState(null),[ie,X]=x.useState(null),{data:ge,isLoading:Se}=s1(),ce=(ge==null?void 0:ge.items)||[],{data:ye,isLoading:Ie}=T7(n),Ue=Ume(),Ze=Vme(),fe=zk(),{data:Oe,isLoading:Et}=Wk(c||void 0,{limit:1e3}),oe=x.useMemo(()=>{if(!(Oe!=null&&Oe.columns))return{numeric:[],categorical:[],date:[],all:[]};const ne=[],ke=[],ht=[];return Oe.columns.forEach(xt=>{_F(xt.type)?ne.push(xt):AF(xt.type)?ht.push(xt):(EF(xt.type),ke.push(xt))}),{numeric:ne,categorical:ke,date:ht,all:Oe.columns}},[Oe==null?void 0:Oe.columns]);x.useEffect(()=>{var ne;if(r&&ye&&!h){if(i(ye.name||""),l(ye.description||""),u(ye.data_source_id||""),(ne=ye.config)!=null&&ne.visualizations){const ke=iue(ye.config.visualizations);f(ke)}m(!0)}},[r,ye,h]),x.useEffect(()=>{r&&ye&&ye.can_edit===!1&&e(`/dashboard/reports/${n}`,{replace:!0})},[r,ye,n,e]),x.useEffect(()=>{if(r)return;const ne=t.get("dataset");if(ne&&ce.length>0){u(ne);const ke=ce.find(ht=>ht.id===ne);ke&&se.success(`Dataset "${ke.name}" selected`)}},[t,ce,r]),x.useEffect(()=>{if(W.current){W.current=!1;return}if(d.length===0&&Y.length===0)return;const ne=Y[V];if(ne&&JSON.stringify(ne)===JSON.stringify(d))return;const ke=Y.slice(0,V+1);ke.push([...d]),ke.length>50&&ke.shift(),ee(ke),K(ke.length-1)},[d]);const Je=V>0,ut=V<Y.length-1,Q=x.useCallback(()=>
916{if(!Je)return;W.current=!0;const ne=V-1;K(ne),f([...Y[ne]]),se.info("Undone")},[Je,V,Y]),he=x.useCallback(()=>{if(!ut)return;W.current=!0;const ne=V+1;K(ne),f([...Y[ne]]),se.info("Redone")},[ut,V,Y]),ve=x.useCallback(ne=>{J({...ne}),se.success("Copied to clipboard")},[]),xe=x.useCallback(()=>{if(!q)return;const ne={...q,id:`${q.blockType}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`};if(ie){const ke=d.findIndex(ht=>ht.id===ie);if(ke>=0){const ht=[...d];ht.splice(ke+1,0,ne),f(ht),X(ne.id),se.success("Pasted");return}}f([...d,ne]),X(ne.id),se.success("Pasted")},[q,ie,d]),Ce=x.useCallback(ne=>{const ke={...ne,id:`${ne.blockType}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`},ht=d.findIndex(xt=>xt.id===ne.id);if(ht>=0){const xt=[...d];xt.splice(ht+1,0,ke),f(xt),X(ke.id),se.success("Block duplicated")}},[d]),Be=x.useCallback(ne=>{X(ne)},[]),$r=ne=>{var ke,ht,xt,Ga,su,iu,ou,lu;try{if(!c){se.error("Please select a dataset first");return}if(!(Oe!=null&&Oe.data)||Oe.data.length===0){se.error("Dataset has no data to visualize");return}if(!(Oe!=null&&Oe.columns)||Oe.columns.length===0){se.error("Dataset has no columns to visualize");return}const $l=((ht=(ke=oe.categorical)==null?void 0:ke[0])==null?void 0:ht.name)||((Ga=(xt=oe.date)==null?void 0:xt[0])==null?void 0:Ga.name)||((iu=(su=oe.all)==null?void 0:su[0])==null?void 0:iu.name)||"",Bd=((lu=(ou=oe.numeric)==null?void 0:ou[0])==null?void 0:lu.name)||"",yo=ne||"bar",zd={id:Date.now().toString(),blockType:"chart",type:yo,title:`${yo.charAt(0).toUpperCase()+yo.slice(1)} Chart`,x_column:$l,y_column:Bd,aggregation:"sum",style:{...Vf}};b(!0),v(zd),g(!0)}catch($l){console.error("Error initiating chart:",$l),se.error("Failed to create chart. Please try again.")}},mr=["paragraph","heading-1","heading-2","heading-3"],At=ne=>{const ke=x2(ne);if(mr.includes(ne)){const ht={...ke,content:"",layout:ke.layout||Ea(ke.type)};if(M===-1)f([ht,...d]);else if(M>=0&&M<d.length){const xt=[...d];xt.splice(M+1,0,ht),f(xt)}else f([...d,ht]);X(ke.id),O(ke.id),$(-1)}else E(!0),C(ke),N(!0)},Pi=(ne="dropdown")=>{var xt,Ga,su,iu,ou,lu,$l,Bd,yo,zd,Kv,Gv;if(!c){se.error("Please select a dataset first");return}if(!(Oe!=null&&Oe.columns)||Oe.columns.length===0){se.error("Dataset has no columns to filter");return}let ke="";ne==="date-range"?ke=((Ga=(xt=oe.date)==null?void 0:xt[0])==null?void 0:Ga.name)||((iu=(su=oe.all)==null?void 0:su[0])==null?void 0:iu.name)||"":ne==="numeric-range"?ke=((lu=(ou=oe.numeric)==null?void 0:ou[0])==null?void 0:lu.name)||((Bd=($l=oe.all)==null?void 0:$l[0])==null?void 0:Bd.name)||"":ke=((zd=(yo=oe.categorical)==null?void 0:yo[0])==null?void 0:zd.name)||((Gv=(Kv=oe.all)==null?void 0:Kv[0])==null?void 0:Gv.name)||"";const ht=xU(ke,ne);I(!0),D(ht),P(!0)},Ha=ne=>{if(Oo(ne))E(!1),C(ne),N(!0);else if(Li(ne))I(!1),D(ne),P(!0);
916else{const ke=ne,ht={...ke,blockType:"chart",style:ke.style||{...Vf}};b(!1),v(ht),g(!0)}},ru=ne=>{v({...ne,blockType:"chart"})},Tl=ne=>{C(ne)},Ml=()=>{if(!y)return;if(!y.x_column){se.error("Please select an X-axis column");return}if(!y.y_column&&y.type!=="pie"){se.error("Please select a Y-axis column");return}const ne={...y,layout:y.layout||Ea(y.type)};if(w){if(M===-1)f([ne,...d]);else if(M>=0&&M<d.length){const ke=[...d];ke.splice(M+1,0,ne),f(ke)}else f([...d,ne]);se.success(`${ne.type.charAt(0).toUpperCase()+ne.type.slice(1)} chart added`)}else f(d.map(ke=>ke.id===ne.id?ne:ke)),se.success("Chart updated");g(!1),v(null),b(!1),$(-1)},Rl=()=>{if(!S)return;const ne={...S,layout:S.layout||Ea(S.type)};if(_){if(M===-1)f([ne,...d]);else if(M>=0&&M<d.length){const ke=[...d];ke.splice(M+1,0,ne),f(ke)}else f([...d,ne]);se.success("Text block added")}else f(d.map(ke=>ke.id===ne.id?ne:ke)),se.success("Text block updated");N(!1),C(null),E(!1),$(-1)},au=()=>{g(!1),v(null),b(!1),$(-1)},yn=()=>{N(!1),C(null),E(!1),$(-1)},Zt=ne=>{D(ne)},er=()=>{if(!k)return;if(!k.column){se.error("Please select a column to filter");return}const ne={...k,layout:k.layout||Ea(k.slicerType)};if(A){if(M===-1)f([ne,...d]);else if(M>=0&&M<d.length){const ke=[...d];ke.splice(M+1,0,ne),f(ke)}else f([...d,ne]);se.success("Filter added")}else f(d.map(ke=>ke.id===ne.id?ne:ke)),se.success("Filter updated");P(!1),D(null),I(!1),$(-1)},Ve=()=>{P(!1),D(null),I(!1),$(-1)},lt=x.useCallback((ne,ke)=>{f(ht=>ht.map(xt=>xt.id===ne?{...xt,content:ke}:xt))},[]),ft=x.useCallback(()=>{O(null)},[]),en=x.useCallback(ne=>{O(ne)},[]),On=(ne,ke)=>{$(ne),ke==="chart"?$r():ke==="filter"?Pi("dropdown"):At("paragraph")},zt=ne=>{const ke=d.find(ht=>ht.id===ne);f(d.filter(ht=>
916ht.id!==ne)),se.success(Oo(ke)?"Text block removed":"Chart removed")},qn=(ne,ke)=>{d.length>0&&!confirm("Esto reemplazará el contenido actual del reporte. ¿Continuar?")||(f(ne),a||i(ke),z(!0),se.success(`Reporte AI generado con ${ne.length} bloques`))},tn=ne=>{const ht={bar:"bar",line:"line",pie:"pie",area:"area",scatter:"line",histogram:"bar"}[ne.chart_type]||"bar",xt={id:Date.now().toString()+Math.random().toString(36).substr(2,9),blockType:"chart",type:ht,title:ne.title,x_column:ne.config.x_column,y_column:ne.config.y_column,aggregation:ne.config.aggregation,style:{...Vf}};f(Ga=>[...Ga,xt]),se.success(`Added: ${ne.title}`)},Tn=async()=>{if(!a){se.error("Please enter a report name");return}if(!c){se.error("Please select a dataset");return}if(d.length===0){se.error("Please add at least one block (chart or text)");return}const ne=WD(d),ke={title:a,subtitle:o||void 0,visualizations:ne,layout:{columns:2,spacing:16}};try{if(r&&n)await Ze.mutateAsync({id:n,data:{name:a,description:o||void 0,data_source_id:c,config:ke}}),se.success("Report updated successfully!"),e(`/dashboard/reports/${n}`);else{const ht={name:a,description:o||void 0,data_source_id:c,visibility:"PRIVATE",config:ke},xt=await Ue.mutateAsync(ht);se.success("Report saved successfully!"),e(`/dashboard/reports/${xt.id}`)}}catch(ht){console.error("Failed to save report:",ht),se.error(`Failed to ${r?"update":"save"} report. Please try again.`)}},fs=async ne=>{if(d.length===0){se.error("No content to export");return}if(!a){se.error("Please enter a report name before exporting");return}if(!c){se.error("Please select a dataset before exporting");return}const ke=WD(d),ht={name:a,description:o||void 0,data_source_id:c,visibility:"PRIVATE",config:{title:a,subtitle:o||void 0,visualizations:ke,layout:{columns:2,spacing:16}}};try{se.info(`Saving report and exporting to ${ne.toUpperCase()}...`);const xt=await Ue.mutateAsync(ht);await fe.mutateAsync({reportId:xt.id,format:ne}),se.success(`Report exported as ${ne.toUpperCase()}`),e(`/dashboard/reports/${xt.id}`)}catch(xt){console.error("Failed to export report:",xt),se.error("Failed to export report. Please try again.")}},go=ne=>{var ke;return Oo(ne)?s.jsx(rg,{block:ne}):Li(ne)?s.jsx(cE,{block:ne,data:Oe==null?void 0:Oe.data,editMode:!1,compact:(ke=ne.style)==null?void 0:ke.compact}):s.jsx(PF,{chart:ne,previewData:Oe,isLoadingPreview:Et,selectedDataset:c})};if(r&&Ie)return s.jsx("div",{className:"flex items-center justify-center h-[60vh]",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(Te,{className:"h-12 w-12 animate-spin mx-auto text-primary"}),s.jsx("p",{className:"text-muted-foreground",children:"Loading report..."})]})});if(r&&!Ie&&!ye)return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(U,{variant:"ghost",onClick:()=>e("/dashboard/reports"),children:[s.jsx(Yr,{className:"mr-2 h-4 w-4"}),"Back to Reports"]}),s.jsx("div",{className:"flex items-center justify-center h-[50vh]",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"h-24 w-24 rounded-full bg-muted flex items-center justify-center mx-auto",children:s.jsx(Xn,{className:"h-12 w-12 text-muted-foreground"})}),s.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Report not found"}),s.jsx("p",{className:"text-muted-foreground",children:"The report you're trying to edit doesn't exist or has been deleted."}),s.jsx(U,{onClick:()=>e("/dashboard/reports"),children:"Go to Reports"})]})})]});const Ka=Ue.isPending||Ze.isPending;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>e(r?`/dashboard/reports/${n}`:"/dashboard/reports"),children:s.jsx(Yr,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:r?"Edit Report":"Create Report"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:r?"Modify your report configuration":"Build visualizations from your data"})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(U,{variant:"outline",disabled:d.length===0,onClick:()=>H(!0),children:[s.jsx(ui,{className:"mr-2 h-4 w-4"}),"Preview"]}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsxs(U,{variant:"outline",disabled:d.length===0,children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),"Export"]})}),s.jsxs(Xr,{align:"end",className:"w-48",children:[s.jsx(n1,{children:"Export Format"}),s.jsx(ha,{}),s.jsxs(Xe,{onClick:()=>fs("pdf"),children:[s.jsx(di,{className:"mr-2 h-4 w-4"}),"PDF Document"]}),s.jsxs(Xe,{onClick:()=>fs("html"),children:[s.jsx(di,{className:"mr-2 h-4 w-4"}),"HTML Report"]}),s.jsxs(Xe,{onClick:()=>fs("xlsx"),children:[s.jsx(_s,{className:"mr-2 h-4 w-4"}),"Excel Spreadsheet"]}),s.jsx(ha,{}),s.jsxs(Xe,{onClick:()=>fs("png"),children:[s.jsx(hh,{className:"mr-2 h-4 w-4"}),"PNG Image"]})]})]}),s.jsx(U,{className:"bg-gradient-primary",onClick:Tn,disabled:Ka,children:Ka?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),r?"Updating...":"Saving..."]}):s.jsxs(s.Fragment,{children:[s.jsx(QB,{className:"mr-2 h-4 w-4"}),r?"Update Report":"Save Report"]})})]})]}),s.jsxs("div",{className:"flex gap-0 relative",children:[s.jsx("div",{className:"flex-shrink-0 flex flex-col items-center pt-2",children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>z(!F),title:F?"Open sidebar":"Collapse sidebar",children:F?s.jsx(Are,{className:"h-4 w-4"}):s.jsx(Ere,{className:"h-4 w-4"})})}),s.jsxs("div",{className:te("space-y-6 transition-all duration-300 flex-shrink-0",F?"w-0 overflow-hidden opacity-0":"w-[320px] lg:w-[340px] opacity-100 pl-2 pr-4"),children:[s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"Report Details"})}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"name",children:"Report Name"}),s.jsx(Re,{id:"name",placeholder:"Q4 Sales Dashboard",value:a,onChange:ne=>i(ne.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"description",children:"Description"}),s.jsx(Aa,{id:"description",placeholder:"Add a description...",value:o,onChange:ne=>l(ne.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Data Source"}),s.jsxs(rt,{value:c,onValueChange:u,children:[s.jsx(tt,{className:"w-full",children:Se?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Te,{className:"h-4 w-4 animate-spin"}),s.jsx("span",{className:"text-muted-foreground",children:"Loading datasets..."})]}):s.jsx("span",{className:"flex items-center gap-2 truncate",children:c?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"flex-shrink-0",children:"📄"}),s.jsx("span",{className:"truncate",title:(ki=ce.find(ne=>ne.id===c))==null?void 0:ki.name,children:((Dl=ce.find(ne=>ne.id===c))==null?void 0:Dl.name)||"Select dataset"})]}):s.jsx("span",{className:"text-muted-foreground",children:"Select dataset"})})}),s.jsx(nt,{children:ce.length===0?s.jsx("div",{className:"px-2 py-4 text-center text-sm text-muted-foreground",children:"No datasets available. Upload a dataset first."}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Your Datasets"}),ce.map(ne=>s.jsx(_e,{value:ne.id,title:ne.name,children:s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"flex-shrink-0",children:"📄"}),s.jsx("span",{className:"truncate",children:ne.name})]})},ne.id))]})})]})]})]})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Add Content"}),s.jsx(it,{children:"Add charts or text blocks to your report"})]}),s.jsx(le,{children:s.jsx(BNe,{onSelectChart:$r,disabled:!c||Et})})]}),r&&(ye==null?void 0:ye.can_share)&&s.jsx(LNe,{reportId:n}),s.jsx(INe,{datasetId:c||void 0,onAddChart:tn,onApplySmartReport:qn,disabled:!(Oe!=null&&Oe.data)||Et})]}),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsxs(Z,{className:"min-h-[600px]",children:[s.jsx(we,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(Ne,{children:"Report Canvas"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs($e,{variant:"secondary",children:[d.filter(ne=>rue(ne)).length," charts"]}),s.jsxs($e,{variant:"outline",children:[d.filter(ne=>Oo(ne)).length," text"]}),d.filter(ne=>Li(ne)).length>0&&s.jsxs($e,{variant:"outline",className:"border-primary/50",children:[s.jsx(Va,{className:"h-3 w-3 mr-1"}),d.filter(ne=>Li(ne)).length," filters"]})]})]})}),s.jsx(le,{children:s.jsx(WCe,{blocks:d,onBlocksChange:f,onEditBlock:Ha,onDeleteBlock:zt,onDuplicateBlock:Ce,onInsertBlock:On,renderBlockContent:go,previewData:Oe==null?void 0:Oe.data,copiedBlock:q,onCopyBlock:ve,onPasteBlock:xe,canUndo:Je,canRedo:ut,onUndo:Q,onRedo:he,selectedBlockId:ie,onSelectBlock:Be,disabled:!c||Et,inline
916EditingBlockId:R,onInlineTextChange:lt,onInlineEditEnd:ft,onStartInlineEdit:en})})]})})]}),s.jsx(Sb,{open:p,onOpenChange:g,children:s.jsxs(eg,{className:"sm:max-w-md overflow-y-auto",children:[s.jsx(tg,{className:"sr-only",children:s.jsx(ng,{children:w?"Configure New Chart":"Edit Chart"})}),y&&s.jsx(nPe,{chart:y,columns:oe,onUpdate:ru,onCancel:au,onSave:Ml,isNew:w})]})}),s.jsx(Sb,{open:j,onOpenChange:N,children:s.jsxs(eg,{className:"sm:max-w-md overflow-y-auto",children:[s.jsx(tg,{className:"sr-only",children:s.jsx(ng,{children:_?"Add Text Block":"Edit Text Block"})}),S&&s.jsx(UNe,{block:S,onUpdate:Tl,onCancel:yn,onSave:Rl,isNew:_})]})}),s.jsx(Sb,{open:T,onOpenChange:P,children:s.jsxs(eg,{className:"sm:max-w-md overflow-y-auto",children:[s.jsx(tg,{className:"sr-only",children:s.jsx(ng,{children:A?"Add Filter":"Edit Filter"})}),k&&s.jsxs("div",{className:"space-y-4",children:[s.jsx(JAe,{block:k,columns:oe.all.map(ne=>({name:ne.name,type:AF(ne.type)?"date":_F(ne.type)?"number":EF(ne.type)?"string":"unknown"})),onUpdate:Zt}),s.jsxs("div",{className:"flex gap-2 pt-4 border-t",children:[s.jsx(U,{variant:"outline",className:"flex-1",onClick:Ve,children:"Cancel"}),s.jsx(U,{className:"flex-1 bg-gradient-primary",onClick:er,children:A?"Add Filter":"Update Filter"})]})]})]})}),s.jsx(br,{open:B,onOpenChange:H,children:s.jsxs(or,{className:"max-w-[90vw] max-h-[90vh] overflow-y-auto",children:[s.jsxs(lr,{children:[s.jsx(cr,{children:a||"Report Preview"}),s.jsx(wr,{children:o||"Preview of your report content"})]}),d.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[s.jsx(ui,{className:"h-12 w-12 text-muted-foreground mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"No content to preview"})]}):s.jsx("div",{className:"grid grid-cols-12 gap-4 mt-4",children:d.map(ne=>{var Ga;const ke=Li(ne)?ne.slicerType:ne.type,ht=ne.layout||Ea(ke),xt=Ptt(ht.colSpan);return s.jsx(Z,{className:xt,children:Oo(ne)?s.jsx(le,{className:"pt-6",children:s.jsx(rg,{block:ne})}):Li(ne)?s.jsxs(s.Fragment,{children:[s.jsx(we,{className:"pb-2",children:s.jsxs(Ne,{className:"text-sm flex items-center gap-2",children:[s.jsx(Va,{className:"h-3.5 w-3.5 text-primary"}),ne.title||"Filter"]})}),s.jsx(le,{children:s.jsx(cE,{block:ne,data:Oe==null?void 0:Oe.data,editMode:!1,compact:(Ga=ne.style)==null?void 0:Ga.compact})})]}):s.jsxs(s.Fragment,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm",children:ne.title||"Chart"})}),s.jsx(le,{children:s.jsx(PF,{chart:ne,previewData:Oe,isLoadingPreview:Et,selectedDataset:c})})]})},ne.id)})})]})})]})},kF=()=>s.jsx(QK,{children:s.jsx(ktt,{})}),Ott=(e,t)=>{const n=e.toLowerCase();let r=nd,a="text-blue-600";return n.includes("total")||n.includes("registros")?(r=wt,a="text-blue-600"):n.includes("promedio")||n.includes("average")?(r=mre,a="text-purple-600"):n.includes("categoría")||n.includes("category")||n.includes("único")?(r=tl,a="text-orange-600"):(n.includes("power")||n.includes("potencia"))&&(r=Xn,a="text-green-600"),t==="positive"?a="text-green-600":t==="negative"&&(a="text-red-600"),{icon:r,color:a}},Ttt=e=>{switch(e){case"positive":return Wa;case"negative":return ek;default:return Rg}},Mtt=e=>{switch(e){case"positive":return"text-green-600";case"negative":return"text-red-600";default:return"text-muted-foreground"}},Rtt=({kpis:e})=>!e||e.length===0?null:s.jsx("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:e.map(t=>{const{icon:n,color:r}=Ott(t.label,t.changeType),a=Ttt(t.changeType),i=Mtt(t.changeType);return s.jsxs(Z,{className:"hover:shadow-lg transition-shadow",children:[s.jsxs(we,{className:"flex flex-row items-center justify-between pb-2",children:[s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground truncate pr-2",children:t.label}),s.jsx(n,{className:`h-5 w-5 flex-shrink-0 ${r}`})]}),s.jsxs(le,{children:[s.jsx("div",{className:"text-2xl font-bold text-foreground",children:t.value}),t.change!==void 0&&s.jsxs("div",{className:`flex items-center gap-1 mt-1 ${i}`,children:[s.jsx(a,{className:"h-4 w-4"}),s.jsxs("span",{className:"text-xs font-medium",children:[t.change>0?"+":"",t.change,"%"]})]})]})]},t.id)})}),Dtt=e=>{switch(e){case"warning":return{icon:ad,classes:"bg-amber-50 border-amber-200 text-amber-800 dark:bg-amber-950 dar
916k:border-amber-800 dark:text-amber-200",iconColor:"text-amber-600 dark:text-amber-400"};case"success":return{icon:_j,classes:"bg-green-50 border-green-200 text-green-800 dark:bg-green-950 dark:border-green-800 dark:text-green-200",iconColor:"text-green-600 dark:text-green-400"};case"trend":return{icon:Wa,classes:"bg-blue-50 border-blue-200 text-blue-800 dark:bg-blue-950 dark:border-blue-800 dark:text-blue-200",iconColor:"text-blue-600 dark:text-blue-400"};case"opportunity":return{icon:kj,classes:"bg-indigo-50 border-indigo-200 text-indigo-800 dark:bg-indigo-950 dark:border-indigo-800 dark:text-indigo-200",iconColor:"text-indigo-600 dark:text-indigo-400"};case"risk":return{icon:Rre,classes:"bg-orange-50 border-orange-200 text-orange-800 dark:bg-orange-950 dark:border-orange-800 dark:text-orange-200",iconColor:"text-orange-600 dark:text-orange-400"};case"action":return{icon:ZP,classes:"bg-emerald-50 border-emerald-200 text-emerald-800 dark:bg-emerald-950 dark:border-emerald-800 dark:text-emerald-200",iconColor:"text-emerald-600 dark:text-emerald-400"};case"info":default:return{icon:ym,classes:"bg-slate-50 border-slate-200 text-slate-800 dark:bg-slate-900 dark:border-slate-700 dark:text-slate-200",iconColor:"text-slate-600 dark:text-slate-400"}}},$tt=({insights:e})=>!e||e.length===0?null:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h4",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[s.jsx(kj,{className:"h-4 w-4 text-amber-500"}),"Insights Clave"]}),s.jsx("div",{className:"space-y-2",children:e.map(t=>{const n=Dtt(t.type),r=n.icon;return s.jsxs("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${n.classes}`,children:[s.jsx(r,{className:`h-5 w-5 mt-0.5 flex-shrink-0 ${n.iconColor}`}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm leading-relaxed",children:t.text}),t.action&&s.jsxs("p",{className:"text-xs text-muted-foreground mt-1 italic",children:["→ ",t.action]})]})]},t.id)})})]}),Itt={beginner:"Basico",intermediate:"Intermedio",advanced:"Avanzado"},Ltt={beginner:"border-green-300 text-green-700 dark:border-green-700 dark:text-green-400",intermediate:"border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-400",advanced:"border-purple-300 text-purple-700 dark:border-purple-700 dark:text-purple-400"},Ftt=({suggestions:e,onSelect:t})=>!e||e.length===0?null:s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h4",{className:"text-sm font-semibold text-foreground flex items-center gap-2",children:[s.jsx(Cre,{className:"h-4 w-4 text-primary"}),"Preguntas Relacionadas"]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(n=>s.jsxs(U,{variant:"outline",size:"sm",className:"h-auto py-2 px-3 text-left whitespace-normal text-xs hover:bg-primary/5 hover:border-primary/50 transition-all group",onClick:()=>t(n.text),children:[s.jsx("span",{className:"line-clamp-2",children:n.text}),n.depth&&n.depth!=="beginner"&&s.jsx($e,{variant:"outline",className:`ml-1.5 text-[10px] px-1 py-0 flex-shrink-0 ${Ltt[n.depth]||""}`,children:Itt[n.depth]||n.depth}),s.jsx(D_,{className:"h-3 w-3 ml-2 flex-shrink-0 opacity-0 group-hover:opacity-100 transition-opacity"})]},n.id))})]}),pZ=({answer:e,messageId:t,onFollowUpSelect:n,onChartDownload:r})=>{const[a,i]=x.useState(!1),o=e.charts&&e.charts.length>0,l=!o&&e.chart_data&&e.chart_data.length>0;return s.jsxs("div",{className:"space-y-4",children:[e.summary&&s.jsxs(Z,{className:"bg-gradient-to-br from-primary/5 via-background to-accent/5 border-primary/20",children:[s.jsx(we,{className:"pb-2",children:s.jsxs(Ne,{className:"text-base font-semibold flex items-center gap-2",children:[s.jsx(di,{className:"h-5 w-5 text-primary"}),"Resumen Ejecutivo"]})}),s.jsx(le,{children:s.jsx("p",{className:"text-sm text-foreground leading-relaxed",children:e.summary})})]}),e.kpis&&e.kpis.length>0&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-semibold text-foreground mb-3",children:"Metricas Principales"}),s.jsx(Rtt,{kpis:e.kpis})]}),o&&s.jsx("div",{className:"space-y-4",children:e.charts.map((c,u)=>{const d=`chart-${t}-${u}`;return s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-semibold",children:c.title})}),s.jsxs(le,{children:[s.jsx("div",{id:d,children:s.jsx(um,{type:c.chart_type||"bar",data:c.chart_data,xLabel:c.x_label||"Categoria",yLabel:c.y_label||"Valor",height:250,style:{colorScheme:"primary",showLegend:!1,showGrid:!0,showValues:!0,legendPosition:"bottom"}})}),s.jsx("div",{className:"flex gap-2 mt-3 pt-3 border-t",children:s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>r(d,c.title),children:[s.jsx(hh,{className:"h-4 w-4 mr-2"}),"Descargar PNG"]})})]})]},u)})}),l&&s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-base font-semibold",children:"Visualizacion"})}
916),s.jsxs(le,{children:[s.jsx("div",{id:`chart-${t}`,children:s.jsx(um,{type:e.chart_type||"bar",data:e.chart_data,xLabel:e.x_label||"Categoria",yLabel:e.y_label||"Valor",height:280,style:{colorScheme:"primary",showLegend:!1,showGrid:!0,showValues:!0,legendPosition:"bottom"}})}),s.jsx("div",{className:"flex gap-2 mt-3 pt-3 border-t",children:s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>r(`chart-${t}`,e.text||"chart"),children:[s.jsx(hh,{className:"h-4 w-4 mr-2"}),"Descargar PNG"]})})]})]}),e.insights&&e.insights.length>0&&s.jsx($tt,{insights:e.insights}),e.follow_ups&&e.follow_ups.length>0&&s.jsx(Ftt,{suggestions:e.follow_ups,onSelect:n}),e.code&&s.jsxs("div",{className:"pt-2 border-t",children:[s.jsxs("button",{onClick:()=>i(!a),className:"flex items-center gap-2 text-xs text-muted-foreground hover:text-foreground transition-colors py-1",children:[s.jsx(HP,{className:"h-4 w-4"}),s.jsx("span",{children:"Ver codigo generado"}),a?s.jsx(Zi,{className:"h-4 w-4"}):s.jsx(Jr,{className:"h-4 w-4"})]}),a&&s.jsx("pre",{className:"mt-2 p-3 bg-slate-950 text-slate-50 rounded-lg text-xs overflow-x-auto",children:s.jsx("code",{children:e.code})})]})]})},gZ=({className:e})=>{const{data:t}=qk();if(!(t!=null&&t.daily_queries_limit)&&(t==null?void 0:t.daily_queries_limit)!==0)return null;const n=t.daily_queries_limit===-1,r=t.limit_reached,a=t.approaching_limit,i=r?"text-destructive font-semibold":a?"text-yellow-600 dark:text-yellow-400 font-medium":"text-muted-foreground";let o;return n?o=`${t.daily_queries_used||0} queries today`:r?o=`Limit reached: ${t.daily_queries_used}/${t.daily_queries_limit} queries today`:a?o=`${t.daily_queries_used}/${t.daily_queries_limit} queries today (${t.usage_percentage}%)`:o=`${t.daily_queries_used||0}/${t.daily_queries_limit} queries today`,s.jsx("p",{className:`text-xs ${i} ${e||""}`,children:o})},Btt=({reportName:e,datasetName:t,dataSourceId:n})=>{const{t:r}=Cr(),[a,i]=x.useState(!0),[o,l]=x.useState(""),[c,u]=x.useState(new Set),d=x.useRef(null),{isConnected:f,isProcessing:h,messages:m,sendQuestion:p,clearMessages:g}=M7({dataSourceId:n,autoConnect:a});x.useEffect(()=>{var S;(S=d.current)==null||S.scrollIntoView({behavior:"smooth"})},[m]);const y=()=>{!o.trim()||h||!f||(p(o),l(""))},v=x.useCallback(S=>{!f||h||p(S)},[f,h,p]),w=S=>{u(C=>{const _=new Set(C);return _.has(S)?_.delete(S):_.add(S),_})},b=x.useCallback((S,C)=>{const _=document.getElementById(S);if(!_)return;const E=_.querySelector("svg");if(!E)return;const T=new XMLSerializer().serializeToString(E),P=document.createElement("canvas"),k=P.getContext("2d"),D=new window.Image;D.onload=()=>{P.width=D.width*2,P.height=D.height*2,k&&(k.fillStyle="white",k.fillRect(0,0,P.width,P.height),k.scale(2,2),k.drawImage(D,0,0));const A=P.toDataURL("image/png"),I=document.createElement("a");I.href=A,I.download=`${C.replace(/\s+/g,"-").toLowerCase()}-${Date.now()}.png`,document.body.appendChild(I),I.click(),document.body.removeChild(I)},D.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(T)))},[]),j=(S,C)=>{if(S.chart_data&&S.chart_data.length>0){const _=`report-chart-${C}`;return s.jsxs("div",{className:"mt-3",children:[s.jsxs("div",{id:_,className:"bg-background rounded-lg border p-3 min-h-[250px]",children:[S.text&&s.jsx("h4",{className:"text-xs font-semibold text-center mb-2",children:S.text}),s.jsx(um,{type:S.chart_type||"bar",data:S.chart_data,xLabel:S.x_label,yLabel:S.y_label,height:220,style:{colorScheme:"primary",showLegend:!1,showGrid:!0,showValues:!0,legendPosition:"bottom"}})]}),s.jsxs(U,{variant:"outline",size:"sm",className:"mt-2 text-xs",onClick:()=>b(_,S.text||"chart"),children:[s.jsx(hh,{className:"h-3 w-3 mr-1"}),"PNG"]})]})}return S.image_bytes?s.jsx("div",{className:"mt-2",children:s.jsx("img",{src:`data:image/png;base64,${S.image_bytes}`,alt:"Chart",className:"max-w-full rounded border"})}):null},N=S=>{var C,_,E,T,P,k,D,A,I;return S.role==="system"?s.jsx("div",{className:"flex justify-center",children:s.jsx($e,{variant:"outline",className:"text-xs",children:S.content})},S.id):s.jsxs("div",{className:`flex gap-2 ${S.role==="user"?"justify-end":"justify-start"}`,children:[S.role==="assistant"&&s.jsx(dd,{className:"h-7 w-7 border border-accent",children:s.jsx(fd,{className:"bg-accent text-accent-foreground text-xs",children:s.jsx(Vu,{className:"h-3 w-3"})})}),s.jsxs("div",{className:`rounded-lg px-3 py-2 ${S.role==="user"?"max-w-[80%] bg-primary text-primary-foreground":((C=S.answer)==null?void 0:C.kind)==="rich"||((_=S.answer)==null?void 0:_.kind)==="chart"||((E=S.answer)==null?void 0:E.kind)==="table"?"max-w-[95%] w-full bg-background border border-border":"max-w-[80%] bg-background border border-border"}`,children:[S.isLoading?s.jsxs("div",{className:"flex gap-1",children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground animate-bounce"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground animate-bounce",style:{animationDelay:"0.2s"}}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground animate-bounce",style:{animationDelay:"0.4s"}})]}):s.jsxs(s.Fragment,{children:[((T=S.answer)==null?void 0:T.kind)!=="rich"&&s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:S.content}),((P=S.answer)==null?void 0:P.kind)==="rich"&&s.jsx(pZ,{answer:S.answer,messageId:S.id,onFollowUpSelect:v,onDownloadChart:b,disabled:h||!f}),((k=S.answer)==null?void 0:k.kind)==="chart"&&j(S.answer,S.id),((D=S.answer)==null?void 0:D.kind)==="table"&&((A=S.answer)==null?void 0:A.data)&&Array.isArray(S.answer.data)&&s.jsx("div",{className:"mt-2 overflow-x-auto max-h-48 overflow-y-auto border rounded text-xs",children:s.jsxs("table",{className:"min-w-full",children:[s.jsx("thead",{className:"bg-muted/50 sticky top-0",children:s.jsx("tr",{children:Object.keys(S.answer.data[0]||{}).map(M=>s.jsx("th",{className:"px-2 py-1 text-left font-medium border-b",children:M},M))})}),s.jsx("tbody",{children:S.answer.data.slice(0,30).map((M,$)=>s.jsx("tr",{className:"hover:bg-muted/30",children:Object.values(M).map((R,O)=>s.jsx("td",{className:"px-2 py-1 border-b",children:String(R??"")},O))},$))})]})}),((I=S.answer)==null?void 0:I.code)&&s.jsxs("div",{className:"mt-2",children:[s.jsxs("button",{onClick:()=>w(S.id),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(HP,{className:"h-3 w-3"}),s.jsx("span",{children:"Ver codigo"}),c.has(S.id)?s.jsx(Zi,{className:"h-3 w-3"}):s.jsx(Jr,{className:"h-3 w-3"})]}),c.has(S.id)&&s.jsx("pre",{className:"mt-1 p-2 bg-muted/50 rounded text-xs overflow-x-auto",children:s.jsx("code",{children:S.answer.code})})]}),S.error&&s.jsx("p",{className:"text-xs text-destructive mt-1",children:S.error})]}),s.jsx("p",{className:`text-xs mt-1 ${S.role==="user"?"text-primary-foreground
916/70":"text-muted-foreground"}`,children:S.timestamp.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]}),S.role==="user"&&s.jsx(dd,{className:"h-7 w-7",children:s.jsx(fd,{className:"text-xs",children:"U"})})]},S.id)};return s.jsx(Z,{className:"border-accent/20",children:s.jsxs(xh,{open:a,onOpenChange:i,children:[s.jsx(bh,{asChild:!0,children:s.jsx(we,{className:"cursor-pointer hover:bg-muted/50 transition-colors",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-full bg-accent/10 flex items-center justify-center",children:s.jsx(YB,{className:"h-5 w-5 text-accent"})}),s.jsxs("div",{children:[s.jsxs(Ne,{className:"text-lg flex items-center gap-2",children:["AI Analyst",s.jsxs($e,{variant:"secondary",className:"text-xs",children:[s.jsx(Ca,{className:"mr-1 h-3 w-3"}),"AI"]})]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Ask questions about this report"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[f?s.jsx(r0,{className:"h-4 w-4 text-green-600"}):n?s.jsx(tk,{className:"h-4 w-4 text-orange-600"}):null,a?s.jsx(Zi,{className:"h-5 w-5 text-muted-foreground"}):s.jsx(Jr,{className:"h-5 w-5 text-muted-foreground"})]})]})})}),s.jsx(wh,{children:s.jsxs(le,{className:"pt-0",children:[s.jsxs(fl,{className:"mb-3 border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-950",children:[s.jsx(Vu,{className:"h-4 w-4 text-blue-600 dark:text-blue-400"}),s.jsx(hl,{className:"text-xs text-blue-700 dark:text-blue-300",children:r("aiAnalyst.euDisclaimer")})]}),s.jsxs("div",{className:"h-[350px] overflow-y-auto space-y-3 mb-4 p-3 bg-muted/30 rounded-lg",children:[m.filter(S=>S.role!=="system").length===0&&!h?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx(Vu,{className:"h-10 w-10 text-accent mb-2"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:['Ask me anything about "',t,'"']})]}):m.map(N),s.jsx("div",{ref:d})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Re,{placeholder:f?"Ask about this report...":"Connecting...",value:o,onChange:S=>l(S.target.value),onKeyPress:S=>S.key==="Enter"&&y(),disabled:!f||h,className:"text-sm"}),s.jsx(U,{onClick:y,disabled:!o.trim()||!f||h,size:"sm",className:"bg-gradient-primary",children:h?s.jsx(Te,{className:"h-4 w-4 animate-spin"}):s.jsx(JB,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"flex items-center justify-end mt-1",children:s.jsx(gZ,{})})]})})]})})},rj=e=>e.blockType==="text"||["heading-1","heading-2","heading-3","paragraph","bullet-list","numbered-list","quote","callout","divider","metric"].includes(e.type),aj=e=>e.blockType==="filter"||e.type==="filter",ztt=e=>({3:"col-span-3",4:"col-span-4",6:"col-span-6",12:"col-span-12"})[e]||"col-span-6",Utt=({visualizations:e,previewData:t,isPreviewLoading:n})=>{const{getFilteredData:r,hasActiveFilters:a}=JK(),i=x.useMemo(()=>{if(!(t!=null&&t.data)||!e)return{};let o=t.data;a&&(o=r(o));const l={};return e.forEach((c,u)=>{const d=c.id||`viz-${u}`;if(rj(c)||aj(c))return;const f=b2(c),{xColumn:h,yColumn:m,aggregation:p}=f;if(!h){l[d]=[];return}l[d]=QG(o,h,m||h,p,{sortByValue:!0,sortDirection:"desc",limit:15})}),l},[t,e,a,r]);return s.jsx("div",{className:"grid grid-cols-12 gap-4",children:e.map((o,l)=>{const c=o.id||`viz-${l}`,u=lv(o),d=ztt(u.colSpan);if(rj(o)){const p=cue(o),g=["heading-1","heading-2","heading-3","paragraph","quote","bullet-list","numbered-list"],y=p.type==="divider",v=g.includes(p.type);return y?s.jsx("div",{className:d,children:s.jsx(rg,{block:p})},c):v?s.jsx("div",{className:`${d} px-2`,children:s.jsx(rg,{block:p})},c):s.jsx(Z,{className:d,children:s.jsx(le,{className:"pt-6",children:s.jsx(rg,{block:p})})},c)}if(aj(o)){const p=bU(o);return s.jsx("div",{className:d,children:s.jsx(cE,{block:p,data:t==null?void 0:t.data,editMode:!1,compact:!1,disabled:!1})},c)}const f=i[c]||[],h=oue(o),m=b2(o);return s.jsxs(Z,{className:d,children:[s.jsx(we,{children:s.jsx(Ne,{children:o.title||`Chart ${l+1}`})}),s.jsx(le,{children:s.jsx(um,{type:o.type,data:f,title:o.title,xColumn:m.xColumn,yColumn:m.yColumn,style:h,height:uT,isLoading:n})})]},c)})})},Vtt=()=>{var w;const{id:e}=iv(),t=cn(),{data:n,isLoading:r,isError:a,error:i}=T7(e),{data:o,isLoading:l}=Wk(n==null?void 0:n.data_source_id),c=zk(),u=g7(),d=async b=>{if(e)try{await c.mutateAsync({id:e,format:b}),se.success(`Report exported as ${b.toUpperCase()}`)}catch{se.error("Failed to export report")}},f=async()=>
916{if(e)try{await u.mutateAsync(e),se.success("Report deleted"),t("/dashboard/reports")}catch{se.error("Failed to delete report")}};if(r)return s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})});if(a||!n)return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(U,{variant:"ghost",onClick:()=>t("/dashboard/reports"),children:[s.jsx(Yr,{className:"mr-2 h-4 w-4"}),"Back to Reports"]}),s.jsxs(Z,{className:"p-12 text-center",children:[s.jsx(Yn,{className:"h-12 w-12 mx-auto text-destructive mb-4"}),s.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Report not found"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:(i==null?void 0:i.message)||"The report you're looking for doesn't exist."})]})]});const h=((w=n.config)==null?void 0:w.visualizations)||[],m=h.filter(b=>!rj(b)&&!aj(b)).length,p=h.filter(b=>rj(b)).length,g=h.filter(b=>aj(b)).length,y=h.length,v=b=>{if(!b)return"N/A";const j=new Date(b),S=Math.floor((new Date().getTime()-j.getTime())/(1e3*60*60*24));return S===0?"Today":S===1?"Yesterday":S<7?`${S} days ago`:j.toLocaleDateString()};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{className:"flex items-center gap-4 min-w-0 flex-1",children:[s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>t("/dashboard/reports"),className:"flex-shrink-0",children:s.jsx(Yr,{className:"h-5 w-5"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground truncate",title:n.name,children:n.name}),s.jsx($e,{variant:n.visibility==="PUBLIC"?"default":"outline",className:"flex-shrink-0",children:n.visibility==="PUBLIC"?"🌐 public":"🔒 private"})]}),s.jsx("p",{className:"text-muted-foreground mt-1 truncate",children:n.description||"No description"})]})]}),s.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>se.success("Link copied!"),children:[s.jsx(ZB,{className:"mr-2 h-4 w-4"}),"Share"]}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsxs(U,{variant:"outline",size:"sm",children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),"Export"]})}),s.jsxs(Xr,{children:[s.jsx(Xe,{onClick:()=>d("pdf"),children:"Export as PDF"}),s.jsx(Xe,{onClick:()=>d("html"),children:"Export as HTML"}),s.jsx(Xe,{onClick:()=>d("xlsx"),children:"Export as Excel"}),s.jsx(Xe,{onClick:()=>d("png"),children:"Export as PNG"})]})]}),(n==null?void 0:n.can_edit)!==!1&&s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>t(`/dashboard/reports/edit/${e}`),children:[s.jsx(YP,{className:"mr-2 h-4 w-4"}),"Edit"]}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",children:s.jsx(fh,{className:"h-4 w-4"})})}),s.jsxs(Xr,{children:[s.jsx(Xe,{onClick:()=>se.success("Report duplicated"),children:"Duplicate"}),(n==null?void 0:n.can_delete)!==!1&&s.jsx(Xe,{className:"text-destructive",onClick:f,children:"Delete"})]})]})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[s.jsxs(Z,{className:"overflow-hidden",children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Data Source"})}),s.jsx(le,{children:s.jsx("p",{className:"text-lg font-semibold truncate",title:n.data_source_name||"Unknown",children:n.data_source_name||"Unknown"})})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Chart Type"})}),s.jsx(le,{children:s.jsx("p",{className:"text-lg font-semibold capitalize",children:n.chart_type||"Multiple"})})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Content Blocks"})}),s.jsxs(le,{children:[s.jsx("p",{className:"text-2xl font-bold",children:y}),s.jsxs("div",{className:"flex gap-2 mt-1 text-xs text-muted-foreground",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Xn,{className:"h-3 w-3"}),m," charts"]}),p>0&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(sd,{className:"h-3 w-3"}),p," text"]}),g>0&&s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(Va,{className:"h-3 w-3"}),g," filters"]})]})]})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-2",children:s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:"Created"})}),s.jsx(le,{children:s.jsx("p",{className:"text-lg font-semibold",children:v(n.created_at)})})]})]}),h.length>0?s.jsx(QK,{children:s.jsx(Utt,{visualizations:h,previewData:o,isPreviewLoading:l})}):s.jsx(Z,{className:"p-12 text-center",children:s.jsx("p",{className:"text-muted-foreground",children:"No content in this report"})}),s.jsx(Btt,{reportName:n.name,datasetName:n.data_source_name||"Dataset",dataSourceId:n.data_source_id})]})},Wtt=()=>{const{t:e}=Cr(),[t,n]=x.useState(!1),r=[{id:"1",name:"Weekly Sales Summary",report:"Q4 Sales Dashboard",frequency:"weekly",time:"09:00 AM",recipients:["[email protected]","[email protected]"],format:"pdf",enabled:!0,lastSent:"2 days ago",nextScheduled:"Monday, 09:00 AM"},{id:"2",name:"Monthly Performance Report",report:"Customer Analytics",frequency:"monthly",time:"08:00 AM",recipients:["[email protected]"],format:"powerpoint",enabled:!0,lastSent:"1 week ago",nextScheduled:"1st of next month"},{id:"3",name:"Daily Inventory Update",report:"Product Performance",frequency:"daily",time:"06:00 AM",recipients:["[email protected]"],format:"excel",enabled:!1,lastSent:"1 month ago",nextScheduled:"Paused"}],a=i=>({daily:"bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400",weekly:"bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400",monthly:"bg-purple-100 text-purple-800 dark:bg-purple-900/30 dark:text-purple-400"})[i]||"";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:e("scheduledReports.title")}),s.jsx("p",{className:"text-muted-foreground mt-1",children:e("scheduledReports.subtitle")})]}),s.jsxs(br,{open:t,onOpenChange:n,children:[s.jsx(l1,{asChild:!0,children:s.jsxs(U,{className:"bg-gradient-primary",children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),e("scheduledReports.create")]})}),s.jsxs(or,{className:"sm:max-w-2xl",children:[s.jsxs(lr,{children:[s.jsx(cr,{children:e("scheduledReports.create")}),s.jsx(wr,{children:"Set up automatic report delivery to your team"})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"schedule-name",children:"Schedule Name"}),s.jsx(Re,{id:"schedule-name",placeholder:"Weekly sales report"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"report",children:"Report to Send"}),s.jsxs(rt,{children:[s.jsx(tt,{id:"report",children:s.jsx(st,{placeholder:"Select report"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"sales",children:"Q4 Sales Dashboard"}),s.jsx(_e,{value:"customers",children:"Customer Analytics"}),s.jsx(_e,{value:"products",children:"Product Performance"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"frequency",children:"Frequency"}),s.jsxs(rt,{children:[s.jsx(tt,{id:"frequency",children:s.jsx(st,{placeholder:"Select frequency"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"daily",children:e("scheduledReports.frequency.daily")}),s.jsx(_e,{value:"weekly",children:e("scheduledReports.frequency.weekly")}),s.jsx(_e,{value:"monthly",children:e("scheduledReports.frequency.monthly")})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"time",children:"Time"}),s.jsx(Re,{id:"time",type:"time",defaultValue:"09:00"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"recipients",children:"Recipients (comma separated)"}),s.jsx(Re,{id:"recipients",placeholder:"[email protected], [email protected]"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"format",children:"Export Format"}),s.jsxs(rt,{children:[s.jsx(tt,{id:"format",children:s.jsx(st,{placeholder:"Select format"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"pdf",children:"PDF Document"}),s.jsx(_e,{value:"excel",children:"Excel Spreadsheet"}),s.jsx(_e,{value:"powerpoint",children:"PowerPoint Presentation"})]})]})]}),s.jsx(U,{className:"w-full bg-gradient-primary",onClick:()=>{se.success("Schedule created successfully"),n(!1)},children:"Create Schedule"})]})]})]})]}),s.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:r.map(i=>s.jsxs(Z,{className:"hover:shadow-lg transition-shadow",children:[s.jsx(we,{children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(Ne,{className:"text-base",children:i.name}),s.jsx(it,{className:"text-xs",children:i.report})]}),s.jsx(xn,{checked:i.enabled})]})}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[s.jsx($e,{className:a(i.frequency),children:e(`sc
916heduledReports.frequency.${i.frequency}`)}),s.jsxs($e,{variant:"outline",children:[s.jsx(tv,{className:"mr-1 h-3 w-3"}),i.time]}),s.jsx($e,{variant:"outline",children:i.format.toUpperCase()})]}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(KP,{className:"h-4 w-4 text-muted-foreground"}),s.jsxs("span",{className:"text-muted-foreground",children:[i.recipients.length," recipients"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zs,{className:"h-4 w-4 text-muted-foreground"}),s.jsxs("span",{className:"text-muted-foreground",children:["Next: ",i.nextScheduled]})]}),i.lastSent&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last sent: ",i.lastSent]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(U,{variant:"outline",size:"sm",className:"flex-1",children:[s.jsx(XP,{className:"mr-2 h-3 w-3"}),"Send Now"]}),s.jsx(U,{variant:"outline",size:"sm",className:"flex-1",children:"Edit"}),s.jsx(U,{variant:"ghost",size:"sm",children:s.jsx(pn,{className:"h-4 w-4"})})]})]})]},i.id))})]})},qtt=()=>{const[e,t]=x.useState(""),[n,r]=x.useState(!1),[a,i]=x.useState(null),[o,l]=x.useState({name:"",resourceType:"",resourceId:"",permission:"VIEW",expires:"7days"}),{data:c,isLoading:u}=wpe(),d=(c==null?void 0:c.items)||[],{data:f}=s1(),{data:h}=O7(),m=(f==null?void 0:f.items)||[],p=(h==null?void 0:h.items)||[],g=Yme(),y=Xme(),v=d.filter(_=>(_.resource_name||"").toLowerCase().includes(e.toLowerCase())),w=_=>{navigator.clipboard.writeText(_),se.success("Link copied to clipboard!")},b=async()=>{if(!o.resourceId||!o.resourceType){se.error("Please fill in all required fields");return}let _;switch(o.expires){case"1day":_=1;break;case"7days":_=7;break;case"30days":_=30;break;case"never":_=void 0;break}try{await g.mutateAsync({resource_type:o.resourceType,resource_id:o.resourceId,permission:o.permission,expires_in_days:_}),se.success("Share link created successfully!"),r(!1),l({name:"",resourceType:"",resourceId:"",permission:"VIEW",expires:"7days"})}catch{se.error("Failed to create share link")}},j=async()=>{if(a)try{await y.mutateAsync(a.id),se.success("Share link revoked successfully!"),i(null)}catch{se.error("Failed to revoke share link")}},N=_=>_?new Date(_).toLocaleDateString():"Never",S=_=>!_.is_active||_.is_expired?"destructive":"default",C=_=>_.is_active?_.is_expired?"expired":"active":"revoked";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Shared Links"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage and track your shared data links"})]}),s.jsxs(br,{open:n,onOpenChange:r,children:[s.jsx(l1,{asChild:!0,children:s.jsxs(U,{className:"bg-gradient-primary",children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"Create Share Link"]})}),s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:"Create Share Link"}),s.jsx(wr,{children:"Generate a shareable link to your data or report"})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"resource-type",children:"Resource Type"}),s.jsxs(rt,{value:o.resourceType,onValueChange:_=>l({...o,resourceType:_,resourceId:""}),children:[s.jsx(tt,{id:"resource-type",children:s.jsx(st,{placeholder:"Select type"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"data_source",children:"Dataset"}),s.jsx(_e,{value:"report",children:"Report"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"dataset",children:"Dataset / Report"}),s.jsxs(rt,{value:o.resourceId,onValueChange:_=>l({...o,resourceId:_}),disabled:!o.resourceType,children:[s.jsx(tt,{id:"dataset",children:s.jsx(st,{placeholder:"Select content to share"})}),s.jsxs(nt,{children:[o.resourceType==="data_source"&&m.map(_=>s.jsx(_e,{value:_.id,children:_.name},_.id)),o.resourceType==="report"&&p.map(_=>s.jsx(_e,{value:_.id,children:_.name},_.id))]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"permission",children:"Permission"}),s.jsxs(rt,{value:o.permission,onValueChange:_=>l({...o,permission:_}),children:[s.jsx(tt,{id:"permission",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"VIEW",children:"View Only"}),s.jsx(_e,{value:"EDIT",children:"Can Edit"}),s.jsx(_e,{value:"DOWNLOAD",children:"Can Download"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"expires",children:"Expires"}),s.jsxs(rt,{value:o.expires,onValueChange:_=>l({...o,expires:_}),children:[s.jsx(tt,{id:"expires",children:s.jsx(st,{})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"1day",children:"1 Day"}),s.jsx(_e,{value:"7days",children:"7 Days"}),s.jsx(_e,{value:"30days",children:"30 Days"}),s.jsx(_e,{value:"never",children:"Never"})]})]})]})]}),s.jsxs(U,{className:"w-full bg-gradient-primary",onClick:b,disabled:g.isPending,children:[g.isPending?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(HB,{className:"mr-2 h-4 w-4"}),"Generate Link"]})]})]})]})]}),s.jsx("div",{className:"flex flex-col sm:flex-row gap-4",children:s.jsxs("div",{className:"relative flex-1",children:[s.jsx(ii,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search share links...",className:"pl-9",value:e,onCh
916ange:_=>t(_.target.value)})]})}),u?s.jsx(Z,{className:"p-12",children:s.jsx("div",{className:"flex justify-center",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}):v.length>0?s.jsx(Z,{children:s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsxs(Rr,{children:[s.jsx(jt,{children:"Name"}),s.jsx(jt,{children:"Type"}),s.jsx(jt,{children:"Permission"}),s.jsx(jt,{children:"Views"}),s.jsx(jt,{children:"Expires"}),s.jsx(jt,{children:"Status"}),s.jsx(jt,{className:"text-right",children:"Actions"})]})}),s.jsx(_l,{children:v.map(_=>s.jsxs(Rr,{children:[s.jsx(Nt,{className:"font-medium",children:_.resource_name||"Unnamed"}),s.jsx(Nt,{className:"text-muted-foreground",children:_.resource_type==="data_source"?"Dataset":"Report"}),s.jsx(Nt,{children:s.jsx($e,{variant:"outline",children:_.permission})}),s.jsx(Nt,{children:_.use_count}),s.jsx(Nt,{className:"text-sm text-muted-foreground",children:N(_.expires_at)}),s.jsx(Nt,{children:s.jsx($e,{variant:S(_),children:C(_)})}),s.jsx(Nt,{className:"text-right",children:s.jsxs("div",{className:"flex justify-end gap-2",children:[s.jsx(U,{size:"sm",variant:"ghost",onClick:()=>w(_.full_url||`${window.location.origin}/share/${_.token}`),children:s.jsx(Od,{className:"h-4 w-4"})}),s.jsx(U,{size:"sm",variant:"ghost",children:s.jsx(Ore,{className:"h-4 w-4"})}),s.jsx(U,{size:"sm",variant:"ghost",onClick:()=>window.open(_.full_url||`/share/${_.token}`,"_blank"),children:s.jsx(xf,{className:"h-4 w-4"})}),s.jsx(U,{size:"sm",variant:"ghost",className:"text-destructive",onClick:()=>i(_),children:s.jsx(pn,{className:"h-4 w-4"})})]})})]},_.id))})]})}):s.jsx(Z,{className:"p-12",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-24 w-24 rounded-full bg-muted flex items-center justify-center",children:s.jsx(xf,{className:"h-12 w-12 text-muted-foreground"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"No shared links found"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Create a share link to collaborate with others"})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>r(!0),children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"Create Your First Share Link"]})]})}),s.jsx(Ic,{open:!!a,onOpenChange:()=>i(null),children:s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:"Revoke Share Link"}),s.jsx(ll,{children:"Are you sure you want to revoke this share link? Anyone with this link will no longer be able to access the shared content."})]}),s.jsxs(il,{children:[s.jsx(ul,{children:"Cancel"}),s.jsx(cl,{onClick:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:y.isPending,children:y.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Revoking..."]}):"Revoke"})]})]})})]})},Htt=()=>{const{t:e}=Cr(),{user:t}=lo(),[n,r]=x.useState(""),[a,i]=x.useState(""),[o,l]=x.useState(""),[c,u]=x.useState(new Set),d=x.useRef(null),f=x.useRef(null),h=M=>{u($=>{const R=new Set($);return R.has(M)?R.delete(M):R.add(M),R})},{data:m,isLoading:p}=s1(),g=(m==null?void 0:m.items)||[],y=x.useMemo(()=>{if(!a.trim())return g;const M=a.toLowerCase();return g.filter($=>$.name.toLowerCase().includes(M))},[g,a]),{data:v,refetch:w}=qk(),{isConnected:b,isProcessing:j,messages:N,error:S,sendQuestion:C,clearMessages:_}=M7({dataSourceId:n,autoConnect:!!n});x.useEffect(()=>{var M;(M=d.current)==null||M.scrollIntoView({behavior:"smooth"})},[N]),x.useEffect(()=>{N.length>0&&w()},[N.length,w]);const E=()=>{!o.trim()||!n||j||(C(o),l(""))},T=M=>{r(M),_()},P=x.useCallback(M=>{const $=g.find(z=>z.id===n),R=($==null?void 0:$.name)||"Dataset",O=N.filter(z=>z.role!=="system").map(z=>{var ee,V,K;const B=z.timestamp.toLocaleString(),H=z.role==="user"?"Usuario":"AI Analyst";let Y=z.content||"";return((ee=z.answer)==null?void 0:ee.kind)==="table"&&((V=z.answer)!=null&&V.data)&&(Y+=`
917[Tabla: ${z.answer.data.length} filas]`),((K=z.answer)==null?void 0:K.kind)==="chart"&&(Y+=`
918[Gráfico: ${z.answer.chart_type||"chart"}]`),`[${B}] ${H}:
919${Y}
920`}).join(`
921---
922
923`),F=`AI Analyst - Conversación
924Dataset: ${R}
925Fecha: ${new Date().toLocaleString()}
926
927${"=".repeat(50)}
928
929${O}`;if(M==="txt"){const z=new Blob([F],{type:"text/plain;charset=utf-8"}),B=URL.createObjectURL(z),H=document.createElement("a");H.href=B,H.download=`ai-analyst-${R}-${new Date().toISOString().split("T")[0]}.txt`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(B)}else if(M==="print"){const z=window.open("","_blank");z&&(z.document.write(`
930          <html>
931            <head>
932              <title>AI Analyst - Conversación</title>
933              <style>
934                body { font-family: system-ui, sans-serif; max-width: 800px; margin: 40px auto; padding: 20px; }
935                h1 { color: #6366f1; }
936                .message { margin: 20px 0; padding: 15px; border-radius: 8px; }
937                .user { background: #f3f4f6; text-align: right; }
938                .assistant { background: #eef2ff; }
939                .time { font-size: 12px; color: #6b7280; }
940                .role { font-weight: 600; margin-bottom: 8px; }
941                pre { background: #1f2937; color: #f9fafb; padding: 10px; border-radius: 4px; overflow-x: auto; }
942                table { border-collapse: collapse; width: 100%; margin: 10px 0; }
943                th, td { border: 1px solid #d1d5db; padding: 8px; text-align: left; }
944                th { background: #f3f4f6; }
945              </style>
946            </head>
947            <body>
948              <h1>🤖 AI Analyst - Conversación</h1>
949              <p><strong>Dataset:</strong> ${R}</p>
950              <p><strong>Fecha:</strong> ${new Date().toLocaleString()}</p>
951              <hr/>
952              ${N.filter(B=>B.role!=="system").map(B=>{var H,Y,ee;return`
953                <div class="message ${B.role}">
954                  <div class="role">${B.role==="user"?"👤 Usuario":"🤖 AI Analyst"}</div>
955                  <div class="time">${B.timestamp.toLocaleString()}</div>
956                  <div>${B.content||""}</div>
957                  ${((H=B.answer)==null?void 0:H.kind)==="table"&&((Y=B.answer)!=null&&Y.data)?`
958                    <table>
959                      <thead><tr>${Object.keys(B.answer.data[0]||{}).map(V=>`<th>${V}</th>`).join("")}</tr></thead>
960                      <tbody>${B.answer.data.slice(0,20).map(V=>`<tr>${Object.values(V).map(K=>`<td>${String(K??"")}</td>`).join("")}</tr>`).join("")}</tbody>
961                    </table>
962                    ${B.answer.data.length>20?`<p><em>... y ${B.answer.data.length-20} filas más</em></p>`:""}
963                  `:""}
964                  ${(ee=B.answer)!=null&&ee.code?`<details><summary>Ver código</summary><pre>${B.answer.code}</pre></details>`:""}
965                </div>
966              `}).join("")}
967            </body>
968          </html>
969        `),z.document.close(),z.print())}},[N,g,n]),k=x.useCallback((M,$)=>{const R=document.getElementById(M);if(!R)return;const O=R.querySelector("svg");if(!O)return;const F=new XMLSerializer().serializeToString(O),z=document.createElement("canvas"),B=z.getContext("2d"),H=new window.Image;H.onload=()=>{z.width=H.width*2,z.height=H.height*2,B&&(B.fillStyle="white",B.fillRect(0,0,z.width,z.height),B.scale(2,2),B.drawImage(H,0,0));const Y=z.toDataURL("image/png"),ee=document.createElement("a");ee.href=Y,ee.download=`${$.replace(/\s+/g,"-").toLowerCase()}-${Date.now()}.png`,document.body.appendChild(ee),ee.click(),document.body.removeChild(ee)},H.src="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(F)))},[]),D=x.useCallback(M=>{!n||!b||j||C(M)},[n,b,j,C]),A=(M,$)=>{if(M.chart_data&&M.chart_data.length>0){const R=`chart-${$}`,O=M.x_label||"Categoría",F=M.y_label||"Valor";return s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{id:R,className:"bg-background rounded-lg border p-4 min-h-[350px]",children:[s.jsx("h4",{className:"text-sm font-semibold text-center mb-2",children:M.text||"Gráfico"}),s.jsx(um,{type:M.chart_type||"bar",data:M.chart_data,xLabel:O,yLabel:F,height:280,style:{colorScheme:"primary",showLegend:!1,showGrid:!0,showValues:!0,legendPosition:"bottom"}})]}),s.jsx("div",{className:"flex gap-2 mt-3",children:s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>k(R,M.text||"chart"),children:[s.jsx(hh,{className:"h-4 w-4 mr-2"}),"Descargar PNG"]})})]})}return M.image_bytes?s.jsxs("div",{className:"mt-3",children:[s.jsx("img",{src:`data:image/png;base64,${M.image_bytes}`,alt:"Gráfico generado",className:"max-w-full rounded border"}),s.jsx("div",{className:"flex gap-2 mt-2",children:s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>{const R=document.createElement("a");R.href=`data:image/png;base64,${M.image_bytes}
969`,R.download=`chart-${Date.now()}.png`,document.body.appendChild(R),R.click(),document.body.removeChild(R)},className:"text-xs",children:[s.jsx(hh,{className:"h-3 w-3 mr-1"}),"Descargar PNG"]})})]}):null},I=M=>{var $,R,O,F,z,B,H,Y,ee,V;return M.role==="system"?s.jsx("div",{className:"flex justify-center",children:s.jsx($e,{variant:"outline",className:"text-xs",children:M.content})},M.id):s.jsxs("div",{className:`flex gap-3 ${M.role==="user"?"justify-end":"justify-start"}`,children:[M.role==="assistant"&&s.jsx(dd,{className:"h-8 w-8 border-2 border-accent",children:s.jsx(fd,{className:"bg-accent text-accent-foreground",children:s.jsx(Vu,{className:"h-4 w-4"})})}),s.jsxs("div",{className:`rounded-lg p-4 ${M.role==="user"?"max-w-[70%] bg-primary text-primary-foreground":(($=M.answer)==null?void 0:$.kind)==="chart"||((R=M.answer)==null?void 0:R.kind)==="table"||((O=M.answer)==null?void 0:O.kind)==="rich"?"max-w-[95%] w-full bg-muted":M.error?"max-w-[80%] bg-destructive/10 border border-destructive":"max-w-[80%] bg-muted"}`,children:[M.isLoading?s.jsxs("div",{className:"flex gap-1",children:[s.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground animate-bounce"}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground animate-bounce",style:{animationDelay:"0.2s"}}),s.jsx("div",{className:"h-2 w-2 rounded-full bg-muted-foreground animate-bounce",style:{animationDelay:"0.4s"}})]}):s.jsxs(s.Fragment,{children:[((F=M.answer)==null?void 0:F.kind)!=="rich"&&s.jsx("p",{className:"text-sm whitespace-pre-wrap",children:M.content}),((z=M.answer)==null?void 0:z.kind)==="chart"&&A(M.answer,M.id),((B=M.answer)==null?void 0:B.kind)==="rich"&&s.jsx(pZ,{answer:M.answer,messageId:M.id,onFollowUpSelect:D,onDownloadChart:k,disabled:j||!b}),((H=M.answer)==null?void 0:H.kind)==="table"&&((Y=M.answer)==null?void 0:Y.data)&&Array.isArray(M.answer.data)&&s.jsxs("div",{className:"mt-3 overflow-x-auto max-h-64 overflow-y-auto border rounded",children:[s.jsxs("table",{className:"min-w-full text-xs",children:[s.jsx("thead",{className:"bg-muted/50 sticky top-0",children:s.jsx("tr",{children:Object.keys(M.answer.data[0]||{}).map(K=>s.jsx("th",{className:"px-2 py-1 text-left font-medium border-b",children:K},K))})}),s.jsx("tbody",{children:M.answer.data.slice(0,50).map((K,W)=>s.jsx("tr",{className:"hover:bg-muted/30",children:Object.values(K).map((q,J)=>s.jsx("td",{className:"px-2 py-1 border-b",children:String(q??"")},J))},W))})]}),M.answer.data.length>50&&s.jsxs("p",{className:"text-xs text-muted-foreground p-2 text-center",children:["Mostrando 50 de ",M.answer.data.length," filas"]})]}),((ee=M.answer)==null?void 0:ee.code)&&s.jsxs("div",{className:"mt-2",children:[s.jsxs("button",{onClick:()=>h(M.id),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[s.jsx(HP,{className:"h-3 w-3"}),s.jsx("span",{children:"Ver código generado"}),c.has(M.id)?s.jsx(Zi,{className:"h-3 w-3"}):s.jsx(Jr,{className:"h-3 w-3"})]}),c.has(M.id)&&s.jsx("pre",{className:"mt-2 p-2 bg-background/50 rounded text-xs overflow-x-auto",children:s.jsx("code",{children:M.answer.code})})]}),M.error&&s.jsx("p",{className:"text-xs text-destructive mt-1",children:M.error})]}),s.jsx("p",{className:`text-xs mt-2 ${M.role==="user"?"text-primary-foreground/70":"text-muted-foreground"}`,children:M.timestamp.toLocaleTimeString()})]}),M.role==="user"&&s.jsxs(dd,{className:"h-8 w-8",children:[s.jsx(a1,{src:t==null?void 0:t.avatar_url}),s.jsx(fd,{children:((V=t==null?void 0:t.username)==null?void 0:V.slice(0,2).toUpperCase())||"U"})]})]},M.id)};return s.jsxs("div",{className:"flex flex-col h-[calc(100vh-12rem)]",children:[s.jsx("div",{className:"mb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-3xl font-bold text-foreground flex items-center gap-2",children:[s.jsx(Ca,{className:"h-8 w-8 text-accent"}),"AI Analyst"]}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Ask questions about your data and get instant insights"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[N.filter(M=>M.role!=="system").length>0&&s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsxs(U,{variant:"outline",size:"sm",children:[s.jsx(ci,{className:"h-4 w-4 mr-1"}),"Exportar"]})}),s.jsxs(Xr,{align:"end",children:[s.jsxs(Xe,{onClick:()=>P("print"),children:[s.jsx(di,{className:"h-4 w-4 mr-2"}),"Imprimir / PDF"]}),s.jsxs(Xe,{onClick:()=>P("txt"),children:[s.jsx(di,{className:"h-4 w-4 mr-2"}),"Descargar TXT"]}),s.jsx(ha,{}),s.jsx(Xe,{onClick:_,className:"text-destructive",children:"Limpiar conversación"})]})]}),b?s.jsxs($e,{variant:"outline",className:"text-green-600 border-green-600",children:[s.jsx(r0,{className:"mr-1 h-3 w-3"}),"Connected"]}):n?s.jsxs($e,{variant:"outline",className:"text-orange-600 border-orange-600",children:[s.jsx(tk,{className:"mr-1 h-3 w-3"}),"Disconnected"]}):null,v&&s.jsxs($e,{variant:"secondary",className:"text-sm",children:[s.jsx(Ca,{className:"mr-1 h-3 w-3"}),v.model||"AI Powered"]})]})]})}),s.jsx("div",{className:"mb-4",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(wt,{className:"h-4 w-4"}),s.jsx("span",{children:"Select a dataset to analyze:"})]}),s.jsxs(rt,{value:n,onValueChange:T,disabled:p,children:[s.jsx(tt,{className:"w-80",children:s.jsx(st,{placeholder:"Seleccionar dataset..."})}),s.jsxs(nt,{children:[s.jsxs("div",{className:"flex items-center px-2 pb-2 border-b",children:[s.jsx(ii,{className:"h-4 w-4 mr-2 text-muted-foreground"}),s.jsx("input",{type:"text",placeholder:"Buscar dataset...",value:a,onChange:M=>i(M.target.value),className:"flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground",onClick:M=>M.stopPropagation(),onKeyDown:M=>M.stopPropagation()})]}),y.length===0?s.jsx("div",{className:"py-4 text-center text-sm text-muted-foreground",children:"No se encontró ningún dataset."}):y.map(M=>s.jsx(_e,{value:M.id,children:M.name},M.id))]})]}),p&&s.jsx(Te,{className:"h-4 w-4 animate-spin text-muted-foreground"})]})}),s.jsxs(fl,{className:"mb-4 border-blue-200 bg-blue-50 dark:border-blue-800 dark:bg-blue-950",children:[s.jsx(Vu,{className:"h-4 w-4 text-blue-600 dar
969k:text-blue-400"}),s.jsx(hl,{className:"text-sm text-blue-700 dark:text-blue-300",children:e("aiAnalyst.euDisclaimer")})]}),S&&s.jsxs(fl,{variant:"destructive",className:"mb-4",children:[s.jsx(Yn,{className:"h-4 w-4"}),s.jsx(hl,{children:S})]}),s.jsxs(Z,{className:"flex-1 flex flex-col overflow-hidden",children:[s.jsx(le,{ref:f,className:"flex-1 overflow-y-auto p-6 space-y-4",children:n?N.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx(Vu,{className:"h-16 w-16 text-accent mb-4"}),s.jsx("h3",{className:"text-lg font-semibold",children:"Ready to Analyze"}),s.jsx("p",{className:"text-muted-foreground mt-1 max-w-sm",children:"Ask me anything about your data. I can help you find insights, create visualizations, and understand trends."})]}):s.jsxs(s.Fragment,{children:[N.map(I),s.jsx("div",{ref:d})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[s.jsx(wt,{className:"h-16 w-16 text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-semibold",children:"Select a Dataset"}),s.jsx("p",{className:"text-muted-foreground mt-1 max-w-sm",children:"Choose a dataset from the dropdown above to start asking questions about your data."})]})}),s.jsxs("div",{className:"border-t border-border p-4",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Re,{placeholder:n?b?"Ask me anything about your data...":"Connecting...":"Select a dataset first...",value:o,onChange:M=>l(M.target.value),onKeyPress:M=>M.key==="Enter"&&E(),disabled:!n||!b||j}),s.jsx(U,{onClick:E,disabled:!o.trim()||!n||!b||j,className:"bg-gradient-primary",children:j?s.jsx(Te,{className:"h-4 w-4 animate-spin"}):s.jsx(JB,{className:"h-4 w-4"})})]}),s.jsxs("div",{className:"flex items-center justify-between mt-2",children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"AI responses may not always be accurate. Verify important information."}),s.jsx(gZ,{})]})]})]})]})},Ktt=()=>{var F;const{user:e,refreshUser:t}=lo(),{darkMode:n,setDarkMode:r}=XU(),a=cn(),[i,o]=ov(),l=Fme(),c=$me(),u=x7(),{t:d}=Cr(),[f,h]=x.useState(!1),[m,p]=x.useState(!1),[g,y]=x.useState(""),[v,w]=x.useState(!1),[b,j]=x.useState(!1),[N,S]=x.useState({analytics:!1,marketing:!1,ai_processing:!1});x.useEffect(()=>{ue.get(ra.ME_CONSENTS).then(z=>{const B={};for(const H of z.data)B[H.consent_type]=H.granted;S(H=>({...H,...B}))}).catch(()=>{})},[]);const C=x.useCallback(async()=>{w(!0);try{const z=await ue.get(ra.ME_EXPORT),B=new Blob([JSON.stringify(z.data,null,2)],{type:"application/json"}),H=URL.createObjectURL(B),Y=document.createElement("a");Y.href=H,Y.download=`refraxion-data-export-${new Date().toISOString().split("T")[0]}.json`,document.body.appendChild(Y),Y.click(),document.body.removeChild(Y),URL.revokeObjectURL(H),se.success(d("common.success"))}catch{se.error("Failed to export data")}finally{w(!1)}},[d]),_=x.useCallback(async()=>{j(!0);try{await ue.delete(ra.ME),se.success("Account deleted"),window.location.href="/"}catch(z){const B=z;se.error((B==null?void 0:B.detail)||"Failed to delete account")}finally{j(!1)}},[]),E=x.useCallback(async(z,B)=>{S(H=>({...H,[z]:B}));try{await ue.put(ra.ME_CONSENTS,{consent_type:z,granted:B})}catch{S(H=>({...H,[z]:!B})),se.error("Failed to update consent")}},[]);x.useEffect(()=>{const z=i.get("google_link");z&&(z==="success"?(se.success("Google account linked successfully!"),t()):z==="already_linked_other"?se.error("This Google account is already linked to another user."):z==="invalid_token"?se.error("Session expired. Please try again."):se.error("Failed to link Google account. Please try again."),i.delete("google_link"),i.delete("tab"),o(i,{replace:!0}))},[i,o,t]);const T=x.useCallback(()=>{h(!0);const z=Xa.getAccessToken();window.location.href=`${vs.GOOGLE_AUTHORIZE}?link_token=${z}`},[]),P=x.useCallback(async()=>{p(!0);try{await ue.delete(ra.ME_UNLINK_GOOGLE),se.success("Google account unlinked successfully!"),t()}catch(z){const B=z;se.error((B==null?void 0:B.detail)||"Failed to unlink Google account")}finally{p(!1)}},[t]),[k,D]=x.useState({full_name:"",username:"",email:"",company:""}),[A,I]=x.useState({current_password:"",new_password:"",new_password_confirm:""});x.useEffect(()=>{e&&D({full_name:e.full_name||"",username:e.username||"",email:e.email||"",company:e.company||""})},[e]);const M=()=>{var z;return e!=null&&e.full_name?e.full_name.split(" ").map(B=>B[0]).join("").toUpperCase().slice(0,2):((z=e==null?void 0:e.username)==null?void 0:z.slice(0,2).toUpperCase())||"U"},$=async()=>{try{await l.mutateAsync({full_name:k.full_name||void 0,username:k.username,email:k.email,company:k.company||void 0}),se.success("Profile updated successfully!"),t()}catch(z){const B=z;se.error((B==null?void 0:B.detail)||"Failed to update profile")}},R=(e==null?void 0:e.auth_provider)==="google",O=async()=>
969{if(A.new_password!==A.new_password_confirm){se.error("New passwords do not match");return}if(A.new_password.length<12){se.error("Password must be at least 12 characters");return}if(!R&&!A.current_password){se.error("Current password is required");return}try{await c.mutateAsync({current_password:R?void 0:A.current_password,new_password:A.new_password,new_password_confirm:A.new_password_confirm}),se.success(R?"Password set successfully!":"Password changed successfully!"),I({current_password:"",new_password:"",new_password_confirm:""}),t()}catch(z){const B=z;se.error((B==null?void 0:B.detail)||"Failed to change password")}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Settings"}),s.jsx("p",{className:"text-muted-foreground mt-1",children:"Manage your account settings and preferences"})]}),s.jsxs(fo,{defaultValue:i.get("tab")||"profile",className:"space-y-6",children:[s.jsxs(ji,{children:[s.jsxs(Rt,{value:"profile",children:[s.jsx(n0,{className:"mr-2 h-4 w-4"}),"Profile"]}),s.jsxs(Rt,{value:"notifications",children:[s.jsx(LB,{className:"mr-2 h-4 w-4"}),"Notifications"]}),s.jsxs(Rt,{value:"security",children:[s.jsx(Uc,{className:"mr-2 h-4 w-4"}),"Security"]}),s.jsxs(Rt,{value:"billing",children:[s.jsx(Zo,{className:"mr-2 h-4 w-4"}),"Billing"]}),s.jsxs(Rt,{value:"privacy",children:[s.jsx(ui,{className:"mr-2 h-4 w-4"}),d("privacy.tabTitle")]}),s.jsxs(Rt,{value:"appearance",children:[s.jsx(GP,{className:"mr-2 h-4 w-4"}),"Appearance"]})]}),s.jsx(Ft,{value:"profile",className:"space-y-6",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Profile Information"}),s.jsx(it,{children:"Update your personal information and profile picture"})]}),s.jsxs(le,{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-6",children:[s.jsxs(dd,{className:"h-24 w-24",children:[s.jsx(a1,{src:(e==null?void 0:e.avatar_url)||""}),s.jsx(fd,{className:"text-2xl",children:M()})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(U,{variant:"outline",size:"sm",children:"Change Avatar"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"JPG, PNG or GIF. Max 2MB."})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"fullName",children:"Full Name"}),s.jsx(Re,{id:"fullName",value:k.full_name,onChange:z=>D({...k,full_name:z.target.value}),placeholder:"Your full name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"username",children:"Username"}),s.jsx(Re,{id:"username",value:k.username,onChange:z=>D({...k,username:z.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"email",children:"Email"}),s.jsx(Re,{id:"email",type:"email",value:k.email,onChange:z=>D({...k,email:z.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"company",children:"Company"}),s.jsx(Re,{id:"company",value:k.company,onChange:z=>D({...k,company:z.target.value}),placeholder:"Your company"})]})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(U,{onClick:$,disabled:l.isPending,children:l.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Saving..."]}):"Save Changes"}),e&&s.jsxs("div",{className:"text-sm text-muted-foreground",children:["Plan: ",s.jsx("span",{className:"font-medium capitalize",children:e.plan})," | ","Role: ",s.jsx("span",{className:"font-medium",children:e.role})]})]})]})]})}),s.jsx(Ft,{value:"notifications",className:"space-y-6",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Notification Preferences"}),s.jsx(it,{children:"Choose what notifications you want to receive"})]}),s.jsxs(le,{className:"space-y-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Email Notifications"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive email about your account activity"})]}),s.jsx(xn,{defaultChecked:!0})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Dataset Updates"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Get notified when datasets are processed"})]}),s.jsx(xn,{defaultChecked:!0})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Report Activity"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Notifications about report views and shares"})]}),s.jsx(xn,{})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Marketing Emails"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Receive updates about new features and offers"})]}),s.jsx(xn,{})]})]}),s.jsx(U,{onClick:()=>se.success("Preferences saved!"),children:"Save Preferences"})]})]})}),s.jsxs(Ft,{value:"security",className:"space-y-6",children:[s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:R?"Set Password":"Password"}),s.jsx(it,{children:R?"Set a local password to enable email/password login":"Change your password"})]}),s.jsxs(le,{className:"space-y-4",children:[!R&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"current-password",children:"Current Password"}),s.jsx(Re,{id:"current-password",type:"password",value:A.current_password,onChange:z=>I({...A,current_password:z.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"new-password",children:"New Password"}),s.jsx(Re,{id:"new-password",type:"password",value:A.new_password,onChange:z=>I({...A,new_password:z.target.value})}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Must be at least 12 characters with uppercase, lowercase, number, and special character."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"confirm-password",children:"Confirm New Password"}),s.jsx(Re,{id:"confirm-password",type:"password",value:A.new_password_confirm,onChange:z=>I({...A,new_password_confirm:z.target.value})})]}),s.jsx(U,{onClick:O,disabled:c.isPending,children:c.isPending?s.jsxs(s.Fragment,{children:[s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),"Updating..."]}):"Update Password"})]})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Two-Factor Authentication"}),s.jsx(it,{children:"Add an extra layer of security to your account"})]}),s.jsx(le,{children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{children:"Enable 2FA"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Use an authenticator app for added security"})]}),s.jsx(xn,{})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Connected Accounts"}),s.jsx(it,{children:"Manage third-party accounts linked to your profile"})]}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between p-4 border border-border rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-white border border-border flex items-center justify-center",children:s.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",children:[s.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),s.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),s.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),s.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"Google"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:e!=null&&e.has_google_linked?"Connected — sign in with Google":"Not connected"})]})]}),e!=null&&e.has_google_linked?s.jsxs(U,{variant:"outline",size:"sm",onClick:P,disabled:m||(e==null?void 0:e.auth_provider)==="google",title:(e==null?void 0:e.auth_provider)==="google"?"Set a local password first to unlink":"Unlink Google account",children:[m?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(Ire,{className:"mr-2 h-4 w-4"}),"Unlink"]}):s.jsxs(U,{variant:"outline",size:"sm",onClick:T,disabled:f,children:[f?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(rd,{className:"mr-2 h-4 w-4"}),"Link"]})]}),(e==null?void 0:e.has_google_linked)&&(e==null?void 0:e.auth_provider)==="google"&&s.jsx("p",{className:"text-xs text-muted-foreground",children:"You signed up with Google. Set a local password via the form above before unlinking."})]})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Account Information"}),s.jsx(it,{children:"Your account details and status"})]}),s.jsxs(le,{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between py-2 border-b border-border",children:[s.jsx("span",{className:"text-muted-foreground",children:"Account ID"}),s.jsxs("span",{className:"font-mono text-sm",children:[(F=e==null?void 0:e.id)==null?void 0:F.slice(0,8),"..."]})]}),s.jsxs("div",{className:"flex justify-between py-2 border-b border-border",children:[s.jsx("span",{className:"text-muted-foreground",children:"Email Verified"}),s.jsx("span",{className:e!=null&&e.is_verified?"text-success":"text-warning",children:e!=null&&e.is_verified?"Yes":"No"})]}),s.jsxs("div",{className:"flex justify-between py-2 border-b border-border",children:[s.jsx("span",{className:"text-muted-foreground",children:"Account Status"}),s.jsx("span",{className:e!=null&&e.is_active?"text-success":"text-destructive",children:e!=null&&e.is_active?"Active":"Inactive"})]}),s.jsxs("div",{className:"flex justify-between py-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"Member Since"}),s.jsx("span",{children:e!=null&&e.created_at?new Date(e.created_at).toLocaleDateString():"-"})]})]})]})]}),s.jsxs(Ft,{value:"billing",className:"space-y-6",children:[s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Payment Method"}),s.jsx(it,{children:"Manage your payment information"})]}),s.jsx(le,{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center justify-between p-4 border border-border rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"h-10 w-14 bg-muted rounded flex items-center justify-center",children:s.jsx(Zo,{className:"h-5 w-5 text-muted-foreground"})}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:"No payment method"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Add a card to upgrade your plan"})]})]}),s.jsx(U,{variant:"outline",size:"sm",onClick:()=>{(e==null?void 0:e.plan)==="free"?a("/dashboard/subscription"):u.mutate()},disabled:u.isPending,children:u.isPending?s.jsx(Te,{className:"h-4 w-4 animate-spin"}):(e==null?void 0:e.plan)==="free"?"Add Card":"Manage"})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Current Plan"}),s.jsx(it,{children:"Your subscription details"})]}),s.jsx(le,{children:s.jsxs("div",{className:"flex items-center justify-between p-4 border border-border rounded-lg",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"font-medium text-lg capitalize",children:[(e==null?void 0:e.plan)||"Free"," Plan"]}),s.jsx("p",{className:"text-sm text-muted-foreground",children:(e==null?void 0:e.plan)==="free"?"Limited features, upgrade to unlock more":"Full access to all features"})]}),s.jsx(U,{variant:(e==null?void 0:e.plan)==="free"?"default":"outline",onClick:()=>{(e==null?void 0:e.plan)==="free"?a("/dashboard/subscription"):u.mutate()},disabled:u.isPending,children:u.isPending?s.jsx(Te,{className:"h-4 w-4 animate-spin"}):(e==null?void 0:e.plan)==="free"?"Upgrade":"Manage"})]})})]})]}),s.jsxs(Ft,{value:"privacy",className:"space-y-6",children:[s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:d("privacy.exportData")}),s.jsx(it,{children:d("privacy.exportDataDesc")})]}),s.jsx(le,{children:s.jsxs(U,{onClick:C,disabled:v,variant:"outline",children:[v?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(ci,{className:"mr-2 h-4 w-4"}),d("privacy.exportButton")]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:d("privacy.consent")}),s.jsx(it,{children:d("privacy.consentDesc")})]}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"space-y-0.5",children:s.jsx(pe,{children:d("privacy.consentAnalytics")})}),s.jsx(xn,{checked:N.analytics,onCheckedChange:z=>E("analytics",z)})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"space-y-0.5",children:s.jsx(pe,{children:d("privacy.consentMarketing")})}),s.jsx(xn,{checked:N.marketing,onCheckedChange:z=>E("marketing",z)})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"space-y-0.5",children:s.jsx(pe,{children:d("privacy.consentAI")})}),s.jsx(xn,{checked:N.ai_processing,onCheckedChange:z=>E("ai_processing",z)})]})]})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:d("privacy.legalLinks")}),s.jsx(it,{children:d("privacy.legalLinksDesc")})]}),s.jsxs(le,{className:"space-y-2",children:[s.jsxs(vt,{to:"/privacy",className:"flex items-center gap-2 text-sm text-primary hover:underline",children:[s.jsx(xf,{className:"h-3 w-3"}),d("legal.privacyPolicy")]}),s.jsxs(vt,{to:"/terms",className:"flex items-center gap-2 text-sm text-primary hover:underline",children:[s.jsx(xf,{className:"h-3 w-3"}),d("legal.termsOfService")]}),s.jsxs(vt,{to:"/cookies",className:"flex items-center gap-2 text-sm text-primary hover:underline",children:[s.jsx(xf,{className:"h-3 w-3"}),d("legal.cookiePolicy")]}),s.jsxs(vt,{to:"/legal",className:"flex items-center gap-2 text-sm text-primary hover:underline",children:[s.jsx(xf,{className:"h-3 w-3"}),d("legal.legalNotice")]})]})]}),s.jsxs(Z,{className:"border-destructive/50",children:[s.jsxs(we,{children:[s.jsx(Ne,{className:"text-destructive",children:d("privacy.deleteAccount")}
969),s.jsx(it,{children:d("privacy.deleteAccountDesc")})]}),s.jsx(le,{children:s.jsxs(Ic,{children:[s.jsx(b0,{asChild:!0,children:s.jsxs(U,{variant:"destructive",children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),d("privacy.deleteButton")]})}),s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:d("privacy.deleteConfirm")}),s.jsx(ll,{children:d("privacy.deleteConfirmDesc")})]}),s.jsxs("div",{className:"py-4",children:[s.jsx(pe,{children:d("privacy.deleteTypeName",{username:e==null?void 0:e.username})}),s.jsx(Re,{className:"mt-2",value:g,onChange:z=>y(z.target.value),placeholder:e==null?void 0:e.username})]}),s.jsxs(il,{children:[s.jsx(ul,{children:d("common.cancel")}),s.jsxs(cl,{onClick:_,disabled:g!==(e==null?void 0:e.username)||b,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[b?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(pn,{className:"mr-2 h-4 w-4"}),d("privacy.deleteButton")]})]})]})]})})]})]}),s.jsx(Ft,{value:"appearance",className:"space-y-6",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Theme"}),s.jsx(it,{children:"Customize the look of your dashboard"})]}),s.jsx(le,{className:"space-y-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx(pe,{htmlFor:"dark-mode",children:"Dark Mode"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Switch to dark theme"})]}),s.jsx(xn,{id:"dark-mode",checked:n,onCheckedChange:r})]})})]})})]})]})},Gtt=[{id:"free",name:"Free",type:"free",price_monthly:0,price_yearly:0,currency:"USD",description:"Perfect for trying out Refraxion",features:[{name:"3 datasets",included:!0},{name:"10 reports",included:!0},{name:"5 AI queries/day",included:!0},{name:"CSV uploads only",included:!0},{name:"Community support",included:!0}],limits:{}},{id:"starter",name:"Starter",type:"starter",price_monthly:19,price_yearly:190,currency:"USD",description:"For individuals and small teams",features:[{name:"50 datasets",included:!0},{name:"100 reports",included:!0},{name:"Unlimited AI queries",included:!0},{name:"All file types",included:!0},{name:"Email support",included:!0},{name:"API access",included:!0}],limits:{}},{id:"pro",name:"Pro",type:"pro",price_monthly:49,price_yearly:490,currency:"USD",description:"For growing teams and businesses",features:[{name:"Unlimited datasets",included:!0},{name:"Unlimited reports",included:!0},{name:"Premium AI features",included:!0},{name:"Priority support",included:!0},{name:"Team collaboration",included:!0},{name:"Scheduled reports",included:!0},{name:"Custom branding",included:!0}],limits:{},is_popular:!0},{id:"enterprise",name:"Enterprise",type:"enterprise",price_monthly:199,price_yearly:1990,currency:"USD",description:"For large organizations",features:[{name:"Everything in Pro",included:!0},{name:"Unlimited users",included:!0},{name:"Dedicated support",included:!0},{name:"Custom integrations",included:!0},{name:"SLA guarantee",included:!0},{name:"On-premise option",included:!0}],limits:{},is_enterprise:!0}],Ytt=()=>{var y,v;const{data:e,isLoading:t}=jpe(),{data:n,isLoading:r}=Npe(),{data:a}=R7(),i=Qme(),o=x7(),l=e||Gtt,c=(n==null?void 0:n.plan)||"free",u=t||r,d=w=>w===0?"$0":`$${w}`,f=w=>w?new Date(w).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):"",h=async w=>{try{await i.mutateAsync({plan_id:w,interval:"MONTHLY"})}catch{se.error("Failed to start checkout. Please try again.")}},m=async()=>{try{await o.mutateAsync()}catch{se.error("Failed to open billing portal. Please try again.")}},p=w=>w.type===c?"Current Plan":w.is_enterprise?"Contact Sales":w.type==="free"?"Downgrade":`Upgrade to ${w.name}`,g=w=>w.type===c;return u?s.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h1",{className:"text-4xl font-bold text-foreground",children:"Choose Your Plan"}),s.jsx("p",{className:"text-lg text-muted-foreground",children:"Flexible pricing for teams of all sizes"})]}),n&&s.jsx(Z,{className:"bg-gradient-primary border-0",children:s.jsx(le,{className:"p-6 text-white",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsxs("h3",{className:"text-lg font-semibold",children:["You're on the ",((y=n.plan_details)==null?void 0:y.name)||n.plan," Plan"]}),s.jsxs("p",{className:"text-white/90 text-sm mt-1",children:[n.current_period_end&&s.jsxs(s.Fragment,{children:["Next billing date: ",f(n.current_period_end)]}),n.plan!=="free"&&n.interval&&s.jsxs(s.Fragment,{children:[" • ",d(((v=n.plan_details)==null?void 0:v.price_monthly)||0),"/",n.interval.toLowerCase()]})]})]}),s.jsxs(U,{variant:"secondary",onClick:m,disabled:o.isPending||n.plan==="free",children:[o.isPending?s.jsx(Te,{className:"h-4 w-4 animate-spin mr-2"}):null,"Manage Billing"]})]})})}),s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-4",children:l.map(w=>s.jsxs(Z,{className:te("relative transition-all hover:shadow-xl",w.is_popular&&"border-primary border-2"),children:[w.is_popular&&s.jsx("div",{className:"absolute -top-4 left-1/2 transform -translate-x-1/2",children:s.jsx($e,{className:"bg-gradient-primary text-white",children:"Most Popular"})}),s.jsxs(we,{children:[s.jsx(Ne,{className:"text-2xl",children:w.name}),s.jsx(it,{children:w.description}),s.jsxs("div",{className:"mt-4",children:[s.jsx("span",{className:"text-4xl font-bold text-foreground",children:w.is_enterprise?"Custom"
969:d(w.price_monthly)}),s.jsxs("span",{className:"text-muted-foreground text-sm ml-2",children:["/",w.is_enterprise?"contact sales":w.price_monthly===0?"forever":"per month"]})]})]}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs(U,{className:"w-full",variant:g(w)?"outline":"default",disabled:g(w)||i.isPending,onClick:()=>!w.is_enterprise&&h(w.id),children:[i.isPending?s.jsx(Te,{className:"h-4 w-4 animate-spin mr-2"}):null,p(w)]}),s.jsx("div",{className:"space-y-3",children:w.features.map((b,j)=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(bt,{className:"h-5 w-5 text-success flex-shrink-0 mt-0.5"}),s.jsx("span",{className:"text-sm text-foreground",children:typeof b=="string"?b:b.name})]},j))})]})]},w.id))}),a&&s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Your Usage"}),s.jsx(it,{children:"Current billing period usage statistics"})]}),s.jsx(le,{children:s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Data Sources"}),s.jsxs("p",{className:"text-2xl font-bold",children:[a.data_sources.used,!a.data_sources.is_unlimited&&` / ${a.data_sources.limit}`]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reports"}),s.jsxs("p",{className:"text-2xl font-bold",children:[a.reports.used,!a.reports.is_unlimited&&` / ${a.reports.limit}`]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"AI Queries Today"}),s.jsxs("p",{className:"text-2xl font-bold",children:[a.ai_queries.used,!a.ai_queries.is_unlimited&&` / ${a.ai_queries.limit}`]})]})]})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"Frequently Asked Questions"})}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Can I change my plan at any time?"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Yes, you can upgrade or downgrade your plan at any time. Changes will be reflected in your next billing cycle."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"What payment methods do you accept?"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"We accept all major credit cards, PayPal, and wire transfers for Enterprise plans."})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-semibold text-foreground mb-2",children:"Is there a free trial?"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Yes! All paid plans come with a 14-d
969ay free trial. No credit card required."})]})]})]})]})},Xtt=[{value:"7",label:"Last 7 days"},{value:"14",label:"Last 14 days"},{value:"30",label:"Last 30 days"},{value:"90",label:"Last 90 days"}],OF=e=>`$${e.toFixed(4)}`,Qx=e=>e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toString(),Qtt=()=>{Cr();const{user:e}=lo(),[t,n]=x.useState(30),{data:r,isLoading:a}=bpe(t),{data:i}=qk(),{data:o}=R7(),l=((r==null?void 0:r.daily_breakdown)||[]).slice().reverse().map(u=>({...u,date:new Date(u.date).toLocaleDateString(void 0,{month:"short",day:"numeric"})})),c=((e==null?void 0:e.plan)||"free").toUpperCase();return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"API Usage"}),s.jsx("p",{className:"text-muted-foreground",children:"Monitor your AI consumption and costs"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx($e,{variant:"secondary",className:"text-xs capitalize",children:c}),s.jsxs(rt,{value:String(t),onValueChange:u=>n(Number(u)),children:[s.jsx(tt,{className:"w-[160px]",children:s.jsx(st,{})}),s.jsx(nt,{children:Xtt.map(u=>s.jsx(_e,{value:u.value,children:u.label},u.value))})]})]})]}),i&&s.jsxs(Z,{children:[s.jsx(we,{className:"pb-3",children:s.jsx(Ne,{className:"text-base",children:"Today's Usage"})}),s.jsxs(le,{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm text-muted-foreground",children:"AI queries today"}),s.jsxs("span",{className:"text-sm font-medium",children:[i.daily_queries_used||0,i.daily_queries_limit!==-1?` / ${i.daily_queries_limit}`:"",i.is_unlimited&&s.jsx($e,{variant:"outline",className:"ml-2 text-xs",children:"Unlimited"})]})]}),!i.is_unlimited&&i.daily_queries_limit&&i.daily_queries_limit>0&&s.jsx(_u,{value:Math.min((i.daily_queries_used||0)/i.daily_queries_limit*100,100),className:"h-2"}),i.approaching_limit&&!i.limit_reached&&s.jsxs("p",{className:"text-xs text-yellow-600 dark:text-yellow-400 mt-2",children:["You've used ",i.usage_percentage,"% of your daily limit"]}),i.limit_reached&&s.jsx("p",{className:"text-xs text-destructive mt-2",children:"Daily limit reached. Resets at midnight UTC."})]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-4",children:[s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-primary/10 flex items-center justify-center",children:s.jsx(ai,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Queries"}),s.jsx("p",{className:"text-2xl font-bold",children:(r==null?void 0:r.total_queries)||0})]})]})})}),s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-blue-500/10 flex items-center justify-center",children:s.jsx(nk,{className:"h-5 w-5 text-blue-500"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Tokens"}),s.jsx("p",{className:"text-2xl font-bold",children:Qx((r==null?void 0:r.total_tokens)||0)})]})]})})}),s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-green-500/10 flex items-center justify-center",children:s.jsx(Tg,{className:"h-5 w-5 text-green-500"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Estimated Cost"}),s.jsx("p",{className:"text-2xl font-bold",children:OF((r==null?void 0:r.total_cost_usd)||0)})]})]})})}),s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"h-10 w-10 rounded-lg bg-purple-500/10 flex items-center justify-center",children:s.jsx(Wa,{className:"h-5 w-5 text-purple-500"})}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Avg Tokens/Query"}),s.jsx("p",{className:"text-2xl font-bold",children:r&&r.total_queries>0?Qx(Math.round(r.total_tokens/r.total_queries)):"0"})]})]})})})]}),s.jsxs(fo,{defaultValue:"queries",className:"space-y-4",children:[s.jsxs(ji,{children:[s.jsx(Rt,{value:"queries",children:"Queries"}),s.jsx(Rt,{value:"tokens",children:"Tokens"}),s.jsx(Rt,{value:"cost",children:"Cost"})]}),s.jsx(Ft,{value:"queries",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Daily Queries"}),s.jsx(it,{children:"Number of AI queries per day"})]}),s.jsx(le,{children:l.length>0?s.jsx(Cn,{width:"100%",height:300,children:s.jsxs(Oc,{data:l,children:[s.jsx(Fo,{strokeDasharray:"3 3",className:"stroke-border"}),s.jsx(Bn,{dataKey:"date",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(zn,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(kt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",color:"hsl(var(--foreground))"}}),s.jsx(Gr,{dataKey:"queries",fill:"hsl(var(--primary))",radius:[4,4,0,0]})]})}):s.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No usage data for this period"})})]})}),s.jsx(Ft,{value:"tokens",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Daily Token Usage"}),s.jsx(it,{children:"Tokens consumed per day"})]}),s.jsx(le,{children:l.length>0?s.jsx(Cn,{width:"100%",height:300,children:s.jsxs(bM,{data:l,children:[s.jsx(Fo,{strokeDasharray:"3 3",className:"stroke-border"}),s.jsx(Bn,{dataKey:"date",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(zn,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"},tickFormatter:Qx}),s.jsx(kt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",color:"hsl(var(--foreground))"},formatter:u=>[Qx(u),"Tokens"]}
969),s.jsx(vl,{type:"monotone",dataKey:"tokens",stroke:"hsl(var(--primary))",strokeWidth:2,dot:{r:3}})]})}):s.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No usage data for this period"})})]})}),s.jsx(Ft,{value:"cost",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Daily Cost"}),s.jsx(it,{children:"Estimated cost per day (USD)"})]}),s.jsx(le,{children:l.length>0?s.jsx(Cn,{width:"100%",height:300,children:s.jsxs(Oc,{data:l,children:[s.jsx(Fo,{strokeDasharray:"3 3",className:"stroke-border"}),s.jsx(Bn,{dataKey:"date",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),s.jsx(zn,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"},tickFormatter:u=>`$${u}`}),s.jsx(kt,{contentStyle:{backgroundColor:"hsl(var(--card))",border:"1px solid hsl(var(--border))",borderRadius:"8px",color:"hsl(var(--foreground))"},formatter:u=>[OF(u),"Cost"]}),s.jsx(Gr,{dataKey:"cost_usd",fill:"hsl(var(--chart-2))",radius:[4,4,0,0]})]})}):s.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No usage data for this period"})})]})})]}),o&&s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{children:"Plan Limits"}),s.jsx(it,{children:"Current resource usage against your plan limits"})]}),s.jsx(le,{children:s.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Data Sources"}),s.jsxs("span",{className:"font-medium",children:[o.data_sources.used,!o.data_sources.is_unlimited&&` / ${o.data_sources.limit}`]})]}),!o.data_sources.is_unlimited&&s.jsx(_u,{value:o.data_sources.used/o.data_sources.limit*100,className:"h-2"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"Reports"}),s.jsxs("span",{className:"font-medium",children:[o.reports.used,!o.reports.is_unlimited&&` / ${o.reports.limit}`]})]}),!o.reports.is_unlimited&&s.jsx(_u,{value:o.reports.used/o.reports.limit*100,className:"h-2"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-muted-foreground",children:"AI Queries Today"}),s.jsxs("span",{className:"font-medium",children:[o.ai_queries.used,!o.ai_queries.is_unlimited&&` / ${o.ai_queries.limit}`]})]}),!o.ai_queries.is_unlimited&&s.jsx(_u,{value:o.ai_queries.used/o.ai_queries.limit*100,className:"h-2"})]})]})})]})]})},Jtt={postgresql:"https://api.iconify.design/logos/postgresql.svg",mysql:"https://api.iconify.design/logos/mysql-icon.svg",mongodb:"https://api.iconify.design/logos/mongodb-icon.svg",mariadb:"https://api.iconify.design/logos/mariadb-icon.svg",sqlserver:"https://api.iconify.design/logos/microsoft-icon.svg",oracle:"https://api.iconify.design/logos/oracle.svg",sqlite:"https://api.iconify.design/logos/sqlite.svg",redis:"https://api.iconify.design/logos/redis.svg",snowflake:"https://api.iconify.design/logos/snowflake-icon.svg",bigquery:"https://api.iconify.design/logos/google-cloud.svg",databricks:"https://api.iconify.design/simple-icons/databricks.svg",stripe:"https://api.iconify.design/logos/stripe.svg",salesforce:"https://api.iconify.design/logos/salesforce.svg",hubspot:"https://api.iconify.design/logos/hubspot.svg",google_analytics:"https://api.iconify.design/logos/google-analytics.svg",amazon_s3:"https://api.iconify.design/logos/aws-s3.svg",google_drive:"https://api.iconify.design/logos/google-drive.svg",azure_blob:"https://api.iconify.design/logos/azure-icon.svg",odoo:"https://api.iconify.design/simple-icons/odoo.svg",sap:"https://api.iconify.design/logos/sap.svg",elasticsearch:"https://api.iconify.design/logos/elasticsearch.svg"},TF=({connectorType:e})=>{const[t,n]=x.useState(!1),r=Jtt[e];return x.useEffect(()=>{n(!1)},[e]),!r||t?s.jsx(wt,{className:"h-6 w-6 text-primary"}):s.jsx("img",{src:r,alt:e,className:"h-8 w-8 object-contain",onError:()=>n(!0)})},Ztt=()=>{var ee;const{t:e}=Cr(),t=cn(),{data:n=[],isLoading:r,isError:a,error:i,refetch:o}=_m(),l=Spe(),c=Cpe(),u=_pe(),d=Epe(),f=Ape(),h=Ppe(),[m,p]=x.useState(!1),[g,y]=x.useState(!1),[v,w]=x.useState(null),[b,j]=x.useState(null),[N,S]=x.useState(new Set),[C,_]=x.useState(null),[E,T]=x.useState({name:"",host:"",port:"",database:"",username:"",password:"",ssl_enabled:!1}),P=n,k=n.filter(V=>V.status==="connected"),D=async()=>
969{if(!v)return;const V={type:v.type,host:E.host,port:E.port?parseInt(E.port):v.defaultPort,database:E.database,username:E.username,password:E.password,ssl_enabled:E.ssl_enabled};try{const K=await d.mutateAsync(V);K.success?se.success(`Connection successful! Latency: ${K.latency_ms}ms`):se.error(K.error||"Connection failed")}catch(K){se.error((K==null?void 0:K.detail)||"Connection test failed")}},A=async()=>{if(!v)return;const V={name:E.name||`My ${v.name}`,type:v.type,host:E.host,port:E.port?parseInt(E.port):v.defaultPort,database:E.database,username:E.username,password:E.password,ssl_enabled:E.ssl_enabled};try{await l.mutateAsync(V),se.success(`Connected to ${v.name}`),y(!1),z()}catch(K){se.error((K==null?void 0:K.detail)||"Failed to create connector")}},I=async V=>{S(K=>new Set(K).add(V.id));try{const K=await h.mutateAsync(V.id),W=K.tables_count??0,q=K.tables_with_access??W,J=K.tables_without_access??0;J>0?se.success(`${V.name} synced: ${W} tables found. ${q} accessible, ${J} restricted.`,{description:"Some tables may require additional database permissions.",duration:5e3}):se.success(`${V.name} synced successfully! ${W} tables found.`)}catch(K){se.error((K==null?void 0:K.detail)||"Sync failed")}finally{S(K=>{const W=new Set(K);return W.delete(V.id),W})}},M=async V=>{_(V.id);try{const K=await f.mutateAsync(V.id);K.success?se.success(`Connection OK! Latency: ${K.latency_ms}ms`):se.error(K.error||"Connection test failed")}catch(K){se.error((K==null?void 0:K.detail)||"Connection test failed")}finally{_(null)}},$=async()=>{if(b)try{await u.mutateAsync(b.id),se.success(`Disconnected from ${b.name}`),p(!1),j(null)}catch(V){se.error((V==null?void 0:V.detail)||"Failed to disconnect")}},R=async()=>{if(b)try{await c.mutateAsync({id:b.id,data:{name:E.name||b.name,host:E.host||b.host,port:E.port?parseInt(E.port):b.port,database:E.database||b.database,username:E.username||b.username,password:E.password||void 0,ssl_enabled:E.ssl_enabled}}),se.success("Settings saved"),p(!1)}catch(V){se.error((V==null?void 0:V.detail)||"Failed to save settings")}},O=V=>{var K;j(V),T({name:V.name,host:V.host||"",port:((K=V.port)==null?void 0:K.toString())||"",database:V.database||"",username:V.username||"",password:"",ssl_enabled:V.ssl_enabled}),p(!0)},F=V=>{var K;w(V),T({name:`My ${V.name}`,host:"",port:((K=V.defaultPort)==null?void 0:K.toString())||"",database:"",username:"",password:"",ssl_enabled:!1}),y(!0)},z=()=>{T({name:"",host:"",port:"",database:"",username:"",password:"",ssl_enabled:!1}),w(null)},B=V=>n.filter(K=>K.type===V),H=({connectorType:V})=>{const W=B(V.type).length,q=W>0;return s.jsxs(Z,{className:"hover:shadow-lg transition-all hover:-translate-y-1",children:[s.jsx(we,{children:s.jsx("div",{className:"flex items-start justify-between",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:s.jsx(TF,{connectorType:V.type})}),s.jsxs("div",{children:[s.jsxs(Ne,{className:"text-base flex items-center gap-2",children:[V.name,!V.available&&s.jsx($e,{variant:"secondary",className:"text-xs",children:"Coming Soon"}),q&&s.jsxs($e,{variant:"outline",className:"text-xs bg-green-50 text-green-700 border-green-200",children:[W," ",W===1?"connection":"connections"]})]}),s.jsx(it,{className:"text-xs",children:V.description})]})]})})}),s.jsx(le,{className:"space-y-4",children:s.jsxs(U,{className:"w-full bg-gradient-primary",size:"sm",disabled:!V.available,onClick:()=>F(V),children:[s.jsx(Ln,{className:"mr-2 h-3 w-3"}),q?"Add Another Connection":"Connect"]})})]})},Y=({connector:V})=>(jS.find(K=>K.type===V.type),s.jsxs(Z,{className:"hover:shadow-lg transition-all hover:-translate-y-1",children:[s.jsx(we,{children:s.jsx("div",{className:"flex items-start justify-between",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-white rounded-lg shadow-sm",children:s.jsx(TF,{connectorType:V.type})}),s.jsxs("div",{children:[s.jsx(Ne,{className:"text-base",children:V.name}),s.jsxs(it,{className:"text-xs",children:[V.host,":",V.port,"/",V.database]})]})]})})}),s.jsxs(le,{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center gap-2",children:V.status==="connected"?s.jsxs(s.Fragment,{children:[s.jsx(_j,{className:"h-4 w-4 text-green-600"}),s.jsx("span",{className:"text-sm text-green-600",children:"Connected"})]}):V.status==="error"?s.jsxs(s.Fragment,{children:[s.jsx(Yn,{className:"h-4 w-4 text-red-600"}),s.jsx("span",{className:"text-sm text-red-600",children:V.last_error||"Error"})]}):s.jsxs(s.Fragment,{children:[s.jsx(tk,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Disconnected"})]})}),V.last_synced_at&&s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last synced: ",new Date(V.last_synced_at).toLocaleStr
969ing()]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(U,{variant:"outline",size:"sm",className:"flex-1",onClick:()=>O(V),children:[s.jsx(QP,{className:"mr-2 h-3 w-3"}),"Settings"]}),s.jsxs(U,{variant:"outline",size:"sm",className:"flex-1",disabled:N.has(V.id),onClick:()=>I(V),children:[s.jsx(Vn,{className:`mr-2 h-3 w-3 ${N.has(V.id)?"animate-spin":""}`}),N.has(V.id)?"Syncing...":"Sync"]})]}),s.jsxs(U,{variant:"ghost",size:"sm",className:"w-full text-muted-foreground",disabled:C===V.id,onClick:()=>M(V),children:[s.jsx(r0,{className:"mr-2 h-3 w-3"}),C===V.id?"Testing...":"Test Connection"]})]})]}));if(r)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})});if(a){const V=(i==null?void 0:i.detail)||(i==null?void 0:i.message)||"";return V.includes("PRO")||V.includes("ENTERPRISE")||V.includes("plan")?s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-6",children:[s.jsx("div",{className:"h-20 w-20 rounded-full bg-gradient-to-br from-amber-400 to-amber-600 flex items-center justify-center",children:s.jsx(eo,{className:"h-10 w-10 text-white"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("h2",{className:"text-2xl font-bold text-foreground",children:"Upgrade to Access Connectors"}),s.jsxs("p",{className:"text-muted-foreground max-w-md",children:["Database connectors are available on ",s.jsx("strong",{children:"PRO"})," and ",s.jsx("strong",{children:"ENTERPRISE"})," plans. Upgrade your subscription to connect to external databases like PostgreSQL and MySQL."]})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(U,{variant:"outline",onClick:()=>t("/dashboard"),children:"Back to Dashboard"}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>t("/dashboard/subscription"),children:[s.jsx(eo,{className:"mr-2 h-4 w-4"}),"Upgrade Plan"]})]}),s.jsxs("div",{className:"mt-8 grid gap-4 md:grid-cols-3 max-w-3xl",children:[s.jsx(Z,{className:"border-dashed opacity-60",children:s.jsxs(le,{className:"pt-6 text-center",children:[s.jsx(qu,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),s.jsx("h3",{className:"font-medium",children:"PostgreSQL"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Connect to PostgreSQL databases"})]})}),s.jsx(Z,{className:"border-dashed opacity-60",children:s.jsxs(le,{className:"pt-6 text-center",children:[s.jsx(qu,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),s.jsx("h3",{className:"font-medium",children:"MySQL"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Connect to MySQL databases"})]})}),s.jsx(Z,{className:"border-dashed opacity-60",children:s.jsxs(le,{className:"pt-6 text-center",children:[s.jsx(qu,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),s.jsx("h3",{className:"font-medium",children:"More Coming"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"MongoDB, Stripe, Salesforce..."})]})})]})]}):s.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[s.jsx(Yn,{className:"h-12 w-12 text-destructive"}),s.jsx("p",{className:"text-lg font-medium",children:"Failed to load connectors"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:V||"An unexpected error occurred"}),s.jsxs(U,{onClick:()=>o(),children:[s.jsx(Vn,{className:"mr-2 h-4 w-4"}),"Retry"]})]})}return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:e("connectors.title")}),s.jsx("p",{className:"text-muted-foreground mt-1",children:e("connectors.subtitle")})]}),s.jsxs($e,{variant:"secondary",className:"w-fit",children:[k.length," Active Connection",k.length!==1?"s":""]})]}),s.jsxs(fo,{defaultValue:"all",className:"space-y-6",children:[s.jsxs(ji,{children:[s.jsx(Rt,{value:"all",children:"All Connectors"}),s.jsxs(Rt,{value:"connected",children:["My Connections (",P.length,")"]}),s.jsx(Rt,{value:"database",children:e("connectors.types.database")}),s.jsx(Rt,{value:"api",children:e("connectors.types.api")||"API"}),s.jsx(Rt,{value:"storage",children:e("connectors.types.cloud")})]}),s.jsx(br,{open:g,onOpenChange:y,children:s.jsxs(or,{className:"sm:max-w-[500px]",children:[s.jsxs(lr,{children:[s.jsxs(cr,{children:["Connect to ",v==null?void 0:v.name]}),s.jsx(wr,{children:v==null?void 0:v.description})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Connection Name"}),s.jsx(Re,{value:E.name,onChange:V=>T({...E,name:V.target.value}),placeholder:`My ${v==null?void 0:v.name} Connection`})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Host"}),s.jsx(Re,{value:E.host,onChange:V=>T({...E,host:V.target.value}),placeholder:"localhost"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Port"}),s.jsx(Re,{type:"number",value:E.port,onChange:V=>T({...E,port:V.target.value}),placeholder:(ee=v==null?void 0:v.defaultPort)==null?void 0:ee.toString()})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Database"}),s.jsx(Re,{value:E.database,onChange:V=>T({...E,database:V.target.value}),placeholder:"my_database"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Username"}),s.jsx(Re,{value:E.username,onChange:V=>T({...E,username:V.target.value}),placeholder:"username"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Password"}),s.jsx(Re,{type:"password",value:E.password,onChange:V=>T({...E,password:V.target.value}),placeholder:"••••••••"})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(pe,{children:"SSL Enabled"}),s.jsx(xn,{checked:E.ssl_enabled,onCheckedChange:V=>T({...E,ssl_enabled:V})})]})]}),s.jsxs(_a,{className:"flex gap-2",children:[s.jsxs(U,{variant:"outline",onClick:D,disabled:d.isPending,children:[d.isPending?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(r0,{className:"mr-2 h-4 w-4"}),"Test Connection"]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:A,disabled:l.isPending,children:[l.isPending?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(Ln,{className:"mr-2 h-4 w-4"}),"Connect"]})]})]})}),s.jsx(br,{open:m,onOpenChange:p,children:s.jsxs(or,{className:"sm:max-w-[500px]",children:[s.jsxs(lr,{children:[s.jsxs(cr,{children:[b==null?void 0:b.name," Settings"]}),s.jsxs(wr,{children:["Manage your ",b==null?void 0:b.name," connection settings"]})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Connection Name"}),s.jsx(Re,{value:E.name,onChange:V=>T({...E,name:V.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Host"}),s.jsx(Re,{value:E.host,onChange:V=>T({...E,host:V.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Port"}),s.jsx(Re,{type:"number",value:E.port,onChange:V=>T({...E,port:V.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Database"}),s.jsx(Re,{value:E.database,onChange:V=>T({...E,database:V.target.value})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Username"}),s.jsx(Re,{value:E.username,onChange:V=>T({...E,username:V.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{children:"Password"}),s.jsx(Re,{type:"password",value:E.password,onChange:V=>T({...E,password:V.target.value}),placeholder:"••••••••••••••••"})]})]}),s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx(pe,{children:"SSL Enabled"}),s.jsx(xn,{checked:E.ssl_enabled,onCheckedChange:V=>T({...E,ssl_enabled:V})})]})]}),s.jsxs(_a,{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex gap-2 w-full",children:[s.jsx(U,{variant:"outline",className:"flex-1",onClick:()=>p(!1),children:"Cancel"}),s.jsxs(U,{className:"flex-1 bg-gradient-primary",onClick:R,disabled:c.isPending,children:[c.isPending?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save Changes"]})]}),s.jsxs(U,{variant:"destructive",className:"w-full",onClick:$,disabled:u.isPending,children:[u.isPending?s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}):s.jsx(pn,{className:"mr-2 h-4 w-4"}),"Disconnect"]})]})]})}),s.jsx(Ft,{value:"all",className:"space-y-6",children:s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:jS.map(V=>s.jsx(H,{connectorType:V},V.type))})}),s.jsx(Ft,{value:"connected",className:"space-y-6",children:P.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[s.jsx(wt,{className:"h-12 w-12 text-muted-foreground"}),s.jsx("p",{className:"text-lg font-medium text-muted-foreground",children:"No connections yet"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:'Go to "All Connectors" to add your first database connection'})]}):s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:P.map(V=>s.jsx(Y,{connector:V},V.id))})}),["database","api","storage"].map(V=>s.jsx(Ft,{value:V,className:"space-y-6",children:s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:jS.filter(K=>K.category===V).map(K=>s.jsx(H,{connectorType:K},K.type))})},V))]})]})};function bn({className:e,...t}){return s.jsx("div",{className:te("animate-pulse rounded-md bg-muted",e),...t})}const Br={STATS:`${be}/dashboard/admin/stats`,AI_USAGE:`${be}/dashboard/admin/ai-usage`,AI_USAGE_ALERTS:`${be}/dashboard/admin/ai-usage/alerts`,RECENT_ACTIONS:`${be}/dashboard/admin/recent-actions`,AUDIT_LOGS:`${be}/admin/audit-logs`,USERS:`${be}/users`},qa={async getStats(){return(await ue.get(Br.STATS)).data},async getAIUsage(e=30){return(await ue.get(Br.AI_USAGE,{params:{days:e}})).data},async getAIUsageAlerts(){return(await ue.get(Br.AI_USAGE_ALERTS)).data},async getRecentActions(e=10,t=24){return(await ue.get(Br.RECENT_ACTIONS,{params:{limit:e,hours:t}}
969)).data},async getAuditLogs(e={}){return(await ue.get(Br.AUDIT_LOGS,{params:{page:e.page||1,limit:e.limit||50,...e}})).data},async listUsers(e={}){return(await ue.get(Br.USERS,{params:{page:e.page||1,page_size:e.limit||20,search:e.search,plan:e.plan,is_active:e.is_active,order_by:e.sort_by||"created_at",order_desc:e.sort_order==="desc"}})).data},async getUser(e){return(await ue.get(`${Br.USERS}/${e}`)).data},async getUserDetailedStats(e){return(await ue.get(`${Br.USERS}/${e}/detailed-stats`)).data},async banUser(e,t){return(await ue.post(`${Br.USERS}/${e}/ban`,t)).data},async unbanUser(e,t){return(await ue.post(`${Br.USERS}/${e}/unban`,{reason:t})).data},async changeUserPlan(e,t){return(await ue.put(`${Br.USERS}/${e}/plan`,t)).data},async changeUserRole(e,t){return(await ue.put(`${Br.USERS}/${e}/role`,t)).data},async forceLogout(e,t){return(await ue.post(`${Br.USERS}/${e}/force-logout`,{reason:t||"Admin action"})).data},async getUserSessions(e){return(await ue.get(`${Br.USERS}/${e}/sessions`)).data},async deleteUser(e,t){return(await ue.delete(`${Br.USERS}/${e}`,{params:{reason:t}})).data},async getUserAuditHistory(e,t=20){return(await ue.get(`${Br.USERS}/${e}/audit-history`,{params:{limit:t}})).data}},dt={all:["admin"],stats:()=>[...dt.all,"stats"],aiUsage:e=>[...dt.all,"ai-usage",e],aiUsageAlerts:()=>[...dt.all,"ai-usage-alerts"],recentActions:(e,t)=>[...dt.all,"recent-actions",e,t],auditLogs:e=>[...dt.all,"audit-logs",e],users:()=>[...dt.all,"users"],usersList:e=>[...dt.users(),"list",e],user:e=>[...dt.users(),e],userDetailedStats:e=>[...dt.users(),e,"detailed-stats"],userSessions:e=>[...dt.users(),e,"sessions"],userAuditHistory:e=>[...dt.users(),e,"audit-history"]};function yZ(){return Qt({queryKey:dt.stats(),queryFn:()=>qa.getStats(),staleTime:5*60*1e3,refetchInterval:5*60*1e3})}function ent(e=30){return Qt({queryKey:dt.aiUsage(e),queryFn:()=>qa.getAIUsage(e),staleTime:5*60*1e3})}function vZ(){return Qt({queryKey:dt.aiUsageAlerts(),queryFn:()=>qa.getAIUsageAlerts(),staleTime:2*60*1e3,refetchInterval:2*60*1e3})}function tnt(e=10,t=24){return Qt({queryKey:dt.recentActions(e,t),queryFn:()=>qa.getRecentActions(e,t),staleTime:1*60*1e3,refetchInterval:1*60*1e3})}function nnt(e={}){return Qt({queryKey:dt.auditLogs(e),queryFn:()=>qa.getAuditLogs(e),staleTime:30*1e3})}function rnt(e={}){return Qt({queryKey:dt.usersList(e),queryFn:()=>qa.listUsers(e),staleTime:30*1e3})}function ant(e){return Qt({queryKey:dt.userDetailedStats(e),queryFn:()=>qa.getUserDetailedStats(e),enabled:!!e,staleTime:60*1e3})}function snt(e,t=20){return Qt({queryKey:dt.userAuditHistory(e),queryFn:()=>qa.getUserAuditHistory(e,t),enabled:!!e,staleTime:30*1e3})}function int(){const e=ct();return Qe({mutationFn:({userId:t,data:n})=>qa.banUser(t,n),onSuccess:(t,{userId:n})=>{e.invalidateQueries({queryKey:dt.user(n)}),e.invalidateQueries({queryKey:dt.userDetailedStats(n)}),e.invalidateQueries({queryKey:dt.users()}),e.invalidateQueries({queryKey:dt.stats()}),e.invalidateQueries({queryKey:dt.recentActions(10,24)})}})}function ont(){const e=ct();return Qe({mutationFn:({userId:t,reason:n})=>qa.unbanUser(t,n),onSuccess:(t,{userId:n})=>{e.invalidateQueries({queryKey:dt.user(n)}),e.invalidateQueries({queryKey:dt.userDetailedStats(n)}),e.invalidateQueries({queryKey:dt.users()}),e.invalidateQueries({queryKey:dt.stats()}),e.invalidateQueries({queryKey:dt.recentActions(10,24)})}})}function lnt(){const e=ct();return Qe({mutationFn:({userId:t,data:n})=>qa.changeUserPlan(t,n),onSuccess:(t,{userId:n})=>{e.invalidateQueries({queryKey:dt.user(n)}),e.invalidateQueries({queryKey:dt.userDetailedStats(n)}),e.invalidateQueries({queryKey:dt.users()}),e.invalidateQueries({queryKey:dt.stats()}),e.invalidateQueries({queryKey:dt.recentActions(10,24)})}})}function cnt(){const e=ct();return Qe({mutationFn:({userId:t,data:n})=>qa.changeUserRole(t,n),onSuccess:(t,{userId:n})=>{e.invalidateQueries({queryKey:dt.user(n)}),e.invalidateQueries({queryKey:dt.userDetailedStats(n)}),e.invalidateQueries({queryKey:dt.users()}),e.invalidateQueries({queryKey:dt.stats()}),e.invalidateQueries({queryKey:dt.recentActions(10,24)})}})}function unt(){const e=ct();return Qe({mutationFn:({userId:t,reason:n})=>qa.forceLogout(t,n),onSuccess:(t,{userId:n})=>
969{e.invalidateQueries({queryKey:dt.userSessions(n)}),e.invalidateQueries({queryKey:dt.recentActions(10,24)})}})}function dnt(){const e=ct();return Qe({mutationFn:({userId:t,reason:n})=>qa.deleteUser(t,n),onSuccess:()=>{e.invalidateQueries({queryKey:dt.users()}),e.invalidateQueries({queryKey:dt.stats()}),e.invalidateQueries({queryKey:dt.recentActions(10,24)})}})}const sj={user_view:"Viewed User",user_update:"Updated User",user_ban:"Banned User",user_unban:"Unbanned User",user_delete:"Deleted User",user_role_change:"Changed Role",user_plan_change:"Changed Plan",user_force_logout:"Force Logout",bulk_delete:"Bulk Delete",bulk_ban:"Bulk Ban",subscription_override:"Override Subscription",subscription_extend:"Extended Subscription",subscription_cancel:"Cancelled Subscription",system_config_change:"System Config Change",data_export:"Data Export",data_delete:"Data Delete"};function xZ(e){if(e===0)return"0 B";const t=1024,n=["B","KB","MB","GB","TB"],r=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,r)).toFixed(2))} ${n[r]}`}function wu(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e)}function Ob(e){return new Intl.NumberFormat("es-ES",{style:"currency",currency:"EUR",minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}function Za(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}K`:e.toLocaleString()}function fnt(e){return e>=100?"destructive":e>=80?"warning":"default"}function ij(e){switch(e.toLowerCase()){case"enterprise":return"default";case"pro":return"default";case"starter":return"secondary";default:return"outline"}}function Np({title:e,value:t,description:n,icon:r,trend:a,loading:i}){return i?s.jsxs(Z,{children:[s.jsxs(we,{className:"flex flex-row items-center justify-between pb-2",children:[s.jsx(bn,{className:"h-4 w-24"}),s.jsx(bn,{className:"h-4 w-4"})]}),s.jsxs(le,{children:[s.jsx(bn,{className:"h-8 w-20 mb-1"}),s.jsx(bn,{className:"h-3 w-32"})]})]}):s.jsxs(Z,{children:[s.jsxs(we,{className:"flex flex-row items-center justify-between pb-2",children:[s.jsx(Ne,{className:"text-sm font-medium text-muted-foreground",children:e}),s.jsx(r,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(le,{children:[s.jsx("div",{className:"text-2xl font-bold",children:t}),(n||a)&&s.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[a&&s.jsx("span",{className:a.positive?"text-green-600":"text-red-600",children:a.value}),a&&n&&" ",n]})]})]})}function hnt(){Cr();const{data:e,isLoading:t,refetch:n}=yZ(),{data:r,isLoading:a}=vZ(),{data:i,isLoading:o}=tnt(10,24);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Admin Dashboard"}),s.jsx("p",{className:"text-muted-foreground",children:"Platform overview and monitoring"})]}),s.jsxs(U,{variant:"outline",size:"sm",onClick:()=>n(),disabled:t,children:[s.jsx(Vn,{className:`h-4 w-4 mr-2 ${t?"animate-spin":""}`}),"Refresh"]})]}),s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-5",children:[s.jsx(Np,{title:"Total Users",value:e?Za(e.total_users):"—",description:e?`+${e.new_users_7d} this week`:void 0,icon:tl,loading:t}),s.jsx(Np,{title:"Active (7d)",value:e?Za(e.active_users_7d):"—",description:e?`${(e.active_users_7d/e.total_users*100).toFixed(1)}% of total`:void 0,icon:ai,loading:t}),s.jsx(Np,{title:"AI Cost (30d)",value:e?wu(e.ai_cost_30d_usd):"—",description:e?`${Za(e.ai_queries_30d)} queries`:void 0,icon:Tg,loading:t}),s.jsx(Np,{title:"MRR",value:e?Ob(e.mrr_eur):"—",description:e?`${e.active_subscriptions} subscriptions`:void 0,icon:Wa,loading:t}),s.jsx(Np,{title:"Storage",value:e?xZ(e.total_storage_bytes):"—",description:e?`${Za(e.total_datasets)} datasets`:void 0,icon:qB,loading:t})]}),s.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{className:"text-lg",children:"Users by Plan"}),s.jsx(it,{children:"Distribution across subscription tiers"})]}),s.jsx(le,{children:t?s.jsx("div",{className:"space-y-3",children:[1,2,3,4].map(l=>s.jsx(bn,{className:"h-8 w-full"},l))}):e?s.jsx("div",{className:"space-y-3",children:Object.entries(e.users_by_plan).map(([l,c])=>{const u=(c/e.total_users*100).toFixed(1);return s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($e,{variant:l==="enterprise"||l==="pro"?"default":"secondary",children:l.toUpperCase()}),s.jsxs("span",{className:"text-sm text-muted-foreground",children:[c.toLocaleStr
969ing()," users"]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-24 bg-muted rounded-full h-2",children:s.jsx("div",{className:"bg-primary rounded-full h-2",style:{width:`${u}%`}})}),s.jsxs("span",{className:"text-sm font-medium w-12 text-right",children:[u,"%"]})]})]},l)})}):null})]}),s.jsxs(Z,{children:[s.jsxs(we,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Ne,{className:"text-lg",children:"AI Usage Alerts"}),s.jsx(it,{children:"Users approaching or exceeding limits"})]}),r&&(r.total_approaching>0||r.total_exceeded>0)&&s.jsx($e,{variant:"destructive",children:r.total_exceeded+r.total_approaching})]}),s.jsx(le,{children:a?s.jsx("div",{className:"space-y-3",children:[1,2,3].map(l=>s.jsx(bn,{className:"h-12 w-full"},l))}):r&&r.alerts.length>0?s.jsxs("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:[r.alerts.slice(0,5).map(l=>s.jsxs(fl,{variant:l.alert_type==="exceeded"?"destructive":"default",className:"py-2",children:[s.jsx(ad,{className:"h-4 w-4"}),s.jsxs("div",{className:"ml-2",children:[s.jsxs(Ph,{className:"text-sm font-medium",children:[l.username," (",l.plan.toUpperCase(),")"]}),s.jsxs(hl,{className:"text-xs",children:[l.usage_today,"/",l.limit_today," queries (",l.usage_percentage.toFixed(0),"%)"]})]})]},l.user_id)),r.alerts.length>5&&s.jsxs("p",{className:"text-xs text-muted-foreground text-center pt-2",children:["+",r.alerts.length-5," more alerts"]})]}):s.jsxs("div",{className:"text-center py-6 text-muted-foreground",children:[s.jsx(Uc,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"No usage alerts"})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{className:"flex flex-row items-center justify-between",children:[s.jsxs("div",{children:[s.jsx(Ne,{className:"text-lg",children:"Recent Actions"}),s.jsx(it,{children:"Admin activity in the last 24 hours"})]}),s.jsx(vt,{to:"/dashboard/admin/audit-logs",children:s.jsxs(U,{variant:"ghost",size:"sm",children:["View All",s.jsx(si,{className:"h-4 w-4 ml-1"})]})})]}),s.jsx(le,{children:o?s.jsx("div",{className:"space-y-3",children:[1,2,3].map(l=>s.jsx(bn,{className:"h-12 w-full"},l))}):i&&i.actions.length>0?s.jsx("div",{className:"space-y-3",children:i.actions.map(l=>s.jsxs("div",{className:"flex items-start justify-between py-2 border-b last:border-0",children:[s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:sj[l.action]||l.action}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["by ",l.admin_username,l.target_username&&` on ${l.target_username}`]})]}),s.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap ml-2",children:new Date(l.created_at).toLocaleTimeString()})]},l.id))}):s.jsxs("div",{className:"text-center py-6 text-muted-foreground",children:[s.jsx(Dg,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{className:"text-sm",children:"No recent actions"})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{className:"text-lg",children:"Quick Access"}),s.jsx(it,{children:"Common admin tasks"})]}),s.jsx(le,{children:s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsx(vt,{to:"/dashboard/admin/users",children:s.jsxs(U,{variant:"outline",className:"w-full justify-start",children:[s.jsx(tl,{className:"h-4 w-4 mr-2"}),"Manage Users"]})}),s.jsx(vt,{to:"/dashboard/admin/ai-usage",children:s.jsxs(U,{variant:"outline",className:"w-full justify-start",children:[s.jsx(ai,{className:"h-4 w-4 mr-2"}),"AI Monitoring"]})}),s.jsx(vt,{to:"/dashboard/admin/subscriptions",children:s.jsxs(U,{variant:"outline",className:"w-full justify-start",children:[s.jsx(Wa,{className:"h-4 w-4 mr-2"}),"Subscriptions"]})}),s.jsx(vt,{to:"/dashboard/admin/audit-logs",children:s.jsxs(U,{variant:"outline",className:"w-full justify-start",children:[s.jsx(Dg,{className:"h-4 w-4 mr-2"}),"Audit Logs"]})})]})})]})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsx(Ne,{className:"text-lg",children:"Platform Resources"}),s.jsx(it,{children:"Total resources across all users"})]}),s.jsx(le,{children:s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(wt,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),s.jsx("p",{className:"text-2xl font-bold",children:e?Za(e.total_datasets):"—"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Datasets"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx(di,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),s.jsx("p",{className:"text-2xl font-bold",children:e?Za(e.total_reports):"—"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Reports"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx(xr,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),s.jsx("p",{className:"text-2xl font-bold",children:e?Za(e.total_workbooks):"—"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Workbooks"})]}),s.jsxs("div",{className:"text-center",children:[s.jsx(ai,{className:"h-8 w-8 mx-auto mb-2 text-muted-foreground"}),s.jsx("p",{className:"text-2xl font-bold",children:e?Za(e.total_connectors):"—"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Connectors"})]})]})})]})]})}const MF=[{value:"free",label:"Free"},{value:"starter",label:"Starter"},{value:"pro",label:"Pro"},{value:"enterprise",label:"Enterprise"}],mnt=[{value:"USER",label:"User"},{value:"MODERATOR",label:"Moderator"},{value:"ADMIN",label:"Admin"}];function pnt(){var Ze;const e=cn(),{toast:t}
969=uB(),[n,r]=x.useState({page:1,limit:20,search:"",plan:void 0,is_active:void 0,sort_by:"created_at",sort_order:"desc"}),[a,i]=x.useState(""),[o,l]=x.useState({open:!1,userId:"",username:""}),[c,u]=x.useState({open:!1,userId:"",username:""}),[d,f]=x.useState({open:!1,userId:"",username:"",currentPlan:""}),[h,m]=x.useState({open:!1,userId:"",username:"",currentRole:""}),[p,g]=x.useState({open:!1,userId:"",username:""}),[y,v]=x.useState({open:!1,userId:"",username:""}),[w,b]=x.useState(""),[j,N]=x.useState(!0),[S,C]=x.useState(""),[_,E]=x.useState(""),[T,P]=x.useState(""),[k,D]=x.useState(""),[A,I]=x.useState(""),[M,$]=x.useState(""),{data:R,isLoading:O,refetch:F}=rnt(n),z=int(),B=ont(),H=lnt(),Y=cnt(),ee=unt(),V=dnt(),K=()=>{r(fe=>({...fe,search:a,page:1}))},W=(fe,Oe)=>{r(Et=>({...Et,[fe]:Oe,page:1}))},q=fe=>{r(Oe=>({...Oe,page:fe}))},J=()=>{r({page:1,limit:20,search:"",plan:void 0,is_active:void 0,sort_by:"created_at",sort_order:"desc"}),i("")},ie=async()=>{if(!w||w.length<10){t({title:"Error",description:"Reason must be at least 10 characters",variant:"destructive"});return}try{await z.mutateAsync({userId:o.userId,data:{reason:w,notify_user:j}}),t({title:"User Banned",description:`${o.username} has been banned successfully.`}),l({open:!1,userId:"",username:""}),b(""),N(!0)}catch{t({title:"Error",description:"Failed to ban user. Please try again.",variant:"destructive"})}},X=async()=>{try{await B.mutateAsync({userId:c.userId,reason:"Admin action"}),t({title:"User Unbanned",description:`${c.username} has been unbanned successfully.`}),u({open:!1,userId:"",username:""})}catch{t({title:"Error",description:"Failed to unban user. Please try again.",variant:"destructive"})}},ge=async()=>{if(!S||!_||_.length<10){t({title:"Error",description:"Please select a plan and provide a reason (min 10 characters)",variant:"destructive"});return}try{await H.mutateAsync({userId:d.userId,data:{new_plan:S,reason:_}}),t({title:"Plan Changed",description:`${d.username}'s plan has been changed to ${S}.`}),f({open:!1,userId:"",username:"",currentPlan:""}),C(""),E("")}catch{t({title:"Error",description:"Failed to change plan. Please try again.",variant:"destructive"})}},Se=async()=>{if(!T||!k||k.length<10){t({title:"Error",description:"Please select a role and provide a reason (min 10 characters)",variant:"destructive"});return}try{await Y.mutateAsync({userId:h.userId,data:{new_role:T,reason:k}}),t({title:"Role Changed",description:`${h.username}'s role has been changed to ${T}.`}),m({open:!1,userId:"",username:"",currentRole:""}),P(""),D("")}catch{t({title:"Error",description:"Failed to change role. Please try again.",variant:"destructive"})}},ce=async()=>{try{await ee.mutateAsync({userId:p.userId,reason:A||"Admin action"}),t({title:"User Logged Out",description:`${p.username} has been logged out of all sessions.`}),g({open:!1,userId:"",username:""}),I("")}catch{t({title:"Error",description:"Failed to logout user. Please try again.",variant:"destructive"})}},ye=async()=>{if(!M||M.length<10){t({title:"Error",description:"Reason must be at least 10 characters",variant:"destructive"});return}try{await V.mutateAsync({userId:y.userId,reason:M}),t({title:"User Deleted",description:`${y.username} has been deleted successfully.`}),v({open:!1,userId:"",username:""}),$("")}catch{t({title:"Error",description:"Failed to delete user. Please try again.",variant:"destructive"})}},Ie=R?Math.ceil(R.total/(n.limit||20)):0,Ue=n.page||1;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"User Management"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage users, roles, and permissions"})]}),s.jsxs(U,{variant:"outline",onClick:()=>F(),children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh"]})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-3",children:s.jsxs(Ne,{className:"text-base flex items-center gap-2",children:[s.jsx(Va,{className:"h-4 w-4"}),"Filters"]})}),s.jsx(le,{children:s.jsxs("div",{className:"flex flex-wrap gap-4",children:[s.jsxs("div",{className:"flex gap-2 flex-1 min-w-[200px]",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(ii,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:"Search by username, email...",value:a,onChange:fe=>i(fe.target.value),onKeyDown:fe=>fe.key==="Enter"&&K(),className:"pl-8"})]}),s.jsx(U,{onClick:K,children:"Search"})]}),s.jsxs(rt,{value:n.plan||"all",onValueChange:fe=>W("plan",fe==="all"?void 0:fe),children:[s.jsx(tt,{className:"w-[140px]",children:s.jsx(st,{placeholder:"Plan"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"all",children:"All Plans"}),MF.map(fe=>s.jsx(_e,{value:fe.value,children:fe.label},fe.value))]})]}),s.jsxs(rt,{value:n.is_active===void 0?"all":n.is_active?"active":"inactive",onValueChange:fe=>W("is_active",fe==="all"?void 0:fe==="active"),children:[s.jsx(tt,{className:"w-[140px]",children:s.jsx(st,{placeholder:"Status"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"all",children:"All Status"}),s.jsx(_e,{value:"active",children:"Active"}),s.jsx(_e,{value:"inactive",children:"Banned"})]})]}),s.jsx(U,{variant:"ghost",onClick:J,children:"Clear"})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2",children:[s.jsx(tl,{className:"h-5 w-5"}),"Users",R&&s.jsxs($e,{variant:"secondary",className:"ml-2",children:[R.total," total"]})]}),s.jsx(it,{children:"Manage user accounts, roles, and permissions"})]}),s.jsx(le,{children:O?s.jsx("div",{className:"space-y-3",children:[...Array(5)].map((fe,Oe)=>s.jsx(bn,{className:"h-12 w-full"},Oe))}):s.jsxs(s.Fragment,{children:[s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsxs(Rr,{children:[s.jsx(jt,{children:"User"}),s.jsx(jt,{children:"Email"}),s.jsx(jt,{children:"Plan"}),s.jsx(jt,{children:"Role"}),s.jsx(jt,{children:"Status"}),s.jsx(jt,{children:"Created"}),s.jsx(jt,{className:"text-right",children:"Actions"})]})}),s.jsx(_l,{children:(Ze=R==null?void 0:R.items)==null?void 0:Ze.map(fe=>s.jsxs(Rr,{children:[s.jsx(Nt,{className:"font-medium",children:fe.username}),s.jsx(Nt,{children:fe.email}),s.jsx(Nt,{children:s.jsx($e,{variant:ij(fe.plan),children:fe.plan.toUpperCase()})}),s.jsx(Nt,{children:s.jsx($e,{variant:fe.role==="ADMIN"?"default":"outline",children:fe.role})}),s.jsx(Nt,{children:fe.is_active?s.jsx($e,{variant:"outline",className:"text-green-600 border-green-600",children:"Active"}):s.jsx($e,{variant:"destructive",children:"Banned"})}),s.jsx(Nt,{children:new Date(fe.created_at).toLocaleDateString()}),s.jsx(Nt,{className:"text-right",children:s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsx(U,{variant:"ghost",size:"icon",children:s.jsx(pre,{className:"h-4 w-4"})})}),s.jsxs(Xr,{align:"end",children:[s.jsxs(Xe,{onClick:()=>e(`/dashboard/admin/users/${fe.id}`),children:[s.jsx(ui,{className:"h-4 w-4 mr-2"}),"View Details"]}
969),s.jsx(ha,{}),s.jsxs(Xe,{onClick:()=>f({open:!0,userId:fe.id,username:fe.username,currentPlan:fe.plan}),children:[s.jsx(Zo,{className:"h-4 w-4 mr-2"}),"Change Plan"]}),s.jsxs(Xe,{onClick:()=>m({open:!0,userId:fe.id,username:fe.username,currentRole:fe.role}),children:[s.jsx(Uc,{className:"h-4 w-4 mr-2"}),"Change Role"]}),s.jsx(ha,{}),s.jsxs(Xe,{onClick:()=>g({open:!0,userId:fe.id,username:fe.username}),children:[s.jsx(GB,{className:"h-4 w-4 mr-2"}),"Force Logout"]}),fe.is_active?s.jsxs(Xe,{onClick:()=>l({open:!0,userId:fe.id,username:fe.username}),className:"text-orange-600",children:[s.jsx(Bre,{className:"h-4 w-4 mr-2"}),"Ban User"]}):s.jsxs(Xe,{onClick:()=>u({open:!0,userId:fe.id,username:fe.username}),className:"text-green-600",children:[s.jsx(Lre,{className:"h-4 w-4 mr-2"}),"Unban User"]}),s.jsx(ha,{}),s.jsxs(Xe,{onClick:()=>v({open:!0,userId:fe.id,username:fe.username}),className:"text-destructive",children:[s.jsx(pn,{className:"h-4 w-4 mr-2"}),"Delete User"]})]})]})})]},fe.id))})]}),Ie>1&&s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Page ",Ue," of ",Ie," (",R==null?void 0:R.total," users)"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(U,{variant:"outline",size:"sm",onClick:()=>q(Ue-1),disabled:Ue<=1,children:s.jsx(Wu,{className:"h-4 w-4"})}),s.jsx(U,{variant:"outline",size:"sm",onClick:()=>q(Ue+1),disabled:Ue>=Ie,children:s.jsx(si,{className:"h-4 w-4"})})]})]})]})})]}),s.jsx(br,{open:o.open,onOpenChange:fe=>l({...o,open:fe}),children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:"Ban User"}),s.jsxs(wr,{children:["Are you sure you want to ban ",s.jsx("strong",{children:o.username}),"? This will deactivate their account and revoke all sessions."]})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"ban-reason",children:"Reason (required)"}),s.jsx(Aa,{id:"ban-reason",placeholder:"Enter reason for banning (min 10 characters)...",value:w,onChange:fe=>b(fe.target.value),rows:3})]}),s.jsxs("div",{className:"flex items-center space-x-2",children:[s.jsx(Hc,{id:"notify-user",checked:j,onCheckedChange:fe=>N(fe)}),s.jsx(pe,{htmlFor:"notify-user",children:"Notify user via email"})]})]}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>l({open:!1,userId:"",username:""}),children:"Cancel"}),s.jsx(U,{variant:"destructive",onClick:ie,disabled:z.isPending||w.length<10,children:z.isPending?"Banning...":"Ban User"})]})]})}),s.jsx(br,{open:c.open,onOpenChange:fe=>u({...c,open:fe}),children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:"Unban User"}),s.jsxs(wr,{children:["Are you sure you want to unban ",s.jsx("strong",{children:c.username}),"? This will reactivate their account."]})]}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>u({open:!1,userId:"",username:""}),children:"Cancel"}),s.jsx(U,{onClick:X,disabled:B.isPending,children:B.isPending?"Unbanning...":"Unban User"})]})]})}),s.jsx(br,{open:d.open,onOpenChange:fe=>f({...d,open:fe}),children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:"Change User Plan"}),s.jsxs(wr,{children:["Change the subscription plan for ",s.jsx("strong",{children:d.username}),". Current plan: ",s.jsx($e,{variant:ij(d.currentPlan),children:d.currentPlan.toUpperCase()})]})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"new-plan",children:"New Plan"}),s.jsxs(rt,{value:S,onValueChange:C,children:[s.jsx(tt,{children:s.jsx(st,{placeholder:"Select new plan"})}),s.jsx(nt,{children:MF.map(fe=>s.jsx(_e,{value:fe.value,children:fe.label},fe.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"plan-reason",children:"Reason (required)"}),s.jsx(Aa,{id:"plan-reason",placeholder:"Enter reason for plan change (min 10 characters)...",value:_,onChange:fe=>E(fe.target.value),rows:3})]})]}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>f({open:!1,userId:"",username:"",currentPlan:""}),children:"Cancel"}),s.jsx(U,{onClick:ge,disabled:H.isPending||!S||_.length<10,children:H.isPending?"Changing...":"Change Plan"})]})]})}),s.jsx(br,{open:h.open,onOpenChange:fe=>m({...h,open:fe}),children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:"Change User Role"}),s.jsxs(wr,{children:["Change the role for ",s.jsx("strong",{children:h.username}),". Current role: ",s.jsx($e,{children:h.currentRole})]})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"new-role",children:"New Role"}),s.jsxs(rt,{value:T,onValueChange:P,children:[s.jsx(tt,{children:s.jsx(st,{placeholder:"Select new role"})}),s.jsx(nt,{children:mnt.map(fe=>s.jsx(_e,{value:fe.value,children:fe.label},fe.value))})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"role-reason",children:"Reason (required)"}),s.jsx(Aa,{id:"role-reason",placeholder:"Enter reason for role change (min 10 characters)...",value:k,onChange:fe=>D(fe.target.value),rows:3})]})]}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>m({open:!1,userId:"",username:"",currentRole:""}),children:"Cancel"}),s.jsx(U,{onClick:Se,disabled:Y.isPending||!T||k.length<10,children:Y.isPending?"Changing...":"Change Role"})]})]})}),s.jsx(br,{open:p.open,onOpenChange:fe=>g({...p,open:fe}),children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:"Force Logout"}),s.jsxs(wr,{children:["Are you sure you want to force logout ",s.jsx("strong",{children:p.username}),"? This will revoke all their active sessions."]})]}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"logout-reason",children:"Reason (optional)"}),s.jsx(Aa,{id:"logout-reason",placeholder:"Enter reason for force logout...",value:A,onChange:fe=>I(fe.target.value),rows:2})]})}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>g({open:!1,userId:"",username:""}),children:"Cancel"}),s.jsx(U,{onClick:ce,disabled:ee.isPending,children:ee.isPending?"Logging out...":"Force Logout"})]})]})}),s.jsx(br,{open:y.open,onOpenChange:fe=>v({...y,open:fe}),children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{className:"text-destructive",children:"Delete User"}),s.jsxs(wr,{children:["Are you sure you want to permanently delete ",s.jsx("strong",{children:y.username}),"? This action cannot be undone. All user data will be removed."]})]}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"delete-reason",children:"Reason (required)"}),s.jsx(Aa,{id:"delete-reason",placeholder:"Enter reason for deleti
969on (min 10 characters)...",value:M,onChange:fe=>$(fe.target.value),rows:3})]})}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>v({open:!1,userId:"",username:""}),children:"Cancel"}),s.jsx(U,{variant:"destructive",onClick:ye,disabled:V.isPending||M.length<10,children:V.isPending?"Deleting...":"Delete User"})]})]})})]})}function gnt(){const{userId:e}=iv(),t=cn(),{data:n,isLoading:r,refetch:a}=ant(e||""),{data:i,isLoading:o}=snt(e||"");if(!e)return s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsx("p",{className:"text-muted-foreground",children:"No user ID provided"})});if(r)return s.jsxs("div",{className:"space-y-6",children:[s.jsx(bn,{className:"h-8 w-64"}),s.jsx(bn,{className:"h-48 w-full"}),s.jsx("div",{className:"grid grid-cols-4 gap-4",children:[...Array(4)].map((c,u)=>s.jsx(bn,{className:"h-24"},u))})]});if(!n)return s.jsxs("div",{className:"space-y-6",children:[s.jsxs(U,{variant:"ghost",onClick:()=>t("/dashboard/admin/users"),children:[s.jsx(Yr,{className:"h-4 w-4 mr-2"}),"Back to Users"]}),s.jsx(Z,{children:s.jsx(le,{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.jsx(Yn,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),s.jsx("p",{className:"text-muted-foreground",children:"User not found"})]})})})]});const l=fnt(n.ai_usage_percentage);return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(U,{variant:"ghost",onClick:()=>t("/dashboard/admin/users"),children:[s.jsx(Yr,{className:"h-4 w-4 mr-2"}),"Back to Users"]}),s.jsxs(U,{variant:"outline",onClick:()=>a(),children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh"]})]}),s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsxs("div",{className:"flex flex-col md:flex-row gap-6",children:[s.jsxs("div",{className:"flex items-start gap-4",children:[s.jsx("div",{className:"h-20 w-20 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(n0,{className:"h-10 w-10 text-primary"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h1",{className:"text-2xl font-bold",children:n.username}),n.is_active?s.jsxs($e,{variant:"outline",className:"text-green-600 border-green-600",children:[s.jsx(BB,{className:"h-3 w-3 mr-1"}),"Active"]}):s.jsxs($e,{variant:"destructive",children:[s.jsx(Ej,{className:"h-3 w-3 mr-1"}),"Banned"]})]}),s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mt-1",children:[s.jsx(KP,{className:"h-4 w-4"}),n.email]}),n.full_name&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mt-1",children:[s.jsx(n0,{className:"h-4 w-4"}),n.full_name]}),n.company&&s.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground mt-1",children:[s.jsx(hre,{className:"h-4 w-4"}),n.company]})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 md:ml-auto",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zo,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Plan:"}),s.jsx($e,{variant:ij(n.plan),children:n.plan.toUpperCase()})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Uc,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Role:"}),s.jsx($e,{variant:n.role==="ADMIN"?"default":"outline",children:n.role})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zs,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Registered:"}),s.jsx("span",{className:"text-sm",children:n.created_at?new Date(n.created_at).toLocaleDateString():"N/A"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tv,{className:"h-4 w-4 text-muted-foreground"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Last Login:"}),s.jsx("span",{className:"text-sm",children:n.last_login?new Date(n.last_login).toLocaleString():"Never"})]})]})]})})}),s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wt,{className:"h-5 w-5 text-blue-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Datasets"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:n.datasets_count})]})}),s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(di,{className:"h-5 w-5 text-green-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Reports"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:n.reports_count})]})}),s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xr,{className:"h-5 w-5 text-purple-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Workbooks"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:n.workbooks_count})]})}),s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kre,{className:"h-5 w-5 text-orange-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Connectors"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:n.connectors_count})]})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(qB,{className:"h-5 w-5"}),"Storage Usage"]})}),s.jsxs(le,{children:[s.jsx("p",{className:"text-2xl font-bold",children:xZ(n.storage_used_bytes)}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Total storage used"})]})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx($_,{className:"h-5 w-5"}),"AI Usage"]})}),s.jsxs(le,{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between text-sm mb-1",children:[s.jsx("span",{children:"Today"}),s.jsxs("span",{children:[n.ai_queries_today," / ",n.ai_limit_today===999999?"∞":n.ai_limit_today]})]}),s.jsx(_u,{value:n.ai_limit_today===999999?0:n.ai_usage_percentage,className:`h-2 ${l==="destructive"?"bg-red-100":l==="warning"?"bg-yellow-100":""}`}),n.ai_usage_percentage>=80&&n.ai_limit_today!==999999&&s.jsx("p",{className:"text-xs text-yellow-600 mt-1",children:n.ai_usage_percentage>=100?"Limit reached":`${Math.round(n.ai_usage_percentage)}% of daily limit used`})]}),s.jsx(Kr,{}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"30-day Quer
969ies"}),s.jsx("p",{className:"text-lg font-semibold",children:n.ai_queries_30d.toLocaleString()})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"30-day Cost"}),s.jsx("p",{className:"text-lg font-semibold",children:wu(n.ai_cost_30d_usd)})]})]})]})]})]}),n.subscription_status&&s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(Zo,{className:"h-5 w-5"}),"Subscription"]})}),s.jsx(le,{children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Status"}),s.jsx($e,{variant:n.subscription_status==="active"?"default":"secondary",children:n.subscription_status.toUpperCase()})]}),n.subscription_expires&&s.jsxs("div",{children:[s.jsx("p",{className:"text-sm text-muted-foreground",children:"Expires"}),s.jsx("p",{className:"font-medium",children:new Date(n.subscription_expires).toLocaleDateString()})]})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(ai,{className:"h-5 w-5"}),"Admin Action History"]}),s.jsx(it,{children:"Actions taken by administrators on this user"})]}),s.jsx(le,{children:o?s.jsx("div",{className:"space-y-2",children:[...Array(3)].map((c,u)=>s.jsx(bn,{className:"h-12 w-full"},u))}):i!=null&&i.actions&&i.actions.length>0?s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsxs(Rr,{children:[s.jsx(jt,{children:"Date"}),s.jsx(jt,{children:"Admin"}),s.jsx(jt,{children:"Action"}),s.jsx(jt,{children:"Details"}),s.jsx(jt,{children:"Reason"})]})}),s.jsx(_l,{children:i.actions.map(c=>s.jsxs(Rr,{children:[s.jsx(Nt,{className:"text-sm",children:new Date(c.created_at).toLocaleString()}),s.jsx(Nt,{className:"font-medium",children:c.admin_username}),s.jsx(Nt,{children:s.jsx($e,{variant:"outline",children:sj[c.action]||c.action})}),s.jsx(Nt,{className:"text-sm text-muted-foreground",children:c.old_value&&c.new_value?s.jsx("span",{children:Object.keys(c.old_value).map(u=>{var d,f;return s.jsxs("span",{children:[u,": ",String((d=c.old_value)==null?void 0:d[u])," → ",String((f=c.new_value)==null?void 0:f[u])]},u)})}):"-"}),s.jsx(Nt,{className:"text-sm max-w-[200px] truncate",children:c.reason||"-"})]},c.id))})]}):s.jsxs("div",{className:"text-center py-8 text-muted-foreground",children:[s.jsx(ai,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),s.jsx("p",{children:"No admin actions recorded for this user"})]})})]})]})}const ynt=[{value:7,label:"7 days"},{value:14,label:"14 days"},{value:30,label:"30 days"},{value:90,label:"90 days"}],RF=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"];function vnt(){var d,f,h,m,p,g,y;const[e,t]=x.useState(30),{data:n,isLoading:r,refetch:a}=ent(e),{data:i,isLoading:o}=vZ(),l=((d=n==null?void 0:n.daily_breakdown)==null?void 0:d.map(v=>({date:new Date(v.date).toLocaleDateString("es-ES",{month:"short",day:"numeric"}),queries:v.queries,tokens:Math.round(v.tokens/1e3),cost:v.cost_usd,users:v.unique_users})))||[],c=((h=(f=n==null?void 0:n.granular)==null?void 0:f.by_endpoint)==null?void 0:h.map((v,w)=>({name:v.endpoint.replace("_"," ").replace(/^\w/,b=>b.toUpperCase()),value:v.queries,cost:v.cost_usd,color:RF[w%RF.length]})))||[],u=((p=(m=n==null?void 0:n.granular)==null?void 0:m.by_model)==null?void 0:p.map(v=>({model:v.model,queries:v.queries,tokens:Math.round(v.tokens/1e3),cost:v.cost_usd})))||[];return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"AI Usage Monitoring"}),s.jsx("p",{className:"text-muted-foreground",children:"Monitor AI query usage, costs, and limits"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"flex gap-1 bg-muted p-1 rounded-lg",children:ynt.map(v=>s.jsx(U,{variant:e===v.value?"default":"ghost",size:"sm",onClick:()=>t(v.value),children:v.label},v.value))}),s.jsxs(U,{variant:"outline",onClick:()=>a(),children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh"]})]})]}),!o&&i&&(i.total_approaching>0||i.total_exceeded>
9690)&&s.jsxs(fl,{variant:"destructive",children:[s.jsx(ad,{className:"h-4 w-4"}),s.jsx(Ph,{children:"Usage Alerts"}),s.jsx(hl,{children:s.jsx("div",{className:"mt-2 space-y-2",children:i.alerts.map(v=>s.jsxs("div",{className:`flex items-center justify-between p-2 rounded ${v.alert_type==="exceeded"?"bg-red-100 dark:bg-red-900/20":"bg-yellow-100 dark:bg-yellow-900/20"}`,children:[s.jsxs("div",{className:"flex items-center gap-2",children:[v.alert_type==="exceeded"?s.jsx(Yn,{className:"h-4 w-4 text-red-500"}):s.jsx(ad,{className:"h-4 w-4 text-yellow-500"}),s.jsx("span",{className:"font-medium",children:v.username}),s.jsx($e,{variant:"outline",children:v.plan.toUpperCase()})]}),s.jsxs("div",{className:"text-sm",children:[v.usage_today," / ",v.limit_today," queries (",Math.round(v.usage_percentage),"%)"]})]},v.user_id))})})]}),r?s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[...Array(4)].map((v,w)=>s.jsx(bn,{className:"h-24"},w))}):s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx($_,{className:"h-5 w-5 text-blue-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Total Queries"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:Za((n==null?void 0:n.total_queries)||0)}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last ",e," days"]})]})}),s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(nd,{className:"h-5 w-5 text-purple-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Total Tokens"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:Za((n==null?void 0:n.total_estimated_tokens)||0)}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last ",e," days"]})]})}),s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Tg,{className:"h-5 w-5 text-green-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Total Cost"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:wu((n==null?void 0:n.total_estimated_cost_usd)||0)}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last ",e," days"]})]})}),s.jsx(Z,{children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tl,{className:"h-5 w-5 text-orange-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Active Users"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:(n==null?void 0:n.unique_users)||0}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Avg ",wu((n==null?void 0:n.avg_cost_per_query)||0),"/query"]})]})})]}),s.jsxs(fo,{defaultValue:"daily",className:"space-y-4",children:[s.jsxs(ji,{children:[s.jsx(Rt,{value:"daily",children:"Daily Queries"}),s.jsx(Rt,{value:"tokens",children:"Daily Tokens"}),s.jsx(Rt,{value:"cost",children:"Daily Cost"}),s.jsx(Rt,{value:"breakdown",children:"Breakdown"})]}),s.jsx(Ft,{value:"daily",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(ai,{className:"h-5 w-5"}),"Daily Queries"]}),s.jsxs(it,{children:["Number of AI queries per day over the last ",e," days"]})]}),s.jsx(le,{children:r?s.jsx(bn,{className:"h-[300px] w-full"}):s.jsx(Cn,{width:"100%",height:300,children:s.jsxs(Oc,{data:l,children:[s.jsx(Fo,{strokeDasharray:"3 3"}),s.jsx(Bn,{dataKey:"date"}),s.jsx(zn,{}),s.jsx(kt,{}),s.jsx(vn,{}),s.jsx(Gr,{dataKey:"queries",fill:"#3b82f6",name:"Queries"})]})})})]})}),s.jsx(Ft,{value:"tokens",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(nd,{className:"h-5 w-5"}),"Daily Tokens (K)"]}),s.jsx(it,{children:"Token consumption per day (in thousands)"})]}),s.jsx(le,{children:r?s.jsx(bn,{className:"h-[300px] w-full"}):s.jsx(Cn,{width:"100%",height:300,children:s.jsxs(bM,{data:l,children:[s.jsx(Fo,{strokeDasharray:"3 3"}),s.jsx(Bn,{dataKey:"date"}),s.jsx(zn,{}),s.jsx(kt,{}),s.jsx(vn,{}
969),s.jsx(vl,{type:"monotone",dataKey:"tokens",stroke:"#8b5cf6",name:"Tokens (K)",strokeWidth:2})]})})})]})}),s.jsx(Ft,{value:"cost",children:s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(Tg,{className:"h-5 w-5"}),"Daily Cost (USD)"]}),s.jsx(it,{children:"Estimated cost per day in USD"})]}),s.jsx(le,{children:r?s.jsx(bn,{className:"h-[300px] w-full"}):s.jsx(Cn,{width:"100%",height:300,children:s.jsxs(Oc,{data:l,children:[s.jsx(Fo,{strokeDasharray:"3 3"}),s.jsx(Bn,{dataKey:"date"}),s.jsx(zn,{tickFormatter:v=>`$${v}`}),s.jsx(kt,{formatter:v=>wu(v)}),s.jsx(vn,{}),s.jsx(Gr,{dataKey:"cost",fill:"#10b981",name:"Cost (USD)"})]})})})]})}),s.jsx(Ft,{value:"breakdown",children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(nk,{className:"h-5 w-5"}),"Usage by Endpoint"]})}),s.jsx(le,{children:r?s.jsx(bn,{className:"h-[250px] w-full"}):s.jsx(Cn,{width:"100%",height:250,children:s.jsxs(Uy,{children:[s.jsx(cs,{data:c,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:v=>v.name,children:c.map((v,w)=>s.jsx(Pa,{fill:v.color},w))}),s.jsx(kt,{formatter:(v,w,b)=>[`${v} queries (${wu(b.payload.cost)})`,w]})]})})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx($_,{className:"h-5 w-5"}),"Usage by Model"]})}),s.jsx(le,{children:r?s.jsx(bn,{className:"h-[250px] w-full"}):s.jsx(Cn,{width:"100%",height:250,children:s.jsxs(Oc,{data:u,layout:"vertical",children:[s.jsx(Fo,{strokeDasharray:"3 3"}),s.jsx(Bn,{type:"number"}),s.jsx(zn,{dataKey:"model",type:"category",width:100}),s.jsx(kt,{}),s.jsx(vn,{}),s.jsx(Gr,{dataKey:"queries",fill:"#3b82f6",name:"Queries"})]})})})]})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(Wa,{className:"h-5 w-5"}),"Top Users by Cost"]}),s.jsxs(it,{children:["Users with highest AI usage costs in the last ",e," days"]})]}),s.jsx(le,{children:r?s.jsx("div",{className:"space-y-2",children:[...Array(5)].map((v,w)=>s.jsx(bn,{className:"h-12 w-full"},w))}):s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsxs(Rr,{children:[s.jsx(jt,{children:"#"}),s.jsx(jt,{children:"User ID"}),s.jsx(jt,{className:"text-right",children:"Queries"}),s.jsx(jt,{className:"text-right",children:"Tokens"}),s.jsx(jt,{className:"text-right",children:"Cost"})]})}),s.jsx(_l,{children:(y=(g=n==null?void 0:n.granular)==null?void 0:g.top_users_by_cost)==null?void 0:y.slice(0,10).map((v,w)=>s.jsxs(Rr,{children:[s.jsx(Nt,{className:"font-medium",children:w+1}),s.jsxs(Nt,{className:"font-mono text-sm",children:[v.user_id.slice(0,8),"..."]}),s.jsx(Nt,{className:"text-right",children:Za(v.queries)}),s.jsx(Nt,{className:"text-right",children:Za(v.tokens)}),s.jsx(Nt,{className:"text-right font-medium",children:wu(v.cost_usd)})]},v.user_id))})]})})]})]})}const xnt={free:"#94a3b8",starter:"#3b82f6",pro:"#8b5cf6",enterprise:"#f59e0b"},bnt={active:"#10b981",cancelled:"#ef4444",past_due:"#f59e0b",trialing:"#3b82f6"};function wnt(){x.useState("all"),x.useState("all");const{data:e,isLoading:t,refetch:n}=yZ(),r=e!=null&&e.subscriptions_by_plan?Object.entries(e.subscriptions_by_plan).map(([o,l])=>({name:o.charAt(0).toUpperCase()+o.slice(1),value:l,color:xnt[o]||"#6b7280"})):[],a=e!=null&&e.subscriptions_by_status?Object.entries(e.subscriptions_by_status).map(([o,l])=>({name:o.replace("_"," ").charAt(0).toUpperCase()+o.slice(1).replace("_"," "),value:l,color:bnt[o]||"#6b7280"})):[],i=((e==null?void 0:e.mrr_eur)||0)*12;return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Subscription Management"}),s.jsx("p",{className:"text-muted-foreground",children:"Manage subscriptions, revenue, and billing"})]}),s.jsxs(U,{variant:"outline",onClick:()=>n(),children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh"]})]}),t?s.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[...Array(4)].map((o,l)=>s.jsx(bn,{className:"h-28"},l))}):s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[s.jsx(Z,{className:"border-l-4 border-l-green-500",children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Tg,{className:"h-5 w-5 text-green-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"MRR"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:Ob((e==null?void 0:e.mrr_eur)||0)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Monthly Recurring Revenue"})]})}),s.jsx(Z,{className:"border-l-4 border-l-blue-500",children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Wa,{className:"h-5 w-5 text-blue-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"ARR"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:Ob(i)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Annual Recurring Revenue"})]})}),s.jsx(Z,{className:"border-l-4 border-l-purple-500",children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zo,{className:"h-5 w-5 text-purple-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Active"})]}),s.jsx("p",{className:"text-2xl font-bold mt-2",children:(e==null?void 0:e.active_subscriptions)||0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Active subscriptions"})]})}),s.jsx(Z,{className:"border-l-4 border-l-orange-500",children:s.jsxs(le,{className:"pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(tl,{className:"h-5 w-5 text-orange-500"}),s.jsx("span",{className:"text-sm text-muted-foreground",children:"Conversion"})]}),s.jsxs("p",{className:"text-2xl font-bold mt-2",children:[e!=null&&e.total_users?Math.round((e.active_subscriptions||0)/e.total_users*100):0,"%"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[(e==null?void 0:e.active_subscriptions)||0," of ",(e==null?void 0:e.total_users)||0," users"]})]})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(Zo,{className:"h-5 w-5"}),"Subscriptions by Plan"]})}),s.jsx(le,{children:t?s.jsx(bn,{className:"h-[250px] w-full"}):r.length>0?s.jsx(Cn,{width:"100%",height:250,children:s.jsxs(Uy,{children:[s.jsx(cs,{data:r,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:o=>`${o.name}: ${o.value}`,children:r.map((o,l)=>s.jsx(Pa,{fill:o.color},l))}),s.jsx(kt,{}),s.jsx(vn,{})]})}):s.jsx("div",{className:"flex items-center justify-center h-[250px] text-muted-foreground",children:"No subscription data available"})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(tv,{className:"h-5 w-5"}),"Subscriptions by Status"]})}),s.jsx(le,{children:t?s.jsx(bn,{className:"h-[250px] w-full"}):a.length>0?s.jsx(Cn,{width:"100%",height:250,children:s.jsxs(Uy,{children:[s.jsx(cs,{data:a,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:80,label:o=>`${o.name}: ${o.value}`,children:a.map((o,l)=>s.jsx(Pa,{fill:o.color},l))}),s.jsx(kt,{}),s.jsx(vn,{})]})}):s.jsx("div",{className:"flex items-center justify-center h-[250px] text-muted-foreground",children:"No status data available"})})]})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(Wa,{className:"h-5 w-5"}),"Plan Distribution"]}),s.jsx(it,{children:"Breakdown of users by subscription plan"})]}),s.jsx(le,{children:t?s.jsx("div",{className:"space-y-2",children:[...Array(4)].map((o,l)=>s.jsx(bn,{className:"h-12 w-full"},l))}):s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsxs(Rr,{children:[s.jsx(jt,{children:"Plan"}),s.jsx(jt,{className:"text-right",children:"Users"}),s.jsx(jt,{className:"text-right",children:"% of Total"}),s.jsx(jt,{className:"text-right",children:"Est. MRR Contribution"})]})}),s.jsx(_l,{children:(e==null?void 0:e.users_by_plan)&&Object.entries(e.users_by_plan).map(([o,l])=>{const c=e.total_users>0?(l/e.total_users*100).toFixed(1):"0",d=l*({free:0,starter:19,pro:49,enterprise:199}[o]||0);return s.jsxs(Rr,{children:[s.jsx(Nt,{children:s.jsx($e,{variant:ij(o),children:o.toUpperCase()})}),s.jsx(Nt,{className:"text-right font-medium",children:Za(l)}),s.jsxs(Nt,{className:"text-right",children:[c,"%"]}),s.jsx(Nt,{className:"text-right font-medium",children:Ob(d)})]},o)})})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2 text-base",children:[s.jsx(ad,{
969className:"h-5 w-5 text-yellow-500"}),"Subscription Management"]}),s.jsx(it,{children:"Advanced subscription management features"})]}),s.jsx(le,{children:s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"p-4 border rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"Manual Overrides"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Change user plans manually without going through Stripe."}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Available via User Management → Change Plan"})]}),s.jsxs("div",{className:"p-4 border rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"Stripe Dashboard"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"For detailed billing, invoices, and payment management."}),s.jsx(U,{variant:"outline",size:"sm",onClick:()=>window.open("https://dashboard.stripe.com","_blank"),children:"Open Stripe"})]}),s.jsxs("div",{className:"p-4 border rounded-lg",children:[s.jsx("h4",{className:"font-medium mb-2",children:"Webhook Events"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:"Subscription changes are synced automatically via webhooks."}),s.jsx($e,{variant:"outline",className:"text-green-600 border-green-600",children:"Active"})]})]})})]})]})}const jnt=[{value:"user_view",label:"User View"},{value:"user_update",label:"User Update"},{value:"user_ban",label:"User Ban"},{value:"user_unban",label:"User Unban"},{value:"user_delete",label:"User Delete"},{value:"user_role_change",label:"Role Change"},{value:"user_plan_change",label:"Plan Change"},{value:"user_force_logout",label:"Force Logout"},{value:"bulk_delete",label:"Bulk Delete"},{value:"subscription_override",label:"Subscription Override"}],Nnt=[{value:"user",label:"User"},{value:"subscription",label:"Subscription"},{value:"system",label:"System"}];function Snt(){var h;const[e,t]=x.useState({page:1,limit:50}),{data:n,isLoading:r,refetch:a}=nnt(e),i=(m,p)=>{t(g=>({...g,[m]:p==="all"?void 0:p,page:1}))},o=m=>{t(p=>({...p,page:m}))},l=()=>{t({page:1,limit:50})},c=()=>{if(!(n!=null&&n.items))return;const m=["Date","Admin","Action","Target User","Resource","Reason","IP Address"],p=n.items.map(b=>[new Date(b.created_at).toLocaleString(),b.admin_username||"Unknown",sj[b.action]||b.action,b.target_username||"-",b.resource_type,b.reason||"-",b.ip_address]),g=[m.join(","),...p.map(b=>b.map(j=>`"${j}"`).join(","))].join(`
970`),y=new Blob([g],{type:"text/csv"}),v=URL.createObjectURL(y),w=document.createElement("a");w.href=v,w.download=`audit-logs-${new Date().toISOString().split("T")[0]}.csv`,w.click(),URL.revokeObjectURL(v)},u=n?Math.ceil(n.total/(e.limit||50)):0,d=e.page||1,f=m=>m.includes("delete")||m.includes("ban")?"destructive":m.includes("change")||m.includes("update")?"default":m.includes("view")?"outline":"secondary";return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Audit Logs"}),s.jsx("p",{className:"text-muted-foreground",children:"View and search admin action history"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(U,{variant:"outline",onClick:c,disabled:!((h=n==null?void 0:n.items)!=null&&h.length),children:[s.jsx(ci,{className:"h-4 w-4 mr-2"}),"Export CSV"]}),s.jsxs(U,{variant:"outline",onClick:()=>a(),children:[s.jsx(Vn,{className:"h-4 w-4 mr-2"}),"Refresh"]})]})]}),s.jsxs(Z,{children:[s.jsx(we,{className:"pb-3",children:s.jsxs(Ne,{className:"text-base flex items-center gap-2",children:[s.jsx(Va,{className:"h-4 w-4"}),"Filters"]})}),s.jsx(le,{children:s.jsxs("div",{className:"flex flex-wrap gap-4",children:[s.jsxs(rt,{value:e.action||"all",onValueChange:m=>i("action",m),children:[s.jsx(tt,{className:"w-[180px]",children:s.jsx(st,{placeholder:"Action Type"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"all",children:"All Actions"}),jnt.map(m=>s.jsx(_e,{value:m.value,children:m.label},m.value))]})]}),s.jsxs(rt,{value:e.resource_type||"all",onValueChange:m=>i("resource_type",m),children:[s.jsx(tt,{className:"w-[150px]",children:s.jsx(st,{placeholder:"Resource"})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"all",children:"All Resources"}),Nnt.map(m=>s.jsx(_e,{value:m.value,children:m.label},m.value))]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Zs,{className:"h-4 w-4 text-muted-foreground"}),s.jsx(Re,{type:"date",placeholder:"Start Date",value:e.start_date||"",onChange:m=>i("start_date",m.target.value||void 0),className:"w-[150px]"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-muted-foreground",children:"to"}),s.jsx(Re,{type:"date",placeholder:"End Date",value:e.end_date||"",onChange:m=>i("end_date",m.target.value||void 0),className:"w-[150px]"})]}),s.jsx(U,{variant:"ghost",onClick:l,children:"Clear"})]})})]}),s.jsxs(Z,{children:[s.jsxs(we,{children:[s.jsxs(Ne,{className:"flex items-center gap-2",children:[s.jsx(Dg,{className:"h-5 w-5"}),"Admin Actions",n&&s.jsxs($e,{variant:"secondary",className:"ml-2",children:[n.total," total"]})]}),s.jsx(it,{children:"Complete history of administrative actions"})]}),s.jsx(le,{children:r?s.jsx("div",{className:"space-y-3",children:[...Array(5)].map((m,p)=>s.jsx(bn,{className:"h-14 w-full"},p))}):n!=null&&n.items&&n.items.length>0?s.jsxs(s.Fragment,{children:[s.jsxs(Sl,{children:[s.jsx(Cl,{children:s.jsxs(Rr,{children:[s.jsx(jt,{className:"w-[180px]",children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(tv,{className:"h-4 w-4"}),"Timestamp"]})}),s.jsx(jt,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(n0,{className:"h-4 w-4"}),"Admin"]})}),s.jsx(jt,{children:s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(ai,{className:"h-4 w-4"}),"Action"]})}),s.jsx(jt,{children:"Target"}),s.jsx(jt,{children:"Details"}),s.jsx(jt,{children:"IP Address"})]})}),s.jsx(_l,{children:n.items.map(m=>s.jsxs(Rr,{children:[s.jsx(Nt,{className:"text-sm",children:new Date(m.created_at).toLocaleStr
970ing("es-ES",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}),s.jsx(Nt,{className:"font-medium",children:m.admin_username||"Unknown"}),s.jsx(Nt,{children:s.jsx($e,{variant:f(m.action),children:sj[m.action]||m.action})}),s.jsx(Nt,{children:m.target_username?s.jsx("span",{className:"text-sm",children:m.target_username}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"-"})}),s.jsx(Nt,{className:"max-w-[200px]",children:m.reason?s.jsx("span",{className:"text-sm text-muted-foreground truncate block",children:m.reason}):m.old_value&&m.new_value?s.jsx("span",{className:"text-sm text-muted-foreground",children:Object.keys(m.old_value).map(p=>{var g,y;return s.jsxs("span",{className:"block",children:[p,": ",String((g=m.old_value)==null?void 0:g[p])," → ",String((y=m.new_value)==null?void 0:y[p])]},p)})}):s.jsx("span",{className:"text-muted-foreground text-sm",children:"-"})}),s.jsx(Nt,{className:"text-sm font-mono text-muted-foreground",children:m.ip_address})]},m.id))})]}),u>1&&s.jsxs("div",{className:"flex items-center justify-between mt-4",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Page ",d," of ",u," (",n.total," entries)"]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(U,{variant:"outline",size:"sm",onClick:()=>o(d-1),disabled:d<=1,children:s.jsx(Wu,{className:"h-4 w-4"})}),s.jsx(U,{variant:"outline",size:"sm",onClick:()=>o(d+1),disabled:d>=u,children:s.jsx(si,{className:"h-4 w-4"})})]})]})]}):s.jsxs("div",{className:"text-center py-12 text-muted-foreground",children:[s.jsx(Dg,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),s.jsx("p",{children:"No audit logs found"}),s.jsx("p",{className:"text-sm mt-1",children:e.action||e.resource_type||e.start_date||e.end_date?"Try adjusting your filters":"Admin actions will appear here"})]})})]})]})}const Cnt=()=>{const e=cn(),{t}=Cr(),[n,r]=x.useState("grid"),[a,i]=x.useState(""),[o,l]=x.useState(null),[c,u]=x.useState(!1),[d,f]=x.useState(""),[h,m]=x.useState(""),[p,g]=x.useState("blank"),{data:y=[],isLoading:v,error:w,refetch:b}=I7({search:a||void 0}),{data:j}=zpe(),N=(j==null?void 0:j.templates)||[],S=Jme(),C=epe(),_=async()=>{if(!d.trim()){sn({title:t("workbooks.error"),description:t("workbooks.nameRequired"),variant:"destructive"});return}try{const P=await S.mutateAsync({name:d,description:h||void 0,template_type:p!=="blank"?p:void 0});sn({title:t("workbooks.created"),description:t("workbooks.createdDescription",{name:P.name})}),u(!1),f(""),m(""),g("blank"),e(`/dashboard/workbooks/${P.id}`)}catch{sn({title:t("workbooks.error"),description:t("workbooks.createError"),variant:"destructive"})}},E=async()=>{if(o)try{await C.mutateAsync(o.id),sn({title:t("workbooks.deleted"),description:t("workbooks.deletedDescription",{name:o.name})}),l(null)}catch{sn({title:t("workbooks.error"),description:t("workbooks.deleteError"),variant:"destructive"})}},T=P=>{const k=new Date(P),A=new Date().getTime()-k.getTime(),I=Math.floor(A/(1e3*60*60*24));return I===0?t("common.today"):I===1?t("common.yesterday"):I<7?t("common.daysAgo",{days:I}):k.toLocaleDateString()};return w?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:t("workbooks.title")}),s.jsx("p",{className:"text-muted-foreground mt-1",children:t("workbooks.description")})]}),s.jsx(Z,{className:"p-12",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-24 w-24 rounded-full bg-destructive/10 flex items-center justify-center",children:s.jsx(_s,{className:"h-12 w-12 text-destructive"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:t("workbooks.errorLoading")}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t("workbooks.errorLoadingDescription")})]}),s.jsx(U,{onClick:()=>b(),children:t("common.retry")})]})})]}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:t("workbooks.title")}),s.jsx("p",{className:"text-muted-foreground mt-1",children:t("workbooks.description")})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>u(!0),children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),t("workbooks.create")]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[s.jsxs("div",{className:"relative flex-1",children:[s.jsx(ii,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(Re,{placeholder:t("workbooks.searchPlaceholder"),className:"pl-9",value:a,onChange:P=>i(P.target.value)})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(U,{variant:n==="grid"?"default":"outline",size:"icon",onClick:()=>r("grid"),children:s.jsx(gm,{className:"h-4 w-4"})}),s.jsx(U,{variant:n==="list"?"default":"outline",size:"icon",onClick:()=>r("list"),children:s.jsx(el,{className:"h-4 w-4"})})]})]}),v&&s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[1,2,3].map(P=>s.jsxs(Z,{className:"animate-pulse",children:[s.jsxs(we,{children:[s.jsx("div",{className:"h-6 bg-muted rounded w-3/4"}),s.jsx("div",{className:"h-4 bg-muted rounded w-1/2 mt-2"})]}),s.jsx(le,{children:s.jsx("div",{className:"h-4 bg-muted rounded w-full"})})]},P))}),!v&&y.length===0&&s.jsx(Z,{className:"p-12",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx("div",{className:"flex justify-center",children:s.jsx("div",{className:"h-24 w-24 rounded-full bg-primary/10 flex items-center justify-center",children:s.jsx(_s,{className:"h-12 w-12 text-primary"})})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-foreground",children:t("workbooks.empty")}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t("workbooks.empty
970Description")})]}),s.jsxs(U,{className:"bg-gradient-primary",onClick:()=>u(!0),children:[s.jsx(Ln,{className:"mr-2 h-4 w-4"}),t("workbooks.createFirst")]})]})}),!v&&y.length>0&&n==="grid"&&s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:y.map(P=>s.jsxs(Z,{className:"cursor-pointer hover:shadow-md transition-shadow group",onClick:()=>e(`/dashboard/workbooks/${P.id}`),children:[s.jsxs(we,{className:"pb-2",children:[s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(_s,{className:"h-5 w-5 text-primary"}),s.jsx(Ne,{className:"text-lg",children:P.name})]}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,onClick:k=>k.stopPropagation(),children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100",children:s.jsx(fh,{className:"h-4 w-4"})})}),s.jsxs(Xr,{align:"end",children:[s.jsxs(Xe,{onClick:k=>{k.stopPropagation(),e(`/dashboard/workbooks/${P.id}`)},children:[s.jsx(U_,{className:"mr-2 h-4 w-4"}),t("common.edit")]}),s.jsx(ha,{}),s.jsxs(Xe,{className:"text-destructive",onClick:k=>{k.stopPropagation(),l(P)},children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})]}),P.description&&s.jsx(it,{className:"line-clamp-2",children:P.description})]}),s.jsx(le,{children:s.jsxs("div",{className:"flex items-center justify-between text-sm text-muted-foreground",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[P.template_type&&P.template_type!=="custom"&&s.jsx($e,{variant:"secondary",className:"text-xs",children:P.template_type}),s.jsxs("span",{children:[P.sheet_count," ",t("workbooks.sheets")]})]}),s.jsx("span",{children:T(P.last_edited_at)})]})})]},P.id))}),!v&&y.length>0&&n==="list"&&s.jsx(Z,{children:s.jsx("div",{className:"divide-y",children:y.map(P=>s.jsxs("div",{className:"flex items-center justify-between p-4 hover:bg-muted/50 cursor-pointer group",onClick:()=>e(`/dashboard/workbooks/${P.id}`),children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(_s,{className:"h-8 w-8 text-primary"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium",children:P.name}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[P.sheet_count," ",t("workbooks.sheets")," · ",T(P.last_edited_at)]})]})]}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,onClick:k=>k.stopPropagation(),children:s.jsx(U,{variant:"ghost",size:"icon",className:"h-8 w-8 opacity-0 group-hover:opacity-100",children:s.jsx(fh,{className:"h-4 w-4"})})}),s.jsxs(Xr,{align:"end",children:[s.jsxs(Xe,{onClick:k=>{k.stopPropagation(),e(`/dashboard/workbooks/${P.id}`)},children:[s.jsx(U_,{className:"mr-2 h-4 w-4"}),t("common.edit")]}),s.jsx(ha,{}),s.jsxs(Xe,{className:"text-destructive",onClick:k=>{k.stopPropagation(),l(P)},children:[s.jsx(pn,{className:"mr-2 h-4 w-4"}),t("common.delete")]})]})]})]},P.id))})}),s.jsx(br,{open:c,onOpenChange:u,children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:t("workbooks.createNew")}),s.jsx(wr,{children:t("workbooks.createDescription")})]}),s.jsxs("div",{className:"space-y-4 py-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"name",children:t("workbooks.name")}),s.jsx(Re,{id:"name",placeholder:t("workbooks.namePlaceholder"),value:d,onChange:P=>f(P.target.value)})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"description",children:t("workbooks.descriptionLabel")}),s.jsx(Aa,{id:"description",placeholder:t("workbooks.descriptionPlaceholder"),value:h,onChange:P=>m(P.target.value)})]}),N.length>0&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"template",children:t("workbooks.template")}),s.jsxs(rt,{value:p,onValueChange:P=>g(P),children:[s.jsx(tt,{children:s.jsx(st,{placeholder:t("workbooks.selectTemplate")})}),s.jsxs(nt,{children:[s.jsx(_e,{value:"blank",children:t("workbooks.blankWorkbook")}),N.map(P=>s.jsx(_e,{value:P.type,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:P.name}),s.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",P.preview_sheets.join(", "),")"]})]})},P.type))]})]})]})]}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>u(!1),children:t("common.cancel")}),s.jsxs(U,{className:"bg-gradient-primary",onClick:_,disabled:S.isPending,children:[S.isPending&&s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),t("workbooks.create")]})]})]})}),s.jsx(Ic,{open:!!o,onOpenChange:()=>l(null),children:s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:t("workbooks.deleteConfirm")}),s.jsx(ll,{children:t("workbooks.deleteConfirmDescription",{name:o==null?void 0:o.name})})]}),s.jsxs(il,{children:[s.jsx(ul,{children:t("common.cancel")}),s.jsxs(cl,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:E,children:[C.isPending&&s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),t("common.delete")]})]})]})})]})},_nt="modulepreload",Ent=function(e){return"/"+e},DF={}
970,Ant=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));a=Promise.allSettled(n.map(c=>{if(c=Ent(c),c in DF)return;DF[c]=!0;const u=c.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${d}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":_nt,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((h,m)=>{f.addEventListener("load",h),f.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return a.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})},Pnt=x.lazy(()=>Ant(()=>import("./index.esm-Dpy-zUgU.js"),[]).then(e=>({default:e.Workbook})));class knt extends x.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("FortuneSheet Error:",t,n)}render(){var t;return this.state.hasError?s.jsx("div",{className:"h-full flex items-center justify-center bg-destructive/10 rounded-lg border border-destructive/20 p-8",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(_s,{className:"h-12 w-12 mx-auto text-destructive"}),s.jsx("h3",{className:"font-semibold text-destructive",children:"Spreadsheet Error"}),s.jsx("p",{className:"text-sm text-muted-foreground max-w-md",children:((t=this.state.error)==null?void 0:t.message)||"Failed to load spreadsheet editor"}),s.jsx(U,{variant:"outline",onClick:()=>this.setState({hasError:!1,error:null}),children:"Retry"})]})}):this.props.children}}const Ont=()=>{var W,q,J,ie,X,ge,Se;const{id:e}=iv(),t=cn(),{t:n}=Cr(),[r,a]=x.useState(null),[i,o]=x.useState(!1),[l,c]=x.useState(""),[u,d]=x.useState(!1),[f,h]=x.useState(""),[m,p]=x.useState(null),[g,y]=x.useState(!1),[v,w]=x.useState(""),[b,j]=x.useState(null),[N,S]=x.useState(!1),C=x.useRef(null),_=x.useRef(!1),E=x.useRef(null);x.useEffect(()=>()=>{C.current&&(clearTimeout(C.current),console.log("=== Component unmounting, clearing timeout ==="))},[]);const{data:T,isLoading:P,error:k,refetch:D}=Bpe(e),A=Zme(),I=npe(),M=tpe(),$=rpe(),R=b7();x.useEffect(()=>{const ce=ye=>{if(_.current||N)return ye.preventDefault(),ye.returnValue="",""};return window.addEventListener("beforeunload",ce),()=>window.removeEventListener("beforeunload",ce)},[N]);const O=x.useCallback(async()=>{var ye;if(!T||!r||N)return;C.current&&(clearTimeout(C.current),C.current=null);const ce=E.current;if(!ce){console.log("No data to save"),sn({title:n("workbooks.noChanges"),description:n("workbooks.noChangesDescription")});return}S(!0);try{const{data:Ie,config:Ue}=qD(ce);if(console.log("=== Manual save ==="),console.log("celldata length:",(ye=Ie.celldata)==null?void 0:ye.length),!Ie.celldata||Ie.celldata.length===0){console.warn("WARNING: No celldata to save!"),sn({title:n("workbooks.error"),description:n("workbooks.noDataToSave"),variant:"destructive"});return}await I.mutateAsync({workbookId:T.id,sheetId:r,data:{data:Ie,config:Ue}}),j(new Date),_.current=!1,sn({title:n("workbooks.saved"),description:n("workbooks.savedDescription")}),console.log("Manual save successful - saved",Ie.celldata.length,"cells")}catch(Ie){console.error("Manual save failed:",Ie),sn({title:n("workbooks.error"),description:n("workbooks.saveError"),variant:"destructive"})}finally{S(!1)}},[T,r,N,I,n]);x.useEffect(()=>{const ce=ye=>{(ye.ctrlKey||ye.metaKey)&&ye.key==="s"&&(ye.preventDefault(),O())};return window.addEventListener("keydown",ce),()=>window.removeEventListener("keydown",ce)},[O]),x.useEffect(()=>{if(T!=null&&T.sheets&&T.sheets.length>0&&!r){const ce=T.sheets.find(ye=>ye.is_active)||T.sheets[0];a(ce.id)}},[T,r]);const F=(W=T==null?void 0:T.sheets)==null?void 0:W.find(ce=>
970ce.id===r),z=async()=>{if(!(!T||!l.trim()))try{await A.mutateAsync({id:T.id,data:{name:l}}),o(!1),sn({title:n("workbooks.nameSaved")})}catch{sn({title:n("workbooks.error"),description:n("workbooks.nameSaveError"),variant:"destructive"})}},B=x.useCallback(async ce=>{var ye,Ie;if(!(!T||!r)){if(console.log("=== FortuneSheet onChange ==="),console.log("Raw data:",ce),console.log("Data type:",typeof ce),console.log("Is array:",Array.isArray(ce)),ce&&ce[0]){const Ue=ce[0];console.log("First sheet keys:",Object.keys(Ue)),console.log("Sheet details:",{name:Ue.name,hasData:!!Ue.data,hasCelldata:!!Ue.celldata,dataType:typeof Ue.data,dataIsArray:Array.isArray(Ue.data),dataLength:(ye=Ue.data)==null?void 0:ye.length,celldataType:typeof Ue.celldata,celldataIsArray:Array.isArray(Ue.celldata),celldataLength:(Ie=Ue.celldata)==null?void 0:Ie.length}),Ue.data&&Array.isArray(Ue.data)&&console.log("First 3 rows of data matrix:",Ue.data.slice(0,3).map(Ze=>{var fe;return(fe=Ze==null?void 0:Ze.slice)==null?void 0:fe.call(Ze,0,5)}))}C.current&&clearTimeout(C.current),E.current=ce[0],_.current=!0,C.current=setTimeout(async()=>{var Ue,Ze;S(!0);try{const{data:fe,config:Oe}=qD(ce[0]);if(console.log("=== Converted data for saving ==="),console.log("celldata length:",(Ue=fe.celldata)==null?void 0:Ue.length),console.log("First 5 cells:",(Ze=fe.celldata)==null?void 0:Ze.slice(0,5)),console.log("config:",Oe),!fe.celldata||fe.celldata.length===0){console.warn("WARNING: No celldata to save! Skipping auto-save to prevent data loss."),S(!1);return}await I.mutateAsync({workbookId:T.id,sheetId:r,data:{data:fe,config:Oe}}),j(new Date),_.current=!1,console.log("Auto-save successful - saved",fe.celldata.length,"cells")}catch(fe){console.error("Auto-save failed:",fe)}finally{S(!1)}},2e3)}},[T,r,I]),H=async()=>{if(!(!T||!f.trim()))try{const ce=await M.mutateAsync({workbookId:T.id,data:{name:f,is_active:!0}});a(ce.id),d(!1),h(""),D(),sn({title:n("workbooks.sheetAdded")})}catch{sn({title:n("workbooks.error"),description:n("workbooks.sheetAddError"),variant:"destructive"})}},Y=async()=>{var ce;if(!(!T||!m))try{if(await $.mutateAsync({workbookId:T.id,sheetId:m.id}),r===m.id){const ye=T.sheets.filter(Ie=>Ie.id!==m.id);a(((ce=ye[0])==null?void 0:ce.id)||null)}p(null),D(),sn({title:n("workbooks.sheetDeleted")})}catch{sn({title:n("workbooks.error"),description:n("workbooks.sheetDeleteError"),variant:"destructive"})}},ee=async()=>{if(!(!T||!r||!v.trim()))try{const ce=await R.mutateAsync({workbookId:T.id,data:{sheet_id:r,name:v,include_header:!0,start_row:0}});sn({title:n("workbooks.converted"),description:n("workbooks.convertedDescription",{rows:ce.row_count})}),y(!1),w(""),t(`/dashboard/datasets/${ce.data_source_id}`)}catch{sn({title:n("workbooks.error"),description:n("workbooks.convertError"),variant:"destructive"})}};let V=[],K=null;try{if(F){console.log("=== Preparing FortuneSheet data ==="),console.log("Active sheet from backend:",{id:F.id,name:F.name,hasData:!!F.data,dataKeys:F.data?Object.keys(F.data):[],celldataLength:(J=(q=F.data)==null?void 0:q.celldata)==null?void 0:J.length,firstCells:(X=(ie=F.data)==null?void 0:ie.celldata)==null?void 0:X.slice(0,3)});const ce=uue(F);console.log("Converted to FortuneSheet format:",{name:ce.name,celldataLength:(ge=ce.celldata)==null?void 0:ge.length,firstCells:(Se=ce.celldata)==null?void 0:Se.slice(0,3),row:ce.row,column:ce.column}),V=[ce]}}catch(ce){console.error("Error preparing sheet data:",ce),K=ce instanceof Error?ce.message:"Failed to prepare sheet data"}return x.useEffect(()=>{F&&(console.log("=== WorkbookEditor State ==="),console.log("Active sheet ID:",r),console.log("Sheet data from backend:",F.data),console.log("FortuneSheet data array length:",V.length))},[r,F,V]),k?s.jsxs("div",{className:"space-y-6",children:[s.jsxs(U,{variant:"ghost",onClick:()=>t("/dashboard/workbooks"),children:[s.jsx(Yr,{className:"mr-2 h-4 w-4"}),n("common.back")]}),s.jsx(Z,{className:"p-12",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(_s,{className:"h-16 w-16 mx-auto text-destructive"}),s.jsx("h3",{className:"text-lg font-semibold",children:n("workbooks.notFound")}),s.jsx(U,{onClick:()=>t("/dashboard/workbooks"),children:n("workbooks.backToList")})]})})]}):P||!T?s.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})}):s.jsxs("div",{className:"h-[calc(100vh-120px)] flex flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between pb-4 border-b",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx(U,{variant:"ghost",size:"icon",onClick:()=>t("/dashboard/workbooks"),children:s.jsx(Yr,{className:"h-4 w-4"})}),i?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Re,{value:l,onCh
970ange:ce=>c(ce.target.value),onKeyDown:ce=>{ce.key==="Enter"&&z(),ce.key==="Escape"&&o(!1)},className:"h-8 w-64",autoFocus:!0}),s.jsx(U,{size:"sm",onClick:z,children:s.jsx(bt,{className:"h-4 w-4"})})]}):s.jsx("h1",{className:"text-xl font-semibold cursor-pointer hover:text-primary",onClick:()=>{c(T.name),o(!0)},children:T.name}),N&&s.jsxs("span",{className:"text-sm text-muted-foreground flex items-center gap-1",children:[s.jsx(Te,{className:"h-3 w-3 animate-spin"}),n("workbooks.saving")]}),!N&&b&&s.jsx("span",{className:"text-sm text-muted-foreground",children:n("workbooks.lastSaved",{time:b.toLocaleTimeString()})})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs(U,{variant:"outline",onClick:()=>{w(`${T.name} - ${(F==null?void 0:F.name)||"Sheet"}`),y(!0)},disabled:!F,children:[s.jsx(wt,{className:"mr-2 h-4 w-4"}),n("workbooks.convertToDataset")]}),s.jsxs(da,{children:[s.jsx(fa,{asChild:!0,children:s.jsx(U,{variant:"outline",size:"icon",children:s.jsx(fh,{className:"h-4 w-4"})})}),s.jsxs(Xr,{align:"end",children:[s.jsxs(Xe,{onClick:O,disabled:N,children:[s.jsx(QB,{className:"mr-2 h-4 w-4"}),n("workbooks.save"),s.jsx("span",{className:"ml-auto text-xs text-muted-foreground",children:"Ctrl+S"})]}),s.jsx(ha,{}),s.jsxs(Xe,{children:[s.jsx(ci,{className:"mr-2 h-4 w-4"}),n("workbooks.exportExcel")]})]})]})]})]}),s.jsxs("div",{className:"flex items-center gap-2 py-2 border-b overflow-x-auto",children:[T.sheets.map(ce=>s.jsxs("div",{className:`
971              flex items-center gap-1 px-3 py-1.5 rounded-t cursor-pointer group
972              ${r===ce.id?"bg-background border border-b-0 -mb-px":"bg-muted/50 hover:bg-muted"}
973            `,onClick:()=>a(ce.id),children:[s.jsx("span",{className:"text-sm",children:ce.name}),T.sheets.length>1&&s.jsx(U,{variant:"ghost",size:"icon",className:"h-5 w-5 opacity-0 group-hover:opacity-100",onClick:ye=>{ye.stopPropagation(),p(ce)},children:s.jsx(pn,{className:"h-3 w-3"})})]},ce.id)),s.jsx(U,{variant:"ghost",size:"sm",className:"h-7",onClick:()=>d(!0),children:s.jsx(Ln,{className:"h-4 w-4"})})]}),s.jsx("div",{className:"flex-1 min-h-0",style:{height:"calc(100vh - 200px)"},children:K?s.jsx("div",{className:"h-full flex items-center justify-center bg-destructive/10 rounded-lg border border-destructive/20 p-8",children:s.jsxs("div",{className:"text-center space-y-4",children:[s.jsx(_s,{className:"h-12 w-12 mx-auto text-destructive"}),s.jsx("h3",{className:"font-semibold text-destructive",children:"Data Error"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:K})]})}):V.length>0?s.jsx(knt,{children:s.jsx(x.Suspense,{fallback:s.jsx("div",{className:"h-full flex items-center justify-center",children:s.jsx(Te,{className:"h-8 w-8 animate-spin text-primary"})}),children:s.jsx(Pnt,{data:V,onChange:B},`${T==null?void 0:T.id}-${r}`)})}):s.jsx("div",{className:"h-full flex items-center justify-center bg-muted/20 rounded-lg border",children:s.jsxs("div",{className:"text-center",children:[s.jsx(_s,{className:"h-12 w-12 mx-auto text-muted-foreground mb-2"}),s.jsx("p",{className:"text-muted-foreground",children:n("workbooks.loadingSheet")})]})})}),s.jsx(br,{open:u,onOpenChange:d,children:s.jsxs(or,{children:[s.jsx(lr,{children:s.jsx(cr,{children:n("workbooks.addSheet")})}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"sheetName",children:n("workbooks.sheetName")}),s.jsx(Re,{id:"sheetName",placeholder:n("workbooks.sheetNamePlaceholder"),value:f,onChange:ce=>h(ce.target.value)})]})}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>d(!1),children:n("common.cancel")}),s.jsxs(U,{onClick:H,disabled:M.isPending,children:[M.isPending&&s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),n("common.add")]})]})]})}),s.jsx(Ic,{open:!!m,onOpenChange:()=>p(null),children:s.jsxs(al,{children:[s.jsxs(sl,{children:[s.jsx(ol,{children:n("workbooks.deleteSheet")}),s.jsx(ll,{children:n("workbooks.deleteSheetDescription",{name:m==null?void 0:m.name})})]}),s.jsxs(il,{children:[s.jsx(ul,{children:n("common.cancel")}),s.jsxs(cl,{className:"bg-destructive text-destructive-foreground",onClick:Y,children:[$.isPending&&s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),n("common.delete")]})]})]})}),s.jsx(br,{open:g,onOpenChange:y,children:s.jsxs(or,{children:[s.jsxs(lr,{children:[s.jsx(cr,{children:n("workbooks.convertToDataset")}),s.jsx(wr,{children:n("workbooks.convertDescription")})]}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(pe,{htmlFor:"datasetName",children:n("workbooks.datasetName")}),s.jsx(Re,{id:"datasetName",placeholder:n("workbooks.datasetNamePlaceholder"),value:v,onCh
973ange:ce=>w(ce.target.value)})]})}),s.jsxs(_a,{children:[s.jsx(U,{variant:"outline",onClick:()=>y(!1),children:n("common.cancel")}),s.jsxs(U,{onClick:ee,disabled:R.isPending,children:[R.isPending&&s.jsx(Te,{className:"mr-2 h-4 w-4 animate-spin"}),n("workbooks.convert")]})]})]})})]})},Tnt=()=>{const{t:e}=Cr();return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-12",children:[s.jsx("div",{className:"mb-8",children:s.jsx(vt,{to:"/",children:s.jsxs(U,{variant:"ghost",size:"sm",children:[s.jsx(Yr,{className:"h-4 w-4 mr-2"}),e("common.back","Back")]})})}),s.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[s.jsx(Uc,{className:"h-8 w-8 text-primary"}),s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:e("legal.privacyPolicy")})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:e("legal.lastUpdated",{date:"February 2, 2026"})}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:e("legal.dataController")})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:e("legal.dataControllerDesc")})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:e("legal.dataProcessing")})}),s.jsxs(le,{children:[s.jsx("p",{className:"text-muted-foreground",children:e("legal.dataProcessingDesc")}),s.jsxs("ul",{className:"mt-4 space-y-2 text-sm text-muted-foreground list-disc list-inside",children:[s.jsx("li",{children:"Account creation and authentication"}),s.jsx("li",{children:"Data storage and processing for analytics"}),s.jsx("li",{children:"AI-powered data analysis (with your consent)"}),s.jsx("li",{children:"Payment processing via Stripe"}),s.jsx("li",{children:"Service improvement and analytics"})]})]})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:e("legal.yourRights")})}),s.jsxs(le,{children:[s.jsx("p",{className:"text-muted-foreground",children:e("legal.yourRightsDesc")}),s.jsxs("ul",{className:"mt-4 space-y-2 text-sm text-muted-foreground list-disc list-inside",children:[s.jsx("li",{children:"Right of access (Art. 15 GDPR)"}),s.jsx("li",{children:"Right to rectification (Art. 16 GDPR)"}),s.jsx("li",{children:"Right to erasure (Art. 17 GDPR)"}),s.jsx("li",{children:"Right to restriction of processing (Art. 18 GDPR)"}),s.jsx("li",{children:"Right to data portability (Art. 20 GDPR)"}),s.jsx("li",{children:"Right to object (Art. 21 GDPR)"})]})]})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:e("legal.contact")})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:e("legal.contactDesc")})})]})]}),s.jsxs("div",{className:"mt-12 flex gap-4 text-sm text-muted-foreground",children:[s.jsx(vt,{to:"/terms",className:"hover:text-foreground underline",children:e("legal.termsOfService")}),s.jsx(vt,{to:"/cookies",className:"hover:text-foreground underline",children:e("legal.cookiePolicy")}),s.jsx(vt,{to:"/legal",className:"hover:text-foreground underline",children:e("legal.legalNotice")})]})]})})},Mnt=()=>{const{t:e}=Cr();return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-12",children:[s.jsx("div",{className:"mb-8",children:s.jsx(vt,{to:"/",children:s.jsxs(U,{variant:"ghost",size:"sm",children:[s.jsx(Yr,{className:"h-4 w-4 mr-2"}),e("common.back","Back")]})})}),s.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[s.jsx(di,{className:"h-8 w-8 text-primary"}),s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:e("legal.termsOfService")})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:e("legal.lastUpdated",{date:"February 2, 2026"})}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsx("p",{className:"text-muted-foreground",children:e("legal.termsContent")})})}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"1. Service Description"})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:"Refraxion is a data analytics and reporting platform that provides business intelligence tools, AI-powered data analysis, and collaborative reporting capabilities."})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"2. User Obligations"})}),s.jsx(le,{children:s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground list-disc list-inside",children:[s.jsx("li",{children:"You must provide accurate registration information"}),s.jsx("li",{children:"You are responsible for maintaining the security of your account"}),s.jsx("li",{children:"You must not upload data that violates applicable laws"}),s.jsx("li",{children:"You must comply with all applicable data protection regulations"})]})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"3. AI-Generated Content"})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:"In accordance with the EU AI Act (Art. 50), AI-generated content on this platform is clearly labeled. AI responses are automated and may contain errors. Users should verify critical information before making business decisions based on AI analysis."})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"4. Data Retention"})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:"Upon account deleti
973on, personal data is removed immediately. Billing and invoice records are retained for 5 years in compliance with the Spanish General Tax Law (Art. 66, Ley General Tributaria)."})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"5. Governing Law"})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:"These terms are governed by Spanish law. Any disputes shall be resolved by the courts of Spain."})})]})]}),s.jsxs("div",{className:"mt-12 flex gap-4 text-sm text-muted-foreground",children:[s.jsx(vt,{to:"/privacy",className:"hover:text-foreground underline",children:e("legal.privacyPolicy")}),s.jsx(vt,{to:"/cookies",className:"hover:text-foreground underline",children:e("legal.cookiePolicy")}),s.jsx(vt,{to:"/legal",className:"hover:text-foreground underline",children:e("legal.legalNotice")})]})]})})},Rnt=()=>{const{t:e}=Cr();return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-12",children:[s.jsx("div",{className:"mb-8",children:s.jsx(vt,{to:"/",children:s.jsxs(U,{variant:"ghost",size:"sm",children:[s.jsx(Yr,{className:"h-4 w-4 mr-2"}),e("common.back","Back")]})})}),s.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[s.jsx(VB,{className:"h-8 w-8 text-primary"}),s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:e("legal.cookiePolicy")})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:e("legal.lastUpdated",{date:"February 2, 2026"})}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsx("p",{className:"text-muted-foreground",children:e("legal.cookieContent")})})}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:e("legal.cookieTypes.essential")})}),s.jsxs(le,{children:[s.jsx("p",{className:"text-muted-foreground",children:e("legal.cookieTypes.essentialDesc")}),s.jsxs("ul",{className:"mt-4 space-y-2 text-sm text-muted-foreground list-disc list-inside",children:[s.jsx("li",{children:"Authentication tokens (JWT)"}),s.jsx("li",{children:"Session management"}),s.jsx("li",{children:"CSRF protection"}),s.jsx("li",{children:"Cookie consent preferences"})]})]})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:e("legal.cookieTypes.analytics")})}),s.jsxs(le,{children:[s.jsx("p",{className:"text-muted-foreground",children:e("legal.cookieTypes.analyticsDesc")}),s.jsxs("ul",{className:"mt-4 space-y-2 text-sm text-muted-foreground list-disc list-inside",children:[s.jsx("li",{children:"Usage patterns and feature adoption"}),s.jsx("li",{children:"Performance monitoring"}),s.jsx("li",{children:"Error tracking"})]})]})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:e("legal.cookieTypes.marketing")})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:e("legal.cookieTypes.marketingDesc")})})]})]}),s.jsxs("div",{className:"mt-12 flex gap-4 text-sm text-muted-foreground",children:[s.jsx(vt,{to:"/privacy",className:"hover:text-foreground underline",children:e("legal.privacyPolicy")}),s.jsx(vt,{to:"/terms",className:"hover:text-foreground underline",children:e("legal.termsOfService")}),s.jsx(vt,{to:"/legal",className:"hover:text-foreground underline",children:e("legal.legalNotice")})]})]})})},Dnt=()=>{const{t:e}=Cr();return s.jsx("div",{className:"min-h-screen bg-background",children:s.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-12",children:[s.jsx("div",{className:"mb-8",children:s.jsx(vt,{to:"/",children:s.jsxs(U,{variant:"ghost",size:"sm",children:[s.jsx(Yr,{className:"h-4 w-4 mr-2"}),e("common.back","Back")]})})}),s.jsxs("div",{className:"flex items-center gap-3 mb-8",children:[s.jsx(Mre,{className:"h-8 w-8 text-primary"}),s.jsx("h1",{className:"text-3xl font-bold text-foreground",children:e("legal.legalNotice")})]}),s.jsx("p",{className:"text-sm text-muted-foreground mb-8",children:e("legal.lastUpdated",{date:"February 2, 2026"})}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(Z,{children:s.jsx(le,{className:"pt-6",children:s.jsx("p",{className:"text-muted-foreground",children:e("legal.legalContent")})})}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"Company Information"})}),s.jsxs(le,{className:"space-y-2 text-sm text-muted-foreground",children:[s.jsxs("p",{children:[s.jsx("strong",{children:"Company:"})," Refraxion"]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Platform:"})," Refraxion 2.0"]}),s.jsxs("p",{children:[s.jsx("strong",{children:"Contact:"})," [email protected]"]})]})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"Applicable Legislation"})}),s.jsx(le,{children:s.jsxs("ul",{className:"space-y-2 text-sm text-muted-foreground list-disc list-inside",children:[s.jsx("li",{children:"Regulation (EU) 2016/679 (GDPR)"}),s.jsx("li",{children:"Spanish Organic Law 3/2018 (LOPDGDD)"}),s.jsx("li",{children:"Spanish Law 34/2002 (LSSI-CE)"}),s.jsx("li",{children:"EU AI Act - Regulation (EU) 2024/1689"}),s.jsx("li",{children:"Spanish General Tax Law (Ley 58/2003)"})]})})]}),s.jsxs(Z,{children:[s.jsx(we,{children:s.jsx(Ne,{children:"AI Systems Transparency"})}),s.jsx(le,{children:s.jsx("p",{className:"text-muted-foreground",children:"In compliance with EU AI Act Article 50, Refraxion uses artificial intelligence systems for data analysis (AI Analyst feature). All AI-generated content is clearly labeled. The AI systems used are based on OpenAI GPT models and are classified as limited-risk AI systems under the EU AI Act."})})]})]}),s.jsxs("div",{className:"mt-12 flex gap-4 text-sm text-muted-foreground",children:[s.jsx(vt,{to:"/privacy",className:"hover:text-foreground underline",children:e("legal.privacyPolicy")}),s.jsx(vt,{to:"/terms",className:"hover:text-foreground underline",children:e("legal.termsOfService")}),s.jsx(vt,{to:"/cookies",className:"hover:text-foreground underline",children:e("legal.cookiePolicy")})]})]})})},bZ="refraxion_cookie_consent";function $nt(){try{const e=localStorage.getItem(bZ);if(e)return JSON.parse(e)}catch{}return null}function IC(e){localStorage.setItem(bZ,JSON.stringify(e))}const Int=()=>{const{t:e}=Cr(),[t,n]=x.useState(!1),[r,a]=x.useState(!1),[i,o]=x.useState(!1);x.useEffect(()=>{$nt()||n(!0)},[]);const l=()=>{const d={essential:!0,analytics:!0,marketing:!0,timestamp:new Date().toISOString()};IC(d),n(!1)},c=()=>{const d={essential:!0,analytics:!1,marketing:!1,timestamp:new Date().toISOString()};IC(d),n(!1)},u=()=>{const d={essential:!0,analytics:r,marketing:i,timestamp:new Date().toISOString()};IC(d),n(!1)};return t?s.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 p-4 bg-background border-t border-border shadow-lg",children:s.jsxs("div",{className:"max-w-4xl mx-auto",children:[s.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[s.jsx(VB,{className:"h-5 w-5 text-primary mt-0.5 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("h3",{className:"font-semibold text-sm",children:e("cookies.bannerTitle")}),s.jsxs("p",{className:"text-sm text-muted-foreground mt-1",children:[e("cookies.bannerDescription")," ",s.jsx(vt,{to:"/cookies",className:"underline hover:text-foreground",children:e("legal.cookiePolicy")})]})]})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-6 mb-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xn,{checked:!0,disabled:!0}),s.jsx(pe,{className:"text-sm",children:e("cookies.essential")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xn,{checked:r,onCheckedChange:a}),s.jsx(pe,{className:"text-sm",children:e("cookies.analytics")})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xn,{checked:i,onCheckedChange:o}),s.jsx(pe,{className:"text-sm",children:e("cookies.marketing")})]})]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(U,{onClick:l,size:"sm",children:e("cookies.acceptAll")}),s.jsx(U,{onClick:u,variant:"outline",size:"sm",children:e("cookies.savePreferences")}),s.jsx(U,{onClick:c,variant:"ghost",size:"sm",children:e("cookies.acceptEssential")})]})]})}):null},Lnt=()=>s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary mx-auto"}),s.jsx("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})}),Fnt=()=>s.jsx(x.Suspense,{fallback:s.jsx(Lnt,{}),children:s.jsx(ooe,{client:NU,children:s.jsx(ofe,{children:s.jsx(ple,{children:s.jsx(ife,{children:s.jsxs(mk,{children:[s.jsx(Nae,{}),s.jsx(tse,{}),s.jsxs(ole,{children:[s.jsx(Pt,{path:"/",element:s.jsx(_me,{})}),s.jsx(Pt,{path:"/auth/login",element:s.jsx(AS,{children:s.jsx(Rme,{})})}),s.jsx(Pt,{path:"/auth/register",element:s.jsx(AS,{children:s.jsx(Dme,{})})}),s.jsx(Pt,{path:"/auth/forgot-password",element:s.jsx(AS,{children:s.jsx(ape,{})})}),s.jsx(Pt,{path:"/auth/verify-email",element:s.jsx(spe,{})}),s.jsx(Pt,{path:"/auth/google/callback",element:s.jsx(ope,{})}),s.jsx(Pt,{path:"/privacy",element:s.jsx(Tnt,{})}),s.jsx(Pt,{path:"/terms",element:s.jsx(Mnt,{})}),s.jsx(Pt,{path:"/cookies",element:s.jsx(Rnt,{})}),s.jsx(Pt,{path:"/legal",element:s.jsx(Dnt,{})}),s.jsx(Pt,{path:"/dashboard",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Vpe,{})})})}),s.jsx(Pt,{path:"/dashboard/datasets",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(kNe,{})})})}),s.jsx(Pt,{path:"/dashboard/datasets/:id",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(MNe,{})})})}),s.jsx(Pt,{path:"/dashboard/reports",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(RNe,{})})})}),s.jsx(Pt,{path:"/dashboard/reports/new",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(kF,{})})})}),s.jsx(Pt,{path:"/dashboard/reports/edit/:id",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(kF,{})})})}),s.jsx(Pt,{path:"/dashboard/reports/:id",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Vtt,{})})})}),s.jsx(Pt,{path:"/dashboard/ai-analyst",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Htt,{})})})}),s.jsx(Pt,{path:"/dashboard/workbooks",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Cnt,{})})})}),s.jsx(Pt,{path:"/dashboard/workbooks/:id",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Ont,{})})})}),s.jsx(Pt,{path:"/dashboard/connectors",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Ztt,{})})})}),s.jsx(Pt,{path:"/dashboard/scheduled-reports",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Wtt,{})})})}),s.jsx(Pt,{path:"/dashboard/shared-links",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(qtt,{})})})}),s.jsx(Pt,{path:"/dashboard/subscription",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Ytt,{})})})}),s.jsx(Pt,{path:"/dashboard/usage",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Qtt,{})})})}),s.jsx(Pt,{path:"/dashboard/settings",element:s.jsx(Er,{children:s.jsx(Mn,{children:s.jsx(Ktt,{})})})}),s.jsx(Pt,{path:"/dashboard/admin",element:s.jsx(Yd,{children:s.jsx(Mn,{children:s.jsx(hnt,{})})})}),s.jsx(Pt,{path:"/dashboard/admin/users",element:s.jsx(Yd,{children:s.jsx(Mn,{children:s.jsx(pnt,{})})})}),s.jsx(Pt,{path:"/dashboard/admin/users/:userId",element:s.jsx(Yd,{children:s.jsx(Mn,{children:s.jsx(gnt,{})})})}),s.jsx(Pt,{path:"/dashboard/admin/ai-usage",element:s.jsx(Yd,{children:s.jsx(Mn,{children:s.jsx(vnt,{})})})}),s.jsx(Pt,{path:"/dashboard/admin/subscriptions",element:s.jsx(Yd,{children:s.jsx(Mn,{children:s.jsx(wnt,{})})})}),s.jsx(Pt,{path:"/dashboard/admin/audit-logs",element:s.jsx(Yd,{children:s.jsx(Mn,{children:s.jsx(Snt,{})})})}),s.jsx(Pt,{path:"*",element:s.jsx(Eme,{})})]}),s.jsx(Int,{})]})})})})})});cB(document.getElementById("root")).render(s.jsx(x.StrictMode,{children:s.jsx(Fnt,{})}));export{L as R,Qv as c,$t as g,x as r};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.