@johpaz/hive-agents 0.0.13 → 0.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,331 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ui-Dea4K2Mp.js","assets/react-CJr1g6q1.js","assets/ui-CHpVij2M.css"])))=>i.map(i=>d[i]);
2
+ import{a as e,i as t,n,r,t as i}from"./react-CJr1g6q1.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var a=r((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,M(x);else{var t=n(l);t!==null&&N(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&N(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,j=A.port2;A.port1.onmessage=O,k=function(){j.postMessage(null)}}else k=function(){g(O,0)};function M(e){C=e,S||(S=!0,k())}function N(t,n){w=g(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,M(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,N(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,M(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=r(((e,t)=>{t.exports=a()})),s=r((e=>{var t=n(),r=o();function i(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 a=new Set,s={};function c(e,t){l(e,t),l(e+`Capture`,t)}function l(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var u=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},m={};function h(e){return d.call(m,e)?!0:d.call(p,e)?!1:f.test(e)?m[e]=!0:(p[e]=!0,!1)}function g(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?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function _(e,t,n,r){if(t==null||g(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function v(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var y={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){y[e]=new v(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];y[t]=new v(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){y[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){y[e]=new v(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){y[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){y[e]=new v(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){y[e]=new v(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){y[e]=new v(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){y[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)});var b=/[\-:]([a-z])/g;function x(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(b,x);y[t]=new v(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(b,x);y[t]=new v(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(b,x);y[t]=new v(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)}),y.xlinkHref=new v(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){y[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)});function S(e,t,n,r){var i=y.hasOwnProperty(t)?y[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(_(t,n,i,r)&&(n=null),r||i===null?h(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var C=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,w=Symbol.for(`react.element`),T=Symbol.for(`react.portal`),E=Symbol.for(`react.fragment`),D=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),k=Symbol.for(`react.provider`),A=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),M=Symbol.for(`react.suspense`),N=Symbol.for(`react.suspense_list`),P=Symbol.for(`react.memo`),F=Symbol.for(`react.lazy`),ee=Symbol.for(`react.offscreen`),I=Symbol.iterator;function L(e){return typeof e!=`object`||!e?null:(e=I&&e[I]||e[`@@iterator`],typeof e==`function`?e:null)}var R=Object.assign,te;function ne(e){if(te===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);te=t&&t[1]||``}return`
3
+ `+te+e}var z=!1;function re(e,t){if(!e||z)return``;z=!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(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
4
+ `),a=r.stack.split(`
5
+ `),o=i.length-1,s=a.length-1;1<=o&&0<=s&&i[o]!==a[s];)s--;for(;1<=o&&0<=s;o--,s--)if(i[o]!==a[s]){if(o!==1||s!==1)do if(o--,s--,0>s||i[o]!==a[s]){var c=`
6
+ `+i[o].replace(` at new `,` at `);return e.displayName&&c.includes(`<anonymous>`)&&(c=c.replace(`<anonymous>`,e.displayName)),c}while(1<=o&&0<=s);break}}}finally{z=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:``)?ne(e):``}function ie(e){switch(e.tag){case 5:return ne(e.type);case 16:return ne(`Lazy`);case 13:return ne(`Suspense`);case 19:return ne(`SuspenseList`);case 0:case 2:case 15:return e=re(e.type,!1),e;case 11:return e=re(e.type.render,!1),e;case 1:return e=re(e.type,!0),e;default:return``}}function ae(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 E:return`Fragment`;case T:return`Portal`;case O:return`Profiler`;case D:return`StrictMode`;case M:return`Suspense`;case N:return`SuspenseList`}if(typeof e==`object`)switch(e.$$typeof){case A:return(e.displayName||`Context`)+`.Consumer`;case k:return(e._context.displayName||`Context`)+`.Provider`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case P:return t=e.displayName||null,t===null?ae(e.type)||`Memo`:t;case F:t=e._payload,e=e._init;try{return ae(e(t))}catch{}}return null}function oe(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`:`ForwardRef(`+e+`)`);case 7:return`Fragment`;case 5:return t;case 4:return`Portal`;case 3:return`Root`;case 6:return`Text`;case 16:return ae(t);case 8:return t===D?`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 se(e){switch(typeof e){case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function B(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function ce(e){var t=B(e)?`checked`:`value`,n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=``+e[t];if(!e.hasOwnProperty(t)&&n!==void 0&&typeof n.get==`function`&&typeof n.set==`function`){var i=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){r=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function le(e){e._valueTracker||=ce(e)}function ue(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=B(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function de(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function fe(e,t){var n=t.checked;return R({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function pe(e,t){var n=t.defaultValue==null?``:t.defaultValue,r=t.checked==null?t.defaultChecked:t.checked;n=se(t.value==null?n:t.value),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type===`checkbox`||t.type===`radio`?t.checked!=null:t.value!=null}}function me(e,t){t=t.checked,t!=null&&S(e,`checked`,t,!1)}function he(e,t){me(e,t);var n=se(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`)?_e(e,t.type,n):t.hasOwnProperty(`defaultValue`)&&_e(e,t.type,se(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ge(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 _e(e,t,n){(t!==`number`||de(e.ownerDocument)!==e)&&(n==null?e.defaultValue=``+e._wrapperState.initialValue:e.defaultValue!==``+n&&(e.defaultValue=``+n))}var ve=Array.isArray;function ye(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+se(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function be(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(i(91));return R({},t,{value:void 0,defaultValue:void 0,children:``+e._wrapperState.initialValue})}function xe(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(i(92));if(ve(n)){if(1<n.length)throw Error(i(93));n=n[0]}t=n}t??=``,n=t}e._wrapperState={initialValue:se(n)}}function Se(e,t){var n=se(t.value),r=se(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 Ce(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==``&&t!==null&&(e.value=t)}function we(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 Te(e,t){return e==null||e===`http://www.w3.org/1999/xhtml`?we(t):e===`http://www.w3.org/2000/svg`&&t===`foreignObject`?`http://www.w3.org/1999/xhtml`:e}var Ee,De=function(e){return typeof MSApp<`u`&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!==`http://www.w3.org/2000/svg`||`innerHTML`in e)e.innerHTML=t;else{for(Ee||=document.createElement(`div`),Ee.innerHTML=`<svg>`+t.valueOf().toString()+`</svg>`,t=Ee.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Oe(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ke={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},Ae=[`Webkit`,`ms`,`Moz`,`O`];Object.keys(ke).forEach(function(e){Ae.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ke[t]=ke[e]})});function je(e,t,n){return t==null||typeof t==`boolean`||t===``?``:n||typeof t!=`number`||t===0||ke.hasOwnProperty(e)&&ke[e]?(``+t).trim():t+`px`}function Me(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=n.indexOf(`--`)===0,i=je(n,t[n],r);n===`float`&&(n=`cssFloat`),r?e.setProperty(n,i):e[n]=i}}var Ne=R({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 Pe(e,t){if(t){if(Ne[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(i(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(i(60));if(typeof t.dangerouslySetInnerHTML!=`object`||!(`__html`in t.dangerouslySetInnerHTML))throw Error(i(61))}if(t.style!=null&&typeof t.style!=`object`)throw Error(i(62))}}function Fe(e,t){if(e.indexOf(`-`)===-1)return typeof t.is==`string`;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 Ie=null;function Le(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Re=null,ze=null,Be=null;function Ve(e){if(e=Vi(e)){if(typeof Re!=`function`)throw Error(i(280));var t=e.stateNode;t&&(t=H(t),Re(e.stateNode,e.type,t))}}function He(e){ze?Be?Be.push(e):Be=[e]:ze=e}function Ue(){if(ze){var e=ze,t=Be;if(Be=ze=null,Ve(e),t)for(e=0;e<t.length;e++)Ve(t[e])}}function We(e,t){return e(t)}function Ge(){}var Ke=!1;function qe(e,t,n){if(Ke)return e(t,n);Ke=!0;try{return We(e,t,n)}finally{Ke=!1,(ze!==null||Be!==null)&&(Ge(),Ue())}}function Je(e,t){var n=e.stateNode;if(n===null)return null;var r=H(n);if(r===null)return null;n=r[t];a: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 a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Ye=!1;if(u)try{var Xe={};Object.defineProperty(Xe,`passive`,{get:function(){Ye=!0}}),window.addEventListener(`test`,Xe,Xe),window.removeEventListener(`test`,Xe,Xe)}catch{Ye=!1}function Ze(e,t,n,r,i,a,o,s,c){var l=Array.prototype.slice.call(arguments,3);try{t.apply(n,l)}catch(e){this.onError(e)}}var Qe=!1,$e=null,et=!1,tt=null,nt={onError:function(e){Qe=!0,$e=e}};function rt(e,t,n,r,i,a,o,s,c){Qe=!1,$e=null,Ze.apply(nt,arguments)}function it(e,t,n,r,a,o,s,c,l){if(rt.apply(this,arguments),Qe){if(Qe){var u=$e;Qe=!1,$e=null}else throw Error(i(198));et||(et=!0,tt=u)}}function at(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 ot(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 st(e){if(at(e)!==e)throw Error(i(188))}function ct(e){var t=e.alternate;if(!t){if(t=at(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return st(a),e;if(o===r)return st(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var s=!1,c=a.child;c;){if(c===n){s=!0,n=a,r=o;break}if(c===r){s=!0,r=a,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=a;break}if(c===r){s=!0,r=o,n=a;break}c=c.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function lt(e){return e=ct(e),e===null?null:ut(e)}function ut(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ut(e);if(t!==null)return t;e=e.sibling}return null}var dt=r.unstable_scheduleCallback,ft=r.unstable_cancelCallback,pt=r.unstable_shouldYield,mt=r.unstable_requestPaint,ht=r.unstable_now,gt=r.unstable_getCurrentPriorityLevel,_t=r.unstable_ImmediatePriority,vt=r.unstable_UserBlockingPriority,yt=r.unstable_NormalPriority,bt=r.unstable_LowPriority,xt=r.unstable_IdlePriority,St=null,Ct=null;function wt(e){if(Ct&&typeof Ct.onCommitFiberRoot==`function`)try{Ct.onCommitFiberRoot(St,e,void 0,(e.current.flags&128)==128)}catch{}}var Tt=Math.clz32?Math.clz32:Ot,Et=Math.log,Dt=Math.LN2;function Ot(e){return e>>>=0,e===0?32:31-(Et(e)/Dt|0)|0}var kt=64,At=4194304;function jt(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 Mt(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var s=o&~i;s===0?(a&=o,a!==0&&(r=jt(a))):r=jt(s)}else o=n&~i,o===0?a!==0&&(r=jt(a)):r=jt(o);if(r===0)return 0;if(t!==0&&t!==r&&(t&i)===0&&(i=r&-r,a=t&-t,i>=a||i===16&&a&4194240))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Tt(t),i=1<<n,r|=e[n],t&=~i;return r}function Nt(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 Pt(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes;0<a;){var o=31-Tt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Nt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}}function Ft(e){return e=e.pendingLanes&-1073741825,e===0?e&1073741824?1073741824:0:e}function It(){var e=kt;return kt<<=1,!(kt&4194240)&&(kt=64),e}function Lt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Rt(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Tt(t),e[t]=n}function zt(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 i=31-Tt(n),a=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~a}}function V(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Tt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var Bt=0;function Vt(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ht,Ut,Wt,Gt,Kt,qt=!1,Jt=[],Yt=null,Xt=null,Zt=null,Qt=new Map,$t=new Map,en=[],tn=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit`.split(` `);function nn(e,t){switch(e){case`focusin`:case`focusout`:Yt=null;break;case`dragenter`:case`dragleave`:Xt=null;break;case`mouseover`:case`mouseout`:Zt=null;break;case`pointerover`:case`pointerout`:Qt.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:$t.delete(t.pointerId)}}function rn(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Vi(t),t!==null&&Ut(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function an(e,t,n,r,i){switch(t){case`focusin`:return Yt=rn(Yt,e,t,n,r,i),!0;case`dragenter`:return Xt=rn(Xt,e,t,n,r,i),!0;case`mouseover`:return Zt=rn(Zt,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Qt.set(a,rn(Qt.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,$t.set(a,rn($t.get(a)||null,e,t,n,r,i)),!0}return!1}function on(e){var t=Bi(e.target);if(t!==null){var n=at(t);if(n!==null){if(t=n.tag,t===13){if(t=ot(n),t!==null){e.blockedOn=t,Kt(e.priority,function(){Wt(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 sn(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vn(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ie=r,n.target.dispatchEvent(r),Ie=null}else return t=Vi(n),t!==null&&Ut(t),e.blockedOn=n,!1;t.shift()}return!0}function cn(e,t,n){sn(e)&&n.delete(t)}function ln(){qt=!1,Yt!==null&&sn(Yt)&&(Yt=null),Xt!==null&&sn(Xt)&&(Xt=null),Zt!==null&&sn(Zt)&&(Zt=null),Qt.forEach(cn),$t.forEach(cn)}function un(e,t){e.blockedOn===t&&(e.blockedOn=null,qt||(qt=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,ln)))}function dn(e){function t(t){return un(t,e)}if(0<Jt.length){un(Jt[0],e);for(var n=1;n<Jt.length;n++){var r=Jt[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Yt!==null&&un(Yt,e),Xt!==null&&un(Xt,e),Zt!==null&&un(Zt,e),Qt.forEach(t),$t.forEach(t),n=0;n<en.length;n++)r=en[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<en.length&&(n=en[0],n.blockedOn===null);)on(n),n.blockedOn===null&&en.shift()}var fn=C.ReactCurrentBatchConfig,pn=!0;function mn(e,t,n,r){var i=Bt,a=fn.transition;fn.transition=null;try{Bt=1,gn(e,t,n,r)}finally{Bt=i,fn.transition=a}}function hn(e,t,n,r){var i=Bt,a=fn.transition;fn.transition=null;try{Bt=4,gn(e,t,n,r)}finally{Bt=i,fn.transition=a}}function gn(e,t,n,r){if(pn){var i=vn(e,t,n,r);if(i===null)fi(e,t,r,_n,n),nn(e,r);else if(an(i,e,t,n,r))r.stopPropagation();else if(nn(e,r),t&4&&-1<tn.indexOf(e)){for(;i!==null;){var a=Vi(i);if(a!==null&&Ht(a),a=vn(e,t,n,r),a===null&&fi(e,t,r,_n,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else fi(e,t,r,null,n)}}var _n=null;function vn(e,t,n,r){if(_n=null,e=Le(r),e=Bi(e),e!==null)if(t=at(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ot(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 _n=e,null}function yn(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(gt()){case _t:return 1;case vt:return 4;case yt:case bt:return 16;case xt:return 536870912;default:return 16}default:return 16}}var bn=null,xn=null,Sn=null;function Cn(){if(Sn)return Sn;var e,t=xn,n=t.length,r,i=`value`in bn?bn.value:bn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Sn=i.slice(e,1<r?1-r:void 0)}function wn(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 Tn(){return!0}function En(){return!1}function Dn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Tn:En,this.isPropagationStopped=En,this}return R(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Tn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Tn)},persist:function(){},isPersistent:Tn}),t}var On={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kn=Dn(On),An=R({},On,{view:0,detail:0}),jn=Dn(An),Mn,Nn,Pn,Fn=R({},An,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Kn,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!==Pn&&(Pn&&e.type===`mousemove`?(Mn=e.screenX-Pn.screenX,Nn=e.screenY-Pn.screenY):Nn=Mn=0,Pn=e),Mn)},movementY:function(e){return`movementY`in e?e.movementY:Nn}}),In=Dn(Fn),Ln=Dn(R({},Fn,{dataTransfer:0})),Rn=Dn(R({},An,{relatedTarget:0})),zn=Dn(R({},On,{animationName:0,elapsedTime:0,pseudoElement:0})),Bn=Dn(R({},On,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Vn=Dn(R({},On,{data:0})),Hn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Un={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`},Wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Gn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Wn[e])?!!t[e]:!1}function Kn(){return Gn}var qn=Dn(R({},An,{key:function(e){if(e.key){var t=Hn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=wn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Un[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Kn,charCode:function(e){return e.type===`keypress`?wn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?wn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Jn=Dn(R({},Fn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Yn=Dn(R({},An,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Kn})),Xn=Dn(R({},On,{propertyName:0,elapsedTime:0,pseudoElement:0})),Zn=Dn(R({},Fn,{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})),Qn=[9,13,27,32],$n=u&&`CompositionEvent`in window,er=null;u&&`documentMode`in document&&(er=document.documentMode);var tr=u&&`TextEvent`in window&&!er,nr=u&&(!$n||er&&8<er&&11>=er),rr=` `,ir=!1;function ar(e,t){switch(e){case`keyup`:return Qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ir=!0,rr):null;case`textInput`:return e=t.data,e===rr&&ir?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!$n&&ar(e,t)?(e=Cn(),Sn=xn=bn=null,sr=!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 nr&&t.locale!==`ko`?null:t.data;default:return null}}var ur={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 dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!ur[e.type]:t===`textarea`}function fr(e,t,n,r){He(r),t=mi(t,`onChange`),0<t.length&&(n=new kn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var pr=null,mr=null;function hr(e){oi(e,0)}function gr(e){if(ue(Hi(e)))return e}function _r(e,t){if(e===`change`)return t}var vr=!1;if(u){var yr;if(u){var br=`oninput`in document;if(!br){var xr=document.createElement(`div`);xr.setAttribute(`oninput`,`return;`),br=typeof xr.oninput==`function`}yr=br}else yr=!1;vr=yr&&(!document.documentMode||9<document.documentMode)}function Sr(){pr&&(pr.detachEvent(`onpropertychange`,Cr),mr=pr=null)}function Cr(e){if(e.propertyName===`value`&&gr(mr)){var t=[];fr(t,mr,e,Le(e)),qe(hr,t)}}function wr(e,t,n){e===`focusin`?(Sr(),pr=t,mr=n,pr.attachEvent(`onpropertychange`,Cr)):e===`focusout`&&Sr()}function Tr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return gr(mr)}function Er(e,t){if(e===`click`)return gr(t)}function Dr(e,t){if(e===`input`||e===`change`)return gr(t)}function Or(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var kr=typeof Object.is==`function`?Object.is:Or;function Ar(e,t){if(kr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)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 i=n[r];if(!d.call(t,i)||!kr(e[i],t[i]))return!1}return!0}function jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Mr(e,t){var n=jr(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}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(){for(var e=window,t=de();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=de(e.document)}return t}function Fr(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 Ir(e){var t=Pr(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Nr(n.ownerDocument.documentElement,n)){if(r!==null&&Fr(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 i=n.textContent.length,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=Mr(n,a);var o=Mr(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>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 Lr=u&&`documentMode`in document&&11>=document.documentMode,Rr=null,zr=null,Br=null,Vr=!1;function Hr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Vr||Rr==null||Rr!==de(r)||(r=Rr,`selectionStart`in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Br&&Ar(Br,r)||(Br=r,r=mi(zr,`onSelect`),0<r.length&&(t=new kn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Rr)))}function Ur(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Wr={animationend:Ur(`Animation`,`AnimationEnd`),animationiteration:Ur(`Animation`,`AnimationIteration`),animationstart:Ur(`Animation`,`AnimationStart`),transitionend:Ur(`Transition`,`TransitionEnd`)},Gr={},Kr={};u&&(Kr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Wr.animationend.animation,delete Wr.animationiteration.animation,delete Wr.animationstart.animation),`TransitionEvent`in window||delete Wr.transitionend.transition);function qr(e){if(Gr[e])return Gr[e];if(!Wr[e])return e;var t=Wr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Kr)return Gr[e]=t[n];return e}var Jr=qr(`animationend`),Yr=qr(`animationiteration`),Xr=qr(`animationstart`),Zr=qr(`transitionend`),Qr=new Map,$r=`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 ei(e,t){Qr.set(e,t),c(t,[e])}for(var ti=0;ti<$r.length;ti++){var ni=$r[ti];ei(ni.toLowerCase(),`on`+(ni[0].toUpperCase()+ni.slice(1)))}ei(Jr,`onAnimationEnd`),ei(Yr,`onAnimationIteration`),ei(Xr,`onAnimationStart`),ei(`dblclick`,`onDoubleClick`),ei(`focusin`,`onFocus`),ei(`focusout`,`onBlur`),ei(Zr,`onTransitionEnd`),l(`onMouseEnter`,[`mouseout`,`mouseover`]),l(`onMouseLeave`,[`mouseout`,`mouseover`]),l(`onPointerEnter`,[`pointerout`,`pointerover`]),l(`onPointerLeave`,[`pointerout`,`pointerover`]),c(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),c(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),c(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),c(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),c(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),c(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var ri=`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(` `),ii=new Set(`cancel close invalid load scroll toggle`.split(` `).concat(ri));function ai(e,t,n){var r=e.type||`unknown-event`;e.currentTarget=n,it(r,t,void 0,e),e.currentTarget=null}function oi(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;ai(i,s,l),a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;ai(i,s,l),a=c}}}if(et)throw e=tt,et=!1,tt=null,e}function si(e,t){var n=t[Li];n===void 0&&(n=t[Li]=new Set);var r=e+`__bubble`;n.has(r)||(di(t,e,2,!1),n.add(r))}function ci(e,t,n){var r=0;t&&(r|=4),di(n,e,r,t)}var li=`_reactListening`+Math.random().toString(36).slice(2);function ui(e){if(!e[li]){e[li]=!0,a.forEach(function(t){t!==`selectionchange`&&(ii.has(t)||ci(t,!1,e),ci(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[li]||(t[li]=!0,ci(`selectionchange`,!1,t))}}function di(e,t,n,r){switch(yn(t)){case 1:var i=mn;break;case 4:i=hn;break;default:i=gn}n=i.bind(null,t,n,e),i=void 0,!Ye||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function fi(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i||s.nodeType===8&&s.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;s!==null;){if(o=Bi(s),o===null)return;if(c=o.tag,c===5||c===6){r=a=o;continue a}s=s.parentNode}}r=r.return}qe(function(){var r=a,i=Le(n),o=[];a:{var s=Qr.get(e);if(s!==void 0){var c=kn,l=e;switch(e){case`keypress`:if(wn(n)===0)break a;case`keydown`:case`keyup`:c=qn;break;case`focusin`:l=`focus`,c=Rn;break;case`focusout`:l=`blur`,c=Rn;break;case`beforeblur`:case`afterblur`:c=Rn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=In;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=Ln;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Yn;break;case Jr:case Yr:case Xr:c=zn;break;case Zr:c=Xn;break;case`scroll`:c=jn;break;case`wheel`:c=Zn;break;case`copy`:case`cut`:case`paste`:c=Bn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Jn}var u=(t&4)!=0,d=!u&&e===`scroll`,f=u?s===null?null:s+`Capture`:s;u=[];for(var p=r,m;p!==null;){m=p;var h=m.stateNode;if(m.tag===5&&h!==null&&(m=h,f!==null&&(h=Je(p,f),h!=null&&u.push(pi(p,h,m)))),d)break;p=p.return}0<u.length&&(s=new c(s,l,null,n,i),o.push({event:s,listeners:u}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Ie&&(l=n.relatedTarget||n.fromElement)&&(Bi(l)||l[Ii]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Bi(l):null,l!==null&&(d=at(l),l!==d||l.tag!==5&&l.tag!==6)&&(l=null)):(c=null,l=r),c!==l)){if(u=In,h=`onMouseLeave`,f=`onMouseEnter`,p=`mouse`,(e===`pointerout`||e===`pointerover`)&&(u=Jn,h=`onPointerLeave`,f=`onPointerEnter`,p=`pointer`),d=c==null?s:Hi(c),m=l==null?s:Hi(l),s=new u(h,p+`leave`,c,n,i),s.target=d,s.relatedTarget=m,h=null,Bi(i)===r&&(u=new u(f,p+`enter`,l,n,i),u.target=m,u.relatedTarget=d,h=u),d=h,c&&l)b:{for(u=c,f=l,p=0,m=u;m;m=hi(m))p++;for(m=0,h=f;h;h=hi(h))m++;for(;0<p-m;)u=hi(u),p--;for(;0<m-p;)f=hi(f),m--;for(;p--;){if(u===f||f!==null&&u===f.alternate)break b;u=hi(u),f=hi(f)}u=null}else u=null;c!==null&&gi(o,s,c,u,!1),l!==null&&d!==null&&gi(o,d,l,u,!0)}}a:{if(s=r?Hi(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var g=_r;else if(dr(s))if(vr)g=Dr;else{g=Tr;var _=wr}else (c=s.nodeName)&&c.toLowerCase()===`input`&&(s.type===`checkbox`||s.type===`radio`)&&(g=Er);if(g&&=g(e,r)){fr(o,g,n,i);break a}_&&_(e,s,r),e===`focusout`&&(_=s._wrapperState)&&_.controlled&&s.type===`number`&&_e(s,`number`,s.value)}switch(_=r?Hi(r):window,e){case`focusin`:(dr(_)||_.contentEditable===`true`)&&(Rr=_,zr=r,Br=null);break;case`focusout`:Br=zr=Rr=null;break;case`mousedown`:Vr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Vr=!1,Hr(o,n,i);break;case`selectionchange`:if(Lr)break;case`keydown`:case`keyup`:Hr(o,n,i)}var v;if($n)b:{switch(e){case`compositionstart`:var y=`onCompositionStart`;break b;case`compositionend`:y=`onCompositionEnd`;break b;case`compositionupdate`:y=`onCompositionUpdate`;break b}y=void 0}else sr?ar(e,n)&&(y=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(y=`onCompositionStart`);y&&(nr&&n.locale!==`ko`&&(sr||y!==`onCompositionStart`?y===`onCompositionEnd`&&sr&&(v=Cn()):(bn=i,xn=`value`in bn?bn.value:bn.textContent,sr=!0)),_=mi(r,y),0<_.length&&(y=new Vn(y,e,null,n,i),o.push({event:y,listeners:_}),v?y.data=v:(v=or(n),v!==null&&(y.data=v)))),(v=tr?cr(e,n):lr(e,n))&&(r=mi(r,`onBeforeInput`),0<r.length&&(i=new Vn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:i,listeners:r}),i.data=v))}oi(o,t)})}function pi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mi(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;i.tag===5&&a!==null&&(i=a,a=Je(e,n),a!=null&&r.unshift(pi(e,a,i)),a=Je(e,t),a!=null&&r.push(pi(e,a,i))),e=e.return}return r}function hi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function gi(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(c!==null&&c===r)break;s.tag===5&&l!==null&&(s=l,i?(c=Je(n,a),c!=null&&o.unshift(pi(n,c,s))):i||(c=Je(n,a),c!=null&&o.push(pi(n,c,s)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var _i=/\r\n?/g,vi=/\u0000|\uFFFD/g;function yi(e){return(typeof e==`string`?e:``+e).replace(_i,`
7
+ `).replace(vi,``)}function bi(e,t,n){if(t=yi(t),yi(e)!==t&&n)throw Error(i(425))}function xi(){}var Si=null,Ci=null;function wi(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 Ti=typeof setTimeout==`function`?setTimeout:void 0,Ei=typeof clearTimeout==`function`?clearTimeout:void 0,Di=typeof Promise==`function`?Promise:void 0,Oi=typeof queueMicrotask==`function`?queueMicrotask:Di===void 0?Ti:function(e){return Di.resolve(null).then(e).catch(ki)};function ki(e){setTimeout(function(){throw e})}function Ai(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`){if(r===0){e.removeChild(i),dn(t);return}r--}else n!==`$`&&n!==`$?`&&n!==`$!`||r++;n=i}while(n);dn(t)}function ji(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 Mi(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 Ni=Math.random().toString(36).slice(2),Pi=`__reactFiber$`+Ni,Fi=`__reactProps$`+Ni,Ii=`__reactContainer$`+Ni,Li=`__reactEvents$`+Ni,Ri=`__reactListeners$`+Ni,zi=`__reactHandles$`+Ni;function Bi(e){var t=e[Pi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ii]||n[Pi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Mi(e);e!==null;){if(n=e[Pi])return n;e=Mi(e)}return t}e=n,n=e.parentNode}return null}function Vi(e){return e=e[Pi]||e[Ii],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Hi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(i(33))}function H(e){return e[Fi]||null}var Ui=[],Wi=-1;function Gi(e){return{current:e}}function Ki(e){0>Wi||(e.current=Ui[Wi],Ui[Wi]=null,Wi--)}function qi(e,t){Wi++,Ui[Wi]=e.current,e.current=t}var Ji={},Yi=Gi(Ji),Xi=Gi(!1),Zi=Ji;function Qi(e,t){var n=e.type.contextTypes;if(!n)return Ji;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function $i(e){return e=e.childContextTypes,e!=null}function ea(){Ki(Xi),Ki(Yi)}function ta(e,t,n){if(Yi.current!==Ji)throw Error(i(168));qi(Yi,t),qi(Xi,n)}function na(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!=`function`)return n;for(var a in r=r.getChildContext(),r)if(!(a in t))throw Error(i(108,oe(e)||`Unknown`,a));return R({},n,r)}function ra(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ji,Zi=Yi.current,qi(Yi,e),qi(Xi,Xi.current),!0}function ia(e,t,n){var r=e.stateNode;if(!r)throw Error(i(169));n?(e=na(e,t,Zi),r.__reactInternalMemoizedMergedChildContext=e,Ki(Xi),Ki(Yi),qi(Yi,e)):Ki(Xi),qi(Xi,n)}var aa=null,oa=!1,sa=!1;function ca(e){aa===null?aa=[e]:aa.push(e)}function la(e){oa=!0,ca(e)}function ua(){if(!sa&&aa!==null){sa=!0;var e=0,t=Bt;try{var n=aa;for(Bt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}aa=null,oa=!1}catch(t){throw aa!==null&&(aa=aa.slice(e+1)),dt(_t,ua),t}finally{Bt=t,sa=!1}}return null}var da=[],fa=0,pa=null,ma=0,ha=[],ga=0,_a=null,va=1,ya=``;function ba(e,t){da[fa++]=ma,da[fa++]=pa,pa=e,ma=t}function xa(e,t,n){ha[ga++]=va,ha[ga++]=ya,ha[ga++]=_a,_a=e;var r=va;e=ya;var i=32-Tt(r)-1;r&=~(1<<i),n+=1;var a=32-Tt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,va=1<<32-Tt(t)+i|n<<i|r,ya=a+e}else va=1<<a|n<<i|r,ya=e}function Sa(e){e.return!==null&&(ba(e,1),xa(e,1,0))}function Ca(e){for(;e===pa;)pa=da[--fa],da[fa]=null,ma=da[--fa],da[fa]=null;for(;e===_a;)_a=ha[--ga],ha[ga]=null,ya=ha[--ga],ha[ga]=null,va=ha[--ga],ha[ga]=null}var wa=null,Ta=null,Ea=!1,Da=null;function Oa(e,t){var n=nu(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 ka(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?!1:(e.stateNode=t,wa=e,Ta=ji(t.firstChild),!0);case 6:return t=e.pendingProps===``||t.nodeType!==3?null:t,t===null?!1:(e.stateNode=t,wa=e,Ta=null,!0);case 13:return t=t.nodeType===8?t:null,t===null?!1:(n=_a===null?null:{id:va,overflow:ya},e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=nu(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,wa=e,Ta=null,!0);default:return!1}}function Aa(e){return(e.mode&1)!=0&&(e.flags&128)==0}function ja(e){if(Ea){var t=Ta;if(t){var n=t;if(!ka(e,t)){if(Aa(e))throw Error(i(418));t=ji(n.nextSibling);var r=wa;t&&ka(e,t)?Oa(r,n):(e.flags=e.flags&-4097|2,Ea=!1,wa=e)}}else{if(Aa(e))throw Error(i(418));e.flags=e.flags&-4097|2,Ea=!1,wa=e}}}function Ma(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;wa=e}function Na(e){if(e!==wa)return!1;if(!Ea)return Ma(e),Ea=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!==`head`&&t!==`body`&&!wi(e.type,e.memoizedProps)),t&&=Ta){if(Aa(e))throw Pa(),Error(i(418));for(;t;)Oa(e,t),t=ji(t.nextSibling)}if(Ma(e),e.tag===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));a:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`){if(t===0){Ta=ji(e.nextSibling);break a}t--}else n!==`$`&&n!==`$!`&&n!==`$?`||t++}e=e.nextSibling}Ta=null}}else Ta=wa?ji(e.stateNode.nextSibling):null;return!0}function Pa(){for(var e=Ta;e;)e=ji(e.nextSibling)}function Fa(){Ta=wa=null,Ea=!1}function Ia(e){Da===null?Da=[e]:Da.push(e)}var La=C.ReactCurrentBatchConfig;function Ra(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(i(309));var r=n.stateNode}if(!r)throw Error(i(147,e));var a=r,o=``+e;return t!==null&&t.ref!==null&&typeof t.ref==`function`&&t.ref._stringRef===o?t.ref:(t=function(e){var t=a.refs;e===null?delete t[o]:t[o]=e},t._stringRef=o,t)}if(typeof e!=`string`)throw Error(i(284));if(!n._owner)throw Error(i(290,e))}return e}function za(e,t){throw e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e))}function Ba(e){var t=e._init;return t(e._payload)}function Va(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e,t){for(e=new Map;t!==null;)t.key===null?e.set(t.index,t):e.set(t.key,t),t=t.sibling;return e}function a(e,t){return e=au(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=2,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=2),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=lu(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===E?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===F&&Ba(i)===t.type)?(r=a(t,n.props),r.ref=Ra(e,t,n),r.return=e,r):(r=ou(n.type,n.key,n.props,null,e.mode,r),r.ref=Ra(e,t,n),r.return=e,r)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=uu(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=su(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`)return t=lu(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case w:return n=ou(t.type,t.key,t.props,null,e.mode,n),n.ref=Ra(e,null,t),n.return=e,n;case T:return t=uu(t,e.mode,n),t.return=e,t;case F:var r=t._init;return f(e,r(t._payload),n)}if(ve(t)||L(t))return t=su(t,e.mode,n,null),t.return=e,t;za(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case w:return n.key===i?l(e,t,n,r):null;case T:return n.key===i?u(e,t,n,r):null;case F:return i=n._init,p(e,t,i(n._payload),r)}if(ve(n)||L(n))return i===null?d(e,t,n,r,null):null;za(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case w:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case T:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case F:var a=r._init;return m(e,t,n,a(r._payload),i)}if(ve(r)||L(r))return e=e.get(n)||null,d(t,e,r,i,null);za(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ea&&ba(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ea&&ba(i,h),l}for(d=r(i,d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ea&&ba(i,h),l}function g(a,s,c,l){var u=L(c);if(typeof u!=`function`)throw Error(i(150));if(c=u.call(c),c==null)throw Error(i(151));for(var d=u=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ea&&ba(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ea&&ba(a,g),u}for(h=r(a,h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ea&&ba(a,g),u}function _(e,r,i,o){if(typeof i==`object`&&i&&i.type===E&&i.key===null&&(i=i.props.children),typeof i==`object`&&i){switch(i.$$typeof){case w:a:{for(var c=i.key,l=r;l!==null;){if(l.key===c){if(c=i.type,c===E){if(l.tag===7){n(e,l.sibling),r=a(l,i.props.children),r.return=e,e=r;break a}}else if(l.elementType===c||typeof c==`object`&&c&&c.$$typeof===F&&Ba(c)===l.type){n(e,l.sibling),r=a(l,i.props),r.ref=Ra(e,l,i),r.return=e,e=r;break a}n(e,l);break}else t(e,l);l=l.sibling}i.type===E?(r=su(i.props.children,e.mode,o,i.key),r.return=e,e=r):(o=ou(i.type,i.key,i.props,null,e.mode,o),o.ref=Ra(e,r,i),o.return=e,e=o)}return s(e);case T:a:{for(l=i.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===i.containerInfo&&r.stateNode.implementation===i.implementation){n(e,r.sibling),r=a(r,i.children||[]),r.return=e,e=r;break a}else{n(e,r);break}else t(e,r);r=r.sibling}r=uu(i,e.mode,o),r.return=e,e=r}return s(e);case F:return l=i._init,_(e,r,l(i._payload),o)}if(ve(i))return h(e,r,i,o);if(L(i))return g(e,r,i,o);za(e,i)}return typeof i==`string`&&i!==``||typeof i==`number`?(i=``+i,r!==null&&r.tag===6?(n(e,r.sibling),r=a(r,i),r.return=e,e=r):(n(e,r),r=lu(i,e.mode,o),r.return=e,e=r),s(e)):n(e,r)}return _}var Ha=Va(!0),Ua=Va(!1),Wa=Gi(null),Ga=null,Ka=null,qa=null;function Ja(){qa=Ka=Ga=null}function Ya(e){var t=Wa.current;Ki(Wa),e._currentValue=t}function Xa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Za(e,t){Ga=e,qa=Ka=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(Vs=!0),e.firstContext=null)}function Qa(e){var t=e._currentValue;if(qa!==e)if(e={context:e,memoizedValue:t,next:null},Ka===null){if(Ga===null)throw Error(i(308));Ka=e,Ga.dependencies={lanes:0,firstContext:e}}else Ka=Ka.next=e;return t}var $a=null;function eo(e){$a===null?$a=[e]:$a.push(e)}function to(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,eo(t)):(n.next=i.next,i.next=n),t.interleaved=n,no(e,r)}function no(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 ro=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ao(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 oo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function so(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Xc&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,no(e,n)}return i=r.interleaved,i===null?(t.next=t,eo(r)):(t.next=i.next,i.next=t),r.interleaved=t,no(e,n)}function co(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194240)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,V(e,n)}}function lo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=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};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,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 uo(e,t,n,r){var i=e.updateQueue;ro=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane,p=s.eventTime;if((r&f)===f){u!==null&&(u=u.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});a:{var m=e,h=s;switch(f=t,p=n,h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(p,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(p,d,f):m,f==null)break a;d=R({},d,f);break a;case 2:ro=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;f=s,s=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(1);if(u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);il|=o,e.lanes=o,e.memoizedState=d}}function fo(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(i(191,a));a.call(r)}}}var po={},mo=Gi(po),ho=Gi(po),go=Gi(po);function _o(e){if(e===po)throw Error(i(174));return e}function vo(e,t){switch(qi(go,t),qi(ho,e),qi(mo,po),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Te(null,``);break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Te(t,e)}Ki(mo),qi(mo,t)}function yo(){Ki(mo),Ki(ho),Ki(go)}function bo(e){_o(go.current);var t=_o(mo.current),n=Te(t,e.type);t!==n&&(qi(ho,e),qi(mo,n))}function xo(e){ho.current===e&&(Ki(mo),Ki(ho))}var So=Gi(0);function Co(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 wo=[];function To(){for(var e=0;e<wo.length;e++)wo[e]._workInProgressVersionPrimary=null;wo.length=0}var Eo=C.ReactCurrentDispatcher,Do=C.ReactCurrentBatchConfig,Oo=0,ko=null,Ao=null,jo=null,Mo=!1,No=!1,Po=0,Fo=0;function Io(){throw Error(i(321))}function Lo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!kr(e[n],t[n]))return!1;return!0}function Ro(e,t,n,r,a,o){if(Oo=o,ko=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Eo.current=e===null||e.memoizedState===null?xs:Ss,e=n(r,a),No){o=0;do{if(No=!1,Po=0,25<=o)throw Error(i(301));o+=1,jo=Ao=null,t.updateQueue=null,Eo.current=Cs,e=n(r,a)}while(No)}if(Eo.current=bs,t=Ao!==null&&Ao.next!==null,Oo=0,jo=Ao=ko=null,Mo=!1,t)throw Error(i(300));return e}function zo(){var e=Po!==0;return Po=0,e}function Bo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jo===null?ko.memoizedState=jo=e:jo=jo.next=e,jo}function Vo(){if(Ao===null){var e=ko.alternate;e=e===null?null:e.memoizedState}else e=Ao.next;var t=jo===null?ko.memoizedState:jo.next;if(t!==null)jo=t,Ao=e;else{if(e===null)throw Error(i(310));Ao=e,e={memoizedState:Ao.memoizedState,baseState:Ao.baseState,baseQueue:Ao.baseQueue,queue:Ao.queue,next:null},jo===null?ko.memoizedState=jo=e:jo=jo.next=e}return jo}function Ho(e,t){return typeof t==`function`?t(e):t}function Uo(e){var t=Vo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=Ao,a=r.baseQueue,o=n.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}r.baseQueue=a=o,n.pending=null}if(a!==null){o=a.next,r=r.baseState;var c=s=null,l=null,u=o;do{var d=u.lane;if((Oo&d)===d)l!==null&&(l=l.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};l===null?(c=l=f,s=r):l=l.next=f,ko.lanes|=d,il|=d}u=u.next}while(u!==null&&u!==o);l===null?s=r:l.next=c,kr(r,t.memoizedState)||(Vs=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do o=a.lane,ko.lanes|=o,il|=o,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Wo(e){var t=Vo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);kr(o,t.memoizedState)||(Vs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Go(){}function Ko(e,t){var n=ko,r=Vo(),a=t(),o=!kr(r.memoizedState,a);if(o&&(r.memoizedState=a,Vs=!0),r=r.queue,is(Yo.bind(null,n,r,e),[e]),r.getSnapshot!==t||o||jo!==null&&jo.memoizedState.tag&1){if(n.flags|=2048,$o(9,Jo.bind(null,n,r,a,t),void 0,null),Zc===null)throw Error(i(349));Oo&30||qo(n,t,a)}return a}function qo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ko.updateQueue,t===null?(t={lastEffect:null,stores:null},ko.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jo(e,t,n,r){t.value=n,t.getSnapshot=r,Xo(t)&&Zo(e)}function Yo(e,t,n){return n(function(){Xo(t)&&Zo(e)})}function Xo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!kr(e,n)}catch{return!0}}function Zo(e){var t=no(e,1);t!==null&&wl(t,e,1,-1)}function Qo(e){var t=Bo();return typeof e==`function`&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ho,lastRenderedState:e},t.queue=e,e=e.dispatch=gs.bind(null,ko,e),[t.memoizedState,e]}function $o(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ko.updateQueue,t===null?(t={lastEffect:null,stores:null},ko.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 es(){return Vo().memoizedState}function ts(e,t,n,r){var i=Bo();ko.flags|=e,i.memoizedState=$o(1|t,n,void 0,r===void 0?null:r)}function ns(e,t,n,r){var i=Vo();r=r===void 0?null:r;var a=void 0;if(Ao!==null){var o=Ao.memoizedState;if(a=o.destroy,r!==null&&Lo(r,o.deps)){i.memoizedState=$o(t,n,a,r);return}}ko.flags|=e,i.memoizedState=$o(1|t,n,a,r)}function rs(e,t){return ts(8390656,8,e,t)}function is(e,t){return ns(2048,8,e,t)}function as(e,t){return ns(4,2,e,t)}function os(e,t){return ns(4,4,e,t)}function ss(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 cs(e,t,n){return n=n==null?null:n.concat([e]),ns(4,4,ss.bind(null,t,e),n)}function ls(){}function us(e,t){var n=Vo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ds(e,t){var n=Vo();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lo(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function fs(e,t,n){return Oo&21?(kr(n,t)||(n=It(),ko.lanes|=n,il|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Vs=!0),e.memoizedState=n)}function ps(e,t){var n=Bt;Bt=n!==0&&4>n?n:4,e(!0);var r=Do.transition;Do.transition={};try{e(!1),t()}finally{Bt=n,Do.transition=r}}function ms(){return Vo().memoizedState}function hs(e,t,n){var r=Cl(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},_s(e))vs(t,n);else if(n=to(e,t,n,r),n!==null){var i=Sl();wl(n,e,r,i),ys(n,t,r)}}function gs(e,t,n){var r=Cl(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(_s(e))vs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,kr(s,o)){var c=t.interleaved;c===null?(i.next=i,eo(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}n=to(e,t,i,r),n!==null&&(i=Sl(),wl(n,e,r,i),ys(n,t,r))}}function _s(e){var t=e.alternate;return e===ko||t!==null&&t===ko}function vs(e,t){No=Mo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ys(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,V(e,n)}}var bs={readContext:Qa,useCallback:Io,useContext:Io,useEffect:Io,useImperativeHandle:Io,useInsertionEffect:Io,useLayoutEffect:Io,useMemo:Io,useReducer:Io,useRef:Io,useState:Io,useDebugValue:Io,useDeferredValue:Io,useTransition:Io,useMutableSource:Io,useSyncExternalStore:Io,useId:Io,unstable_isNewReconciler:!1},xs={readContext:Qa,useCallback:function(e,t){return Bo().memoizedState=[e,t===void 0?null:t],e},useContext:Qa,useEffect:rs,useImperativeHandle:function(e,t,n){return n=n==null?null:n.concat([e]),ts(4194308,4,ss.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ts(4194308,4,e,t)},useInsertionEffect:function(e,t){return ts(4,2,e,t)},useMemo:function(e,t){var n=Bo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Bo();return t=n===void 0?t:n(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=hs.bind(null,ko,e),[r.memoizedState,e]},useRef:function(e){var t=Bo();return e={current:e},t.memoizedState=e},useState:Qo,useDebugValue:ls,useDeferredValue:function(e){return Bo().memoizedState=e},useTransition:function(){var e=Qo(!1),t=e[0];return e=ps.bind(null,e[1]),Bo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ko,a=Bo();if(Ea){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Zc===null)throw Error(i(349));Oo&30||qo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,rs(Yo.bind(null,r,o,e),[e]),r.flags|=2048,$o(9,Jo.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Bo(),t=Zc.identifierPrefix;if(Ea){var n=ya,r=va;n=(r&~(1<<32-Tt(r)-1)).toString(32)+n,t=`:`+t+`R`+n,n=Po++,0<n&&(t+=`H`+n.toString(32)),t+=`:`}else n=Fo++,t=`:`+t+`r`+n.toString(32)+`:`;return e.memoizedState=t},unstable_isNewReconciler:!1},Ss={readContext:Qa,useCallback:us,useContext:Qa,useEffect:is,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Uo,useRef:es,useState:function(){return Uo(Ho)},useDebugValue:ls,useDeferredValue:function(e){return fs(Vo(),Ao.memoizedState,e)},useTransition:function(){return[Uo(Ho)[0],Vo().memoizedState]},useMutableSource:Go,useSyncExternalStore:Ko,useId:ms,unstable_isNewReconciler:!1},Cs={readContext:Qa,useCallback:us,useContext:Qa,useEffect:is,useImperativeHandle:cs,useInsertionEffect:as,useLayoutEffect:os,useMemo:ds,useReducer:Wo,useRef:es,useState:function(){return Wo(Ho)},useDebugValue:ls,useDeferredValue:function(e){var t=Vo();return Ao===null?t.memoizedState=e:fs(t,Ao.memoizedState,e)},useTransition:function(){return[Wo(Ho)[0],Vo().memoizedState]},useMutableSource:Go,useSyncExternalStore:Ko,useId:ms,unstable_isNewReconciler:!1};function ws(e,t){if(e&&e.defaultProps){for(var n in t=R({},t),e=e.defaultProps,e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ts(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:R({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Es={isMounted:function(e){return(e=e._reactInternals)?at(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=oo(r,i);a.payload=t,n!=null&&(a.callback=n),t=so(e,a,i),t!==null&&(wl(t,e,i,r),co(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Sl(),i=Cl(e),a=oo(r,i);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=so(e,a,i),t!==null&&(wl(t,e,i,r),co(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Sl(),r=Cl(e),i=oo(n,r);i.tag=2,t!=null&&(i.callback=t),t=so(e,i,r),t!==null&&(wl(t,e,r,n),co(t,e,r))}};function Ds(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ar(n,r)||!Ar(i,a):!0}function Os(e,t,n){var r=!1,i=Ji,a=t.contextType;return typeof a==`object`&&a?a=Qa(a):(i=$i(t)?Zi:Yi.current,r=t.contextTypes,a=(r=r!=null)?Qi(e,i):Ji),t=new t(n,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Es,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=a),t}function ks(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&&Es.enqueueReplaceState(t,t.state,null)}function As(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},io(e);var a=t.contextType;typeof a==`object`&&a?i.context=Qa(a):(a=$i(t)?Zi:Yi.current,i.context=Qi(e,a)),i.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a==`function`&&(Ts(e,t,a,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps==`function`||typeof i.getSnapshotBeforeUpdate==`function`||typeof i.UNSAFE_componentWillMount!=`function`&&typeof i.componentWillMount!=`function`||(t=i.state,typeof i.componentWillMount==`function`&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount==`function`&&i.UNSAFE_componentWillMount(),t!==i.state&&Es.enqueueReplaceState(i,i.state,null),uo(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount==`function`&&(e.flags|=4194308)}function js(e,t){try{var n=``,r=t;do n+=ie(r),r=r.return;while(r);var i=n}catch(e){i=`
8
+ Error generating stack: `+e.message+`
9
+ `+e.stack}return{value:e,source:t,stack:i,digest:null}}function Ms(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ns(e,t){try{console.error(t.value)}catch(e){setTimeout(function(){throw e})}}var Ps=typeof WeakMap==`function`?WeakMap:Map;function Fs(e,t,n){n=oo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){fl||(fl=!0,pl=r),Ns(e,t)},n}function Is(e,t,n){n=oo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r==`function`){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){Ns(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch==`function`&&(n.callback=function(){Ns(e,t),typeof r!=`function`&&(ml===null?ml=new Set([this]):ml.add(this));var n=t.stack;this.componentDidCatch(t.value,{componentStack:n===null?``:n})}),n}function Ls(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Ps;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=Yl.bind(null,e,t,n),t.then(e,e))}function Rs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t===null?!0:t.dehydrated!==null),t)return e;e=e.return}while(e!==null);return null}function zs(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,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=oo(-1,1),t.tag=2,so(n,t,1))),n.lanes|=1),e)}var Bs=C.ReactCurrentOwner,Vs=!1;function Hs(e,t,n,r){t.child=e===null?Ua(t,null,n,r):Ha(t,e.child,n,r)}function Us(e,t,n,r,i){n=n.render;var a=t.ref;return Za(t,i),r=Ro(e,t,n,r,a,i),n=zo(),e!==null&&!Vs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,lc(e,t,i)):(Ea&&n&&Sa(t),t.flags|=1,Hs(e,t,r,i),t.child)}function Ws(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ru(a)&&a.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=a,Gs(e,t,a,r,i)):(e=ou(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,(e.lanes&i)===0){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ar:n,n(o,r)&&e.ref===t.ref)return lc(e,t,i)}return t.flags|=1,e=au(a,r),e.ref=t.ref,e.return=t,t.child=e}function Gs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ar(a,r)&&e.ref===t.ref)if(Vs=!1,t.pendingProps=r=a,(e.lanes&i)!==0)e.flags&131072&&(Vs=!0);else return t.lanes=e.lanes,lc(e,t,i)}return Js(e,t,n,r,i)}function Ks(e,t,n){var r=t.pendingProps,i=r.children,a=e===null?null:e.memoizedState;if(r.mode===`hidden`)if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},qi(tl,el),el|=n;else{if(!(n&1073741824))return e=a===null?n:a.baseLanes|n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,qi(tl,el),el|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=a===null?n:a.baseLanes,qi(tl,el),el|=r}else a===null?r=n:(r=a.baseLanes|n,t.memoizedState=null),qi(tl,el),el|=r;return Hs(e,t,i,n),t.child}function qs(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Js(e,t,n,r,i){var a=$i(n)?Zi:Yi.current;return a=Qi(t,a),Za(t,i),n=Ro(e,t,n,r,a,i),r=zo(),e!==null&&!Vs?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,lc(e,t,i)):(Ea&&r&&Sa(t),t.flags|=1,Hs(e,t,n,i),t.child)}function Ys(e,t,n,r,i){if($i(n)){var a=!0;ra(t)}else a=!1;if(Za(t,i),t.stateNode===null)cc(e,t),Os(t,n,r),As(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var c=o.context,l=n.contextType;typeof l==`object`&&l?l=Qa(l):(l=$i(n)?Zi:Yi.current,l=Qi(t,l));var u=n.getDerivedStateFromProps,d=typeof u==`function`||typeof o.getSnapshotBeforeUpdate==`function`;d||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==r||c!==l)&&ks(t,o,r,l),ro=!1;var f=t.memoizedState;o.state=f,uo(t,r,o,i),c=t.memoizedState,s!==r||f!==c||Xi.current||ro?(typeof u==`function`&&(Ts(t,n,u,r),c=t.memoizedState),(s=ro||Ds(t,n,s,r,f,c,l))?(d||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=l,r=s):(typeof o.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ao(e,t),s=t.memoizedProps,l=t.type===t.elementType?s:ws(t.type,s),o.props=l,d=t.pendingProps,f=o.context,c=n.contextType,typeof c==`object`&&c?c=Qa(c):(c=$i(n)?Zi:Yi.current,c=Qi(t,c));var p=n.getDerivedStateFromProps;(u=typeof p==`function`||typeof o.getSnapshotBeforeUpdate==`function`)||typeof o.UNSAFE_componentWillReceiveProps!=`function`&&typeof o.componentWillReceiveProps!=`function`||(s!==d||f!==c)&&ks(t,o,r,c),ro=!1,f=t.memoizedState,o.state=f,uo(t,r,o,i);var m=t.memoizedState;s!==d||f!==m||Xi.current||ro?(typeof p==`function`&&(Ts(t,n,p,r),m=t.memoizedState),(l=ro||Ds(t,n,l,r,f,m,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!=`function`&&typeof o.componentWillUpdate!=`function`||(typeof o.componentWillUpdate==`function`&&o.componentWillUpdate(r,m,c),typeof o.UNSAFE_componentWillUpdate==`function`&&o.UNSAFE_componentWillUpdate(r,m,c)),typeof o.componentDidUpdate==`function`&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=m),o.props=r,o.state=m,o.context=c,r=l):(typeof o.componentDidUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!=`function`||s===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Xs(e,t,n,r,a,i)}function Xs(e,t,n,r,i,a){qs(e,t);var o=(t.flags&128)!=0;if(!r&&!o)return i&&ia(t,n,!1),lc(e,t,a);r=t.stateNode,Bs.current=t;var s=o&&typeof n.getDerivedStateFromError!=`function`?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Ha(t,e.child,null,a),t.child=Ha(t,null,s,a)):Hs(e,t,s,a),t.memoizedState=r.state,i&&ia(t,n,!0),t.child}function Zs(e){var t=e.stateNode;t.pendingContext?ta(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ta(e,t.context,!1),vo(e,t.containerInfo)}function Qs(e,t,n,r,i){return Fa(),Ia(i),t.flags|=256,Hs(e,t,n,r),t.child}var $s={dehydrated:null,treeContext:null,retryLane:0};function ec(e){return{baseLanes:e,cachePool:null,transitions:null}}function tc(e,t,n){var r=t.pendingProps,i=So.current,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(i&2)!=0),s?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),qi(So,i&1),e===null)return ja(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,a?(r=t.mode,a=t.child,o={mode:`hidden`,children:o},!(r&1)&&a!==null?(a.childLanes=0,a.pendingProps=o):a=cu(o,r,0,null),e=su(e,r,n,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=ec(n),t.memoizedState=$s,e):nc(t,o));if(i=e.memoizedState,i!==null&&(s=i.dehydrated,s!==null))return ic(e,t,o,r,s,i,n);if(a){a=r.fallback,o=t.mode,i=e.child,s=i.sibling;var c={mode:`hidden`,children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=au(i,c),r.subtreeFlags=i.subtreeFlags&14680064),s===null?(a=su(a,o,n,null),a.flags|=2):a=au(s,a),a.return=t,r.return=t,r.sibling=a,t.child=r,r=a,a=t.child,o=e.child.memoizedState,o=o===null?ec(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},a.memoizedState=o,a.childLanes=e.childLanes&~n,t.memoizedState=$s,r}return a=e.child,e=a.sibling,r=au(a,{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 nc(e,t){return t=cu({mode:`visible`,children:t},e.mode,0,null),t.return=e,e.child=t}function rc(e,t,n,r){return r!==null&&Ia(r),Ha(t,e.child,null,n),e=nc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ic(e,t,n,r,a,o,s){if(n)return t.flags&256?(t.flags&=-257,r=Ms(Error(i(422))),rc(e,t,s,r)):t.memoizedState===null?(o=r.fallback,a=t.mode,r=cu({mode:`visible`,children:r.children},a,0,null),o=su(o,a,s,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&Ha(t,e.child,null,s),t.child.memoizedState=ec(s),t.memoizedState=$s,o):(t.child=e.child,t.flags|=128,null);if(!(t.mode&1))return rc(e,t,s,null);if(a.data===`$!`){if(r=a.nextSibling&&a.nextSibling.dataset,r)var c=r.dgst;return r=c,o=Error(i(419)),r=Ms(o,r,void 0),rc(e,t,s,r)}if(c=(s&e.childLanes)!==0,Vs||c){if(r=Zc,r!==null){switch(s&-s){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|s))===0?a:0,a!==0&&a!==o.retryLane&&(o.retryLane=a,no(e,a),wl(r,e,a,-1))}return Rl(),r=Ms(Error(i(421))),rc(e,t,s,r)}return a.data===`$?`?(t.flags|=128,t.child=e.child,t=Zl.bind(null,e),a._reactRetry=t,null):(e=o.treeContext,Ta=ji(a.nextSibling),wa=t,Ea=!0,Da=null,e!==null&&(ha[ga++]=va,ha[ga++]=ya,ha[ga++]=_a,va=e.id,ya=e.overflow,_a=t),t=nc(t,r.children),t.flags|=4096,t)}function ac(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xa(e.return,t,n)}function oc(e,t,n,r,i){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=r,a.tail=n,a.tailMode=i)}function sc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;if(Hs(e,t,r.children,n),r=So.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ac(e,n,t);else if(e.tag===19)ac(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(qi(So,r),!(t.mode&1))t.memoizedState=null;else switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Co(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),oc(t,!1,i,n,a);break;case`backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Co(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}oc(t,!0,n,null,a);break;case`together`:oc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cc(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function lc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),il|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=au(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=au(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uc(e,t,n){switch(t.tag){case 3:Zs(t),Fa();break;case 5:bo(t);break;case 1:$i(t.type)&&ra(t);break;case 4:vo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;qi(Wa,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(qi(So,So.current&1),e=lc(e,t,n),e===null?null:e.sibling):tc(e,t,n):(qi(So,So.current&1),t.flags|=128,null);qi(So,So.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return sc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),qi(So,So.current),r)break;return null;case 22:case 23:return t.lanes=0,Ks(e,t,n)}return lc(e,t,n)}var dc=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}},fc=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,_o(mo.current);var a=null;switch(n){case`input`:i=fe(e,i),r=fe(e,r),a=[];break;case`select`:i=R({},i,{value:void 0}),r=R({},r,{value:void 0}),a=[];break;case`textarea`:i=be(e,i),r=be(e,r),a=[];break;default:typeof i.onClick!=`function`&&typeof r.onClick==`function`&&(e.onclick=xi)}Pe(n,r);var o;for(u in n=null,i)if(!r.hasOwnProperty(u)&&i.hasOwnProperty(u)&&i[u]!=null)if(u===`style`){var c=i[u];for(o in c)c.hasOwnProperty(o)&&(n||={},n[o]=``)}else u!==`dangerouslySetInnerHTML`&&u!==`children`&&u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&u!==`autoFocus`&&(s.hasOwnProperty(u)?a||=[]:(a||=[]).push(u,null));for(u in r){var l=r[u];if(c=i?.[u],r.hasOwnProperty(u)&&l!==c&&(l!=null||c!=null))if(u===`style`)if(c){for(o in c)!c.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||={},n[o]=``);for(o in l)l.hasOwnProperty(o)&&c[o]!==l[o]&&(n||={},n[o]=l[o])}else n||(a||=[],a.push(u,n)),n=l;else u===`dangerouslySetInnerHTML`?(l=l?l.__html:void 0,c=c?c.__html:void 0,l!=null&&c!==l&&(a||=[]).push(u,l)):u===`children`?typeof l!=`string`&&typeof l!=`number`||(a||=[]).push(u,``+l):u!==`suppressContentEditableWarning`&&u!==`suppressHydrationWarning`&&(s.hasOwnProperty(u)?(l!=null&&u===`onScroll`&&si(`scroll`,e),a||c===l||(a=[])):(a||=[]).push(u,l))}n&&(a||=[]).push(`style`,n);var u=a;(t.updateQueue=u)&&(t.flags|=4)}},pc=function(e,t,n,r){n!==r&&(t.flags|=4)};function mc(e,t){if(!Ea)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 hc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function gc(e,t,n){var r=t.pendingProps;switch(Ca(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return hc(t),null;case 1:return $i(t.type)&&ea(),hc(t),null;case 3:return r=t.stateNode,yo(),Ki(Xi),Ki(Yi),To(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Na(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Da!==null&&(Ol(Da),Da=null))),hc(t),null;case 5:xo(t);var a=_o(go.current);if(n=t.type,e!==null&&t.stateNode!=null)fc(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(i(166));return hc(t),null}if(e=_o(mo.current),Na(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Pi]=t,r[Fi]=o,e=(t.mode&1)!=0,n){case`dialog`:si(`cancel`,r),si(`close`,r);break;case`iframe`:case`object`:case`embed`:si(`load`,r);break;case`video`:case`audio`:for(a=0;a<ri.length;a++)si(ri[a],r);break;case`source`:si(`error`,r);break;case`img`:case`image`:case`link`:si(`error`,r),si(`load`,r);break;case`details`:si(`toggle`,r);break;case`input`:pe(r,o),si(`invalid`,r);break;case`select`:r._wrapperState={wasMultiple:!!o.multiple},si(`invalid`,r);break;case`textarea`:xe(r,o),si(`invalid`,r)}for(var c in Pe(n,o),a=null,o)if(o.hasOwnProperty(c)){var l=o[c];c===`children`?typeof l==`string`?r.textContent!==l&&(!0!==o.suppressHydrationWarning&&bi(r.textContent,l,e),a=[`children`,l]):typeof l==`number`&&r.textContent!==``+l&&(!0!==o.suppressHydrationWarning&&bi(r.textContent,l,e),a=[`children`,``+l]):s.hasOwnProperty(c)&&l!=null&&c===`onScroll`&&si(`scroll`,r)}switch(n){case`input`:le(r),ge(r,o,!0);break;case`textarea`:le(r),Ce(r);break;case`select`:case`option`:break;default:typeof o.onClick==`function`&&(r.onclick=xi)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{c=a.nodeType===9?a:a.ownerDocument,e===`http://www.w3.org/1999/xhtml`&&(e=we(n)),e===`http://www.w3.org/1999/xhtml`?n===`script`?(e=c.createElement(`div`),e.innerHTML=`<script><\/script>`,e=e.removeChild(e.firstChild)):typeof r.is==`string`?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n===`select`&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[Pi]=t,e[Fi]=r,dc(e,t,!1,!1),t.stateNode=e;a:{switch(c=Fe(n,r),n){case`dialog`:si(`cancel`,e),si(`close`,e),a=r;break;case`iframe`:case`object`:case`embed`:si(`load`,e),a=r;break;case`video`:case`audio`:for(a=0;a<ri.length;a++)si(ri[a],e);a=r;break;case`source`:si(`error`,e),a=r;break;case`img`:case`image`:case`link`:si(`error`,e),si(`load`,e),a=r;break;case`details`:si(`toggle`,e),a=r;break;case`input`:pe(e,r),a=fe(e,r),si(`invalid`,e);break;case`option`:a=r;break;case`select`:e._wrapperState={wasMultiple:!!r.multiple},a=R({},r,{value:void 0}),si(`invalid`,e);break;case`textarea`:xe(e,r),a=be(e,r),si(`invalid`,e);break;default:a=r}for(o in Pe(n,a),l=a,l)if(l.hasOwnProperty(o)){var u=l[o];o===`style`?Me(e,u):o===`dangerouslySetInnerHTML`?(u=u?u.__html:void 0,u!=null&&De(e,u)):o===`children`?typeof u==`string`?(n!==`textarea`||u!==``)&&Oe(e,u):typeof u==`number`&&Oe(e,``+u):o!==`suppressContentEditableWarning`&&o!==`suppressHydrationWarning`&&o!==`autoFocus`&&(s.hasOwnProperty(o)?u!=null&&o===`onScroll`&&si(`scroll`,e):u!=null&&S(e,o,u,c))}switch(n){case`input`:le(e),ge(e,r,!1);break;case`textarea`:le(e),Ce(e);break;case`option`:r.value!=null&&e.setAttribute(`value`,``+se(r.value));break;case`select`:e.multiple=!!r.multiple,o=r.value,o==null?r.defaultValue!=null&&ye(e,!!r.multiple,r.defaultValue,!0):ye(e,!!r.multiple,o,!1);break;default:typeof a.onClick==`function`&&(e.onclick=xi)}switch(n){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return hc(t),null;case 6:if(e&&t.stateNode!=null)pc(e,t,e.memoizedProps,r);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(n=_o(go.current),_o(mo.current),Na(t)){if(r=t.stateNode,n=t.memoizedProps,r[Pi]=t,(o=r.nodeValue!==n)&&(e=wa,e!==null))switch(e.tag){case 3:bi(r.nodeValue,n,(e.mode&1)!=0);break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&bi(r.nodeValue,n,(e.mode&1)!=0)}o&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Pi]=t,t.stateNode=r}return hc(t),null;case 13:if(Ki(So),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ea&&Ta!==null&&t.mode&1&&!(t.flags&128))Pa(),Fa(),t.flags|=98560,o=!1;else if(o=Na(t),r!==null&&r.dehydrated!==null){if(e===null){if(!o)throw Error(i(318));if(o=t.memoizedState,o=o===null?null:o.dehydrated,!o)throw Error(i(317));o[Pi]=t}else Fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;hc(t),o=!1}else Da!==null&&(Ol(Da),Da=null),o=!0;if(!o)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||So.current&1?nl===0&&(nl=3):Rl())),t.updateQueue!==null&&(t.flags|=4),hc(t),null);case 4:return yo(),e===null&&ui(t.stateNode.containerInfo),hc(t),null;case 10:return Ya(t.type._context),hc(t),null;case 17:return $i(t.type)&&ea(),hc(t),null;case 19:if(Ki(So),o=t.memoizedState,o===null)return hc(t),null;if(r=(t.flags&128)!=0,c=o.rendering,c===null)if(r)mc(o,!1);else{if(nl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Co(e),c!==null){for(t.flags|=128,mc(o,!1),r=c.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)o=n,e=r,o.flags&=14680066,c=o.alternate,c===null?(o.childLanes=0,o.lanes=e,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=c.childLanes,o.lanes=c.lanes,o.child=c.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=c.memoizedProps,o.memoizedState=c.memoizedState,o.updateQueue=c.updateQueue,o.type=c.type,e=c.dependencies,o.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return qi(So,So.current&1|2),t.child}e=e.sibling}o.tail!==null&&ht()>ul&&(t.flags|=128,r=!0,mc(o,!1),t.lanes=4194304)}else{if(!r)if(e=Co(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),mc(o,!0),o.tail===null&&o.tailMode===`hidden`&&!c.alternate&&!Ea)return hc(t),null}else 2*ht()-o.renderingStartTime>ul&&n!==1073741824&&(t.flags|=128,r=!0,mc(o,!1),t.lanes=4194304);o.isBackwards?(c.sibling=t.child,t.child=c):(n=o.last,n===null?t.child=c:n.sibling=c,o.last=c)}return o.tail===null?(hc(t),null):(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ht(),t.sibling=null,n=So.current,qi(So,r?n&1|2:n&1),t);case 22:case 23:return Pl(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?el&1073741824&&(hc(t),t.subtreeFlags&6&&(t.flags|=8192)):hc(t),null;case 24:return null;case 25:return null}throw Error(i(156,t.tag))}function _c(e,t){switch(Ca(t),t.tag){case 1:return $i(t.type)&&ea(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return yo(),Ki(Xi),Ki(Yi),To(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return xo(t),null;case 13:if(Ki(So),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ki(So),null;case 4:return yo(),null;case 10:return Ya(t.type._context),null;case 22:case 23:return Pl(),null;case 24:return null;default:return null}}var vc=!1,yc=!1,bc=typeof WeakSet==`function`?WeakSet:Set,U=null;function xc(e,t){var n=e.ref;if(n!==null)if(typeof n==`function`)try{n(null)}catch(n){Jl(e,t,n)}else n.current=null}function Sc(e,t,n){try{n()}catch(n){Jl(e,t,n)}}var Cc=!1;function wc(e,t){if(Si=pn,e=Pr(),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{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,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Ci={focusedElem:e,selectionRange:n},pn=!1,U=t;U!==null;)if(t=U,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,U=e;else for(;U!==null;){t=U;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var g=h.memoizedProps,_=h.memoizedState,v=t.stateNode;v.__reactInternalSnapshotBeforeUpdate=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ws(t.type,g),_)}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent=``:y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(e){Jl(t,t.return,e)}if(e=t.sibling,e!==null){e.return=t.return,U=e;break}U=t.return}return h=Cc,Cc=!1,h}function Tc(e,t,n){var r=t.updateQueue;if(r=r===null?null:r.lastEffect,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var a=i.destroy;i.destroy=void 0,a!==void 0&&Sc(t,n,a)}i=i.next}while(i!==r)}}function Ec(e,t){if(t=t.updateQueue,t=t===null?null:t.lastEffect,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 Dc(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 Oc(e){var t=e.alternate;t!==null&&(e.alternate=null,Oc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pi],delete t[Fi],delete t[Li],delete t[Ri],delete t[zi])),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 kc(e){return e.tag===5||e.tag===3||e.tag===4}function Ac(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kc(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 a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jc(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=xi));else if(r!==4&&(e=e.child,e!==null))for(jc(e,t,n),e=e.sibling;e!==null;)jc(e,t,n),e=e.sibling}function Mc(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(Mc(e,t,n),e=e.sibling;e!==null;)Mc(e,t,n),e=e.sibling}var Nc=null,Pc=!1;function Fc(e,t,n){for(n=n.child;n!==null;)Ic(e,t,n),n=n.sibling}function Ic(e,t,n){if(Ct&&typeof Ct.onCommitFiberUnmount==`function`)try{Ct.onCommitFiberUnmount(St,n)}catch{}switch(n.tag){case 5:yc||xc(n,t);case 6:var r=Nc,i=Pc;Nc=null,Fc(e,t,n),Nc=r,Pc=i,Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Nc.removeChild(n.stateNode));break;case 18:Nc!==null&&(Pc?(e=Nc,n=n.stateNode,e.nodeType===8?Ai(e.parentNode,n):e.nodeType===1&&Ai(e,n),dn(e)):Ai(Nc,n.stateNode));break;case 4:r=Nc,i=Pc,Nc=n.stateNode.containerInfo,Pc=!0,Fc(e,t,n),Nc=r,Pc=i;break;case 0:case 11:case 14:case 15:if(!yc&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Sc(n,t,o),i=i.next}while(i!==r)}Fc(e,t,n);break;case 1:if(!yc&&(xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(e){Jl(n,t,e)}Fc(e,t,n);break;case 21:Fc(e,t,n);break;case 22:n.mode&1?(yc=(r=yc)||n.memoizedState!==null,Fc(e,t,n),yc=r):Fc(e,t,n);break;default:Fc(e,t,n)}}function Lc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bc),t.forEach(function(t){var r=Ql.bind(null,e,t);n.has(t)||(n.add(t),t.then(r,r))})}}function Rc(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 5:Nc=c.stateNode,Pc=!1;break a;case 3:Nc=c.stateNode.containerInfo,Pc=!0;break a;case 4:Nc=c.stateNode.containerInfo,Pc=!0;break a}c=c.return}if(Nc===null)throw Error(i(160));Ic(o,s,a),Nc=null,Pc=!1;var l=a.alternate;l!==null&&(l.return=null),a.return=null}catch(e){Jl(a,t,e)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)zc(t,e),t=t.sibling}function zc(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Rc(t,e),Bc(e),r&4){try{Tc(3,e,e.return),Ec(3,e)}catch(t){Jl(e,e.return,t)}try{Tc(5,e,e.return)}catch(t){Jl(e,e.return,t)}}break;case 1:Rc(t,e),Bc(e),r&512&&n!==null&&xc(n,n.return);break;case 5:if(Rc(t,e),Bc(e),r&512&&n!==null&&xc(n,n.return),e.flags&32){var a=e.stateNode;try{Oe(a,``)}catch(t){Jl(e,e.return,t)}}if(r&4&&(a=e.stateNode,a!=null)){var o=e.memoizedProps,s=n===null?o:n.memoizedProps,c=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{c===`input`&&o.type===`radio`&&o.name!=null&&me(a,o),Fe(c,s);var u=Fe(c,o);for(s=0;s<l.length;s+=2){var d=l[s],f=l[s+1];d===`style`?Me(a,f):d===`dangerouslySetInnerHTML`?De(a,f):d===`children`?Oe(a,f):S(a,d,f,u)}switch(c){case`input`:he(a,o);break;case`textarea`:Se(a,o);break;case`select`:var p=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!o.multiple;var m=o.value;m==null?p!==!!o.multiple&&(o.defaultValue==null?ye(a,!!o.multiple,o.multiple?[]:``,!1):ye(a,!!o.multiple,o.defaultValue,!0)):ye(a,!!o.multiple,m,!1)}a[Fi]=o}catch(t){Jl(e,e.return,t)}}break;case 6:if(Rc(t,e),Bc(e),r&4){if(e.stateNode===null)throw Error(i(162));a=e.stateNode,o=e.memoizedProps;try{a.nodeValue=o}catch(t){Jl(e,e.return,t)}}break;case 3:if(Rc(t,e),Bc(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{dn(t.containerInfo)}catch(t){Jl(e,e.return,t)}break;case 4:Rc(t,e),Bc(e);break;case 13:Rc(t,e),Bc(e),a=e.child,a.flags&8192&&(o=a.memoizedState!==null,a.stateNode.isHidden=o,!o||a.alternate!==null&&a.alternate.memoizedState!==null||(ll=ht())),r&4&&Lc(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(yc=(u=yc)||d,Rc(t,e),yc=u):Rc(t,e),Bc(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(U=e,d=e.child;d!==null;){for(f=U=d;U!==null;){switch(p=U,m=p.child,p.tag){case 0:case 11:case 14:case 15:Tc(4,p,p.return);break;case 1:xc(p,p.return);var h=p.stateNode;if(typeof h.componentWillUnmount==`function`){r=p,n=p.return;try{t=r,h.props=t.memoizedProps,h.state=t.memoizedState,h.componentWillUnmount()}catch(e){Jl(r,n,e)}}break;case 5:xc(p,p.return);break;case 22:if(p.memoizedState!==null){Wc(f);continue}}m===null?Wc(f):(m.return=p,U=m)}d=d.sibling}a:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{a=f.stateNode,u?(o=a.style,typeof o.setProperty==`function`?o.setProperty(`display`,`none`,`important`):o.display=`none`):(c=f.stateNode,l=f.memoizedProps.style,s=l!=null&&l.hasOwnProperty(`display`)?l.display:null,c.style.display=je(`display`,s))}catch(t){Jl(e,e.return,t)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?``:f.memoizedProps}catch(t){Jl(e,e.return,t)}}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 a;for(;f.sibling===null;){if(f.return===null||f.return===e)break a;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Rc(t,e),Bc(e),r&4&&Lc(e);break;case 21:break;default:Rc(t,e),Bc(e)}}function Bc(e){var t=e.flags;if(t&2){try{a:{for(var n=e.return;n!==null;){if(kc(n)){var r=n;break a}n=n.return}throw Error(i(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Oe(a,``),r.flags&=-33),Mc(e,Ac(e),a);break;case 3:case 4:var o=r.stateNode.containerInfo;jc(e,Ac(e),o);break;default:throw Error(i(161))}}catch(t){Jl(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vc(e,t,n){U=e,Hc(e,t,n)}function Hc(e,t,n){for(var r=(e.mode&1)!=0;U!==null;){var i=U,a=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||vc;if(!o){var s=i.alternate,c=s!==null&&s.memoizedState!==null||yc;s=vc;var l=yc;if(vc=o,(yc=c)&&!l)for(U=i;U!==null;)o=U,c=o.child,o.tag===22&&o.memoizedState!==null||c===null?Gc(i):(c.return=o,U=c);for(;a!==null;)U=a,Hc(a,t,n),a=a.sibling;U=i,vc=s,yc=l}Uc(e,t,n)}else i.subtreeFlags&8772&&a!==null?(a.return=i,U=a):Uc(e,t,n)}}function Uc(e){for(;U!==null;){var t=U;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yc||Ec(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yc)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:ws(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var o=t.updateQueue;o!==null&&fo(t,o,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}fo(t,s,n)}break;case 5:var c=t.stateNode;if(n===null&&t.flags&4){n=c;var l=t.memoizedProps;switch(t.type){case`button`:case`input`:case`select`:case`textarea`:l.autoFocus&&n.focus();break;case`img`:l.src&&(n.src=l.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&&dn(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(i(163))}yc||t.flags&512&&Dc(t)}catch(e){Jl(t,t.return,e)}}if(t===e){U=null;break}if(n=t.sibling,n!==null){n.return=t.return,U=n;break}U=t.return}}function Wc(e){for(;U!==null;){var t=U;if(t===e){U=null;break}var n=t.sibling;if(n!==null){n.return=t.return,U=n;break}U=t.return}}function Gc(e){for(;U!==null;){var t=U;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ec(4,t)}catch(e){Jl(t,n,e)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount==`function`){var i=t.return;try{r.componentDidMount()}catch(e){Jl(t,i,e)}}var a=t.return;try{Dc(t)}catch(e){Jl(t,a,e)}break;case 5:var o=t.return;try{Dc(t)}catch(e){Jl(t,o,e)}}}catch(e){Jl(t,t.return,e)}if(t===e){U=null;break}var s=t.sibling;if(s!==null){s.return=t.return,U=s;break}U=t.return}}var Kc=Math.ceil,qc=C.ReactCurrentDispatcher,Jc=C.ReactCurrentOwner,Yc=C.ReactCurrentBatchConfig,Xc=0,Zc=null,Qc=null,$c=0,el=0,tl=Gi(0),nl=0,rl=null,il=0,al=0,ol=0,sl=null,cl=null,ll=0,ul=1/0,dl=null,fl=!1,pl=null,ml=null,hl=!1,gl=null,_l=0,vl=0,yl=null,bl=-1,xl=0;function Sl(){return Xc&6?ht():bl===-1?bl=ht():bl}function Cl(e){return e.mode&1?Xc&2&&$c!==0?$c&-$c:La.transition===null?(e=Bt,e===0?(e=window.event,e=e===void 0?16:yn(e.type),e):e):(xl===0&&(xl=It()),xl):1}function wl(e,t,n,r){if(50<vl)throw vl=0,yl=null,Error(i(185));Rt(e,n,r),(!(Xc&2)||e!==Zc)&&(e===Zc&&(!(Xc&2)&&(al|=n),nl===4&&Al(e,$c)),Tl(e,r),n===1&&Xc===0&&!(t.mode&1)&&(ul=ht()+500,oa&&ua()))}function Tl(e,t){var n=e.callbackNode;Pt(e,t);var r=Mt(e,e===Zc?$c:0);if(r===0)n!==null&&ft(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&ft(n),t===1)e.tag===0?la(jl.bind(null,e)):ca(jl.bind(null,e)),Oi(function(){!(Xc&6)&&ua()}),n=null;else{switch(Vt(r)){case 1:n=_t;break;case 4:n=vt;break;case 16:n=yt;break;case 536870912:n=xt;break;default:n=yt}n=eu(n,El.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function El(e,t){if(bl=-1,xl=0,Xc&6)throw Error(i(327));var n=e.callbackNode;if(Kl()&&e.callbackNode!==n)return null;var r=Mt(e,e===Zc?$c:0);if(r===0)return null;if(r&30||(r&e.expiredLanes)!==0||t)t=zl(e,r);else{t=r;var a=Xc;Xc|=2;var o=Ll();(Zc!==e||$c!==t)&&(dl=null,ul=ht()+500,Fl(e,t));do try{Vl();break}catch(t){Il(e,t)}while(1);Ja(),qc.current=o,Xc=a,Qc===null?(Zc=null,$c=0,t=nl):t=0}if(t!==0){if(t===2&&(a=Ft(e),a!==0&&(r=a,t=Dl(e,a))),t===1)throw n=rl,Fl(e,0),Al(e,r),Tl(e,ht()),n;if(t===6)Al(e,r);else{if(a=e.current.alternate,!(r&30)&&!kl(a)&&(t=zl(e,r),t===2&&(o=Ft(e),o!==0&&(r=o,t=Dl(e,o))),t===1))throw n=rl,Fl(e,0),Al(e,r),Tl(e,ht()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(i(345));case 2:Wl(e,cl,dl);break;case 3:if(Al(e,r),(r&130023424)===r&&(t=ll+500-ht(),10<t)){if(Mt(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Sl(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=Ti(Wl.bind(null,e,cl,dl),t);break}Wl(e,cl,dl);break;case 4:if(Al(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var s=31-Tt(r);o=1<<s,s=t[s],s>a&&(a=s),r&=~o}if(r=a,r=ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Kc(r/1960))-r,10<r){e.timeoutHandle=Ti(Wl.bind(null,e,cl,dl),r);break}Wl(e,cl,dl);break;case 5:Wl(e,cl,dl);break;default:throw Error(i(329))}}}return Tl(e,ht()),e.callbackNode===n?El.bind(null,e):null}function Dl(e,t){var n=sl;return e.current.memoizedState.isDehydrated&&(Fl(e,t).flags|=256),e=zl(e,t),e!==2&&(t=cl,cl=n,t!==null&&Ol(t)),e}function Ol(e){cl===null?cl=e:cl.push.apply(cl,e)}function kl(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 i=n[r],a=i.getSnapshot;i=i.value;try{if(!kr(a(),i))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 Al(e,t){for(t&=~ol,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Tt(t),r=1<<n;e[n]=-1,t&=~r}}function jl(e){if(Xc&6)throw Error(i(327));Kl();var t=Mt(e,0);if(!(t&1))return Tl(e,ht()),null;var n=zl(e,t);if(e.tag!==0&&n===2){var r=Ft(e);r!==0&&(t=r,n=Dl(e,r))}if(n===1)throw n=rl,Fl(e,0),Al(e,t),Tl(e,ht()),n;if(n===6)throw Error(i(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wl(e,cl,dl),Tl(e,ht()),null}function Ml(e,t){var n=Xc;Xc|=1;try{return e(t)}finally{Xc=n,Xc===0&&(ul=ht()+500,oa&&ua())}}function Nl(e){gl!==null&&gl.tag===0&&!(Xc&6)&&Kl();var t=Xc;Xc|=1;var n=Yc.transition,r=Bt;try{if(Yc.transition=null,Bt=1,e)return e()}finally{Bt=r,Yc.transition=n,Xc=t,!(Xc&6)&&ua()}}function Pl(){el=tl.current,Ki(tl)}function Fl(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ei(n)),Qc!==null)for(n=Qc.return;n!==null;){var r=n;switch(Ca(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&ea();break;case 3:yo(),Ki(Xi),Ki(Yi),To();break;case 5:xo(r);break;case 4:yo();break;case 13:Ki(So);break;case 19:Ki(So);break;case 10:Ya(r.type._context);break;case 22:case 23:Pl()}n=n.return}if(Zc=e,Qc=e=au(e.current,null),$c=el=t,nl=0,rl=null,ol=al=il=0,cl=sl=null,$a!==null){for(t=0;t<$a.length;t++)if(n=$a[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,a=n.pending;if(a!==null){var o=a.next;a.next=i,r.next=o}n.pending=r}$a=null}return e}function Il(e,t){do{var n=Qc;try{if(Ja(),Eo.current=bs,Mo){for(var r=ko.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}Mo=!1}if(Oo=0,jo=Ao=ko=null,No=!1,Po=0,Jc.current=null,n===null||n.return===null){nl=1,rl=t,Qc=null;break}a:{var o=e,s=n.return,c=n,l=t;if(t=$c,c.flags|=32768,typeof l==`object`&&l&&typeof l.then==`function`){var u=l,d=c,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var p=d.alternate;p?(d.updateQueue=p.updateQueue,d.memoizedState=p.memoizedState,d.lanes=p.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Rs(s);if(m!==null){m.flags&=-257,zs(m,s,c,o,t),m.mode&1&&Ls(o,u,t),t=m,l=u;var h=t.updateQueue;if(h===null){var g=new Set;g.add(l),t.updateQueue=g}else h.add(l);break a}else{if(!(t&1)){Ls(o,u,t),Rl();break a}l=Error(i(426))}}else if(Ea&&c.mode&1){var _=Rs(s);if(_!==null){!(_.flags&65536)&&(_.flags|=256),zs(_,s,c,o,t),Ia(js(l,c));break a}}o=l=js(l,c),nl!==4&&(nl=2),sl===null?sl=[o]:sl.push(o),o=s;do{switch(o.tag){case 3:o.flags|=65536,t&=-t,o.lanes|=t;var v=Fs(o,l,t);lo(o,v);break a;case 1:c=l;var y=o.type,b=o.stateNode;if(!(o.flags&128)&&(typeof y.getDerivedStateFromError==`function`||b!==null&&typeof b.componentDidCatch==`function`&&(ml===null||!ml.has(b)))){o.flags|=65536,t&=-t,o.lanes|=t;var x=Is(o,c,t);lo(o,x);break a}}o=o.return}while(o!==null)}Ul(n)}catch(e){t=e,Qc===n&&n!==null&&(Qc=n=n.return);continue}break}while(1)}function Ll(){var e=qc.current;return qc.current=bs,e===null?bs:e}function Rl(){(nl===0||nl===3||nl===2)&&(nl=4),Zc===null||!(il&268435455)&&!(al&268435455)||Al(Zc,$c)}function zl(e,t){var n=Xc;Xc|=2;var r=Ll();(Zc!==e||$c!==t)&&(dl=null,Fl(e,t));do try{Bl();break}catch(t){Il(e,t)}while(1);if(Ja(),Xc=n,qc.current=r,Qc!==null)throw Error(i(261));return Zc=null,$c=0,nl}function Bl(){for(;Qc!==null;)Hl(Qc)}function Vl(){for(;Qc!==null&&!pt();)Hl(Qc)}function Hl(e){var t=$l(e.alternate,e,el);e.memoizedProps=e.pendingProps,t===null?Ul(e):Qc=t,Jc.current=null}function Ul(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=_c(n,t),n!==null){n.flags&=32767,Qc=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{nl=6,Qc=null;return}}else if(n=gc(n,t,el),n!==null){Qc=n;return}if(t=t.sibling,t!==null){Qc=t;return}Qc=t=e}while(t!==null);nl===0&&(nl=5)}function Wl(e,t,n){var r=Bt,i=Yc.transition;try{Yc.transition=null,Bt=1,Gl(e,t,n,r)}finally{Yc.transition=i,Bt=r}return null}function Gl(e,t,n,r){do Kl();while(gl!==null);if(Xc&6)throw Error(i(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(i(177));e.callbackNode=null,e.callbackPriority=0;var o=n.lanes|n.childLanes;if(zt(e,o),e===Zc&&(Qc=Zc=null,$c=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||hl||(hl=!0,eu(yt,function(){return Kl(),null})),o=(n.flags&15990)!=0,n.subtreeFlags&15990||o){o=Yc.transition,Yc.transition=null;var s=Bt;Bt=1;var c=Xc;Xc|=4,Jc.current=null,wc(e,n),zc(n,e),Ir(Ci),pn=!!Si,Ci=Si=null,e.current=n,Vc(n,e,a),mt(),Xc=c,Bt=s,Yc.transition=o}else e.current=n;if(hl&&(hl=!1,gl=e,_l=a),o=e.pendingLanes,o===0&&(ml=null),wt(n.stateNode,r),Tl(e,ht()),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(fl)throw fl=!1,e=pl,pl=null,e;return _l&1&&e.tag!==0&&Kl(),o=e.pendingLanes,o&1?e===yl?vl++:(vl=0,yl=e):vl=0,ua(),null}function Kl(){if(gl!==null){var e=Vt(_l),t=Yc.transition,n=Bt;try{if(Yc.transition=null,Bt=16>e?16:e,gl===null)var r=!1;else{if(e=gl,gl=null,_l=0,Xc&6)throw Error(i(331));var a=Xc;for(Xc|=4,U=e.current;U!==null;){var o=U,s=o.child;if(U.flags&16){var c=o.deletions;if(c!==null){for(var l=0;l<c.length;l++){var u=c[l];for(U=u;U!==null;){var d=U;switch(d.tag){case 0:case 11:case 15:Tc(8,d,o)}var f=d.child;if(f!==null)f.return=d,U=f;else for(;U!==null;){d=U;var p=d.sibling,m=d.return;if(Oc(d),d===u){U=null;break}if(p!==null){p.return=m,U=p;break}U=m}}}var h=o.alternate;if(h!==null){var g=h.child;if(g!==null){h.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}U=o}}if(o.subtreeFlags&2064&&s!==null)s.return=o,U=s;else b:for(;U!==null;){if(o=U,o.flags&2048)switch(o.tag){case 0:case 11:case 15:Tc(9,o,o.return)}var v=o.sibling;if(v!==null){v.return=o.return,U=v;break b}U=o.return}}var y=e.current;for(U=y;U!==null;){s=U;var b=s.child;if(s.subtreeFlags&2064&&b!==null)b.return=s,U=b;else b:for(s=y;U!==null;){if(c=U,c.flags&2048)try{switch(c.tag){case 0:case 11:case 15:Ec(9,c)}}catch(e){Jl(c,c.return,e)}if(c===s){U=null;break b}var x=c.sibling;if(x!==null){x.return=c.return,U=x;break b}U=c.return}}if(Xc=a,ua(),Ct&&typeof Ct.onPostCommitFiberRoot==`function`)try{Ct.onPostCommitFiberRoot(St,e)}catch{}r=!0}return r}finally{Bt=n,Yc.transition=t}}return!1}function ql(e,t,n){t=js(n,t),t=Fs(e,t,1),e=so(e,t,1),t=Sl(),e!==null&&(Rt(e,1,t),Tl(e,t))}function Jl(e,t,n){if(e.tag===3)ql(e,e,n);else for(;t!==null;){if(t.tag===3){ql(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ml===null||!ml.has(r))){e=js(n,e),e=Is(t,e,1),t=so(t,e,1),e=Sl(),t!==null&&(Rt(t,1,e),Tl(t,e));break}}t=t.return}}function Yl(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Sl(),e.pingedLanes|=e.suspendedLanes&n,Zc===e&&($c&n)===n&&(nl===4||nl===3&&($c&130023424)===$c&&500>ht()-ll?Fl(e,0):ol|=n),Tl(e,t)}function Xl(e,t){t===0&&(e.mode&1?(t=At,At<<=1,!(At&130023424)&&(At=4194304)):t=1);var n=Sl();e=no(e,t),e!==null&&(Rt(e,t,n),Tl(e,n))}function Zl(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Xl(e,n)}function Ql(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(i(314))}r!==null&&r.delete(t),Xl(e,n)}var $l=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xi.current)Vs=!0;else{if((e.lanes&n)===0&&!(t.flags&128))return Vs=!1,uc(e,t,n);Vs=!!(e.flags&131072)}else Vs=!1,Ea&&t.flags&1048576&&xa(t,ma,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cc(e,t),e=t.pendingProps;var a=Qi(t,Yi.current);Za(t,n),a=Ro(null,t,r,e,a,n);var o=zo();return t.flags|=1,typeof a==`object`&&a&&typeof a.render==`function`&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,$i(r)?(o=!0,ra(t)):o=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,io(t),a.updater=Es,t.stateNode=a,a._reactInternals=t,As(t,r,e,n),t=Xs(null,t,r,!0,o,n)):(t.tag=0,Ea&&o&&Sa(t),Hs(null,t,a,n),t=t.child),t;case 16:r=t.elementType;a:{switch(cc(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=iu(r),e=ws(r,e),a){case 0:t=Js(null,t,r,e,n);break a;case 1:t=Ys(null,t,r,e,n);break a;case 11:t=Us(null,t,r,e,n);break a;case 14:t=Ws(null,t,r,ws(r.type,e),n);break a}throw Error(i(306,r,``))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ws(r,a),Js(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ws(r,a),Ys(e,t,r,a,n);case 3:a:{if(Zs(t),e===null)throw Error(i(387));r=t.pendingProps,o=t.memoizedState,a=o.element,ao(e,t),uo(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){a=js(Error(i(423)),t),t=Qs(e,t,r,n,a);break a}else if(r!==a){a=js(Error(i(424)),t),t=Qs(e,t,r,n,a);break a}else for(Ta=ji(t.stateNode.containerInfo.firstChild),wa=t,Ea=!0,Da=null,n=Ua(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Fa(),r===a){t=lc(e,t,n);break a}Hs(e,t,r,n)}t=t.child}return t;case 5:return bo(t),e===null&&ja(t),r=t.type,a=t.pendingProps,o=e===null?null:e.memoizedProps,s=a.children,wi(r,a)?s=null:o!==null&&wi(r,o)&&(t.flags|=32),qs(e,t),Hs(e,t,s,n),t.child;case 6:return e===null&&ja(t),null;case 13:return tc(e,t,n);case 4:return vo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ha(t,null,r,n):Hs(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ws(r,a),Us(e,t,r,a,n);case 7:return Hs(e,t,t.pendingProps,n),t.child;case 8:return Hs(e,t,t.pendingProps.children,n),t.child;case 12:return Hs(e,t,t.pendingProps.children,n),t.child;case 10:a:{if(r=t.type._context,a=t.pendingProps,o=t.memoizedProps,s=a.value,qi(Wa,r._currentValue),r._currentValue=s,o!==null)if(kr(o.value,s)){if(o.children===a.children&&!Xi.current){t=lc(e,t,n);break a}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var c=o.dependencies;if(c!==null){s=o.child;for(var l=c.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=oo(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Xa(o.return,n,t),c.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(i(341));s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),Xa(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Hs(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,Za(t,n),a=Qa(a),r=r(a),t.flags|=1,Hs(e,t,r,n),t.child;case 14:return r=t.type,a=ws(r,t.pendingProps),a=ws(r.type,a),Ws(e,t,r,a,n);case 15:return Gs(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:ws(r,a),cc(e,t),t.tag=1,$i(r)?(e=!0,ra(t)):e=!1,Za(t,n),Os(t,r,a),As(t,r,a,n),Xs(null,t,r,!0,e,n);case 19:return sc(e,t,n);case 22:return Ks(e,t,n)}throw Error(i(156,t.tag))};function eu(e,t){return dt(e,t)}function tu(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 nu(e,t,n,r){return new tu(e,t,n,r)}function ru(e){return e=e.prototype,!(!e||!e.isReactComponent)}function iu(e){if(typeof e==`function`)return ru(e)?1:0;if(e!=null){if(e=e.$$typeof,e===j)return 11;if(e===P)return 14}return 2}function au(e,t){var n=e.alternate;return n===null?(n=nu(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 ou(e,t,n,r,a,o){var s=2;if(r=e,typeof e==`function`)ru(e)&&(s=1);else if(typeof e==`string`)s=5;else a:switch(e){case E:return su(n.children,a,o,t);case D:s=8,a|=8;break;case O:return e=nu(12,n,t,a|2),e.elementType=O,e.lanes=o,e;case M:return e=nu(13,n,t,a),e.elementType=M,e.lanes=o,e;case N:return e=nu(19,n,t,a),e.elementType=N,e.lanes=o,e;case ee:return cu(n,a,o,t);default:if(typeof e==`object`&&e)switch(e.$$typeof){case k:s=10;break a;case A:s=9;break a;case j:s=11;break a;case P:s=14;break a;case F:s=16,r=null;break a}throw Error(i(130,e==null?e:typeof e,``))}return t=nu(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function su(e,t,n,r){return e=nu(7,e,r,t),e.lanes=n,e}function cu(e,t,n,r){return e=nu(22,e,r,t),e.elementType=ee,e.lanes=n,e.stateNode={isHidden:!1},e}function lu(e,t,n){return e=nu(6,e,null,t),e.lanes=n,e}function uu(e,t,n){return t=nu(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function du(e,t,n,r,i){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=Lt(0),this.expirationTimes=Lt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Lt(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function fu(e,t,n,r,i,a,o,s,c){return e=new du(e,t,n,s,c),t===1?(t=1,!0===a&&(t|=8)):t=0,a=nu(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},io(a),e}function pu(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}function mu(e){if(!e)return Ji;e=e._reactInternals;a:{if(at(e)!==e||e.tag!==1)throw Error(i(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break a;case 1:if($i(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break a}}t=t.return}while(t!==null);throw Error(i(171))}if(e.tag===1){var n=e.type;if($i(n))return na(e,n,t)}return t}function hu(e,t,n,r,i,a,o,s,c){return e=fu(n,r,!0,e,i,a,o,s,c),e.context=mu(null),n=e.current,r=Sl(),i=Cl(n),a=oo(r,i),a.callback=t??null,so(n,a,i),e.current.lanes=i,Rt(e,i,r),Tl(e,r),e}function gu(e,t,n,r){var i=t.current,a=Sl(),o=Cl(i);return n=mu(n),t.context===null?t.context=n:t.pendingContext=n,t=oo(a,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=so(i,t,o),e!==null&&(wl(e,i,o,a),co(e,i,o)),o}function _u(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 vu(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yu(e,t){vu(e,t),(e=e.alternate)&&vu(e,t)}function bu(){return null}var xu=typeof reportError==`function`?reportError:function(e){console.error(e)};function Su(e){this._internalRoot=e}Cu.prototype.render=Su.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));gu(e,t,null,null)},Cu.prototype.unmount=Su.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nl(function(){gu(null,e,null,null)}),t[Ii]=null}};function Cu(e){this._internalRoot=e}Cu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<en.length&&t!==0&&t<en[n].priority;n++);en.splice(n,0,e),n===0&&on(e)}};function wu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==` react-mount-point-unstable `))}function Eu(){}function Du(e,t,n,r,i){if(i){if(typeof r==`function`){var a=r;r=function(){var e=_u(o);a.call(e)}}var o=hu(t,r,e,0,null,!1,!1,``,Eu);return e._reactRootContainer=o,e[Ii]=o.current,ui(e.nodeType===8?e.parentNode:e),Nl(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r==`function`){var s=r;r=function(){var e=_u(c);s.call(e)}}var c=fu(e,0,!1,null,null,!1,!1,``,Eu);return e._reactRootContainer=c,e[Ii]=c.current,ui(e.nodeType===8?e.parentNode:e),Nl(function(){gu(t,c,n,r)}),c}function Ou(e,t,n,r,i){var a=n._reactRootContainer;if(a){var o=a;if(typeof i==`function`){var s=i;i=function(){var e=_u(o);s.call(e)}}gu(t,o,e,i)}else o=Du(n,t,e,i,r);return _u(o)}Ht=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=jt(t.pendingLanes);n!==0&&(V(t,n|1),Tl(t,ht()),!(Xc&6)&&(ul=ht()+500,ua()))}break;case 13:Nl(function(){var t=no(e,1);t!==null&&wl(t,e,1,Sl())}),yu(e,1)}},Ut=function(e){if(e.tag===13){var t=no(e,134217728);t!==null&&wl(t,e,134217728,Sl()),yu(e,134217728)}},Wt=function(e){if(e.tag===13){var t=Cl(e),n=no(e,t);n!==null&&wl(n,e,t,Sl()),yu(e,t)}},Gt=function(){return Bt},Kt=function(e,t){var n=Bt;try{return Bt=e,t()}finally{Bt=n}},Re=function(e,t,n){switch(t){case`input`:if(he(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=H(r);if(!a)throw Error(i(90));ue(r),he(r,a)}}}break;case`textarea`:Se(e,n);break;case`select`:t=n.value,t!=null&&ye(e,!!n.multiple,t,!1)}},We=Ml,Ge=Nl;var ku={usingClientEntryPoint:!1,Events:[Vi,Hi,H,He,Ue,Ml]},Au={findFiberByHostInstance:Bi,bundleType:0,version:`18.3.1`,rendererPackageName:`react-dom`},ju={bundleType:Au.bundleType,version:Au.version,rendererPackageName:Au.rendererPackageName,rendererConfig:Au.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=lt(e),e===null?null:e.stateNode},findFiberByHostInstance:Au.findFiberByHostInstance||bu,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 Mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Mu.isDisabled&&Mu.supportsFiber)try{St=Mu.inject(ju),Ct=Mu}catch{}}e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ku,e.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!wu(t))throw Error(i(200));return pu(e,t,null,n)},e.createRoot=function(e,t){if(!wu(e))throw Error(i(299));var n=!1,r=``,a=xu;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=fu(e,1,!1,null,null,n,!1,r,a),e[Ii]=t.current,ui(e.nodeType===8?e.parentNode:e),new Su(t)},e.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(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=lt(t),e=e===null?null:e.stateNode,e},e.flushSync=function(e){return Nl(e)},e.hydrate=function(e,t,n){if(!Tu(t))throw Error(i(200));return Ou(null,e,t,!0,n)},e.hydrateRoot=function(e,t,n){if(!wu(e))throw Error(i(405));var r=n!=null&&n.hydratedSources||null,a=!1,o=``,s=xu;if(n!=null&&(!0===n.unstable_strictMode&&(a=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=hu(t,null,e,1,n??null,a,!1,o,s),e[Ii]=t.current,ui(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 Cu(t)},e.render=function(e,t,n){if(!Tu(t))throw Error(i(200));return Ou(null,e,t,!1,n)},e.unmountComponentAtNode=function(e){if(!Tu(e))throw Error(i(40));return e._reactRootContainer?(Nl(function(){Ou(null,null,e,!1,function(){e._reactRootContainer=null,e[Ii]=null})}),!0):!1},e.unstable_batchedUpdates=Ml,e.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Tu(n))throw Error(i(200));if(e==null||e._reactInternals===void 0)throw Error(i(38));return Ou(e,t,n,!1,r)},e.version=`18.3.1-next-f1338f8080-20240426`})),c=r(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=r((e=>{var t=c();e.createRoot=t.createRoot,e.hydrateRoot=t.hydrateRoot}))(),u=e(n(),1),d=1,f=1e6,p=0;function m(){return p=(p+1)%(2**53-1),p.toString()}var h=new Map,g=e=>{if(h.has(e))return;let t=setTimeout(()=>{h.delete(e),b({type:`REMOVE_TOAST`,toastId:e})},f);h.set(e,t)},_=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,d)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?g(n):e.toasts.forEach(e=>{g(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},v=[],y={toasts:[]};function b(e){y=_(y,e),v.forEach(e=>{e(y)})}function x({...e}){let t=m(),n=e=>b({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>b({type:`DISMISS_TOAST`,toastId:t});return b({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function S(){let[e,t]=u.useState(y);return u.useEffect(()=>(v.push(t),()=>{let e=v.indexOf(t);e>-1&&v.splice(e,1)}),[e]),{...e,toast:x,dismiss:e=>b({type:`DISMISS_TOAST`,toastId:e})}}var C=e(c(),1);typeof window<`u`&&window.document&&window.document.createElement;function w(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function T(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function E(...e){return t=>{let n=!1,r=e.map(e=>{let r=T(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():T(e[t],null)}}}}function D(...e){return u.useCallback(E(...e),e)}var O=r((e=>{var t=n(),r=Symbol.for(`react.element`),i=Symbol.for(`react.fragment`),a=Object.prototype.hasOwnProperty,o=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var i,c={},l=null,u=null;for(i in n!==void 0&&(l=``+n),t.key!==void 0&&(l=``+t.key),t.ref!==void 0&&(u=t.ref),t)a.call(t,i)&&!s.hasOwnProperty(i)&&(c[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)c[i]===void 0&&(c[i]=t[i]);return{$$typeof:r,type:e,key:l,ref:u,props:c,_owner:o.current}}e.Fragment=i,e.jsx=c,e.jsxs=c})),k=r(((e,t)=>{t.exports=O()})),A=k();function j(e,t){let n=u.createContext(t),r=e=>{let{children:t,...r}=e,i=u.useMemo(()=>r,Object.values(r));return(0,A.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=u.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function M(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,A.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=u.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>u.createContext(e));return function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,N(i,...t)]}function N(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function P(e){let t=F(e),n=u.forwardRef((e,n)=>{let{children:r,...i}=e,a=u.Children.toArray(r),o=a.find(L);if(o){let e=o.props.children,r=a.map(t=>t===o?u.Children.count(e)>1?u.Children.only(null):u.isValidElement(e)?e.props.children:null:t);return(0,A.jsx)(t,{...i,ref:n,children:u.isValidElement(e)?u.cloneElement(e,void 0,r):null})}return(0,A.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function F(e){let t=u.forwardRef((e,t)=>{let{children:n,...r}=e;if(u.isValidElement(n)){let e=te(n),i=R(r,n.props);return n.type!==u.Fragment&&(i.ref=t?E(t,e):e),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ee=Symbol(`radix.slottable`);function I(e){let t=({children:e})=>(0,A.jsx)(A.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=ee,t}function L(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ee}function R(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function te(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function ne(e){let t=e+`CollectionProvider`,[n,r]=M(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=u.useRef(null),a=u.useRef(new Map).current;return(0,A.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=P(s),l=u.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,A.jsx)(c,{ref:D(t,a(s,n).collectionRef),children:r})});l.displayName=s;let d=e+`CollectionItemSlot`,f=`data-radix-collection-item`,p=P(d),m=u.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=u.useRef(null),s=D(t,o),c=a(d,n);return u.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,A.jsx)(p,{[f]:``,ref:s,children:r})});m.displayName=d;function h(t){let n=a(e+`CollectionConsumer`,t);return u.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:m},h,r]}var z=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=P(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,A.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function re(e,t){e&&C.flushSync(()=>e.dispatchEvent(t))}function ie(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...e)=>t.current?.(...e),[])}function ae(e,t=globalThis?.document){let n=ie(e);u.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var oe=`DismissableLayer`,se=`dismissableLayer.update`,B=`dismissableLayer.pointerDownOutside`,ce=`dismissableLayer.focusOutside`,le,ue=u.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),de=u.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=u.useContext(ue),[d,f]=u.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=u.useState({}),h=D(t,e=>f(e)),g=Array.from(l.layers),[_]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),v=g.indexOf(_),y=d?g.indexOf(d):-1,b=l.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=me(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!x||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},p),C=he(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},p);return ae(e=>{y===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},p),u.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(le=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),ge(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=le)}},[d,p,n,l]),u.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),ge())},[d,l]),u.useEffect(()=>{let e=()=>m({});return document.addEventListener(se,e),()=>document.removeEventListener(se,e)},[]),(0,A.jsx)(z.div,{...c,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:w(e.onFocusCapture,C.onFocusCapture),onBlurCapture:w(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:w(e.onPointerDownCapture,S.onPointerDownCapture)})});de.displayName=oe;var fe=`DismissableLayerBranch`,pe=u.forwardRef((e,t)=>{let n=u.useContext(ue),r=u.useRef(null),i=D(t,r);return u.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,A.jsx)(z.div,{...e,ref:i})});pe.displayName=fe;function me(e,t=globalThis?.document){let n=ie(e),r=u.useRef(!1),i=u.useRef(()=>{});return u.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){_e(B,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function he(e,t=globalThis?.document){let n=ie(e),r=u.useRef(!1);return u.useEffect(()=>{let e=e=>{e.target&&!r.current&&_e(ce,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function ge(){let e=new CustomEvent(se);document.dispatchEvent(e)}function _e(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?re(i,a):i.dispatchEvent(a)}var ve=de,ye=pe,be=globalThis?.document?u.useLayoutEffect:()=>{},xe=`Portal`,Se=u.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=u.useState(!1);be(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?C.createPortal((0,A.jsx)(z.div,{...r,ref:t}),o):null});Se.displayName=xe;function Ce(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}var we=e=>{let{present:t,children:n}=e,r=Te(t),i=typeof n==`function`?n({present:r.isPresent}):u.Children.only(n),a=D(r.ref,De(i));return typeof n==`function`||r.isPresent?u.cloneElement(i,{ref:a}):null};we.displayName=`Presence`;function Te(e){let[t,n]=u.useState(),r=u.useRef(null),i=u.useRef(e),a=u.useRef(`none`),[o,s]=Ce(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return u.useEffect(()=>{let e=Ee(r.current);a.current=o===`mounted`?e:`none`},[o]),be(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Ee(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),be(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Ee(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Ee(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:u.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Ee(e){return e?.animationName||`none`}function De(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Oe=u.useInsertionEffect||be;function ke({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Ae({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=u.useRef(e!==void 0);u.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`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.`),t.current=s},[s,r])}return[c,u.useCallback(t=>{if(s){let n=je(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Ae({defaultProp:e,onChange:t}){let[n,r]=u.useState(e),i=u.useRef(n),a=u.useRef(t);return Oe(()=>{a.current=t},[t]),u.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function je(e){return typeof e==`function`}var Me=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`}),Ne=`VisuallyHidden`,Pe=u.forwardRef((e,t)=>(0,A.jsx)(z.span,{...e,ref:t,style:{...Me,...e.style}}));Pe.displayName=Ne;var Fe=Pe,Ie=`ToastProvider`,[Le,Re,ze]=ne(`Toast`),[Be,Ve]=M(`Toast`,[ze]),[He,Ue]=Be(Ie),We=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=u.useState(null),[l,d]=u.useState(0),f=u.useRef(!1),p=u.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ie}\`. Expected non-empty \`string\`.`),(0,A.jsx)(Le.Provider,{scope:t,children:(0,A.jsx)(He,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:u.useCallback(()=>d(e=>e+1),[]),onToastRemove:u.useCallback(()=>d(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:f,isClosePausedRef:p,children:o})})};We.displayName=Ie;var Ge=`ToastViewport`,Ke=[`F8`],qe=`toast.viewportPause`,Je=`toast.viewportResume`,Ye=u.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=Ke,label:i=`Notifications ({hotkey})`,...a}=e,o=Ue(Ge,n),s=Re(n),c=u.useRef(null),l=u.useRef(null),d=u.useRef(null),f=u.useRef(null),p=D(t,f,o.onViewportChange),m=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),h=o.toastCount>0;u.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&f.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),u.useEffect(()=>{let e=c.current,t=f.current;if(h&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(qe);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(Je);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[h,o.isClosePausedRef]);let g=u.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...St(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return u.useEffect(()=>{let e=f.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=g({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Ct(i.slice(a+1))?t.preventDefault():r?l.current?.focus():d.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,g]),(0,A.jsxs)(ye,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,m),tabIndex:-1,style:{pointerEvents:h?void 0:`none`},children:[h&&(0,A.jsx)(Ze,{ref:l,onFocusFromOutsideViewport:()=>{Ct(g({tabbingDirection:`forwards`}))}}),(0,A.jsx)(Le.Slot,{scope:n,children:(0,A.jsx)(z.ol,{tabIndex:-1,...a,ref:p})}),h&&(0,A.jsx)(Ze,{ref:d,onFocusFromOutsideViewport:()=>{Ct(g({tabbingDirection:`backwards`}))}})]})});Ye.displayName=Ge;var Xe=`ToastFocusProxy`,Ze=u.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=Ue(Xe,n);return(0,A.jsx)(Pe,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});Ze.displayName=Xe;var Qe=`Toast`,$e=`toast.swipeStart`,et=`toast.swipeMove`,tt=`toast.swipeCancel`,nt=`toast.swipeEnd`,rt=u.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=ke({prop:r,defaultProp:i??!0,onChange:a,caller:Qe});return(0,A.jsx)(we,{present:n||s,children:(0,A.jsx)(ot,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:ie(e.onPause),onResume:ie(e.onResume),onSwipeStart:w(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:w(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:w(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:w(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});rt.displayName=Qe;var[it,at]=Be(Qe,{onClose(){}}),ot=u.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:d,onSwipeMove:f,onSwipeCancel:p,onSwipeEnd:m,...h}=e,g=Ue(Qe,n),[_,v]=u.useState(null),y=D(t,e=>v(e)),b=u.useRef(null),x=u.useRef(null),S=i||g.duration,T=u.useRef(0),E=u.useRef(S),O=u.useRef(0),{onToastAdd:k,onToastRemove:j}=g,M=ie(()=>{_?.contains(document.activeElement)&&g.viewport?.focus(),o()}),N=u.useCallback(e=>{!e||e===1/0||(window.clearTimeout(O.current),T.current=new Date().getTime(),O.current=window.setTimeout(M,e))},[M]);u.useEffect(()=>{let e=g.viewport;if(e){let t=()=>{N(E.current),l?.()},n=()=>{let e=new Date().getTime()-T.current;E.current-=e,window.clearTimeout(O.current),c?.()};return e.addEventListener(qe,n),e.addEventListener(Je,t),()=>{e.removeEventListener(qe,n),e.removeEventListener(Je,t)}}},[g.viewport,S,c,l,N]),u.useEffect(()=>{a&&!g.isClosePausedRef.current&&N(S)},[a,S,g.isClosePausedRef,N]),u.useEffect(()=>(k(),()=>j()),[k,j]);let P=u.useMemo(()=>_?_t(_):null,[_]);return g.viewport?(0,A.jsxs)(A.Fragment,{children:[P&&(0,A.jsx)(st,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:P}),(0,A.jsx)(it,{scope:n,onClose:M,children:C.createPortal((0,A.jsx)(Le.ItemSlot,{scope:n,children:(0,A.jsx)(ve,{asChild:!0,onEscapeKeyDown:w(s,()=>{g.isFocusedToastEscapeKeyDownRef.current||M(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,A.jsx)(z.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":g.swipeDirection,...h,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:w(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,M()))}),onPointerDown:w(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:w(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(g.swipeDirection),a=[`left`,`up`].includes(g.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},u={originalEvent:e,delta:l};r?(x.current=l,vt(et,f,u,{discrete:!1})):yt(l,g.swipeDirection,c)?(x.current=l,vt($e,d,u,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:w(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};yt(t,g.swipeDirection,g.swipeThreshold)?vt(nt,m,r,{discrete:!0}):vt(tt,p,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),st=e=>{let{__scopeToast:t,children:n,...r}=e,i=Ue(Qe,t),[a,o]=u.useState(!1),[s,c]=u.useState(!1);return bt(()=>o(!0)),u.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,A.jsx)(Se,{asChild:!0,children:(0,A.jsx)(Pe,{...r,children:a&&(0,A.jsxs)(A.Fragment,{children:[i.label,` `,n]})})})},ct=`ToastTitle`,lt=u.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,A.jsx)(z.div,{...r,ref:t})});lt.displayName=ct;var ut=`ToastDescription`,dt=u.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,A.jsx)(z.div,{...r,ref:t})});dt.displayName=ut;var ft=`ToastAction`,pt=u.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,A.jsx)(gt,{altText:n,asChild:!0,children:(0,A.jsx)(ht,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${ft}\`. Expected non-empty \`string\`.`),null)});pt.displayName=ft;var mt=`ToastClose`,ht=u.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=at(mt,n);return(0,A.jsx)(gt,{asChild:!0,children:(0,A.jsx)(z.button,{type:`button`,...r,ref:t,onClick:w(e.onClick,i.onClose)})})});ht.displayName=mt;var gt=u.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,A.jsx)(z.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function _t(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),xt(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(..._t(e))}}),t}function vt(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?re(i,a):i.dispatchEvent(a)}var yt=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function bt(e=()=>{}){let t=ie(e);be(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function xt(e){return e.nodeType===e.ELEMENT_NODE}function St(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ct(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var wt=We,Tt=Ye,Et=rt,Dt=lt,Ot=dt,kt=pt,At=ht;function jt(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=jt(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Mt(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=jt(e))&&(r&&(r+=` `),r+=t);return r}var Nt=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Pt=Mt,Ft=(e,t)=>n=>{if(t?.variants==null)return Pt(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Nt(t)||Nt(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Pt(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},It=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Lt=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Rt={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`},zt=(0,u.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,u.createElement)(`svg`,{ref:c,...Rt,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Lt(`lucide`,i),...s},[...o.map(([e,t])=>(0,u.createElement)(e,t)),...Array.isArray(a)?a:[a]])),V=(e,t)=>{let n=(0,u.forwardRef)(({className:n,...r},i)=>(0,u.createElement)(zt,{ref:i,iconNode:t,className:Lt(`lucide-${It(e)}`,n),...r}));return n.displayName=`${e}`,n},Bt=V(`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-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Vt=V(`ArrowLeft`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Ht=V(`ArrowRight`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Ut=V(`ArrowUpRight`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Wt=V(`Award`,[[`path`,{d:`m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526`,key:`1yiouv`}],[`circle`,{cx:`12`,cy:`8`,r:`6`,key:`1vp47v`}]]),Gt=V(`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`}]]),Kt=V(`BookOpen`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),qt=V(`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`}]]),Jt=V(`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`}]]),Yt=V(`Briefcase`,[[`path`,{d:`M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16`,key:`jecpp`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`6`,rx:`2`,key:`i6l2r4`}]]),Xt=V(`Cable`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),Zt=V(`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`}]]),Qt=V(`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`}]]),$t=V(`Check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),en=V(`ChevronDown`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),tn=V(`ChevronLeft`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),nn=V(`ChevronRight`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),rn=V(`ChevronUp`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),an=V(`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`}]]),on=V(`CircleArrowUp`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),sn=V(`CircleCheck`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),cn=V(`CircleMinus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),ln=V(`CircleStop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),un=V(`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`}]]),dn=V(`Circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),fn=V(`Clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16 14`,key:`68esgv`}]]),pn=V(`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`}]]),mn=V(`Code`,[[`polyline`,{points:`16 18 22 12 16 6`,key:`z7tu5w`}],[`polyline`,{points:`8 6 2 12 8 18`,key:`1eg1df`}]]),hn=V(`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`}]]),gn=V(`Cpu`,[[`rect`,{width:`16`,height:`16`,x:`4`,y:`4`,rx:`2`,key:`14l7u7`}],[`rect`,{width:`6`,height:`6`,x:`9`,y:`9`,rx:`1`,key:`5aljv4`}],[`path`,{d:`M15 2v2`,key:`13l42r`}],[`path`,{d:`M15 20v2`,key:`15mkzm`}],[`path`,{d:`M2 15h2`,key:`1gxd5l`}],[`path`,{d:`M2 9h2`,key:`1bbxkp`}],[`path`,{d:`M20 15h2`,key:`19e6y8`}],[`path`,{d:`M20 9h2`,key:`19tzq7`}],[`path`,{d:`M9 2v2`,key:`165o2o`}],[`path`,{d:`M9 20v2`,key:`i2bqo8`}]]),_n=V(`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`}]]),vn=V(`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`}]]),yn=V(`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`}]]),bn=V(`Dot`,[[`circle`,{cx:`12.1`,cy:`12.1`,r:`1`,key:`18d7e5`}]]),xn=V(`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`}]]),Sn=V(`Earth`,[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Cn=V(`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`}]]),wn=V(`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`}]]),Tn=V(`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`}]]),En=V(`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`}]]),Dn=V(`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`}]]),On=V(`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`}]]),kn=V(`Fingerprint`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),An=V(`FolderKanban`,[[`path`,{d:`M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z`,key:`1fr9dc`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M12 10v2`,key:`hh53o1`}],[`path`,{d:`M16 10v6`,key:`1d6xys`}]]),jn=V(`FolderOpen`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Mn=V(`Gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Nn=V(`GitBranch`,[[`line`,{x1:`6`,x2:`6`,y1:`3`,y2:`15`,key:`17qcm7`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M18 9a9 9 0 0 1-9 9`,key:`n2h4wq`}]]),Pn=V(`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`}]]),Fn=V(`GraduationCap`,[[`path`,{d:`M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z`,key:`j76jl0`}],[`path`,{d:`M22 10v6`,key:`1lu8f3`}],[`path`,{d:`M6 12.5V16a6 3 0 0 0 12 0v-3.5`,key:`1r8lef`}]]),In=V(`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`}]]),Ln=V(`Hammer`,[[`path`,{d:`m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9`,key:`eefl8a`}],[`path`,{d:`m18 15 4-4`,key:`16gjal`}],[`path`,{d:`m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5`,key:`b7pghm`}]]),Rn=V(`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`}]]),zn=V(`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`}]]),Bn=V(`Hexagon`,[[`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`,key:`yt0hxn`}]]),Vn=V(`History`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),Hn=V(`Info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Un=V(`KeyRound`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Wn=V(`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`}]]),Gn=V(`Languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),Kn=V(`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`}]]),qn=V(`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`}]]),Jn=V(`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`}]]),Yn=V(`LoaderCircle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Xn=V(`LockOpen`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]),Zn=V(`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`}]]),Qn=V(`MemoryStick`,[[`path`,{d:`M6 19v-3`,key:`1nvgqn`}],[`path`,{d:`M10 19v-3`,key:`iu8nkm`}],[`path`,{d:`M14 19v-3`,key:`kcehxu`}],[`path`,{d:`M18 19v-3`,key:`1vh91z`}],[`path`,{d:`M8 11V9`,key:`63erz4`}],[`path`,{d:`M16 11V9`,key:`fru6f3`}],[`path`,{d:`M12 11V9`,key:`ha00sb`}],[`path`,{d:`M2 15h20`,key:`16ne18`}],[`path`,{d:`M2 7a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v1.1a2 2 0 0 0 0 3.837V17a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-5.1a2 2 0 0 0 0-3.837Z`,key:`lhddv3`}]]),$n=V(`MessageCircle`,[[`path`,{d:`M7.9 20A9 9 0 1 0 4 16.1L2 22Z`,key:`vv11sd`}]]),er=V(`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`}]]),tr=V(`Mic`,[[`path`,{d:`M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z`,key:`131961`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}]]),nr=V(`Network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),rr=V(`PanelLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),ir=V(`PanelsTopLeft`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),ar=V(`Pause`,[[`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`zuxfzm`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,rx:`1`,key:`1okwgv`}]]),or=V(`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`}]]),sr=V(`Pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),cr=V(`Play`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),lr=V(`Plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),ur=V(`Power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),dr=V(`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`}]]),fr=V(`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`}]]),pr=V(`RotateCcw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),mr=V(`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`}]]),hr=V(`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`}]]),gr=V(`Search`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`path`,{d:`m21 21-4.3-4.3`,key:`1qie3q`}]]),_r=V(`SendHorizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),vr=V(`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`}]]),yr=V(`Server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),br=V(`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`}]]),xr=V(`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`}]]),Sr=V(`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`}]]),Cr=V(`ShieldCheck`,[[`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:`m9 12 2 2 4-4`,key:`dzmm74`}]]),wr=V(`ShieldOff`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Tr=V(`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`}]]),Er=V(`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`}]]),Dr=V(`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`}]]),Or=V(`Square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),kr=V(`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`}]]),Ar=V(`StickyNote`,[[`path`,{d:`M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z`,key:`qazsjp`}],[`path`,{d:`M15 3v4a2 2 0 0 0 2 2h4`,key:`40519r`}]]),jr=V(`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`}]]),Mr=V(`Terminal`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),Nr=V(`Trash2`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Pr=V(`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`}]]),Fr=V(`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`}]]),Ir=V(`Trophy`,[[`path`,{d:`M6 9H4.5a2.5 2.5 0 0 1 0-5H6`,key:`17hqa7`}],[`path`,{d:`M18 9h1.5a2.5 2.5 0 0 0 0-5H18`,key:`lmptdp`}],[`path`,{d:`M4 22h16`,key:`57wxv0`}],[`path`,{d:`M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22`,key:`1nw9bq`}],[`path`,{d:`M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22`,key:`1np0yb`}],[`path`,{d:`M18 2H6v7a6 6 0 0 0 12 0V2Z`,key:`u46fv3`}]]),Lr=V(`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`}]]),Rr=V(`Volume2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),zr=V(`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`}]]),Br=V(`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`}],[`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`}]]),Vr=V(`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`}]]),Hr=V(`Wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),Ur=V(`X`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Wr=V(`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`}]]),Gr=V(`ZoomIn`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Kr=V(`ZoomOut`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),qr=`-`,Jr=e=>{let t=Qr(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{let n=e.split(qr);return n[0]===``&&n.length!==1&&n.shift(),Yr(n,t)||Zr(e)},getConflictingClassGroupIds:(e,t)=>{let i=n[e]||[];return t&&r[e]?[...i,...r[e]]:i}}},Yr=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),i=r?Yr(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;let a=e.join(qr);return t.validators.find(({validator:e})=>e(a))?.classGroupId},Xr=/^\[(.+)\]$/,Zr=e=>{if(Xr.test(e)){let t=Xr.exec(e)[1],n=t?.substring(0,t.indexOf(`:`));if(n)return`arbitrary..`+n}},Qr=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ni(Object.entries(e.classGroups),n).forEach(([e,n])=>{$r(n,r,e,t)}),r},$r=(e,t,n,r)=>{e.forEach(e=>{if(typeof e==`string`){let r=e===``?t:ei(t,e);r.classGroupId=n;return}if(typeof e==`function`){if(ti(e)){$r(e(r),t,n,r);return}t.validators.push({validator:e,classGroupId:n});return}Object.entries(e).forEach(([e,i])=>{$r(i,ei(t,e),n,r)})})},ei=(e,t)=>{let n=e;return t.split(qr).forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},ti=e=>e.isThemeGetter,ni=(e,t)=>t?e.map(([e,n])=>[e,n.map(e=>typeof e==`string`?t+e:typeof e==`object`?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e)]):e,ri=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=new Map,r=new Map,i=(i,a)=>{n.set(i,a),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);if(t!==void 0)return t;if((t=r.get(e))!==void 0)return i(e,t),t},set(e,t){n.has(e)?n.set(e,t):i(e,t)}}},ii=`!`,ai=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],a=t.length,o=e=>{let n=[],o=0,s=0,c;for(let l=0;l<e.length;l++){let u=e[l];if(o===0){if(u===i&&(r||e.slice(l,l+a)===t)){n.push(e.slice(s,l)),s=l+a;continue}if(u===`/`){c=l;continue}}u===`[`?o++:u===`]`&&o--}let l=n.length===0?e:e.substring(s),u=l.startsWith(ii);return{modifiers:n,hasImportantModifier:u,baseClassName:u?l.substring(1):l,maybePostfixModifierPosition:c&&c>s?c-s:void 0}};return n?e=>n({className:e,parseClassName:o}):o},oi=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(e=>{e[0]===`[`?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},si=e=>({cache:ri(e.cacheSize),parseClassName:ai(e),...Jr(e)}),ci=/\s+/,li=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,a=[],o=e.trim().split(ci),s=``;for(let e=o.length-1;e>=0;--e){let t=o[e],{modifiers:c,hasImportantModifier:l,baseClassName:u,maybePostfixModifierPosition:d}=n(t),f=!!d,p=r(f?u.substring(0,d):u);if(!p){if(!f){s=t+(s.length>0?` `+s:s);continue}if(p=r(u),!p){s=t+(s.length>0?` `+s:s);continue}f=!1}let m=oi(c).join(`:`),h=l?m+ii:m,g=h+p;if(a.includes(g))continue;a.push(g);let _=i(p,f);for(let e=0;e<_.length;++e){let t=_[e];a.push(h+t)}s=t+(s.length>0?` `+s:s)}return s};function ui(){let e=0,t,n,r=``;for(;e<arguments.length;)(t=arguments[e++])&&(n=di(t))&&(r&&(r+=` `),r+=n);return r}var di=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=di(e[r]))&&(n&&(n+=` `),n+=t);return n};function fi(e,...t){let n,r,i,a=o;function o(o){return n=si(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)}function s(e){let t=r(e);if(t)return t;let a=li(e,n);return i(e,a),a}return function(){return a(ui.apply(null,arguments))}}var pi=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},mi=/^\[(?:([a-z-]+):)?(.+)\]$/i,hi=/^\d+\/\d+$/,gi=new Set([`px`,`full`,`screen`]),_i=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vi=/\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$/,yi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Si=e=>wi(e)||gi.has(e)||hi.test(e),Ci=e=>Li(e,`length`,Ri),wi=e=>!!e&&!Number.isNaN(Number(e)),Ti=e=>Li(e,`number`,wi),Ei=e=>!!e&&Number.isInteger(Number(e)),Di=e=>e.endsWith(`%`)&&wi(e.slice(0,-1)),Oi=e=>mi.test(e),ki=e=>_i.test(e),Ai=new Set([`length`,`size`,`percentage`]),ji=e=>Li(e,Ai,zi),Mi=e=>Li(e,`position`,zi),Ni=new Set([`image`,`url`]),Pi=e=>Li(e,Ni,Vi),Fi=e=>Li(e,``,Bi),Ii=()=>!0,Li=(e,t,n)=>{let r=mi.exec(e);return r?r[1]?typeof t==`string`?r[1]===t:t.has(r[1]):n(r[2]):!1},Ri=e=>vi.test(e)&&!yi.test(e),zi=()=>!1,Bi=e=>bi.test(e),Vi=e=>xi.test(e),Hi=fi(()=>{let e=pi(`colors`),t=pi(`spacing`),n=pi(`blur`),r=pi(`brightness`),i=pi(`borderColor`),a=pi(`borderRadius`),o=pi(`borderSpacing`),s=pi(`borderWidth`),c=pi(`contrast`),l=pi(`grayscale`),u=pi(`hueRotate`),d=pi(`invert`),f=pi(`gap`),p=pi(`gradientColorStops`),m=pi(`gradientColorStopPositions`),h=pi(`inset`),g=pi(`margin`),_=pi(`opacity`),v=pi(`padding`),y=pi(`saturate`),b=pi(`scale`),x=pi(`sepia`),S=pi(`skew`),C=pi(`space`),w=pi(`translate`),T=()=>[`auto`,`contain`,`none`],E=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],D=()=>[`auto`,Oi,t],O=()=>[Oi,t],k=()=>[``,Si,Ci],A=()=>[`auto`,wi,Oi],j=()=>[`bottom`,`center`,`left`,`left-bottom`,`left-top`,`right`,`right-bottom`,`right-top`,`top`],M=()=>[`solid`,`dashed`,`dotted`,`double`,`none`],N=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],P=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`],F=()=>[``,`0`,Oi],ee=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],I=()=>[wi,Oi];return{cacheSize:500,separator:`:`,theme:{colors:[Ii],spacing:[Si,Ci],blur:[`none`,``,ki,Oi],brightness:I(),borderColor:[e],borderRadius:[`none`,``,`full`,ki,Oi],borderSpacing:O(),borderWidth:k(),contrast:I(),grayscale:F(),hueRotate:I(),invert:F(),gap:O(),gradientColorStops:[e],gradientColorStopPositions:[Di,Ci],inset:D(),margin:D(),opacity:I(),padding:O(),saturate:I(),scale:I(),sepia:F(),skew:I(),space:O(),translate:O()},classGroups:{aspect:[{aspect:[`auto`,`square`,`video`,Oi]}],container:[`container`],columns:[{columns:[ki]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"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:[...j(),Oi]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[`auto`,Ei,Oi]}],basis:[{basis:D()}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`wrap`,`wrap-reverse`,`nowrap`]}],flex:[{flex:[`1`,`auto`,`initial`,`none`,Oi]}],grow:[{grow:F()}],shrink:[{shrink:F()}],order:[{order:[`first`,`last`,`none`,Ei,Oi]}],"grid-cols":[{"grid-cols":[Ii]}],"col-start-end":[{col:[`auto`,{span:[`full`,Ei,Oi]},Oi]}],"col-start":[{"col-start":A()}],"col-end":[{"col-end":A()}],"grid-rows":[{"grid-rows":[Ii]}],"row-start-end":[{row:[`auto`,{span:[Ei,Oi]},Oi]}],"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`,Oi]}],"auto-rows":[{"auto-rows":[`auto`,`min`,`max`,`fr`,Oi]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:[`normal`,...P()]}],"justify-items":[{"justify-items":[`start`,`end`,`center`,`stretch`]}],"justify-self":[{"justify-self":[`auto`,`start`,`end`,`center`,`stretch`]}],"align-content":[{content:[`normal`,...P(),`baseline`]}],"align-items":[{items:[`start`,`end`,`center`,`baseline`,`stretch`]}],"align-self":[{self:[`auto`,`start`,`end`,`center`,`stretch`,`baseline`]}],"place-content":[{"place-content":[...P(),`baseline`]}],"place-items":[{"place-items":[`start`,`end`,`center`,`baseline`,`stretch`]}],"place-self":[{"place-self":[`auto`,`start`,`end`,`center`,`stretch`]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"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`,Oi,t]}],"min-w":[{"min-w":[Oi,t,`min`,`max`,`fit`]}],"max-w":[{"max-w":[Oi,t,`none`,`full`,`min`,`max`,`fit`,`prose`,{screen:[ki]},ki]}],h:[{h:[Oi,t,`auto`,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"min-h":[{"min-h":[Oi,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],"max-h":[{"max-h":[Oi,t,`min`,`max`,`fit`,`svh`,`lvh`,`dvh`]}],size:[{size:[Oi,t,`auto`,`min`,`max`,`fit`]}],"font-size":[{text:[`base`,ki,Ci]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`,Ti]}],"font-family":[{font:[Ii]}],"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`,Oi]}],"line-clamp":[{"line-clamp":[`none`,wi,Ti]}],leading:[{leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`,Si,Oi]}],"list-image":[{"list-image":[`none`,Oi]}],"list-style-type":[{list:[`none`,`disc`,`decimal`,Oi]}],"list-style-position":[{list:[`inside`,`outside`]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[_]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[_]}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...M(),`wavy`]}],"text-decoration-thickness":[{decoration:[`auto`,`from-font`,Si,Ci]}],"underline-offset":[{"underline-offset":[`auto`,Si,Oi]}],"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:O()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Oi]}],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`,Oi]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-opacity":[{"bg-opacity":[_]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:[...j(),Mi]}],"bg-repeat":[{bg:[`no-repeat`,{repeat:[``,`x`,`y`,`round`,`space`]}]}],"bg-size":[{bg:[`auto`,`cover`,`contain`,ji]}],"bg-image":[{bg:[`none`,{"gradient-to":[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Pi]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[_]}],"border-style":[{border:[...M(),`hidden`]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":[`divide-y-reverse`],"divide-opacity":[{"divide-opacity":[_]}],"divide-style":[{divide:M()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[i]}],"border-color-t":[{"border-t":[i]}],"border-color-r":[{"border-r":[i]}],"border-color-b":[{"border-b":[i]}],"border-color-l":[{"border-l":[i]}],"divide-color":[{divide:[i]}],"outline-style":[{outline:[``,...M()]}],"outline-offset":[{"outline-offset":[Si,Oi]}],"outline-w":[{outline:[Si,Ci]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:k()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[_]}],"ring-offset-w":[{"ring-offset":[Si,Ci]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:[``,`inner`,`none`,ki,Fi]}],"shadow-color":[{shadow:[Ii]}],opacity:[{opacity:[_]}],"mix-blend":[{"mix-blend":[...N(),`plus-lighter`,`plus-darker`]}],"bg-blend":[{"bg-blend":N()}],filter:[{filter:[``,`none`]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":[``,`none`,ki,Oi]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":[``,`none`]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[_]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"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`,Oi]}],duration:[{duration:I()}],ease:[{ease:[`linear`,`in`,`out`,`in-out`,Oi]}],delay:[{delay:I()}],animate:[{animate:[`none`,`spin`,`ping`,`pulse`,`bounce`,Oi]}],transform:[{transform:[``,`gpu`,`none`]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ei,Oi]}],"translate-x":[{"translate-x":[w]}],"translate-y":[{"translate-y":[w]}],"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`,Oi]}],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`,Oi]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":[`none`,`auto`]}],resize:[{resize:[`none`,`y`,`x`,``]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Oi]}],fill:[{fill:[e,`none`]}],"stroke-w":[{stroke:[Si,Ci,Ti]}],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`]}}});function H(...e){return Hi(Mt(e))}function Ui(){return typeof crypto<`u`&&typeof crypto.randomUUID==`function`?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)})}var Wi=wt,Gi=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Tt,{ref:n,className:H(`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}));Gi.displayName=Tt.displayName;var Ki=Ft(`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`}}),qi=u.forwardRef(({className:e,variant:t,...n},r)=>(0,A.jsx)(Et,{ref:r,className:H(Ki({variant:t}),e),...n}));qi.displayName=Et.displayName;var Ji=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(kt,{ref:n,className:H(`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}));Ji.displayName=kt.displayName;var Yi=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(At,{ref:n,className:H(`absolute right-2 top-2 rounded-md p-1 text-foreground/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:(0,A.jsx)(Ur,{className:`h-4 w-4`})}));Yi.displayName=At.displayName;var Xi=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Dt,{ref:n,className:H(`text-sm font-semibold`,e),...t}));Xi.displayName=Dt.displayName;var Zi=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Ot,{ref:n,className:H(`text-sm opacity-90`,e),...t}));Zi.displayName=Ot.displayName;function Qi(){let{toasts:e}=S();return(0,A.jsxs)(Wi,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,A.jsxs)(qi,{...i,children:[(0,A.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,A.jsx)(Xi,{children:t}),n&&(0,A.jsx)(Zi,{children:n})]}),r,(0,A.jsx)(Yi,{})]},e)}),(0,A.jsx)(Gi,{})]})}var $i=[`light`,`dark`],ea=`(prefers-color-scheme: dark)`,ta=u.createContext(void 0),na={setTheme:e=>{},themes:[]},ra=()=>u.useContext(ta)??na;u.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,attrs:s,nonce:c})=>{let l=a===`system`,d=n===`class`?`var d=document.documentElement,c=d.classList;${`c.remove(${s.map(e=>`'${e}'`).join(`,`)})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,f=i?$i.includes(a)&&a?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${a}'`:`if(e==='light'||e==='dark')d.style.colorScheme=e`:``,p=(e,t=!1,r=!0)=>{let a=o?o[e]:e,s=t?e+`|| ''`:`'${a}'`,c=``;return i&&r&&!t&&$i.includes(e)&&(c+=`d.style.colorScheme = '${e}';`),n===`class`?t||a?c+=`c.add(${s})`:c+=`null`:a&&(c+=`d[s](n,${s})`),c},m=e?`!function(){${d}${p(e)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${l})){var t='${ea}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p(`dark`)}}else{${p(`light`)}}}else if(e){${o?`var x=${JSON.stringify(o)};`:``}${p(o?`x[e]`:`e`,!0)}}${l?``:`else{`+p(a,!1,!1)+`}`}${f}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${t}');if(e){${o?`var x=${JSON.stringify(o)};`:``}${p(o?`x[e]`:`e`,!0)}}else{${p(a,!1,!1)};}${f}}catch(t){}}();`;return u.createElement(`script`,{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var ia=e=>{switch(e){case`success`:return sa;case`info`:return la;case`warning`:return ca;case`error`:return ua;default:return null}},aa=Array(12).fill(0),oa=({visible:e,className:t})=>u.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},u.createElement(`div`,{className:`sonner-spinner`},aa.map((e,t)=>u.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),sa=u.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},u.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`})),ca=u.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},u.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`})),la=u.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},u.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`})),ua=u.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},u.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`})),da=u.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`},u.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),u.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),fa=()=>{let[e,t]=u.useState(document.hidden);return u.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},pa=1,ma=new 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=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:pa++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.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)=>this.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`?void 0:t.description}));let r=e instanceof Promise?e:e(),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],u.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(ga(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:n,type:`error`,message:r,description:a})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`success`,message:r,description:a})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description;this.create({id:n,type:`error`,message:r,description:a})}}).finally(()=>{var e;i&&(this.dismiss(n),n=void 0),(e=t.finally)==null||e.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||pa++;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}},ha=(e,t)=>{let n=t?.id||pa++;return ma.addToast({title:e,...t,id:n}),n},ga=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(ha,{success:ma.success,info:ma.info,warning:ma.warning,error:ma.error,custom:ma.custom,message:ma.message,promise:ma.promise,dismiss:ma.dismiss,loading:ma.loading},{getHistory:()=>ma.toasts,getToasts:()=>ma.getActiveToasts()});function _a(e,{insertAt:t}={}){if(!e||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))}_a(`: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;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);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}: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%);--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%)}
10
+ `);function va(e){return e.label!==void 0}var ya=3,ba=`32px`,xa=`16px`,Sa=4e3,Ca=356,wa=14,Ta=20,Ea=200;function Da(...e){return e.filter(Boolean).join(` `)}function Oa(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var ka=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:l,expanded:d,removeToast:f,defaultRichColors:p,closeButton:m,style:h,cancelButtonStyle:g,actionButtonStyle:_,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,loadingIcon:C,expandByDefault:w,classNames:T,icons:E,closeButtonAriaLabel:D=`Close toast`,pauseWhenPageIsHidden:O}=e,[k,A]=u.useState(null),[j,M]=u.useState(null),[N,P]=u.useState(!1),[F,ee]=u.useState(!1),[I,L]=u.useState(!1),[R,te]=u.useState(!1),[ne,z]=u.useState(!1),[re,ie]=u.useState(0),[ae,oe]=u.useState(0),se=u.useRef(n.duration||b||Sa),B=u.useRef(null),ce=u.useRef(null),le=c===0,ue=c+1<=o,de=n.type,fe=n.dismissible!==!1,pe=n.className||``,me=n.descriptionClassName||``,he=u.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),ge=u.useMemo(()=>n.closeButton??m,[n.closeButton,m]),_e=u.useMemo(()=>n.duration||b||Sa,[n.duration,b]),ve=u.useRef(0),ye=u.useRef(0),be=u.useRef(0),xe=u.useRef(null),[Se,Ce]=x.split(`-`),we=u.useMemo(()=>s.reduce((e,t,n)=>n>=he?e:e+t.height,0),[s,he]),Te=fa(),Ee=n.invert||t,De=de===`loading`;ye.current=u.useMemo(()=>he*S+we,[he,we]),u.useEffect(()=>{se.current=_e},[_e]),u.useEffect(()=>{P(!0)},[]),u.useEffect(()=>{let e=ce.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),u.useLayoutEffect(()=>{if(!N)return;let e=ce.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[N,n.title,n.description,a,n.id]);let Oe=u.useCallback(()=>{ee(!0),ie(ye.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{f(n)},Ea)},[n,f,a,ye]);u.useEffect(()=>{if(n.promise&&de===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return d||i||O&&Te?(()=>{if(be.current<ve.current){let e=new Date().getTime()-ve.current;se.current-=e}be.current=new Date().getTime()})():se.current!==1/0&&(ve.current=new Date().getTime(),e=setTimeout(()=>{var e;(e=n.onAutoClose)==null||e.call(n,n),Oe()},se.current)),()=>clearTimeout(e)},[d,i,n,de,O,Te,Oe]),u.useEffect(()=>{n.delete&&Oe()},[Oe,n.delete]);function ke(){return E!=null&&E.loading?u.createElement(`div`,{className:Da(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":de===`loading`},E.loading):C?u.createElement(`div`,{className:Da(T?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":de===`loading`},C):u.createElement(oa,{className:Da(T?.loader,n?.classNames?.loader),visible:de===`loading`})}return u.createElement(`li`,{tabIndex:0,ref:ce,className:Da(v,pe,T?.toast,n?.classNames?.toast,T?.default,T?.[de],n?.classNames?.[de]),"data-sonner-toast":``,"data-rich-colors":n.richColors??p,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":N,"data-promise":!!n.promise,"data-swiped":ne,"data-removed":F,"data-visible":ue,"data-y-position":Se,"data-x-position":Ce,"data-index":c,"data-front":le,"data-swiping":I,"data-dismissible":fe,"data-type":de,"data-invert":Ee,"data-swipe-out":R,"data-swipe-direction":j,"data-expanded":!!(d||w&&N),style:{"--index":c,"--toasts-before":c,"--z-index":l.length-c,"--offset":`${F?re:ye.current}px`,"--initial-height":w?`auto`:`${ae}px`,...h,...n.style},onDragEnd:()=>{L(!1),A(null),xe.current=null},onPointerDown:e=>{De||!fe||(B.current=new Date,ie(ye.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(L(!0),xe.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e;if(R||!fe)return;xe.current=null;let t=Number(ce.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),r=Number(ce.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),i=new Date().getTime()-B.current?.getTime(),a=k===`x`?t:r,o=Math.abs(a)/i;if(Math.abs(a)>=Ta||o>.11){ie(ye.current),(e=n.onDismiss)==null||e.call(n,n),M(k===`x`?t>0?`right`:`left`:r>0?`down`:`up`),Oe(),te(!0),z(!1);return}L(!1),A(null)},onPointerMove:t=>{var n,r;if(!xe.current||!fe||window.getSelection()?.toString().length>0)return;let i=t.clientY-xe.current.y,a=t.clientX-xe.current.x,o=e.swipeDirections??Oa(x);!k&&(Math.abs(a)>1||Math.abs(i)>1)&&A(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0};k===`y`?(o.includes(`top`)||o.includes(`bottom`))&&(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)&&(s.y=i):k===`x`&&(o.includes(`left`)||o.includes(`right`))&&(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)&&(s.x=a),(Math.abs(s.x)>0||Math.abs(s.y)>0)&&z(!0),(n=ce.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ce.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx?u.createElement(`button`,{"aria-label":D,"data-disabled":De,"data-close-button":!0,onClick:De||!fe?()=>{}:()=>{var e;Oe(),(e=n.onDismiss)==null||e.call(n,n)},className:Da(T?.closeButton,n?.classNames?.closeButton)},E?.close??da):null,n.jsx||(0,u.isValidElement)(n.title)?n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title:u.createElement(u.Fragment,null,de||n.icon||n.promise?u.createElement(`div`,{"data-icon":``,className:Da(T?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||ke():null,n.type===`loading`?null:n.icon||E?.[de]||ia(de)):null,u.createElement(`div`,{"data-content":``,className:Da(T?.content,n?.classNames?.content)},u.createElement(`div`,{"data-title":``,className:Da(T?.title,n?.classNames?.title)},typeof n.title==`function`?n.title():n.title),n.description?u.createElement(`div`,{"data-description":``,className:Da(y,me,T?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),(0,u.isValidElement)(n.cancel)?n.cancel:n.cancel&&va(n.cancel)?u.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{var t,r;va(n.cancel)&&fe&&((r=(t=n.cancel).onClick)==null||r.call(t,e),Oe())},className:Da(T?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,(0,u.isValidElement)(n.action)?n.action:n.action&&va(n.action)?u.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||_,onClick:e=>{var t,r;va(n.action)&&((r=(t=n.action).onClick)==null||r.call(t,e),!e.defaultPrevented&&Oe())},className:Da(T?.actionButton,n?.classNames?.actionButton)},n.action.label):null))};function Aa(){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 ja(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?xa:ba;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var Ma=(0,u.forwardRef)(function(e,t){let{invert:n,position:r=`bottom-right`,hotkey:i=[`altKey`,`KeyT`],expand:a,closeButton:o,className:s,offset:c,mobileOffset:l,theme:d=`light`,richColors:f,duration:p,style:m,visibleToasts:h=ya,toastOptions:g,dir:_=Aa(),gap:v=wa,loadingIcon:y,icons:b,containerAriaLabel:x=`Notifications`,pauseWhenPageIsHidden:S}=e,[w,T]=u.useState([]),E=u.useMemo(()=>Array.from(new Set([r].concat(w.filter(e=>e.position).map(e=>e.position)))),[w,r]),[D,O]=u.useState([]),[k,A]=u.useState(!1),[j,M]=u.useState(!1),[N,P]=u.useState(d===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:d),F=u.useRef(null),ee=i.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),I=u.useRef(null),L=u.useRef(!1),R=u.useCallback(e=>{T(t=>{var n;return(n=t.find(t=>t.id===e.id))!=null&&n.delete||ma.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return u.useEffect(()=>ma.subscribe(e=>{if(e.dismiss){T(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));return}setTimeout(()=>{C.flushSync(()=>{T(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[]),u.useEffect(()=>{if(d!==`system`){P(d);return}if(d===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[d]),u.useEffect(()=>{w.length<=1&&A(!1)},[w]),u.useEffect(()=>{let e=e=>{var t,n;i.every(t=>e[t]||e.code===t)&&(A(!0),(t=F.current)==null||t.focus()),e.code===`Escape`&&(document.activeElement===F.current||(n=F.current)!=null&&n.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[i]),u.useEffect(()=>{if(F.current)return()=>{I.current&&(I.current.focus({preventScroll:!0}),I.current=null,L.current=!1)}},[F.current]),u.createElement(`section`,{ref:t,"aria-label":`${x} ${ee}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,r)=>{let[i,d]=t.split(`-`);return w.length?u.createElement(`ol`,{key:t,dir:_===`auto`?Aa():_,tabIndex:-1,ref:F,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":i,"data-lifted":k&&w.length>1&&!a,"data-x-position":d,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${Ca}px`,"--gap":`${v}px`,...m,...ja(c,l)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,I.current&&=(I.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||L.current||(L.current=!0,I.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},w.filter(e=>!e.position&&r===0||e.position===t).map((r,i)=>u.createElement(ka,{key:r.id,icons:b,index:i,toast:r,defaultRichColors:f,duration:g?.duration??p,className:g?.className,descriptionClassName:g?.descriptionClassName,invert:n,visibleToasts:h,closeButton:g?.closeButton??o,interacting:j,position:t,style:g?.style,unstyled:g?.unstyled,classNames:g?.classNames,cancelButtonStyle:g?.cancelButtonStyle,actionButtonStyle:g?.actionButtonStyle,removeToast:R,toasts:w.filter(e=>e.position==r.position),heights:D.filter(e=>e.position==r.position),setHeights:O,expandByDefault:a,gap:v,loadingIcon:y,expanded:k,pauseWhenPageIsHidden:S,swipeDirections:e.swipeDirections}))):null}))}),Na=({...e})=>{let{theme:t=`system`}=ra();return(0,A.jsx)(Ma,{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})},Pa=u.useId||(()=>void 0),Fa=0;function Ia(e){let[t,n]=u.useState(Pa());return be(()=>{e||n(e=>e??String(Fa++))},[e]),e||(t?`radix-${t}`:``)}var La=[`top`,`right`,`bottom`,`left`],Ra=Math.min,za=Math.max,Ba=Math.round,Va=Math.floor,Ha=e=>({x:e,y:e}),Ua={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Wa(e,t,n){return za(e,Ra(t,n))}function Ga(e,t){return typeof e==`function`?e(t):e}function Ka(e){return e.split(`-`)[0]}function qa(e){return e.split(`-`)[1]}function Ja(e){return e===`x`?`y`:`x`}function Ya(e){return e===`y`?`height`:`width`}function Xa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Za(e){return Ja(Xa(e))}function Qa(e,t,n){n===void 0&&(n=!1);let r=qa(e),i=Za(e),a=Ya(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=so(o)),[o,so(o)]}function $a(e){let t=so(e);return[eo(e),t,eo(t)]}function eo(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var to=[`left`,`right`],no=[`right`,`left`],ro=[`top`,`bottom`],io=[`bottom`,`top`];function ao(e,t,n){switch(e){case`top`:case`bottom`:return n?t?no:to:t?to:no;case`left`:case`right`:return t?ro:io;default:return[]}}function oo(e,t,n,r){let i=qa(e),a=ao(Ka(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(eo)))),a}function so(e){let t=Ka(e);return Ua[t]+e.slice(t.length)}function co(e){return{top:0,right:0,bottom:0,left:0,...e}}function lo(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:co(e)}function uo(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fo(e,t,n){let{reference:r,floating:i}=e,a=Xa(t),o=Za(t),s=Ya(o),c=Ka(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(qa(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function po(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=Ga(t,e),p=lo(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=uo(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=uo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var mo=50,ho=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:po},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=fo(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<mo&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=fo(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},go=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=Ga(e,t)||{};if(l==null)return{};let d=lo(u),f={x:n,y:r},p=Za(i),m=Ya(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=Ra(d[_],T),D=Ra(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=Wa(O,A,k),M=!c.arrow&&qa(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),_o=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=Ga(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ka(r),_=Xa(o),v=Ka(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[so(o)]:$a(o)),x=p!==`none`;!d&&x&&b.push(...oo(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=Qa(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==Xa(t))||T.every(e=>Xa(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=Xa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function vo(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yo(e){return La.some(t=>e[t]>=0)}var bo=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Ga(e,t);switch(i){case`referenceHidden`:{let e=vo(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yo(e)}}}case`escaped`:{let e=vo(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yo(e)}}}default:return{}}}}},xo=new Set([`left`,`top`]);async function So(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ka(n),s=qa(n),c=Xa(n)===`y`,l=xo.has(o)?-1:1,u=a&&c?-1:1,d=Ga(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Co=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await So(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},wo=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Ga(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=Xa(Ka(i)),p=Ja(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=Wa(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=Wa(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},To=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=Ga(e,t),u={x:n,y:r},d=Xa(i),f=Ja(d),p=u[f],m=u[d],h=Ga(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=xo.has(Ka(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Eo=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=Ga(e,t),u=await o.detectOverflow(t,l),d=Ka(i),f=qa(i),p=Xa(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=Ra(h-u[g],v),x=Ra(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=za(u.left,0),t=za(u.right,0),n=za(u.top,0),r=za(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:za(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:za(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Do(){return typeof window<`u`}function Oo(e){return jo(e)?(e.nodeName||``).toLowerCase():`#document`}function ko(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ao(e){return((jo(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function jo(e){return Do()?e instanceof Node||e instanceof ko(e).Node:!1}function Mo(e){return Do()?e instanceof Element||e instanceof ko(e).Element:!1}function No(e){return Do()?e instanceof HTMLElement||e instanceof ko(e).HTMLElement:!1}function Po(e){return!Do()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof ko(e).ShadowRoot}function Fo(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ko(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Io(e){return/^(table|td|th)$/.test(Oo(e))}function Lo(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ro=/transform|translate|scale|rotate|perspective|filter/,zo=/paint|layout|strict|content/,Bo=e=>!!e&&e!==`none`,Vo;function Ho(e){let t=Mo(e)?Ko(e):e;return Bo(t.transform)||Bo(t.translate)||Bo(t.scale)||Bo(t.rotate)||Bo(t.perspective)||!Wo()&&(Bo(t.backdropFilter)||Bo(t.filter))||Ro.test(t.willChange||``)||zo.test(t.contain||``)}function Uo(e){let t=Jo(e);for(;No(t)&&!Go(t);){if(Ho(t))return t;if(Lo(t))return null;t=Jo(t)}return null}function Wo(){return Vo??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Vo}function Go(e){return/^(html|body|#document)$/.test(Oo(e))}function Ko(e){return ko(e).getComputedStyle(e)}function qo(e){return Mo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Jo(e){if(Oo(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Po(e)&&e.host||Ao(e);return Po(t)?t.host:t}function Yo(e){let t=Jo(e);return Go(t)?e.ownerDocument?e.ownerDocument.body:e.body:No(t)&&Fo(t)?t:Yo(t)}function Xo(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Yo(e),i=r===e.ownerDocument?.body,a=ko(r);if(i){let e=Zo(a);return t.concat(a,a.visualViewport||[],Fo(r)?r:[],e&&n?Xo(e):[])}else return t.concat(r,Xo(r,[],n))}function Zo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Qo(e){let t=Ko(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=No(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Ba(n)!==a||Ba(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $o(e){return Mo(e)?e:e.contextElement}function es(e){let t=$o(e);if(!No(t))return Ha(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qo(t),o=(a?Ba(n.width):n.width)/r,s=(a?Ba(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ts=Ha(0);function ns(e){let t=ko(e);return!Wo()||!t.visualViewport?ts:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ko(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$o(e),o=Ha(1);t&&(r?Mo(r)&&(o=es(r)):o=es(e));let s=rs(a,n,r)?ns(a):Ha(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=ko(a),t=r&&Mo(r)?ko(r):r,n=e,i=Zo(n);for(;i&&r&&t!==n;){let e=es(i),t=i.getBoundingClientRect(),r=Ko(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ko(i),i=Zo(n)}}return uo({width:u,height:d,x:c,y:l})}function as(e,t){let n=qo(e).scrollLeft;return t?t.left+n:is(Ao(e)).left+n}function os(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-as(e,n),y:n.top+t.scrollTop}}function ss(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ao(r),s=t?Lo(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ha(1),u=Ha(0),d=No(r);if((d||!d&&!a)&&((Oo(r)!==`body`||Fo(o))&&(c=qo(r)),d)){let e=is(r);l=es(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?os(o,c):Ha(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function cs(e){return Array.from(e.getClientRects())}function ls(e){let t=Ao(e),n=qo(e),r=e.ownerDocument.body,i=za(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=za(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+as(e),s=-n.scrollTop;return Ko(r).direction===`rtl`&&(o+=za(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var us=25;function ds(e,t){let n=ko(e),r=Ao(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Wo();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=as(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=us&&(a-=o)}else l<=us&&(a+=l);return{width:a,height:o,x:s,y:c}}function fs(e,t){let n=is(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=No(e)?es(e):Ha(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ps(e,t,n){let r;if(t===`viewport`)r=ds(e,n);else if(t===`document`)r=ls(Ao(e));else if(Mo(t))r=fs(t,n);else{let n=ns(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return uo(r)}function ms(e,t){let n=Jo(e);return n===t||!Mo(n)||Go(n)?!1:Ko(n).position===`fixed`||ms(n,t)}function hs(e,t){let n=t.get(e);if(n)return n;let r=Xo(e,[],!1).filter(e=>Mo(e)&&Oo(e)!==`body`),i=null,a=Ko(e).position===`fixed`,o=a?Jo(e):e;for(;Mo(o)&&!Go(o);){let t=Ko(o),n=Ho(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Fo(o)&&!n&&ms(e,o))?r=r.filter(e=>e!==o):i=t,o=Jo(o)}return t.set(e,r),r}function gs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Lo(t)?[]:hs(t,this._c):[].concat(n),r],o=ps(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=ps(t,a[e],i);s=za(n.top,s),c=Ra(n.right,c),l=Ra(n.bottom,l),u=za(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _s(e){let{width:t,height:n}=Qo(e);return{width:t,height:n}}function vs(e,t,n){let r=No(t),i=Ao(t),a=n===`fixed`,o=is(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Ha(0);function l(){c.x=as(i)}if(r||!r&&!a)if((Oo(t)!==`body`||Fo(i))&&(s=qo(t)),r){let e=is(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?os(i,s):Ha(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function ys(e){return Ko(e).position===`static`}function bs(e,t){if(!No(e)||Ko(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Ao(e)===n&&(n=n.ownerDocument.body),n}function xs(e,t){let n=ko(e);if(Lo(e))return n;if(!No(e)){let t=Jo(e);for(;t&&!Go(t);){if(Mo(t)&&!ys(t))return t;t=Jo(t)}return n}let r=bs(e,t);for(;r&&Io(r)&&ys(r);)r=bs(r,t);return r&&Go(r)&&ys(r)&&!Ho(r)?n:r||Uo(e)||n}var Ss=async function(e){let t=this.getOffsetParent||xs,n=this.getDimensions,r=await n(e.floating);return{reference:vs(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cs(e){return Ko(e).direction===`rtl`}var ws={convertOffsetParentRelativeRectToViewportRelativeRect:ss,getDocumentElement:Ao,getClippingRect:gs,getOffsetParent:xs,getElementRects:Ss,getClientRects:cs,getDimensions:_s,getScale:es,isElement:Mo,isRTL:Cs};function Ts(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Es(e,t){let n=null,r,i=Ao(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=Va(d),h=Va(i.clientWidth-(u+f)),g=Va(i.clientHeight-(d+p)),_=Va(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:za(0,Ra(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Ts(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ds(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$o(e),u=i||a?[...l?Xo(l):[],...t?Xo(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Es(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?is(e):null;c&&g();function g(){let t=is(e);h&&!Ts(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Os=Co,ks=wo,As=_o,js=Eo,Ms=bo,Ns=go,Ps=To,Fs=(e,t,n)=>{let r=new Map,i={platform:ws,...n},a={...i.platform,_c:r};return ho(e,t,{...i,platform:a})},Is=typeof document<`u`?u.useLayoutEffect:function(){};function Ls(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;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(!Ls(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Ls(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rs(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zs(e,t){let n=Rs(e);return Math.round(t*n)/n}function Bs(e){let t=u.useRef(e);return Is(()=>{t.current=e}),t}function Vs(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,f]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=u.useState(r);Ls(p,r)||m(r);let[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useCallback(e=>{e!==w.current&&(w.current=e,g(e))},[]),b=u.useCallback(e=>{e!==T.current&&(T.current=e,v(e))},[]),x=a||h,S=o||_,w=u.useRef(null),T=u.useRef(null),E=u.useRef(d),D=c!=null,O=Bs(c),k=Bs(i),A=Bs(l),j=u.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),Fs(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Ls(E.current,t)&&(E.current=t,C.flushSync(()=>{f(t)}))})},[p,t,n,k,A]);Is(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);let M=u.useRef(!1);Is(()=>(M.current=!0,()=>{M.current=!1}),[]),Is(()=>{if(x&&(w.current=x),S&&(T.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=u.useMemo(()=>({reference:w,floating:T,setReference:y,setFloating:b}),[y,b]),P=u.useMemo(()=>({reference:x,floating:S}),[x,S]),F=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=zs(P.floating,d.x),r=zs(P.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rs(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var Hs=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ns({element:r.current,padding:i}).fn(n):r?Ns({element:r,padding:i}).fn(n):{}}}},Us=(e,t)=>{let n=Os(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ws=(e,t)=>{let n=ks(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gs=(e,t)=>({fn:Ps(e).fn,options:[e,t]}),Ks=(e,t)=>{let n=As(e);return{name:n.name,fn:n.fn,options:[e,t]}},qs=(e,t)=>{let n=js(e);return{name:n.name,fn:n.fn,options:[e,t]}},Js=(e,t)=>{let n=Ms(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ys=(e,t)=>{let n=Hs(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xs=`Arrow`,Zs=u.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,A.jsx)(z.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,A.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});Zs.displayName=Xs;var Qs=Zs;function $s(e){let[t,n]=u.useState(void 0);return be(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var ec=`Popper`,[tc,nc]=M(ec),[rc,ic]=tc(ec),ac=e=>{let{__scopePopper:t,children:n}=e,[r,i]=u.useState(null);return(0,A.jsx)(rc,{scope:t,anchor:r,onAnchorChange:i,children:n})};ac.displayName=ec;var oc=`PopperAnchor`,sc=u.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=ic(oc,n),o=u.useRef(null),s=D(t,o),c=u.useRef(null);return u.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,A.jsx)(z.div,{...i,ref:s})});sc.displayName=oc;var cc=`PopperContent`,[lc,uc]=tc(cc),dc=u.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:f=`partial`,hideWhenDetached:p=!1,updatePositionStrategy:m=`optimized`,onPlaced:h,...g}=e,_=ic(cc,n),[v,y]=u.useState(null),b=D(t,e=>y(e)),[x,S]=u.useState(null),C=$s(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),O=typeof d==`number`?d:{top:0,right:0,bottom:0,left:0,...d},k=Array.isArray(l)?l:[l],j=k.length>0,M={padding:O,boundary:k.filter(hc),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:ee,middlewareData:I}=Vs({strategy:`fixed`,placement:E,whileElementsMounted:(...e)=>Ds(...e,{animationFrame:m===`always`}),elements:{reference:_.anchor},middleware:[Us({mainAxis:i+T,alignmentAxis:o}),c&&Ws({mainAxis:!0,crossAxis:!1,limiter:f===`partial`?Gs():void 0,...M}),c&&Ks({...M}),qs({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),x&&Ys({element:x,padding:s}),gc({arrowWidth:w,arrowHeight:T}),p&&Js({strategy:`referenceHidden`,...M})]}),[L,R]=_c(F),te=ie(h);be(()=>{ee&&te?.()},[ee,te]);let ne=I.arrow?.x,re=I.arrow?.y,ae=I.arrow?.centerOffset!==0,[oe,se]=u.useState();return be(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,A.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:ee?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:oe,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,A.jsx)(lc,{scope:n,placedSide:L,onArrowChange:S,arrowX:ne,arrowY:re,shouldHideArrow:ae,children:(0,A.jsx)(z.div,{"data-side":L,"data-align":R,...g,ref:b,style:{...g.style,animation:ee?void 0:`none`}})})})});dc.displayName=cc;var fc=`PopperArrow`,pc={top:`bottom`,right:`left`,bottom:`top`,left:`right`},mc=u.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=uc(fc,n),a=pc[i.placedSide];return(0,A.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]: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:(0,A.jsx)(Qs,{...r,ref:t,style:{...r.style,display:`block`}})})});mc.displayName=fc;function hc(e){return e!==null}var gc=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=_c(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function _c(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var vc=ac,yc=sc,bc=dc,U=mc,[xc,Sc]=M(`Tooltip`,[nc]),Cc=nc(),wc=`TooltipProvider`,Tc=700,Ec=`tooltip.open`,[Dc,Oc]=xc(wc),kc=e=>{let{__scopeTooltip:t,delayDuration:n=Tc,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=u.useRef(!0),s=u.useRef(!1),c=u.useRef(0);return u.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,A.jsx)(Dc,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:u.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:u.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};kc.displayName=wc;var Ac=`Tooltip`,[jc,Mc]=xc(Ac),Nc=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Oc(Ac,e.__scopeTooltip),l=Cc(t),[d,f]=u.useState(null),p=Ia(),m=u.useRef(0),h=o??c.disableHoverableContent,g=s??c.delayDuration,_=u.useRef(!1),[v,y]=ke({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(Ec))):c.onClose(),a?.(e)},caller:Ac}),b=u.useMemo(()=>v?_.current?`delayed-open`:`instant-open`:`closed`,[v]),x=u.useCallback(()=>{window.clearTimeout(m.current),m.current=0,_.current=!1,y(!0)},[y]),S=u.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y(!1)},[y]),C=u.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{_.current=!0,y(!0),m.current=0},g)},[g,y]);return u.useEffect(()=>()=>{m.current&&=(window.clearTimeout(m.current),0)},[]),(0,A.jsx)(vc,{...l,children:(0,A.jsx)(jc,{scope:t,contentId:p,open:v,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:u.useCallback(()=>{c.isOpenDelayedRef.current?C():x()},[c.isOpenDelayedRef,C,x]),onTriggerLeave:u.useCallback(()=>{h?S():(window.clearTimeout(m.current),m.current=0)},[S,h]),onOpen:x,onClose:S,disableHoverableContent:h,children:n})})};Nc.displayName=Ac;var Pc=`TooltipTrigger`,Fc=u.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Mc(Pc,n),a=Oc(Pc,n),o=Cc(n),s=D(t,u.useRef(null),i.onTriggerChange),c=u.useRef(!1),l=u.useRef(!1),d=u.useCallback(()=>c.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener(`pointerup`,d),[d]),(0,A.jsx)(yc,{asChild:!0,...o,children:(0,A.jsx)(z.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:w(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:w(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:w(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,d,{once:!0})}),onFocus:w(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:w(e.onBlur,i.onClose),onClick:w(e.onClick,i.onClose)})})});Fc.displayName=Pc;var Ic=`TooltipPortal`,[Lc,Rc]=xc(Ic,{forceMount:void 0}),zc=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Mc(Ic,t);return(0,A.jsx)(Lc,{scope:t,forceMount:n,children:(0,A.jsx)(we,{present:n||a.open,children:(0,A.jsx)(Se,{asChild:!0,container:i,children:r})})})};zc.displayName=Ic;var Bc=`TooltipContent`,Vc=u.forwardRef((e,t)=>{let n=Rc(Bc,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Mc(Bc,e.__scopeTooltip);return(0,A.jsx)(we,{present:r||o.open,children:o.disableHoverableContent?(0,A.jsx)(Kc,{side:i,...a,ref:t}):(0,A.jsx)(Hc,{side:i,...a,ref:t})})}),Hc=u.forwardRef((e,t)=>{let n=Mc(Bc,e.__scopeTooltip),r=Oc(Bc,e.__scopeTooltip),i=u.useRef(null),a=D(t,i),[o,s]=u.useState(null),{trigger:c,onClose:l}=n,d=i.current,{onPointerInTransitChange:f}=r,p=u.useCallback(()=>{s(null),f(!1)},[f]),m=u.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Xc(r,Yc(r,n.getBoundingClientRect())),a=Zc(t.getBoundingClientRect());s($c([...i,...a])),f(!0)},[f]);return u.useEffect(()=>()=>p(),[p]),u.useEffect(()=>{if(c&&d){let e=e=>m(e,d),t=e=>m(e,c);return c.addEventListener(`pointerleave`,e),d.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),d.removeEventListener(`pointerleave`,t)}}},[c,d,m,p]),u.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||d?.contains(t),i=!Qc(n,o);r?p():i&&(p(),l())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,d,o,l,p]),(0,A.jsx)(Kc,{...e,ref:a})}),[Uc,Wc]=xc(Ac,{isInside:!1}),Gc=I(`TooltipContent`),Kc=u.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=Mc(Bc,n),l=Cc(n),{onClose:d}=c;return u.useEffect(()=>(document.addEventListener(Ec,d),()=>document.removeEventListener(Ec,d)),[d]),u.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&d()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,d]),(0,A.jsx)(de,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,A.jsxs)(bc,{"data-state":c.stateAttribute,...l,...s,ref:t,style:{...s.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:[(0,A.jsx)(Gc,{children:r}),(0,A.jsx)(Uc,{scope:n,isInside:!0,children:(0,A.jsx)(Fe,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});Vc.displayName=Bc;var qc=`TooltipArrow`,Jc=u.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=Cc(n);return Wc(qc,n).isInside?null:(0,A.jsx)(U,{...i,...r,ref:t})});Jc.displayName=qc;function Yc(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function Xc(e,t,n=5){let 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 Zc(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function Qc(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function $c(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),el(t)}function el(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 tl=kc,nl=Nc,rl=Fc,il=Vc,al=tl,ol=nl,sl=rl,cl=u.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,A.jsx)(il,{ref:r,sideOffset:t,className:H(`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}));cl.displayName=il.displayName;var ll=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(){}},ul=new class extends ll{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},dl={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},fl=new class{#e=dl;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function pl(e){setTimeout(e,0)}var ml=typeof window>`u`||`Deno`in globalThis;function hl(){}function gl(e,t){return typeof e==`function`?e(t):e}function _l(e){return typeof e==`number`&&e>=0&&e!==1/0}function vl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function yl(e,t){return typeof e==`function`?e(t):e}function bl(e,t){return typeof e==`function`?e(t):e}function xl(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Cl(o,t.options))return!1}else if(!Tl(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Sl(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(wl(t.options.mutationKey)!==wl(a))return!1}else if(!Tl(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Cl(e,t){return(t?.queryKeyHashFn||wl)(e)}function wl(e){return JSON.stringify(e,(e,t)=>Al(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Tl(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Tl(e[n],t[n])):!1}var El=Object.prototype.hasOwnProperty;function Dl(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=kl(e)&&kl(t);if(!r&&!(Al(e)&&Al(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:El.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Dl(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Ol(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function kl(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Al(e){if(!jl(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!jl(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function jl(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ml(e){return new Promise(t=>{fl.setTimeout(t,e)})}function Nl(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Dl(e,t)}function Pl(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Fl(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Il=Symbol();function Ll(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Il?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rl(e,t){return typeof e==`function`?e(...t):!!e}function zl(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Bl=(()=>{let e=()=>ml;return{isServer(){return e()},setIsServer(t){e=t}}})();function Vl(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Hl=pl;function Ul(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Hl,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Wl=Ul(),Gl=new class extends ll{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Kl(e){return Math.min(1e3*2**e,3e4)}function ql(e){return(e??`online`)===`online`?Gl.isOnline():!0}var Jl=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Yl(e){let t=!1,n=0,r,i=Vl(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Jl(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ul.isFocused()&&(e.networkMode===`always`||Gl.isOnline())&&e.canRun(),u=()=>ql(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Bl.isServer()?0:3),o=e.retryDelay??Kl,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Ml(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Xl=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),_l(this.gcTime)&&(this.#e=fl.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bl.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(fl.clearTimeout(this.#e),void 0)}},Zl=class extends Xl{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=eu(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=eu(this.options);e.data!==void 0&&(this.setState($l(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=Nl(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(hl).catch(hl):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>bl(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Il||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>yl(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!vl(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=Ll(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=Yl({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Jl&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Jl){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Ql(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...$l(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}})(this.state),Wl.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function Ql(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ql(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function $l(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function eu(e){let 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 tu=class extends ll{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Vl(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ru(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iu(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iu(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof bl(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Ol(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&au(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||bl(this.options.enabled,this.#t)!==bl(t.enabled,this.#t)||yl(this.options.staleTime,this.#t)!==yl(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||bl(this.options.enabled,this.#t)!==bl(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return su(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(hl)),t}#g(){this.#b();let e=yl(this.options.staleTime,this.#t);if(Bl.isServer()||this.#r.isStale||!_l(e))return;let t=vl(this.#r.dataUpdatedAt,e)+1;this.#d=fl.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Bl.isServer()||bl(this.options.enabled,this.#t)===!1||!_l(this.#p)||this.#p===0)&&(this.#f=fl.setInterval(()=>{(this.options.refetchIntervalInBackground||ul.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(fl.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(fl.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ru(e,t),o=i&&au(e,n,t,r);(a||o)&&(l={...l,...Ql(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Nl(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Nl(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ou(e,t),refetch:this.refetch,promise:this.#o,isEnabled:bl(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=Vl())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Ol(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Wl.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function nu(e,t){return bl(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function ru(e,t){return nu(e,t)||e.state.data!==void 0&&iu(e,t,t.refetchOnMount)}function iu(e,t,n){if(bl(t.enabled,e)!==!1&&yl(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&ou(e,t)}return!1}function au(e,t,n,r){return(e!==t||bl(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ou(e,n)}function ou(e,t){return bl(t.enabled,e)!==!1&&e.isStaleByTime(yl(t.staleTime,e))}function su(e,t){return!Ol(e.getCurrentResult(),t)}function cu(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{zl(e,()=>t.signal,()=>n=!0)},u=Ll(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?Fl:Pl;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?uu:lu,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:lu(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function lu(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function uu(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var du=class extends Xl{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||fu(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Yl({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),Wl.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function fu(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var pu=class extends ll{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new du({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=mu(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=mu(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=mu(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=mu(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Wl.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Sl(t,e))}findAll(e={}){return this.getAll().filter(t=>Sl(e,t))}notify(e){Wl.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Wl.batch(()=>Promise.all(e.map(e=>e.continue().catch(hl))))}};function mu(e){return e.options.scope?.id}var hu=class extends ll{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Ol(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&wl(t.mutationKey)!==wl(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??fu();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Wl.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},gu=class extends ll{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Cl(r,t),a=this.get(i);return a||(a=new Zl({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Wl.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>xl(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>xl(e,t)):t}notify(e){Wl.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Wl.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Wl.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_u=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new gu,this.#t=e.mutationCache||new pu,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ul.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Gl.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(yl(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=gl(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Wl.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Wl.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Wl.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Wl.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(hl).catch(hl)}invalidateQueries(e,t={}){return Wl.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Wl.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(hl)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(hl)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(yl(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(hl).catch(hl)}fetchInfiniteQuery(e){return e.behavior=cu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(hl).catch(hl)}ensureInfiniteQueryData(e){return e.behavior=cu(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Gl.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(wl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Tl(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(wl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Tl(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Cl(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===Il&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},vu=u.createContext(void 0),yu=e=>{let t=u.useContext(vu);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},bu=({client:e,children:t})=>(u.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,A.jsx)(vu.Provider,{value:e,children:t})),xu=u.createContext(!1),Su=()=>u.useContext(xu);xu.Provider;function Cu(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var wu=u.createContext(Cu()),Tu=()=>u.useContext(wu),Eu=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Rl(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Du=e=>{u.useEffect(()=>{e.clearReset()},[e])},Ou=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Rl(n,[e.error,r])),ku=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Au=(e,t)=>e.isLoading&&e.isFetching&&!t,ju=(e,t)=>e?.suspense&&t.isPending,Mu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function eee(e,t,n){let r=Su(),i=Tu(),a=yu(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,ku(o),Eu(o,i,s),Du(i);let c=!a.getQueryCache().get(o.queryHash),[l]=u.useState(()=>new t(a,o)),d=l.getOptimisticResult(o),f=!r&&e.subscribed!==!1;if(u.useSyncExternalStore(u.useCallback(e=>{let t=f?l.subscribe(Wl.batchCalls(e)):hl;return l.updateResult(),t},[l,f]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),u.useEffect(()=>{l.setOptions(o)},[o,l]),ju(o,d))throw Mu(o,l,i);if(Ou({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Bl.isServer()&&Au(d,r)&&(c?Mu(o,l,i):s?.promise)?.catch(hl).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?d:l.trackResult(d)}function Nu(e,t){return eee(e,tu,t)}function Pu(e,t){let n=yu(t),[r]=u.useState(()=>new hu(n,e));u.useEffect(()=>{r.setOptions(e)},[r,e]);let i=u.useSyncExternalStore(u.useCallback(e=>r.subscribe(Wl.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=u.useCallback((e,t)=>{r.mutate(e,t).catch(hl)},[r]);if(i.error&&Rl(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Fu=`modulepreload`,Iu=function(e){return`/`+e},Lu={},Ru=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Iu(t,n),t in Lu)return;Lu[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Fu,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},zu=`popstate`;function Bu(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function tee(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Wu(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:Gu(t)}return ree(t,n,null,e)}function Vu(e,t){if(e===!1||e==null)throw Error(t)}function Hu(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function nee(){return Math.random().toString(36).substring(2,10)}function Uu(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Wu(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Ku(t):t,state:n,key:t&&t.key||r||nee(),unstable_mask:i}}function Gu({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Ku(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function ree(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Bu(e)?e:Wu(h.location,e,t);n&&n(r,e),l=u()+1;let d=Uu(r,l),f=h.createHref(r.unstable_mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Bu(e)?e:Wu(h.location,e,t);n&&n(r,e),l=u();let i=Uu(r,l),d=h.createHref(r.unstable_mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return qu(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(zu,d),c=e,()=>{i.removeEventListener(zu,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function qu(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),Vu(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:Gu(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function Ju(e,t,n=`/`){return Yu(e,t,n,!1)}function Yu(e,t,n,r){let i=ld((typeof t==`string`?Ku(t):t).pathname||`/`,n);if(i==null)return null;let a=Zu(e);$u(a);let o=null;for(let e=0;o==null&&e<a.length;++e){let t=see(i);o=aee(a[e],t,r)}return o}function Xu(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Zu(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;Vu(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 l=md([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(Vu(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Zu(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:sd(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Qu(e.path))a(e,t,!0,n)}),t}function Qu(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Qu(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function $u(e){e.sort((e,t)=>e.score===t.score?iee(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var ed=/^:[\w-]+$/,td=3,nd=2,rd=1,id=10,ad=-2,od=e=>e===`*`;function sd(e,t){let n=e.split(`/`),r=n.length;return n.some(od)&&(r+=ad),t&&(r+=nd),n.filter(e=>!od(e)).reduce((e,t)=>e+(ed.test(t)?td:t===``?rd:id),r)}function iee(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function aee(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=cd({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=cd({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:md([a,u.pathname]),pathnameBase:dee(md([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=md([a,u.pathnameBase]))}return o}function cd(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=oee(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function oee(e,t=!1,n=!0){Hu(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=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function see(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return Hu(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ld(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)||`/`}var cee=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function lee(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Ku(e):e,a;return n?(n=n.replace(/\/\/+/g,`/`),a=n.startsWith(`/`)?ud(n.substring(1),`/`):ud(n,t)):a=t,{pathname:a,search:fee(r),hash:pee(i)}}function ud(e,t){let n=t.replace(/\/+$/,``).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function dd(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 uee(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function fd(e){let t=uee(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function pd(e,t,n,r=!1){let i;typeof e==`string`?i=Ku(e):(i={...e},Vu(!i.pathname||!i.pathname.includes(`?`),dd(`?`,`pathname`,`search`,i)),Vu(!i.pathname||!i.pathname.includes(`#`),dd(`#`,`pathname`,`hash`,i)),Vu(!i.search||!i.search.includes(`#`),dd(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=lee(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var md=e=>e.join(`/`).replace(/\/\/+/g,`/`),dee=e=>e.replace(/\/+$/,``).replace(/^\/*/,`/`),fee=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,pee=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,mee=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function hee(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function gee(e){return e.map(e=>e.route.path).filter(Boolean).join(`/`).replace(/\/\/*/g,`/`)||`/`}var hd=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function gd(e,t){let n=e;if(typeof n!=`string`||!cee.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(hd)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=ld(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{Hu(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var _d=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(_d);var vd=[`GET`,..._d];new Set(vd);var yd=u.createContext(null);yd.displayName=`DataRouter`;var bd=u.createContext(null);bd.displayName=`DataRouterState`;var _ee=u.createContext(!1),xd=u.createContext({isTransitioning:!1});xd.displayName=`ViewTransition`;var Sd=u.createContext(new Map);Sd.displayName=`Fetchers`;var Cd=u.createContext(null);Cd.displayName=`Await`;var wd=u.createContext(null);wd.displayName=`Navigation`;var Td=u.createContext(null);Td.displayName=`Location`;var Ed=u.createContext({outlet:null,matches:[],isDataRoute:!1});Ed.displayName=`Route`;var Dd=u.createContext(null);Dd.displayName=`RouteError`;var Od=`REACT_ROUTER_ERROR`,vee=`REDIRECT`,kd=`ROUTE_ERROR_RESPONSE`;function Ad(e){if(e.startsWith(`${Od}:${vee}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function yee(e){if(e.startsWith(`${Od}:${kd}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new mee(t.status,t.statusText,t.data)}catch{}}function bee(e,{relative:t}={}){Vu(jd(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=u.useContext(wd),{hash:i,pathname:a,search:o}=zd(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:md([n,a])),r.createHref({pathname:s,search:o,hash:i})}function jd(){return u.useContext(Td)!=null}function Md(){return Vu(jd(),`useLocation() may be used only in the context of a <Router> component.`),u.useContext(Td).location}var Nd=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Pd(e){u.useContext(wd).static||u.useLayoutEffect(e)}function Fd(){let{isDataRoute:e}=u.useContext(Ed);return e?af():xee()}function xee(){Vu(jd(),`useNavigate() may be used only in the context of a <Router> component.`);let e=u.useContext(yd),{basename:t,navigator:n}=u.useContext(wd),{matches:r}=u.useContext(Ed),{pathname:i}=Md(),a=JSON.stringify(fd(r)),o=u.useRef(!1);return Pd(()=>{o.current=!0}),u.useCallback((r,s={})=>{if(Hu(o.current,Nd),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=pd(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:md([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Id=u.createContext(null);function Ld(e){let t=u.useContext(Ed).outlet;return u.useMemo(()=>t&&u.createElement(Id.Provider,{value:e},t),[t,e])}function Rd(){let{matches:e}=u.useContext(Ed),t=e[e.length-1];return t?t.params:{}}function zd(e,{relative:t}={}){let{matches:n}=u.useContext(Ed),{pathname:r}=Md(),i=JSON.stringify(fd(n));return u.useMemo(()=>pd(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Bd(e,t){return Vd(e,t)}function Vd(e,t,n){Vu(jd(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=u.useContext(wd),{matches:i}=u.useContext(Ed),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;sf(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
11
+
12
+ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let d=Md(),f;if(t){let e=typeof t==`string`?Ku(t):t;Vu(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),f=e}else f=d;let p=f.pathname||`/`,m=p;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);m=`/`+p.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let h=Ju(e,{pathname:m});Hu(l||h!=null,`No routes matched location "${f.pathname}${f.search}${f.hash}" `),Hu(h==null||h[h.length-1].route.element!==void 0||h[h.length-1].route.Component!==void 0||h[h.length-1].route.lazy!==void 0,`Matched leaf route at location "${f.pathname}${f.search}${f.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let g=Jd(h&&h.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:md([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:md([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&g?u.createElement(Td.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,unstable_mask:void 0,...f},navigationType:`POP`}},g):g}function Hd(){let e=rf(),t=hee(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=u.createElement(u.Fragment,null,u.createElement(`p`,null,`💿 Hey developer 👋`),u.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,u.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,u.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),u.createElement(u.Fragment,null,u.createElement(`h2`,null,`Unexpected Application Error!`),u.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?u.createElement(`pre`,{style:i},n):null,o)}var Ud=u.createElement(Hd,null),Wd=class extends u.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=yee(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:u.createElement(Ed.Provider,{value:this.props.routeContext},u.createElement(Dd.Provider,{value:e,children:this.props.component}));return this.context?u.createElement(Kd,{error:e},t):t}};Wd.contextType=_ee;var Gd=new WeakMap;function Kd({children:e,error:t}){let{basename:n}=u.useContext(wd);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ad(t.digest);if(e){let r=Gd.get(t);if(r)throw r;let i=gd(e.location,n);if(hd&&!Gd.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Gd.set(t,n),n}return u.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function qd({routeContext:e,match:t,children:n}){let r=u.useContext(yd);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),u.createElement(Ed.Provider,{value:e},n)}function Jd(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);Vu(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:gee(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let d,f=!1,p=null,m=null;r&&(d=a&&n.route.id?a[n.route.id]:void 0,p=n.route.errorElement||Ud,o&&(s<0&&c===0?(sf(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),f=!0,m=null):s===c&&(f=!0,m=n.route.hydrateFallbackElement||null)));let h=t.concat(i.slice(0,c+1)),g=()=>{let t;return t=d?p:f?m:n.route.Component?u.createElement(n.route.Component,null):n.route.element?n.route.element:e,u.createElement(qd,{match:n,routeContext:{outlet:e,matches:h,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?u.createElement(Wd,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0},onError:l}):g()},null)}function Yd(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xd(e){let t=u.useContext(yd);return Vu(t,Yd(e)),t}function Zd(e){let t=u.useContext(bd);return Vu(t,Yd(e)),t}function Qd(e){let t=u.useContext(Ed);return Vu(t,Yd(e)),t}function $d(e){let t=Qd(e),n=t.matches[t.matches.length-1];return Vu(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ef(){return $d(`useRouteId`)}function tf(){return Zd(`useNavigation`).navigation}function nf(){let{matches:e,loaderData:t}=Zd(`useMatches`);return u.useMemo(()=>e.map(e=>Xu(e,t)),[e,t])}function rf(){let e=u.useContext(Dd),t=Zd(`useRouteError`),n=$d(`useRouteError`);return e===void 0?t.errors?.[n]:e}function af(){let{router:e}=Xd(`useNavigate`),t=$d(`useNavigate`),n=u.useRef(!1);return Pd(()=>{n.current=!0}),u.useCallback(async(r,i={})=>{Hu(n.current,Nd),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var of={};function sf(e,t,n){!t&&!of[e]&&(of[e]=!0,Hu(!1,n))}u.useOptimistic,u.memo(cf);function cf({routes:e,future:t,state:n,isStatic:r,onError:i}){return Vd(e,void 0,{state:n,isStatic:r,onError:i,future:t})}function lf({to:e,replace:t,state:n,relative:r}){Vu(jd(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=u.useContext(wd);Hu(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=u.useContext(Ed),{pathname:o}=Md(),s=Fd(),c=pd(e,fd(a),o,r===`path`),l=JSON.stringify(c);return u.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function uf(e){return Ld(e.context)}function df(e){Vu(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ff({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,unstable_useTransitions:o}){Vu(!jd(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=u.useMemo(()=>({basename:s,navigator:i,static:a,unstable_useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Ku(n));let{pathname:l=`/`,search:d=``,hash:f=``,state:p=null,key:m=`default`,unstable_mask:h}=n,g=u.useMemo(()=>{let e=ld(l,s);return e==null?null:{location:{pathname:e,search:d,hash:f,state:p,key:m,unstable_mask:h},navigationType:r}},[s,l,d,f,p,m,r,h]);return Hu(g!=null,`<Router basename="${s}"> is not able to match the URL "${l}${d}${f}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:u.createElement(wd.Provider,{value:c},u.createElement(Td.Provider,{children:t,value:g}))}function See({children:e,location:t}){return Bd(pf(e),t)}u.Component;function pf(e,t=[]){let n=[];return u.Children.forEach(e,(e,r)=>{if(!u.isValidElement(e))return;let i=[...t,r];if(e.type===u.Fragment){n.push.apply(n,pf(e.props.children,i));return}Vu(e.type===df,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Vu(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=pf(e.props.children,i)),n.push(a)}),n}var mf=`get`,hf=`application/x-www-form-urlencoded`;function gf(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Cee(e){return gf(e)&&e.tagName.toLowerCase()===`button`}function wee(e){return gf(e)&&e.tagName.toLowerCase()===`form`}function Tee(e){return gf(e)&&e.tagName.toLowerCase()===`input`}function Eee(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Dee(e,t){return e.button===0&&(!t||t===`_self`)&&!Eee(e)}var _f=null;function Oee(){if(_f===null)try{new FormData(document.createElement(`form`),0),_f=!1}catch{_f=!0}return _f}var kee=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function vf(e){return e!=null&&!kee.has(e)?(Hu(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${hf}"`),null):e}function Aee(e,t){let n,r,i,a,o;if(wee(e)){let o=e.getAttribute(`action`);r=o?ld(o,t):null,n=e.getAttribute(`method`)||mf,i=vf(e.getAttribute(`enctype`))||hf,a=new FormData(e)}else if(Cee(e)||Tee(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?ld(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||mf,i=vf(e.getAttribute(`formenctype`))||vf(o.getAttribute(`enctype`))||hf,a=new FormData(o,e),!Oee()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(gf(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=mf,r=null,i=hf,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var jee={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Mee=/[&><\u2028\u2029]/g;function yf(e){return e.replace(Mee,e=>jee[e])}function bf(e,t){if(e===!1||e==null)throw Error(t)}function Nee(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&ld(i.pathname,t)===`/`?i.pathname=`${t.replace(/\/$/,``)}/_root.${r}`:i.pathname=`${i.pathname.replace(/\/$/,``)}.${r}`,i}async function Pee(e,t){if(e.id in t)return t[e.id];try{let n=await Ru(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Fee(e){return e!=null&&typeof e.page==`string`}function Iee(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Lee(e,t,n){return Vee((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Pee(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Iee).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function xf(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ree(e,t,{includeHydrateFallback:n}={}){return zee(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function zee(e){return[...new Set(e)]}function Bee(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Vee(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Fee(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Bee(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Sf(){let e=u.useContext(yd);return bf(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Hee(){let e=u.useContext(bd);return bf(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Cf=u.createContext(void 0);Cf.displayName=`FrameworkContext`;function wf(){let e=u.useContext(Cf);return bf(e,`You must render this element inside a <HydratedRouter> element`),e}function Uee(e,t){let n=u.useContext(Cf),[r,i]=u.useState(!1),[a,o]=u.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:d,onTouchStart:f}=t,p=u.useRef(null);u.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return p.current&&e.observe(p.current),()=>{e.disconnect()}}},[e]),u.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let m=()=>{i(!0)},h=()=>{i(!1),o(!1)};return n?e===`intent`?[a,p,{onFocus:Tf(s,m),onBlur:Tf(c,h),onMouseEnter:Tf(l,m),onMouseLeave:Tf(d,h),onTouchStart:Tf(f,m)}]:[a,p,{}]:[!1,p,{}]}function Tf(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Wee({page:e,...t}){let{router:n}=Sf(),r=u.useMemo(()=>Ju(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?u.createElement(Kee,{page:e,matches:r,...t}):null}function Gee(e){let{manifest:t,routeModules:n}=wf(),[r,i]=u.useState([]);return u.useEffect(()=>{let r=!1;return Lee(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Kee({page:e,matches:t,...n}){let r=Md(),{future:i,manifest:a,routeModules:o}=wf(),{basename:s}=Sf(),{loaderData:c,matches:l}=Hee(),d=u.useMemo(()=>xf(e,t,l,a,r,`data`),[e,t,l,a,r]),f=u.useMemo(()=>xf(e,t,l,a,r,`assets`),[e,t,l,a,r]),p=u.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!d.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let u=Nee(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&u.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[u.pathname+u.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,d,t,e,o]),m=u.useMemo(()=>Ree(f,a),[f,a]),h=Gee(f);return u.createElement(u.Fragment,null,p.map(e=>u.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),m.map(e=>u.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),h.map(({key:e,link:t})=>u.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function qee(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}u.Component;var Jee=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Jee&&(window.__reactRouterVersion=`7.13.1`)}catch{}function Yee({basename:e,children:t,unstable_useTransitions:n,window:r}){let i=u.useRef();i.current??=tee({window:r,v5Compat:!0});let a=i.current,[o,s]=u.useState({action:a.action,location:a.location}),c=u.useCallback(e=>{n===!1?s(e):u.startTransition(()=>s(e))},[n]);return u.useLayoutEffect(()=>a.listen(c),[a,c]),u.createElement(ff,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,unstable_useTransitions:n})}function Xee({basename:e,children:t,history:n,unstable_useTransitions:r}){let[i,a]=u.useState({action:n.action,location:n.location}),o=u.useCallback(e=>{r===!1?a(e):u.startTransition(()=>a(e))},[r]);return u.useLayoutEffect(()=>n.listen(o),[n,o]),u.createElement(ff,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,unstable_useTransitions:r})}Xee.displayName=`unstable_HistoryRouter`;var Ef=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Df=u.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,unstable_mask:o,state:s,target:c,to:l,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h){let{basename:g,navigator:_,unstable_useTransitions:v}=u.useContext(wd),y=typeof l==`string`&&Ef.test(l),b=gd(l,g);l=b.to;let x=bee(l,{relative:r}),S=Md(),C=null;if(o){let e=pd(o,[],S.unstable_mask?S.unstable_mask.pathname:`/`,!0);g!==`/`&&(e.pathname=e.pathname===`/`?g:md([g,e.pathname])),C=_.createHref(e)}let[w,T,E]=Uee(n,m),D=ete(l,{replace:a,unstable_mask:o,state:s,target:c,preventScrollReset:d,relative:r,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:v});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=u.createElement(`a`,{...m,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:qee(h,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?u.createElement(u.Fragment,null,A,u.createElement(Wee,{page:x})):A});Df.displayName=`Link`;var Of=u.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let d=zd(a,{relative:c.relative}),f=Md(),p=u.useContext(bd),{navigator:m,basename:h}=u.useContext(wd),g=p!=null&&Lf(d)&&o===!0,_=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=f.pathname,y=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;t||(v=v.toLowerCase(),y=y?y.toLowerCase():null,_=_.toLowerCase()),y&&h&&(y=ld(y,h)||y);let b=_!==`/`&&_.endsWith(`/`)?_.length-1:_.length,x=v===_||!r&&v.startsWith(_)&&v.charAt(b)===`/`,S=y!=null&&(y===_||!r&&y.startsWith(_)&&y.charAt(_.length)===`/`),C={isActive:x,isPending:S,isTransitioning:g},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,g?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return u.createElement(Df,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Of.displayName=`NavLink`;var Zee=u.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=mf,action:s,onSubmit:c,relative:l,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p,...m},h)=>{let{unstable_useTransitions:g}=u.useContext(wd),_=rte(),v=jf(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&Ef.test(s);return u.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,m=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:d,viewTransition:f,unstable_defaultShouldRevalidate:p});g&&n!==!1?u.startTransition(()=>m()):m()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});Zee.displayName=`Form`;function Qee({getKey:e,storageKey:t,...n}){let r=u.useContext(Cf),{basename:i}=u.useContext(wd),a=Md(),o=nf();Ff({getKey:e,storageKey:t});let s=u.useMemo(()=>{if(!r||!e)return null;let t=Pf(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return u.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${yf(JSON.stringify(t||Mf))}, ${yf(JSON.stringify(s))})`}})}Qee.displayName=`ScrollRestoration`;function kf(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Af(e){let t=u.useContext(yd);return Vu(t,kf(e)),t}function $ee(e){let t=u.useContext(bd);return Vu(t,kf(e)),t}function ete(e,{target:t,replace:n,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c,unstable_useTransitions:l}={}){let d=Fd(),f=Md(),p=zd(e,{relative:o});return u.useCallback(m=>{if(Dee(m,t)){m.preventDefault();let t=n===void 0?Gu(f)===Gu(p):n,h=()=>d(e,{replace:t,unstable_mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,unstable_defaultShouldRevalidate:c});l?u.startTransition(()=>h()):h()}},[f,d,p,n,r,i,t,e,a,o,s,c,l])}var tte=0,nte=()=>`__${String(++tte)}__`;function rte(){let{router:e}=Af(`useSubmit`),{basename:t}=u.useContext(wd),n=ef(),r=e.fetch,i=e.navigate;return u.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Aee(e,t);a.navigate===!1?await r(a.fetcherKey||nte(),n,a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{unstable_defaultShouldRevalidate:a.unstable_defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function jf(e,{relative:t}={}){let{basename:n}=u.useContext(wd),r=u.useContext(Ed);Vu(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...zd(e||`.`,{relative:t})},o=Md();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:md([n,a.pathname])),Gu(a)}var Mf=`react-router-scroll-positions`,Nf={};function Pf(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:ld(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Ff({getKey:e,storageKey:t}={}){let{router:n}=Af(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=$ee(`useScrollRestoration`),{basename:a}=u.useContext(wd),o=Md(),s=nf(),c=tf();u.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),If(u.useCallback(()=>{if(c.state===`idle`){let t=Pf(o,s,a,e);Nf[t]=window.scrollY}try{sessionStorage.setItem(t||Mf,JSON.stringify(Nf))}catch(e){Hu(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(u.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Mf);e&&(Nf=JSON.parse(e))}catch{}},[t]),u.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Nf,()=>window.scrollY,e?(t,n)=>Pf(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),u.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{Hu(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function If(e,t){let{capture:n}=t||{};u.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Lf(e,{relative:t}={}){let n=u.useContext(xd);Vu(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Af(`useViewTransitionState`),i=zd(e,{relative:t});if(!n.isTransitioning)return!1;let a=ld(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=ld(n.nextLocation.pathname,r)||n.nextLocation.pathname;return cd(i.pathname,o)!=null||cd(i.pathname,a)!=null}var Rf=Symbol.for(`react.lazy`),zf=u.use;function Bf(e){return typeof e==`object`&&!!e&&`then`in e}function Vf(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Rf&&`_payload`in e&&Bf(e._payload)}function Hf(e){let t=Wf(e),n=u.forwardRef((e,n)=>{let{children:r,...i}=e;Vf(r)&&typeof zf==`function`&&(r=zf(r._payload));let a=u.Children.toArray(r),o=a.find(Kf);if(o){let e=o.props.children,r=a.map(t=>t===o?u.Children.count(e)>1?u.Children.only(null):u.isValidElement(e)?e.props.children:null:t);return(0,A.jsx)(t,{...i,ref:n,children:u.isValidElement(e)?u.cloneElement(e,void 0,r):null})}return(0,A.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var Uf=Hf(`Slot`);function Wf(e){let t=u.forwardRef((e,t)=>{let{children:n,...r}=e;if(Vf(n)&&typeof zf==`function`&&(n=zf(n._payload)),u.isValidElement(n)){let e=Jf(n),i=qf(r,n.props);return n.type!==u.Fragment&&(i.ref=t?E(t,e):e),u.cloneElement(n,i)}return u.Children.count(n)>1?u.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gf=Symbol(`radix.slottable`);function Kf(e){return u.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Gf}function qf(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Jf(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yf=768;function Xf(){let[e,t]=u.useState(void 0);return u.useEffect(()=>{let e=window.matchMedia(`(max-width: ${Yf-1}px)`),n=()=>{t(window.innerWidth<Yf)};return e.addEventListener(`change`,n),t(window.innerWidth<Yf),()=>e.removeEventListener(`change`,n)},[]),!!e}var Zf=Ft(`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`}}),W=u.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,A.jsx)(r?Uf:`button`,{className:H(Zf({variant:t,size:n,className:e})),ref:a,...i}));W.displayName=`Button`;var G=u.forwardRef(({className:e,type:t,...n},r)=>(0,A.jsx)(`input`,{type:t,className:H(`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}));G.displayName=`Input`;var Qf=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Hf(`Primitive.${t}`),r=u.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,A.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),$f=`Separator`,ep=`horizontal`,tp=[`horizontal`,`vertical`],np=u.forwardRef((e,t)=>{let{decorative:n,orientation:r=ep,...i}=e,a=rp(r)?r:ep,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,A.jsx)(Qf.div,{"data-orientation":a,...s,...i,ref:t})});np.displayName=$f;function rp(e){return tp.includes(e)}var ip=np,ap=u.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,A.jsx)(ip,{ref:i,decorative:n,orientation:t,className:H(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));ap.displayName=ip.displayName;var op=`focusScope.autoFocusOnMount`,sp=`focusScope.autoFocusOnUnmount`,cp={bubbles:!1,cancelable:!0},lp=`FocusScope`,up=u.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=u.useState(null),l=ie(i),d=ie(a),f=u.useRef(null),p=D(t,e=>c(e)),m=u.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;u.useEffect(()=>{if(r){let e=function(e){if(m.paused||!s)return;let t=e.target;s.contains(t)?f.current=t:_p(f.current,{select:!0})},t=function(e){if(m.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||_p(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&_p(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,m.paused]),u.useEffect(()=>{if(s){vp.add(m);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(op,cp);s.addEventListener(op,l),s.dispatchEvent(t),t.defaultPrevented||(dp(ite(pp(s)),{select:!0}),document.activeElement===e&&_p(s))}return()=>{s.removeEventListener(op,l),setTimeout(()=>{let t=new CustomEvent(sp,cp);s.addEventListener(sp,d),s.dispatchEvent(t),t.defaultPrevented||_p(e??document.body,{select:!0}),s.removeEventListener(sp,d),vp.remove(m)},0)}}},[s,l,d,m]);let h=u.useCallback(e=>{if(!n&&!r||m.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=fp(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&_p(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&_p(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,m.paused]);return(0,A.jsx)(z.div,{tabIndex:-1,...o,ref:p,onKeyDown:h})});up.displayName=lp;function dp(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(_p(r,{select:t}),document.activeElement!==n)return}function fp(e){let t=pp(e);return[mp(t,e),mp(t.reverse(),e)]}function pp(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function mp(e,t){for(let n of e)if(!hp(n,{upTo:t}))return n}function hp(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 gp(e){return e instanceof HTMLInputElement&&`select`in e}function _p(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&gp(e)&&t&&e.select()}}var vp=yp();function yp(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=bp(e,t),e.unshift(t)},remove(t){e=bp(e,t),e[0]?.resume()}}}function bp(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function ite(e){return e.filter(e=>e.tagName!==`A`)}var xp=0;function Sp(){u.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Cp()),document.body.insertAdjacentElement(`beforeend`,e[1]??Cp()),xp++,()=>{xp===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),xp--}},[])}function Cp(){let 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 wp=function(){return wp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},wp.apply(this,arguments)};function Tp(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function ate(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Ep=`right-scroll-bar-position`,Dp=`width-before-scroll-bar`,ote=`with-scroll-bars-hidden`,ste=`--removed-body-scroll-bar-size`;function Op(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function cte(e,t){var n=(0,u.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var lte=typeof window<`u`?u.useLayoutEffect:u.useEffect,kp=new WeakMap;function ute(e,t){var n=cte(t||null,function(t){return e.forEach(function(e){return Op(e,t)})});return lte(function(){var t=kp.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Op(e,null)}),i.forEach(function(e){r.has(e)||Op(e,a)})}kp.set(n,e)},[e]),n}function dte(e){return e}function fte(e,t){t===void 0&&(t=dte);var n=[],r=!1;return{read:function(){if(r)throw 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(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function pte(e){e===void 0&&(e={});var t=fte(null);return t.options=wp({async:!0,ssr:!1},e),t}var Ap=function(e){var t=e.sideCar,n=Tp(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return u.createElement(r,wp({},n))};Ap.isSideCarExport=!0;function mte(e,t){return e.useMedium(t),Ap}var jp=pte(),Mp=function(){},Np=u.forwardRef(function(e,t){var n=u.useRef(null),r=u.useState({onScrollCapture:Mp,onWheelCapture:Mp,onTouchMoveCapture:Mp}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,d=e.enabled,f=e.shards,p=e.sideCar,m=e.noRelative,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Tp(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=p,C=ute([n,t]),w=wp(wp({},x),i);return u.createElement(u.Fragment,null,d&&u.createElement(S,{sideCar:jp,removeScrollBar:l,shards:f,noRelative:m,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?u.cloneElement(u.Children.only(s),wp(wp({},w),{ref:C})):u.createElement(y,wp({},w,{className:c,ref:C}),s))});Np.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Np.classNames={fullWidth:Dp,zeroRight:Ep};var Pp,hte=function(){if(Pp)return Pp;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function gte(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=hte();return t&&e.setAttribute(`nonce`,t),e}function _te(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function vte(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var yte=function(){var e=0,t=null;return{add:function(n){e==0&&(t=gte())&&(_te(t,n),vte(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bte=function(){var e=yte();return function(t,n){u.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Fp=function(){var e=bte();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},xte={left:0,top:0,right:0,gap:0},Ip=function(e){return parseInt(e||``,10)||0},Ste=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ip(n),Ip(r),Ip(i)]},Cte=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return xte;var t=Ste(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])}},wte=Fp(),Lp=`data-scroll-locked`,Tte=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
13
+ .${ote} {
14
+ overflow: hidden ${r};
15
+ padding-right: ${s}px ${r};
16
+ }
17
+ body[${Lp}] {
18
+ overflow: hidden ${r};
19
+ overscroll-behavior: contain;
20
+ ${[t&&`position: relative ${r};`,n===`margin`&&`
21
+ padding-left: ${i}px;
22
+ padding-top: ${a}px;
23
+ padding-right: ${o}px;
24
+ margin-left:0;
25
+ margin-top:0;
26
+ margin-right: ${s}px ${r};
27
+ `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
28
+ }
29
+
30
+ .${Ep} {
31
+ right: ${s}px ${r};
32
+ }
33
+
34
+ .${Dp} {
35
+ margin-right: ${s}px ${r};
36
+ }
37
+
38
+ .${Ep} .${Ep} {
39
+ right: 0 ${r};
40
+ }
41
+
42
+ .${Dp} .${Dp} {
43
+ margin-right: 0 ${r};
44
+ }
45
+
46
+ body[${Lp}] {
47
+ ${ste}: ${s}px;
48
+ }
49
+ `},Rp=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ete=function(){u.useEffect(function(){return document.body.setAttribute(Lp,(Rp()+1).toString()),function(){var e=Rp()-1;e<=0?document.body.removeAttribute(Lp):document.body.setAttribute(Lp,e.toString())}},[])},Dte=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ete();var a=u.useMemo(function(){return Cte(i)},[i]);return u.createElement(wte,{styles:Tte(a,!t,i,n?``:`!important`)})},zp=!1;if(typeof window<`u`)try{var Bp=Object.defineProperty({},`passive`,{get:function(){return zp=!0,!0}});window.addEventListener(`test`,Bp,Bp),window.removeEventListener(`test`,Bp,Bp)}catch{zp=!1}var Vp=zp?{passive:!1}:!1,Ote=function(e){return e.tagName===`TEXTAREA`},Hp=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Ote(e)&&n[t]===`visible`)},kte=function(e){return Hp(e,`overflowY`)},Ate=function(e){return Hp(e,`overflowX`)},Up=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Wp(e,r)){var i=Gp(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},jte=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Mte=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Wp=function(e,t){return e===`v`?kte(t):Ate(t)},Gp=function(e,t){return e===`v`?jte(t):Mte(t)},Nte=function(e,t){return e===`h`&&t===`rtl`?-1:1},Pte=function(e,t,n,r,i){var a=Nte(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Gp(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Wp(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Kp=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},qp=function(e){return[e.deltaX,e.deltaY]},Jp=function(e){return e&&`current`in e?e.current:e},Fte=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Ite=function(e){return`
50
+ .block-interactivity-${e} {pointer-events: none;}
51
+ .allow-interactivity-${e} {pointer-events: all;}
52
+ `},Lte=0,Yp=[];function Rte(e){var t=u.useRef([]),n=u.useRef([0,0]),r=u.useRef(),i=u.useState(Lte++)[0],a=u.useState(Fp)[0],o=u.useRef(e);u.useEffect(function(){o.current=e},[e]),u.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=ate([e.lockRef.current],(e.shards||[]).map(Jp),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=u.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Kp(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Up(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Up(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Pte(h,t,e,h===`h`?s:c,!0)},[]),c=u.useCallback(function(e){var n=e;if(!(!Yp.length||Yp[Yp.length-1]!==a)){var r=`deltaY`in n?qp(n):Kp(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Fte(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Jp).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=u.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:zte(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=u.useCallback(function(e){n.current=Kp(e),r.current=void 0},[]),f=u.useCallback(function(t){l(t.type,qp(t),t.target,s(t,e.lockRef.current))},[]),p=u.useCallback(function(t){l(t.type,Kp(t),t.target,s(t,e.lockRef.current))},[]);u.useEffect(function(){return Yp.push(a),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener(`wheel`,c,Vp),document.addEventListener(`touchmove`,c,Vp),document.addEventListener(`touchstart`,d,Vp),function(){Yp=Yp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Vp),document.removeEventListener(`touchmove`,c,Vp),document.removeEventListener(`touchstart`,d,Vp)}},[]);var m=e.removeScrollBar,h=e.inert;return u.createElement(u.Fragment,null,h?u.createElement(a,{styles:Ite(i)}):null,m?u.createElement(Dte,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function zte(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Bte=mte(jp,Rte),Xp=u.forwardRef(function(e,t){return u.createElement(Np,wp({},e,{ref:t,sideCar:Bte}))});Xp.classNames=Np.classNames;var Vte=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Zp=new WeakMap,Qp=new WeakMap,$p={},em=0,tm=function(e){return e&&(e.host||tm(e.parentNode))},Hte=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=tm(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},Ute=function(e,t,n,r){var i=Hte(t,Array.isArray(e)?e:[e]);$p[n]||($p[n]=new WeakMap);var a=$p[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Zp.get(e)||0)+1,l=(a.get(e)||0)+1;Zp.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Qp.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),em++,function(){o.forEach(function(e){var t=Zp.get(e)-1,i=a.get(e)-1;Zp.set(e,t),a.set(e,i),t||(Qp.has(e)||e.removeAttribute(r),Qp.delete(e)),i||e.removeAttribute(n)}),em--,em||(Zp=new WeakMap,Zp=new WeakMap,Qp=new WeakMap,$p={})}},nm=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Vte(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Ute(r,i,n,`aria-hidden`)):function(){return null}},rm=`Dialog`,[im,am]=M(rm),[om,sm]=im(rm),cm=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=u.useRef(null),c=u.useRef(null),[l,d]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:rm});return(0,A.jsx)(om,{scope:t,triggerRef:s,contentRef:c,contentId:Ia(),titleId:Ia(),descriptionId:Ia(),open:l,onOpenChange:d,onOpenToggle:u.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};cm.displayName=rm;var lm=`DialogTrigger`,um=u.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sm(lm,n),a=D(t,i.triggerRef);return(0,A.jsx)(z.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Tm(i.open),...r,ref:a,onClick:w(e.onClick,i.onOpenToggle)})});um.displayName=lm;var dm=`DialogPortal`,[Wte,fm]=im(dm,{forceMount:void 0}),pm=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=sm(dm,t);return(0,A.jsx)(Wte,{scope:t,forceMount:n,children:u.Children.map(r,e=>(0,A.jsx)(we,{present:n||a.open,children:(0,A.jsx)(Se,{asChild:!0,container:i,children:e})}))})};pm.displayName=dm;var mm=`DialogOverlay`,hm=u.forwardRef((e,t)=>{let n=fm(mm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=sm(mm,e.__scopeDialog);return a.modal?(0,A.jsx)(we,{present:r||a.open,children:(0,A.jsx)(Kte,{...i,ref:t})}):null});hm.displayName=mm;var Gte=P(`DialogOverlay.RemoveScroll`),Kte=u.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sm(mm,n);return(0,A.jsx)(Xp,{as:Gte,allowPinchZoom:!0,shards:[i.contentRef],children:(0,A.jsx)(z.div,{"data-state":Tm(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),gm=`DialogContent`,_m=u.forwardRef((e,t)=>{let n=fm(gm,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=sm(gm,e.__scopeDialog);return(0,A.jsx)(we,{present:r||a.open,children:a.modal?(0,A.jsx)(qte,{...i,ref:t}):(0,A.jsx)(Jte,{...i,ref:t})})});_m.displayName=gm;var qte=u.forwardRef((e,t)=>{let n=sm(gm,e.__scopeDialog),r=u.useRef(null),i=D(t,n.contentRef,r);return u.useEffect(()=>{let e=r.current;if(e)return nm(e)},[]),(0,A.jsx)(vm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:w(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault())})}),Jte=u.forwardRef((e,t)=>{let n=sm(gm,e.__scopeDialog),r=u.useRef(!1),i=u.useRef(!1);return(0,A.jsx)(vm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),vm=u.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=sm(gm,n),c=u.useRef(null),l=D(t,c);return Sp(),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(up,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(de,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Tm(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(km,{titleId:s.titleId}),(0,A.jsx)(jm,{contentRef:c,descriptionId:s.descriptionId})]})]})}),ym=`DialogTitle`,bm=u.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sm(ym,n);return(0,A.jsx)(z.h2,{id:i.titleId,...r,ref:t})});bm.displayName=ym;var xm=`DialogDescription`,Sm=u.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sm(xm,n);return(0,A.jsx)(z.p,{id:i.descriptionId,...r,ref:t})});Sm.displayName=xm;var Cm=`DialogClose`,wm=u.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=sm(Cm,n);return(0,A.jsx)(z.button,{type:`button`,...r,ref:t,onClick:w(e.onClick,()=>i.onOpenChange(!1))})});wm.displayName=Cm;function Tm(e){return e?`open`:`closed`}var Em=`DialogTitleWarning`,[Dm,Om]=j(Em,{contentName:gm,titleName:ym,docsSlug:`dialog`}),km=({titleId:e})=>{let t=Om(Em),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
53
+
54
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
55
+
56
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return u.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Am=`DialogDescriptionWarning`,jm=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Om(Am).contentName}}.`;return u.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},Mm=cm,Nm=um,Pm=pm,Fm=hm,Im=_m,Lm=bm,Rm=Sm,zm=wm,Bm=Mm,Yte=Nm,Xte=Pm,Vm=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Fm,{className:H(`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}));Vm.displayName=Fm.displayName;var Hm=Ft(`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`}}),Um=u.forwardRef(({side:e=`right`,className:t,children:n,...r},i)=>(0,A.jsxs)(Xte,{children:[(0,A.jsx)(Vm,{}),(0,A.jsxs)(Im,{ref:i,className:H(Hm({side:e}),t),...r,children:[n,(0,A.jsxs)(zm,{className:`absolute right-4 top-4 rounded-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:[(0,A.jsx)(Ur,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Um.displayName=Im.displayName;var Wm=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Wm.displayName=`SheetHeader`;var Gm=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Gm.displayName=`SheetFooter`;var Km=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Lm,{ref:n,className:H(`text-lg font-semibold text-foreground`,e),...t}));Km.displayName=Lm.displayName;var qm=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Rm,{ref:n,className:H(`text-sm text-muted-foreground`,e),...t}));qm.displayName=Rm.displayName;function Jm({className:e,...t}){return(0,A.jsx)(`div`,{className:H(`animate-pulse rounded-md bg-muted`,e),...t})}var Zte=`sidebar:state`,Qte=3600*24*7,$te=`16rem`,ene=`18rem`,tne=`3rem`,nne=`b`,Ym=u.createContext(null);function Xm(){let e=u.useContext(Ym);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}var Zm=u.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:i,children:a,...o},s)=>{let c=Xf(),[l,d]=u.useState(!1),[f,p]=u.useState(e),m=t??f,h=u.useCallback(e=>{let t=typeof e==`function`?e(m):e;n?n(t):p(t),document.cookie=`${Zte}=${t}; path=/; max-age=${Qte}`},[n,m]),g=u.useCallback(()=>c?d(e=>!e):h(e=>!e),[c,h,d]);u.useEffect(()=>{let e=e=>{e.key===nne&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[g]);let _=m?`expanded`:`collapsed`,v=u.useMemo(()=>({state:_,open:m,setOpen:h,isMobile:c,openMobile:l,setOpenMobile:d,toggleSidebar:g}),[_,m,h,c,l,d,g]);return(0,A.jsx)(Ym.Provider,{value:v,children:(0,A.jsx)(al,{delayDuration:0,children:(0,A.jsx)(`div`,{style:{"--sidebar-width":$te,"--sidebar-width-icon":tne,...i},className:H(`group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar`,r),ref:s,...o,children:a})})})});Zm.displayName=`SidebarProvider`;var Qm=u.forwardRef(({side:e=`left`,variant:t=`sidebar`,collapsible:n=`offcanvas`,className:r,children:i,...a},o)=>{let{isMobile:s,state:c,openMobile:l,setOpenMobile:u}=Xm();return n===`none`?(0,A.jsx)(`div`,{className:H(`flex h-full w-[var(--sidebar-width)] flex-col bg-sidebar text-sidebar-foreground`,r),ref:o,...a,children:i}):s?(0,A.jsx)(Bm,{open:l,onOpenChange:u,...a,children:(0,A.jsx)(Um,{"data-sidebar":`sidebar`,"data-mobile":`true`,className:`w-[var(--sidebar-width)] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden`,style:{"--sidebar-width":ene},side:e,children:(0,A.jsx)(`div`,{className:`flex h-full w-full flex-col`,children:i})})}):(0,A.jsxs)(`div`,{ref:o,className:`group peer hidden text-sidebar-foreground md:block`,"data-state":c,"data-collapsible":c===`collapsed`?n:``,"data-variant":t,"data-side":e,children:[(0,A.jsx)(`div`,{className:H(`relative h-svh w-[var(--sidebar-width)] bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,t===`floating`||t===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]`:`group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]`)}),(0,A.jsx)(`div`,{className:H(`fixed inset-y-0 z-10 hidden h-svh w-[var(--sidebar-width)] transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,t===`floating`||t===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]`:`group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)] group-data-[side=left]:border-r group-data-[side=right]:border-l`,r),...a,children:(0,A.jsx)(`div`,{"data-sidebar":`sidebar`,className:`flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow`,children:i})})]})});Qm.displayName=`Sidebar`;var $m=u.forwardRef(({className:e,onClick:t,...n},r)=>{let{toggleSidebar:i}=Xm();return(0,A.jsxs)(W,{ref:r,"data-sidebar":`trigger`,variant:`ghost`,size:`icon`,className:H(`h-7 w-7`,e),onClick:e=>{t?.(e),i()},...n,children:[(0,A.jsx)(rr,{}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})});$m.displayName=`SidebarTrigger`;var rne=u.forwardRef(({className:e,...t},n)=>{let{toggleSidebar:r}=Xm();return(0,A.jsx)(`button`,{ref:n,"data-sidebar":`rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onClick:r,title:`Toggle Sidebar`,className:H(`absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 hover:after:bg-sidebar-border sm:flex`,`[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,e),...t})});rne.displayName=`SidebarRail`;var eh=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`main`,{ref:n,className:H(`relative flex min-h-svh flex-1 flex-col bg-background`,`peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow`,e),...t}));eh.displayName=`SidebarInset`;var ine=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(G,{ref:n,"data-sidebar":`input`,className:H(`h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring`,e),...t}));ine.displayName=`SidebarInput`;var ane=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,"data-sidebar":`header`,className:H(`flex flex-col gap-2 p-2`,e),...t}));ane.displayName=`SidebarHeader`;var one=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,"data-sidebar":`footer`,className:H(`flex flex-col gap-2 p-2`,e),...t}));one.displayName=`SidebarFooter`;var sne=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(ap,{ref:n,"data-sidebar":`separator`,className:H(`mx-2 w-auto bg-sidebar-border`,e),...t}));sne.displayName=`SidebarSeparator`;var th=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,"data-sidebar":`content`,className:H(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,e),...t}));th.displayName=`SidebarContent`;var nh=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,"data-sidebar":`group`,className:H(`relative flex w-full min-w-0 flex-col p-2`,e),...t}));nh.displayName=`SidebarGroup`;var rh=u.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,A.jsx)(t?Uf:`div`,{ref:r,"data-sidebar":`group-label`,className:H(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0`,e),...n}));rh.displayName=`SidebarGroupLabel`;var cne=u.forwardRef(({className:e,asChild:t=!1,...n},r)=>(0,A.jsx)(t?Uf:`button`,{ref:r,"data-sidebar":`group-action`,className:H(`absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`group-data-[collapsible=icon]:hidden`,e),...n}));cne.displayName=`SidebarGroupAction`;var ih=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,"data-sidebar":`group-content`,className:H(`w-full text-sm`,e),...t}));ih.displayName=`SidebarGroupContent`;var ah=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`ul`,{ref:n,"data-sidebar":`menu`,className:H(`flex w-full min-w-0 flex-col gap-1`,e),...t}));ah.displayName=`SidebarMenu`;var oh=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`li`,{ref:n,"data-sidebar":`menu-item`,className:H(`group/menu-item relative`,e),...t}));oh.displayName=`SidebarMenuItem`;var lne=Ft(`peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:!p-0`}},defaultVariants:{variant:`default`,size:`default`}}),sh=u.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n=`default`,size:r=`default`,tooltip:i,className:a,...o},s)=>{let c=e?Uf:`button`,{isMobile:l,state:u}=Xm(),d=(0,A.jsx)(c,{ref:s,"data-sidebar":`menu-button`,"data-size":r,"data-active":t,className:H(lne({variant:n,size:r}),a),...o});return i?(typeof i==`string`&&(i={children:i}),(0,A.jsxs)(ol,{children:[(0,A.jsx)(sl,{asChild:!0,children:d}),(0,A.jsx)(cl,{side:`right`,align:`center`,hidden:u!==`collapsed`||l,...i})]})):d});sh.displayName=`SidebarMenuButton`;var une=u.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},i)=>(0,A.jsx)(t?Uf:`button`,{ref:i,"data-sidebar":`menu-action`,className:H(`absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,`after:absolute after:-inset-2 after:md:hidden`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,n&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0`,e),...r}));une.displayName=`SidebarMenuAction`;var dne=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,"data-sidebar":`menu-badge`,className:H(`pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground`,`peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground`,`peer-data-[size=sm]/menu-button:top-1`,`peer-data-[size=default]/menu-button:top-1.5`,`peer-data-[size=lg]/menu-button:top-2.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));dne.displayName=`SidebarMenuBadge`;var fne=u.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{let i=u.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return(0,A.jsxs)(`div`,{ref:r,"data-sidebar":`menu-skeleton`,className:H(`flex h-8 items-center gap-2 rounded-md px-2`,e),...n,children:[t&&(0,A.jsx)(Jm,{className:`size-4 rounded-md`,"data-sidebar":`menu-skeleton-icon`}),(0,A.jsx)(Jm,{className:`h-4 max-w-[--skeleton-width] flex-1`,"data-sidebar":`menu-skeleton-text`,style:{"--skeleton-width":i}})]})});fne.displayName=`SidebarMenuSkeleton`;var ch=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`ul`,{ref:n,"data-sidebar":`menu-sub`,className:H(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5`,`group-data-[collapsible=icon]:hidden`,e),...t}));ch.displayName=`SidebarMenuSub`;var lh=u.forwardRef(({...e},t)=>(0,A.jsx)(`li`,{ref:t,...e}));lh.displayName=`SidebarMenuSubItem`;var uh=u.forwardRef(({asChild:e=!1,size:t=`md`,isActive:n,className:r,...i},a)=>(0,A.jsx)(e?Uf:`a`,{ref:a,"data-sidebar":`menu-sub-button`,"data-size":t,"data-active":n,className:H(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,`data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground`,t===`sm`&&`text-xs`,t===`md`&&`text-sm`,`group-data-[collapsible=icon]:hidden`,r),...i}));uh.displayName=`SidebarMenuSubButton`;var dh=i(e=>({isOpen:!1,data:null,show:t=>e({isOpen:!0,data:t}),close:()=>e({isOpen:!1,data:null})})),fh=typeof window<`u`?window.__HIVE_CONFIG__:void 0,ph=fh?.apiUrl||``,mh=fh?.wsUrl||``,hh=e=>/localhost|127\.0\.0\.1/.test(e),gh=/localhost|127\.0\.0\.1/.test(window.location.hostname);function _h(){return ph&&(!hh(ph)||gh)?ph:``}function vh(){if(mh&&(!hh(mh)||gh))return mh;let e=_h();return e?e.replace(/^http/,`ws`):`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}`}var yh=i((e,t)=>{let n=null,r=null;return{ws:null,status:`disconnected`,url:vh()+`/ws`,lastPing:null,retryCount:0,handlers:new Map,sessionId:null,setStatus:t=>e({status:t}),setLastPing:t=>e({lastPing:t}),setSessionId:t=>e({sessionId:t}),connect:i=>{let a=t();a.ws&&a.ws.close(),n&&clearTimeout(n);let o=a.url;try{let e=new URL(o),t=typeof localStorage<`u`?localStorage.getItem(`hive-auth-token`):null;i&&e.searchParams.set(`session`,i),t&&e.searchParams.set(`token`,t),o=e.toString()}catch{}e({status:`connecting`});try{let a=new WebSocket(o);a.onopen=()=>{console.log(`[WS-GLOBAL] Connected to`,o),e({status:`connected`,retryCount:0,ws:a}),a.send(JSON.stringify({type:`canvas_subscribe`})),r&&clearInterval(r),r=setInterval(()=>{a.readyState===WebSocket.OPEN&&a.send(JSON.stringify({type:`ping`,sessionId:i}))},3e4)},a.onclose=a=>{console.log(`[WS-GLOBAL] Disconnected from`,o,`Code:`,a.code),r&&=(clearInterval(r),null),e({status:`disconnected`,ws:null}),a.code!==1e3&&a.code!==1001&&(n=setTimeout(()=>{e(e=>({retryCount:e.retryCount+1})),t().connect(i)},3e3))},a.onerror=()=>{console.error(`[WS-GLOBAL] Error on`,o),e({status:`error`})},a.onmessage=n=>{e({lastPing:new Date().toISOString()});try{let r=JSON.parse(n.data),i=r.type;if(i===`pong`)return;i===`welcome`&&r.sessionId&&(e({sessionId:r.sessionId}),dh.getState().show(r));let a=t().handlers.get(i);a&&a.forEach(e=>e(r))}catch{}}}catch(t){console.error(`[WS-GLOBAL] Failed to create WebSocket:`,t),e({status:`error`})}},disconnect:()=>{let{ws:i}=t();n&&=(clearTimeout(n),null),r&&=(clearInterval(r),null),i?.close(1e3),e({ws:null,status:`disconnected`})},send:e=>{let{ws:n,status:r}=t();n&&r===`connected`&&n.send(JSON.stringify(e))},subscribe:(e,n)=>{let{handlers:r}=t();return r.has(e)||r.set(e,new Set),r.get(e).add(n),()=>{let t=r.get(e);t&&(t.delete(n),t.size===0&&r.delete(e))}}}});function bh(e){let{status:t,url:n,connect:r,disconnect:i,send:a,subscribe:o}=yh();return(0,u.useEffect)(()=>{},[r]),{status:t,url:n,connect:r,disconnect:i,send:a,subscribe:o}}var xh={connected:`bg-hive-connected`,connecting:`bg-hive-thinking animate-pulse`,disconnected:`bg-hive-disconnected`,error:`bg-hive-disconnected`};function Sh(){let{status:e}=bh();return(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:`inline-block h-2 w-2 rounded-full ${xh[e]}`}),(0,A.jsxs)(`span`,{className:`hidden sm:inline`,children:[`WS: `,e]})]})}function Ch(){return(0,A.jsxs)(`header`,{className:`flex h-12 items-center justify-between border-b px-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)($m,{className:`h-8 w-8`}),(0,A.jsxs)(`h1`,{className:`text-sm font-semibold tracking-tight`,children:[(0,A.jsx)(`span`,{className:`text-primary`,children:`⬡`}),` Hive`]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,A.jsx)(Sh,{})})]})}var wh=Of,Th=(0,u.forwardRef)(({className:e,activeClassName:t,pendingClassName:n,to:r,...i},a)=>(0,A.jsx)(wh,{ref:a,to:r,className:({isActive:r,isPending:i})=>H(e,r&&t,i&&n),...i}));Th.displayName=`NavLink`;var Eh=`Collapsible`,[Dh,Oh]=M(Eh),[kh,Ah]=Dh(Eh),jh=u.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=ke({prop:r,defaultProp:i??!1,onChange:o,caller:Eh});return(0,A.jsx)(kh,{scope:n,disabled:a,contentId:Ia(),open:c,onOpenToggle:u.useCallback(()=>l(e=>!e),[l]),children:(0,A.jsx)(z.div,{"data-state":Lh(c),"data-disabled":a?``:void 0,...s,ref:t})})});jh.displayName=Eh;var Mh=`CollapsibleTrigger`,Nh=u.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=Ah(Mh,n);return(0,A.jsx)(z.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":Lh(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:w(e.onClick,i.onOpenToggle)})});Nh.displayName=Mh;var Ph=`CollapsibleContent`,Fh=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Ah(Ph,e.__scopeCollapsible);return(0,A.jsx)(we,{present:n||i.open,children:({present:e})=>(0,A.jsx)(Ih,{...r,ref:t,present:e})})});Fh.displayName=Ph;var Ih=u.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=Ah(Ph,n),[s,c]=u.useState(r),l=u.useRef(null),d=D(t,l),f=u.useRef(0),p=f.current,m=u.useRef(0),h=m.current,g=o.open||s,_=u.useRef(g),v=u.useRef(void 0);return u.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),be(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();f.current=t.height,m.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,A.jsx)(z.div,{"data-state":Lh(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:d,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})});function Lh(e){return e?`open`:`closed`}var Rh=jh,zh=Nh,Bh=Fh,Vh=Rh,Hh=Nh,Uh=Fh;function Wh({icon:e,...t}){return(0,A.jsx)(e,{...t})}var Gh=[{title:`Dashboard`,url:`/`,icon:qn},{title:`Web Chat`,url:`/chat`,icon:er},{title:`Agentes`,url:`/agents`,icon:qt},{title:`Proyectos`,url:`/projects`,icon:An},{title:`Canales`,url:`/channels`,icon:er},{title:`Providers`,url:`/providers`,icon:Jt},{title:`Canvas`,url:`/canvas`,icon:Kn},{title:`Bridge`,url:`/bridge`,icon:Xt},{title:`Logs`,url:`/logs`,icon:hr}],Kh=[{label:`Entorno`,items:[{id:`herramientas`,label:`Herramientas`,icon:Hr},{id:`mcp`,label:`MCP Servers`,icon:yr},{id:`skills`,label:`Skills`,icon:zr},{id:`etica`,label:`Ética`,icon:Sr}]},{label:`Usuario`,items:[{id:`perfil`,label:`Perfil`,icon:Lr},{id:`voz`,label:`Voz`,icon:tr},{id:`seguridad`,label:`Seguridad`,icon:Sr}]}],qh=[{title:`Notas`,url:`/notas`,icon:Ar},{title:`Cron Jobs`,url:`/cron-jobs`,icon:fn}],Jh=[{id:`learn`,label:`Aprender`,url:`/hivelearn`,icon:Kt},{id:`sessions`,label:`Sesiones`,url:`/hivelearn/sessions`,icon:Vn},{id:`swarm`,label:`Enjambre`,url:`/hivelearn/swarm`,icon:nr},{id:`config`,label:`Configuración`,url:`/hivelearn/config`,icon:br}];function Yh(){let e=Md(),t=e.pathname.startsWith(`/settings`),n=e.pathname.startsWith(`/hivelearn`);return(0,A.jsx)(Qm,{collapsible:`icon`,className:`hive-sidebar`,children:(0,A.jsx)(th,{children:(0,A.jsxs)(nh,{children:[(0,A.jsx)(rh,{children:`Navegación`}),(0,A.jsx)(ih,{children:(0,A.jsxs)(ah,{children:[Gh.map(e=>(0,A.jsx)(oh,{children:(0,A.jsx)(sh,{asChild:!0,children:(0,A.jsxs)(Th,{to:e.url,end:e.url===`/`,className:`hive-sidebar-item group/item text-white/50 hover:text-white`,activeClassName:`hive-sidebar-item--active text-blue-400 font-bold`,children:[(0,A.jsx)(Wh,{icon:e.icon,className:`h-4 w-4 transition-transform group-hover/item:scale-110`}),(0,A.jsx)(`span`,{children:e.title})]})})},e.title)),(0,A.jsx)(Vh,{open:n,asChild:!0,children:(0,A.jsxs)(oh,{children:[(0,A.jsx)(sh,{asChild:!0,isActive:n,children:(0,A.jsxs)(Th,{to:`/hivelearn`,className:`hive-sidebar-item group/item text-white/50 hover:text-white`,activeClassName:`hive-sidebar-item--active text-amber-400 font-bold`,children:[(0,A.jsx)(Wh,{icon:Fn,className:`h-4 w-4 transition-transform group-hover/item:scale-110`}),(0,A.jsx)(`span`,{children:`HiveLearn`}),(0,A.jsx)(`span`,{className:`ml-auto rounded-full bg-amber-500/20 text-[9px] font-semibold text-amber-400 px-1.5 py-0.5 leading-none`,children:`En construcción`})]})}),(0,A.jsx)(Uh,{children:(0,A.jsx)(ch,{children:Jh.map(e=>(0,A.jsx)(lh,{children:(0,A.jsx)(uh,{asChild:!0,children:(0,A.jsxs)(Th,{to:e.url,end:e.url===`/hivelearn`,className:`flex items-center gap-2.5 px-3 py-2 rounded-lg text-white/40 hover:text-white hover:bg-white/5 transition-all text-xs`,activeClassName:`text-amber-400 bg-amber-500/5 font-semibold`,children:[(0,A.jsx)(Wh,{icon:e.icon,className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:e.label})]})})},e.id))})})]})}),(0,A.jsx)(`div`,{className:`h-4`}),(0,A.jsx)(`p`,{className:`px-2 pb-1 text-[10px] font-bold uppercase tracking-widest text-white/20`,children:`Cognitivo`}),qh.map(e=>(0,A.jsx)(oh,{children:(0,A.jsx)(sh,{asChild:!0,children:(0,A.jsxs)(Th,{to:e.url,className:`hive-sidebar-item group/item text-white/50 hover:text-white`,activeClassName:`hive-sidebar-item--active text-blue-400 font-bold`,children:[(0,A.jsx)(Wh,{icon:e.icon,className:`h-4 w-4 transition-transform group-hover/item:scale-110`}),(0,A.jsx)(`span`,{children:e.title})]})})},e.title)),(0,A.jsx)(`div`,{className:`h-4`}),(0,A.jsx)(`p`,{className:`px-2 pb-1 text-[10px] font-bold uppercase tracking-widest text-white/20`,children:`Sistema`}),(0,A.jsx)(Vh,{open:t,asChild:!0,children:(0,A.jsxs)(oh,{children:[(0,A.jsx)(sh,{asChild:!0,isActive:t,children:(0,A.jsxs)(Th,{to:`/settings/herramientas`,className:`hive-sidebar-item group/item text-white/50 hover:text-white`,activeClassName:`hive-sidebar-item--active text-blue-400 font-bold`,children:[(0,A.jsx)(Wh,{icon:Er,className:`h-4 w-4 transition-transform group-hover/item:scale-110`}),(0,A.jsx)(`span`,{children:`Ajustes`})]})}),(0,A.jsx)(Uh,{children:Kh.map(e=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`px-2 pt-2 pb-0.5 text-[10px] font-semibold uppercase tracking-widest text-sidebar-foreground/40`,children:e.label}),(0,A.jsx)(ch,{children:e.items.map(e=>(0,A.jsx)(lh,{children:(0,A.jsx)(uh,{asChild:!0,children:(0,A.jsxs)(Th,{to:`/settings/${e.id}`,className:`flex items-center gap-2.5 px-3 py-2 rounded-lg text-white/40 hover:text-white hover:bg-white/5 transition-all text-xs`,activeClassName:`text-blue-400 bg-blue-500/5 font-semibold`,children:[(0,A.jsx)(Wh,{icon:e.icon,className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:e.label})]})})},e.id))})]},e.label))})]})})]})})]})})})}var Xh=t({loader:()=>Qh,useLoaderStore:()=>Zh}),Zh=i(e=>({isLoading:!1,message:void 0,showLoader:t=>e({isLoading:!0,message:t}),hideLoader:()=>e({isLoading:!1,message:void 0})})),Qh={show:e=>Zh.getState().showLoader(e),hide:()=>Zh.getState().hideLoader()},$h=e(r(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.Sweetalert2=r())})(e,(function(){function e(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function t(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function n(t,n){return t.get(e(t,n))}function r(e,n,r){t(e,n),n.set(e,r)}function i(t,n,r){return t.set(e(t,n),r),r}let a={},o=()=>{a.previousActiveElement instanceof HTMLElement?(a.previousActiveElement.focus(),a.previousActiveElement=null):document.body&&document.body.focus()},s=e=>new Promise(t=>{if(!e)return t();let n=window.scrollX,r=window.scrollY;a.restoreFocusTimeout=setTimeout(()=>{o(),t()},100),window.scrollTo(n,r)}),c=`swal2-`,l=`container.shown.height-auto.iosfix.popup.modal.no-backdrop.no-transition.toast.toast-shown.show.hide.close.title.html-container.actions.confirm.deny.cancel.footer.icon.icon-content.image.input.file.range.select.radio.checkbox.label.textarea.inputerror.input-label.validation-message.progress-steps.active-progress-step.progress-step.progress-step-line.loader.loading.styled.top.top-start.top-end.top-left.top-right.center.center-start.center-end.center-left.center-right.bottom.bottom-start.bottom-end.bottom-left.bottom-right.grow-row.grow-column.grow-fullscreen.rtl.timer-progress-bar.timer-progress-bar-container.scrollbar-measure.icon-success.icon-warning.icon-info.icon-question.icon-error.draggable.dragging`.split(`.`).reduce((e,t)=>(e[t]=c+t,e),{}),u=[`success`,`warning`,`info`,`question`,`error`].reduce((e,t)=>(e[t]=c+t,e),{}),d=`SweetAlert2:`,f=e=>e.charAt(0).toUpperCase()+e.slice(1),p=e=>{console.warn(`${d} ${typeof e==`object`?e.join(` `):e}`)},m=e=>{console.error(`${d} ${e}`)},h=[],g=e=>{h.includes(e)||(h.push(e),p(e))},_=(e,t=null)=>{g(`"${e}" is deprecated and will be removed in the next major release.${t?` Use "${t}" instead.`:``}`)},v=e=>typeof e==`function`?e():e,y=e=>e&&typeof e.toPromise==`function`,b=e=>y(e)?e.toPromise():Promise.resolve(e),x=e=>e&&Promise.resolve(e)===e,S=()=>navigator.userAgent.includes(`Firefox`),C=()=>document.body.querySelector(`.${l.container}`),w=e=>{let t=C();return t?t.querySelector(e):null},T=e=>w(`.${e}`),E=()=>T(l.popup),D=()=>T(l.icon),O=()=>T(l[`icon-content`]),k=()=>T(l.title),A=()=>T(l[`html-container`]),j=()=>T(l.image),M=()=>T(l[`progress-steps`]),N=()=>T(l[`validation-message`]),P=()=>w(`.${l.actions} .${l.confirm}`),F=()=>w(`.${l.actions} .${l.cancel}`),ee=()=>w(`.${l.actions} .${l.deny}`),I=()=>T(l[`input-label`]),L=()=>w(`.${l.loader}`),R=()=>T(l.actions),te=()=>T(l.footer),ne=()=>T(l[`timer-progress-bar`]),z=()=>T(l.close),re=()=>{let e=E();if(!e)return[];let t=e.querySelectorAll(`[tabindex]:not([tabindex="-1"]):not([tabindex="0"])`),n=Array.from(t).sort((e,t)=>{let n=parseInt(e.getAttribute(`tabindex`)||`0`),r=parseInt(t.getAttribute(`tabindex`)||`0`);return n>r?1:n<r?-1:0}),r=e.querySelectorAll(`
57
+ a[href],
58
+ area[href],
59
+ input:not([disabled]),
60
+ select:not([disabled]),
61
+ textarea:not([disabled]),
62
+ button:not([disabled]),
63
+ iframe,
64
+ object,
65
+ embed,
66
+ [tabindex="0"],
67
+ [contenteditable],
68
+ audio[controls],
69
+ video[controls],
70
+ summary
71
+ `),i=Array.from(r).filter(e=>e.getAttribute(`tabindex`)!==`-1`);return[...new Set(n.concat(i))].filter(e=>Se(e))},ie=()=>B(document.body,l.shown)&&!B(document.body,l[`toast-shown`])&&!B(document.body,l[`no-backdrop`]),ae=()=>{let e=E();return e?B(e,l.toast):!1},oe=()=>{let e=E();return e?e.hasAttribute(`data-loading`):!1},se=(e,t)=>{if(e.textContent=``,t){let n=new DOMParser().parseFromString(t,`text/html`),r=n.querySelector(`head`);r&&Array.from(r.childNodes).forEach(t=>{e.appendChild(t)});let i=n.querySelector(`body`);i&&Array.from(i.childNodes).forEach(t=>{t instanceof HTMLVideoElement||t instanceof HTMLAudioElement?e.appendChild(t.cloneNode(!0)):e.appendChild(t)})}},B=(e,t)=>{if(!t)return!1;let n=t.split(/\s+/);for(let t=0;t<n.length;t++)if(!e.classList.contains(n[t]))return!1;return!0},ce=(e,t)=>{Array.from(e.classList).forEach(n=>{!Object.values(l).includes(n)&&!Object.values(u).includes(n)&&!Object.values(t.showClass||{}).includes(n)&&e.classList.remove(n)})},le=(e,t,n)=>{if(ce(e,t),!t.customClass)return;let r=t.customClass[n];if(r){if(typeof r!=`string`&&!r.forEach){p(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof r}"`);return}pe(e,r)}},ue=(e,t)=>{if(!t)return null;switch(t){case`select`:case`textarea`:case`file`:return e.querySelector(`.${l.popup} > .${l[t]}`);case`checkbox`:return e.querySelector(`.${l.popup} > .${l.checkbox} input`);case`radio`:return e.querySelector(`.${l.popup} > .${l.radio} input:checked`)||e.querySelector(`.${l.popup} > .${l.radio} input:first-child`);case`range`:return e.querySelector(`.${l.popup} > .${l.range} input`);default:return e.querySelector(`.${l.popup} > .${l.input}`)}},de=e=>{if(e.focus(),e.type!==`file`){let t=e.value;e.value=``,e.value=t}},fe=(e,t,n)=>{if(!e||!t)return;let r=typeof t==`string`?t.split(/\s+/).filter(Boolean):t;(Array.isArray(e)?e:[e]).forEach(e=>{r.forEach(t=>{n?e.classList.add(t):e.classList.remove(t)})})},pe=(e,t)=>{fe(e,t,!0)},me=(e,t)=>{fe(e,t,!1)},he=(e,t)=>{let n=Array.from(e.children);for(let e=0;e<n.length;e++){let r=n[e];if(r instanceof HTMLElement&&B(r,t))return r}},ge=(e,t,n)=>{n===`${parseInt(`${n}`)}`&&(n=parseInt(n)),n||n===0?e.style.setProperty(t,typeof n==`number`?`${n}px`:n):e.style.removeProperty(t)},_e=(e,t=`flex`)=>{e&&(e.style.display=t)},ve=e=>{e&&(e.style.display=`none`)},ye=(e,t=`block`)=>{e&&new MutationObserver(()=>{xe(e,e.innerHTML,t)}).observe(e,{childList:!0,subtree:!0})},be=(e,t,n,r)=>{let i=e.querySelector(t);i&&i.style.setProperty(n,r)},xe=(e,t,n=`flex`)=>{t?_e(e,n):ve(e)},Se=e=>!!(e&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)),Ce=()=>!Se(P())&&!Se(ee())&&!Se(F()),we=e=>e.scrollHeight>e.clientHeight,Te=(e,t)=>{let n=e;for(;n&&n!==t;){if(we(n))return!0;n=n.parentElement}return!1},Ee=e=>{let t=window.getComputedStyle(e),n=parseFloat(t.getPropertyValue(`animation-duration`)||`0`),r=parseFloat(t.getPropertyValue(`transition-duration`)||`0`);return n>0||r>0},De=(e,t=!1)=>{let n=ne();n&&Se(n)&&(t&&(n.style.transition=`none`,n.style.width=`100%`),setTimeout(()=>{n.style.transition=`width ${e/1e3}s linear`,n.style.width=`0%`},10))},Oe=()=>{let e=ne();if(!e)return;let t=parseInt(window.getComputedStyle(e).width);e.style.removeProperty(`transition`),e.style.width=`100%`;let n=t/parseInt(window.getComputedStyle(e).width)*100;e.style.width=`${n}%`},ke=()=>typeof window>`u`||typeof document>`u`,Ae=`
72
+ <div aria-labelledby="${l.title}" aria-describedby="${l[`html-container`]}" class="${l.popup}" tabindex="-1">
73
+ <button type="button" class="${l.close}"></button>
74
+ <ul class="${l[`progress-steps`]}"></ul>
75
+ <div class="${l.icon}"></div>
76
+ <img class="${l.image}" />
77
+ <h2 class="${l.title}" id="${l.title}"></h2>
78
+ <div class="${l[`html-container`]}" id="${l[`html-container`]}"></div>
79
+ <input class="${l.input}" id="${l.input}" />
80
+ <input type="file" class="${l.file}" />
81
+ <div class="${l.range}">
82
+ <input type="range" />
83
+ <output></output>
84
+ </div>
85
+ <select class="${l.select}" id="${l.select}"></select>
86
+ <div class="${l.radio}"></div>
87
+ <label class="${l.checkbox}">
88
+ <input type="checkbox" id="${l.checkbox}" />
89
+ <span class="${l.label}"></span>
90
+ </label>
91
+ <textarea class="${l.textarea}" id="${l.textarea}"></textarea>
92
+ <div class="${l[`validation-message`]}" id="${l[`validation-message`]}"></div>
93
+ <div class="${l.actions}">
94
+ <div class="${l.loader}"></div>
95
+ <button type="button" class="${l.confirm}"></button>
96
+ <button type="button" class="${l.deny}"></button>
97
+ <button type="button" class="${l.cancel}"></button>
98
+ </div>
99
+ <div class="${l.footer}"></div>
100
+ <div class="${l[`timer-progress-bar-container`]}">
101
+ <div class="${l[`timer-progress-bar`]}"></div>
102
+ </div>
103
+ </div>
104
+ `.replace(/(^|\n)\s*/g,``),je=()=>{let e=C();return e?(e.remove(),me([document.documentElement,document.body],[l[`no-backdrop`],l[`toast-shown`],l[`has-column`]]),!0):!1},Me=()=>{a.currentInstance&&a.currentInstance.resetValidationMessage()},Ne=()=>{let e=E();if(!e)return;let t=he(e,l.input),n=he(e,l.file),r=e.querySelector(`.${l.range} input`),i=e.querySelector(`.${l.range} output`),a=he(e,l.select),o=e.querySelector(`.${l.checkbox} input`),s=he(e,l.textarea);t&&(t.oninput=Me),n&&(n.onchange=Me),a&&(a.onchange=Me),o&&(o.onchange=Me),s&&(s.oninput=Me),r&&i&&(r.oninput=()=>{Me(),i.value=r.value},r.onchange=()=>{Me(),i.value=r.value})},Pe=e=>{if(typeof e==`string`){let t=document.querySelector(e);if(!t)throw Error(`Target element "${e}" not found`);return t}return e},Fe=e=>{let t=E();t&&(t.setAttribute(`role`,e.toast?`alert`:`dialog`),t.setAttribute(`aria-live`,e.toast?`polite`:`assertive`),e.toast||t.setAttribute(`aria-modal`,`true`))},Ie=e=>{window.getComputedStyle(e).direction===`rtl`&&(pe(C(),l.rtl),a.isRTL=!0)},Le=e=>{let t=je();if(ke()){m(`SweetAlert2 requires document to initialize`);return}let n=document.createElement(`div`);n.className=l.container,t&&pe(n,l[`no-transition`]),se(n,Ae),n.dataset.swal2Theme=e.theme;let r=Pe(e.target||`body`);r.appendChild(n),e.topLayer&&(n.setAttribute(`popover`,``),n.showPopover()),Fe(e),Ie(r),Ne()},Re=(e,t)=>{e instanceof HTMLElement?t.appendChild(e):typeof e==`object`?ze(e,t):e&&se(t,e)},ze=(e,t)=>{`jquery`in e?Be(t,e):se(t,e.toString())},Be=(e,t)=>{if(e.textContent=``,0 in t)for(let n=0;n in t;n++)e.appendChild(t[n].cloneNode(!0));else e.appendChild(t.cloneNode(!0))},Ve=(e,t)=>{let n=R(),r=L();!n||!r||(!t.showConfirmButton&&!t.showDenyButton&&!t.showCancelButton?ve(n):_e(n),le(n,t,`actions`),He(n,r,t),se(r,t.loaderHtml||``),le(r,t,`loader`))};function He(e,t,n){let r=P(),i=ee(),a=F();!r||!i||!a||(Ge(r,`confirm`,n),Ge(i,`deny`,n),Ge(a,`cancel`,n),Ue(r,i,a,n),n.reverseButtons&&(n.toast?(e.insertBefore(a,r),e.insertBefore(i,r)):(e.insertBefore(a,t),e.insertBefore(i,t),e.insertBefore(r,t))))}function Ue(e,t,n,r){if(!r.buttonsStyling){me([e,t,n],l.styled);return}pe([e,t,n],l.styled),[[e,`confirm`,r.confirmButtonColor],[t,`deny`,r.denyButtonColor],[n,`cancel`,r.cancelButtonColor]].forEach(([e,t,n])=>{n&&e.style.setProperty(`--swal2-${t}-button-background-color`,n),We(e)})}function We(e){let t=window.getComputedStyle(e);if(t.getPropertyValue(`--swal2-action-button-focus-box-shadow`))return;let n=t.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,`rgba($1, $2, $3, 0.5)`);e.style.setProperty(`--swal2-action-button-focus-box-shadow`,t.getPropertyValue(`--swal2-outline`).replace(/ rgba\(.*/,` ${n}`))}function Ge(e,t,n){xe(e,n[`show${f(t)}Button`],`inline-block`),se(e,n[`${t}ButtonText`]||``),e.setAttribute(`aria-label`,n[`${t}ButtonAriaLabel`]||``),e.className=l[t],le(e,n,`${t}Button`)}let Ke=(e,t)=>{let n=z();n&&(se(n,t.closeButtonHtml||``),le(n,t,`closeButton`),xe(n,t.showCloseButton),n.setAttribute(`aria-label`,t.closeButtonAriaLabel||``))},qe=(e,t)=>{let n=C();n&&(Je(n,t.backdrop),Ye(n,t.position),Xe(n,t.grow),le(n,t,`container`))};function Je(e,t){typeof t==`string`?e.style.background=t:t||pe([document.documentElement,document.body],l[`no-backdrop`])}function Ye(e,t){t&&(t in l?pe(e,l[t]):(p(`The "position" parameter is not valid, defaulting to "center"`),pe(e,l.center)))}function Xe(e,t){t&&pe(e,l[`grow-${t}`])}var Ze={innerParams:new WeakMap,domCache:new WeakMap,focusedElement:new WeakMap};let Qe=[`input`,`file`,`range`,`select`,`radio`,`checkbox`,`textarea`],$e=(e,t)=>{let n=E();if(!n)return;let r=Ze.innerParams.get(e),i=!r||t.input!==r.input;Qe.forEach(e=>{let r=he(n,l[e]);r&&(nt(e,t.inputAttributes),r.className=l[e],i&&ve(r))}),t.input&&(i&&et(t),rt(t))},et=e=>{if(!e.input)return;if(!ct[e.input]){m(`Unexpected type of input! Expected ${Object.keys(ct).join(` | `)}, got "${e.input}"`);return}let t=ot(e.input);if(!t)return;let n=ct[e.input](t,e);_e(t),e.inputAutoFocus&&setTimeout(()=>{de(n)})},tt=e=>{for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t].name;[`id`,`type`,`value`,`style`].includes(n)||e.removeAttribute(n)}},nt=(e,t)=>{let n=E();if(!n)return;let r=ue(n,e);if(r){tt(r);for(let e in t)r.setAttribute(e,t[e])}},rt=e=>{if(!e.input)return;let t=ot(e.input);t&&le(t,e,`input`)},it=(e,t)=>{!e.placeholder&&t.inputPlaceholder&&(e.placeholder=t.inputPlaceholder)},at=(e,t,n)=>{if(n.inputLabel){let r=document.createElement(`label`),i=l[`input-label`];r.setAttribute(`for`,e.id),r.className=i,typeof n.customClass==`object`&&pe(r,n.customClass.inputLabel),r.innerText=n.inputLabel,t.insertAdjacentElement(`beforebegin`,r)}},ot=e=>{let t=E();if(t)return he(t,l[e]||l.input)},st=(e,t)=>{[`string`,`number`].includes(typeof t)?e.value=`${t}`:x(t)||p(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof t}"`)},ct={};ct.text=ct.email=ct.password=ct.number=ct.tel=ct.url=ct.search=ct.date=ct[`datetime-local`]=ct.time=ct.week=ct.month=(e,t)=>{let n=e;return st(n,t.inputValue),at(n,n,t),it(n,t),n.type=t.input,n},ct.file=(e,t)=>{let n=e;return at(n,n,t),it(n,t),n},ct.range=(e,t)=>{let n=e,r=n.querySelector(`input`),i=n.querySelector(`output`);return r&&(st(r,t.inputValue),r.type=t.input,at(r,e,t)),i&&st(i,t.inputValue),e},ct.select=(e,t)=>{let n=e;if(n.textContent=``,t.inputPlaceholder){let e=document.createElement(`option`);se(e,t.inputPlaceholder),e.value=``,e.disabled=!0,e.selected=!0,n.appendChild(e)}return at(n,n,t),n},ct.radio=e=>{let t=e;return t.textContent=``,e},ct.checkbox=(e,t)=>{let n=E();if(!n)throw Error(`Popup not found`);let r=ue(n,`checkbox`);if(!r)throw Error(`Checkbox input not found`);r.value=`1`,r.checked=!!t.inputValue;let i=e.querySelector(`span`);if(i){let e=t.inputPlaceholder||t.inputLabel;e&&se(i,e)}return r},ct.textarea=(e,t)=>{let n=e;st(n,t.inputValue),it(n,t),at(n,n,t);let r=e=>parseInt(window.getComputedStyle(e).marginLeft)+parseInt(window.getComputedStyle(e).marginRight);return setTimeout(()=>{if(`MutationObserver`in window){let e=E();if(!e)return;let i=parseInt(window.getComputedStyle(e).width);new MutationObserver(()=>{if(!document.body.contains(n))return;let e=n.offsetWidth+r(n),a=E();a&&(e>i?a.style.width=`${e}px`:ge(a,`width`,t.width))}).observe(n,{attributes:!0,attributeFilter:[`style`]})}}),n};let lt=(e,t)=>{let n=A();n&&(ye(n),le(n,t,`htmlContainer`),t.html?(Re(t.html,n),_e(n,`block`)):t.text?(n.textContent=t.text,_e(n,`block`)):ve(n),$e(e,t))},ut=(e,t)=>{let n=te();n&&(ye(n),xe(n,!!t.footer,`block`),t.footer&&Re(t.footer,n),le(n,t,`footer`))},dt=(e,t)=>{let n=Ze.innerParams.get(e),r=D();if(r){if(n&&t.icon===n.icon){ht(r,t),ft(r,t);return}if(!t.icon&&!t.iconHtml){ve(r);return}if(t.icon&&Object.keys(u).indexOf(t.icon)===-1){m(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${t.icon}"`),ve(r);return}_e(r),ht(r,t),ft(r,t),pe(r,t.showClass&&t.showClass.icon),window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,pt)}},ft=(e,t)=>{for(let[n,r]of Object.entries(u))t.icon!==n&&me(e,r);pe(e,t.icon&&u[t.icon]),gt(e,t),pt(),le(e,t,`icon`)},pt=()=>{let e=E();if(!e)return;let t=window.getComputedStyle(e).getPropertyValue(`background-color`),n=e.querySelectorAll(`[class^=swal2-success-circular-line], .swal2-success-fix`);for(let e=0;e<n.length;e++)n[e].style.backgroundColor=t},mt=e=>`
105
+ ${e.animation?`<div class="swal2-success-circular-line-left"></div>`:``}
106
+ <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
107
+ <div class="swal2-success-ring"></div>
108
+ ${e.animation?`<div class="swal2-success-fix"></div>`:``}
109
+ ${e.animation?`<div class="swal2-success-circular-line-right"></div>`:``}
110
+ `,ht=(e,t)=>{if(!t.icon&&!t.iconHtml)return;let n=e.innerHTML,r=``;t.iconHtml?r=_t(t.iconHtml):t.icon===`success`?(r=mt(t),n=n.replace(/ style=".*?"/g,``)):t.icon===`error`?r=`
111
+ <span class="swal2-x-mark">
112
+ <span class="swal2-x-mark-line-left"></span>
113
+ <span class="swal2-x-mark-line-right"></span>
114
+ </span>
115
+ `:t.icon&&(r=_t({question:`?`,warning:`!`,info:`i`}[t.icon])),n.trim()!==r.trim()&&se(e,r)},gt=(e,t)=>{if(t.iconColor){e.style.color=t.iconColor,e.style.borderColor=t.iconColor;for(let n of[`.swal2-success-line-tip`,`.swal2-success-line-long`,`.swal2-x-mark-line-left`,`.swal2-x-mark-line-right`])be(e,n,`background-color`,t.iconColor);be(e,`.swal2-success-ring`,`border-color`,t.iconColor)}},_t=e=>`<div class="${l[`icon-content`]}">${e}</div>`,vt=(e,t)=>{let n=j();if(n){if(!t.imageUrl){ve(n);return}_e(n,``),n.setAttribute(`src`,t.imageUrl),n.setAttribute(`alt`,t.imageAlt||``),ge(n,`width`,t.imageWidth),ge(n,`height`,t.imageHeight),n.className=l.image,le(n,t,`image`)}},yt=!1,bt=0,xt=0,St=0,Ct=0,wt=e=>{e.addEventListener(`mousedown`,Et),document.body.addEventListener(`mousemove`,Dt),e.addEventListener(`mouseup`,Ot),e.addEventListener(`touchstart`,Et),document.body.addEventListener(`touchmove`,Dt),e.addEventListener(`touchend`,Ot)},Tt=e=>{e.removeEventListener(`mousedown`,Et),document.body.removeEventListener(`mousemove`,Dt),e.removeEventListener(`mouseup`,Ot),e.removeEventListener(`touchstart`,Et),document.body.removeEventListener(`touchmove`,Dt),e.removeEventListener(`touchend`,Ot)},Et=e=>{let t=E();if(!t)return;let n=D();if(e.target===t||n&&n.contains(e.target)){yt=!0;let n=kt(e);bt=n.clientX,xt=n.clientY,St=parseInt(t.style.insetInlineStart)||0,Ct=parseInt(t.style.insetBlockStart)||0,pe(t,`swal2-dragging`)}},Dt=e=>{let t=E();if(t&&yt){let{clientX:n,clientY:r}=kt(e),i=n-bt;t.style.insetInlineStart=`${St+(a.isRTL?-i:i)}px`,t.style.insetBlockStart=`${Ct+(r-xt)}px`}},Ot=()=>{let e=E();yt=!1,me(e,`swal2-dragging`)},kt=e=>{let t=e.type.startsWith(`touch`)?e.touches[0]:e;return{clientX:t.clientX,clientY:t.clientY}},At=(e,t)=>{let n=C(),r=E();if(!(!n||!r)){if(t.toast){ge(n,`width`,t.width),r.style.width=`100%`;let e=L();e&&r.insertBefore(e,D())}else ge(r,`width`,t.width);ge(r,`padding`,t.padding),t.color&&(r.style.color=t.color),t.background&&(r.style.background=t.background),ve(N()),jt(r,t),t.draggable&&!t.toast?(pe(r,l.draggable),wt(r)):(me(r,l.draggable),Tt(r))}},jt=(e,t)=>{let n=t.showClass||{};e.className=`${l.popup} ${Se(e)?n.popup:``}`,t.toast?(pe([document.documentElement,document.body],l[`toast-shown`]),pe(e,l.toast)):pe(e,l.modal),le(e,t,`popup`),typeof t.customClass==`string`&&pe(e,t.customClass),t.icon&&pe(e,l[`icon-${t.icon}`])},Mt=(e,t)=>{let n=M();if(!n)return;let{progressSteps:r,currentProgressStep:i}=t;if(!r||r.length===0||i===void 0){ve(n);return}_e(n),n.textContent=``,i>=r.length&&p(`Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)`),r.forEach((e,a)=>{let o=Nt(e);if(n.appendChild(o),a===i&&pe(o,l[`active-progress-step`]),a!==r.length-1){let e=Pt(t);n.appendChild(e)}})},Nt=e=>{let t=document.createElement(`li`);return pe(t,l[`progress-step`]),se(t,e),t},Pt=e=>{let t=document.createElement(`li`);return pe(t,l[`progress-step-line`]),e.progressStepsDistance&&ge(t,`width`,e.progressStepsDistance),t},Ft=(e,t)=>{let n=k();n&&(ye(n),xe(n,!!(t.title||t.titleText),`block`),t.title&&Re(t.title,n),t.titleText&&(n.innerText=t.titleText),le(n,t,`title`))},It=(e,t)=>{var n;At(e,t),qe(e,t),Mt(e,t),dt(e,t),vt(e,t),Ft(e,t),Ke(e,t),lt(e,t),Ve(e,t),ut(e,t);let r=E();typeof t.didRender==`function`&&r&&t.didRender(r),(n=a.eventEmitter)==null||n.emit(`didRender`,r)},Lt=()=>Se(E()),Rt=()=>P()?.click(),zt=()=>ee()?.click(),V=()=>F()?.click(),Bt=Object.freeze({cancel:`cancel`,backdrop:`backdrop`,close:`close`,esc:`esc`,timer:`timer`}),Vt=e=>{if(e.keydownTarget&&e.keydownHandlerAdded&&e.keydownHandler){let t=e.keydownHandler;e.keydownTarget.removeEventListener(`keydown`,t,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1}},Ht=(e,t,n)=>{if(Vt(e),!t.toast){let r=e=>Kt(t,e,n);e.keydownHandler=r;let i=t.keydownListenerCapture?window:E();if(i){e.keydownTarget=i,e.keydownListenerCapture=t.keydownListenerCapture;let n=r;e.keydownTarget.addEventListener(`keydown`,n,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0}}},Ut=(e,t)=>{var n;let r=re();return r.length?(e+=t,e===-2&&(e=r.length-1),e===r.length?e=0:e===-1&&(e=r.length-1),r[e].focus(),!(S()&&r[e]instanceof HTMLIFrameElement)):((n=E())==null||n.focus(),!0)},Wt=[`ArrowRight`,`ArrowDown`],Gt=[`ArrowLeft`,`ArrowUp`],Kt=(e,t,n)=>{e&&(t.isComposing||t.keyCode===229||(e.stopKeydownPropagation&&t.stopPropagation(),t.key===`Enter`?qt(t,e):t.key===`Tab`?Jt(t):[...Wt,...Gt].includes(t.key)?Yt(t.key):t.key===`Escape`&&Xt(t,e,n)))},qt=(e,t)=>{if(!v(t.allowEnterKey))return;let n=E();if(!n||!t.input)return;let r=ue(n,t.input);if(e.target&&r&&e.target instanceof HTMLElement&&e.target.outerHTML===r.outerHTML){if([`textarea`,`file`].includes(t.input))return;Rt(),e.preventDefault()}},Jt=e=>{let t=e.target,n=re(),r=-1;for(let e=0;e<n.length;e++)if(t===n[e]){r=e;break}let i=!0;i=e.shiftKey?Ut(r,-1):Ut(r,1),e.stopPropagation(),i&&e.preventDefault()},Yt=e=>{let t=R(),n=P(),r=ee(),i=F();if(!t||!n||!r||!i)return;let a=[n,r,i];if(document.activeElement instanceof HTMLElement&&!a.includes(document.activeElement))return;let o=Wt.includes(e)?`nextElementSibling`:`previousElementSibling`,s=document.activeElement;if(s){for(let e=0;e<t.children.length;e++){if(s=s[o],!s)return;if(s instanceof HTMLButtonElement&&Se(s))break}s instanceof HTMLButtonElement&&s.focus()}},Xt=(e,t,n)=>{e.preventDefault(),v(t.allowEscapeKey)&&n(Bt.esc)};var Zt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};let Qt=()=>{let e=C();Array.from(document.body.children).forEach(t=>{t.contains(e)||(t.hasAttribute(`aria-hidden`)&&t.setAttribute(`data-previous-aria-hidden`,t.getAttribute(`aria-hidden`)||``),t.setAttribute(`aria-hidden`,`true`))})},$t=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute(`data-previous-aria-hidden`)?(e.setAttribute(`aria-hidden`,e.getAttribute(`data-previous-aria-hidden`)||``),e.removeAttribute(`data-previous-aria-hidden`)):e.removeAttribute(`aria-hidden`)})},en=typeof window<`u`&&!!window.GestureEvent,tn=en&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,nn=()=>{if(en&&!B(document.body,l.iosfix)){let e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,pe(document.body,l.iosfix),rn()}},rn=()=>{let e=C();if(!e)return;let t;e.ontouchstart=e=>{t=an(e)},e.ontouchmove=e=>{t&&(e.preventDefault(),e.stopPropagation())}},an=e=>{let t=e.target,n=C(),r=A();return!n||!r||on(e)||sn(e)?!1:t===n||!we(n)&&t instanceof HTMLElement&&!Te(t,r)&&t.tagName!==`INPUT`&&t.tagName!==`TEXTAREA`&&!(we(r)&&r.contains(t))},on=e=>!!(e.touches&&e.touches.length&&e.touches[0].touchType===`stylus`),sn=e=>e.touches&&e.touches.length>1,cn=()=>{if(B(document.body,l.iosfix)){let e=parseInt(document.body.style.top,10);me(document.body,l.iosfix),document.body.style.top=``,document.body.scrollTop=e*-1}},ln=()=>{let e=document.createElement(`div`);e.className=l[`scrollbar-measure`],document.body.appendChild(e);let t=e.getBoundingClientRect().width-e.clientWidth;return document.body.removeChild(e),t},un=null,dn=e=>{un===null&&(document.body.scrollHeight>window.innerHeight||e===`scroll`)&&(un=parseInt(window.getComputedStyle(document.body).getPropertyValue(`padding-right`)),document.body.style.paddingRight=`${un+ln()}px`)},fn=()=>{un!==null&&(document.body.style.paddingRight=`${un}px`,un=null)};function pn(e,t,n,r){ae()?Sn(e,r):(s(n).then(()=>Sn(e,r)),Vt(a)),en?(t.setAttribute(`style`,`display:none !important`),t.removeAttribute(`class`),t.innerHTML=``):t.remove(),ie()&&(fn(),cn(),$t()),mn()}function mn(){me([document.documentElement,document.body],[l.shown,l[`height-auto`],l[`no-backdrop`],l[`toast-shown`]])}function hn(e){e=yn(e);let t=Zt.swalPromiseResolve.get(this),n=gn(this);this.isAwaitingPromise?e.isDismissed||(vn(this),t(e)):n&&t(e)}let gn=e=>{let t=E();if(!t)return!1;let n=Ze.innerParams.get(e);if(!n||B(t,n.hideClass.popup))return!1;me(t,n.showClass.popup),pe(t,n.hideClass.popup);let r=C();return me(r,n.showClass.backdrop),pe(r,n.hideClass.backdrop),bn(e,t,n),!0};function _n(e){let t=Zt.swalPromiseReject.get(this);vn(this),t&&t(e)}let vn=e=>{e.isAwaitingPromise&&(delete e.isAwaitingPromise,Ze.innerParams.get(e)||e._destroy())},yn=e=>e===void 0?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),bn=(e,t,n)=>{var r;let i=C(),o=Ee(t);typeof n.willClose==`function`&&n.willClose(t),(r=a.eventEmitter)==null||r.emit(`willClose`,t),o&&i?xn(e,t,i,!!n.returnFocus,n.didClose):i&&pn(e,i,!!n.returnFocus,n.didClose)},xn=(e,t,n,r,i)=>{a.swalCloseEventFinishedCallback=pn.bind(null,e,n,r,i);let o=function(e){if(e.target===t){var n;(n=a.swalCloseEventFinishedCallback)==null||n.call(a),delete a.swalCloseEventFinishedCallback,t.removeEventListener(`animationend`,o),t.removeEventListener(`transitionend`,o)}};t.addEventListener(`animationend`,o),t.addEventListener(`transitionend`,o)},Sn=(e,t)=>{setTimeout(()=>{var n;typeof t==`function`&&t.bind(e.params)(),(n=a.eventEmitter)==null||n.emit(`didClose`),e._destroy&&e._destroy()})},Cn=e=>{let t=E();if(t||new xi,t=E(),!t)return;let n=L();ae()?ve(D()):wn(t,e),_e(n),t.setAttribute(`data-loading`,`true`),t.setAttribute(`aria-busy`,`true`),t.focus()},wn=(e,t)=>{let n=R(),r=L();!n||!r||(!t&&Se(P())&&(t=P()),_e(n),t&&(ve(t),r.setAttribute(`data-button-to-replace`,t.className),n.insertBefore(r,t)),pe([e,n],l.loading))},Tn=(e,t)=>{t.input===`select`||t.input===`radio`?An(e,t):[`text`,`email`,`number`,`tel`,`textarea`].some(e=>e===t.input)&&(y(t.inputValue)||x(t.inputValue))&&(Cn(P()),jn(e,t))},En=(e,t)=>{let n=e.getInput();if(!n)return null;switch(t.input){case`checkbox`:return Dn(n);case`radio`:return On(n);case`file`:return kn(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Dn=e=>e.checked?1:0,On=e=>e.checked?e.value:null,kn=e=>e.files&&e.files.length?e.getAttribute(`multiple`)===null?e.files[0]:e.files:null,An=(e,t)=>{let n=E();if(!n)return;let r=e=>{t.input===`select`?Mn(n,Pn(e),t):t.input===`radio`&&Nn(n,Pn(e),t)};y(t.inputOptions)||x(t.inputOptions)?(Cn(P()),b(t.inputOptions).then(t=>{e.hideLoading(),r(t)})):typeof t.inputOptions==`object`?r(t.inputOptions):m(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof t.inputOptions}`)},jn=(e,t)=>{let n=e.getInput();n&&(ve(n),b(t.inputValue).then(r=>{n.value=t.input===`number`?`${parseFloat(r)||0}`:`${r}`,_e(n),n.focus(),e.hideLoading()}).catch(t=>{m(`Error in inputValue promise: ${t}`),n.value=``,_e(n),n.focus(),e.hideLoading()}))};function Mn(e,t,n){let r=he(e,l.select);if(!r)return;let i=(e,t,r)=>{let i=document.createElement(`option`);i.value=r,se(i,t),i.selected=Fn(r,n.inputValue),e.appendChild(i)};t.forEach(e=>{let t=e[0],n=e[1];if(Array.isArray(n)){let e=document.createElement(`optgroup`);e.label=t,e.disabled=!1,r.appendChild(e),n.forEach(t=>i(e,t[1],t[0]))}else i(r,n,t)}),r.focus()}function Nn(e,t,n){let r=he(e,l.radio);if(!r)return;t.forEach(e=>{let t=e[0],i=e[1],a=document.createElement(`input`),o=document.createElement(`label`);a.type=`radio`,a.name=l.radio,a.value=t,Fn(t,n.inputValue)&&(a.checked=!0);let s=document.createElement(`span`);se(s,i),s.className=l.label,o.appendChild(a),o.appendChild(s),r.appendChild(o)});let i=r.querySelectorAll(`input`);i.length&&i[0].focus()}let Pn=e=>(e instanceof Map?Array.from(e):Object.entries(e)).map(([e,t])=>[e,typeof t==`object`?Pn(t):t]),Fn=(e,t)=>!!t&&t!=null&&t.toString()===e.toString(),In=e=>{let t=Ze.innerParams.get(e);e.disableButtons(),t.input?zn(e,`confirm`):Wn(e,!0)},Ln=e=>{let t=Ze.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?zn(e,`deny`):Vn(e,!1)},Rn=(e,t)=>{e.disableButtons(),t(Bt.cancel)},zn=(e,t)=>{let n=Ze.innerParams.get(e);if(!n.input){m(`The "input" parameter is needed to be set when using returnInputValueOn${f(t)}`);return}let r=e.getInput(),i=En(e,n);n.inputValidator?Bn(e,i,t):r&&!r.checkValidity()?(e.enableButtons(),e.showValidationMessage(n.validationMessage||r.validationMessage)):t===`deny`?Vn(e,i):Wn(e,i)},Bn=(e,t,n)=>{let r=Ze.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>b(r.inputValidator(t,r.validationMessage))).then(r=>{e.enableButtons(),e.enableInput(),r?e.showValidationMessage(r):n===`deny`?Vn(e,t):Wn(e,t)})},Vn=(e,t)=>{let n=Ze.innerParams.get(e);n.showLoaderOnDeny&&Cn(ee()),n.preDeny?(e.isAwaitingPromise=!0,Promise.resolve().then(()=>b(n.preDeny(t,n.validationMessage))).then(n=>{n===!1?(e.hideLoading(),vn(e)):e.close({isDenied:!0,value:n===void 0?t:n})}).catch(t=>Un(e,t))):e.close({isDenied:!0,value:t})},Hn=(e,t)=>{e.close({isConfirmed:!0,value:t})},Un=(e,t)=>{e.rejectPromise(t)},Wn=(e,t)=>{let n=Ze.innerParams.get(e);n.showLoaderOnConfirm&&Cn(),n.preConfirm?(e.resetValidationMessage(),e.isAwaitingPromise=!0,Promise.resolve().then(()=>b(n.preConfirm(t,n.validationMessage))).then(n=>{Se(N())||n===!1?(e.hideLoading(),vn(e)):Hn(e,n===void 0?t:n)}).catch(t=>Un(e,t))):Hn(e,t)};function Gn(){let e=Ze.innerParams.get(this);if(!e)return;let t=Ze.domCache.get(this);ve(t.loader),ae()?e.icon&&_e(D()):Kn(t),me([t.popup,t.actions],l.loading),t.popup.removeAttribute(`aria-busy`),t.popup.removeAttribute(`data-loading`),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1;let n=Ze.focusedElement.get(this);n instanceof HTMLElement&&document.activeElement===document.body&&n.focus(),Ze.focusedElement.delete(this)}let Kn=e=>{let t=e.loader.getAttribute(`data-button-to-replace`),n=t?e.popup.getElementsByClassName(t):[];n.length?_e(n[0],`inline-block`):Ce()&&ve(e.actions)};function qn(){let e=Ze.innerParams.get(this),t=Ze.domCache.get(this);return t?ue(t.popup,e.input):null}function Jn(e,t,n){let r=Ze.domCache.get(e);t.forEach(e=>{r[e].disabled=n})}function Yn(e,t){let n=E();if(!(!n||!e))if(e.type===`radio`){let e=n.querySelectorAll(`[name="${l.radio}"]`);for(let n=0;n<e.length;n++)e[n].disabled=t}else e.disabled=t}function Xn(){Jn(this,[`confirmButton`,`denyButton`,`cancelButton`],!1);let e=Ze.focusedElement.get(this);e instanceof HTMLElement&&document.activeElement===document.body&&e.focus(),Ze.focusedElement.delete(this)}function Zn(){Ze.focusedElement.set(this,document.activeElement),Jn(this,[`confirmButton`,`denyButton`,`cancelButton`],!0)}function Qn(){Yn(this.getInput(),!1)}function $n(){Yn(this.getInput(),!0)}function er(e){let t=Ze.domCache.get(this),n=Ze.innerParams.get(this);se(t.validationMessage,e),t.validationMessage.className=l[`validation-message`],n.customClass&&n.customClass.validationMessage&&pe(t.validationMessage,n.customClass.validationMessage),_e(t.validationMessage);let r=this.getInput();r&&(r.setAttribute(`aria-invalid`,`true`),r.setAttribute(`aria-describedby`,l[`validation-message`]),de(r),pe(r,l.inputerror))}function tr(){let e=Ze.domCache.get(this);e.validationMessage&&ve(e.validationMessage);let t=this.getInput();t&&(t.removeAttribute(`aria-invalid`),t.removeAttribute(`aria-describedby`),me(t,l.inputerror))}let nr={title:``,titleText:``,text:``,html:``,footer:``,icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:`light`,showClass:{popup:`swal2-show`,backdrop:`swal2-backdrop-show`,icon:`swal2-icon-show`},hideClass:{popup:`swal2-hide`,backdrop:`swal2-backdrop-hide`,icon:`swal2-icon-hide`},customClass:{},target:`body`,color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:`OK`,confirmButtonAriaLabel:``,confirmButtonColor:void 0,denyButtonText:`No`,denyButtonAriaLabel:``,denyButtonColor:void 0,cancelButtonText:`Cancel`,cancelButtonAriaLabel:``,cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:`&times;`,closeButtonAriaLabel:`Close this dialog`,loaderHtml:``,showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:``,timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:``,inputLabel:``,inputValue:``,inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:`center`,progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0,topLayer:!1},rr=`allowEscapeKey.allowOutsideClick.background.buttonsStyling.cancelButtonAriaLabel.cancelButtonColor.cancelButtonText.closeButtonAriaLabel.closeButtonHtml.color.confirmButtonAriaLabel.confirmButtonColor.confirmButtonText.currentProgressStep.customClass.denyButtonAriaLabel.denyButtonColor.denyButtonText.didClose.didDestroy.draggable.footer.hideClass.html.icon.iconColor.iconHtml.imageAlt.imageHeight.imageUrl.imageWidth.preConfirm.preDeny.progressSteps.returnFocus.reverseButtons.showCancelButton.showCloseButton.showConfirmButton.showDenyButton.text.title.titleText.theme.willClose`.split(`.`),ir={allowEnterKey:void 0},ar=[`allowOutsideClick`,`allowEnterKey`,`backdrop`,`draggable`,`focusConfirm`,`focusDeny`,`focusCancel`,`returnFocus`,`heightAuto`,`keydownListenerCapture`],or=e=>Object.prototype.hasOwnProperty.call(nr,e),sr=e=>rr.indexOf(e)!==-1,cr=e=>ir[e],lr=e=>{or(e)||p(`Unknown parameter "${e}"`)},ur=e=>{ar.includes(e)&&p(`The parameter "${e}" is incompatible with toasts`)},dr=e=>{let t=cr(e);t&&_(e,t)},fr=e=>{e.backdrop===!1&&e.allowOutsideClick&&p('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),e.theme&&![`light`,`dark`,`auto`,`minimal`,`borderless`,`bootstrap-4`,`bootstrap-4-light`,`bootstrap-4-dark`,`bootstrap-5`,`bootstrap-5-light`,`bootstrap-5-dark`,`material-ui`,`material-ui-light`,`material-ui-dark`,`embed-iframe`,`bulma`,`bulma-light`,`bulma-dark`].includes(e.theme)&&p(`Invalid theme "${e.theme}"`);for(let t in e)lr(t),e.toast&&ur(t),dr(t)};function pr(e){let t=C(),n=E(),r=Ze.innerParams.get(this);if(!n||B(n,r.hideClass.popup)){p(`You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.`);return}let i=mr(e),a=Object.assign({},r,i);fr(a),t&&(t.dataset.swal2Theme=a.theme),It(this,a),Ze.innerParams.set(this,a),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}let mr=e=>{let t={};return Object.keys(e).forEach(n=>{sr(n)?t[n]=e[n]:p(`Invalid parameter to update: ${n}`)}),t};function hr(){var e;let t=Ze.domCache.get(this),n=Ze.innerParams.get(this);if(!n){_r(this);return}t.popup&&a.swalCloseEventFinishedCallback&&(a.swalCloseEventFinishedCallback(),delete a.swalCloseEventFinishedCallback),typeof n.didDestroy==`function`&&n.didDestroy(),(e=a.eventEmitter)==null||e.emit(`didDestroy`),gr(this)}let gr=e=>{_r(e),delete e.params,delete a.keydownHandler,delete a.keydownTarget,delete a.currentInstance},_r=e=>{e.isAwaitingPromise?(vr(Ze,e),e.isAwaitingPromise=!0):(vr(Zt,e),vr(Ze,e),delete e.isAwaitingPromise,delete e.disableButtons,delete e.enableButtons,delete e.getInput,delete e.disableInput,delete e.enableInput,delete e.hideLoading,delete e.disableLoading,delete e.showValidationMessage,delete e.resetValidationMessage,delete e.close,delete e.closePopup,delete e.closeModal,delete e.closeToast,delete e.rejectPromise,delete e.update,delete e._destroy)},vr=(e,t)=>{for(let n in e)e[n].delete(t)};var yr=Object.freeze({__proto__:null,_destroy:hr,close:hn,closeModal:hn,closePopup:hn,closeToast:hn,disableButtons:Zn,disableInput:$n,disableLoading:Gn,enableButtons:Xn,enableInput:Qn,getInput:qn,handleAwaitingPromise:vn,hideLoading:Gn,rejectPromise:_n,resetValidationMessage:tr,showValidationMessage:er,update:pr});let br=(e,t,n)=>{e.toast?xr(e,t,n):(wr(t),Tr(t),Er(e,t,n))},xr=(e,t,n)=>{t.popup.onclick=()=>{e&&(Sr(e)||e.timer||e.input)||n(Bt.close)}},Sr=e=>!!(e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton),Cr=!1,wr=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=()=>{},t.target===e.container&&(Cr=!0)}}},Tr=e=>{e.container.onmousedown=t=>{t.target===e.container&&t.preventDefault(),e.popup.onmouseup=function(t){e.popup.onmouseup=()=>{},(t.target===e.popup||t.target instanceof HTMLElement&&e.popup.contains(t.target))&&(Cr=!0)}}},Er=(e,t,n)=>{t.container.onclick=r=>{if(Cr){Cr=!1;return}r.target===t.container&&v(e.allowOutsideClick)&&n(Bt.backdrop)}},Dr=e=>typeof e==`object`&&!!e&&`jquery`in e,Or=e=>e instanceof Element||Dr(e),kr=e=>{let t={};return typeof e[0]==`object`&&!Or(e[0])?Object.assign(t,e[0]):[`title`,`html`,`icon`].forEach((n,r)=>{let i=e[r];typeof i==`string`||Or(i)?t[n]=i:i!==void 0&&m(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof i}`)}),t};function Ar(...e){return new this(...e)}function jr(e){class t extends this{_main(t,n){return super._main(t,Object.assign({},e,n))}}return t}let Mr=()=>a.timeout&&a.timeout.getTimerLeft(),Nr=()=>{if(a.timeout)return Oe(),a.timeout.stop()},Pr=()=>{if(a.timeout){let e=a.timeout.start();return De(e),e}},Fr=()=>{let e=a.timeout;return e&&(e.running?Nr():Pr())},Ir=e=>{if(a.timeout){let t=a.timeout.increase(e);return De(t,!0),t}},Lr=()=>!!(a.timeout&&a.timeout.isRunning()),Rr=!1,zr={};function Br(e=`data-swal-template`){zr[e]=this,Rr||=(document.body.addEventListener(`click`,Vr),!0)}let Vr=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(let e in zr){let n=t.getAttribute&&t.getAttribute(e);if(n){zr[e].fire({template:n});return}}};class Hr{constructor(){this.events={}}_getHandlersByEventName(e){return this.events[e]===void 0&&(this.events[e]=[]),this.events[e]}on(e,t){let n=this._getHandlersByEventName(e);n.includes(t)||n.push(t)}once(e,t){let n=(...r)=>{this.removeListener(e,n),t.apply(this,r)};this.on(e,n)}emit(e,...t){this._getHandlersByEventName(e).forEach(e=>{try{e.apply(this,t)}catch(e){console.error(e)}})}removeListener(e,t){let n=this._getHandlersByEventName(e),r=n.indexOf(t);r>-1&&n.splice(r,1)}removeAllListeners(e){this.events[e]!==void 0&&(this.events[e].length=0)}reset(){this.events={}}}a.eventEmitter=new Hr;var Ur=Object.freeze({__proto__:null,argsToParams:kr,bindClickHandler:Br,clickCancel:V,clickConfirm:Rt,clickDeny:zt,enableLoading:Cn,fire:Ar,getActions:R,getCancelButton:F,getCloseButton:z,getConfirmButton:P,getContainer:C,getDenyButton:ee,getFocusableElements:re,getFooter:te,getHtmlContainer:A,getIcon:D,getIconContent:O,getImage:j,getInputLabel:I,getLoader:L,getPopup:E,getProgressSteps:M,getTimerLeft:Mr,getTimerProgressBar:ne,getTitle:k,getValidationMessage:N,increaseTimer:Ir,isDeprecatedParameter:cr,isLoading:oe,isTimerRunning:Lr,isUpdatableParameter:sr,isValidParameter:or,isVisible:Lt,mixin:jr,off:(e,t)=>{if(a.eventEmitter){if(!e){a.eventEmitter.reset();return}t?a.eventEmitter.removeListener(e,t):a.eventEmitter.removeAllListeners(e)}},on:(e,t)=>{a.eventEmitter&&a.eventEmitter.on(e,t)},once:(e,t)=>{a.eventEmitter&&a.eventEmitter.once(e,t)},resumeTimer:Pr,showLoading:Cn,stopTimer:Nr,toggleTimer:Fr});class Wr{constructor(e,t){this.callback=e,this.remaining=t,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(e){let t=this.running;return t&&this.stop(),this.remaining+=e,t&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}let Gr=[`swal-title`,`swal-html`,`swal-footer`],Kr=e=>{let t=typeof e.template==`string`?document.querySelector(e.template):e.template;if(!t)return{};let n=t.content;return ei(n),Object.assign(qr(n),Jr(n),Yr(n),Xr(n),Zr(n),Qr(n),$r(n,Gr))},qr=e=>{let t={};return Array.from(e.querySelectorAll(`swal-param`)).forEach(e=>{ti(e,[`name`,`value`]);let n=e.getAttribute(`name`),r=e.getAttribute(`value`);!n||!r||(n in nr&&typeof nr[n]==`boolean`?t[n]=r!==`false`:n in nr&&typeof nr[n]==`object`?t[n]=JSON.parse(r):t[n]=r)}),t},Jr=e=>{let t={};return Array.from(e.querySelectorAll(`swal-function-param`)).forEach(e=>{let n=e.getAttribute(`name`),r=e.getAttribute(`value`);!n||!r||(t[n]=Function(`return ${r}`)())}),t},Yr=e=>{let t={};return Array.from(e.querySelectorAll(`swal-button`)).forEach(e=>{ti(e,[`type`,`color`,`aria-label`]);let n=e.getAttribute(`type`);if(!n||![`confirm`,`cancel`,`deny`].includes(n))return;t[`${n}ButtonText`]=e.innerHTML,t[`show${f(n)}Button`]=!0;let r=e.getAttribute(`color`);r!==null&&(t[`${n}ButtonColor`]=r);let i=e.getAttribute(`aria-label`);i!==null&&(t[`${n}ButtonAriaLabel`]=i)}),t},Xr=e=>{let t={},n=e.querySelector(`swal-image`);if(n){ti(n,[`src`,`width`,`height`,`alt`]);let e=n.getAttribute(`src`);e!==null&&(t.imageUrl=e||void 0);let r=n.getAttribute(`width`);r!==null&&(t.imageWidth=r||void 0);let i=n.getAttribute(`height`);i!==null&&(t.imageHeight=i||void 0);let a=n.getAttribute(`alt`);a!==null&&(t.imageAlt=a||void 0)}return t},Zr=e=>{let t={},n=e.querySelector(`swal-icon`);return n&&(ti(n,[`type`,`color`]),n.hasAttribute(`type`)&&(t.icon=n.getAttribute(`type`)),n.hasAttribute(`color`)&&(t.iconColor=n.getAttribute(`color`)),t.iconHtml=n.innerHTML),t},Qr=e=>{let t={},n=e.querySelector(`swal-input`);n&&(ti(n,[`type`,`label`,`placeholder`,`value`]),t.input=n.getAttribute(`type`)||`text`,n.hasAttribute(`label`)&&(t.inputLabel=n.getAttribute(`label`)),n.hasAttribute(`placeholder`)&&(t.inputPlaceholder=n.getAttribute(`placeholder`)),n.hasAttribute(`value`)&&(t.inputValue=n.getAttribute(`value`)));let r=Array.from(e.querySelectorAll(`swal-input-option`));return r.length&&(t.inputOptions={},r.forEach(e=>{ti(e,[`value`]);let n=e.getAttribute(`value`);if(!n)return;let r=e.innerHTML;t.inputOptions[n]=r})),t},$r=(e,t)=>{let n={};for(let r in t){let i=t[r],a=e.querySelector(i);a&&(ti(a,[]),n[i.replace(/^swal-/,``)]=a.innerHTML.trim())}return n},ei=e=>{let t=Gr.concat([`swal-param`,`swal-function-param`,`swal-button`,`swal-image`,`swal-icon`,`swal-input`,`swal-input-option`]);Array.from(e.children).forEach(e=>{let n=e.tagName.toLowerCase();t.includes(n)||p(`Unrecognized element <${n}>`)})},ti=(e,t)=>{Array.from(e.attributes).forEach(n=>{t.indexOf(n.name)===-1&&p([`Unrecognized attribute "${n.name}" on <${e.tagName.toLowerCase()}>.`,`${t.length?`Allowed attributes are: ${t.join(`, `)}`:`To set the value, use HTML within the element.`}`])})},ni=e=>{var t,n;let r=C(),i=E();if(!r||!i)return;typeof e.willOpen==`function`&&e.willOpen(i),(t=a.eventEmitter)==null||t.emit(`willOpen`,i);let o=window.getComputedStyle(document.body).overflowY;if(oi(r,i,e),setTimeout(()=>{ii(r,i)},10),ie()&&(ai(r,e.scrollbarPadding===void 0?!1:e.scrollbarPadding,o),Qt()),tn&&e.backdrop===!1&&i.scrollHeight>r.clientHeight&&(r.style.pointerEvents=`auto`),!ae()&&!a.previousActiveElement&&(a.previousActiveElement=document.activeElement),typeof e.didOpen==`function`){let t=e.didOpen;setTimeout(()=>t(i))}(n=a.eventEmitter)==null||n.emit(`didOpen`,i)},ri=e=>{let t=E();if(!t||e.target!==t)return;let n=C();n&&(t.removeEventListener(`animationend`,ri),t.removeEventListener(`transitionend`,ri),n.style.overflowY=`auto`,me(n,l[`no-transition`]))},ii=(e,t)=>{Ee(t)?(e.style.overflowY=`hidden`,t.addEventListener(`animationend`,ri),t.addEventListener(`transitionend`,ri)):e.style.overflowY=`auto`},ai=(e,t,n)=>{nn(),t&&n!==`hidden`&&dn(n),setTimeout(()=>{e.scrollTop=0})},oi=(e,t,n)=>{var r;(r=n.showClass)!=null&&r.backdrop&&pe(e,n.showClass.backdrop),n.animation?(t.style.setProperty(`opacity`,`0`,`important`),_e(t,`grid`),setTimeout(()=>{var e;(e=n.showClass)!=null&&e.popup&&pe(t,n.showClass.popup),t.style.removeProperty(`opacity`)},10)):_e(t,`grid`),pe([document.documentElement,document.body],l.shown),n.heightAuto&&n.backdrop&&!n.toast&&pe([document.documentElement,document.body],l[`height-auto`])};var si={email:(e,t)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(e)?Promise.resolve():Promise.resolve(t||`Invalid email address`),url:(e,t)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(e)?Promise.resolve():Promise.resolve(t||`Invalid URL`)};function ci(e){e.inputValidator||(e.input===`email`&&(e.inputValidator=si.email),e.input===`url`&&(e.inputValidator=si.url))}function li(e){(!e.target||typeof e.target==`string`&&!document.querySelector(e.target)||typeof e.target!=`string`&&!e.target.appendChild)&&(p(`Target parameter is not valid, defaulting to "body"`),e.target=`body`)}function ui(e){ci(e),e.showLoaderOnConfirm&&!e.preConfirm&&p(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
116
+ showLoaderOnConfirm should be used together with preConfirm, see usage example:
117
+ https://sweetalert2.github.io/#ajax-request`),li(e),typeof e.title==`string`&&(e.title=e.title.split(`
118
+ `).join(`<br />`)),Le(e)}let di;var fi=new WeakMap;class pi{constructor(...e){r(this,fi,Promise.resolve({isConfirmed:!1,isDenied:!1,isDismissed:!0})),!(typeof window>`u`)&&(di=this,this.params=Object.freeze(this.constructor.argsToParams(e)),this.isAwaitingPromise=!1,i(fi,this,this._main(di.params)))}_main(e,t={}){if(fr(Object.assign({},t,e)),a.currentInstance){let e=Zt.swalPromiseResolve.get(a.currentInstance),{isAwaitingPromise:t}=a.currentInstance;a.currentInstance._destroy(),t||e({isDismissed:!0}),ie()&&$t()}a.currentInstance=di;let n=hi(e,t);ui(n),Object.freeze(n),a.timeout&&(a.timeout.stop(),delete a.timeout),clearTimeout(a.restoreFocusTimeout);let r=gi(di);return It(di,n),Ze.innerParams.set(di,n),mi(di,r,n)}then(e){return n(fi,this).then(e)}finally(e){return n(fi,this).finally(e)}}let mi=(e,t,n)=>new Promise((r,i)=>{let o=t=>{e.close({isDismissed:!0,dismiss:t,isConfirmed:!1,isDenied:!1})};Zt.swalPromiseResolve.set(e,r),Zt.swalPromiseReject.set(e,i),t.confirmButton.onclick=()=>{In(e)},t.denyButton.onclick=()=>{Ln(e)},t.cancelButton.onclick=()=>{Rn(e,o)},t.closeButton.onclick=()=>{o(Bt.close)},br(n,t,o),Ht(a,n,o),Tn(e,n),ni(n),_i(a,n,o),vi(t,n),setTimeout(()=>{t.container.scrollTop=0})}),hi=(e,t)=>{let n=Kr(e),r=Object.assign({},nr,t,n,e);return r.showClass=Object.assign({},nr.showClass,r.showClass),r.hideClass=Object.assign({},nr.hideClass,r.hideClass),r.animation===!1&&(r.showClass={backdrop:`swal2-noanimation`},r.hideClass={}),r},gi=e=>{let t={popup:E(),container:C(),actions:R(),confirmButton:P(),denyButton:ee(),cancelButton:F(),loader:L(),closeButton:z(),validationMessage:N(),progressSteps:M()};return Ze.domCache.set(e,t),t},_i=(e,t,n)=>{let r=ne();ve(r),t.timer&&(e.timeout=new Wr(()=>{n(`timer`),delete e.timeout},t.timer),t.timerProgressBar&&r&&(_e(r),le(r,t,`timerProgressBar`),setTimeout(()=>{e.timeout&&e.timeout.running&&De(t.timer)})))},vi=(e,t)=>{if(!t.toast){if(!v(t.allowEnterKey)){_(`allowEnterKey`,`preConfirm: () => false`),e.popup.focus();return}yi(e)||bi(e,t)||Ut(-1,1)}},yi=e=>{let t=Array.from(e.popup.querySelectorAll(`[autofocus]`));for(let e of t)if(e instanceof HTMLElement&&Se(e))return e.focus(),!0;return!1},bi=(e,t)=>t.focusDeny&&Se(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&Se(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&Se(e.confirmButton)?(e.confirmButton.focus(),!0):!1;pi.prototype.disableButtons=Zn,pi.prototype.enableButtons=Xn,pi.prototype.getInput=qn,pi.prototype.disableInput=$n,pi.prototype.enableInput=Qn,pi.prototype.hideLoading=Gn,pi.prototype.disableLoading=Gn,pi.prototype.showValidationMessage=er,pi.prototype.resetValidationMessage=tr,pi.prototype.close=hn,pi.prototype.closePopup=hn,pi.prototype.closeModal=hn,pi.prototype.closeToast=hn,pi.prototype.rejectPromise=_n,pi.prototype.update=pr,pi.prototype._destroy=hr,Object.assign(pi,Ur),Object.keys(yr).forEach(e=>{pi[e]=function(...t){if(di&&di[e])return di[e](...t)}}),pi.DismissReason=Bt,pi.version=`11.26.24`;let xi=pi;return xi.default=xi,xi})),e!==void 0&&e.Sweetalert2&&(e.swal=e.sweetAlert=e.Swal=e.SweetAlert=e.Sweetalert2),typeof document<`u`&&function(e,t){var n=e.createElement(`style`);if(e.getElementsByTagName(`head`)[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch{n.innerText=t}}(document,`:root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:auto}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:auto}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}`)}))(),1),eg=$h.default.mixin({customClass:{confirmButton:`bg-primary text-primary-foreground hover:bg-primary/90 px-4 py-2 rounded-md font-medium transition-colors outline-none`,cancelButton:`bg-destructive text-destructive-foreground hover:bg-destructive/90 px-4 py-2 rounded-md font-medium transition-colors outline-none`,popup:`rounded-lg border border-border bg-card text-card-foreground shadow-lg overflow-hidden`,title:`text-foreground font-bold text-xl`,htmlContainer:`text-muted-foreground text-base`},buttonsStyling:!1,background:`hsl(var(--card))`,color:`hsl(var(--foreground))`}),tg=$h.default.mixin({toast:!0,position:`top-end`,showConfirmButton:!1,timer:3e3,timerProgressBar:!0,background:`hsl(var(--card))`,color:`hsl(var(--foreground))`,didOpen:e=>{e.onmouseenter=$h.default.stopTimer,e.onmouseleave=$h.default.resumeTimer}}),ng=_h(),rg=e=>new Promise(t=>setTimeout(t,e));async function K(e,t={}){let{method:n=`GET`,body:r,headers:i={},requireAuth:a=!0,showLoader:o=!1,showError:s=!0,showSuccess:c=!1}=t;if(o){let e=typeof o==`string`?o:`Procesando...`;Zh.getState().showLoader(e)}let l=typeof window<`u`?localStorage.getItem(`hive-auth-token`):null;console.log(`[API] ${n} ${e}`,{hasToken:!!l,tokenPreview:l?l.slice(0,20)+`...`:null,requireAuth:a});let u={method:n,headers:{"Content-Type":`application/json`,Accept:`application/json`,...a&&l?{Authorization:`Bearer ${l}`}:{},...i},body:r?JSON.stringify(r):void 0},d=null;for(let t=0;t<=3;t++)try{d=await fetch(`${ng}${e}`,u);break}catch(n){if(t<3)console.warn(`[API] Network error on ${e}, retrying in ${(t+1)*2}s…`),await rg((t+1)*2e3);else throw o&&Zh.getState().hideLoader(),n}if(d=d,o&&Zh.getState().hideLoader(),!d.ok){if(d.status===401&&typeof window<`u`&&!e.startsWith(`/api/auth/`)&&window.location.pathname!==`/login`)throw localStorage.removeItem(`hive-auth-token`),window.location.href=`/login`,Error(`No autorizado`);if(d.status===503)throw Error(`API Error: 503 Service Unavailable`);let t=`API Error: ${d.status} ${d.statusText}`;try{let e=await d.json();(e.message||e.error)&&(t=e.message||e.error)}catch{}throw s&&eg.fire({title:`Error de Sistema`,text:t,icon:`error`}),Error(t)}let f=await d.json();if(c){let e=`Operación exitosa`;typeof c==`function`?e=c(f):typeof c==`string`&&(e=c),e!==!1&&eg.fire({toast:!0,position:`top-end`,icon:`success`,title:typeof e==`string`?e:`Operación exitosa`,showConfirmButton:!1,timer:3e3,timerProgressBar:!0})}return f}var ig=i((e,t)=>({isLoading:!1,currentUser:null,error:null,setLoading:t=>e({isLoading:t}),setError:t=>e({error:t}),fetchUser:async()=>{e({isLoading:!0,error:null});try{let t=((await K(`/api/users`)).users||[])[0]||null;return e({currentUser:t,isLoading:!1}),t}catch(t){return e({isLoading:!1,error:t instanceof Error?t.message:`Failed to fetch user profile`}),null}},saveUser:async n=>{let r=t().currentUser;if(!r)throw Error(`No user to update`);e({isLoading:!0,error:null});try{let t=await K(`/api/users`,{method:`POST`,body:{...r,...n,id:r.id}});return e({currentUser:{...r,...n},isLoading:!1}),t.message||`Perfil guardado correctamente`}catch(t){throw e({isLoading:!1,error:t instanceof Error?t.message:`Failed to save user profile`}),t}}})),ag=uf;function og(){let{connect:e}=bh(),{currentUser:t,fetchUser:n}=ig();return(0,u.useEffect)(()=>{n()},[n]),(0,u.useEffect)(()=>{t?.id&&e(t.id)},[e,t?.id]),(0,A.jsxs)(Zm,{children:[(0,A.jsx)(Yh,{}),(0,A.jsxs)(eh,{className:`bg-background relative overflow-hidden`,children:[(0,A.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--blue -top-20 -left-20 h-[500px] w-[500px] opacity-20`}),(0,A.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--purple -bottom-20 -right-20 h-[500px] w-[500px] opacity-20`}),(0,A.jsxs)(`div`,{className:`flex flex-1 flex-col overflow-hidden relative z-10`,children:[(0,A.jsx)(Ch,{}),(0,A.jsx)(`main`,{className:`hive-page flex-1 min-h-0 p-4 animate-fade-in flex flex-col overflow-auto`,children:(0,A.jsx)(ag,{})})]})]})]})}var sg=r(((e,t)=>{t.exports=Array.isArray})),cg=r(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),lg=r(((e,t)=>{var n=cg(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),ug=r(((e,t)=>{t.exports=lg().Symbol})),dg=r(((e,t)=>{var n=ug(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),fg=r(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),pg=r(((e,t)=>{var n=ug(),r=dg(),i=fg(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),mg=r(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),hg=r(((e,t)=>{var n=pg(),r=mg(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),gg=r(((e,t)=>{var n=sg(),r=hg(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),_g=r(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),vg=r(((e,t)=>{var n=pg(),r=_g(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),yg=r(((e,t)=>{t.exports=lg()[`__core-js_shared__`]})),pne=r(((e,t)=>{var n=yg(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),bg=r(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),mne=r(((e,t)=>{var n=vg(),r=pne(),i=_g(),a=bg(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),hne=r(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),xg=r(((e,t)=>{var n=mne(),r=hne();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),Sg=r(((e,t)=>{t.exports=xg()(Object,`create`)})),gne=r(((e,t)=>{var n=Sg();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),_ne=r(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}t.exports=n})),vne=r(((e,t)=>{var n=Sg(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),yne=r(((e,t)=>{var n=Sg(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),bne=r(((e,t)=>{var n=Sg(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=n&&t===void 0?r:t,this}t.exports=i})),xne=r(((e,t)=>{var n=gne(),r=_ne(),i=vne(),a=yne(),o=bne();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Sne=r(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),Cg=r(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),wg=r(((e,t)=>{var n=Cg();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),Cne=r(((e,t)=>{var n=wg(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),wne=r(((e,t)=>{var n=wg();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),Tne=r(((e,t)=>{var n=wg();function r(e){return n(this.__data__,e)>-1}t.exports=r})),Ene=r(((e,t)=>{var n=wg();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),Tg=r(((e,t)=>{var n=Sne(),r=Cne(),i=wne(),a=Tne(),o=Ene();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),Eg=r(((e,t)=>{t.exports=xg()(lg(),`Map`)})),Dne=r(((e,t)=>{var n=xne(),r=Tg(),i=Eg();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),One=r(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),Dg=r(((e,t)=>{var n=One();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),kne=r(((e,t)=>{var n=Dg();function r(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}t.exports=r})),Ane=r(((e,t)=>{var n=Dg();function r(e){return n(this,e).get(e)}t.exports=r})),jne=r(((e,t)=>{var n=Dg();function r(e){return n(this,e).has(e)}t.exports=r})),Mne=r(((e,t)=>{var n=Dg();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),Og=r(((e,t)=>{var n=Dne(),r=kne(),i=Ane(),a=jne(),o=Mne();function s(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])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),kg=r(((e,t)=>{var n=Og(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),Nne=r(((e,t)=>{var n=kg(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),Pne=r(((e,t)=>{var n=Nne(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),Ag=r(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),Fne=r(((e,t)=>{var n=ug(),r=Ag(),i=sg(),a=hg(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),jg=r(((e,t)=>{var n=Fne();function r(e){return e==null?``:n(e)}t.exports=r})),Mg=r(((e,t)=>{var n=sg(),r=gg(),i=Pne(),a=jg();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),Ng=r(((e,t)=>{var n=hg(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),Pg=r(((e,t)=>{var n=Mg(),r=Ng();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),Fg=r(((e,t)=>{var n=Pg();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),Ine=r(((e,t)=>{function n(e){return e==null}t.exports=n})),Lne=r(((e,t)=>{var n=pg(),r=sg(),i=mg(),a=`[object String]`;function o(e){return typeof e==`string`||!r(e)&&i(e)&&n(e)==a}t.exports=o})),Rne=r((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.server_context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.suspense_list`),f=Symbol.for(`react.memo`),p=Symbol.for(`react.lazy`);function m(e){if(typeof e==`object`&&e){var m=e.$$typeof;switch(m){case t:switch(e=e.type,e){case r:case a:case i:case u:case d:return e;default:switch(e&&=e.$$typeof,e){case c:case s:case l:case p:case f:case o:return e;default:return m}}case n:return m}}}e.isFragment=function(e){return m(e)===r}})),zne=r(((e,t)=>{t.exports=Rne()})),Ig=r(((e,t)=>{var n=pg(),r=mg(),i=`[object Number]`;function a(e){return typeof e==`number`||r(e)&&n(e)==i}t.exports=a})),Bne=r(((e,t)=>{var n=Ig();function r(e){return n(e)&&e!=+e}t.exports=r})),Lg=e(Lne()),Rg=e(Bne()),zg=e(Fg()),Vne=e(Ig()),Bg=e(Ine()),Vg=function(e){return e===0?0:e>0?1:-1},Hg=function(e){return(0,Lg.default)(e)&&e.indexOf(`%`)===e.length-1},q=function(e){return(0,Vne.default)(e)&&!(0,Rg.default)(e)},Hne=function(e){return(0,Bg.default)(e)},Ug=function(e){return q(e)||(0,Lg.default)(e)},Une=0,Wg=function(e){var t=++Une;return`${e||``}${t}`},Gg=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!q(e)&&!(0,Lg.default)(e))return n;var i;if(Hg(e)){var a=e.indexOf(`%`);i=t*parseFloat(e.slice(0,a))/100}else i=+e;return(0,Rg.default)(i)&&(i=n),r&&i>t&&(i=t),i},Kg=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},Wne=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++)if(!n[e[r]])n[e[r]]=!0;else return!0;return!1},qg=function(e,t){return q(e)&&q(t)?function(n){return e+n*(t-e)}:function(){return t}};function Jg(e,t,n){return!e||!e.length?null:e.find(function(e){return e&&(typeof t==`function`?t(e):(0,zg.default)(e,t))===n})}var Gne=function(e,t){return q(e)&&q(t)?e-t:(0,Lg.default)(e)&&(0,Lg.default)(t)?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():String(e).localeCompare(String(t))};function Yg(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}var Xg=e(_g());function Zg(e){"@babel/helpers - typeof";return Zg=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Zg(e)}var Kne=[`viewBox`,`children`],qne=`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`.split(`.`),Qg=[`points`,`pathLength`],Jne={svg:Kne,polygon:Qg,polyline:Qg},$g=`dangerouslySetInnerHTML.onCopy.onCopyCapture.onCut.onCutCapture.onPaste.onPasteCapture.onCompositionEnd.onCompositionEndCapture.onCompositionStart.onCompositionStartCapture.onCompositionUpdate.onCompositionUpdateCapture.onFocus.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`.split(`.`),e_=function(e,t){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var n=e;if((0,u.isValidElement)(e)&&(n=e.props),!(0,Xg.default)(n))return null;var r={};return Object.keys(n).forEach(function(e){$g.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},Yne=function(e,t,n){return function(r){return e(t,n,r),null}},t_=function(e,t,n){if(!(0,Xg.default)(e)||Zg(e)!==`object`)return null;var r=null;return Object.keys(e).forEach(function(i){var a=e[i];$g.includes(i)&&typeof a==`function`&&(r||={},r[i]=Yne(a,t,n))}),r},n_=e(vg()),Xne=zne(),Zne=[`children`],Qne=[`children`];function r_(e,t){if(e==null)return{};var n=$ne(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function $ne(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 i_(e){"@babel/helpers - typeof";return i_=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},i_(e)}var a_={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`},o_=function(e){return typeof e==`string`?e:e?e.displayName||e.name||`Component`:``},s_=null,c_=null,l_=function e(t){if(t===s_&&Array.isArray(c_))return c_;var n=[];return u.Children.forEach(t,function(t){(0,Bg.default)(t)||((0,Xne.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),c_=n,s_=t,n};function u_(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return o_(e)}):[o_(t)],l_(e).forEach(function(e){var t=(0,zg.default)(e,`type.displayName`)||(0,zg.default)(e,`type.name`);r.indexOf(t)!==-1&&n.push(e)}),n}function d_(e,t){var n=u_(e,t);return n&&n[0]}var f_=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!q(n)||n<=0||!q(r)||r<=0)},ere=`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`.split(`.`),tre=function(e){return e&&e.type&&(0,Lg.default)(e.type)&&ere.indexOf(e.type)>=0},p_=function(e){return e&&i_(e)===`object`&&`clipDot`in e},nre=function(e,t,n,r){var i=Jne?.[r]??[];return t.startsWith(`data-`)||!(0,n_.default)(e)&&(r&&i.includes(t)||qne.includes(t))||n&&$g.includes(t)},J=function(e,t,n){if(!e||typeof e==`function`||typeof e==`boolean`)return null;var r=e;if((0,u.isValidElement)(e)&&(r=e.props),!(0,Xg.default)(r))return null;var i={};return Object.keys(r).forEach(function(e){nre(r?.[e],e,t,n)&&(i[e]=r[e])}),i},m_=function e(t,n){if(t===n)return!0;var r=u.Children.count(t);if(r!==u.Children.count(n))return!1;if(r===0)return!0;if(r===1)return h_(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var i=0;i<r;i++){var a=t[i],o=n[i];if(Array.isArray(a)||Array.isArray(o)){if(!e(a,o))return!1}else if(!h_(a,o))return!1}return!0},h_=function(e,t){if((0,Bg.default)(e)&&(0,Bg.default)(t))return!0;if(!(0,Bg.default)(e)&&!(0,Bg.default)(t)){var n=e.props||{},r=n.children,i=r_(n,Zne),a=t.props||{},o=a.children,s=r_(a,Qne);return r&&o?Yg(i,s)&&m_(r,o):!r&&!o?Yg(i,s):!1}return!1},g_=function(e,t){var n=[],r={};return l_(e).forEach(function(e,i){if(tre(e))n.push(e);else if(e){var a=o_(e.type),o=t[a]||{},s=o.handler,c=o.once;if(s&&(!c||!r[a])){var l=s(e,a,i);n.push(l),r[a]=!0}}}),n},rre=function(e){var t=e&&e.type;return t&&a_[t]?a_[t]:null},ire=function(e,t){return l_(t).indexOf(e)},are=[`children`,`width`,`height`,`viewBox`,`className`,`style`,`title`,`desc`];function __(){return __=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},__.apply(this,arguments)}function ore(e,t){if(e==null)return{};var n=sre(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sre(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 v_(e){var t=e.children,n=e.width,r=e.height,i=e.viewBox,a=e.className,o=e.style,s=e.title,c=e.desc,l=ore(e,are),d=i||{width:n,height:r,x:0,y:0},f=Mt(`recharts-surface`,a);return u.createElement(`svg`,__({},J(l,!0,`svg`),{className:f,width:n,height:r,style:o,viewBox:`${d.x} ${d.y} ${d.width} ${d.height}`}),u.createElement(`title`,null,s),u.createElement(`desc`,null,c),t)}var cre=[`children`,`className`];function y_(){return y_=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},y_.apply(this,arguments)}function lre(e,t){if(e==null)return{};var n=ure(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ure(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 b_=u.forwardRef(function(e,t){var n=e.children,r=e.className,i=lre(e,cre),a=Mt(`recharts-layer`,r);return u.createElement(`g`,y_({className:a},J(i,!0),{ref:t}),n)}),dre=!1,x_=function(e,t){var n=[...arguments].slice(2);if(dre&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,function(){return n[r++]}))}},fre=r(((e,t)=>{function n(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}t.exports=n})),pre=r(((e,t)=>{var n=fre();function r(e,t,r){var i=e.length;return r=r===void 0?i:r,!t&&r>=i?e:n(e,t,r)}t.exports=r})),S_=r(((e,t)=>{var n=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function r(e){return n.test(e)}t.exports=r})),mre=r(((e,t)=>{function n(e){return e.split(``)}t.exports=n})),hre=r(((e,t)=>{var n=`\\ud800-\\udfff`,r=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,i=`\\ufe0e\\ufe0f`,a=`[`+n+`]`,o=`[`+r+`]`,s=`\\ud83c[\\udffb-\\udfff]`,c=`(?:`+o+`|`+s+`)`,l=`[^`+n+`]`,u=`(?:\\ud83c[\\udde6-\\uddff]){2}`,d=`[\\ud800-\\udbff][\\udc00-\\udfff]`,f=`\\u200d`,p=c+`?`,m=`[`+i+`]?`,h=`(?:`+f+`(?:`+[l,u,d].join(`|`)+`)`+m+p+`)*`,g=m+p+h,_=`(?:`+[l+o+`?`,o,u,d,a].join(`|`)+`)`,v=RegExp(s+`(?=`+s+`)|`+_+g,`g`);function y(e){return e.match(v)||[]}t.exports=y})),gre=r(((e,t)=>{var n=mre(),r=S_(),i=hre();function a(e){return r(e)?i(e):n(e)}t.exports=a})),_re=r(((e,t)=>{var n=pre(),r=S_(),i=gre(),a=jg();function o(e){return function(t){t=a(t);var o=r(t)?i(t):void 0,s=o?o[0]:t.charAt(0),c=o?n(o,1).join(``):t.slice(1);return s[e]()+c}}t.exports=o})),vre=r(((e,t)=>{t.exports=_re()(`toUpperCase`)}));function C_(e){return function(){return e}}var w_=Math.cos,T_=Math.sin,E_=Math.sqrt,D_=Math.PI;D_/2;var O_=2*D_,k_=Math.PI,A_=2*k_,j_=1e-6,yre=A_-j_;function M_(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function bre(e){let t=Math.floor(e);if(!(t>=0))throw Error(`invalid digits: ${e}`);if(t>15)return M_;let n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}var N_=class{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._=``,this._append=e==null?M_:bre(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,i,a){this._append`C${+e},${+t},${+n},${+r},${this._x1=+i},${this._y1=+a}`}arcTo(e,t,n,r,i){if(e=+e,t=+t,n=+n,r=+r,i=+i,i<0)throw Error(`negative radius: ${i}`);let a=this._x1,o=this._y1,s=n-e,c=r-t,l=a-e,u=o-t,d=l*l+u*u;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(d>j_)if(!(Math.abs(u*s-c*l)>j_)||!i)this._append`L${this._x1=e},${this._y1=t}`;else{let f=n-a,p=r-o,m=s*s+c*c,h=f*f+p*p,g=Math.sqrt(m),_=Math.sqrt(d),v=i*Math.tan((k_-Math.acos((m+d-h)/(2*g*_)))/2),y=v/_,b=v/g;Math.abs(y-1)>j_&&this._append`L${e+y*l},${t+y*u}`,this._append`A${i},${i},0,0,${+(u*f>l*p)},${this._x1=e+b*s},${this._y1=t+b*c}`}}arc(e,t,n,r,i,a){if(e=+e,t=+t,n=+n,a=!!a,n<0)throw Error(`negative radius: ${n}`);let o=n*Math.cos(r),s=n*Math.sin(r),c=e+o,l=t+s,u=1^a,d=a?r-i:i-r;this._x1===null?this._append`M${c},${l}`:(Math.abs(this._x1-c)>j_||Math.abs(this._y1-l)>j_)&&this._append`L${c},${l}`,n&&(d<0&&(d=d%A_+A_),d>yre?this._append`A${n},${n},0,1,${u},${e-o},${t-s}A${n},${n},0,1,${u},${this._x1=c},${this._y1=l}`:d>j_&&this._append`A${n},${n},0,${+(d>=k_)},${u},${this._x1=e+n*Math.cos(i)},${this._y1=t+n*Math.sin(i)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}};function xre(){return new N_}xre.prototype=N_.prototype;function P_(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{let e=Math.floor(n);if(!(e>=0))throw RangeError(`invalid digits: ${n}`);t=e}return e},()=>new N_(t)}Array.prototype.slice;function F_(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function I_(e){this._context=e}I_.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 L_(e){return new I_(e)}function R_(e){return e[0]}function z_(e){return e[1]}function B_(e,t){var n=C_(!0),r=null,i=L_,a=null,o=P_(s);e=typeof e==`function`?e:e===void 0?R_:C_(e),t=typeof t==`function`?t:t===void 0?z_:C_(t);function s(s){var c,l=(s=F_(s)).length,u,d=!1,f;for(r??(a=i(f=o())),c=0;c<=l;++c)!(c<l&&n(u=s[c],c,s))===d&&((d=!d)?a.lineStart():a.lineEnd()),d&&a.point(+e(u,c,s),+t(u,c,s));if(f)return a=null,f+``||null}return s.x=function(t){return arguments.length?(e=typeof t==`function`?t:C_(+t),s):e},s.y=function(e){return arguments.length?(t=typeof e==`function`?e:C_(+e),s):t},s.defined=function(e){return arguments.length?(n=typeof e==`function`?e:C_(!!e),s):n},s.curve=function(e){return arguments.length?(i=e,r!=null&&(a=i(r)),s):i},s.context=function(e){return arguments.length?(e==null?r=a=null:a=i(r=e),s):r},s}function V_(e,t,n){var r=null,i=C_(!0),a=null,o=L_,s=null,c=P_(l);e=typeof e==`function`?e:e===void 0?R_:C_(+e),t=typeof t==`function`?t:C_(t===void 0?0:+t),n=typeof n==`function`?n:n===void 0?z_:C_(+n);function l(l){var u,d,f,p=(l=F_(l)).length,m,h=!1,g,_=Array(p),v=Array(p);for(a??(s=o(g=c())),u=0;u<=p;++u){if(!(u<p&&i(m=l[u],u,l))===h)if(h=!h)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(_[f],v[f]);s.lineEnd(),s.areaEnd()}h&&(_[u]=+e(m,u,l),v[u]=+t(m,u,l),s.point(r?+r(m,u,l):_[u],n?+n(m,u,l):v[u]))}if(g)return s=null,g+``||null}function u(){return B_().defined(i).curve(o).context(a)}return l.x=function(t){return arguments.length?(e=typeof t==`function`?t:C_(+t),r=null,l):e},l.x0=function(t){return arguments.length?(e=typeof t==`function`?t:C_(+t),l):e},l.x1=function(e){return arguments.length?(r=e==null?null:typeof e==`function`?e:C_(+e),l):r},l.y=function(e){return arguments.length?(t=typeof e==`function`?e:C_(+e),n=null,l):t},l.y0=function(e){return arguments.length?(t=typeof e==`function`?e:C_(+e),l):t},l.y1=function(e){return arguments.length?(n=e==null?null:typeof e==`function`?e:C_(+e),l):n},l.lineX0=l.lineY0=function(){return u().x(e).y(t)},l.lineY1=function(){return u().x(e).y(n)},l.lineX1=function(){return u().x(r).y(t)},l.defined=function(e){return arguments.length?(i=typeof e==`function`?e:C_(!!e),l):i},l.curve=function(e){return arguments.length?(o=e,a!=null&&(s=o(a)),l):o},l.context=function(e){return arguments.length?(e==null?a=s=null:s=o(a=e),l):a},l}var H_=class{constructor(e,t){this._context=e,this._x=t}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(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._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}this._x0=e,this._y0=t}};function U_(e){return new H_(e,!0)}function W_(e){return new H_(e,!1)}var G_={draw(e,t){let n=E_(t/D_);e.moveTo(n,0),e.arc(0,0,n,0,O_)}},K_={draw(e,t){let n=E_(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()}},q_=E_(1/3),J_=q_*2,Y_={draw(e,t){let n=E_(t/J_),r=n*q_;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},X_={draw(e,t){let n=E_(t),r=-n/2;e.rect(r,r,n,n)}},Z_=.8908130915292852,Q_=T_(D_/10)/T_(7*D_/10),$_=T_(O_/10)*Q_,ev=-w_(O_/10)*Q_,tv={draw(e,t){let n=E_(t*Z_),r=$_*n,i=ev*n;e.moveTo(0,-n),e.lineTo(r,i);for(let t=1;t<5;++t){let a=O_*t/5,o=w_(a),s=T_(a);e.lineTo(s*n,-o*n),e.lineTo(o*r-s*i,s*r+o*i)}e.closePath()}},nv=E_(3),rv={draw(e,t){let n=-E_(t/(nv*3));e.moveTo(0,n*2),e.lineTo(-nv*n,-n),e.lineTo(nv*n,-n),e.closePath()}},iv=-.5,av=E_(3)/2,ov=1/E_(12),sv=(ov/2+1)*3,cv={draw(e,t){let n=E_(t/sv),r=n/2,i=n*ov,a=r,o=n*ov+n,s=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(s,c),e.lineTo(iv*r-av*i,av*r+iv*i),e.lineTo(iv*a-av*o,av*a+iv*o),e.lineTo(iv*s-av*c,av*s+iv*c),e.lineTo(iv*r+av*i,iv*i-av*r),e.lineTo(iv*a+av*o,iv*o-av*a),e.lineTo(iv*s+av*c,iv*c-av*s),e.closePath()}};function lv(e,t){let n=null,r=P_(i);e=typeof e==`function`?e:C_(e||G_),t=typeof t==`function`?t:C_(t===void 0?64:+t);function i(){let i;if(n||=i=r(),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+``||null}return i.type=function(t){return arguments.length?(e=typeof t==`function`?t:C_(t),i):e},i.size=function(e){return arguments.length?(t=typeof e==`function`?e:C_(+e),i):t},i.context=function(e){return arguments.length?(n=e??null,i):n},i}function uv(){}function dv(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 fv(e){this._context=e}fv.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:dv(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:dv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function pv(e){return new fv(e)}function mv(e){this._context=e}mv.prototype={areaStart:uv,areaEnd:uv,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:dv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function hv(e){return new mv(e)}function gv(e){this._context=e}gv.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:dv(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _v(e){return new gv(e)}function vv(e){this._context=e}vv.prototype={areaStart:uv,areaEnd:uv,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 yv(e){return new vv(e)}function bv(e){return e<0?-1:1}function xv(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),s=(a*i+o*r)/(r+i);return(bv(a)+bv(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(s))||0}function Sv(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Cv(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,s=(a-r)/3;e._context.bezierCurveTo(r+s,i+s*t,a-s,o-s*n,a,o)}function wv(e){this._context=e}wv.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:Cv(this,this._t0,Sv(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,Cv(this,Sv(this,n=xv(this,e,t)),n);break;default:Cv(this,this._t0,n=xv(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Tv(e){this._context=new Ev(e)}(Tv.prototype=Object.create(wv.prototype)).point=function(e,t){wv.prototype.point.call(this,t,e)};function Ev(e){this._context=e}Ev.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,i,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function Dv(e){return new wv(e)}function Ov(e){return new Tv(e)}function kv(e){this._context=e}kv.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=Av(e),i=Av(t),a=0,o=1;o<n;++a,++o)this._context.bezierCurveTo(r[0][a],i[0][a],r[1][a],i[1][a],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 Av(e){var t,n=e.length-1,r,i=Array(n),a=Array(n),o=Array(n);for(i[0]=0,a[0]=2,o[0]=e[0]+2*e[1],t=1;t<n-1;++t)i[t]=1,a[t]=4,o[t]=4*e[t]+2*e[t+1];for(i[n-1]=2,a[n-1]=7,o[n-1]=8*e[n-1]+e[n],t=1;t<n;++t)r=i[t]/a[t-1],a[t]-=r,o[t]-=r*o[t-1];for(i[n-1]=o[n-1]/a[n-1],t=n-2;t>=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[n-1]=(e[n]+i[n-1])/2,t=0;t<n-1;++t)a[t]=2*e[t+1]-i[t+1];return[i,a]}function jv(e){return new kv(e)}function Mv(e,t){this._context=e,this._t=t}Mv.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;default: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 Nv(e){return new Mv(e,.5)}function Pv(e){return new Mv(e,0)}function Fv(e){return new Mv(e,1)}function Iv(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,s=a.length;n<o;++n)for(i=a,a=e[t[n]],r=0;r<s;++r)a[r][1]+=a[r][0]=isNaN(i[r][1])?i[r][0]:i[r][1]}function Lv(e){for(var t=e.length,n=Array(t);--t>=0;)n[t]=t;return n}function Rv(e,t){return e[t]}function zv(e){let t=[];return t.key=e,t}function Bv(){var e=C_([]),t=Lv,n=Iv,r=Rv;function i(i){var a=Array.from(e.apply(this,arguments),zv),o,s=a.length,c=-1,l;for(let e of i)for(o=0,++c;o<s;++o)(a[o][c]=[0,+r(e,a[o].key,c,i)]).data=e;for(o=0,l=F_(t(a));o<s;++o)a[l[o]].index=o;return n(a,l),a}return i.keys=function(t){return arguments.length?(e=typeof t==`function`?t:C_(Array.from(t)),i):e},i.value=function(e){return arguments.length?(r=typeof e==`function`?e:C_(+e),i):r},i.order=function(e){return arguments.length?(t=e==null?Lv:typeof e==`function`?e:C_(Array.from(e)),i):t},i.offset=function(e){return arguments.length?(n=e??Iv,i):n},i}function Vv(e,t){if((r=e.length)>0){for(var n,r,i=0,a=e[0].length,o;i<a;++i){for(o=n=0;n<r;++n)o+=e[n][i][1]||0;if(o)for(n=0;n<r;++n)e[n][i][1]/=o}Iv(e,t)}}function Hv(e,t){if((i=e.length)>0){for(var n=0,r=e[t[0]],i,a=r.length;n<a;++n){for(var o=0,s=0;o<i;++o)s+=e[o][n][1]||0;r[n][1]+=r[n][0]=-s/2}Iv(e,t)}}function Uv(e,t){if(!(!((o=e.length)>0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r<a;++r){for(var s=0,c=0,l=0;s<o;++s){for(var u=e[t[s]],d=u[r][1]||0,f=(d-(u[r-1][1]||0))/2,p=0;p<s;++p){var m=e[t[p]],h=m[r][1]||0,g=m[r-1][1]||0;f+=h-g}c+=d,l+=f*d}i[r-1][1]+=i[r-1][0]=n,c&&(n-=l/c)}i[r-1][1]+=i[r-1][0]=n,Iv(e,t)}}var Wv=e(vre());function Gv(e){"@babel/helpers - typeof";return Gv=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Gv(e)}var Kv=[`type`,`size`,`sizeType`];function qv(){return qv=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},qv.apply(this,arguments)}function Jv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Yv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Jv(Object(n),!0).forEach(function(t){Xv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xv(e,t,n){return t=Zv(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zv(e){var t=Qv(e,`string`);return Gv(t)==`symbol`?t:t+``}function Qv(e,t){if(Gv(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Gv(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function $v(e,t){if(e==null)return{};var n=ey(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ey(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 ty={symbolCircle:G_,symbolCross:K_,symbolDiamond:Y_,symbolSquare:X_,symbolStar:tv,symbolTriangle:rv,symbolWye:cv},ny=Math.PI/180,ry=function(e){return ty[`symbol${(0,Wv.default)(e)}`]||G_},iy=function(e,t,n){if(t===`area`)return e;switch(n){case`cross`:return 5*e*e/9;case`diamond`:return .5*e*e/Math.sqrt(3);case`square`:return e*e;case`star`:var r=18*ny;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2);case`triangle`:return Math.sqrt(3)*e*e/4;case`wye`:return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},ay=function(e,t){ty[`symbol${(0,Wv.default)(e)}`]=t},oy=function(e){var t=e.type,n=t===void 0?`circle`:t,r=e.size,i=r===void 0?64:r,a=e.sizeType,o=a===void 0?`area`:a,s=Yv(Yv({},$v(e,Kv)),{},{type:n,size:i,sizeType:o}),c=function(){var e=ry(n);return lv().type(e).size(iy(i,o,n))()},l=s.className,d=s.cx,f=s.cy,p=J(s,!0);return d===+d&&f===+f&&i===+i?u.createElement(`path`,qv({},p,{className:Mt(`recharts-symbols`,l),transform:`translate(${d}, ${f})`,d:c()})):null};oy.registerSymbol=ay;function sy(e){"@babel/helpers - typeof";return sy=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},sy(e)}function cy(){return cy=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},cy.apply(this,arguments)}function ly(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uy(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ly(Object(n),!0).forEach(function(t){xy(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dy(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function fy(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,Sy(r.key),r)}}function py(e,t,n){return t&&fy(e.prototype,t),n&&fy(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function my(e,t,n){return t=vy(t),hy(e,_y()?Reflect.construct(t,n||[],vy(e).constructor):t.apply(e,n))}function hy(e,t){if(t&&(sy(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return gy(e)}function gy(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function _y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_y=function(){return!!e})()}function vy(e){return vy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vy(e)}function yy(e,t){if(typeof t!=`function`&&t!==null)throw 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&&by(e,t)}function by(e,t){return by=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},by(e,t)}function xy(e,t,n){return t=Sy(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sy(e){var t=Cy(e,`string`);return sy(t)==`symbol`?t:t+``}function Cy(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 TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var wy=32,Ty=function(e){function t(){return dy(this,t),my(this,t,arguments)}return yy(t,e),py(t,[{key:`renderIcon`,value:function(e){var t=this.props.inactiveColor,n=wy/2,r=wy/6,i=wy/3,a=e.inactive?t:e.color;if(e.type===`plainline`)return u.createElement(`line`,{strokeWidth:4,fill:`none`,stroke:a,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:n,x2:wy,y2:n,className:`recharts-legend-icon`});if(e.type===`line`)return u.createElement(`path`,{strokeWidth:4,fill:`none`,stroke:a,d:`M0,${n}h${i}
119
+ A${r},${r},0,1,1,${2*i},${n}
120
+ H${wy}M${2*i},${n}
121
+ A${r},${r},0,1,1,${i},${n}`,className:`recharts-legend-icon`});if(e.type===`rect`)return u.createElement(`path`,{stroke:`none`,fill:a,d:`M0,${wy/8}h${wy}v${wy*3/4}h${-wy}z`,className:`recharts-legend-icon`});if(u.isValidElement(e.legendIcon)){var o=uy({},e);return delete o.legendIcon,u.cloneElement(e.legendIcon,o)}return u.createElement(oy,{fill:a,cx:n,cy:n,size:wy,sizeType:`diameter`,type:e.type})}},{key:`renderItems`,value:function(){var e=this,t=this.props,n=t.payload,r=t.iconSize,i=t.layout,a=t.formatter,o=t.inactiveColor,s={x:0,y:0,width:wy,height:wy},c={display:i===`horizontal`?`inline-block`:`block`,marginRight:10},l={display:`inline-block`,verticalAlign:`middle`,marginRight:4};return n.map(function(t,n){var i=t.formatter||a,d=Mt(xy(xy({"recharts-legend-item":!0},`legend-item-${n}`,!0),`inactive`,t.inactive));if(t.type===`none`)return null;var f=(0,n_.default)(t.value)?null:t.value;x_(!(0,n_.default)(t.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 p=t.inactive?o:t.color;return u.createElement(`li`,cy({className:d,style:c,key:`legend-item-${n}`},t_(e.props,t,n)),u.createElement(v_,{width:r,height:r,viewBox:s,style:l},e.renderIcon(t)),u.createElement(`span`,{className:`recharts-legend-item-text`,style:{color:p}},i?i(f,t,n):f))})}},{key:`render`,value:function(){var e=this.props,t=e.payload,n=e.layout,r=e.align;if(!t||!t.length)return null;var i={padding:0,margin:0,textAlign:n===`horizontal`?r:`left`};return u.createElement(`ul`,{className:`recharts-default-legend`,style:i},this.renderItems())}}])}(u.PureComponent);xy(Ty,`displayName`,`Legend`),xy(Ty,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`middle`,inactiveColor:`#ccc`});var Ey=r(((e,t)=>{var n=Tg();function r(){this.__data__=new n,this.size=0}t.exports=r})),Dy=r(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),Oy=r(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),ky=r(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Ay=r(((e,t)=>{var n=Tg(),r=Eg(),i=Og(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),jy=r(((e,t)=>{var n=Tg(),r=Ey(),i=Dy(),a=Oy(),o=ky(),s=Ay();function c(e){this.size=(this.__data__=new n(e)).size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),My=r(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),Ny=r(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),Py=r(((e,t)=>{var n=Og(),r=My(),i=Ny();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),Fy=r(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),Iy=r(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),Ly=r(((e,t)=>{var n=Py(),r=Fy(),i=Iy(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),Ry=r(((e,t)=>{t.exports=lg().Uint8Array})),zy=r(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),By=r(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),Vy=r(((e,t)=>{var n=ug(),r=Ry(),i=Cg(),a=Ly(),o=zy(),s=By(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,p=`[object Map]`,m=`[object Number]`,h=`[object RegExp]`,g=`[object Set]`,_=`[object String]`,v=`[object Symbol]`,y=`[object ArrayBuffer]`,b=`[object DataView]`,x=n?n.prototype:void 0,S=x?x.valueOf:void 0;function C(e,t,n,x,C,w,T){switch(n){case b:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case y:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case m:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case h:case _:return e==t+``;case p:var E=o;case g:var D=x&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;x|=l,T.set(e,t);var k=a(E(e),E(t),x,C,w,T);return T.delete(e),k;case v:if(S)return S.call(e)==S.call(t)}return!1}t.exports=C})),Hy=r(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),Uy=r(((e,t)=>{var n=Hy(),r=sg();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Wy=r(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),Gy=r(((e,t)=>{function n(){return[]}t.exports=n})),Ky=r(((e,t)=>{var n=Wy(),r=Gy(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),qy=r(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),Jy=r(((e,t)=>{var n=pg(),r=mg(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),Yy=r(((e,t)=>{var n=Jy(),r=mg(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Xy=r(((e,t)=>{function n(){return!1}t.exports=n})),Zy=r(((e,t)=>{var n=lg(),r=Xy(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),Qy=r(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),$y=r(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),eb=r(((e,t)=>{var n=pg(),r=$y(),i=mg(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,k={};k[b]=k[x]=k[S]=k[C]=k[w]=k[T]=k[E]=k[D]=k[O]=!0,k[a]=k[o]=k[v]=k[s]=k[y]=k[c]=k[l]=k[u]=k[d]=k[f]=k[p]=k[m]=k[h]=k[g]=k[_]=!1;function A(e){return i(e)&&r(e.length)&&!!k[n(e)]}t.exports=A})),tb=r(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),nb=r(((e,t)=>{var n=cg(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),rb=r(((e,t)=>{var n=eb(),r=tb(),i=nb(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),ib=r(((e,t)=>{var n=qy(),r=Yy(),i=sg(),a=Zy(),o=Qy(),s=rb(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),ab=r(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),ob=r(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),sb=r(((e,t)=>{t.exports=ob()(Object.keys,Object)})),cb=r(((e,t)=>{var n=ab(),r=sb(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),lb=r(((e,t)=>{var n=vg(),r=$y();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),ub=r(((e,t)=>{var n=ib(),r=cb(),i=lb();function a(e){return i(e)?n(e):r(e)}t.exports=a})),db=r(((e,t)=>{var n=Uy(),r=Ky(),i=ub();function a(e){return n(e,i,r)}t.exports=a})),fb=r(((e,t)=>{var n=db(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),pb=r(((e,t)=>{t.exports=xg()(lg(),`DataView`)})),mb=r(((e,t)=>{t.exports=xg()(lg(),`Promise`)})),hb=r(((e,t)=>{t.exports=xg()(lg(),`Set`)})),gb=r(((e,t)=>{t.exports=xg()(lg(),`WeakMap`)})),_b=r(((e,t)=>{var n=pb(),r=Eg(),i=mb(),a=hb(),o=gb(),s=pg(),c=bg(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),vb=r(((e,t)=>{var n=jy(),r=Ly(),i=Vy(),a=fb(),o=_b(),s=sg(),c=Zy(),l=rb(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),yb=r(((e,t)=>{var n=vb(),r=mg();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),bb=r(((e,t)=>{var n=jy(),r=yb(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),xb=r(((e,t)=>{var n=_g();function r(e){return e===e&&!n(e)}t.exports=r})),Sb=r(((e,t)=>{var n=xb(),r=ub();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),Cb=r(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),wb=r(((e,t)=>{var n=bb(),r=Sb(),i=Cb();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Tb=r(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Eb=r(((e,t)=>{var n=Mg(),r=Yy(),i=sg(),a=Qy(),o=$y(),s=Ng();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),Db=r(((e,t)=>{var n=Tb(),r=Eb();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),Ob=r(((e,t)=>{var n=yb(),r=Fg(),i=Db(),a=gg(),o=xb(),s=Cb(),c=Ng(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),kb=r(((e,t)=>{function n(e){return e}t.exports=n})),Ab=r(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),jb=r(((e,t)=>{var n=Pg();function r(e){return function(t){return n(t,e)}}t.exports=r})),Mb=r(((e,t)=>{var n=Ab(),r=jb(),i=gg(),a=Ng();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),Nb=r(((e,t)=>{var n=wb(),r=Ob(),i=kb(),a=sg(),o=Mb();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Pb=r(((e,t)=>{function n(e,t,n,r){for(var i=e.length,a=n+(r?1:-1);r?a--:++a<i;)if(t(e[a],a,e))return a;return-1}t.exports=n})),Fb=r(((e,t)=>{function n(e){return e!==e}t.exports=n})),Ib=r(((e,t)=>{function n(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}t.exports=n})),Lb=r(((e,t)=>{var n=Pb(),r=Fb(),i=Ib();function a(e,t,a){return t===t?i(e,t,a):n(e,r,a)}t.exports=a})),Rb=r(((e,t)=>{var n=Lb();function r(e,t){return!!(e!=null&&e.length)&&n(e,t,0)>-1}t.exports=r})),zb=r(((e,t)=>{function n(e,t,n){for(var r=-1,i=e==null?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}t.exports=n})),Bb=r(((e,t)=>{function n(){}t.exports=n})),Vb=r(((e,t)=>{var n=hb(),r=Bb(),i=By();t.exports=n&&1/i(new n([,-0]))[1]==1/0?function(e){return new n(e)}:r})),Hb=r(((e,t)=>{var n=Py(),r=Rb(),i=zb(),a=Iy(),o=Vb(),s=By(),c=200;function l(e,t,l){var u=-1,d=r,f=e.length,p=!0,m=[],h=m;if(l)p=!1,d=i;else if(f>=c){var g=t?null:o(e);if(g)return s(g);p=!1,d=a,h=new n}else h=t?[]:m;outer:for(;++u<f;){var _=e[u],v=t?t(_):_;if(_=l||_!==0?_:0,p&&v===v){for(var y=h.length;y--;)if(h[y]===v)continue outer;t&&h.push(v),m.push(_)}else d(h,v,l)||(h!==m&&h.push(v),m.push(_))}return m}t.exports=l})),Ub=e(r(((e,t)=>{var n=Nb(),r=Hb();function i(e,t){return e&&e.length?r(e,n(t,2)):[]}t.exports=i}))());function Wb(e,t,n){return t===!0?(0,Ub.default)(e,n):(0,n_.default)(t)?(0,Ub.default)(e,t):e}function Gb(e){"@babel/helpers - typeof";return Gb=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Gb(e)}var Kb=[`ref`];function qb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?qb(Object(n),!0).forEach(function(t){ax(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Yb(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Xb(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,ox(r.key),r)}}function Zb(e,t,n){return t&&Xb(e.prototype,t),n&&Xb(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Qb(e,t,n){return t=nx(t),$b(e,tx()?Reflect.construct(t,n||[],nx(e).constructor):t.apply(e,n))}function $b(e,t){if(t&&(Gb(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return ex(e)}function ex(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function tx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(tx=function(){return!!e})()}function nx(e){return nx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nx(e)}function rx(e,t){if(typeof t!=`function`&&t!==null)throw 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&&ix(e,t)}function ix(e,t){return ix=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ix(e,t)}function ax(e,t,n){return t=ox(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ox(e){var t=sx(e,`string`);return Gb(t)==`symbol`?t:t+``}function sx(e,t){if(Gb(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Gb(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function cx(e,t){if(e==null)return{};var n=lx(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function lx(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 ux(e){return e.value}function dx(e,t){if(u.isValidElement(e))return u.cloneElement(e,t);if(typeof e==`function`)return u.createElement(e,t);t.ref;var n=cx(t,Kb);return u.createElement(Ty,n)}var fx=1,px=function(e){function t(){var e;Yb(this,t);var n=[...arguments];return e=Qb(this,t,[].concat(n)),ax(e,`lastBoundingBox`,{width:-1,height:-1}),e}return rx(t,e),Zb(t,[{key:`componentDidMount`,value:function(){this.updateBBox()}},{key:`componentDidUpdate`,value:function(){this.updateBBox()}},{key:`getBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:`updateBBox`,value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>fx||Math.abs(t.height-this.lastBoundingBox.height)>fx)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:`getBBoxSnapshot`,value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Jb({},this.lastBoundingBox):{width:0,height:0}}},{key:`getDefaultPosition`,value:function(e){var t=this.props,n=t.layout,r=t.align,i=t.verticalAlign,a=t.margin,o=t.chartWidth,s=t.chartHeight,c,l;if(!e||(e.left===void 0||e.left===null)&&(e.right===void 0||e.right===null))if(r===`center`&&n===`vertical`){var u=this.getBBoxSnapshot();c={left:((o||0)-u.width)/2}}else c=r===`right`?{right:a&&a.right||0}:{left:a&&a.left||0};if(!e||(e.top===void 0||e.top===null)&&(e.bottom===void 0||e.bottom===null))if(i===`middle`){var d=this.getBBoxSnapshot();l={top:((s||0)-d.height)/2}}else l=i===`bottom`?{bottom:a&&a.bottom||0}:{top:a&&a.top||0};return Jb(Jb({},c),l)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.content,r=t.width,i=t.height,a=t.wrapperStyle,o=t.payloadUniqBy,s=t.payload,c=Jb(Jb({position:`absolute`,width:r||`auto`,height:i||`auto`},this.getDefaultPosition(a)),a);return u.createElement(`div`,{className:`recharts-legend-wrapper`,style:c,ref:function(t){e.wrapperNode=t}},dx(n,Jb(Jb({},this.props),{},{payload:Wb(s,o,ux)})))}}],[{key:`getWithHeight`,value:function(e,t){var n=Jb(Jb({},this.defaultProps),e.props).layout;return n===`vertical`&&q(e.props.height)?{height:e.props.height}:n===`horizontal`?{width:e.props.width||t}:null}}])}(u.PureComponent);ax(px,`displayName`,`Legend`),ax(px,`defaultProps`,{iconSize:14,layout:`horizontal`,align:`center`,verticalAlign:`bottom`});var mx=r(((e,t)=>{var n=ug(),r=Yy(),i=sg(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),hx=r(((e,t)=>{var n=Hy(),r=mx();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),gx=r(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),_x=r(((e,t)=>{t.exports=gx()()})),vx=r(((e,t)=>{var n=_x(),r=ub();function i(e,t){return e&&n(e,t,r)}t.exports=i})),yx=r(((e,t)=>{var n=lb();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),bx=r(((e,t)=>{var n=vx();t.exports=yx()(n)})),xx=r(((e,t)=>{var n=bx(),r=lb();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),Sx=r(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),Cx=r(((e,t)=>{var n=hg();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),wx=r(((e,t)=>{var n=Cx();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),Tx=r(((e,t)=>{var n=Ag(),r=Pg(),i=Nb(),a=xx(),o=Sx(),s=tb(),c=wx(),l=kb(),u=sg();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),Ex=r(((e,t)=>{function n(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)}t.exports=n})),Dx=r(((e,t)=>{var n=Ex(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),Ox=r(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),kx=r(((e,t)=>{var n=xg();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Ax=r(((e,t)=>{var n=Ox(),r=kx(),i=kb();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),jx=r(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),Mx=r(((e,t)=>{var n=Ax();t.exports=jx()(n)})),Nx=r(((e,t)=>{var n=kb(),r=Dx(),i=Mx();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),Px=r(((e,t)=>{var n=Cg(),r=lb(),i=Qy(),a=_g();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),Fx=e(r(((e,t)=>{var n=hx(),r=Tx(),i=Nx(),a=Px();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})}))());function Ix(e){"@babel/helpers - typeof";return Ix=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Ix(e)}function Lx(){return Lx=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},Lx.apply(this,arguments)}function Rx(e,t){return Cre(e)||Sre(e,t)||Bx(e,t)||zx()}function zx(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
122
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Bx(e,t){if(e){if(typeof e==`string`)return Vx(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 Vx(e,t)}}function Vx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Sre(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Cre(e){if(Array.isArray(e))return e}function Hx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).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?Hx(Object(n),!0).forEach(function(t){wre(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wre(e,t,n){return t=Tre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tre(e){var t=Ere(e,`string`);return Ix(t)==`symbol`?t:t+``}function Ere(e,t){if(Ix(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Ix(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Dre(e){return Array.isArray(e)&&Ug(e[0])&&Ug(e[1])?e.join(` ~ `):e}var Ore=function(e){var t=e.separator,n=t===void 0?` : `:t,r=e.contentStyle,i=r===void 0?{}:r,a=e.itemStyle,o=a===void 0?{}:a,s=e.labelStyle,c=s===void 0?{}:s,l=e.payload,d=e.formatter,f=e.itemSorter,p=e.wrapperClassName,m=e.labelClassName,h=e.label,g=e.labelFormatter,_=e.accessibilityLayer,v=_===void 0?!1:_,y=function(){if(l&&l.length){var e={padding:0,margin:0},t=(f?(0,Fx.default)(l,f):l).map(function(e,t){if(e.type===`none`)return null;var r=Ux({display:`block`,paddingTop:4,paddingBottom:4,color:e.color||`#000`},o),i=e.formatter||d||Dre,a=e.value,s=e.name,c=a,f=s;if(i&&c!=null&&f!=null){var p=i(a,s,e,t,l);if(Array.isArray(p)){var m=Rx(p,2);c=m[0],f=m[1]}else c=p}return u.createElement(`li`,{className:`recharts-tooltip-item`,key:`tooltip-item-${t}`,style:r},Ug(f)?u.createElement(`span`,{className:`recharts-tooltip-item-name`},f):null,Ug(f)?u.createElement(`span`,{className:`recharts-tooltip-item-separator`},n):null,u.createElement(`span`,{className:`recharts-tooltip-item-value`},c),u.createElement(`span`,{className:`recharts-tooltip-item-unit`},e.unit||``))});return u.createElement(`ul`,{className:`recharts-tooltip-item-list`,style:e},t)}return null},b=Ux({margin:0,padding:10,backgroundColor:`#fff`,border:`1px solid #ccc`,whiteSpace:`nowrap`},i),x=Ux({margin:0},c),S=!(0,Bg.default)(h),C=S?h:``,w=Mt(`recharts-default-tooltip`,p),T=Mt(`recharts-tooltip-label`,m);S&&g&&l!=null&&(C=g(h,l));var E=v?{role:`status`,"aria-live":`assertive`}:{};return u.createElement(`div`,Lx({className:w,style:b},E),u.createElement(`p`,{className:T,style:x},u.isValidElement(C)?C:`${C}`),y())};function Wx(e){"@babel/helpers - typeof";return Wx=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Wx(e)}function Gx(e,t,n){return t=kre(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kre(e){var t=Are(e,`string`);return Wx(t)==`symbol`?t:t+``}function Are(e,t){if(Wx(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Wx(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Kx=`recharts-tooltip-wrapper`,jre={visibility:`hidden`};function Mre(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Mt(Kx,Gx(Gx(Gx(Gx({},`${Kx}-right`,q(n)&&t&&q(t.x)&&n>=t.x),`${Kx}-left`,q(n)&&t&&q(t.x)&&n<t.x),`${Kx}-bottom`,q(r)&&t&&q(t.y)&&r>=t.y),`${Kx}-top`,q(r)&&t&&q(t.y)&&r<t.y))}function qx(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,i=e.offsetTopLeft,a=e.position,o=e.reverseDirection,s=e.tooltipDimension,c=e.viewBox,l=e.viewBoxDimension;if(a&&q(a[r]))return a[r];var u=n[r]-s-i,d=n[r]+i;return t[r]?o[r]?u:d:o[r]?u<c[r]?Math.max(d,c[r]):Math.max(u,c[r]):d+s>c[r]+l?Math.max(u,c[r]):Math.max(d,c[r])}function Nre(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?`translate3d(${t}px, ${n}px, 0)`:`translate(${t}px, ${n}px)`}}function Pre(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,i=e.position,a=e.reverseDirection,o=e.tooltipBox,s=e.useTranslate3d,c=e.viewBox,l,u,d;return o.height>0&&o.width>0&&n?(u=qx({allowEscapeViewBox:t,coordinate:n,key:`x`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),d=qx({allowEscapeViewBox:t,coordinate:n,key:`y`,offsetTopLeft:r,position:i,reverseDirection:a,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),l=Nre({translateX:u,translateY:d,useTranslate3d:s})):l=jre,{cssProperties:l,cssClasses:Mre({translateX:u,translateY:d,coordinate:n})}}function Jx(e){"@babel/helpers - typeof";return Jx=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Jx(e)}function Yx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xx(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yx(Object(n),!0).forEach(function(t){tS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yx(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fre(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Zx(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,nS(r.key),r)}}function Ire(e,t,n){return t&&Zx(e.prototype,t),n&&Zx(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Lre(e,t,n){return t=$x(t),Rre(e,Qx()?Reflect.construct(t,n||[],$x(e).constructor):t.apply(e,n))}function Rre(e,t){if(t&&(Jx(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return zre(e)}function zre(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Qx(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Qx=function(){return!!e})()}function $x(e){return $x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$x(e)}function Bre(e,t){if(typeof t!=`function`&&t!==null)throw 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&&eS(e,t)}function eS(e,t){return eS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eS(e,t)}function tS(e,t,n){return t=nS(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nS(e){var t=Vre(e,`string`);return Jx(t)==`symbol`?t:t+``}function Vre(e,t){if(Jx(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Jx(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rS=1,Hre=function(e){function t(){var e;Fre(this,t);var n=[...arguments];return e=Lre(this,t,[].concat(n)),tS(e,`state`,{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),tS(e,`handleKeyDown`,function(t){t.key===`Escape`&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:e.props.coordinate?.x??0,y:e.props.coordinate?.y??0}})}),e}return Bre(t,e),Ire(t,[{key:`updateBBox`,value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>rS||Math.abs(e.height-this.state.lastBoundingBox.height)>rS)&&this.setState({lastBoundingBox:{width:e.width,height:e.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(){this.props.active&&this.updateBBox(),this.state.dismissed&&(this.props.coordinate?.x!==this.state.dismissedAtCoordinate.x||this.props.coordinate?.y!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.children,s=t.coordinate,c=t.hasPayload,l=t.isAnimationActive,d=t.offset,f=t.position,p=t.reverseDirection,m=t.useTranslate3d,h=t.viewBox,g=t.wrapperStyle,_=Pre({allowEscapeViewBox:r,coordinate:s,offsetTopLeft:d,position:f,reverseDirection:p,tooltipBox:this.state.lastBoundingBox,useTranslate3d:m,viewBox:h}),v=_.cssClasses,y=_.cssProperties,b=Xx(Xx({transition:l&&n?`transform ${i}ms ${a}`:void 0},y),{},{pointerEvents:`none`,visibility:!this.state.dismissed&&n&&c?`visible`:`hidden`,position:`absolute`,top:0,left:0},g);return u.createElement(`div`,{tabIndex:-1,className:v,style:b,ref:function(t){e.wrapperNode=t}},o)}}])}(u.PureComponent),iS={isSsr:function(){return!(typeof window<`u`&&window.document&&window.document.createElement&&window.setTimeout)}(),get:function(e){return iS[e]},set:function(e,t){if(typeof e==`string`)iS[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){iS[t]=e[t]})}}};function aS(e){"@babel/helpers - typeof";return aS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},aS(e)}function oS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?oS(Object(n),!0).forEach(function(t){fS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ure(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function cS(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,pS(r.key),r)}}function Wre(e,t,n){return t&&cS(e.prototype,t),n&&cS(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Gre(e,t,n){return t=uS(t),Kre(e,lS()?Reflect.construct(t,n||[],uS(e).constructor):t.apply(e,n))}function Kre(e,t){if(t&&(aS(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return qre(e)}function qre(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function lS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lS=function(){return!!e})()}function uS(e){return uS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},uS(e)}function Jre(e,t){if(typeof t!=`function`&&t!==null)throw 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&&dS(e,t)}function dS(e,t){return dS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},dS(e,t)}function fS(e,t,n){return t=pS(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pS(e){var t=Yre(e,`string`);return aS(t)==`symbol`?t:t+``}function Yre(e,t){if(aS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(aS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Xre(e){return e.dataKey}function Zre(e,t){return u.isValidElement(e)?u.cloneElement(e,t):typeof e==`function`?u.createElement(e,t):u.createElement(Ore,t)}var mS=function(e){function t(){return Ure(this,t),Gre(this,t,arguments)}return Jre(t,e),Wre(t,[{key:`render`,value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,i=t.animationDuration,a=t.animationEasing,o=t.content,s=t.coordinate,c=t.filterNull,l=t.isAnimationActive,d=t.offset,f=t.payload,p=t.payloadUniqBy,m=t.position,h=t.reverseDirection,g=t.useTranslate3d,_=t.viewBox,v=t.wrapperStyle,y=f??[];c&&y.length&&(y=Wb(f.filter(function(t){return t.value!=null&&(t.hide!==!0||e.props.includeHidden)}),p,Xre));var b=y.length>0;return u.createElement(Hre,{allowEscapeViewBox:r,animationDuration:i,animationEasing:a,isAnimationActive:l,active:n,coordinate:s,hasPayload:b,offset:d,position:m,reverseDirection:h,useTranslate3d:g,viewBox:_,wrapperStyle:v},Zre(o,sS(sS({},this.props),{},{payload:y})))}}])}(u.PureComponent);fS(mS,`displayName`,`Tooltip`),fS(mS,`defaultProps`,{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:`ease`,contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!iS.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 Qre=r(((e,t)=>{var n=lg();t.exports=function(){return n.Date.now()}})),$re=r(((e,t)=>{var n=/\s/;function r(e){for(var t=e.length;t--&&n.test(e.charAt(t)););return t}t.exports=r})),eie=r(((e,t)=>{var n=$re(),r=/^\s+/;function i(e){return e&&e.slice(0,n(e)+1).replace(r,``)}t.exports=i})),hS=r(((e,t)=>{var n=eie(),r=_g(),i=hg(),a=NaN,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;function u(e){if(typeof e==`number`)return e;if(i(e))return a;if(r(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=r(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=n(e);var u=s.test(e);return u||c.test(e)?l(e.slice(2),u?2:8):o.test(e)?a:+e}t.exports=u})),tie=r(((e,t)=>{var n=_g(),r=Qre(),i=hS(),a=`Expected a function`,o=Math.max,s=Math.min;function c(e,t,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof e!=`function`)throw TypeError(a);t=i(t)||0,n(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?o(i(c.maxWait)||0,t):d,v=`trailing`in c?!!c.trailing:v);function y(t){var n=l,r=u;return l=u=void 0,h=t,f=e.apply(r,n),f}function b(e){return h=e,p=setTimeout(C,t),g?y(e):f}function x(e){var n=e-m,r=e-h,i=t-n;return _?s(i,d-r):i}function S(e){var n=e-m,r=e-h;return m===void 0||n>=t||n<0||_&&r>=d}function C(){var e=r();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(r())}function D(){var e=r(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,t),y(m)}return p===void 0&&(p=setTimeout(C,t)),f}return D.cancel=T,D.flush=E,D}t.exports=c})),gS=e(r(((e,t)=>{var n=tie(),r=_g(),i=`Expected a function`;function a(e,t,a){var o=!0,s=!0;if(typeof e!=`function`)throw TypeError(i);return r(a)&&(o=`leading`in a?!!a.leading:o,s=`trailing`in a?!!a.trailing:s),n(e,t,{leading:o,maxWait:t,trailing:s})}t.exports=a}))());function _S(e){"@babel/helpers - typeof";return _S=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_S(e)}function vS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vS(Object(n),!0).forEach(function(t){nie(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nie(e,t,n){return t=rie(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rie(e){var t=iie(e,`string`);return _S(t)==`symbol`?t:t+``}function iie(e,t){if(_S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function aie(e,t){return lie(e)||cie(e,t)||sie(e,t)||oie()}function oie(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
123
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sie(e,t){if(e){if(typeof e==`string`)return bS(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 bS(e,t)}}function bS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function cie(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function lie(e){if(Array.isArray(e))return e}var xS=(0,u.forwardRef)(function(e,t){var n=e.aspect,r=e.initialDimension,i=r===void 0?{width:-1,height:-1}:r,a=e.width,o=a===void 0?`100%`:a,s=e.height,c=s===void 0?`100%`:s,l=e.minWidth,d=l===void 0?0:l,f=e.minHeight,p=e.maxHeight,m=e.children,h=e.debounce,g=h===void 0?0:h,_=e.id,v=e.className,y=e.onResize,b=e.style,x=b===void 0?{}:b,S=(0,u.useRef)(null),C=(0,u.useRef)();C.current=y,(0,u.useImperativeHandle)(t,function(){return Object.defineProperty(S.current,`current`,{get:function(){return console.warn(`The usage of ref.current.current is deprecated and will no longer be supported.`),S.current},configurable:!0})});var w=aie((0,u.useState)({containerWidth:i.width,containerHeight:i.height}),2),T=w[0],E=w[1],D=(0,u.useCallback)(function(e,t){E(function(n){var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,u.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,i=n.height;D(r,i),(t=C.current)==null||t.call(C,r,i)};g>0&&(e=(0,gS.default)(e,g,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=S.current.getBoundingClientRect(),r=n.width,i=n.height;return D(r,i),t.observe(S.current),function(){t.disconnect()}},[D,g]);var O=(0,u.useMemo)(function(){var e=T.containerWidth,t=T.containerHeight;if(e<0||t<0)return null;x_(Hg(o)||Hg(c),`The width(%s) and height(%s) are both fixed numbers,
124
+ maybe you don't need to use a ResponsiveContainer.`,o,c),x_(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var r=Hg(o)?e:o,i=Hg(c)?t:c;n&&n>0&&(r?i=r/n:i&&(r=i*n),p&&i>p&&(i=p)),x_(r>0||i>0,`The width(%s) and height(%s) of chart should be greater than 0,
125
+ please check the style of container, or the props width(%s) and height(%s),
126
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
127
+ height and width.`,r,i,o,c,d,f,n);var a=!Array.isArray(m)&&o_(m.type).endsWith(`Chart`);return u.Children.map(m,function(e){return u.isValidElement(e)?(0,u.cloneElement)(e,yS({width:r,height:i},a?{style:yS({height:`100%`,width:`100%`,maxHeight:i,maxWidth:r},e.props.style)}:{})):e})},[n,m,c,p,f,d,T,o]);return u.createElement(`div`,{id:_?`${_}`:void 0,className:Mt(`recharts-responsive-container`,v),style:yS(yS({},x),{},{width:o,height:c,minWidth:d,minHeight:f,maxHeight:p}),ref:S},O)}),SS=function(e){return null};SS.displayName=`Cell`;function CS(e){"@babel/helpers - typeof";return CS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},CS(e)}function wS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function TS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wS(Object(n),!0).forEach(function(t){uie(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uie(e,t,n){return t=die(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function die(e){var t=fie(e,`string`);return CS(t)==`symbol`?t:t+``}function fie(e,t){if(CS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(CS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ES={widthCache:{},cacheCount:0},pie=2e3,mie={position:`absolute`,top:`-20000px`,left:0,padding:0,margin:0,border:`none`,whiteSpace:`pre`},DS=`recharts_measurement_span`;function hie(e){var t=TS({},e);return Object.keys(t).forEach(function(e){t[e]||delete t[e]}),t}var OS=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||iS.isSsr)return{width:0,height:0};var n=hie(t),r=JSON.stringify({text:e,copyStyle:n});if(ES.widthCache[r])return ES.widthCache[r];try{var i=document.getElementById(DS);i||(i=document.createElement(`span`),i.setAttribute(`id`,DS),i.setAttribute(`aria-hidden`,`true`),document.body.appendChild(i));var a=TS(TS({},mie),n);Object.assign(i.style,a),i.textContent=`${e}`;var o=i.getBoundingClientRect(),s={width:o.width,height:o.height};return ES.widthCache[r]=s,++ES.cacheCount>pie&&(ES.cacheCount=0,ES.widthCache={}),s}catch{return{width:0,height:0}}},gie=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function kS(e){"@babel/helpers - typeof";return kS=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kS(e)}function AS(e,t){return bie(e)||yie(e,t)||vie(e,t)||_ie()}function _ie(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
128
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vie(e,t){if(e){if(typeof e==`string`)return jS(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 jS(e,t)}}function jS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yie(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function bie(e){if(Array.isArray(e))return e}function xie(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function MS(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,Cie(r.key),r)}}function Sie(e,t,n){return t&&MS(e.prototype,t),n&&MS(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Cie(e){var t=wie(e,`string`);return kS(t)==`symbol`?t:t+``}function wie(e,t){if(kS(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kS(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var NS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,PS=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Tie=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Eie=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,FS={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Die=Object.keys(FS),IS=`NaN`;function Oie(e,t){return e*FS[t]}var LS=function(){function e(t,n){xie(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=``),n!==``&&!Tie.test(n)&&(this.num=NaN,this.unit=``),Die.includes(n)&&(this.num=Oie(t,n),this.unit=`px`)}return Sie(e,[{key:`add`,value:function(t){return this.unit===t.unit?new e(this.num+t.num,this.unit):new e(NaN,``)}},{key:`subtract`,value:function(t){return this.unit===t.unit?new e(this.num-t.num,this.unit):new e(NaN,``)}},{key:`multiply`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num*t.num,this.unit||t.unit)}},{key:`divide`,value:function(t){return this.unit!==``&&t.unit!==``&&this.unit!==t.unit?new e(NaN,``):new e(this.num/t.num,this.unit||t.unit)}},{key:`toString`,value:function(){return`${this.num}${this.unit}`}},{key:`isNaN`,value:function(){return Number.isNaN(this.num)}}],[{key:`parse`,value:function(t){var n=AS(Eie.exec(t)??[],3),r=n[1],i=n[2];return new e(parseFloat(r),i??``)}}])}();function RS(e){if(e.includes(IS))return IS;for(var t=e;t.includes(`*`)||t.includes(`/`);){var n=AS(NS.exec(t)??[],4),r=n[1],i=n[2],a=n[3],o=LS.parse(r??``),s=LS.parse(a??``),c=i===`*`?o.multiply(s):o.divide(s);if(c.isNaN())return IS;t=t.replace(NS,c.toString())}for(;t.includes(`+`)||/.-\d+(?:\.\d+)?/.test(t);){var l=AS(PS.exec(t)??[],4),u=l[1],d=l[2],f=l[3],p=LS.parse(u??``),m=LS.parse(f??``),h=d===`+`?p.add(m):p.subtract(m);if(h.isNaN())return IS;t=t.replace(PS,h.toString())}return t}var zS=/\(([^()]*)\)/;function kie(e){for(var t=e;t.includes(`(`);){var n=AS(zS.exec(t),2)[1];t=t.replace(zS,RS(n))}return t}function Aie(e){var t=e.replace(/\s+/g,``);return t=kie(t),t=RS(t),t}function jie(e){try{return Aie(e)}catch{return IS}}function BS(e){var t=jie(e.slice(5,-1));return t===IS?``:t}var Mie=[`x`,`y`,`lineHeight`,`capHeight`,`scaleToFit`,`textAnchor`,`verticalAnchor`,`fill`],Nie=[`dx`,`dy`,`angle`,`className`,`breakAll`];function VS(){return VS=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},VS.apply(this,arguments)}function HS(e,t){if(e==null)return{};var n=Pie(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pie(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 US(e,t){return Rie(e)||Lie(e,t)||Iie(e,t)||Fie()}function Fie(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
129
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iie(e,t){if(e){if(typeof e==`string`)return WS(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 WS(e,t)}}function WS(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Lie(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Rie(e){if(Array.isArray(e))return e}var GS=/[ \f\n\r\t\v\u2028\u2029]+/,KS=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var i=[];return(0,Bg.default)(t)||(i=n?t.toString().split(``):t.toString().split(GS)),{wordsWithComputedWidth:i.map(function(e){return{word:e,width:OS(e,r).width}}),spaceWidth:n?0:OS(`\xA0`,r).width}}catch{return null}},zie=function(e,t,n,r,i){var a=e.maxLines,o=e.children,s=e.style,c=e.breakAll,l=q(a),u=o,d=function(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(e,t){var a=t.word,o=t.width,s=e[e.length-1];if(s&&(r==null||i||s.width+o+n<Number(r)))s.words.push(a),s.width+=o+n;else{var c={words:[a],width:o};e.push(c)}return e},[])},f=d(t),p=function(e){return e.reduce(function(e,t){return e.width>t.width?e:t})};if(!l)return f;for(var m=`…`,h=function(e){var t=KS({breakAll:c,style:s,children:u.slice(0,e)+m}).wordsWithComputedWidth,n=d(t);return[n.length>a||p(n).width>Number(r),n]},g=0,_=u.length-1,v=0,y;g<=_&&v<=u.length-1;){var b=Math.floor((g+_)/2),x=US(h(b-1),2),S=x[0],C=x[1],w=US(h(b),1)[0];if(!S&&!w&&(g=b+1),S&&w&&(_=b-1),!S&&w){y=C;break}v++}return y||f},qS=function(e){return[{words:(0,Bg.default)(e)?[]:e.toString().split(GS)}]},Bie=function(e){var t=e.width,n=e.scaleToFit,r=e.children,i=e.style,a=e.breakAll,o=e.maxLines;if((t||n)&&!iS.isSsr){var s,c,l=KS({breakAll:a,children:r,style:i});if(l){var u=l.wordsWithComputedWidth,d=l.spaceWidth;s=u,c=d}else return qS(r);return zie({breakAll:a,children:r,maxLines:o,style:i},s,c,t,n)}return qS(r)},JS=`#808080`,YS=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.lineHeight,o=a===void 0?`1em`:a,s=e.capHeight,c=s===void 0?`0.71em`:s,l=e.scaleToFit,d=l===void 0?!1:l,f=e.textAnchor,p=f===void 0?`start`:f,m=e.verticalAnchor,h=m===void 0?`end`:m,g=e.fill,_=g===void 0?JS:g,v=HS(e,Mie),y=(0,u.useMemo)(function(){return Bie({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:d,style:v.style,width:v.width})},[v.breakAll,v.children,v.maxLines,d,v.style,v.width]),b=v.dx,x=v.dy,S=v.angle,C=v.className,w=v.breakAll,T=HS(v,Nie);if(!Ug(n)||!Ug(i))return null;var E=n+(q(b)?b:0),D=i+(q(x)?x:0),O;switch(h){case`start`:O=BS(`calc(${c})`);break;case`middle`:O=BS(`calc(${(y.length-1)/2} * -${o} + (${c} / 2))`);break;default:O=BS(`calc(${y.length-1} * -${o})`);break}var k=[];if(d){var A=y[0].width,j=v.width;k.push(`scale(${(q(j)?j/A:1)/A})`)}return S&&k.push(`rotate(${S}, ${E}, ${D})`),k.length&&(T.transform=k.join(` `)),u.createElement(`text`,VS({},J(T,!0),{x:E,y:D,className:Mt(`recharts-text`,C),textAnchor:p,fill:_.includes(`url`)?JS:_}),y.map(function(e,t){var n=e.words.join(w?``:` `);return u.createElement(`tspan`,{x:E,dy:t===0?O:o,key:`${n}-${t}`},n)}))};function XS(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Vie(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function ZS(e){let t,n,r;e.length===2?(t=e===XS||e===Vie?e:Hie,n=e,r=e):(t=XS,n=(t,n)=>XS(e(t),n),r=(t,n)=>e(t)-n);function i(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<0?i=t+1:a=t}while(i<a)}return i}function a(e,r,i=0,a=e.length){if(i<a){if(t(r,r)!==0)return a;do{let t=i+a>>>1;n(e[t],r)<=0?i=t+1:a=t}while(i<a)}return i}function o(e,t,n=0,a=e.length){let o=i(e,t,n,a-1);return o>n&&r(e[o-1],t)>-r(e[o],t)?o-1:o}return{left:i,center:o,right:a}}function Hie(){return 0}function QS(e){return e===null?NaN:+e}function*Uie(e,t){if(t===void 0)for(let t of e)t!=null&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}var $S=ZS(XS),eC=$S.right;$S.left,ZS(QS).center;var tC=class extends Map{constructor(e,t=Kie){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(let[t,n]of e)this.set(t,n)}get(e){return super.get(nC(this,e))}has(e){return super.has(nC(this,e))}set(e,t){return super.set(Wie(this,e),t)}delete(e){return super.delete(Gie(this,e))}};function nC({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):n}function Wie({_intern:e,_key:t},n){let r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function Gie({_intern:e,_key:t},n){let r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function Kie(e){return typeof e==`object`&&e?e.valueOf():e}function qie(e=XS){if(e===XS)return rC;if(typeof e!=`function`)throw TypeError(`compare is not a function`);return(t,n)=>{let r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function rC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}var Jie=Math.sqrt(50),Yie=Math.sqrt(10),Xie=Math.sqrt(2);function iC(e,t,n){let r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/10**i,o=a>=Jie?10:a>=Yie?5:a>=Xie?2:1,s,c,l;return i<0?(l=10**-i/o,s=Math.round(e*l),c=Math.round(t*l),s/l<e&&++s,c/l>t&&--c,l=-l):(l=10**i*o,s=Math.round(e/l),c=Math.round(t/l),s*l<e&&++s,c*l>t&&--c),c<s&&.5<=n&&n<2?iC(e,t,n*2):[s,c,l]}function aC(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];let r=t<e,[i,a,o]=r?iC(t,e,n):iC(e,t,n);if(!(a>=i))return[];let s=a-i+1,c=Array(s);if(r)if(o<0)for(let e=0;e<s;++e)c[e]=(a-e)/-o;else for(let e=0;e<s;++e)c[e]=(a-e)*o;else if(o<0)for(let e=0;e<s;++e)c[e]=(i+e)/-o;else for(let e=0;e<s;++e)c[e]=(i+e)*o;return c}function oC(e,t,n){return t=+t,e=+e,n=+n,iC(e,t,n)[2]}function sC(e,t,n){t=+t,e=+e,n=+n;let r=t<e,i=r?oC(t,e,n):oC(e,t,n);return(r?-1:1)*(i<0?1/-i:i)}function cC(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n<t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function lC(e,t){let n;if(t===void 0)for(let t of e)t!=null&&(n>t||n===void 0&&t>=t)&&(n=t);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function uC(e,t,n=0,r=1/0,i){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(i=i===void 0?rC:qie(i);r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1),u=Math.max(n,Math.floor(t-o*c/a+l)),d=Math.min(r,Math.floor(t+(a-o)*c/a+l));uC(e,t,u,d,i)}let a=e[t],o=n,s=r;for(dC(e,n,t),i(e[r],a)>0&&dC(e,n,r);o<s;){for(dC(e,o,s),++o,--s;i(e[o],a)<0;)++o;for(;i(e[s],a)>0;)--s}i(e[n],a)===0?dC(e,n,s):(++s,dC(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function dC(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Zie(e,t,n){if(e=Float64Array.from(Uie(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return lC(e);if(t>=1)return cC(e);var r,i=(r-1)*t,a=Math.floor(i),o=cC(uC(e,a).subarray(0,a+1));return o+(lC(e.subarray(a+1))-o)*(i-a)}}function Qie(e,t,n=QS){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,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e);return o+(+n(e[a+1],a+1,e)-o)*(i-a)}}function $ie(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,a=Array(i);++r<i;)a[r]=e+r*n;return a}function fC(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e);break}return this}function pC(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}var mC=Symbol(`implicit`);function hC(){var e=new tC,t=[],n=[],r=mC;function i(i){let a=e.get(i);if(a===void 0){if(r!==mC)return r;e.set(i,a=t.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new tC;for(let r of n)e.has(r)||e.set(r,t.push(r)-1);return i},i.range=function(e){return arguments.length?(n=Array.from(e),i):n.slice()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return hC(t,n).unknown(r)},fC.apply(i,arguments),i}function gC(){var e=hC().unknown(void 0),t=e.domain,n=e.range,r=0,i=1,a,o,s=!1,c=0,l=0,u=.5;delete e.unknown;function d(){var e=t().length,d=i<r,f=d?i:r,p=d?r:i;a=(p-f)/Math.max(1,e-c+l*2),s&&(a=Math.floor(a)),f+=(p-f-a*(e-c))*u,o=a*(1-c),s&&(f=Math.round(f),o=Math.round(o));var m=$ie(e).map(function(e){return f+a*e});return n(d?m.reverse():m)}return e.domain=function(e){return arguments.length?(t(e),d()):t()},e.range=function(e){return arguments.length?([r,i]=e,r=+r,i=+i,d()):[r,i]},e.rangeRound=function(e){return[r,i]=e,r=+r,i=+i,s=!0,d()},e.bandwidth=function(){return o},e.step=function(){return a},e.round=function(e){return arguments.length?(s=!!e,d()):s},e.padding=function(e){return arguments.length?(c=Math.min(1,l=+e),d()):c},e.paddingInner=function(e){return arguments.length?(c=Math.min(1,e),d()):c},e.paddingOuter=function(e){return arguments.length?(l=+e,d()):l},e.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},e.copy=function(){return gC(t(),[r,i]).round(s).paddingInner(c).paddingOuter(l).align(u)},fC.apply(d(),arguments)}function _C(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return _C(t())},e}function vC(){return _C(gC.apply(null,arguments).paddingInner(1))}function yC(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function bC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function xC(){}var SC=.7,CC=1/SC,wC=`\\s*([+-]?\\d+)\\s*`,TC=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,EC=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,eae=/^#([0-9a-f]{3,8})$/,tae=RegExp(`^rgb\\(${wC},${wC},${wC}\\)$`),nae=RegExp(`^rgb\\(${EC},${EC},${EC}\\)$`),rae=RegExp(`^rgba\\(${wC},${wC},${wC},${TC}\\)$`),iae=RegExp(`^rgba\\(${EC},${EC},${EC},${TC}\\)$`),aae=RegExp(`^hsl\\(${TC},${EC},${EC}\\)$`),oae=RegExp(`^hsla\\(${TC},${EC},${EC},${TC}\\)$`),DC={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};yC(xC,AC,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:OC,formatHex:OC,formatHex8:sae,formatHsl:cae,formatRgb:kC,toString:kC});function OC(){return this.rgb().formatHex()}function sae(){return this.rgb().formatHex8()}function cae(){return VC(this).formatHsl()}function kC(){return this.rgb().formatRgb()}function AC(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=eae.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?jC(t):n===3?new PC(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?MC(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?MC(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=tae.exec(e))?new PC(t[1],t[2],t[3],1):(t=nae.exec(e))?new PC(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=rae.exec(e))?MC(t[1],t[2],t[3],t[4]):(t=iae.exec(e))?MC(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=aae.exec(e))?BC(t[1],t[2]/100,t[3]/100,1):(t=oae.exec(e))?BC(t[1],t[2]/100,t[3]/100,t[4]):DC.hasOwnProperty(e)?jC(DC[e]):e===`transparent`?new PC(NaN,NaN,NaN,0):null}function jC(e){return new PC(e>>16&255,e>>8&255,e&255,1)}function MC(e,t,n,r){return r<=0&&(e=t=n=NaN),new PC(e,t,n,r)}function lae(e){return e instanceof xC||(e=AC(e)),e?(e=e.rgb(),new PC(e.r,e.g,e.b,e.opacity)):new PC}function NC(e,t,n,r){return arguments.length===1?lae(e):new PC(e,t,n,r??1)}function PC(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}yC(PC,NC,bC(xC,{brighter(e){return e=e==null?CC:CC**+e,new PC(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?SC:SC**+e,new PC(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new PC(RC(this.r),RC(this.g),RC(this.b),LC(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:FC,formatHex:FC,formatHex8:uae,formatRgb:IC,toString:IC}));function FC(){return`#${zC(this.r)}${zC(this.g)}${zC(this.b)}`}function uae(){return`#${zC(this.r)}${zC(this.g)}${zC(this.b)}${zC((isNaN(this.opacity)?1:this.opacity)*255)}`}function IC(){let e=LC(this.opacity);return`${e===1?`rgb(`:`rgba(`}${RC(this.r)}, ${RC(this.g)}, ${RC(this.b)}${e===1?`)`:`, ${e})`}`}function LC(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function RC(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function zC(e){return e=RC(e),(e<16?`0`:``)+e.toString(16)}function BC(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new HC(e,t,n,r)}function VC(e){if(e instanceof HC)return new HC(e.h,e.s,e.l,e.opacity);if(e instanceof xC||(e=AC(e)),!e)return new HC;if(e instanceof HC)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new HC(o,s,c,e.opacity)}function dae(e,t,n,r){return arguments.length===1?VC(e):new HC(e,t,n,r??1)}function HC(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}yC(HC,dae,bC(xC,{brighter(e){return e=e==null?CC:CC**+e,new HC(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?SC:SC**+e,new HC(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,i=2*n-r;return new PC(GC(e>=240?e-240:e+120,i,r),GC(e,i,r),GC(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new HC(UC(this.h),WC(this.s),WC(this.l),LC(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(){let e=LC(this.opacity);return`${e===1?`hsl(`:`hsla(`}${UC(this.h)}, ${WC(this.s)*100}%, ${WC(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function UC(e){return e=(e||0)%360,e<0?e+360:e}function WC(e){return Math.max(0,Math.min(1,e||0))}function GC(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var KC=e=>()=>e;function fae(e,t){return function(n){return e+n*t}}function pae(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function mae(e){return(e=+e)==1?qC:function(t,n){return n-t?pae(t,n,e):KC(isNaN(t)?n:t)}}function qC(e,t){var n=t-e;return n?fae(e,n):KC(isNaN(e)?t:e)}var JC=(function e(t){var n=mae(t);function r(e,t){var r=n((e=NC(e)).r,(t=NC(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=qC(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function hae(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function gae(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function _ae(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o;for(o=0;o<r;++o)i[o]=$C(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function vae(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function YC(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function yae(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=$C(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var XC=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ZC=new RegExp(XC.source,`g`);function bae(e){return function(){return e}}function xae(e){return function(t){return e(t)+``}}function QC(e,t){var n=XC.lastIndex=ZC.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=XC.exec(e))&&(i=ZC.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:YC(r,i)})),n=ZC.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?xae(c[0].x):bae(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function $C(e,t){var n=typeof t,r;return t==null||n===`boolean`?KC(t):(n===`number`?YC:n===`string`?(r=AC(t))?(t=r,JC):QC:t instanceof AC?JC:t instanceof Date?vae:gae(t)?hae:Array.isArray(t)?_ae:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?yae:YC)(e,t)}function ew(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function Sae(e,t){t===void 0&&(t=e,e=$C);for(var n=0,r=t.length-1,i=t[0],a=Array(r<0?0:r);n<r;)a[n]=e(i,i=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return a[t](e-t)}}function Cae(e){return function(){return e}}function tw(e){return+e}var nw=[0,1];function rw(e){return e}function iw(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:Cae(isNaN(t)?NaN:.5)}function wae(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}function Tae(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i<r?(r=iw(i,r),a=n(o,a)):(r=iw(r,i),a=n(a,o)),function(e){return a(r(e))}}function Eae(e,t,n){var r=Math.min(e.length,t.length)-1,i=Array(r),a=Array(r),o=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++o<r;)i[o]=iw(e[o],e[o+1]),a[o]=n(t[o],t[o+1]);return function(t){var n=eC(e,t,1,r)-1;return a[n](i[n](t))}}function aw(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function ow(){var e=nw,t=nw,n=$C,r,i,a,o=rw,s,c,l;function u(){var n=Math.min(e.length,t.length);return o!==rw&&(o=wae(e[0],e[n-1])),s=n>2?Eae:Tae,c=l=null,d}function d(i){return i==null||isNaN(i=+i)?a:(c||=s(e.map(r),t,n))(r(o(i)))}return d.invert=function(n){return o(i((l||=s(t,e.map(r),YC))(n)))},d.domain=function(t){return arguments.length?(e=Array.from(t,tw),u()):e.slice()},d.range=function(e){return arguments.length?(t=Array.from(e),u()):t.slice()},d.rangeRound=function(e){return t=Array.from(e),n=ew,u()},d.clamp=function(e){return arguments.length?(o=e?!0:rw,u()):o!==rw},d.interpolate=function(e){return arguments.length?(n=e,u()):n},d.unknown=function(e){return arguments.length?(a=e,d):a},function(e,t){return r=e,i=t,u()}}function sw(){return ow()(rw,rw)}function Dae(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function cw(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function lw(e){return e=cw(Math.abs(e)),e?e[1]:NaN}function Oae(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function kae(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var Aae=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function uw(e){if(!(t=Aae.exec(e)))throw Error(`invalid format: `+e);var t;return new dw({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]})}uw.prototype=dw.prototype;function dw(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+``}dw.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 jae(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var fw;function Mae(e,t){var n=cw(e,t);if(!n)return fw=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(fw=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+Array(a-o+1).join(`0`):a>0?r.slice(0,a)+`.`+r.slice(a):`0.`+Array(1-a).join(`0`)+cw(e,Math.max(0,t+a-1))[0]}function pw(e,t){var n=cw(e,t);if(!n)return e+``;var r=n[0],i=n[1];return i<0?`0.`+Array(-i).join(`0`)+r:r.length>i+1?r.slice(0,i+1)+`.`+r.slice(i+1):r+Array(i-r.length+2).join(`0`)}var mw={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:Dae,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)=>pw(e*100,t),r:pw,s:Mae,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function hw(e){return e}var gw=Array.prototype.map,_w=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function vw(e){var t=e.grouping===void 0||e.thousands===void 0?hw:Oae(gw.call(e.grouping,Number),e.thousands+``),n=e.currency===void 0?``:e.currency[0]+``,r=e.currency===void 0?``:e.currency[1]+``,i=e.decimal===void 0?`.`:e.decimal+``,a=e.numerals===void 0?hw:kae(gw.call(e.numerals,String)),o=e.percent===void 0?`%`:e.percent+``,s=e.minus===void 0?`−`:e.minus+``,c=e.nan===void 0?`NaN`:e.nan+``;function l(e,l){e=uw(e);var u=e.fill,d=e.align,f=e.sign,p=e.symbol,m=e.zero,h=e.width,g=e.comma,_=e.precision,v=e.trim,y=e.type;y===`n`?(g=!0,y=`g`):mw[y]||(_===void 0&&(_=12),v=!0,y=`g`),(m||u===`0`&&d===`=`)&&(m=!0,u=`0`,d=`=`);var b=(l&&l.prefix!==void 0?l.prefix:``)+(p===`$`?n:p===`#`&&/[boxX]/.test(y)?`0`+y.toLowerCase():``),x=(p===`$`?r:/[%p]/.test(y)?o:``)+(l&&l.suffix!==void 0?l.suffix:``),S=mw[y],C=/[defgprs%]/.test(y);_=_===void 0?6:/[gprs]/.test(y)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_));function w(e){var n=b,r=x,o,l,p;if(y===`c`)r=S(e)+r,e=``;else{e=+e;var w=e<0||1/e<0;if(e=isNaN(e)?c:S(Math.abs(e),_),v&&(e=jae(e)),w&&+e==0&&f!==`+`&&(w=!1),n=(w?f===`(`?f:s:f===`-`||f===`(`?``:f)+n,r=(y===`s`&&!isNaN(e)&&fw!==void 0?_w[8+fw/3]:``)+r+(w&&f===`(`?`)`:``),C){for(o=-1,l=e.length;++o<l;)if(p=e.charCodeAt(o),48>p||p>57){r=(p===46?i+e.slice(o+1):e.slice(o))+r,e=e.slice(0,o);break}}}g&&!m&&(e=t(e,1/0));var T=n.length+e.length+r.length,E=T<h?Array(h-T+1).join(u):``;switch(g&&m&&(e=t(E+e,E.length?h-r.length:1/0),E=``),d){case`<`:e=n+e+r+E;break;case`=`:e=n+E+e+r;break;case`^`:e=E.slice(0,T=E.length>>1)+n+e+r+E.slice(T);break;default:e=E+n+e+r;break}return a(e)}return w.toString=function(){return e+``},w}function u(e,t){var n=Math.max(-8,Math.min(8,Math.floor(lw(t)/3)))*3,r=10**-n,i=l((e=uw(e),e.type=`f`,e),{suffix:_w[8+n/3]});return function(e){return i(r*e)}}return{format:l,formatPrefix:u}}var yw,bw,xw;Nae({thousands:`,`,grouping:[3],currency:[`$`,``]});function Nae(e){return yw=vw(e),bw=yw.format,xw=yw.formatPrefix,yw}function Pae(e){return Math.max(0,-lw(Math.abs(e)))}function Fae(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(lw(t)/3)))*3-lw(Math.abs(e)))}function Iae(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,lw(t)-lw(e))+1}function Sw(e,t,n,r){var i=sC(e,t,n),a;switch(r=uw(r??`,f`),r.type){case`s`:var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Fae(i,o))&&(r.precision=a),xw(r,o);case``:case`e`:case`g`:case`p`:case`r`:r.precision==null&&!isNaN(a=Iae(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type===`e`));break;case`f`:case`%`:r.precision==null&&!isNaN(a=Pae(i))&&(r.precision=a-(r.type===`%`)*2);break}return bw(r)}function Cw(e){var t=e.domain;return e.ticks=function(e){var n=t();return aC(n[0],n[n.length-1],e??10)},e.tickFormat=function(e,n){var r=t();return Sw(r[0],r[r.length-1],e??10,n)},e.nice=function(n){n??=10;var r=t(),i=0,a=r.length-1,o=r[i],s=r[a],c,l,u=10;for(s<o&&(l=o,o=s,s=l,l=i,i=a,a=l);u-- >0;){if(l=oC(o,s,n),l===c)return r[i]=o,r[a]=s,t(r);if(l>0)o=Math.floor(o/l)*l,s=Math.ceil(s/l)*l;else if(l<0)o=Math.ceil(o*l)/l,s=Math.floor(s*l)/l;else break;c=l}return e},e}function ww(){var e=sw();return e.copy=function(){return aw(e,ww())},fC.apply(e,arguments),Cw(e)}function Tw(e){var t;function n(e){return e==null||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,tw),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return Tw(e).unknown(t)},e=arguments.length?Array.from(e,tw):[0,1],Cw(n)}function Ew(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return a<i&&(o=n,n=r,r=o,o=i,i=a,a=o),e[n]=t.floor(i),e[r]=t.ceil(a),e}function Dw(e){return Math.log(e)}function Ow(e){return Math.exp(e)}function Lae(e){return-Math.log(-e)}function kw(e){return-Math.exp(-e)}function Aw(e){return isFinite(e)?+(`1e`+e):e<0?0:e}function jw(e){return e===10?Aw:e===Math.E?Math.exp:t=>e**+t}function Mw(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 Nw(e){return(t,n)=>-e(-t,n)}function Pw(e){let t=e(Dw,Ow),n=t.domain,r=10,i,a;function o(){return i=Mw(r),a=jw(r),n()[0]<0?(i=Nw(i),a=Nw(a),e(Lae,kw)):e(Dw,Ow),t}return t.base=function(e){return arguments.length?(r=+e,o()):r},t.domain=function(e){return arguments.length?(n(e),o()):n()},t.ticks=e=>{let t=n(),o=t[0],s=t[t.length-1],c=s<o;c&&([o,s]=[s,o]);let l=i(o),u=i(s),d,f,p=e==null?10:+e,m=[];if(!(r%1)&&u-l<p){if(l=Math.floor(l),u=Math.ceil(u),o>0){for(;l<=u;++l)for(d=1;d<r;++d)if(f=l<0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}}else for(;l<=u;++l)for(d=r-1;d>=1;--d)if(f=l>0?d/a(-l):d*a(l),!(f<o)){if(f>s)break;m.push(f)}m.length*2<p&&(m=aC(o,s,p))}else m=aC(l,u,Math.min(u-l,p)).map(a);return c?m.reverse():m},t.tickFormat=(e,n)=>{if(e??=10,n??=r===10?`s`:`,`,typeof n!=`function`&&(!(r%1)&&(n=uw(n)).precision==null&&(n.trim=!0),n=bw(n)),e===1/0)return n;let o=Math.max(1,r*e/t.ticks().length);return e=>{let t=e/a(Math.round(i(e)));return t*r<r-.5&&(t*=r),t<=o?n(e):``}},t.nice=()=>n(Ew(n(),{floor:e=>a(Math.floor(i(e))),ceil:e=>a(Math.ceil(i(e)))})),t}function Fw(){let e=Pw(ow()).domain([1,10]);return e.copy=()=>aw(e,Fw()).base(e.base()),fC.apply(e,arguments),e}function Iw(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function Lw(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Rw(e){var t=1,n=e(Iw(t),Lw(t));return n.constant=function(n){return arguments.length?e(Iw(t=+n),Lw(t)):t},Cw(n)}function zw(){var e=Rw(ow());return e.copy=function(){return aw(e,zw()).constant(e.constant())},fC.apply(e,arguments)}function Bw(e){return function(t){return t<0?-((-t)**+e):t**+e}}function Rae(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function zae(e){return e<0?-e*e:e*e}function Vw(e){var t=e(rw,rw),n=1;function r(){return n===1?e(rw,rw):n===.5?e(Rae,zae):e(Bw(n),Bw(1/n))}return t.exponent=function(e){return arguments.length?(n=+e,r()):n},Cw(t)}function Hw(){var e=Vw(ow());return e.copy=function(){return aw(e,Hw()).exponent(e.exponent())},fC.apply(e,arguments),e}function Uw(){return Hw.apply(null,arguments).exponent(.5)}function Ww(e){return Math.sign(e)*e*e}function Gw(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function Kw(){var e=sw(),t=[0,1],n=!1,r;function i(t){var i=Gw(e(t));return isNaN(i)?r:n?Math.round(i):i}return i.invert=function(t){return e.invert(Ww(t))},i.domain=function(t){return arguments.length?(e.domain(t),i):e.domain()},i.range=function(n){return arguments.length?(e.range((t=Array.from(n,tw)).map(Ww)),i):t.slice()},i.rangeRound=function(e){return i.range(e).round(!0)},i.round=function(e){return arguments.length?(n=!!e,i):n},i.clamp=function(t){return arguments.length?(e.clamp(t),i):e.clamp()},i.unknown=function(e){return arguments.length?(r=e,i):r},i.copy=function(){return Kw(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},fC.apply(i,arguments),Cw(i)}function qw(){var e=[],t=[],n=[],r;function i(){var r=0,i=Math.max(1,t.length);for(n=Array(i-1);++r<i;)n[r-1]=Qie(e,r/i);return a}function a(e){return e==null||isNaN(e=+e)?r:t[eC(n,e)]}return a.invertExtent=function(r){var i=t.indexOf(r);return i<0?[NaN,NaN]:[i>0?n[i-1]:e[0],i<n.length?n[i]:e[e.length-1]]},a.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(XS),i()},a.range=function(e){return arguments.length?(t=Array.from(e),i()):t.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.quantiles=function(){return n.slice()},a.copy=function(){return qw().domain(e).range(t).unknown(r)},fC.apply(a,arguments)}function Jw(){var e=0,t=1,n=1,r=[.5],i=[0,1],a;function o(e){return e!=null&&e<=e?i[eC(r,e,0,n)]:a}function s(){var i=-1;for(r=Array(n);++i<n;)r[i]=((i+1)*t-(i-n)*e)/(n+1);return o}return o.domain=function(n){return arguments.length?([e,t]=n,e=+e,t=+t,s()):[e,t]},o.range=function(e){return arguments.length?(n=(i=Array.from(e)).length-1,s()):i.slice()},o.invertExtent=function(a){var o=i.indexOf(a);return o<0?[NaN,NaN]:o<1?[e,r[0]]:o>=n?[r[n-1],t]:[r[o-1],r[o]]},o.unknown=function(e){return arguments.length&&(a=e),o},o.thresholds=function(){return r.slice()},o.copy=function(){return Jw().domain([e,t]).range(i).unknown(a)},fC.apply(Cw(o),arguments)}function Yw(){var e=[.5],t=[0,1],n,r=1;function i(i){return i!=null&&i<=i?t[eC(e,i,0,r)]:n}return i.domain=function(n){return arguments.length?(e=Array.from(n),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(n){return arguments.length?(t=Array.from(n),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(n){var r=t.indexOf(n);return[e[r-1],e[r]]},i.unknown=function(e){return arguments.length?(n=e,i):n},i.copy=function(){return Yw().domain(e).range(t).unknown(n)},fC.apply(i,arguments)}var Xw=new Date,Zw=new Date;function Qw(e,t,n,r){function i(t){return e(t=arguments.length===0?new Date:new Date(+t)),t}return i.floor=t=>(e(t=new Date(+t)),t),i.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),i.round=e=>{let t=i(e),n=i.ceil(e);return e-t<n-e?t:n},i.offset=(e,n)=>(t(e=new Date(+e),n==null?1:Math.floor(n)),e),i.range=(n,r,a)=>{let o=[];if(n=i.ceil(n),a=a==null?1:Math.floor(a),!(n<r)||!(a>0))return o;let s;do o.push(s=new Date(+n)),t(n,a),e(n);while(s<n&&n<r);return o},i.filter=n=>Qw(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(i.count=(t,r)=>(Xw.setTime(+t),Zw.setTime(+r),e(Xw),e(Zw),Math.floor(n(Xw,Zw))),i.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?i.filter(r?t=>r(t)%e===0:t=>i.count(0,t)%e===0):i)),i}var $w=Qw(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);$w.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Qw(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):$w),$w.range;var eT=1e3,tT=eT*60,nT=tT*60,rT=nT*24,iT=rT*7,aT=rT*30,oT=rT*365,sT=Qw(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*eT)},(e,t)=>(t-e)/eT,e=>e.getUTCSeconds());sT.range;var cT=Qw(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*eT)},(e,t)=>{e.setTime(+e+t*tT)},(e,t)=>(t-e)/tT,e=>e.getMinutes());cT.range;var lT=Qw(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*tT)},(e,t)=>(t-e)/tT,e=>e.getUTCMinutes());lT.range;var uT=Qw(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*eT-e.getMinutes()*tT)},(e,t)=>{e.setTime(+e+t*nT)},(e,t)=>(t-e)/nT,e=>e.getHours());uT.range;var dT=Qw(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*nT)},(e,t)=>(t-e)/nT,e=>e.getUTCHours());dT.range;var fT=Qw(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tT)/rT,e=>e.getDate()-1);fT.range;var pT=Qw(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/rT,e=>e.getUTCDate()-1);pT.range;var mT=Qw(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/rT,e=>Math.floor(e/rT));mT.range;function hT(e){return Qw(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*tT)/iT)}var gT=hT(0),_T=hT(1),vT=hT(2),yT=hT(3),bT=hT(4),xT=hT(5),ST=hT(6);gT.range,_T.range,vT.range,yT.range,bT.range,xT.range,ST.range;function CT(e){return Qw(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/iT)}var wT=CT(0),TT=CT(1),ET=CT(2),DT=CT(3),OT=CT(4),kT=CT(5),AT=CT(6);wT.range,TT.range,ET.range,DT.range,OT.range,kT.range,AT.range;var jT=Qw(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;var MT=Qw(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());MT.range;var NT=Qw(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());NT.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Qw(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)}),NT.range;var PT=Qw(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());PT.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Qw(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)}),PT.range;function FT(e,t,n,r,i,a){let o=[[sT,1,eT],[sT,5,5*eT],[sT,15,15*eT],[sT,30,30*eT],[a,1,tT],[a,5,5*tT],[a,15,15*tT],[a,30,30*tT],[i,1,nT],[i,3,3*nT],[i,6,6*nT],[i,12,12*nT],[r,1,rT],[r,2,2*rT],[n,1,iT],[t,1,aT],[t,3,3*aT],[e,1,oT]];function s(e,t,n){let r=t<e;r&&([e,t]=[t,e]);let i=n&&typeof n.range==`function`?n:c(e,t,n),a=i?i.range(e,+t+1):[];return r?a.reverse():a}function c(t,n,r){let i=Math.abs(n-t)/r,a=ZS(([,,e])=>e).right(o,i);if(a===o.length)return e.every(sC(t/oT,n/oT,r));if(a===0)return $w.every(Math.max(sC(t,n,r),1));let[s,c]=o[i/o[a-1][2]<o[a][2]/i?a-1:a];return s.every(c)}return[s,c]}var[Bae,Vae]=FT(PT,MT,wT,mT,dT,lT),[Hae,Uae]=FT(NT,jT,gT,fT,uT,cT);function IT(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 LT(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 RT(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function Wae(e){var t=e.dateTime,n=e.date,r=e.time,i=e.periods,a=e.days,o=e.shortDays,s=e.months,c=e.shortMonths,l=HT(i),u=UT(i),d=HT(a),f=UT(a),p=HT(o),m=UT(o),h=HT(s),g=UT(s),_=HT(c),v=UT(c),y={a:N,A:P,b:F,B:ee,c:null,d:JT,e:JT,f:poe,g:tE,G:rE,H:uoe,I:doe,j:foe,L:YT,m:moe,M:hoe,p:I,q:L,Q:EE,s:DE,S:goe,u:_oe,U:voe,V:ZT,w:QT,W:$T,x:null,X:null,y:eE,Y:nE,Z:iE,"%":TE},b={a:R,A:te,b:ne,B:z,c:null,d:aE,e:aE,f:uE,g:xE,G:CE,H:oE,I:sE,j:cE,L:lE,m:dE,M:fE,p:re,q:ie,Q:EE,s:DE,S:pE,u:mE,U:hE,V:_E,w:vE,W:yE,x:null,X:null,y:bE,Y:SE,Z:wE,"%":TE},x={a:E,A:D,b:O,B:k,c:A,d:KT,e:KT,f:ooe,g:GT,G:WT,H:qT,I:qT,j:noe,L:aoe,m:toe,M:roe,p:T,q:eoe,Q:coe,s:loe,S:ioe,u:Yae,U:Xae,V:Zae,w:Jae,W:Qae,x:j,X:M,y:GT,Y:WT,Z:$ae,"%":soe};y.x=S(n,y),y.X=S(r,y),y.c=S(t,y),b.x=S(n,b),b.X=S(r,b),b.c=S(t,b);function S(e,t){return function(n){var r=[],i=-1,a=0,o=e.length,s,c,l;for(n instanceof Date||(n=new Date(+n));++i<o;)e.charCodeAt(i)===37&&(r.push(e.slice(a,i)),(c=zT[s=e.charAt(++i)])==null?c=s===`e`?` `:`0`:s=e.charAt(++i),(l=t[s])&&(s=l(n,c)),r.push(s),a=i+1);return r.push(e.slice(a,i)),r.join(``)}}function C(e,t){return function(n){var r=RT(1900,void 0,1),i=w(r,e,n+=``,0),a,o;if(i!=n.length)return null;if(`Q`in r)return new Date(r.Q);if(`s`in r)return new Date(r.s*1e3+(`L`in r?r.L:0));if(t&&!(`Z`in r)&&(r.Z=0),`p`in r&&(r.H=r.H%12+r.p*12),r.m===void 0&&(r.m=`q`in r?r.q:0),`V`in r){if(r.V<1||r.V>53)return null;`w`in r||(r.w=1),`Z`in r?(a=LT(RT(r.y,0,1)),o=a.getUTCDay(),a=o>4||o===0?TT.ceil(a):TT(a),a=pT.offset(a,(r.V-1)*7),r.y=a.getUTCFullYear(),r.m=a.getUTCMonth(),r.d=a.getUTCDate()+(r.w+6)%7):(a=IT(RT(r.y,0,1)),o=a.getDay(),a=o>4||o===0?_T.ceil(a):_T(a),a=fT.offset(a,(r.V-1)*7),r.y=a.getFullYear(),r.m=a.getMonth(),r.d=a.getDate()+(r.w+6)%7)}else (`W`in r||`U`in r)&&(`w`in r||(r.w=`u`in r?r.u%7:`W`in r?1:0),o=`Z`in r?LT(RT(r.y,0,1)).getUTCDay():IT(RT(r.y,0,1)).getDay(),r.m=0,r.d=`W`in r?(r.w+6)%7+r.W*7-(o+5)%7:r.w+r.U*7-(o+6)%7);return`Z`in r?(r.H+=r.Z/100|0,r.M+=r.Z%100,LT(r)):IT(r)}}function w(e,t,n,r){for(var i=0,a=t.length,o=n.length,s,c;i<a;){if(r>=o)return-1;if(s=t.charCodeAt(i++),s===37){if(s=t.charAt(i++),c=x[s in zT?t.charAt(i++):s],!c||(r=c(e,n,r))<0)return-1}else if(s!=n.charCodeAt(r++))return-1}return r}function T(e,t,n){var r=l.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1}function E(e,t,n){var r=p.exec(t.slice(n));return r?(e.w=m.get(r[0].toLowerCase()),n+r[0].length):-1}function D(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1}function O(e,t,n){var r=_.exec(t.slice(n));return r?(e.m=v.get(r[0].toLowerCase()),n+r[0].length):-1}function k(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1}function A(e,n,r){return w(e,t,n,r)}function j(e,t,r){return w(e,n,t,r)}function M(e,t,n){return w(e,r,t,n)}function N(e){return o[e.getDay()]}function P(e){return a[e.getDay()]}function F(e){return c[e.getMonth()]}function ee(e){return s[e.getMonth()]}function I(e){return i[+(e.getHours()>=12)]}function L(e){return 1+~~(e.getMonth()/3)}function R(e){return o[e.getUTCDay()]}function te(e){return a[e.getUTCDay()]}function ne(e){return c[e.getUTCMonth()]}function z(e){return s[e.getUTCMonth()]}function re(e){return i[+(e.getUTCHours()>=12)]}function ie(e){return 1+~~(e.getUTCMonth()/3)}return{format:function(e){var t=S(e+=``,y);return t.toString=function(){return e},t},parse:function(e){var t=C(e+=``,!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=S(e+=``,b);return t.toString=function(){return e},t},utcParse:function(e){var t=C(e+=``,!0);return t.toString=function(){return e},t}}}var zT={"-":``,_:` `,0:`0`},BT=/^\s*\d+/,Gae=/^%/,Kae=/[\\^$*+?|[\]().{}]/g;function VT(e,t,n){var r=e<0?`-`:``,i=(r?-e:e)+``,a=i.length;return r+(a<n?Array(n-a+1).join(t)+i:i)}function qae(e){return e.replace(Kae,`\\$&`)}function HT(e){return RegExp(`^(?:`+e.map(qae).join(`|`)+`)`,`i`)}function UT(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function Jae(e,t,n){var r=BT.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Yae(e,t,n){var r=BT.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Xae(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Zae(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Qae(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function WT(e,t,n){var r=BT.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function GT(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function $ae(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 eoe(e,t,n){var r=BT.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function toe(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function KT(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function noe(e,t,n){var r=BT.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function qT(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function roe(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ioe(e,t,n){var r=BT.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function aoe(e,t,n){var r=BT.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ooe(e,t,n){var r=BT.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function soe(e,t,n){var r=Gae.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function coe(e,t,n){var r=BT.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function loe(e,t,n){var r=BT.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function JT(e,t){return VT(e.getDate(),t,2)}function uoe(e,t){return VT(e.getHours(),t,2)}function doe(e,t){return VT(e.getHours()%12||12,t,2)}function foe(e,t){return VT(1+fT.count(NT(e),e),t,3)}function YT(e,t){return VT(e.getMilliseconds(),t,3)}function poe(e,t){return YT(e,t)+`000`}function moe(e,t){return VT(e.getMonth()+1,t,2)}function hoe(e,t){return VT(e.getMinutes(),t,2)}function goe(e,t){return VT(e.getSeconds(),t,2)}function _oe(e){var t=e.getDay();return t===0?7:t}function voe(e,t){return VT(gT.count(NT(e)-1,e),t,2)}function XT(e){var t=e.getDay();return t>=4||t===0?bT(e):bT.ceil(e)}function ZT(e,t){return e=XT(e),VT(bT.count(NT(e),e)+(NT(e).getDay()===4),t,2)}function QT(e){return e.getDay()}function $T(e,t){return VT(_T.count(NT(e)-1,e),t,2)}function eE(e,t){return VT(e.getFullYear()%100,t,2)}function tE(e,t){return e=XT(e),VT(e.getFullYear()%100,t,2)}function nE(e,t){return VT(e.getFullYear()%1e4,t,4)}function rE(e,t){var n=e.getDay();return e=n>=4||n===0?bT(e):bT.ceil(e),VT(e.getFullYear()%1e4,t,4)}function iE(e){var t=e.getTimezoneOffset();return(t>0?`-`:(t*=-1,`+`))+VT(t/60|0,`0`,2)+VT(t%60,`0`,2)}function aE(e,t){return VT(e.getUTCDate(),t,2)}function oE(e,t){return VT(e.getUTCHours(),t,2)}function sE(e,t){return VT(e.getUTCHours()%12||12,t,2)}function cE(e,t){return VT(1+pT.count(PT(e),e),t,3)}function lE(e,t){return VT(e.getUTCMilliseconds(),t,3)}function uE(e,t){return lE(e,t)+`000`}function dE(e,t){return VT(e.getUTCMonth()+1,t,2)}function fE(e,t){return VT(e.getUTCMinutes(),t,2)}function pE(e,t){return VT(e.getUTCSeconds(),t,2)}function mE(e){var t=e.getUTCDay();return t===0?7:t}function hE(e,t){return VT(wT.count(PT(e)-1,e),t,2)}function gE(e){var t=e.getUTCDay();return t>=4||t===0?OT(e):OT.ceil(e)}function _E(e,t){return e=gE(e),VT(OT.count(PT(e),e)+(PT(e).getUTCDay()===4),t,2)}function vE(e){return e.getUTCDay()}function yE(e,t){return VT(TT.count(PT(e)-1,e),t,2)}function bE(e,t){return VT(e.getUTCFullYear()%100,t,2)}function xE(e,t){return e=gE(e),VT(e.getUTCFullYear()%100,t,2)}function SE(e,t){return VT(e.getUTCFullYear()%1e4,t,4)}function CE(e,t){var n=e.getUTCDay();return e=n>=4||n===0?OT(e):OT.ceil(e),VT(e.getUTCFullYear()%1e4,t,4)}function wE(){return`+0000`}function TE(){return`%`}function EE(e){return+e}function DE(e){return Math.floor(e/1e3)}var OE,kE,AE;jE({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 jE(e){return OE=Wae(e),kE=OE.format,OE.parse,AE=OE.utcFormat,OE.utcParse,OE}function ME(e){return new Date(e)}function NE(e){return e instanceof Date?+e:+new Date(+e)}function PE(e,t,n,r,i,a,o,s,c,l){var u=sw(),d=u.invert,f=u.domain,p=l(`.%L`),m=l(`:%S`),h=l(`%I:%M`),g=l(`%I %p`),_=l(`%a %d`),v=l(`%b %d`),y=l(`%B`),b=l(`%Y`);function x(e){return(c(e)<e?p:s(e)<e?m:o(e)<e?h:a(e)<e?g:r(e)<e?i(e)<e?_:v:n(e)<e?y:b)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,NE)):f().map(ME)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],t??10)},u.tickFormat=function(e,t){return t==null?x:l(t)},u.nice=function(e){var n=f();return(!e||typeof e.range!=`function`)&&(e=t(n[0],n[n.length-1],e??10)),e?f(Ew(n,e)):u},u.copy=function(){return aw(u,PE(e,t,n,r,i,a,o,s,c,l))},u}function FE(){return fC.apply(PE(Hae,Uae,NT,jT,gT,fT,uT,cT,sT,kE).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function IE(){return fC.apply(PE(Bae,Vae,PT,MT,wT,pT,dT,lT,sT,AE).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function LE(){var e=0,t=1,n,r,i,a,o=rw,s=!1,c;function l(e){return e==null||isNaN(e=+e)?c:o(i===0?.5:(e=(a(e)-n)*i,s?Math.max(0,Math.min(1,e)):e))}l.domain=function(o){return arguments.length?([e,t]=o,n=a(e=+e),r=a(t=+t),i=n===r?0:1/(r-n),l):[e,t]},l.clamp=function(e){return arguments.length?(s=!!e,l):s},l.interpolator=function(e){return arguments.length?(o=e,l):o};function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,o=e(n,r),l):[o(0),o(1)]}}return l.range=u($C),l.rangeRound=u(ew),l.unknown=function(e){return arguments.length?(c=e,l):c},function(o){return a=o,n=o(e),r=o(t),i=n===r?0:1/(r-n),l}}function RE(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function zE(){var e=Cw(LE()(rw));return e.copy=function(){return RE(e,zE())},pC.apply(e,arguments)}function BE(){var e=Pw(LE()).domain([1,10]);return e.copy=function(){return RE(e,BE()).base(e.base())},pC.apply(e,arguments)}function VE(){var e=Rw(LE());return e.copy=function(){return RE(e,VE()).constant(e.constant())},pC.apply(e,arguments)}function HE(){var e=Vw(LE());return e.copy=function(){return RE(e,HE()).exponent(e.exponent())},pC.apply(e,arguments)}function UE(){return HE.apply(null,arguments).exponent(.5)}function WE(){var e=[],t=rw;function n(n){if(n!=null&&!isNaN(n=+n))return t((eC(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)n!=null&&!isNaN(n=+n)&&e.push(n);return e.sort(XS),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>Zie(e,r/t))},n.copy=function(){return WE(t).domain(e)},pC.apply(n,arguments)}function GE(){var e=0,t=.5,n=1,r=1,i,a,o,s,c,l=rw,u,d=!1,f;function p(e){return isNaN(e=+e)?f:(e=.5+((e=+u(e))-a)*(r*e<r*a?s:c),l(d?Math.max(0,Math.min(1,e)):e))}p.domain=function(l){return arguments.length?([e,t,n]=l,i=u(e=+e),a=u(t=+t),o=u(n=+n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p):[e,t,n]},p.clamp=function(e){return arguments.length?(d=!!e,p):d},p.interpolator=function(e){return arguments.length?(l=e,p):l};function m(e){return function(t){var n,r,i;return arguments.length?([n,r,i]=t,l=Sae(e,[n,r,i]),p):[l(0),l(.5),l(1)]}}return p.range=m($C),p.rangeRound=m(ew),p.unknown=function(e){return arguments.length?(f=e,p):f},function(l){return u=l,i=l(e),a=l(t),o=l(n),s=i===a?0:.5/(a-i),c=a===o?0:.5/(o-a),r=a<i?-1:1,p}}function KE(){var e=Cw(GE()(rw));return e.copy=function(){return RE(e,KE())},pC.apply(e,arguments)}function qE(){var e=Pw(GE()).domain([.1,1,10]);return e.copy=function(){return RE(e,qE()).base(e.base())},pC.apply(e,arguments)}function JE(){var e=Rw(GE());return e.copy=function(){return RE(e,JE()).constant(e.constant())},pC.apply(e,arguments)}function YE(){var e=Vw(GE());return e.copy=function(){return RE(e,YE()).exponent(e.exponent())},pC.apply(e,arguments)}function XE(){return YE.apply(null,arguments).exponent(.5)}var ZE=t({scaleBand:()=>gC,scaleDiverging:()=>KE,scaleDivergingLog:()=>qE,scaleDivergingPow:()=>YE,scaleDivergingSqrt:()=>XE,scaleDivergingSymlog:()=>JE,scaleIdentity:()=>Tw,scaleImplicit:()=>mC,scaleLinear:()=>ww,scaleLog:()=>Fw,scaleOrdinal:()=>hC,scalePoint:()=>vC,scalePow:()=>Hw,scaleQuantile:()=>qw,scaleQuantize:()=>Jw,scaleRadial:()=>Kw,scaleSequential:()=>zE,scaleSequentialLog:()=>BE,scaleSequentialPow:()=>HE,scaleSequentialQuantile:()=>WE,scaleSequentialSqrt:()=>UE,scaleSequentialSymlog:()=>VE,scaleSqrt:()=>Uw,scaleSymlog:()=>zw,scaleThreshold:()=>Yw,scaleTime:()=>FE,scaleUtc:()=>IE,tickFormat:()=>Sw}),QE=r(((e,t)=>{var n=hg();function r(e,t,r){for(var i=-1,a=e.length;++i<a;){var o=e[i],s=t(o);if(s!=null&&(c===void 0?s===s&&!n(s):r(s,c)))var c=s,l=o}return l}t.exports=r})),$E=r(((e,t)=>{function n(e,t){return e>t}t.exports=n})),eD=r(((e,t)=>{var n=QE(),r=$E(),i=kb();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),tD=r(((e,t)=>{function n(e,t){return e<t}t.exports=n})),nD=r(((e,t)=>{var n=QE(),r=tD(),i=kb();function a(e){return e&&e.length?n(e,i,r):void 0}t.exports=a})),rD=r(((e,t)=>{var n=Ag(),r=Nb(),i=xx(),a=sg();function o(e,t){return(a(e)?n:i)(e,r(t,3))}t.exports=o})),yoe=r(((e,t)=>{var n=hx(),r=rD();function i(e,t){return n(r(e,t),1)}t.exports=i})),boe=r(((e,t)=>{var n=yb();function r(e,t){return n(e,t)}t.exports=r})),xoe=r(((e,t)=>{(function(e){var n=1e9,r={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:`2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286`},i=!0,a=`[DecimalError] `,o=a+`Invalid argument: `,s=a+`Exponent out of range: `,c=Math.floor,l=Math.pow,u=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,d,f=1e7,p=7,m=9007199254740991,h=c(m/p),g={};g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&=1,e},g.comparedTo=g.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=r<i?r:i;t<n;++t)if(a.d[t]!==e.d[t])return a.d[t]>e.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*p;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return b(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this,n=t.constructor;return D(b(t,new n(e),0,1),n.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return S(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return this.s===0},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,s=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(d))throw Error(a+`NaN`);if(n.s<1)throw Error(a+(n.s?`NaN`:`-Infinity`));return n.eq(d)?new r(0):(i=!1,t=b(T(n,s),T(e,s),s),i=!0,D(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?O(t,e):_(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(a+`NaN`);return n.s?(i=!1,t=b(n,e,0,1).times(e),i=!0,n.minus(t)):D(new r(n),o)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return T(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?_(t,e):O(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(o+e);if(t=S(i)+1,r=i.d.length-1,n=r*p+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,o,s,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(a+`NaN`)}for(e=S(u),i=!1,o=Math.sqrt(+u),o==0||o==1/0?(t=y(u.d),(t.length+e)%2==0&&(t+=`0`),o=Math.sqrt(t),e=c((e+1)/2)-(e<0||e%2),o==1/0?t=`5e`+e:(t=o.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+e),r=new d(t)):r=new d(o.toString()),n=d.precision,o=l=n+3;;)if(s=r,r=s.plus(b(u,s,l+2)).times(.5),y(s.d).slice(0,l)===(t=y(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),o==l&&t==`4999`){if(D(s,n+1,0),s.times(s).eq(u)){r=s;break}}else if(t!=`9999`)break;l+=4}return i=!0,D(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,s,c,l,u,d=this,p=d.constructor,m=d.d,h=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,n=d.e+e.e,l=m.length,u=h.length,l<u&&(o=m,m=h,h=o,s=l,l=u,u=s),o=[],s=l+u,r=s;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=l+r;a>r;)c=o[a]+h[r]*m[a-r-1]+t,o[a--]=c%f|0,t=c/f|0;o[a]=(o[a]+t)%f|0}for(;!o[--s];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,i?D(e,p.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var r=this,i=r.constructor;return r=new i(r),e===void 0?r:(v(e,0,n),t===void 0?t=i.rounding:v(t,0,8),D(r,e+S(r)+1,t))},g.toExponential=function(e,t){var r,i=this,a=i.constructor;return e===void 0?r=k(i,!0):(v(e,0,n),t===void 0?t=a.rounding:v(t,0,8),i=D(new a(i),e+1,t),r=k(i,!0,e+1)),r},g.toFixed=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?k(a):(v(e,0,n),t===void 0?t=o.rounding:v(t,0,8),i=D(new o(a),e+S(a)+1,t),r=k(i.abs(),!1,e+S(i)+1),a.isneg()&&!a.isZero()?`-`+r:r)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return D(new t(e),S(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,s,l,u=this,f=u.constructor,h=12,g=+(e=new f(e));if(!e.s)return new f(d);if(u=new f(u),!u.s){if(e.s<1)throw Error(a+`Infinity`);return u}if(u.eq(d))return u;if(r=f.precision,e.eq(d))return D(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,s=u.s,!l){if(s<0)throw Error(a+`NaN`)}else if((n=g<0?-g:g)<=m){for(o=new f(d),t=Math.ceil(r/p+4),i=!1;n%2&&(o=o.times(u),A(o.d,t)),n=c(n/2),n!==0;)u=u.times(u),A(u.d,t);return i=!0,e.s<0?new f(d).div(o):D(o,r)}return s=s<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,i=!1,o=e.times(T(u,r+h)),i=!0,o=x(o),o.s=s,o},g.toPrecision=function(e,t){var r,i,a=this,o=a.constructor;return e===void 0?(r=S(a),i=k(a,r<=o.toExpNeg||r>=o.toExpPos)):(v(e,1,n),t===void 0?t=o.rounding:v(t,0,8),a=D(new o(a),e,t),r=S(a),i=k(a,e<=r||r<=o.toExpNeg,e)),i},g.toSignificantDigits=g.tosd=function(e,t){var r=this,i=r.constructor;return e===void 0?(e=i.precision,t=i.rounding):(v(e,1,n),t===void 0?t=i.rounding:v(t,0,8)),D(new i(r),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=S(e),n=e.constructor;return k(e,t<=n.toExpNeg||t>=n.toExpPos)};function _(e,t){var n,r,a,o,s,c,l,u,d=e.constructor,m=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),i?D(t,m):t;if(l=e.d,u=t.d,s=e.e,a=t.e,l=l.slice(),o=s-a,o){for(o<0?(r=l,o=-o,c=u.length):(r=u,a=s,c=l.length),s=Math.ceil(m/p),c=s>c?s+1:c+1,o>c&&(o=c,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(c=l.length,o=u.length,c-o<0&&(o=c,r=u,u=l,l=r),n=0;o;)n=(l[--o]=l[o]+u[o]+n)/f|0,l[o]%=f;for(n&&(l.unshift(n),++a),c=l.length;l[--c]==0;)l.pop();return t.d=l,t.e=a,i?D(t,m):t}function v(e,t,n){if(e!==~~e||e<t||e>n)throw Error(o+e)}function y(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=p-r.length,n&&(a+=w(n)),a+=r;o=e[t],r=o+``,n=p-r.length,n&&(a+=w(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}var b=(function(){function e(e,t){var n,r=0,i=e.length;for(e=e.slice();i--;)n=e[i]*t+r,e[i]=n%f|0,r=n/f|0;return r&&e.unshift(r),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=r*f+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,o,s){var c,l,u,d,m,h,g,_,v,y,b,x,C,w,T,E,O,k,A=r.constructor,j=r.s==i.s?1:-1,M=r.d,N=i.d;if(!r.s)return new A(r);if(!i.s)throw Error(a+`Division by zero`);for(l=r.e-i.e,O=N.length,T=M.length,g=new A(j),_=g.d=[],u=0;N[u]==(M[u]||0);)++u;if(N[u]>(M[u]||0)&&--l,x=o==null?o=A.precision:s?o+(S(r)-S(i))+1:o,x<0)return new A(0);if(x=x/p+2|0,u=0,O==1)for(d=0,N=N[0],x++;(u<T||d)&&x--;u++)C=d*f+(M[u]||0),_[u]=C/N|0,d=C%N|0;else{for(d=f/(N[0]+1)|0,d>1&&(N=e(N,d),M=e(M,d),O=N.length,T=M.length),w=O,v=M.slice(0,O),y=v.length;y<O;)v[y++]=0;k=N.slice(),k.unshift(0),E=N[0],N[1]>=f/2&&++E;do d=0,c=t(N,v,O,y),c<0?(b=v[0],O!=y&&(b=b*f+(v[1]||0)),d=b/E|0,d>1?(d>=f&&(d=f-1),m=e(N,d),h=m.length,y=v.length,c=t(m,v,h,y),c==1&&(d--,n(m,O<h?k:N,h))):(d==0&&(c=d=1),m=N.slice()),h=m.length,h<y&&m.unshift(0),n(v,m,y),c==-1&&(y=v.length,c=t(N,v,O,y),c<1&&(d++,n(v,O<y?k:N,y))),y=v.length):c===0&&(d++,v=[0]),_[u++]=d,c&&v[0]?v[y++]=M[w]||0:(v=[M[w]],y=1);while((w++<T||v[0]!==void 0)&&x--)}return _[0]||_.shift(),g.e=l,D(g,s?o+S(g)+1:o)}})();function x(e,t){var n,r,a,o,c,u,f=0,p=0,m=e.constructor,h=m.precision;if(S(e)>16)throw Error(s+S(e));if(!e.s)return new m(d);for(t==null?(i=!1,u=h):u=t,c=new m(.03125);e.abs().gte(.1);)e=e.times(c),p+=5;for(r=Math.log(l(2,p))/Math.LN10*2+5|0,u+=r,n=a=o=new m(d),m.precision=u;;){if(a=D(a.times(e),u),n=n.times(++f),c=o.plus(b(a,n,u)),y(c.d).slice(0,u)===y(o.d).slice(0,u)){for(;p--;)o=D(o.times(o),u);return m.precision=h,t==null?(i=!0,D(o,h)):o}o=c}}function S(e){for(var t=e.e*p,n=e.d[0];n>=10;n/=10)t++;return t}function C(e,t,n){if(t>e.LN10.sd())throw i=!0,n&&(e.precision=n),Error(a+`LN10 precision limit exceeded`);return D(new e(e.LN10),t)}function w(e){for(var t=``;e--;)t+=`0`;return t}function T(e,t){var n,r,o,s,c,l,u,f,p,m=1,h=10,g=e,_=g.d,v=g.constructor,x=v.precision;if(g.s<1)throw Error(a+(g.s?`NaN`:`-Infinity`));if(g.eq(d))return new v(0);if(t==null?(i=!1,f=x):f=t,g.eq(10))return t??(i=!0),C(v,f);if(f+=h,v.precision=f,n=y(_),r=n.charAt(0),s=S(g),Math.abs(s)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)g=g.times(e),n=y(g.d),r=n.charAt(0),m++;s=S(g),r>1?(g=new v(`0.`+n),s++):g=new v(r+`.`+n.slice(1))}else return u=C(v,f+2,x).times(s+``),g=T(new v(r+`.`+n.slice(1)),f-h).plus(u),v.precision=x,t==null?(i=!0,D(g,x)):g;for(l=c=g=b(g.minus(d),g.plus(d),f),p=D(g.times(g),f),o=3;;){if(c=D(c.times(p),f),u=l.plus(b(c,new v(o),f)),y(u.d).slice(0,f)===y(l.d).slice(0,f))return l=l.times(2),s!==0&&(l=l.plus(C(v,f+2,x).times(s+``))),l=b(l,new v(m),f),v.precision=x,t==null?(i=!0,D(l,x)):l;l=u,o+=2}}function E(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=c(n/p),e.d=[],r=(n+1)%p,n<0&&(r+=p),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=p;r<a;)e.d.push(+t.slice(r,r+=p));t=t.slice(r),r=p-t.length}else r-=a;for(;r--;)t+=`0`;if(e.d.push(+t),i&&(e.e>h||e.e<-h))throw Error(s+n)}else e.s=0,e.e=0,e.d=[0];return e}function D(e,t,n){var r,a,o,u,d,m,g,_,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(r=t-u,r<0)r+=p,a=t,g=v[_=0];else{if(_=Math.ceil((r+1)/p),o=v.length,_>=o)return e;for(g=o=v[_],u=1;o>=10;o/=10)u++;r%=p,a=r-p+u}if(n!==void 0&&(o=l(10,u-a-1),d=g/o%10|0,m=t<0||v[_+1]!==void 0||g%o,m=n<4?(d||m)&&(n==0||n==(e.s<0?3:2)):d>5||d==5&&(n==4||m||n==6&&(r>0?a>0?g/l(10,u-a):0:v[_-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return m?(o=S(e),v.length=1,t=t-o-1,v[0]=l(10,(p-t%p)%p),e.e=c(-t/p)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=_,o=1,_--):(v.length=_+1,o=l(10,p-r),v[_]=a>0?(g/l(10,u-a)%l(10,a)|0)*o:0),m)for(;;)if(_==0){(v[0]+=o)==f&&(v[0]=1,++e.e);break}else{if(v[_]+=o,v[_]!=f)break;v[_--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(i&&(e.e>h||e.e<-h))throw Error(s+S(e));return e}function O(e,t){var n,r,a,o,s,c,l,u,d,m,h=e.constructor,g=h.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new h(e),i?D(t,g):t;if(l=e.d,m=t.d,r=t.e,u=e.e,l=l.slice(),s=u-r,s){for(d=s<0,d?(n=l,s=-s,c=m.length):(n=m,r=u,c=l.length),a=Math.max(Math.ceil(g/p),c)+2,s>a&&(s=a,n.length=1),n.reverse(),a=s;a--;)n.push(0);n.reverse()}else{for(a=l.length,c=m.length,d=a<c,d&&(c=a),a=0;a<c;a++)if(l[a]!=m[a]){d=l[a]<m[a];break}s=0}for(d&&(n=l,l=m,m=n,t.s=-t.s),c=l.length,a=m.length-c;a>0;--a)l[c++]=0;for(a=m.length;a>s;){if(l[--a]<m[a]){for(o=a;o&&l[--o]===0;)l[o]=f-1;--l[o],l[a]+=f}l[a]-=m[a]}for(;l[--c]===0;)l.pop();for(;l[0]===0;l.shift())--r;return l[0]?(t.d=l,t.e=r,i?D(t,g):t):new h(0)}function k(e,t,n){var r,i=S(e),a=y(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+w(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(i<0?`e`:`e+`)+i):i<0?(a=`0.`+w(-i-1)+a,n&&(r=n-o)>0&&(a+=w(r))):i>=o?(a+=w(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+w(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=w(r))),e.s<0?`-`+a:a}function A(e,t){if(e.length>t)return e.length=t,!0}function j(e){var t,n,r;function i(e){var t=this;if(!(t instanceof i))return new i(e);if(t.constructor=i,e instanceof i){t.s=e.s,t.e=e.e,t.d=(e=e.d)?e.slice():e;return}if(typeof e==`number`){if(e*0!=0)throw Error(o+e);if(e>0)t.s=1;else if(e<0)e=-e,t.s=-1;else{t.s=0,t.e=0,t.d=[0];return}if(e===~~e&&e<1e7){t.e=0,t.d=[e];return}return E(t,e.toString())}else if(typeof e!=`string`)throw Error(o+e);if(e.charCodeAt(0)===45?(e=e.slice(1),t.s=-1):t.s=1,u.test(e))E(t,e);else throw Error(o+e)}if(i.prototype=g,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=j,i.config=i.set=M,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 i.config(e),i}function M(e){if(!e||typeof e!=`object`)throw Error(a+`Object expected`);var t,r,i,s=[`precision`,1,n,`rounding`,0,8,`toExpNeg`,-1/0,0,`toExpPos`,0,1/0];for(t=0;t<s.length;t+=3)if((i=e[r=s[t]])!==void 0)if(c(i)===i&&i>=s[t+1]&&i<=s[t+2])this[r]=i;else throw Error(o+r+`: `+i);if((i=e[r=`LN10`])!==void 0)if(i==Math.LN10)this[r]=new this(i);else throw Error(o+r+`: `+i);return this}r=j(r),r.default=r.Decimal=r,d=new r(1),typeof define==`function`&&define.amd?define(function(){return r}):t!==void 0&&t.exports?t.exports=r:(e||=typeof self<`u`&&self&&self.self==self?self:Function(`return this`)(),e.Decimal=r)})(e)}));function Soe(e){return Eoe(e)||Toe(e)||woe(e)||Coe()}function Coe(){throw TypeError(`Invalid attempt to spread non-iterable instance.
130
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function woe(e,t){if(e){if(typeof e==`string`)return iD(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 iD(e,t)}}function Toe(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function Eoe(e){if(Array.isArray(e))return iD(e)}function iD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Doe=function(e){return e},aD={"@@functional/placeholder":!0},oD=function(e){return e===aD},sD=function(e){return function t(){return arguments.length===0||arguments.length===1&&oD(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},Ooe=function e(t,n){return t===1?n:sD(function(){var r=[...arguments],i=r.filter(function(e){return e!==aD}).length;return i>=t?n.apply(void 0,r):e(t-i,sD(function(){var e=[...arguments],t=r.map(function(t){return oD(t)?e.shift():t});return n.apply(void 0,Soe(t).concat(e))}))})},cD=function(e){return Ooe(e.length,e)},lD=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},koe=cD(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),Aoe=function(){var e=[...arguments];if(!e.length)return Doe;var t=e.reverse(),n=t[0],r=t.slice(1);return function(){return r.reduce(function(e,t){return t(e)},n.apply(void 0,arguments))}},uD=function(e){return Array.isArray(e)?e.reverse():e.split(``).reverse.join(``)},dD=function(e){var t=null,n=null;return function(){var r=[...arguments];return t&&r.every(function(e,n){return e===t[n]})?n:(t=r,n=e.apply(void 0,r),n)}},fD=e(xoe());function joe(e){return e===0?1:Math.floor(new fD.default(e).abs().log(10).toNumber())+1}function Moe(e,t,n){for(var r=new fD.default(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var pD={rangeStep:Moe,getDigitCount:joe,interpolateNumber:cD(function(e,t,n){var r=+e;return r+n*(+t-r)}),uninterpolateNumber:cD(function(e,t,n){var r=t-+e;return r||=1/0,(n-e)/r}),uninterpolateTruncation:cD(function(e,t,n){var r=t-+e;return r||=1/0,Math.max(0,Math.min(1,(n-e)/r))})};function mD(e){return Foe(e)||Poe(e)||gD(e)||Noe()}function Noe(){throw TypeError(`Invalid attempt to spread non-iterable instance.
131
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Poe(e){if(typeof Symbol<`u`&&Symbol.iterator in Object(e))return Array.from(e)}function Foe(e){if(Array.isArray(e))return _D(e)}function hD(e,t){return Roe(e)||Loe(e,t)||gD(e,t)||Ioe()}function Ioe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
132
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gD(e,t){if(e){if(typeof e==`string`)return _D(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 _D(e,t)}}function _D(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Loe(e,t){if(!(typeof Symbol>`u`||!(Symbol.iterator in Object(e)))){var n=[],r=!0,i=!1,a=void 0;try{for(var o=e[Symbol.iterator](),s;!(r=(s=o.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(e){i=!0,a=e}finally{try{!r&&o.return!=null&&o.return()}finally{if(i)throw a}}return n}}function Roe(e){if(Array.isArray(e))return e}function vD(e){var t=hD(e,2),n=t[0],r=t[1],i=n,a=r;return n>r&&(i=r,a=n),[i,a]}function yD(e,t,n){if(e.lte(0))return new fD.default(0);var r=pD.getDigitCount(e.toNumber()),i=new fD.default(10).pow(r),a=e.div(i),o=r===1?.1:.05,s=new fD.default(Math.ceil(a.div(o).toNumber())).add(n).mul(o).mul(i);return t?s:new fD.default(Math.ceil(s))}function zoe(e,t,n){var r=1,i=new fD.default(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new fD.default(10).pow(pD.getDigitCount(e)-1),i=new fD.default(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new fD.default(Math.floor(e)))}else e===0?i=new fD.default(Math.floor((t-1)/2)):n||(i=new fD.default(Math.floor(e)));var o=Math.floor((t-1)/2);return Aoe(koe(function(e){return i.add(new fD.default(e-o).mul(r)).toNumber()}),lD)(0,t)}function bD(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new fD.default(0),tickMin:new fD.default(0),tickMax:new fD.default(0)};var a=yD(new fD.default(t).sub(e).div(n-1),r,i),o;e<=0&&t>=0?o=new fD.default(0):(o=new fD.default(e).add(t).div(2),o=o.sub(new fD.default(o).mod(a)));var s=Math.ceil(o.sub(e).div(a).toNumber()),c=Math.ceil(new fD.default(t).sub(o).div(a).toNumber()),l=s+c+1;return l>n?bD(e,t,n,r,i+1):(l<n&&(c=t>0?c+(n-l):c,s=t>0?s:s+(n-l)),{step:a,tickMin:o.sub(new fD.default(s).mul(a)),tickMax:o.add(new fD.default(c).mul(a))})}function Boe(e){var t=hD(e,2),n=t[0],r=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),s=hD(vD([n,r]),2),c=s[0],l=s[1];if(c===-1/0||l===1/0){var u=l===1/0?[c].concat(mD(lD(0,i-1).map(function(){return 1/0}))):[].concat(mD(lD(0,i-1).map(function(){return-1/0})),[l]);return n>r?uD(u):u}if(c===l)return zoe(c,i,a);var d=bD(c,l,o,a),f=d.step,p=d.tickMin,m=d.tickMax,h=pD.rangeStep(p,m.add(new fD.default(.1).mul(f)),f);return n>r?uD(h):h}function Voe(e,t){var n=hD(e,2),r=n[0],i=n[1],a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=hD(vD([r,i]),2),s=o[0],c=o[1];if(s===-1/0||c===1/0)return[r,i];if(s===c)return[s];var l=Math.max(t,2),u=yD(new fD.default(c).sub(s).div(l-1),a,0),d=[].concat(mD(pD.rangeStep(new fD.default(s),new fD.default(c).sub(new fD.default(.99).mul(u)),u)),[c]);return r>i?uD(d):d}var Hoe=dD(Boe),Uoe=dD(Voe),Woe=!0,xD=`Invariant failed`;function SD(e,t){if(!e){if(Woe)throw Error(xD);var n=typeof t==`function`?t():t,r=n?`${xD}: ${n}`:xD;throw Error(r)}}var Goe=[`offset`,`layout`,`width`,`dataKey`,`data`,`dataPointFormatter`,`xAxis`,`yAxis`];function CD(e){"@babel/helpers - typeof";return CD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},CD(e)}function wD(){return wD=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},wD.apply(this,arguments)}function Koe(e,t){return Yoe(e)||Joe(e,t)||qoe(e,t)||TD()}function TD(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
133
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qoe(e,t){if(e){if(typeof e==`string`)return ED(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 ED(e,t)}}function ED(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Joe(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Yoe(e){if(Array.isArray(e))return e}function Xoe(e,t){if(e==null)return{};var n=Zoe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zoe(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 Qoe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function DD(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,MD(r.key),r)}}function $oe(e,t,n){return t&&DD(e.prototype,t),n&&DD(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function ese(e,t,n){return t=kD(t),tse(e,OD()?Reflect.construct(t,n||[],kD(e).constructor):t.apply(e,n))}function tse(e,t){if(t&&(CD(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return nse(e)}function nse(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function OD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OD=function(){return!!e})()}function kD(e){return kD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kD(e)}function rse(e,t){if(typeof t!=`function`&&t!==null)throw 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&&AD(e,t)}function AD(e,t){return AD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},AD(e,t)}function jD(e,t,n){return t=MD(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function MD(e){var t=ise(e,`string`);return CD(t)==`symbol`?t:t+``}function ise(e,t){if(CD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(CD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ND=function(e){function t(){return Qoe(this,t),ese(this,t,arguments)}return rse(t,e),$oe(t,[{key:`render`,value:function(){var e=this.props,t=e.offset,n=e.layout,r=e.width,i=e.dataKey,a=e.data,o=e.dataPointFormatter,s=e.xAxis,c=e.yAxis,l=J(Xoe(e,Goe),!1);this.props.direction===`x`&&s.type!==`number`&&SD(!1);var d=a.map(function(e){var a=o(e,i),d=a.x,f=a.y,p=a.value,m=a.errorVal;if(!m)return null;var h=[],g,_;if(Array.isArray(m)){var v=Koe(m,2);g=v[0],_=v[1]}else g=_=m;if(n===`vertical`){var y=s.scale,b=f+t,x=b+r,S=b-r,C=y(p-g),w=y(p+_);h.push({x1:w,y1:x,x2:w,y2:S}),h.push({x1:C,y1:b,x2:w,y2:b}),h.push({x1:C,y1:x,x2:C,y2:S})}else if(n===`horizontal`){var T=c.scale,E=d+t,D=E-r,O=E+r,k=T(p-g),A=T(p+_);h.push({x1:D,y1:A,x2:O,y2:A}),h.push({x1:E,y1:k,x2:E,y2:A}),h.push({x1:D,y1:k,x2:O,y2:k})}return u.createElement(b_,wD({className:`recharts-errorBar`,key:`bar-${h.map(function(e){return`${e.x1}-${e.x2}-${e.y1}-${e.y2}`})}`},l),h.map(function(e){return u.createElement(`line`,wD({},e,{key:`line-${e.x1}-${e.x2}-${e.y1}-${e.y2}`}))}))});return u.createElement(b_,{className:`recharts-errorBars`},d)}}])}(u.Component);jD(ND,`defaultProps`,{stroke:`black`,strokeWidth:1.5,width:5,offset:0,layout:`horizontal`}),jD(ND,`displayName`,`ErrorBar`);function PD(e){"@babel/helpers - typeof";return PD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},PD(e)}function FD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ID(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?FD(Object(n),!0).forEach(function(t){ase(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):FD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ase(e,t,n){return t=ose(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ose(e){var t=sse(e,`string`);return PD(t)==`symbol`?t:t+``}function sse(e,t){if(PD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var LD=function(e){var t=e.children,n=e.formattedGraphicalItems,r=e.legendWidth,i=e.legendContent,a=d_(t,px);if(!a)return null;var o=px.defaultProps,s=o===void 0?{}:ID(ID({},o),a.props),c=a.props&&a.props.payload?a.props&&a.props.payload:i===`children`?(n||[]).reduce(function(e,t){var n=t.item,r=t.props,i=r.sectors||r.data||[];return e.concat(i.map(function(e){return{type:a.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(n||[]).map(function(e){var t=e.item,n=t.type.defaultProps,r=n===void 0?{}:ID(ID({},n),t.props),i=r.dataKey,a=r.name,o=r.legendType;return{inactive:r.hide,dataKey:i,type:s.iconType||o||`square`,color:YD(t),value:a||i,payload:r}});return ID(ID(ID({},s),px.getWithHeight(a,r)),{},{payload:c,item:a})},RD=e(eD()),zD=e(nD()),cse=e(yoe()),BD=e(boe());function VD(e){"@babel/helpers - typeof";return VD=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},VD(e)}function HD(e){return fse(e)||dse(e)||use(e)||lse()}function lse(){throw TypeError(`Invalid attempt to spread non-iterable instance.
134
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function use(e,t){if(e){if(typeof e==`string`)return UD(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 UD(e,t)}}function dse(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function fse(e){if(Array.isArray(e))return UD(e)}function UD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function WD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GD(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WD(Object(n),!0).forEach(function(t){KD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KD(e,t,n){return t=pse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pse(e){var t=mse(e,`string`);return VD(t)==`symbol`?t:t+``}function mse(e,t){if(VD(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(VD(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function qD(e,t,n){return(0,Bg.default)(e)||(0,Bg.default)(t)?n:Ug(t)?(0,zg.default)(e,t,n):(0,n_.default)(t)?t(e):n}function JD(e,t,n,r){var i=(0,cse.default)(e,function(e){return qD(e,t)});if(n===`number`){var a=i.filter(function(e){return q(e)||parseFloat(e)});return a.length?[(0,zD.default)(a),(0,RD.default)(a)]:[1/0,-1/0]}return(r?i.filter(function(e){return!(0,Bg.default)(e)}):i).map(function(e){return Ug(e)||e instanceof Date?e:``})}var hse=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=-1,a=t?.length??0;if(a<=1)return 0;if(r&&r.axisType===`angleAxis`&&Math.abs(Math.abs(r.range[1]-r.range[0])-360)<=1e-6)for(var o=r.range,s=0;s<a;s++){var c=s>0?n[s-1].coordinate:n[a-1].coordinate,l=n[s].coordinate,u=s>=a-1?n[0].coordinate:n[s+1].coordinate,d=void 0;if(Vg(l-c)!==Vg(u-l)){var f=[];if(Vg(u-l)===Vg(o[1]-o[0])){d=u;var p=l+o[1]-o[0];f[0]=Math.min(p,(p+c)/2),f[1]=Math.max(p,(p+c)/2)}else{d=c;var m=u+o[1]-o[0];f[0]=Math.min(l,(m+l)/2),f[1]=Math.max(l,(m+l)/2)}var h=[Math.min(l,(d+l)/2),Math.max(l,(d+l)/2)];if(e>h[0]&&e<=h[1]||e>=f[0]&&e<=f[1]){i=n[s].index;break}}else{var g=Math.min(c,u),_=Math.max(c,u);if(e>(g+l)/2&&e<=(_+l)/2){i=n[s].index;break}}}else for(var v=0;v<a;v++)if(v===0&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v>0&&v<a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2&&e<=(t[v].coordinate+t[v+1].coordinate)/2||v===a-1&&e>(t[v].coordinate+t[v-1].coordinate)/2){i=t[v].index;break}return i},YD=function(e){var t,n=e.type.displayName,r=(t=e.type)!=null&&t.defaultProps?GD(GD({},e.type.defaultProps),e.props):e.props,i=r.stroke,a=r.fill,o;switch(n){case`Line`:o=i;break;case`Area`:case`Radar`:o=i&&i!==`none`?i:a;break;default:o=a;break}return o},gse=function(e){var t=e.barSize,n=e.totalSize,r=e.stackGroups,i=r===void 0?{}:r;if(!i)return{};for(var a={},o=Object.keys(i),s=0,c=o.length;s<c;s++)for(var l=i[o[s]].stackGroups,u=Object.keys(l),d=0,f=u.length;d<f;d++){var p=l[u[d]],m=p.items,h=p.cateAxisId,g=m.filter(function(e){return o_(e.type).indexOf(`Bar`)>=0});if(g&&g.length){var _=g[0].type.defaultProps,v=_===void 0?g[0].props:GD(GD({},_),g[0].props),y=v.barSize,b=v[h];a[b]||(a[b]=[]);var x=(0,Bg.default)(y)?t:y;a[b].push({item:g[0],stackList:g.slice(1),barSize:(0,Bg.default)(x)?void 0:Gg(x,n,0)})}}return a},_se=function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,i=e.sizeList,a=i===void 0?[]:i,o=e.maxBarSize,s=a.length;if(s<1)return null;var c=Gg(t,r,0,!0),l,u=[];if(a[0].barSize===+a[0].barSize){var d=!1,f=r/s,p=a.reduce(function(e,t){return e+t.barSize||0},0);p+=(s-1)*c,p>=r&&(p-=(s-1)*c,c=0),p>=r&&f>0&&(d=!0,f*=.9,p=s*f);var m={offset:((r-p)/2>>0)-c,size:0};l=a.reduce(function(e,t){var n={item:t.item,position:{offset:m.offset+m.size+c,size:d?f:t.barSize}},r=[].concat(HD(e),[n]);return m=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:m})}),r},u)}else{var h=Gg(n,r,0,!0);r-2*h-(s-1)*c<=0&&(c=0);var g=(r-2*h-(s-1)*c)/s;g>1&&(g>>=0);var _=o===+o?Math.min(g,o):g;l=a.reduce(function(e,t,n){var r=[].concat(HD(e),[{item:t.item,position:{offset:h+(g+c)*n+(g-_)/2,size:_}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return l},vse=function(e,t,n,r){var i=n.children,a=n.width,o=n.margin,s=LD({children:i,legendWidth:a-(o.left||0)-(o.right||0)});if(s){var c=r||{},l=c.width,u=c.height,d=s.align,f=s.verticalAlign,p=s.layout;if((p===`vertical`||p===`horizontal`&&f===`middle`)&&d!==`center`&&q(e[d]))return GD(GD({},e),{},KD({},d,e[d]+(l||0)));if((p===`horizontal`||p===`vertical`&&d===`center`)&&f!==`middle`&&q(e[f]))return GD(GD({},e),{},KD({},f,e[f]+(u||0)))}return e},yse=function(e,t,n){return(0,Bg.default)(t)?!0:e===`horizontal`?t===`yAxis`:e===`vertical`||n===`x`?t===`xAxis`:n===`y`?t===`yAxis`:!0},XD=function(e,t,n,r,i){var a=t.props.children,o=u_(a,ND).filter(function(e){return yse(r,i,e.props.direction)});if(o&&o.length){var s=o.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=qD(t,n);if((0,Bg.default)(r))return e;var i=Array.isArray(r)?[(0,zD.default)(r),(0,RD.default)(r)]:[r,r],a=s.reduce(function(e,n){var r=qD(t,n,0),a=i[0]-Math.abs(Array.isArray(r)?r[0]:r),o=i[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(a,e[0]),Math.max(o,e[1])]},[1/0,-1/0]);return[Math.min(a[0],e[0]),Math.max(a[1],e[1])]},[1/0,-1/0])}return null},bse=function(e,t,n,r,i){var a=t.map(function(t){return XD(e,t,n,i,r)}).filter(function(e){return!(0,Bg.default)(e)});return a&&a.length?a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null},ZD=function(e,t,n,r,i){var a=t.map(function(t){var a=t.props.dataKey;return n===`number`&&a&&XD(e,t,a,r)||JD(e,a,n,i)});if(n===`number`)return a.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var o={};return a.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)o[t[n]]||(o[t[n]]=!0,e.push(t[n]));return e},[])},QD=function(e,t){return e===`horizontal`&&t===`xAxis`||e===`vertical`&&t===`yAxis`||e===`centric`&&t===`angleAxis`||e===`radial`&&t===`radiusAxis`},$D=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var i,a,o=e.map(function(e){return e.coordinate===t&&(i=!0),e.coordinate===n&&(a=!0),e.coordinate});return i||o.push(t),a||o.push(n),o},eO=function(e,t,n){if(!e)return null;var r=e.scale,i=e.duplicateDomain,a=e.type,o=e.range,s=e.realScaleType===`scaleBand`?r.bandwidth()/2:2,c=(t||n)&&a===`category`&&r.bandwidth?r.bandwidth()/s:0;return c=e.axisType===`angleAxis`&&o?.length>=2?Vg(o[0]-o[1])*2*c:c,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map(function(e){return{coordinate:r(i?i.indexOf(e):e)+c,value:e,offset:c}}).filter(function(e){return!(0,Rg.default)(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+c,value:e,index:t,offset:c}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+c,value:e,offset:c}}):r.domain().map(function(e,t){return{coordinate:r(e)+c,value:i?i[e]:e,index:t,offset:c}})},tO=new WeakMap,nO=function(e,t){if(typeof t!=`function`)return e;tO.has(e)||tO.set(e,new WeakMap);var n=tO.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},rO=function(e,t,n){var r=e.scale,i=e.type,a=e.layout,o=e.axisType;if(r===`auto`)return a===`radial`&&o===`radiusAxis`?{scale:gC(),realScaleType:`band`}:a===`radial`&&o===`angleAxis`?{scale:ww(),realScaleType:`linear`}:i===`category`&&t&&(t.indexOf(`LineChart`)>=0||t.indexOf(`AreaChart`)>=0||t.indexOf(`ComposedChart`)>=0&&!n)?{scale:vC(),realScaleType:`point`}:i===`category`?{scale:gC(),realScaleType:`band`}:{scale:ww(),realScaleType:`linear`};if((0,Lg.default)(r)){var s=`scale${(0,Wv.default)(r)}`;return{scale:(ZE[s]||vC)(),realScaleType:ZE[s]?s:`point`}}return(0,n_.default)(r)?{scale:r}:{scale:vC(),realScaleType:`point`}},iO=1e-4,aO=function(e){var t=e.domain();if(!(!t||t.length<=2)){var n=t.length,r=e.range(),i=Math.min(r[0],r[1])-iO,a=Math.max(r[0],r[1])+iO,o=e(t[0]),s=e(t[n-1]);(o<i||o>a||s<i||s>a)&&e.domain([t[0],t[n-1]])}},xse=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null},Sse=function(e,t){if(!t||t.length!==2||!q(t[0])||!q(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),i=[e[0],e[1]];return(!q(e[0])||e[0]<n)&&(i[0]=n),(!q(e[1])||e[1]>r)&&(i[1]=r),i[0]>r&&(i[0]=r),i[1]<n&&(i[1]=n),i},Cse={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0,o=0;o<t;++o){var s=(0,Rg.default)(e[o][n][1])?e[o][n][0]:e[o][n][1];s>=0?(e[o][n][0]=i,e[o][n][1]=i+s,i=e[o][n][1]):(e[o][n][0]=a,e[o][n][1]=a+s,a=e[o][n][1])}},expand:Vv,none:Iv,silhouette:Hv,wiggle:Uv,positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var i=0,a=0;a<t;++a){var o=(0,Rg.default)(e[a][n][1])?e[a][n][0]:e[a][n][1];o>=0?(e[a][n][0]=i,e[a][n][1]=i+o,i=e[a][n][1]):(e[a][n][0]=0,e[a][n][1]=0)}}},wse=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),i=Cse[n];return Bv().keys(r).value(function(e,t){return+qD(e,t,0)}).order(Lv).offset(i)(e)},Tse=function(e,t,n,r,i,a){if(!e)return null;var o=(a?t.reverse():t).reduce(function(e,t){var i,a=(i=t.type)!=null&&i.defaultProps?GD(GD({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(a.hide)return e;var s=a[n],c=e[s]||{hasStack:!1,stackGroups:{}};if(Ug(o)){var l=c.stackGroups[o]||{numericAxisId:n,cateAxisId:r,items:[]};l.items.push(t),c.hasStack=!0,c.stackGroups[o]=l}else c.stackGroups[Wg(`_stackId_`)]={numericAxisId:n,cateAxisId:r,items:[t]};return GD(GD({},e),{},KD({},s,c))},{});return Object.keys(o).reduce(function(t,a){var s=o[a];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce(function(t,a){var o=s.stackGroups[a];return GD(GD({},t),{},KD({},a,{numericAxisId:n,cateAxisId:r,items:o.items,stackedData:wse(e,o.items,i)}))},{})),GD(GD({},t),{},KD({},a,s))},{})},oO=function(e,t){var n=t.realScaleType,r=t.type,i=t.tickCount,a=t.originalDomain,o=t.allowDecimals,s=n||t.scale;if(s!==`auto`&&s!==`linear`)return null;if(i&&r===`number`&&a&&(a[0]===`auto`||a[1]===`auto`)){var c=e.domain();if(!c.length)return null;var l=Hoe(c,i,o);return e.domain([(0,zD.default)(l),(0,RD.default)(l)]),{niceTicks:l}}return i&&r===`number`?{niceTicks:Uoe(e.domain(),i,o)}:null};function sO(e){var t=e.axis,n=e.ticks,r=e.bandSize,i=e.entry,a=e.index,o=e.dataKey;if(t.type===`category`){if(!t.allowDuplicatedCategory&&t.dataKey&&!(0,Bg.default)(i[t.dataKey])){var s=Jg(n,`value`,i[t.dataKey]);if(s)return s.coordinate+r/2}return n[a]?n[a].coordinate+r/2:null}var c=qD(i,(0,Bg.default)(o)?t.dataKey:o);return(0,Bg.default)(c)?null:t.scale(c)}var cO=function(e){var t=e.axis,n=e.ticks,r=e.offset,i=e.bandSize,a=e.entry,o=e.index;if(t.type===`category`)return n[o]?n[o].coordinate+r:null;var s=qD(a,t.dataKey,t.domain[o]);return(0,Bg.default)(s)?null:t.scale(s)-i/2+r},Ese=function(e){var t=e.numericAxis,n=t.scale.domain();if(t.type===`number`){var r=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return r<=0&&i>=0?0:i<0?i:r}return n[0]},Dse=function(e,t){var n,r=((n=e.type)!=null&&n.defaultProps?GD(GD({},e.type.defaultProps),e.props):e.props).stackId;if(Ug(r)){var i=t[r];if(i){var a=i.items.indexOf(e);return a>=0?i.stackedData[a]:null}}return null},Ose=function(e){return e.reduce(function(e,t){return[(0,zD.default)(t.concat([e[0]]).filter(q)),(0,RD.default)(t.concat([e[1]]).filter(q))]},[1/0,-1/0])},lO=function(e,t,n){return Object.keys(e).reduce(function(r,i){var a=e[i].stackedData.reduce(function(e,r){var i=Ose(r.slice(t,n+1));return[Math.min(e[0],i[0]),Math.max(e[1],i[1])]},[1/0,-1/0]);return[Math.min(a[0],r[0]),Math.max(a[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},uO=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,dO=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fO=function(e,t,n){if((0,n_.default)(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(q(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(uO.test(e[0])){var i=+uO.exec(e[0])[1];r[0]=t[0]-i}else (0,n_.default)(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if(q(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(dO.test(e[1])){var a=+dO.exec(e[1])[1];r[1]=t[1]+a}else (0,n_.default)(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},pO=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=(0,Fx.default)(t,function(e){return e.coordinate}),a=1/0,o=1,s=i.length;o<s;o++){var c=i[o],l=i[o-1];a=Math.min((c.coordinate||0)-(l.coordinate||0),a)}return a===1/0?0:a}return n?void 0:0},mO=function(e,t,n){return!e||!e.length||(0,BD.default)(e,(0,zg.default)(n,`type.defaultProps.domain`))?t:e},hO=function(e,t){var n=e.type.defaultProps?GD(GD({},e.type.defaultProps),e.props):e.props,r=n.dataKey,i=n.name,a=n.unit,o=n.formatter,s=n.tooltipType,c=n.chartType,l=n.hide;return GD(GD({},J(e,!1)),{},{dataKey:r,unit:a,formatter:o,name:i||r,color:YD(e),value:qD(t,r),type:s,payload:t,chartType:c,hide:l})};function gO(e){"@babel/helpers - typeof";return gO=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},gO(e)}function _O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_O(Object(n),!0).forEach(function(t){yO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_O(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yO(e,t,n){return t=kse(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kse(e){var t=Ase(e,`string`);return gO(t)==`symbol`?t:t+``}function Ase(e,t){if(gO(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(gO(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function jse(e,t){return SO(e)||xO(e,t)||Nse(e,t)||Mse()}function Mse(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
135
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nse(e,t){if(e){if(typeof e==`string`)return bO(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 bO(e,t)}}function bO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xO(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function SO(e){if(Array.isArray(e))return e}var CO=Math.PI/180,wO=function(e){return e*180/Math.PI},TO=function(e,t,n,r){return{x:e+Math.cos(-CO*r)*n,y:t+Math.sin(-CO*r)*n}},EO=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(t-(n.top||0)-(n.bottom||0)))/2},DO=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.startAngle,c=e.endAngle,l=Gg(e.cx,a,a/2),u=Gg(e.cy,o,o/2),d=EO(a,o,n),f=Gg(e.innerRadius,d,0),p=Gg(e.outerRadius,d,d*.8);return Object.keys(t).reduce(function(e,n){var a=t[n],o=a.domain,d=a.reversed,m;if((0,Bg.default)(a.range))r===`angleAxis`?m=[s,c]:r===`radiusAxis`&&(m=[f,p]),d&&(m=[m[1],m[0]]);else{m=a.range;var h=jse(m,2);s=h[0],c=h[1]}var g=rO(a,i),_=g.realScaleType,v=g.scale;v.domain(o).range(m),aO(v);var y=oO(v,vO(vO({},a),{},{realScaleType:_})),b=vO(vO(vO({},a),y),{},{range:m,radius:p,realScaleType:_,scale:v,cx:l,cy:u,innerRadius:f,outerRadius:p,startAngle:s,endAngle:c});return vO(vO({},e),{},yO({},n,b))},{})},OO=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return Math.sqrt((n-i)**2+(r-a)**2)},kO=function(e,t){var n=e.x,r=e.y,i=t.cx,a=t.cy,o=OO({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o};var s=(n-i)/o,c=Math.acos(s);return r>a&&(c=2*Math.PI-c),{radius:o,angle:wO(c),angleInRadian:c}},AO=function(e){var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},jO=function(e,t){var n=t.startAngle,r=t.endAngle,i=Math.floor(n/360),a=Math.floor(r/360);return e+Math.min(i,a)*360},MO=function(e,t){var n=e.x,r=e.y,i=kO({x:n,y:r},t),a=i.radius,o=i.angle,s=t.innerRadius,c=t.outerRadius;if(a<s||a>c)return!1;if(a===0)return!0;var l=AO(t),u=l.startAngle,d=l.endAngle,f=o,p;if(u<=d){for(;f>d;)f-=360;for(;f<u;)f+=360;p=f>=u&&f<=d}else{for(;f>u;)f-=360;for(;f<d;)f+=360;p=f>=d&&f<=u}return p?vO(vO({},t),{},{radius:a,angle:jO(f,t)}):null},NO=function(e){return!(0,u.isValidElement)(e)&&!(0,n_.default)(e)&&typeof e!=`boolean`?e.className:``};function PO(e){"@babel/helpers - typeof";return PO=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},PO(e)}var FO=[`offset`];function IO(e){return BO(e)||zO(e)||RO(e)||LO()}function LO(){throw TypeError(`Invalid attempt to spread non-iterable instance.
136
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RO(e,t){if(e){if(typeof e==`string`)return VO(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 VO(e,t)}}function zO(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function BO(e){if(Array.isArray(e))return VO(e)}function VO(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function HO(e,t){if(e==null)return{};var n=UO(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function UO(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 WO(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function GO(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?WO(Object(n),!0).forEach(function(t){KO(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):WO(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function KO(e,t,n){return t=qO(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qO(e){var t=JO(e,`string`);return PO(t)==`symbol`?t:t+``}function JO(e,t){if(PO(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(PO(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function YO(){return YO=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},YO.apply(this,arguments)}var XO=function(e){var t=e.value,n=e.formatter,r=(0,Bg.default)(e.children)?t:e.children;return(0,n_.default)(n)?n(r):r},ZO=function(e,t){return Vg(t-e)*Math.min(Math.abs(t-e),360)},QO=function(e,t,n){var r=e.position,i=e.viewBox,a=e.offset,o=e.className,s=i,c=s.cx,l=s.cy,d=s.innerRadius,f=s.outerRadius,p=s.startAngle,m=s.endAngle,h=s.clockWise,g=(d+f)/2,_=ZO(p,m),v=_>=0?1:-1,y,b;r===`insideStart`?(y=p+v*a,b=h):r===`insideEnd`?(y=m-v*a,b=!h):r===`end`&&(y=m+v*a,b=h),b=_<=0?b:!b;var x=TO(c,l,g,y),S=TO(c,l,g,y+(b?1:-1)*359),C=`M${x.x},${x.y}
137
+ A${g},${g},0,1,${b?0:1},
138
+ ${S.x},${S.y}`,w=(0,Bg.default)(e.id)?Wg(`recharts-radial-line-`):e.id;return u.createElement(`text`,YO({},n,{dominantBaseline:`central`,className:Mt(`recharts-radial-bar-label`,o)}),u.createElement(`defs`,null,u.createElement(`path`,{id:w,d:C})),u.createElement(`textPath`,{xlinkHref:`#${w}`},t))},$O=function(e){var t=e.viewBox,n=e.offset,r=e.position,i=t,a=i.cx,o=i.cy,s=i.innerRadius,c=i.outerRadius,l=(i.startAngle+i.endAngle)/2;if(r===`outside`){var u=TO(a,o,c+n,l),d=u.x;return{x:d,y:u.y,textAnchor:d>=a?`start`:`end`,verticalAnchor:`middle`}}if(r===`center`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`middle`};if(r===`centerTop`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`start`};if(r===`centerBottom`)return{x:a,y:o,textAnchor:`middle`,verticalAnchor:`end`};var f=TO(a,o,(s+c)/2,l);return{x:f.x,y:f.y,textAnchor:`middle`,verticalAnchor:`middle`}},ek=function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,i=e.position,a=t,o=a.x,s=a.y,c=a.width,l=a.height,u=l>=0?1:-1,d=u*r,f=u>0?`end`:`start`,p=u>0?`start`:`end`,m=c>=0?1:-1,h=m*r,g=m>0?`end`:`start`,_=m>0?`start`:`end`;if(i===`top`)return GO(GO({},{x:o+c/2,y:s-u*r,textAnchor:`middle`,verticalAnchor:f}),n?{height:Math.max(s-n.y,0),width:c}:{});if(i===`bottom`)return GO(GO({},{x:o+c/2,y:s+l+d,textAnchor:`middle`,verticalAnchor:p}),n?{height:Math.max(n.y+n.height-(s+l),0),width:c}:{});if(i===`left`){var v={x:o-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`};return GO(GO({},v),n?{width:Math.max(v.x-n.x,0),height:l}:{})}if(i===`right`){var y={x:o+c+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`};return GO(GO({},y),n?{width:Math.max(n.x+n.width-y.x,0),height:l}:{})}var b=n?{width:c,height:l}:{};return i===`insideLeft`?GO({x:o+h,y:s+l/2,textAnchor:_,verticalAnchor:`middle`},b):i===`insideRight`?GO({x:o+c-h,y:s+l/2,textAnchor:g,verticalAnchor:`middle`},b):i===`insideTop`?GO({x:o+c/2,y:s+d,textAnchor:`middle`,verticalAnchor:p},b):i===`insideBottom`?GO({x:o+c/2,y:s+l-d,textAnchor:`middle`,verticalAnchor:f},b):i===`insideTopLeft`?GO({x:o+h,y:s+d,textAnchor:_,verticalAnchor:p},b):i===`insideTopRight`?GO({x:o+c-h,y:s+d,textAnchor:g,verticalAnchor:p},b):i===`insideBottomLeft`?GO({x:o+h,y:s+l-d,textAnchor:_,verticalAnchor:f},b):i===`insideBottomRight`?GO({x:o+c-h,y:s+l-d,textAnchor:g,verticalAnchor:f},b):(0,Xg.default)(i)&&(q(i.x)||Hg(i.x))&&(q(i.y)||Hg(i.y))?GO({x:o+Gg(i.x,c),y:s+Gg(i.y,l),textAnchor:`end`,verticalAnchor:`end`},b):GO({x:o+c/2,y:s+l/2,textAnchor:`middle`,verticalAnchor:`middle`},b)},tk=function(e){return`cx`in e&&q(e.cx)};function nk(e){var t=e.offset,n=t===void 0?5:t,r=HO(e,FO),i=GO({offset:n},r),a=i.viewBox,o=i.position,s=i.value,c=i.children,l=i.content,d=i.className,f=d===void 0?``:d,p=i.textBreakAll;if(!a||(0,Bg.default)(s)&&(0,Bg.default)(c)&&!(0,u.isValidElement)(l)&&!(0,n_.default)(l))return null;if((0,u.isValidElement)(l))return(0,u.cloneElement)(l,i);var m;if((0,n_.default)(l)){if(m=(0,u.createElement)(l,i),(0,u.isValidElement)(m))return m}else m=XO(i);var h=tk(a),g=J(i,!0);if(h&&(o===`insideStart`||o===`insideEnd`||o===`end`))return QO(i,m,g);var _=h?$O(i):ek(i);return u.createElement(YS,YO({className:Mt(`recharts-label`,f)},g,_,{breakAll:p}),m)}nk.displayName=`Label`;var rk=function(e){var t=e.cx,n=e.cy,r=e.angle,i=e.startAngle,a=e.endAngle,o=e.r,s=e.radius,c=e.innerRadius,l=e.outerRadius,u=e.x,d=e.y,f=e.top,p=e.left,m=e.width,h=e.height,g=e.clockWise,_=e.labelViewBox;if(_)return _;if(q(m)&&q(h)){if(q(u)&&q(d))return{x:u,y:d,width:m,height:h};if(q(f)&&q(p))return{x:f,y:p,width:m,height:h}}return q(u)&&q(d)?{x:u,y:d,width:0,height:0}:q(t)&&q(n)?{cx:t,cy:n,startAngle:i||r||0,endAngle:a||r||0,innerRadius:c||0,outerRadius:l||s||o||0,clockWise:g}:e.viewBox?e.viewBox:{}},ik=function(e,t){return e?e===!0?u.createElement(nk,{key:`label-implicit`,viewBox:t}):Ug(e)?u.createElement(nk,{key:`label-implicit`,viewBox:t,value:e}):(0,u.isValidElement)(e)?e.type===nk?(0,u.cloneElement)(e,{key:`label-implicit`,viewBox:t}):u.createElement(nk,{key:`label-implicit`,content:e,viewBox:t}):(0,n_.default)(e)?u.createElement(nk,{key:`label-implicit`,content:e,viewBox:t}):(0,Xg.default)(e)?u.createElement(nk,YO({viewBox:t},e,{key:`label-implicit`})):null:null};nk.parseViewBox=rk,nk.renderCallByParent=function(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,i=rk(e),a=u_(r,nk).map(function(e,n){return(0,u.cloneElement)(e,{viewBox:t||i,key:`label-${n}`})});return n?[ik(e.label,t||i)].concat(IO(a)):a};var ak=e(r(((e,t)=>{function n(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}t.exports=n}))());function ok(e){"@babel/helpers - typeof";return ok=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ok(e)}var sk=[`valueAccessor`],ck=[`data`,`dataKey`,`clockWise`,`id`,`textBreakAll`];function lk(e){return pk(e)||fk(e)||dk(e)||uk()}function uk(){throw TypeError(`Invalid attempt to spread non-iterable instance.
139
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dk(e,t){if(e){if(typeof e==`string`)return mk(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 mk(e,t)}}function fk(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function pk(e){if(Array.isArray(e))return mk(e)}function mk(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function hk(){return hk=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},hk.apply(this,arguments)}function gk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gk(Object(n),!0).forEach(function(t){vk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vk(e,t,n){return t=yk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yk(e){var t=bk(e,`string`);return ok(t)==`symbol`?t:t+``}function bk(e,t){if(ok(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ok(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function xk(e,t){if(e==null)return{};var n=Sk(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Sk(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 Ck=function(e){return Array.isArray(e.value)?(0,ak.default)(e.value):e.value};function wk(e){var t=e.valueAccessor,n=t===void 0?Ck:t,r=xk(e,sk),i=r.data,a=r.dataKey,o=r.clockWise,s=r.id,c=r.textBreakAll,l=xk(r,ck);return!i||!i.length?null:u.createElement(b_,{className:`recharts-label-list`},i.map(function(e,t){var r=(0,Bg.default)(a)?n(e,t):qD(e&&e.payload,a),i=(0,Bg.default)(s)?{}:{id:`${s}-${t}`};return u.createElement(nk,hk({},J(e,!0),l,i,{parentViewBox:e.parentViewBox,value:r,textBreakAll:c,viewBox:nk.parseViewBox((0,Bg.default)(o)?e:_k(_k({},e),{},{clockWise:o})),key:`label-${t}`,index:t}))}))}wk.displayName=`LabelList`;function Tk(e,t){return e?e===!0?u.createElement(wk,{key:`labelList-implicit`,data:t}):u.isValidElement(e)||(0,n_.default)(e)?u.createElement(wk,{key:`labelList-implicit`,data:t,content:e}):(0,Xg.default)(e)?u.createElement(wk,hk({data:t},e,{key:`labelList-implicit`})):null:null}function Ek(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,i=u_(r,wk).map(function(e,n){return(0,u.cloneElement)(e,{data:t,key:`labelList-${n}`})});return n?[Tk(e.label,t)].concat(lk(i)):i}wk.renderCallByParent=Ek;function Dk(e){"@babel/helpers - typeof";return Dk=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Dk(e)}function Ok(){return Ok=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},Ok.apply(this,arguments)}function kk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ak(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?kk(Object(n),!0).forEach(function(t){jk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function jk(e,t,n){return t=Mk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mk(e){var t=Nk(e,`string`);return Dk(t)==`symbol`?t:t+``}function Nk(e,t){if(Dk(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Dk(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Pk=function(e,t){return Vg(t-e)*Math.min(Math.abs(t-e),359.999)},Fk=function(e){var t=e.cx,n=e.cy,r=e.radius,i=e.angle,a=e.sign,o=e.isExternal,s=e.cornerRadius,c=e.cornerIsExternal,l=s*(o?1:-1)+r,u=Math.asin(s/l)/CO,d=c?i:i+a*u,f=TO(t,n,l,d),p=TO(t,n,r,d),m=c?i-a*u:i;return{center:f,circleTangency:p,lineTangency:TO(t,n,l*Math.cos(u*CO),m),theta:u}},Ik=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.startAngle,o=e.endAngle,s=Pk(a,o),c=a+s,l=TO(t,n,i,a),u=TO(t,n,i,c),d=`M ${l.x},${l.y}
140
+ A ${i},${i},0,
141
+ ${+(Math.abs(s)>180)},${+(a>c)},
142
+ ${u.x},${u.y}
143
+ `;if(r>0){var f=TO(t,n,r,a),p=TO(t,n,r,c);d+=`L ${p.x},${p.y}
144
+ A ${r},${r},0,
145
+ ${+(Math.abs(s)>180)},${+(a<=c)},
146
+ ${f.x},${f.y} Z`}else d+=`L ${t},${n} Z`;return d},Lk=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,i=e.outerRadius,a=e.cornerRadius,o=e.forceCornerRadius,s=e.cornerIsExternal,c=e.startAngle,l=e.endAngle,u=Vg(l-c),d=Fk({cx:t,cy:n,radius:i,angle:c,sign:u,cornerRadius:a,cornerIsExternal:s}),f=d.circleTangency,p=d.lineTangency,m=d.theta,h=Fk({cx:t,cy:n,radius:i,angle:l,sign:-u,cornerRadius:a,cornerIsExternal:s}),g=h.circleTangency,_=h.lineTangency,v=h.theta,y=s?Math.abs(c-l):Math.abs(c-l)-m-v;if(y<0)return o?`M ${p.x},${p.y}
147
+ a${a},${a},0,0,1,${a*2},0
148
+ a${a},${a},0,0,1,${-a*2},0
149
+ `:Ik({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:l});var b=`M ${p.x},${p.y}
150
+ A${a},${a},0,0,${+(u<0)},${f.x},${f.y}
151
+ A${i},${i},0,${+(y>180)},${+(u<0)},${g.x},${g.y}
152
+ A${a},${a},0,0,${+(u<0)},${_.x},${_.y}
153
+ `;if(r>0){var x=Fk({cx:t,cy:n,radius:r,angle:c,sign:u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),S=x.circleTangency,C=x.lineTangency,w=x.theta,T=Fk({cx:t,cy:n,radius:r,angle:l,sign:-u,isExternal:!0,cornerRadius:a,cornerIsExternal:s}),E=T.circleTangency,D=T.lineTangency,O=T.theta,k=s?Math.abs(c-l):Math.abs(c-l)-w-O;if(k<0&&a===0)return`${b}L${t},${n}Z`;b+=`L${D.x},${D.y}
154
+ A${a},${a},0,0,${+(u<0)},${E.x},${E.y}
155
+ A${r},${r},0,${+(k>180)},${+(u>0)},${S.x},${S.y}
156
+ A${a},${a},0,0,${+(u<0)},${C.x},${C.y}Z`}else b+=`L${t},${n}Z`;return b},Rk={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},zk=function(e){var t=Ak(Ak({},Rk),e),n=t.cx,r=t.cy,i=t.innerRadius,a=t.outerRadius,o=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,l=t.startAngle,d=t.endAngle,f=t.className;if(a<i||l===d)return null;var p=Mt(`recharts-sector`,f),m=a-i,h=Gg(o,m,0,!0),g=h>0&&Math.abs(l-d)<360?Lk({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(h,m/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:l,endAngle:d}):Ik({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:l,endAngle:d});return u.createElement(`path`,Ok({},J(t,!0),{className:p,d:g,role:`img`}))};function Bk(e){"@babel/helpers - typeof";return Bk=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Bk(e)}function Vk(){return Vk=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},Vk.apply(this,arguments)}function Hk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Uk(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Hk(Object(n),!0).forEach(function(t){Wk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wk(e,t,n){return t=Gk(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Gk(e){var t=Kk(e,`string`);return Bk(t)==`symbol`?t:t+``}function Kk(e,t){if(Bk(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Bk(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var qk={curveBasisClosed:hv,curveBasisOpen:_v,curveBasis:pv,curveBumpX:U_,curveBumpY:W_,curveLinearClosed:yv,curveLinear:L_,curveMonotoneX:Dv,curveMonotoneY:Ov,curveNatural:jv,curveStep:Nv,curveStepAfter:Fv,curveStepBefore:Pv},Jk=function(e){return e.x===+e.x&&e.y===+e.y},Yk=function(e){return e.x},Xk=function(e){return e.y},Zk=function(e,t){if((0,n_.default)(e))return e;var n=`curve${(0,Wv.default)(e)}`;return(n===`curveMonotone`||n===`curveBump`)&&t?qk[`${n}${t===`vertical`?`Y`:`X`}`]:qk[n]||L_},Qk=function(e){var t=e.type,n=t===void 0?`linear`:t,r=e.points,i=r===void 0?[]:r,a=e.baseLine,o=e.layout,s=e.connectNulls,c=s===void 0?!1:s,l=Zk(n,o),u=c?i.filter(function(e){return Jk(e)}):i,d;if(Array.isArray(a)){var f=c?a.filter(function(e){return Jk(e)}):a,p=u.map(function(e,t){return Uk(Uk({},e),{},{base:f[t]})});return d=o===`vertical`?V_().y(Xk).x1(Yk).x0(function(e){return e.base.x}):V_().x(Yk).y1(Xk).y0(function(e){return e.base.y}),d.defined(Jk).curve(l),d(p)}return d=o===`vertical`&&q(a)?V_().y(Xk).x1(Yk).x0(a):q(a)?V_().x(Yk).y1(Xk).y0(a):B_().x(Yk).y(Xk),d.defined(Jk).curve(l),d(u)},$k=function(e){var t=e.className,n=e.points,r=e.path,i=e.pathRef;if((!n||!n.length)&&!r)return null;var a=n&&n.length?Qk(e):r;return u.createElement(`path`,Vk({},J(e,!1),e_(e),{className:Mt(`recharts-curve`,t),d:a,ref:i}))},eA=r(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),tA=r(((e,t)=>{var n=eA();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=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 s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={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:i,resetWarningCache:r};return a.PropTypes=a,a}})),nA=r(((e,t)=>{t.exports=tA()()})),{getOwnPropertyNames:rA,getOwnPropertySymbols:iA}=Object,{hasOwnProperty:aA}=Object.prototype;function oA(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function sA(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function cA(e){return e?.[Symbol.toStringTag]}function lA(e){return rA(e).concat(iA(e))}var uA=Object.hasOwn||((e,t)=>aA.call(e,t));function dA(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var fA=`__v`,pA=`__o`,mA=`_owner`,{getOwnPropertyDescriptor:hA,keys:gA}=Object;function _A(e,t){return e.byteLength===t.byteLength&&AA(new Uint8Array(e),new Uint8Array(t))}function vA(e,t,n){let 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 yA(e,t){return e.byteLength===t.byteLength&&AA(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function bA(e,t){return dA(e.getTime(),t.getTime())}function xA(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function SA(e,t){return e===t}function CA(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var wA=dA;function TA(e,t,n){let r=gA(e),i=r.length;if(gA(t).length!==i)return!1;for(;i-- >0;)if(!MA(e,t,n,r[i]))return!1;return!0}function EA(e,t,n){let r=lA(e),i=r.length;if(lA(t).length!==i)return!1;let a,o,s;for(;i-- >0;)if(a=r[i],!MA(e,t,n,a)||(o=hA(e,a),s=hA(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function DA(e,t){return dA(e.valueOf(),t.valueOf())}function OA(e,t){return e.source===t.source&&e.flags===t.flags}function kA(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function AA(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function jA(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 MA(e,t,n,r){return(r===mA||r===pA||r===fA)&&(e.$$typeof||t.$$typeof)?!0:uA(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var NA=`[object ArrayBuffer]`,PA=`[object Arguments]`,FA=`[object Boolean]`,IA=`[object DataView]`,LA=`[object Date]`,RA=`[object Error]`,zA=`[object Map]`,BA=`[object Number]`,VA=`[object Object]`,HA=`[object RegExp]`,UA=`[object Set]`,WA=`[object String]`,GA={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},KA=`[object URL]`,qA=Object.prototype.toString;function JA({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`?a(h,g,_):!1;let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);let b=qA.call(h);if(b===LA)return r(h,g,_);if(b===HA)return u(h,g,_);if(b===zA)return o(h,g,_);if(b===UA)return d(h,g,_);if(b===VA)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===KA)return p(h,g,_);if(b===RA)return i(h,g,_);if(b===PA)return c(h,g,_);if(GA[b])return f(h,g,_);if(b===NA)return e(h,g,_);if(b===IA)return n(h,g,_);if(b===FA||b===BA||b===WA)return l(h,g,_);if(m){let e=m[b];if(!e){let t=cA(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function YA({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:_A,areArraysEqual:n?EA:vA,areDataViewsEqual:yA,areDatesEqual:bA,areErrorsEqual:xA,areFunctionsEqual:SA,areMapsEqual:n?oA(CA,EA):CA,areNumbersEqual:wA,areObjectsEqual:n?EA:TA,arePrimitiveWrappersEqual:DA,areRegExpsEqual:OA,areSetsEqual:n?oA(kA,EA):kA,areTypedArraysEqual:n?oA(AA,EA):AA,areUrlsEqual:jA,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=sA(r.areArraysEqual),t=sA(r.areMapsEqual),n=sA(r.areObjectsEqual),i=sA(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:i})}return r}function XA(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function ZA({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}var QA=$A();$A({strict:!0}),$A({circular:!0}),$A({circular:!0,strict:!0}),$A({createInternalComparator:()=>dA}),$A({strict:!0,createInternalComparator:()=>dA}),$A({circular:!0,createInternalComparator:()=>dA}),$A({circular:!0,createInternalComparator:()=>dA,strict:!0});function $A(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=JA(YA(e));return ZA({circular:t,comparator:a,createState:r,equals:n?n(a):XA(a),strict:i})}function ej(e){typeof requestAnimationFrame<`u`&&requestAnimationFrame(e)}function tj(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1;requestAnimationFrame(function r(i){n<0&&(n=i),i-n>t?(e(i),n=-1):ej(r)})}function nj(e){"@babel/helpers - typeof";return nj=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},nj(e)}function rj(e){return cj(e)||sj(e)||aj(e)||ij()}function ij(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
157
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aj(e,t){if(e){if(typeof e==`string`)return oj(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 oj(e,t)}}function oj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sj(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function cj(e){if(Array.isArray(e))return e}function lj(){var e={},t=function(){return null},n=!1,r=function r(i){if(!n){if(Array.isArray(i)){if(!i.length)return;var a=rj(i),o=a[0],s=a.slice(1);if(typeof o==`number`){tj(r.bind(null,s),o);return}r(o),tj(r.bind(null,s));return}nj(i)===`object`&&(e=i,t(e)),typeof i==`function`&&i()}};return{stop:function(){n=!0},start:function(e){n=!1,r(e)},subscribe:function(e){return t=e,function(){t=function(){return null}}}}}function uj(e){"@babel/helpers - typeof";return uj=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},uj(e)}function dj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?dj(Object(n),!0).forEach(function(t){pj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pj(e,t,n){return t=mj(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mj(e){var t=hj(e,`string`);return uj(t)===`symbol`?t:String(t)}function hj(e,t){if(uj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(uj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var gj=function(e,t){return[Object.keys(e),Object.keys(t)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})})},_j=function(e){return e},vj=function(e){return e.replace(/([A-Z])/g,function(e){return`-${e.toLowerCase()}`})},yj=function(e,t){return Object.keys(t).reduce(function(n,r){return fj(fj({},n),{},pj({},r,e(r,t[r])))},{})},bj=function(e,t,n){return e.map(function(e){return`${vj(e)} ${t}ms ${n}`}).join(`,`)},xj=!1,Sj=function(e,t,n,r,i,a,o,s){if(xj&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var c=[n,r,i,a,o,s],l=0;console.warn(t.replace(/%s/g,function(){return c[l++]}))}};function Cj(e,t){return Ej(e)||Tj(e,t)||kj(e,t)||wj()}function wj(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
158
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tj(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ej(e){if(Array.isArray(e))return e}function Dj(e){return jj(e)||Aj(e)||kj(e)||Oj()}function Oj(){throw TypeError(`Invalid attempt to spread non-iterable instance.
159
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kj(e,t){if(e){if(typeof e==`string`)return Mj(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 Mj(e,t)}}function Aj(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function jj(e){if(Array.isArray(e))return Mj(e)}function Mj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var Nj=1e-4,Pj=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Fj=function(e,t){return e.map(function(e,n){return e*t**+n}).reduce(function(e,t){return e+t})},Ij=function(e,t){return function(n){return Fj(Pj(e,t),n)}},Lj=function(e,t){return function(n){var r=Pj(e,t);return Fj([].concat(Dj(r.map(function(e,t){return e*t}).slice(1)),[0]),n)}},Rj=function(){var e=[...arguments],t=e[0],n=e[1],r=e[2],i=e[3];if(e.length===1)switch(e[0]){case`linear`:t=0,n=0,r=1,i=1;break;case`ease`:t=.25,n=.1,r=.25,i=1;break;case`ease-in`:t=.42,n=0,r=1,i=1;break;case`ease-out`:t=.42,n=0,r=.58,i=1;break;case`ease-in-out`:t=0,n=0,r=.58,i=1;break;default:var a=e[0].split(`(`);if(a[0]===`cubic-bezier`&&a[1].split(`)`)[0].split(`,`).length===4){var o=Cj(a[1].split(`)`)[0].split(`,`).map(function(e){return parseFloat(e)}),4);t=o[0],n=o[1],r=o[2],i=o[3]}else Sj(!1,`[configBezier]: arguments should be one of oneOf 'linear', 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', instead received %s`,e)}Sj([t,r,n,i].every(function(e){return typeof e==`number`&&e>=0&&e<=1}),`[configBezier]: arguments should be x1, y1, x2, y2 of [0, 1] instead received %s`,e);var s=Ij(t,r),c=Ij(n,i),l=Lj(t,r),u=function(e){return e>1?1:e<0?0:e},d=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var i=s(n)-t,a=l(n);if(Math.abs(i-t)<Nj||a<Nj)return c(n);n=u(n-i/a)}return c(n)};return d.isStepper=!1,d},zj=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,n=t===void 0?100:t,r=e.damping,i=r===void 0?8:r,a=e.dt,o=a===void 0?17:a,s=function(e,t,r){var a=r+(-(e-t)*n-r*i)*o/1e3,s=r*o/1e3+e;return Math.abs(s-t)<Nj&&Math.abs(a)<Nj?[t,0]:[s,a]};return s.isStepper=!0,s.dt=o,s},Bj=function(){var e=[...arguments],t=e[0];if(typeof t==`string`)switch(t){case`ease`:case`ease-in-out`:case`ease-out`:case`ease-in`:case`linear`:return Rj(t);case`spring`:return zj();default:if(t.split(`(`)[0]===`cubic-bezier`)return Rj(t);Sj(!1,`[configEasing]: first argument should be one of 'ease', 'ease-in', 'ease-out', 'ease-in-out','cubic-bezier(x1,y1,x2,y2)', 'linear' and 'spring', instead received %s`,e)}return typeof t==`function`?t:(Sj(!1,`[configEasing]: first argument type should be function or string, instead received %s`,e),null)};function Vj(e){"@babel/helpers - typeof";return Vj=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Vj(e)}function Hj(e){return Gj(e)||Wj(e)||$j(e)||Uj()}function Uj(){throw TypeError(`Invalid attempt to spread non-iterable instance.
160
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wj(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Gj(e){if(Array.isArray(e))return eM(e)}function Kj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function qj(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Kj(Object(n),!0).forEach(function(t){Jj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jj(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=Xj(e,`string`);return Vj(t)===`symbol`?t:String(t)}function Xj(e,t){if(Vj(e)!==`object`||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Vj(r)!==`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Zj(e,t){return nM(e)||tM(e,t)||$j(e,t)||Qj()}function Qj(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
161
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $j(e,t){if(e){if(typeof e==`string`)return eM(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 eM(e,t)}}function eM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tM(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function nM(e){if(Array.isArray(e))return e}var rM=function(e,t,n){return e+(t-e)*n},iM=function(e){return e.from!==e.to},aM=function e(t,n,r){var i=yj(function(e,n){if(iM(n)){var r=Zj(t(n.from,n.to,n.velocity),2),i=r[0],a=r[1];return qj(qj({},n),{},{from:i,velocity:a})}return n},n);return r<1?yj(function(e,t){return iM(t)?qj(qj({},t),{},{velocity:rM(t.velocity,i[e].velocity,r),from:rM(t.from,i[e].from,r)}):t},n):e(t,i,r-1)},oM=(function(e,t,n,r,i){var a=gj(e,t),o=a.reduce(function(n,r){return qj(qj({},n),{},Jj({},r,[e[r],t[r]]))},{}),s=a.reduce(function(n,r){return qj(qj({},n),{},Jj({},r,{from:e[r],velocity:0,to:t[r]}))},{}),c=-1,l,u,d=function(){return null},f=function(){return yj(function(e,t){return t.from},s)},p=function(){return!Object.values(s).filter(iM).length};return d=n.isStepper?function(r){l||=r;var a=(r-l)/n.dt;s=aM(n,s,a),i(qj(qj(qj({},e),t),f(s))),l=r,p()||(c=requestAnimationFrame(d))}:function(a){u||=a;var s=(a-u)/r,l=yj(function(e,t){return rM.apply(void 0,Hj(t).concat([n(s)]))},o);if(i(qj(qj(qj({},e),t),l)),s<1)c=requestAnimationFrame(d);else{var f=yj(function(e,t){return rM.apply(void 0,Hj(t).concat([n(1)]))},o);i(qj(qj(qj({},e),t),f))}},function(){return requestAnimationFrame(d),function(){cancelAnimationFrame(c)}}}),sM=e(nA());function cM(e){"@babel/helpers - typeof";return cM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cM(e)}var lM=[`children`,`begin`,`duration`,`attributeName`,`easing`,`isActive`,`steps`,`from`,`to`,`canBegin`,`onAnimationEnd`,`shouldReAnimate`,`onAnimationReStart`];function uM(e,t){if(e==null)return{};var n=dM(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dM(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,a;for(a=0;a<r.length;a++)i=r[a],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function fM(e){return gM(e)||hM(e)||mM(e)||pM()}function pM(){throw TypeError(`Invalid attempt to spread non-iterable instance.
162
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mM(e,t){if(e){if(typeof e==`string`)return _M(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 _M(e,t)}}function hM(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function gM(e){if(Array.isArray(e))return _M(e)}function _M(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function vM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vM(Object(n),!0).forEach(function(t){bM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bM(e,t,n){return t=wM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xM(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function SM(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,wM(r.key),r)}}function CM(e,t,n){return t&&SM(e.prototype,t),n&&SM(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function wM(e){var t=TM(e,`string`);return cM(t)===`symbol`?t:String(t)}function TM(e,t){if(cM(e)!==`object`||e===null)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 TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function EM(e,t){if(typeof t!=`function`&&t!==null)throw 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&&DM(e,t)}function DM(e,t){return DM=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},DM(e,t)}function OM(e){var t=jM();return function(){var n=MM(e),r;if(t){var i=MM(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kM(this,r)}}function kM(e,t){if(t&&(cM(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return AM(e)}function AM(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function jM(){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 MM(e){return MM=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},MM(e)}var NM=function(e){EM(n,e);var t=OM(n);function n(e,r){var i;xM(this,n),i=t.call(this,e,r);var a=i.props,o=a.isActive,s=a.attributeName,c=a.from,l=a.to,u=a.steps,d=a.children,f=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(AM(i)),i.changeStyle=i.changeStyle.bind(AM(i)),!o||f<=0)return i.state={style:{}},typeof d==`function`&&(i.state={style:l}),kM(i);if(u&&u.length)i.state={style:u[0].style};else if(c){if(typeof d==`function`)return i.state={style:c},kM(i);i.state={style:s?bM({},s,c):c}}else i.state={style:{}};return i}return CM(n,[{key:`componentDidMount`,value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,!(!t||!n)&&this.runAnimation(this.props)}},{key:`componentDidUpdate`,value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,i=t.attributeName,a=t.shouldReAnimate,o=t.to,s=t.from,c=this.state.style;if(r){if(!n){var l={style:i?bM({},i,o):o};this.state&&c&&(i&&c[i]!==o||!i&&c!==o)&&this.setState(l);return}if(!(QA(e.to,o)&&e.canBegin&&e.isActive)){var u=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var d=u||a?s:e.to;if(this.state&&c){var f={style:i?bM({},i,d):d};(i&&c[i]!==d||!i&&c!==d)&&this.setState(f)}this.runAnimation(yM(yM({},this.props),{},{from:d,begin:0}))}}}},{key:`componentWillUnmount`,value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&=(this.manager.stop(),null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:`handleStyleChange`,value:function(e){this.changeStyle(e)}},{key:`changeStyle`,value:function(e){this.mounted&&this.setState({style:e})}},{key:`runJSAnimation`,value:function(e){var t=this,n=e.from,r=e.to,i=e.duration,a=e.easing,o=e.begin,s=e.onAnimationEnd,c=e.onAnimationStart,l=oM(n,r,Bj(a),i,this.changeStyle);this.manager.start([c,o,function(){t.stopJSAnimation=l()},i,s])}},{key:`runStepAnimation`,value:function(e){var t=this,n=e.steps,r=e.begin,i=e.onAnimationStart,a=n[0],o=a.style,s=a.duration,c=s===void 0?0:s;return this.manager.start([i].concat(fM(n.reduce(function(e,r,i){if(i===0)return e;var a=r.duration,o=r.easing,s=o===void 0?`ease`:o,c=r.style,l=r.properties,u=r.onAnimationEnd,d=i>0?n[i-1]:r,f=l||Object.keys(c);if(typeof s==`function`||s===`spring`)return[].concat(fM(e),[t.runJSAnimation.bind(t,{from:d.style,to:c,duration:a,easing:s}),a]);var p=bj(f,a,s),m=yM(yM(yM({},d.style),c),{},{transition:p});return[].concat(fM(e),[m,a,u]).filter(_j)},[o,Math.max(c,r)])),[e.onAnimationEnd]))}},{key:`runAnimation`,value:function(e){this.manager||=lj();var t=e.begin,n=e.duration,r=e.attributeName,i=e.to,a=e.easing,o=e.onAnimationStart,s=e.onAnimationEnd,c=e.steps,l=e.children,u=this.manager;if(this.unSubscribe=u.subscribe(this.handleStyleChange),typeof a==`function`||typeof l==`function`||a===`spring`){this.runJSAnimation(e);return}if(c.length>1){this.runStepAnimation(e);return}var d=r?bM({},r,i):i,f=bj(Object.keys(d),n,a);u.start([o,t,yM(yM({},d),{},{transition:f}),n,s])}},{key:`render`,value:function(){var e=this.props,t=e.children;e.begin;var n=e.duration;e.attributeName,e.easing;var r=e.isActive;e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart;var i=uM(e,lM),a=u.Children.count(t),o=this.state.style;if(typeof t==`function`)return t(o);if(!r||a===0||n<=0)return t;var s=function(e){var t=e.props,n=t.style,r=n===void 0?{}:n,a=t.className;return(0,u.cloneElement)(e,yM(yM({},i),{},{style:yM(yM({},r),o),className:a}))};return a===1?s(u.Children.only(t)):u.createElement(`div`,null,u.Children.map(t,function(e){return s(e)}))}}]),n}(u.PureComponent);NM.displayName=`Animate`,NM.defaultProps={begin:0,duration:1e3,from:``,to:``,attributeName:``,easing:`ease`,isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},NM.propTypes={from:sM.default.oneOfType([sM.default.object,sM.default.string]),to:sM.default.oneOfType([sM.default.object,sM.default.string]),attributeName:sM.default.string,duration:sM.default.number,begin:sM.default.number,easing:sM.default.oneOfType([sM.default.string,sM.default.func]),steps:sM.default.arrayOf(sM.default.shape({duration:sM.default.number.isRequired,style:sM.default.object.isRequired,easing:sM.default.oneOfType([sM.default.oneOf([`ease`,`ease-in`,`ease-out`,`ease-in-out`,`linear`]),sM.default.func]),properties:sM.default.arrayOf(`string`),onAnimationEnd:sM.default.func})),children:sM.default.oneOfType([sM.default.node,sM.default.func]),isActive:sM.default.bool,canBegin:sM.default.bool,onAnimationEnd:sM.default.func,shouldReAnimate:sM.default.bool,onAnimationStart:sM.default.func,onAnimationReStart:sM.default.func};var PM=NM;function FM(e){"@babel/helpers - typeof";return FM=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},FM(e)}function IM(){return IM=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},IM.apply(this,arguments)}function LM(e,t){return HM(e)||VM(e,t)||zM(e,t)||RM()}function RM(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
163
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zM(e,t){if(e){if(typeof e==`string`)return BM(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 BM(e,t)}}function BM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function VM(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function HM(e){if(Array.isArray(e))return e}function UM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WM(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?UM(Object(n),!0).forEach(function(t){GM(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UM(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function GM(e,t,n){return t=KM(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function KM(e){var t=qM(e,`string`);return FM(t)==`symbol`?t:t+``}function qM(e,t){if(FM(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(FM(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JM=function(e,t,n,r,i){var a=Math.min(Math.abs(n)/2,Math.abs(r)/2),o=r>=0?1:-1,s=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0,l;if(a>0&&i instanceof Array){for(var u=[0,0,0,0],d=0,f=4;d<f;d++)u[d]=i[d]>a?a:i[d];l=`M${e},${t+o*u[0]}`,u[0]>0&&(l+=`A ${u[0]},${u[0]},0,0,${c},${e+s*u[0]},${t}`),l+=`L ${e+n-s*u[1]},${t}`,u[1]>0&&(l+=`A ${u[1]},${u[1]},0,0,${c},
164
+ ${e+n},${t+o*u[1]}`),l+=`L ${e+n},${t+r-o*u[2]}`,u[2]>0&&(l+=`A ${u[2]},${u[2]},0,0,${c},
165
+ ${e+n-s*u[2]},${t+r}`),l+=`L ${e+s*u[3]},${t+r}`,u[3]>0&&(l+=`A ${u[3]},${u[3]},0,0,${c},
166
+ ${e},${t+r-o*u[3]}`),l+=`Z`}else if(a>0&&i===+i&&i>0){var p=Math.min(a,i);l=`M ${e},${t+o*p}
167
+ A ${p},${p},0,0,${c},${e+s*p},${t}
168
+ L ${e+n-s*p},${t}
169
+ A ${p},${p},0,0,${c},${e+n},${t+o*p}
170
+ L ${e+n},${t+r-o*p}
171
+ A ${p},${p},0,0,${c},${e+n-s*p},${t+r}
172
+ L ${e+s*p},${t+r}
173
+ A ${p},${p},0,0,${c},${e},${t+r-o*p} Z`}else l=`M ${e},${t} h ${n} v ${r} h ${-n} Z`;return l},YM=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,i=t.x,a=t.y,o=t.width,s=t.height;if(Math.abs(o)>0&&Math.abs(s)>0){var c=Math.min(i,i+o),l=Math.max(i,i+o),u=Math.min(a,a+s),d=Math.max(a,a+s);return n>=c&&n<=l&&r>=u&&r<=d}return!1},XM={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},ZM=function(e){var t=WM(WM({},XM),e),n=(0,u.useRef)(),r=LM((0,u.useState)(-1),2),i=r[0],a=r[1];(0,u.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.width,l=t.height,d=t.radius,f=t.className,p=t.animationEasing,m=t.animationDuration,h=t.animationBegin,g=t.isAnimationActive,_=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||c===0||l===0)return null;var v=Mt(`recharts-rectangle`,f);return _?u.createElement(PM,{canBegin:i>0,from:{width:c,height:l,x:o,y:s},to:{width:c,height:l,x:o,y:s},duration:m,animationEasing:p,isActive:_},function(e){var r=e.width,a=e.height,o=e.x,s=e.y;return u.createElement(PM,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:h,duration:m,isActive:g,easing:p},u.createElement(`path`,IM({},J(t,!0),{className:v,d:JM(o,s,r,a,d),ref:n})))}):u.createElement(`path`,IM({},J(t,!0),{className:v,d:JM(o,s,c,l,d)}))},QM=[`points`,`className`,`baseLinePoints`,`connectNulls`];function $M(){return $M=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},$M.apply(this,arguments)}function eN(e,t){if(e==null)return{};var n=tN(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tN(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 nN(e){return oN(e)||aN(e)||iN(e)||rN()}function rN(){throw TypeError(`Invalid attempt to spread non-iterable instance.
174
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iN(e,t){if(e){if(typeof e==`string`)return sN(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 sN(e,t)}}function aN(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function oN(e){if(Array.isArray(e))return sN(e)}function sN(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var cN=function(e){return e&&e.x===+e.x&&e.y===+e.y},lN=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];return e.forEach(function(e){cN(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),cN(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},uN=function(e,t){var n=lN(e);t&&(n=[n.reduce(function(e,t){return[].concat(nN(e),nN(t))},[])]);var r=n.map(function(e){return e.reduce(function(e,t,n){return`${e}${n===0?`M`:`L`}${t.x},${t.y}`},``)}).join(``);return n.length===1?`${r}Z`:r},dN=function(e,t,n){var r=uN(e,n);return`${r.slice(-1)===`Z`?r.slice(0,-1):r}L${uN(t.reverse(),n).slice(1)}`},fN=function(e){var t=e.points,n=e.className,r=e.baseLinePoints,i=e.connectNulls,a=eN(e,QM);if(!t||!t.length)return null;var o=Mt(`recharts-polygon`,n);if(r&&r.length){var s=a.stroke&&a.stroke!==`none`,c=dN(t,r,i);return u.createElement(`g`,{className:o},u.createElement(`path`,$M({},J(a,!0),{fill:c.slice(-1)===`Z`?a.fill:`none`,stroke:`none`,d:c})),s?u.createElement(`path`,$M({},J(a,!0),{fill:`none`,d:uN(t,i)})):null,s?u.createElement(`path`,$M({},J(a,!0),{fill:`none`,d:uN(r,i)})):null)}var l=uN(t,i);return u.createElement(`path`,$M({},J(a,!0),{fill:l.slice(-1)===`Z`?a.fill:`none`,className:o,d:l}))};function pN(){return pN=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},pN.apply(this,arguments)}var mN=function(e){var t=e.cx,n=e.cy,r=e.r,i=e.className,a=Mt(`recharts-dot`,i);return t===+t&&n===+n&&r===+r?u.createElement(`circle`,pN({},J(e,!1),e_(e),{className:a,cx:t,cy:n,r})):null};function hN(e){"@babel/helpers - typeof";return hN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hN(e)}var gN=[`x`,`y`,`top`,`left`,`width`,`height`,`className`];function _N(){return _N=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},_N.apply(this,arguments)}function vN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?vN(Object(n),!0).forEach(function(t){bN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function bN(e,t,n){return t=xN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function xN(e){var t=SN(e,`string`);return hN(t)==`symbol`?t:t+``}function SN(e,t){if(hN(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(hN(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function CN(e,t){if(e==null)return{};var n=wN(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wN(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 TN=function(e,t,n,r,i,a){return`M${e},${i}v${r}M${a},${t}h${n}`},EN=function(e){var t=e.x,n=t===void 0?0:t,r=e.y,i=r===void 0?0:r,a=e.top,o=a===void 0?0:a,s=e.left,c=s===void 0?0:s,l=e.width,d=l===void 0?0:l,f=e.height,p=f===void 0?0:f,m=e.className,h=CN(e,gN),g=yN({x:n,y:i,top:o,left:c,width:d,height:p},h);return!q(n)||!q(i)||!q(d)||!q(p)||!q(o)||!q(c)?null:u.createElement(`path`,_N({},J(g,!0),{className:Mt(`recharts-cross`,m),d:TN(n,i,d,p,o,c)}))},DN=r(((e,t)=>{var n=QE(),r=$E(),i=Nb();function a(e,t){return e&&e.length?n(e,i(t,2),r):void 0}t.exports=a})),Pse=r(((e,t)=>{var n=QE(),r=Nb(),i=tD();function a(e,t){return e&&e.length?n(e,r(t,2),i):void 0}t.exports=a})),Fse=e(DN()),Ise=e(Pse()),Lse=[`cx`,`cy`,`angle`,`ticks`,`axisLine`],Rse=[`ticks`,`tick`,`angle`,`tickFormatter`,`stroke`];function ON(e){"@babel/helpers - typeof";return ON=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},ON(e)}function kN(){return kN=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},kN.apply(this,arguments)}function AN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?AN(Object(n),!0).forEach(function(t){LN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function MN(e,t){if(e==null)return{};var n=zse(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function zse(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 Bse(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function NN(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,RN(r.key),r)}}function Vse(e,t,n){return t&&NN(e.prototype,t),n&&NN(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Hse(e,t,n){return t=FN(t),Use(e,PN()?Reflect.construct(t,n||[],FN(e).constructor):t.apply(e,n))}function Use(e,t){if(t&&(ON(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Wse(e)}function Wse(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function PN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(PN=function(){return!!e})()}function FN(e){return FN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},FN(e)}function Gse(e,t){if(typeof t!=`function`&&t!==null)throw 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&&IN(e,t)}function IN(e,t){return IN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IN(e,t)}function LN(e,t,n){return t=RN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function RN(e){var t=Kse(e,`string`);return ON(t)==`symbol`?t:t+``}function Kse(e,t){if(ON(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(ON(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var zN=function(e){function t(){return Bse(this,t),Hse(this,t,arguments)}return Gse(t,e),Vse(t,[{key:`getTickValueCoord`,value:function(e){var t=e.coordinate,n=this.props,r=n.angle,i=n.cx,a=n.cy;return TO(i,a,t,r)}},{key:`getTickTextAnchor`,value:function(){var e=this.props.orientation,t;switch(e){case`left`:t=`end`;break;case`right`:t=`start`;break;default:t=`middle`;break}return t}},{key:`getViewBox`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=(0,Fse.default)(i,function(e){return e.coordinate||0});return{cx:t,cy:n,startAngle:r,endAngle:r,innerRadius:(0,Ise.default)(i,function(e){return e.coordinate||0}).coordinate||0,outerRadius:a.coordinate||0}}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.angle,i=e.ticks,a=e.axisLine,o=MN(e,Lse),s=i.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=TO(t,n,s[0],r),l=TO(t,n,s[1],r),d=jN(jN(jN({},J(o,!1)),{},{fill:`none`},J(a,!1)),{},{x1:c.x,y1:c.y,x2:l.x,y2:l.y});return u.createElement(`line`,kN({className:`recharts-polar-radius-axis-line`},d))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.angle,o=n.tickFormatter,s=n.stroke,c=MN(n,Rse),l=this.getTickTextAnchor(),d=J(c,!1),f=J(i,!1),p=r.map(function(n,r){var c=e.getTickValueCoord(n),p=jN(jN(jN(jN({textAnchor:l,transform:`rotate(${90-a}, ${c.x}, ${c.y})`},d),{},{stroke:`none`,fill:s},f),{},{index:r},c),{},{payload:n});return u.createElement(b_,kN({className:Mt(`recharts-polar-radius-axis-tick`,NO(i)),key:`tick-${n.coordinate}`},t_(e.props,n,r)),t.renderTickItem(i,p,o?o(n.value,r):n.value))});return u.createElement(b_,{className:`recharts-polar-radius-axis-ticks`},p)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.axisLine,r=e.tick;return!t||!t.length?null:u.createElement(b_,{className:Mt(`recharts-polar-radius-axis`,this.props.className)},n&&this.renderAxisLine(),r&&this.renderTicks(),nk.renderCallByParent(this.props,this.getViewBox()))}}],[{key:`renderTickItem`,value:function(e,t,n){return u.isValidElement(e)?u.cloneElement(e,t):(0,n_.default)(e)?e(t):u.createElement(YS,kN({},t,{className:`recharts-polar-radius-axis-tick-value`}),n)}}])}(u.PureComponent);LN(zN,`displayName`,`PolarRadiusAxis`),LN(zN,`axisType`,`radiusAxis`),LN(zN,`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 BN(e){"@babel/helpers - typeof";return BN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},BN(e)}function VN(){return VN=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},VN.apply(this,arguments)}function HN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function UN(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?HN(Object(n),!0).forEach(function(t){JN(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):HN(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qse(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function WN(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,YN(r.key),r)}}function Jse(e,t,n){return t&&WN(e.prototype,t),n&&WN(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Yse(e,t,n){return t=KN(t),Xse(e,GN()?Reflect.construct(t,n||[],KN(e).constructor):t.apply(e,n))}function Xse(e,t){if(t&&(BN(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Zse(e)}function Zse(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function GN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GN=function(){return!!e})()}function KN(e){return KN=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},KN(e)}function Qse(e,t){if(typeof t!=`function`&&t!==null)throw 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&&qN(e,t)}function qN(e,t){return qN=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qN(e,t)}function JN(e,t,n){return t=YN(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YN(e){var t=$se(e,`string`);return BN(t)==`symbol`?t:t+``}function $se(e,t){if(BN(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(BN(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var ece=Math.PI/180,XN=1e-5,ZN=function(e){function t(){return qse(this,t),Yse(this,t,arguments)}return Qse(t,e),Jse(t,[{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.cx,r=t.cy,i=t.radius,a=t.orientation,o=t.tickSize||8,s=TO(n,r,i,e.coordinate),c=TO(n,r,i+(a===`inner`?-1:1)*o,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}}},{key:`getTickTextAnchor`,value:function(e){var t=this.props.orientation,n=Math.cos(-e.coordinate*ece);return n>XN?t===`outer`?`start`:`end`:n<-XN?t===`outer`?`end`:`start`:`middle`}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.cx,n=e.cy,r=e.radius,i=e.axisLine,a=e.axisLineType,o=UN(UN({},J(this.props,!1)),{},{fill:`none`},J(i,!1));if(a===`circle`)return u.createElement(mN,VN({className:`recharts-polar-angle-axis-line`},o,{cx:t,cy:n,r}));var s=this.props.ticks.map(function(e){return TO(t,n,r,e.coordinate)});return u.createElement(fN,VN({className:`recharts-polar-angle-axis-line`},o,{points:s}))}},{key:`renderTicks`,value:function(){var e=this,n=this.props,r=n.ticks,i=n.tick,a=n.tickLine,o=n.tickFormatter,s=n.stroke,c=J(this.props,!1),l=J(i,!1),d=UN(UN({},c),{},{fill:`none`},J(a,!1)),f=r.map(function(n,r){var f=e.getTickLineCoord(n),p=UN(UN(UN({textAnchor:e.getTickTextAnchor(n)},c),{},{stroke:`none`,fill:s},l),{},{index:r,payload:n,x:f.x2,y:f.y2});return u.createElement(b_,VN({className:Mt(`recharts-polar-angle-axis-tick`,NO(i)),key:`tick-${n.coordinate}`},t_(e.props,n,r)),a&&u.createElement(`line`,VN({className:`recharts-polar-angle-axis-tick-line`},d,f)),i&&t.renderTickItem(i,p,o?o(n.value,r):n.value))});return u.createElement(b_,{className:`recharts-polar-angle-axis-ticks`},f)}},{key:`render`,value:function(){var e=this.props,t=e.ticks,n=e.radius,r=e.axisLine;return n<=0||!t||!t.length?null:u.createElement(b_,{className:Mt(`recharts-polar-angle-axis`,this.props.className)},r&&this.renderAxisLine(),this.renderTicks())}}],[{key:`renderTickItem`,value:function(e,t,n){return u.isValidElement(e)?u.cloneElement(e,t):(0,n_.default)(e)?e(t):u.createElement(YS,VN({},t,{className:`recharts-polar-angle-axis-tick-value`}),n)}}])}(u.PureComponent);JN(ZN,`displayName`,`PolarAngleAxis`),JN(ZN,`axisType`,`angleAxis`),JN(ZN,`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 tce=r(((e,t)=>{t.exports=ob()(Object.getPrototypeOf,Object)})),nce=r(((e,t)=>{var n=pg(),r=tce(),i=mg(),a=`[object Object]`,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=c.call(Object);function d(e){if(!i(e)||n(e)!=a)return!1;var t=r(e);if(t===null)return!0;var o=l.call(t,`constructor`)&&t.constructor;return typeof o==`function`&&o instanceof o&&c.call(o)==u}t.exports=d})),rce=r(((e,t)=>{var n=pg(),r=mg(),i=`[object Boolean]`;function a(e){return e===!0||e===!1||r(e)&&n(e)==i}t.exports=a}));function QN(e){"@babel/helpers - typeof";return QN=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},QN(e)}function $N(){return $N=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},$N.apply(this,arguments)}function ice(e,t){return cce(e)||sce(e,t)||oce(e,t)||ace()}function ace(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
175
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oce(e,t){if(e){if(typeof e==`string`)return eP(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 eP(e,t)}}function eP(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sce(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function cce(e){if(Array.isArray(e))return e}function tP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?tP(Object(n),!0).forEach(function(t){lce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lce(e,t,n){return t=uce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uce(e){var t=dce(e,`string`);return QN(t)==`symbol`?t:t+``}function dce(e,t){if(QN(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(QN(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var rP=function(e,t,n,r,i){var a=n-r,o=`M ${e},${t}`;return o+=`L ${e+n},${t}`,o+=`L ${e+n-a/2},${t+i}`,o+=`L ${e+n-a/2-r},${t+i}`,o+=`L ${e},${t} Z`,o},fce={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:`ease`},pce=function(e){var t=nP(nP({},fce),e),n=(0,u.useRef)(),r=ice((0,u.useState)(-1),2),i=r[0],a=r[1];(0,u.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&a(e)}catch{}},[]);var o=t.x,s=t.y,c=t.upperWidth,l=t.lowerWidth,d=t.height,f=t.className,p=t.animationEasing,m=t.animationDuration,h=t.animationBegin,g=t.isUpdateAnimationActive;if(o!==+o||s!==+s||c!==+c||l!==+l||d!==+d||c===0&&l===0||d===0)return null;var _=Mt(`recharts-trapezoid`,f);return g?u.createElement(PM,{canBegin:i>0,from:{upperWidth:0,lowerWidth:0,height:d,x:o,y:s},to:{upperWidth:c,lowerWidth:l,height:d,x:o,y:s},duration:m,animationEasing:p,isActive:g},function(e){var r=e.upperWidth,a=e.lowerWidth,o=e.height,s=e.x,c=e.y;return u.createElement(PM,{canBegin:i>0,from:`0px ${i===-1?1:i}px`,to:`${i}px 0px`,attributeName:`strokeDasharray`,begin:h,duration:m,easing:p},u.createElement(`path`,$N({},J(t,!0),{className:_,d:rP(s,c,r,a,o),ref:n})))}):u.createElement(`g`,null,u.createElement(`path`,$N({},J(t,!0),{className:_,d:rP(o,s,c,l,d)})))},mce=e(nce()),hce=e(rce()),gce=[`option`,`shapeType`,`propTransformer`,`activeClassName`,`isActive`];function iP(e){"@babel/helpers - typeof";return iP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},iP(e)}function _ce(e,t){if(e==null)return{};var n=vce(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vce(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 aP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?aP(Object(n),!0).forEach(function(t){yce(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):aP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yce(e,t,n){return t=bce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bce(e){var t=xce(e,`string`);return iP(t)==`symbol`?t:t+``}function xce(e,t){if(iP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(iP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Sce(e,t){return oP(oP({},t),e)}function Cce(e,t){return e===`symbols`}function sP(e){var t=e.shapeType,n=e.elementProps;switch(t){case`rectangle`:return u.createElement(ZM,n);case`trapezoid`:return u.createElement(pce,n);case`sector`:return u.createElement(zk,n);case`symbols`:if(Cce(t,n))return u.createElement(oy,n);break;default:return null}}function wce(e){return(0,u.isValidElement)(e)?e.props:e}function cP(e){var t=e.option,n=e.shapeType,r=e.propTransformer,i=r===void 0?Sce:r,a=e.activeClassName,o=a===void 0?`recharts-active-shape`:a,s=e.isActive,c=_ce(e,gce),l;if((0,u.isValidElement)(t))l=(0,u.cloneElement)(t,oP(oP({},c),wce(t)));else if((0,n_.default)(t))l=t(c);else if((0,mce.default)(t)&&!(0,hce.default)(t)){var d=i(t,c);l=u.createElement(sP,{shapeType:n,elementProps:d})}else{var f=c;l=u.createElement(sP,{shapeType:n,elementProps:f})}return s?u.createElement(b_,{className:o},l):l}function lP(e,t){return t!=null&&`trapezoids`in e.props}function uP(e,t){return t!=null&&`sectors`in e.props}function dP(e,t){return t!=null&&`points`in e.props}function Tce(e,t){var n,r,i=e.x===(t==null||(n=t.labelViewBox)==null?void 0:n.x)||e.x===t.x,a=e.y===(t==null||(r=t.labelViewBox)==null?void 0:r.y)||e.y===t.y;return i&&a}function Ece(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function Dce(e,t){var n=e.x===t.x,r=e.y===t.y,i=e.z===t.z;return n&&r&&i}function Oce(e,t){var n;return lP(e,t)?n=Tce:uP(e,t)?n=Ece:dP(e,t)&&(n=Dce),n}function kce(e,t){var n;return lP(e,t)?n=`trapezoids`:uP(e,t)?n=`sectors`:dP(e,t)&&(n=`points`),n}function Ace(e,t){if(lP(e,t)){var n;return(n=t.tooltipPayload)==null||(n=n[0])==null||(n=n.payload)==null?void 0:n.payload}if(uP(e,t)){var r;return(r=t.tooltipPayload)==null||(r=r[0])==null||(r=r.payload)==null?void 0:r.payload}return dP(e,t)?t.payload:{}}function jce(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,i=kce(n,t),a=Ace(n,t),o=r.filter(function(e,r){var o=(0,BD.default)(a,e),s=n.props[i].filter(function(e){return Oce(n,t)(e,t)}),c=r===n.props[i].indexOf(s[s.length-1]);return o&&c});return r.indexOf(o[o.length-1])}var fP;function pP(e){"@babel/helpers - typeof";return pP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},pP(e)}function mP(){return mP=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},mP.apply(this,arguments)}function hP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?hP(Object(n),!0).forEach(function(t){xP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mce(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function _P(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,SP(r.key),r)}}function Nce(e,t,n){return t&&_P(e.prototype,t),n&&_P(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Pce(e,t,n){return t=yP(t),Fce(e,vP()?Reflect.construct(t,n||[],yP(e).constructor):t.apply(e,n))}function Fce(e,t){if(t&&(pP(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Ice(e)}function Ice(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function vP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vP=function(){return!!e})()}function yP(e){return yP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yP(e)}function Lce(e,t){if(typeof t!=`function`&&t!==null)throw 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&&bP(e,t)}function bP(e,t){return bP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bP(e,t)}function xP(e,t,n){return t=SP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function SP(e){var t=Rce(e,`string`);return pP(t)==`symbol`?t:t+``}function Rce(e,t){if(pP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(pP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var CP=function(e){function t(e){var n;return Mce(this,t),n=Pce(this,t,[e]),xP(n,`pieRef`,null),xP(n,`sectorRefs`,[]),xP(n,`id`,Wg(`recharts-pie-`)),xP(n,`handleAnimationEnd`,function(){var e=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),(0,n_.default)(e)&&e()}),xP(n,`handleAnimationStart`,function(){var e=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),(0,n_.default)(e)&&e()}),n.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},n}return Lce(t,e),Nce(t,[{key:`isActiveIndex`,value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?t.indexOf(e)!==-1:e===t}},{key:`hasActiveIndex`,value:function(){var e=this.props.activeIndex;return Array.isArray(e)?e.length!==0:e||e===0}},{key:`renderLabels`,value:function(e){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.label,i=n.labelLine,a=n.dataKey,o=n.valueKey,s=J(this.props,!1),c=J(r,!1),l=J(i,!1),d=r&&r.offsetRadius||20,f=e.map(function(e,n){var f=(e.startAngle+e.endAngle)/2,p=TO(e.cx,e.cy,e.outerRadius+d,f),m=gP(gP(gP(gP({},s),e),{},{stroke:`none`},c),{},{index:n,textAnchor:t.getTextAnchor(p.x,e.cx)},p),h=gP(gP(gP(gP({},s),e),{},{fill:`none`,stroke:e.fill},l),{},{index:n,points:[TO(e.cx,e.cy,e.outerRadius,f),p]}),g=a;return(0,Bg.default)(a)&&(0,Bg.default)(o)?g=`value`:(0,Bg.default)(a)&&(g=o),u.createElement(b_,{key:`label-${e.startAngle}-${e.endAngle}-${e.midAngle}-${n}`},i&&t.renderLabelLineItem(i,h,`line`),t.renderLabelItem(r,m,qD(e,g)))});return u.createElement(b_,{className:`recharts-pie-labels`},f)}},{key:`renderSectorsStatically`,value:function(e){var t=this,n=this.props,r=n.activeShape,i=n.blendStroke,a=n.inactiveShape;return e.map(function(n,o){if(n?.startAngle===0&&n?.endAngle===0&&e.length!==1)return null;var s=t.isActiveIndex(o),c=a&&t.hasActiveIndex()?a:null,l=s?r:c,d=gP(gP({},n),{},{stroke:i?n.fill:n.stroke,tabIndex:-1});return u.createElement(b_,mP({ref:function(e){e&&!t.sectorRefs.includes(e)&&t.sectorRefs.push(e)},tabIndex:-1,className:`recharts-pie-sector`},t_(t.props,n,o),{key:`sector-${n?.startAngle}-${n?.endAngle}-${n.midAngle}-${o}`}),u.createElement(cP,mP({option:l,isActive:s,shapeType:`sector`},d)))})}},{key:`renderSectorsWithAnimation`,value:function(){var e=this,t=this.props,n=t.sectors,r=t.isAnimationActive,i=t.animationBegin,a=t.animationDuration,o=t.animationEasing,s=t.animationId,c=this.state,l=c.prevSectors,d=c.prevIsAnimationActive;return u.createElement(PM,{begin:i,duration:a,isActive:r,easing:o,from:{t:0},to:{t:1},key:`pie-${s}-${d}`,onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(t){var r=t.t,i=[],a=(n&&n[0]).startAngle;return n.forEach(function(e,t){var n=l&&l[t],o=t>0?(0,zg.default)(e,`paddingAngle`,0):0;if(n){var s=qg(n.endAngle-n.startAngle,e.endAngle-e.startAngle),c=gP(gP({},e),{},{startAngle:a+o,endAngle:a+s(r)+o});i.push(c),a=c.endAngle}else{var u=e.endAngle,d=e.startAngle,f=qg(0,u-d)(r),p=gP(gP({},e),{},{startAngle:a+o,endAngle:a+f+o});i.push(p),a=p.endAngle}}),u.createElement(b_,null,e.renderSectorsStatically(i))})}},{key:`attachKeyboardHandlers`,value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case`ArrowLeft`:var n=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});break;case`ArrowRight`:var r=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case`Escape`:t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0});break;default:}}}},{key:`renderSectors`,value:function(){var e=this.props,t=e.sectors,n=e.isAnimationActive,r=this.state.prevSectors;return n&&t&&t.length&&(!r||!(0,BD.default)(r,t))?this.renderSectorsWithAnimation():this.renderSectorsStatically(t)}},{key:`componentDidMount`,value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.hide,r=t.sectors,i=t.className,a=t.label,o=t.cx,s=t.cy,c=t.innerRadius,l=t.outerRadius,d=t.isAnimationActive,f=this.state.isAnimationFinished;if(n||!r||!r.length||!q(o)||!q(s)||!q(c)||!q(l))return null;var p=Mt(`recharts-pie`,i);return u.createElement(b_,{tabIndex:this.props.rootTabIndex,className:p,ref:function(t){e.pieRef=t}},this.renderSectors(),a&&this.renderLabels(r),nk.renderCallByParent(this.props,null,!1),(!d||f)&&wk.renderCallByParent(this.props,r,!1))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return t.prevIsAnimationActive===e.isAnimationActive?e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors===t.curSectors?null:{curSectors:e.sectors,isAnimationFinished:!0}:{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}}},{key:`getTextAnchor`,value:function(e,t){return e>t?`start`:e<t?`end`:`middle`}},{key:`renderLabelLineItem`,value:function(e,t,n){if(u.isValidElement(e))return u.cloneElement(e,t);if((0,n_.default)(e))return e(t);var r=Mt(`recharts-pie-label-line`,typeof e==`boolean`?``:e.className);return u.createElement($k,mP({},t,{key:n,type:`linear`,className:r}))}},{key:`renderLabelItem`,value:function(e,t,n){if(u.isValidElement(e))return u.cloneElement(e,t);var r=n;if((0,n_.default)(e)&&(r=e(t),u.isValidElement(r)))return r;var i=Mt(`recharts-pie-label-text`,typeof e!=`boolean`&&!(0,n_.default)(e)?e.className:``);return u.createElement(YS,mP({},t,{alignmentBaseline:`middle`,className:i}),r)}}])}(u.PureComponent);fP=CP,xP(CP,`displayName`,`Pie`),xP(CP,`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:!iS.isSsr,animationBegin:400,animationDuration:1500,animationEasing:`ease`,nameKey:`name`,blendStroke:!1,rootTabIndex:0}),xP(CP,`parseDeltaAngle`,function(e,t){return Vg(t-e)*Math.min(Math.abs(t-e),360)}),xP(CP,`getRealPieData`,function(e){var t=e.data,n=e.children,r=J(e,!1),i=u_(n,SS);return t&&t.length?t.map(function(e,t){return gP(gP(gP({payload:e},r),e),i&&i[t]&&i[t].props)}):i&&i.length?i.map(function(e){return gP(gP({},r),e.props)}):[]}),xP(CP,`parseCoordinateOfPie`,function(e,t){var n=t.top,r=t.left,i=t.width,a=t.height,o=EO(i,a);return{cx:r+Gg(e.cx,i,i/2),cy:n+Gg(e.cy,a,a/2),innerRadius:Gg(e.innerRadius,o,0),outerRadius:Gg(e.outerRadius,o,o*.8),maxRadius:e.maxRadius||Math.sqrt(i*i+a*a)/2}}),xP(CP,`getComposedData`,function(e){var t=e.item,n=e.offset,r=t.type.defaultProps===void 0?t.props:gP(gP({},t.type.defaultProps),t.props),i=fP.getRealPieData(r);if(!i||!i.length)return null;var a=r.cornerRadius,o=r.startAngle,s=r.endAngle,c=r.paddingAngle,l=r.dataKey,u=r.nameKey,d=r.valueKey,f=r.tooltipType,p=Math.abs(r.minAngle),m=fP.parseCoordinateOfPie(r,n),h=fP.parseDeltaAngle(o,s),g=Math.abs(h),_=l;(0,Bg.default)(l)&&(0,Bg.default)(d)?(x_(!1,`Use "dataKey" to specify the value of pie,
176
+ the props "valueKey" will be deprecated in 1.1.0`),_=`value`):(0,Bg.default)(l)&&(x_(!1,`Use "dataKey" to specify the value of pie,
177
+ the props "valueKey" will be deprecated in 1.1.0`),_=d);var v=i.filter(function(e){return qD(e,_,0)!==0}).length,y=(g>=360?v:v-1)*c,b=g-v*p-y,x=i.reduce(function(e,t){var n=qD(t,_,0);return e+(q(n)?n:0)},0),S;if(x>0){var C;S=i.map(function(e,t){var n=qD(e,_,0),r=qD(e,u,t),i=(q(n)?n:0)/x,s=t?C.endAngle+Vg(h)*c*(n===0?0:1):o,l=s+Vg(h)*((n===0?0:p)+i*b),d=(s+l)/2,g=(m.innerRadius+m.outerRadius)/2;return C=gP(gP(gP({percent:i,cornerRadius:a,name:r,tooltipPayload:[{name:r,value:n,payload:e,dataKey:_,type:f}],midAngle:d,middleRadius:g,tooltipPosition:TO(m.cx,m.cy,g,d)},e),m),{},{value:qD(e,_),startAngle:s,endAngle:l,payload:e,paddingAngle:Vg(h)*c}),C})}return gP(gP({},m),{},{sectors:S,data:i})});var zce=r(((e,t)=>{var n=Math.ceil,r=Math.max;function i(e,t,i,a){for(var o=-1,s=r(n((t-e)/(i||1)),0),c=Array(s);s--;)c[a?s:++o]=e,e+=i;return c}t.exports=i})),wP=r(((e,t)=>{var n=hS(),r=1/0,i=17976931348623157e292;function a(e){return e?(e=n(e),e===r||e===-r?(e<0?-1:1)*i:e===e?e:0):e===0?e:0}t.exports=a})),Bce=r(((e,t)=>{var n=zce(),r=Px(),i=wP();function a(e){return function(t,a,o){return o&&typeof o!=`number`&&r(t,a,o)&&(a=o=void 0),t=i(t),a===void 0?(a=t,t=0):a=i(a),o=o===void 0?t<a?1:-1:i(o),n(t,a,o,e)}}t.exports=a})),Vce=r(((e,t)=>{t.exports=Bce()()}));function TP(e){"@babel/helpers - typeof";return TP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},TP(e)}function EP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function DP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?EP(Object(n),!0).forEach(function(t){OP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):EP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function OP(e,t,n){return t=Hce(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Hce(e){var t=Uce(e,`string`);return TP(t)==`symbol`?t:t+``}function Uce(e,t){if(TP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(TP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var Wce=[`Webkit`,`Moz`,`O`,`ms`],Gce=function(e,t){if(!e)return null;var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=Wce.reduce(function(e,r){return DP(DP({},e),{},OP({},r+n,t))},{});return r[e]=t,r},kP=e(Vce());function AP(e){"@babel/helpers - typeof";return AP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},AP(e)}function jP(){return jP=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},jP.apply(this,arguments)}function MP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function NP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?MP(Object(n),!0).forEach(function(t){RP(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):MP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Kce(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function PP(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,zP(r.key),r)}}function qce(e,t,n){return t&&PP(e.prototype,t),n&&PP(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Jce(e,t,n){return t=IP(t),Yce(e,FP()?Reflect.construct(t,n||[],IP(e).constructor):t.apply(e,n))}function Yce(e,t){if(t&&(AP(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Xce(e)}function Xce(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function FP(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(FP=function(){return!!e})()}function IP(e){return IP=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},IP(e)}function Zce(e,t){if(typeof t!=`function`&&t!==null)throw 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&&LP(e,t)}function LP(e,t){return LP=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},LP(e,t)}function RP(e,t,n){return t=zP(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zP(e){var t=Qce(e,`string`);return AP(t)==`symbol`?t:t+``}function Qce(e,t){if(AP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(AP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $ce=function(e){var t=e.data,n=e.startIndex,r=e.endIndex,i=e.x,a=e.width,o=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,c=vC().domain((0,kP.default)(0,s)).range([i,i+a-o]),l=c.domain().map(function(e){return c(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(n),endX:c(r),scale:c,scaleValues:l}},BP=function(e){return e.changedTouches&&!!e.changedTouches.length},VP=function(e){function t(e){var n;return Kce(this,t),n=Jce(this,t,[e]),RP(n,`handleDrag`,function(e){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(e):n.state.isSlideMoving&&n.handleSlideDrag(e)}),RP(n,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&n.handleDrag(e.changedTouches[0])}),RP(n,`handleDragEnd`,function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=n.props,t=e.endIndex,r=e.onDragEnd,i=e.startIndex;r?.({endIndex:t,startIndex:i})}),n.detachDragEndListener()}),RP(n,`handleLeaveWrapper`,function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),RP(n,`handleEnterSlideOrTraveller`,function(){n.setState({isTextActive:!0})}),RP(n,`handleLeaveSlideOrTraveller`,function(){n.setState({isTextActive:!1})}),RP(n,`handleSlideDragStart`,function(e){var t=BP(e)?e.changedTouches[0]:e;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,`startX`),endX:n.handleTravellerDragStart.bind(n,`endX`)},n.state={},n}return Zce(t,e),qce(t,[{key:`componentWillUnmount`,value:function(){this.leaveTimer&&=(clearTimeout(this.leaveTimer),null),this.detachDragEndListener()}},{key:`getIndex`,value:function(e){var n=e.startX,r=e.endX,i=this.state.scaleValues,a=this.props,o=a.gap,s=a.data.length-1,c=Math.min(n,r),l=Math.max(n,r),u=t.getIndexInRange(i,c),d=t.getIndexInRange(i,l);return{startIndex:u-u%o,endIndex:d===s?s:d-d%o}}},{key:`getTextOfTick`,value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,i=t.dataKey,a=qD(n[e],i,e);return(0,n_.default)(r)?r(a,e):a}},{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(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,i=t.endX,a=this.props,o=a.x,s=a.width,c=a.travellerWidth,l=a.startIndex,u=a.endIndex,d=a.onChange,f=e.pageX-n;f>0?f=Math.min(f,o+s-c-i,o+s-c-r):f<0&&(f=Math.max(f,o-r,o-i));var p=this.getIndex({startX:r+f,endX:i+f});(p.startIndex!==l||p.endIndex!==u)&&d&&d(p),this.setState({startX:r+f,endX:i+f,slideMoveStartX:e.pageX})}},{key:`handleTravellerDragStart`,value:function(e,t){var n=BP(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:`handleTravellerMove`,value:function(e){var t=this.state,n=t.brushMoveStartX,r=t.movingTravellerId,i=t.endX,a=t.startX,o=this.state[r],s=this.props,c=s.x,l=s.width,u=s.travellerWidth,d=s.onChange,f=s.gap,p=s.data,m={startX:this.state.startX,endX:this.state.endX},h=e.pageX-n;h>0?h=Math.min(h,c+l-u-o):h<0&&(h=Math.max(h,c-o)),m[r]=o+h;var g=this.getIndex(m),_=g.startIndex,v=g.endIndex,y=function(){var e=p.length-1;return r===`startX`&&(i>a?_%f===0:v%f===0)||i<a&&v===e||r===`endX`&&(i>a?v%f===0:_%f===0)||i>a&&v===e};this.setState(RP(RP({},r,o+h),`brushMoveStartX`,e.pageX),function(){d&&y()&&d(g)})}},{key:`handleTravellerMoveKeyboard`,value:function(e,t){var n=this,r=this.state,i=r.scaleValues,a=r.startX,o=r.endX,s=this.state[t],c=i.indexOf(s);if(c!==-1){var l=c+e;if(!(l===-1||l>=i.length)){var u=i[l];t===`startX`&&u>=o||t===`endX`&&u<=a||this.setState(RP({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:`renderBackground`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.fill,o=e.stroke;return u.createElement(`rect`,{stroke:o,fill:a,x:t,y:n,width:r,height:i})}},{key:`renderPanorama`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.data,o=e.children,s=e.padding,c=u.Children.only(o);return c?u.cloneElement(c,{x:t,y:n,width:r,height:i,margin:s,compact:!0,data:a}):null}},{key:`renderTravellerLayer`,value:function(e,n){var r=this,i=this.props,a=i.y,o=i.travellerWidth,s=i.height,c=i.traveller,l=i.ariaLabel,d=i.data,f=i.startIndex,p=i.endIndex,m=Math.max(e,this.props.x),h=NP(NP({},J(this.props,!1)),{},{x:m,y:a,width:o,height:s}),g=l||`Min value: ${d[f]?.name}, Max value: ${d[p]?.name}`;return u.createElement(b_,{tabIndex:0,role:`slider`,"aria-label":g,"aria-valuenow":e,className:`recharts-brush-traveller`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[n],onTouchStart:this.travellerDragStartHandlers[n],onKeyDown:function(e){[`ArrowLeft`,`ArrowRight`].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),r.handleTravellerMoveKeyboard(e.key===`ArrowRight`?1:-1,n))},onFocus:function(){r.setState({isTravellerFocused:!0})},onBlur:function(){r.setState({isTravellerFocused:!1})},style:{cursor:`col-resize`}},t.renderTraveller(c,h))}},{key:`renderSlide`,value:function(e,t){var n=this.props,r=n.y,i=n.height,a=n.stroke,o=n.travellerWidth,s=Math.min(e,t)+o,c=Math.max(Math.abs(t-e)-o,0);return u.createElement(`rect`,{className:`recharts-brush-slide`,onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:`move`},stroke:`none`,fill:a,fillOpacity:.2,x:s,y:r,width:c,height:i})}},{key:`renderText`,value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,i=e.height,a=e.travellerWidth,o=e.stroke,s=this.state,c=s.startX,l=s.endX,d=5,f={pointerEvents:`none`,fill:o};return u.createElement(b_,{className:`recharts-brush-texts`},u.createElement(YS,jP({textAnchor:`end`,verticalAnchor:`middle`,x:Math.min(c,l)-d,y:r+i/2},f),this.getTextOfTick(t)),u.createElement(YS,jP({textAnchor:`start`,verticalAnchor:`middle`,x:Math.max(c,l)+a+d,y:r+i/2},f),this.getTextOfTick(n)))}},{key:`render`,value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,i=e.x,a=e.y,o=e.width,s=e.height,c=e.alwaysShowText,l=this.state,d=l.startX,f=l.endX,p=l.isTextActive,m=l.isSlideMoving,h=l.isTravellerMoving,g=l.isTravellerFocused;if(!t||!t.length||!q(i)||!q(a)||!q(o)||!q(s)||o<=0||s<=0)return null;var _=Mt(`recharts-brush`,n),v=u.Children.count(r)===1,y=Gce(`userSelect`,`none`);return u.createElement(b_,{className:_,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:y},this.renderBackground(),v&&this.renderPanorama(),this.renderSlide(d,f),this.renderTravellerLayer(d,`startX`),this.renderTravellerLayer(f,`endX`),(p||m||h||g||c)&&this.renderText())}}],[{key:`renderDefaultTraveller`,value:function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=e.stroke,o=Math.floor(n+i/2)-1;return u.createElement(u.Fragment,null,u.createElement(`rect`,{x:t,y:n,width:r,height:i,fill:a,stroke:`none`}),u.createElement(`line`,{x1:t+1,y1:o,x2:t+r-1,y2:o,fill:`none`,stroke:`#fff`}),u.createElement(`line`,{x1:t+1,y1:o+2,x2:t+r-1,y2:o+2,fill:`none`,stroke:`#fff`}))}},{key:`renderTraveller`,value:function(e,n){return u.isValidElement(e)?u.cloneElement(e,n):(0,n_.default)(e)?e(n):t.renderDefaultTraveller(n)}},{key:`getDerivedStateFromProps`,value:function(e,t){var n=e.data,r=e.width,i=e.x,a=e.travellerWidth,o=e.updateId,s=e.startIndex,c=e.endIndex;if(n!==t.prevData||o!==t.prevUpdateId)return NP({prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r},n&&n.length?$ce({data:n,width:r,x:i,travellerWidth:a,startIndex:s,endIndex:c}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||i!==t.prevX||a!==t.prevTravellerWidth)){t.scale.range([i,i+r-a]);var l=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:a,prevUpdateId:o,prevX:i,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:l}}return null}},{key:`getIndexInRange`,value:function(e,t){for(var n=e.length,r=0,i=n-1;i-r>1;){var a=Math.floor((r+i)/2);e[a]>t?i=a:r=a}return t>=e[i]?i:r}}])}(u.PureComponent);RP(VP,`displayName`,`Brush`),RP(VP,`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 ele=r(((e,t)=>{var n=bx();function r(e,t){var r;return n(e,function(e,n,i){return r=t(e,n,i),!r}),!!r}t.exports=r})),tle=r(((e,t)=>{var n=Fy(),r=Nb(),i=ele(),a=sg(),o=Px();function s(e,t,s){var c=a(e)?n:i;return s&&o(e,t,s)&&(t=void 0),c(e,r(t,3))}t.exports=s})),HP=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r=`extendDomain`),r===t},nle=r(((e,t)=>{var n=kx();function r(e,t,r){t==`__proto__`&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}t.exports=r})),rle=r(((e,t)=>{var n=nle(),r=vx(),i=Nb();function a(e,t){var a={};return t=i(t,3),r(e,function(e,r,i){n(a,r,t(e,r,i))}),a}t.exports=a})),ile=r(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}t.exports=n})),ale=r(((e,t)=>{var n=bx();function r(e,t){var r=!0;return n(e,function(e,n,i){return r=!!t(e,n,i),r}),r}t.exports=r})),ole=r(((e,t)=>{var n=ile(),r=ale(),i=Nb(),a=sg(),o=Px();function s(e,t,s){var c=a(e)?n:r;return s&&o(e,t,s)&&(t=void 0),c(e,i(t,3))}t.exports=s})),sle=[`x`,`y`];function UP(e){"@babel/helpers - typeof";return UP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},UP(e)}function WP(){return WP=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},WP.apply(this,arguments)}function GP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function KP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?GP(Object(n),!0).forEach(function(t){cle(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cle(e,t,n){return t=lle(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lle(e){var t=ule(e,`string`);return UP(t)==`symbol`?t:t+``}function ule(e,t){if(UP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(UP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function dle(e,t){if(e==null)return{};var n=fle(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fle(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 ple(e,t){var n=e.x,r=e.y,i=dle(e,sle),a=`${n}`,o=parseInt(a,10),s=`${r}`,c=parseInt(s,10),l=`${t.height||i.height}`,u=parseInt(l,10),d=`${t.width||i.width}`,f=parseInt(d,10);return KP(KP(KP(KP(KP({},t),i),o?{x:o}:{}),c?{y:c}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function qP(e){return u.createElement(cP,WP({shapeType:`rectangle`,propTransformer:ple,activeClassName:`recharts-active-bar`},e))}var mle=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,r){if(typeof e==`number`)return e;var i=q(n)||Hne(n);return i?e(n,r):(!i&&SD(!1),t)}},hle=[`value`,`background`],JP;function YP(e){"@babel/helpers - typeof";return YP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},YP(e)}function gle(e,t){if(e==null)return{};var n=_le(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _le(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 XP(){return XP=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},XP.apply(this,arguments)}function ZP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QP(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?ZP(Object(n),!0).forEach(function(t){rF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ZP(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vle(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function $P(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,iF(r.key),r)}}function yle(e,t,n){return t&&$P(e.prototype,t),n&&$P(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function ble(e,t,n){return t=tF(t),xle(e,eF()?Reflect.construct(t,n||[],tF(e).constructor):t.apply(e,n))}function xle(e,t){if(t&&(YP(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Sle(e)}function Sle(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function eF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eF=function(){return!!e})()}function tF(e){return tF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tF(e)}function Cle(e,t){if(typeof t!=`function`&&t!==null)throw 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&&nF(e,t)}function nF(e,t){return nF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},nF(e,t)}function rF(e,t,n){return t=iF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iF(e){var t=wle(e,`string`);return YP(t)==`symbol`?t:t+``}function wle(e,t){if(YP(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(YP(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var aF=function(e){function t(){var e;vle(this,t);var n=[...arguments];return e=ble(this,t,[].concat(n)),rF(e,`state`,{isAnimationFinished:!1}),rF(e,`id`,Wg(`recharts-bar-`)),rF(e,`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),rF(e,`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return Cle(t,e),yle(t,[{key:`renderRectanglesStatically`,value:function(e){var t=this,n=this.props,r=n.shape,i=n.dataKey,a=n.activeIndex,o=n.activeBar,s=J(this.props,!1);return e&&e.map(function(e,n){var c=n===a,l=c?o:r,d=QP(QP(QP({},s),e),{},{isActive:c,option:l,index:n,dataKey:i,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return u.createElement(b_,XP({className:`recharts-bar-rectangle`},t_(t.props,e,n),{key:`rectangle-${e?.x}-${e?.y}-${e?.value}-${n}`}),u.createElement(qP,d))})}},{key:`renderRectanglesWithAnimation`,value:function(){var e=this,t=this.props,n=t.data,r=t.layout,i=t.isAnimationActive,a=t.animationBegin,o=t.animationDuration,s=t.animationEasing,c=t.animationId,l=this.state.prevData;return u.createElement(PM,{begin:a,duration:o,isActive:i,easing:s,from:{t:0},to:{t:1},key:`bar-${c}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var i=t.t,a=n.map(function(e,t){var n=l&&l[t];if(n){var a=qg(n.x,e.x),o=qg(n.y,e.y),s=qg(n.width,e.width),c=qg(n.height,e.height);return QP(QP({},e),{},{x:a(i),y:o(i),width:s(i),height:c(i)})}if(r===`horizontal`){var u=qg(0,e.height)(i);return QP(QP({},e),{},{y:e.y+e.height-u,height:u})}var d=qg(0,e.width)(i);return QP(QP({},e),{},{width:d})});return u.createElement(b_,null,e.renderRectanglesStatically(a))})}},{key:`renderRectangles`,value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return n&&t&&t.length&&(!r||!(0,BD.default)(r,t))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(t)}},{key:`renderBackground`,value:function(){var e=this,t=this.props,n=t.data,r=t.dataKey,i=t.activeIndex,a=J(this.props.background,!1);return n.map(function(t,n){t.value;var o=t.background,s=gle(t,hle);if(!o)return null;var c=QP(QP(QP(QP(QP({},s),{},{fill:`#eee`},o),a),t_(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,className:`recharts-bar-background-rectangle`});return u.createElement(qP,XP({key:`background-bar-${n}`,option:e.props.background,isActive:n===i},c))})}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.data,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=u_(s,ND);if(!c)return null;var l=o===`vertical`?r[0].height/2:r[0].width/2,d=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:qD(e,t)}},f={clipPath:e?`url(#clipPath-${t})`:null};return u.createElement(b_,f,c.map(function(e){return u.cloneElement(e,{key:`error-bar-${t}-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,offset:l,dataPointFormatter:d})}))}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.data,r=e.className,i=e.xAxis,a=e.yAxis,o=e.left,s=e.top,c=e.width,l=e.height,d=e.isAnimationActive,f=e.background,p=e.id;if(t||!n||!n.length)return null;var m=this.state.isAnimationFinished,h=Mt(`recharts-bar`,r),g=i&&i.allowDataOverflow,_=a&&a.allowDataOverflow,v=g||_,y=(0,Bg.default)(p)?this.id:p;return u.createElement(b_,{className:h},g||_?u.createElement(`defs`,null,u.createElement(`clipPath`,{id:`clipPath-${y}`},u.createElement(`rect`,{x:g?o:o-c/2,y:_?s:s-l/2,width:g?c:c*2,height:_?l:l*2}))):null,u.createElement(b_,{className:`recharts-bar-rectangles`,clipPath:v?`url(#clipPath-${y})`:null},f?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(v,y),(!d||m)&&wk.renderCallByParent(this.props,n))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.data===t.curData?null:{curData:e.data}:{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}}}])}(u.PureComponent);JP=aF,rF(aF,`displayName`,`Bar`),rF(aF,`defaultProps`,{xAxisId:0,yAxisId:0,legendType:`rect`,minPointSize:0,hide:!1,data:[],layout:`vertical`,activeBar:!1,isAnimationActive:!iS.isSsr,animationBegin:0,animationDuration:400,animationEasing:`ease`}),rF(aF,`getComposedData`,function(e){var t=e.props,n=e.item,r=e.barPosition,i=e.bandSize,a=e.xAxis,o=e.yAxis,s=e.xAxisTicks,c=e.yAxisTicks,l=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=xse(r,n);if(!p)return null;var m=t.layout,h=n.type.defaultProps,g=h===void 0?n.props:QP(QP({},h),n.props),_=g.dataKey,v=g.children,y=g.minPointSize,b=m===`horizontal`?o:a,x=l?b.scale.domain():null,S=Ese({numericAxis:b}),C=u_(v,SS);return QP({data:d.map(function(e,t){var r,d,f,h,g,v;l?r=Sse(l[u+t],x):(r=qD(e,_),Array.isArray(r)||(r=[S,r]));var b=mle(y,JP.defaultProps.minPointSize)(r[1],t);if(m===`horizontal`){var w=[o.scale(r[0]),o.scale(r[1])],T=w[0],E=w[1];d=cO({axis:a,ticks:s,bandSize:i,offset:p.offset,entry:e,index:t}),f=E??T??void 0,h=p.size;var D=T-E;if(g=Number.isNaN(D)?0:D,v={x:d,y:o.y,width:h,height:o.height},Math.abs(b)>0&&Math.abs(g)<Math.abs(b)){var O=Vg(g||b)*(Math.abs(b)-Math.abs(g));f-=O,g+=O}}else{var k=[a.scale(r[0]),a.scale(r[1])],A=k[0],j=k[1];if(d=A,f=cO({axis:o,ticks:c,bandSize:i,offset:p.offset,entry:e,index:t}),h=j-A,g=p.size,v={x:a.x,y:f,width:a.width,height:g},Math.abs(b)>0&&Math.abs(h)<Math.abs(b)){var M=Vg(h||b)*(Math.abs(b)-Math.abs(h));h+=M}}return QP(QP(QP({},e),{},{x:d,y:f,width:h,height:g,value:l?r:r[1],payload:e,background:v},C&&C[t]&&C[t].props),{},{tooltipPayload:[hO(n,e)],tooltipPosition:{x:d+h/2,y:f+g/2}})}),layout:m},f)});var Tle=e(rle()),oF=e(ole());function sF(e){"@babel/helpers - typeof";return sF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},sF(e)}function Ele(e,t){if(!(e instanceof t))throw 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,fF(r.key),r)}}function Dle(e,t,n){return t&&cF(e.prototype,t),n&&cF(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function lF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?lF(Object(n),!0).forEach(function(t){dF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function dF(e,t,n){return t=fF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fF(e){var t=Ole(e,`string`);return sF(t)==`symbol`?t:t+``}function Ole(e,t){if(sF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(sF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var pF=function(e,t,n,r,i){var a=e.width,o=e.height,s=e.layout,c=e.children,l=Object.keys(t),u={left:n.left,leftMirror:n.left,right:a-n.right,rightMirror:a-n.right,top:n.top,topMirror:n.top,bottom:o-n.bottom,bottomMirror:o-n.bottom},d=!!d_(c,aF);return l.reduce(function(a,o){var c=t[o],l=c.orientation,f=c.domain,p=c.padding,m=p===void 0?{}:p,h=c.mirror,g=c.reversed,_=`${l}${h?`Mirror`:``}`,v,y,b,x,S;if(c.type===`number`&&(c.padding===`gap`||c.padding===`no-gap`)){var C=f[1]-f[0],w=1/0,T=c.categoricalDomain.sort(Gne);if(T.forEach(function(e,t){t>0&&(w=Math.min((e||0)-(T[t-1]||0),w))}),Number.isFinite(w)){var E=w/C,D=c.layout===`vertical`?n.height:n.width;if(c.padding===`gap`&&(v=E*D/2),c.padding===`no-gap`){var O=Gg(e.barCategoryGap,E*D),k=E*D/2;v=k-O-(k-O)/D*O}}}y=r===`xAxis`?[n.left+(m.left||0)+(v||0),n.left+n.width-(m.right||0)-(v||0)]:r===`yAxis`?s===`horizontal`?[n.top+n.height-(m.bottom||0),n.top+(m.top||0)]:[n.top+(m.top||0)+(v||0),n.top+n.height-(m.bottom||0)-(v||0)]:c.range,g&&(y=[y[1],y[0]]);var A=rO(c,i,d),j=A.scale,M=A.realScaleType;j.domain(f).range(y),aO(j);var N=oO(j,uF(uF({},c),{},{realScaleType:M}));r===`xAxis`?(S=l===`top`&&!h||l===`bottom`&&h,b=n.left,x=u[_]-S*c.height):r===`yAxis`&&(S=l===`left`&&!h||l===`right`&&h,b=u[_]-S*c.width,x=n.top);var P=uF(uF(uF({},c),N),{},{realScaleType:M,x:b,y:x,scale:j,width:r===`xAxis`?n.width:c.width,height:r===`yAxis`?n.height:c.height});return P.bandSize=pO(P,N),!c.hide&&r===`xAxis`?u[_]+=(S?-1:1)*P.height:c.hide||(u[_]+=(S?-1:1)*P.width),uF(uF({},a),{},dF({},o,P))},{})},mF=function(e,t){var n=e.x,r=e.y,i=t.x,a=t.y;return{x:Math.min(n,i),y:Math.min(r,a),width:Math.abs(i-n),height:Math.abs(a-r)}},kle=function(e){var t=e.x1,n=e.y1,r=e.x2,i=e.y2;return mF({x:t,y:n},{x:r,y:i})},hF=function(){function e(t){Ele(this,e),this.scale=t}return Dle(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(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.bandAware,r=t.position;if(e!==void 0){if(r)switch(r){case`start`:return this.scale(e);case`middle`:var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i;case`end`:var a=this.bandwidth?this.bandwidth():0;return this.scale(e)+a;default:return this.scale(e)}if(n){var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+o}return this.scale(e)}}},{key:`isInRange`,value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],[{key:`create`,value:function(t){return new e(t)}}])}();dF(hF,`EPS`,1e-4);var gF=function(e){var t=Object.keys(e).reduce(function(t,n){return uF(uF({},t),{},dF({},n,hF.create(e[n])))},{});return uF(uF({},t),{},{apply:function(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.bandAware,i=n.position;return(0,Tle.default)(e,function(e,n){return t[n].apply(e,{bandAware:r,position:i})})},isInRange:function(e){return(0,oF.default)(e,function(e,n){return t[n].isInRange(e)})}})};function Ale(e){return(e%180+180)%180}var jle=function(e){var t=e.width,n=e.height,r=Ale(arguments.length>1&&arguments[1]!==void 0?arguments[1]:0)*Math.PI/180,i=Math.atan(n/t),a=r>i&&r<Math.PI-i?n/Math.sin(r):t/Math.cos(r);return Math.abs(a)},Mle=r(((e,t)=>{var n=Nb(),r=lb(),i=ub();function a(e){return function(t,a,o){var s=Object(t);if(!r(t)){var c=n(a,3);t=i(t),a=function(e){return c(s[e],e,s)}}var l=e(t,a,o);return l>-1?s[c?t[l]:l]:void 0}}t.exports=a})),Nle=r(((e,t)=>{var n=wP();function r(e){var t=n(e),r=t%1;return t===t?r?t-r:t:0}t.exports=r})),Ple=r(((e,t)=>{var n=Pb(),r=Nb(),i=Nle(),a=Math.max;function o(e,t,o){var s=e==null?0:e.length;if(!s)return-1;var c=o==null?0:i(o);return c<0&&(c=a(s+c,0)),n(e,r(t,3),c)}t.exports=o})),Fle=r(((e,t)=>{t.exports=Mle()(Ple())})),Ile=(0,e(kg()).default)(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(``)}),Lle=e(Fle()),_F=(0,u.createContext)(void 0),vF=(0,u.createContext)(void 0),yF=(0,u.createContext)(void 0),bF=(0,u.createContext)({}),xF=(0,u.createContext)(void 0),SF=(0,u.createContext)(0),CF=(0,u.createContext)(0),wF=function(e){var t=e.state,n=t.xAxisMap,r=t.yAxisMap,i=t.offset,a=e.clipPathId,o=e.children,s=e.width,c=e.height,l=Ile(i);return u.createElement(_F.Provider,{value:n},u.createElement(vF.Provider,{value:r},u.createElement(bF.Provider,{value:i},u.createElement(yF.Provider,{value:l},u.createElement(xF.Provider,{value:a},u.createElement(SF.Provider,{value:c},u.createElement(CF.Provider,{value:s},o)))))))},Rle=function(){return(0,u.useContext)(xF)},TF=function(e){var t=(0,u.useContext)(_F);t??SD(!1);var n=t[e];return n??SD(!1),n},zle=function(){return Kg((0,u.useContext)(_F))},Ble=function(){var e=(0,u.useContext)(vF);return(0,Lle.default)(e,function(e){return(0,oF.default)(e.domain,Number.isFinite)})||Kg(e)},EF=function(e){var t=(0,u.useContext)(vF);t??SD(!1);var n=t[e];return n??SD(!1),n},Vle=function(){return(0,u.useContext)(yF)},Hle=function(){return(0,u.useContext)(bF)},DF=function(){return(0,u.useContext)(CF)},OF=function(){return(0,u.useContext)(SF)},Ule=e(tle());function kF(e){"@babel/helpers - typeof";return kF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},kF(e)}function Wle(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function AF(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,LF(r.key),r)}}function Gle(e,t,n){return t&&AF(e.prototype,t),n&&AF(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Kle(e,t,n){return t=MF(t),qle(e,jF()?Reflect.construct(t,n||[],MF(e).constructor):t.apply(e,n))}function qle(e,t){if(t&&(kF(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Jle(e)}function Jle(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function jF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jF=function(){return!!e})()}function MF(e){return MF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},MF(e)}function Yle(e,t){if(typeof t!=`function`&&t!==null)throw 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&&NF(e,t)}function NF(e,t){return NF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},NF(e,t)}function PF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?PF(Object(n),!0).forEach(function(t){IF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):PF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function IF(e,t,n){return t=LF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LF(e){var t=Xle(e,`string`);return kF(t)==`symbol`?t:t+``}function Xle(e,t){if(kF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(kF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Zle(e,t){return tue(e)||eue(e,t)||$le(e,t)||Qle()}function Qle(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
178
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $le(e,t){if(e){if(typeof e==`string`)return RF(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 RF(e,t)}}function RF(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function eue(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function tue(e){if(Array.isArray(e))return e}function zF(){return zF=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},zF.apply(this,arguments)}var nue=function(e,t){return u.isValidElement(e)?u.cloneElement(e,t):(0,n_.default)(e)?e(t):u.createElement(`line`,zF({},t,{className:`recharts-reference-line-line`}))},rue=function(e,t,n,r,i,a,o,s,c){var l=i.x,u=i.y,d=i.width,f=i.height;if(n){var p=c.y,m=e.y.apply(p,{position:a});if(HP(c,`discard`)&&!e.y.isInRange(m))return null;var h=[{x:l+d,y:m},{x:l,y:m}];return s===`left`?h.reverse():h}if(t){var g=c.x,_=e.x.apply(g,{position:a});if(HP(c,`discard`)&&!e.x.isInRange(_))return null;var v=[{x:_,y:u+f},{x:_,y:u}];return o===`top`?v.reverse():v}if(r){var y=c.segment.map(function(t){return e.apply(t,{position:a})});return HP(c,`discard`)&&(0,Ule.default)(y,function(t){return!e.isInRange(t)})?null:y}return null};function iue(e){var t=e.x,n=e.y,r=e.segment,i=e.xAxisId,a=e.yAxisId,o=e.shape,s=e.className,c=e.alwaysShow,l=Rle(),d=TF(i),f=EF(a),p=Vle();if(!l||!p)return null;x_(c===void 0,`The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.`);var m=rue(gF({x:d.scale,y:f.scale}),Ug(t),Ug(n),r&&r.length===2,p,e.position,d.orientation,f.orientation,e);if(!m)return null;var h=Zle(m,2),g=h[0],_=g.x,v=g.y,y=h[1],b=y.x,x=y.y,S=FF(FF({clipPath:HP(e,`hidden`)?`url(#${l})`:void 0},J(e,!0)),{},{x1:_,y1:v,x2:b,y2:x});return u.createElement(b_,{className:Mt(`recharts-reference-line`,s)},nue(o,S),nk.renderCallByParent(e,kle({x1:_,y1:v,x2:b,y2:x})))}var BF=function(e){function t(){return Wle(this,t),Kle(this,t,arguments)}return Yle(t,e),Gle(t,[{key:`render`,value:function(){return u.createElement(iue,this.props)}}])}(u.Component);IF(BF,`displayName`,`ReferenceLine`),IF(BF,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,fill:`none`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1,position:`middle`});function VF(){return VF=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},VF.apply(this,arguments)}function HF(e){"@babel/helpers - typeof";return HF=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},HF(e)}function UF(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WF(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?UF(Object(n),!0).forEach(function(t){YF(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UF(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aue(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function GF(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,XF(r.key),r)}}function oue(e,t,n){return t&&GF(e.prototype,t),n&&GF(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function sue(e,t,n){return t=qF(t),cue(e,KF()?Reflect.construct(t,n||[],qF(e).constructor):t.apply(e,n))}function cue(e,t){if(t&&(HF(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return lue(e)}function lue(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function KF(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KF=function(){return!!e})()}function qF(e){return qF=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qF(e)}function uue(e,t){if(typeof t!=`function`&&t!==null)throw 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&&JF(e,t)}function JF(e,t){return JF=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},JF(e,t)}function YF(e,t,n){return t=XF(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XF(e){var t=due(e,`string`);return HF(t)==`symbol`?t:t+``}function due(e,t){if(HF(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(HF(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var fue=function(e){var t=e.x,n=e.y,r=e.xAxis,i=e.yAxis,a=gF({x:r.scale,y:i.scale}),o=a.apply({x:t,y:n},{bandAware:!0});return HP(e,`discard`)&&!a.isInRange(o)?null:o},ZF=function(e){function t(){return aue(this,t),sue(this,t,arguments)}return uue(t,e),oue(t,[{key:`render`,value:function(){var e=this.props,n=e.x,r=e.y,i=e.r,a=e.alwaysShow,o=e.clipPathId,s=Ug(n),c=Ug(r);if(x_(a===void 0,`The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.`),!s||!c)return null;var l=fue(this.props);if(!l)return null;var d=l.x,f=l.y,p=this.props,m=p.shape,h=p.className,g=WF(WF({clipPath:HP(this.props,`hidden`)?`url(#${o})`:void 0},J(this.props,!0)),{},{cx:d,cy:f});return u.createElement(b_,{className:Mt(`recharts-reference-dot`,h)},t.renderDot(m,g),nk.renderCallByParent(this.props,{x:d-i,y:f-i,width:2*i,height:2*i}))}}])}(u.Component);YF(ZF,`displayName`,`ReferenceDot`),YF(ZF,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#fff`,stroke:`#ccc`,fillOpacity:1,strokeWidth:1}),YF(ZF,`renderDot`,function(e,t){return u.isValidElement(e)?u.cloneElement(e,t):(0,n_.default)(e)?e(t):u.createElement(mN,VF({},t,{cx:t.cx,cy:t.cy,className:`recharts-reference-dot-dot`}))});function QF(){return QF=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},QF.apply(this,arguments)}function $F(e){"@babel/helpers - typeof";return $F=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$F(e)}function eI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?eI(Object(n),!0).forEach(function(t){oI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pue(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function nI(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,sI(r.key),r)}}function mue(e,t,n){return t&&nI(e.prototype,t),n&&nI(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function hue(e,t,n){return t=iI(t),gue(e,rI()?Reflect.construct(t,n||[],iI(e).constructor):t.apply(e,n))}function gue(e,t){if(t&&($F(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return _ue(e)}function _ue(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function rI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(rI=function(){return!!e})()}function iI(e){return iI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},iI(e)}function vue(e,t){if(typeof t!=`function`&&t!==null)throw 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&&aI(e,t)}function aI(e,t){return aI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},aI(e,t)}function oI(e,t,n){return t=sI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sI(e){var t=yue(e,`string`);return $F(t)==`symbol`?t:t+``}function yue(e,t){if($F(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if($F(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var bue=function(e,t,n,r,i){var a=i.x1,o=i.x2,s=i.y1,c=i.y2,l=i.xAxis,u=i.yAxis;if(!l||!u)return null;var d=gF({x:l.scale,y:u.scale}),f={x:e?d.x.apply(a,{position:`start`}):d.x.rangeMin,y:n?d.y.apply(s,{position:`start`}):d.y.rangeMin},p={x:t?d.x.apply(o,{position:`end`}):d.x.rangeMax,y:r?d.y.apply(c,{position:`end`}):d.y.rangeMax};return HP(i,`discard`)&&(!d.isInRange(f)||!d.isInRange(p))?null:mF(f,p)},cI=function(e){function t(){return pue(this,t),hue(this,t,arguments)}return vue(t,e),mue(t,[{key:`render`,value:function(){var e=this.props,n=e.x1,r=e.x2,i=e.y1,a=e.y2,o=e.className,s=e.alwaysShow,c=e.clipPathId;x_(s===void 0,`The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.`);var l=Ug(n),d=Ug(r),f=Ug(i),p=Ug(a),m=this.props.shape;if(!l&&!d&&!f&&!p&&!m)return null;var h=bue(l,d,f,p,this.props);if(!h&&!m)return null;var g=HP(this.props,`hidden`)?`url(#${c})`:void 0;return u.createElement(b_,{className:Mt(`recharts-reference-area`,o)},t.renderRect(m,tI(tI({clipPath:g},J(this.props,!0)),h)),nk.renderCallByParent(this.props,h))}}])}(u.Component);oI(cI,`displayName`,`ReferenceArea`),oI(cI,`defaultProps`,{isFront:!1,ifOverflow:`discard`,xAxisId:0,yAxisId:0,r:10,fill:`#ccc`,fillOpacity:.5,stroke:`none`,strokeWidth:1}),oI(cI,`renderRect`,function(e,t){return u.isValidElement(e)?u.cloneElement(e,t):(0,n_.default)(e)?e(t):u.createElement(ZM,QF({},t,{className:`recharts-reference-area-rect`}))});function lI(e,t,n){if(t<1)return[];if(t===1&&n===void 0)return e;for(var r=[],i=0;i<e.length;i+=t)if(n===void 0||n(e[i])===!0)r.push(e[i]);else return;return r}function xue(e,t,n){return jle({width:e.width+t.width,height:e.height+t.height},n)}function Sue(e,t,n){var r=n===`width`,i=e.x,a=e.y,o=e.width,s=e.height;return t===1?{start:r?i:a,end:r?i+o:a+s}:{start:r?i+o:a+s,end:r?i:a}}function uI(e,t,n,r,i){if(e*t<e*r||e*t>e*i)return!1;var a=n();return e*(t-e*a/2-r)>=0&&e*(t+e*a/2-i)<=0}function Cue(e,t){return lI(e,t+1)}function wue(e,t,n,r,i){for(var a=(r||[]).slice(),o=t.start,s=t.end,c=0,l=1,u=o,d=function(){var t=r?.[c];if(t===void 0)return{v:lI(r,l)};var a=c,d,f=function(){return d===void 0&&(d=n(t,a)),d},p=t.coordinate,m=c===0||uI(e,p,f,u,s);m||(c=0,u=o,l+=1),m&&(u=p+e*(f()/2+i),c+=l)},f;l<=a.length;)if(f=d(),f)return f.v;return[]}function dI(e){"@babel/helpers - typeof";return dI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},dI(e)}function fI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?fI(Object(n),!0).forEach(function(t){Tue(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tue(e,t,n){return t=Eue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Eue(e){var t=Due(e,`string`);return dI(t)==`symbol`?t:t+``}function Due(e,t){if(dI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(dI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Oue(e,t,n,r,i){for(var a=(r||[]).slice(),o=a.length,s=t.start,c=t.end,l=function(t){var r=a[t],l,u=function(){return l===void 0&&(l=n(r,t)),l};if(t===o-1){var d=e*(r.coordinate+e*u()/2-c);a[t]=r=pI(pI({},r),{},{tickCoord:d>0?r.coordinate-d*e:r.coordinate})}else a[t]=r=pI(pI({},r),{},{tickCoord:r.coordinate});uI(e,r.tickCoord,u,s,c)&&(c=r.tickCoord-e*(u()/2+i),a[t]=pI(pI({},r),{},{isShow:!0}))},u=o-1;u>=0;u--)l(u);return a}function kue(e,t,n,r,i,a){var o=(r||[]).slice(),s=o.length,c=t.start,l=t.end;if(a){var u=r[s-1],d=n(u,s-1),f=e*(u.coordinate+e*d/2-l);o[s-1]=u=pI(pI({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),uI(e,u.tickCoord,function(){return d},c,l)&&(l=u.tickCoord-e*(d/2+i),o[s-1]=pI(pI({},u),{},{isShow:!0}))}for(var p=a?s-1:s,m=function(t){var r=o[t],a,s=function(){return a===void 0&&(a=n(r,t)),a};if(t===0){var u=e*(r.coordinate-e*s()/2-c);o[t]=r=pI(pI({},r),{},{tickCoord:u<0?r.coordinate-u*e:r.coordinate})}else o[t]=r=pI(pI({},r),{},{tickCoord:r.coordinate});uI(e,r.tickCoord,s,c,l)&&(c=r.tickCoord+e*(s()/2+i),o[t]=pI(pI({},r),{},{isShow:!0}))},h=0;h<p;h++)m(h);return o}function mI(e,t,n){var r=e.tick,i=e.ticks,a=e.viewBox,o=e.minTickGap,s=e.orientation,c=e.interval,l=e.tickFormatter,u=e.unit,d=e.angle;if(!i||!i.length||!r)return[];if(q(c)||iS.isSsr)return Cue(i,typeof c==`number`&&q(c)?c:0);var f=[],p=s===`top`||s===`bottom`?`width`:`height`,m=u&&p===`width`?OS(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=function(e,r){var i=(0,n_.default)(l)?l(e.value,r):e.value;return p===`width`?xue(OS(i,{fontSize:t,letterSpacing:n}),m,d):OS(i,{fontSize:t,letterSpacing:n})[p]},g=i.length>=2?Vg(i[1].coordinate-i[0].coordinate):1,_=Sue(a,g,p);return c===`equidistantPreserveStart`?wue(g,_,h,i,o):(f=c===`preserveStart`||c===`preserveStartEnd`?kue(g,_,h,i,o,c===`preserveStartEnd`):Oue(g,_,h,i,o),f.filter(function(e){return e.isShow}))}var Aue=[`viewBox`],jue=[`viewBox`],Mue=[`ticks`];function hI(e){"@babel/helpers - typeof";return hI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},hI(e)}function gI(){return gI=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},gI.apply(this,arguments)}function _I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?_I(Object(n),!0).forEach(function(t){wI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yI(e,t){if(e==null)return{};var n=Nue(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Nue(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 Pue(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function bI(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,TI(r.key),r)}}function Fue(e,t,n){return t&&bI(e.prototype,t),n&&bI(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Iue(e,t,n){return t=SI(t),Lue(e,xI()?Reflect.construct(t,n||[],SI(e).constructor):t.apply(e,n))}function Lue(e,t){if(t&&(hI(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Rue(e)}function Rue(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function xI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(xI=function(){return!!e})()}function SI(e){return SI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},SI(e)}function zue(e,t){if(typeof t!=`function`&&t!==null)throw 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&&CI(e,t)}function CI(e,t){return CI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},CI(e,t)}function wI(e,t,n){return t=TI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TI(e){var t=Bue(e,`string`);return hI(t)==`symbol`?t:t+``}function Bue(e,t){if(hI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(hI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var EI=function(e){function t(e){var n;return Pue(this,t),n=Iue(this,t,[e]),n.state={fontSize:``,letterSpacing:``},n}return zue(t,e),Fue(t,[{key:`shouldComponentUpdate`,value:function(e,t){var n=e.viewBox,r=yI(e,Aue),i=this.props,a=i.viewBox,o=yI(i,jue);return!Yg(n,a)||!Yg(r,o)||!Yg(t,this.state)}},{key:`componentDidMount`,value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName(`recharts-cartesian-axis-tick-value`)[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:`getTickLineCoord`,value:function(e){var t=this.props,n=t.x,r=t.y,i=t.width,a=t.height,o=t.orientation,s=t.tickSize,c=t.mirror,l=t.tickMargin,u,d,f,p,m,h,g=c?-1:1,_=e.tickSize||s,v=q(e.tickCoord)?e.tickCoord:e.coordinate;switch(o){case`top`:u=d=e.coordinate,p=r+ +!c*a,f=p-g*_,h=f-g*l,m=v;break;case`left`:f=p=e.coordinate,d=n+ +!c*i,u=d-g*_,m=u-g*l,h=v;break;case`right`:f=p=e.coordinate,d=n+ +c*i,u=d+g*_,m=u+g*l,h=v;break;default:u=d=e.coordinate,p=r+ +c*a,f=p+g*_,h=f+g*l,m=v;break}return{line:{x1:u,y1:f,x2:d,y2:p},tick:{x:m,y:h}}}},{key:`getTickTextAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r;switch(t){case`left`:r=n?`start`:`end`;break;case`right`:r=n?`end`:`start`;break;default:r=`middle`;break}return r}},{key:`getTickVerticalAnchor`,value:function(){var e=this.props,t=e.orientation,n=e.mirror,r=`end`;switch(t){case`left`:case`right`:r=`middle`;break;case`top`:r=n?`start`:`end`;break;default:r=n?`end`:`start`;break}return r}},{key:`renderAxisLine`,value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,i=e.height,a=e.orientation,o=e.mirror,s=e.axisLine,c=vI(vI(vI({},J(this.props,!1)),J(s,!1)),{},{fill:`none`});if(a===`top`||a===`bottom`){var l=+(a===`top`&&!o||a===`bottom`&&o);c=vI(vI({},c),{},{x1:t,y1:n+l*i,x2:t+r,y2:n+l*i})}else{var d=+(a===`left`&&!o||a===`right`&&o);c=vI(vI({},c),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+i})}return u.createElement(`line`,gI({},c,{className:Mt(`recharts-cartesian-axis-line`,(0,zg.default)(s,`className`))}))}},{key:`renderTicks`,value:function(e,n,r){var i=this,a=this.props,o=a.tickLine,s=a.stroke,c=a.tick,l=a.tickFormatter,d=a.unit,f=mI(vI(vI({},this.props),{},{ticks:e}),n,r),p=this.getTickTextAnchor(),m=this.getTickVerticalAnchor(),h=J(this.props,!1),g=J(c,!1),_=vI(vI({},h),{},{fill:`none`},J(o,!1)),v=f.map(function(e,n){var r=i.getTickLineCoord(e),a=r.line,v=r.tick,y=vI(vI(vI(vI({textAnchor:p,verticalAnchor:m},h),{},{stroke:`none`,fill:s},g),v),{},{index:n,payload:e,visibleTicksCount:f.length,tickFormatter:l});return u.createElement(b_,gI({className:`recharts-cartesian-axis-tick`,key:`tick-${e.value}-${e.coordinate}-${e.tickCoord}`},t_(i.props,e,n)),o&&u.createElement(`line`,gI({},_,a,{className:Mt(`recharts-cartesian-axis-tick-line`,(0,zg.default)(o,`className`))})),c&&t.renderTickItem(c,y,`${(0,n_.default)(l)?l(e.value,n):e.value}${d||``}`))});return u.createElement(`g`,{className:`recharts-cartesian-axis-ticks`},v)}},{key:`render`,value:function(){var e=this,t=this.props,n=t.axisLine,r=t.width,i=t.height,a=t.ticksGenerator,o=t.className;if(t.hide)return null;var s=this.props,c=s.ticks,l=yI(s,Mue),d=c;return(0,n_.default)(a)&&(d=c&&c.length>0?a(this.props):a(l)),r<=0||i<=0||!d||!d.length?null:u.createElement(b_,{className:Mt(`recharts-cartesian-axis`,o),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(d,this.state.fontSize,this.state.letterSpacing),nk.renderCallByParent(this.props))}}],[{key:`renderTickItem`,value:function(e,t,n){var r,i=Mt(t.className,`recharts-cartesian-axis-tick-value`);return r=u.isValidElement(e)?u.cloneElement(e,vI(vI({},t),{},{className:i})):(0,n_.default)(e)?e(vI(vI({},t),{},{className:i})):u.createElement(YS,gI({},t,{className:`recharts-cartesian-axis-tick-value`}),n),r}}])}(u.Component);wI(EI,`displayName`,`CartesianAxis`),wI(EI,`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 Vue=[`x1`,`y1`,`x2`,`y2`,`key`],Hue=[`offset`];function DI(e){"@babel/helpers - typeof";return DI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},DI(e)}function OI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?OI(Object(n),!0).forEach(function(t){Uue(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Uue(e,t,n){return t=Wue(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Wue(e){var t=Gue(e,`string`);return DI(t)==`symbol`?t:t+``}function Gue(e,t){if(DI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(DI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function AI(){return AI=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},AI.apply(this,arguments)}function jI(e,t){if(e==null)return{};var n=Kue(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Kue(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 que=function(e){var t=e.fill;if(!t||t===`none`)return null;var n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.ry;return u.createElement(`rect`,{x:r,y:i,ry:s,width:a,height:o,stroke:`none`,fill:t,fillOpacity:n,className:`recharts-cartesian-grid-bg`})};function MI(e,t){var n;if(u.isValidElement(e))n=u.cloneElement(e,t);else if((0,n_.default)(e))n=e(t);else{var r=t.x1,i=t.y1,a=t.x2,o=t.y2,s=t.key,c=J(jI(t,Vue),!1);c.offset;var l=jI(c,Hue);n=u.createElement(`line`,AI({},l,{x1:r,y1:i,x2:a,y2:o,fill:`none`,key:s}))}return n}function Jue(e){var t=e.x,n=e.width,r=e.horizontal,i=r===void 0?!0:r,a=e.horizontalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(r,a){return MI(i,kI(kI({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:`line-${a}`,index:a}))});return u.createElement(`g`,{className:`recharts-cartesian-grid-horizontal`},o)}function Yue(e){var t=e.y,n=e.height,r=e.vertical,i=r===void 0?!0:r,a=e.verticalPoints;if(!i||!a||!a.length)return null;var o=a.map(function(r,a){return MI(i,kI(kI({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:`line-${a}`,index:a}))});return u.createElement(`g`,{className:`recharts-cartesian-grid-vertical`},o)}function Xue(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,i=e.y,a=e.width,o=e.height,s=e.horizontalPoints,c=e.horizontal;if(!(c===void 0||c)||!t||!t.length)return null;var l=s.map(function(e){return Math.round(e+i-i)}).sort(function(e,t){return e-t});i!==l[0]&&l.unshift(0);var d=l.map(function(e,s){var c=l[s+1]?l[s+1]-e:i+o-e;if(c<=0)return null;var d=s%t.length;return u.createElement(`rect`,{key:`react-${s}`,y:e,x:r,height:c,width:a,stroke:`none`,fill:t[d],fillOpacity:n,className:`recharts-cartesian-grid-bg`})});return u.createElement(`g`,{className:`recharts-cartesian-gridstripes-horizontal`},d)}function Zue(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,i=e.fillOpacity,a=e.x,o=e.y,s=e.width,c=e.height,l=e.verticalPoints;if(!n||!r||!r.length)return null;var d=l.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==d[0]&&d.unshift(0);var f=d.map(function(e,t){var n=d[t+1]?d[t+1]-e:a+s-e;if(n<=0)return null;var l=t%r.length;return u.createElement(`rect`,{key:`react-${t}`,x:e,y:o,width:n,height:c,stroke:`none`,fill:r[l],fillOpacity:i,className:`recharts-cartesian-grid-bg`})});return u.createElement(`g`,{className:`recharts-cartesian-gridstripes-vertical`},f)}var Que=function(e,t){var n=e.xAxis,r=e.width,i=e.height,a=e.offset;return $D(mI(kI(kI(kI({},EI.defaultProps),n),{},{ticks:eO(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.left,a.left+a.width,t)},$ue=function(e,t){var n=e.yAxis,r=e.width,i=e.height,a=e.offset;return $D(mI(kI(kI(kI({},EI.defaultProps),n),{},{ticks:eO(n,!0),viewBox:{x:0,y:0,width:r,height:i}})),a.top,a.top+a.height,t)},NI={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:`#ccc`,fill:`none`,verticalFill:[],horizontalFill:[]};function PI(e){var t=DF(),n=OF(),r=Hle(),i=kI(kI({},e),{},{stroke:e.stroke??NI.stroke,fill:e.fill??NI.fill,horizontal:e.horizontal??NI.horizontal,horizontalFill:e.horizontalFill??NI.horizontalFill,vertical:e.vertical??NI.vertical,verticalFill:e.verticalFill??NI.verticalFill,x:q(e.x)?e.x:r.left,y:q(e.y)?e.y:r.top,width:q(e.width)?e.width:r.width,height:q(e.height)?e.height:r.height}),a=i.x,o=i.y,s=i.width,c=i.height,l=i.syncWithTicks,d=i.horizontalValues,f=i.verticalValues,p=zle(),m=Ble();if(!q(s)||s<=0||!q(c)||c<=0||!q(a)||a!==+a||!q(o)||o!==+o)return null;var h=i.verticalCoordinatesGenerator||Que,g=i.horizontalCoordinatesGenerator||$ue,_=i.horizontalPoints,v=i.verticalPoints;if((!_||!_.length)&&(0,n_.default)(g)){var y=d&&d.length,b=g({yAxis:m?kI(kI({},m),{},{ticks:y?d:m.ticks}):void 0,width:t,height:n,offset:r},y?!0:l);x_(Array.isArray(b),`horizontalCoordinatesGenerator should return Array but instead it returned [${DI(b)}]`),Array.isArray(b)&&(_=b)}if((!v||!v.length)&&(0,n_.default)(h)){var x=f&&f.length,S=h({xAxis:p?kI(kI({},p),{},{ticks:x?f:p.ticks}):void 0,width:t,height:n,offset:r},x?!0:l);x_(Array.isArray(S),`verticalCoordinatesGenerator should return Array but instead it returned [${DI(S)}]`),Array.isArray(S)&&(v=S)}return u.createElement(`g`,{className:`recharts-cartesian-grid`},u.createElement(que,{fill:i.fill,fillOpacity:i.fillOpacity,x:i.x,y:i.y,width:i.width,height:i.height,ry:i.ry}),u.createElement(Jue,AI({},i,{offset:r,horizontalPoints:_,xAxis:p,yAxis:m})),u.createElement(Yue,AI({},i,{offset:r,verticalPoints:v,xAxis:p,yAxis:m})),u.createElement(Xue,AI({},i,{horizontalPoints:_})),u.createElement(Zue,AI({},i,{verticalPoints:v})))}PI.displayName=`CartesianGrid`;var ede=[`type`,`layout`,`connectNulls`,`ref`],tde=[`key`];function FI(e){"@babel/helpers - typeof";return FI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},FI(e)}function II(e,t){if(e==null)return{};var n=nde(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nde(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 LI(){return LI=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},LI.apply(this,arguments)}function RI(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zI(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?RI(Object(n),!0).forEach(function(t){KI(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RI(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BI(e){return ode(e)||ade(e)||ide(e)||rde()}function rde(){throw TypeError(`Invalid attempt to spread non-iterable instance.
179
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ide(e,t){if(e){if(typeof e==`string`)return VI(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 VI(e,t)}}function ade(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function ode(e){if(Array.isArray(e))return VI(e)}function VI(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function sde(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function HI(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,qI(r.key),r)}}function cde(e,t,n){return t&&HI(e.prototype,t),n&&HI(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function lde(e,t,n){return t=WI(t),ude(e,UI()?Reflect.construct(t,n||[],WI(e).constructor):t.apply(e,n))}function ude(e,t){if(t&&(FI(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return dde(e)}function dde(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function UI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(UI=function(){return!!e})()}function WI(e){return WI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},WI(e)}function fde(e,t){if(typeof t!=`function`&&t!==null)throw 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&&GI(e,t)}function GI(e,t){return GI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},GI(e,t)}function KI(e,t,n){return t=qI(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qI(e){var t=pde(e,`string`);return FI(t)==`symbol`?t:t+``}function pde(e,t){if(FI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(FI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var JI=function(e){function t(){var e;sde(this,t);var n=[...arguments];return e=lde(this,t,[].concat(n)),KI(e,`state`,{isAnimationFinished:!0,totalLength:0}),KI(e,`generateSimpleStrokeDasharray`,function(e,t){return`${t}px ${e-t}px`}),KI(e,`getStrokeDasharray`,function(n,r,i){var a=i.reduce(function(e,t){return e+t});if(!a)return e.generateSimpleStrokeDasharray(r,n);for(var o=Math.floor(n/a),s=n%a,c=r-n,l=[],u=0,d=0;u<i.length;d+=i[u],++u)if(d+i[u]>s){l=[].concat(BI(i.slice(0,u)),[s-d]);break}var f=l.length%2==0?[0,c]:[c];return[].concat(BI(t.repeat(i,o)),BI(l),f).map(function(e){return`${e}px`}).join(`, `)}),KI(e,`id`,Wg(`recharts-line-`)),KI(e,`pathRef`,function(t){e.mainCurve=t}),KI(e,`handleAnimationEnd`,function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),KI(e,`handleAnimationStart`,function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return fde(t,e),cde(t,[{key:`componentDidMount`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:`componentDidUpdate`,value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:`getTotalLength`,value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}},{key:`renderErrorBar`,value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.points,i=n.xAxis,a=n.yAxis,o=n.layout,s=n.children,c=u_(s,ND);if(!c)return null;var l=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:qD(e.payload,t)}},d={clipPath:e?`url(#clipPath-${t})`:null};return u.createElement(b_,d,c.map(function(e){return u.cloneElement(e,{key:`bar-${e.props.dataKey}`,data:r,xAxis:i,yAxis:a,layout:o,dataPointFormatter:l})}))}},{key:`renderDots`,value:function(e,n,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,a=i.dot,o=i.points,s=i.dataKey,c=J(this.props,!1),l=J(a,!0),d=o.map(function(e,n){var r=zI(zI(zI({key:`dot-${n}`,r:3},c),l),{},{index:n,cx:e.x,cy:e.y,value:e.value,dataKey:s,payload:e.payload,points:o});return t.renderDotItem(a,r)}),f={clipPath:e?`url(#clipPath-${n?``:`dots-`}${r})`:null};return u.createElement(b_,LI({className:`recharts-line-dots`,key:`dots`},f),d)}},{key:`renderCurveStatically`,value:function(e,t,n,r){var i=this.props,a=i.type,o=i.layout,s=i.connectNulls;i.ref;var c=zI(zI(zI({},J(II(i,ede),!0)),{},{fill:`none`,className:`recharts-line-curve`,clipPath:t?`url(#clipPath-${n})`:null,points:e},r),{},{type:a,layout:o,connectNulls:s});return u.createElement($k,LI({},c,{pathRef:this.pathRef}))}},{key:`renderCurveWithAnimation`,value:function(e,t){var n=this,r=this.props,i=r.points,a=r.strokeDasharray,o=r.isAnimationActive,s=r.animationBegin,c=r.animationDuration,l=r.animationEasing,d=r.animationId,f=r.animateNewValues,p=r.width,m=r.height,h=this.state,g=h.prevPoints,_=h.totalLength;return u.createElement(PM,{begin:s,duration:c,isActive:o,easing:l,from:{t:0},to:{t:1},key:`line-${d}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o=r.t;if(g){var s=g.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(g[n]){var r=g[n],i=qg(r.x,e.x),a=qg(r.y,e.y);return zI(zI({},e),{},{x:i(o),y:a(o)})}if(f){var c=qg(p*2,e.x),l=qg(m/2,e.y);return zI(zI({},e),{},{x:c(o),y:l(o)})}return zI(zI({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(c,e,t)}var l=qg(0,_)(o),u;if(a){var d=`${a}`.split(/[,\s]+/gim).map(function(e){return parseFloat(e)});u=n.getStrokeDasharray(l,_,d)}else u=n.generateSimpleStrokeDasharray(_,l);return n.renderCurveStatically(i,e,t,{strokeDasharray:u})})}},{key:`renderCurve`,value:function(e,t){var n=this.props,r=n.points,i=n.isAnimationActive,a=this.state,o=a.prevPoints,s=a.totalLength;return i&&r&&r.length&&(!o&&s>0||!(0,BD.default)(o,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.xAxis,o=e.yAxis,s=e.top,c=e.left,l=e.width,d=e.height,f=e.isAnimationActive,p=e.id;if(t||!r||!r.length)return null;var m=this.state.isAnimationFinished,h=r.length===1,g=Mt(`recharts-line`,i),_=a&&a.allowDataOverflow,v=o&&o.allowDataOverflow,y=_||v,b=(0,Bg.default)(p)?this.id:p,x=J(n,!1)??{r:3,strokeWidth:2},S=x.r,C=S===void 0?3:S,w=x.strokeWidth,T=w===void 0?2:w,E=(p_(n)?n:{}).clipDot,D=E===void 0?!0:E,O=C*2+T;return u.createElement(b_,{className:g},_||v?u.createElement(`defs`,null,u.createElement(`clipPath`,{id:`clipPath-${b}`},u.createElement(`rect`,{x:_?c:c-l/2,y:v?s:s-d/2,width:_?l:l*2,height:v?d:d*2})),!D&&u.createElement(`clipPath`,{id:`clipPath-dots-${b}`},u.createElement(`rect`,{x:c-O/2,y:s-O/2,width:l+O,height:d+O}))):null,!h&&this.renderCurve(y,b),this.renderErrorBar(y,b),(h||n)&&this.renderDots(y,D,b),(!f||m)&&wk.renderCallByParent(this.props,r))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.points===t.curPoints?null:{curPoints:e.points}:{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}}},{key:`repeat`,value:function(e,t){for(var n=e.length%2==0?e:[].concat(BI(e),[0]),r=[],i=0;i<t;++i)r=[].concat(BI(r),BI(n));return r}},{key:`renderDotItem`,value:function(e,t){var n;if(u.isValidElement(e))n=u.cloneElement(e,t);else if((0,n_.default)(e))n=e(t);else{var r=t.key,i=II(t,tde),a=Mt(`recharts-line-dot`,typeof e==`boolean`?``:e.className);n=u.createElement(mN,LI({key:r},i,{className:a}))}return n}}])}(u.PureComponent);KI(JI,`displayName`,`Line`),KI(JI,`defaultProps`,{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,fill:`#fff`,points:[],isAnimationActive:!iS.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,hide:!1,label:!1}),KI(JI,`getComposedData`,function(e){var t=e.props,n=e.xAxis,r=e.yAxis,i=e.xAxisTicks,a=e.yAxisTicks,o=e.dataKey,s=e.bandSize,c=e.displayedData,l=e.offset,u=t.layout;return zI({points:c.map(function(e,t){var c=qD(e,o);return u===`horizontal`?{x:sO({axis:n,ticks:i,bandSize:s,entry:e,index:t}),y:(0,Bg.default)(c)?null:r.scale(c),value:c,payload:e}:{x:(0,Bg.default)(c)?null:n.scale(c),y:sO({axis:r,ticks:a,bandSize:s,entry:e,index:t}),value:c,payload:e}}),layout:u},l)});var mde=[`layout`,`type`,`stroke`,`connectNulls`,`isRange`,`ref`],hde=[`key`],YI;function XI(e){"@babel/helpers - typeof";return XI=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},XI(e)}function ZI(e,t){if(e==null)return{};var n=gde(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gde(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 QI(){return QI=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},QI.apply(this,arguments)}function $I(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function eL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?$I(Object(n),!0).forEach(function(t){aL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$I(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _de(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function tL(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,oL(r.key),r)}}function vde(e,t,n){return t&&tL(e.prototype,t),n&&tL(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function yde(e,t,n){return t=rL(t),bde(e,nL()?Reflect.construct(t,n||[],rL(e).constructor):t.apply(e,n))}function bde(e,t){if(t&&(XI(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return xde(e)}function xde(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function nL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nL=function(){return!!e})()}function rL(e){return rL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rL(e)}function Sde(e,t){if(typeof t!=`function`&&t!==null)throw 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&&iL(e,t)}function iL(e,t){return iL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},iL(e,t)}function aL(e,t,n){return t=oL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oL(e){var t=Cde(e,`string`);return XI(t)==`symbol`?t:t+``}function Cde(e,t){if(XI(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(XI(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var sL=function(e){function t(){var e;_de(this,t);var n=[...arguments];return e=yde(this,t,[].concat(n)),aL(e,`state`,{isAnimationFinished:!0}),aL(e,`id`,Wg(`recharts-area-`)),aL(e,`handleAnimationEnd`,function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),(0,n_.default)(t)&&t()}),aL(e,`handleAnimationStart`,function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),(0,n_.default)(t)&&t()}),e}return Sde(t,e),vde(t,[{key:`renderDots`,value:function(e,n,r){var i=this.props.isAnimationActive,a=this.state.isAnimationFinished;if(i&&!a)return null;var o=this.props,s=o.dot,c=o.points,l=o.dataKey,d=J(this.props,!1),f=J(s,!0),p=c.map(function(e,n){var r=eL(eL(eL({key:`dot-${n}`,r:3},d),f),{},{index:n,cx:e.x,cy:e.y,dataKey:l,value:e.value,payload:e.payload,points:c});return t.renderDotItem(s,r)}),m={clipPath:e?`url(#clipPath-${n?``:`dots-`}${r})`:null};return u.createElement(b_,QI({className:`recharts-area-dots`},m),p)}},{key:`renderHorizontalRect`,value:function(e){var t=this.props,n=t.baseLine,r=t.points,i=t.strokeWidth,a=r[0].x,o=r[r.length-1].x,s=e*Math.abs(a-o),c=(0,RD.default)(r.map(function(e){return e.y||0}));return q(n)&&typeof n==`number`?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max((0,RD.default)(n.map(function(e){return e.y||0})),c)),q(c)?u.createElement(`rect`,{x:a<o?a:a-s,y:0,width:s,height:Math.floor(c+(i?parseInt(`${i}`,10):1))}):null}},{key:`renderVerticalRect`,value:function(e){var t=this.props,n=t.baseLine,r=t.points,i=t.strokeWidth,a=r[0].y,o=r[r.length-1].y,s=e*Math.abs(a-o),c=(0,RD.default)(r.map(function(e){return e.x||0}));return q(n)&&typeof n==`number`?c=Math.max(n,c):n&&Array.isArray(n)&&n.length&&(c=Math.max((0,RD.default)(n.map(function(e){return e.x||0})),c)),q(c)?u.createElement(`rect`,{x:0,y:a<o?a:a-s,width:c+(i?parseInt(`${i}`,10):1),height:Math.floor(s)}):null}},{key:`renderClipRect`,value:function(e){return this.props.layout===`vertical`?this.renderVerticalRect(e):this.renderHorizontalRect(e)}},{key:`renderAreaStatically`,value:function(e,t,n,r){var i=this.props,a=i.layout,o=i.type,s=i.stroke,c=i.connectNulls,l=i.isRange;i.ref;var d=ZI(i,mde);return u.createElement(b_,{clipPath:n?`url(#clipPath-${r})`:null},u.createElement($k,QI({},J(d,!0),{points:e,connectNulls:c,type:o,baseLine:t,layout:a,stroke:`none`,className:`recharts-area-area`})),s!==`none`&&u.createElement($k,QI({},J(this.props,!1),{className:`recharts-area-curve`,layout:a,type:o,connectNulls:c,fill:`none`,points:e})),s!==`none`&&l&&u.createElement($k,QI({},J(this.props,!1),{className:`recharts-area-curve`,layout:a,type:o,connectNulls:c,fill:`none`,points:t})))}},{key:`renderAreaWithAnimation`,value:function(e,t){var n=this,r=this.props,i=r.points,a=r.baseLine,o=r.isAnimationActive,s=r.animationBegin,c=r.animationDuration,l=r.animationEasing,d=r.animationId,f=this.state,p=f.prevPoints,m=f.prevBaseLine;return u.createElement(PM,{begin:s,duration:c,isActive:o,easing:l,from:{t:0},to:{t:1},key:`area-${d}`,onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var o=r.t;if(p){var s=p.length/i.length,c=i.map(function(e,t){var n=Math.floor(t*s);if(p[n]){var r=p[n],i=qg(r.x,e.x),a=qg(r.y,e.y);return eL(eL({},e),{},{x:i(o),y:a(o)})}return e}),l=q(a)&&typeof a==`number`?qg(m,a)(o):(0,Bg.default)(a)||(0,Rg.default)(a)?qg(m,0)(o):a.map(function(e,t){var n=Math.floor(t*s);if(m[n]){var r=m[n],i=qg(r.x,e.x),a=qg(r.y,e.y);return eL(eL({},e),{},{x:i(o),y:a(o)})}return e});return n.renderAreaStatically(c,l,e,t)}return u.createElement(b_,null,u.createElement(`defs`,null,u.createElement(`clipPath`,{id:`animationClipPath-${t}`},n.renderClipRect(o))),u.createElement(b_,{clipPath:`url(#animationClipPath-${t})`},n.renderAreaStatically(i,a,e,t)))})}},{key:`renderArea`,value:function(e,t){var n=this.props,r=n.points,i=n.baseLine,a=n.isAnimationActive,o=this.state,s=o.prevPoints,c=o.prevBaseLine,l=o.totalLength;return a&&r&&r.length&&(!s&&l>0||!(0,BD.default)(s,r)||!(0,BD.default)(c,i))?this.renderAreaWithAnimation(e,t):this.renderAreaStatically(r,i,e,t)}},{key:`render`,value:function(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,o=e.left,s=e.xAxis,c=e.yAxis,l=e.width,d=e.height,f=e.isAnimationActive,p=e.id;if(t||!r||!r.length)return null;var m=this.state.isAnimationFinished,h=r.length===1,g=Mt(`recharts-area`,i),_=s&&s.allowDataOverflow,v=c&&c.allowDataOverflow,y=_||v,b=(0,Bg.default)(p)?this.id:p,x=J(n,!1)??{r:3,strokeWidth:2},S=x.r,C=S===void 0?3:S,w=x.strokeWidth,T=w===void 0?2:w,E=(p_(n)?n:{}).clipDot,D=E===void 0?!0:E,O=C*2+T;return u.createElement(b_,{className:g},_||v?u.createElement(`defs`,null,u.createElement(`clipPath`,{id:`clipPath-${b}`},u.createElement(`rect`,{x:_?o:o-l/2,y:v?a:a-d/2,width:_?l:l*2,height:v?d:d*2})),!D&&u.createElement(`clipPath`,{id:`clipPath-dots-${b}`},u.createElement(`rect`,{x:o-O/2,y:a-O/2,width:l+O,height:d+O}))):null,h?null:this.renderArea(y,b),(n||h)&&this.renderDots(y,D,b),(!f||m)&&wk.renderCallByParent(this.props,r))}}],[{key:`getDerivedStateFromProps`,value:function(e,t){return e.animationId===t.prevAnimationId?e.points!==t.curPoints||e.baseLine!==t.curBaseLine?{curPoints:e.points,curBaseLine:e.baseLine}:null:{prevAnimationId:e.animationId,curPoints:e.points,curBaseLine:e.baseLine,prevPoints:t.curPoints,prevBaseLine:t.curBaseLine}}}])}(u.PureComponent);YI=sL,aL(sL,`displayName`,`Area`),aL(sL,`defaultProps`,{stroke:`#3182bd`,fill:`#3182bd`,fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:`line`,connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!iS.isSsr,animationBegin:0,animationDuration:1500,animationEasing:`ease`}),aL(sL,`getBaseValue`,function(e,t,n,r){var i=e.layout,a=e.baseValue,o=t.props.baseValue??a;if(q(o)&&typeof o==`number`)return o;var s=i===`horizontal`?r:n,c=s.scale.domain();if(s.type===`number`){var l=Math.max(c[0],c[1]),u=Math.min(c[0],c[1]);return o===`dataMin`?u:o===`dataMax`||l<0?l:Math.max(Math.min(c[0],c[1]),0)}return o===`dataMin`?c[0]:o===`dataMax`?c[1]:c[0]}),aL(sL,`getComposedData`,function(e){var t=e.props,n=e.item,r=e.xAxis,i=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,s=e.bandSize,c=e.dataKey,l=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,p=t.layout,m=l&&l.length,h=YI.getBaseValue(t,n,r,i),g=p===`horizontal`,_=!1,v=d.map(function(e,t){var n;m?n=l[u+t]:(n=qD(e,c),Array.isArray(n)?_=!0:n=[h,n]);var d=n[1]==null||m&&qD(e,c)==null;return g?{x:sO({axis:r,ticks:a,bandSize:s,entry:e,index:t}),y:d?null:i.scale(n[1]),value:n,payload:e}:{x:d?null:r.scale(n[1]),y:sO({axis:i,ticks:o,bandSize:s,entry:e,index:t}),value:n,payload:e}});return eL({points:v,baseLine:m||_?v.map(function(e){var t=Array.isArray(e.value)?e.value[0]:null;return g?{x:e.x,y:t!=null&&e.y!=null?i.scale(t):null}:{x:t==null?null:r.scale(t),y:e.y}}):g?i.scale(h):r.scale(h),layout:p,isRange:_},f)}),aL(sL,`renderDotItem`,function(e,t){var n;if(u.isValidElement(e))n=u.cloneElement(e,t);else if((0,n_.default)(e))n=e(t);else{var r=Mt(`recharts-area-dot`,typeof e==`boolean`?``:e.className),i=t.key,a=ZI(t,hde);n=u.createElement(mN,QI({},a,{key:i,className:r}))}return n});function cL(e){"@babel/helpers - typeof";return cL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},cL(e)}function wde(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function lL(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,mL(r.key),r)}}function Tde(e,t,n){return t&&lL(e.prototype,t),n&&lL(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Ede(e,t,n){return t=dL(t),Dde(e,uL()?Reflect.construct(t,n||[],dL(e).constructor):t.apply(e,n))}function Dde(e,t){if(t&&(cL(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Ode(e)}function Ode(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function uL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(uL=function(){return!!e})()}function dL(e){return dL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dL(e)}function kde(e,t){if(typeof t!=`function`&&t!==null)throw 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&&fL(e,t)}function fL(e,t){return fL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},fL(e,t)}function pL(e,t,n){return t=mL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mL(e){var t=Ade(e,`string`);return cL(t)==`symbol`?t:t+``}function Ade(e,t){if(cL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(cL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function hL(){return hL=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},hL.apply(this,arguments)}function jde(e){var t=e.xAxisId,n=DF(),r=OF(),i=TF(t);return i==null?null:u.createElement(EI,hL({},i,{className:Mt(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return eO(e,!0)}}))}var gL=function(e){function t(){return wde(this,t),Ede(this,t,arguments)}return kde(t,e),Tde(t,[{key:`render`,value:function(){return u.createElement(jde,this.props)}}])}(u.Component);pL(gL,`displayName`,`XAxis`),pL(gL,`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 _L(e){"@babel/helpers - typeof";return _L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},_L(e)}function Mde(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function vL(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,CL(r.key),r)}}function Nde(e,t,n){return t&&vL(e.prototype,t),n&&vL(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function Pde(e,t,n){return t=bL(t),Fde(e,yL()?Reflect.construct(t,n||[],bL(e).constructor):t.apply(e,n))}function Fde(e,t){if(t&&(_L(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Ide(e)}function Ide(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function yL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(yL=function(){return!!e})()}function bL(e){return bL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bL(e)}function Lde(e,t){if(typeof t!=`function`&&t!==null)throw 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&&xL(e,t)}function xL(e,t){return xL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},xL(e,t)}function SL(e,t,n){return t=CL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CL(e){var t=Rde(e,`string`);return _L(t)==`symbol`?t:t+``}function Rde(e,t){if(_L(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(_L(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wL(){return wL=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},wL.apply(this,arguments)}var zde=function(e){var t=e.yAxisId,n=DF(),r=OF(),i=EF(t);return i==null?null:u.createElement(EI,wL({},i,{className:Mt(`recharts-${i.axisType} ${i.axisType}`,i.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return eO(e,!0)}}))},TL=function(e){function t(){return Mde(this,t),Pde(this,t,arguments)}return Lde(t,e),Nde(t,[{key:`render`,value:function(){return u.createElement(zde,this.props)}}])}(u.Component);SL(TL,`displayName`,`YAxis`),SL(TL,`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 EL(e){return Ude(e)||Hde(e)||Vde(e)||Bde()}function Bde(){throw TypeError(`Invalid attempt to spread non-iterable instance.
180
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vde(e,t){if(e){if(typeof e==`string`)return DL(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 DL(e,t)}}function Hde(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Ude(e){if(Array.isArray(e))return DL(e)}function DL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var OL=function(e,t,n,r,i){var a=u_(e,BF),o=u_(e,ZF),s=[].concat(EL(a),EL(o)),c=u_(e,cI),l=`${r}Id`,u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[l]===n&&HP(t.props,`extendDomain`)&&q(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),c.length){var f=`${u}1`,p=`${u}2`;d=c.reduce(function(e,t){if(t.props[l]===n&&HP(t.props,`extendDomain`)&&q(t.props[f])&&q(t.props[p])){var r=t.props[f],i=t.props[p];return[Math.min(e[0],r,i),Math.max(e[1],r,i)]}return e},d)}return i&&i.length&&(d=i.reduce(function(e,t){return q(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},kL=new(e(r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)}))())).default,AL=`recharts.syncMouseEvents`;function jL(e){"@babel/helpers - typeof";return jL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},jL(e)}function Wde(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function ML(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,PL(r.key),r)}}function Gde(e,t,n){return t&&ML(e.prototype,t),n&&ML(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function NL(e,t,n){return t=PL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function PL(e){var t=Kde(e,`string`);return jL(t)==`symbol`?t:t+``}function Kde(e,t){if(jL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(jL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var qde=function(){function e(){Wde(this,e),NL(this,`activeIndex`,0),NL(this,`coordinateList`,[]),NL(this,`layout`,`horizontal`)}return Gde(e,[{key:`setDetails`,value:function(e){var t=e.coordinateList,n=t===void 0?null:t,r=e.container,i=r===void 0?null:r,a=e.layout,o=a===void 0?null:a,s=e.offset,c=s===void 0?null:s,l=e.mouseHandlerCallback,u=l===void 0?null:l;this.coordinateList=n??this.coordinateList??[],this.container=i??this.container,this.layout=o??this.layout,this.offset=c??this.offset,this.mouseHandlerCallback=u??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(e){if(this.coordinateList.length!==0)switch(e.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;default:break}}},{key:`setIndex`,value:function(e){this.activeIndex=e}},{key:`spoofMouse`,value:function(){if(this.layout===`horizontal`&&this.coordinateList.length!==0){var e=this.container.getBoundingClientRect(),t=e.x,n=e.y,r=e.height,i=this.coordinateList[this.activeIndex].coordinate,a=window?.scrollX||0,o=window?.scrollY||0,s=t+i+a,c=n+this.offset.top+r/2+o;this.mouseHandlerCallback({pageX:s,pageY:c})}}}])}();function Jde(e,t,n){if(n===`number`&&t===!0&&Array.isArray(e)){var r=e?.[0],i=e?.[1];if(r&&i&&q(r)&&q(i))return!0}return!1}function Yde(e,t,n,r){var i=r/2;return{stroke:`none`,fill:`#ccc`,x:e===`horizontal`?t.x-i:n.left+.5,y:e===`horizontal`?n.top+.5:t.y-i,width:e===`horizontal`?r:n.width-1,height:e===`horizontal`?n.height-1:r}}function FL(e){var t=e.cx,n=e.cy,r=e.radius,i=e.startAngle,a=e.endAngle;return{points:[TO(t,n,r,i),TO(t,n,r,a)],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}function Xde(e,t,n){var r,i,a,o;if(e===`horizontal`)r=t.x,a=r,i=n.top,o=n.top+n.height;else if(e===`vertical`)i=t.y,o=i,r=n.left,a=n.left+n.width;else if(t.cx!=null&&t.cy!=null)if(e===`centric`){var s=t.cx,c=t.cy,l=t.innerRadius,u=t.outerRadius,d=t.angle,f=TO(s,c,l,d),p=TO(s,c,u,d);r=f.x,i=f.y,a=p.x,o=p.y}else return FL(t);return[{x:r,y:i},{x:a,y:o}]}function IL(e){"@babel/helpers - typeof";return IL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},IL(e)}function LL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function RL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?LL(Object(n),!0).forEach(function(t){Zde(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zde(e,t,n){return t=Qde(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qde(e){var t=$de(e,`string`);return IL(t)==`symbol`?t:t+``}function $de(e,t){if(IL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(IL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function efe(e){var t=e.element,n=e.tooltipEventType,r=e.isActive,i=e.activeCoordinate,a=e.activePayload,o=e.offset,s=e.activeTooltipIndex,c=e.tooltipAxisBandSize,l=e.layout,d=e.chartName,f=t.props.cursor??t.type.defaultProps?.cursor;if(!t||!f||!r||!i||d!==`ScatterChart`&&n!==`axis`)return null;var p,m=$k;if(d===`ScatterChart`)p=i,m=EN;else if(d===`BarChart`)p=Yde(l,i,o,c),m=ZM;else if(l===`radial`){var h=FL(i),g=h.cx,_=h.cy,v=h.radius;p={cx:g,cy:_,startAngle:h.startAngle,endAngle:h.endAngle,innerRadius:v,outerRadius:v},m=zk}else p={points:Xde(l,i,o)},m=$k;var y=RL(RL(RL(RL({stroke:`#ccc`,pointerEvents:`none`},o),p),J(f,!1)),{},{payload:a,payloadIndex:s,className:Mt(`recharts-tooltip-cursor`,f.className)});return(0,u.isValidElement)(f)?(0,u.cloneElement)(f,y):(0,u.createElement)(m,y)}var tfe=[`item`],nfe=[`children`,`className`,`width`,`height`,`style`,`compact`,`title`,`desc`];function zL(e){"@babel/helpers - typeof";return zL=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},zL(e)}function BL(){return BL=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},BL.apply(this,arguments)}function VL(e,t){return afe(e)||ife(e,t)||JL(e,t)||rfe()}function rfe(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
181
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ife(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function afe(e){if(Array.isArray(e))return e}function HL(e,t){if(e==null)return{};var n=ofe(e,t),r,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ofe(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 sfe(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function UL(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,QL(r.key),r)}}function cfe(e,t,n){return t&&UL(e.prototype,t),n&&UL(e,n),Object.defineProperty(e,`prototype`,{writable:!1}),e}function lfe(e,t,n){return t=GL(t),ufe(e,WL()?Reflect.construct(t,n||[],GL(e).constructor):t.apply(e,n))}function ufe(e,t){if(t&&(zL(t)===`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return dfe(e)}function dfe(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function WL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(WL=function(){return!!e})()}function GL(e){return GL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},GL(e)}function ffe(e,t){if(typeof t!=`function`&&t!==null)throw 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&&KL(e,t)}function KL(e,t){return KL=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},KL(e,t)}function qL(e){return hfe(e)||mfe(e)||JL(e)||pfe()}function pfe(){throw TypeError(`Invalid attempt to spread non-iterable instance.
182
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function JL(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 mfe(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function hfe(e){if(Array.isArray(e))return YL(e)}function YL(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function XL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?XL(Object(n),!0).forEach(function(t){ZL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZL(e,t,n){return t=QL(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QL(e){var t=gfe(e,`string`);return zL(t)==`symbol`?t:t+``}function gfe(e,t){if(zL(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(zL(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var _fe={xAxis:[`bottom`,`top`],yAxis:[`left`,`right`]},vfe={width:`100%`,height:`100%`},$L={x:0,y:0};function eR(e){return e}var tR=function(e,t){return t===`horizontal`?e.x:t===`vertical`?e.y:t===`centric`?e.angle:e.radius},nR=function(e,t,n,r){var i=t.find(function(e){return e&&e.index===n});if(i){if(e===`horizontal`)return{x:i.coordinate,y:r.y};if(e===`vertical`)return{x:r.x,y:i.coordinate};if(e===`centric`){var a=i.coordinate,o=r.radius;return Y(Y(Y({},r),TO(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var s=i.coordinate,c=r.angle;return Y(Y(Y({},r),TO(r.cx,r.cy,s,c)),{},{angle:c,radius:s})}return $L},rR=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,i=t.dataEndIndex,a=(n??[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(qL(e),qL(n)):e},[]);return a.length>0?a:e&&e.length&&q(r)&&q(i)?e.slice(r,i+1):[]};function iR(e){return e===`number`?[0,`auto`]:void 0}var aR=function(e,t,n,r){var i=e.graphicalItems,a=e.tooltipAxis,o=rR(t,e);return n<0||!i||!i.length||n>=o.length?null:i.reduce(function(i,s){var c=s.props.data??t;c&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(c=c.slice(e.dataStartIndex,e.dataEndIndex+1));var l=a.dataKey&&!a.allowDuplicatedCategory?Jg(c===void 0?o:c,a.dataKey,r):c&&c[n]||o[n];return l?[].concat(qL(i),[hO(s,l)]):i},[])},oR=function(e,t,n,r){var i=r||{x:e.chartX,y:e.chartY},a=tR(i,n),o=e.orderedTooltipTicks,s=e.tooltipAxis,c=e.tooltipTicks,l=hse(a,o,c,s);if(l>=0&&c){var u=c[l]&&c[l].value;return{activeTooltipIndex:l,activeLabel:u,activePayload:aR(e,t,l,u),activeCoordinate:nR(n,o,l,i)}}return null},sR=function(e,t){var n=t.axes,r=t.graphicalItems,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=e.stackOffset,f=QD(l,i);return n.reduce(function(t,n){var p=n.type.defaultProps===void 0?n.props:Y(Y({},n.type.defaultProps),n.props),m=p.type,h=p.dataKey,g=p.allowDataOverflow,_=p.allowDuplicatedCategory,v=p.scale,y=p.ticks,b=p.includeHidden,x=p[a];if(t[x])return t;var S=rR(e.data,{graphicalItems:r.filter(function(e){return(a in e.props?e.props[a]:e.type.defaultProps?.[a])===x}),dataStartIndex:s,dataEndIndex:c}),C=S.length,w,T,E;Jde(p.domain,g,m)&&(w=fO(p.domain,null,g),f&&(m===`number`||v!==`auto`)&&(E=JD(S,h,`category`)));var D=iR(m);if(!w||w.length===0){var O=p.domain??D;if(h){if(w=JD(S,h,m),m===`category`&&f){var k=Wne(w);_&&k?(T=w,w=(0,kP.default)(0,C)):_||(w=mO(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(qL(e),[t])},[]))}else if(m===`category`)w=_?w.filter(function(e){return e!==``&&!(0,Bg.default)(e)}):mO(O,w,n).reduce(function(e,t){return e.indexOf(t)>=0||t===``||(0,Bg.default)(t)?e:[].concat(qL(e),[t])},[]);else if(m===`number`){var A=bse(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===x&&(b||!n)}),h,i,l);A&&(w=A)}f&&(m===`number`||v!==`auto`)&&(E=JD(S,h,`category`))}else w=f?(0,kP.default)(0,C):o&&o[x]&&o[x].hasStack&&m===`number`?d===`expand`?[0,1]:lO(o[x].stackGroups,s,c):ZD(S,r.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps.hide;return t===x&&(b||!n)}),m,l,!0);if(m===`number`)w=OL(u,w,x,i,y),O&&(w=fO(O,w,g));else if(m===`category`&&O){var j=O;w.every(function(e){return j.indexOf(e)>=0})&&(w=j)}}return Y(Y({},t),{},ZL({},x,Y(Y({},p),{},{axisType:i,domain:w,categoricalDomain:E,duplicateDomain:T,originalDomain:p.domain??D,isCategorical:f,layout:l})))},{})},cR=function(e,t){var n=t.graphicalItems,r=t.Axis,i=t.axisType,a=t.axisIdKey,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.layout,u=e.children,d=rR(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:c}),f=d.length,p=QD(l,i),m=-1;return n.reduce(function(e,t){var h=(t.type.defaultProps===void 0?t.props:Y(Y({},t.type.defaultProps),t.props))[a],g=iR(`number`);if(!e[h]){m++;var _;return p?_=(0,kP.default)(0,f):o&&o[h]&&o[h].hasStack?(_=lO(o[h].stackGroups,s,c),_=OL(u,_,h,i)):(_=fO(g,ZD(d,n.filter(function(e){var t=a in e.props?e.props[a]:e.type.defaultProps?.[a],n=`hide`in e.props?e.props.hide:e.type.defaultProps?.hide;return t===h&&!n}),`number`,l),r.defaultProps.allowDataOverflow),_=OL(u,_,h,i)),Y(Y({},e),{},ZL({},h,Y(Y({axisType:i},r.defaultProps),{},{hide:!0,orientation:(0,zg.default)(_fe,`${i}.${m%2}`,null),domain:_,originalDomain:g,isCategorical:p,layout:l})))}return e},{})},lR=function(e,t){var n=t.axisType,r=n===void 0?`xAxis`:n,i=t.AxisComp,a=t.graphicalItems,o=t.stackGroups,s=t.dataStartIndex,c=t.dataEndIndex,l=e.children,u=`${r}Id`,d=u_(l,i),f={};return d&&d.length?f=sR(e,{axes:d,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c}):a&&a.length&&(f=cR(e,{Axis:i,graphicalItems:a,axisType:r,axisIdKey:u,stackGroups:o,dataStartIndex:s,dataEndIndex:c})),f},uR=function(e){var t=Kg(e),n=eO(t,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:(0,Fx.default)(n,function(e){return e.coordinate}),tooltipAxis:t,tooltipAxisBandSize:pO(t,n)}},dR=function(e){var t=e.children,n=e.defaultShowTooltip,r=d_(t,VP),i=0,a=0;return e.data&&e.data.length!==0&&(a=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(i=r.props.startIndex),r.props.endIndex>=0&&(a=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!n}},fR=function(e){return!e||!e.length?!1:e.some(function(e){var t=o_(e&&e.type);return t&&t.indexOf(`Bar`)>=0})},pR=function(e){return e===`horizontal`?{numericAxisName:`yAxis`,cateAxisName:`xAxis`}:e===`vertical`?{numericAxisName:`xAxis`,cateAxisName:`yAxis`}:e===`centric`?{numericAxisName:`radiusAxis`,cateAxisName:`angleAxis`}:{numericAxisName:`angleAxis`,cateAxisName:`radiusAxis`}},mR=function(e,t){var n=e.props,r=e.graphicalItems,i=e.xAxisMap,a=i===void 0?{}:i,o=e.yAxisMap,s=o===void 0?{}:o,c=n.width,l=n.height,u=n.children,d=n.margin||{},f=d_(u,VP),p=d_(u,px),m=Object.keys(s).reduce(function(e,t){var n=s[t],r=n.orientation;return!n.mirror&&!n.hide?Y(Y({},e),{},ZL({},r,e[r]+n.width)):e},{left:d.left||0,right:d.right||0}),h=Y(Y({},Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return!n.mirror&&!n.hide?Y(Y({},e),{},ZL({},r,(0,zg.default)(e,`${r}`)+n.height)):e},{top:d.top||0,bottom:d.bottom||0})),m),g=h.bottom;f&&(h.bottom+=f.props.height||VP.defaultProps.height),p&&t&&(h=vse(h,r,n,t));var _=c-h.left-h.right,v=l-h.top-h.bottom;return Y(Y({brushBottom:g},h),{},{width:Math.max(_,0),height:Math.max(v,0)})},hR=function(e,t){if(t===`xAxis`)return e[t].width;if(t===`yAxis`)return e[t].height},gR=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,i=r===void 0?`axis`:r,a=e.validateTooltipEventTypes,o=a===void 0?[`axis`]:a,s=e.axisComponents,c=e.legendContent,l=e.formatAxisMap,d=e.defaultProps,f=function(e,t){var n=t.graphicalItems,r=t.stackGroups,i=t.offset,a=t.updateId,o=t.dataStartIndex,c=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,p=e.maxBarSize,m=pR(u),h=m.numericAxisName,g=m.cateAxisName,_=fR(n),v=[];return n.forEach(function(n,m){var y=rR(e.data,{graphicalItems:[n],dataStartIndex:o,dataEndIndex:c}),b=n.type.defaultProps===void 0?n.props:Y(Y({},n.type.defaultProps),n.props),x=b.dataKey,S=b.maxBarSize,C=b[`${h}Id`],w=b[`${g}Id`],T=s.reduce(function(e,n){var r=t[`${n.axisType}Map`],i=b[`${n.axisType}Id`];!(r&&r[i]||n.axisType===`zAxis`)&&SD(!1);var a=r[i];return Y(Y({},e),{},ZL(ZL({},n.axisType,a),`${n.axisType}Ticks`,eO(a)))},{}),E=T[g],D=T[`${g}Ticks`],O=r&&r[C]&&r[C].hasStack&&Dse(n,r[C].stackGroups),k=o_(n.type).indexOf(`Bar`)>=0,A=pO(E,D),j=[],M=_&&gse({barSize:l,stackGroups:r,totalSize:hR(T,g)});if(k){var N=(0,Bg.default)(S)?p:S,P=pO(E,D,!0)??N??0;j=_se({barGap:d,barCategoryGap:f,bandSize:P===A?A:P,sizeList:M[w],maxBarSize:N}),P!==A&&(j=j.map(function(e){return Y(Y({},e),{},{position:Y(Y({},e.position),{},{offset:e.position.offset-P/2})})}))}var F=n&&n.type&&n.type.getComposedData;F&&v.push({props:Y(Y({},F(Y(Y({},T),{},{displayedData:y,props:e,dataKey:x,item:n,bandSize:A,barPosition:j,offset:i,stackedData:O,layout:u,dataStartIndex:o,dataEndIndex:c}))),{},ZL(ZL(ZL({key:n.key||`item-${m}`},h,T[h]),g,T[g]),`animationId`,a)),childIndex:ire(n,e.children),item:n})}),v},p=function(e,r){var i=e.props,a=e.dataStartIndex,o=e.dataEndIndex,c=e.updateId;if(!f_({props:i}))return null;var u=i.children,d=i.layout,p=i.stackOffset,m=i.data,h=i.reverseStackOrder,g=pR(d),_=g.numericAxisName,v=g.cateAxisName,y=u_(u,n),b=Tse(m,y,`${_}Id`,`${v}Id`,p,h),x=s.reduce(function(e,t){var n=`${t.axisType}Map`;return Y(Y({},e),{},ZL({},n,lR(i,Y(Y({},t),{},{graphicalItems:y,stackGroups:t.axisType===_&&b,dataStartIndex:a,dataEndIndex:o}))))},{}),S=mR(Y(Y({},x),{},{props:i,graphicalItems:y}),r?.legendBBox);Object.keys(x).forEach(function(e){x[e]=l(i,x[e],S,e.replace(`Map`,``),t)});var C=x[`${v}Map`],w=uR(C);return Y(Y({formattedGraphicalItems:f(i,Y(Y({},x),{},{dataStartIndex:a,dataEndIndex:o,updateId:c,graphicalItems:y,stackGroups:b,offset:S})),graphicalItems:y,offset:S,stackGroups:b},w),x)},m=function(e){function n(e){var r;return sfe(this,n),r=lfe(this,n,[e]),ZL(r,`eventEmitterSymbol`,Symbol(`rechartsEventEmitter`)),ZL(r,`accessibilityManager`,new qde),ZL(r,`handleLegendBBoxUpdate`,function(e){if(e){var t=r.state,n=t.dataStartIndex,i=t.dataEndIndex,a=t.updateId;r.setState(Y({legendBBox:e},p({props:r.props,dataStartIndex:n,dataEndIndex:i,updateId:a},Y(Y({},r.state),{},{legendBBox:e}))))}}),ZL(r,`handleReceiveSyncEvent`,function(e,t,n){if(r.props.syncId===e){if(n===r.eventEmitterSymbol&&typeof r.props.syncMethod!=`function`)return;r.applySyncEvent(t)}}),ZL(r,`handleBrushChange`,function(e){var t=e.startIndex,n=e.endIndex;if(t!==r.state.dataStartIndex||n!==r.state.dataEndIndex){var i=r.state.updateId;r.setState(function(){return Y({dataStartIndex:t,dataEndIndex:n},p({props:r.props,dataStartIndex:t,dataEndIndex:n,updateId:i},r.state))}),r.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),ZL(r,`handleMouseEnter`,function(e){var t=r.getMouseInfo(e);if(t){var n=Y(Y({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseEnter;(0,n_.default)(i)&&i(n,e)}}),ZL(r,`triggeredAfterMouseMove`,function(e){var t=r.getMouseInfo(e),n=t?Y(Y({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};r.setState(n),r.triggerSyncEvent(n);var i=r.props.onMouseMove;(0,n_.default)(i)&&i(n,e)}),ZL(r,`handleItemMouseEnter`,function(e){r.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),ZL(r,`handleItemMouseLeave`,function(){r.setState(function(){return{isTooltipActive:!1}})}),ZL(r,`handleMouseMove`,function(e){e.persist(),r.throttleTriggeredAfterMouseMove(e)}),ZL(r,`handleMouseLeave`,function(e){r.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};r.setState(t),r.triggerSyncEvent(t);var n=r.props.onMouseLeave;(0,n_.default)(n)&&n(t,e)}),ZL(r,`handleOuterEvent`,function(e){var t=rre(e),n=(0,zg.default)(r.props,`${t}`);t&&(0,n_.default)(n)&&n((/.*touch.*/i.test(t)?r.getMouseInfo(e.changedTouches[0]):r.getMouseInfo(e))??{},e)}),ZL(r,`handleClick`,function(e){var t=r.getMouseInfo(e);if(t){var n=Y(Y({},t),{},{isTooltipActive:!0});r.setState(n),r.triggerSyncEvent(n);var i=r.props.onClick;(0,n_.default)(i)&&i(n,e)}}),ZL(r,`handleMouseDown`,function(e){var t=r.props.onMouseDown;(0,n_.default)(t)&&t(r.getMouseInfo(e),e)}),ZL(r,`handleMouseUp`,function(e){var t=r.props.onMouseUp;(0,n_.default)(t)&&t(r.getMouseInfo(e),e)}),ZL(r,`handleTouchMove`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),ZL(r,`handleTouchStart`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseDown(e.changedTouches[0])}),ZL(r,`handleTouchEnd`,function(e){e.changedTouches!=null&&e.changedTouches.length>0&&r.handleMouseUp(e.changedTouches[0])}),ZL(r,`handleDoubleClick`,function(e){var t=r.props.onDoubleClick;(0,n_.default)(t)&&t(r.getMouseInfo(e),e)}),ZL(r,`handleContextMenu`,function(e){var t=r.props.onContextMenu;(0,n_.default)(t)&&t(r.getMouseInfo(e),e)}),ZL(r,`triggerSyncEvent`,function(e){r.props.syncId!==void 0&&kL.emit(AL,r.props.syncId,e,r.eventEmitterSymbol)}),ZL(r,`applySyncEvent`,function(e){var t=r.props,n=t.layout,i=t.syncMethod,a=r.state.updateId,o=e.dataStartIndex,s=e.dataEndIndex;if(e.dataStartIndex!==void 0||e.dataEndIndex!==void 0)r.setState(Y({dataStartIndex:o,dataEndIndex:s},p({props:r.props,dataStartIndex:o,dataEndIndex:s,updateId:a},r.state)));else if(e.activeTooltipIndex!==void 0){var c=e.chartX,l=e.chartY,u=e.activeTooltipIndex,d=r.state,f=d.offset,m=d.tooltipTicks;if(!f)return;if(typeof i==`function`)u=i(m,e);else if(i===`value`){u=-1;for(var h=0;h<m.length;h++)if(m[h].value===e.activeLabel){u=h;break}}var g=Y(Y({},f),{},{x:f.left,y:f.top}),_=Math.min(c,g.x+g.width),v=Math.min(l,g.y+g.height),y=m[u]&&m[u].value,b=aR(r.state,r.props.data,u),x=m[u]?{x:n===`horizontal`?m[u].coordinate:_,y:n===`horizontal`?v:m[u].coordinate}:$L;r.setState(Y(Y({},e),{},{activeLabel:y,activeCoordinate:x,activePayload:b,activeTooltipIndex:u}))}else r.setState(e)}),ZL(r,`renderCursor`,function(e){var n=r.state,i=n.isTooltipActive,a=n.activeCoordinate,o=n.activePayload,s=n.offset,c=n.activeTooltipIndex,l=n.tooltipAxisBandSize,d=r.getTooltipEventType(),f=e.props.active??i,p=r.props.layout,m=e.key||`_recharts-cursor`;return u.createElement(efe,{key:m,activeCoordinate:a,activePayload:o,activeTooltipIndex:c,chartName:t,element:e,isActive:f,layout:p,offset:s,tooltipAxisBandSize:l,tooltipEventType:d})}),ZL(r,`renderPolarAxis`,function(e,t,n){var i=(0,zg.default)(e,`type.axisType`),a=(0,zg.default)(r.state,`${i}Map`),o=e.type.defaultProps,s=o===void 0?e.props:Y(Y({},o),e.props),c=a&&a[s[`${i}Id`]];return(0,u.cloneElement)(e,Y(Y({},c),{},{className:Mt(i,c.className),key:e.key||`${t}-${n}`,ticks:eO(c,!0)}))}),ZL(r,`renderPolarGrid`,function(e){var t=e.props,n=t.radialLines,i=t.polarAngles,a=t.polarRadius,o=r.state,s=o.radiusAxisMap,c=o.angleAxisMap,l=Kg(s),d=Kg(c),f=d.cx,p=d.cy,m=d.innerRadius,h=d.outerRadius;return(0,u.cloneElement)(e,{polarAngles:Array.isArray(i)?i:eO(d,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:eO(l,!0).map(function(e){return e.coordinate}),cx:f,cy:p,innerRadius:m,outerRadius:h,key:e.key||`polar-grid`,radialLines:n})}),ZL(r,`renderLegend`,function(){var e=r.state.formattedGraphicalItems,t=r.props,n=t.children,i=t.width,a=t.height,o=r.props.margin||{},s=LD({children:n,formattedGraphicalItems:e,legendWidth:i-(o.left||0)-(o.right||0),legendContent:c});if(!s)return null;var l=s.item;return(0,u.cloneElement)(l,Y(Y({},HL(s,tfe)),{},{chartWidth:i,chartHeight:a,margin:o,onBBoxUpdate:r.handleLegendBBoxUpdate}))}),ZL(r,`renderTooltip`,function(){var e=r.props,t=e.children,n=e.accessibilityLayer,i=d_(t,mS);if(!i)return null;var a=r.state,o=a.isTooltipActive,s=a.activeCoordinate,c=a.activePayload,l=a.activeLabel,d=a.offset,f=i.props.active??o;return(0,u.cloneElement)(i,{viewBox:Y(Y({},d),{},{x:d.left,y:d.top}),active:f,label:l,payload:f?c:[],coordinate:s,accessibilityLayer:n})}),ZL(r,`renderBrush`,function(e){var t=r.props,n=t.margin,i=t.data,a=r.state,o=a.offset,s=a.dataStartIndex,c=a.dataEndIndex,l=a.updateId;return(0,u.cloneElement)(e,{key:e.key||`_recharts-brush`,onChange:nO(r.handleBrushChange,e.props.onChange),data:i,x:q(e.props.x)?e.props.x:o.left,y:q(e.props.y)?e.props.y:o.top+o.height+o.brushBottom-(n.bottom||0),width:q(e.props.width)?e.props.width:o.width,startIndex:s,endIndex:c,updateId:`brush-${l}`})}),ZL(r,`renderReferenceElement`,function(e,t,n){if(!e)return null;var i=r.clipPathId,a=r.state,o=a.xAxisMap,s=a.yAxisMap,c=a.offset,l=e.type.defaultProps||{},d=e.props,f=d.xAxisId,p=f===void 0?l.xAxisId:f,m=d.yAxisId,h=m===void 0?l.yAxisId:m;return(0,u.cloneElement)(e,{key:e.key||`${t}-${n}`,xAxis:o[p],yAxis:s[h],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:i})}),ZL(r,`renderActivePoints`,function(e){var t=e.item,r=e.activePoint,i=e.basePoint,a=e.childIndex,o=e.isRange,s=[],c=t.props.key,l=t.item.type.defaultProps===void 0?t.item.props:Y(Y({},t.item.type.defaultProps),t.item.props),u=l.activeDot,d=l.dataKey,f=Y(Y({index:a,dataKey:d,cx:r.x,cy:r.y,r:4,fill:YD(t.item),strokeWidth:2,stroke:`#fff`,payload:r.payload,value:r.value},J(u,!1)),e_(u));return s.push(n.renderActiveDot(u,f,`${c}-activePoint-${a}`)),i?s.push(n.renderActiveDot(u,Y(Y({},f),{},{cx:i.x,cy:i.y}),`${c}-basePoint-${a}`)):o&&s.push(null),s}),ZL(r,`renderGraphicChild`,function(e,t,n){var i=r.filterFormatItem(e,t,n);if(!i)return null;var a=r.getTooltipEventType(),o=r.state,s=o.isTooltipActive,c=o.tooltipAxis,l=o.activeTooltipIndex,d=o.activeLabel,f=r.props.children,p=d_(f,mS),m=i.props,h=m.points,g=m.isRange,_=m.baseLine,v=i.item.type.defaultProps===void 0?i.item.props:Y(Y({},i.item.type.defaultProps),i.item.props),y=v.activeDot,b=v.hide,x=v.activeBar,S=v.activeShape,C=!!(!b&&s&&p&&(y||x||S)),w={};a!==`axis`&&p&&p.props.trigger===`click`?w={onClick:nO(r.handleItemMouseEnter,e.props.onClick)}:a!==`axis`&&(w={onMouseLeave:nO(r.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:nO(r.handleItemMouseEnter,e.props.onMouseEnter)});var T=(0,u.cloneElement)(e,Y(Y({},i.props),w));function E(e){return typeof c.dataKey==`function`?c.dataKey(e.payload):null}if(C)if(l>=0){var D,O;if(c.dataKey&&!c.allowDuplicatedCategory){var k=typeof c.dataKey==`function`?E:`payload.${c.dataKey.toString()}`;D=Jg(h,k,d),O=g&&_&&Jg(_,k,d)}else D=h?.[l],O=g&&_&&_[l];if(S||x){var A=e.props.activeIndex===void 0?l:e.props.activeIndex;return[(0,u.cloneElement)(e,Y(Y(Y({},i.props),w),{},{activeIndex:A})),null,null]}if(!(0,Bg.default)(D))return[T].concat(qL(r.renderActivePoints({item:i,activePoint:D,basePoint:O,childIndex:l,isRange:g})))}else{var j=(r.getItemByXY(r.state.activeCoordinate)??{graphicalItem:T}).graphicalItem,M=j.item,N=M===void 0?e:M,P=j.childIndex;return[(0,u.cloneElement)(N,Y(Y(Y({},i.props),w),{},{activeIndex:P})),null,null]}return g?[T,null,null]:[T,null]}),ZL(r,`renderCustomized`,function(e,t,n){return(0,u.cloneElement)(e,Y(Y({key:`recharts-customized-${n}`},r.props),r.state))}),ZL(r,`renderMap`,{CartesianGrid:{handler:eR,once:!0},ReferenceArea:{handler:r.renderReferenceElement},ReferenceLine:{handler:eR},ReferenceDot:{handler:r.renderReferenceElement},XAxis:{handler:eR},YAxis:{handler:eR},Brush:{handler:r.renderBrush,once:!0},Bar:{handler:r.renderGraphicChild},Line:{handler:r.renderGraphicChild},Area:{handler:r.renderGraphicChild},Radar:{handler:r.renderGraphicChild},RadialBar:{handler:r.renderGraphicChild},Scatter:{handler:r.renderGraphicChild},Pie:{handler:r.renderGraphicChild},Funnel:{handler:r.renderGraphicChild},Tooltip:{handler:r.renderCursor,once:!0},PolarGrid:{handler:r.renderPolarGrid,once:!0},PolarAngleAxis:{handler:r.renderPolarAxis},PolarRadiusAxis:{handler:r.renderPolarAxis},Customized:{handler:r.renderCustomized}}),r.clipPathId=`${e.id??Wg(`recharts`)}-clip`,r.throttleTriggeredAfterMouseMove=(0,gS.default)(r.triggeredAfterMouseMove,e.throttleDelay??1e3/60),r.state={},r}return ffe(n,e),cfe(n,[{key:`componentDidMount`,value:function(){this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:this.props.margin.left??0,top:this.props.margin.top??0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:`displayDefaultTooltip`,value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,i=e.layout,a=d_(t,mS);if(a){var o=a.props.defaultIndex;if(!(typeof o!=`number`||o<0||o>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[o]&&this.state.tooltipTicks[o].value,c=aR(this.state,n,o,s),l=this.state.tooltipTicks[o].coordinate,u=(this.state.offset.top+r)/2,d=i===`horizontal`?{x:l,y:u}:{y:l,x:u},f=this.state.formattedGraphicalItems.find(function(e){return e.item.type.name===`Scatter`});f&&(d=Y(Y({},d),f.props.points[o].tooltipPosition),c=f.props.points[o].tooltipPayload);var p={activeTooltipIndex:o,isTooltipActive:!0,activeLabel:s,activePayload:c,activeCoordinate:d};this.setState(p),this.renderCursor(a),this.accessibilityManager.setIndex(o)}}}},{key:`getSnapshotBeforeUpdate`,value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:this.props.margin.left??0,top:this.props.margin.top??0}}),null):null}},{key:`componentDidUpdate`,value:function(e){m_([d_(e.children,mS)],[d_(this.props.children,mS)])||this.displayDefaultTooltip()}},{key:`componentWillUnmount`,value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:`getTooltipEventType`,value:function(){var e=d_(this.props.children,mS);if(e&&typeof e.props.shared==`boolean`){var t=e.props.shared?`axis`:`item`;return o.indexOf(t)>=0?t:i}return i}},{key:`getMouseInfo`,value:function(e){if(!this.container)return null;var t=this.container,n=t.getBoundingClientRect(),r=gie(n),i={chartX:Math.round(e.pageX-r.left),chartY:Math.round(e.pageY-r.top)},a=n.width/t.offsetWidth||1,o=this.inRange(i.chartX,i.chartY,a);if(!o)return null;var s=this.state,c=s.xAxisMap,l=s.yAxisMap,u=this.getTooltipEventType(),d=oR(this.state,this.props.data,this.props.layout,o);if(u!==`axis`&&c&&l){var f=Kg(c).scale,p=Kg(l).scale,m=f&&f.invert?f.invert(i.chartX):null,h=p&&p.invert?p.invert(i.chartY):null;return Y(Y({},i),{},{xValue:m,yValue:h},d)}return d?Y(Y({},i),d):null}},{key:`inRange`,value:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,r=this.props.layout,i=e/n,a=t/n;if(r===`horizontal`||r===`vertical`){var o=this.state.offset;return i>=o.left&&i<=o.left+o.width&&a>=o.top&&a<=o.top+o.height?{x:i,y:a}:null}var s=this.state,c=s.angleAxisMap,l=s.radiusAxisMap;if(c&&l){var u=Kg(c);return MO({x:i,y:a},u)}return null}},{key:`parseEventsOfWrapper`,value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=d_(e,mS),r={};return n&&t===`axis`&&(r=n.props.trigger===`click`?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),Y(Y({},e_(this.props,this.handleOuterEvent)),r)}},{key:`addListener`,value:function(){kL.on(AL,this.handleReceiveSyncEvent)}},{key:`removeListener`,value:function(){kL.removeListener(AL,this.handleReceiveSyncEvent)}},{key:`filterFormatItem`,value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,i=0,a=r.length;i<a;i++){var o=r[i];if(o.item===e||o.props.key===e.key||t===o_(o.item.type)&&n===o.childIndex)return o}return null}},{key:`renderClipPath`,value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,i=t.height,a=t.width;return u.createElement(`defs`,null,u.createElement(`clipPath`,{id:e},u.createElement(`rect`,{x:n,y:r,height:i,width:a})))}},{key:`getXScales`,value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=VL(t,2),r=n[0],i=n[1];return Y(Y({},e),{},ZL({},r,i.scale))},{}):null}},{key:`getYScales`,value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=VL(t,2),r=n[0],i=n[1];return Y(Y({},e),{},ZL({},r,i.scale))},{}):null}},{key:`getXScaleByAxisId`,value:function(e){var t;return(t=this.state.xAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getYScaleByAxisId`,value:function(e){var t;return(t=this.state.yAxisMap)==null||(t=t[e])==null?void 0:t.scale}},{key:`getItemByXY`,value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var i=0,a=n.length;i<a;i++){var o=n[i],s=o.props,c=o.item,l=c.type.defaultProps===void 0?c.props:Y(Y({},c.type.defaultProps),c.props),u=o_(c.type);if(u===`Bar`){var d=(s.data||[]).find(function(t){return YM(e,t)});if(d)return{graphicalItem:o,payload:d}}else if(u===`RadialBar`){var f=(s.data||[]).find(function(t){return MO(e,t)});if(f)return{graphicalItem:o,payload:f}}else if(lP(o,r)||uP(o,r)||dP(o,r)){var p=jce({graphicalItem:o,activeTooltipItem:r,itemData:l.data}),m=l.activeIndex===void 0?p:l.activeIndex;return{graphicalItem:Y(Y({},o),{},{childIndex:m}),payload:dP(o,r)?l.data[p]:o.props.data[p]}}}return null}},{key:`render`,value:function(){var e=this;if(!f_(this))return null;var t=this.props,n=t.children,r=t.className,i=t.width,a=t.height,o=t.style,s=t.compact,c=t.title,l=t.desc,d=J(HL(t,nfe),!1);if(s)return u.createElement(wF,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},u.createElement(v_,BL({},d,{width:i,height:a,title:c,desc:l}),this.renderClipPath(),g_(n,this.renderMap)));this.props.accessibilityLayer&&(d.tabIndex=this.props.tabIndex??0,d.role=this.props.role??`application`,d.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},d.onFocus=function(){e.accessibilityManager.focus()});var f=this.parseEventsOfWrapper();return u.createElement(wF,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},u.createElement(`div`,BL({className:Mt(`recharts-wrapper`,r),style:Y({position:`relative`,cursor:`default`,width:i,height:a},o)},f,{ref:function(t){e.container=t}}),u.createElement(v_,BL({},d,{width:i,height:a,title:c,desc:l,style:vfe}),this.renderClipPath(),g_(n,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(u.Component);ZL(m,`displayName`,t),ZL(m,`defaultProps`,Y({layout:`horizontal`,stackOffset:`none`,barCategoryGap:`10%`,barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:`index`},d)),ZL(m,`getDerivedStateFromProps`,function(e,t){var n=e.dataKey,r=e.data,i=e.children,a=e.width,o=e.height,s=e.layout,c=e.stackOffset,l=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(t.updateId===void 0){var f=dR(e);return Y(Y(Y({},f),{},{updateId:0},p(Y(Y({props:e},f),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(n!==t.prevDataKey||r!==t.prevData||a!==t.prevWidth||o!==t.prevHeight||s!==t.prevLayout||c!==t.prevStackOffset||!Yg(l,t.prevMargin)){var m=dR(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=Y(Y({},oR(t,r,s)),{},{updateId:t.updateId+1}),_=Y(Y(Y({},m),h),g);return Y(Y(Y({},_),p(Y({props:e},_),t)),{},{prevDataKey:n,prevData:r,prevWidth:a,prevHeight:o,prevLayout:s,prevStackOffset:c,prevMargin:l,prevChildren:i})}if(!m_(i,t.prevChildren)){var v=d_(i,VP),y=v?v.props?.startIndex??u:u,b=v?v.props?.endIndex??d:d,x=y!==u||b!==d,S=!(0,Bg.default)(r)&&!x?t.updateId:t.updateId+1;return Y(Y({updateId:S},p(Y(Y({props:e},t),{},{updateId:S,dataStartIndex:y,dataEndIndex:b}),t)),{},{prevChildren:i,dataStartIndex:y,dataEndIndex:b})}return null}),ZL(m,`renderActiveDot`,function(e,t,n){var r=(0,u.isValidElement)(e)?(0,u.cloneElement)(e,t):(0,n_.default)(e)?e(t):u.createElement(mN,t);return u.createElement(b_,{className:`recharts-active-dot`,key:n},r)});var h=(0,u.forwardRef)(function(e,t){return u.createElement(m,BL({},e,{ref:t}))});return h.displayName=m.displayName,h},_R=gR({chartName:`LineChart`,GraphicalChild:JI,axisComponents:[{axisType:`xAxis`,AxisComp:gL},{axisType:`yAxis`,AxisComp:TL}],formatAxisMap:pF}),vR=gR({chartName:`BarChart`,GraphicalChild:aF,defaultTooltipEventType:`axis`,validateTooltipEventTypes:[`axis`,`item`],axisComponents:[{axisType:`xAxis`,AxisComp:gL},{axisType:`yAxis`,AxisComp:TL}],formatAxisMap:pF}),yR=gR({chartName:`PieChart`,GraphicalChild:CP,validateTooltipEventTypes:[`item`],defaultTooltipEventType:`item`,legendContent:`children`,axisComponents:[{axisType:`angleAxis`,AxisComp:ZN},{axisType:`radiusAxis`,AxisComp:zN}],formatAxisMap:DO,defaultProps:{layout:`centric`,startAngle:0,endAngle:360,cx:`50%`,cy:`50%`,innerRadius:0,outerRadius:`80%`}}),bR=gR({chartName:`AreaChart`,GraphicalChild:sL,axisComponents:[{axisType:`xAxis`,AxisComp:gL},{axisType:`yAxis`,AxisComp:TL}],formatAxisMap:pF}),xR=()=>({providers:[],activeProviders:[],isLoading:!1,fetchProviders:async()=>{try{let e=(await K(`/api/providers`)).providers;return{providers:e,activeProviders:e.filter(e=>e.enabled&&e.active)}}catch(e){return console.error(`Failed to fetch providers:`,e),{providers:[],activeProviders:[]}}},toggleProvider:async(e,t)=>{try{await K(`/api/providers/${e}/toggle`,{method:`POST`,body:{active:t},showLoader:t?`Activando proveedor...`:`Desactivando proveedor...`,showError:!0});let n=X.getState().providers.map(n=>n.id===e?{...n,active:t,enabled:t}:n);X.setState({providers:n,activeProviders:n.filter(e=>e.enabled&&e.active)})}catch(e){throw console.error(`Failed to toggle provider:`,e),e}},updateProvider:async(e,t)=>{try{let n=await K(`/api/providers/${e}`,{method:`PUT`,body:t,showLoader:`Actualizando proveedor...`,showError:!0,showSuccess:`Proveedor actualizado`});if(n?.provider){let t=X.getState().providers.map(t=>t.id===e?{...t,...n.provider}:t);X.setState({providers:t,activeProviders:t.filter(e=>e.enabled&&e.active)})}}catch(e){throw console.error(`Failed to update provider:`,e),e}},createProvider:async e=>{try{await K(`/api/providers`,{method:`POST`,body:{id:e.id,name:e.name,base_url:e.base_url||null,enabled:1},showLoader:`Añadiendo proveedor...`,showError:!0});let t={};e.api_key&&(t.apiKey=e.api_key),e.headers&&(t.headers=e.headers),e.num_ctx!==void 0&&e.num_ctx!==null&&(t.num_ctx=e.num_ctx),Object.keys(t).length>0&&await K(`/api/providers/${e.id}`,{method:`PUT`,body:t,showLoader:`Configurando proveedor...`,showError:!0});let n=await X.getState().fetchProviders();X.setState(n)}catch(e){throw console.error(`Failed to create provider:`,e),e}}}),SR=()=>({models:[],availableModels:[],fetchModels:async()=>{try{let e=(await K(`/api/models`)).models;return{models:e,availableModels:e.filter(e=>e.enabled||e.active)}}catch(e){return console.error(`Failed to fetch models:`,e),{models:[],availableModels:[]}}},toggleModel:async(e,t)=>{try{await K(`/api/models/${e}/toggle`,{method:`POST`,body:{active:t},showLoader:t?`Activando modelo...`:`Desactivando modelo...`,showError:!0});let n=X.getState().models.map(n=>n.id===e?{...n,active:t,enabled:t}:n);X.setState({models:n,availableModels:n.filter(e=>e.enabled||e.active)})}catch(e){throw console.error(`Failed to toggle model:`,e),e}},syncModels:async e=>{try{let t=await K(`/api/providers/${e}/sync-models`,{method:`POST`,showLoader:`Sincronizando modelos desde Ollama...`,showError:!0,showSuccess:e=>`${e.synced} modelos sincronizados`}),n=[...X.getState().models.filter(t=>(t.provider_id||t.providerId)!==e),...t.models||[]];return X.setState({models:n,availableModels:n.filter(e=>e.enabled||e.active)}),{synced:t.synced}}catch(e){throw console.error(`Failed to sync models:`,e),e}},createModel:async(e,t)=>{try{let n=await K(`/api/models`,{method:`POST`,body:{provider_id:e,name:t},showLoader:`Agregando modelo...`,showError:!0,showSuccess:`Modelo agregado`});if(n?.model){let e=[...X.getState().models,n.model];X.setState({models:e,availableModels:e.filter(e=>e.enabled||e.active)})}else{let e=await SR().fetchModels();X.setState(e)}}catch(e){throw console.error(`Failed to create model:`,e),e}},getModelsByProvider:e=>{let{models:t}=X.getState();return t.filter(t=>(t.providerId||t.provider_id)===e&&(t.enabled||t.active))},deleteModel:async e=>{try{await K(`/api/models/${encodeURIComponent(e)}`,{method:`DELETE`,showLoader:`Eliminando modelo...`,showError:!0,showSuccess:`Modelo eliminado`});let t=X.getState().models.filter(t=>t.id!==e);X.setState({models:t,availableModels:t.filter(e=>e.enabled||e.active)})}catch(e){throw console.error(`Failed to delete model:`,e),e}},updateModel:async(e,t)=>{try{let n=await K(`/api/models/${encodeURIComponent(e)}`,{method:`PUT`,body:t,showLoader:`Actualizando modelo...`,showError:!0,showSuccess:`Modelo actualizado`});if(n?.model){let t=X.getState().models.map(t=>t.id===e?{...t,...n.model}:t);X.setState({models:t,availableModels:t.filter(e=>e.enabled||e.active)})}}catch(e){throw console.error(`Failed to update model:`,e),e}}}),CR=()=>({agents:[],isLoading:!1,fetchAgents:async()=>{try{return{agents:(await K(`/api/agents`)).agents}}catch(e){return console.error(`Failed to fetch agents:`,e),{agents:[]}}},createAgent:async e=>{try{let t=await K(`/api/agents`,{method:`POST`,body:e,showLoader:`Creando agente...`,showError:!0,showSuccess:`Agente creado con éxito`}),{fetchAgents:n}=X.getState();return await n(),t.agent}catch(e){throw console.error(`Failed to create agent:`,e),e}},updateAgent:async(e,t)=>{try{await K(`/api/agents/${e}`,{method:`PUT`,body:t,showLoader:`Guardando cambios...`,showError:!0,showSuccess:`Perfil del agente sincronizado`});let{fetchAgents:n}=X.getState();await n()}catch(e){throw console.error(`Failed to update agent:`,e),e}},deleteAgent:async e=>{try{await K(`/api/agents/${e}`,{method:`DELETE`,showLoader:`Eliminando agente...`,showError:!0,showSuccess:`Agente eliminado`});let{fetchAgents:t}=X.getState();await t()}catch(e){throw console.error(`Failed to delete agent:`,e),e}}}),wR=()=>({tools:[],activeTools:[],fetchTools:async()=>{try{let e=(await K(`/api/tools`)).tools;return{tools:e,activeTools:e.filter(e=>e.active).map(e=>({id:e.id,name:e.name,description:e.description,category:e.category}))}}catch(e){return console.error(`Failed to fetch tools:`,e),{tools:[],activeTools:[]}}},toggleTool:async(e,t)=>{let n=X.getState(),r=n.tools,i=n.tools.map(n=>n.id===e?{...n,active:t}:n);X.setState({tools:i,activeTools:i.filter(e=>e.active).map(e=>({id:e.id,name:e.name,description:e.description,category:e.category}))});try{await K(`/api/tools/${e}/toggle`,{method:`POST`,body:{active:t}})}catch(e){throw X.setState({tools:r,activeTools:r.filter(e=>e.active).map(e=>({id:e.id,name:e.name,description:e.description,category:e.category}))}),console.error(`Failed to toggle tool:`,e),e}},updateTool:async(e,t)=>{try{await K(`/api/tools/${e}`,{method:`PUT`,body:t});let n=X.getState().tools.map(n=>n.id===e?{...n,...t}:n);X.setState({tools:n,activeTools:n.filter(e=>e.active).map(e=>({id:e.id,name:e.name,description:e.description,category:e.category}))})}catch(e){throw console.error(`Failed to update tool:`,e),e}}}),TR=()=>({skills:[],activeSkills:[],fetchSkills:async()=>{try{let e=(await K(`/api/skills`)).skills;return{skills:e,activeSkills:e.filter(e=>e.active)}}catch(e){return console.error(`Failed to fetch skills:`,e),{skills:[],activeSkills:[]}}},toggleSkill:async(e,t)=>{try{await K(`/api/skills/${e}/toggle`,{method:`POST`,body:{active:t}})}catch(e){throw console.error(`Failed to toggle skill:`,e),e}},updateSkill:async(e,t)=>{try{await K(`/api/skills/${e}`,{method:`PUT`,body:t})}catch(e){throw console.error(`Failed to update skill:`,e),e}}}),ER=()=>({servers:[],activeServers:[],fetchMCPServers:async()=>{try{let e=(await K(`/api/mcp/servers`)).map(e=>{let t=e.config||{};return{id:e.id||e.name,name:e.name,status:e.status,enabled:e.enabled,active:e.enabled&&e.status===`connected`,builtin:e.builtin||!1,transport:t.transport||`stdio`,command:t.command,args:t.args,url:t.url,tools_count:e.tools_count||0,tools:e.tools||[]}});return{servers:e,activeServers:e.filter(e=>e.active).map(e=>({id:e.id,name:e.name,transport:e.transport,status:e.status}))}}catch(e){return console.error(`Failed to fetch MCP servers:`,e),{servers:[],activeServers:[]}}},toggleMCPServer:async(e,t)=>{try{await K(`/api/mcp/servers/${e}`,{method:`POST`,body:{action:t?`connect`:`disconnect`},showLoader:t?`Conectando servidor...`:`Desconectando servidor...`,showError:!0,showSuccess:t?`Servidor conectado`:`Servidor desconectado`});let{fetchMCPServers:n}=X.getState();await n()}catch(e){throw console.error(`Failed to toggle MCP server:`,e),e}},updateMCPServer:async(e,t)=>{try{await K(`/api/mcp/servers/${e}`,{method:`PUT`,body:t,showLoader:`Guardando configuración...`,showError:!0,showSuccess:`Configuración guardada`});let{fetchMCPServers:n}=X.getState();await n()}catch(e){throw console.error(`Failed to update MCP server:`,e),e}},deleteMCPServer:async e=>{try{await K(`/api/mcp/servers/${e}`,{method:`DELETE`,showLoader:`Eliminando servidor...`,showError:!0,showSuccess:`Servidor eliminado`});let t=X.getState().servers.filter(t=>t.id!==e);X.setState({servers:t,activeServers:t.filter(e=>e.active).map(e=>({id:e.id,name:e.name,transport:e.transport,status:e.status}))})}catch(e){throw console.error(`Failed to delete MCP server:`,e),e}}}),DR=()=>({channels:[],activeChannels:[],fetchChannels:async()=>{try{let e=(await K(`/api/channels`)).channels;return{channels:e,activeChannels:e.filter(e=>e.active)}}catch(e){return console.error(`Failed to fetch channels:`,e),{channels:[],activeChannels:[]}}},createChannel:async(e,t)=>{let n=await K(`/api/channels`,{method:`POST`,body:{type:e,config:t||{}}});return{id:n.id,status:n.status}},reconnectChannel:async(e,t)=>{await K(`/api/channels/${e}/reconnect`,{method:`POST`,body:{config:t||{}}})},toggleChannel:async(e,t)=>{try{await K(`/api/channels/${e}/toggle`,{method:`POST`,body:{active:t}})}catch(e){throw console.error(`Failed to toggle channel:`,e),e}},updateChannel:async(e,t)=>{try{await K(`/api/channels/${e}`,{method:`PUT`,body:t});let{fetchChannels:n}=X.getState();await n()}catch(e){throw console.error(`Failed to update channel:`,e),e}}}),OR=()=>({voiceProviders:[],configuredVoiceProviders:{},fetchVoiceProviders:async()=>{try{return{voiceProviders:(await K(`/api/voice/providers`)).providers,configuredVoiceProviders:{}}}catch(e){return console.error(`Failed to fetch voice providers:`,e),{voiceProviders:[],configuredVoiceProviders:{}}}},fetchConfiguredVoiceProviders:async()=>{try{return{configuredVoiceProviders:await K(`/api/voice/configured-providers`)}}catch(e){return console.error(`Failed to fetch configured voice providers:`,e),{configuredVoiceProviders:{}}}},saveVoiceProviderKey:async(e,t)=>{try{await K(`/api/voice/providers/${e}/key`,{method:`POST`,body:{apiKey:t}});let n=await OR().fetchConfiguredVoiceProviders();X.setState(n)}catch(e){throw console.error(`Failed to save voice provider key:`,e),e}}}),X=i((e,t)=>({providers:[],activeProviders:[],models:[],availableModels:[],agents:[],tools:[],activeTools:[],skills:[],activeSkills:[],servers:[],activeServers:[],channels:[],activeChannels:[],voiceProviders:[],configuredVoiceProviders:{},isLoading:!1,isInitialized:!1,error:null,fetchAll:async()=>{if(t().isInitialized)return;let{showLoader:n,hideLoader:r}=(await Ru(async()=>{let{useLoaderStore:e}=await Promise.resolve().then(()=>Xh);return{useLoaderStore:e}},void 0)).useLoaderStore.getState();n(`Sincronizando la Colmena...`),e({isLoading:!0,error:null});try{let[t,n,i,a,o,s,c,l]=await Promise.all([xR().fetchProviders(),SR().fetchModels(),CR().fetchAgents(),wR().fetchTools(),TR().fetchSkills(),ER().fetchMCPServers(),DR().fetchChannels(),OR().fetchVoiceProviders()]),u=await OR().fetchConfiguredVoiceProviders();e({...t,...n,...i,...a,...o,...s,...c,...l,...u,isLoading:!1,isInitialized:!0}),r()}catch(t){r(),e({isLoading:!1,error:t instanceof Error?t.message:`Failed to fetch config`})}},refresh:async t=>{try{let n;switch(t){case`providers`:n=await xR().fetchProviders(),e(n);break;case`models`:n=await SR().fetchModels(),e(n);break;case`agents`:n=await CR().fetchAgents(),e(n);break;case`tools`:{let t=await wR().fetchTools();t&&e(t);break}case`skills`:n=await TR().fetchSkills(),e(n);break;case`mcp`:n=await ER().fetchMCPServers(),e(n);break;case`channels`:n=await DR().fetchChannels(),e(n);break}}catch(e){console.error(`Failed to refresh ${t}:`,e)}},fetchProviders:async()=>{e(await xR().fetchProviders())},toggleProvider:xR().toggleProvider,updateProvider:xR().updateProvider,createProvider:xR().createProvider,fetchModels:async()=>{e(await SR().fetchModels())},toggleModel:SR().toggleModel,createModel:SR().createModel,syncModels:SR().syncModels,getModelsByProvider:SR().getModelsByProvider,deleteModel:SR().deleteModel,updateModel:SR().updateModel,fetchAgents:async()=>{e(await CR().fetchAgents())},createAgent:CR().createAgent,updateAgent:CR().updateAgent,deleteAgent:CR().deleteAgent,fetchTools:async()=>{let t=await wR().fetchTools();t&&e(t)},toggleTool:wR().toggleTool,updateTool:wR().updateTool,fetchSkills:async()=>{e(await TR().fetchSkills())},toggleSkill:TR().toggleSkill,updateSkill:TR().updateSkill,fetchMCPServers:async()=>{e(await ER().fetchMCPServers())},toggleMCPServer:ER().toggleMCPServer,updateMCPServer:ER().updateMCPServer,deleteMCPServer:ER().deleteMCPServer,fetchChannels:async()=>{e(await DR().fetchChannels())},createChannel:DR().createChannel,reconnectChannel:DR().reconnectChannel,toggleChannel:DR().toggleChannel,updateChannel:DR().updateChannel,fetchVoiceProviders:async()=>{let t=await OR().fetchVoiceProviders();return e(t),t},fetchConfiguredVoiceProviders:async()=>{let t=await OR().fetchConfiguredVoiceProviders();return e(t),t},saveVoiceProviderKey:async(t,n)=>{await K(`/api/voice/providers/${t}/key`,{method:`POST`,body:{apiKey:n}}),e(await OR().fetchConfiguredVoiceProviders())}}));function kR(e=!0){let t=X(e=>e.fetchAll),n=X(e=>e.isInitialized),r=u.useRef(!1);u.useEffect(()=>{e&&!n&&!r.current&&(r.current=!0,t())},[e,n,t])}function AR(){let e=X(e=>e.providers),t=X(e=>e.activeProviders),n=X(e=>e.models),r=X(e=>e.availableModels),i=X(e=>e.isLoading),a=X(e=>e.fetchProviders),o=X(e=>e.fetchModels),s=X(e=>e.toggleProvider),c=X(e=>e.updateProvider),l=X(e=>e.createProvider),u=X(e=>e.getModelsByProvider);return{providers:e,activeProviders:t,models:n,availableModels:r,isLoading:i,error:X(e=>e.error),fetchProviders:a,fetchModels:o,toggleProvider:s,updateProvider:c,createProvider:l,getModelsByProvider:u}}function jR(){let e=X(e=>e.models),t=X(e=>e.availableModels),n=X(e=>e.isLoading),r=X(e=>e.fetchModels),i=X(e=>e.toggleModel),a=X(e=>e.createModel),o=X(e=>e.syncModels),s=X(e=>e.getModelsByProvider),c=X(e=>e.deleteModel),l=X(e=>e.updateModel);return{models:e,availableModels:t,isLoading:n,error:X(e=>e.error),fetchModels:r,toggleModel:i,createModel:a,syncModels:o,getModelsByProvider:s,deleteModel:c,updateModel:l}}function MR(){let e=X(e=>e.agents),t=X(e=>e.isLoading),n=X(e=>e.fetchAgents),r=X(e=>e.createAgent),i=X(e=>e.updateAgent),a=X(e=>e.deleteAgent);return{agents:e,isLoading:t,error:X(e=>e.error),fetchAgents:n,createAgent:r,updateAgent:i,deleteAgent:a}}function NR(){let e=X(e=>e.tools),t=X(e=>e.activeTools),n=X(e=>e.isLoading),r=X(e=>e.fetchTools),i=X(e=>e.toggleTool),a=X(e=>e.updateTool);return{tools:e,activeTools:t,isLoading:n,error:X(e=>e.error),fetchTools:r,toggleTool:i,updateTool:a}}function PR(){let e=X(e=>e.skills),t=X(e=>e.activeSkills),n=X(e=>e.isLoading),r=X(e=>e.fetchSkills),i=X(e=>e.toggleSkill),a=X(e=>e.updateSkill);return{skills:e,activeSkills:t,isLoading:n,error:X(e=>e.error),fetchSkills:r,toggleSkill:i,updateSkill:a}}function FR(){let e=X(e=>e.servers),t=X(e=>e.activeServers),n=X(e=>e.isLoading),r=X(e=>e.fetchMCPServers),i=X(e=>e.toggleMCPServer),a=X(e=>e.updateMCPServer),o=X(e=>e.deleteMCPServer);return{servers:e,activeServers:t,isLoading:n,error:X(e=>e.error),fetchMCPServers:r,toggleMCPServer:i,updateMCPServer:a,deleteMCPServer:o}}function IR(){let e=X(e=>e.channels),t=X(e=>e.activeChannels),n=X(e=>e.isLoading),r=X(e=>e.fetchChannels),i=X(e=>e.createChannel),a=X(e=>e.reconnectChannel),o=X(e=>e.toggleChannel);return{channels:e,activeChannels:t,isLoading:n,error:X(e=>e.error),fetchChannels:r,createChannel:i,reconnectChannel:a,toggleChannel:o,updateChannel:X(e=>e.updateChannel)}}function LR(){let e=X(e=>e.voiceProviders),t=X(e=>e.configuredVoiceProviders),n=X(e=>e.isLoading),r=X(e=>e.fetchVoiceProviders),i=X(e=>e.fetchConfiguredVoiceProviders),a=X(e=>e.saveVoiceProviderKey);return{voiceProviders:e,configuredVoiceProviders:t,isLoading:n,error:X(e=>e.error),fetchVoiceProviders:r,fetchConfiguredVoiceProviders:i,saveVoiceProviderKey:a}}function RR(){let{agents:e,isLoading:t,error:n,fetchAgents:r,createAgent:i,updateAgent:a,deleteAgent:o}=MR(),[s,c]=(0,u.useState)(`all`);return(0,u.useEffect)(()=>{r()},[r]),{agents:(0,u.useMemo)(()=>Array.isArray(e)?(s===`all`?e:e.filter(e=>e.status===s)).filter(e=>!e.id?.startsWith(`hl-`)):[],[e,s]),allAgents:e||[],filter:s,setFilter:c,createAgent:i,updateAgent:a,deleteAgent:o,isLoading:t,error:n,refreshAgents:r}}var zR=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:H(`rounded-lg border bg-card text-card-foreground shadow-sm`,e),...t}));zR.displayName=`Card`;var BR=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:H(`flex flex-col space-y-1.5 p-6`,e),...t}));BR.displayName=`CardHeader`;var VR=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsx)(`h3`,{ref:r,className:H(`text-2xl font-semibold leading-none tracking-tight`,e),...n,children:t}));VR.displayName=`CardTitle`;var HR=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`p`,{ref:n,className:H(`text-sm text-muted-foreground`,e),...t}));HR.displayName=`CardDescription`;var UR=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:H(`p-6 pt-0`,e),...t}));UR.displayName=`CardContent`;var WR=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:H(`flex items-center p-6 pt-0`,e),...t}));WR.displayName=`CardFooter`;function GR(e){return e<50?`#22c55e`:e<80?`#eab308`:`#ef4444`}function KR(){let[e,t]=(0,u.useState)(()=>{let e=new Date;return Array.from({length:12},(t,n)=>({time:new Date(e.getTime()-(11-n)*5e3).toLocaleTimeString(`es`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),msgs:0,rss:0}))}),[n,r]=(0,u.useState)([]),{data:i}=Nu({queryKey:[`system-stats`],queryFn:()=>K(`/api/system-stats`),refetchInterval:5e3}),a=(0,u.useRef)(i);(0,u.useEffect)(()=>{a.current=i},[i]),(0,u.useEffect)(()=>{let e=setInterval(()=>{let e=a.current;if(!e)return;let n=new Date().toLocaleTimeString(`es`,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});t(t=>[...t,{time:n,msgs:e.recentMessages,rss:e.memory.rss}].slice(-20))},5e3);return()=>clearInterval(e)},[]);let o=i?.memory.rss??0,s=i?.memory.heapUsed??0,c=i?.memory.external??0,l=i?.recentMessages??0;return(0,A.jsxs)(`div`,{className:`flex flex-col gap-4 mb-4`,children:[(0,A.jsxs)(zR,{className:`overflow-hidden border-primary/10`,children:[(0,A.jsx)(BR,{className:`pb-2 bg-gradient-to-r from-primary/5 to-transparent`,children:(0,A.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,A.jsxs)(VR,{className:`text-base flex items-center gap-2`,children:[(0,A.jsx)(Mn,{className:`h-4 w-4 text-primary`}),`Monitor del Proceso Hive`]})})}),(0,A.jsxs)(UR,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-4 pt-4`,children:[(0,A.jsx)(qR,{icon:er,label:`Actividad reciente`,value:`${l}`,subValue:`mensajes últimos 5 min`,color:l>0?`#22c55e`:`hsl(var(--muted-foreground))`,progress:Math.min(100,l*10)}),(0,A.jsx)(qR,{icon:Rn,label:`Memoria Hive (RSS)`,value:`${o} MB`,subValue:`Heap JS: ${s} MB usados`,color:GR(Math.min(100,Math.round(o/1024*100))),progress:Math.min(100,Math.round(o/1024*100))}),(0,A.jsx)(qR,{icon:Qn,label:`Heap JS`,value:`${s} MB`,subValue:`External: ${c} MB`,color:`#3b82f6`,progress:Math.min(100,Math.round(s/512*100))}),(0,A.jsx)(qR,{icon:yr,label:`Sesiones WS activas`,value:`${i?.connections??0}`,subValue:`conexiones WebSocket`,color:`#a855f7`,progress:Math.min(100,(i?.connections??0)*10)})]})]}),(0,A.jsxs)(zR,{className:`border-primary/10`,children:[(0,A.jsx)(BR,{className:`pb-2`,children:(0,A.jsxs)(VR,{className:`text-sm flex items-center gap-2`,children:[(0,A.jsx)(Bt,{className:`h-4 w-4 text-primary`}),`Historial — `,(0,A.jsx)(`span`,{className:`text-green-400`,children:`Mensajes`}),` · `,(0,A.jsx)(`span`,{className:`text-purple-400`,children:`RSS MB`})]})}),(0,A.jsx)(UR,{className:`h-[160px]`,children:(0,A.jsx)(xS,{width:`100%`,height:`100%`,children:(0,A.jsxs)(bR,{data:e,children:[(0,A.jsxs)(`defs`,{children:[(0,A.jsxs)(`linearGradient`,{id:`gMsgs`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,A.jsx)(`stop`,{offset:`5%`,stopColor:`#22c55e`,stopOpacity:.3}),(0,A.jsx)(`stop`,{offset:`95%`,stopColor:`#22c55e`,stopOpacity:0})]}),(0,A.jsxs)(`linearGradient`,{id:`gHeap`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,A.jsx)(`stop`,{offset:`5%`,stopColor:`#8b5cf6`,stopOpacity:.3}),(0,A.jsx)(`stop`,{offset:`95%`,stopColor:`#8b5cf6`,stopOpacity:0})]})]}),(0,A.jsx)(gL,{dataKey:`time`,axisLine:!1,tickLine:!1,tick:{fill:`hsl(var(--muted-foreground))`,fontSize:9},interval:`preserveStartEnd`}),(0,A.jsx)(TL,{axisLine:!1,tickLine:!1,tick:{fill:`hsl(var(--muted-foreground))`,fontSize:9}}),(0,A.jsx)(sL,{type:`monotone`,dataKey:`msgs`,stroke:`#22c55e`,strokeWidth:2,fillOpacity:1,fill:`url(#gMsgs)`,name:`Mensajes`}),(0,A.jsx)(sL,{type:`monotone`,dataKey:`rss`,stroke:`#8b5cf6`,strokeWidth:2,fillOpacity:1,fill:`url(#gHeap)`,name:`RSS MB`})]})})})]})]})}function qR({icon:e,label:t,value:n,subValue:r,color:i,progress:a}){return(0,A.jsxs)(`div`,{className:`rounded-lg border bg-card/50 p-3 space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{style:{color:i},children:(0,A.jsx)(e,{className:`h-4 w-4`})}),(0,A.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:t})]}),(0,A.jsx)(`span`,{className:`text-lg font-bold font-mono`,style:{color:i},children:n})]}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-muted overflow-hidden`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full transition-all duration-500`,style:{width:`${Math.min(a,100)}%`,backgroundColor:i}})}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:r})]})]})}var JR={anthropic:`#d97706`,openai:`#10b981`,google:`#3b82f6`,gemini:`#3b82f6`,deepseek:`#8b5cf6`,kimi:`#ec4899`,ollama:`#14b8a6`,openrouter:`#f59e0b`,mistral:`#6366f1`};function YR(e){return e>=1e6?(e/1e6).toFixed(2)+`M`:e>=1e3?(e/1e3).toFixed(1)+`K`:e.toString()}function XR(e){return e>=1?`$`+e.toFixed(2):e>=.01?`$`+e.toFixed(3):e>0?`$`+e.toFixed(5):`$0.00`}function ZR(e){return e>=10?e.toFixed(1)+`%`:e>=1?e.toFixed(2)+`%`:e>0?e.toFixed(3)+`%`:`0%`}function QR(){let[e,t]=(0,u.useState)(24),{data:n,isLoading:r}=Nu({queryKey:[`usage-stats`,e],queryFn:async()=>{let t=await K(`/api/usage-stats?hours=${e}`);return console.log(`[UsageStatsPanel] Received stats:`,{totalTokens:t.totalTokens,totalCostUsd:t.totalCostUsd,providers:Object.keys(t.byProvider||{}).length}),t},refetchInterval:6e4});if(r&&!n)return(0,A.jsxs)(zR,{className:`border-primary/10`,children:[(0,A.jsx)(BR,{children:(0,A.jsxs)(VR,{className:`flex items-center gap-2`,children:[(0,A.jsx)(yn,{className:`h-5 w-5 text-primary`}),`Uso y Costos de API`]})}),(0,A.jsx)(UR,{children:(0,A.jsx)(`div`,{className:`h-40 flex items-center justify-center text-muted-foreground animate-pulse`,children:`Cargando estadísticas de uso...`})})]});let i=n&&(n.totalTokens>0||n.totalCostUsd>0),a=n?Object.entries(n.byProvider).map(([e,t])=>({name:e.charAt(0).toUpperCase()+e.slice(1),value:t.tokens,cost:t.costUsd,color:JR[e.toLowerCase()]||`#6b7280`})):[],o=n?Object.entries(n.byModel).slice(0,8).map(([e,t])=>({name:e.length>20?e.slice(0,18)+`...`:e,tokens:t.tokens,cost:t.costUsd,fullName:e})):[];return(0,A.jsxs)(zR,{className:`border-primary/10`,children:[(0,A.jsx)(BR,{className:`pb-2`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(VR,{className:`text-base flex items-center gap-2`,children:[(0,A.jsx)(yn,{className:`h-5 w-5 text-primary`}),`Uso y Costos de API`]}),(0,A.jsx)(HR,{children:`Tokens consumidos y costos por provider/modelo`})]}),(0,A.jsx)(`div`,{className:`flex gap-1`,children:[6,24,168].map(n=>(0,A.jsx)(`button`,{onClick:()=>t(n),className:`px-2 py-1 text-xs rounded-md transition-colors ${e===n?`bg-primary text-primary-foreground`:`bg-muted hover:bg-muted/80`}`,children:n===6?`6h`:n===24?`24h`:`7d`},n))})]})}),(0,A.jsxs)(UR,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`rounded-lg border p-3 ${n?.toonSavedTokens?`border-emerald-500/30 bg-emerald-500/5`:`bg-card/50`}`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,A.jsx)(Wr,{className:`h-3 w-3 ${n?.toonSavedTokens?`text-emerald-400`:``}`}),(0,A.jsx)(`span`,{className:`font-medium`,children:`TOON Optimización de Tokens`})]}),n?.toonSavingsPercent&&n.toonSavingsPercent>0?(0,A.jsxs)(`span`,{className:`text-xs font-bold text-emerald-400`,children:[ZR(n.toonSavingsPercent),` reducción`]}):null]}),(0,A.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 md:grid-cols-4 gap-3`,children:[(0,A.jsxs)(`div`,{className:`bg-emerald-500/5 rounded-md p-2`,children:[(0,A.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`Tokens Ahorrados`}),(0,A.jsx)(`div`,{className:`text-lg font-bold ${n?.toonSavedTokens?`text-emerald-400`:`text-muted-foreground`}`,children:n?YR(n.toonSavedTokens):`—`})]}),(0,A.jsxs)(`div`,{className:`bg-emerald-500/5 rounded-md p-2`,children:[(0,A.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`Costo Ahorrado`}),(0,A.jsx)(`div`,{className:`text-lg font-bold text-emerald-400`,children:n?XR(n.toonSavedCost):`—`})]}),(0,A.jsxs)(`div`,{className:`bg-emerald-500/5 rounded-md p-2`,children:[(0,A.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`Bytes Ahorrados`}),(0,A.jsx)(`div`,{className:`text-lg font-bold text-emerald-400`,children:n&&n.toonSavedBytes>0?YR(n.toonSavedBytes):`—`})]}),(0,A.jsxs)(`div`,{className:`bg-emerald-500/5 rounded-md p-2`,children:[(0,A.jsx)(`div`,{className:`text-xs text-muted-foreground mb-1`,children:`Reducción Bytes`}),(0,A.jsx)(`div`,{className:`text-lg font-bold text-emerald-400`,children:n?.toonSavedBytesPercent&&n.toonSavedBytesPercent>0?ZR(n.toonSavedBytesPercent):`—`})]})]}),n&&(n.toonJsonTokens>0||n.toonToonTokens>0)&&(0,A.jsx)(`div`,{className:`mt-3 pt-3 border-t border-emerald-500/20`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between text-xs`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`JSON:`}),` `,(0,A.jsx)(`span`,{className:`font-medium`,children:n.toonJsonTokens>0?YR(n.toonJsonTokens):`—`}),` `,(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`tokens`})]}),(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`→`}),(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[(0,A.jsx)(`span`,{className:`text-emerald-400`,children:`TOON:`}),` `,(0,A.jsx)(`span`,{className:`font-medium text-emerald-400`,children:n.toonToonTokens>0?YR(n.toonToonTokens):`—`}),` `,(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:`tokens`})]})]}),n?.toonSavingsPercent&&n.toonSavingsPercent>0?(0,A.jsxs)(`span`,{className:`text-xs font-bold text-emerald-400`,children:[ZR(n.toonSavingsPercent),` menos tokens`]}):null]})}),n&&!n.toonSavedTokens&&(0,A.jsx)(`div`,{className:`mt-2 text-xs text-muted-foreground italic`,children:`Sin optimizaciones TOON registradas aún`})]}),i?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[(0,A.jsxs)(`div`,{className:`rounded-lg border bg-card/50 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,A.jsx)(yn,{className:`h-3 w-3`}),`Costo Total`]}),(0,A.jsx)(`div`,{className:`text-2xl font-bold text-green-500`,children:XR(n.totalCostUsd)})]}),(0,A.jsxs)(`div`,{className:`rounded-lg border bg-card/50 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,A.jsx)(zn,{className:`h-3 w-3`}),`Total Tokens`]}),(0,A.jsx)(`div`,{className:`text-2xl font-bold`,children:YR(n.totalTokens)})]}),(0,A.jsxs)(`div`,{className:`rounded-lg border bg-card/50 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,A.jsx)(Pr,{className:`h-3 w-3`}),`Input / Output`]}),(0,A.jsxs)(`div`,{className:`text-lg font-semibold`,children:[(0,A.jsx)(`span`,{className:`text-blue-500`,children:YR(n.totalInputTokens)}),(0,A.jsx)(`span`,{className:`text-muted-foreground`,children:` / `}),(0,A.jsx)(`span`,{className:`text-purple-500`,children:YR(n.totalOutputTokens)})]})]}),(0,A.jsxs)(`div`,{className:`rounded-lg border bg-card/50 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground mb-1`,children:[(0,A.jsx)(yr,{className:`h-3 w-3`}),`Providers`]}),(0,A.jsx)(`div`,{className:`text-2xl font-bold`,children:Object.keys(n.byProvider).length})]})]}),(0,A.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`h4`,{className:`text-sm font-medium mb-2 flex items-center gap-2`,children:[(0,A.jsx)(yr,{className:`h-4 w-4 text-muted-foreground`}),`Por Provider`]}),(0,A.jsx)(`div`,{className:`h-[180px]`,children:(0,A.jsx)(xS,{width:`100%`,height:`100%`,children:(0,A.jsxs)(vR,{data:a,layout:`vertical`,children:[(0,A.jsx)(gL,{type:`number`,hide:!0}),(0,A.jsx)(TL,{type:`category`,dataKey:`name`,axisLine:!1,tickLine:!1,tick:{fill:`hsl(var(--muted-foreground))`,fontSize:11},width:70}),(0,A.jsx)(mS,{contentStyle:{backgroundColor:`hsl(var(--card))`,border:`1px solid hsl(var(--border))`,borderRadius:`8px`},formatter:(e,t)=>[t===`cost`?XR(e):YR(e),t===`cost`?`Costo`:`Tokens`]}),(0,A.jsx)(aF,{dataKey:`value`,radius:[0,4,4,0],barSize:16,children:a.map(e=>(0,A.jsx)(SS,{fill:e.color},e.name))})]})})})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`h4`,{className:`text-sm font-medium mb-2 flex items-center gap-2`,children:[(0,A.jsx)(qt,{className:`h-4 w-4 text-muted-foreground`}),`Por Modelo (Top 8)`]}),(0,A.jsx)(`div`,{className:`h-[180px]`,children:(0,A.jsx)(xS,{width:`100%`,height:`100%`,children:(0,A.jsxs)(vR,{data:o,children:[(0,A.jsx)(gL,{dataKey:`name`,axisLine:!1,tickLine:!1,tick:{fill:`hsl(var(--muted-foreground))`,fontSize:10},angle:-45,textAnchor:`end`,height:60}),(0,A.jsx)(TL,{axisLine:!1,tickLine:!1,tick:{fill:`hsl(var(--muted-foreground))`,fontSize:10}}),(0,A.jsx)(mS,{contentStyle:{backgroundColor:`hsl(var(--card))`,border:`1px solid hsl(var(--border))`,borderRadius:`8px`},formatter:e=>XR(e),labelFormatter:e=>o.find(t=>t.name===e)?.fullName||e}),(0,A.jsx)(aF,{dataKey:`cost`,radius:[4,4,0,0],children:o.map(e=>(0,A.jsx)(SS,{fill:JR[e.fullName.split(`-`)[0]?.toLowerCase()]||`#6b7280`},e.fullName))})]})})})]})]}),a.length>0&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h4`,{className:`text-sm font-medium mb-2`,children:`Detalle por Provider`}),(0,A.jsx)(`div`,{className:`rounded-lg border overflow-hidden`,children:(0,A.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,A.jsx)(`thead`,{className:`bg-muted/50`,children:(0,A.jsxs)(`tr`,{children:[(0,A.jsx)(`th`,{className:`text-left p-2 font-medium`,children:`Provider`}),(0,A.jsx)(`th`,{className:`text-right p-2 font-medium`,children:`Input`}),(0,A.jsx)(`th`,{className:`text-right p-2 font-medium`,children:`Output`}),(0,A.jsx)(`th`,{className:`text-right p-2 font-medium`,children:`Total`}),(0,A.jsx)(`th`,{className:`text-right p-2 font-medium`,children:`Costo`})]})}),(0,A.jsx)(`tbody`,{children:Object.entries(n.byProvider).map(([e,t])=>(0,A.jsxs)(`tr`,{className:`border-t`,children:[(0,A.jsx)(`td`,{className:`p-2 font-medium`,children:e}),(0,A.jsx)(`td`,{className:`p-2 text-right text-blue-500`,children:YR(t.inputTokens)}),(0,A.jsx)(`td`,{className:`p-2 text-right text-purple-500`,children:YR(t.outputTokens)}),(0,A.jsx)(`td`,{className:`p-2 text-right`,children:YR(t.tokens)}),(0,A.jsx)(`td`,{className:`p-2 text-right font-medium text-green-500`,children:XR(t.costUsd)})]},e))})]})})]})]}):(0,A.jsx)(`div`,{className:`h-32 flex items-center justify-center text-muted-foreground`,children:(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(Bt,{className:`h-8 w-8 mx-auto mb-2 opacity-50`}),(0,A.jsx)(`p`,{children:`No hay datos de uso aún`}),(0,A.jsx)(`p`,{className:`text-xs`,children:`Los tokens se registrarán automáticamente`})]})})]})]})}var $R=`AlertDialog`,[ez,yfe]=M($R,[am]),tz=am(),nz=e=>{let{__scopeAlertDialog:t,...n}=e,r=tz(t);return(0,A.jsx)(Mm,{...r,...n,modal:!0})};nz.displayName=$R;var rz=`AlertDialogTrigger`,iz=u.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=tz(n);return(0,A.jsx)(Nm,{...i,...r,ref:t})});iz.displayName=rz;var az=`AlertDialogPortal`,oz=e=>{let{__scopeAlertDialog:t,...n}=e,r=tz(t);return(0,A.jsx)(Pm,{...r,...n})};oz.displayName=az;var sz=`AlertDialogOverlay`,cz=u.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=tz(n);return(0,A.jsx)(Fm,{...i,...r,ref:t})});cz.displayName=sz;var lz=`AlertDialogContent`,[uz,dz]=ez(lz),fz=I(`AlertDialogContent`),pz=u.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=tz(n),o=u.useRef(null),s=D(t,o),c=u.useRef(null);return(0,A.jsx)(Dm,{contentName:lz,titleName:mz,docsSlug:`alert-dialog`,children:(0,A.jsx)(uz,{scope:n,cancelRef:c,children:(0,A.jsxs)(Im,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:w(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,A.jsx)(fz,{children:r}),(0,A.jsx)(Sz,{contentRef:o})]})})})});pz.displayName=lz;var mz=`AlertDialogTitle`,hz=u.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=tz(n);return(0,A.jsx)(Lm,{...i,...r,ref:t})});hz.displayName=mz;var gz=`AlertDialogDescription`,_z=u.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=tz(n);return(0,A.jsx)(Rm,{...i,...r,ref:t})});_z.displayName=gz;var vz=`AlertDialogAction`,yz=u.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=tz(n);return(0,A.jsx)(zm,{...i,...r,ref:t})});yz.displayName=vz;var bz=`AlertDialogCancel`,xz=u.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=dz(bz,n),a=tz(n),o=D(t,i);return(0,A.jsx)(zm,{...a,...r,ref:o})});xz.displayName=bz;var Sz=({contentRef:e})=>{let t=`\`${lz}\` requires a description for the component to be accessible for screen reader users.
183
+
184
+ You can add a description to the \`${lz}\` by passing a \`${gz}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
185
+
186
+ Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${lz}\`. 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.
187
+
188
+ For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return u.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},Cz=nz,wz=oz,Tz=cz,Ez=pz,Dz=yz,Oz=xz,kz=hz,Az=_z,jz=Cz,Mz=wz,Nz=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Tz,{className:H(`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}));Nz.displayName=Tz.displayName;var Pz=u.forwardRef(({className:e,...t},n)=>(0,A.jsxs)(Mz,{children:[(0,A.jsx)(Nz,{}),(0,A.jsx)(Ez,{ref:n,className:H(`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:rounded-lg`,e),...t})]}));Pz.displayName=Ez.displayName;var Fz=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Fz.displayName=`AlertDialogHeader`;var Iz=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Iz.displayName=`AlertDialogFooter`;var Lz=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(kz,{ref:n,className:H(`text-lg font-semibold`,e),...t}));Lz.displayName=kz.displayName;var Rz=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Az,{ref:n,className:H(`text-sm text-muted-foreground`,e),...t}));Rz.displayName=Az.displayName;var zz=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Dz,{ref:n,className:H(Zf(),e),...t}));zz.displayName=Dz.displayName;var Bz=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Oz,{ref:n,className:H(Zf({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));Bz.displayName=Oz.displayName;var Vz=Ft(`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 Hz({className:e,variant:t,...n}){return(0,A.jsx)(`div`,{className:H(Vz({variant:t}),e),...n})}function Uz(e,t=[]){let n=[];function r(t,r){let i=u.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=u.useMemo(()=>o,Object.values(o));return(0,A.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=u.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>u.createContext(e));return function(n){let r=n?.[e]||t;return u.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Wz(i,...t)]}function Wz(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return u.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Gz=`Progress`,Kz=100,[qz,bfe]=Uz(Gz),[Jz,Yz]=qz(Gz),Xz=u.forwardRef((e,t)=>{let{__scopeProgress:n,value:r=null,max:i,getValueLabel:a=$z,...o}=e;(i||i===0)&&!nB(i)&&console.error(iB(`${i}`,`Progress`));let s=nB(i)?i:Kz;r!==null&&!rB(r,s)&&console.error(aB(`${r}`,`Progress`));let c=rB(r,s)?r:null,l=tB(c)?a(c,s):void 0;return(0,A.jsx)(Jz,{scope:n,value:c,max:s,children:(0,A.jsx)(Qf.div,{"aria-valuemax":s,"aria-valuemin":0,"aria-valuenow":tB(c)?c:void 0,"aria-valuetext":l,role:`progressbar`,"data-state":eB(c,s),"data-value":c??void 0,"data-max":s,...o,ref:t})})});Xz.displayName=Gz;var Zz=`ProgressIndicator`,Qz=u.forwardRef((e,t)=>{let{__scopeProgress:n,...r}=e,i=Yz(Zz,n);return(0,A.jsx)(Qf.div,{"data-state":eB(i.value,i.max),"data-value":i.value??void 0,"data-max":i.max,...r,ref:t})});Qz.displayName=Zz;function $z(e,t){return`${Math.round(e/t*100)}%`}function eB(e,t){return e==null?`indeterminate`:e===t?`complete`:`loading`}function tB(e){return typeof e==`number`}function nB(e){return tB(e)&&!isNaN(e)&&e>0}function rB(e,t){return tB(e)&&!isNaN(e)&&e<=t&&e>=0}function iB(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Kz}\`.`}function aB(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be:
189
+ - a positive number
190
+ - less than the value passed to \`max\` (or ${Kz} if no \`max\` prop is set)
191
+ - \`null\` or \`undefined\` if the progress is indeterminate.
192
+
193
+ Defaulting to \`null\`.`}var oB=Xz,sB=Qz,cB=u.forwardRef(({className:e,value:t,...n},r)=>(0,A.jsx)(oB,{ref:r,className:H(`relative h-4 w-full overflow-hidden rounded-full bg-secondary`,e),...n,children:(0,A.jsx)(sB,{className:`h-full w-full flex-1 bg-primary transition-all`,style:{transform:`translateX(-${100-(t||0)}%)`}})}));cB.displayName=oB.displayName;function lB(){let[e,t]=(0,u.useState)(!1),[n,r]=(0,u.useState)(0),[i,a]=(0,u.useState)([]),o=yu(),{data:s,isLoading:c}=Nu({queryKey:[`version-check`],queryFn:()=>K(`/api/version`),refetchInterval:3e5,retry:2}),l=Pu({mutationFn:()=>K(`/api/update`,{method:`POST`,showLoader:`Actualizando Hive...`}),onSuccess:e=>{r(100),e.success?(a(e.instructions||[]),eg.fire({title:`¡Actualización Completada!`,text:e.message||`Hive ha sido actualizado exitosamente.`,icon:`success`,confirmButtonText:`Continuar`})):(e.instructions&&a(e.instructions),eg.fire({title:`Información de Actualización`,html:`
194
+ <div class="text-left space-y-2">
195
+ ${e.error?`<p class="mb-2">${e.error}</p>`:``}
196
+ ${e.output?`<pre class="bg-muted p-2 rounded text-xs overflow-auto max-h-40">${e.output}</pre>`:``}
197
+ </div>
198
+ `,icon:e.instructions?`info`:`error`,confirmButtonText:`Entendido`})),setTimeout(()=>{o.invalidateQueries({queryKey:[`version-check`]})},2e3)},onError:e=>{r(0),console.error(`[UpdateChecker] Error:`,e)}}),d=()=>{t(!0)},f=()=>{t(!1),r(10),l.mutate();let e=setInterval(()=>{r(t=>t>=90?(clearInterval(e),t):t+10)},500)},p=e=>{switch(e){case`docker`:return`Docker`;case`binary`:return`Binario`;case`npm`:return`npm`;case`bun`:return`Bun`;default:return`Desconocida`}},m=()=>{if(!s)return null;switch(s.status){case`up-to-date`:return(0,A.jsxs)(Hz,{variant:`outline`,className:`flex items-center gap-1 bg-green-500/10 text-green-400 border-green-500/20`,children:[(0,A.jsx)(sn,{className:`h-3 w-3`}),`Actualizado`]});case`update-available`:return(0,A.jsxs)(Hz,{className:`flex items-center gap-1 bg-blue-500 text-white border-blue-400 hover:bg-blue-600`,children:[(0,A.jsx)(on,{className:`h-3 w-3`}),`v`,s.latest,` disponible`]});case`checking`:return(0,A.jsxs)(Hz,{variant:`outline`,className:`flex items-center gap-1`,children:[(0,A.jsx)(Yn,{className:`h-3 w-3 animate-spin`}),`Verificando...`]});case`error`:return(0,A.jsxs)(Hz,{variant:`destructive`,className:`flex items-center gap-1`,children:[(0,A.jsx)(Fr,{className:`h-3 w-3`}),`Error`]})}},h=s?.status===`update-available`;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,A.jsx)(`span`,{className:`hive-label mb-1`,children:`Versión`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m(),s&&(0,A.jsxs)(`span`,{className:`text-xs text-white/40 font-mono`,children:[`v`,s.current,` · `,p(s.installationType)]})]})]}),h&&(0,A.jsx)(W,{size:`sm`,onClick:d,disabled:l.isPending,className:`bg-blue-600 hover:bg-blue-700 text-white shadow-lg shadow-blue-500/20`,children:l.isPending?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`h-4 w-4 mr-2 animate-spin`}),`Actualizando...`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(xn,{className:`h-4 w-4 mr-2`}),`Actualizar a v`,s.latest]})}),(0,A.jsx)(jz,{open:e,onOpenChange:t,children:(0,A.jsxs)(Pz,{children:[(0,A.jsxs)(Fz,{children:[(0,A.jsxs)(Lz,{className:`flex items-center gap-2`,children:[(0,A.jsx)(xn,{className:`h-5 w-5 text-blue-500`}),`Actualizar Hive`]}),(0,A.jsxs)(Rz,{className:`space-y-3`,children:[(0,A.jsxs)(`p`,{children:[`Se ha detectado una nueva versión disponible (`,(0,A.jsxs)(`strong`,{children:[`v`,s?.latest]}),`). Tu versión actual es `,(0,A.jsxs)(`strong`,{children:[`v`,s?.current]}),`.`]}),(0,A.jsx)(`div`,{className:`bg-muted p-3 rounded-lg space-y-2`,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(Hn,{className:`h-4 w-4 text-blue-500 mt-0.5`}),(0,A.jsxs)(`div`,{className:`text-sm`,children:[(0,A.jsxs)(`p`,{className:`font-semibold mb-1`,children:[`Tipo de instalación: `,p(s?.installationType)]}),s?.installationType===`docker`&&(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Para Docker, deberás ejecutar manualmente los comandos en tu terminal.`}),s?.installationType===`binary`&&(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Para el binario, serás redirigido a GitHub Releases para descargar la nueva versión.`}),(s?.installationType===`npm`||s?.installationType===`bun`)&&(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`La actualización se realizará automáticamente. Deberás reiniciar el gateway después.`})]})]})}),l.isPending&&(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between text-sm`,children:[(0,A.jsx)(`span`,{children:`Progreso de actualización...`}),(0,A.jsxs)(`span`,{className:`text-muted-foreground`,children:[n,`%`]})]}),(0,A.jsx)(cB,{value:n,className:`h-2`})]})]})]}),(0,A.jsxs)(Iz,{children:[(0,A.jsx)(Bz,{disabled:l.isPending,children:`Cancelar`}),(0,A.jsx)(zz,{onClick:f,disabled:l.isPending,className:`bg-blue-600 hover:bg-blue-700`,children:l.isPending?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`h-4 w-4 mr-2 animate-spin`}),`Actualizando...`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(xn,{className:`h-4 w-4 mr-2`}),`Confirmar actualización`]})})]})]})}),i.length>0&&(0,A.jsx)(jz,{open:!0,onOpenChange:()=>a([]),children:(0,A.jsxs)(Pz,{children:[(0,A.jsxs)(Fz,{children:[(0,A.jsx)(Lz,{children:`Instrucciones de Actualización`}),(0,A.jsxs)(Rz,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{children:`Sigue estos pasos para completar la actualización:`}),(0,A.jsx)(`ol`,{className:`list-decimal list-inside space-y-2 bg-muted p-4 rounded-lg`,children:i.map((e,t)=>(0,A.jsx)(`li`,{className:`text-sm`,children:e},t))}),(0,A.jsxs)(`div`,{className:`flex items-start gap-2 text-xs text-muted-foreground`,children:[(0,A.jsx)(Tn,{className:`h-4 w-4 mt-0.5`}),(0,A.jsx)(`p`,{children:`Después de completar los pasos, recarga esta página para ver la nueva versión.`})]})]})]}),(0,A.jsx)(Iz,{children:(0,A.jsx)(zz,{children:`Entendido`})})]})})]})}function uB({icon:e,...t}){return(0,A.jsx)(e,{...t})}function dB(){let{status:e}=bh(),{allAgents:t}=RR(),{data:n}=Nu({queryKey:[`system-stats`],queryFn:()=>K(`/api/system-stats`),refetchInterval:5e3}),{data:r=[]}=Nu({queryKey:[`activity-stats`],queryFn:()=>K(`/api/activity-stats?hours=12`),refetchInterval:6e4}),i=(0,u.useMemo)(()=>t||[],[t]),a=[{label:`Agentes Activos`,value:i.length,icon:qt,color:`text-blue-500`,trend:`${i.filter(e=>e.status===`active`||e.status===`thinking`).length} en uso`},{label:`Sesiones Canvas`,value:n?.connections??0,icon:Kn,color:`text-orange-500`,trend:`Live`},{label:`Procesos Bridge`,value:i.filter(e=>e.status===`thinking`).length,icon:Xt,color:`text-purple-500`,trend:`Estable`},{label:`Mensajes / 1h`,value:r.at(-1)?.count??0,icon:Bt,color:`text-green-500`,trend:`Última hora`}],o=(0,u.useMemo)(()=>{let e=i.filter(e=>e.status===`idle`||e.status===`hibernated`).length,t=i.filter(e=>e.status===`active`).length,n=i.filter(e=>e.status===`thinking`).length,r=i.filter(e=>e.status===`error`).length;return[{name:`Idle`,value:e||0,color:`hsl(var(--muted))`},{name:`Active`,value:t||0,color:`hsl(var(--primary))`},{name:`Thinking`,value:n||0,color:`hsl(var(--accent))`},...r>0?[{name:`Error`,value:r,color:`#ef4444`}]:[]].filter(e=>e.value>0||e.name===`Idle`)},[i]),s=r.reduce((e,t)=>e+t.count,0);return n?.memory?.percentage&&Math.max(0,Math.round(100-n.memory.percentage*.3-(n.cpu||0)*.2)),(0,A.jsxs)(`div`,{className:`hive-page-container`,children:[(0,A.jsxs)(`div`,{className:`hive-page-header`,children:[(0,A.jsxs)(`div`,{className:`relative z-10`,children:[(0,A.jsxs)(`div`,{className:`hive-page-header__eyebrow`,children:[(0,A.jsx)(`div`,{className:`hive-page-header__dot`}),(0,A.jsx)(`span`,{className:`hive-page-header__label`,children:`SISTEMA OPERATIVO HIVE`})]}),(0,A.jsxs)(`h2`,{className:`hive-title-page`,children:[`Centro de `,(0,A.jsx)(`span`,{className:`hive-title-page__accent`,children:`Control`})]}),(0,A.jsx)(`p`,{className:`hive-subtitle`,children:`Monitoreo en tiempo real del enjambre y estado de los nodos cognitivos.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-6 relative z-10`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-end`,children:[(0,A.jsx)(`span`,{className:`hive-label mb-1`,children:`Estado Hive`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:e===`connected`?`hive-status-dot--active`:`hive-status-dot--disabled`}),(0,A.jsx)(`span`,{className:e===`connected`?`hive-status-label--active`:`hive-status-label--disabled`,children:e===`connected`?`EN LÍNEA`:`DESCONECTADO`})]})]}),(0,A.jsx)(`div`,{className:`h-10 w-px bg-white/10 hidden sm:block`}),(0,A.jsx)(lB,{})]})]}),(0,A.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 lg:grid-cols-4 mb-8`,children:a.map(e=>(0,A.jsxs)(`div`,{className:`hive-card hive-card--active group`,children:[(0,A.jsxs)(`div`,{className:`hive-card-body`,children:[(0,A.jsxs)(`div`,{className:`flex flex-row items-center justify-between mb-4`,children:[(0,A.jsx)(`span`,{className:`hive-title-section`,children:e.label}),(0,A.jsx)(`div`,{className:`p-2 rounded-lg bg-white/5 border border-white/5`,children:(0,A.jsx)(uB,{icon:e.icon,className:`h-4 w-4 ${e.color}`})})]}),(0,A.jsxs)(`div`,{className:`flex items-end justify-between`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`text-3xl font-black text-white group-hover:text-blue-400 transition-colors`,children:e.value}),(0,A.jsxs)(`p`,{className:`text-[10px] font-bold text-white/30 uppercase tracking-widest mt-1 flex items-center gap-1`,children:[(0,A.jsx)(Ut,{className:`h-2.5 w-2.5 text-green-500`}),e.trend]})]}),(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full border border-white/5 bg-white/5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,A.jsx)(Ut,{className:`h-4 w-4 text-blue-400`})})]})]}),(0,A.jsx)(`div`,{className:`hive-strip--bottom`})]},e.label))}),(0,A.jsx)(KR,{}),(0,A.jsx)(QR,{}),(0,A.jsxs)(`div`,{className:`grid gap-6 lg:grid-cols-3 mb-8`,children:[(0,A.jsx)(`div`,{className:`lg:col-span-2 hive-card`,children:(0,A.jsxs)(`div`,{className:`hive-card-body !pb-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`hive-title-section`,children:`Actividad del Enjambre`}),(0,A.jsxs)(`p`,{className:`text-[10px] text-white/40 uppercase tracking-widest font-bold`,children:[`Últimas 12 horas · `,s,` mensajes`]})]}),(0,A.jsx)(Bt,{className:`h-5 w-5 text-blue-500 animate-pulse shadow-blue-glow`})]}),(0,A.jsx)(`div`,{className:`h-[280px] w-full`,children:r.length>0?(0,A.jsx)(xS,{width:`100%`,height:`100%`,children:(0,A.jsxs)(bR,{data:r,children:[(0,A.jsx)(`defs`,{children:(0,A.jsxs)(`linearGradient`,{id:`colorCount`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,A.jsx)(`stop`,{offset:`5%`,stopColor:`#3b82f6`,stopOpacity:.2}),(0,A.jsx)(`stop`,{offset:`95%`,stopColor:`#3b82f6`,stopOpacity:0})]})}),(0,A.jsx)(PI,{strokeDasharray:`3 3`,vertical:!1,stroke:`rgba(255,255,255,0.05)`}),(0,A.jsx)(gL,{dataKey:`time`,axisLine:!1,tickLine:!1,tick:{fill:`rgba(255,255,255,0.3)`,fontSize:10,fontWeight:`bold`}}),(0,A.jsx)(TL,{axisLine:!1,tickLine:!1,tick:{fill:`rgba(255,255,255,0.3)`,fontSize:10,fontWeight:`bold`},allowDecimals:!1}),(0,A.jsx)(mS,{contentStyle:{backgroundColor:`#09090b`,borderRadius:`12px`,border:`1px solid rgba(255,255,255,0.1)`,color:`#fff`},itemStyle:{color:`#3b82f6`},formatter:e=>[e,`Mensajes`]}),(0,A.jsx)(sL,{type:`monotone`,dataKey:`count`,stroke:`#3b82f6`,strokeWidth:4,fillOpacity:1,fill:`url(#colorCount)`})]})}):(0,A.jsx)(`div`,{className:`h-full flex items-center justify-center text-white/30 text-sm`,children:`Cargando actividad...`})})]})}),(0,A.jsx)(`div`,{className:`hive-card`,children:(0,A.jsxs)(`div`,{className:`hive-card-body`,children:[(0,A.jsx)(`h3`,{className:`hive-title-section mb-6`,children:`Distribución de Agentes`}),(0,A.jsx)(`div`,{className:`h-[210px]`,children:o.length>0?(0,A.jsx)(xS,{width:`100%`,height:`100%`,children:(0,A.jsxs)(vR,{data:o,layout:`vertical`,children:[(0,A.jsx)(gL,{type:`number`,hide:!0,allowDecimals:!1}),(0,A.jsx)(TL,{dataKey:`name`,type:`category`,axisLine:!1,tickLine:!1,tick:{fill:`rgba(255,255,255,0.5)`,fontSize:10,fontWeight:`bold`},width:70}),(0,A.jsx)(mS,{cursor:{fill:`rgba(255,255,255,0.02)`}}),(0,A.jsx)(aF,{dataKey:`value`,radius:[0,8,8,0],barSize:16,children:o.map(e=>(0,A.jsx)(SS,{fill:e.color},e.name))})]})}):(0,A.jsx)(`div`,{className:`h-full flex items-center justify-center text-white/30 text-sm`,children:`Sin agentes configurados`})}),(0,A.jsxs)(`div`,{className:`mt-4 pt-4 border-t border-white/5 grid grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`Salud Monitor`}),(0,A.jsx)(`span`,{className:`hive-stat__value hive-stat__value--active`,children:`Óptima`})]}),(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`Uptime`}),(0,A.jsx)(`span`,{className:`hive-stat__value hive-stat__value--active`,children:n?.uptime??`—`})]})]})]})})]})]})}var fB={active:{label:`Activo`,className:`bg-hive-connected/15 text-hive-connected border-hive-connected/30`},idle:{label:`Activo`,className:`bg-hive-connected/10 text-hive-connected/80 border-hive-connected/20`},hibernated:{label:`Hibernado`,className:`bg-secondary text-secondary-foreground border-border`},error:{label:`Error`,className:`bg-destructive/15 text-destructive border-destructive/30`},thinking:{label:`Pensando`,className:`bg-hive-thinking/15 text-hive-thinking border-hive-thinking/30 animate-pulse-slow`}};function pB({status:e,className:t}){if(!e||!fB[e])return(0,A.jsxs)(Hz,{variant:`outline`,className:t,children:[(0,A.jsx)(`span`,{className:`mr-1.5 inline-block h-1.5 w-1.5 rounded-full bg-current`}),`Desconocido`]});let n=fB[e];return(0,A.jsxs)(Hz,{variant:`outline`,className:H(n.className,t),children:[(0,A.jsx)(`span`,{className:`mr-1.5 inline-block h-1.5 w-1.5 rounded-full bg-current`}),n.label]})}var mB=u.createContext(void 0);function hB(e){let t=u.useContext(mB);return e||t||`ltr`}var gB=`rovingFocusGroup.onEntryFocus`,_B={bubbles:!1,cancelable:!0},vB=`RovingFocusGroup`,[yB,bB,xB]=ne(vB),[SB,CB]=M(vB,[xB]),[wB,TB]=SB(vB),EB=u.forwardRef((e,t)=>(0,A.jsx)(yB.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,A.jsx)(yB.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,A.jsx)(DB,{...e,ref:t})})}));EB.displayName=vB;var DB=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...f}=e,p=u.useRef(null),m=D(t,p),h=hB(a),[g,_]=ke({prop:o,defaultProp:s??null,onChange:c,caller:vB}),[v,y]=u.useState(!1),b=ie(l),x=bB(n),S=u.useRef(!1),[C,T]=u.useState(0);return u.useEffect(()=>{let e=p.current;if(e)return e.addEventListener(gB,b),()=>e.removeEventListener(gB,b)},[b]),(0,A.jsx)(wB,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:u.useCallback(e=>_(e),[_]),onItemShiftTab:u.useCallback(()=>y(!0),[]),onFocusableItemAdd:u.useCallback(()=>T(e=>e+1),[]),onFocusableItemRemove:u.useCallback(()=>T(e=>e-1),[]),children:(0,A.jsx)(z.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...f,ref:m,style:{outline:`none`,...e.style},onMouseDown:w(e.onMouseDown,()=>{S.current=!0}),onFocus:w(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(gB,_B);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);NB([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),d)}}S.current=!1}),onBlur:w(e.onBlur,()=>y(!1))})})}),OB=`RovingFocusGroupItem`,kB=u.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ia(),l=a||c,d=TB(OB,n),f=d.currentTabStopId===l,p=bB(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=d;return u.useEffect(()=>{if(r)return m(),()=>h()},[r,m,h]),(0,A.jsx)(yB.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,A.jsx)(z.span,{tabIndex:f?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:w(e.onMouseDown,e=>{r?d.onItemFocus(l):e.preventDefault()}),onFocus:w(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:w(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){d.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=MB(e,d.orientation,d.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=p().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=d.loop?PB(n,r+1):n.slice(r+1)}setTimeout(()=>NB(n))}}),children:typeof o==`function`?o({isCurrentTabStop:f,hasTabStop:g!=null}):o})})});kB.displayName=OB;var AB={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function jB(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function MB(e,t,n){let r=jB(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return AB[r]}function NB(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function PB(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var FB=EB,IB=kB,LB=[`Enter`,` `],RB=[`ArrowDown`,`PageUp`,`Home`],zB=[`ArrowUp`,`PageDown`,`End`],BB=[...RB,...zB],VB={ltr:[...LB,`ArrowRight`],rtl:[...LB,`ArrowLeft`]},HB={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},UB=`Menu`,[WB,GB,KB]=ne(UB),[qB,JB]=M(UB,[KB,nc,CB]),YB=nc(),XB=CB(),[ZB,QB]=qB(UB),[$B,eV]=qB(UB),tV=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=YB(t),[c,l]=u.useState(null),d=u.useRef(!1),f=ie(a),p=hB(i);return u.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,A.jsx)(vc,{...s,children:(0,A.jsx)(ZB,{scope:t,open:n,onOpenChange:f,content:c,onContentChange:l,children:(0,A.jsx)($B,{scope:t,onClose:u.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};tV.displayName=UB;var nV=`MenuAnchor`,rV=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=YB(n);return(0,A.jsx)(yc,{...i,...r,ref:t})});rV.displayName=nV;var iV=`MenuPortal`,[aV,oV]=qB(iV,{forceMount:void 0}),sV=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=QB(iV,t);return(0,A.jsx)(aV,{scope:t,forceMount:n,children:(0,A.jsx)(we,{present:n||a.open,children:(0,A.jsx)(Se,{asChild:!0,container:i,children:r})})})};sV.displayName=iV;var cV=`MenuContent`,[lV,uV]=qB(cV),dV=u.forwardRef((e,t)=>{let n=oV(cV,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=QB(cV,e.__scopeMenu),o=eV(cV,e.__scopeMenu);return(0,A.jsx)(WB.Provider,{scope:e.__scopeMenu,children:(0,A.jsx)(we,{present:r||a.open,children:(0,A.jsx)(WB.Slot,{scope:e.__scopeMenu,children:o.modal?(0,A.jsx)(fV,{...i,ref:t}):(0,A.jsx)(pV,{...i,ref:t})})})})}),fV=u.forwardRef((e,t)=>{let n=QB(cV,e.__scopeMenu),r=u.useRef(null),i=D(t,r);return u.useEffect(()=>{let e=r.current;if(e)return nm(e)},[]),(0,A.jsx)(hV,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),pV=u.forwardRef((e,t)=>{let n=QB(cV,e.__scopeMenu);return(0,A.jsx)(hV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),mV=P(`MenuContent.ScrollLock`),hV=u.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,disableOutsideScroll:h,...g}=e,_=QB(cV,n),v=eV(cV,n),y=YB(n),b=XB(n),x=GB(n),[S,C]=u.useState(null),T=u.useRef(null),E=D(t,T,_.onContentChange),O=u.useRef(0),k=u.useRef(``),j=u.useRef(0),M=u.useRef(null),N=u.useRef(`right`),P=u.useRef(0),F=h?Xp:u.Fragment,ee=h?{as:mV,allowPinchZoom:!0}:void 0,I=e=>{let t=k.current+e,n=x().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=$V(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};u.useEffect(()=>()=>window.clearTimeout(O.current),[]),Sp();let L=u.useCallback(e=>N.current===M.current?.side&&tH(e,M.current?.area),[]);return(0,A.jsx)(lV,{scope:n,searchRef:k,onItemEnter:u.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:u.useCallback(e=>{L(e)||(T.current?.focus(),C(null))},[L]),onTriggerLeave:u.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:j,onPointerGraceIntentChange:u.useCallback(e=>{M.current=e},[]),children:(0,A.jsx)(F,{...ee,children:(0,A.jsx)(up,{asChild:!0,trapped:i,onMountAutoFocus:w(a,e=>{e.preventDefault(),T.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,A.jsx)(de,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:p,onDismiss:m,children:(0,A.jsx)(FB,{asChild:!0,...b,dir:v.dir,orientation:`vertical`,loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:w(c,e=>{v.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,A.jsx)(bc,{role:`menu`,"aria-orientation":`vertical`,"data-state":JV(_.open),"data-radix-menu-content":``,dir:v.dir,...y,...g,ref:E,style:{outline:`none`,...g.style},onKeyDown:w(g.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&I(e.key));let i=T.current;if(e.target!==i||!BB.includes(e.key))return;e.preventDefault();let a=x().filter(e=>!e.disabled).map(e=>e.ref.current);zB.includes(e.key)&&a.reverse(),ZV(a)}),onBlur:w(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:w(e.onPointerMove,nH(e=>{let t=e.target,n=P.current!==e.clientX;e.currentTarget.contains(t)&&n&&(N.current=e.clientX>P.current?`right`:`left`,P.current=e.clientX)}))})})})})})})});dV.displayName=cV;var gV=`MenuGroup`,_V=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,A.jsx)(z.div,{role:`group`,...r,ref:t})});_V.displayName=gV;var vV=`MenuLabel`,yV=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,A.jsx)(z.div,{...r,ref:t})});yV.displayName=vV;var bV=`MenuItem`,xV=`menu.itemSelect`,SV=u.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=u.useRef(null),o=eV(bV,e.__scopeMenu),s=uV(bV,e.__scopeMenu),c=D(t,a),l=u.useRef(!1),d=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(xV,{bubbles:!0,cancelable:!0});e.addEventListener(xV,e=>r?.(e),{once:!0}),re(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,A.jsx)(CV,{...i,ref:c,disabled:n,onClick:w(e.onClick,d),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:w(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:w(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||LB.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});SV.displayName=bV;var CV=u.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=uV(bV,n),s=XB(n),c=u.useRef(null),l=D(t,c),[d,f]=u.useState(!1),[p,m]=u.useState(``);return u.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,A.jsx)(WB.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,A.jsx)(IB,{asChild:!0,...s,focusable:!r,children:(0,A.jsx)(z.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:w(e.onPointerMove,nH(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:w(e.onPointerLeave,nH(e=>o.onItemLeave(e))),onFocus:w(e.onFocus,()=>f(!0)),onBlur:w(e.onBlur,()=>f(!1))})})})}),wV=`MenuCheckboxItem`,TV=u.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,A.jsx)(NV,{scope:e.__scopeMenu,checked:n,children:(0,A.jsx)(SV,{role:`menuitemcheckbox`,"aria-checked":YV(n)?`mixed`:n,...i,ref:t,"data-state":XV(n),onSelect:w(i.onSelect,()=>r?.(YV(n)?!0:!n),{checkForDefaultPrevented:!1})})})});TV.displayName=wV;var EV=`MenuRadioGroup`,[DV,OV]=qB(EV,{value:void 0,onValueChange:()=>{}}),kV=u.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=ie(r);return(0,A.jsx)(DV,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,A.jsx)(_V,{...i,ref:t})})});kV.displayName=EV;var AV=`MenuRadioItem`,jV=u.forwardRef((e,t)=>{let{value:n,...r}=e,i=OV(AV,e.__scopeMenu),a=n===i.value;return(0,A.jsx)(NV,{scope:e.__scopeMenu,checked:a,children:(0,A.jsx)(SV,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":XV(a),onSelect:w(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});jV.displayName=AV;var MV=`MenuItemIndicator`,[NV,PV]=qB(MV,{checked:!1}),FV=u.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=PV(MV,n);return(0,A.jsx)(we,{present:r||YV(a.checked)||a.checked===!0,children:(0,A.jsx)(z.span,{...i,ref:t,"data-state":XV(a.checked)})})});FV.displayName=MV;var IV=`MenuSeparator`,LV=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,A.jsx)(z.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});LV.displayName=IV;var RV=`MenuArrow`,zV=u.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=YB(n);return(0,A.jsx)(U,{...i,...r,ref:t})});zV.displayName=RV;var BV=`MenuSub`,[VV,HV]=qB(BV),UV=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=QB(BV,t),o=YB(t),[s,c]=u.useState(null),[l,d]=u.useState(null),f=ie(i);return u.useEffect(()=>(a.open===!1&&f(!1),()=>f(!1)),[a.open,f]),(0,A.jsx)(vc,{...o,children:(0,A.jsx)(ZB,{scope:t,open:r,onOpenChange:f,content:l,onContentChange:d,children:(0,A.jsx)(VV,{scope:t,contentId:Ia(),triggerId:Ia(),trigger:s,onTriggerChange:c,children:n})})})};UV.displayName=BV;var WV=`MenuSubTrigger`,GV=u.forwardRef((e,t)=>{let n=QB(WV,e.__scopeMenu),r=eV(WV,e.__scopeMenu),i=HV(WV,e.__scopeMenu),a=uV(WV,e.__scopeMenu),o=u.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},d=u.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return u.useEffect(()=>d,[d]),u.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,A.jsx)(rV,{asChild:!0,...l,children:(0,A.jsx)(CV,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":JV(n.open),...e,ref:E(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:w(e.onPointerMove,nH(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:w(e.onPointerLeave,nH(e=>{d();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:w(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||VB[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});GV.displayName=WV;var KV=`MenuSubContent`,qV=u.forwardRef((e,t)=>{let n=oV(cV,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=QB(cV,e.__scopeMenu),o=eV(cV,e.__scopeMenu),s=HV(KV,e.__scopeMenu),c=u.useRef(null),l=D(t,c);return(0,A.jsx)(WB.Provider,{scope:e.__scopeMenu,children:(0,A.jsx)(we,{present:r||a.open,children:(0,A.jsx)(WB.Slot,{scope:e.__scopeMenu,children:(0,A.jsx)(hV,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:w(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:w(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:w(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=HB[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});qV.displayName=KV;function JV(e){return e?`open`:`closed`}function YV(e){return e===`indeterminate`}function XV(e){return YV(e)?`indeterminate`:e?`checked`:`unchecked`}function ZV(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function QV(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function $V(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=QV(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function eH(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function tH(e,t){return t?eH({x:e.clientX,y:e.clientY},t):!1}function nH(e){return t=>t.pointerType===`mouse`?e(t):void 0}var rH=tV,iH=rV,aH=sV,oH=dV,sH=_V,cH=yV,lH=SV,uH=TV,dH=kV,fH=jV,pH=FV,mH=LV,hH=zV,gH=UV,_H=GV,vH=qV,yH=`DropdownMenu`,[bH,xfe]=M(yH,[JB]),xH=JB(),[SH,CH]=bH(yH),wH=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=xH(t),l=u.useRef(null),[d,f]=ke({prop:i,defaultProp:a??!1,onChange:o,caller:yH});return(0,A.jsx)(SH,{scope:t,triggerId:Ia(),triggerRef:l,contentId:Ia(),open:d,onOpenChange:f,onOpenToggle:u.useCallback(()=>f(e=>!e),[f]),modal:s,children:(0,A.jsx)(rH,{...c,open:d,onOpenChange:f,dir:r,modal:s,children:n})})};wH.displayName=yH;var TH=`DropdownMenuTrigger`,EH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=CH(TH,n),o=xH(n);return(0,A.jsx)(iH,{asChild:!0,...o,children:(0,A.jsx)(z.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:E(t,a.triggerRef),onPointerDown:w(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:w(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});EH.displayName=TH;var DH=`DropdownMenuPortal`,OH=e=>{let{__scopeDropdownMenu:t,...n}=e,r=xH(t);return(0,A.jsx)(aH,{...r,...n})};OH.displayName=DH;var kH=`DropdownMenuContent`,AH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=CH(kH,n),a=xH(n),o=u.useRef(!1);return(0,A.jsx)(oH,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:w(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(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)`}})});AH.displayName=kH;var jH=`DropdownMenuGroup`,MH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(sH,{...i,...r,ref:t})});MH.displayName=jH;var NH=`DropdownMenuLabel`,PH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(cH,{...i,...r,ref:t})});PH.displayName=NH;var FH=`DropdownMenuItem`,IH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(lH,{...i,...r,ref:t})});IH.displayName=FH;var LH=`DropdownMenuCheckboxItem`,RH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(uH,{...i,...r,ref:t})});RH.displayName=LH;var zH=`DropdownMenuRadioGroup`,BH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(dH,{...i,...r,ref:t})});BH.displayName=zH;var VH=`DropdownMenuRadioItem`,HH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(fH,{...i,...r,ref:t})});HH.displayName=VH;var UH=`DropdownMenuItemIndicator`,WH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(pH,{...i,...r,ref:t})});WH.displayName=UH;var GH=`DropdownMenuSeparator`,KH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(mH,{...i,...r,ref:t})});KH.displayName=GH;var qH=`DropdownMenuArrow`,JH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(hH,{...i,...r,ref:t})});JH.displayName=qH;var YH=`DropdownMenuSubTrigger`,XH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(_H,{...i,...r,ref:t})});XH.displayName=YH;var ZH=`DropdownMenuSubContent`,QH=u.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=xH(n);return(0,A.jsx)(vH,{...i,...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)`}})});QH.displayName=ZH;var $H=wH,eU=EH,tU=OH,nU=AH,rU=PH,iU=IH,aU=RH,oU=HH,sU=WH,cU=KH,lU=XH,uU=QH,dU=$H,fU=eU,pU=u.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,A.jsxs)(lU,{ref:i,className:H(`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,(0,A.jsx)(nn,{className:`ml-auto h-4 w-4`})]}));pU.displayName=lU.displayName;var mU=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(uU,{ref:n,className:H(`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}));mU.displayName=uU.displayName;var hU=u.forwardRef(({className:e,sideOffset:t=4,...n},r)=>(0,A.jsx)(tU,{children:(0,A.jsx)(nU,{ref:r,sideOffset:t,className:H(`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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...n})}));hU.displayName=nU.displayName;var gU=u.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(iU,{ref:r,className:H(`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}));gU.displayName=iU.displayName;var _U=u.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,A.jsxs)(aU,{ref:i,className:H(`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:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(sU,{children:(0,A.jsx)($t,{className:`h-4 w-4`})})}),t]}));_U.displayName=aU.displayName;var vU=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(oU,{ref:r,className:H(`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:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(sU,{children:(0,A.jsx)(dn,{className:`h-2 w-2 fill-current`})})}),t]}));vU.displayName=oU.displayName;var yU=u.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(rU,{ref:r,className:H(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));yU.displayName=rU.displayName;var bU=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(cU,{ref:n,className:H(`-mx-1 my-1 h-px bg-muted`,e),...t}));bU.displayName=cU.displayName;var xU=({className:e,...t})=>(0,A.jsx)(`span`,{className:H(`ml-auto text-xs tracking-widest opacity-60`,e),...t});xU.displayName=`DropdownMenuShortcut`;function SU(e){let 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 CU(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function wU(e,t){let n=SU(e);return isNaN(t)?CU(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function TU(e,t){let n=SU(e);if(isNaN(t))return CU(e,NaN);if(!t)return n;let r=n.getDate(),i=CU(e,n.getTime());return i.setMonth(n.getMonth()+t+1,0),r>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),r),n)}var EU=365.2425,DU=6048e5,OU=864e5,kU=3600*24;kU*7,kU*EU/12*3;var AU={};function jU(){return AU}function MU(e,t){let n=jU(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=SU(e),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function NU(e){return MU(e,{weekStartsOn:1})}function PU(e){let t=SU(e),n=t.getFullYear(),r=CU(e,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let i=NU(r),a=CU(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);let o=NU(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=o.getTime()?n:n-1}function FU(e){let t=SU(e);return t.setHours(0,0,0,0),t}function IU(e){let t=SU(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 LU(e,t){let n=FU(e),r=FU(t),i=+n-IU(n),a=+r-IU(r);return Math.round((i-a)/OU)}function RU(e){let t=PU(e),n=CU(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),NU(n)}function zU(e,t){return wU(e,t*7)}function BU(e,t){return TU(e,t*12)}function VU(e){let t;return e.forEach(function(e){let n=SU(e);(t===void 0||t<n||isNaN(Number(n)))&&(t=n)}),t||new Date(NaN)}function HU(e){let t;return e.forEach(e=>{let n=SU(e);(!t||t>n||isNaN(+n))&&(t=n)}),t||new Date(NaN)}function UU(e,t){let n=FU(e),r=FU(t);return+n==+r}function WU(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function GU(e){if(!WU(e)&&typeof e!=`number`)return!1;let t=SU(e);return!isNaN(Number(t))}function KU(e,t){let n=SU(e),r=SU(t),i=n.getFullYear()-r.getFullYear(),a=n.getMonth()-r.getMonth();return i*12+a}function qU(e,t,n){let r=MU(e,n),i=MU(t,n),a=+r-IU(r),o=+i-IU(i);return Math.round((a-o)/DU)}function JU(e){let t=SU(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function YU(e){let t=SU(e);return t.setDate(1),t.setHours(0,0,0,0),t}function XU(e){let t=SU(e),n=CU(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ZU(e,t){let n=jU(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=SU(e),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function QU(e){return ZU(e,{weekStartsOn:1})}var $U={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`}},eW=(e,t,n)=>{let r,i=$U[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function tW(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var nW={date:tW({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:tW({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:tW({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},rW={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},iW=(e,t,n,r)=>rW[e];function aW(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var oW={ordinalNumber:(e,t)=>{let 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`},era:aW({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:aW({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:aW({values:{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`]},defaultWidth:`wide`}),day:aW({values:{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`]},defaultWidth:`wide`}),dayPeriod:aW({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})};function sW(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?lW(s,e=>e.test(o)):cW(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function cW(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function lW(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function uW(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var dW={code:`en-US`,formatDistance:eW,formatLong:nW,formatRelative:iW,localize:oW,match:{ordinalNumber:uW({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:sW({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:sW({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:sW({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:sW({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:sW({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function fW(e){let t=SU(e);return LU(t,XU(t))+1}function pW(e){let t=SU(e),n=NU(t)-+RU(t);return Math.round(n/DU)+1}function mW(e,t){let n=SU(e),r=n.getFullYear(),i=jU(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=CU(e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=MU(o,t),c=CU(e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=MU(c,t);return n.getTime()>=s.getTime()?r+1:n.getTime()>=l.getTime()?r:r-1}function hW(e,t){let n=jU(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=mW(e,t),a=CU(e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),MU(a,t)}function gW(e,t){let n=SU(e),r=MU(n,t)-+hW(n,t);return Math.round(r/DU)+1}function _W(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var vW={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return _W(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):_W(n+1,2)},d(e,t){return _W(e.getDate(),t.length)},a(e,t){let 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];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return _W(e.getHours()%12||12,t.length)},H(e,t){return _W(e.getHours(),t.length)},m(e,t){return _W(e.getMinutes(),t.length)},s(e,t){return _W(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return _W(Math.trunc(r*10**(n-3)),t.length)}},yW={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},bW={G:function(e,t,n){let 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`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return vW.y(e,t)},Y:function(e,t,n,r){let i=mW(e,r),a=i>0?i:1-i;return t===`YY`?_W(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):_W(a,t.length)},R:function(e,t){return _W(PU(e),t.length)},u:function(e,t){return _W(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return _W(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`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return _W(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`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return vW.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`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return _W(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`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=gW(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):_W(i,t.length)},I:function(e,t,n){let r=pW(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):_W(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):vW.d(e,t)},D:function(e,t,n){let r=fW(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):_W(r,t.length)},E:function(e,t,n){let 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`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return _W(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return _W(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return _W(i,t.length);case`io`:return n.ordinalNumber(i,{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`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?yW.noon:r===0?yW.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?yW.evening:r>=12?yW.afternoon:r>=4?yW.morning:yW.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return vW.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):vW.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):_W(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):_W(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):vW.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):vW.s(e,t)},S:function(e,t){return vW.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return SW(r);case`XXXX`:case`XX`:return CW(r);default:return CW(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return SW(r);case`xxxx`:case`xx`:return CW(r);default:return CW(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+xW(r,`:`);default:return`GMT`+CW(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+xW(r,`:`);default:return`GMT`+CW(r,`:`)}},t:function(e,t,n){return _W(Math.trunc(e.getTime()/1e3),t.length)},T:function(e,t,n){return _W(e.getTime(),t.length)}};function xW(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+_W(a,2)}function SW(e,t){return e%60==0?(e>0?`-`:`+`)+_W(Math.abs(e)/60,2):CW(e,t)}function CW(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=_W(Math.trunc(r/60),2),a=_W(r%60,2);return n+i+t+a}var wW=(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`});default:return t.date({width:`full`})}},TW=(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`});default:return t.time({width:`full`})}},EW={p:TW,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return wW(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,wW(r,t)).replace(`{{time}}`,TW(i,t))}},DW=/^D+$/,OW=/^Y+$/,kW=[`D`,`DD`,`YY`,`YYYY`];function AW(e){return DW.test(e)}function jW(e){return OW.test(e)}function MW(e,t,n){let r=NW(e,t,n);if(console.warn(r),kW.includes(e))throw RangeError(r)}function NW(e,t,n){let 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`}var PW=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,FW=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IW=/^'([^]*?)'?$/,LW=/''/g,RW=/[a-zA-Z]/;function zW(e,t,n){let r=jU(),i=n?.locale??r.locale??dW,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=SU(e);if(!GU(s))throw RangeError(`Invalid time value`);let c=t.match(FW).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=EW[t];return n(e,i.formatLong)}return e}).join(``).match(PW).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:BW(e)};if(bW[t])return{isToken:!0,value:e};if(t.match(RW))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&jW(a)||!n?.useAdditionalDayOfYearTokens&&AW(a))&&MW(a,t,String(e));let o=bW[a[0]];return o(s,a,i.localize,l)}).join(``)}function BW(e){let t=e.match(IW);return t?t[1].replace(LW,`'`):e}function VW(e){let t=SU(e),n=t.getFullYear(),r=t.getMonth(),i=CU(e,0);return i.setFullYear(n,r+1,0),i.setHours(0,0,0,0),i.getDate()}function HW(e){return Math.trunc(SU(e)/1e3)}function UW(e){let t=SU(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}function WW(e,t){return qU(UW(e),YU(e),t)+1}function GW(e,t){let n=SU(e),r=SU(t);return n.getTime()>r.getTime()}function KW(e,t){let n=SU(e),r=SU(t);return+n<+r}function qW(e,t){let n=SU(e),r=SU(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function JW(e,t){let n=SU(e),r=SU(t);return n.getFullYear()===r.getFullYear()}function YW(e,t){return wU(e,-t)}function XW(e,t){let n=SU(e),r=n.getFullYear(),i=n.getDate(),a=CU(e,0);a.setFullYear(r,t,15),a.setHours(0,0,0,0);let o=VW(a);return n.setMonth(t,Math.min(i,o)),n}function ZW(e,t){let n=SU(e);return isNaN(+n)?CU(e,NaN):(n.setFullYear(t),n)}var QW={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`}},$W=(e,t,n)=>{let r,i=QW[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`en `+r:`hace `+r:r},eG={date:tW({formats:{full:`EEEE, d 'de' MMMM 'de' y`,long:`d 'de' MMMM 'de' y`,medium:`d MMM y`,short:`dd/MM/y`},defaultWidth:`full`}),time:tW({formats:{full:`HH:mm:ss zzzz`,long:`HH:mm:ss z`,medium:`HH:mm:ss`,short:`HH:mm`},defaultWidth:`full`}),dateTime:tW({formats:{full:`{{date}} 'a las' {{time}}`,long:`{{date}} 'a las' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},tG={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`},nG={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`},rG={code:`es`,formatDistance:$W,formatLong:eG,formatRelative:(e,t,n,r)=>t.getHours()===1?tG[e]:nG[e],localize:{ordinalNumber:(e,t)=>Number(e)+`º`,era:aW({values:{narrow:[`AC`,`DC`],abbreviated:[`AC`,`DC`],wide:[`antes de cristo`,`después de cristo`]},defaultWidth:`wide`}),quarter:aW({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`T1`,`T2`,`T3`,`T4`],wide:[`1º trimestre`,`2º trimestre`,`3º trimestre`,`4º trimestre`]},defaultWidth:`wide`,argumentCallback:e=>Number(e)-1}),month:aW({values:{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`]},defaultWidth:`wide`}),day:aW({values:{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`]},defaultWidth:`wide`}),dayPeriod:aW({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})},match:{ordinalNumber:uW({matchPattern:/^(\d+)(º)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:sW({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),quarter:sW({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:sW({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:sW({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:sW({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},options:{weekStartsOn:1,firstWeekContainsDate:1}};function iG({agent:e,onEdit:t}){let n=Fd(),{deleteAgent:r}=MR(),{providers:i}=AR(),{models:a}=jR(),o=t=>{t.target.closest(`[role="menuitem"]`)||t.target.closest(`button`)||n(`/agents/${e.id}`)},s=async t=>{if(t.stopPropagation(),(await eg.fire({title:`¿Eliminar Agente?`,text:`¿Estás seguro de que deseas eliminar al agente "${e.name}"? Esta acción eliminará permanentemente su configuración.`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, eliminar`,cancelButtonText:`Cancelar`,reverseButtons:!0,background:`#09090b`,color:`#fff`,customClass:{popup:`border border-white/10 rounded-xl`,confirmButton:`bg-red-500 hover:bg-red-600 text-white`,cancelButton:`bg-white/10 hover:bg-white/20 text-white`}})).isConfirmed)try{await r(e.id)}catch(e){console.error(e)}},c=e.role===`coordinator`,l=e.provider_id||e.providerId,u=e.model_id||e.modelId,d=i.find(e=>e.id===l)?.name||l,f=a.find(e=>e.id===u)?.name||u,p=e.enabled?e.status:`hibernated`,m=e.toolsJson?JSON.parse(e.toolsJson):[],h=e.skillsJson?JSON.parse(e.skillsJson):[],g=m.length||0,_=h.length||0,v=!!e.systemPrompt,y=e.maxIterations||10,b=(e=>{if(!e)return null;try{return zW(new Date(e),`dd MMM yyyy`,{locale:rG})}catch{return null}})(e.created_at||e.createdAt);return(0,A.jsxs)(`div`,{role:`button`,tabIndex:0,className:`group relative overflow-hidden rounded-2xl border bg-black/40 backdrop-blur-xl transition-all duration-500 cursor-pointer flex flex-col h-full
199
+ ${e.enabled?c?`border-purple-500/20 hover:border-purple-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(168,85,247,0.15)]`:`border-white/10 hover:border-blue-500/50 hover:bg-white/[0.03] hover:shadow-[0_0_30px_rgba(59,130,246,0.15)]`:`border-white/5 opacity-70 grayscale hover:grayscale-0`}
200
+ `,onClick:o,onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&n(`/agents/${e.id}`)},children:[e.enabled&&(0,A.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent ${c?`via-purple-500/60`:`via-blue-500/50`} to-transparent`}),e.enabled&&(0,A.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-br ${c?`from-purple-500/10 via-transparent to-blue-500/5`:`from-blue-500/10 via-transparent to-purple-500/10`} opacity-0 transition-opacity duration-500 group-hover:opacity-100 pointer-events-none`}),(0,A.jsxs)(`div`,{className:`p-5 flex flex-col flex-1 relative z-10`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3 mb-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`w-11 h-11 rounded-xl flex items-center justify-center shrink-0 border transition-colors
201
+ ${c?`bg-purple-500/10 border-purple-500/20 group-hover:border-purple-500/40`:`bg-blue-500/10 border-blue-500/20 group-hover:border-blue-500/40`}`,children:c?(0,A.jsx)(Tr,{className:`h-5 w-5 text-purple-400`}):(0,A.jsx)(gn,{className:`h-5 w-5 text-blue-400`})}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsx)(`h3`,{className:`text-base font-bold tracking-tight transition-colors truncate ${e.enabled?`text-white/95 group-hover:text-white`:`text-white/40`}`,children:e.name}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-0.5 flex-wrap`,children:[(0,A.jsx)(`span`,{className:`text-[9px] px-2 py-0.5 rounded-full font-bold uppercase border
202
+ ${c?`bg-purple-500/10 text-purple-400 border-purple-500/20`:`bg-blue-500/10 text-blue-400 border-blue-500/20`}`,children:c?`Coordinador`:`Worker`}),e.hasHeaders&&(0,A.jsx)(`span`,{title:`Credenciales Mapeadas`,className:`flex items-center justify-center p-0.5 rounded bg-emerald-500/10 border border-emerald-500/20`,children:(0,A.jsx)(Zn,{className:`h-2.5 w-2.5 text-emerald-400`})}),e.parentId&&(0,A.jsx)(`span`,{title:`Sub-agente`,className:`flex items-center justify-center p-0.5 rounded bg-amber-500/10 border border-amber-500/20`,children:(0,A.jsx)(Nn,{className:`h-2.5 w-2.5 text-amber-400`})})]})]})]}),(0,A.jsxs)(`div`,{className:`flex flex-col items-end gap-2 shrink-0`,children:[(0,A.jsx)(pB,{status:p}),(0,A.jsxs)(dU,{children:[(0,A.jsx)(fU,{asChild:!0,children:(0,A.jsx)(W,{variant:`ghost`,size:`icon`,className:`h-8 w-8 text-white/40 hover:text-white hover:bg-white/10 rounded-full transition-colors`,children:(0,A.jsx)(Cn,{className:`h-4 w-4`})})}),(0,A.jsxs)(hU,{align:`end`,className:`w-48 bg-black/90 backdrop-blur-xl border-white/10 text-white p-1 rounded-xl shadow-2xl`,children:[(0,A.jsxs)(gU,{onClick:()=>t?.(e),className:`gap-2 cursor-pointer focus:bg-white/10 focus:text-white rounded-lg px-3 py-2 text-sm transition-colors`,children:[(0,A.jsx)(or,{className:`h-4 w-4 text-blue-400`}),(0,A.jsx)(`span`,{children:`Editar Configuración`})]}),(0,A.jsxs)(gU,{onClick:s,className:`gap-2 cursor-pointer focus:bg-red-500/20 focus:text-red-400 rounded-lg px-3 py-2 text-sm text-red-400 transition-colors`,children:[(0,A.jsx)(Nr,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{children:`Eliminar Agente`})]})]})]})]})]}),(0,A.jsx)(`p`,{className:`text-xs text-white/50 line-clamp-2 leading-relaxed font-light mb-1`,children:e.description||`Sin descripción`}),(0,A.jsxs)(`div`,{className:`mt-5 flex flex-wrap gap-2`,children:[l&&(0,A.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
203
+ ${e.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,children:[(0,A.jsx)(gn,{className:`h-3 w-3`}),d]}),u&&(0,A.jsx)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium tracking-wider border backdrop-blur-md transition-colors truncate max-w-[120px]
204
+ ${e.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,title:f,children:f}),e.tone&&(0,A.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
205
+ ${e.enabled?`bg-white/5 border-white/10 text-white/80 group-hover:bg-white/10 group-hover:border-white/20`:`bg-transparent border-white/5 text-white/30`}`,children:[(0,A.jsx)(Bt,{className:`h-3 w-3`}),e.tone]}),e.workspace&&(0,A.jsxs)(`div`,{className:`px-2.5 py-1 rounded-md text-[10px] font-medium uppercase tracking-wider flex items-center gap-1.5 border backdrop-blur-md transition-colors
206
+ ${e.enabled?`bg-emerald-500/5 border-emerald-500/20 text-emerald-300 group-hover:bg-emerald-500/10 group-hover:border-emerald-500/30`:`bg-transparent border-white/5 text-white/30`}`,title:`Workspace: ${e.workspace}`,children:[(0,A.jsx)(jn,{className:`h-3 w-3`}),(0,A.jsx)(`span`,{className:`truncate max-w-[100px]`,children:`Workspace`})]})]}),(0,A.jsxs)(`div`,{className:`mt-6 pt-5 border-t border-white/5 grid grid-cols-4 gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,A.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,A.jsx)(Hr,{className:`h-3 w-3 text-emerald-400/70`}),`Tools`]}),(0,A.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:g})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,A.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,A.jsx)(Wr,{className:`h-3 w-3 text-amber-400/70`}),`Skills`]}),(0,A.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:_})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,A.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,A.jsx)(On,{className:`h-3 w-3 text-blue-400/70`}),`Prompt`]}),(0,A.jsx)(`span`,{className:`text-sm font-bold ${e.enabled?v?`text-emerald-400`:`text-white/30`:`text-white/20`}`,children:v?`✓`:`—`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 items-start bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,A.jsxs)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-white/40 flex items-center gap-1.5`,children:[(0,A.jsx)(Mn,{className:`h-3 w-3 text-purple-400/70`}),`Iters`]}),(0,A.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:y})]})]}),e.systemPrompt&&(0,A.jsxs)(`div`,{className:`mt-3 bg-white/[0.02] rounded-lg p-3 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,A.jsxs)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase mb-1.5 flex items-center gap-1.5`,children:[(0,A.jsx)(On,{className:`h-3 w-3 text-blue-400/70`}),`System Prompt`]}),(0,A.jsxs)(`p`,{className:`text-xs text-white/60 font-mono line-clamp-2 leading-relaxed italic`,children:[`"`,e.systemPrompt,`"`]})]}),(0,A.jsxs)(`div`,{className:`mt-3 grid grid-cols-2 gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,A.jsx)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase`,children:`Tareas`}),(0,A.jsx)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-white/90`:`text-white/30`}`,children:e.taskCount||0})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between bg-white/[0.02] rounded-lg p-2.5 border border-white/5 group-hover:border-white/10 transition-colors`,children:[(0,A.jsx)(`span`,{className:`text-[10px] font-medium tracking-wider text-white/40 uppercase`,children:`Éxito`}),(0,A.jsxs)(`span`,{className:`text-sm font-semibold font-mono ${e.enabled?`text-emerald-400/90`:`text-white/30`}`,children:[e.successRate||0,`%`]})]})]}),(0,A.jsxs)(`div`,{className:`mt-auto pt-5 flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`h-2 w-2 rounded-full ${e.enabled?`bg-blue-400 shadow-[0_0_8px_rgba(96,165,250,0.8)] animate-pulse`:`bg-white/20`}`}),(0,A.jsx)(`span`,{className:`text-[10px] font-bold tracking-widest uppercase ${e.enabled?`text-blue-400`:`text-white/30`}`,children:e.enabled?`ACTIVO`:`INACTIVO`})]}),b&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] text-white/30 font-medium tracking-wider pl-3 border-l border-white/10`,children:[(0,A.jsx)(Zt,{className:`h-3 w-3`}),b]})]}),(0,A.jsxs)(`div`,{className:`text-xs font-semibold tracking-wide flex items-center gap-1.5 transition-all
207
+ ${e.enabled?`text-white/70 group-hover:text-blue-400 translate-x-1 group-hover:translate-x-0`:`text-white/20`}`,children:[`INGRESAR`,(0,A.jsx)(`span`,{className:`transition-transform group-hover:translate-x-1 opacity-0 group-hover:opacity-100 hidden sm:inline-block`,children:`→`})]})]})]})]})}function aG({agents:e,onEdit:t}){return e.length===0?(0,A.jsxs)(`div`,{className:`hive-empty-state`,children:[(0,A.jsx)(`div`,{className:`p-4 rounded-full bg-white/5 mb-4`,children:(0,A.jsx)(`div`,{className:`h-10 w-10 border-2 border-dashed border-white/20 rounded-full`})}),(0,A.jsx)(`p`,{className:`hive-label uppercase`,children:`No se detectaron nodos activos`}),(0,A.jsx)(`p`,{className:`text-xs text-white/20 mt-1`,children:`Comienza desplegando un nuevo agente en tu red.`})]}):(0,A.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 lg:grid-cols-3 pb-20`,children:e.map(e=>(0,A.jsx)(iG,{agent:e,onEdit:t},e.id))})}var oG=`Label`,sG=u.forwardRef((e,t)=>(0,A.jsx)(Qf.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));sG.displayName=oG;var cG=sG,lG=Ft(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Z=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(cG,{ref:n,className:H(lG(),e),...t}));Z.displayName=cG.displayName;var uG=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`textarea`,{className:H(`flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-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}));uG.displayName=`Textarea`;function dG(e,[t,n]){return Math.min(n,Math.max(t,e))}function fG(e){let t=u.useRef({value:e,previous:e});return u.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var pG=[` `,`Enter`,`ArrowUp`,`ArrowDown`],mG=[` `,`Enter`],hG=`Select`,[gG,_G,vG]=ne(hG),[yG,Sfe]=M(hG,[vG,nc]),bG=nc(),[xG,SG]=yG(hG),[CG,wG]=yG(hG),TG=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:d,autoComplete:f,disabled:p,required:m,form:h}=e,g=bG(t),[_,v]=u.useState(null),[y,b]=u.useState(null),[x,S]=u.useState(!1),C=hB(l),[w,T]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:hG}),[E,D]=ke({prop:o,defaultProp:s,onChange:c,caller:hG}),O=u.useRef(null),k=_?h||!!_.closest(`form`):!0,[j,M]=u.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,A.jsx)(vc,{...g,children:(0,A.jsxs)(xG,{required:m,scope:t,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Ia(),value:E,onValueChange:D,open:w,onOpenChange:T,dir:C,triggerPointerDownPosRef:O,disabled:p,children:[(0,A.jsx)(gG.Provider,{scope:t,children:(0,A.jsx)(CG,{scope:e.__scopeSelect,onNativeOptionAdd:u.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:u.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),k?(0,A.jsxs)(bK,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:E,onChange:e=>D(e.target.value),disabled:p,form:h,children:[E===void 0?(0,A.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};TG.displayName=hG;var EG=`SelectTrigger`,DG=u.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=bG(n),o=SG(EG,n),s=o.disabled||r,c=D(t,o.onTriggerChange),l=_G(n),d=u.useRef(`touch`),[f,p,m]=SK(e=>{let t=l().filter(e=>!e.disabled),n=CK(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),h=e=>{s||(o.onOpenChange(!0),m()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,A.jsx)(yc,{asChild:!0,...a,children:(0,A.jsx)(z.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:s,"data-disabled":s?``:void 0,"data-placeholder":xK(o.value)?``:void 0,...i,ref:c,onClick:w(i.onClick,e=>{e.currentTarget.focus(),d.current!==`mouse`&&h(e)}),onPointerDown:w(i.onPointerDown,e=>{d.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:w(i.onKeyDown,e=>{let t=f.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&p(e.key),!(t&&e.key===` `)&&pG.includes(e.key)&&(h(),e.preventDefault())})})})});DG.displayName=EG;var OG=`SelectValue`,kG=u.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=SG(OG,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=D(t,c.onValueNodeChange);return be(()=>{l(u)},[l,u]),(0,A.jsx)(z.span,{...s,ref:d,style:{pointerEvents:`none`},children:xK(c.value)?(0,A.jsx)(A.Fragment,{children:o}):a})});kG.displayName=OG;var AG=`SelectIcon`,jG=u.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,A.jsx)(z.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});jG.displayName=AG;var MG=`SelectPortal`,NG=e=>(0,A.jsx)(Se,{asChild:!0,...e});NG.displayName=MG;var PG=`SelectContent`,FG=u.forwardRef((e,t)=>{let n=SG(PG,e.__scopeSelect),[r,i]=u.useState();if(be(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?C.createPortal((0,A.jsx)(LG,{scope:e.__scopeSelect,children:(0,A.jsx)(gG.Slot,{scope:e.__scopeSelect,children:(0,A.jsx)(`div`,{children:e.children})})}),t):null}return(0,A.jsx)(VG,{...e,ref:t})});FG.displayName=PG;var IG=10,[LG,RG]=yG(PG),zG=`SelectContentImpl`,BG=P(`SelectContent.RemoveScroll`),VG=u.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_,...v}=e,y=SG(PG,n),[b,x]=u.useState(null),[S,C]=u.useState(null),T=D(t,e=>x(e)),[E,O]=u.useState(null),[k,j]=u.useState(null),M=_G(n),[N,P]=u.useState(!1),F=u.useRef(!1);u.useEffect(()=>{if(b)return nm(b)},[b]),Sp();let ee=u.useCallback(e=>{let[t,...n]=M().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[M,S]),I=u.useCallback(()=>ee([E,b]),[ee,E,b]);u.useEffect(()=>{N&&I()},[N,I]);let{onOpenChange:L,triggerPointerDownPosRef:R}=y;u.useEffect(()=>{if(b){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():b.contains(n.target)||L(!1),document.removeEventListener(`pointermove`,t),R.current=null};return R.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,L,R]),u.useEffect(()=>{let e=()=>L(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[L]);let[te,ne]=SK(e=>{let t=M().filter(e=>!e.disabled),n=CK(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),z=u.useCallback((e,t,n)=>{let r=!F.current&&!n;(y.value!==void 0&&y.value===t||r)&&(O(e),r&&(F.current=!0))},[y.value]),re=u.useCallback(()=>b?.focus(),[b]),ie=u.useCallback((e,t,n)=>{let r=!F.current&&!n;(y.value!==void 0&&y.value===t||r)&&j(e)},[y.value]),ae=r===`popper`?GG:UG,oe=ae===GG?{side:s,sideOffset:c,align:l,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:_}:{};return(0,A.jsx)(LG,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:z,selectedItem:E,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:I,selectedItemText:k,position:r,isPositioned:N,searchRef:te,children:(0,A.jsx)(Xp,{as:BG,allowPinchZoom:!0,children:(0,A.jsx)(up,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:w(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,A.jsx)(de,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,A.jsx)(ae,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...oe,onPlaced:()=>P(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:w(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ne(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=M().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>ee(t)),e.preventDefault()}})})})})})})});VG.displayName=zG;var HG=`SelectItemAlignedPosition`,UG=u.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=SG(PG,n),o=RG(PG,n),[s,c]=u.useState(null),[l,d]=u.useState(null),f=D(t,e=>d(e)),p=_G(n),m=u.useRef(!1),h=u.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=u.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&g&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-IG,d=dG(a,[IG,Math.max(IG,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-IG,d=dG(a,[IG,Math.max(IG,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=p(),c=window.innerHeight-IG*2,u=g.scrollHeight,d=window.getComputedStyle(l),f=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=f+h+u+b+y,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-IG,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=f+h+k,j=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+g.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${IG}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,s,l,g,_,v,a.dir,r]);be(()=>b(),[b]);let[x,S]=u.useState();return be(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]),(0,A.jsx)(KG,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:m,onScrollButtonChange:u.useCallback(e=>{e&&h.current===!0&&(b(),y?.(),h.current=!1)},[b,y]),children:(0,A.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,A.jsx)(z.div,{...i,ref:f,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});UG.displayName=HG;var WG=`SelectPopperPosition`,GG=u.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=IG,...a}=e,o=bG(n);return(0,A.jsx)(bc,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.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)`}})});GG.displayName=WG;var[KG,qG]=yG(PG,{}),JG=`SelectViewport`,YG=u.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=RG(JG,n),o=qG(JG,n),s=D(t,a.onViewportChange),c=u.useRef(0);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,A.jsx)(gG.Slot,{scope:n,children:(0,A.jsx)(z.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:w(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-IG*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});YG.displayName=JG;var XG=`SelectGroup`,[ZG,QG]=yG(XG),$G=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ia();return(0,A.jsx)(ZG,{scope:n,id:i,children:(0,A.jsx)(z.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});$G.displayName=XG;var eK=`SelectLabel`,tK=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=QG(eK,n);return(0,A.jsx)(z.div,{id:i.id,...r,ref:t})});tK.displayName=eK;var nK=`SelectItem`,[rK,iK]=yG(nK),aK=u.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=SG(nK,n),c=RG(nK,n),l=s.value===r,[d,f]=u.useState(a??``),[p,m]=u.useState(!1),h=D(t,e=>c.itemRefCallback?.(e,r,i)),g=Ia(),_=u.useRef(`touch`),v=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw 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(0,A.jsx)(rK,{scope:n,value:r,disabled:i,textId:g,isSelected:l,onItemTextChange:u.useCallback(e=>{f(t=>t||(e?.textContent??``).trim())},[]),children:(0,A.jsx)(gG.ItemSlot,{scope:n,value:r,disabled:i,textValue:d,children:(0,A.jsx)(z.div,{role:`option`,"aria-labelledby":g,"data-highlighted":p?``:void 0,"aria-selected":l&&p,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:w(o.onFocus,()=>m(!0)),onBlur:w(o.onBlur,()=>m(!1)),onClick:w(o.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:w(o.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:w(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:w(o.onPointerMove,e=>{_.current=e.pointerType,i?c.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:w(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:w(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(mG.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})});aK.displayName=nK;var oK=`SelectItemText`,sK=u.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=SG(oK,n),s=RG(oK,n),c=iK(oK,n),l=wG(oK,n),[d,f]=u.useState(null),p=D(t,e=>f(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),m=d?.textContent,h=u.useMemo(()=>(0,A.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return be(()=>(g(h),()=>_(h)),[g,_,h]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(z.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?C.createPortal(a.children,o.valueNode):null]})});sK.displayName=oK;var cK=`SelectItemIndicator`,lK=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return iK(cK,n).isSelected?(0,A.jsx)(z.span,{"aria-hidden":!0,...r,ref:t}):null});lK.displayName=cK;var uK=`SelectScrollUpButton`,dK=u.forwardRef((e,t)=>{let n=RG(uK,e.__scopeSelect),r=qG(uK,e.__scopeSelect),[i,a]=u.useState(!1),o=D(t,r.onScrollButtonChange);return be(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,A.jsx)(mK,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});dK.displayName=uK;var fK=`SelectScrollDownButton`,pK=u.forwardRef((e,t)=>{let n=RG(fK,e.__scopeSelect),r=qG(fK,e.__scopeSelect),[i,a]=u.useState(!1),o=D(t,r.onScrollButtonChange);return be(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,A.jsx)(mK,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});pK.displayName=fK;var mK=u.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=RG(`SelectScrollButton`,n),o=u.useRef(null),s=_G(n),c=u.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return u.useEffect(()=>()=>c(),[c]),be(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,A.jsx)(z.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:w(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:w(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:w(i.onPointerLeave,()=>{c()})})}),hK=`SelectSeparator`,gK=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,A.jsx)(z.div,{"aria-hidden":!0,...r,ref:t})});gK.displayName=hK;var _K=`SelectArrow`,vK=u.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=bG(n),a=SG(_K,n),o=RG(_K,n);return a.open&&o.position===`popper`?(0,A.jsx)(U,{...i,...r,ref:t}):null});vK.displayName=_K;var yK=`SelectBubbleInput`,bK=u.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=u.useRef(null),a=D(r,i),o=fG(t);return u.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,A.jsx)(z.select,{...n,style:{...Me,...n.style},ref:a,defaultValue:t})});bK.displayName=yK;function xK(e){return e===``||e===void 0}function SK(e){let t=ie(e),n=u.useRef(``),r=u.useRef(0),i=u.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=u.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function CK(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=wK(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function wK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var TK=TG,EK=DG,DK=kG,OK=jG,kK=NG,AK=FG,jK=YG,MK=$G,NK=tK,PK=aK,FK=sK,IK=lK,LK=dK,RK=pK,zK=gK,BK=TK,VK=MK,HK=DK,UK=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(EK,{ref:r,className:H(`flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-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,(0,A.jsx)(OK,{asChild:!0,children:(0,A.jsx)(en,{className:`h-4 w-4 opacity-50`})})]}));UK.displayName=EK.displayName;var WK=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(LK,{ref:n,className:H(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,A.jsx)(rn,{className:`h-4 w-4`})}));WK.displayName=LK.displayName;var GK=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(RK,{ref:n,className:H(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,A.jsx)(en,{className:`h-4 w-4`})}));GK.displayName=RK.displayName;var KK=u.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,A.jsx)(kK,{children:(0,A.jsxs)(AK,{ref:i,className:H(`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:[(0,A.jsx)(WK,{}),(0,A.jsx)(jK,{className:H(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,A.jsx)(GK,{})]})}));KK.displayName=AK.displayName;var qK=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(NK,{ref:n,className:H(`py-1.5 pl-8 pr-2 text-sm font-semibold`,e),...t}));qK.displayName=NK.displayName;var Q=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(PK,{ref:r,className:H(`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:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(IK,{children:(0,A.jsx)($t,{className:`h-4 w-4`})})}),(0,A.jsx)(FK,{children:t})]}));Q.displayName=PK.displayName;var JK=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(zK,{ref:n,className:H(`-mx-1 my-1 h-px bg-muted`,e),...t}));JK.displayName=zK.displayName;var YK=`Switch`,[XK,Cfe]=M(YK),[ZK,QK]=XK(YK),$K=u.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:l,form:d,...f}=e,[p,m]=u.useState(null),h=D(t,e=>m(e)),g=u.useRef(!1),_=p?d||!!p.closest(`form`):!0,[v,y]=ke({prop:i,defaultProp:a??!1,onChange:l,caller:YK});return(0,A.jsxs)(ZK,{scope:n,checked:v,disabled:s,children:[(0,A.jsx)(z.button,{type:`button`,role:`switch`,"aria-checked":v,"aria-required":o,"data-state":iq(v),"data-disabled":s?``:void 0,disabled:s,value:c,...f,ref:h,onClick:w(e.onClick,e=>{y(e=>!e),_&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),_&&(0,A.jsx)(rq,{control:p,bubbles:!g.current,name:r,value:c,checked:v,required:o,disabled:s,form:d,style:{transform:`translateX(-100%)`}})]})});$K.displayName=YK;var eq=`SwitchThumb`,tq=u.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=QK(eq,n);return(0,A.jsx)(z.span,{"data-state":iq(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});tq.displayName=eq;var nq=`SwitchBubbleInput`,rq=u.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=u.useRef(null),s=D(o,a),c=fG(n),l=$s(t);return u.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,A.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});rq.displayName=nq;function iq(e){return e?`checked`:`unchecked`}var aq=$K,oq=tq,sq=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(aq,{className:H(`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:(0,A.jsx)(oq,{className:H(`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`)})}));sq.displayName=aq.displayName;var cq=Mm,lq=Nm,uq=Pm,dq=zm,fq=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Fm,{ref:n,className:H(`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}));fq.displayName=Fm.displayName;var pq=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(uq,{children:[(0,A.jsx)(fq,{className:`z-[9999]`}),(0,A.jsxs)(Im,{ref:r,className:H(`fixed left-[50%] top-[50%] z-[10000] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg`,e),...n,children:[t,(0,A.jsxs)(zm,{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:[(0,A.jsx)(Ur,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));pq.displayName=Im.displayName;var mq=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});mq.displayName=`DialogHeader`;var hq=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});hq.displayName=`DialogFooter`;var gq=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Lm,{ref:n,className:H(`text-lg font-semibold leading-none tracking-tight`,e),...t}));gq.displayName=Lm.displayName;var _q=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Rm,{ref:n,className:H(`text-sm text-muted-foreground`,e),...t}));_q.displayName=Rm.displayName;function vq({selectedProviderId:e,selectedModelId:t,onProviderChange:n,onModelChange:r,disabled:i=!1}){let{activeProviders:a,getModelsByProvider:o}=AR(),s=(0,u.useMemo)(()=>e?o(e):[],[e,o]);(0,u.useEffect)(()=>{t&&s.length>0&&!s.find(e=>e.id===t)&&r(``)},[s,t,r]);let c=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}};return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`provider`,children:`Proveedor de IA`}),(0,A.jsxs)(BK,{value:e||``,onValueChange:n,disabled:i||a.length===0,children:[(0,A.jsx)(UK,{id:`provider`,className:`w-full`,children:(0,A.jsx)(HK,{placeholder:`Selecciona un proveedor`})}),(0,A.jsx)(KK,{children:a.length===0?(0,A.jsx)(Q,{value:`none`,disabled:!0,children:`No hay proveedores configurados`}):a.map(e=>(0,A.jsx)(Q,{value:e.id,children:e.name},e.id))})]}),a.length===0&&(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Configura un proveedor en`,` `,(0,A.jsx)(`a`,{href:`/providers`,className:`text-primary underline`,children:`Settings > Providers`})]})]}),e&&(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`model`,children:`Modelo`}),(0,A.jsxs)(BK,{value:t||``,onValueChange:r,disabled:i||s.length===0,children:[(0,A.jsx)(UK,{id:`model`,className:`w-full`,children:(0,A.jsx)(HK,{placeholder:`Selecciona un modelo`})}),(0,A.jsx)(KK,{children:s.length===0?(0,A.jsx)(Q,{value:`none`,disabled:!0,children:`No hay modelos disponibles`}):s.map(e=>(0,A.jsx)(Q,{value:e.id,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{children:e.name}),e.contextWindow&&(0,A.jsxs)(Hz,{variant:`secondary`,className:`text-[10px]`,children:[(e.contextWindow/1e3).toFixed(0),`K ctx`]})]})},e.id))})]}),t&&s.find(e=>e.id===t)&&(0,A.jsx)(zR,{className:`mt-2`,children:(0,A.jsxs)(UR,{className:`p-3 space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium`,children:s.find(e=>e.id===t)?.name}),(0,A.jsx)(Hz,{variant:`outline`,children:a.find(t=>t.id===e)?.name})]}),(()=>{let e=c(s.find(e=>e.id===t)?.capabilities);return e.length>0?(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.slice(0,5).map(e=>(0,A.jsx)(Hz,{variant:`secondary`,className:`text-[10px]`,children:e},e))}):null})()]})})]})]})}var yq=[{value:`friendly`,label:`Amigable`},{value:`professional`,label:`Profesional`},{value:`casual`,label:`Casual`},{value:`formal`,label:`Formal`},{value:`creative`,label:`Creativo`}];function bq({initialData:e,onSuccess:t,onCancel:n}){let{createAgent:r,updateAgent:i,isLoading:a,error:o}=MR(),{activeProviders:s}=AR(),[c,l]=(0,u.useState)({isValidating:!1,exists:!1,accessible:!1}),[d,f]=(0,u.useState)({name:``,description:``,tone:`professional`,provider_id:``,model_id:``,role:`coordinator`,enabled:!0,systemPrompt:``,workspace:e?.workspace||``});(0,u.useEffect)(()=>{e&&f({...e})},[e]);let p=async e=>{if(!e||e.trim()===``){l({isValidating:!1,exists:!1,accessible:!1});return}l({isValidating:!0,exists:!1,accessible:!1});try{let t=await K(`/api/workspace/validate`,{method:`POST`,body:{path:e}});l({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){l({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},m=async()=>{if(d.workspace)try{await K(`/api/workspace/create`,{method:`POST`,body:{path:d.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await p(d.workspace)}catch(e){eg.fire(`Error`,e.message,`error`)}},h=async()=>{if(d.workspace)try{await K(`/api/workspace/open?path=${encodeURIComponent(d.workspace)}`,{method:`GET`})}catch(e){eg.fire(`Error`,e.message,`error`)}},g=async n=>{if(n.preventDefault(),!d.provider_id||!d.model_id){eg.fire(`Incompleto`,`Por favor selecciona un proveedor y modelo`,`warning`);return}try{e?.id?await i(e.id,d):await r(d),t&&t()}catch(e){console.error(e)}},_=!!e?.id;return(0,A.jsxs)(zR,{className:`hive-card--form group`,children:[(0,A.jsx)(`div`,{className:`hive-glow-blob--card absolute -top-24 -right-24 h-48 w-48 bg-blue-600/10 group-hover:bg-blue-600/20`,style:{borderRadius:`50%`,filter:`blur(80px)`}}),(0,A.jsx)(BR,{className:`relative`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:_?(0,A.jsx)(mr,{className:`h-5 w-5`}):(0,A.jsx)(Dr,{className:`h-5 w-5`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(VR,{className:`text-xl font-bold text-white/90`,children:_?`Configurar Nodo`:`Desplegar Nuevo Nodo`}),(0,A.jsx)(HR,{className:`text-white/40`,children:_?`Ajusta los parámetros de tu agente inteligente.`:`Crea una nueva entidad inteligente para tu colmena.`})]})]}),n&&(0,A.jsx)(W,{variant:`ghost`,size:`icon`,onClick:n,className:`text-white/40 hover:text-white hover:bg-white/5`,children:(0,A.jsx)(Ur,{className:`h-5 w-5`})})]})}),(0,A.jsx)(UR,{className:`relative space-y-6 pt-2`,children:(0,A.jsxs)(`form`,{onSubmit:g,className:`space-y-8`,children:[(0,A.jsxs)(`div`,{className:`grid gap-6`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`name`,className:`hive-label--field`,children:`Nombre del Agente`}),(0,A.jsx)(G,{id:`name`,placeholder:`Ej: Analista de Mercado`,className:`hive-input`,value:d.name,onChange:e=>f({...d,name:e.target.value}),disabled:a,required:!0})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`description`,className:`hive-label--field`,children:`Descripción / Rol`}),(0,A.jsx)(uG,{id:`description`,placeholder:`Describe qué hace este agente y cuáles son sus objetivos...`,className:`hive-textarea`,value:d.description,onChange:e=>f({...d,description:e.target.value}),disabled:a})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(Z,{htmlFor:`systemPrompt`,className:`hive-label--field`,children:`System Prompt`}),(0,A.jsxs)(cq,{children:[(0,A.jsx)(lq,{asChild:!0,children:(0,A.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,A.jsxs)(pq,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,A.jsxs)(mq,{children:[(0,A.jsx)(gq,{className:`text-xl`,children:`Editar System Prompt`}),(0,A.jsx)(_q,{className:`text-sm text-white/50`,children:`El prompt base de comportamiento del agente. Se recomienda formato Markdown.`})]}),(0,A.jsx)(`div`,{className:`py-2`,children:(0,A.jsx)(uG,{value:d.systemPrompt||``,onChange:e=>f({...d,systemPrompt:e.target.value}),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`,disabled:a})}),(0,A.jsx)(hq,{children:(0,A.jsx)(dq,{asChild:!0,children:(0,A.jsx)(W,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Guardar Cambios`})})})]})]})]}),d.systemPrompt?(0,A.jsxs)(`p`,{className:`text-xs text-white/40 line-clamp-1 italic border border-white/5 bg-white/[0.02] p-2 rounded-md`,children:[`"`,d.systemPrompt,`"`]}):(0,A.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})]}),(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(jn,{className:`h-4 w-4 text-emerald-400`}),(0,A.jsx)(`h3`,{className:`hive-title-section`,children:`Workspace Directory`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`workspace`,className:`hive-label--field`,children:`Directorio de Trabajo del Agente`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(G,{id:`workspace`,placeholder:`Ej: /home/user/proyectos, D:\\Work, /Volumes/USB`,className:`hive-input flex-1 font-mono text-sm`,value:d.workspace,onChange:e=>{f({...d,workspace:e.target.value}),p(e.target.value)},disabled:a}),d.workspace&&c.exists&&c.accessible&&(0,A.jsx)(W,{type:`button`,variant:`outline`,size:`icon`,onClick:h,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10`,title:`Abrir en el explorador`,children:(0,A.jsx)(Tn,{className:`h-4 w-4`})})]}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente creará archivos, carpetas y ejecutará comandos. Puede ser cualquier ubicación en tu sistema (disco duro, USB, red, etc.).`}),d.workspace&&d.workspace.trim()!==``&&(0,A.jsxs)(`div`,{className:H(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,c.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!c.isValidating&&c.exists&&c.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!c.isValidating&&c.exists&&!c.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!c.isValidating&&!c.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[c.isValidating&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`h-3.5 w-3.5 animate-spin`}),(0,A.jsx)(`span`,{children:`Validando directorio...`})]}),!c.isValidating&&c.exists&&c.accessible&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($t,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:c.message||`Directorio válido y accesible`})]}),!c.isValidating&&c.exists&&!c.accessible&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(an,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:c.message||`El directorio existe pero no tiene permisos de lectura/escritura`})]}),!c.isValidating&&!c.exists&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(jn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:c.message||`El directorio no existe`}),!c.error&&(0,A.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:m,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear directorio`})]})]})]})]}),(0,A.jsx)(`div`,{className:`hive-card-divider`}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(gn,{className:`h-4 w-4 text-blue-400`}),(0,A.jsx)(`h3`,{className:`hive-title-section`,children:`Motor de Inteligencia`})]}),(0,A.jsx)(vq,{selectedProviderId:d.provider_id||void 0,selectedModelId:d.model_id||void 0,onProviderChange:e=>f({...d,provider_id:e,model_id:``}),onModelChange:e=>f({...d,model_id:e}),disabled:a})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`tone`,className:`hive-label--field`,children:`Tono de Voz`}),(0,A.jsxs)(BK,{value:d.tone,onValueChange:e=>f({...d,tone:e}),disabled:a,children:[(0,A.jsx)(UK,{className:`hive-select-trigger`,children:(0,A.jsx)(HK,{placeholder:`Selecciona un tono`})}),(0,A.jsx)(KK,{className:`hive-select-content`,children:yq.map(e=>(0,A.jsx)(Q,{value:e.value,className:`hive-select-item`,children:e.label},e.value))})]})]}),(0,A.jsxs)(`div`,{className:`hive-toggle-panel`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Tr,{className:`h-3.5 w-3.5 text-purple-400`}),(0,A.jsx)(Z,{htmlFor:`role`,className:`text-xs font-medium text-white/70`,children:`Rol`})]}),(0,A.jsxs)(BK,{value:d.role,onValueChange:e=>f({...d,role:e}),disabled:a,children:[(0,A.jsx)(UK,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{className:`bg-zinc-900 border-white/10`,children:[(0,A.jsx)(Q,{value:`coordinator`,children:`Coordinador`}),(0,A.jsx)(Q,{value:`worker`,children:`Worker`})]})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`h-2 w-2 rounded-full ${d.enabled?`bg-blue-400`:`bg-zinc-600`}`}),(0,A.jsx)(Z,{htmlFor:`enabled`,className:`text-xs font-medium text-white/70`,children:`Habilitado`})]}),(0,A.jsx)(sq,{id:`enabled`,checked:d.enabled,onCheckedChange:e=>f({...d,enabled:e}),disabled:a})]})]})]}),o&&(0,A.jsx)(`div`,{className:`hive-form-error`,children:o}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 pt-4`,children:[n&&(0,A.jsx)(W,{type:`button`,variant:`outline`,onClick:n,disabled:a,className:`hive-btn--form-cancel`,children:`Cancelar`}),(0,A.jsx)(W,{type:`submit`,disabled:a,className:`hive-btn--form-submit`,children:a?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`mr-2 h-4 w-4 animate-spin`}),`Procesando...`]}):(0,A.jsx)(A.Fragment,{children:_?`Actualizar Agente`:`Desplegar Agente`})})]})]})})]})}function xq(){let{agents:e,isLoading:t,error:n,fetchAgents:r}=MR(),{fetchProviders:i}=AR(),{fetchModels:a}=jR(),[o,s]=(0,u.useState)(!1),[c,l]=(0,u.useState)(void 0);(0,u.useEffect)(()=>{r(),i(),a()},[r,i,a]);let d=e=>{l(e),s(!0)},f=()=>{l(void 0),s(!0)};return(0,A.jsxs)(`div`,{className:`hive-page mt-10 animate-in fade-in duration-700`,children:[(0,A.jsxs)(`div`,{className:`hive-page-container`,children:[(0,A.jsxs)(`div`,{className:`hive-page-header flex flex-col sm:flex-row sm:items-end justify-between gap-6 relative z-10 mb-8`,children:[(0,A.jsxs)(`div`,{className:`relative z-10 animate-in slide-in-from-left-8 duration-700`,children:[(0,A.jsxs)(`div`,{className:`hive-page-header__eyebrow mb-3 opacity-80`,children:[(0,A.jsx)(`div`,{className:`hive-page-header__dot animate-pulse shadow-[0_0_10px_rgba(59,130,246,0.6)]`}),(0,A.jsx)(`span`,{className:`hive-page-header__label tracking-widest font-semibold text-blue-400`,children:`NEXO CENTRAL`})]}),(0,A.jsxs)(`h2`,{className:`text-4xl md:text-5xl font-black tracking-tight text-white drop-shadow-lg mb-4`,children:[`Agentes `,(0,A.jsx)(`span`,{className:`text-transparent bg-clip-text bg-gradient-to-r from-blue-400 to-purple-500`,children:`Inteligentes`})]}),(0,A.jsx)(`p`,{className:`text-white/60 text-sm max-w-xl leading-relaxed font-light`,children:`Configura y despliega inteligencias autónomas. Cada nodo amplía las capacidades de tu infraestructura personal y de negocio con precisión absoluta.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 relative z-10 animate-in slide-in-from-right-8 duration-700`,children:[(0,A.jsxs)(`button`,{className:`px-4 py-2 bg-white/5 hover:bg-white/10 text-white/70 hover:text-white rounded-lg border border-white/10 hover:border-white/20 transition-all duration-300 flex items-center gap-2 font-medium text-sm backdrop-blur-sm group`,onClick:()=>r(),disabled:t,children:[(0,A.jsx)(fr,{className:`h-4 w-4 transition-transform duration-500 group-hover:rotate-180 text-blue-400 ${t?`animate-spin`:``}`}),(0,A.jsx)(`span`,{children:`Sincronizar`})]}),(0,A.jsxs)(`button`,{onClick:f,className:`px-4 py-2 bg-blue-600 hover:bg-blue-500 text-white rounded-lg border border-blue-500/50 hover:border-blue-400/50 shadow-[0_0_15px_rgba(37,99,235,0.3)] hover:shadow-[0_0_25px_rgba(59,130,246,0.5)] transition-all duration-300 flex items-center gap-2 font-medium text-sm group`,children:[(0,A.jsx)(lr,{className:`h-4 w-4 transition-transform duration-300 group-hover:rotate-90`}),(0,A.jsx)(`span`,{children:`Desplegar Nodo`})]})]})]}),(0,A.jsxs)(`div`,{className:`relative mt-8`,children:[(0,A.jsx)(`div`,{className:`absolute -top-40 -left-40 h-[500px] w-[500px] bg-blue-600/10 rounded-full blur-[120px] pointer-events-none mix-blend-screen opacity-50`}),(0,A.jsx)(`div`,{className:`absolute top-40 -right-40 h-[400px] w-[400px] bg-purple-600/10 rounded-full blur-[100px] pointer-events-none mix-blend-screen opacity-50`}),n?(0,A.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border border-red-500/20 bg-red-500/5 backdrop-blur-lg`,children:[(0,A.jsx)(`div`,{className:`absolute top-0 left-0 w-1 h-full bg-red-500`}),(0,A.jsxs)(`div`,{className:`px-6 py-5 flex items-center gap-4 text-red-400 relative z-10`,children:[(0,A.jsx)(`div`,{className:`p-3 rounded-xl bg-red-500/10 border border-red-500/20 shadow-[0_0_15px_rgba(239,68,68,0.15)]`,children:(0,A.jsx)(Ur,{className:`h-6 w-6`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-sm font-bold uppercase tracking-widest drop-shadow-sm`,children:`Error de Enlace`}),(0,A.jsx)(`p`,{className:`text-sm text-red-300/70 mt-1 font-light`,children:n})]})]})]}):(0,A.jsx)(`div`,{className:`relative z-10`,children:t&&e.length===0?(0,A.jsx)(`div`,{className:`grid gap-6 sm:grid-cols-2 lg:grid-cols-3`,children:[1,2,3].map(e=>(0,A.jsx)(`div`,{className:`h-64 rounded-2xl border border-white/5 bg-white/[0.02] animate-pulse`},e))}):e.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 px-4 text-center border border-white/5 rounded-3xl bg-black/20 backdrop-blur-sm animate-in fade-in duration-1000`,children:[(0,A.jsx)(`div`,{className:`h-20 w-20 rounded-full bg-blue-500/10 border border-blue-500/20 flex items-center justify-center mb-6 shadow-[0_0_30px_rgba(59,130,246,0.15)]`,children:(0,A.jsx)(qt,{className:`h-10 w-10 text-blue-400`})}),(0,A.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Colmena inactiva`}),(0,A.jsx)(`p`,{className:`text-white/50 max-w-md mx-auto mb-8 leading-relaxed`,children:`La red neuronal está esperando ser poblada. Despliega tu primer nodo agente para comenzar a automatizar tus operaciones.`}),(0,A.jsxs)(`button`,{onClick:f,className:`px-6 py-3 bg-blue-600 hover:bg-blue-500 text-white rounded-xl border border-blue-500/50 hover:border-blue-400/50 shadow-[0_0_20px_rgba(37,99,235,0.4)] transition-all duration-300 flex items-center gap-2 font-bold group`,children:[(0,A.jsx)(lr,{className:`h-5 w-5 transition-transform duration-300 group-hover:scale-125`}),(0,A.jsx)(`span`,{children:`INICIAR DESPLIEGUE`})]})]}):(0,A.jsx)(`div`,{className:`animate-in slide-in-from-bottom-8 duration-1000 fade-in fill-mode-both`,children:(0,A.jsx)(aG,{agents:e,onEdit:d})})})]})]}),o&&(0,A.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 animate-in fade-in duration-300`,children:[(0,A.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-md transition-opacity`,onClick:()=>s(!1)}),(0,A.jsx)(`div`,{className:`relative w-full max-w-4xl max-h-[90vh] overflow-y-auto bg-[#09090b] border border-white/10 rounded-2xl shadow-2xl animate-in zoom-in-95 duration-300`,children:(0,A.jsx)(bq,{initialData:c,onSuccess:()=>{s(!1),l(void 0)},onCancel:()=>s(!1)})})]})]})}function Sq({icon:e,...t}){return(0,A.jsx)(e,{...t})}function Cq({agentId:e}){let{agents:t,updateAgent:n,fetchAgents:r}=MR(),{providers:i,fetchProviders:a}=AR(),{models:o,fetchModels:s}=jR();(0,u.useEffect)(()=>{r(),a(),s()},[r,a,s]);let c=t.find(t=>t.id===e),[l,d]=(0,u.useState)({name:``,description:``,provider_id:``,model_id:``,tone:``,role:`coordinator`,enabled:!0,headers:``,systemPrompt:``,workspace:``}),[f,p]=(0,u.useState)({isValidating:!1,exists:!1,accessible:!1});(0,u.useEffect)(()=>{c&&(d({name:c.name||``,description:c.description||``,provider_id:c.provider_id||c.providerId||``,model_id:c.model_id||c.modelId||``,tone:c.tone||``,role:c.role||`coordinator`,enabled:!!c.enabled,headers:``,systemPrompt:c.systemPrompt||``,workspace:c.workspace||``}),c.workspace&&m(c.workspace))},[c]);let m=async e=>{if(!e||e.trim()===``){p({isValidating:!1,exists:!1,accessible:!1});return}p({isValidating:!0,exists:!1,accessible:!1});try{let t=await K(`/api/workspace/validate`,{method:`POST`,body:{path:e}});p({isValidating:!1,exists:t.exists,accessible:t.accessible,error:t.error,message:t.message})}catch(e){p({isValidating:!1,exists:!1,accessible:!1,error:e.message})}},h=async()=>{if(l.workspace)try{await K(`/api/workspace/create`,{method:`POST`,body:{path:l.workspace},showLoader:`Creando directorio...`,showSuccess:`Directorio creado exitosamente`}),await m(l.workspace)}catch(e){tg.fire({icon:`error`,title:e.message})}},g=async()=>{if(l.workspace)try{await K(`/api/workspace/open?path=${encodeURIComponent(l.workspace)}`,{method:`GET`})}catch(e){tg.fire({icon:`error`,title:e.message})}},_=async()=>{Qh.show(`Sincronizando configuración del agente...`);try{await n(e,{...l,role:l.role,enabled:l.enabled?1:0,workspace:l.workspace||null}),tg.fire({icon:`success`,title:`Cambios sincronizados correctamente`})}catch(e){tg.fire({icon:`error`,title:e instanceof Error?e.message:`Error al sincronizar cambios`})}finally{Qh.hide()}};if(!c)return(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 text-center space-y-4 rounded-3xl border border-dashed border-white/10 bg-white/5`,children:[(0,A.jsx)(Sq,{icon:Bt,className:`h-12 w-12 text-white/10 animate-pulse`}),(0,A.jsx)(`p`,{className:`text-white/40 font-medium`,children:`Buscando nodo en la colmena...`})]});let v=i.filter(e=>{if(!e.active)return!1;let t=e.base_url||e.baseUrl||``,n=e.id===`ollama`||t.includes(`localhost`)||t.includes(`127.0.0.1`);return e.has_api_key||n}),y=o.filter(e=>(e.provider_id||e.providerId)===l.provider_id&&(e.active||e.enabled));return(0,A.jsx)(`div`,{className:`space-y-8 animate-in fade-in slide-in-from-bottom-4 duration-500`,children:(0,A.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-3 gap-8`,children:[(0,A.jsxs)(`div`,{className:`lg:col-span-1 space-y-6`,children:[(0,A.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-xl bg-blue-500/10 border border-blue-500/20`,children:(0,A.jsx)(Sq,{icon:Lr,className:`h-4 w-4 text-blue-400`})}),(0,A.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Identidad Base`})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`name`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Nombre Público`}),(0,A.jsx)(G,{id:`name`,value:l.name,onChange:e=>d(t=>({...t,name:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Nombre del nodo`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`tone`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Tono Cognitivo`}),(0,A.jsx)(G,{id:`tone`,value:l.tone,onChange:e=>d(t=>({...t,tone:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-xl h-11`,placeholder:`Ej: Analítico, Conciso...`})]})]})]}),(0,A.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-xl bg-purple-500/10 border border-purple-500/20`,children:(0,A.jsx)(Sq,{icon:Tr,className:`h-4 w-4 text-purple-400`})}),(0,A.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Permisos de Red`})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,A.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,A.jsx)(Z,{className:`text-sm font-semibold`,children:`Rol`}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Coordinador o Worker`})]}),(0,A.jsxs)(BK,{value:l.role,onValueChange:e=>d(t=>({...t,role:e})),children:[(0,A.jsx)(UK,{className:`w-[120px] bg-white/5 border-white/10 text-white`,children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{className:`bg-zinc-900 border-white/10`,children:[(0,A.jsx)(Q,{value:`coordinator`,children:`Coordinador`}),(0,A.jsx)(Q,{value:`worker`,children:`Worker`})]})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-2xl bg-white/5 hover:bg-white/10 transition-colors`,children:[(0,A.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,A.jsx)(Z,{className:`text-sm font-semibold`,children:`Nodo Activo`}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Disponible para la colmena`})]}),(0,A.jsx)(sq,{checked:l.enabled,onCheckedChange:e=>d(t=>({...t,enabled:e}))})]})]})]}),(0,A.jsxs)(`div`,{className:`p-6 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-xl bg-emerald-500/10 border border-emerald-500/20`,children:(0,A.jsx)(Sq,{icon:jn,className:`h-4 w-4 text-emerald-400`})}),(0,A.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Workspace Directory`})]}),(0,A.jsx)(`div`,{className:`space-y-4`,children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`workspace`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directorio de Trabajo`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(G,{id:`workspace`,value:l.workspace,onChange:e=>{d(t=>({...t,workspace:e.target.value})),m(e.target.value)},className:`bg-white/5 border-white/10 focus:border-emerald-500/50 rounded-xl h-11 font-mono text-sm flex-1`,placeholder:`Ej: /home/user/proyectos, D:\\Work`}),l.workspace&&f.exists&&f.accessible&&(0,A.jsx)(W,{type:`button`,variant:`outline`,size:`icon`,onClick:g,className:`shrink-0 border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10 h-11 w-11`,title:`Abrir en el explorador`,children:(0,A.jsx)(Tn,{className:`h-4 w-4`})})]}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:`Directorio donde el agente operará. Puede ser cualquier ubicación (disco, USB, red).`}),l.workspace&&l.workspace.trim()!==``&&(0,A.jsxs)(`div`,{className:H(`flex items-center gap-2 text-xs p-2.5 rounded-lg border backdrop-blur-md transition-all`,f.isValidating&&`bg-blue-500/10 border-blue-500/20 text-blue-400`,!f.isValidating&&f.exists&&f.accessible&&`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`,!f.isValidating&&f.exists&&!f.accessible&&`bg-amber-500/10 border-amber-500/20 text-amber-400`,!f.isValidating&&!f.exists&&`bg-purple-500/10 border-purple-500/20 text-purple-400`),children:[f.isValidating&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`h-3.5 w-3.5 animate-spin`}),(0,A.jsx)(`span`,{children:`Validando directorio...`})]}),!f.isValidating&&f.exists&&f.accessible&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)($t,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:f.message||`Directorio válido y accesible`})]}),!f.isValidating&&f.exists&&!f.accessible&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(an,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:f.message||`Sin permisos de lectura/escritura`})]}),!f.isValidating&&!f.exists&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(jn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:f.message||`El directorio no existe`}),!f.error&&(0,A.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,onClick:h,className:`ml-auto h-6 px-2 text-xs bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border-purple-500/30`,children:`Crear`})]})]})]})})]})]}),(0,A.jsx)(`div`,{className:`lg:col-span-2 space-y-6`,children:(0,A.jsxs)(`div`,{className:`p-8 rounded-3xl border border-white/10 bg-black/20 backdrop-blur-md space-y-8`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-xl bg-amber-500/10 border border-amber-500/20`,children:(0,A.jsx)(Sq,{icon:Dr,className:`h-4 w-4 text-amber-400`})}),(0,A.jsx)(`h3`,{className:`font-bold text-white uppercase tracking-wider text-xs`,children:`Configuración Cognitiva`})]}),(0,A.jsxs)(W,{onClick:_,className:`bg-blue-600 hover:bg-blue-500 text-white font-bold rounded-xl px-6 shadow-[0_4px_15px_rgba(37,99,235,0.3)] transition-all active:scale-95 gap-2`,children:[(0,A.jsx)(Sq,{icon:mr,className:`h-4 w-4`}),`Sincronizar Cambios`]})]}),(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`description`,className:`text-xs text-white/40 uppercase tracking-widest pl-1`,children:`Directiva de Misión (Descripción)`}),(0,A.jsx)(uG,{id:`description`,value:l.description,onChange:e=>d(t=>({...t,description:e.target.value})),className:`bg-white/5 border-white/10 focus:border-blue-500/50 rounded-2xl min-h-[80px] resize-none`,placeholder:`Define el propósito general de este nodo...`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`System Prompt (Markdown)`}),(0,A.jsxs)(cq,{children:[(0,A.jsx)(lq,{asChild:!0,children:(0,A.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,className:`h-7 px-3 text-xs bg-blue-500/10 hover:bg-blue-500/20 text-blue-400 border-blue-500/30 transition-colors`,children:`Modifica acá el System Prompt`})}),(0,A.jsxs)(pq,{className:`sm:max-w-3xl bg-[#0a0a0c] border-white/10 text-white shadow-2xl [&>button]:text-white/50 hover:[&>button]:text-white`,children:[(0,A.jsxs)(mq,{children:[(0,A.jsx)(gq,{className:`text-xl`,children:`Editar System Prompt`}),(0,A.jsx)(_q,{className:`text-sm text-white/50`,children:`El comportamiento principal del agente. Se recomienda usar Markdown.`})]}),(0,A.jsx)(`div`,{className:`py-2`,children:(0,A.jsx)(uG,{value:l.systemPrompt,onChange:e=>d(t=>({...t,systemPrompt:e.target.value})),className:`min-h-[400px] font-mono text-sm bg-black/40 border-white/10 text-white/90 focus-visible:ring-blue-500/50 resize-y`,placeholder:`Escribe el system prompt detallado aquí...`})}),(0,A.jsx)(hq,{children:(0,A.jsx)(dq,{asChild:!0,children:(0,A.jsx)(W,{type:`button`,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-[0_0_15px_rgba(37,99,235,0.3)]`,children:`Listo`})})})]})]})]}),l.systemPrompt?(0,A.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4 max-h-[120px] overflow-y-auto custom-scrollbar`,children:(0,A.jsx)(`p`,{className:`text-xs text-white/60 font-mono whitespace-pre-wrap italic`,children:l.systemPrompt})}):(0,A.jsx)(`div`,{className:`bg-white/[0.02] border border-white/5 rounded-2xl p-4`,children:(0,A.jsx)(`p`,{className:`text-xs text-white/30 italic`,children:`Sin system prompt configurado...`})})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`Proveedor`}),v.length===0&&(0,A.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`Sin providers activos`})]}),(0,A.jsxs)(BK,{value:l.provider_id,onValueChange:e=>d(t=>({...t,provider_id:e,model_id:``})),children:[(0,A.jsx)(UK,{className:`bg-white/5 border-white/10 rounded-xl h-11`,children:(0,A.jsx)(HK,{placeholder:`Seleccionar proveedor`})}),(0,A.jsxs)(KK,{className:`bg-zinc-900 border-white/10 text-white`,children:[v.length===0&&(0,A.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-white/30`,children:`Activa al menos un provider en la sección de Providers`}),v.map(e=>{let t=e.base_url||e.baseUrl||``,n=e.id===`ollama`||t.includes(`localhost`)||t.includes(`127.0.0.1`);return(0,A.jsx)(Q,{value:e.id,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{children:e.name}),(0,A.jsx)(`span`,{className:`text-[9px] font-bold px-1.5 py-0.5 rounded-full ${n?`bg-amber-500/20 text-amber-400`:`bg-emerald-500/20 text-emerald-400`}`,children:n?`LOCAL`:`API`})]})},e.id)})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between pl-1`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/40 uppercase tracking-widest`,children:`Modelo`}),l.provider_id&&y.length===0&&(0,A.jsx)(`span`,{className:`text-[10px] text-amber-400/80`,children:`Sin modelos activos`})]}),(0,A.jsxs)(BK,{value:l.model_id,onValueChange:e=>d(t=>({...t,model_id:e})),disabled:!l.provider_id||y.length===0,children:[(0,A.jsx)(UK,{className:`bg-white/5 border-white/10 rounded-xl h-11 disabled:opacity-50`,children:(0,A.jsx)(HK,{placeholder:l.provider_id?y.length===0?`Activa modelos en el provider`:`Seleccionar modelo`:`Primero selecciona un proveedor`})}),(0,A.jsx)(KK,{className:`bg-zinc-900 border-white/10 text-white`,children:y.map(e=>(0,A.jsx)(Q,{value:e.id,children:(0,A.jsx)(`span`,{className:`font-mono text-sm`,children:e.name})},e.id))})]})]})]})]}),(0,A.jsxs)(`div`,{className:`mt-8 p-4 rounded-2xl bg-white/[0.03] border border-white/5 flex items-start gap-4 italic`,children:[(0,A.jsx)(Sq,{icon:Pn,className:`h-5 w-5 text-white/20 mt-0.5`}),(0,A.jsx)(`p`,{className:`text-[11px] text-white/30 leading-relaxed`,children:`Las credenciales de acceso y llaves de cifrado para los headers personalizados se gestionan en una capa segura y no son visibles en texto plano para mantener la integridad de la red.`})]})]})})]})})}function wq({agent:e}){let{providers:t}=AR(),{models:n}=jR(),r=e.role===`coordinator`,i=e.provider_id||e.providerId,a=e.model_id||e.modelId,o=e.created_at||e.createdAt,s=o?zW(typeof o==`string`?new Date(o):new Date(o*1e3),`PPP`,{locale:rG}):`Fecha desconocida`,c=t.find(e=>e.id===i)?.name||i,l=n.find(e=>e.id===a)?.name||a;return(0,A.jsxs)(`div`,{className:`hive-card--internal group ${e.enabled?`hive-card--internal-active`:`hive-card--internal-disabled`}`,children:[e.enabled&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`absolute -top-24 -right-24 h-64 w-64 bg-blue-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-blue-600/20 transition-all duration-700`}),(0,A.jsx)(`div`,{className:`absolute -bottom-24 -left-24 h-64 w-64 bg-purple-600/10 rounded-full blur-[100px] pointer-events-none group-hover:bg-purple-600/20 transition-all duration-700`})]}),(0,A.jsxs)(`div`,{className:`relative flex flex-col md:flex-row gap-8 items-start justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex-1 space-y-6`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`hive-icon-wrap--internal ${e.enabled?`hive-icon-wrap--internal-active`:`hive-icon-wrap--internal-disabled`}`,children:(0,A.jsx)(kn,{className:`h-6 w-6 ${e.enabled?`text-blue-400`:`text-white/20`}`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,A.jsx)(`span`,{className:`hive-page-header__label ${!e.enabled&&`text-white/20`}`,children:`Identidad de Nodo`}),r&&(0,A.jsx)(Hz,{className:`hive-tag--coordinator ${!e.enabled&&`bg-white/5 text-white/20 border-white/10`}`,children:`Coordinador`})]}),(0,A.jsx)(`h1`,{className:`text-4xl font-black tracking-tighter ${e.enabled?`text-white`:`text-white/40`}`,children:e.name})]})]}),(0,A.jsxs)(`p`,{className:`text-lg leading-relaxed max-w-2xl font-light italic ${e.enabled?`text-white/60`:`text-white/20`}`,children:[`"`,e.description||`Este agente no tiene una descripción definida aún.`,`"`]})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4`,children:[(0,A.jsx)(Tq,{icon:gn,label:`Infraestructura`,value:c,subValue:l,color:e.enabled?`text-blue-400`:`text-white/20`,enabled:e.enabled}),(0,A.jsx)(Tq,{icon:Wr,label:`Personalidad`,value:e.tone||`Neutral`,color:e.enabled?`text-purple-400`:`text-white/20`,enabled:e.enabled}),(0,A.jsx)(Tq,{icon:Zt,label:`Desplegado el`,value:s,color:e.enabled?`text-emerald-400`:`text-white/20`,enabled:e.enabled})]})]}),(0,A.jsxs)(`div`,{className:`flex flex-col items-center md:items-end gap-6 min-w-[200px]`,children:[(0,A.jsxs)(`div`,{className:`text-center md:text-right space-y-2`,children:[(0,A.jsx)(`span`,{className:`hive-label block`,children:`Estado Operativo`}),(0,A.jsx)(pB,{status:e.enabled?e.status:`hibernated`,className:`px-6 py-2 text-sm border-2`})]}),(0,A.jsxs)(`div`,{className:`hive-network-panel md:w-auto`,children:[(0,A.jsxs)(`div`,{className:`flex-1`,children:[(0,A.jsx)(`p`,{className:`hive-label mb-1`,children:`Carga de Red`}),(0,A.jsx)(`div`,{className:`hive-network-track`,children:e.enabled&&(0,A.jsx)(`div`,{className:`hive-network-fill`})})]}),(0,A.jsx)(Bt,{className:`h-5 w-5 ${e.enabled?`text-blue-400 animate-pulse`:`text-white/10`}`})]})]})]}),(0,A.jsx)(`div`,{className:`hive-strip--bottom ${!e.enabled&&`opacity-20`}`}),(0,A.jsxs)(`div`,{className:`absolute top-4 right-8 hive-mono hidden md:block`,children:[`NODE_UID: `,e.id]})]})}function Tq({icon:e,label:t,value:n,subValue:r,color:i,enabled:a}){return(0,A.jsxs)(`div`,{className:`hive-info-card ${a?`hive-info-card--active`:`hive-info-card--disabled`}`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(e,{className:`h-3.5 w-3.5 ${i}`}),(0,A.jsx)(`span`,{className:`hive-info-card__label`,children:t})]}),(0,A.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,A.jsx)(`p`,{className:`hive-info-card__value ${a?`text-white/80 group-hover/item:text-white`:`text-white/20`}`,children:n}),r&&(0,A.jsx)(`p`,{className:`hive-info-card__sub ${a?`text-white/40`:`text-white/10`}`,children:r})]})]})}function Eq(){let{id:e}=Rd(),t=Fd(),n=e??`unknown`,{agents:r,fetchAgents:i,isLoading:a}=MR();(0,u.useEffect)(()=>{i()},[i]);let o=r.find(e=>e.id===n);return(0,A.jsx)(`div`,{className:`min-h-screen bg-transparent pb-20`,children:(0,A.jsxs)(`div`,{className:`max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 animate-in fade-in slide-in-from-bottom-4 duration-700`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between mb-8`,children:[(0,A.jsxs)(W,{variant:`ghost`,onClick:()=>t(`/agents`),className:`group flex items-center gap-2 text-white/40 hover:text-white hover:bg-white/5 px-4 py-2 rounded-xl transition-all`,children:[(0,A.jsx)(tn,{className:`h-4 w-4 transition-transform group-hover:-translate-x-1`}),(0,A.jsx)(`span`,{className:`text-sm font-bold uppercase tracking-widest`,children:`Volver a la Colmena`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4 text-white/20`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Jn,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Agentes`})]}),(0,A.jsx)(`div`,{className:`h-4 w-px bg-white/10`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Bt,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`text-[10px] font-bold uppercase tracking-widest`,children:`Detalles Operativos`})]})]})]}),o?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(wq,{agent:o}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-8`,children:(0,A.jsx)(Cq,{agentId:n})})]}):(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[60vh] text-center space-y-6`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`div`,{className:`h-24 w-24 rounded-full border-4 border-t-blue-500 border-white/5 animate-spin`}),(0,A.jsx)(Bt,{className:`absolute inset-0 m-auto h-8 w-8 text-blue-400 animate-pulse`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Sincronizando con el Nodo`}),(0,A.jsx)(`p`,{className:`text-white/40 max-w-xs mx-auto`,children:`Estamos recuperando la configuración cuántica de este agente desde la base de datos central.`})]})]})]})})}var Dq=i((e,t)=>({isLoading:!1,error:null,configs:[],conflicts:[],templates:[],setLoading:t=>e({isLoading:t}),setError:t=>e({error:t}),fetchEthics:async()=>{e({isLoading:!0,error:null});try{let t=(await K(`/api/ethics`)).ethics||[],n=t.find(e=>e.active)||t[0];return e({configs:t,isLoading:!1}),n?.content||``}catch(t){throw e({isLoading:!1,error:t instanceof Error?t.message:`Failed to fetch ethics`}),t}},saveEthics:async n=>{e({isLoading:!0,error:null});try{let r=t(),i=r.configs.find(e=>e.active)||r.configs[0],a;return a=i?await K(`/api/ethics/${i.id}`,{method:`PUT`,body:{content:n}}):await K(`/api/ethics`,{method:`POST`,body:{name:`Default`,content:n,active:!0}}),e({isLoading:!1}),a.message||`Guardado correctamente`}catch(t){throw e({isLoading:!1,error:t instanceof Error?t.message:`Failed to save ethics`}),t}},fetchConfigs:async()=>{e({isLoading:!0,error:null});try{e({configs:await K(`/api/workspace/ethics/configs`),isLoading:!1})}catch(t){e({isLoading:!1,error:t instanceof Error?t.message:`Failed to fetch configs`})}},fetchConflicts:async()=>{e({isLoading:!0,error:null});try{e({conflicts:await K(`/api/workspace/ethics/conflicts`),isLoading:!1})}catch(t){e({isLoading:!1,error:t instanceof Error?t.message:`Failed to fetch conflicts`})}},fetchTemplates:async()=>{e({isLoading:!0,error:null});try{e({templates:await K(`/api/workspace/ethics/templates`),isLoading:!1})}catch(t){e({isLoading:!1,error:t instanceof Error?t.message:`Failed to fetch templates`})}},updateConfig:(t,n)=>{e(e=>({configs:e.configs.map(e=>e.id===t?{...e,...n,updatedAt:new Date().toISOString(),version:e.version+1}:e)}))},addConfig:t=>{let n={...t,id:Ui(),version:1,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()};e(e=>({configs:[...e.configs,n]}))},removeConfig:t=>{e(e=>({configs:e.configs.filter(e=>e.id!==t)}))}}));function Oq(){let{configs:e,fetchEthics:t,isLoading:n}=Dq(),[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)({name:``,description:``,content:``}),[l,d]=(0,u.useState)(!1),f=(0,u.useRef)(null),p=()=>{let e=f.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)};(0,u.useEffect)(()=>{a&&setTimeout(p,0)},[a,s.content]),(0,u.useEffect)(()=>{t().catch(console.error)},[t]),(0,u.useEffect)(()=>{if(e.length===0)return;let t=e,n=t.find(e=>e.active)||t[0];r||(i(n.id),c({name:n.name,description:n.description||``,content:n.content}))},[e,r]);let m=e.find(e=>e.id===r),h=e=>{i(e.id),c({name:e.name,description:e.description||``,content:e.content}),o(!0)},g=async n=>{Qh.show(`Activando registro de ética...`);let r=e;try{let e=await Promise.all(r.map(e=>K(`/api/ethics/${e.id}`,{method:`PUT`,body:{active:e.id===n?1:0}}).catch(()=>({}))));await t();let i=e.find((e,t)=>r[t].id===n);tg.fire({icon:`success`,title:i?.message||`Registro de ética activado`})}catch(e){tg.fire({icon:`error`,title:e instanceof Error?e.message:`Error al activar registro`})}finally{Qh.hide()}};return n&&e.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 border border-white/5 bg-zinc-950/30 rounded-2xl`,children:[(0,A.jsx)(Yn,{className:`h-8 w-8 animate-spin text-amber-500 mb-4 opacity-50`}),(0,A.jsx)(`span`,{className:`hive-label`,children:`Cargando lineamientos operativos...`})]}):(0,A.jsxs)(`div`,{className:`space-y-8 animate-fade-in`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(`h3`,{className:`hive-title-section !text-lg`,children:`Protocolos Éticos`}),(0,A.jsxs)(`span`,{className:`hive-tag hive-tag--provider`,children:[e.length,` REGISTROS`]})]}),(0,A.jsx)(`p`,{className:`hive-subtitle !mt-0 !text-xs`,children:`Define la capa moral y los límites operacionales de tus agentes inteligentes.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] uppercase tracking-widest font-black text-white/20 bg-white/5 px-4 py-2 rounded-xl border border-white/5`,children:[(0,A.jsx)(Tr,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Configuración del Núcleo`})]})]}),e.length===0?(0,A.jsx)(`div`,{className:`hive-card border-dashed border-white/10 bg-white/[0.02]`,children:(0,A.jsxs)(`div`,{className:`hive-card-body flex flex-col items-center justify-center py-16 px-4`,children:[(0,A.jsx)(`div`,{className:`h-16 w-16 rounded-2xl bg-white/5 flex items-center justify-center mb-6`,children:(0,A.jsx)(Fr,{className:`h-8 w-8 text-white/20`})}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`hive-title-section text-center mb-2`,children:`Sin Protocolos Base`}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 mb-8 max-w-[300px] mx-auto leading-relaxed`,children:`No se han detectado lineamientos éticos en el sistema. Selecciona una de las plantillas inferiores para comenzar.`})]})]})}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6`,children:e.map(e=>{let t=!!e.active,n=r===e.id;return(0,A.jsxs)(`div`,{onClick:()=>h(e),className:`hive-card group transition-all duration-500 cursor-pointer ${n?`hive-card--active`:`opacity-60 grayscale-[0.8] hover:opacity-100 hover:grayscale-0`}`,children:[(0,A.jsxs)(`div`,{className:`hive-card-body relative overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between mb-6`,children:[(0,A.jsx)(`div`,{className:`hive-icon-wrap--internal ${n?`hive-icon-wrap--internal-active`:`hive-icon-wrap--internal-disabled`}`,children:(0,A.jsx)(Sr,{className:`h-6 w-6`})}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,A.jsx)(`span`,{className:`hive-status-label--active`,children:`ACTIVO`}),(0,A.jsx)(`div`,{className:t?`hive-status-dot--active`:`hive-status-dot--disabled`})]})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-lg font-black text-white uppercase tracking-tighter mb-1 line-clamp-1 group-hover:text-blue-400 transition-colors text-ellipsis`,children:e.name}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 font-medium leading-relaxed line-clamp-1 h-4`,children:e.description||`Sin descripción adicional`})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-white/5 flex items-center gap-4`,children:[(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`CONFIG`}),(0,A.jsx)(`span`,{className:`hive-stat__value`,children:e.is_default?`DEFAULT`:`CUSTOM`})]}),(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`PRECEDENCIA`}),(0,A.jsx)(`span`,{className:`hive-stat__value`,children:t?`ALTA`:`NORMAL`})]})]})]}),n&&(0,A.jsx)(`div`,{className:`hive-glow-blob--card hive-glow-blob--blue -bottom-10 -right-10 h-24 w-24 opacity-20`})]}),(0,A.jsx)(`div`,{className:`hive-strip--bottom ${t?``:`opacity-20`}`})]},e.id)})}),(0,A.jsx)(cq,{open:a,onOpenChange:o,children:(0,A.jsx)(pq,{className:`max-w-4xl border-white/10 !bg-[#09090b] p-0 overflow-hidden shadow-2xl`,children:m&&(0,A.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between p-6 border-b border-white/5 bg-white/5 relative overflow-hidden`,children:[(0,A.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--blue -top-10 -right-10 h-32 w-32 opacity-20`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4 relative z-10`,children:[(0,A.jsx)(`div`,{className:`hive-icon-wrap--internal hive-icon-wrap--internal-active`,children:(0,A.jsx)(Tr,{className:`h-6 w-6`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(gq,{className:`hive-title-page !text-2xl uppercase tracking-tighter`,children:m.name}),(0,A.jsx)(_q,{className:`hive-subtitle !mt-0`,children:`Sintonización de la capa moral y operativa del agente.`})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-3 relative z-10`,children:!m.active&&(0,A.jsx)(`button`,{className:`hive-btn hive-btn--ghost px-6 text-[10px]`,onClick:()=>g(m.id),children:`ESTABLECER COMO ACTIVO`})})]}),(0,A.jsx)(`div`,{className:`p-6 space-y-4 border-b border-white/5`,children:(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`hive-label uppercase !text-[10px]`,children:`Nombre del Protocolo`}),(0,A.jsx)(G,{value:s.name,onChange:e=>c(t=>({...t,name:e.target.value})),className:`bg-white/5 border-white/5 focus-visible:ring-blue-500/30 text-white font-bold`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`hive-label uppercase !text-[10px]`,children:`Descripción / Meta`}),(0,A.jsx)(G,{value:s.description,onChange:e=>c(t=>({...t,description:e.target.value})),className:`bg-white/5 border-white/5 focus-visible:ring-blue-500/30 text-white/60 text-xs italic`})]})]})}),(0,A.jsxs)(`div`,{className:`p-0 bg-[#09090b]`,children:[(0,A.jsx)(`div`,{className:`px-6 pt-4`,children:(0,A.jsx)(Z,{className:`hive-label uppercase !text-[10px]`,children:`Lineamientos de Capa (Markdown)`})}),(0,A.jsx)(uG,{ref:f,placeholder:`Define los lineamientos éticos del agente...`,value:s.content,onChange:e=>{c(t=>({...t,content:e.target.value})),p()},className:`hive-textarea w-full !bg-zinc-950/50 border-none focus-visible:ring-0 text-amber-50/90 font-mono text-xs leading-relaxed min-h-[400px] p-8 resize-none placeholder:text-white/10 overflow-hidden`})]}),(0,A.jsxs)(`div`,{className:`p-6 bg-white/[0.02] border-t border-white/5 flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-6`,children:[(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`IDENTIFICADOR`}),(0,A.jsx)(`span`,{className:`hive-stat__value`,children:m.id})]}),(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`ESTADO DE CAPA`}),(0,A.jsx)(`span`,{className:`hive-stat__value hive-stat__value--active`,children:m.active?`SISTEMA ACTIVO`:`PENDIENTE`})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`button`,{className:`hive-btn hive-btn--ghost px-6 text-[10px]`,onClick:()=>o(!1),children:`CANCELAR`}),(0,A.jsx)(`button`,{onClick:async()=>{if(m){d(!0),Qh.show(`Guardando lineamientos éticos...`);try{let e=await K(`/api/ethics/${m.id}`,{method:`PUT`,body:s});await t(),tg.fire({icon:`success`,title:e.message||`Contenido ético guardado`})}catch(e){tg.fire({icon:`error`,title:e instanceof Error?e.message:`Error al guardar`})}finally{d(!1),Qh.hide(),o(!1)}}},disabled:l,className:`hive-btn hive-btn--primary px-8 text-[10px]`,children:l?`SINCRONIZANDO...`:`GUARDAR LINEAMIENTOS`})]})]})]})})})]})}var kq={filesystem:`Sistema de archivos`,web:`Web`,codebridge:`Code Bridge`,schedule:`Cron`,projects:`Proyectos`,cli:`CLI`,agents:`Agentes`,canvas:`Canvas`,voice:`Voz`};function Aq(){let{tools:e,isLoading:t,fetchTools:n,toggleTool:r,updateTool:i}=NR(),[a,o]=(0,u.useState)(`all`),[s,c]=(0,u.useState)(null),[l,d]=(0,u.useState)(null),[f,p]=(0,u.useState)(!1);(0,u.useEffect)(()=>{n()},[n]);let m=async(e,t)=>{if(!l){d(e);try{await r(e,t),n(),tg.fire({icon:`success`,title:`Herramienta ${t?`activada`:`desactivada`}`})}catch{tg.fire({icon:`error`,title:`Error al actualizar estado de la herramienta`})}finally{d(null)}}},h=async()=>{if(s){p(!0),Qh.show(`Guardando herramienta...`);try{await i(s.id,{name:s.name,description:s.description}),tg.fire({icon:`success`,title:`Herramienta actualizada`}),n(),c(null)}catch{tg.fire({icon:`error`,title:`Error al guardar cambios`})}finally{p(!1),Qh.hide()}}};if(t&&e.length===0)return(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 border border-white/5 bg-zinc-950/30 rounded-2xl`,children:[(0,A.jsx)(Yn,{className:`h-8 w-8 animate-spin text-violet-500 mb-4 opacity-50`}),(0,A.jsx)(`span`,{className:`text-xs uppercase font-bold tracking-[0.2em] text-zinc-500`,children:`Cargando herramientas...`})]});let g=e.filter(e=>a===`all`?!0:e.category===a);return(0,A.jsxs)(`div`,{className:`space-y-8 animate-fade-in`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(`h3`,{className:`hive-title-section !text-lg !text-white/80`,children:`Herramientas`}),(0,A.jsxs)(`span`,{className:`hive-tag bg-white/5 text-white/40 border-white/10`,children:[g.length,` DISPONIBLES`]})]}),(0,A.jsx)(`p`,{className:`hive-subtitle !mt-0 !text-xs`,children:`Gestiona las capacidades externas y el arsenal tecnológico de tu agente.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] uppercase tracking-widest font-black text-white/20 bg-white/5 px-4 py-2 rounded-xl border border-white/5`,children:[(0,A.jsx)(Hr,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Arsenal Operativo`})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1.5 p-1 bg-white/5 rounded-2xl w-fit border border-white/5`,children:[`all`,`filesystem`,`web`,`schedule`,`codebridge`,`cli`,`agents`,`canvas`,`voice`].map(e=>(0,A.jsx)(`button`,{onClick:()=>o(e),className:`px-6 py-2 rounded-xl text-[10px] font-black tracking-widest uppercase transition-all duration-300 ${a===e?`bg-blue-600 text-white shadow-btn-primary`:`text-white/20 hover:text-white/40 hover:bg-white/5`}`,children:e===`all`?`TODAS`:kq[e]||e},e))}),g.length===0?(0,A.jsxs)(`div`,{className:`py-16 flex flex-col items-center justify-center border border-dashed border-white/10 rounded-2xl bg-zinc-950/20 group hover:border-violet-500/20 transition-colors`,children:[(0,A.jsx)(`div`,{className:`p-4 rounded-full bg-zinc-900 mb-4 group-hover:scale-110 transition-transform`,children:(0,A.jsx)(Fr,{className:`h-8 w-8 text-zinc-700 group-hover:text-violet-500/50 transition-colors`})}),(0,A.jsx)(`p`,{className:`text-xs text-zinc-500 font-medium`,children:`Sin herramientas en esta categoría.`})]}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6`,children:g.map(e=>{let t=e.active,n=e.core;return(0,A.jsxs)(`div`,{onClick:()=>c({...e}),className:`hive-card group cursor-pointer transition-all duration-500 ${t?`hive-card--active`:`hive-card--disabled`}`,children:[(0,A.jsxs)(`div`,{className:`hive-card-body relative overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between mb-6`,children:[(0,A.jsxs)(`div`,{className:`hive-icon-wrap--internal ${t?`hive-icon-wrap--internal-active`:`hive-icon-wrap--internal-disabled`}`,children:[e.category===`filesystem`&&(0,A.jsx)(Sn,{className:`h-6 w-6`}),e.category===`web`&&(0,A.jsx)(Sn,{className:`h-6 w-6`}),e.category===`schedule`&&(0,A.jsx)(gr,{className:`h-6 w-6`}),e.category===`cli`&&(0,A.jsx)(Mr,{className:`h-6 w-6`}),e.category===`codebridge`&&(0,A.jsx)(Mr,{className:`h-6 w-6`}),e.category===`agents`&&(0,A.jsx)(br,{className:`h-6 w-6`}),e.category===`projects`&&(0,A.jsx)(Mr,{className:`h-6 w-6`}),e.category===`canvas`&&(0,A.jsx)(Mr,{className:`h-6 w-6`}),e.category===`voice`&&(0,A.jsx)(br,{className:`h-6 w-6`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n&&(0,A.jsx)(`span`,{className:`hive-status-label--active`,children:`NATIVO`}),(0,A.jsx)(sq,{checked:t,onCheckedChange:()=>m(e.id,!t),onClick:e=>e.stopPropagation(),className:`data-[state=checked]:bg-blue-500 scale-75 origin-right`})]})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-lg font-black text-white uppercase tracking-tighter mb-1 line-clamp-1 group-hover:text-blue-400 transition-colors`,children:e.name}),(0,A.jsx)(`p`,{className:`hive-subtitle !mt-0 !text-[11px] h-8 line-clamp-2`,children:e.description||`Sin descripción disponible`})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-white/5 flex items-center gap-4`,children:[(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`TIPO`}),(0,A.jsx)(`span`,{className:`hive-stat__value truncate max-w-[80px]`,children:e.category})]}),(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`ESTADO`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:t?`hive-status-dot--active`:`hive-status-dot--disabled`}),(0,A.jsx)(`span`,{className:t?`hive-status-label--active`:`hive-status-label--disabled`,children:t?`ACTIVE`:`STANDBY`})]})]})]})]}),t&&(0,A.jsx)(`div`,{className:`hive-glow-blob--card hive-glow-blob--blue -bottom-10 -right-10 h-24 w-24 opacity-20`})]}),(0,A.jsx)(`div`,{className:`hive-strip--bottom ${t?``:`opacity-20`}`})]},e.id)})}),(0,A.jsx)(cq,{open:!!s,onOpenChange:e=>!e&&c(null),children:(0,A.jsxs)(pq,{className:`sm:max-w-sm bg-zinc-950 border-white/10`,children:[(0,A.jsxs)(mq,{children:[(0,A.jsxs)(gq,{className:`flex items-center gap-2 text-sm`,children:[(0,A.jsx)(`div`,{className:`p-1.5 rounded-lg bg-violet-500/10 text-violet-400`,children:(0,A.jsx)(br,{className:`h-3.5 w-3.5`})}),`Editar herramienta`]}),(0,A.jsx)(_q,{className:`text-[10px] text-zinc-500 font-medium`,children:`Modifica los parámetros y la descripción de la herramienta seleccionada.`})]}),(0,A.jsxs)(`div`,{className:`space-y-3 py-2`,children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(Z,{className:`text-[10px] text-zinc-500 uppercase tracking-widest font-bold`,children:`Nombre`}),(0,A.jsx)(G,{value:s?.name||``,onChange:e=>c({...s,name:e.target.value}),className:`h-9 text-sm bg-white/5 border-white/10 focus:border-violet-500/50`})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(Z,{className:`text-[10px] text-zinc-500 uppercase tracking-widest font-bold`,children:`Descripción`}),(0,A.jsx)(uG,{value:s?.description||``,onChange:e=>c({...s,description:e.target.value}),className:`text-sm min-h-[80px] resize-none bg-white/5 border-white/10 focus:border-violet-500/50 font-mono`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 pt-1 border-t border-white/5`,children:[(0,A.jsx)(`span`,{className:`font-mono text-[10px] bg-zinc-900 border border-white/5 text-zinc-500 px-2 py-0.5 rounded truncate max-w-[180px]`,children:s?.id}),(0,A.jsx)(Hz,{variant:`outline`,className:`text-[9px] border-zinc-800 text-zinc-500 uppercase`,children:s?.category})]})]}),(0,A.jsxs)(hq,{className:`gap-2 sm:gap-0`,children:[(0,A.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>c(null),className:`hive-btn--form-cancel h-10`,children:`Cancelar`}),(0,A.jsxs)(W,{size:`sm`,onClick:h,disabled:f,className:`hive-btn--form-submit h-10`,children:[f&&(0,A.jsx)(Yn,{className:`h-3.5 w-3.5 animate-spin`}),`Guardar Cambios`]})]})]})})]})}function jq({server:e,onClick:t,isConnected:n,isLoading:r}){let i=n||e.status===`connected`,a=e.transport===`stdio`;return(0,A.jsxs)(zR,{onClick:t,className:`group relative overflow-hidden transition-all hover:border-cyan-500/50 hover:shadow-lg hover:shadow-cyan-500/5 cursor-pointer border-white/5 bg-zinc-950/50 backdrop-blur-sm ${i?`border-cyan-500/20 bg-cyan-500/[0.02]`:`opacity-80 grayscale-[0.2]`} ${r?`pointer-events-none opacity-50`:``}`,children:[(0,A.jsx)(`div`,{className:`absolute top-0 left-0 w-1 h-full transition-colors ${i?`bg-cyan-500`:`bg-zinc-800`}`}),(0,A.jsxs)(BR,{className:`pb-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between mb-2`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-lg transition-colors ${i?`bg-cyan-500/10 text-cyan-400`:`bg-zinc-800 text-zinc-500`}`,children:a?(0,A.jsx)(gn,{className:`h-5 w-5`}):(0,A.jsx)(Pn,{className:`h-5 w-5`})}),(0,A.jsx)(`div`,{className:`flex items-center gap-2`,children:i?(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-full bg-cyan-500/10 border border-cyan-500/20`,children:[(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-cyan-500 animate-pulse`}),(0,A.jsx)(`span`,{className:`text-[10px] font-bold text-cyan-500 uppercase tracking-wider`,children:`LIVE`})]}):(0,A.jsx)(Hz,{variant:`outline`,className:`text-[10px] border-zinc-800 text-zinc-500 uppercase tracking-tighter`,children:`OFFLINE`})})]}),(0,A.jsx)(VR,{className:`text-sm font-bold truncate group-hover:text-cyan-400 transition-colors`,children:e.name}),(0,A.jsx)(HR,{className:`text-[10px] font-mono opacity-50 truncate mt-0.5`,children:e.url||`stdio: ${e.transport}`})]}),(0,A.jsxs)(UR,{className:`pt-0 pb-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 mt-2`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[(0,A.jsx)(`span`,{className:`text-[9px] text-zinc-500 uppercase font-bold tracking-widest`,children:`Transport`}),(0,A.jsx)(`span`,{className:`text-xs font-semibold text-zinc-300`,children:e.transport})]}),(0,A.jsx)(`div`,{className:`h-4 w-px bg-white/10`}),(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[(0,A.jsx)(`span`,{className:`text-[9px] text-zinc-500 uppercase font-bold tracking-widest`,children:`Tools`}),(0,A.jsxs)(`span`,{className:`text-xs font-semibold text-zinc-300`,children:[e.tools?.length||e.tools_count||0,` expuestas`]})]})]}),e.builtin&&(0,A.jsx)(Hz,{variant:`outline`,className:`mt-3 text-[9px] border-amber-500/20 text-amber-500/70 bg-amber-500/5`,children:`BUILTIN`})]}),i&&(0,A.jsx)(`div`,{className:`absolute -bottom-6 -right-6 w-12 h-12 bg-cyan-500/10 blur-2xl rounded-full`})]})}function Mq({serverId:e,serverName:t,tools:n=[]}){let[r,i]=(0,u.useState)(``),a=n.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())||e.description.toLowerCase().includes(r.toLowerCase()));return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 relative`,children:[(0,A.jsx)(gr,{className:`absolute left-2.5 top-2.5 h-3.5 w-3.5 text-zinc-500`}),(0,A.jsx)(G,{placeholder:`Buscar herramientas...`,className:`pl-8 h-8 text-[11px] bg-white/5 border-white/10 focus:border-cyan-500/30`,value:r,onChange:e=>i(e.target.value)})]}),(0,A.jsx)(`div`,{className:`space-y-2 max-h-[300px] overflow-y-auto pr-1 custom-scrollbar`,children:a.length===0?(0,A.jsx)(`div`,{className:`py-8 text-center text-[10px] text-zinc-500 italic`,children:r?`No se encontraron herramientas que coincidan.`:`Este servidor no expone herramientas actualmente.`}):a.map(e=>(0,A.jsxs)(`div`,{className:`p-3 rounded-lg bg-zinc-900/50 border border-white/5 hover:border-cyan-500/20 transition-all group`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`p-1.5 rounded bg-cyan-500/5 text-cyan-400 group-hover:bg-cyan-500/10 transition-colors`,children:(0,A.jsx)(Ln,{className:`h-3.5 w-3.5`})}),(0,A.jsx)(`h5`,{className:`text-[11px] font-bold text-zinc-200 group-hover:text-cyan-400 transition-colors`,children:e.name})]}),e.inputSchema&&(0,A.jsx)(Hz,{variant:`outline`,className:`text-[9px] border-zinc-800 text-zinc-600 h-4`,children:`JSON Schema`})]}),(0,A.jsx)(`p`,{className:`mt-1.5 text-[10px] text-zinc-500 leading-relaxed line-clamp-2`,children:e.description})]},e.name))}),(0,A.jsxs)(`div`,{className:`p-2 rounded bg-cyan-500/5 border border-cyan-500/10 flex items-center gap-2`,children:[(0,A.jsx)(Hn,{className:`h-3 w-3 text-cyan-500`}),(0,A.jsxs)(`span`,{className:`text-[9px] text-cyan-200/50`,children:[`Estas herramientas son gestionadas directamente por `,(0,A.jsx)(`span`,{className:`text-cyan-400 font-mono`,children:t}),`.`]})]})]})}function Nq(e){return e?e[`x-api-key`]?{authType:`api-key`,authToken:e[`x-api-key`]}:e.Authorization?.startsWith(`Bearer `)?{authType:`bearer`,authToken:e.Authorization.replace(`Bearer `,``)}:Object.keys(e).length>0?{authType:`custom`,authToken:``}:{authType:`none`,authToken:``}:{authType:`none`,authToken:``}}function Pq({server:e,onClose:t}){let{updateMCPServer:n,toggleMCPServer:r,deleteMCPServer:i,fetchMCPServers:a}=FR(),[o,s]=(0,u.useState)(e.transport||`stdio`),[c,l]=(0,u.useState)(e.command||``),[d,f]=(0,u.useState)(e.args?.join(` `)||``),[p,m]=(0,u.useState)(e.url||``),[h,g]=(0,u.useState)(()=>Nq(e.headers).authType),[_,v]=(0,u.useState)(()=>Nq(e.headers).authToken),[y,b]=(0,u.useState)(e.headers?JSON.stringify(e.headers,null,2):``),[x,S]=(0,u.useState)(!1),[C,w]=(0,u.useState)(!1),[T,E]=(0,u.useState)(!1),[D,O]=(0,u.useState)(!0),[k,j]=(0,u.useState)(!1),[M,N]=(0,u.useState)(`config`),[P,F]=(0,u.useState)(e.status),[ee,I]=(0,u.useState)(e.active),L=P===`connected`||ee===1||ee===!0;return(0,u.useEffect)(()=>{let t=!1;return(async()=>{O(!0);try{let n=await K(`/api/mcp/servers/${e.id}`);if(t)return;s(n.transport||`stdio`),l(n.command||``),f(Array.isArray(n.args)?n.args.join(` `):``),m(n.url||``);let r=Nq(n.headers);g(r.authType),v(r.authToken),b(n.headers?JSON.stringify(n.headers,null,2):``),F(n.status||e.status),I(n.enabled?1:0)}catch{}finally{t||O(!1)}})(),()=>{t=!0}},[e.id]),(0,A.jsx)(cq,{open:!0,onOpenChange:e=>!e&&t(),children:(0,A.jsxs)(pq,{className:`sm:max-w-[500px] border-cyan-500/20 bg-zinc-950/95 backdrop-blur-xl p-0 overflow-hidden`,children:[(0,A.jsx)(`div`,{className:`absolute top-0 left-0 w-full h-1 bg-gradient-to-r from-transparent via-cyan-500/50 to-transparent`}),(0,A.jsxs)(mq,{className:`p-6 pb-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-lg ${L?`bg-cyan-500/10 text-cyan-400`:`bg-zinc-800 text-zinc-500`}`,children:(0,A.jsx)(br,{className:`h-5 w-5`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(gq,{className:`text-white flex items-center gap-2`,children:[`Configurar `,e.name,L&&(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-cyan-500 animate-pulse`})]}),(0,A.jsxs)(_q,{className:`text-[10px] font-mono opacity-50 uppercase tracking-widest mt-0.5`,children:[`ID: `,e.id,` • `,e.transport]})]})]}),!e.builtin&&(0,A.jsx)(W,{variant:`ghost`,size:`icon`,onClick:()=>j(!0),disabled:C||k,className:`text-zinc-600 hover:text-red-400 hover:bg-red-400/10 h-8 w-8 transition-colors`,title:`Eliminar Servidor`,children:(0,A.jsx)(Nr,{className:`h-4 w-4`})})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1 mt-6 border-b border-white/5`,children:[(0,A.jsxs)(`button`,{onClick:()=>N(`config`),className:`px-4 py-2 text-[10px] uppercase font-bold tracking-widest transition-all relative ${M===`config`?`text-cyan-400`:`text-zinc-500 hover:text-zinc-300`}`,children:[`Configuración`,M===`config`&&(0,A.jsx)(`div`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-cyan-500`})]}),(0,A.jsxs)(`button`,{onClick:()=>N(`tools`),className:`px-4 py-2 text-[10px] uppercase font-bold tracking-widest transition-all relative ${M===`tools`?`text-cyan-400`:`text-zinc-500 hover:text-zinc-300`}`,children:[`Herramientas`,M===`tools`&&(0,A.jsx)(`div`,{className:`absolute bottom-0 left-0 w-full h-0.5 bg-cyan-500`})]})]})]}),k&&(0,A.jsxs)(`div`,{className:`mx-6 mt-4 p-3 rounded-lg bg-red-500/10 border border-red-500/30 animate-in fade-in slide-in-from-top-2 duration-200`,children:[(0,A.jsxs)(`p`,{className:`text-xs text-red-400 font-medium mb-3`,children:[`¿Eliminar `,(0,A.jsx)(`span`,{className:`font-bold`,children:e.name}),`? Esta acción no se puede deshacer.`]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 justify-end`,children:[(0,A.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>j(!1),disabled:C,className:`h-7 px-3 text-[10px] font-bold uppercase tracking-wider text-zinc-400 hover:text-white`,children:`Cancelar`}),(0,A.jsx)(W,{size:`sm`,onClick:async()=>{w(!0);try{await K(`/api/mcp/servers/${e.id}`,{method:`DELETE`,showLoader:`Eliminando servidor...`,showError:!0}),await a(),t()}catch{}finally{w(!1),j(!1)}},disabled:C,className:`h-7 px-3 text-[10px] font-bold uppercase tracking-wider bg-red-600 hover:bg-red-500 text-white`,children:C?(0,A.jsx)(Yn,{className:`h-3 w-3 animate-spin`}):`Sí, eliminar`})]})]}),(0,A.jsx)(`div`,{className:`p-6`,children:M===`config`?(0,A.jsxs)(`div`,{className:`space-y-4 animate-in fade-in duration-300`,children:[D&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-zinc-500`,children:[(0,A.jsx)(Yn,{className:`h-3 w-3 animate-spin`}),(0,A.jsx)(`span`,{children:`Cargando configuración...`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Transporte`}),(0,A.jsxs)(BK,{value:o,onValueChange:s,children:[(0,A.jsx)(UK,{className:`bg-white/5 border-white/10 h-9`,children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{className:`bg-zinc-900 border-white/10`,children:[(0,A.jsx)(Q,{value:`stdio`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Mr,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`stdio (Binario Local)`})]})}),(0,A.jsx)(Q,{value:`sse`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Pn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`SSE (Remote HTTP)`})]})})]})]})]}),o===`stdio`?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Comando`}),(0,A.jsx)(G,{value:c,onChange:e=>l(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 h-9`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Argumentos`}),(0,A.jsx)(G,{value:d,onChange:e=>f(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 h-9`})]})]}):(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Endpoint URL`}),(0,A.jsx)(G,{value:p,onChange:e=>m(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 h-9`})]}),(0,A.jsxs)(`div`,{className:`space-y-4 pt-2 border-t border-white/5`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Autenticación`}),(0,A.jsxs)(BK,{value:h,onValueChange:g,children:[(0,A.jsx)(UK,{className:`bg-white/5 border-white/10 focus:border-cyan-500/50 h-9`,children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{className:`bg-zinc-900 border-white/10`,children:[(0,A.jsx)(Q,{value:`none`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Pn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Ninguna`})]})}),(0,A.jsx)(Q,{value:`api-key`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Wn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`API Key (x-api-key)`})]})}),(0,A.jsx)(Q,{value:`bearer`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Cr,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Bearer Token (Authorization)`})]})}),(0,A.jsx)(Q,{value:`custom`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(mn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Custom Headers (JSON)`})]})})]})]})]}),(h===`api-key`||h===`bearer`)&&(0,A.jsxs)(`div`,{className:`space-y-2 animate-in fade-in slide-in-from-top-1 duration-200`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:h===`api-key`?`API Key`:`Bearer Token`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{type:`password`,placeholder:`sk-...`,value:_,onChange:e=>v(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 transition-all h-9 pl-9`}),(0,A.jsx)(Zn,{className:`absolute left-3 top-2.5 h-3.5 w-3.5 text-zinc-500`})]})]}),h===`custom`&&(0,A.jsxs)(`div`,{className:`space-y-2 animate-in fade-in slide-in-from-top-1 duration-200`,children:[(0,A.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Headers JSON`})}),(0,A.jsx)(`textarea`,{value:y,onChange:e=>b(e.target.value),placeholder:`{ "x-custom-auth": "secret" }`,rows:3,className:`w-full bg-white/5 border border-white/10 rounded-md p-2 text-xs text-zinc-300 focus:outline-none focus:border-cyan-500/50 transition-all font-mono`})]})]})]}),(0,A.jsxs)(`div`,{className:`p-3 rounded-lg bg-zinc-900 border border-white/5 flex items-center justify-between mt-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`p-1.5 rounded-full ${L?`bg-green-500/10 text-green-400`:`bg-zinc-800 text-zinc-500`}`,children:(0,A.jsx)(ur,{className:`h-3.5 w-3.5 ${L?`animate-pulse`:``}`})}),(0,A.jsxs)(`div`,{className:`flex flex-col`,children:[(0,A.jsx)(`span`,{className:`text-[10px] font-bold text-zinc-300 uppercase tracking-tight`,children:`Estado del Nodo`}),(0,A.jsx)(`span`,{className:`text-[9px] font-mono ${L?`text-green-500`:`text-zinc-500`}`,children:L?`ACTIVE_CONNECTION`:`INACTIVE_NODE`})]})]}),(0,A.jsx)(W,{size:`sm`,variant:L?`outline`:`default`,onClick:async()=>{E(!0),Qh.show(L?`Desconectando servidor...`:`Conectando servidor...`);try{await r(e.id,!L),I(L?0:1),F(L?`disconnected`:`connected`),tg.fire({icon:`success`,title:L?`Servidor desconectado`:`Servidor conectado`}),setTimeout(a,1500)}catch{tg.fire({icon:`error`,title:`Error al cambiar estado de conexión`})}finally{E(!1),Qh.hide()}},disabled:T,className:`h-7 px-4 text-[10px] font-bold uppercase tracking-wider ${L?`border-zinc-800 text-zinc-400 hover:bg-zinc-800`:`bg-cyan-600 hover:bg-cyan-500 text-white`}`,children:T?(0,A.jsx)(Yn,{className:`h-3 w-3 animate-spin`}):L?`Desconectar`:`Conectar`})]})]}):(0,A.jsx)(`div`,{className:`animate-in fade-in duration-300`,children:(0,A.jsx)(Mq,{serverId:e.id,serverName:e.name,tools:e.tools||[]})})}),(0,A.jsxs)(hq,{className:`p-6 bg-white/[0.02] border-t border-white/5`,children:[(0,A.jsx)(W,{variant:`ghost`,onClick:t,className:`text-zinc-500 hover:text-white`,children:`Cerrar`}),M===`config`&&(0,A.jsx)(W,{onClick:async()=>{S(!0),Qh.show(`Actualizando configuración...`);try{let t={transport:o};if(o===`stdio`){if(!c){tg.fire({icon:`warning`,title:`El comando es obligatorio`});return}t.command=c;let e=d.trim();if(e.startsWith(`[`)&&e.endsWith(`]`))try{t.args=JSON.parse(e)}catch{t.args=e.match(/"[^"]*"|'[^']*'|[^\\s,]+/g)?.map(e=>e.replace(/^["']|["']$/g,``).replace(/,$/,``).trim()).filter(Boolean)||[]}else t.args=e.match(/"[^"]*"|'[^']*'|[^\\s,]+/g)?.map(e=>e.replace(/^["']|["']$/g,``).replace(/,$/,``).trim()).filter(Boolean)||[]}else if(o===`sse`){if(!p){tg.fire({icon:`warning`,title:`La URL es obligatoria`});return}t.url=p;let e={};if(h===`api-key`&&_)e[`x-api-key`]=_;else if(h===`bearer`&&_)e.Authorization=`Bearer ${_}`;else if(h===`custom`&&y.trim())try{e=JSON.parse(y.trim())}catch{tg.fire({icon:`error`,title:`JSON de Headers inválido`});return}Object.keys(e).length>0&&(t.headers=e)}await n(e.id,t),await a(),tg.fire({icon:`success`,title:`Configuración actualizada`})}catch(e){tg.fire({icon:`error`,title:e instanceof Error?e.message:`Error al actualizar configuración`})}finally{S(!1),Qh.hide()}},disabled:x,className:`bg-cyan-600 hover:bg-cyan-500 text-white min-w-[120px]`,children:x?(0,A.jsx)(Yn,{className:`h-4 w-4 animate-spin`}):`Guardar Cambios`})]})]})})}function Fq(){let{fetchMCPServers:e}=FR(),[t,n]=(0,u.useState)(!1),[r,i]=(0,u.useState)(``),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(``),[l,d]=(0,u.useState)(`stdio`),[f,p]=(0,u.useState)(``),[m,h]=(0,u.useState)(`none`),[g,_]=(0,u.useState)(``),[v,y]=(0,u.useState)(``),[b,x]=(0,u.useState)(!1);return(0,A.jsxs)(cq,{open:t,onOpenChange:n,children:[(0,A.jsx)(lq,{asChild:!0,children:(0,A.jsxs)(W,{className:`bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-600/20 gap-2`,children:[(0,A.jsx)(lr,{className:`h-4 w-4`}),`Añadir Servidor MCP`]})}),(0,A.jsxs)(pq,{className:`sm:max-w-[425px] border-cyan-500/20 bg-zinc-950/95 backdrop-blur-xl`,children:[(0,A.jsxs)(mq,{children:[(0,A.jsxs)(gq,{className:`flex items-center gap-2 text-white`,children:[(0,A.jsx)(`div`,{className:`p-1.5 rounded-md bg-cyan-500/10 text-cyan-400`,children:(0,A.jsx)(yr,{className:`h-4 w-4`})}),`Nuevo Servidor MCP`]}),(0,A.jsx)(_q,{className:`text-zinc-400`,children:`Conecta una nueva fuente de herramientas para tus agentes mediante el protocolo MCP.`})]}),(0,A.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`mcp-name`,className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Nombre Identificador`}),(0,A.jsx)(G,{id:`mcp-name`,placeholder:`github-tools`,value:r,onChange:e=>i(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 transition-all h-9`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Protocolo de Transporte`}),(0,A.jsxs)(BK,{value:l,onValueChange:d,children:[(0,A.jsx)(UK,{className:`bg-white/5 border-white/10 focus:border-cyan-500/50 h-9`,children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{className:`bg-zinc-900 border-white/10`,children:[(0,A.jsx)(Q,{value:`stdio`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Mr,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`stdio (Binario Local)`})]})}),(0,A.jsx)(Q,{value:`sse`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Pn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`SSE (Remote HTTP)`})]})})]})]})]}),l===`stdio`?(0,A.jsxs)(`div`,{className:`space-y-4 animate-in fade-in slide-in-from-top-2 duration-300`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`mcp-cmd`,className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Comando Ejecutable`}),(0,A.jsx)(G,{id:`mcp-cmd`,placeholder:`npx`,value:a,onChange:e=>o(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 transition-all h-9`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`mcp-args`,className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Argumentos`}),(0,A.jsx)(G,{id:`mcp-args`,placeholder:`-y @modelcontextprotocol/server-github`,value:s,onChange:e=>c(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 transition-all h-9`})]})]}):(0,A.jsxs)(`div`,{className:`space-y-4 animate-in fade-in slide-in-from-top-2 duration-300`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`mcp-url`,className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Endpoint URL`}),(0,A.jsx)(G,{id:`mcp-url`,placeholder:`https://mcp-server.com/sse`,value:f,onChange:e=>p(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 transition-all h-9`})]}),(0,A.jsxs)(`div`,{className:`space-y-4 pt-2 border-t border-white/5`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Autenticación`}),(0,A.jsxs)(BK,{value:m,onValueChange:h,children:[(0,A.jsx)(UK,{className:`bg-white/5 border-white/10 focus:border-cyan-500/50 h-9`,children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{className:`bg-zinc-900 border-white/10`,children:[(0,A.jsx)(Q,{value:`none`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Pn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Ninguna`})]})}),(0,A.jsx)(Q,{value:`api-key`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Wn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`API Key (x-api-key)`})]})}),(0,A.jsx)(Q,{value:`bearer`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Cr,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Bearer Token (Authorization)`})]})}),(0,A.jsx)(Q,{value:`google-api-key`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Wn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Google API Key (X-Goog-Api-Key)`})]})}),(0,A.jsx)(Q,{value:`custom`,className:`focus:bg-cyan-500/20 focus:text-cyan-400`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(mn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Custom Headers (JSON)`})]})})]})]})]}),(m===`api-key`||m===`google-api-key`||m===`bearer`)&&(0,A.jsxs)(`div`,{className:`space-y-2 animate-in fade-in slide-in-from-top-1 duration-200`,children:[(0,A.jsx)(Z,{htmlFor:`mcp-token`,className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:m===`api-key`?`API Key`:m===`google-api-key`?`Google API Key`:`Bearer Token`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{id:`mcp-token`,type:`password`,placeholder:`sk-...`,value:g,onChange:e=>_(e.target.value),className:`bg-white/5 border-white/10 focus:border-cyan-500/50 transition-all h-9 pl-9`}),(0,A.jsx)(Zn,{className:`absolute left-3 top-2.5 h-3.5 w-3.5 text-zinc-500`})]})]}),m===`custom`&&(0,A.jsxs)(`div`,{className:`space-y-2 animate-in fade-in slide-in-from-top-1 duration-200`,children:[(0,A.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,A.jsx)(Z,{htmlFor:`mcp-headers`,className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Headers JSON`})}),(0,A.jsx)(`textarea`,{id:`mcp-headers`,placeholder:`{ "x-custom-auth": "secret" }`,rows:3,value:v,onChange:e=>{let t=e.target.value;y(t);try{t.trim()&&JSON.parse(t.trim()),e.target.style.borderColor=``}catch{t.trim()?e.target.style.borderColor=`rgba(239, 68, 68, 0.5)`:e.target.style.borderColor=``}},className:`w-full bg-white/5 border border-white/10 rounded-md p-2 text-xs text-zinc-300 focus:outline-none focus:border-cyan-500/50 transition-all font-mono`})]})]})]}),(0,A.jsxs)(`div`,{className:`p-3 rounded-lg bg-cyan-500/5 border border-cyan-500/10 flex items-center gap-3`,children:[(0,A.jsx)(sn,{className:`h-5 w-5 text-cyan-500 shrink-0`}),(0,A.jsx)(`div`,{className:`text-[10px] text-cyan-200/70`,children:`El servidor se inicializará y validará inmediatamente después de ser añadido.`})]})]}),(0,A.jsxs)(hq,{children:[(0,A.jsx)(W,{variant:`ghost`,onClick:()=>n(!1),className:`hover:bg-white/5 text-zinc-400 h-9 text-xs`,children:`Cancelar`}),(0,A.jsx)(W,{onClick:async()=>{if(!r){tg.fire({icon:`error`,title:`El nombre es obligatorio`});return}x(!0);try{let t={transport:l};if(l===`stdio`){if(!a){tg.fire({icon:`error`,title:`El comando es obligatorio para transporte stdio`}),x(!1);return}t.command=a;let e=s.trim();if(e.startsWith(`[`)&&e.endsWith(`]`))try{t.args=JSON.parse(e)}catch{t.args=e.match(/"[^"]*"|'[^']*'|[^\\s,]+/g)?.map(e=>e.replace(/^["']|["']$/g,``).replace(/,$/,``).trim()).filter(Boolean)||[]}else t.args=e.match(/"[^"]*"|'[^']*'|[^\\s,]+/g)?.map(e=>e.replace(/^["']|["']$/g,``).replace(/,$/,``).trim()).filter(Boolean)||[]}else{if(!f){tg.fire({icon:`error`,title:`La URL es obligatoria para transporte SSE`}),x(!1);return}t.url=f;let e={};if(m===`api-key`&&g)e[`x-api-key`]=g;else if(m===`google-api-key`&&g)e[`X-Goog-Api-Key`]=g;else if(m===`bearer`&&g)e.Authorization=`Bearer ${g}`;else if(m===`custom`&&v.trim())try{e=JSON.parse(v.trim())}catch{eg.fire(`Error`,`JSON de Headers inválido`,`error`),x(!1);return}Object.keys(e).length>0&&(t.headers=e)}await K(`/api/mcp/servers`,{method:`POST`,body:{name:r,config:t},showLoader:`Conectando servidor MCP...`,showError:!0}),tg.fire({icon:`success`,title:`Servidor "${r}" añadido correctamente`}),i(``),o(``),c(``),p(``),h(`none`),_(``),y(``),n(!1),await e()}catch{}finally{x(!1)}},disabled:b,className:`bg-cyan-600 hover:bg-cyan-500 text-white shadow-lg shadow-cyan-600/20 h-9 text-xs px-6`,children:b?`Conectando...`:`Conectar Servidor`})]})]})]})}function Iq(){let{servers:e,activeServers:t,isLoading:n,fetchMCPServers:r}=FR(),[i,a]=(0,u.useState)(null),[o,s]=(0,u.useState)(``);(0,u.useEffect)(()=>{r()},[r]);let c=e.filter(e=>e.name.toLowerCase().includes(o.toLowerCase())),l=e=>{a({...e,args:typeof e.args==`string`?JSON.parse(e.args):e.args})};return(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-white/5 pb-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-lg bg-cyan-500/10 text-cyan-400`,children:(0,A.jsx)(yr,{className:`h-5 w-5`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h4`,{className:`text-sm font-bold text-white uppercase tracking-wider`,children:`MCP Ecosystem`}),(0,A.jsx)(`p`,{className:`text-[10px] text-zinc-500 font-mono`,children:`Model Context Protocol Servers`})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsxs)(`div`,{className:`relative group`,children:[(0,A.jsx)(gr,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-zinc-500 group-focus-within:text-cyan-400 transition-colors`}),(0,A.jsx)(G,{placeholder:`Buscar servidor...`,value:o,onChange:e=>s(e.target.value),className:`pl-9 bg-zinc-900/50 border-white/5 focus:border-cyan-500/30 transition-all h-9 w-[260px] text-xs`})]}),(0,A.jsx)(Fq,{})]})]}),c.length===0?(0,A.jsxs)(`div`,{className:`py-16 flex flex-col items-center justify-center border border-dashed border-white/10 rounded-2xl bg-zinc-950/20 group hover:border-cyan-500/20 transition-colors`,children:[(0,A.jsx)(`div`,{className:`p-4 rounded-full bg-zinc-900 mb-4 group-hover:scale-110 transition-transform`,children:(0,A.jsx)(Fr,{className:`h-8 w-8 text-zinc-700 group-hover:text-cyan-500/50 transition-colors`})}),(0,A.jsx)(`p`,{className:`text-xs text-zinc-500 font-medium`,children:`No se detectan servidores MCP configurados.`}),(0,A.jsx)(`p`,{className:`text-[10px] text-zinc-600 mt-1`,children:`Añade uno para expandir las capacidades de tus agentes.`})]}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4`,children:c.map(e=>(0,A.jsx)(jq,{server:e,isConnected:e.status===`connected`||e.active===1,onClick:()=>l(e)},e.id))}),i&&(0,A.jsx)(Pq,{server:i,onClose:()=>a(null)})]})}var Lq=[{value:`auto`,label:`Auto — detectar mejor canal`},{value:`webchat`,label:`Web Chat`},{value:`telegram`,label:`Telegram`},{value:`discord`,label:`Discord`}];function Rq(e){return e.split(` `).map(e=>e[0]).slice(0,2).join(``).toUpperCase()||`?`}function zq(){let{fetchUser:e,saveUser:t,isLoading:n}=ig(),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)({name:``,occupation:``,language:``,timezone:``,preferred_cron_channel:`auto`,notes:``});(0,u.useEffect)(()=>{e().then(e=>{e&&o({name:e.name||``,occupation:e.occupation||``,language:e.language||``,timezone:e.timezone||``,preferred_cron_channel:e.preferred_cron_channel||`auto`,notes:e.notes||``})}).catch(console.error)},[e]);let s=(e,t)=>o(n=>({...n,[e]:t}));return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border border-white/10 bg-zinc-950/60 backdrop-blur-xl shadow-2xl`,children:[(0,A.jsxs)(`div`,{className:`absolute inset-0 pointer-events-none`,children:[(0,A.jsx)(`div`,{className:`absolute -top-10 -left-10 w-48 h-48 bg-blue-600/20 rounded-full blur-3xl`}),(0,A.jsx)(`div`,{className:`absolute -bottom-10 -right-10 w-48 h-48 bg-indigo-600/15 rounded-full blur-3xl`})]}),(0,A.jsx)(`div`,{className:`relative h-20 bg-gradient-to-r from-blue-600/30 via-indigo-600/20 to-violet-600/10`,children:(0,A.jsx)(`div`,{className:`absolute inset-0 bg-[repeating-linear-gradient(45deg,transparent,transparent_12px,rgba(255,255,255,0.015)_12px,rgba(255,255,255,0.015)_13px)]`})}),(0,A.jsxs)(`div`,{className:`relative px-6 pb-6`,children:[(0,A.jsxs)(`div`,{className:`relative -mt-8 mb-4 w-fit`,children:[(0,A.jsx)(`div`,{className:`h-16 w-16 rounded-2xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center shadow-lg shadow-blue-500/30 ring-2 ring-zinc-950 text-white font-bold text-xl tracking-tight`,children:Rq(a.name)}),(0,A.jsx)(`span`,{className:`absolute -bottom-1 -right-1 h-4 w-4 rounded-full bg-emerald-500 border-2 border-zinc-950 shadow`})]}),(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-1 min-w-0`,children:[(0,A.jsx)(`h3`,{className:`text-lg font-bold text-white leading-tight truncate`,children:a.name||(0,A.jsx)(`span`,{className:`text-zinc-500 italic text-sm font-normal`,children:`Sin nombre`})}),a.occupation&&(0,A.jsx)(`p`,{className:`text-sm text-zinc-400`,children:a.occupation}),(0,A.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 pt-1`,children:[a.language&&(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] text-zinc-400 bg-white/5 border border-white/10 rounded-full px-2.5 py-0.5`,children:[(0,A.jsx)(Pn,{className:`h-3 w-3`}),a.language]}),a.timezone&&(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] text-zinc-400 bg-white/5 border border-white/10 rounded-full px-2.5 py-0.5`,children:[(0,A.jsx)(fn,{className:`h-3 w-3`}),a.timezone]}),a.preferred_cron_channel!==`auto`&&(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] text-zinc-400 bg-white/5 border border-white/10 rounded-full px-2.5 py-0.5`,children:[(0,A.jsx)(Gt,{className:`h-3 w-3`}),a.preferred_cron_channel]})]})]}),(0,A.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>i(e=>!e),className:`shrink-0 border-white/10 bg-white/5 hover:bg-white/10 text-zinc-300 gap-1.5 h-8 text-xs`,children:[r?(0,A.jsx)(Ur,{className:`h-3 w-3`}):(0,A.jsx)(sr,{className:`h-3 w-3`}),r?`Cancelar`:`Editar`]})]})]})]}),r&&(0,A.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border border-white/10 bg-zinc-950/60 backdrop-blur-xl shadow-2xl animate-in fade-in slide-in-from-top-2 duration-200`,children:[(0,A.jsx)(`div`,{className:`absolute inset-0 pointer-events-none`,children:(0,A.jsx)(`div`,{className:`absolute -top-8 -right-8 w-40 h-40 bg-blue-600/10 rounded-full blur-3xl`})}),(0,A.jsxs)(`div`,{className:`relative flex items-center gap-3 px-6 pt-5 pb-4 border-b border-white/5`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-lg bg-blue-500/10 text-blue-400`,children:(0,A.jsx)(Lr,{className:`h-4 w-4`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-sm font-bold text-white uppercase tracking-wider`,children:`Editar perfil`}),(0,A.jsx)(`p`,{className:`text-[10px] text-zinc-500`,children:`Datos personales y preferencias`})]})]}),(0,A.jsxs)(`div`,{className:`relative p-6 space-y-6`,children:[(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Identidad`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsxs)(Z,{className:`text-[10px] text-zinc-500 flex items-center gap-1.5`,children:[(0,A.jsx)(Lr,{className:`h-3 w-3`}),` Nombre completo`]}),(0,A.jsx)(G,{placeholder:`John Doe`,value:a.name,onChange:e=>s(`name`,e.target.value),className:`bg-white/5 border-white/10 focus:border-blue-500/50 h-9 text-sm transition-all`})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsxs)(Z,{className:`text-[10px] text-zinc-500 flex items-center gap-1.5`,children:[(0,A.jsx)(Yt,{className:`h-3 w-3`}),` Ocupación`]}),(0,A.jsx)(G,{placeholder:`AI Engineer`,value:a.occupation,onChange:e=>s(`occupation`,e.target.value),className:`bg-white/5 border-white/10 focus:border-blue-500/50 h-9 text-sm transition-all`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Localización`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsxs)(Z,{className:`text-[10px] text-zinc-500 flex items-center gap-1.5`,children:[(0,A.jsx)(Pn,{className:`h-3 w-3`}),` Idioma`]}),(0,A.jsx)(G,{placeholder:`Spanish`,value:a.language,onChange:e=>s(`language`,e.target.value),className:`bg-white/5 border-white/10 focus:border-blue-500/50 h-9 text-sm transition-all`})]}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsxs)(Z,{className:`text-[10px] text-zinc-500 flex items-center gap-1.5`,children:[(0,A.jsx)(fn,{className:`h-3 w-3`}),` Zona horaria`]}),(0,A.jsx)(G,{placeholder:`America/Bogota`,value:a.timezone,onChange:e=>s(`timezone`,e.target.value),className:`bg-white/5 border-white/10 focus:border-blue-500/50 h-9 text-sm transition-all`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Notificaciones`}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsxs)(Z,{className:`text-[10px] text-zinc-500 flex items-center gap-1.5`,children:[(0,A.jsx)(Gt,{className:`h-3 w-3`}),` Canal preferido para Cron Jobs`]}),(0,A.jsxs)(BK,{value:a.preferred_cron_channel,onValueChange:e=>s(`preferred_cron_channel`,e),children:[(0,A.jsx)(UK,{className:`bg-white/5 border-white/10 focus:border-blue-500/50 h-9 text-sm`,children:(0,A.jsx)(HK,{})}),(0,A.jsx)(KK,{className:`bg-zinc-900 border-white/10`,children:Lq.map(e=>(0,A.jsx)(Q,{value:e.value,className:`text-sm focus:bg-blue-500/20 focus:text-blue-400`,children:e.label},e.value))})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{className:`text-[10px] font-bold text-zinc-500 uppercase tracking-widest`,children:`Contexto para el agente`}),(0,A.jsx)(uG,{placeholder:`Describe tu perfil, preferencias de trabajo, estilo de comunicación...`,value:a.notes,onChange:e=>s(`notes`,e.target.value),className:`bg-white/5 border-white/10 focus:border-blue-500/50 text-sm resize-none min-h-[100px] transition-all`})]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-1 border-t border-white/5`,children:[(0,A.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>i(!1),className:`text-zinc-400 hover:bg-white/5 h-9 text-xs`,children:`Cancelar`}),(0,A.jsxs)(W,{onClick:async()=>{Qh.show(`Guardando perfil de usuario...`);try{let e=await t(a);tg.fire({icon:`success`,title:e}),i(!1)}catch(e){tg.fire({icon:`error`,title:e instanceof Error?e.message:`Error al guardar el perfil`})}finally{Qh.hide()}},disabled:n,className:`bg-blue-600 hover:bg-blue-500 text-white shadow-lg shadow-blue-600/20 gap-2 h-9 text-xs px-6`,children:[n?(0,A.jsx)(Yn,{className:`h-4 w-4 animate-spin`}):(0,A.jsx)(mr,{className:`h-4 w-4`}),`Guardar cambios`]})]})]})]})]})}var Bq=e=>{let t=e.toLowerCase();return t.includes(`code`)||t.includes(`program`)?(0,A.jsx)(pn,{className:`h-4 w-4`}):t.includes(`research`)||t.includes(`investiga`)?(0,A.jsx)(gr,{className:`h-4 w-4`}):t.includes(`write`)||t.includes(`escrib`)?(0,A.jsx)(er,{className:`h-4 w-4`}):t.includes(`data`)||t.includes(`anal`)||t.includes(`estad`)?(0,A.jsx)(Qt,{className:`h-4 w-4`}):t.includes(`trans`)||t.includes(`traduc`)?(0,A.jsx)(Gn,{className:`h-4 w-4`}):t.includes(`web`)||t.includes(`glob`)?(0,A.jsx)(Pn,{className:`h-4 w-4`}):(0,A.jsx)(Wr,{className:`h-4 w-4`})};function Vq({skill:e,onClick:t,className:n}){let r=!!e.active;return(0,A.jsxs)(`div`,{onClick:t,className:`hive-card group transition-all duration-500 cursor-pointer ${r?`hive-card--active border-blue-500/20`:`opacity-60 grayscale-[0.8] hover:opacity-100 hover:grayscale-0`} ${n}`,children:[(0,A.jsxs)(`div`,{className:`hive-card-body`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between mb-6`,children:[(0,A.jsx)(`div`,{className:`h-12 w-12 rounded-xl flex items-center justify-center border transition-all duration-500 ${r?`bg-blue-500/10 border-blue-500/30 text-blue-400 shadow-blue-glow`:`bg-white/5 border-white/10 text-white/30`}`,children:Bq(e.name)}),(0,A.jsx)(`div`,{className:`h-6 w-6 rounded-full border border-white/5 bg-white/5 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity`,children:(0,A.jsx)(Dr,{className:`h-3 w-3 text-blue-400`})})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-lg font-black text-white uppercase tracking-tighter mb-1 line-clamp-1 group-hover:text-blue-400 transition-colors`,children:e.name}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 font-medium leading-relaxed line-clamp-2 h-8`,children:e.body?.substring(0,100)||e.category})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-white/5 flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`CATEGORY`}),(0,A.jsx)(`span`,{className:`hive-stat__value truncate max-w-[80px]`,children:e.category||`GENERAL`})]}),(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`TOOLS`}),(0,A.jsx)(`span`,{className:`hive-stat__value`,children:e.tools?e.tools.split(`,`).length:0})]})]}),(0,A.jsxs)(`div`,{className:`opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-1.5 text-[9px] font-black text-blue-400 uppercase tracking-widest`,children:[`DETALLES`,(0,A.jsx)(gn,{className:`h-3 w-3`})]})]})]})]}),(0,A.jsx)(`div`,{className:`hive-strip--bottom ${r?`bg-blue-500`:`bg-white/10`}`})]})}function Hq(){let{skills:e,isLoading:t,fetchSkills:n,toggleSkill:r,updateSkill:i}=PR(),[a,o]=(0,u.useState)(null),[s,c]=(0,u.useState)({name:``,body:``,tools:``,triggers:``,category:``,version:1,active:!0}),[l,d]=(0,u.useState)(null),[f,p]=(0,u.useState)(!1),[m,h]=(0,u.useState)(!1),[g,_]=(0,u.useState)(!1),v=(0,u.useRef)(null),y=()=>{let e=v.current;e&&(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)};(0,u.useEffect)(()=>{a&&setTimeout(y,0)},[a,s.body]),(0,u.useEffect)(()=>{n()},[n]);let b=async(e,t)=>{if(!l){d(e);try{await r(e,t),await n(),tg.fire({icon:`success`,title:t?`Skill habilitado`:`Skill deshabilitado`})}catch{tg.fire({icon:`error`,title:`Error al cambiar estado del skill`})}finally{d(null)}}},x=async()=>{if(a){_(!0);try{await K(`/api/skills/${a.id}`,{method:`DELETE`,showError:!0}),tg.fire({icon:`success`,title:`Skill eliminado`}),n(),o(null)}catch{tg.fire({icon:`error`,title:`Error al eliminar skill`})}finally{_(!1),h(!1)}}},S=e=>{h(!1),o(e),c({name:e.name,body:e.body||``,tools:e.tools||``,triggers:e.triggers||``,category:e.category||``,version:Number(e.version)||1,active:!!e.active})};return t&&e.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 space-y-4`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(Yn,{className:`h-10 w-10 animate-spin text-primary/40`}),(0,A.jsx)(Dr,{className:`h-4 w-4 text-primary absolute -top-1 -right-1 animate-pulse`})]}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground animate-pulse`,children:`Cargando habilidades premium...`})]}):(0,A.jsxs)(`div`,{className:`space-y-6 animate-in fade-in duration-500`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-8`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(`h3`,{className:`hive-title-section !text-lg`,children:`Habilidades del Sistema`}),(0,A.jsxs)(`span`,{className:`hive-tag bg-blue-500/10 text-blue-400 border-blue-500/20`,children:[e.length,` ACTIVAS`]})]}),(0,A.jsx)(`p`,{className:`hive-subtitle !mt-0 !text-xs`,children:`Gestiona los módulos cognitivos que otorgan capacidades autónomas a tus agentes.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] uppercase tracking-widest font-black text-white/20 bg-white/5 px-4 py-2 rounded-xl border border-white/5`,children:[(0,A.jsx)(Hn,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{children:`Click en skill para configurar`})]})]}),e.length===0?(0,A.jsx)(`div`,{className:`hive-card border-dashed border-white/10 bg-white/[0.02]`,children:(0,A.jsxs)(`div`,{className:`hive-card-body flex flex-col items-center justify-center py-16 px-4`,children:[(0,A.jsx)(`div`,{className:`h-16 w-16 rounded-2xl bg-white/5 flex items-center justify-center mb-6`,children:(0,A.jsx)(zr,{className:`h-8 w-8 text-white/20`})}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`hive-title-section text-center mb-2`,children:`No se detectan habilidades`}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 mb-8 max-w-[300px] mx-auto leading-relaxed`,children:`El repositorio de habilidades está vacío. Visita el Marketplace para descargar nuevos nodos cognitivos.`})]}),(0,A.jsx)(`button`,{className:`hive-btn hive-btn--primary px-8`,children:`Explorar Marketplace`})]})}):(0,A.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-6`,children:e.map(e=>(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(Vq,{skill:e,onClick:()=>S(e)}),(0,A.jsxs)(`div`,{className:`absolute top-6 right-6 z-20 pointer-events-auto flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-[9px] font-black tracking-widest ${e.active?`text-blue-400`:`text-white/20`}`,children:e.active?`HABILITADO`:`DESACTIVADO`}),(0,A.jsx)(sq,{checked:!!e.active,disabled:l===e.id,onClick:e=>e.stopPropagation(),onCheckedChange:t=>b(e.id,t),className:`scale-75 data-[state=checked]:bg-blue-500`})]})]},e.id))}),(0,A.jsx)(cq,{open:!!a,onOpenChange:e=>{e||(o(null),h(!1))},children:(0,A.jsxs)(pq,{className:`max-w-3xl bg-zinc-950 border-white/10 text-white p-0 overflow-hidden shadow-2xl`,children:[(0,A.jsx)(`div`,{className:`p-6 border-b border-white/5 bg-white/5`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`h-10 w-10 rounded-lg bg-blue-500/10 border border-blue-500/20 flex items-center justify-center`,children:(0,A.jsx)(gn,{className:`h-5 w-5 text-blue-400`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(gq,{className:`text-lg font-bold text-white uppercase tracking-tight`,children:`Propiedades del Nodo de Habilidad`}),(0,A.jsx)(_q,{className:`text-xs text-white/40`,children:`Editor granular de capacidades cognitivas y herramientas vinculadas.`})]})]}),(0,A.jsx)(W,{variant:`ghost`,size:`icon`,onClick:()=>h(!0),disabled:g||m,className:`text-zinc-600 hover:text-red-400 hover:bg-red-400/10 h-8 w-8 transition-colors shrink-0`,title:`Eliminar Skill`,children:(0,A.jsx)(Nr,{className:`h-4 w-4`})})]})}),m&&(0,A.jsxs)(`div`,{className:`mx-6 mt-4 p-3 rounded-lg bg-red-500/10 border border-red-500/30 animate-in fade-in slide-in-from-top-2 duration-200`,children:[(0,A.jsxs)(`p`,{className:`text-xs text-red-400 font-medium mb-3`,children:[`¿Eliminar `,(0,A.jsx)(`span`,{className:`font-bold`,children:a?.name}),`? Esta acción no se puede deshacer.`]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 justify-end`,children:[(0,A.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>h(!1),disabled:g,className:`h-7 px-3 text-[10px] font-bold uppercase tracking-wider text-zinc-400 hover:text-white`,children:`Cancelar`}),(0,A.jsx)(W,{size:`sm`,onClick:x,disabled:g,className:`h-7 px-3 text-[10px] font-bold uppercase tracking-wider bg-red-600 hover:bg-red-500 text-white`,children:g?(0,A.jsx)(Yn,{className:`h-3 w-3 animate-spin`}):`Sí, eliminar`})]})]}),(0,A.jsxs)(`div`,{className:`p-8 space-y-8 max-h-[70vh] overflow-y-auto custom-scrollbar`,children:[(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(`div`,{className:`h-1 w-8 bg-blue-500 rounded-full`}),(0,A.jsx)(`span`,{className:`text-[10px] font-black tracking-widest text-white/40 uppercase`,children:`Información General`})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`skill-name`,className:`text-[10px] uppercase tracking-widest text-white/60`,children:`Nombre del Nodo`}),(0,A.jsx)(G,{id:`skill-name`,value:s.name,onChange:e=>c(t=>({...t,name:e.target.value})),className:`bg-white/5 border-white/10 focus-visible:ring-blue-500/30 text-white font-medium`,placeholder:`Ej: canvas_dashboard`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`skill-category`,className:`text-[10px] uppercase tracking-widest text-white/60`,children:`Categoría Funcional`}),(0,A.jsx)(G,{id:`skill-category`,value:s.category,onChange:e=>c(t=>({...t,category:e.target.value})),className:`bg-white/5 border-white/10 focus-visible:ring-blue-500/30 text-white/70`,placeholder:`Ej: visualización, análisis...`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(`div`,{className:`h-1 w-8 bg-blue-500 rounded-full`}),(0,A.jsx)(`span`,{className:`text-[10px] font-black tracking-widest text-white/40 uppercase`,children:`Capacidades y Activación`})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`skill-tools`,className:`text-[10px] uppercase tracking-widest text-white/60`,children:`Herramientas Vinculadas (CSV)`}),(0,A.jsx)(G,{id:`skill-tools`,value:s.tools,onChange:e=>c(t=>({...t,tools:e.target.value})),className:`bg-white/5 border-white/10 focus-visible:ring-blue-500/30 text-white/80 font-mono text-[11px]`,placeholder:`tool1, tool2, tool3...`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`skill-triggers`,className:`text-[10px] uppercase tracking-widest text-white/60`,children:`Frases de Activación / Triggers (CSV)`}),(0,A.jsx)(G,{id:`skill-triggers`,value:s.triggers,onChange:e=>c(t=>({...t,triggers:e.target.value})),className:`bg-white/5 border-white/10 focus-visible:ring-blue-500/30 text-white/80 font-mono text-[11px]`,placeholder:`mostrar panel, dashboard...`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsx)(`div`,{className:`h-1 w-8 bg-blue-500 rounded-full`}),(0,A.jsx)(`span`,{className:`text-[10px] font-black tracking-widest text-white/40 uppercase`,children:`Cuerpo / Lógica del Nodo`})]}),(0,A.jsx)(`div`,{className:`space-y-2`,children:(0,A.jsx)(uG,{ref:v,value:s.body,onChange:e=>{c(t=>({...t,body:e.target.value})),y()},className:`min-h-[160px] resize-none bg-white/5 border-white/10 focus-visible:ring-blue-500/30 text-white/80 text-sm overflow-hidden font-sans leading-relaxed p-4`,placeholder:`Instrucciones detalladas y lógica de ejecución...`})})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-6 pt-4 border-t border-white/5`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`skill-version`,className:`text-[10px] uppercase tracking-widest text-white/60`,children:`Versión del Skill`}),(0,A.jsx)(G,{id:`skill-version`,type:`number`,step:`0.1`,value:s.version,onChange:e=>c(t=>({...t,version:Number(e.target.value)})),className:`bg-white/5 border-white/10 focus-visible:ring-blue-500/30 text-white w-32`})]}),(0,A.jsxs)(`div`,{className:`flex flex-col justify-center space-y-3`,children:[(0,A.jsx)(Z,{className:`text-[10px] uppercase tracking-widest text-white/60`,children:`Estado del Nodo`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-4 bg-white/5 p-3 rounded-xl border border-white/10 w-fit`,children:[(0,A.jsx)(`div`,{className:`h-2 w-2 rounded-full ${s.active?`bg-blue-500 shadow-blue-glow animate-pulse`:`bg-white/20`}`}),(0,A.jsx)(`span`,{className:`text-[10px] font-black tracking-widest ${s.active?`text-white`:`text-white/40`}`,children:s.active?`OPERATIVO / ACTIVO`:`FUERA DE LÍNEA / INACTIVO`}),(0,A.jsx)(sq,{checked:s.active,onCheckedChange:e=>c(t=>({...t,active:e})),className:`data-[state=checked]:bg-blue-500`})]})]})]})]}),(0,A.jsxs)(hq,{className:`p-6 bg-white/5 flex items-center justify-end gap-3 border-t border-white/5 sm:justify-end`,children:[(0,A.jsx)(W,{variant:`ghost`,className:`text-[10px] font-black tracking-widest hover:bg-white/5 hover:text-white text-white/40 uppercase`,onClick:()=>o(null),children:`Cancelar`}),(0,A.jsx)(W,{className:`bg-blue-600 hover:bg-blue-500 text-white font-black text-[10px] tracking-widest px-8 rounded-lg shadow-lg shadow-blue-900/20 uppercase`,onClick:async()=>{if(a){p(!0),Qh.show(`Guardando skill...`);try{await i(a.id,s),tg.fire({icon:`success`,title:`Skill actualizado correctamente`}),n(),o(null)}catch{tg.fire({icon:`error`,title:`Error al actualizar skill`})}finally{p(!1),Qh.hide()}}},disabled:f,children:f?`PROCESANDO...`:`Sincronizar Propiedades`})]})]})})]})}var Uq={groq:{name:`Groq`,description:`STT (Speech-to-Text) - Transcripción de audio ultra-rápida`,logo:`🔴`,consoleUrl:`https://console.groq.com/keys`},elevenlabs:{name:`ElevenLabs`,description:`TTS (Text-to-Speech) - Voces neuronales de alta calidad`,logo:`🎙️`,consoleUrl:`https://elevenlabs.io/app/settings/api-keys`},openai:{name:`OpenAI`,description:`STT/TTS - Whisper y TTS-1`,logo:`🟢`,consoleUrl:`https://platform.openai.com/api-keys`},gemini:{name:`Google Gemini`,description:`TTS - Voces de Gemini`,logo:`🔵`,consoleUrl:`https://aistudio.google.com/app/apikey`},qwen:{name:`Qwen (Alibaba)`,description:`TTS - Voces de Qwen`,logo:`🟣`,consoleUrl:`https://dashscope.console.aliyun.com/apiKey`}};function Wq(){let{voiceProviders:e,configuredVoiceProviders:t,fetchVoiceProviders:n,fetchConfiguredVoiceProviders:r,saveVoiceProviderKey:i}=LR(),[a,o]=(0,u.useState)(null),[s,c]=(0,u.useState)(``),[l,d]=(0,u.useState)(!1),[f,p]=(0,u.useState)(!1);(0,u.useEffect)(()=>{n(),r()},[n,r]);let m=async e=>{if(s.trim()){d(!0);try{await i(e,s.trim()),await r(),o(null),c(``)}catch(e){console.error(`Failed to save API key:`,e)}finally{d(!1)}}};return(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsx)(`div`,{className:`grid gap-6 md:grid-cols-2`,children:(e.length>0?e:Object.keys(Uq)).map(e=>{let n=Uq[e]||{name:e,description:``,logo:`🔌`,consoleUrl:`#`},r=t[e]===!0,i=a===e;return(0,A.jsxs)(zR,{className:`relative overflow-hidden ${r?`border-green-500/30 bg-green-500/[0.02]`:``}`,children:[(0,A.jsx)(BR,{children:(0,A.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-3xl`,children:n.logo}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(VR,{className:`text-lg`,children:n.name}),(0,A.jsx)(HR,{className:`text-xs`,children:n.description})]})]}),r?(0,A.jsxs)(Hz,{variant:`default`,className:`bg-green-500/20 text-green-400 border-green-500/30`,children:[(0,A.jsx)($t,{className:`h-3 w-3 mr-1`}),`Configurado`]}):(0,A.jsx)(Hz,{variant:`secondary`,className:`bg-yellow-500/20 text-yellow-400 border-yellow-500/30`,children:`Sin configurar`})]})}),(0,A.jsx)(UR,{className:`space-y-4`,children:i?(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(Z,{htmlFor:`api-key-${e}`,children:`API Key`}),(0,A.jsxs)(`div`,{className:`flex gap-2 mt-1`,children:[(0,A.jsx)(G,{id:`api-key-${e}`,type:f?`text`:`password`,placeholder:`sk-...`,value:s,onChange:e=>c(e.target.value),className:`flex-1 font-mono text-sm`,autoFocus:!0}),(0,A.jsx)(W,{variant:`outline`,size:`icon`,onClick:()=>p(!f),title:f?`Ocultar`:`Mostrar`,children:f?(0,A.jsx)(Zn,{className:`h-4 w-4`}):(0,A.jsx)(Xn,{className:`h-4 w-4`})})]})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(W,{size:`sm`,onClick:()=>m(e),disabled:l||!s.trim(),className:`flex-1`,children:l?`Guardando...`:`Guardar`}),(0,A.jsx)(W,{size:`sm`,variant:`outline`,onClick:()=>{o(null),c(``)},children:`Cancelar`})]})]}):(0,A.jsxs)(`div`,{className:`space-y-3`,children:[r?(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,A.jsx)(Wn,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{children:`API key guardada de forma segura (encriptada)`})]}):(0,A.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Necesitas una API key de `,n.name,` para usar esta funcionalidad.`]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[r?(0,A.jsxs)(W,{size:`sm`,variant:`outline`,onClick:()=>{o(e),c(``)},className:`flex-1`,children:[(0,A.jsx)(Wn,{className:`h-3 w-3 mr-2`}),`Actualizar API Key`]}):(0,A.jsxs)(W,{size:`sm`,onClick:()=>{o(e),c(``)},className:`flex-1`,children:[(0,A.jsx)(Wn,{className:`h-3 w-3 mr-2`}),`Configurar API Key`]}),(0,A.jsx)(W,{size:`sm`,variant:`outline`,onClick:()=>window.open(n.consoleUrl,`_blank`),children:`Obtener Key`})]})]})})]},e)})}),(0,A.jsxs)(zR,{children:[(0,A.jsxs)(BR,{children:[(0,A.jsx)(VR,{className:`text-lg`,children:`¿Cómo funciona?`}),(0,A.jsx)(HR,{children:`Configura las API keys de los providers de voz para habilitar las funcionalidades de STT y TTS en tus canales.`})]}),(0,A.jsxs)(UR,{className:`space-y-4 text-sm text-muted-foreground`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`strong`,{className:`text-foreground`,children:`STT (Speech-to-Text):`}),` Convierte el audio entrante en texto. Groq Whisper es recomendado por su velocidad y precisión.`]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`strong`,{className:`text-foreground`,children:`TTS (Text-to-Speech):`}),` Convierte las respuestas de texto en audio. ElevenLabs ofrece las voces más naturales.`]}),(0,A.jsx)(`div`,{className:`pt-2 border-t`,children:(0,A.jsx)(`p`,{className:`text-xs`,children:`Las API keys se guardan encriptadas en la base de datos local de Hive. Nunca se comparten ni envían a servidores externos.`})})]})]})]})}var Gq=i((e,t)=>({notes:[],scheduledTasks:[],taskHistory:{},cronChannels:[],cronRecommended:`webchat`,cronUserPreference:`auto`,isLoading:!1,error:null,fetchNotes:async()=>{e({isLoading:!0,error:null});try{e({notes:(await K(`/api/notes`)).notes,isLoading:!1})}catch(t){e({error:t.message,isLoading:!1})}},fetchScheduledTasks:async t=>{e({isLoading:!0,error:null});try{e({scheduledTasks:(await K(t?`/api/scheduled-tasks?status=${t}`:`/api/scheduled-tasks`)).tasks??[],isLoading:!1})}catch(t){e({error:t.message,isLoading:!1,scheduledTasks:[]})}},pauseTask:async t=>{try{await K(`/api/scheduled-tasks/${t}/pause`,{method:`POST`}),e(e=>({scheduledTasks:e.scheduledTasks.map(e=>e.id===t?{...e,status:`paused`}:e)}))}catch(t){e({error:t.message})}},resumeTask:async t=>{try{await K(`/api/scheduled-tasks/${t}/resume`,{method:`POST`}),e(e=>({scheduledTasks:e.scheduledTasks.map(e=>e.id===t?{...e,status:`active`}:e)}))}catch(t){e({error:t.message})}},deleteTask:async t=>{try{await K(`/api/scheduled-tasks/${t}`,{method:`DELETE`}),e(e=>({scheduledTasks:e.scheduledTasks.filter(e=>e.id!==t)}))}catch(t){e({error:t.message})}},triggerTask:async t=>{try{await K(`/api/scheduled-tasks/${t}/trigger`,{method:`POST`})}catch(t){e({error:t.message})}},fetchTaskHistory:async(t,n=10)=>{try{let r=await K(`/api/scheduled-tasks/${t}/history?limit=${n}`);e(e=>({taskHistory:{...e.taskHistory,[t]:r.history??[]}}))}catch(t){e({error:t.message})}},fetchCronChannels:async()=>{try{let t=await K(`/api/cron-jobs/channels`),n=[];Array.isArray(t.channels)&&(n=t.channels.map(e=>typeof e==`string`?{id:e,type:e,active:!0,recommended:e===`webchat`||e===`telegram`}:e)),e({cronChannels:n,cronRecommended:`webchat`,cronUserPreference:`auto`})}catch{}},saveCronChannelPreference:async t=>{try{await K(`/api/user/settings`,{method:`PATCH`,body:{preferred_cron_channel:t}}),e({cronUserPreference:t})}catch(t){e({error:t.message})}}}));function Kq(e,t){return u.useReducer((e,n)=>t[e][n]??e,e)}var qq=`ScrollArea`,[Jq,wfe]=M(qq),[Yq,Xq]=Jq(qq),Zq=u.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=u.useState(null),[l,d]=u.useState(null),[f,p]=u.useState(null),[m,h]=u.useState(null),[g,_]=u.useState(null),[v,y]=u.useState(0),[b,x]=u.useState(0),[S,C]=u.useState(!1),[w,T]=u.useState(!1),E=D(t,e=>c(e)),O=hB(i);return(0,A.jsx)(Yq,{scope:n,type:r,dir:O,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:d,content:f,onContentChange:p,scrollbarX:m,onScrollbarXChange:h,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:_,scrollbarYEnabled:w,onScrollbarYEnabledChange:T,onCornerWidthChange:y,onCornerHeightChange:x,children:(0,A.jsx)(z.div,{dir:O,...o,ref:E,style:{position:`relative`,"--radix-scroll-area-corner-width":v+`px`,"--radix-scroll-area-corner-height":b+`px`,...e.style}})})});Zq.displayName=qq;var Qq=`ScrollAreaViewport`,$q=u.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=Xq(Qq,n),s=D(t,u.useRef(null),o.onViewportChange);return(0,A.jsxs)(A.Fragment,{children:[(0,A.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:i}),(0,A.jsx)(z.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,A.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});$q.displayName=Qq;var eJ=`ScrollAreaScrollbar`,tJ=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Xq(eJ,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return u.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,A.jsx)(nJ,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,A.jsx)(rJ,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,A.jsx)(iJ,{...r,ref:t,forceMount:n}):i.type===`always`?(0,A.jsx)(aJ,{...r,ref:t}):null});tJ.displayName=eJ;var nJ=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Xq(eJ,e.__scopeScrollArea),[a,o]=u.useState(!1);return u.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,A.jsx)(we,{present:n||a,children:(0,A.jsx)(iJ,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),rJ=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=Xq(eJ,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=TJ(()=>c(`SCROLL_END`),100),[s,c]=Kq(`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 u.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),u.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,A.jsx)(we,{present:n||s!==`hidden`,children:(0,A.jsx)(aJ,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:w(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:w(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),iJ=u.forwardRef((e,t)=>{let n=Xq(eJ,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=u.useState(!1),s=e.orientation===`horizontal`,c=TJ(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return EJ(n.viewport,c),EJ(n.content,c),(0,A.jsx)(we,{present:r||a,children:(0,A.jsx)(aJ,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),aJ=u.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=Xq(eJ,e.__scopeScrollArea),a=u.useRef(null),o=u.useRef(0),[s,c]=u.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=vJ(s.viewport,s.content),d={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function f(e,t){return bJ(e,o.current,s,t)}return n===`horizontal`?(0,A.jsx)(oJ,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=xJ(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=f(e,i.dir))}}):n===`vertical`?(0,A.jsx)(sJ,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=xJ(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=f(e))}}):null}),oJ=u.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Xq(eJ,e.__scopeScrollArea),[o,s]=u.useState(),c=u.useRef(null),l=D(t,c,a.onScrollbarXChange);return u.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,A.jsx)(uJ,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":yJ(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),CJ(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:_J(o.paddingLeft),paddingEnd:_J(o.paddingRight)}})}})}),sJ=u.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=Xq(eJ,e.__scopeScrollArea),[o,s]=u.useState(),c=u.useRef(null),l=D(t,c,a.onScrollbarYChange);return u.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,A.jsx)(uJ,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":yJ(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),CJ(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:_J(o.paddingTop),paddingEnd:_J(o.paddingBottom)}})}})}),[cJ,lJ]=Jq(eJ),uJ=u.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:d,onResize:f,...p}=e,m=Xq(eJ,n),[h,g]=u.useState(null),_=D(t,e=>g(e)),v=u.useRef(null),y=u.useRef(``),b=m.viewport,x=r.content-r.viewport,S=ie(d),C=ie(c),T=TJ(f,10);function E(e){v.current&&l({x:e.clientX-v.current.left,y:e.clientY-v.current.top})}return u.useEffect(()=>{let e=e=>{let t=e.target;h?.contains(t)&&S(e,x)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[b,h,x,S]),u.useEffect(C,[r,C]),EJ(h,T),EJ(m.content,T),(0,A.jsx)(cJ,{scope:n,scrollbar:h,hasThumb:i,onThumbChange:ie(a),onThumbPointerUp:ie(o),onThumbPositionChange:C,onThumbPointerDown:ie(s),children:(0,A.jsx)(z.div,{...p,ref:_,style:{position:`absolute`,...p.style},onPointerDown:w(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),v.current=h.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,m.viewport&&(m.viewport.style.scrollBehavior=`auto`),E(e))}),onPointerMove:w(e.onPointerMove,E),onPointerUp:w(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=y.current,m.viewport&&(m.viewport.style.scrollBehavior=``),v.current=null})})})}),dJ=`ScrollAreaThumb`,fJ=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=lJ(dJ,e.__scopeScrollArea);return(0,A.jsx)(we,{present:n||i.hasThumb,children:(0,A.jsx)(pJ,{ref:t,...r})})}),pJ=u.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=Xq(dJ,n),o=lJ(dJ,n),{onThumbPositionChange:s}=o,c=D(t,e=>o.onThumbChange(e)),l=u.useRef(void 0),d=TJ(()=>{l.current&&=(l.current(),void 0)},100);return u.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{d(),l.current||(l.current=wJ(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,d,s]),(0,A.jsx)(z.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:w(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:w(e.onPointerUp,o.onThumbPointerUp)})});fJ.displayName=dJ;var mJ=`ScrollAreaCorner`,hJ=u.forwardRef((e,t)=>{let n=Xq(mJ,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,A.jsx)(gJ,{...e,ref:t}):null});hJ.displayName=mJ;var gJ=u.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=Xq(mJ,n),[a,o]=u.useState(0),[s,c]=u.useState(0),l=!!(a&&s);return EJ(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),EJ(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,A.jsx)(z.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function _J(e){return e?parseInt(e,10):0}function vJ(e,t){let n=e/t;return isNaN(n)?0:n}function yJ(e){let t=vJ(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function bJ(e,t,n,r=`ltr`){let i=yJ(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return SJ([c,l],d)(e)}function xJ(e,t,n=`ltr`){let r=yJ(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=dG(e,n===`ltr`?[0,o]:[o*-1,0]);return SJ([0,o],[0,s])(c)}function SJ(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function CJ(e,t){return e>0&&e<t}var wJ=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function TJ(e,t){let n=ie(e),r=u.useRef(0);return u.useEffect(()=>()=>window.clearTimeout(r.current),[]),u.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function EJ(e,t){let n=ie(t);be(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var DJ=Zq,OJ=$q,kJ=hJ,AJ=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(DJ,{ref:r,className:H(`relative overflow-hidden`,e),...n,children:[(0,A.jsx)(OJ,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,A.jsx)(jJ,{}),(0,A.jsx)(kJ,{})]}));AJ.displayName=DJ.displayName;var jJ=u.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,A.jsx)(tJ,{ref:r,orientation:t,className:H(`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:(0,A.jsx)(fJ,{className:`relative flex-1 rounded-full bg-border`})}));jJ.displayName=tJ.displayName;var MJ=()=>{let{notes:e,isLoading:t,fetchNotes:n}=Gq();return(0,u.useEffect)(()=>{n()},[n]),(0,A.jsxs)(zR,{className:`border-none bg-background/50 backdrop-blur-xl shadow-2xl overflow-hidden group border border-white/10`,children:[(0,A.jsx)(BR,{className:`pb-2`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-xl bg-primary/10 text-primary`,children:(0,A.jsx)(Ar,{className:`w-5 h-5`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(VR,{className:`text-xl font-bold tracking-tight`,children:`Notas`}),(0,A.jsx)(HR,{children:`Scratchpad del agente`})]})]}),t&&(0,A.jsx)(Yn,{className:`w-4 h-4 animate-spin text-muted-foreground`})]})}),(0,A.jsx)(UR,{children:(0,A.jsx)(AJ,{className:`h-[350px] pr-4`,children:(0,A.jsx)(`div`,{className:`space-y-4`,children:e.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[250px] text-muted-foreground space-y-2`,children:[(0,A.jsx)(Ar,{className:`w-12 h-12 opacity-20`}),(0,A.jsx)(`p`,{className:`text-sm`,children:`No hay notas guardadas`}),(0,A.jsx)(`p`,{className:`text-[10px] opacity-70`,children:`El agente guardará notas con save_note`})]}):e.map(e=>(0,A.jsxs)(`div`,{className:`p-4 rounded-2xl border border-white/5 bg-card/40 hover:bg-card/60 transition-all duration-300 relative overflow-hidden`,children:[(0,A.jsx)(`h4`,{className:`font-semibold text-sm mb-1.5 line-clamp-1`,children:e.key}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground line-clamp-3 leading-relaxed`,children:e.value}),(0,A.jsxs)(`div`,{className:`mt-4 flex items-center justify-between`,children:[(0,A.jsx)(Hz,{variant:`secondary`,className:`text-[10px] px-2 py-0.5 bg-primary/10 text-primary border-none font-medium font-mono truncate max-w-[120px]`,children:e.thread_id.slice(-8)}),(0,A.jsx)(`span`,{className:`text-[10px] text-muted-foreground font-mono`,children:new Date(e.updated_at*1e3).toLocaleDateString()})]})]},e.id))})})})]})};function NJ(e){if(!e)return`—`;try{return new Date(e).toLocaleString([],{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}catch{return e}}function PJ({status:e}){let t={active:{label:`Activa`,className:`bg-green-500/10 text-green-400 border-green-500/20`},paused:{label:`Pausada`,className:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`},completed:{label:`Completada`,className:`bg-blue-500/10 text-blue-400 border-blue-500/20`},failed:{label:`Fallida`,className:`bg-red-500/10 text-red-400 border-red-500/20`},cancelled:{label:`Cancelada`,className:`bg-muted/30 text-muted-foreground border-white/10`}},{label:n,className:r}=t[e]??t.cancelled;return(0,A.jsx)(`span`,{className:`inline-flex items-center text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full border ${r}`,children:n})}function FJ({type:e}){let t=e===`recurring`;return(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full border ${t?`bg-violet-500/10 text-violet-400 border-violet-500/20`:`bg-teal-500/10 text-teal-400 border-teal-500/20`}`,children:[t?(0,A.jsx)(fr,{className:`w-2.5 h-2.5`}):(0,A.jsx)(Zt,{className:`w-2.5 h-2.5`}),t?`Recurrente`:`Una vez`]})}function IJ({channel:e}){return!e||e===`system`?(0,A.jsx)(`span`,{className:`inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-muted/30 text-muted-foreground border border-white/10`,children:`System`}):e===`webchat`?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-blue-500/10 text-blue-400 border border-blue-500/20`,children:[(0,A.jsx)($n,{className:`w-2.5 h-2.5`}),`Web`]}):e===`telegram`?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-sky-500/10 text-sky-400 border border-sky-500/20`,children:[(0,A.jsx)(vr,{className:`w-2.5 h-2.5`}),`Telegram`]}):(0,A.jsx)(`span`,{className:`inline-flex items-center gap-1 text-[9px] font-bold uppercase tracking-wider px-1.5 py-0.5 rounded-full bg-muted/30 text-muted-foreground border border-white/10`,children:e})}function LJ({status:e}){return(0,A.jsx)(`span`,{className:`inline-block w-1.5 h-1.5 rounded-full ${{running:`bg-blue-400 animate-pulse`,success:`bg-green-400`,failed:`bg-red-400`,timeout:`bg-amber-400`}[e]??`bg-muted-foreground`}`})}function RJ(e,t){let n=e===`telegram`?`Telegram`:e===`webchat`?`Web Chat`:e;return e===t?`${n} (recomendado)`:n}function zJ({taskId:e,history:t}){return t?t.length===0?(0,A.jsx)(`p`,{className:`text-[10px] text-muted-foreground px-1`,children:`Sin ejecuciones registradas.`}):(0,A.jsx)(`div`,{className:`mt-2 space-y-1`,children:t.map(e=>(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(LJ,{status:e.status}),(0,A.jsx)(`span`,{className:`font-mono`,children:NJ(e.started_at)}),e.duration_ms!=null&&(0,A.jsxs)(`span`,{className:`text-primary/70`,children:[e.duration_ms,`ms`]}),e.error_message&&(0,A.jsx)(`span`,{className:`text-red-400 truncate max-w-[160px]`,children:e.error_message})]},e.id))}):(0,A.jsx)(`p`,{className:`text-[10px] text-muted-foreground px-1`,children:`Cargando historial…`})}function BJ({task:e,onPause:t,onResume:n,onDelete:r,onTrigger:i,onLoadHistory:a,history:o}){let[s,c]=(0,u.useState)(!1),[l,d]=(0,u.useState)(!1),f=e.status===`active`,p=e.status===`active`||e.status===`paused`;function m(){!s&&!o&&a(e.id),c(e=>!e)}function h(){l?r(e.id):(d(!0),setTimeout(()=>d(!1),3e3))}return(0,A.jsxs)(`div`,{className:`p-4 rounded-2xl border border-white/5 bg-card/40 hover:bg-card/60 transition-all duration-200`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2 mb-2`,children:[(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`h4`,{className:`font-semibold text-sm truncate`,children:e.name}),e.description&&(0,A.jsx)(`p`,{className:`text-[10px] text-muted-foreground truncate mt-0.5`,children:e.description})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1 shrink-0`,children:(0,A.jsx)(PJ,{status:e.status})})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap mb-2`,children:[(0,A.jsx)(FJ,{type:e.task_type}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1 text-[10px] text-primary font-bold uppercase tracking-wider bg-primary/5 px-2 py-0.5 rounded-full`,children:[(0,A.jsx)(Zt,{className:`w-3 h-3`}),e.task_type===`recurring`?e.cron_expression??`—`:e.fire_at?NJ(e.fire_at):`—`]}),(0,A.jsx)(IJ,{channel:e.channel})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground mb-2`,children:[(0,A.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(Bt,{className:`w-3 h-3`}),e.run_count,` runs`]}),e.error_count>0&&(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-red-400`,children:[(0,A.jsx)(an,{className:`w-3 h-3`}),e.error_count,` errores`]}),e.timezone&&e.timezone!==`UTC`&&(0,A.jsx)(`span`,{className:`font-mono`,children:e.timezone})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 text-[10px] text-muted-foreground mb-3`,children:[e.last_run_at&&(0,A.jsxs)(`span`,{children:[`Último: `,NJ(e.last_run_at)]}),e.next_run_at&&e.status===`active`&&(0,A.jsxs)(`span`,{className:`text-primary/70`,children:[`Próximo: `,NJ(e.next_run_at)]})]}),e.last_error&&(0,A.jsx)(`div`,{className:`mb-2 text-[10px] text-red-400 bg-red-500/5 border border-red-500/20 rounded-lg px-2 py-1 truncate`,children:e.last_error}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[p&&(f?(0,A.jsxs)(W,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-2 border-white/10 hover:bg-yellow-500/10 hover:text-yellow-400 hover:border-yellow-500/20`,onClick:()=>t(e.id),children:[(0,A.jsx)(ar,{className:`w-3 h-3 mr-1`}),`Pausar`]}):(0,A.jsxs)(W,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-2 border-white/10 hover:bg-green-500/10 hover:text-green-400 hover:border-green-500/20`,onClick:()=>n(e.id),children:[(0,A.jsx)(cr,{className:`w-3 h-3 mr-1`}),`Reanudar`]})),f&&(0,A.jsxs)(W,{size:`sm`,variant:`outline`,className:`h-6 text-[10px] px-2 border-white/10 hover:bg-primary/10 hover:text-primary hover:border-primary/20`,onClick:()=>i(e.id),title:`Ejecutar ahora (sin afectar el schedule)`,children:[(0,A.jsx)(Wr,{className:`w-3 h-3 mr-1`}),`Ejecutar`]}),(0,A.jsxs)(W,{size:`sm`,variant:`ghost`,className:`h-6 text-[10px] px-2 text-muted-foreground hover:text-foreground`,onClick:m,children:[(0,A.jsx)(Vn,{className:`w-3 h-3 mr-1`}),`Historial`,s?(0,A.jsx)(rn,{className:`w-3 h-3 ml-1`}):(0,A.jsx)(en,{className:`w-3 h-3 ml-1`})]}),(0,A.jsxs)(W,{size:`sm`,variant:`ghost`,className:`h-6 text-[10px] px-2 ml-auto ${l?`text-red-400 bg-red-500/10 border border-red-500/20`:`text-muted-foreground hover:text-red-400`}`,onClick:h,title:l?`Confirmar eliminación`:`Eliminar tarea`,children:[(0,A.jsx)(Nr,{className:`w-3 h-3 mr-1`}),l?`Confirmar`:`Eliminar`]})]}),s&&(0,A.jsx)(`div`,{className:`mt-2 pt-2 border-t border-white/5`,children:(0,A.jsx)(zJ,{taskId:e.id,history:o})})]})}var VJ=()=>{let{scheduledTasks:e,taskHistory:t,cronChannels:n,cronRecommended:r,cronUserPreference:i,isLoading:a,fetchScheduledTasks:o,fetchCronChannels:s,pauseTask:c,resumeTask:l,deleteTask:d,triggerTask:f,fetchTaskHistory:p,saveCronChannelPreference:m}=Gq(),[h,g]=(0,u.useState)(`all`);(0,u.useEffect)(()=>{o(),s()},[o,s]);let _=h===`all`?e:e.filter(e=>e.status===h),v=(n??[]).filter(e=>e.active),y=_.filter(e=>!e.name.startsWith(`_hive_`));return(0,A.jsxs)(zR,{className:`border-none bg-background/50 backdrop-blur-xl shadow-2xl overflow-hidden border border-white/10`,children:[(0,A.jsx)(BR,{className:`pb-2`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between gap-2 flex-wrap`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-xl bg-primary/10 text-primary`,children:(0,A.jsx)(fn,{className:`w-5 h-5`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(VR,{className:`text-xl font-bold tracking-tight`,children:`Tareas Programadas`}),(0,A.jsx)(HR,{children:`Scheduler basado en Croner`})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[a&&(0,A.jsx)(Yn,{className:`w-4 h-4 animate-spin text-muted-foreground`}),(0,A.jsxs)(BK,{value:h,onValueChange:g,children:[(0,A.jsx)(UK,{className:`h-7 text-[10px] w-[110px] border-white/10 bg-card/40`,children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`all`,className:`text-xs`,children:`Todas`}),(0,A.jsx)(Q,{value:`active`,className:`text-xs`,children:`Activas`}),(0,A.jsx)(Q,{value:`paused`,className:`text-xs`,children:`Pausadas`}),(0,A.jsx)(Q,{value:`completed`,className:`text-xs`,children:`Completadas`}),(0,A.jsx)(Q,{value:`failed`,className:`text-xs`,children:`Fallidas`})]})]}),v.length>1&&(0,A.jsxs)(BK,{value:i,onValueChange:m,children:[(0,A.jsx)(UK,{className:`h-7 text-[10px] w-[130px] border-white/10 bg-card/40`,children:(0,A.jsx)(HK,{placeholder:`Canal`})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`auto`,className:`text-xs`,children:`Auto`}),v.map(e=>(0,A.jsx)(Q,{value:e.id,className:`text-xs`,children:RJ(e.id,r)},e.id))]})]}),(0,A.jsx)(W,{size:`sm`,variant:`ghost`,className:`h-7 w-7 p-0 text-muted-foreground hover:text-foreground`,onClick:()=>o(h===`all`?void 0:h),disabled:a,title:`Refrescar`,children:(0,A.jsx)(fr,{className:`w-3.5 h-3.5`})})]})]})}),(0,A.jsx)(UR,{children:(0,A.jsx)(AJ,{className:`h-[420px] pr-4`,children:(0,A.jsx)(`div`,{className:`space-y-3`,children:y.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-[280px] text-muted-foreground space-y-2`,children:[(0,A.jsx)(fn,{className:`w-12 h-12 opacity-20`}),(0,A.jsx)(`p`,{className:`text-sm`,children:`Sin tareas programadas`}),(0,A.jsxs)(`p`,{className:`text-[10px] opacity-70`,children:[`Crea tareas desde el chat o con `,(0,A.jsx)(`code`,{className:`font-mono`,children:`hive cron add`})]})]}):y.map(e=>(0,A.jsx)(BJ,{task:e,onPause:c,onResume:l,onDelete:d,onTrigger:f,onLoadHistory:p,history:t[e.id]},e.id))})})})]})};function HJ(){let[e,t]=(0,u.useState)(!1),[n,r]=(0,u.useState)(``),[i,a]=(0,u.useState)(!0),[o,s]=(0,u.useState)(`status`),[c,l]=(0,u.useState)(``),[d,f]=(0,u.useState)(!1),[p,m]=(0,u.useState)(``),[h,g]=(0,u.useState)(``),[_,v]=(0,u.useState)(``),[y,b]=(0,u.useState)(!1),[x,S]=(0,u.useState)(!1),[C,w]=(0,u.useState)(``),[T,E]=(0,u.useState)(``),[D,O]=(0,u.useState)(``),[k,j]=(0,u.useState)(!1),[M,N]=(0,u.useState)(!1),[P,F]=(0,u.useState)(!1);(0,u.useEffect)(()=>{ee(),I()},[]);async function ee(){a(!0);try{let e=await fetch(`/api/auth/status`).then(e=>e.json());t(e.hasCredentials),e.email&&r(e.email)}catch{}finally{a(!1)}}async function I(){try{l((await K(`/api/auth/recovery-key`)).recoveryKey)}catch{}}async function L(e){if(e.preventDefault(),h!==_){eg.fire({icon:`error`,title:`Error`,text:`Las contraseñas no coinciden`});return}if(h.length<8){eg.fire({icon:`error`,title:`Error`,text:`La contraseña debe tener al menos 8 caracteres`});return}S(!0);try{await K(`/api/auth/setup-credentials`,{method:`POST`,body:{email:p,password:h}}),eg.fire({icon:`success`,title:`Protección activada`,text:`La próxima vez que accedas necesitarás tu email y contraseña.`,timer:3e3,showConfirmButton:!1,toast:!0,position:`top-end`}),m(``),g(``),v(``),s(`status`),await ee()}catch{}finally{S(!1)}}async function R(){if((await eg.fire({title:`¿Desactivar protección?`,text:`Cualquiera con acceso a la URL podrá usar Hive sin contraseña.`,icon:`warning`,showCancelButton:!0,confirmButtonText:`Sí, desactivar`,cancelButtonText:`Cancelar`})).isConfirmed)try{await K(`/api/auth/disable`,{method:`POST`}),eg.fire({icon:`success`,title:`Protección desactivada`,timer:2e3,showConfirmButton:!1,toast:!0,position:`top-end`}),t(!1),r(``),s(`status`)}catch{}}async function te(e){if(e.preventDefault(),T!==D){eg.fire({icon:`error`,title:`Error`,text:`Las contraseñas no coinciden`});return}if(T.length<8){eg.fire({icon:`error`,title:`Error`,text:`La contraseña debe tener al menos 8 caracteres`});return}F(!0);try{await K(`/api/auth/change-password`,{method:`POST`,body:{currentPassword:C,newPassword:T}}),eg.fire({icon:`success`,title:`Contraseña actualizada`,timer:2e3,showConfirmButton:!1,toast:!0,position:`top-end`}),w(``),E(``),O(``),s(`status`)}catch{}finally{F(!1)}}function ne(){c&&(navigator.clipboard.writeText(c),f(!0),setTimeout(()=>f(!1),2e3))}return i?(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,A.jsx)(Yn,{className:`h-4 w-4 animate-spin`}),` Cargando...`]}):(0,A.jsxs)(`div`,{className:`space-y-8 max-w-xl`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e?(0,A.jsx)(Cr,{className:`h-5 w-5 text-green-500`}):(0,A.jsx)(wr,{className:`h-5 w-5 text-muted-foreground`}),(0,A.jsx)(`span`,{className:`font-medium`,children:`Protección con contraseña`})]}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e?`Activa — ${n||`credenciales configuradas`}`:`Desactivada — acceso libre sin contraseña`})]}),(0,A.jsx)(sq,{checked:e,onCheckedChange:e=>{e?s(`enable`):R()}})]}),o===`enable`&&!e&&(0,A.jsxs)(`form`,{onSubmit:L,className:`space-y-4 border rounded-lg p-4`,children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:`Configurar credenciales`}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`sec-email`,children:`Email`}),(0,A.jsx)(G,{id:`sec-email`,type:`email`,placeholder:`tu@email.com`,value:p,onChange:e=>m(e.target.value),required:!0,disabled:x})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`sec-pwd`,children:`Contraseña`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{id:`sec-pwd`,type:y?`text`:`password`,placeholder:`Mínimo 8 caracteres`,value:h,onChange:e=>g(e.target.value),required:!0,disabled:x,className:`pr-10`}),(0,A.jsx)(`button`,{type:`button`,className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>b(e=>!e),tabIndex:-1,children:y?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`sec-confirm`,children:`Confirmar contraseña`}),(0,A.jsx)(G,{id:`sec-confirm`,type:y?`text`:`password`,placeholder:`Repite la contraseña`,value:_,onChange:e=>v(e.target.value),required:!0,disabled:x})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(W,{type:`submit`,disabled:x,children:[x&&(0,A.jsx)(Yn,{className:`mr-2 h-4 w-4 animate-spin`}),`Activar protección`]}),(0,A.jsx)(W,{type:`button`,variant:`ghost`,onClick:()=>s(`status`),disabled:x,children:`Cancelar`})]})]}),e&&o===`status`&&(0,A.jsx)(`div`,{className:`flex gap-2`,children:(0,A.jsx)(W,{variant:`outline`,size:`sm`,onClick:()=>s(`change-password`),children:`Cambiar contraseña`})}),o===`change-password`&&e&&(0,A.jsxs)(`form`,{onSubmit:te,className:`space-y-4 border rounded-lg p-4`,children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:`Cambiar contraseña`}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`current-pwd`,children:`Contraseña actual`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{id:`current-pwd`,type:k?`text`:`password`,placeholder:`••••••••`,value:C,onChange:e=>w(e.target.value),required:!0,disabled:P,className:`pr-10`}),(0,A.jsx)(`button`,{type:`button`,className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>j(e=>!e),tabIndex:-1,children:k?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`new-pwd`,children:`Nueva contraseña`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{id:`new-pwd`,type:M?`text`:`password`,placeholder:`Mínimo 8 caracteres`,value:T,onChange:e=>E(e.target.value),required:!0,disabled:P,className:`pr-10`}),(0,A.jsx)(`button`,{type:`button`,className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>N(e=>!e),tabIndex:-1,children:M?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`confirm-new`,children:`Confirmar nueva contraseña`}),(0,A.jsx)(G,{id:`confirm-new`,type:M?`text`:`password`,placeholder:`••••••••`,value:D,onChange:e=>O(e.target.value),required:!0,disabled:P})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(W,{type:`submit`,disabled:P,children:[P&&(0,A.jsx)(Yn,{className:`mr-2 h-4 w-4 animate-spin`}),`Actualizar contraseña`]}),(0,A.jsx)(W,{type:`button`,variant:`ghost`,onClick:()=>s(`status`),disabled:P,children:`Cancelar`})]})]}),c&&(0,A.jsxs)(`div`,{className:`space-y-2 border rounded-lg p-4 bg-muted/30`,children:[(0,A.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-sm font-medium`,children:`Recovery Key`}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Úsalo para recuperar el acceso si olvidas tu contraseña`})]})}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`code`,{className:`flex-1 text-xs bg-muted rounded px-3 py-2 font-mono break-all`,children:c}),(0,A.jsx)(W,{variant:`ghost`,size:`icon`,onClick:ne,className:`shrink-0`,children:d?(0,A.jsx)($t,{className:`h-4 w-4 text-green-500`}):(0,A.jsx)(hn,{className:`h-4 w-4`})})]})]})]})}function UJ({panel:e}){switch(e){case`etica`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(Oq,{})});case`herramientas`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(Aq,{})});case`mcp`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(Iq,{})});case`skills`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(Hq,{})});case`perfil`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(zq,{})});case`notas`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(MJ,{})});case`cron-jobs`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(VJ,{})});case`voz`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(Wq,{})});case`seguridad`:return(0,A.jsx)(`div`,{className:`p-4`,children:(0,A.jsx)(HJ,{})});default:return null}}var WJ=[`etica`,`herramientas`,`mcp`,`skills`,`perfil`,`notas`,`cron-jobs`,`voz`,`seguridad`];function GJ({forcePanel:e}){let{panel:t}=Rd(),{fetchSkills:n}=PR(),{fetchTools:r}=NR(),{fetchMCPServers:i}=FR();(0,u.useEffect)(()=>{n(),r(),i()},[n,r,i]);let a=e||(WJ.includes(t)?t:`herramientas`),{title:o,subtitle:s,eyebrow:c}={etica:{eyebrow:`PROTOCOLOS DE CONDUCTA`,title:`Ética & Alineación`,subtitle:`Configura los límites morales y el comportamiento base de tus agentes.`},herramientas:{eyebrow:`CAPACIDADES DINÁMICAS`,title:`Gestión de Herramientas`,subtitle:`Habilita y configura las funciones que tus agentes pueden ejecutar.`},mcp:{eyebrow:`CONECTIVIDAD EXTERNA`,title:`Servidores MCP`,subtitle:`Conecta Hive con fuentes de datos externas y herramientas de terceros.`},skills:{eyebrow:`HABILIDADES ESPECIALIZADAS`,title:`Galería de Skills`,subtitle:`Nodos cognitivos preconfigurados para tareas específicas de alto nivel.`},perfil:{eyebrow:`IDENTIDAD DEL OPERADOR`,title:`Perfil de Usuario`,subtitle:`Gestiona tu información personal y preferencias de la interfaz.`},notas:{eyebrow:`MEMORIA OPERATIVA`,title:`Notas del Sistema`,subtitle:`Registro de información persistente y recordatorios del enjambre.`},"cron-jobs":{eyebrow:`AUTOMATIZACIÓN TEMPORAL`,title:`Tareas Programadas`,subtitle:`Gestión de ejecuciones recurrentes y disparadores cron.`},voz:{eyebrow:`INTERFAZ DE VOZ`,title:`Configuración de Voz`,subtitle:`Configura las API keys de los providers de STT (Speech-to-Text) y TTS (Text-to-Speech) para habilitar la comunicación por voz.`},seguridad:{eyebrow:`CONTROL DE ACCESO`,title:`Seguridad`,subtitle:`Protege tu instancia con email y contraseña. Esencial si despliegas Hive en un servidor público.`}}[a];return(0,A.jsxs)(`div`,{className:`hive-page-container`,children:[(0,A.jsx)(`div`,{className:`hive-page-header`,children:(0,A.jsxs)(`div`,{className:`relative z-10`,children:[(0,A.jsxs)(`div`,{className:`hive-page-header__eyebrow`,children:[(0,A.jsx)(`div`,{className:`hive-page-header__dot`}),(0,A.jsx)(`span`,{className:`hive-page-header__label`,children:c})]}),(0,A.jsxs)(`h2`,{className:`hive-title-page`,children:[o.split(` & `)[0],` `,o.includes(` & `)&&(0,A.jsxs)(`span`,{className:`hive-title-page__accent`,children:[`& `,o.split(` & `)[1]]}),o.includes(` `)&&!o.includes(` & `)&&(0,A.jsxs)(A.Fragment,{children:[o.split(` `)[0],` `,(0,A.jsx)(`span`,{className:`hive-title-page__accent`,children:o.split(` `).slice(1).join(` `)})]}),!o.includes(` `)&&o]}),(0,A.jsx)(`p`,{className:`hive-subtitle`,children:s})]})}),(0,A.jsx)(`div`,{className:`animate-fade-in`,children:(0,A.jsx)(UJ,{panel:a})})]})}function KJ(){return(0,A.jsx)(bq,{})}function qJ(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var JJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XJ={};function ZJ(e,t){return((t||XJ).jsx?YJ:JJ).test(e)}var QJ=/[ \t\n\f\r]/g;function $J(e){return typeof e==`object`?e.type===`text`?eY(e.value):!1:eY(e)}function eY(e){return e.replace(QJ,``)===``}var tY=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};tY.prototype.normal={},tY.prototype.property={},tY.prototype.space=void 0;function nY(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new tY(n,r,t)}function rY(e){return e.toLowerCase()}var iY=class{constructor(e,t){this.attribute=t,this.property=e}};iY.prototype.attribute=``,iY.prototype.booleanish=!1,iY.prototype.boolean=!1,iY.prototype.commaOrSpaceSeparated=!1,iY.prototype.commaSeparated=!1,iY.prototype.defined=!1,iY.prototype.mustUseProperty=!1,iY.prototype.number=!1,iY.prototype.overloadedBoolean=!1,iY.prototype.property=``,iY.prototype.spaceSeparated=!1,iY.prototype.space=void 0;var aY=t({boolean:()=>sY,booleanish:()=>cY,commaOrSpaceSeparated:()=>fY,commaSeparated:()=>dY,number:()=>$,overloadedBoolean:()=>lY,spaceSeparated:()=>uY}),oY=0,sY=pY(),cY=pY(),lY=pY(),$=pY(),uY=pY(),dY=pY(),fY=pY();function pY(){return 2**++oY}var mY=Object.keys(aY),hY=class extends iY{constructor(e,t,n,r){let i=-1;if(super(e,t),gY(this,`space`,r),typeof n==`number`)for(;++i<mY.length;){let e=mY[i];gY(this,mY[i],(n&aY[e])===aY[e])}}};hY.prototype.defined=!0;function gY(e,t,n){n&&(e[t]=n)}function _Y(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new hY(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[rY(r)]=r,n[rY(a.attribute)]=r}return new tY(t,n,e.space)}var vY=_Y({properties:{ariaActiveDescendant:null,ariaAtomic:cY,ariaAutoComplete:null,ariaBusy:cY,ariaChecked:cY,ariaColCount:$,ariaColIndex:$,ariaColSpan:$,ariaControls:uY,ariaCurrent:null,ariaDescribedBy:uY,ariaDetails:null,ariaDisabled:cY,ariaDropEffect:uY,ariaErrorMessage:null,ariaExpanded:cY,ariaFlowTo:uY,ariaGrabbed:cY,ariaHasPopup:null,ariaHidden:cY,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:uY,ariaLevel:$,ariaLive:null,ariaModal:cY,ariaMultiLine:cY,ariaMultiSelectable:cY,ariaOrientation:null,ariaOwns:uY,ariaPlaceholder:null,ariaPosInSet:$,ariaPressed:cY,ariaReadOnly:cY,ariaRelevant:null,ariaRequired:cY,ariaRoleDescription:uY,ariaRowCount:$,ariaRowIndex:$,ariaRowSpan:$,ariaSelected:cY,ariaSetSize:$,ariaSort:null,ariaValueMax:$,ariaValueMin:$,ariaValueNow:$,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function yY(e,t){return t in e?e[t]:t}function bY(e,t){return yY(e,t.toLowerCase())}var xY=_Y({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:dY,acceptCharset:uY,accessKey:uY,action:null,allow:null,allowFullScreen:sY,allowPaymentRequest:sY,allowUserMedia:sY,alt:null,as:null,async:sY,autoCapitalize:null,autoComplete:uY,autoFocus:sY,autoPlay:sY,blocking:uY,capture:null,charSet:null,checked:sY,cite:null,className:uY,cols:$,colSpan:null,content:null,contentEditable:cY,controls:sY,controlsList:uY,coords:$|dY,crossOrigin:null,data:null,dateTime:null,decoding:null,default:sY,defer:sY,dir:null,dirName:null,disabled:sY,download:lY,draggable:cY,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:sY,formTarget:null,headers:uY,height:$,hidden:lY,high:$,href:null,hrefLang:null,htmlFor:uY,httpEquiv:uY,id:null,imageSizes:null,imageSrcSet:null,inert:sY,inputMode:null,integrity:null,is:null,isMap:sY,itemId:null,itemProp:uY,itemRef:uY,itemScope:sY,itemType:uY,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:sY,low:$,manifest:null,max:null,maxLength:$,media:null,method:null,min:null,minLength:$,multiple:sY,muted:sY,name:null,nonce:null,noModule:sY,noValidate:sY,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:sY,optimum:$,pattern:null,ping:uY,placeholder:null,playsInline:sY,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:sY,referrerPolicy:null,rel:uY,required:sY,reversed:sY,rows:$,rowSpan:$,sandbox:uY,scope:null,scoped:sY,seamless:sY,selected:sY,shadowRootClonable:sY,shadowRootDelegatesFocus:sY,shadowRootMode:null,shape:null,size:$,sizes:null,slot:null,span:$,spellCheck:cY,src:null,srcDoc:null,srcLang:null,srcSet:null,start:$,step:null,style:null,tabIndex:$,target:null,title:null,translate:null,type:null,typeMustMatch:sY,useMap:null,value:cY,width:$,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:uY,axis:null,background:null,bgColor:null,border:$,borderColor:null,bottomMargin:$,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:sY,declare:sY,event:null,face:null,frame:null,frameBorder:null,hSpace:$,leftMargin:$,link:null,longDesc:null,lowSrc:null,marginHeight:$,marginWidth:$,noResize:sY,noHref:sY,noShade:sY,noWrap:sY,object:null,profile:null,prompt:null,rev:null,rightMargin:$,rules:null,scheme:null,scrolling:cY,standby:null,summary:null,text:null,topMargin:$,valueType:null,version:null,vAlign:null,vLink:null,vSpace:$,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:sY,disableRemotePlayback:sY,prefix:null,property:null,results:$,security:null,unselectable:null},space:`html`,transform:bY}),SY=_Y({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:fY,accentHeight:$,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:$,amplitude:$,arabicForm:null,ascent:$,attributeName:null,attributeType:null,azimuth:$,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:$,by:null,calcMode:null,capHeight:$,className:uY,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:$,diffuseConstant:$,direction:null,display:null,dur:null,divisor:$,dominantBaseline:null,download:sY,dx:null,dy:null,edgeMode:null,editable:null,elevation:$,enableBackground:null,end:null,event:null,exponent:$,externalResourcesRequired:null,fill:null,fillOpacity:$,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:dY,g2:dY,glyphName:dY,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:$,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:$,horizOriginX:$,horizOriginY:$,id:null,ideographic:$,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:$,k:$,k1:$,k2:$,k3:$,k4:$,kernelMatrix:fY,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:$,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:$,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:$,overlineThickness:$,paintOrder:null,panose1:null,path:null,pathLength:$,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:uY,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:$,pointsAtY:$,pointsAtZ:$,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fY,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fY,rev:fY,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fY,requiredFeatures:fY,requiredFonts:fY,requiredFormats:fY,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:$,specularExponent:$,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:$,strikethroughThickness:$,string:null,stroke:null,strokeDashArray:fY,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:$,strokeOpacity:$,strokeWidth:null,style:null,surfaceScale:$,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fY,tabIndex:$,tableValues:null,target:null,targetX:$,targetY:$,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fY,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:$,underlineThickness:$,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:$,values:null,vAlphabetic:$,vMathematical:$,vectorEffect:null,vHanging:$,vIdeographic:$,version:null,vertAdvY:$,vertOriginX:$,vertOriginY:$,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:$,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:yY}),CY=_Y({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),wY=_Y({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:bY}),TY=_Y({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),EY={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},DY=/[A-Z]/g,OY=/-[a-z]/g,kY=/^data[-\w.:]+$/i;function AY(e,t){let n=rY(t),r=t,i=iY;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&kY.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(OY,MY);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!OY.test(e)){let n=e.replace(DY,jY);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=hY}return new i(r,t)}function jY(e){return`-`+e.toLowerCase()}function MY(e){return e.charAt(1).toUpperCase()}var NY=nY([vY,xY,CY,wY,TY],`html`),PY=nY([vY,SY,CY,wY,TY],`svg`);function FY(e){return e.join(` `).trim()}var IY=r(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g,u=`
208
+ `,d=`/`,f=`*`,p=``,m=`comment`,h=`declaration`;function g(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,g=1;function v(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(u);g=~n?e.length-n:g+e.length}function y(){var e={line:l,column:g};return function(t){return t.position=new b(e),C(),t}}function b(e){this.start=e,this.end={line:l,column:g},this.source=t.source}b.prototype.content=e;function x(n){var r=Error(t.source+`:`+l+`:`+g+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=g,r.source=e,!t.silent)throw r}function S(t){var n=t.exec(e);if(n){var r=n[0];return v(r),e=e.slice(r.length),n}}function C(){S(i)}function w(e){var t;for(e||=[];t=T();)t!==!1&&e.push(t);return e}function T(){var t=y();if(!(d!=e.charAt(0)||f!=e.charAt(1))){for(var n=2;p!=e.charAt(n)&&(f!=e.charAt(n)||d!=e.charAt(n+1));)++n;if(n+=2,p===e.charAt(n-1))return x(`End of comment missing`);var r=e.slice(2,n-2);return g+=2,v(r),e=e.slice(n),g+=2,t({type:m,comment:r})}}function E(){var e=y(),t=S(a);if(t){if(T(),!S(o))return x(`property missing ':'`);var r=S(s),i=e({type:h,property:_(t[0].replace(n,p)),value:r?_(r[0].replace(n,p)):p});return S(c),i}}function D(){var e=[];w(e);for(var t;t=E();)t!==!1&&(e.push(t),w(e));return e}return C(),D()}function _(e){return e?e.replace(l,p):p}t.exports=g})),LY=r((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,`__esModule`,{value:!0}),e.default=r;var n=t(IY());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),RY=r((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),zY=r(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(LY()),r=RY();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),BY=HY(`end`),VY=HY(`start`);function HY(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function UY(e){let t=VY(e),n=BY(e);if(t&&n)return{start:t,end:n}}function WY(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?KY(e.position):`start`in e||`end`in e?KY(e):`line`in e||`column`in e?GY(e):``}function GY(e){return qY(e&&e.line)+`:`+qY(e&&e.column)}function KY(e){return GY(e&&e.start)+`-`+GY(e&&e.end)}function qY(e){return e&&typeof e==`number`?e:1}var JY=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=WY(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};JY.prototype.file=``,JY.prototype.name=``,JY.prototype.reason=``,JY.prototype.message=``,JY.prototype.stack=``,JY.prototype.column=void 0,JY.prototype.line=void 0,JY.prototype.ancestors=void 0,JY.prototype.cause=void 0,JY.prototype.fatal=void 0,JY.prototype.place=void 0,JY.prototype.ruleId=void 0,JY.prototype.source=void 0;var YY=e(zY(),1),XY={}.hasOwnProperty,ZY=new Map,QY=/[A-Z]/g,$Y=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),eX=new Set([`td`,`th`]),tX=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function nX(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=pX(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=fX(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?PY:NY,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=rX(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function rX(e,t,n){if(t.type===`element`)return iX(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return aX(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return sX(e,t,n);if(t.type===`mdxjsEsm`)return oX(e,t);if(t.type===`root`)return cX(e,t,n);if(t.type===`text`)return lX(e,t)}function iX(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=PY,e.schema=i),e.ancestors.push(t);let a=yX(e,t.tagName,!1),o=mX(e,t),s=gX(e,t);return $Y.has(t.tagName)&&(s=s.filter(function(e){return typeof e==`string`?!$J(e):!0})),uX(e,o,a,t),dX(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function aX(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}bX(e,t.position)}function oX(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bX(e,t.position)}function sX(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=PY,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:yX(e,t.name,!0),o=hX(e,t),s=gX(e,t);return uX(e,o,a,t),dX(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cX(e,t,n){let r={};return dX(r,gX(e,t)),e.create(t,e.Fragment,r,n)}function lX(e,t){return t.value}function uX(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function dX(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function fX(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function pX(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=VY(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function mX(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&XY.call(t.properties,i)){let a=_X(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&eX.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function hX(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`)if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bX(e,t.position);else{let i=r.name,a;if(r.value&&typeof r.value==`object`)if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else bX(e,t.position);else a=r.value===null?!0:r.value;n[i]=a}return n}function gX(e,t){let n=[],r=-1,i=e.passKeys?new Map:ZY;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=rX(e,a,o);s!==void 0&&n.push(s)}return n}function _X(e,t,n){let r=AY(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qJ(n):FY(n)),r.property===`style`){let t=typeof n==`object`?n:vX(e,String(n));return e.stylePropertyNameCase===`css`&&(t=xX(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?EY[r.property]||r.property:r.attribute,n]}}function vX(e,t){try{return(0,YY.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new JY("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=tX+`#cannot-parse-style-attribute`,r}}function yX(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ZJ(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ZJ(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return XY.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);bX(e)}function bX(e,t){let n=new JY("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=tX+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function xX(e){let t={},n;for(n in e)XY.call(e,n)&&(t[SX(n)]=e[n]);return t}function SX(e){let t=e.replace(QY,CX);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function CX(e){return`-`+e.toLowerCase()}var wX={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},TX={};function EX(e,t){let n=t||TX;return DX(e,typeof n.includeImageAlt==`boolean`?n.includeImageAlt:!0,typeof n.includeHtml==`boolean`?n.includeHtml:!0)}function DX(e,t,n){if(kX(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return OX(e.children,t,n)}return Array.isArray(e)?OX(e,t,n):``}function OX(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=DX(e[i],t,n);return r.join(``)}function kX(e){return!!(e&&typeof e==`object`)}var AX=document.createElement(`i`);function jX(e){let t=`&`+e+`;`;AX.innerHTML=t;let n=AX.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`||n===t?!1:n}function MX(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function NX(e,t){return e.length>0?(MX(e,e.length,0,t),e):t}var PX={}.hasOwnProperty;function FX(e){let t={},n=-1;for(;++n<e.length;)IX(t,e[n]);return t}function IX(e,t){let n;for(n in t){let r=(PX.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){PX.call(r,a)||(r[a]=[]);let e=i[a];LX(r[a],Array.isArray(e)?e:e?[e]:[])}}}function LX(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);MX(e,0,0,r)}function RX(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function zX(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var BX=QX(/[A-Za-z]/),VX=QX(/[\dA-Za-z]/),HX=QX(/[#-'*+\--9=?A-Z^-~]/);function UX(e){return e!==null&&(e<32||e===127)}var WX=QX(/\d/),GX=QX(/[\dA-Fa-f]/),KX=QX(/[!-/:-@[-`{-~]/);function qX(e){return e!==null&&e<-2}function JX(e){return e!==null&&(e<0||e===32)}function YX(e){return e===-2||e===-1||e===32}var XX=QX(/\p{P}|\p{S}/u),ZX=QX(/\s/);function QX(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function $X(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&VX(e.charCodeAt(n+1))&&VX(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function eZ(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return YX(r)?(e.enter(n),s(r)):t(r)}function s(r){return YX(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var tZ={tokenize:nZ};function nZ(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),eZ(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return qX(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var rZ={tokenize:aZ},iZ={tokenize:oZ};function aZ(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return MX(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(iZ,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(iZ,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return qX(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;MX(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-- >r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function oZ(e,t,n){return eZ(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function sZ(e){if(e===null||JX(e)||ZX(e))return 1;if(XX(e))return 2}function cZ(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var lZ={name:`attention`,resolveAll:uZ,tokenize:dZ};function uZ(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};fZ(d,-c),fZ(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=NX(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=NX(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=NX(l,cZ(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=NX(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=NX(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,MX(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function dZ(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=sZ(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=sZ(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function fZ(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var pZ={name:`autolink`,tokenize:mZ};function mZ(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return BX(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||VX(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||VX(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||UX(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):HX(t)?(e.consume(t),l):n(t)}function u(e){return VX(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||VX(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var hZ={partial:!0,tokenize:gZ};function gZ(e,t,n){return r;function r(t){return YX(t)?eZ(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||qX(e)?t(e):n(e)}}var _Z={continuation:{tokenize:yZ},exit:bZ,name:`blockQuote`,tokenize:vZ};function vZ(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return YX(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function yZ(e,t,n){let r=this;return i;function i(t){return YX(t)?eZ(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(_Z,t,n)(r)}}function bZ(e){e.exit(`blockQuote`)}var xZ={name:`characterEscape`,tokenize:SZ};function SZ(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return KX(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var CZ={name:`characterReference`,tokenize:wZ};function wZ(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=VX,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=GX,u):(e.enter(`characterReferenceValue`),a=7,o=WX,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===VX&&!jX(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var TZ={partial:!0,tokenize:OZ},EZ={concrete:!0,name:`codeFenced`,tokenize:DZ};function DZ(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),YX(t)?eZ(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||qX(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(TZ,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||qX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):YX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),eZ(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||qX(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||qX(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&YX(t)?eZ(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||qX(t)?e.check(TZ,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||qX(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),YX(t)?eZ(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),YX(t)?eZ(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||qX(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function OZ(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var kZ={name:`codeIndented`,tokenize:jZ},AZ={partial:!0,tokenize:MZ};function jZ(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),eZ(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):qX(t)?e.attempt(AZ,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||qX(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function MZ(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):qX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):eZ(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):qX(e)?i(e):n(e)}}var NZ={name:`codeText`,previous:FZ,resolve:PZ,tokenize:Tfe};function PZ(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function FZ(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Tfe(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):qX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||qX(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Efe=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&IZ(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),IZ(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),IZ(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);IZ(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);IZ(this.left,t.reverse())}}};function IZ(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function LZ(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Efe(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Dfe(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return MX(e,0,1/0,u.slice(0)),!l}function Dfe(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ofe={resolve:Afe,tokenize:jfe},kfe={partial:!0,tokenize:Mfe};function Afe(e){return LZ(e),e}function jfe(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):qX(t)?e.check(kfe,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Mfe(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),eZ(e,a,`linePrefix`)}function a(i){if(i===null||qX(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function RZ(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||UX(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||qX(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||JX(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||UX(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function zZ(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):qX(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||qX(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!YX(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function BZ(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):qX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),eZ(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||qX(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function VZ(e,t){let n;return r;function r(i){return qX(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):YX(i)?eZ(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Nfe={name:`definition`,tokenize:Ffe},Pfe={partial:!0,tokenize:Ife};function Ffe(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return zZ.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=zX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return JX(t)?VZ(e,l)(t):l(t)}function l(t){return RZ(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Pfe,d,d)(t)}function d(t){return YX(t)?eZ(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||qX(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ife(e,t,n){return r;function r(t){return JX(t)?VZ(e,i)(t):n(t)}function i(t){return BZ(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return YX(t)?eZ(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||qX(e)?t(e):n(e)}}var Lfe={name:`hardBreakEscape`,tokenize:Rfe};function Rfe(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return qX(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var zfe={name:`headingAtx`,resolve:Bfe,tokenize:Vfe};function Bfe(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},MX(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Vfe(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||JX(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||qX(n)?(e.exit(`atxHeading`),t(n)):YX(n)?eZ(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||JX(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Hfe=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),HZ=[`pre`,`script`,`style`,`textarea`],Ufe={concrete:!0,name:`htmlFlow`,resolveTo:Kfe,tokenize:qfe},Wfe={partial:!0,tokenize:Yfe},Gfe={partial:!0,tokenize:Jfe};function Kfe(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qfe(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ee):BX(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):BX(a)?(e.consume(a),i=4,r.interrupt?t:ee):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ee):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return BX(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||JX(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&HZ.includes(l)?(i=1,r.interrupt?t(s):O(s)):Hfe.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||VX(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return YX(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||BX(t)?(e.consume(t),b):YX(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||VX(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):YX(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):YX(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||qX(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||JX(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||YX(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||qX(t)?O(t):YX(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),M):t===60&&i===1?(e.consume(t),N):t===62&&i===4?(e.consume(t),I):t===63&&i===3?(e.consume(t),ee):t===93&&i===5?(e.consume(t),F):qX(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Wfe,L,k)(t)):t===null||qX(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Gfe,A,L)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),j}function j(t){return t===null||qX(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function M(t){return t===45?(e.consume(t),ee):O(t)}function N(t){return t===47?(e.consume(t),o=``,P):O(t)}function P(t){if(t===62){let n=o.toLowerCase();return HZ.includes(n)?(e.consume(t),I):O(t)}return BX(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),P):O(t)}function F(t){return t===93?(e.consume(t),ee):O(t)}function ee(t){return t===62?(e.consume(t),I):t===45&&i===2?(e.consume(t),ee):O(t)}function I(t){return t===null||qX(t)?(e.exit(`htmlFlowData`),L(t)):(e.consume(t),I)}function L(n){return e.exit(`htmlFlow`),t(n)}}function Jfe(e,t,n){let r=this;return i;function i(t){return qX(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Yfe(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(hZ,t,n)}}var Xfe={name:`htmlText`,tokenize:Zfe};function Zfe(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):BX(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):BX(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):qX(t)?(o=d,N(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?M(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):qX(t)?(o=h,N(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?M(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?M(t):qX(t)?(o=v,N(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):qX(t)?(o=y,N(t)):(e.consume(t),y)}function b(e){return e===62?M(e):y(e)}function x(t){return BX(t)?(e.consume(t),S):n(t)}function S(t){return t===45||VX(t)?(e.consume(t),S):C(t)}function C(t){return qX(t)?(o=C,N(t)):YX(t)?(e.consume(t),C):M(t)}function w(t){return t===45||VX(t)?(e.consume(t),w):t===47||t===62||JX(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),M):t===58||t===95||BX(t)?(e.consume(t),E):qX(t)?(o=T,N(t)):YX(t)?(e.consume(t),T):M(t)}function E(t){return t===45||t===46||t===58||t===95||VX(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):qX(t)?(o=D,N(t)):YX(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):qX(t)?(o=O,N(t)):YX(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,j):t===null?n(t):qX(t)?(o=k,N(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||JX(t)?T(t):(e.consume(t),A)}function j(e){return e===47||e===62||JX(e)?T(e):n(e)}function M(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function N(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),P}function P(t){return YX(t)?eZ(e,F,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):F(t)}function F(t){return e.enter(`htmlTextData`),o(t)}}var UZ={name:`labelEnd`,resolveAll:tpe,resolveTo:npe,tokenize:rpe},Qfe={tokenize:ipe},$fe={tokenize:ape},epe={tokenize:ope};function tpe(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&MX(e,0,e.length,n),e}function npe(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=NX(s,e.slice(a+1,a+r+3)),s=NX(s,[[`enter`,u,t]]),s=NX(s,cZ(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=NX(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=NX(s,e.slice(o+1)),s=NX(s,[[`exit`,c,t]]),MX(e,a,e.length,s),e}function rpe(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(zX(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Qfe,u,o?u:d)(t):t===91?e.attempt($fe,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(epe,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function ipe(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return JX(t)?VZ(e,a)(t):a(t)}function a(t){return t===41?u(t):RZ(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return JX(t)?VZ(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?BZ(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return JX(t)?VZ(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ape(e,t,n){let r=this;return i;function i(t){return zZ.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(zX(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ope(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var spe={name:`labelStartImage`,resolveAll:UZ.resolveAll,tokenize:cpe};function cpe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var lpe={name:`labelStartLink`,resolveAll:UZ.resolveAll,tokenize:upe};function upe(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var WZ={name:`lineEnding`,tokenize:dpe};function dpe(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),eZ(e,t,`linePrefix`)}}var GZ={name:`thematicBreak`,tokenize:fpe};function fpe(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||qX(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),YX(t)?eZ(e,s,`whitespace`)(t):s(t))}}var KZ={continuation:{tokenize:gpe},exit:vpe,name:`list`,tokenize:hpe},ppe={partial:!0,tokenize:ype},mpe={partial:!0,tokenize:_pe};function hpe(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:WX(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(GZ,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return WX(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(hZ,r.interrupt?n:u,e.attempt(ppe,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return YX(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function gpe(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(hZ,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,eZ(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!YX(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(mpe,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,eZ(e,e.attempt(KZ,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function _pe(e,t,n){let r=this;return eZ(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function vpe(e){e.exit(this.containerState.type)}function ype(e,t,n){let r=this;return eZ(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!YX(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var qZ={name:`setextUnderline`,resolveTo:bpe,tokenize:xpe};function bpe(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function xpe(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),YX(t)?eZ(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||qX(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Spe={tokenize:Cpe};function Cpe(e){let t=this,n=e.attempt(hZ,r,e.attempt(this.parser.constructs.flowInitial,i,eZ(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ofe,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var wpe={resolveAll:YZ()},Tpe=JZ(`string`),Epe=JZ(`text`);function JZ(e){return{resolveAll:YZ(e===`text`?Dpe:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function YZ(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Dpe(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var Ope=t({attentionMarkers:()=>Ipe,contentInitial:()=>Ape,disable:()=>Lpe,document:()=>kpe,flow:()=>Mpe,flowInitial:()=>jpe,insideSpan:()=>Fpe,string:()=>Npe,text:()=>Ppe}),kpe={42:KZ,43:KZ,45:KZ,48:KZ,49:KZ,50:KZ,51:KZ,52:KZ,53:KZ,54:KZ,55:KZ,56:KZ,57:KZ,62:_Z},Ape={91:Nfe},jpe={[-2]:kZ,[-1]:kZ,32:kZ},Mpe={35:zfe,42:GZ,45:[qZ,GZ],60:Ufe,61:qZ,95:GZ,96:EZ,126:EZ},Npe={38:CZ,92:xZ},Ppe={[-5]:WZ,[-4]:WZ,[-3]:WZ,33:spe,38:CZ,42:lZ,60:[pZ,Xfe],91:lpe,92:[Lfe,xZ],93:UZ,95:lZ,96:NZ},Fpe={null:[lZ,wpe]},Ipe={null:[42,95]},Lpe={null:[]};function Rpe(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=NX(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=cZ(a,l.events,l),l.events):[]}function f(e,t){return Bpe(p(e),t)}function p(e){return zpe(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){qX(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&MX(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zpe(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Bpe(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
209
+ `;break;case-3:o=`\r
210
+ `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Vpe(e){let t={constructs:FX([Ope,...(e||{}).extensions||[]]),content:n(tZ),defined:[],document:n(rZ),flow:n(Spe),lazy:{},string:n(Tpe),text:n(Epe)};return t;function n(e){return n;function n(n){return Rpe(t,e,n)}}}function Hpe(e){for(;!LZ(e););return e}var XZ=/[\0\t\n\r]/g;function Upe(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(XZ.lastIndex=u,c=XZ.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Wpe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Gpe(e){return e.replace(Wpe,Kpe)}function Kpe(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return RX(n.slice(t?2:1),t?16:10)}return jX(n)||e}var ZZ={}.hasOwnProperty;function qpe(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Jpe(n)(Hpe(Vpe(n).document().write(Upe()(e,t,!0))))}function Jpe(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(me),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ue),blockQuote:a(oe),characterEscape:T,characterReference:T,codeFenced:a(se),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(se,o),codeText:a(B,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ce),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(le),hardBreakEscape:a(de),hardBreakTrailing:a(de),htmlFlow:a(fe,o),htmlFlowData:T,htmlText:a(fe,o),htmlTextData:T,image:a(pe),label:o,link:a(me),listItem:a(ge),listItemValue:f,listOrdered:a(he,d),listUnordered:a(he),paragraph:a(_e),reference:R,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ue),strong:a(ve),thematicBreak:a(be)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:ae,autolinkProtocol:ie,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:ne,characterReferenceMarkerNumeric:ne,characterReferenceValue:z,characterReference:re,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(j),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(N),label:F,labelText:P,lineEnding:D,link:c(M),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:ee,resourceTitleString:I,resource:L,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};$Z(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];ZZ.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||eQ).call(a,void 0,e[0])}for(r.position={start:QZ(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:QZ(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(!(t[1].type===`linePrefix`||t[1].type===`blockQuotePrefix`||t[1].type===`blockQuotePrefixWhitespace`||t[1].type===`blockQuoteMarker`||t[1].type===`listItemIndent`))break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:QZ(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||eQ).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+WY({start:e.start,end:e.end})+`): it’s not open`);n.position.end=QZ(e.end)}function u(){return EX(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=zX(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=ye(),n.position={start:QZ(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=QZ(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=QZ(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function N(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function P(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=Gpe(t),n.identifier=zX(t).toLowerCase()}function F(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function I(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function L(){this.data.inReference=void 0}function R(){this.data.referenceType=`collapsed`}function te(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=zX(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function ne(e){this.data.characterReferenceType=e.type}function z(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=RX(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=jX(t);let i=this.stack[this.stack.length-1];i.value+=r}function re(e){let t=this.stack.pop();t.position.end=QZ(e.end)}function ie(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function ae(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function oe(){return{type:`blockquote`,children:[]}}function se(){return{type:`code`,lang:null,meta:null,value:``}}function B(){return{type:`inlineCode`,value:``}}function ce(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function le(){return{type:`emphasis`,children:[]}}function ue(){return{type:`heading`,depth:0,children:[]}}function de(){return{type:`break`}}function fe(){return{type:`html`,value:``}}function pe(){return{type:`image`,title:null,url:``,alt:null}}function me(){return{type:`link`,title:null,url:``,children:[]}}function he(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function ge(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function _e(){return{type:`paragraph`,children:[]}}function ve(){return{type:`strong`,children:[]}}function ye(){return{type:`text`,value:``}}function be(){return{type:`thematicBreak`}}}function QZ(e){return{line:e.line,column:e.column,offset:e.offset}}function $Z(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?$Z(e,r):Ype(e,r)}}function Ype(e,t){let n;for(n in t)if(ZZ.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function eQ(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+WY({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+WY({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+WY({start:t.start,end:t.end})+`) is still open`)}function Xpe(e){let t=this;t.parser=n;function n(n){return qpe(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function Zpe(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Qpe(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
211
+ `}]}function $pe(e,t){let n=t.value?t.value+`
212
+ `:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function eme(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function tme(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nme(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=$X(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function rme(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ime(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function tQ(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function ame(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tQ(e,t);let i={src:$X(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function ome(e,t){let n={src:$X(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function sme(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function cme(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return tQ(e,t);let i={href:$X(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function lme(e,t){let n={href:$X(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function ume(e,t,n){let r=e.all(t),i=n?dme(n):nQ(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
213
+ `}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
214
+ `});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function dme(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=nQ(n[r])}return t}function nQ(e){return e.spread??e.children.length>1}function fme(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function pme(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mme(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function hme(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gme(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=VY(t.children[1]),o=BY(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function _me(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function vme(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var rQ=9,iQ=32;function yme(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(aQ(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(aQ(t.slice(i),i>0,!1)),a.join(``)}function aQ(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===rQ||t===iQ;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===rQ||t===iQ;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function bme(e,t){let n={type:`text`,value:yme(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function xme(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Sme={blockquote:Zpe,break:Qpe,code:$pe,delete:eme,emphasis:tme,footnoteReference:nme,heading:rme,html:ime,imageReference:ame,image:ome,inlineCode:sme,linkReference:cme,link:lme,listItem:ume,list:fme,paragraph:pme,root:mme,strong:hme,table:gme,tableCell:vme,tableRow:_me,text:bme,thematicBreak:xme,toml:oQ,yaml:oQ,definition:oQ,footnoteDefinition:oQ};function oQ(){}var sQ=typeof self==`object`?self:globalThis,Cme=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(new sQ[e](t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(new sQ[a](o),i)};return r},cQ=e=>Cme(new Map,e)(0),lQ=``,{toString:wme}={},{keys:Tme}=Object,uQ=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=wme.call(e).slice(8,-1);switch(n){case`Array`:return[1,lQ];case`Object`:return[2,lQ];case`Date`:return[3,lQ];case`RegExp`:return[4,lQ];case`Map`:return[5,lQ];case`Set`:return[6,lQ];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:n.includes(`Error`)?[7,n]:[2,n]},dQ=([e,t])=>e===0&&(t===`function`||t===`symbol`),Eme=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=uQ(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of Tme(r))(e||!dQ(uQ(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(dQ(uQ(n))||dQ(uQ(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!dQ(uQ(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},fQ=(e,{json:t,lossy:n}={})=>{let r=[];return Eme(!(t||n),!!t,new Map,r)(e),r},pQ=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?cQ(fQ(e,t)):structuredClone(e):(e,t)=>cQ(fQ(e,t));function Dme(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Ome(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function kme(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Dme,r=e.options.footnoteBackLabel||Ome,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=$X(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...pQ(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
215
+ `},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
216
+ `}]}}var mQ=(function(e){if(e==null)return Nme;if(typeof e==`function`)return hQ(e);if(typeof e==`object`)return Array.isArray(e)?Ame(e):jme(e);if(typeof e==`string`)return Mme(e);throw Error(`Expected function, string, or object as test`)});function Ame(e){let t=[],n=-1;for(;++n<e.length;)t[n]=mQ(e[n]);return hQ(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function jme(e){let t=e;return hQ(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Mme(e){return hQ(t);function t(t){return t&&t.type===e}}function hQ(e){return t;function t(t,n,r){return!!(Pme(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Nme(){return!0}function Pme(e){return typeof e==`object`&&!!e&&`type`in e}function Fme(e){return e}var gQ=[];function _Q(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=mQ(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,`name`,{value:`node (`+Fme(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=gQ,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Ime(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Ime(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?gQ:[e]}function vQ(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),_Q(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var yQ={}.hasOwnProperty,Lme={};function Rme(e,t){let n=t||Lme,r=new Map,i=new Map,a={all:s,applyData:Bme,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Sme,...n.handlers},one:o,options:n,patch:zme,wrap:Hme};return vQ(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(yQ.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=pQ(n);return r.children=a.all(e),r}return pQ(e)}return(a.options.unknownHandler||Vme)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=bQ(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=bQ(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function zme(e,t){e.position&&(t.position=UY(e))}function Bme(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,pQ(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Vme(e,t){let n=t.data||{},r=`value`in t&&!(yQ.call(n,`hProperties`)||yQ.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Hme(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
217
+ `});++r<e.length;)r&&n.push({type:`text`,value:`
218
+ `}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
219
+ `}),n}function bQ(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function xQ(e,t){let n=Rme(e,t),r=n.one(e,void 0),i=kme(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
220
+ `},i)),a}function Ume(e,t){return e&&`run`in e?async function(n,r){let i=xQ(n,{file:r,...t});await e.run(i,r)}:function(n,r){return xQ(n,{file:r,...e||t})}}function SQ(e){if(e)throw e}var Wme=r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function CQ(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Gme(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Kme(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Kme(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var wQ={basename:qme,dirname:Jme,extname:Yme,join:Xme,sep:`/`};function qme(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);TQ(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function Jme(e){if(TQ(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Yme(e){TQ(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Xme(...e){let t=-1,n;for(;++t<e.length;)TQ(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Zme(n)}function Zme(e){TQ(e);let t=e.codePointAt(0)===47,n=Qme(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Qme(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(!(i===o-1||a===1))if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function TQ(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var $me={cwd:ehe};function ehe(){return`/`}function EQ(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function the(e){if(typeof e==`string`)e=new URL(e);else if(!EQ(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return nhe(e)}function nhe(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var DQ=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],OQ=class{constructor(e){let t;t=e?EQ(e)?{path:e}:typeof e==`string`||rhe(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:$me.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<DQ.length;){let e=DQ[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)DQ.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?wQ.basename(this.path):void 0}set basename(e){AQ(e,`basename`),kQ(e,`basename`),this.path=wQ.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?wQ.dirname(this.path):void 0}set dirname(e){jQ(this.basename,`dirname`),this.path=wQ.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?wQ.extname(this.path):void 0}set extname(e){if(kQ(e,`extname`),jQ(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=wQ.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){EQ(e)&&(e=the(e)),AQ(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?wQ.basename(this.path,this.extname):void 0}set stem(e){AQ(e,`stem`),kQ(e,`stem`),this.path=wQ.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new JY(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function kQ(e,t){if(e&&e.includes(wQ.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+wQ.sep+"`")}function AQ(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function jQ(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function rhe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ihe=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),MQ=e(Wme(),1),ahe={}.hasOwnProperty,ohe=new class e extends ihe{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Gme()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,MQ.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(FQ(`data`,this.frozen),this.namespace[e]=t,this):ahe.call(this.namespace,e)&&this.namespace[e]||void 0:e?(FQ(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=RQ(e),n=this.parser||this.Parser;return NQ(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),NQ(`process`,this.parser||this.Parser),PQ(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=RQ(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);che(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),NQ(`processSync`,this.parser||this.Parser),PQ(`processSync`,this.compiler||this.Compiler),this.process(e,r),LQ(`processSync`,`process`,t),n;function r(e,r){t=!0,SQ(e),n=r}}run(e,t,n){IQ(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=RQ(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),LQ(`runSync`,`run`,n),r;function i(e,t){SQ(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=RQ(t),r=this.compiler||this.Compiler;return PQ(`stringify`,r),IQ(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(FQ(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,MQ.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];CQ(o)&&CQ(r)&&(r=(0,MQ.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function NQ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function PQ(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function FQ(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function IQ(e){if(!CQ(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function LQ(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function RQ(e){return she(e)?e:new OQ(e)}function she(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function che(e){return typeof e==`string`||lhe(e)}function lhe(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var zQ=[],BQ={allowDangerousHtml:!0},uhe=/^(https?|ircs?|mailto|xmpp)$/i,dhe=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function VQ(e){let t=fhe(e),n=phe(e);return mhe(t.runSync(t.parse(n),n),e)}function fhe(e){let t=e.rehypePlugins||zQ,n=e.remarkPlugins||zQ,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...BQ}:BQ;return ohe().use(Xpe).use(n).use(Ume,r).use(t)}function phe(e){let t=e.children||``,n=new OQ;return typeof t==`string`?n.value=t:``+t,n}function mhe(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||hhe;for(let e of dhe)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return vQ(e,l),nX(e,{Fragment:A.Fragment,components:i,ignoreInvalidStyle:!0,jsx:A.jsx,jsxs:A.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in wX)if(Object.hasOwn(wX,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=wX[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function hhe(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||uhe.test(e.slice(0,t))?e:``}var ghe=Ft(`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`}}),HQ=u.forwardRef(({className:e,variant:t,...n},r)=>(0,A.jsx)(`div`,{ref:r,role:`alert`,className:H(ghe({variant:t}),e),...n}));HQ.displayName=`Alert`;var UQ=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsx)(`h5`,{ref:r,className:H(`mb-1 font-medium leading-none tracking-tight`,e),...n,children:t}));UQ.displayName=`AlertTitle`;var WQ=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:H(`text-sm [&_p]:leading-relaxed`,e),...t}));WQ.displayName=`AlertDescription`;var GQ=`Checkbox`,[_he,vhe]=M(GQ),[yhe,KQ]=_he(GQ);function bhe(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:d=`on`,internal_do_not_use_render:f}=e,[p,m]=ke({prop:n,defaultProp:i??!1,onChange:c,caller:GQ}),[h,g]=u.useState(null),[_,v]=u.useState(null),y=u.useRef(!1),b=h?!!o||!!h.closest(`form`):!0,x={checked:p,disabled:a,setChecked:m,control:h,setControl:g,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:y,required:l,defaultChecked:e$(i)?!1:i,isFormControl:b,bubbleInput:_,setBubbleInput:v};return(0,A.jsx)(yhe,{scope:t,...x,children:xhe(f)?f(x):r})}var qQ=`CheckboxTrigger`,JQ=u.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:m,bubbleInput:h}=KQ(qQ,e),g=D(i,d),_=u.useRef(c);return u.useEffect(()=>{let e=a?.form;if(e){let t=()=>f(_.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,f]),(0,A.jsx)(z.button,{type:`button`,role:`checkbox`,"aria-checked":e$(c)?`mixed`:c,"aria-required":l,"data-state":t$(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:g,onKeyDown:w(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:w(n,e=>{f(e=>e$(e)?!0:!e),h&&m&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});JQ.displayName=qQ;var YQ=u.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,A.jsx)(bhe,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(JQ,{...d,ref:t,__scopeCheckbox:n}),e&&(0,A.jsx)($Q,{__scopeCheckbox:n})]})})});YQ.displayName=GQ;var XQ=`CheckboxIndicator`,ZQ=u.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=KQ(XQ,n);return(0,A.jsx)(we,{present:r||e$(a.checked)||a.checked===!0,children:(0,A.jsx)(z.span,{"data-state":t$(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});ZQ.displayName=XQ;var QQ=`CheckboxBubbleInput`,$Q=u.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:d,form:f,bubbleInput:p,setBubbleInput:m}=KQ(QQ,e),h=D(n,m),g=fG(a),_=$s(r);u.useEffect(()=>{let e=p;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(g!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=e$(a),n.call(e,e$(a)?!1:a),e.dispatchEvent(t)}},[p,g,a,i]);let v=u.useRef(e$(a)?!1:a);return(0,A.jsx)(z.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??v.current,required:s,disabled:c,name:l,value:d,form:f,...t,tabIndex:-1,ref:h,style:{...t.style,..._,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});$Q.displayName=QQ;function xhe(e){return typeof e==`function`}function e$(e){return e===`indeterminate`}function t$(e){return e$(e)?`indeterminate`:e?`checked`:`unchecked`}var n$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(YQ,{ref:n,className:H(`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:(0,A.jsx)(ZQ,{className:H(`flex items-center justify-center text-current`),children:(0,A.jsx)($t,{className:`h-4 w-4`})})}));n$.displayName=YQ.displayName;var r$=`Radio`,[She,i$]=M(r$),[Che,whe]=She(r$),a$=u.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:l,...d}=e,[f,p]=u.useState(null),m=D(t,e=>p(e)),h=u.useRef(!1),g=f?l||!!f.closest(`form`):!0;return(0,A.jsxs)(Che,{scope:n,checked:i,disabled:o,children:[(0,A.jsx)(z.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":l$(i),"data-disabled":o?``:void 0,disabled:o,value:s,...d,ref:m,onClick:w(e.onClick,e=>{i||c?.(),g&&(h.current=e.isPropagationStopped(),h.current||e.stopPropagation())})}),g&&(0,A.jsx)(c$,{control:f,bubbles:!h.current,name:r,value:s,checked:i,required:a,disabled:o,form:l,style:{transform:`translateX(-100%)`}})]})});a$.displayName=r$;var o$=`RadioIndicator`,s$=u.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=whe(o$,n);return(0,A.jsx)(we,{present:r||a.checked,children:(0,A.jsx)(z.span,{"data-state":l$(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});s$.displayName=o$;var The=`RadioBubbleInput`,c$=u.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=u.useRef(null),s=D(o,a),c=fG(n),l=$s(t);return u.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,A.jsx)(z.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...l,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});c$.displayName=The;function l$(e){return e?`checked`:`unchecked`}var Ehe=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],u$=`RadioGroup`,[Dhe,Ohe]=M(u$,[CB,i$]),d$=CB(),f$=i$(),[khe,Ahe]=Dhe(u$),p$=u.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:u=!0,onValueChange:d,...f}=e,p=d$(n),m=hB(l),[h,g]=ke({prop:a,defaultProp:i??null,onChange:d,caller:u$});return(0,A.jsx)(khe,{scope:n,name:r,required:o,disabled:s,value:h,onValueChange:g,children:(0,A.jsx)(FB,{asChild:!0,...p,orientation:c,dir:m,loop:u,children:(0,A.jsx)(z.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:m,...f,ref:t})})})});p$.displayName=u$;var m$=`RadioGroupItem`,h$=u.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Ahe(m$,n),o=a.disabled||r,s=d$(n),c=f$(n),l=u.useRef(null),d=D(t,l),f=a.value===i.value,p=u.useRef(!1);return u.useEffect(()=>{let e=e=>{Ehe.includes(e.key)&&(p.current=!0)},t=()=>p.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,A.jsx)(IB,{asChild:!0,...s,focusable:!o,active:f,children:(0,A.jsx)(a$,{disabled:o,required:a.required,checked:f,...c,...i,name:a.name,ref:d,onCheck:()=>a.onValueChange(i.value),onKeyDown:w(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:w(i.onFocus,()=>{p.current&&l.current?.click()})})})});h$.displayName=m$;var jhe=`RadioGroupIndicator`,g$=u.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,A.jsx)(s$,{...f$(n),...r,ref:t})});g$.displayName=jhe;var _$=p$,v$=h$,Mhe=g$,y$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(_$,{className:H(`grid gap-2`,e),...t,ref:n}));y$.displayName=_$.displayName;var b$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(v$,{ref:n,className:H(`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:(0,A.jsx)(Mhe,{className:`flex items-center justify-center`,children:(0,A.jsx)(dn,{className:`h-2.5 w-2.5 fill-current text-current`})})}));b$.displayName=v$.displayName;var x$=[`PageUp`,`PageDown`],S$=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],C$={"from-left":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-right":[`Home`,`PageDown`,`ArrowDown`,`ArrowRight`],"from-bottom":[`Home`,`PageDown`,`ArrowDown`,`ArrowLeft`],"from-top":[`Home`,`PageDown`,`ArrowUp`,`ArrowLeft`]},w$=`Slider`,[T$,Nhe,Phe]=ne(w$),[E$,Fhe]=M(w$,[Phe]),[Ihe,D$]=E$(w$),O$=u.forwardRef((e,t)=>{let{name:n,min:r=0,max:i=100,step:a=1,orientation:o=`horizontal`,disabled:s=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:d,onValueChange:f=()=>{},onValueCommit:p=()=>{},inverted:m=!1,form:h,...g}=e,_=u.useRef(new Set),v=u.useRef(0),y=o===`horizontal`?Lhe:Rhe,[b=[],x]=ke({prop:d,defaultProp:l,onChange:e=>{[..._.current][v.current]?.focus(),f(e)}}),S=u.useRef(b);function C(e){D(e,Uhe(b,e))}function T(e){D(e,v.current)}function E(){let e=S.current[v.current];b[v.current]!==e&&p(b)}function D(e,t,{commit:n}={commit:!1}){let o=qhe(a),s=dG(Jhe(Math.round((e-r)/a)*a+r,o),[r,i]);x((e=[])=>{let r=Vhe(e,s,t);if(Khe(r,c*a)){v.current=r.indexOf(s);let t=String(r)!==String(e);return t&&n&&p(r),t?r:e}else return e})}return(0,A.jsx)(Ihe,{scope:e.__scopeSlider,name:n,disabled:s,min:r,max:i,valueIndexToChangeRef:v,thumbs:_.current,values:b,orientation:o,form:h,children:(0,A.jsx)(T$.Provider,{scope:e.__scopeSlider,children:(0,A.jsx)(T$.Slot,{scope:e.__scopeSlider,children:(0,A.jsx)(y,{"aria-disabled":s,"data-disabled":s?``:void 0,...g,ref:t,onPointerDown:w(g.onPointerDown,()=>{s||(S.current=b)}),min:r,max:i,inverted:m,onSlideStart:s?void 0:C,onSlideMove:s?void 0:T,onSlideEnd:s?void 0:E,onHomeKeyDown:()=>!s&&D(r,0,{commit:!0}),onEndKeyDown:()=>!s&&D(i,b.length-1,{commit:!0}),onStepKeyDown:({event:e,direction:t})=>{if(!s){let n=x$.includes(e.key)||e.shiftKey&&S$.includes(e.key)?10:1,r=v.current,i=b[r];D(i+a*n*t,r,{commit:!0})}}})})})})});O$.displayName=w$;var[k$,A$]=E$(w$,{startEdge:`left`,endEdge:`right`,size:`width`,direction:1}),Lhe=u.forwardRef((e,t)=>{let{min:n,max:r,dir:i,inverted:a,onSlideStart:o,onSlideMove:s,onSlideEnd:c,onStepKeyDown:l,...d}=e,[f,p]=u.useState(null),m=D(t,e=>p(e)),h=u.useRef(void 0),g=hB(i),_=g===`ltr`,v=_&&!a||!_&&a;function y(e){let t=h.current||f.getBoundingClientRect(),i=B$([0,t.width],v?[n,r]:[r,n]);return h.current=t,i(e-t.left)}return(0,A.jsx)(k$,{scope:e.__scopeSlider,startEdge:v?`left`:`right`,endEdge:v?`right`:`left`,direction:v?1:-1,size:`width`,children:(0,A.jsx)(j$,{dir:g,"data-orientation":`horizontal`,...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":`translateX(-50%)`},onSlideStart:e=>{let t=y(e.clientX);o?.(t)},onSlideMove:e=>{let t=y(e.clientX);s?.(t)},onSlideEnd:()=>{h.current=void 0,c?.()},onStepKeyDown:e=>{let t=C$[v?`from-left`:`from-right`].includes(e.key);l?.({event:e,direction:t?-1:1})}})})}),Rhe=u.forwardRef((e,t)=>{let{min:n,max:r,inverted:i,onSlideStart:a,onSlideMove:o,onSlideEnd:s,onStepKeyDown:c,...l}=e,d=u.useRef(null),f=D(t,d),p=u.useRef(void 0),m=!i;function h(e){let t=p.current||d.current.getBoundingClientRect(),i=B$([0,t.height],m?[r,n]:[n,r]);return p.current=t,i(e-t.top)}return(0,A.jsx)(k$,{scope:e.__scopeSlider,startEdge:m?`bottom`:`top`,endEdge:m?`top`:`bottom`,size:`height`,direction:m?1:-1,children:(0,A.jsx)(j$,{"data-orientation":`vertical`,...l,ref:f,style:{...l.style,"--radix-slider-thumb-transform":`translateY(50%)`},onSlideStart:e=>{let t=h(e.clientY);a?.(t)},onSlideMove:e=>{let t=h(e.clientY);o?.(t)},onSlideEnd:()=>{p.current=void 0,s?.()},onStepKeyDown:e=>{let t=C$[m?`from-bottom`:`from-top`].includes(e.key);c?.({event:e,direction:t?-1:1})}})})}),j$=u.forwardRef((e,t)=>{let{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:a,onHomeKeyDown:o,onEndKeyDown:s,onStepKeyDown:c,...l}=e,u=D$(w$,n);return(0,A.jsx)(z.span,{...l,ref:t,onKeyDown:w(e.onKeyDown,e=>{e.key===`Home`?(o(e),e.preventDefault()):e.key===`End`?(s(e),e.preventDefault()):x$.concat(S$).includes(e.key)&&(c(e),e.preventDefault())}),onPointerDown:w(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),u.thumbs.has(t)?t.focus():r(e)}),onPointerMove:w(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&i(e)}),onPointerUp:w(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),M$=`SliderTrack`,N$=u.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=D$(M$,n);return(0,A.jsx)(z.span,{"data-disabled":i.disabled?``:void 0,"data-orientation":i.orientation,...r,ref:t})});N$.displayName=M$;var P$=`SliderRange`,F$=u.forwardRef((e,t)=>{let{__scopeSlider:n,...r}=e,i=D$(P$,n),a=A$(P$,n),o=D(t,u.useRef(null)),s=i.values.length,c=i.values.map(e=>z$(e,i.min,i.max)),l=s>1?Math.min(...c):0,d=100-Math.max(...c);return(0,A.jsx)(z.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?``:void 0,...r,ref:o,style:{...e.style,[a.startEdge]:l+`%`,[a.endEdge]:d+`%`}})});F$.displayName=P$;var I$=`SliderThumb`,L$=u.forwardRef((e,t)=>{let n=Nhe(e.__scopeSlider),[r,i]=u.useState(null),a=D(t,e=>i(e)),o=u.useMemo(()=>r?n().findIndex(e=>e.ref.current===r):-1,[n,r]);return(0,A.jsx)(zhe,{...e,ref:a,index:o})}),zhe=u.forwardRef((e,t)=>{let{__scopeSlider:n,index:r,name:i,...a}=e,o=D$(I$,n),s=A$(I$,n),[c,l]=u.useState(null),d=D(t,e=>l(e)),f=c?o.form||!!c.closest(`form`):!0,p=$s(c),m=o.values[r],h=m===void 0?0:z$(m,o.min,o.max),g=Hhe(r,o.values.length),_=p?.[s.size],v=_?Whe(_,h,s.direction):0;return u.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),(0,A.jsxs)(`span`,{style:{transform:`var(--radix-slider-thumb-transform)`,position:`absolute`,[s.startEdge]:`calc(${h}% + ${v}px)`},children:[(0,A.jsx)(T$.ItemSlot,{scope:e.__scopeSlider,children:(0,A.jsx)(z.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,...a,ref:d,style:m===void 0?{display:`none`}:e.style,onFocus:w(e.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),f&&(0,A.jsx)(R$,{name:i??(o.name?o.name+(o.values.length>1?`[]`:``):void 0),form:o.form,value:m},r)]})});L$.displayName=I$;var Bhe=`RadioBubbleInput`,R$=u.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{let i=u.useRef(null),a=D(i,r),o=fG(t);return u.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`input`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,A.jsx)(z.input,{style:{display:`none`},...n,ref:a,defaultValue:t})});R$.displayName=Bhe;function Vhe(e=[],t,n){let r=[...e];return r[n]=t,r.sort((e,t)=>e-t)}function z$(e,t,n){return dG(100/(n-t)*(e-t),[0,100])}function Hhe(e,t){if(t>2)return`Value ${e+1} of ${t}`;if(t===2)return[`Minimum`,`Maximum`][e]}function Uhe(e,t){if(e.length===1)return 0;let n=e.map(e=>Math.abs(e-t)),r=Math.min(...n);return n.indexOf(r)}function Whe(e,t,n){let r=e/2;return(r-B$([0,50],[0,r])(t)*n)*n}function Ghe(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Khe(e,t){if(t>0){let n=Ghe(e);return Math.min(...n)>=t}return!0}function B$(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function qhe(e){return(String(e).split(`.`)[1]||``).length}function Jhe(e,t){let n=10**t;return Math.round(e*n)/n}var V$=O$,Yhe=N$,Xhe=F$,Zhe=L$,H$=u.forwardRef(({className:e,...t},n)=>(0,A.jsxs)(V$,{ref:n,className:H(`relative flex w-full touch-none select-none items-center`,e),...t,children:[(0,A.jsx)(Yhe,{className:`relative h-2 w-full grow overflow-hidden rounded-full bg-secondary`,children:(0,A.jsx)(Xhe,{className:`absolute h-full bg-primary`})}),(0,A.jsx)(Zhe,{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`})]}));H$.displayName=V$.displayName;var U$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{className:`relative w-full overflow-auto`,children:(0,A.jsx)(`table`,{ref:n,className:H(`w-full caption-bottom text-sm`,e),...t})}));U$.displayName=`Table`;var W$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`thead`,{ref:n,className:H(`[&_tr]:border-b`,e),...t}));W$.displayName=`TableHeader`;var G$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`tbody`,{ref:n,className:H(`[&_tr:last-child]:border-0`,e),...t}));G$.displayName=`TableBody`;var Qhe=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`tfoot`,{ref:n,className:H(`border-t bg-muted/50 font-medium [&>tr]:last:border-b-0`,e),...t}));Qhe.displayName=`TableFooter`;var K$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`tr`,{ref:n,className:H(`border-b transition-colors data-[state=selected]:bg-muted hover:bg-muted/50`,e),...t}));K$.displayName=`TableRow`;var q$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`th`,{ref:n,className:H(`h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0`,e),...t}));q$.displayName=`TableHead`;var J$=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`td`,{ref:n,className:H(`p-4 align-middle [&:has([role=checkbox])]:pr-0`,e),...t}));J$.displayName=`TableCell`;var $he=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`caption`,{ref:n,className:H(`mt-4 text-sm text-muted-foreground`,e),...t}));$he.displayName=`TableCaption`;var Y$=`Tabs`,[ege,tge]=M(Y$,[CB]),X$=CB(),[nge,Z$]=ege(Y$),Q$=u.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=hB(s),[d,f]=ke({prop:r,onChange:i,defaultProp:a??``,caller:Y$});return(0,A.jsx)(nge,{scope:n,baseId:Ia(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,A.jsx)(z.div,{dir:u,"data-orientation":o,...l,ref:t})})});Q$.displayName=Y$;var $$=`TabsList`,e1=u.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Z$($$,n),o=X$(n);return(0,A.jsx)(FB,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,A.jsx)(z.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});e1.displayName=$$;var t1=`TabsTrigger`,n1=u.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Z$(t1,n),s=X$(n),c=a1(o.baseId,r),l=o1(o.baseId,r),u=r===o.value;return(0,A.jsx)(IB,{asChild:!0,...s,focusable:!i,active:u,children:(0,A.jsx)(z.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:w(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:w(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:w(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})});n1.displayName=t1;var r1=`TabsContent`,i1=u.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Z$(r1,n),c=a1(s.baseId,r),l=o1(s.baseId,r),d=r===s.value,f=u.useRef(d);return u.useEffect(()=>{let e=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,A.jsx)(we,{present:i||d,children:({present:n})=>(0,A.jsx)(z.div,{"data-state":d?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:f.current?`0s`:void 0},children:n&&a})})});i1.displayName=r1;function a1(e,t){return`${e}-trigger-${t}`}function o1(e,t){return`${e}-content-${t}`}var rge=Q$,s1=e1,c1=n1,l1=i1,ige=rge,u1=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(s1,{ref:n,className:H(`inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground`,e),...t}));u1.displayName=s1.displayName;var d1=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(c1,{ref:n,className:H(`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}));d1.displayName=c1.displayName;var f1=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(l1,{ref:n,className:H(`mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2`,e),...t}));f1.displayName=l1.displayName;var age=r((e=>{var t=n();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),p1=r(((e,t)=>{t.exports=age()})),oge=p1();function sge(){return(0,oge.useSyncExternalStore)(cge,()=>!0,()=>!1)}function cge(){return()=>{}}var m1=`Avatar`,[lge,uge]=Uz(m1),[dge,h1]=lge(m1),g1=u.forwardRef((e,t)=>{let{__scopeAvatar:n,...r}=e,[i,a]=u.useState(`idle`);return(0,A.jsx)(dge,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:a,children:(0,A.jsx)(Qf.span,{...r,ref:t})})});g1.displayName=m1;var _1=`AvatarImage`,v1=u.forwardRef((e,t)=>{let{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...a}=e,o=h1(_1,n),s=fge(r,a),c=ie(e=>{i(e),o.onImageLoadingStatusChange(e)});return be(()=>{s!==`idle`&&c(s)},[s,c]),s===`loaded`?(0,A.jsx)(Qf.img,{...a,ref:t,src:r}):null});v1.displayName=_1;var y1=`AvatarFallback`,b1=u.forwardRef((e,t)=>{let{__scopeAvatar:n,delayMs:r,...i}=e,a=h1(y1,n),[o,s]=u.useState(r===void 0);return u.useEffect(()=>{if(r!==void 0){let e=window.setTimeout(()=>s(!0),r);return()=>window.clearTimeout(e)}},[r]),o&&a.imageLoadingStatus!==`loaded`?(0,A.jsx)(Qf.span,{...i,ref:t}):null});b1.displayName=y1;function x1(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?`loaded`:`loading`):`error`:`idle`}function fge(e,{referrerPolicy:t,crossOrigin:n}){let r=sge(),i=u.useRef(null),a=r?(i.current||=new window.Image,i.current):null,[o,s]=u.useState(()=>x1(a,e));return be(()=>{s(x1(a,e))},[a,e]),be(()=>{let e=e=>()=>{s(e)};if(!a)return;let r=e(`loaded`),i=e(`error`);return a.addEventListener(`load`,r),a.addEventListener(`error`,i),t&&(a.referrerPolicy=t),typeof n==`string`&&(a.crossOrigin=n),()=>{a.removeEventListener(`load`,r),a.removeEventListener(`error`,i)}},[a,n,t]),o}var S1=g1,C1=v1,w1=b1,T1=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(S1,{ref:n,className:H(`relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full`,e),...t}));T1.displayName=S1.displayName;var E1=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(C1,{ref:n,className:H(`aspect-square h-full w-full`,e),...t}));E1.displayName=C1.displayName;var D1=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(w1,{ref:n,className:H(`flex h-full w-full items-center justify-center rounded-full bg-muted`,e),...t}));D1.displayName=w1.displayName;function pge(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var O1=u.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:`bottom`,shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),k1=()=>{let e=u.useContext(O1);if(!e)throw Error(`useDrawerContext must be used within a Drawer.Root`);return e};pge(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,-100%,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(-100%,0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(100%,0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
221
+ [data-state=closed]
222
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,100%,0)}}@keyframes slideFromTop{from{transform:translate3d(0,-100%,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,-100%,0)}}@keyframes slideFromLeft{from{transform:translate3d(-100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(-100%,0,0)}}@keyframes slideFromRight{from{transform:translate3d(100%,0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(100%,0,0)}}`);var mge=24,hge=typeof window<`u`?u.useLayoutEffect:u.useEffect;function A1(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function gge(){return N1(/^Mac/)}function _ge(){return N1(/^iPhone/)}function j1(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function vge(){return N1(/^iPad/)||gge()&&navigator.maxTouchPoints>1}function M1(){return _ge()||vge()}function N1(e){return typeof window<`u`&&window.navigator!=null?e.test(window.navigator.platform):void 0}var P1=typeof document<`u`&&window.visualViewport;function F1(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function I1(e){for(F1(e)&&(e=e.parentElement);e&&!F1(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}var yge=new Set([`checkbox`,`radio`,`range`,`color`,`file`,`image`,`button`,`submit`,`reset`]),L1=0,R1;function bge(e={}){let{isDisabled:t}=e;hge(()=>{if(!t)return L1++,L1===1&&M1()&&(R1=xge()),()=>{L1--,L1===0&&R1?.()}},[t])}function xge(){let e,t=0,n=n=>{e=I1(n.target),!(e===document.documentElement&&e===document.body)&&(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body){n.preventDefault();return}let r=n.changedTouches[0].pageY,i=e.scrollTop,a=e.scrollHeight-e.clientHeight;a!==0&&((i<=0&&r>t||i>=a&&r<t)&&n.preventDefault(),t=r)},i=e=>{let t=e.target;V1(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform=`translateY(-2000px)`,t.focus(),requestAnimationFrame(()=>{t.style.transform=``}))},a=e=>{let t=e.target;V1(t)&&(t.style.transform=`translateY(-2000px)`,requestAnimationFrame(()=>{t.style.transform=``,P1&&(P1.height<window.innerHeight?requestAnimationFrame(()=>{B1(t)}):P1.addEventListener(`resize`,()=>B1(t),{once:!0}))}))},o=()=>{window.scrollTo(0,0)},s=window.pageXOffset,c=window.pageYOffset,l=A1(Sge(document.documentElement,`paddingRight`,`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let u=A1(z1(document,`touchstart`,n,{passive:!1,capture:!0}),z1(document,`touchmove`,r,{passive:!1,capture:!0}),z1(document,`touchend`,i,{passive:!1,capture:!0}),z1(document,`focus`,a,!0),z1(window,`scroll`,o));return()=>{l(),u(),window.scrollTo(s,c)}}function Sge(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function z1(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function B1(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=I1(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+mge&&(t.scrollTop+=r-n)}e=t.parentElement}}function V1(e){return e instanceof HTMLInputElement&&!yge.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Cge(e,t){typeof e==`function`?e(t):e!=null&&(e.current=t)}function wge(...e){return t=>e.forEach(e=>Cge(e,t))}function H1(...e){return u.useCallback(wge(...e),e)}var U1=new WeakMap;function W1(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{if(t.startsWith(`--`)){e.style.setProperty(t,n);return}r[t]=e.style[t],e.style[t]=n}),!n&&U1.set(e,r)}function Tge(e,t){if(!e||!(e instanceof HTMLElement))return;let n=U1.get(e);n&&(e.style[t]=n[t])}var G1=e=>{switch(e){case`top`:case`bottom`:return!0;case`left`:case`right`:return!1;default:return e}};function K1(e,t){if(!e)return null;let n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform,i=r.match(/^matrix3d\((.+)\)$/);return i?parseFloat(i[1].split(`, `)[G1(t)?13:12]):(i=r.match(/^matrix\((.+)\)$/),i?parseFloat(i[1].split(`, `)[G1(t)?5:4]):null)}function Ege(e){return 8*(Math.log(e+1)-2)}function q1(e,t){if(!e)return()=>{};let n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}var J1={DURATION:.5,EASE:[.32,.72,0,1]},Y1=.4,Dge=.25,Oge=100,X1=8,Z1=16,Q1=26,$1=`vaul-dragging`;function e0(e){let t=u.useRef(e);return u.useEffect(()=>{t.current=e}),u.useMemo(()=>(...e)=>t.current==null?void 0:t.current.call(t,...e),[])}function kge({defaultProp:e,onChange:t}){let n=u.useState(e),[r]=n,i=u.useRef(r),a=e0(t);return u.useEffect(()=>{i.current!==r&&(a(r),i.current=r)},[r,i,a]),n}function t0({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,i]=kge({defaultProp:t,onChange:n}),a=e!==void 0,o=a?e:r,s=e0(n);return[o,u.useCallback(t=>{if(a){let n=typeof t==`function`?t(e):t;n!==e&&s(n)}else i(t)},[a,e,i,s])]}function Age({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:i,fadeFromIndex:a,onSnapPointChange:o,direction:s=`bottom`,container:c,snapToSequentialPoint:l}){let[d,f]=t0({prop:e,defaultProp:n?.[0],onChange:t}),[p,m]=u.useState(typeof window<`u`?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);u.useEffect(()=>{function e(){m({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let h=u.useMemo(()=>d===n?.[n.length-1]||null,[n,d]),g=u.useMemo(()=>n?.findIndex(e=>e===d),[n,d]),_=n&&n.length>0&&(a||a===0)&&!Number.isNaN(a)&&n[a]===d||!n,v=u.useMemo(()=>{let e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:typeof window<`u`?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};return n?.map(t=>{let n=typeof t==`string`,r=0;if(n&&(r=parseInt(t,10)),G1(s)){let i=n?r:p?t*e.height:0;return p?s===`bottom`?e.height-i:-e.height+i:i}let i=n?r:p?t*e.width:0;return p?s===`right`?e.width-i:-e.width+i:i})??[]},[n,p,c]),y=u.useMemo(()=>g===null?null:v?.[g],[v,g]),b=u.useCallback(e=>{let t=v?.findIndex(t=>t===e)??null;o(t),W1(r.current,{transition:`transform ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`,transform:G1(s)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&t!==v.length-1&&t!==a&&t<a?W1(i.current,{transition:`opacity ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`,opacity:`0`}):W1(i.current,{transition:`opacity ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`,opacity:`1`}),f(n?.[Math.max(t,0)])},[r.current,n,v,a,i,f]);u.useEffect(()=>{if(d||e){let t=n?.findIndex(t=>t===e||t===d)??-1;v&&t!==-1&&typeof v[t]==`number`&&b(v[t])}},[d,e,n,v,b]);function x({draggedDistance:e,closeDrawer:t,velocity:r,dismissible:o}){if(a===void 0)return;let c=s===`bottom`||s===`right`?(y??0)-e:(y??0)+e,u=g===a-1,d=g===0,f=e>0;if(u&&W1(i.current,{transition:`opacity ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`}),!l&&r>2&&!f){o?t():b(v[0]);return}if(!l&&r>2&&f&&v&&n){b(v[n.length-1]);return}let p=v?.reduce((e,t)=>typeof e!=`number`||typeof t!=`number`?e:Math.abs(t-c)<Math.abs(e-c)?t:e),m=G1(s)?window.innerHeight:window.innerWidth;if(r>Y1&&Math.abs(e)<m*.4){let e=f?1:-1;if(e>0&&h){b(v[n.length-1]);return}if(d&&e<0&&o&&t(),g===null)return;b(v[g+e]);return}b(p)}function S({draggedDistance:e}){if(y===null)return;let t=s===`bottom`||s===`right`?y-e:y+e;(s===`bottom`||s===`right`)&&t<v[v.length-1]||(s===`top`||s===`left`)&&t>v[v.length-1]||W1(r.current,{transform:G1(s)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})}function C(e,t){if(!n||typeof g!=`number`||!v||a===void 0)return null;let r=g===a-1;if(g>=a&&t)return 0;if(r&&!t)return 1;if(!_&&!r)return null;let i=r?g+1:g-1,o=r?v[i]-v[i-1]:v[i+1]-v[i],s=e/Math.abs(o);return r?1-s:s}return{isLastSnapPoint:h,activeSnapPoint:d,shouldFade:_,getPercentageDragged:C,setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:x,onDrag:S,snapPointsOffset:v}}function jge(){let{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:i}=k1(),a=u.useRef(null),o=(0,u.useMemo)(()=>document.body.style.backgroundColor,[]);function s(){return(window.innerWidth-Q1)/window.innerWidth}u.useEffect(()=>{if(t&&n){a.current&&clearTimeout(a.current);let t=document.querySelector(`[data-vaul-drawer-wrapper]`)||document.querySelector(`[vaul-drawer-wrapper]`);if(!t)return;r&&!i&&q1(document.body,{background:`black`}),q1(t,{transformOrigin:G1(e)?`top`:`left`,transitionProperty:`transform, border-radius`,transitionDuration:`${J1.DURATION}s`,transitionTimingFunction:`cubic-bezier(${J1.EASE.join(`,`)})`});let n=q1(t,{borderRadius:`${X1}px`,overflow:`hidden`,...G1(e)?{transform:`scale(${s()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${s()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),a.current=window.setTimeout(()=>{o?document.body.style.background=o:document.body.style.removeProperty(`background`)},J1.DURATION*1e3)}}},[t,n,o])}var n0=null;function Mge({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:i,noBodyStyles:a}){let[o,s]=u.useState(()=>typeof window<`u`?window.location.href:``),c=u.useRef(0),l=u.useCallback(()=>{if(j1()&&n0===null&&e&&!a){n0={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:`unset`};let{scrollX:e,innerHeight:t}=window;document.body.style.setProperty(`position`,`fixed`,`important`),Object.assign(document.body.style,{top:`${-c.current}px`,left:`${-e}px`,right:`0px`,height:`auto`}),window.setTimeout(()=>window.requestAnimationFrame(()=>{let e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=`${-(c.current+e)}px`)}),300)}},[e]),d=u.useCallback(()=>{if(j1()&&n0!==null&&!a){let e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,n0),window.requestAnimationFrame(()=>{if(i&&o!==window.location.href){s(window.location.href);return}window.scrollTo(t,e)}),n0=null}},[o]);return u.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener(`scroll`,e),()=>{window.removeEventListener(`scroll`,e)}},[]),u.useEffect(()=>{n||!r||(e?(!window.matchMedia(`(display-mode: standalone)`).matches&&l(),t||window.setTimeout(()=>{d()},500)):d())},[e,r,o,t,n,l,d]),{restorePositionSetting:d}}function r0({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:i,snapPoints:a,shouldScaleBackground:o=!1,setBackgroundColorOnScale:s=!0,closeThreshold:c=Dge,scrollLockTimeout:l=Oge,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=a&&a.length-1,activeSnapPoint:m,setActiveSnapPoint:h,fixed:g,modal:_=!0,onClose:v,nested:y,noBodyStyles:b,direction:x=`bottom`,defaultOpen:S=!1,disablePreventScroll:C=!0,snapToSequentialPoint:w=!1,preventScrollRestoration:T=!1,repositionInputs:E=!0,onAnimationEnd:D,container:O,autoFocus:k=!1}){let[A=!1,j]=t0({defaultProp:S,prop:e,onChange:e=>{t?.(e),!e&&!y&&ye(),setTimeout(()=>{D?.(e)},J1.DURATION*1e3),e&&!_&&typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),e||(document.body.style.pointerEvents=`auto`)}}),[M,N]=u.useState(!1),[P,F]=u.useState(!1),[ee,I]=u.useState(!1),L=u.useRef(null),R=u.useRef(null),te=u.useRef(null),ne=u.useRef(null),z=u.useRef(null),re=u.useRef(!1),ie=u.useRef(null),ae=u.useRef(0),oe=u.useRef(!1),se=u.useRef(0),B=u.useRef(null),ce=u.useRef(B.current?.getBoundingClientRect().height||0),le=u.useRef(B.current?.getBoundingClientRect().width||0),ue=u.useRef(0),{activeSnapPoint:de,activeSnapPointIndex:fe,setActiveSnapPoint:pe,onRelease:me,snapPointsOffset:he,onDrag:ge,shouldFade:_e,getPercentageDragged:ve}=Age({snapPoints:a,activeSnapPointProp:m,setActiveSnapPointProp:h,drawerRef:B,fadeFromIndex:p,overlayRef:L,onSnapPointChange:u.useCallback(e=>{a&&e===he.length-1&&(R.current=new Date)},[]),direction:x,container:O,snapToSequentialPoint:w});bge({isDisabled:!A||P||!_||ee||!M||!E||!C});let{restorePositionSetting:ye}=Mge({isOpen:A,modal:_,nested:y,hasBeenOpened:M,preventScrollRestoration:T,noBodyStyles:b});function be(){return(window.innerWidth-Q1)/window.innerWidth}function xe(e){!d&&!a||B.current&&!B.current.contains(e.target)||(ce.current=B.current?.getBoundingClientRect().height||0,le.current=B.current?.getBoundingClientRect().width||0,F(!0),te.current=new Date,M1()&&window.addEventListener(`touchend`,()=>re.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),ae.current=G1(x)?e.pageY:e.pageX)}function Se(e,t){let n=e,r=window.getSelection()?.toString(),i=B.current?K1(B.current,x):null,a=new Date;if(n.hasAttribute(`data-vaul-no-drag`)||n.closest(`[data-vaul-no-drag]`))return!1;if(x===`right`||x===`left`)return!0;if(R.current&&a.getTime()-R.current.getTime()<500)return!1;if(i!==null&&(x===`bottom`?i>0:i<0))return!0;if(r&&r.length>0)return!1;if(a.getTime()-z.current?.getTime()<l&&i===0||t)return z.current=a,!1;for(;n;){if(n.scrollHeight>n.clientHeight){if(n.scrollTop!==0)return z.current=new Date,!1;if(n.getAttribute(`role`)===`dialog`)return!0}n=n.parentNode}return!0}function Ce(e){if(B.current&&P){let t=x===`bottom`||x===`right`?1:-1,n=(ae.current-(G1(x)?e.pageY:e.pageX))*t,i=n>0,s=a&&!d&&!i;if(s&&fe===0)return;let c=Math.abs(n),l=document.querySelector(`[data-vaul-drawer-wrapper]`),u=c/(x===`bottom`||x===`top`?ce.current:le.current),f=ve(c,i);if(f!==null&&(u=f),s&&u>=1||!re.current&&!Se(e.target,i))return;if(B.current.classList.add($1),re.current=!0,W1(B.current,{transition:`none`}),W1(L.current,{transition:`none`}),a&&ge({draggedDistance:n}),i&&!a){let e=Ege(n),r=Math.min(e*-1,0)*t;W1(B.current,{transform:G1(x)?`translate3d(0, ${r}px, 0)`:`translate3d(${r}px, 0, 0)`});return}let m=1-u;if((_e||p&&fe===p-1)&&(r?.(e,u),W1(L.current,{opacity:`${m}`,transition:`none`},!0)),l&&L.current&&o){let e=Math.min(be()+u*(1-be()),1),t=8-u*8,n=Math.max(0,14-u*14);W1(l,{borderRadius:`${t}px`,transform:G1(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:`none`},!0)}if(!a){let e=c*t;W1(B.current,{transform:G1(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}}u.useEffect(()=>{var e;function t(){if(!B.current||!E)return;let e=document.activeElement;if(V1(e)||oe.current){let e=window.visualViewport?.height||0,t=window.innerHeight,n=t-e,r=B.current.getBoundingClientRect().height||0,i=r>t*.8;ue.current||=r;let o=B.current.getBoundingClientRect().top;if(Math.abs(se.current-n)>60&&(oe.current=!oe.current),a&&a.length>0&&he&&fe){let e=he[fe]||0;n+=e}if(se.current=n,r>e||oe.current){let t=B.current.getBoundingClientRect().height,r=t;t>e&&(r=e-(i?o:Q1)),g?B.current.style.height=`${t-Math.max(n,0)}px`:B.current.style.height=`${Math.max(r,e-o)}px`}else B.current.style.height=`${ue.current}px`;a&&a.length>0&&!oe.current?B.current.style.bottom=`0px`:B.current.style.bottom=`${Math.max(n,0)}px`}}return(e=window.visualViewport)==null||e.addEventListener(`resize`,t),()=>window.visualViewport?.removeEventListener(`resize`,t)},[fe,a,he]);function we(e){Ee(),v?.(),e||j(!1),setTimeout(()=>{a&&pe(a[0])},J1.DURATION*1e3)}function Te(){if(!B.current)return;let e=document.querySelector(`[data-vaul-drawer-wrapper]`),t=K1(B.current,x);W1(B.current,{transform:`translate3d(0, 0, 0)`,transition:`transform ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`}),W1(L.current,{transition:`opacity ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`,opacity:`1`}),o&&t&&t>0&&A&&W1(e,{borderRadius:`${X1}px`,overflow:`hidden`,...G1(x)?{transform:`scale(${be()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:`top`}:{transform:`scale(${be()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:`left`},transitionProperty:`transform, border-radius`,transitionDuration:`${J1.DURATION}s`,transitionTimingFunction:`cubic-bezier(${J1.EASE.join(`,`)})`},!0)}function Ee(){!P||!B.current||(B.current.classList.remove($1),re.current=!1,F(!1),ne.current=new Date)}function De(e){if(!P||!B.current)return;B.current.classList.remove($1),re.current=!1,F(!1),ne.current=new Date;let t=K1(B.current,x);if(!Se(e.target,!1)||!t||Number.isNaN(t)||te.current===null)return;let n=ne.current.getTime()-te.current.getTime(),r=ae.current-(G1(x)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(I(!0),setTimeout(()=>{I(!1)},200)),a){me({draggedDistance:r*(x===`bottom`||x===`right`?1:-1),closeDrawer:we,velocity:o,dismissible:d}),i?.(e,!0);return}if(x===`bottom`||x===`right`?r>0:r<0){Te(),i?.(e,!0);return}if(o>Y1){we(),i?.(e,!1);return}let s=Math.min(B.current.getBoundingClientRect().height??0,window.innerHeight),l=Math.min(B.current.getBoundingClientRect().width??0,window.innerWidth);if(Math.abs(t)>=(x===`left`||x===`right`?l:s)*c){we(),i?.(e,!1);return}i?.(e,!0),Te()}u.useEffect(()=>(A&&(W1(document.documentElement,{scrollBehavior:`auto`}),R.current=new Date),()=>{Tge(document.documentElement,`scrollBehavior`)}),[A]);function Oe(e){let t=e?(window.innerWidth-Z1)/window.innerWidth:1,n=e?-Z1:0;ie.current&&window.clearTimeout(ie.current),W1(B.current,{transition:`transform ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`,transform:`scale(${t}) translate3d(0, ${n}px, 0)`}),!e&&B.current&&(ie.current=setTimeout(()=>{let e=K1(B.current,x);W1(B.current,{transition:`none`,transform:G1(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))}function ke(e,t){if(t<0)return;let n=(window.innerWidth-Z1)/window.innerWidth,r=n+t*(1-n),i=-Z1+t*Z1;W1(B.current,{transform:G1(x)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`,transition:`none`})}function Ae(e,t){let n=G1(x)?window.innerHeight:window.innerWidth,r=t?(n-Z1)/n:1,i=t?-Z1:0;t&&W1(B.current,{transition:`transform ${J1.DURATION}s cubic-bezier(${J1.EASE.join(`,`)})`,transform:G1(x)?`scale(${r}) translate3d(0, ${i}px, 0)`:`scale(${r}) translate3d(${i}px, 0, 0)`})}return u.createElement(Mm,{defaultOpen:S,onOpenChange:e=>{!d&&!e||(e?N(!0):we(!0),j(e))},open:A},u.createElement(O1.Provider,{value:{activeSnapPoint:de,snapPoints:a,setActiveSnapPoint:pe,drawerRef:B,overlayRef:L,onOpenChange:t,onPress:xe,onRelease:De,onDrag:Ce,dismissible:d,handleOnly:f,isOpen:A,isDragging:P,shouldFade:_e,closeDrawer:we,onNestedDrag:ke,onNestedOpenChange:Oe,onNestedRelease:Ae,keyboardIsOpen:oe,modal:_,snapPointsOffset:he,direction:x,shouldScaleBackground:o,setBackgroundColorOnScale:s,noBodyStyles:b,container:O,autoFocus:k}},n))}var i0=u.forwardRef(function({...e},t){let{overlayRef:n,snapPoints:r,onRelease:i,shouldFade:a,isOpen:o,modal:s}=k1(),c=H1(t,n),l=r&&r.length>0;return s?u.createElement(Fm,{onMouseUp:i,ref:c,"data-vaul-overlay":``,"data-vaul-snap-points":o&&l?`true`:`false`,"data-vaul-snap-points-overlay":o&&a?`true`:`false`,...e}):(typeof window<`u`&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents=`auto`}),null)});i0.displayName=`Drawer.Overlay`;var a0=u.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},i){let{drawerRef:a,onPress:o,onRelease:s,onDrag:c,keyboardIsOpen:l,snapPointsOffset:d,modal:f,isOpen:p,direction:m,snapPoints:h,container:g,handleOnly:_,autoFocus:v}=k1(),[y,b]=u.useState(!1),x=H1(i,a),S=u.useRef(null),C=u.useRef(null),w=u.useRef(!1),T=h&&h.length>0;jge();let E=(e,t,n=0)=>{if(w.current)return!0;let r=Math.abs(e.y),i=Math.abs(e.x),a=i>r,o=[`bottom`,`right`].includes(t)?1:-1;if(t===`left`||t===`right`){if(!(e.x*o<0)&&i>=0&&i<=n)return a}else if(!(e.y*o<0)&&r>=0&&r<=n)return!a;return w.current=!0,!0};u.useEffect(()=>{T&&window.requestAnimationFrame(()=>{b(!0)})},[]);function D(e){S.current=null,w.current=!1,s(e)}return u.createElement(Im,{"data-vaul-drawer-direction":m,"data-vaul-drawer":``,"data-vaul-delayed-snap-points":y?`true`:`false`,"data-vaul-snap-points":p&&T?`true`:`false`,"data-vaul-custom-container":g?`true`:`false`,...r,ref:x,style:d&&d.length>0?{"--snap-point-height":`${d[0]}px`,...t}:t,onPointerDown:e=>{_||(r.onPointerDown==null||r.onPointerDown.call(r,e),S.current={x:e.pageX,y:e.pageY},o(e))},onOpenAutoFocus:e=>{n?.(e),v||e.preventDefault()},onPointerDownOutside:t=>{if(e?.(t),!f||t.defaultPrevented){t.preventDefault();return}l.current&&=!1},onFocusOutside:e=>{if(!f){e.preventDefault();return}},onPointerMove:e=>{if(C.current=e,_||(r.onPointerMove==null||r.onPointerMove.call(r,e),!S.current))return;let t=e.pageY-S.current.y,n=e.pageX-S.current.x,i=e.pointerType===`touch`?10:2;E({x:n,y:t},m,i)?c(e):(Math.abs(n)>i||Math.abs(t)>i)&&(S.current=null)},onPointerUp:e=>{r.onPointerUp==null||r.onPointerUp.call(r,e),S.current=null,w.current=!1,s(e)},onPointerOut:e=>{r.onPointerOut==null||r.onPointerOut.call(r,e),D(C.current)},onContextMenu:e=>{r.onContextMenu==null||r.onContextMenu.call(r,e),D(C.current)}})});a0.displayName=`Drawer.Content`;var Nge=250,Pge=120,o0=u.forwardRef(function({preventCycle:e=!1,children:t,...n},r){let{closeDrawer:i,isDragging:a,snapPoints:o,activeSnapPoint:s,setActiveSnapPoint:c,dismissible:l,handleOnly:d,isOpen:f,onPress:p,onDrag:m}=k1(),h=u.useRef(null),g=u.useRef(!1);function _(){if(g.current){b();return}window.setTimeout(()=>{v()},Pge)}function v(){if(a||e||g.current){b();return}if(b(),(!o||o.length===0)&&l){i();return}if(s===o[o.length-1]&&l){i();return}let t=o.findIndex(e=>e===s);if(t===-1)return;let n=o[t+1];c(n)}function y(){h.current=window.setTimeout(()=>{g.current=!0},Nge)}function b(){window.clearTimeout(h.current),g.current=!1}return u.createElement(`div`,{onClick:_,onPointerCancel:b,onPointerDown:e=>{d&&p(e),y()},onPointerMove:e=>{d&&m(e)},ref:r,"data-vaul-drawer-visible":f?`true`:`false`,"data-vaul-handle":``,"aria-hidden":`true`,...n},u.createElement(`span`,{"data-vaul-handle-hitarea":``,"aria-hidden":`true`},t))});o0.displayName=`Drawer.Handle`;function Fge({onDrag:e,onOpenChange:t,...n}){let{onNestedDrag:r,onNestedOpenChange:i,onNestedRelease:a}=k1();if(!r)throw Error(`Drawer.NestedRoot must be placed in another drawer`);return u.createElement(r0,{nested:!0,onClose:()=>{i(!1)},onDrag:(t,n)=>{r(t,n),e?.(t,n)},onOpenChange:e=>{e&&i(e)},onRelease:a,...n})}function Ige(e){let t=k1(),{container:n=t.container,...r}=e;return u.createElement(Pm,{container:n,...r})}var s0={Root:r0,NestedRoot:Fge,Content:a0,Overlay:i0,Trigger:Nm,Portal:Ige,Handle:o0,Close:zm,Title:Lm,Description:Rm},c0=({shouldScaleBackground:e=!0,...t})=>(0,A.jsx)(s0.Root,{shouldScaleBackground:e,...t});c0.displayName=`Drawer`;var Lge=s0.Trigger,Rge=s0.Portal;s0.Close;var l0=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(s0.Overlay,{ref:n,className:H(`fixed inset-0 z-50 bg-black/80`,e),...t}));l0.displayName=s0.Overlay.displayName;var u0=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(Rge,{children:[(0,A.jsx)(l0,{}),(0,A.jsxs)(s0.Content,{ref:r,className:H(`fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background`,e),...n,children:[(0,A.jsx)(`div`,{className:`mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted`}),t]})]}));u0.displayName=`DrawerContent`;var d0=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`grid gap-1.5 p-4 text-center sm:text-left`,e),...t});d0.displayName=`DrawerHeader`;var zge=({className:e,...t})=>(0,A.jsx)(`div`,{className:H(`mt-auto flex flex-col gap-2 p-4`,e),...t});zge.displayName=`DrawerFooter`;var f0=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(s0.Title,{ref:n,className:H(`text-lg font-semibold leading-none tracking-tight`,e),...t}));f0.displayName=s0.Title.displayName;var p0=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(s0.Description,{ref:n,className:H(`text-sm text-muted-foreground`,e),...t}));p0.displayName=s0.Description.displayName;var m0=1,Bge=.9,Vge=.8,Hge=.17,h0=.1,g0=.999,Uge=.9999,Wge=.99,Gge=/[\\\/_+.#"@\[\(\{&]/,Kge=/[\\\/_+.#"@\[\(\{&]/g,qge=/[\s-]/,_0=/[\s-]/g;function v0(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?m0:Wge;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=v0(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=m0:Gge.test(e.charAt(l-1))?(d*=Vge,p=e.slice(i,l-1).match(Kge),p&&i>0&&(d*=g0**+p.length)):qge.test(e.charAt(l-1))?(d*=Bge,m=e.slice(i,l-1).match(_0),m&&i>0&&(d*=g0**+m.length)):(d*=Hge,i>0&&(d*=g0**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Uge)),(d<h0&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=v0(e,t,n,r,l+1,a+2,o),f*h0>d&&(d=f*h0)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function y0(e){return e.toLowerCase().replace(_0,` `)}function Jge(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,v0(e,t,y0(e),y0(t),0,0,{})}var b0=`[cmdk-group=""]`,x0=`[cmdk-group-items=""]`,Yge=`[cmdk-group-heading=""]`,S0=`[cmdk-item=""]`,C0=`${S0}:not([aria-disabled="true"])`,w0=`cmdk-item-select`,T0=`data-value`,Xge=(e,t,n)=>Jge(e,t,n),E0=u.createContext(void 0),D0=()=>u.useContext(E0),O0=u.createContext(void 0),k0=()=>u.useContext(O0),A0=u.createContext(void 0),j0=u.forwardRef((e,t)=>{let n=F0(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=F0(()=>new Set),i=F0(()=>new Map),a=F0(()=>new Map),o=F0(()=>new Set),s=N0(e),{label:c,children:l,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=Ia(),b=Ia(),x=Ia(),S=u.useRef(null),C=s_e();P0(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),P0(()=>{C(6,A)},[]);let w=u.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=u.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??Xge;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(x0);t?t.appendChild(e.parentElement===t?e:e.closest(`${x0} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${x0} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${b0}[${T0}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(T0);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(b0)?.querySelector(Yge))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${S0}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(C0)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(T0))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(T0))}function F(e){let t=j()?.closest(b0),n;for(;t&&!n;)t=e>0?a_e(t,b0):o_e(t,b0),n=t?.querySelector(C0);n?w.setState(`value`,n.getAttribute(T0)):P(e)}let ee=()=>N(M().length-1),I=e=>{e.preventDefault(),e.metaKey?ee():e.altKey?F(1):P(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return u.createElement(z.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:_&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),ee();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(w0);t.dispatchEvent(e)}}}}},u.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:l_e},c),R0(e,e=>u.createElement(O0.Provider,{value:w},u.createElement(E0.Provider,{value:T},e))))}),Zge=u.forwardRef((e,t)=>{let n=Ia(),r=u.useRef(null),i=u.useContext(A0),a=D0(),o=N0(e),s=o.current?.forceMount??i?.forceMount;P0(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=L0(n,r,[e.value,e.children,r],e.keywords),l=k0(),d=I0(e=>e.value&&e.value===c.current),f=I0(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);u.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(w0,p),()=>t.removeEventListener(w0,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return u.createElement(z.div,{ref:E(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),Qge=u.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ia(),s=u.useRef(null),c=u.useRef(null),l=Ia(),d=D0(),f=I0(e=>i||d.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);P0(()=>d.group(o),[]),L0(o,s,[e.value,e.heading,c]);let p=u.useMemo(()=>({id:o,forceMount:i}),[i]);return u.createElement(z.div,{ref:E(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:f?void 0:!0},n&&u.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),R0(e,e=>u.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},u.createElement(A0.Provider,{value:p},e))))}),$ge=u.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=u.useRef(null),a=I0(e=>!e.search);return!n&&!a?null:u.createElement(z.div,{ref:E(i,t),...r,"cmdk-separator":``,role:`separator`})}),e_e=u.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=k0(),o=I0(e=>e.search),s=I0(e=>e.selectedItemId),c=D0();return u.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),u.createElement(z.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),t_e=u.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=u.useRef(null),o=u.useRef(null),s=I0(e=>e.selectedItemId),c=D0();return u.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),u.createElement(z.div,{ref:E(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},R0(e,e=>u.createElement(`div`,{ref:E(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),n_e=u.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return u.createElement(Mm,{open:n,onOpenChange:r},u.createElement(Pm,{container:o},u.createElement(Fm,{"cmdk-overlay":``,className:i}),u.createElement(Im,{"aria-label":e.label,"cmdk-dialog":``,className:a},u.createElement(j0,{ref:t,...s}))))}),r_e=u.forwardRef((e,t)=>I0(e=>e.filtered.count===0)?u.createElement(z.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),i_e=u.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return u.createElement(z.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},R0(e,e=>u.createElement(`div`,{"aria-hidden":!0},e)))}),M0=Object.assign(j0,{List:t_e,Item:Zge,Input:e_e,Group:Qge,Separator:$ge,Dialog:n_e,Empty:r_e,Loading:i_e});function a_e(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function o_e(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function N0(e){let t=u.useRef(e);return P0(()=>{t.current=e}),t}var P0=typeof window>`u`?u.useEffect:u.useLayoutEffect;function F0(e){let t=u.useRef();return t.current===void 0&&(t.current=e()),t}function I0(e){let t=k0(),n=()=>e(t.snapshot());return u.useSyncExternalStore(t.subscribe,n,n)}function L0(e,t,n,r=[]){let i=u.useRef(),a=D0();return P0(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(T0,s),i.current=s}),i}var s_e=()=>{let[e,t]=u.useState(),n=F0(()=>new Map);return P0(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function c_e(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function R0({asChild:e,children:t},n){return e&&u.isValidElement(t)?u.cloneElement(c_e(t),{ref:t.ref},n(t.props.children)):n(t)}var l_e={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},z0=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(M0,{ref:n,className:H(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,e),...t}));z0.displayName=M0.displayName;var B0=u.forwardRef(({className:e,...t},n)=>(0,A.jsxs)(`div`,{className:`flex items-center border-b px-3`,"data-cmdk-input-wrapper":``,children:[(0,A.jsx)(gr,{className:`mr-2 h-4 w-4 shrink-0 opacity-50`}),(0,A.jsx)(M0.Input,{ref:n,className:H(`flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]}));B0.displayName=M0.Input.displayName;var V0=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(M0.List,{ref:n,className:H(`max-h-[300px] overflow-y-auto overflow-x-hidden`,e),...t}));V0.displayName=M0.List.displayName;var H0=u.forwardRef((e,t)=>(0,A.jsx)(M0.Empty,{ref:t,className:`py-6 text-center text-sm`,...e}));H0.displayName=M0.Empty.displayName;var U0=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(M0.Group,{ref:n,className:H(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground`,e),...t}));U0.displayName=M0.Group.displayName;var u_e=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(M0.Separator,{ref:n,className:H(`-mx-1 h-px bg-border`,e),...t}));u_e.displayName=M0.Separator.displayName;var W0=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(M0.Item,{ref:n,className:H(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}));W0.displayName=M0.Item.displayName;var d_e=({className:e,...t})=>(0,A.jsx)(`span`,{className:H(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});d_e.displayName=`CommandShortcut`;var G0=`ContextMenu`,[f_e,p_e]=M(G0,[JB]),K0=JB(),[m_e,q0]=f_e(G0),J0=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=u.useState(!1),c=K0(t),l=ie(r),d=u.useCallback(e=>{s(e),l(e)},[l]);return(0,A.jsx)(m_e,{scope:t,open:o,onOpenChange:d,modal:a,children:(0,A.jsx)(rH,{...c,dir:i,open:o,onOpenChange:d,modal:a,children:n})})};J0.displayName=G0;var Y0=`ContextMenuTrigger`,X0=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=q0(Y0,n),o=K0(n),s=u.useRef({x:0,y:0}),c=u.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=u.useRef(0),d=u.useCallback(()=>window.clearTimeout(l.current),[]),f=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return u.useEffect(()=>d,[d]),u.useEffect(()=>void(r&&d()),[r,d]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(iH,{...o,virtualRef:c}),(0,A.jsx)(z.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:w(e.onContextMenu,e=>{d(),f(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:w(e.onPointerDown,l2(e=>{d(),l.current=window.setTimeout(()=>f(e),700)})),onPointerMove:r?e.onPointerMove:w(e.onPointerMove,l2(d)),onPointerCancel:r?e.onPointerCancel:w(e.onPointerCancel,l2(d)),onPointerUp:r?e.onPointerUp:w(e.onPointerUp,l2(d))})]})});X0.displayName=Y0;var h_e=`ContextMenuPortal`,Z0=e=>{let{__scopeContextMenu:t,...n}=e,r=K0(t);return(0,A.jsx)(aH,{...r,...n})};Z0.displayName=h_e;var Q0=`ContextMenuContent`,$0=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=q0(Q0,n),a=K0(n),o=u.useRef(!1);return(0,A.jsx)(oH,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});$0.displayName=Q0;var g_e=`ContextMenuGroup`,__e=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(sH,{...i,...r,ref:t})});__e.displayName=g_e;var v_e=`ContextMenuLabel`,e2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(cH,{...i,...r,ref:t})});e2.displayName=v_e;var y_e=`ContextMenuItem`,t2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(lH,{...i,...r,ref:t})});t2.displayName=y_e;var b_e=`ContextMenuCheckboxItem`,n2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(uH,{...i,...r,ref:t})});n2.displayName=b_e;var x_e=`ContextMenuRadioGroup`,S_e=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(dH,{...i,...r,ref:t})});S_e.displayName=x_e;var C_e=`ContextMenuRadioItem`,r2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(fH,{...i,...r,ref:t})});r2.displayName=C_e;var w_e=`ContextMenuItemIndicator`,i2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(pH,{...i,...r,ref:t})});i2.displayName=w_e;var T_e=`ContextMenuSeparator`,a2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(mH,{...i,...r,ref:t})});a2.displayName=T_e;var E_e=`ContextMenuArrow`,D_e=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(hH,{...i,...r,ref:t})});D_e.displayName=E_e;var o2=`ContextMenuSub`,O_e=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=K0(t),[s,c]=ke({prop:i,defaultProp:a??!1,onChange:r,caller:o2});return(0,A.jsx)(gH,{...o,open:s,onOpenChange:c,children:n})};O_e.displayName=o2;var k_e=`ContextMenuSubTrigger`,s2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(_H,{...i,...r,ref:t})});s2.displayName=k_e;var A_e=`ContextMenuSubContent`,c2=u.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=K0(n);return(0,A.jsx)(vH,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});c2.displayName=A_e;function l2(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var j_e=J0,M_e=X0,N_e=Z0,u2=$0,d2=e2,f2=t2,p2=n2,m2=r2,h2=i2,g2=a2,_2=s2,v2=c2,P_e=j_e,F_e=M_e,I_e=u.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,A.jsxs)(_2,{ref:i,className:H(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent data-[state=open]:text-accent-foreground focus:bg-accent focus:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,A.jsx)(nn,{className:`ml-auto h-4 w-4`})]}));I_e.displayName=_2.displayName;var L_e=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(v2,{ref:n,className:H(`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]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));L_e.displayName=v2.displayName;var y2=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(N_e,{children:(0,A.jsx)(u2,{ref:n,className:H(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md animate-in fade-in-80 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})}));y2.displayName=u2.displayName;var b2=u.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(f2,{ref:r,className:H(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,t&&`pl-8`,e),...n}));b2.displayName=f2.displayName;var R_e=u.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,A.jsxs)(p2,{ref:i,className:H(`relative flex 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),checked:n,...r,children:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(h2,{children:(0,A.jsx)($t,{className:`h-4 w-4`})})}),t]}));R_e.displayName=p2.displayName;var z_e=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(m2,{ref:r,className:H(`relative flex 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:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(h2,{children:(0,A.jsx)(dn,{className:`h-2 w-2 fill-current`})})}),t]}));z_e.displayName=m2.displayName;var x2=u.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(d2,{ref:r,className:H(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));x2.displayName=d2.displayName;var S2=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(g2,{ref:n,className:H(`-mx-1 my-1 h-px bg-border`,e),...t}));S2.displayName=g2.displayName;var B_e=({className:e,...t})=>(0,A.jsx)(`span`,{className:H(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});B_e.displayName=`ContextMenuShortcut`;var C2=`Menubar`,[w2,V_e,H_e]=ne(C2),[T2,U_e]=M(C2,[H_e,CB]),E2=JB(),D2=CB(),[W_e,O2]=T2(C2),k2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,value:r,onValueChange:i,defaultValue:a,loop:o=!0,dir:s,...c}=e,l=hB(s),d=D2(n),[f,p]=ke({prop:r,onChange:i,defaultProp:a??``,caller:C2}),[m,h]=u.useState(null);return(0,A.jsx)(W_e,{scope:n,value:f,onMenuOpen:u.useCallback(e=>{p(e),h(e)},[p]),onMenuClose:u.useCallback(()=>p(``),[p]),onMenuToggle:u.useCallback(e=>{p(t=>t?``:e),h(e)},[p]),dir:l,loop:o,children:(0,A.jsx)(w2.Provider,{scope:n,children:(0,A.jsx)(w2.Slot,{scope:n,children:(0,A.jsx)(FB,{asChild:!0,...d,orientation:`horizontal`,loop:o,dir:l,currentTabStopId:m,onCurrentTabStopIdChange:h,children:(0,A.jsx)(z.div,{role:`menubar`,...c,ref:t})})})})})});k2.displayName=C2;var A2=`MenubarMenu`,[G_e,j2]=T2(A2),M2=e=>{let{__scopeMenubar:t,value:n,...r}=e,i=Ia(),a=n||i||`LEGACY_REACT_AUTO_VALUE`,o=O2(A2,t),s=E2(t),c=u.useRef(null),l=u.useRef(!1),d=o.value===a;return u.useEffect(()=>{d||(l.current=!1)},[d]),(0,A.jsx)(G_e,{scope:t,value:a,triggerId:Ia(),triggerRef:c,contentId:Ia(),wasKeyboardTriggerOpenRef:l,children:(0,A.jsx)(rH,{...s,open:d,onOpenChange:e=>{e||o.onMenuClose()},modal:!1,dir:o.dir,...r})})};M2.displayName=A2;var N2=`MenubarTrigger`,P2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,disabled:r=!1,...i}=e,a=D2(n),o=E2(n),s=O2(N2,n),c=j2(N2,n),l=u.useRef(null),d=D(t,l,c.triggerRef),[f,p]=u.useState(!1),m=s.value===c.value;return(0,A.jsx)(w2.ItemSlot,{scope:n,value:c.value,disabled:r,children:(0,A.jsx)(IB,{asChild:!0,...a,focusable:!r,tabStopId:c.value,children:(0,A.jsx)(iH,{asChild:!0,...o,children:(0,A.jsx)(z.button,{type:`button`,role:`menuitem`,id:c.triggerId,"aria-haspopup":`menu`,"aria-expanded":m,"aria-controls":m?c.contentId:void 0,"data-highlighted":f?``:void 0,"data-state":m?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:d,onPointerDown:w(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(s.onMenuOpen(c.value),m||e.preventDefault())}),onPointerEnter:w(e.onPointerEnter,()=>{s.value&&!m&&(s.onMenuOpen(c.value),l.current?.focus())}),onKeyDown:w(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&s.onMenuToggle(c.value),e.key===`ArrowDown`&&s.onMenuOpen(c.value),[`Enter`,` `,`ArrowDown`].includes(e.key)&&(c.wasKeyboardTriggerOpenRef.current=!0,e.preventDefault()))}),onFocus:w(e.onFocus,()=>p(!0)),onBlur:w(e.onBlur,()=>p(!1))})})})})});P2.displayName=N2;var K_e=`MenubarPortal`,F2=e=>{let{__scopeMenubar:t,...n}=e,r=E2(t);return(0,A.jsx)(aH,{...r,...n})};F2.displayName=K_e;var I2=`MenubarContent`,L2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,align:r=`start`,...i}=e,a=E2(n),o=O2(I2,n),s=j2(I2,n),c=V_e(n),l=u.useRef(!1);return(0,A.jsx)(oH,{id:s.contentId,"aria-labelledby":s.triggerId,"data-radix-menubar-content":``,...a,...i,ref:t,align:r,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{!o.value&&!l.current&&s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()}),onFocusOutside:w(e.onFocusOutside,e=>{let t=e.target;c().some(e=>e.ref.current?.contains(t))&&e.preventDefault()}),onInteractOutside:w(e.onInteractOutside,()=>{l.current=!0}),onEntryFocus:e=>{s.wasKeyboardTriggerOpenRef.current||e.preventDefault()},onKeyDown:w(e.onKeyDown,e=>{if([`ArrowRight`,`ArrowLeft`].includes(e.key)){let t=e.target,n=t.hasAttribute(`data-radix-menubar-subtrigger`),r=t.closest(`[data-radix-menubar-content]`)!==e.currentTarget,i=(o.dir===`rtl`?`ArrowRight`:`ArrowLeft`)===e.key;if(!i&&n||r&&i)return;let a=c().filter(e=>!e.disabled).map(e=>e.value);i&&a.reverse();let l=a.indexOf(s.value);a=o.loop?cve(a,l+1):a.slice(l+1);let[u]=a;u&&o.onMenuOpen(u)}},{checkForDefaultPrevented:!1}),style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});L2.displayName=I2;var q_e=`MenubarGroup`,J_e=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(sH,{...i,...r,ref:t})});J_e.displayName=q_e;var Y_e=`MenubarLabel`,R2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(cH,{...i,...r,ref:t})});R2.displayName=Y_e;var X_e=`MenubarItem`,z2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(lH,{...i,...r,ref:t})});z2.displayName=X_e;var Z_e=`MenubarCheckboxItem`,B2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(uH,{...i,...r,ref:t})});B2.displayName=Z_e;var Q_e=`MenubarRadioGroup`,$_e=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(dH,{...i,...r,ref:t})});$_e.displayName=Q_e;var eve=`MenubarRadioItem`,V2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(fH,{...i,...r,ref:t})});V2.displayName=eve;var tve=`MenubarItemIndicator`,H2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(pH,{...i,...r,ref:t})});H2.displayName=tve;var nve=`MenubarSeparator`,U2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(mH,{...i,...r,ref:t})});U2.displayName=nve;var rve=`MenubarArrow`,ive=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(hH,{...i,...r,ref:t})});ive.displayName=rve;var W2=`MenubarSub`,ave=e=>{let{__scopeMenubar:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=E2(t),[s,c]=ke({prop:r,defaultProp:a??!1,onChange:i,caller:W2});return(0,A.jsx)(gH,{...o,open:s,onOpenChange:c,children:n})};ave.displayName=W2;var ove=`MenubarSubTrigger`,G2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(_H,{"data-radix-menubar-subtrigger":``,...i,...r,ref:t})});G2.displayName=ove;var sve=`MenubarSubContent`,K2=u.forwardRef((e,t)=>{let{__scopeMenubar:n,...r}=e,i=E2(n);return(0,A.jsx)(vH,{...i,"data-radix-menubar-content":``,...r,ref:t,style:{...e.style,"--radix-menubar-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-menubar-content-available-width":`var(--radix-popper-available-width)`,"--radix-menubar-content-available-height":`var(--radix-popper-available-height)`,"--radix-menubar-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-menubar-trigger-height":`var(--radix-popper-anchor-height)`}})});K2.displayName=sve;function cve(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var q2=k2,lve=M2,J2=P2,uve=F2,Y2=L2,X2=R2,Z2=z2,Q2=B2,$2=V2,e4=H2,t4=U2,n4=G2,r4=K2,dve=lve,i4=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(q2,{ref:n,className:H(`flex h-10 items-center space-x-1 rounded-md border bg-background p-1`,e),...t}));i4.displayName=q2.displayName;var a4=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(J2,{ref:n,className:H(`flex cursor-default select-none items-center rounded-sm px-3 py-1.5 text-sm font-medium outline-none data-[state=open]:bg-accent data-[state=open]:text-accent-foreground focus:bg-accent focus:text-accent-foreground`,e),...t}));a4.displayName=J2.displayName;var fve=u.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,A.jsxs)(n4,{ref:i,className:H(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[state=open]:bg-accent data-[state=open]:text-accent-foreground focus:bg-accent focus:text-accent-foreground`,t&&`pl-8`,e),...r,children:[n,(0,A.jsx)(nn,{className:`ml-auto h-4 w-4`})]}));fve.displayName=n4.displayName;var pve=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(r4,{ref:n,className:H(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));pve.displayName=r4.displayName;var o4=u.forwardRef(({className:e,align:t=`start`,alignOffset:n=-4,sideOffset:r=8,...i},a)=>(0,A.jsx)(uve,{children:(0,A.jsx)(Y2,{ref:a,align:t,alignOffset:n,sideOffset:r,className:H(`z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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),...i})}));o4.displayName=Y2.displayName;var s4=u.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(Z2,{ref:r,className:H(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 focus:bg-accent focus:text-accent-foreground`,t&&`pl-8`,e),...n}));s4.displayName=Z2.displayName;var mve=u.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,A.jsxs)(Q2,{ref:i,className:H(`relative flex 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),checked:n,...r,children:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(e4,{children:(0,A.jsx)($t,{className:`h-4 w-4`})})}),t]}));mve.displayName=Q2.displayName;var hve=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)($2,{ref:r,className:H(`relative flex 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:[(0,A.jsx)(`span`,{className:`absolute left-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,A.jsx)(e4,{children:(0,A.jsx)(dn,{className:`h-2 w-2 fill-current`})})}),t]}));hve.displayName=$2.displayName;var gve=u.forwardRef(({className:e,inset:t,...n},r)=>(0,A.jsx)(X2,{ref:r,className:H(`px-2 py-1.5 text-sm font-semibold`,t&&`pl-8`,e),...n}));gve.displayName=X2.displayName;var c4=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(t4,{ref:n,className:H(`-mx-1 my-1 h-px bg-muted`,e),...t}));c4.displayName=t4.displayName;var l4=({className:e,...t})=>(0,A.jsx)(`span`,{className:H(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});l4.displayname=`MenubarShortcut`;var u4=`NavigationMenu`,[d4,f4,_ve]=ne(u4),[p4,vve,yve]=ne(u4),[m4,bve]=M(u4,[_ve,yve]),[xve,h4]=m4(u4),[Sve,Cve]=m4(u4),g4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:a,delayDuration:o=200,skipDelayDuration:s=300,orientation:c=`horizontal`,dir:l,...d}=e,[f,p]=u.useState(null),m=D(t,e=>p(e)),h=hB(l),g=u.useRef(0),_=u.useRef(0),v=u.useRef(0),[y,b]=u.useState(!0),[x,S]=ke({prop:r,onChange:e=>{let t=e!==``,n=s>0;t?(window.clearTimeout(v.current),n&&b(!1)):(window.clearTimeout(v.current),v.current=window.setTimeout(()=>b(!0),s)),i?.(e)},defaultProp:a??``,caller:u4}),C=u.useCallback(()=>{window.clearTimeout(_.current),_.current=window.setTimeout(()=>S(``),150)},[S]),w=u.useCallback(e=>{window.clearTimeout(_.current),S(e)},[S]),T=u.useCallback(e=>{x===e?window.clearTimeout(_.current):g.current=window.setTimeout(()=>{window.clearTimeout(_.current),S(e)},o)},[x,S,o]);return u.useEffect(()=>()=>{window.clearTimeout(g.current),window.clearTimeout(_.current),window.clearTimeout(v.current)},[]),(0,A.jsx)(v4,{scope:n,isRootMenu:!0,value:x,dir:h,orientation:c,rootNavigationMenu:f,onTriggerEnter:e=>{window.clearTimeout(g.current),y?T(e):w(e)},onTriggerLeave:()=>{window.clearTimeout(g.current),C()},onContentEnter:()=>window.clearTimeout(_.current),onContentLeave:C,onItemSelect:e=>{S(t=>t===e?``:e)},onItemDismiss:()=>S(``),children:(0,A.jsx)(z.nav,{"aria-label":`Main`,"data-orientation":c,dir:h,...d,ref:m})})});g4.displayName=u4;var _4=`NavigationMenuSub`,wve=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,...s}=e,c=h4(_4,n),[l,u]=ke({prop:r,onChange:i,defaultProp:a??``,caller:_4});return(0,A.jsx)(v4,{scope:n,isRootMenu:!1,value:l,dir:c.dir,orientation:o,rootNavigationMenu:c.rootNavigationMenu,onTriggerEnter:e=>u(e),onItemSelect:e=>u(e),onItemDismiss:()=>u(``),children:(0,A.jsx)(z.div,{"data-orientation":o,...s,ref:t})})});wve.displayName=_4;var v4=e=>{let{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:a,children:o,value:s,onItemSelect:c,onItemDismiss:l,onTriggerEnter:d,onTriggerLeave:f,onContentEnter:p,onContentLeave:m}=e,[h,g]=u.useState(null),[_,v]=u.useState(new Map),[y,b]=u.useState(null);return(0,A.jsx)(xve,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:s,previousValue:fG(s),baseId:Ia(),dir:i,orientation:a,viewport:h,onViewportChange:g,indicatorTrack:y,onIndicatorTrackChange:b,onTriggerEnter:ie(d),onTriggerLeave:ie(f),onContentEnter:ie(p),onContentLeave:ie(m),onItemSelect:ie(c),onItemDismiss:ie(l),onViewportContentChange:u.useCallback((e,t)=>{v(n=>(n.set(e,t),new Map(n)))},[]),onViewportContentRemove:u.useCallback(e=>{v(t=>t.has(e)?(t.delete(e),new Map(t)):t)},[]),children:(0,A.jsx)(d4.Provider,{scope:t,children:(0,A.jsx)(Sve,{scope:t,items:_,children:o})})})},y4=`NavigationMenuList`,b4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=h4(y4,n),a=(0,A.jsx)(z.ul,{"data-orientation":i.orientation,...r,ref:t});return(0,A.jsx)(z.div,{style:{position:`relative`},ref:i.onIndicatorTrackChange,children:(0,A.jsx)(d4.Slot,{scope:n,children:i.isRootMenu?(0,A.jsx)(I4,{asChild:!0,children:a}):a})})});b4.displayName=y4;var x4=`NavigationMenuItem`,[Tve,S4]=m4(x4),C4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,...i}=e,a=Ia(),o=r||a||`LEGACY_REACT_AUTO_VALUE`,s=u.useRef(null),c=u.useRef(null),l=u.useRef(null),d=u.useRef(()=>{}),f=u.useRef(!1),p=u.useCallback((e=`start`)=>{if(s.current){d.current();let t=z4(s.current);t.length&&B4(e===`start`?t:t.reverse())}},[]),m=u.useCallback(()=>{if(s.current){let e=z4(s.current);e.length&&(d.current=Mve(e))}},[]);return(0,A.jsx)(Tve,{scope:n,value:o,triggerRef:c,contentRef:s,focusProxyRef:l,wasEscapeCloseRef:f,onEntryKeyDown:p,onFocusProxyEnter:p,onRootContentClose:m,onContentFocusOutside:m,children:(0,A.jsx)(z.li,{...i,ref:t})})});C4.displayName=x4;var w4=`NavigationMenuTrigger`,T4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,disabled:r,...i}=e,a=h4(w4,e.__scopeNavigationMenu),o=S4(w4,e.__scopeNavigationMenu),s=u.useRef(null),c=D(s,o.triggerRef,t),l=U4(a.baseId,o.value),d=W4(a.baseId,o.value),f=u.useRef(!1),p=u.useRef(!1),m=o.value===a.value;return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(d4.ItemSlot,{scope:n,value:o.value,children:(0,A.jsx)(R4,{asChild:!0,children:(0,A.jsx)(z.button,{id:l,disabled:r,"data-disabled":r?``:void 0,"data-state":H4(m),"aria-expanded":m,"aria-controls":d,...i,ref:c,onPointerEnter:w(e.onPointerEnter,()=>{p.current=!1,o.wasEscapeCloseRef.current=!1}),onPointerMove:w(e.onPointerMove,G4(()=>{r||p.current||o.wasEscapeCloseRef.current||f.current||(a.onTriggerEnter(o.value),f.current=!0)})),onPointerLeave:w(e.onPointerLeave,G4(()=>{r||(a.onTriggerLeave(),f.current=!1)})),onClick:w(e.onClick,()=>{a.onItemSelect(o.value),p.current=m}),onKeyDown:w(e.onKeyDown,e=>{let t={horizontal:`ArrowDown`,vertical:a.dir===`rtl`?`ArrowLeft`:`ArrowRight`}[a.orientation];m&&e.key===t&&(o.onEntryKeyDown(),e.preventDefault())})})})}),m&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Fe,{"aria-hidden":!0,tabIndex:0,ref:o.focusProxyRef,onFocus:e=>{let t=o.contentRef.current,n=e.relatedTarget,r=n===s.current,i=t?.contains(n);(r||!i)&&o.onFocusProxyEnter(r?`start`:`end`)}}),a.viewport&&(0,A.jsx)(`span`,{"aria-owns":d})]})]})});T4.displayName=w4;var Eve=`NavigationMenuLink`,E4=`navigationMenu.linkSelect`,D4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,active:r,onSelect:i,...a}=e;return(0,A.jsx)(R4,{asChild:!0,children:(0,A.jsx)(z.a,{"data-active":r?``:void 0,"aria-current":r?`page`:void 0,...a,ref:t,onClick:w(e.onClick,e=>{let t=e.target,n=new CustomEvent(E4,{bubbles:!0,cancelable:!0});t.addEventListener(E4,e=>i?.(e),{once:!0}),re(t,n),!n.defaultPrevented&&!e.metaKey&&re(t,new CustomEvent(M4,{bubbles:!0,cancelable:!0}))},{checkForDefaultPrevented:!1})})})});D4.displayName=Eve;var O4=`NavigationMenuIndicator`,k4=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=h4(O4,e.__scopeNavigationMenu),a=!!i.value;return i.indicatorTrack?C.createPortal((0,A.jsx)(we,{present:n||a,children:(0,A.jsx)(Dve,{...r,ref:t})}),i.indicatorTrack):null});k4.displayName=O4;var Dve=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=h4(O4,n),a=f4(n),[o,s]=u.useState(null),[c,l]=u.useState(null),d=i.orientation===`horizontal`,f=!!i.value;u.useEffect(()=>{let e=a().find(e=>e.value===i.value)?.ref.current;e&&s(e)},[a,i.value]);let p=()=>{o&&l({size:d?o.offsetWidth:o.offsetHeight,offset:d?o.offsetLeft:o.offsetTop})};return V4(o,p),V4(i.indicatorTrack,p),c?(0,A.jsx)(z.div,{"aria-hidden":!0,"data-state":f?`visible`:`hidden`,"data-orientation":i.orientation,...r,ref:t,style:{position:`absolute`,...d?{left:0,width:c.size+`px`,transform:`translateX(${c.offset}px)`}:{top:0,height:c.size+`px`,transform:`translateY(${c.offset}px)`},...r.style}}):null}),A4=`NavigationMenuContent`,j4=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=h4(A4,e.__scopeNavigationMenu),a=S4(A4,e.__scopeNavigationMenu),o=D(a.contentRef,t),s=a.value===i.value,c={value:a.value,triggerRef:a.triggerRef,focusProxyRef:a.focusProxyRef,wasEscapeCloseRef:a.wasEscapeCloseRef,onContentFocusOutside:a.onContentFocusOutside,onRootContentClose:a.onRootContentClose,...r};return i.viewport?(0,A.jsx)(Ove,{forceMount:n,...c,ref:o}):(0,A.jsx)(we,{present:n||s,children:(0,A.jsx)(N4,{"data-state":H4(s),...c,ref:o,onPointerEnter:w(e.onPointerEnter,i.onContentEnter),onPointerLeave:w(e.onPointerLeave,G4(i.onContentLeave)),style:{pointerEvents:!s&&i.isRootMenu?`none`:void 0,...c.style}})})});j4.displayName=A4;var Ove=u.forwardRef((e,t)=>{let{onViewportContentChange:n,onViewportContentRemove:r}=h4(A4,e.__scopeNavigationMenu);return be(()=>{n(e.value,{ref:t,...e})},[e,t,n]),be(()=>()=>r(e.value),[e.value,r]),null}),M4=`navigationMenu.rootContentDismiss`,N4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:a,wasEscapeCloseRef:o,onRootContentClose:s,onContentFocusOutside:c,...l}=e,d=h4(A4,n),f=u.useRef(null),p=D(f,t),m=U4(d.baseId,r),h=W4(d.baseId,r),g=f4(n),_=u.useRef(null),{onItemDismiss:v}=d;u.useEffect(()=>{let e=f.current;if(d.isRootMenu&&e){let t=()=>{v(),s(),e.contains(document.activeElement)&&i.current?.focus()};return e.addEventListener(M4,t),()=>e.removeEventListener(M4,t)}},[d.isRootMenu,e.value,i,v,s]);let y=u.useMemo(()=>{let e=g().map(e=>e.value);d.dir===`rtl`&&e.reverse();let t=e.indexOf(d.value),n=e.indexOf(d.previousValue),i=r===d.value,a=n===e.indexOf(r);if(!i&&!a)return _.current;let o=(()=>{if(t!==n){if(i&&n!==-1)return t>n?`from-end`:`from-start`;if(a&&t!==-1)return t>n?`to-start`:`to-end`}return null})();return _.current=o,o},[d.previousValue,d.value,d.dir,g,r]);return(0,A.jsx)(I4,{asChild:!0,children:(0,A.jsx)(de,{id:h,"aria-labelledby":m,"data-motion":y,"data-orientation":d.orientation,...l,ref:p,disableOutsidePointerEvents:!1,onDismiss:()=>{let e=new Event(M4,{bubbles:!0,cancelable:!0});f.current?.dispatchEvent(e)},onFocusOutside:w(e.onFocusOutside,e=>{c();let t=e.target;d.rootNavigationMenu?.contains(t)&&e.preventDefault()}),onPointerDownOutside:w(e.onPointerDownOutside,e=>{let t=e.target,n=g().some(e=>e.ref.current?.contains(t)),r=d.isRootMenu&&d.viewport?.contains(t);(n||r||!d.isRootMenu)&&e.preventDefault()}),onKeyDown:w(e.onKeyDown,e=>{let t=e.altKey||e.ctrlKey||e.metaKey;if(e.key===`Tab`&&!t){let t=z4(e.currentTarget),n=document.activeElement,r=t.findIndex(e=>e===n);B4(e.shiftKey?t.slice(0,r).reverse():t.slice(r+1,t.length))?e.preventDefault():a.current?.focus()}}),onEscapeKeyDown:w(e.onEscapeKeyDown,e=>{o.current=!0})})})}),P4=`NavigationMenuViewport`,F4=u.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=!!h4(P4,e.__scopeNavigationMenu).value;return(0,A.jsx)(we,{present:n||i,children:(0,A.jsx)(kve,{...r,ref:t})})});F4.displayName=P4;var kve=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,children:r,...i}=e,a=h4(P4,n),o=D(t,a.onViewportChange),s=Cve(A4,e.__scopeNavigationMenu),[c,l]=u.useState(null),[d,f]=u.useState(null),p=c?c?.width+`px`:void 0,m=c?c?.height+`px`:void 0,h=!!a.value,g=h?a.value:a.previousValue;return V4(d,()=>{d&&l({width:d.offsetWidth,height:d.offsetHeight})}),(0,A.jsx)(z.div,{"data-state":H4(h),"data-orientation":a.orientation,...i,ref:o,style:{pointerEvents:!h&&a.isRootMenu?`none`:void 0,"--radix-navigation-menu-viewport-width":p,"--radix-navigation-menu-viewport-height":m,...i.style},onPointerEnter:w(e.onPointerEnter,a.onContentEnter),onPointerLeave:w(e.onPointerLeave,G4(a.onContentLeave)),children:Array.from(s.items).map(([e,{ref:t,forceMount:n,...r}])=>{let i=g===e;return(0,A.jsx)(we,{present:n||i,children:(0,A.jsx)(N4,{...r,ref:E(t,e=>{i&&e&&f(e)})})},e)})})}),Ave=`FocusGroup`,I4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=h4(Ave,n);return(0,A.jsx)(p4.Provider,{scope:n,children:(0,A.jsx)(p4.Slot,{scope:n,children:(0,A.jsx)(z.div,{dir:i.dir,...r,ref:t})})})}),L4=[`ArrowRight`,`ArrowLeft`,`ArrowUp`,`ArrowDown`],jve=`FocusGroupItem`,R4=u.forwardRef((e,t)=>{let{__scopeNavigationMenu:n,...r}=e,i=vve(n),a=h4(jve,n);return(0,A.jsx)(p4.ItemSlot,{scope:n,children:(0,A.jsx)(z.button,{...r,ref:t,onKeyDown:w(e.onKeyDown,e=>{if([`Home`,`End`,...L4].includes(e.key)){let t=i().map(e=>e.ref.current);if([a.dir===`rtl`?`ArrowRight`:`ArrowLeft`,`ArrowUp`,`End`].includes(e.key)&&t.reverse(),L4.includes(e.key)){let n=t.indexOf(e.currentTarget);t=t.slice(n+1)}setTimeout(()=>B4(t)),e.preventDefault()}})})})});function z4(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function B4(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}function Mve(e){return e.forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)}),()=>{e.forEach(e=>{let t=e.dataset.tabindex;e.setAttribute(`tabindex`,t)})}}function V4(e,t){let n=ie(t);be(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}function H4(e){return e?`open`:`closed`}function U4(e,t){return`${e}-trigger-${t}`}function W4(e,t){return`${e}-content-${t}`}function G4(e){return t=>t.pointerType===`mouse`?e(t):void 0}var K4=g4,q4=b4,Nve=C4,J4=T4,Pve=D4,Y4=k4,X4=j4,Z4=F4,Q4=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(K4,{ref:r,className:H(`relative z-10 flex max-w-max flex-1 items-center justify-center`,e),...n,children:[t,(0,A.jsx)(r3,{})]}));Q4.displayName=K4.displayName;var $4=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(q4,{ref:n,className:H(`group flex flex-1 list-none items-center justify-center space-x-1`,e),...t}));$4.displayName=q4.displayName;var e3=Nve,Fve=Ft(`group inline-flex h-10 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[active]:bg-accent/50 data-[state=open]:bg-accent/50`),t3=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsxs)(J4,{ref:r,className:H(Fve(),`group`,e),...n,children:[t,` `,(0,A.jsx)(en,{className:`relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180`,"aria-hidden":`true`})]}));t3.displayName=J4.displayName;var n3=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(X4,{ref:n,className:H(`left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto`,e),...t}));n3.displayName=X4.displayName;var Ive=Pve,r3=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{className:H(`absolute left-0 top-full flex justify-center`),children:(0,A.jsx)(Z4,{className:H(`origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]`,e),ref:n,...t})}));r3.displayName=Z4.displayName;var Lve=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Y4,{ref:n,className:H(`top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in`,e),...t,children:(0,A.jsx)(`div`,{className:`relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md`})}));Lve.displayName=Y4.displayName;var i3=`Accordion`,Rve=[`Home`,`End`,`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`],[a3,zve,Bve]=ne(i3),[o3,Vve]=M(i3,[Bve,Oh]),s3=Oh(),c3=u.forwardRef((e,t)=>{let{type:n,...r}=e,i=r,a=r;return(0,A.jsx)(a3.Provider,{scope:e.__scopeAccordion,children:n===`multiple`?(0,A.jsx)(Gve,{...a,ref:t}):(0,A.jsx)(Wve,{...i,ref:t})})});c3.displayName=i3;var[l3,Hve]=o3(i3),[u3,Uve]=o3(i3,{collapsible:!1}),Wve=u.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:a=!1,...o}=e,[s,c]=ke({prop:n,defaultProp:r??``,onChange:i,caller:i3});return(0,A.jsx)(l3,{scope:e.__scopeAccordion,value:u.useMemo(()=>s?[s]:[],[s]),onItemOpen:c,onItemClose:u.useCallback(()=>a&&c(``),[a,c]),children:(0,A.jsx)(u3,{scope:e.__scopeAccordion,collapsible:a,children:(0,A.jsx)(f3,{...o,ref:t})})})}),Gve=u.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=ke({prop:n,defaultProp:r??[],onChange:i,caller:i3}),c=u.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=u.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,A.jsx)(l3,{scope:e.__scopeAccordion,value:o,onItemOpen:c,onItemClose:l,children:(0,A.jsx)(u3,{scope:e.__scopeAccordion,collapsible:!0,children:(0,A.jsx)(f3,{...a,ref:t})})})}),[Kve,d3]=o3(i3),f3=u.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,dir:i,orientation:a=`vertical`,...o}=e,s=D(u.useRef(null),t),c=zve(n),l=hB(i)===`ltr`,d=w(e.onKeyDown,e=>{if(!Rve.includes(e.key))return;let t=e.target,n=c().filter(e=>!e.ref.current?.disabled),r=n.findIndex(e=>e.ref.current===t),i=n.length;if(r===-1)return;e.preventDefault();let o=r,s=i-1,u=()=>{o=r+1,o>s&&(o=0)},d=()=>{o=r-1,o<0&&(o=s)};switch(e.key){case`Home`:o=0;break;case`End`:o=s;break;case`ArrowRight`:a===`horizontal`&&(l?u():d());break;case`ArrowDown`:a===`vertical`&&u();break;case`ArrowLeft`:a===`horizontal`&&(l?d():u());break;case`ArrowUp`:a===`vertical`&&d();break}n[o%i].ref.current?.focus()});return(0,A.jsx)(Kve,{scope:n,disabled:r,direction:i,orientation:a,children:(0,A.jsx)(a3.Slot,{scope:n,children:(0,A.jsx)(z.div,{...o,"data-orientation":a,ref:s,onKeyDown:r?void 0:d})})})}),p3=`AccordionItem`,[qve,m3]=o3(p3),h3=u.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,a=d3(p3,n),o=Hve(p3,n),s=s3(n),c=Ia(),l=r&&o.value.includes(r)||!1,u=a.disabled||e.disabled;return(0,A.jsx)(qve,{scope:n,open:l,disabled:u,triggerId:c,children:(0,A.jsx)(Rh,{"data-orientation":a.orientation,"data-state":S3(l),...s,...i,ref:t,disabled:u,open:l,onOpenChange:e=>{e?o.onItemOpen(r):o.onItemClose(r)}})})});h3.displayName=p3;var g3=`AccordionHeader`,_3=u.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=d3(i3,n),a=m3(g3,n);return(0,A.jsx)(z.h3,{"data-orientation":i.orientation,"data-state":S3(a.open),"data-disabled":a.disabled?``:void 0,...r,ref:t})});_3.displayName=g3;var v3=`AccordionTrigger`,y3=u.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=d3(i3,n),a=m3(v3,n),o=Uve(v3,n),s=s3(n);return(0,A.jsx)(a3.ItemSlot,{scope:n,children:(0,A.jsx)(zh,{"aria-disabled":a.open&&!o.collapsible||void 0,"data-orientation":i.orientation,id:a.triggerId,...s,...r,ref:t})})});y3.displayName=v3;var b3=`AccordionContent`,x3=u.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=d3(i3,n),a=m3(b3,n),o=s3(n);return(0,A.jsx)(Bh,{role:`region`,"aria-labelledby":a.triggerId,"data-orientation":i.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}})});x3.displayName=b3;function S3(e){return e?`open`:`closed`}var Jve=c3,Yve=h3,Xve=_3,C3=y3,w3=x3,T3=Jve,E3=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(Yve,{ref:n,className:H(`border-b`,e),...t}));E3.displayName=`AccordionItem`;var D3=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsx)(Xve,{className:`flex`,children:(0,A.jsxs)(C3,{ref:r,className:H(`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,(0,A.jsx)(en,{className:`h-4 w-4 shrink-0 transition-transform duration-200`})]})}));D3.displayName=C3.displayName;var O3=u.forwardRef(({className:e,children:t,...n},r)=>(0,A.jsx)(w3,{ref:r,className:`overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down`,...n,children:(0,A.jsx)(`div`,{className:H(`pb-4 pt-0`,e),children:t})}));O3.displayName=w3.displayName;var k3=(0,u.createContext)(null);k3.displayName=`PanelGroupContext`;var A3={group:`data-panel-group`,groupDirection:`data-panel-group-direction`,groupId:`data-panel-group-id`,panel:`data-panel`,panelCollapsible:`data-panel-collapsible`,panelId:`data-panel-id`,panelSize:`data-panel-size`,resizeHandle:`data-resize-handle`,resizeHandleActive:`data-resize-handle-active`,resizeHandleEnabled:`data-panel-resize-handle-enabled`,resizeHandleId:`data-panel-resize-handle-id`,resizeHandleState:`data-resize-handle-state`},j3=10,M3=u.useLayoutEffect,N3=u.useId,Zve=typeof N3==`function`?N3:()=>null,Qve=0;function P3(e=null){let t=Zve(),n=(0,u.useRef)(e||t||null);return n.current===null&&(n.current=``+ Qve++),e??n.current}function F3({children:e,className:t=``,collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:a,id:o,maxSize:s,minSize:c,onCollapse:l,onExpand:d,onResize:f,order:p,style:m,tagName:h=`div`,...g}){let _=(0,u.useContext)(k3);if(_===null)throw Error(`Panel components must be rendered within a PanelGroup container`);let{collapsePanel:v,expandPanel:y,getPanelSize:b,getPanelStyle:x,groupId:S,isPanelCollapsed:C,reevaluatePanelConstraints:w,registerPanel:T,resizePanel:E,unregisterPanel:D}=_,O=P3(o),k=(0,u.useRef)({callbacks:{onCollapse:l,onExpand:d,onResize:f},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:c},id:O,idIsFromProps:o!==void 0,order:p});(0,u.useRef)({didLogMissingDefaultSizeWarning:!1}),M3(()=>{let{callbacks:e,constraints:t}=k.current,a={...t};k.current.id=O,k.current.idIsFromProps=o!==void 0,k.current.order=p,e.onCollapse=l,e.onExpand=d,e.onResize=f,t.collapsedSize=n,t.collapsible=r,t.defaultSize=i,t.maxSize=s,t.minSize=c,(a.collapsedSize!==t.collapsedSize||a.collapsible!==t.collapsible||a.maxSize!==t.maxSize||a.minSize!==t.minSize)&&w(k.current,a)}),M3(()=>{let e=k.current;return T(e),()=>{D(e)}},[p,O,T,D]),(0,u.useImperativeHandle)(a,()=>({collapse:()=>{v(k.current)},expand:e=>{y(k.current,e)},getId(){return O},getSize(){return b(k.current)},isCollapsed(){return C(k.current)},isExpanded(){return!C(k.current)},resize:e=>{E(k.current,e)}}),[v,y,b,C,O,E]);let A=x(k.current,i);return(0,u.createElement)(h,{...g,children:e,className:t,id:O,style:{...A,...m},[A3.groupId]:S,[A3.panel]:``,[A3.panelCollapsible]:r||void 0,[A3.panelId]:O,[A3.panelSize]:parseFloat(``+A.flexGrow).toFixed(1)})}var I3=(0,u.forwardRef)((e,t)=>(0,u.createElement)(F3,{...e,forwardedRef:t}));F3.displayName=`Panel`,I3.displayName=`forwardRef(Panel)`;var $ve;function eye(){return $ve}var L3=null,tye=!0,R3=-1,z3=null;function nye(e,t){if(t){let e=(t&Y3)!==0,n=(t&X3)!==0,r=(t&Z3)!==0,i=(t&Q3)!==0;if(e)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}switch(e){case`horizontal`:return`ew-resize`;case`intersection`:return`move`;case`vertical`:return`ns-resize`}}function rye(){z3!==null&&(document.head.removeChild(z3),L3=null,z3=null,R3=-1)}function B3(e,t){if(!tye)return;let n=nye(e,t);if(L3!==n){if(L3=n,z3===null){z3=document.createElement(`style`);let e=eye();e&&z3.setAttribute(`nonce`,e),document.head.appendChild(z3)}if(R3>=0){var r;(r=z3.sheet)==null||r.removeRule(R3)}R3=z3.sheet?.insertRule(`*{cursor: ${n} !important;}`)??-1}}function V3(e){return e.type===`keydown`}function H3(e){return e.type.startsWith(`pointer`)}function U3(e){return e.type.startsWith(`mouse`)}function W3(e){if(H3(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(U3(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}function iye(){if(typeof matchMedia==`function`)return matchMedia(`(pointer:coarse)`).matches?`coarse`:`fine`}function aye(e,t,n){return n?e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y:e.x<=t.x+t.width&&e.x+e.width>=t.x&&e.y<=t.y+t.height&&e.y+e.height>=t.y}function oye(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:q3(e),b:q3(t)},r;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;p6(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:K3(G3(n.a)),b:K3(G3(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var sye=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function cye(e){let t=getComputedStyle(J3(e)??e).display;return t===`flex`||t===`inline-flex`}function lye(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||cye(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||sye.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function G3(e){let t=e.length;for(;t--;){let n=e[t];if(p6(n,`Missing node`),lye(n))return n}return null}function K3(e){return e&&Number(getComputedStyle(e).zIndex)||0}function q3(e){let t=[];for(;e;)t.push(e),e=J3(e);return t}function J3(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}var Y3=1,X3=2,Z3=4,Q3=8,uye=iye()===`coarse`,$3=[],e6=!1,t6=new Map,n6=new Map,r6=new Set;function dye(e,t,n,r,i){let{ownerDocument:a}=t,o={direction:n,element:t,hitAreaMargins:r,setResizeHandlerState:i},s=t6.get(a)??0;return t6.set(a,s+1),r6.add(o),d6(),function(){n6.delete(e),r6.delete(o);let t=t6.get(a)??1;if(t6.set(a,t-1),d6(),t===1&&t6.delete(a),$3.includes(o)){let e=$3.indexOf(o);e>=0&&$3.splice(e,1),l6(),i(`up`,!0,null)}}}function fye(e){let{target:t}=e,{x:n,y:r}=W3(e);e6=!0,s6({target:t,x:n,y:r}),d6(),$3.length>0&&(f6(`down`,e),e.preventDefault(),o6(t)||e.stopImmediatePropagation())}function i6(e){let{x:t,y:n}=W3(e);if(e6&&e.buttons===0&&(e6=!1,f6(`up`,e)),!e6){let{target:r}=e;s6({target:r,x:t,y:n})}f6(`move`,e),l6(),$3.length>0&&e.preventDefault()}function a6(e){let{target:t}=e,{x:n,y:r}=W3(e);n6.clear(),e6=!1,$3.length>0&&(e.preventDefault(),o6(t)||e.stopImmediatePropagation()),f6(`up`,e),s6({target:t,x:n,y:r}),l6(),d6()}function o6(e){let t=e;for(;t;){if(t.hasAttribute(A3.resizeHandle))return!0;t=t.parentElement}return!1}function s6({target:e,x:t,y:n}){$3.splice(0);let r=null;(e instanceof HTMLElement||e instanceof SVGElement)&&(r=e),r6.forEach(e=>{let{element:i,hitAreaMargins:a}=e,o=i.getBoundingClientRect(),{bottom:s,left:c,right:l,top:u}=o,d=uye?a.coarse:a.fine;if(t>=c-d&&t<=l+d&&n>=u-d&&n<=s+d){if(r!==null&&document.contains(r)&&i!==r&&!i.contains(r)&&!r.contains(i)&&oye(r,i)>0){let e=r,t=!1;for(;e&&!e.contains(i);){if(aye(e.getBoundingClientRect(),o,!0)){t=!0;break}e=e.parentElement}if(t)return}$3.push(e)}})}function c6(e,t){n6.set(e,t)}function l6(){let e=!1,t=!1;$3.forEach(n=>{let{direction:r}=n;r===`horizontal`?e=!0:t=!0});let n=0;n6.forEach(e=>{n|=e}),e&&t?B3(`intersection`,n):e?B3(`horizontal`,n):t?B3(`vertical`,n):rye()}var u6=new AbortController;function d6(){u6.abort(),u6=new AbortController;let e={capture:!0,signal:u6.signal};r6.size&&(e6?($3.length>0&&t6.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`contextmenu`,a6,e),r.addEventListener(`pointerleave`,i6,e),r.addEventListener(`pointermove`,i6,e))}),window.addEventListener(`pointerup`,a6,e),window.addEventListener(`pointercancel`,a6,e)):t6.forEach((t,n)=>{let{body:r}=n;t>0&&(r.addEventListener(`pointerdown`,fye,e),r.addEventListener(`pointermove`,i6,e))}))}function f6(e,t){r6.forEach(n=>{let{setResizeHandlerState:r}=n;r(e,$3.includes(n),t)})}function pye(){let[e,t]=(0,u.useState)(0);return(0,u.useCallback)(()=>t(e=>e+1),[])}function p6(e,t){if(!e)throw console.error(t),Error(t)}function m6(e,t,n=j3){return e.toFixed(n)===t.toFixed(n)?0:e>t?1:-1}function h6(e,t,n=j3){return m6(e,t,n)===0}function g6(e,t,n){return m6(e,t,n)===0}function mye(e,t,n){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],a=t[r];if(!g6(i,a,n))return!1}return!0}function _6({panelConstraints:e,panelIndex:t,size:n}){let r=e[t];p6(r!=null,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,maxSize:o=100,minSize:s=0}=r;if(m6(n,s)<0)if(a){let e=(i+s)/2;n=m6(n,e)<0?i:s}else n=s;return n=Math.min(o,n),n=parseFloat(n.toFixed(j3)),n}function v6({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(g6(e,0))return t;let o=[...t],[s,c]=r;p6(s!=null,`Invalid first pivot index`),p6(c!=null,`Invalid second pivot index`);let l=0;if(a===`keyboard`){{let r=e<0?c:s,i=n[r];p6(i,`Panel constraints not found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(p6(n!=null,`Previous layout not found for panel index ${r}`),g6(n,a)){let t=l-n;m6(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let r=e<0?s:c,i=n[r];p6(i,`No panel constraints found for index ${r}`);let{collapsedSize:a=0,collapsible:o,minSize:l=0}=i;if(o){let n=t[r];if(p6(n!=null,`Previous layout not found for panel index ${r}`),g6(n,l)){let t=n-a;m6(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let r=e<0?1:-1,i=e<0?c:s,a=0;for(;;){let e=t[i];p6(e!=null,`Previous layout not found for panel index ${i}`);let o=_6({panelConstraints:n,panelIndex:i,size:100})-e;if(a+=o,i+=r,i<0||i>=n.length)break}let o=Math.min(Math.abs(e),Math.abs(a));e=e<0?0-o:o}{let r=e<0?s:c;for(;r>=0&&r<n.length;){let i=Math.abs(e)-Math.abs(l),a=t[r];p6(a!=null,`Previous layout not found for panel index ${r}`);let s=a-i,c=_6({panelConstraints:n,panelIndex:r,size:s});if(!g6(a,c)&&(l+=a-c,o[r]=c,l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?r--:r++}}if(mye(i,o))return i;{let r=e<0?c:s,i=t[r];p6(i!=null,`Previous layout not found for panel index ${r}`);let a=i+l,u=_6({panelConstraints:n,panelIndex:r,size:a});if(o[r]=u,!g6(u,a)){let t=a-u,r=e<0?c:s;for(;r>=0&&r<n.length;){let i=o[r];p6(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=_6({panelConstraints:n,panelIndex:r,size:a});if(g6(i,s)||(t-=s-i,o[r]=s),g6(t,0))break;e>0?r--:r++}}}return g6(o.reduce((e,t)=>t+e,0),100)?o:i}function hye({layout:e,panelsArray:t,pivotIndices:n}){let r=0,i=100,a=0,o=0,s=n[0];return p6(s!=null,`No pivot index found`),t.forEach((e,t)=>{let{constraints:n}=e,{maxSize:c=100,minSize:l=0}=n;t===s?(r=l,i=c):(a+=l,o+=c)}),{valueMax:Math.min(i,100-a),valueMin:Math.max(r,100-o),valueNow:e[s]}}function y6(e,t=document){return Array.from(t.querySelectorAll(`[${A3.resizeHandleId}][data-panel-group-id="${e}"]`))}function b6(e,t,n=document){return y6(e,n).findIndex(e=>e.getAttribute(A3.resizeHandleId)===t)??null}function x6(e,t,n){let r=b6(e,t,n);return r==null?[-1,-1]:[r,r+1]}function S6(e,t=document){return t instanceof HTMLElement&&t?.dataset?.panelGroupId==e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null}function C6(e,t=document){return t.querySelector(`[${A3.resizeHandleId}="${e}"]`)||null}function gye(e,t,n,r=document){let i=C6(t,r),a=y6(e,r),o=i?a.indexOf(i):-1;return[n[o]?.id??null,n[o+1]?.id??null]}function _ye({committedValuesRef:e,eagerValuesRef:t,groupId:n,layout:r,panelDataArray:i,panelGroupElement:a,setLayout:o}){(0,u.useRef)({didWarnAboutMissingResizeHandle:!1}),M3(()=>{if(!a)return;let e=y6(n,a);for(let t=0;t<i.length-1;t++){let{valueMax:n,valueMin:a,valueNow:o}=hye({layout:r,panelsArray:i,pivotIndices:[t,t+1]}),s=e[t];if(s!=null){let e=i[t];p6(e,`No panel data found for index "${t}"`),s.setAttribute(`aria-controls`,e.id),s.setAttribute(`aria-valuemax`,``+Math.round(n)),s.setAttribute(`aria-valuemin`,``+Math.round(a)),s.setAttribute(`aria-valuenow`,o==null?``:``+Math.round(o))}}return()=>{e.forEach((e,t)=>{e.removeAttribute(`aria-controls`),e.removeAttribute(`aria-valuemax`),e.removeAttribute(`aria-valuemin`),e.removeAttribute(`aria-valuenow`)})}},[n,r,i,a]),(0,u.useEffect)(()=>{if(!a)return;let e=t.current;p6(e,`Eager values not found`);let{panelDataArray:i}=e;p6(S6(n,a)!=null,`No group found for id "${n}"`);let s=y6(n,a);p6(s,`No resize handles found for group id "${n}"`);let c=s.map(e=>{let t=e.getAttribute(A3.resizeHandleId);p6(t,`Resize handle element has no handle id attribute`);let[s,c]=gye(n,t,i,a);if(s==null||c==null)return()=>{};let l=e=>{if(!e.defaultPrevented)switch(e.key){case`Enter`:{e.preventDefault();let c=i.findIndex(e=>e.id===s);if(c>=0){let e=i[c];p6(e,`No panel data found for index ${c}`);let s=r[c],{collapsedSize:l=0,collapsible:u,minSize:d=0}=e.constraints;if(s!=null&&u){let e=v6({delta:g6(s,l)?d-l:l-s,initialLayout:r,panelConstraints:i.map(e=>e.constraints),pivotIndices:x6(n,t,a),prevLayout:r,trigger:`keyboard`});r!==e&&o(e)}}break}}};return e.addEventListener(`keydown`,l),()=>{e.removeEventListener(`keydown`,l)}});return()=>{c.forEach(e=>e())}},[a,e,t,n,r,i,o])}function w6(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function T6(e,t){let n=e===`horizontal`,{x:r,y:i}=W3(t);return n?r:i}function vye(e,t,n,r,i){let a=n===`horizontal`,o=C6(t,i);p6(o,`No resize handle element found for id "${t}"`);let s=o.getAttribute(A3.groupId);p6(s,`Resize handle element has no group id attribute`);let{initialCursorPosition:c}=r,l=T6(n,e),u=S6(s,i);p6(u,`No group element found for id "${s}"`);let d=u.getBoundingClientRect(),f=a?d.width:d.height;return(l-c)/f*100}function yye(e,t,n,r,i,a){if(V3(e)){let t=n===`horizontal`,r=0;r=e.shiftKey?100:i??10;let a=0;switch(e.key){case`ArrowDown`:a=t?0:r;break;case`ArrowLeft`:a=t?-r:0;break;case`ArrowRight`:a=t?r:0;break;case`ArrowUp`:a=t?0:-r;break;case`End`:a=100;break;case`Home`:a=-100;break}return a}else return r==null?0:vye(e,t,n,r,a)}function bye({panelDataArray:e}){let t=Array(e.length),n=e.map(e=>e.constraints),r=0,i=100;for(let a=0;a<e.length;a++){let e=n[a];p6(e,`Panel constraints not found for index ${a}`);let{defaultSize:o}=e;o!=null&&(r++,t[a]=o,i-=o)}for(let a=0;a<e.length;a++){let o=n[a];p6(o,`Panel constraints not found for index ${a}`);let{defaultSize:s}=o;if(s!=null)continue;let c=e.length-r,l=i/c;r++,t[a]=l,i-=l}return t}function E6(e,t,n){t.forEach((t,r)=>{let i=e[r];p6(i,`Panel data not found for index ${r}`);let{callbacks:a,constraints:o,id:s}=i,{collapsedSize:c=0,collapsible:l}=o,u=n[s];if(u==null||t!==u){n[s]=t;let{onCollapse:e,onExpand:r,onResize:i}=a;i&&i(t,u),l&&(e||r)&&(r&&(u==null||h6(u,c))&&!h6(t,c)&&r(),e&&(u==null||!h6(u,c))&&h6(t,c)&&e())}})}function D6(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function xye({defaultSize:e,dragState:t,layout:n,panelData:r,panelIndex:i,precision:a=3}){let o=n[i],s;return s=o==null?e==null?`1`:e.toPrecision(a):r.length===1?`1`:o.toPrecision(a),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:`hidden`,pointerEvents:t===null?void 0:`none`}}function Sye(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}function O6(e){try{if(typeof localStorage<`u`)e.getItem=e=>localStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error(`localStorage not supported in this environment`)}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function k6(e){return`react-resizable-panels:${e}`}function A6(e){return e.map(e=>{let{constraints:t,id:n,idIsFromProps:r,order:i}=e;return r?n:i?`${i}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(`,`)}function j6(e,t){try{let n=k6(e),r=t.getItem(n);if(r){let e=JSON.parse(r);if(typeof e==`object`&&e)return e}}catch{}return null}function Cye(e,t,n){return(j6(e,n)??{})[A6(t)]??null}function wye(e,t,n,r,i){let a=k6(e),o=A6(t),s=j6(e,i)??{};s[o]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(s))}catch(e){console.error(e)}}function M6({layout:e,panelConstraints:t}){let n=[...e],r=n.reduce((e,t)=>e+t,0);if(n.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${n.map(e=>`${e}%`).join(`, `)}`);if(!g6(r,100)&&n.length>0)for(let e=0;e<t.length;e++){let t=n[e];p6(t!=null,`No layout data found for index ${e}`),n[e]=100/r*t}let i=0;for(let e=0;e<t.length;e++){let r=n[e];p6(r!=null,`No layout data found for index ${e}`);let a=_6({panelConstraints:t,panelIndex:e,size:r});r!=a&&(i+=r-a,n[e]=a)}if(!g6(i,0))for(let e=0;e<t.length;e++){let r=n[e];p6(r!=null,`No layout data found for index ${e}`);let a=r+i,o=_6({panelConstraints:t,panelIndex:e,size:a});if(r!==o&&(i-=o-r,n[e]=o,g6(i,0)))break}return n}var Tye=100,N6={getItem:e=>(O6(N6),N6.getItem(e)),setItem:(e,t)=>{O6(N6),N6.setItem(e,t)}},P6={};function F6({autoSaveId:e=null,children:t,className:n=``,direction:r,forwardedRef:i,id:a=null,onLayout:o=null,keyboardResizeBy:s=null,storage:c=N6,style:l,tagName:d=`div`,...f}){let p=P3(a),m=(0,u.useRef)(null),[h,g]=(0,u.useState)(null),[_,v]=(0,u.useState)([]),y=pye(),b=(0,u.useRef)({}),x=(0,u.useRef)(new Map),S=(0,u.useRef)(0),C=(0,u.useRef)({autoSaveId:e,direction:r,dragState:h,id:p,keyboardResizeBy:s,onLayout:o,storage:c}),w=(0,u.useRef)({layout:_,panelDataArray:[],panelDataArrayChanged:!1});(0,u.useRef)({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),(0,u.useImperativeHandle)(i,()=>({getId:()=>C.current.id,getLayout:()=>{let{layout:e}=w.current;return e},setLayout:e=>{let{onLayout:t}=C.current,{layout:n,panelDataArray:r}=w.current,i=M6({layout:e,panelConstraints:r.map(e=>e.constraints)});w6(n,i)||(v(i),w.current.layout=i,t&&t(i),E6(r,i,b.current))}}),[]),M3(()=>{C.current.autoSaveId=e,C.current.direction=r,C.current.dragState=h,C.current.id=p,C.current.onLayout=o,C.current.storage=c}),_ye({committedValuesRef:C,eagerValuesRef:w,groupId:p,layout:_,panelDataArray:w.current.panelDataArray,setLayout:v,panelGroupElement:m.current}),(0,u.useEffect)(()=>{let{panelDataArray:t}=w.current;if(e){if(_.length===0||_.length!==t.length)return;let n=P6[e];n??(n=Sye(wye,Tye),P6[e]=n);let r=[...t],i=new Map(x.current);n(e,r,i,_,c)}},[e,_,c]),(0,u.useEffect)(()=>{});let T=(0,u.useCallback)(e=>{let{onLayout:t}=C.current,{layout:n,panelDataArray:r}=w.current;if(e.constraints.collapsible){let i=r.map(e=>e.constraints),{collapsedSize:a=0,panelSize:o,pivotIndices:s}=R6(r,e,n);if(p6(o!=null,`Panel size not found for panel "${e.id}"`),!h6(o,a)){x.current.set(e.id,o);let c=v6({delta:L6(r,e)===r.length-1?o-a:a-o,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:`imperative-api`});D6(n,c)||(v(c),w.current.layout=c,t&&t(c),E6(r,c,b.current))}}},[]),E=(0,u.useCallback)((e,t)=>{let{onLayout:n}=C.current,{layout:r,panelDataArray:i}=w.current;if(e.constraints.collapsible){let a=i.map(e=>e.constraints),{collapsedSize:o=0,panelSize:s=0,minSize:c=0,pivotIndices:l}=R6(i,e,r),u=t??c;if(h6(s,o)){let t=x.current.get(e.id),o=t!=null&&t>=u?t:u,c=v6({delta:L6(i,e)===i.length-1?s-o:o-s,initialLayout:r,panelConstraints:a,pivotIndices:l,prevLayout:r,trigger:`imperative-api`});D6(r,c)||(v(c),w.current.layout=c,n&&n(c),E6(i,c,b.current))}}},[]),D=(0,u.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{panelSize:r}=R6(n,e,t);return p6(r!=null,`Panel size not found for panel "${e.id}"`),r},[]),O=(0,u.useCallback)((e,t)=>{let{panelDataArray:n}=w.current;return xye({defaultSize:t,dragState:h,layout:_,panelData:n,panelIndex:L6(n,e)})},[h,_]),k=(0,u.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=R6(n,e,t);return p6(a!=null,`Panel size not found for panel "${e.id}"`),i===!0&&h6(a,r)},[]),A=(0,u.useCallback)(e=>{let{layout:t,panelDataArray:n}=w.current,{collapsedSize:r=0,collapsible:i,panelSize:a}=R6(n,e,t);return p6(a!=null,`Panel size not found for panel "${e.id}"`),!i||m6(a,r)>0},[]),j=(0,u.useCallback)(e=>{let{panelDataArray:t}=w.current;t.push(e),t.sort((e,t)=>{let n=e.order,r=t.order;return n==null&&r==null?0:n==null?-1:r==null?1:n-r}),w.current.panelDataArrayChanged=!0,y()},[y]);M3(()=>{if(w.current.panelDataArrayChanged){w.current.panelDataArrayChanged=!1;let{autoSaveId:e,onLayout:t,storage:n}=C.current,{layout:r,panelDataArray:i}=w.current,a=null;if(e){let t=Cye(e,i,n);t&&(x.current=new Map(Object.entries(t.expandToSizes)),a=t.layout)}a??=bye({panelDataArray:i});let o=M6({layout:a,panelConstraints:i.map(e=>e.constraints)});w6(r,o)||(v(o),w.current.layout=o,t&&t(o),E6(i,o,b.current))}}),M3(()=>{let e=w.current;return()=>{e.layout=[]}},[]);let M=(0,u.useCallback)(e=>{let t=!1,n=m.current;return n&&window.getComputedStyle(n,null).getPropertyValue(`direction`)===`rtl`&&(t=!0),function(n){n.preventDefault();let r=m.current;if(!r)return()=>null;let{direction:i,dragState:a,id:o,keyboardResizeBy:s,onLayout:c}=C.current,{layout:l,panelDataArray:u}=w.current,{initialLayout:d}=a??{},f=x6(o,e,r),p=yye(n,e,i,a,s,r),h=i===`horizontal`;h&&t&&(p=-p);let g=u.map(e=>e.constraints),_=v6({delta:p,initialLayout:d??l,panelConstraints:g,pivotIndices:f,prevLayout:l,trigger:V3(n)?`keyboard`:`mouse-or-touch`}),y=!D6(l,_);(H3(n)||U3(n))&&S.current!=p&&(S.current=p,!y&&p!==0?h?c6(e,p<0?Y3:X3):c6(e,p<0?Z3:Q3):c6(e,0)),y&&(v(_),w.current.layout=_,c&&c(_),E6(u,_,b.current))}},[]),N=(0,u.useCallback)((e,t)=>{let{onLayout:n}=C.current,{layout:r,panelDataArray:i}=w.current,a=i.map(e=>e.constraints),{panelSize:o,pivotIndices:s}=R6(i,e,r);p6(o!=null,`Panel size not found for panel "${e.id}"`);let c=v6({delta:L6(i,e)===i.length-1?o-t:t-o,initialLayout:r,panelConstraints:a,pivotIndices:s,prevLayout:r,trigger:`imperative-api`});D6(r,c)||(v(c),w.current.layout=c,n&&n(c),E6(i,c,b.current))},[]),P=(0,u.useCallback)((e,t)=>{let{layout:n,panelDataArray:r}=w.current,{collapsedSize:i=0,collapsible:a}=t,{collapsedSize:o=0,collapsible:s,maxSize:c=100,minSize:l=0}=e.constraints,{panelSize:u}=R6(r,e,n);u!=null&&(a&&s&&h6(u,i)?h6(i,o)||N(e,o):u<l?N(e,l):u>c&&N(e,c))},[N]),F=(0,u.useCallback)((e,t)=>{let{direction:n}=C.current,{layout:r}=w.current;if(!m.current)return;let i=C6(e,m.current);p6(i,`Drag handle element not found for id "${e}"`);let a=T6(n,t);g({dragHandleId:e,dragHandleRect:i.getBoundingClientRect(),initialCursorPosition:a,initialLayout:r})},[]),ee=(0,u.useCallback)(()=>{g(null)},[]),I=(0,u.useCallback)(e=>{let{panelDataArray:t}=w.current,n=L6(t,e);n>=0&&(t.splice(n,1),delete b.current[e.id],w.current.panelDataArrayChanged=!0,y())},[y]),L=(0,u.useMemo)(()=>({collapsePanel:T,direction:r,dragState:h,expandPanel:E,getPanelSize:D,getPanelStyle:O,groupId:p,isPanelCollapsed:k,isPanelExpanded:A,reevaluatePanelConstraints:P,registerPanel:j,registerResizeHandle:M,resizePanel:N,startDragging:F,stopDragging:ee,unregisterPanel:I,panelGroupElement:m.current}),[T,h,r,E,D,O,p,k,A,P,j,M,N,F,ee,I]),R={display:`flex`,flexDirection:r===`horizontal`?`row`:`column`,height:`100%`,overflow:`hidden`,width:`100%`};return(0,u.createElement)(k3.Provider,{value:L},(0,u.createElement)(d,{...f,children:t,className:n,id:a,ref:m,style:{...R,...l},[A3.group]:``,[A3.groupDirection]:r,[A3.groupId]:p}))}var I6=(0,u.forwardRef)((e,t)=>(0,u.createElement)(F6,{...e,forwardedRef:t}));F6.displayName=`PanelGroup`,I6.displayName=`forwardRef(PanelGroup)`;function L6(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function R6(e,t,n){let r=L6(e,t),i=r===e.length-1?[r-1,r]:[r,r+1],a=n[r];return{...t.constraints,panelSize:a,pivotIndices:i}}function Eye({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:r}){(0,u.useEffect)(()=>{if(e||n==null||r==null)return;let i=C6(t,r);if(i==null)return;let a=e=>{if(!e.defaultPrevented)switch(e.key){case`ArrowDown`:case`ArrowLeft`:case`ArrowRight`:case`ArrowUp`:case`End`:case`Home`:e.preventDefault(),n(e);break;case`F6`:{e.preventDefault();let n=i.getAttribute(A3.groupId);p6(n,`No group element found for id "${n}"`);let a=y6(n,r),o=b6(n,t,r);p6(o!==null,`No resize element found for id "${t}"`),a[e.shiftKey?o>0?o-1:a.length-1:o+1<a.length?o+1:0].focus();break}}};return i.addEventListener(`keydown`,a),()=>{i.removeEventListener(`keydown`,a)}},[r,e,t,n])}function z6({children:e=null,className:t=``,disabled:n=!1,hitAreaMargins:r,id:i,onBlur:a,onClick:o,onDragging:s,onFocus:c,onPointerDown:l,onPointerUp:d,style:f={},tabIndex:p=0,tagName:m=`div`,...h}){let g=(0,u.useRef)(null),_=(0,u.useRef)({onClick:o,onDragging:s,onPointerDown:l,onPointerUp:d});(0,u.useEffect)(()=>{_.current.onClick=o,_.current.onDragging=s,_.current.onPointerDown=l,_.current.onPointerUp=d});let v=(0,u.useContext)(k3);if(v===null)throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);let{direction:y,groupId:b,registerResizeHandle:x,startDragging:S,stopDragging:C,panelGroupElement:w}=v,T=P3(i),[E,D]=(0,u.useState)(`inactive`),[O,k]=(0,u.useState)(!1),[A,j]=(0,u.useState)(null),M=(0,u.useRef)({state:E});M3(()=>{M.current.state=E}),(0,u.useEffect)(()=>{if(n)j(null);else{let e=x(T);j(()=>e)}},[n,T,x]);let N=r?.coarse??15,P=r?.fine??5;(0,u.useEffect)(()=>{if(n||A==null)return;let e=g.current;p6(e,`Element ref not attached`);let t=!1;return dye(T,e,y,{coarse:N,fine:P},(e,n,r)=>{if(!n){D(`inactive`);return}switch(e){case`down`:{D(`drag`),t=!1,p6(r,`Expected event to be defined for "down" action`),S(T,r);let{onDragging:e,onPointerDown:n}=_.current;e?.(!0),n?.();break}case`move`:{let{state:e}=M.current;t=!0,e!==`drag`&&D(`hover`),p6(r,`Expected event to be defined for "move" action`),A(r);break}case`up`:{D(`hover`),C();let{onClick:e,onDragging:n,onPointerUp:r}=_.current;n?.(!1),r?.(),t||e?.();break}}})},[N,y,n,P,x,T,A,S,C]),Eye({disabled:n,handleId:T,resizeHandler:A,panelGroupElement:w});let F={touchAction:`none`,userSelect:`none`};return(0,u.createElement)(m,{...h,children:e,className:t,id:i,onBlur:()=>{k(!1),a?.()},onFocus:()=>{k(!0),c?.()},ref:g,role:`separator`,style:{...F,...f},tabIndex:p,[A3.groupDirection]:y,[A3.groupId]:b,[A3.resizeHandle]:``,[A3.resizeHandleActive]:E===`drag`?`pointer`:O?`keyboard`:void 0,[A3.resizeHandleEnabled]:!n,[A3.resizeHandleId]:T,[A3.resizeHandleState]:E})}z6.displayName=`PanelResizeHandle`;var Dye=({className:e,...t})=>(0,A.jsx)(I6,{className:H(`flex h-full w-full data-[panel-group-direction=vertical]:flex-col`,e),...t}),Oye=I3,kye=({withHandle:e,className:t,...n})=>(0,A.jsx)(z6,{className:H(`relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 [&[data-panel-group-direction=vertical]>div]:rotate-90`,t),...n,children:e&&(0,A.jsx)(`div`,{className:`z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border`,children:(0,A.jsx)(In,{className:`h-2.5 w-2.5`})})}),B6=u.forwardRef(({...e},t)=>(0,A.jsx)(`nav`,{ref:t,"aria-label":`breadcrumb`,...e}));B6.displayName=`Breadcrumb`;var V6=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`ol`,{ref:n,className:H(`flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5`,e),...t}));V6.displayName=`BreadcrumbList`;var H6=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`li`,{ref:n,className:H(`inline-flex items-center gap-1.5`,e),...t}));H6.displayName=`BreadcrumbItem`;var U6=u.forwardRef(({asChild:e,className:t,...n},r)=>(0,A.jsx)(e?Uf:`a`,{ref:r,className:H(`transition-colors hover:text-foreground`,t),...n}));U6.displayName=`BreadcrumbLink`;var W6=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`span`,{ref:n,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:H(`font-normal text-foreground`,e),...t}));W6.displayName=`BreadcrumbPage`;var G6=({children:e,className:t,...n})=>(0,A.jsx)(`li`,{role:`presentation`,"aria-hidden":`true`,className:H(`[&>svg]:size-3.5`,t),...n,children:e??(0,A.jsx)(nn,{})});G6.displayName=`BreadcrumbSeparator`;var Aye=({className:e,...t})=>(0,A.jsxs)(`span`,{role:`presentation`,"aria-hidden":`true`,className:H(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,A.jsx)(wn,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`More`})]});Aye.displayName=`BreadcrumbElipssis`;var K6=({className:e,...t})=>(0,A.jsx)(`nav`,{"aria-label":`pagination`,className:H(`mx-auto flex w-full justify-center`,e),...t});K6.displayName=`Pagination`;var q6=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`ul`,{ref:n,className:H(`flex flex-row items-center gap-1`,e),...t}));q6.displayName=`PaginationContent`;var J6=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`li`,{ref:n,className:H(``,e),...t}));J6.displayName=`PaginationItem`;var Y6=({className:e,isActive:t,size:n=`icon`,...r})=>(0,A.jsx)(`a`,{"aria-current":t?`page`:void 0,className:H(Zf({variant:t?`outline`:`ghost`,size:n}),e),...r});Y6.displayName=`PaginationLink`;var X6=({className:e,...t})=>(0,A.jsxs)(Y6,{"aria-label":`Go to previous page`,size:`default`,className:H(`gap-1 pl-2.5`,e),...t,children:[(0,A.jsx)(tn,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{children:`Previous`})]});X6.displayName=`PaginationPrevious`;var Z6=({className:e,...t})=>(0,A.jsxs)(Y6,{"aria-label":`Go to next page`,size:`default`,className:H(`gap-1 pr-2.5`,e),...t,children:[(0,A.jsx)(`span`,{children:`Next`}),(0,A.jsx)(nn,{className:`h-4 w-4`})]});Z6.displayName=`PaginationNext`;var jye=({className:e,...t})=>(0,A.jsxs)(`span`,{"aria-hidden":!0,className:H(`flex h-9 w-9 items-center justify-center`,e),...t,children:[(0,A.jsx)(wn,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`More pages`})]});jye.displayName=`PaginationEllipsis`;var Q6=`Toggle`,$6=u.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=ke({prop:n,onChange:i,defaultProp:r??!1,caller:Q6});return(0,A.jsx)(z.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:w(e.onClick,()=>{e.disabled||s(!o)})})});$6.displayName=Q6;var e8=$6,t8=Ft(`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`}}),n8=u.forwardRef(({className:e,variant:t,size:n,...r},i)=>(0,A.jsx)(e8,{ref:i,className:H(t8({variant:t,size:n,className:e})),...r}));n8.displayName=e8.displayName;var r8=`ToggleGroup`,[i8,Mye]=M(r8,[CB]),a8=CB(),o8=u.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,A.jsx)(Nye,{...r,ref:t});if(n===`multiple`)return(0,A.jsx)(Pye,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${r8}\``)});o8.displayName=r8;var[s8,c8]=i8(r8),Nye=u.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=ke({prop:n,defaultProp:r??``,onChange:i,caller:r8});return(0,A.jsx)(s8,{scope:e.__scopeToggleGroup,type:`single`,value:u.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:u.useCallback(()=>s(``),[s]),children:(0,A.jsx)(l8,{...a,ref:t})})}),Pye=u.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=ke({prop:n,defaultProp:r??[],onChange:i,caller:r8}),c=u.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=u.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,A.jsx)(s8,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,A.jsx)(l8,{...a,ref:t})})});o8.displayName=r8;var[Fye,Iye]=i8(r8),l8=u.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=a8(n),u=hB(o),d={role:`group`,dir:u,...c};return(0,A.jsx)(Fye,{scope:n,rovingFocus:i,disabled:r,children:i?(0,A.jsx)(FB,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,A.jsx)(z.div,{...d,ref:t})}):(0,A.jsx)(z.div,{...d,ref:t})})}),u8=`ToggleGroupItem`,d8=u.forwardRef((e,t)=>{let n=c8(u8,e.__scopeToggleGroup),r=Iye(u8,e.__scopeToggleGroup),i=a8(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=u.useRef(null);return r.rovingFocus?(0,A.jsx)(IB,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,A.jsx)(f8,{...s,ref:t})}):(0,A.jsx)(f8,{...s,ref:t})});d8.displayName=u8;var f8=u.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=c8(u8,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,A.jsx)($6,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),p8=o8,m8=d8,h8=u.createContext({size:`default`,variant:`default`}),g8=u.forwardRef(({className:e,variant:t,size:n,children:r,...i},a)=>(0,A.jsx)(p8,{ref:a,className:H(`flex items-center justify-center gap-1`,e),...i,children:(0,A.jsx)(h8.Provider,{value:{variant:t,size:n},children:r})}));g8.displayName=p8.displayName;var _8=u.forwardRef(({className:e,children:t,variant:n,size:r,...i},a)=>{let o=u.useContext(h8);return(0,A.jsx)(m8,{ref:a,className:H(t8({variant:o.variant||n,size:o.size||r}),e),...i,children:t})});_8.displayName=m8.displayName;var v8=function(){return v8=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},v8.apply(this,arguments)};function Lye(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function y8(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function b8(e){return e.mode===`multiple`}function x8(e){return e.mode===`range`}function S8(e){return e.mode===`single`}var Rye={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 zye(e,t){return zW(e,`LLLL y`,t)}function Bye(e,t){return zW(e,`d`,t)}function Vye(e,t){return zW(e,`LLLL`,t)}function Hye(e){return`${e}`}function Uye(e,t){return zW(e,`cccccc`,t)}function Wye(e,t){return zW(e,`yyyy`,t)}var Gye=Object.freeze({__proto__:null,formatCaption:zye,formatDay:Bye,formatMonthCaption:Vye,formatWeekNumber:Hye,formatWeekdayName:Uye,formatYearCaption:Wye}),Kye=Object.freeze({__proto__:null,labelDay:function(e,t,n){return zW(e,`do MMMM (EEEE)`,n)},labelMonthDropdown:function(){return`Month: `},labelNext:function(){return`Go to next month`},labelPrevious:function(){return`Go to previous month`},labelWeekNumber:function(e){return`Week n. ${e}`},labelWeekday:function(e,t){return zW(e,`cccc`,t)},labelYearDropdown:function(){return`Year: `}});function qye(){return{captionLayout:`buttons`,classNames:Rye,formatters:Gye,labels:Kye,locale:dW,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:`default`}}function Jye(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,i=e.toMonth,a=e.fromDate,o=e.toDate;return r?a=YU(r):t&&(a=new Date(t,0,1)),i?o=JU(i):n&&(o=new Date(n,11,31)),{fromDate:a?FU(a):void 0,toDate:o?FU(o):void 0}}var C8=(0,u.createContext)(void 0);function Yye(e){var t=e.initialProps,n=qye(),r=Jye(t),i=r.fromDate,a=r.toDate,o=t.captionLayout??n.captionLayout;o!==`buttons`&&(!i||!a)&&(o=`buttons`);var s;(S8(t)||b8(t)||x8(t))&&(s=t.onSelect);var c=v8(v8(v8({},n),t),{captionLayout:o,classNames:v8(v8({},n.classNames),t.classNames),components:v8({},t.components),formatters:v8(v8({},n.formatters),t.formatters),fromDate:i,labels:v8(v8({},n.labels),t.labels),mode:t.mode||n.mode,modifiers:v8(v8({},n.modifiers),t.modifiers),modifiersClassNames:v8(v8({},n.modifiersClassNames),t.modifiersClassNames),onSelect:s,styles:v8(v8({},n.styles),t.styles),toDate:a});return(0,A.jsx)(C8.Provider,{value:c,children:e.children})}function w8(){var e=(0,u.useContext)(C8);if(!e)throw Error(`useDayPicker must be used within a DayPickerProvider.`);return e}function T8(e){var t=w8(),n=t.locale,r=t.classNames,i=t.styles,a=t.formatters.formatCaption;return(0,A.jsx)(`div`,{className:r.caption_label,style:i.caption_label,"aria-live":`polite`,role:`presentation`,id:e.id,children:a(e.displayMonth,{locale:n})})}function Xye(e){return(0,A.jsx)(`svg`,v8({width:`8px`,height:`8px`,viewBox:`0 0 120 120`,"data-testid":`iconDropdown`},e,{children:(0,A.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 E8(e){var t=e.onChange,n=e.value,r=e.children,i=e.caption,a=e.className,o=e.style,s=w8(),c=s.components?.IconDropdown??Xye;return(0,A.jsxs)(`div`,{className:a,style:o,children:[(0,A.jsx)(`span`,{className:s.classNames.vhidden,children:e[`aria-label`]}),(0,A.jsx)(`select`,{name:e.name,"aria-label":e[`aria-label`],className:s.classNames.dropdown,style:s.styles.dropdown,value:n,onChange:t,children:r}),(0,A.jsxs)(`div`,{className:s.classNames.caption_label,style:s.styles.caption_label,"aria-hidden":`true`,children:[i,(0,A.jsx)(c,{className:s.classNames.dropdown_icon,style:s.styles.dropdown_icon})]})]})}function Zye(e){var t=w8(),n=t.fromDate,r=t.toDate,i=t.styles,a=t.locale,o=t.formatters.formatMonthCaption,s=t.classNames,c=t.components,l=t.labels.labelMonthDropdown;if(!n||!r)return(0,A.jsx)(A.Fragment,{});var u=[];if(JW(n,r))for(var d=YU(n),f=n.getMonth();f<=r.getMonth();f++)u.push(XW(d,f));else for(var d=YU(new Date),f=0;f<=11;f++)u.push(XW(d,f));var p=function(t){var n=Number(t.target.value),r=XW(YU(e.displayMonth),n);e.onChange(r)};return(0,A.jsx)(c?.Dropdown??E8,{name:`months`,"aria-label":l(),className:s.dropdown_month,style:i.dropdown_month,onChange:p,value:e.displayMonth.getMonth(),caption:o(e.displayMonth,{locale:a}),children:u.map(function(e){return(0,A.jsx)(`option`,{value:e.getMonth(),children:o(e,{locale:a})},e.getMonth())})})}function Qye(e){var t=e.displayMonth,n=w8(),r=n.fromDate,i=n.toDate,a=n.locale,o=n.styles,s=n.classNames,c=n.components,l=n.formatters.formatYearCaption,u=n.labels.labelYearDropdown,d=[];if(!r||!i)return(0,A.jsx)(A.Fragment,{});for(var f=r.getFullYear(),p=i.getFullYear(),m=f;m<=p;m++)d.push(ZW(XU(new Date),m));var h=function(n){var r=ZW(YU(t),Number(n.target.value));e.onChange(r)};return(0,A.jsx)(c?.Dropdown??E8,{name:`years`,"aria-label":u(),className:s.dropdown_year,style:o.dropdown_year,onChange:h,value:t.getFullYear(),caption:l(t,{locale:a}),children:d.map(function(e){return(0,A.jsx)(`option`,{value:e.getFullYear(),children:l(e,{locale:a})},e.getFullYear())})})}function $ye(e,t){var n=(0,u.useState)(e),r=n[0],i=n[1];return[t===void 0?r:t,i]}function ebe(e){var t=e.month,n=e.defaultMonth,r=e.today,i=t||n||r||new Date,a=e.toDate,o=e.fromDate,s=e.numberOfMonths,c=s===void 0?1:s;return a&&KU(a,i)<0&&(i=TU(a,-1*(c-1))),o&&KU(i,o)<0&&(i=o),YU(i)}function tbe(){var e=w8(),t=$ye(ebe(e),e.month),n=t[0],r=t[1];return[n,function(t){var n;if(!e.disableNavigation){var i=YU(t);r(i),(n=e.onMonthChange)==null||n.call(e,i)}}]}function nbe(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,i=YU(e),a=KU(YU(TU(i,r)),i),o=[],s=0;s<a;s++){var c=TU(i,s);o.push(c)}return n&&(o=o.reverse()),o}function rbe(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.pagedNavigation,i=t.numberOfMonths,a=i===void 0?1:i,o=r?a:1,s=YU(e);if(!n||!(KU(n,e)<a))return TU(s,o)}}function ibe(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.pagedNavigation,i=t.numberOfMonths,a=r?i===void 0?1:i:1,o=YU(e);if(!n||!(KU(o,n)<=0))return TU(o,-a)}}var D8=(0,u.createContext)(void 0);function abe(e){var t=w8(),n=tbe(),r=n[0],i=n[1],a=nbe(r,t),o=rbe(r,t),s=ibe(r,t),c=function(e){return a.some(function(t){return qW(e,t)})},l={currentMonth:r,displayMonths:a,goToMonth:i,goToDate:function(e,n){c(e)||(n&&KW(e,n)?i(TU(e,1+t.numberOfMonths*-1)):i(e))},previousMonth:s,nextMonth:o,isDateDisplayed:c};return(0,A.jsx)(D8.Provider,{value:l,children:e.children})}function O8(){var e=(0,u.useContext)(D8);if(!e)throw Error(`useNavigation must be used within a NavigationProvider`);return e}function k8(e){var t=w8(),n=t.classNames,r=t.styles,i=t.components,a=O8().goToMonth,o=function(t){a(TU(t,e.displayIndex?-e.displayIndex:0))},s=(0,A.jsx)(i?.CaptionLabel??T8,{id:e.id,displayMonth:e.displayMonth});return(0,A.jsxs)(`div`,{className:n.caption_dropdowns,style:r.caption_dropdowns,children:[(0,A.jsx)(`div`,{className:n.vhidden,children:s}),(0,A.jsx)(Zye,{onChange:o,displayMonth:e.displayMonth}),(0,A.jsx)(Qye,{onChange:o,displayMonth:e.displayMonth})]})}function obe(e){return(0,A.jsx)(`svg`,v8({width:`16px`,height:`16px`,viewBox:`0 0 120 120`},e,{children:(0,A.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 sbe(e){return(0,A.jsx)(`svg`,v8({width:`16px`,height:`16px`,viewBox:`0 0 120 120`},e,{children:(0,A.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 A8=(0,u.forwardRef)(function(e,t){var n=w8(),r=n.classNames,i=n.styles,a=[r.button_reset,r.button];e.className&&a.push(e.className);var o=a.join(` `),s=v8(v8({},i.button_reset),i.button);return e.style&&Object.assign(s,e.style),(0,A.jsx)(`button`,v8({},e,{ref:t,type:`button`,className:o,style:s}))});function cbe(e){var t=w8(),n=t.dir,r=t.locale,i=t.classNames,a=t.styles,o=t.labels,s=o.labelPrevious,c=o.labelNext,l=t.components;if(!e.nextMonth&&!e.previousMonth)return(0,A.jsx)(A.Fragment,{});var u=s(e.previousMonth,{locale:r}),d=[i.nav_button,i.nav_button_previous].join(` `),f=c(e.nextMonth,{locale:r}),p=[i.nav_button,i.nav_button_next].join(` `),m=l?.IconRight??sbe,h=l?.IconLeft??obe;return(0,A.jsxs)(`div`,{className:i.nav,style:a.nav,children:[!e.hidePrevious&&(0,A.jsx)(A8,{name:`previous-month`,"aria-label":u,className:d,style:a.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:n===`rtl`?(0,A.jsx)(m,{className:i.nav_icon,style:a.nav_icon}):(0,A.jsx)(h,{className:i.nav_icon,style:a.nav_icon})}),!e.hideNext&&(0,A.jsx)(A8,{name:`next-month`,"aria-label":f,className:p,style:a.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:n===`rtl`?(0,A.jsx)(h,{className:i.nav_icon,style:a.nav_icon}):(0,A.jsx)(m,{className:i.nav_icon,style:a.nav_icon})})]})}function j8(e){var t=w8().numberOfMonths,n=O8(),r=n.previousMonth,i=n.nextMonth,a=n.goToMonth,o=n.displayMonths,s=o.findIndex(function(t){return qW(e.displayMonth,t)}),c=s===0,l=s===o.length-1,u=t>1&&(c||!l),d=t>1&&(l||!c);return(0,A.jsx)(cbe,{displayMonth:e.displayMonth,hideNext:u,hidePrevious:d,nextMonth:i,previousMonth:r,onPreviousClick:function(){r&&a(r)},onNextClick:function(){i&&a(i)}})}function lbe(e){var t=w8(),n=t.classNames,r=t.disableNavigation,i=t.styles,a=t.captionLayout,o=t.components?.CaptionLabel??T8,s=r?(0,A.jsx)(o,{id:e.id,displayMonth:e.displayMonth}):a===`dropdown`?(0,A.jsx)(k8,{displayMonth:e.displayMonth,id:e.id}):a===`dropdown-buttons`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(k8,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),(0,A.jsx)(j8,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(o,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,A.jsx)(j8,{displayMonth:e.displayMonth,id:e.id})]});return(0,A.jsx)(`div`,{className:n.caption,style:i.caption,children:s})}function ube(e){var t=w8(),n=t.footer,r=t.styles,i=t.classNames.tfoot;return n?(0,A.jsx)(`tfoot`,{className:i,style:r.tfoot,children:(0,A.jsx)(`tr`,{children:(0,A.jsx)(`td`,{colSpan:8,children:n})})}):(0,A.jsx)(A.Fragment,{})}function dbe(e,t,n){for(var r=n?NU(new Date):MU(new Date,{locale:e,weekStartsOn:t}),i=[],a=0;a<7;a++){var o=wU(r,a);i.push(o)}return i}function fbe(){var e=w8(),t=e.classNames,n=e.styles,r=e.showWeekNumber,i=e.locale,a=e.weekStartsOn,o=e.ISOWeek,s=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,l=dbe(i,a,o);return(0,A.jsxs)(`tr`,{style:n.head_row,className:t.head_row,children:[r&&(0,A.jsx)(`td`,{style:n.head_cell,className:t.head_cell}),l.map(function(e,r){return(0,A.jsx)(`th`,{scope:`col`,className:t.head_cell,style:n.head_cell,"aria-label":c(e,{locale:i}),children:s(e,{locale:i})},r)})]})}function pbe(){var e=w8(),t=e.classNames,n=e.styles,r=e.components?.HeadRow??fbe;return(0,A.jsx)(`thead`,{style:n.head,className:t.head,children:(0,A.jsx)(r,{})})}function mbe(e){var t=w8(),n=t.locale,r=t.formatters.formatDay;return(0,A.jsx)(A.Fragment,{children:r(e.date,{locale:n})})}var M8=(0,u.createContext)(void 0);function hbe(e){return b8(e.initialProps)?(0,A.jsx)(gbe,{initialProps:e.initialProps,children:e.children}):(0,A.jsx)(M8.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}function gbe(e){var t=e.initialProps,n=e.children,r=t.selected,i=t.min,a=t.max,o=function(e,n,o){var s,c;if((s=t.onDayClick)==null||s.call(t,e,n,o),!(n.selected&&i&&r?.length===i)&&!(!n.selected&&a&&r?.length===a)){var l=r?y8([],r,!0):[];if(n.selected){var u=l.findIndex(function(t){return UU(e,t)});l.splice(u,1)}else l.push(e);(c=t.onSelect)==null||c.call(t,l,e,n,o)}},s={disabled:[]};r&&s.disabled.push(function(e){var t=a&&r.length>a-1,n=r.some(function(t){return UU(t,e)});return!!(t&&!n)});var c={selected:r,onDayClick:o,modifiers:s};return(0,A.jsx)(M8.Provider,{value:c,children:n})}function N8(){var e=(0,u.useContext)(M8);if(!e)throw Error(`useSelectMultiple must be used within a SelectMultipleProvider`);return e}function _be(e,t){var n=t||{},r=n.from,i=n.to;return r&&i?UU(i,e)&&UU(r,e)?void 0:UU(i,e)?{from:i,to:void 0}:UU(r,e)?void 0:GW(r,e)?{from:e,to:i}:{from:r,to:e}:i?GW(e,i)?{from:i,to:e}:{from:e,to:i}:r?KW(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}var P8=(0,u.createContext)(void 0);function vbe(e){return x8(e.initialProps)?(0,A.jsx)(ybe,{initialProps:e.initialProps,children:e.children}):(0,A.jsx)(P8.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}function ybe(e){var t=e.initialProps,n=e.children,r=t.selected,i=r||{},a=i.from,o=i.to,s=t.min,c=t.max,l=function(e,n,i){var a,o;(a=t.onDayClick)==null||a.call(t,e,n,i);var s=_be(e,r);(o=t.onSelect)==null||o.call(t,s,e,n,i)},u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(a?(u.range_start=[a],o?(u.range_end=[o],UU(a,o)||(u.range_middle=[{after:a,before:o}])):u.range_end=[a]):o&&(u.range_start=[o],u.range_end=[o]),s&&(a&&!o&&u.disabled.push({after:YW(a,s-1),before:wU(a,s-1)}),a&&o&&u.disabled.push({after:a,before:wU(a,s-1)}),!a&&o&&u.disabled.push({after:YW(o,s-1),before:wU(o,s-1)})),c){if(a&&!o&&(u.disabled.push({before:wU(a,-c+1)}),u.disabled.push({after:wU(a,c-1)})),a&&o){var d=c-(LU(o,a)+1);u.disabled.push({before:YW(a,d)}),u.disabled.push({after:wU(o,d)})}!a&&o&&(u.disabled.push({before:wU(o,-c+1)}),u.disabled.push({after:wU(o,c-1)}))}return(0,A.jsx)(P8.Provider,{value:{selected:r,onDayClick:l,modifiers:u},children:n})}function F8(){var e=(0,u.useContext)(P8);if(!e)throw Error(`useSelectRange must be used within a SelectRangeProvider`);return e}function I8(e){return Array.isArray(e)?y8([],e,!0):e===void 0?[]:[e]}function bbe(e){var t={};return Object.entries(e).forEach(function(e){var n=e[0],r=e[1];t[n]=I8(r)}),t}var L8;(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`})(L8||={});var xbe=L8.Selected,R8=L8.Disabled,Sbe=L8.Hidden,Cbe=L8.Today,z8=L8.RangeEnd,B8=L8.RangeMiddle,V8=L8.RangeStart,wbe=L8.Outside;function Tbe(e,t,n){var r,i=(r={},r[xbe]=I8(e.selected),r[R8]=I8(e.disabled),r[Sbe]=I8(e.hidden),r[Cbe]=[e.today],r[z8]=[],r[B8]=[],r[V8]=[],r[wbe]=[],r);return e.fromDate&&i[R8].push({before:e.fromDate}),e.toDate&&i[R8].push({after:e.toDate}),b8(e)?i[R8]=i[R8].concat(t.modifiers[R8]):x8(e)&&(i[R8]=i[R8].concat(n.modifiers[R8]),i[V8]=n.modifiers[V8],i[B8]=n.modifiers[B8],i[z8]=n.modifiers[z8]),i}var H8=(0,u.createContext)(void 0);function Ebe(e){var t=w8(),n=Tbe(t,N8(),F8()),r=bbe(t.modifiers),i=v8(v8({},n),r);return(0,A.jsx)(H8.Provider,{value:i,children:e.children})}function U8(){var e=(0,u.useContext)(H8);if(!e)throw Error(`useModifiers must be used within a ModifiersProvider`);return e}function Dbe(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function Obe(e){return!!(e&&typeof e==`object`&&`from`in e)}function kbe(e){return!!(e&&typeof e==`object`&&`after`in e)}function Abe(e){return!!(e&&typeof e==`object`&&`before`in e)}function jbe(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function Mbe(e,t){var n,r=t.from,i=t.to;return r&&i?(LU(i,r)<0&&(n=[i,r],r=n[0],i=n[1]),LU(e,r)>=0&&LU(i,e)>=0):i?UU(i,e):r?UU(r,e):!1}function Nbe(e){return WU(e)}function Pbe(e){return Array.isArray(e)&&e.every(WU)}function Fbe(e,t){return t.some(function(t){if(typeof t==`boolean`)return t;if(Nbe(t))return UU(e,t);if(Pbe(t))return t.includes(e);if(Obe(t))return Mbe(e,t);if(jbe(t))return t.dayOfWeek.includes(e.getDay());if(Dbe(t)){var n=LU(t.before,e),r=LU(t.after,e),i=n>0,a=r<0;return GW(t.before,t.after)?a&&i:i||a}return kbe(t)?LU(e,t.after)>0:Abe(t)?LU(t.before,e)>0:typeof t==`function`?t(e):!1})}function W8(e,t,n){var r=Object.keys(t).reduce(function(n,r){var i=t[r];return Fbe(e,i)&&n.push(r),n},[]),i={};return r.forEach(function(e){return i[e]=!0}),n&&!qW(e,n)&&(i.outside=!0),i}function Ibe(e,t){for(var n=YU(e[0]),r=JU(e[e.length-1]),i,a,o=n;o<=r;){var s=W8(o,t);if(!(!s.disabled&&!s.hidden)){o=wU(o,1);continue}if(s.selected)return o;s.today&&!a&&(a=o),i||=o,o=wU(o,1)}return a||i}var Lbe=365;function G8(e,t){var n=t.moveBy,r=t.direction,i=t.context,a=t.modifiers,o=t.retry,s=o===void 0?{count:0,lastFocused:e}:o,c=i.weekStartsOn,l=i.fromDate,u=i.toDate,d=i.locale,f={day:wU,week:zU,month:TU,year:BU,startOfWeek:function(e){return i.ISOWeek?NU(e):MU(e,{locale:d,weekStartsOn:c})},endOfWeek:function(e){return i.ISOWeek?QU(e):ZU(e,{locale:d,weekStartsOn:c})}}[n](e,r===`after`?1:-1);r===`before`&&l?f=VU([l,f]):r===`after`&&u&&(f=HU([u,f]));var p=!0;if(a){var m=W8(f,a);p=!m.disabled&&!m.hidden}return p?f:s.count>Lbe?s.lastFocused:G8(f,{moveBy:n,direction:r,context:i,modifiers:a,retry:v8(v8({},s),{count:s.count+1})})}var K8=(0,u.createContext)(void 0);function Rbe(e){var t=O8(),n=U8(),r=(0,u.useState)(),i=r[0],a=r[1],o=(0,u.useState)(),s=o[0],c=o[1],l=Ibe(t.displayMonths,n),d=i??(s&&t.isDateDisplayed(s))?s:l,f=function(){c(i),a(void 0)},p=function(e){a(e)},m=w8(),h=function(e,r){if(i){var a=G8(i,{moveBy:e,direction:r,context:m,modifiers:n});UU(i,a)||(t.goToDate(a,i),p(a))}},g={focusedDay:i,focusTarget:d,blur:f,focus:p,focusDayAfter:function(){return h(`day`,`after`)},focusDayBefore:function(){return h(`day`,`before`)},focusWeekAfter:function(){return h(`week`,`after`)},focusWeekBefore:function(){return h(`week`,`before`)},focusMonthBefore:function(){return h(`month`,`before`)},focusMonthAfter:function(){return h(`month`,`after`)},focusYearBefore:function(){return h(`year`,`before`)},focusYearAfter:function(){return h(`year`,`after`)},focusStartOfWeek:function(){return h(`startOfWeek`,`before`)},focusEndOfWeek:function(){return h(`endOfWeek`,`after`)}};return(0,A.jsx)(K8.Provider,{value:g,children:e.children})}function q8(){var e=(0,u.useContext)(K8);if(!e)throw Error(`useFocusContext must be used within a FocusProvider`);return e}function zbe(e,t){return W8(e,U8(),t)}var J8=(0,u.createContext)(void 0);function Bbe(e){return S8(e.initialProps)?(0,A.jsx)(Vbe,{initialProps:e.initialProps,children:e.children}):(0,A.jsx)(J8.Provider,{value:{selected:void 0},children:e.children})}function Vbe(e){var t=e.initialProps,n=e.children,r={selected:t.selected,onDayClick:function(e,n,r){var i,a,o;if((i=t.onDayClick)==null||i.call(t,e,n,r),n.selected&&!t.required){(a=t.onSelect)==null||a.call(t,void 0,e,n,r);return}(o=t.onSelect)==null||o.call(t,e,e,n,r)}};return(0,A.jsx)(J8.Provider,{value:r,children:n})}function Y8(){var e=(0,u.useContext)(J8);if(!e)throw Error(`useSelectSingle must be used within a SelectSingleProvider`);return e}function Hbe(e,t){var n=w8(),r=Y8(),i=N8(),a=F8(),o=q8(),s=o.focusDayAfter,c=o.focusDayBefore,l=o.focusWeekAfter,u=o.focusWeekBefore,d=o.blur,f=o.focus,p=o.focusMonthBefore,m=o.focusMonthAfter,h=o.focusYearBefore,g=o.focusYearAfter,_=o.focusStartOfWeek,v=o.focusEndOfWeek;return{onClick:function(o){var s,c,l,u;S8(n)?(s=r.onDayClick)==null||s.call(r,e,t,o):b8(n)?(c=i.onDayClick)==null||c.call(i,e,t,o):x8(n)?(l=a.onDayClick)==null||l.call(a,e,t,o):(u=n.onDayClick)==null||u.call(n,e,t,o)},onFocus:function(r){var i;f(e),(i=n.onDayFocus)==null||i.call(n,e,t,r)},onBlur:function(r){var i;d(),(i=n.onDayBlur)==null||i.call(n,e,t,r)},onKeyDown:function(r){var i;switch(r.key){case`ArrowLeft`:r.preventDefault(),r.stopPropagation(),n.dir===`rtl`?s():c();break;case`ArrowRight`:r.preventDefault(),r.stopPropagation(),n.dir===`rtl`?c():s();break;case`ArrowDown`:r.preventDefault(),r.stopPropagation(),l();break;case`ArrowUp`:r.preventDefault(),r.stopPropagation(),u();break;case`PageUp`:r.preventDefault(),r.stopPropagation(),r.shiftKey?h():p();break;case`PageDown`:r.preventDefault(),r.stopPropagation(),r.shiftKey?g():m();break;case`Home`:r.preventDefault(),r.stopPropagation(),_();break;case`End`:r.preventDefault(),r.stopPropagation(),v();break}(i=n.onDayKeyDown)==null||i.call(n,e,t,r)},onKeyUp:function(r){var i;(i=n.onDayKeyUp)==null||i.call(n,e,t,r)},onMouseEnter:function(r){var i;(i=n.onDayMouseEnter)==null||i.call(n,e,t,r)},onMouseLeave:function(r){var i;(i=n.onDayMouseLeave)==null||i.call(n,e,t,r)},onPointerEnter:function(r){var i;(i=n.onDayPointerEnter)==null||i.call(n,e,t,r)},onPointerLeave:function(r){var i;(i=n.onDayPointerLeave)==null||i.call(n,e,t,r)},onTouchCancel:function(r){var i;(i=n.onDayTouchCancel)==null||i.call(n,e,t,r)},onTouchEnd:function(r){var i;(i=n.onDayTouchEnd)==null||i.call(n,e,t,r)},onTouchMove:function(r){var i;(i=n.onDayTouchMove)==null||i.call(n,e,t,r)},onTouchStart:function(r){var i;(i=n.onDayTouchStart)==null||i.call(n,e,t,r)}}}function Ube(){var e=w8(),t=Y8(),n=N8(),r=F8();return S8(e)?t.selected:b8(e)?n.selected:x8(e)?r.selected:void 0}function Wbe(e){return Object.values(L8).includes(e)}function Gbe(e,t){var n=[e.classNames.day];return Object.keys(t).forEach(function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(Wbe(t)){var i=e.classNames[`day_${t}`];i&&n.push(i)}}),n}function Kbe(e,t){var n=v8({},e.styles.day);return Object.keys(t).forEach(function(t){n=v8(v8({},n),e.modifiersStyles?.[t])}),n}function qbe(e,t,n){var r,i=w8(),a=q8(),o=zbe(e,t),s=Hbe(e,o),c=Ube(),l=!!(i.onDayClick||i.mode!==`default`);(0,u.useEffect)(function(){var t;o.outside||a.focusedDay&&l&&UU(a.focusedDay,e)&&((t=n.current)==null||t.focus())},[a.focusedDay,e,n,l,o.outside]);var d=Gbe(i,o).join(` `),f=Kbe(i,o),p=!!(o.outside&&!i.showOutsideDays||o.hidden),m={style:f,className:d,children:(0,A.jsx)(i.components?.DayContent??mbe,{date:e,displayMonth:t,activeModifiers:o}),role:`gridcell`},h=a.focusTarget&&UU(a.focusTarget,e)&&!o.outside,g=a.focusedDay&&UU(a.focusedDay,e);return{isButton:l,isHidden:p,activeModifiers:o,selectedDays:c,buttonProps:v8(v8(v8({},m),(r={disabled:o.disabled,role:`gridcell`},r[`aria-selected`]=o.selected,r.tabIndex=g||h?0:-1,r)),s),divProps:m}}function Jbe(e){var t=(0,u.useRef)(null),n=qbe(e.date,e.displayMonth,t);return n.isHidden?(0,A.jsx)(`div`,{role:`gridcell`}):n.isButton?(0,A.jsx)(A8,v8({name:`day`,ref:t},n.buttonProps)):(0,A.jsx)(`div`,v8({},n.divProps))}function Ybe(e){var t=e.number,n=e.dates,r=w8(),i=r.onWeekNumberClick,a=r.styles,o=r.classNames,s=r.locale,c=r.labels.labelWeekNumber,l=r.formatters.formatWeekNumber,u=l(Number(t),{locale:s});if(!i)return(0,A.jsx)(`span`,{className:o.weeknumber,style:a.weeknumber,children:u});var d=c(Number(t),{locale:s}),f=function(e){i(t,n,e)};return(0,A.jsx)(A8,{name:`week-number`,"aria-label":d,className:o.weeknumber,style:a.weeknumber,onClick:f,children:u})}function Xbe(e){var t=w8(),n=t.styles,r=t.classNames,i=t.showWeekNumber,a=t.components,o=a?.Day??Jbe,s=a?.WeekNumber??Ybe,c;return i&&(c=(0,A.jsx)(`td`,{className:r.cell,style:n.cell,children:(0,A.jsx)(s,{number:e.weekNumber,dates:e.dates})})),(0,A.jsxs)(`tr`,{className:r.row,style:n.row,children:[c,e.dates.map(function(t){return(0,A.jsx)(`td`,{className:r.cell,style:n.cell,role:`presentation`,children:(0,A.jsx)(o,{displayMonth:e.displayMonth,date:t})},HW(t))})]})}function X8(e,t,n){for(var r=n?.ISOWeek?QU(t):ZU(t,n),i=n?.ISOWeek?NU(e):MU(e,n),a=LU(r,i),o=[],s=0;s<=a;s++)o.push(wU(i,s));return o.reduce(function(e,t){var r=n?.ISOWeek?pW(t):gW(t,n),i=e.find(function(e){return e.weekNumber===r});return i?(i.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)},[])}function Zbe(e,t){var n=X8(YU(e),JU(e),t);if(t?.useFixedWeeks){var r=WW(e,t);if(r<6){var i=n[n.length-1],a=i.dates[i.dates.length-1],o=zU(a,6-r),s=X8(zU(a,1),o,t);n.push.apply(n,s)}}return n}function Qbe(e){var t=w8(),n=t.locale,r=t.classNames,i=t.styles,a=t.hideHead,o=t.fixedWeeks,s=t.components,c=t.weekStartsOn,l=t.firstWeekContainsDate,u=t.ISOWeek,d=Zbe(e.displayMonth,{useFixedWeeks:!!o,ISOWeek:u,locale:n,weekStartsOn:c,firstWeekContainsDate:l}),f=s?.Head??pbe,p=s?.Row??Xbe,m=s?.Footer??ube;return(0,A.jsxs)(`table`,{id:e.id,className:r.table,style:i.table,role:`grid`,"aria-labelledby":e[`aria-labelledby`],children:[!a&&(0,A.jsx)(f,{}),(0,A.jsx)(`tbody`,{className:r.tbody,style:i.tbody,children:d.map(function(t){return(0,A.jsx)(p,{displayMonth:e.displayMonth,dates:t.dates,weekNumber:t.weekNumber},t.weekNumber)})}),(0,A.jsx)(m,{displayMonth:e.displayMonth})]})}function $be(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}var exe=$be()?u.useLayoutEffect:u.useEffect,Z8=!1,txe=0;function Q8(){return`react-day-picker-${++txe}`}function nxe(e){var t=(0,u.useState)(e??(Z8?Q8():null)),n=t[0],r=t[1];return exe(function(){n===null&&r(Q8())},[]),(0,u.useEffect)(function(){Z8===!1&&(Z8=!0)},[]),e??n??void 0}function rxe(e){var t,n=w8(),r=n.dir,i=n.classNames,a=n.styles,o=n.components,s=O8().displayMonths,c=nxe(n.id?`${n.id}-${e.displayIndex}`:void 0),l=n.id?`${n.id}-grid-${e.displayIndex}`:void 0,u=[i.month],d=a.month,f=e.displayIndex===0,p=e.displayIndex===s.length-1,m=!f&&!p;r===`rtl`&&(t=[f,p],p=t[0],f=t[1]),f&&(u.push(i.caption_start),d=v8(v8({},d),a.caption_start)),p&&(u.push(i.caption_end),d=v8(v8({},d),a.caption_end)),m&&(u.push(i.caption_between),d=v8(v8({},d),a.caption_between));var h=o?.Caption??lbe;return(0,A.jsxs)(`div`,{className:u.join(` `),style:d,children:[(0,A.jsx)(h,{id:c,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),(0,A.jsx)(Qbe,{id:l,"aria-labelledby":c,displayMonth:e.displayMonth})]},e.displayIndex)}function ixe(e){var t=w8(),n=t.classNames,r=t.styles;return(0,A.jsx)(`div`,{className:n.months,style:r.months,children:e.children})}function axe(e){var t=e.initialProps,n=w8(),r=q8(),i=O8(),a=(0,u.useState)(!1),o=a[0],s=a[1];(0,u.useEffect)(function(){n.initialFocus&&r.focusTarget&&(o||(r.focus(r.focusTarget),s(!0)))},[n.initialFocus,o,r.focus,r.focusTarget,r]);var c=[n.classNames.root,n.className];n.numberOfMonths>1&&c.push(n.classNames.multiple_months),n.showWeekNumber&&c.push(n.classNames.with_weeknumber);var l=v8(v8({},n.styles.root),n.style),d=Object.keys(t).filter(function(e){return e.startsWith(`data-`)}).reduce(function(e,n){var r;return v8(v8({},e),(r={},r[n]=t[n],r))},{}),f=t.components?.Months??ixe;return(0,A.jsx)(`div`,v8({className:c.join(` `),style:l,dir:n.dir,id:n.id,nonce:t.nonce,title:t.title,lang:t.lang},d,{children:(0,A.jsx)(f,{children:i.displayMonths.map(function(e,t){return(0,A.jsx)(rxe,{displayIndex:t,displayMonth:e},t)})})}))}function oxe(e){var t=e.children,n=Lye(e,[`children`]);return(0,A.jsx)(Yye,{initialProps:n,children:(0,A.jsx)(abe,{children:(0,A.jsx)(Bbe,{initialProps:n,children:(0,A.jsx)(hbe,{initialProps:n,children:(0,A.jsx)(vbe,{initialProps:n,children:(0,A.jsx)(Ebe,{children:(0,A.jsx)(Rbe,{children:t})})})})})})})}function sxe(e){return(0,A.jsx)(oxe,v8({},e,{children:(0,A.jsx)(axe,{initialProps:e})}))}function $8({className:e,classNames:t,showOutsideDays:n=!0,...r}){return(0,A.jsx)(sxe,{showOutsideDays:n,className:H(`p-3`,e),classNames:{months:`flex flex-col sm:flex-row space-y-4 sm:space-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:H(Zf({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:H(Zf({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:({...e})=>(0,A.jsx)(tn,{className:`h-4 w-4`}),IconRight:({...e})=>(0,A.jsx)(nn,{className:`h-4 w-4`})},...r})}$8.displayName=`Calendar`;var cxe=`AspectRatio`,e5=u.forwardRef((e,t)=>{let{ratio:n=1/1,style:r,...i}=e;return(0,A.jsx)(`div`,{style:{position:`relative`,width:`100%`,paddingBottom:`${100/n}%`},"data-radix-aspect-ratio-wrapper":``,children:(0,A.jsx)(Qf.div,{...i,ref:t,style:{...r,position:`absolute`,top:0,right:0,bottom:0,left:0}})})});e5.displayName=cxe;var lxe=e5,t5,n5=`HoverCard`,[r5,uxe]=M(n5,[nc]),i5=nc(),[dxe,a5]=r5(n5),o5=e=>{let{__scopeHoverCard:t,children:n,open:r,defaultOpen:i,onOpenChange:a,openDelay:o=700,closeDelay:s=300}=e,c=i5(t),l=u.useRef(0),d=u.useRef(0),f=u.useRef(!1),p=u.useRef(!1),[m,h]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:n5}),g=u.useCallback(()=>{clearTimeout(d.current),l.current=window.setTimeout(()=>h(!0),o)},[o,h]),_=u.useCallback(()=>{clearTimeout(l.current),!f.current&&!p.current&&(d.current=window.setTimeout(()=>h(!1),s))},[s,h]),v=u.useCallback(()=>h(!1),[h]);return u.useEffect(()=>()=>{clearTimeout(l.current),clearTimeout(d.current)},[]),(0,A.jsx)(dxe,{scope:t,open:m,onOpenChange:h,onOpen:g,onClose:_,onDismiss:v,hasSelectionRef:f,isPointerDownOnContentRef:p,children:(0,A.jsx)(vc,{...c,children:n})})};o5.displayName=n5;var s5=`HoverCardTrigger`,c5=u.forwardRef((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=a5(s5,n),a=i5(n);return(0,A.jsx)(yc,{asChild:!0,...a,children:(0,A.jsx)(z.a,{"data-state":i.open?`open`:`closed`,...r,ref:t,onPointerEnter:w(e.onPointerEnter,f5(i.onOpen)),onPointerLeave:w(e.onPointerLeave,f5(i.onClose)),onFocus:w(e.onFocus,i.onOpen),onBlur:w(e.onBlur,i.onClose),onTouchStart:w(e.onTouchStart,e=>e.preventDefault())})})});c5.displayName=s5;var l5=`HoverCardPortal`,[fxe,pxe]=r5(l5,{forceMount:void 0}),mxe=e=>{let{__scopeHoverCard:t,forceMount:n,children:r,container:i}=e,a=a5(l5,t);return(0,A.jsx)(fxe,{scope:t,forceMount:n,children:(0,A.jsx)(we,{present:n||a.open,children:(0,A.jsx)(Se,{asChild:!0,container:i,children:r})})})};mxe.displayName=l5;var u5=`HoverCardContent`,d5=u.forwardRef((e,t)=>{let n=pxe(u5,e.__scopeHoverCard),{forceMount:r=n.forceMount,...i}=e,a=a5(u5,e.__scopeHoverCard);return(0,A.jsx)(we,{present:r||a.open,children:(0,A.jsx)(hxe,{"data-state":a.open?`open`:`closed`,...i,onPointerEnter:w(e.onPointerEnter,f5(a.onOpen)),onPointerLeave:w(e.onPointerLeave,f5(a.onClose)),ref:t})})});d5.displayName=u5;var hxe=u.forwardRef((e,t)=>{let{__scopeHoverCard:n,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,...s}=e,c=a5(u5,n),l=i5(n),d=u.useRef(null),f=D(t,d),[p,m]=u.useState(!1);return u.useEffect(()=>{if(p){let e=document.body;return t5=e.style.userSelect||e.style.webkitUserSelect,e.style.userSelect=`none`,e.style.webkitUserSelect=`none`,()=>{e.style.userSelect=t5,e.style.webkitUserSelect=t5}}},[p]),u.useEffect(()=>{if(d.current){let e=()=>{m(!1),c.isPointerDownOnContentRef.current=!1,setTimeout(()=>{document.getSelection()?.toString()!==``&&(c.hasSelectionRef.current=!0)})};return document.addEventListener(`pointerup`,e),()=>{document.removeEventListener(`pointerup`,e),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!1}}},[c.isPointerDownOnContentRef,c.hasSelectionRef]),u.useEffect(()=>{d.current&&vxe(d.current).forEach(e=>e.setAttribute(`tabindex`,`-1`))}),(0,A.jsx)(de,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:o,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:w(a,e=>{e.preventDefault()}),onDismiss:c.onDismiss,children:(0,A.jsx)(bc,{...l,...s,onPointerDown:w(s.onPointerDown,e=>{e.currentTarget.contains(e.target)&&m(!0),c.hasSelectionRef.current=!1,c.isPointerDownOnContentRef.current=!0}),ref:f,style:{...s.style,userSelect:p?`text`:void 0,WebkitUserSelect:p?`text`:void 0,"--radix-hover-card-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-hover-card-content-available-width":`var(--radix-popper-available-width)`,"--radix-hover-card-content-available-height":`var(--radix-popper-available-height)`,"--radix-hover-card-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-hover-card-trigger-height":`var(--radix-popper-anchor-height)`}})})}),gxe=`HoverCardArrow`,_xe=u.forwardRef((e,t)=>{let{__scopeHoverCard:n,...r}=e,i=i5(n);return(0,A.jsx)(U,{...i,...r,ref:t})});_xe.displayName=gxe;function f5(e){return t=>t.pointerType===`touch`?void 0:e()}function vxe(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}var yxe=o5,bxe=c5,p5=d5,xxe=yxe,Sxe=bxe,m5=u.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,A.jsx)(p5,{ref:i,align:t,sideOffset:n,className:H(`z-50 w-64 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}));m5.displayName=p5.displayName;var Cxe=Object.defineProperty,wxe=Object.defineProperties,Txe=Object.getOwnPropertyDescriptors,h5=Object.getOwnPropertySymbols,g5=Object.prototype.hasOwnProperty,_5=Object.prototype.propertyIsEnumerable,v5=(e,t,n)=>t in e?Cxe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Exe=(e,t)=>{for(var n in t||={})g5.call(t,n)&&v5(e,n,t[n]);if(h5)for(var n of h5(t))_5.call(t,n)&&v5(e,n,t[n]);return e},Dxe=(e,t)=>wxe(e,Txe(t)),Oxe=(e,t)=>{var n={};for(var r in e)g5.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&h5)for(var r of h5(e))t.indexOf(r)<0&&_5.call(e,r)&&(n[r]=e[r]);return n};function kxe(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}function Axe(e){let t=u.useRef();return u.useEffect(()=>{t.current=e}),t.current}var jxe=18,y5=40,Mxe=`${y5}px`,Nxe=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function Pxe({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[i,a]=u.useState(!1),[o,s]=u.useState(!1),[c,l]=u.useState(!1),d=u.useMemo(()=>n===`none`?!1:(n===`increase-width`||n===`experimental-no-flickering`)&&i&&o,[i,o,n]),f=u.useCallback(()=>{let r=e.current,i=t.current;if(!r||!i||c||n===`none`)return;let o=r,s=o.getBoundingClientRect().left+o.offsetWidth,u=o.getBoundingClientRect().top+o.offsetHeight/2,d=s-jxe,f=u;document.querySelectorAll(Nxe).length===0&&document.elementFromPoint(d,f)===r||(a(!0),l(!0))},[e,t,c,n]);return u.useEffect(()=>{let t=e.current;if(!t||n===`none`)return;function r(){s(window.innerWidth-t.getBoundingClientRect().right>=y5)}r();let i=setInterval(r,1e3);return()=>{clearInterval(i)}},[e,n]),u.useEffect(()=>{let e=r||document.activeElement===t.current;if(n===`none`||!e)return;let i=setTimeout(f,0),a=setTimeout(f,2e3),o=setTimeout(f,5e3),s=setTimeout(()=>{l(!0)},6e3);return()=>{clearTimeout(i),clearTimeout(a),clearTimeout(o),clearTimeout(s)}},[t,r,n,f]),{hasPWMBadge:i,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:Mxe}}var b5=u.createContext({}),x5=u.forwardRef((e,t)=>{var n=e,{value:r,onChange:i,maxLength:a,textAlign:o=`left`,pattern:s,placeholder:c,inputMode:l=`numeric`,onComplete:d,pushPasswordManagerStrategy:f=`increase-width`,pasteTransformer:p,containerClassName:m,noScriptCSSFallback:h=Fxe,render:g,children:_}=n,v=Oxe(n,[`value`,`onChange`,`maxLength`,`textAlign`,`pattern`,`placeholder`,`inputMode`,`onComplete`,`pushPasswordManagerStrategy`,`pasteTransformer`,`containerClassName`,`noScriptCSSFallback`,`render`,`children`]),y;let[b,x]=u.useState(typeof v.defaultValue==`string`?v.defaultValue:``),S=r??b,C=Axe(S),w=u.useCallback(e=>{i?.(e),x(e)},[i]),T=u.useMemo(()=>s?typeof s==`string`?new RegExp(s):s:null,[s]),E=u.useRef(null),D=u.useRef(null),O=u.useRef({value:S,onChange:w,isIOS:typeof window<`u`&&((y=window==null?void 0:window.CSS)?.supports)?.call(y,`-webkit-touch-callout`,`none`)}),k=u.useRef({prev:[E.current?.selectionStart,E.current?.selectionEnd,E.current?.selectionDirection]});u.useImperativeHandle(t,()=>E.current,[]),u.useEffect(()=>{let e=E.current,t=D.current;if(!e||!t)return;O.current.value!==e.value&&O.current.onChange(e.value),k.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function n(){if(document.activeElement!==e){F(null),I(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=k.current.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&E.current.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;F(u),I(d),k.current.prev=[u,d,f]}if(document.addEventListener(`selectionchange`,n,{capture:!0}),n(),document.activeElement===e&&N(!0),!document.getElementById(`input-otp-style`)){let e=document.createElement(`style`);if(e.id=`input-otp-style`,document.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;S5(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),S5(e.sheet,`[data-input-otp]:autofill { ${t} }`),S5(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),S5(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),S5(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let r=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener(`selectionchange`,n,{capture:!0}),i.disconnect()}},[]);let[A,j]=u.useState(!1),[M,N]=u.useState(!1),[P,F]=u.useState(null),[ee,I]=u.useState(null);u.useEffect(()=>{kxe(()=>{var e;(e=E.current)==null||e.dispatchEvent(new Event(`input`));let t=E.current?.selectionStart,n=E.current?.selectionEnd,r=E.current?.selectionDirection;t!==null&&n!==null&&(F(t),I(n),k.current.prev=[t,n,r])})},[S,M]),u.useEffect(()=>{C!==void 0&&S!==C&&C.length<a&&S.length===a&&d?.(S)},[a,d,C,S]);let L=Pxe({containerRef:D,inputRef:E,pushPasswordManagerStrategy:f,isFocused:M}),R=u.useCallback(e=>{let t=e.currentTarget.value.slice(0,a);if(t.length>0&&T&&!T.test(t)){e.preventDefault();return}typeof C==`string`&&t.length<C.length&&document.dispatchEvent(new Event(`selectionchange`)),w(t)},[a,w,C,T]),te=u.useCallback(()=>{var e;if(E.current){let t=Math.min(E.current.value.length,a-1),n=E.current.value.length;(e=E.current)==null||e.setSelectionRange(t,n),F(t),I(n)}N(!0)},[a]),ne=u.useCallback(e=>{let t=E.current;if(!p&&(!O.current.isIOS||!e.clipboardData||!t))return;let n=e.clipboardData.getData(`text/plain`),r=p?p(n):n;e.preventDefault();let i=E.current?.selectionStart,o=E.current?.selectionEnd,s=(i===o?S.slice(0,i)+r+S.slice(i):S.slice(0,i)+r+S.slice(o)).slice(0,a);if(s.length>0&&T&&!T.test(s))return;t.value=s,w(s);let c=Math.min(s.length,a-1),l=s.length;t.setSelectionRange(c,l),F(c),I(l)},[a,w,T,S]),z=u.useMemo(()=>({position:`relative`,cursor:v.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}),[v.disabled]),re=u.useMemo(()=>({position:`absolute`,inset:0,width:L.willPushPWMBadge?`calc(100% + ${L.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:L.willPushPWMBadge?`inset(0 ${L.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:o,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}),[L.PWM_BADGE_SPACE_WIDTH,L.willPushPWMBadge,o]),ie=u.useMemo(()=>u.createElement(`input`,Dxe(Exe({autoComplete:v.autoComplete||`one-time-code`},v),{"data-input-otp":!0,"data-input-otp-placeholder-shown":S.length===0||void 0,"data-input-otp-mss":P,"data-input-otp-mse":ee,inputMode:l,pattern:T?.source,"aria-placeholder":c,style:re,maxLength:a,value:S,ref:E,onPaste:e=>{var t;ne(e),(t=v.onPaste)==null||t.call(v,e)},onChange:R,onMouseOver:e=>{var t;j(!0),(t=v.onMouseOver)==null||t.call(v,e)},onMouseLeave:e=>{var t;j(!1),(t=v.onMouseLeave)==null||t.call(v,e)},onFocus:e=>{var t;te(),(t=v.onFocus)==null||t.call(v,e)},onBlur:e=>{var t;N(!1),(t=v.onBlur)==null||t.call(v,e)}})),[R,te,ne,l,re,a,ee,P,v,T?.source,S]),ae=u.useMemo(()=>({slots:Array.from({length:a}).map((e,t)=>{let n=M&&P!==null&&ee!==null&&(P===ee&&t===P||t>=P&&t<ee),r=S[t]===void 0?null:S[t];return{char:r,placeholderChar:S[0]===void 0?c?.[t]??null:null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:M,isHovering:!v.disabled&&A}),[M,A,a,ee,P,v.disabled,S]),oe=u.useMemo(()=>g?g(ae):u.createElement(b5.Provider,{value:ae},_),[_,ae,g]);return u.createElement(u.Fragment,null,h!==null&&u.createElement(`noscript`,null,u.createElement(`style`,null,h)),u.createElement(`div`,{ref:D,"data-input-otp-container":!0,style:z,className:m},oe,u.createElement(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`}},ie)))});x5.displayName=`Input`;function S5(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}var Fxe=`
223
+ [data-input-otp] {
224
+ --nojs-bg: white !important;
225
+ --nojs-fg: black !important;
226
+
227
+ background-color: var(--nojs-bg) !important;
228
+ color: var(--nojs-fg) !important;
229
+ caret-color: var(--nojs-fg) !important;
230
+ letter-spacing: .25em !important;
231
+ text-align: center !important;
232
+ border: 1px solid var(--nojs-fg) !important;
233
+ border-radius: 4px !important;
234
+ width: 100% !important;
235
+ }
236
+ @media (prefers-color-scheme: dark) {
237
+ [data-input-otp] {
238
+ --nojs-bg: black !important;
239
+ --nojs-fg: white !important;
240
+ }
241
+ }`,C5=u.forwardRef(({className:e,containerClassName:t,...n},r)=>(0,A.jsx)(x5,{ref:r,containerClassName:H(`flex items-center gap-2 has-[:disabled]:opacity-50`,t),className:H(`disabled:cursor-not-allowed`,e),...n}));C5.displayName=`InputOTP`;var w5=u.forwardRef(({className:e,...t},n)=>(0,A.jsx)(`div`,{ref:n,className:H(`flex items-center`,e),...t}));w5.displayName=`InputOTPGroup`;var T5=u.forwardRef(({index:e,className:t,...n},r)=>{let{char:i,hasFakeCaret:a,isActive:o}=u.useContext(b5).slots[e];return(0,A.jsxs)(`div`,{ref:r,className:H(`relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md`,o&&`z-10 ring-2 ring-ring ring-offset-background`,t),...n,children:[i,a&&(0,A.jsx)(`div`,{className:`pointer-events-none absolute inset-0 flex items-center justify-center`,children:(0,A.jsx)(`div`,{className:`animate-caret-blink h-4 w-px bg-foreground duration-1000`})})]})});T5.displayName=`InputOTPSlot`;var Ixe=u.forwardRef(({...e},t)=>(0,A.jsx)(`div`,{ref:t,role:`separator`,...e,children:(0,A.jsx)(bn,{})}));Ixe.displayName=`InputOTPSeparator`;function Lxe(e){return Object.prototype.toString.call(e)===`[object Object]`}function E5(e){return Lxe(e)||Array.isArray(e)}function Rxe(){return!!(typeof window<`u`&&window.document&&window.document.createElement)}function D5(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length!==r.length||JSON.stringify(Object.keys(e.breakpoints||{}))!==JSON.stringify(Object.keys(t.breakpoints||{}))?!1:n.every(n=>{let r=e[n],i=t[n];return typeof r==`function`?`${r}`==`${i}`:!E5(r)||!E5(i)?r===i:D5(r,i)})}function O5(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function zxe(e,t){if(e.length!==t.length)return!1;let n=O5(e),r=O5(t);return n.every((e,t)=>{let n=r[t];return D5(e,n)})}function k5(e){return typeof e==`number`}function A5(e){return typeof e==`string`}function j5(e){return typeof e==`boolean`}function M5(e){return Object.prototype.toString.call(e)===`[object Object]`}function N5(e){return Math.abs(e)}function P5(e){return Math.sign(e)}function F5(e,t){return N5(e-t)}function Bxe(e,t){return e===0||t===0||N5(e)<=N5(t)?0:N5(F5(N5(e),N5(t))/e)}function Vxe(e){return Math.round(e*100)/100}function I5(e){return V5(e).map(Number)}function L5(e){return e[R5(e)]}function R5(e){return Math.max(0,e.length-1)}function z5(e,t){return t===R5(e)}function B5(e,t=0){return Array.from(Array(e),(e,n)=>t+n)}function V5(e){return Object.keys(e)}function H5(e,t){return[e,t].reduce((e,t)=>(V5(t).forEach(n=>{let r=e[n],i=t[n];e[n]=M5(r)&&M5(i)?H5(r,i):i}),e),{})}function U5(e,t){return t.MouseEvent!==void 0&&e instanceof t.MouseEvent}function Hxe(e,t){let n={start:r,center:i,end:a};function r(){return 0}function i(e){return a(e)/2}function a(e){return t-e}function o(r,i){return A5(e)?n[e](r):e(t,r,i)}return{measure:o}}function W5(){let e=[];function t(t,n,i,a={passive:!0}){let o;if(`addEventListener`in t)t.addEventListener(n,i,a),o=()=>t.removeEventListener(n,i,a);else{let e=t;e.addListener(i),o=()=>e.removeListener(i)}return e.push(o),r}function n(){e=e.filter(e=>e())}let r={add:t,clear:n};return r}function Uxe(e,t,n,r){let i=W5(),a=1e3/60,o=null,s=0,c=0;function l(){i.add(e,`visibilitychange`,()=>{e.hidden&&m()})}function u(){p(),i.clear()}function d(e){if(!c)return;o||(o=e,n(),n());let i=e-o;for(o=e,s+=i;s>=a;)n(),s-=a;r(s/a),c&&=t.requestAnimationFrame(d)}function f(){c||=t.requestAnimationFrame(d)}function p(){t.cancelAnimationFrame(c),o=null,s=0,c=0}function m(){o=null,s=0}return{init:l,destroy:u,start:f,stop:p,update:n,render:r}}function Wxe(e,t){let n=t===`rtl`,r=e===`y`,i=r?`y`:`x`,a=r?`x`:`y`,o=!r&&n?-1:1,s=u(),c=d();function l(e){let{height:t,width:n}=e;return r?t:n}function u(){return r?`top`:n?`right`:`left`}function d(){return r?`bottom`:n?`left`:`right`}function f(e){return e*o}return{scroll:i,cross:a,startEdge:s,endEdge:c,measureSize:l,direction:f}}function G5(e=0,t=0){let n=N5(e-t);function r(t){return t<e}function i(e){return e>t}function a(e){return r(e)||i(e)}function o(n){return a(n)?r(n)?e:t:n}function s(e){return n?e-n*Math.ceil((e-t)/n):e}return{length:n,max:t,min:e,constrain:o,reachedAny:a,reachedMax:i,reachedMin:r,removeOffset:s}}function K5(e,t,n){let{constrain:r}=G5(0,e),i=e+1,a=o(t);function o(e){return n?N5((i+e)%i):r(e)}function s(){return a}function c(e){return a=o(e),d}function l(e){return u().set(s()+e)}function u(){return K5(e,s(),n)}let d={get:s,set:c,add:l,clone:u};return d}function Gxe(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v){let{cross:y,direction:b}=e,x=[`INPUT`,`SELECT`,`TEXTAREA`],S={passive:!1},C=W5(),w=W5(),T=G5(50,225).constrain(p.measure(20)),E={mouse:300,touch:400},D={mouse:500,touch:600},O=m?43:25,k=!1,A=0,j=0,M=!1,N=!1,P=!1,F=!1;function ee(e){if(!v)return;function n(t){(j5(v)||v(e,t))&&z(t)}let r=t;C.add(r,`dragstart`,e=>e.preventDefault(),S).add(r,`touchmove`,()=>void 0,S).add(r,`touchend`,()=>void 0).add(r,`touchstart`,n).add(r,`mousedown`,n).add(r,`touchcancel`,ie).add(r,`contextmenu`,ie).add(r,`click`,ae,!0)}function I(){C.clear(),w.clear()}function L(){let e=F?n:t;w.add(e,`touchmove`,re,S).add(e,`touchend`,ie).add(e,`mousemove`,re,S).add(e,`mouseup`,ie)}function R(e){let t=e.nodeName||``;return x.includes(t)}function te(){return(m?D:E)[F?`mouse`:`touch`]}function ne(e,t){let n=d.add(P5(e)*-1),r=u.byDistance(e,!m).distance;return m||N5(e)<T?r:g&&t?r*.5:u.byIndex(n.get(),0).distance}function z(e){let t=U5(e,r);F=t,P=m&&t&&!e.buttons&&k,k=F5(i.get(),o.get())>=2,!(t&&e.button!==0)&&(R(e.target)||(M=!0,a.pointerDown(e),l.useFriction(0).useDuration(0),i.set(o),L(),A=a.readPoint(e),j=a.readPoint(e,y),f.emit(`pointerDown`)))}function re(e){if(!U5(e,r)&&e.touches.length>=2)return ie(e);let t=a.readPoint(e),n=a.readPoint(e,y),o=F5(t,A),c=F5(n,j);if(!N&&!F&&(!e.cancelable||(N=o>c,!N)))return ie(e);let u=a.pointerMove(e);o>h&&(P=!0),l.useFriction(.3).useDuration(.75),s.start(),i.add(b(u)),e.preventDefault()}function ie(e){let t=u.byDistance(0,!1).index!==d.get(),n=a.pointerUp(e)*te(),r=ne(b(n),t),i=Bxe(n,r),o=O-10*i,s=_+i/50;N=!1,M=!1,w.clear(),l.useDuration(o).useFriction(s),c.distance(r,!m),F=!1,f.emit(`pointerUp`)}function ae(e){P&&=(e.stopPropagation(),e.preventDefault(),!1)}function oe(){return M}return{init:ee,destroy:I,pointerDown:oe}}function Kxe(e,t){let n,r;function i(e){return e.timeStamp}function a(n,r){let i=`client${(r||e.scroll)===`x`?`X`:`Y`}`;return(U5(n,t)?n:n.touches[0])[i]}function o(e){return n=e,r=e,a(e)}function s(e){let t=a(e)-a(r),o=i(e)-i(n)>170;return r=e,o&&(n=e),t}function c(e){if(!n||!r)return 0;let t=a(r)-a(n),o=i(e)-i(n),s=i(e)-i(r)>170,c=t/o;return o&&!s&&N5(c)>.1?c:0}return{pointerDown:o,pointerMove:s,pointerUp:c,readPoint:a}}function qxe(){function e(e){let{offsetTop:t,offsetLeft:n,offsetWidth:r,offsetHeight:i}=e;return{top:t,right:n+r,bottom:t+i,left:n,width:r,height:i}}return{measure:e}}function Jxe(e){function t(t){return t/100*e}return{measure:t}}function Yxe(e,t,n,r,i,a,o){let s=[e].concat(r),c,l,u=[],d=!1;function f(e){return i.measureSize(o.measure(e))}function p(i){if(!a)return;l=f(e),u=r.map(f);function o(n){for(let a of n){if(d)return;let n=a.target===e,o=r.indexOf(a.target),s=n?l:u[o];if(N5(f(n?e:r[o])-s)>=.5){i.reInit(),t.emit(`resize`);break}}}c=new ResizeObserver(e=>{(j5(a)||a(i,e))&&o(e)}),n.requestAnimationFrame(()=>{s.forEach(e=>c.observe(e))})}function m(){d=!0,c&&c.disconnect()}return{init:p,destroy:m}}function Xxe(e,t,n,r,i,a){let o=0,s=0,c=i,l=a,u=e.get(),d=0;function f(){let t=r.get()-e.get(),i=!c,a=0;return i?(o=0,n.set(r),e.set(r),a=t):(n.set(e),o+=t/c,o*=l,u+=o,e.add(o),a=u-d),s=P5(a),d=u,x}function p(){return N5(r.get()-t.get())<.001}function m(){return c}function h(){return s}function g(){return o}function _(){return y(i)}function v(){return b(a)}function y(e){return c=e,x}function b(e){return l=e,x}let x={direction:h,duration:m,velocity:g,seek:f,settled:p,useBaseFriction:v,useBaseDuration:_,useFriction:b,useDuration:y};return x}function Zxe(e,t,n,r,i){let a=i.measure(10),o=i.measure(50),s=G5(.1,.99),c=!1;function l(){return!(c||!e.reachedAny(n.get())||!e.reachedAny(t.get()))}function u(i){if(!l())return;let c=N5(e[e.reachedMin(t.get())?`min`:`max`]-t.get()),u=n.get()-t.get(),d=s.constrain(c/o);n.subtract(u*d),!i&&N5(u)<a&&(n.set(e.constrain(n.get())),r.useDuration(25).useBaseFriction())}function d(e){c=!e}return{shouldConstrain:l,constrain:u,toggleActive:d}}function Qxe(e,t,n,r,i){let a=G5(-t+e,0),o=d(),s=u(),c=f();function l(e,t){return F5(e,t)<=1}function u(){let e=o[0],t=L5(o);return G5(o.lastIndexOf(e),o.indexOf(t)+1)}function d(){return n.map((e,t)=>{let{min:r,max:i}=a,o=a.constrain(e),s=!t,c=z5(n,t);return s?i:c||l(r,o)?r:l(i,o)?i:o}).map(e=>parseFloat(e.toFixed(3)))}function f(){if(t<=e+i)return[a.max];if(r===`keepSnaps`)return o;let{min:n,max:c}=s;return o.slice(n,c)}return{snapsContained:c,scrollContainLimit:s}}function $xe(e,t,n){let r=t[0];return{limit:G5(n?r-e:L5(t),r)}}function eSe(e,t,n,r){let i=.1,{reachedMin:a,reachedMax:o}=G5(t.min+i,t.max+i);function s(e){return e===1?o(n.get()):e===-1?a(n.get()):!1}function c(t){if(!s(t))return;let n=t*-1*e;r.forEach(e=>e.add(n))}return{loop:c}}function tSe(e){let{max:t,length:n}=e;function r(e){let r=e-t;return n?r/-n:0}return{get:r}}function nSe(e,t,n,r,i){let{startEdge:a,endEdge:o}=e,{groupSlides:s}=i,c=d().map(t.measure),l=f(),u=p();function d(){return s(r).map(e=>L5(e)[o]-e[0][a]).map(N5)}function f(){return r.map(e=>n[a]-e[a]).map(e=>-N5(e))}function p(){return s(l).map(e=>e[0]).map((e,t)=>e+c[t])}return{snaps:l,snapsAligned:u}}function rSe(e,t,n,r,i,a){let{groupSlides:o}=i,{min:s,max:c}=r,l=u();function u(){let r=o(a),i=!e||t===`keepSnaps`;return n.length===1?[a]:i?r:r.slice(s,c).map((e,t,n)=>{let r=!t,i=z5(n,t);return r?B5(L5(n[0])+1):i?B5(R5(a)-L5(n)[0]+1,L5(n)[0]):e})}return{slideRegistry:l}}function iSe(e,t,n,r,i){let{reachedAny:a,removeOffset:o,constrain:s}=r;function c(e){return e.concat().sort((e,t)=>N5(e)-N5(t))[0]}function l(n){let r=e?o(n):s(n),{index:i}=t.map((e,t)=>({diff:u(e-r,0),index:t})).sort((e,t)=>N5(e.diff)-N5(t.diff))[0];return{index:i,distance:r}}function u(t,r){let i=[t,t+n,t-n];if(!e)return t;if(!r)return c(i);let a=i.filter(e=>P5(e)===r);return a.length?c(a):L5(i)-n}function d(e,n){return{index:e,distance:u(t[e]-i.get(),n)}}function f(n,r){let o=i.get()+n,{index:s,distance:c}=l(o),d=!e&&a(o);return!r||d?{index:s,distance:n}:{index:s,distance:n+u(t[s]-c,0)}}return{byDistance:f,byIndex:d,shortcut:u}}function aSe(e,t,n,r,i,a,o){function s(i){let s=i.distance,c=i.index!==t.get();a.add(s),s&&(r.duration()?e.start():(e.update(),e.render(1),e.update())),c&&(n.set(t.get()),t.set(i.index),o.emit(`select`))}function c(e,t){s(i.byDistance(e,t))}function l(e,n){let r=t.clone().set(e);s(i.byIndex(r.get(),n))}return{distance:c,index:l}}function oSe(e,t,n,r,i,a,o,s){let c={passive:!0,capture:!0},l=0;function u(u){if(!s)return;function f(t){if(new Date().getTime()-l>10)return;o.emit(`slideFocusStart`),e.scrollLeft=0;let a=n.findIndex(e=>e.includes(t));k5(a)&&(i.useDuration(0),r.index(a,0),o.emit(`slideFocus`))}a.add(document,`keydown`,d,!1),t.forEach((e,t)=>{a.add(e,`focus`,e=>{(j5(s)||s(u,e))&&f(t)},c)})}function d(e){e.code===`Tab`&&(l=new Date().getTime())}return{init:u}}function q5(e){let t=e;function n(){return t}function r(e){t=o(e)}function i(e){t+=o(e)}function a(e){t-=o(e)}function o(e){return k5(e)?e:e.get()}return{get:n,set:r,add:i,subtract:a}}function J5(e,t){let n=e.scroll===`x`?o:s,r=t.style,i=null,a=!1;function o(e){return`translate3d(${e}px,0px,0px)`}function s(e){return`translate3d(0px,${e}px,0px)`}function c(t){if(a)return;let o=Vxe(e.direction(t));o!==i&&(r.transform=n(o),i=o)}function l(e){a=!e}function u(){a||(r.transform=``,t.getAttribute(`style`)||t.removeAttribute(`style`))}return{clear:u,to:c,toggleActive:l}}function sSe(e,t,n,r,i,a,o,s,c){let l=.5,u=I5(i),d=I5(i).reverse(),f=_().concat(v());function p(e,t){return e.reduce((e,t)=>e-i[t],t)}function m(e,t){return e.reduce((e,n)=>p(e,t)>0?e.concat([n]):e,[])}function h(e){return a.map((n,i)=>({start:n-r[i]+l+e,end:n+t-l+e}))}function g(t,r,i){let a=h(r);return t.map(t=>{let r=i?0:-n,o=i?n:0,l=i?`end`:`start`,u=a[t][l];return{index:t,loopPoint:u,slideLocation:q5(-1),translate:J5(e,c[t]),target:()=>s.get()>u?r:o}})}function _(){let e=o[0];return g(m(d,e),n,!1)}function v(){return g(m(u,t-o[0]-1),-n,!0)}function y(){return f.every(({index:e})=>p(u.filter(t=>t!==e),t)<=.1)}function b(){f.forEach(e=>{let{target:t,translate:n,slideLocation:r}=e,i=t();i!==r.get()&&(n.to(i),r.set(i))})}function x(){f.forEach(e=>e.translate.clear())}return{canLoop:y,clear:x,loop:b,loopPoints:f}}function cSe(e,t,n){let r,i=!1;function a(a){if(!n)return;function o(e){for(let n of e)if(n.type===`childList`){a.reInit(),t.emit(`slidesChanged`);break}}r=new MutationObserver(e=>{i||(j5(n)||n(a,e))&&o(e)}),r.observe(e,{childList:!0})}function o(){r&&r.disconnect(),i=!0}return{init:a,destroy:o}}function lSe(e,t,n,r){let i={},a=null,o=null,s,c=!1;function l(){s=new IntersectionObserver(e=>{c||(e.forEach(e=>{let n=t.indexOf(e.target);i[n]=e}),a=null,o=null,n.emit(`slidesInView`))},{root:e.parentElement,threshold:r}),t.forEach(e=>s.observe(e))}function u(){s&&s.disconnect(),c=!0}function d(e){return V5(i).reduce((t,n)=>{let r=parseInt(n),{isIntersecting:a}=i[r];return(e&&a||!e&&!a)&&t.push(r),t},[])}function f(e=!0){if(e&&a)return a;if(!e&&o)return o;let t=d(e);return e&&(a=t),e||(o=t),t}return{init:l,destroy:u,get:f}}function uSe(e,t,n,r,i,a){let{measureSize:o,startEdge:s,endEdge:c}=e,l=n[0]&&i,u=m(),d=h(),f=n.map(o),p=g();function m(){if(!l)return 0;let e=n[0];return N5(t[s]-e[s])}function h(){if(!l)return 0;let e=a.getComputedStyle(L5(r));return parseFloat(e.getPropertyValue(`margin-${c}`))}function g(){return n.map((e,t,n)=>{let r=!t,i=z5(n,t);return r?f[t]+u:i?f[t]+d:n[t+1][s]-e[s]}).map(N5)}return{slideSizes:f,slideSizesWithGaps:p,startGap:u,endGap:d}}function dSe(e,t,n,r,i,a,o,s,c){let{startEdge:l,endEdge:u,direction:d}=e,f=k5(n);function p(e,t){return I5(e).filter(e=>e%t===0).map(n=>e.slice(n,n+t))}function m(e){return e.length?I5(e).reduce((n,f,p)=>{let m=L5(n)||0,h=m===0,g=f===R5(e),_=i[l]-a[m][l],v=i[l]-a[f][u],y=!r&&h?d(o):0,b=N5(v-(!r&&g?d(s):0)-(_+y));return p&&b>t+c&&n.push(f),g&&n.push(e.length),n},[]).map((t,n,r)=>{let i=Math.max(r[n-1]||0);return e.slice(i,t)}):[]}function h(e){return f?p(e,n):m(e)}return{groupSlides:h}}function fSe(e,t,n,r,i,a,o){let{align:s,axis:c,direction:l,startIndex:u,loop:d,duration:f,dragFree:p,dragThreshold:m,inViewThreshold:h,slidesToScroll:g,skipSnaps:_,containScroll:v,watchResize:y,watchSlides:b,watchDrag:x,watchFocus:S}=a,C=qxe(),w=C.measure(t),T=n.map(C.measure),E=Wxe(c,l),D=E.measureSize(w),O=Jxe(D),k=Hxe(s,D),A=!d&&!!v,{slideSizes:j,slideSizesWithGaps:M,startGap:N,endGap:P}=uSe(E,w,T,n,d||!!v,i),F=dSe(E,D,g,d,w,T,N,P,2),{snaps:ee,snapsAligned:I}=nSe(E,k,w,T,F),L=-L5(ee)+L5(M),{snapsContained:R,scrollContainLimit:te}=Qxe(D,L,I,v,2),ne=A?R:I,{limit:z}=$xe(L,ne,d),re=K5(R5(ne),u,d),ie=re.clone(),ae=I5(n),oe=({dragHandler:e,scrollBody:t,scrollBounds:n,options:{loop:r}})=>{r||n.constrain(e.pointerDown()),t.seek()},se=({scrollBody:e,translate:t,location:n,offsetLocation:r,previousLocation:i,scrollLooper:a,slideLooper:o,dragHandler:s,animation:c,eventHandler:l,scrollBounds:u,options:{loop:d}},f)=>{let p=e.settled(),m=!u.shouldConstrain(),h=d?p:p&&m,g=h&&!s.pointerDown();g&&c.stop();let _=n.get()*f+i.get()*(1-f);r.set(_),d&&(a.loop(e.direction()),o.loop()),t.to(r.get()),g&&l.emit(`settle`),h||l.emit(`scroll`)},B=Uxe(r,i,()=>oe(Se),e=>se(Se,e)),ce=.68,le=ne[re.get()],ue=q5(le),de=q5(le),fe=q5(le),pe=q5(le),me=Xxe(ue,fe,de,pe,f,ce),he=iSe(d,ne,L,z,pe),ge=aSe(B,re,ie,me,he,pe,o),_e=tSe(z),ve=W5(),ye=lSe(t,n,o,h),{slideRegistry:be}=rSe(A,v,ne,te,F,ae),xe=oSe(e,n,be,ge,me,ve,o,S),Se={ownerDocument:r,ownerWindow:i,eventHandler:o,containerRect:w,slideRects:T,animation:B,axis:E,dragHandler:Gxe(E,e,r,i,pe,Kxe(E,i),ue,B,ge,me,he,re,o,O,p,m,_,ce,x),eventStore:ve,percentOfView:O,index:re,indexPrevious:ie,limit:z,location:ue,offsetLocation:fe,previousLocation:de,options:a,resizeHandler:Yxe(t,o,i,n,E,y,C),scrollBody:me,scrollBounds:Zxe(z,fe,pe,me,O),scrollLooper:eSe(L,z,fe,[ue,fe,de,pe]),scrollProgress:_e,scrollSnapList:ne.map(_e.get),scrollSnaps:ne,scrollTarget:he,scrollTo:ge,slideLooper:sSe(E,D,L,j,M,ee,ne,fe,n),slideFocus:xe,slidesHandler:cSe(t,o,b),slidesInView:ye,slideIndexes:ae,slideRegistry:be,slidesToScroll:F,target:pe,translate:J5(E,t)};return Se}function pSe(){let e={},t;function n(e){t=e}function r(t){return e[t]||[]}function i(e){return r(e).forEach(n=>n(t,e)),c}function a(t,n){return e[t]=r(t).concat([n]),c}function o(t,n){return e[t]=r(t).filter(e=>e!==n),c}function s(){e={}}let c={init:n,emit:i,off:o,on:a,clear:s};return c}var mSe={align:`center`,axis:`x`,container:null,slides:null,containScroll:`trimSnaps`,direction:`ltr`,slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function hSe(e){function t(e,t){return H5(e,t||{})}function n(n){let r=n.breakpoints||{};return t(n,V5(r).filter(t=>e.matchMedia(t).matches).map(e=>r[e]).reduce((e,n)=>t(e,n),{}))}function r(t){return t.map(e=>V5(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}return{mergeOptions:t,optionsAtMedia:n,optionsMediaQueries:r}}function gSe(e){let t=[];function n(n,r){return t=r.filter(({options:t})=>e.optionsAtMedia(t).active!==!1),t.forEach(t=>t.init(n,e)),r.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})}function r(){t=t.filter(e=>e.destroy())}return{init:n,destroy:r}}function Y5(e,t,n){let r=e.ownerDocument,i=r.defaultView,a=hSe(i),o=gSe(a),s=W5(),c=pSe(),{mergeOptions:l,optionsAtMedia:u,optionsMediaQueries:d}=a,{on:f,off:p,emit:m}=c,h=D,g=!1,_,v=l(mSe,Y5.globalOptions),y=l(v),b=[],x,S,C;function w(){let{container:t,slides:n}=y;S=(A5(t)?e.querySelector(t):t)||e.children[0];let r=A5(n)?S.querySelectorAll(n):n;C=[].slice.call(r||S.children)}function T(t){let n=fSe(e,S,C,r,i,t,c);return t.loop&&!n.slideLooper.canLoop()?T(Object.assign({},t,{loop:!1})):n}function E(e,t){g||(v=l(v,e),y=u(v),b=t||b,w(),_=T(y),d([v,...b.map(({options:e})=>e)]).forEach(e=>s.add(e,`change`,D)),y.active&&(_.translate.to(_.location.get()),_.animation.init(),_.slidesInView.init(),_.slideFocus.init(oe),_.eventHandler.init(oe),_.resizeHandler.init(oe),_.slidesHandler.init(oe),_.options.loop&&_.slideLooper.loop(),S.offsetParent&&C.length&&_.dragHandler.init(oe),x=o.init(oe,b)))}function D(e,t){let n=I();O(),E(l({startIndex:n},e),t),c.emit(`reInit`)}function O(){_.dragHandler.destroy(),_.eventStore.clear(),_.translate.clear(),_.slideLooper.clear(),_.resizeHandler.destroy(),_.slidesHandler.destroy(),_.slidesInView.destroy(),_.animation.destroy(),o.destroy(),s.clear()}function k(){g||(g=!0,s.clear(),O(),c.emit(`destroy`),c.clear())}function A(e,t,n){!y.active||g||(_.scrollBody.useBaseFriction().useDuration(t===!0?0:y.duration),_.scrollTo.index(e,n||0))}function j(e){A(_.index.add(1).get(),e,-1)}function M(e){A(_.index.add(-1).get(),e,1)}function N(){return _.index.add(1).get()!==I()}function P(){return _.index.add(-1).get()!==I()}function F(){return _.scrollSnapList}function ee(){return _.scrollProgress.get(_.offsetLocation.get())}function I(){return _.index.get()}function L(){return _.indexPrevious.get()}function R(){return _.slidesInView.get()}function te(){return _.slidesInView.get(!1)}function ne(){return x}function z(){return _}function re(){return e}function ie(){return S}function ae(){return C}let oe={canScrollNext:N,canScrollPrev:P,containerNode:ie,internalEngine:z,destroy:k,off:p,on:f,emit:m,plugins:ne,previousScrollSnap:L,reInit:h,rootNode:re,scrollNext:j,scrollPrev:M,scrollProgress:ee,scrollSnapList:F,scrollTo:A,selectedScrollSnap:I,slideNodes:ae,slidesInView:R,slidesNotInView:te};return E(t,n),setTimeout(()=>c.emit(`init`),0),oe}Y5.globalOptions=void 0;function X5(e={},t=[]){let n=(0,u.useRef)(e),r=(0,u.useRef)(t),[i,a]=(0,u.useState)(),[o,s]=(0,u.useState)(),c=(0,u.useCallback)(()=>{i&&i.reInit(n.current,r.current)},[i]);return(0,u.useEffect)(()=>{D5(n.current,e)||(n.current=e,c())},[e,c]),(0,u.useEffect)(()=>{zxe(r.current,t)||(r.current=t,c())},[t,c]),(0,u.useEffect)(()=>{if(Rxe()&&o){Y5.globalOptions=X5.globalOptions;let e=Y5(o,n.current,r.current);return a(e),()=>e.destroy()}else a(void 0)},[o,a]),[s,i]}X5.globalOptions=void 0;var Z5=u.createContext(null);function Q5(){let e=u.useContext(Z5);if(!e)throw Error(`useCarousel must be used within a <Carousel />`);return e}var $5=u.forwardRef(({orientation:e=`horizontal`,opts:t,setApi:n,plugins:r,className:i,children:a,...o},s)=>{let[c,l]=X5({...t,axis:e===`horizontal`?`x`:`y`},r),[d,f]=u.useState(!1),[p,m]=u.useState(!1),h=u.useCallback(e=>{e&&(f(e.canScrollPrev()),m(e.canScrollNext()))},[]),g=u.useCallback(()=>{l?.scrollPrev()},[l]),_=u.useCallback(()=>{l?.scrollNext()},[l]),v=u.useCallback(e=>{e.key===`ArrowLeft`?(e.preventDefault(),g()):e.key===`ArrowRight`&&(e.preventDefault(),_())},[g,_]);return u.useEffect(()=>{!l||!n||n(l)},[l,n]),u.useEffect(()=>{if(l)return h(l),l.on(`reInit`,h),l.on(`select`,h),()=>{l?.off(`select`,h)}},[l,h]),(0,A.jsx)(Z5.Provider,{value:{carouselRef:c,api:l,opts:t,orientation:e||(t?.axis===`y`?`vertical`:`horizontal`),scrollPrev:g,scrollNext:_,canScrollPrev:d,canScrollNext:p},children:(0,A.jsx)(`div`,{ref:s,onKeyDownCapture:v,className:H(`relative`,i),role:`region`,"aria-roledescription":`carousel`,...o,children:a})})});$5.displayName=`Carousel`;var e7=u.forwardRef(({className:e,...t},n)=>{let{carouselRef:r,orientation:i}=Q5();return(0,A.jsx)(`div`,{ref:r,className:`overflow-hidden`,children:(0,A.jsx)(`div`,{ref:n,className:H(`flex`,i===`horizontal`?`-ml-4`:`-mt-4 flex-col`,e),...t})})});e7.displayName=`CarouselContent`;var t7=u.forwardRef(({className:e,...t},n)=>{let{orientation:r}=Q5();return(0,A.jsx)(`div`,{ref:n,role:`group`,"aria-roledescription":`slide`,className:H(`min-w-0 shrink-0 grow-0 basis-full`,r===`horizontal`?`pl-4`:`pt-4`,e),...t})});t7.displayName=`CarouselItem`;var n7=u.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollPrev:o,canScrollPrev:s}=Q5();return(0,A.jsxs)(W,{ref:i,variant:t,size:n,className:H(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-left-12 top-1/2 -translate-y-1/2`:`-top-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!s,onClick:o,...r,children:[(0,A.jsx)(Vt,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Previous slide`})]})});n7.displayName=`CarouselPrevious`;var r7=u.forwardRef(({className:e,variant:t=`outline`,size:n=`icon`,...r},i)=>{let{orientation:a,scrollNext:o,canScrollNext:s}=Q5();return(0,A.jsxs)(W,{ref:i,variant:t,size:n,className:H(`absolute h-8 w-8 rounded-full`,a===`horizontal`?`-right-12 top-1/2 -translate-y-1/2`:`-bottom-12 left-1/2 -translate-x-1/2 rotate-90`,e),disabled:!s,onClick:o,...r,children:[(0,A.jsx)(Ht,{className:`h-4 w-4`}),(0,A.jsx)(`span`,{className:`sr-only`,children:`Next slide`})]})});r7.displayName=`CarouselNext`;var i7=`Popover`,[a7,_Se]=M(i7,[nc]),o7=nc(),[vSe,s7]=a7(i7),c7=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=o7(t),c=u.useRef(null),[l,d]=u.useState(!1),[f,p]=ke({prop:r,defaultProp:i??!1,onChange:a,caller:i7});return(0,A.jsx)(vc,{...s,children:(0,A.jsx)(vSe,{scope:t,contentId:Ia(),triggerRef:c,open:f,onOpenChange:p,onOpenToggle:u.useCallback(()=>p(e=>!e),[p]),hasCustomAnchor:l,onCustomAnchorAdd:u.useCallback(()=>d(!0),[]),onCustomAnchorRemove:u.useCallback(()=>d(!1),[]),modal:o,children:n})})};c7.displayName=i7;var l7=`PopoverAnchor`,ySe=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=s7(l7,n),a=o7(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return u.useEffect(()=>(o(),()=>s()),[o,s]),(0,A.jsx)(yc,{...a,...r,ref:t})});ySe.displayName=l7;var u7=`PopoverTrigger`,d7=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=s7(u7,n),a=o7(n),o=D(t,i.triggerRef),s=(0,A.jsx)(z.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":v7(i.open),...r,ref:o,onClick:w(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,A.jsx)(yc,{asChild:!0,...a,children:s})});d7.displayName=u7;var f7=`PopoverPortal`,[bSe,xSe]=a7(f7,{forceMount:void 0}),p7=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=s7(f7,t);return(0,A.jsx)(bSe,{scope:t,forceMount:n,children:(0,A.jsx)(we,{present:n||a.open,children:(0,A.jsx)(Se,{asChild:!0,container:i,children:r})})})};p7.displayName=f7;var m7=`PopoverContent`,h7=u.forwardRef((e,t)=>{let n=xSe(m7,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=s7(m7,e.__scopePopover);return(0,A.jsx)(we,{present:r||a.open,children:a.modal?(0,A.jsx)(CSe,{...i,ref:t}):(0,A.jsx)(wSe,{...i,ref:t})})});h7.displayName=m7;var SSe=P(`PopoverContent.RemoveScroll`),CSe=u.forwardRef((e,t)=>{let n=s7(m7,e.__scopePopover),r=u.useRef(null),i=D(t,r),a=u.useRef(!1);return u.useEffect(()=>{let e=r.current;if(e)return nm(e)},[]),(0,A.jsx)(Xp,{as:SSe,allowPinchZoom:!0,children:(0,A.jsx)(g7,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:w(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:w(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:w(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),wSe=u.forwardRef((e,t)=>{let n=s7(m7,e.__scopePopover),r=u.useRef(!1),i=u.useRef(!1);return(0,A.jsx)(g7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),g7=u.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=s7(m7,n),p=o7(n);return Sp(),(0,A.jsx)(up,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,A.jsx)(de,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),children:(0,A.jsx)(bc,{"data-state":v7(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.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)`}})})})}),_7=`PopoverClose`,TSe=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=s7(_7,n);return(0,A.jsx)(z.button,{type:`button`,...r,ref:t,onClick:w(e.onClick,()=>i.onOpenChange(!1))})});TSe.displayName=_7;var ESe=`PopoverArrow`,DSe=u.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=o7(n);return(0,A.jsx)(U,{...i,...r,ref:t})});DSe.displayName=ESe;function v7(e){return e?`open`:`closed`}var OSe=c7,kSe=d7,ASe=p7,y7=h7,jSe=OSe,MSe=kSe,b7=u.forwardRef(({className:e,align:t=`center`,sideOffset:n=4,...r},i)=>(0,A.jsx)(ASe,{children:(0,A.jsx)(y7,{ref:i,align:t,sideOffset:n,className:H(`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})}));b7.displayName=y7.displayName;function NSe(e){return(0,A.jsxs)(HQ,{variant:e.variant||`default`,className:e.className,children:[e.title&&(0,A.jsx)(UQ,{children:String(e.title)}),e.description&&(0,A.jsx)(WQ,{children:String(e.description)}),e.children&&(0,A.jsx)(`div`,{children:String(e.children)})]})}function PSe(e){let t=e.id,n=e.onInteraction;return(0,A.jsx)(W,{variant:e.variant,size:e.size,disabled:e.disabled,className:e.className,onClick:()=>n?.(t,`click`,{label:e.label}),children:e.label||e.children})}function FSe(e){return(0,A.jsx)(Hz,{variant:e.variant||`default`,className:e.className,children:String(e.children||e.label||``)})}function ISe(e){return(0,A.jsxs)(zR,{className:e.className||`bg-background/60 backdrop-blur-md border-primary/20`,children:[e.title&&(0,A.jsxs)(BR,{children:[(0,A.jsx)(VR,{children:e.title}),e.description&&(0,A.jsx)(HR,{children:e.description})]}),(0,A.jsx)(UR,{children:e.children?(0,A.jsx)(`div`,{children:String(e.children)}):null}),e.footer&&(0,A.jsx)(WR,{children:(0,A.jsx)(`div`,{children:String(e.footer)})})]})}function LSe(e){return(0,A.jsx)(G,{type:e.type,placeholder:e.placeholder,value:e.value,disabled:e.disabled,className:e.className})}function RSe(e){return(0,A.jsx)(Z,{htmlFor:e.htmlFor,className:e.className,children:String(e.children||e.label||``)})}function zSe(e){return(0,A.jsx)(uG,{placeholder:e.placeholder,value:e.value,disabled:e.disabled,className:e.className,rows:e.rows})}function BSe(e){return(0,A.jsx)(n$,{checked:e.checked,disabled:e.disabled})}function VSe(e){return(0,A.jsx)(sq,{checked:e.checked,disabled:e.disabled})}function HSe(e){return(0,A.jsx)(y$,{value:e.value,children:e.options?.map(e=>(0,A.jsxs)(`div`,{className:`flex items-center space-x-2`,children:[(0,A.jsx)(b$,{value:e.value}),(0,A.jsx)(Z,{children:e.label})]},e.value))})}function USe(e){return(0,A.jsxs)(BK,{value:e.value,children:[(0,A.jsx)(UK,{className:e.className,children:(0,A.jsx)(HK,{placeholder:e.placeholder})}),(0,A.jsx)(KK,{children:e.options?.map(e=>(0,A.jsx)(Q,{value:e.value,children:e.label},e.value))})]})}function WSe(e){return(0,A.jsx)(H$,{value:e.value||[50],min:e.min,max:e.max,step:e.step})}function GSe(e){return(0,A.jsx)(cB,{value:e.value,className:e.className})}function KSe(e){return(0,A.jsxs)(zR,{className:`border-primary/10 bg-background/40`,children:[e.title&&(0,A.jsx)(BR,{children:(0,A.jsx)(VR,{className:`text-md font-semibold`,children:e.title})}),(0,A.jsx)(UR,{className:`p-0`,children:(0,A.jsxs)(U$,{children:[(0,A.jsx)(W$,{children:(0,A.jsx)(K$,{className:`bg-muted/50`,children:e.columns?.map(e=>(0,A.jsx)(q$,{className:`font-bold text-primary`,children:e.header},e.key))})}),(0,A.jsx)(G$,{children:e.data?.map((t,n)=>(0,A.jsx)(K$,{className:`hover:bg-primary/5 transition-colors`,children:e.columns?.map((e,n)=>(0,A.jsx)(J$,{className:`text-sm`,children:String(t[e.key])},n))},n))})]})})]})}function qSe(e){let t=e.tabs||[],n=t[0]?.value;return(0,A.jsxs)(ige,{defaultValue:e.defaultValue||n,children:[(0,A.jsx)(u1,{children:t.map(e=>(0,A.jsx)(d1,{value:e.value,children:e.label},e.value))}),t.map(e=>(0,A.jsx)(f1,{value:e.value,children:e.content?(0,A.jsx)(`div`,{className:`prose prose-invert max-w-none text-sm`,children:(0,A.jsx)(VQ,{children:String(e.content)})}):null},e.value))]})}function JSe(e){return(0,A.jsxs)(T1,{className:e.className,children:[e.src&&(0,A.jsx)(E1,{src:e.src}),(0,A.jsx)(D1,{children:e.fallback})]})}function YSe(e){return(0,A.jsx)(ap,{orientation:e.orientation,className:e.className})}function XSe(e){return(0,A.jsx)(Jm,{className:e.className})}function ZSe(e){return(0,A.jsx)(AJ,{className:e.className,style:{height:e.height},children:e.children?(0,A.jsx)(`div`,{children:String(e.children)}):null})}function QSe(e){return(0,A.jsx)(al,{children:(0,A.jsxs)(ol,{children:[(0,A.jsx)(sl,{asChild:!0,children:(0,A.jsx)(`span`,{children:String(e.children||e.trigger||`Hover`)})}),(0,A.jsx)(cl,{children:String(e.content||``)})]})})}function $Se(e){let[t,n]=(0,u.useState)(!0);return(0,A.jsxs)(cq,{open:t,onOpenChange:n,children:[e.trigger&&(0,A.jsx)(lq,{asChild:!0,children:(0,A.jsx)(W,{variant:`outline`,children:String(e.trigger)})}),(0,A.jsxs)(pq,{children:[(0,A.jsxs)(mq,{children:[(0,A.jsx)(gq,{children:String(e.title||``)}),e.description&&(0,A.jsx)(_q,{children:String(e.description)})]}),e.children&&(0,A.jsx)(`div`,{className:`py-2`,children:String(e.children)})]})]})}function eCe(e){let[t,n]=(0,u.useState)(!0);return(0,A.jsxs)(c0,{open:t,onOpenChange:n,children:[e.trigger&&(0,A.jsx)(Lge,{asChild:!0,children:(0,A.jsx)(W,{variant:`outline`,children:String(e.trigger)})}),(0,A.jsxs)(u0,{children:[(0,A.jsxs)(d0,{children:[(0,A.jsx)(f0,{children:String(e.title||``)}),e.description&&(0,A.jsx)(p0,{children:String(e.description)})]}),e.children&&(0,A.jsx)(`div`,{className:`px-4 pb-4`,children:String(e.children)})]})]})}function tCe(e){let[t,n]=(0,u.useState)(!0);return(0,A.jsxs)(Bm,{open:t,onOpenChange:n,children:[e.trigger&&(0,A.jsx)(Yte,{asChild:!0,children:(0,A.jsx)(W,{variant:`outline`,children:String(e.trigger)})}),(0,A.jsxs)(Um,{side:e.side,children:[(0,A.jsxs)(Wm,{children:[(0,A.jsx)(Km,{children:String(e.title||``)}),e.description&&(0,A.jsx)(qm,{children:String(e.description)})]}),e.children&&(0,A.jsx)(`div`,{className:`py-2`,children:String(e.children)})]})]})}function nCe(e){return(0,A.jsxs)(dU,{children:[(0,A.jsx)(fU,{asChild:!0,children:(0,A.jsx)(W,{variant:`outline`,children:String(e.trigger||`Open Menu`)})}),(0,A.jsxs)(hU,{children:[e.label&&(0,A.jsx)(yU,{children:String(e.label)}),e.items?.map((e,t)=>e.separator?(0,A.jsx)(bU,{},t):(0,A.jsx)(gU,{children:e.label},t))]})]})}function rCe(e){return(0,A.jsxs)(z0,{children:[(0,A.jsx)(B0,{placeholder:e.placeholder||`Search...`}),(0,A.jsxs)(V0,{children:[(0,A.jsx)(H0,{children:String(e.empty||`No results found.`)}),e.items?.map((e,t)=>(0,A.jsx)(U0,{heading:e.label,children:e.items?.map((e,t)=>(0,A.jsx)(W0,{children:e.label},t))},t))]})]})}function iCe(e){return(0,A.jsxs)(P_e,{children:[(0,A.jsx)(F_e,{className:`flex h-16 w-full items-center justify-center rounded-md border border-dashed text-sm`,children:String(e.trigger||`Right click here`)}),(0,A.jsxs)(y2,{children:[e.label&&(0,A.jsx)(x2,{children:String(e.label)}),e.items?.map((e,t)=>e.separator?(0,A.jsx)(S2,{},t):(0,A.jsx)(b2,{children:e.label},t))]})]})}function aCe(e){return(0,A.jsx)(i4,{children:e.menus?.map((e,t)=>(0,A.jsxs)(dve,{children:[(0,A.jsx)(a4,{children:e.label}),(0,A.jsx)(o4,{children:e.items?.map((e,t)=>e.separator?(0,A.jsx)(c4,{},t):(0,A.jsxs)(s4,{children:[e.label,e.shortcut&&(0,A.jsx)(l4,{children:e.shortcut})]},t))})]},t))})}function oCe(e){return(0,A.jsx)(Q4,{children:(0,A.jsx)($4,{children:e.items?.map((e,t)=>e.content?(0,A.jsxs)(e3,{children:[(0,A.jsx)(t3,{children:e.label}),(0,A.jsx)(n3,{children:(0,A.jsx)(`div`,{className:`p-4 w-48`,children:String(e.content)})})]},t):(0,A.jsx)(e3,{children:(0,A.jsx)(Ive,{href:e.href||`#`,className:`px-3 py-2 text-sm font-medium`,children:e.label})},t))})})}function sCe(e){return(0,A.jsx)(T3,{type:e.type||`single`,collapsible:e.collapsible!==!1,children:e.items?.map(e=>(0,A.jsxs)(E3,{value:e.value,children:[(0,A.jsx)(D3,{children:e.title}),(0,A.jsx)(O3,{children:e.content?(0,A.jsx)(`div`,{className:`prose prose-invert max-w-none text-sm`,children:(0,A.jsx)(VQ,{children:String(e.content)})}):null})]},e.value))})}function cCe(e){let[t,n]=(0,u.useState)(e.open!==!1);return(0,A.jsxs)(Vh,{open:t,onOpenChange:n,children:[(0,A.jsx)(Hh,{asChild:!0,children:(0,A.jsxs)(W,{variant:`ghost`,className:`w-full justify-between`,children:[String(e.trigger||`Toggle`),(0,A.jsx)(`span`,{children:t?`▲`:`▼`})]})}),(0,A.jsx)(Uh,{className:`pt-2`,children:e.children?(0,A.jsx)(`div`,{className:`prose prose-invert max-w-none text-sm px-2`,children:(0,A.jsx)(VQ,{children:String(e.children)})}):null})]})}function lCe(e){return(0,A.jsx)(Dye,{direction:e.direction||`horizontal`,className:`min-h-32 rounded-lg border`,children:e.panels?.map((e,t,n)=>(0,A.jsxs)(u.Fragment,{children:[(0,A.jsx)(Oye,{defaultSize:e.size,children:(0,A.jsx)(`div`,{className:`flex h-full items-center justify-center p-3 text-sm`,children:String(e.content||``)})}),t<n.length-1&&(0,A.jsx)(kye,{})]},t))})}function uCe(e){return(0,A.jsx)(B6,{children:(0,A.jsx)(V6,{children:e.items?.map((t,n)=>(0,A.jsxs)(u.Fragment,{children:[(0,A.jsx)(H6,{children:t.href?(0,A.jsx)(U6,{href:t.href,children:t.label}):(0,A.jsx)(W6,{children:t.label})}),n<e.items.length-1&&(0,A.jsx)(G6,{})]},`${t.label}-${t.href??``}`))})})}function dCe(e){return(0,A.jsx)(K6,{children:(0,A.jsxs)(q6,{children:[(0,A.jsx)(J6,{children:(0,A.jsx)(X6,{href:`#`})}),e.items?.map(e=>(0,A.jsx)(J6,{children:(0,A.jsx)(Y6,{href:`#`,isActive:e.active,children:e.label})},e.value)),(0,A.jsx)(J6,{children:(0,A.jsx)(Z6,{href:`#`})})]})})}function fCe(e){return(0,A.jsx)(n8,{pressed:e.pressed,children:String(e.children||e.label||`Toggle`)})}function pCe(e){return(0,A.jsx)(g8,{type:`single`,value:String(e.value||``),children:e.items?.map(e=>(0,A.jsx)(_8,{value:e.value,children:e.label},e.value))})}function mCe(e){return(0,A.jsx)($8,{mode:e.mode,disabled:e.disabled})}function hCe(e){return(0,A.jsx)(lxe,{ratio:e.ratio||16/9,className:e.className,children:e.src?(0,A.jsx)(`img`,{src:e.src,alt:e.alt||``,className:`w-full h-full object-cover rounded-md`}):e.children?(0,A.jsx)(`div`,{className:`flex items-center justify-center w-full h-full`,children:String(e.children)}):null})}function gCe(e){return(0,A.jsxs)(xxe,{children:[(0,A.jsx)(Sxe,{asChild:!0,children:(0,A.jsx)(`span`,{className:`cursor-pointer underline decoration-dotted`,children:String(e.children||e.trigger||`Hover me`)})}),(0,A.jsx)(m5,{children:String(e.content||``)})]})}function _Ce(e){let t=e.maxLength||6;return(0,A.jsx)(C5,{maxLength:t,value:e.value,children:(0,A.jsx)(w5,{children:Array.from({length:t}).map((e,t)=>(0,A.jsx)(T5,{index:t},t))})})}function vCe(e){return(0,A.jsx)(`div`,{className:`prose prose-invert max-w-none p-4 bg-background/40 rounded-xl border`,children:(0,A.jsx)(VQ,{children:e.content})})}function yCe(e){let[t,n]=(0,u.useState)(!0),r=e.id,i=e.onInteraction;return(0,A.jsx)(jz,{open:t,onOpenChange:n,children:(0,A.jsxs)(Pz,{children:[(0,A.jsxs)(Fz,{children:[(0,A.jsx)(Lz,{children:String(e.title||`Are you sure?`)}),e.description&&(0,A.jsx)(Rz,{children:String(e.description)})]}),(0,A.jsxs)(Iz,{children:[(0,A.jsx)(Bz,{onClick:()=>{n(!1),i?.(r,`cancel`,{confirmed:!1})},children:String(e.cancelLabel||`Cancel`)}),(0,A.jsx)(zz,{onClick:()=>{n(!1),i?.(r,`confirm`,{confirmed:!0})},children:String(e.actionLabel||e.confirmLabel||`Continue`)})]})]})})}function bCe(e){let t=e.items||[];return(0,A.jsxs)($5,{orientation:e.orientation||`horizontal`,className:`w-full max-w-sm mx-auto`,children:[(0,A.jsx)(e7,{children:t.map((e,t)=>(0,A.jsx)(t7,{children:(0,A.jsx)(zR,{children:(0,A.jsxs)(UR,{className:`flex flex-col items-center justify-center p-6 gap-2`,children:[e.image&&(0,A.jsx)(`img`,{src:e.image,alt:e.title||``,className:`max-h-32 object-contain rounded`}),e.title&&(0,A.jsx)(`p`,{className:`font-semibold text-sm`,children:e.title}),e.content&&(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground text-center`,children:e.content})]})})},t))}),(0,A.jsx)(n7,{}),(0,A.jsx)(r7,{})]})}var xCe=[`hsl(var(--primary))`,`#22c55e`,`#f59e0b`,`#ef4444`,`#8b5cf6`,`#06b6d4`];function SCe(e){let t=e.type||`bar`,n=e.data||[],r=e.xKey||`name`,i=e.keys||[],a=e.colors||xCe,o=t===`bar`?(0,A.jsxs)(vR,{data:n,children:[(0,A.jsx)(PI,{strokeDasharray:`3 3`,opacity:.3}),(0,A.jsx)(gL,{dataKey:r,tick:{fontSize:11}}),(0,A.jsx)(TL,{tick:{fontSize:11}}),(0,A.jsx)(mS,{}),i.length>1&&(0,A.jsx)(px,{}),i.map((e,t)=>(0,A.jsx)(aF,{dataKey:e,fill:a[t%a.length],radius:[4,4,0,0]},e))]}):t===`line`?(0,A.jsxs)(_R,{data:n,children:[(0,A.jsx)(PI,{strokeDasharray:`3 3`,opacity:.3}),(0,A.jsx)(gL,{dataKey:r,tick:{fontSize:11}}),(0,A.jsx)(TL,{tick:{fontSize:11}}),(0,A.jsx)(mS,{}),i.length>1&&(0,A.jsx)(px,{}),i.map((e,t)=>(0,A.jsx)(JI,{type:`monotone`,dataKey:e,stroke:a[t%a.length],strokeWidth:2,dot:{r:4}},e))]}):t===`area`?(0,A.jsxs)(bR,{data:n,children:[(0,A.jsx)(PI,{strokeDasharray:`3 3`,opacity:.3}),(0,A.jsx)(gL,{dataKey:r,tick:{fontSize:11}}),(0,A.jsx)(TL,{tick:{fontSize:11}}),(0,A.jsx)(mS,{}),i.length>1&&(0,A.jsx)(px,{}),i.map((e,t)=>(0,A.jsx)(sL,{type:`monotone`,dataKey:e,stroke:a[t%a.length],fill:a[t%a.length],fillOpacity:.2,strokeWidth:2},e))]}):t===`pie`?(0,A.jsxs)(yR,{children:[(0,A.jsx)(CP,{data:n,dataKey:i[0]||`value`,nameKey:r,cx:`50%`,cy:`50%`,outerRadius:80,label:!0,children:n.map((e,t)=>(0,A.jsx)(SS,{fill:a[t%a.length]},t))}),(0,A.jsx)(mS,{}),(0,A.jsx)(px,{})]}):null;return(0,A.jsxs)(zR,{className:`bg-background/60 border-primary/20`,children:[e.title&&(0,A.jsx)(BR,{className:`pb-2`,children:(0,A.jsx)(VR,{className:`text-sm font-semibold`,children:String(e.title)})}),(0,A.jsx)(UR,{className:`pt-0`,children:(0,A.jsx)(xS,{width:`100%`,height:260,children:o||(0,A.jsx)(vR,{data:[]})})})]})}function CCe(e){let t=e.id,n=e.onInteraction,r=e.fields||[],[i,a]=(0,u.useState)({}),o=(e,t)=>{a(n=>({...n,[e]:t}))};return(0,A.jsxs)(zR,{className:`bg-background/60 border-primary/20`,children:[e.title&&(0,A.jsx)(BR,{children:(0,A.jsx)(VR,{className:`text-sm font-semibold`,children:String(e.title)})}),(0,A.jsx)(UR,{className:`space-y-4`,children:r.map(e=>(0,A.jsxs)(`div`,{className:`space-y-1`,children:[e.type!==`checkbox`&&(0,A.jsx)(Z,{htmlFor:e.name,children:e.label}),e.type===`textarea`?(0,A.jsx)(uG,{id:e.name,placeholder:e.placeholder,value:i[e.name]||``,onChange:t=>o(e.name,t.target.value)}):e.type===`select`?(0,A.jsxs)(BK,{value:i[e.name]||``,onValueChange:t=>o(e.name,t),children:[(0,A.jsx)(UK,{id:e.name,children:(0,A.jsx)(HK,{placeholder:e.placeholder||`Select ${e.label}`})}),(0,A.jsx)(KK,{children:e.options?.map(e=>(0,A.jsx)(Q,{value:e.value,children:e.label},e.value))})]}):e.type===`checkbox`?(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(n$,{id:e.name,checked:i[e.name]||!1,onCheckedChange:t=>o(e.name,t)}),(0,A.jsx)(Z,{htmlFor:e.name,children:e.label})]}):(0,A.jsx)(G,{id:e.name,type:e.type,placeholder:e.placeholder,value:i[e.name]||``,onChange:t=>o(e.name,t.target.value)})]},e.name))}),(0,A.jsx)(WR,{children:(0,A.jsx)(W,{className:`w-full`,onClick:()=>n?.(t,`submit`,i),children:String(e.submitLabel||`Submit`)})})]})}function wCe(e){let[t,n]=(0,u.useState)(!0);return(0,A.jsxs)(jSe,{open:t,onOpenChange:n,children:[(0,A.jsx)(MSe,{asChild:!0,children:(0,A.jsx)(W,{variant:`outline`,children:String(e.triggerLabel||`Open`)})}),(0,A.jsx)(b7,{className:`w-64`,children:e.content?(0,A.jsx)(`div`,{className:`prose prose-invert max-w-none text-sm`,children:(0,A.jsx)(VQ,{children:String(e.content)})}):null})]})}function TCe(e){return(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 py-6`,children:[(0,A.jsx)(`div`,{className:`animate-bounce`,children:(0,A.jsxs)(`svg`,{width:`48`,height:`48`,viewBox:`0 0 48 48`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:[(0,A.jsx)(`ellipse`,{cx:`24`,cy:`28`,rx:`12`,ry:`10`,fill:`#F59E0B`}),(0,A.jsx)(`rect`,{x:`14`,y:`26`,width:`20`,height:`3`,rx:`1`,fill:`#1C1917`,opacity:`0.6`}),(0,A.jsx)(`rect`,{x:`14`,y:`31`,width:`20`,height:`3`,rx:`1`,fill:`#1C1917`,opacity:`0.6`}),(0,A.jsx)(`ellipse`,{cx:`24`,cy:`18`,rx:`7`,ry:`7`,fill:`#F59E0B`}),(0,A.jsx)(`circle`,{cx:`21`,cy:`17`,r:`1.5`,fill:`#1C1917`}),(0,A.jsx)(`circle`,{cx:`27`,cy:`17`,r:`1.5`,fill:`#1C1917`}),(0,A.jsx)(`line`,{x1:`22`,y1:`11`,x2:`18`,y2:`7`,stroke:`#1C1917`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,A.jsx)(`line`,{x1:`26`,y1:`11`,x2:`30`,y2:`7`,stroke:`#1C1917`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,A.jsx)(`circle`,{cx:`18`,cy:`7`,r:`1.5`,fill:`#1C1917`}),(0,A.jsx)(`circle`,{cx:`30`,cy:`7`,r:`1.5`,fill:`#1C1917`}),(0,A.jsx)(`ellipse`,{cx:`14`,cy:`22`,rx:`7`,ry:`4`,fill:`white`,opacity:`0.7`,transform:`rotate(-20 14 22)`}),(0,A.jsx)(`ellipse`,{cx:`34`,cy:`22`,rx:`7`,ry:`4`,fill:`white`,opacity:`0.7`,transform:`rotate(20 34 22)`}),(0,A.jsx)(`path`,{d:`M24 38 L21 44 L24 42 L27 44 Z`,fill:`#F59E0B`})]})}),e.message&&(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground animate-pulse`,children:String(e.message)})]})}function x7(e){return(0,A.jsxs)(`div`,{className:`rounded-lg border bg-muted/20 p-4`,children:[(0,A.jsx)(`div`,{className:`mb-2 text-[10px] font-bold uppercase text-muted-foreground`,children:`JSON Data`}),(0,A.jsx)(`pre`,{className:`overflow-auto text-[10px] text-muted-foreground/80`,children:JSON.stringify(e,null,2)})]})}var ECe={alert:NSe,"alert-dialog":yCe,button:PSe,badge:FSe,card:ISe,carousel:bCe,chart:SCe,input:LSe,label:RSe,textarea:zSe,checkbox:BSe,switch:VSe,"radio-group":HSe,select:USe,slider:WSe,progress:GSe,table:KSe,tabs:qSe,avatar:JSe,separator:YSe,skeleton:XSe,"scroll-area":ZSe,tooltip:QSe,dialog:$Se,drawer:eCe,sheet:tCe,"dropdown-menu":nCe,command:rCe,"context-menu":iCe,menubar:aCe,"navigation-menu":oCe,accordion:sCe,collapsible:cCe,resizable:lCe,breadcrumb:uCe,pagination:dCe,toggle:fCe,"toggle-group":pCe,calendar:mCe,"aspect-ratio":hCe,"hover-card":gCe,"input-otp":_Ce,form:CCe,popover:wCe,"bee-loader":TCe,markdown:vCe,custom:x7};function DCe(e){return ECe[e]||x7}var OCe=({renderFn:e,...t})=>(0,A.jsx)(A.Fragment,{children:e(t)}),kCe=({component:e,onInteraction:t})=>{let{type:n,props:r,id:i}=e,a=DCe(n);return(0,A.jsx)(`div`,{"data-canvas-type":n,"data-canvas-id":i,children:(0,A.jsx)(OCe,{renderFn:a,...r,id:i,onInteraction:t})})},S7=i((e,t)=>({components:[],selectedComponentId:null,isConnected:!1,graphNodes:[],graphEdges:[],zoomLevel:1,panX:0,panY:0,setComponents:t=>e({components:t}),addComponent:t=>e(e=>({components:[...e.components,t]})),removeComponent:t=>e(e=>({components:e.components.filter(e=>e.id!==t)})),selectComponent:t=>e({selectedComponentId:t}),setIsConnected:t=>e({isConnected:t}),setGraphSnapshot:(t,n)=>e({graphNodes:t,graphEdges:n}),addGraphNode:t=>e(e=>e.graphNodes.find(e=>e.id===t.id)?{graphNodes:e.graphNodes.map(e=>e.id===t.id?t:e)}:{graphNodes:[...e.graphNodes,t]}),updateGraphNode:(t,n)=>e(e=>({graphNodes:e.graphNodes.map(e=>e.id===t?{...e,...n}:e)})),removeGraphNode:t=>e(e=>({graphNodes:e.graphNodes.filter(e=>e.id!==t),graphEdges:e.graphEdges.filter(e=>e.source!==t&&e.target!==t)})),addGraphEdge:t=>e(e=>e.graphEdges.find(e=>e.id===t.id)?e:{graphEdges:[...e.graphEdges,t]}),setZoomLevel:t=>e({zoomLevel:Math.max(.25,Math.min(2,t))}),zoomIn:()=>e(e=>({zoomLevel:Math.max(.25,Math.min(2,e.zoomLevel+.25))})),zoomOut:()=>e(e=>({zoomLevel:Math.max(.25,Math.min(2,e.zoomLevel-.25))})),resetView:()=>e({zoomLevel:1,panX:0,panY:0}),setPan:(t,n)=>e({panX:t,panY:n}),init:()=>{let n=yh.getState();e({isConnected:n.status===`connected`}),n.status===`connected`&&n.send({type:`canvas_subscribe`});let r=[yh.subscribe(t=>{e({isConnected:t.status===`connected`})}),n.subscribe(`canvas:snapshot`,t=>{let n=t.data;if(n&&Array.isArray(n.nodes)&&Array.isArray(n.edges)){let t={graphNodes:n.nodes,graphEdges:n.edges};Array.isArray(n.components)&&(t.components=n.components),e(t)}}),n.subscribe(`canvas:node_add`,e=>{let n=e.data;if(n?.id){let e=n.data??{},r={id:n.id,type:n.type,name:n.label??n.name??n.id,status:e.status??n.status??`pending`,data:e};t().addGraphNode(r)}}),n.subscribe(`canvas:node_update`,e=>{let n=e.data,r=n?.id??n?.nodeId;if(r){let e=n.data??n.changes??{},i={};e.status&&(i.status=e.status),i.data={...t().graphNodes.find(e=>e.id===r)?.data??{},...e},t().updateGraphNode(r,i)}}),n.subscribe(`canvas:node_remove`,e=>{let n=e.data;n?.id&&t().removeGraphNode(n.id)}),n.subscribe(`canvas:edge_add`,e=>{let n=e.data;n?.id&&t().addGraphEdge(n)}),n.subscribe(`canvas:render`,t=>{let n=t.data?.component??t.component;n&&e(e=>e.components.find(e=>e.id===n.id)?{components:e.components.map(e=>e.id===n.id?n:e)}:{components:[...e.components,n]})}),n.subscribe(`canvas:clear`,()=>e({components:[]})),n.subscribe(`canvas:ask`,t=>{let n=t.data??{},r={id:n.id||`ask_${Date.now()}`,type:`form`,props:{question:n.question,fields:n.fields??[],raw:n},position:{x:0,y:0},size:{width:400,height:300},agentId:n.agentId||``};e(e=>e.components.find(e=>e.id===r.id)?{components:e.components.map(e=>e.id===r.id?r:e)}:{components:[...e.components,r]})}),n.subscribe(`canvas:confirm`,t=>{let n=t.data??{},r={id:n.id||`confirm_${Date.now()}`,type:`alert-dialog`,props:{message:n.message,confirmLabel:n.confirmLabel??`Confirmar`,cancelLabel:n.cancelLabel??`Cancelar`,raw:n},position:{x:0,y:0},size:{width:400,height:200},agentId:n.agentId||``};e(e=>e.components.find(e=>e.id===r.id)?{components:e.components.map(e=>e.id===r.id?r:e)}:{components:[...e.components,r]})})];return()=>r.forEach(e=>e())},sendMessage:e=>{yh.getState().send(e)}})),ACe={active:`Activo`,pending:`Pendiente`,in_progress:`En progreso`,paused:`Pausado`,idle:`Disponible`,completed:`Completado`,done:`Completado`,failed:`Fallido`,blocked:`Bloqueado`,running:`Ejecutando`,thinking:`Pensando`,tool_call:`Usando Herramienta`};function jCe({status:e}){switch(e){case`completed`:return(0,A.jsx)(sn,{className:`h-3.5 w-3.5 text-green-400`});case`in_progress`:return(0,A.jsx)(Yn,{className:`h-3.5 w-3.5 text-yellow-400 animate-spin`});case`failed`:return(0,A.jsx)(un,{className:`h-3.5 w-3.5 text-red-400`});case`blocked`:return(0,A.jsx)(cn,{className:`h-3.5 w-3.5 text-orange-400`});default:return(0,A.jsx)(dn,{className:`h-3.5 w-3.5 text-muted-foreground`})}}function MCe({node:e}){let t=e.data?.currentTool??null,n=e.status===`thinking`,r=e.status===`tool_call`,i=n||r,a=e.data?.role===`coordinator`;return(0,A.jsxs)(`div`,{className:`relative group w-64 rounded-xl p-5 flex flex-col gap-3 transition-all duration-300
242
+ bg-[rgba(255,255,255,0.03)] backdrop-blur-xl border
243
+ ${n?`border-purple-500/40 shadow-[0_0_20px_rgba(168,85,247,0.25)]`:a?`border-purple-500/20 shadow-[0_0_16px_rgba(168,85,247,0.1)] hover:border-purple-500/40`:`border-white/[0.08] hover:border-blue-500/30 hover:shadow-[0_0_15px_rgba(59,130,246,0.12)]`}
244
+ `,children:[(0,A.jsxs)(`div`,{className:`flex justify-between items-start`,children:[(0,A.jsx)(`div`,{className:`p-2.5 rounded-lg ${a?`bg-purple-500/10`:`bg-blue-500/10`}`,children:a?(0,A.jsx)(Tr,{className:`h-6 w-6 text-purple-400`}):(0,A.jsx)(qt,{className:`h-6 w-6 text-blue-400 ${i?`animate-pulse`:``}`})}),(0,A.jsx)(`span`,{className:`text-[9px] px-2 py-0.5 rounded-full font-bold uppercase border
245
+ ${a?`bg-purple-500/10 text-purple-400 border-purple-500/20`:`bg-blue-500/10 text-blue-400 border-blue-500/20`}`,children:a?`Coordinador`:`Worker`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`font-bold text-white text-base leading-tight truncate`,children:e.name}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 mt-1.5`,children:[n?(0,A.jsxs)(`div`,{className:`flex gap-0.5`,children:[(0,A.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-purple-400 animate-bounce`}),(0,A.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-purple-400 animate-bounce [animation-delay:-0.15s]`}),(0,A.jsx)(`span`,{className:`w-1 h-1 rounded-full bg-purple-400 animate-bounce [animation-delay:-0.3s]`})]}):(0,A.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full shrink-0 ${e.status===`active`||e.status===`running`?`bg-green-400`:e.status===`idle`?`bg-emerald-400`:e.status===`tool_call`?`bg-cyan-400`:e.status===`error`?`bg-red-400`:`bg-gray-500`}`}),(0,A.jsx)(`span`,{className:`text-[10px] text-white/50 font-medium uppercase tracking-widest`,children:ACe[e.status]??e.status})]})]}),(r||n)&&t&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 bg-cyan-500/5 border border-cyan-500/10 rounded-md px-2 py-1`,children:[(0,A.jsx)(Mr,{className:`h-3 w-3 text-cyan-400/70 shrink-0`}),(0,A.jsxs)(`span`,{className:`text-[9px] font-mono text-cyan-400/80 truncate`,children:[`⚙ `,t]})]}),e.data?.model&&(0,A.jsxs)(`div`,{className:`absolute -top-[72px] left-1/2 -translate-x-1/2 w-44 p-3 bg-[#1c1b1d] border border-white/10 rounded-lg shadow-2xl opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none z-50`,children:[(0,A.jsxs)(`div`,{className:`text-[10px] text-white/50 flex justify-between mb-1`,children:[`Modelo: `,(0,A.jsx)(`span`,{className:`text-white font-mono text-[9px]`,children:e.data.model})]}),e.data?.tools!=null&&(0,A.jsxs)(`div`,{className:`text-[10px] text-white/50 flex justify-between`,children:[`Tools: `,(0,A.jsx)(`span`,{className:`text-white`,children:e.data.tools})]}),(0,A.jsx)(`div`,{className:`absolute bottom-[-5px] left-1/2 -translate-x-1/2 w-2.5 h-2.5 bg-[#1c1b1d] border-r border-b border-white/10 rotate-45`})]})]})}function NCe({node:e}){return(0,A.jsxs)(`div`,{className:`w-48 p-3 rounded-xl flex items-center gap-3 bg-[rgba(255,255,255,0.03)] backdrop-blur-xl border border-teal-500/20 hover:border-teal-500/40 transition-all duration-300`,children:[(0,A.jsx)(`div`,{className:`p-1.5 bg-teal-500/10 rounded-lg shrink-0`,children:(0,A.jsx)(yr,{className:`h-4 w-4 text-teal-400`})}),(0,A.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,A.jsx)(`div`,{className:`text-[9px] text-teal-400 font-bold uppercase tracking-tight`,children:`MCP Server`}),(0,A.jsx)(`div`,{className:`text-sm font-bold text-white truncate`,children:e.name})]}),(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full shrink-0 ${e.status===`connected`||e.status===`active`?`bg-teal-400`:`bg-gray-500`}`})]})}function PCe({node:e,tasks:t}){let[n,r]=(0,u.useState)(!0),i=e.data?.progress??0,a=e.data?.projectType??`general`;return(0,A.jsxs)(`div`,{className:`rounded-xl overflow-hidden bg-[rgba(255,255,255,0.03)] backdrop-blur-xl border border-blue-500/20 hover:border-blue-500/40 transition-all duration-300 w-72`,children:[(0,A.jsxs)(`button`,{className:`w-full flex items-center gap-3 p-4 text-left hover:bg-blue-500/5 transition-colors`,onClick:()=>r(!n),children:[(0,A.jsx)(`div`,{className:`p-1.5 bg-blue-500/10 rounded-lg shrink-0`,children:(0,A.jsx)(jn,{className:`h-4 w-4 text-blue-400`})}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`span`,{className:`text-sm font-bold text-white truncate`,children:e.name}),(0,A.jsx)(`span`,{className:`text-[9px] text-blue-400 font-bold uppercase tracking-tight shrink-0`,children:a})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5`,children:[(0,A.jsx)(cB,{value:i,className:`h-1 flex-1`}),(0,A.jsxs)(`span`,{className:`text-[10px] text-white/40 shrink-0 font-mono`,children:[i,`%`]})]})]})]}),n&&t.length>0&&(0,A.jsx)(`div`,{className:`border-t border-white/[0.06] p-3 space-y-2`,children:t.map(e=>{let t=e.data?.progress??0;return(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5 px-3 py-2 rounded-lg border ${e.status===`in_progress`?`bg-blue-500/10 border-blue-500/20`:e.status===`completed`?`bg-white/[0.03] border-white/5`:`bg-white/[0.02] border-white/5 opacity-50`}`,children:[(0,A.jsx)(jCe,{status:e.status}),(0,A.jsx)(`span`,{className:`text-[11px] flex-1 text-white/70 truncate`,children:e.name}),e.status===`in_progress`&&(0,A.jsx)(`div`,{className:`w-10 shrink-0`,children:(0,A.jsx)(cB,{value:t,className:`h-1`})}),(0,A.jsxs)(`span`,{className:`text-[10px] text-white/30 font-mono shrink-0`,children:[t,`%`]})]},e.id)})}),n&&t.length===0&&(0,A.jsx)(`div`,{className:`border-t border-white/[0.06] px-4 py-3 text-xs text-white/30`,children:`Sin tareas`})]})}function FCe({nodes:e,edges:t}){if(e.length>0){let t=e.filter(e=>e.type===`agent`).map(e=>e.id);console.log(`[Canvas] Agent node IDs:`,t)}let n=e.filter(e=>e.type===`agent`&&!e.id.startsWith(`hl-`)),r=e.filter(e=>e.type===`mcp`),i=e.filter(e=>e.type===`project`),a=e.filter(e=>e.type===`task`),o=new Map;for(let e of t)if(e.edgeType===`contains`){let t=e.source,n=e.target,r=a.find(e=>e.id===n);r&&(o.has(t)||o.set(t,[]),o.get(t).push(r))}return e.length===0?(0,A.jsxs)(`div`,{className:`hive-empty-state`,children:[(0,A.jsx)(Bt,{className:`h-10 w-10 opacity-30`}),(0,A.jsx)(`p`,{className:`text-sm mt-3`,children:`Sin agentes ni proyectos activos`})]}):(0,A.jsxs)(`div`,{className:`flex gap-6 h-full`,children:[(0,A.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-8`,children:[(0,A.jsx)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[{color:`bg-green-400`,label:`Activo`},{color:`bg-purple-400`,label:`Pensando`},{color:`bg-cyan-400`,label:`Herramienta`},{color:`bg-emerald-400`,label:`Disponible`},{color:`bg-red-400`,label:`Error`},{color:`bg-teal-400`,label:`MCP`}].map(({color:e,label:t})=>(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 bg-white/[0.03] backdrop-blur-md px-3 py-1.5 rounded-full border border-white/[0.06]`,children:[(0,A.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full ${e}`}),(0,A.jsx)(`span`,{className:`text-[10px] font-bold tracking-wider text-white/50 uppercase`,children:t})]},t))}),n.length>0&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`hive-label mb-3`,children:`Agentes`}),(0,A.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:n.map(e=>(0,A.jsx)(MCe,{node:e},e.id))})]}),i.length>0&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`hive-label mb-3`,children:`Proyectos`}),(0,A.jsx)(`div`,{className:`flex flex-wrap gap-4`,children:i.map(e=>(0,A.jsx)(PCe,{node:e,tasks:o.get(e.id)??[]},e.id))})]})]}),r.length>0&&(0,A.jsxs)(`div`,{className:`shrink-0 w-52`,children:[(0,A.jsx)(`p`,{className:`hive-label mb-3`,children:`MCP Servers`}),(0,A.jsx)(`div`,{className:`flex flex-col gap-3`,children:r.map(e=>(0,A.jsx)(NCe,{node:e},e.id))})]})]})}function ICe({sessionId:e}){let t=ig(e=>e.currentUser),n=S7(e=>e.isConnected),r=S7(e=>e.components),i=S7(e=>e.graphNodes),a=S7(e=>e.graphEdges),o=S7(e=>e.zoomLevel),s=S7(e=>e.init),c=S7(e=>e.sendMessage),l=S7(e=>e.removeComponent),d=S7(e=>e.zoomIn),f=S7(e=>e.zoomOut),p=S7(e=>e.resetView),m=e||t?.id||`default`;(0,u.useEffect)(()=>s(),[s]);let h=(0,u.useCallback)((e,t,n)=>{c({type:`canvas:interact`,componentId:e,action:t,data:n}),l(e)},[c,l]);return(0,A.jsxs)(`div`,{className:`hive-card flex h-full flex-col shadow-2xl`,children:[(0,A.jsxs)(`div`,{className:`flex flex-row items-center justify-between space-y-0 border-b border-white/5 bg-white/5 px-6 py-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`hive-icon-wrap hive-icon-wrap--primary`,children:(0,A.jsx)(ir,{className:`h-5 w-5`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`hive-title-page !text-lg`,children:`Canvas`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-white/40 mt-0.5`,children:[(0,A.jsx)(Lr,{className:`h-3 w-3`}),(0,A.jsx)(`span`,{className:`font-mono`,children:m})]})]})]}),(0,A.jsx)(Hz,{variant:`outline`,className:`flex items-center gap-1.5 px-3 py-1 transition-all duration-500 border ${n?`bg-emerald-500/15 text-emerald-500 border-emerald-500/20 hover:bg-emerald-500/20`:`bg-red-500/15 text-red-500 border-red-500/20 hover:bg-red-500/20`}`,children:n?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Vr,{className:`h-3.5 w-3.5 animate-pulse`}),(0,A.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Live`})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Br,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{className:`font-semibold uppercase tracking-wider text-[10px]`,children:`Offline`})]})})]}),(0,A.jsxs)(`div`,{className:`relative flex flex-1 flex-col overflow-hidden`,style:{backgroundImage:`radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px)`,backgroundSize:`40px 40px`},children:[(0,A.jsxs)(AJ,{className:`flex-1 p-6`,children:[(0,A.jsx)(`div`,{className:`origin-top-left transition-transform duration-200 ease-out`,style:{transform:`translate(${o===1?0:o*20}px, 0) scale(${o})`},children:(0,A.jsx)(FCe,{nodes:i,edges:a})}),r.length>0&&(0,A.jsxs)(`div`,{className:`mt-8`,children:[(0,A.jsx)(`p`,{className:`hive-label mb-3`,children:`Componentes`}),(0,A.jsx)(`div`,{className:`grid grid-cols-1 gap-4 lg:grid-cols-2 xl:grid-cols-3`,children:r.map(e=>(0,A.jsx)(kCe,{component:e,onInteraction:h},e.id))})]})]}),(0,A.jsxs)(`div`,{className:`absolute bottom-12 left-1/2 -translate-x-1/2 flex items-center gap-1 px-4 py-2 rounded-full border border-white/10 bg-[#1c1b1d]/70 backdrop-blur-xl shadow-[0_0_20px_rgba(59,130,246,0.08)]`,children:[(0,A.jsx)(`button`,{className:`p-2 text-white/40 hover:text-white hover:scale-110 transition-all duration-150 active:scale-90`,onClick:d,title:`Acercar`,children:(0,A.jsx)(Gr,{className:`h-4 w-4`})}),(0,A.jsx)(`button`,{className:`p-2 text-white/40 hover:text-white hover:scale-110 transition-all duration-150 active:scale-90`,onClick:f,title:`Alejar`,children:(0,A.jsx)(Kr,{className:`h-4 w-4`})}),(0,A.jsx)(`div`,{className:`w-px h-4 bg-white/10 mx-1`}),(0,A.jsx)(`button`,{className:`p-2 text-blue-400 bg-blue-500/10 rounded-full hover:bg-blue-500/20 transition-all duration-150 active:scale-90`,onClick:p,title:`Centrar vista`,children:(0,A.jsx)(pr,{className:`h-4 w-4`})})]}),(0,A.jsx)(`div`,{className:`border-t border-white/5 bg-white/[0.02] px-6 py-2.5`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(Mr,{className:`h-3 w-3 text-white/30`}),(0,A.jsx)(`span`,{className:`hive-mono`,children:n?`Sincronizado · ${i.length} nodos · ${a.length} conexiones`:`Reconectando...`})]})})]})]})}function C7(){let{sessionId:e}=Rd(),{currentUser:t}=ig(),n=e&&e!==`default`?e:t?.id;return n?(0,A.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] flex-col bg-background/50 backdrop-blur-sm`,children:(0,A.jsx)(`div`,{className:`flex-1 overflow-hidden p-4 lg:p-8`,children:(0,A.jsx)(`div`,{className:`mx-auto h-full max-w-7xl`,children:(0,A.jsx)(ICe,{sessionId:n})})})}):(0,A.jsx)(`div`,{className:`flex h-[calc(100vh-4rem)] items-center justify-center`,children:(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-2`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Cargando sesión...`})]})})}var LCe={connected:{label:`Conectado`,className:`bg-hive-connected/15 text-hive-connected border-hive-connected/30`},connecting:{label:`Conectando…`,className:`bg-hive-thinking/15 text-hive-thinking border-hive-thinking/30 animate-pulse-slow`},disconnected:{label:`Desconectado`,className:`bg-destructive/15 text-destructive border-destructive/30`},error:{label:`Error`,className:`bg-destructive/15 text-destructive border-destructive/30`}};function RCe({status:e}){let t=LCe[e];return(0,A.jsxs)(Hz,{variant:`outline`,className:t.className,children:[(0,A.jsx)(`span`,{className:`mr-1.5 inline-block h-1.5 w-1.5 rounded-full bg-current`}),t.label]})}var zCe=window.location.hostname===`0.0.0.0`?`localhost`:window.location.hostname,w7=window.location.protocol===`https:`?`wss:`:`ws:`,BCe=`${w7}//${zCe}:18791/ws`,VCe=`${vh()}/bridge-events`;function HCe(){return Math.random().toString(36).substring(2,15)}function T7(e,t,n=`system`){return{id:HCe(),processId:n,level:e,message:t,timestamp:new Date().toISOString()}}var E7=!1,D7=0,UCe=3,O7=!1,k7=null,A7=null,j7=i((e,t)=>({processes:[],logs:[],isConnected:!1,socket:null,gatewaySocket:null,addProcess:t=>e(e=>({processes:[...e.processes,t]})),removeProcess:t=>e(e=>({processes:e.processes.filter(e=>e.id!==t)})),updateProcess:(t,n)=>e(e=>({processes:e.processes.map(e=>e.id===t?{...e,...n}:e)})),addLog:t=>e(e=>({logs:[t,...e.logs].slice(0,500)})),clearLogs:()=>e({logs:[]}),sendCommand:e=>{let{socket:n,isConnected:r}=t();n&&r&&n.send(JSON.stringify(e))},connect:()=>{let{socket:n,isConnected:r}=t();if(!(n||r)&&w7!==`wss:`){E7=!0;try{let n=new WebSocket(BCe);n.onmessage=r=>{try{let i=JSON.parse(r.data);if(i.type===`ping`){n.send(JSON.stringify({cmd:`ping`}));return}if(i.type===`pong`){console.log(`[Bridge] ✅ Heartbeat acknowledged by server`);return}if(i.type===`code-bridge:status`&&Array.isArray(i.agents)&&e({processes:i.agents.map(e=>({id:e.taskId,name:e.role,command:e.cli,status:e.state,pid:e.pid,startedAt:new Date().toISOString(),output:[]}))}),i.type===`agent:started`){let e={id:i.taskId,name:i.role,command:i.cli,status:`running`,pid:i.pid,startedAt:new Date().toISOString(),output:[]};t().addProcess(e),t().addLog(T7(`info`,`Agent started: ${i.role} (PID: ${i.pid})`,i.taskId))}if(i.type===`agent:output`){let e=t().processes.find(e=>e.id===i.taskId);e&&t().updateProcess(i.taskId,{output:[...e.output,i.chunk]})}i.type===`agent:finished`&&(t().updateProcess(i.taskId,{status:`completed`}),t().addLog(T7(`info`,`Agent finished: ${i.role}`,i.taskId))),i.type===`agent:error`&&(t().updateProcess(i.taskId,{status:`error`}),t().addLog(T7(`error`,i.message,i.taskId))),i.type===`agent:cancelled`&&(t().updateProcess(i.taskId,{status:`stopped`}),t().addLog(T7(`warn`,`Agent cancelled: ${i.role}`,i.taskId)))}catch{}},n.onopen=()=>{D7=0,e({isConnected:!0,socket:n}),t().addLog(T7(`info`,`Connected to Code Bridge`)),t().sendCommand({cmd:`status`}),k7&&clearInterval(k7),k7=setInterval(()=>{n.readyState===WebSocket.OPEN&&(console.log(`[Bridge] 💓 Sending heartbeat...`),n.send(JSON.stringify({cmd:`ping`})))},15e3)},n.onerror=()=>{},n.onclose=()=>{if(k7&&=(clearInterval(k7),null),e({isConnected:!1,socket:null}),E7){if(D7++,D7>UCe){E7=!1;return}setTimeout(()=>{E7&&!t().isConnected&&t().connect()},5e3)}},e({socket:n})}catch{e({isConnected:!1,socket:null})}}},connectGateway:()=>{let{gatewaySocket:n}=t();if(!n){O7=!0;try{let n=new WebSocket(VCe);n.onopen=()=>{e({isConnected:!0}),t().addLog(T7(`info`,`Connected to gateway bridge events`)),A7&&clearInterval(A7),A7=setInterval(()=>{n.readyState===WebSocket.OPEN&&n.send(JSON.stringify({type:`ping`}))},3e4)},n.onmessage=e=>{try{let n=JSON.parse(e.data);if(n.type===`bridge:cmd_start`){let e=n.data,r={id:e.processId,name:e.name??`terminal`,command:e.command,status:`running`,pid:0,startedAt:new Date().toISOString(),output:[]};t().addProcess(r),t().addLog(T7(`info`,`$ ${e.command}${e.cwd?` (in ${e.cwd})`:``}`,e.processId))}if(n.type===`bridge:cmd_output`){let e=n.data,r=t().processes.find(t=>t.id===e.processId);r&&t().updateProcess(e.processId,{output:[...r.output,e.chunk]}),t().addLog(T7(e.stream===`stderr`?`warn`:`info`,e.chunk,e.processId))}if(n.type===`bridge:cmd_done`){let e=n.data;t().updateProcess(e.processId,{status:e.success?`completed`:`error`}),t().addLog(T7(e.success?`info`:`error`,`Exit code: ${e.exitCode}`,e.processId))}if(n.type===`bridge:cmd_error`){let e=n.data;t().updateProcess(e.processId,{status:`error`}),t().addLog(T7(`error`,e.message,e.processId))}}catch{}},n.onerror=()=>{},n.onclose=()=>{A7&&=(clearInterval(A7),null),e({gatewaySocket:null,isConnected:!1}),O7&&setTimeout(()=>{O7&&!t().gatewaySocket&&t().connectGateway()},5e3)},e({gatewaySocket:n})}catch{e({gatewaySocket:null})}}},disconnect:()=>{E7=!1,O7=!1,k7&&=(clearInterval(k7),null),A7&&=(clearInterval(A7),null);let{socket:n,gatewaySocket:r}=t();n&&(n.close(),e({socket:null,isConnected:!1})),r&&(r.close(),e({gatewaySocket:null}))}})),WCe={running:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,completed:`bg-green-500/10 text-green-400 border-green-500/20`,finished:`bg-green-500/10 text-green-400 border-green-500/20`,error:`bg-red-500/10 text-red-400 border-red-500/20`,stopped:`bg-gray-500/10 text-gray-400 border-gray-500/20`};function GCe({status:e}){switch(e){case`running`:return(0,A.jsx)(Yn,{className:`h-3.5 w-3.5 text-yellow-400 animate-spin`});case`completed`:case`finished`:return(0,A.jsx)(sn,{className:`h-3.5 w-3.5 text-green-400`});case`error`:return(0,A.jsx)(un,{className:`h-3.5 w-3.5 text-red-400`});case`stopped`:return(0,A.jsx)(ln,{className:`h-3.5 w-3.5 text-gray-400`});default:return(0,A.jsx)(Mr,{className:`h-3.5 w-3.5 text-muted-foreground`})}}function KCe(){let e=j7(e=>e.processes);return e.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-8 text-center text-muted-foreground`,children:[(0,A.jsx)(Mr,{className:`h-8 w-8 opacity-30 mb-2`}),(0,A.jsx)(`p`,{className:`text-sm`,children:`Sin procesos activos`}),(0,A.jsx)(`p`,{className:`text-xs opacity-60 mt-1`,children:`Los comandos ejecutados por el agente aparecerán aquí`})]}):(0,A.jsx)(`div`,{className:`space-y-2 p-1`,children:e.map(e=>(0,A.jsxs)(`div`,{className:`rounded-lg border border-border bg-card/50 p-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,A.jsx)(GCe,{status:e.status}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,A.jsx)(`span`,{className:`text-sm font-medium font-mono truncate`,children:e.name}),e.pid>0&&(0,A.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`PID: `,e.pid]}),(0,A.jsx)(Hz,{variant:`outline`,className:`text-[10px] px-1.5 py-0 ml-auto ${WCe[e.status]??``}`,children:e.status})]}),e.command&&(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground font-mono mt-0.5 truncate`,children:[`$ `,e.command]}),e.status===`running`&&(0,A.jsx)(cB,{value:void 0,className:`h-0.5 mt-2`})]})]}),e.output.length>0&&(0,A.jsx)(`div`,{className:`mt-2 rounded bg-black/30 px-2 py-1.5 max-h-24 overflow-y-auto`,children:(0,A.jsx)(`pre`,{className:`text-[10px] font-mono text-green-400/80 whitespace-pre-wrap break-all`,children:e.output.slice(-20).join(``)})})]},e.id))})}var qCe={info:`text-foreground/80`,warn:`text-yellow-400`,error:`text-red-400`,debug:`text-muted-foreground/60`},JCe={info:` `,warn:`! `,error:`✗ `,debug:`· `};function YCe(){let e=j7(e=>e.logs),t=j7(e=>e.clearLogs);return(0,A.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between px-3 py-2 border-b border-border`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,A.jsx)(Mr,{className:`h-3.5 w-3.5`}),(0,A.jsx)(`span`,{className:`font-mono uppercase tracking-wider`,children:`Terminal Log`}),(0,A.jsxs)(`span`,{className:`text-muted-foreground/50`,children:[`(`,e.length,`)`]})]}),e.length>0&&(0,A.jsxs)(W,{variant:`ghost`,size:`sm`,className:`h-6 px-2 text-xs`,onClick:t,children:[(0,A.jsx)(Nr,{className:`h-3 w-3 mr-1`}),`Clear`]})]}),(0,A.jsx)(AJ,{className:`flex-1 font-mono text-xs`,children:e.length===0?(0,A.jsx)(`div`,{className:`flex items-center justify-center h-32 text-muted-foreground/50`,children:(0,A.jsx)(`p`,{children:`No logs yet — run a command to see output here`})}):(0,A.jsx)(`div`,{className:`p-3 space-y-0.5`,children:e.map(e=>(0,A.jsxs)(`div`,{className:`flex gap-2 ${qCe[e.level]??`text-foreground/80`}`,children:[(0,A.jsx)(`span`,{className:`text-muted-foreground/40 shrink-0 w-[72px] truncate`,children:new Date(e.timestamp).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}),(0,A.jsx)(`span`,{className:`shrink-0 w-4`,children:JCe[e.level]??` `}),(0,A.jsx)(`span`,{className:`break-all whitespace-pre-wrap`,children:e.message})]},e.id))})})]})}function XCe(){let{isConnected:e,connect:t,connectGateway:n,processes:r,logs:i}=j7();(0,u.useEffect)(()=>{t(),n()},[t,n]);let a=e?`connected`:`disconnected`,o=r.filter(e=>e.status===`running`).length;return(0,A.jsx)(`div`,{className:`hive-page mt-10`,children:(0,A.jsxs)(`div`,{className:`hive-page-container`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`h1`,{className:`text-xl font-semibold flex items-center gap-2`,children:[(0,A.jsx)(Mr,{className:`h-5 w-5`}),`Code Bridge`]}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground mt-0.5`,children:`Monitoreo de comandos CLI y procesos del agente`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[o>0&&(0,A.jsxs)(`span`,{className:`text-xs text-yellow-400 font-mono`,children:[o,` proceso`,o>1?`s`:``,` activo`,o>1?`s`:``]}),(0,A.jsx)(RCe,{status:a}),(0,A.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>{t(),n()},children:[(0,A.jsx)(fr,{className:`h-3.5 w-3.5 mr-1.5`}),`Reconectar`]})]})]}),(0,A.jsxs)(`div`,{className:`mt-4 grid grid-cols-1 lg:grid-cols-2 gap-4 h-[calc(100vh-14rem)]`,children:[(0,A.jsxs)(zR,{className:`flex flex-col overflow-hidden`,children:[(0,A.jsx)(BR,{className:`py-3 px-4 border-b`,children:(0,A.jsxs)(VR,{className:`text-sm flex items-center justify-between`,children:[(0,A.jsx)(`span`,{children:`Procesos`}),(0,A.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[r.length,` total`]})]})}),(0,A.jsx)(UR,{className:`flex-1 overflow-y-auto p-2`,children:(0,A.jsx)(KCe,{})})]}),(0,A.jsxs)(zR,{className:`flex flex-col overflow-hidden`,children:[(0,A.jsx)(BR,{className:`py-3 px-4 border-b`,children:(0,A.jsxs)(VR,{className:`text-sm flex items-center justify-between`,children:[(0,A.jsx)(`span`,{children:`Logs`}),(0,A.jsxs)(`span`,{className:`text-xs text-muted-foreground font-normal`,children:[i.length,` entradas`]})]})}),(0,A.jsx)(UR,{className:`flex-1 overflow-hidden p-0`,children:(0,A.jsx)(YCe,{})})]})]})]})})}function ZCe(){let[e,t]=(0,u.useState)([]),[n,r]=(0,u.useState)(!1),[i,a]=(0,u.useState)(``),[o,s]=(0,u.useState)([`info`,`warn`,`error`]),[c,l]=(0,u.useState)(!1),[d,f]=(0,u.useState)(!0),p=(0,u.useRef)(null),{url:m,status:h,subscribe:g,send:_}=bh();(0,u.useEffect)(()=>{if(h!==`connected`)return;_({type:`logs_subscribe`});let e=g(`log`,e=>{c||e.logEntry&&t(t=>[...t,e.logEntry].slice(-2e3))});return()=>{_({type:`logs_unsubscribe`}),e()}},[h,g,_,c]),(0,u.useEffect)(()=>{if(d&&p.current){let e=p.current.querySelector(`[data-radix-scroll-area-viewport]`);e&&(e.scrollTop=e.scrollHeight)}},[e,d]);let v=e=>{s(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},y=(0,u.useMemo)(()=>e.filter(e=>{let t=o.includes(e.level),n=e.message.toLowerCase().includes(i.toLowerCase())||e.meta&&JSON.stringify(e.meta).toLowerCase().includes(i.toLowerCase());return t&&n}),[e,o,i]),b=e=>{switch(e){case`error`:return`bg-red-500/10 text-red-500 border-red-500/20`;case`warn`:return`bg-yellow-500/10 text-yellow-500 border-yellow-500/20`;case`debug`:return`bg-slate-500/10 text-slate-500 border-slate-500/20`;default:return`bg-blue-500/10 text-blue-500 border-blue-500/20`}};return(0,A.jsxs)(`div`,{className:`flex flex-col h-[calc(100vh-8rem)] space-y-4 mt-10`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-center justify-between gap-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`text-2xl font-bold tracking-tight`,children:`Logs del Sistema`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Monitoreo en tiempo real de la actividad del enjambre.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>l(!c),className:c?`text-yellow-500 border-yellow-500/50 hover:bg-yellow-500/10`:``,children:[c?(0,A.jsx)(cr,{className:`h-4 w-4 mr-2`}):(0,A.jsx)(ar,{className:`h-4 w-4 mr-2`}),c?`Renaudar`:`Pausar`]}),(0,A.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>t([]),children:[(0,A.jsx)(Nr,{className:`h-4 w-4 mr-2`}),`Limpiar`]}),(0,A.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>{},disabled:!0,className:`opacity-50`,children:[(0,A.jsx)(fr,{className:`h-4 w-4 mr-2`}),`Sincronizado via WS`]})]})]}),(0,A.jsx)(zR,{className:`bg-muted/30`,children:(0,A.jsxs)(UR,{className:`p-3 flex flex-wrap items-center gap-4`,children:[(0,A.jsxs)(`div`,{className:`relative flex-1 min-w-[200px]`,children:[(0,A.jsx)(gr,{className:`absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground`}),(0,A.jsx)(G,{placeholder:`Buscar en logs...`,className:`pl-9 h-9 bg-background`,value:i,onChange:e=>a(e.target.value)})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1.5 p-1 bg-background rounded-md border text-xs`,children:[`debug`,`info`,`warn`,`error`].map(e=>(0,A.jsx)(`button`,{onClick:()=>v(e),className:H(`px-2 py-1 rounded capitalize transition-colors`,o.includes(e)?b(e).split(` `)[1]+` `+b(e).split(` `)[0]:`text-muted-foreground hover:bg-muted`),children:e},e))}),(0,A.jsxs)(`label`,{className:`flex items-center gap-2 text-xs cursor-pointer select-none`,children:[(0,A.jsx)(`input`,{type:`checkbox`,className:`sr-only`,checked:d,onChange:()=>f(!d)}),(0,A.jsx)(`div`,{className:H(`w-8 h-4 rounded-full relative transition-colors`,d?`bg-primary`:`bg-muted border shadow-inner`),children:(0,A.jsx)(`div`,{className:H(`absolute top-0.5 w-3 h-3 rounded-full bg-white transition-all shadow-sm`,d?`left-[17px]`:`left-0.5`)})}),`Auto-scroll`]}),(0,A.jsxs)(`div`,{className:`ml-auto flex items-center gap-2 text-[10px] text-muted-foreground`,children:[(0,A.jsx)(`div`,{className:H(`w-2 h-2 rounded-full`,h===`connected`?`bg-green-500 animate-pulse`:`bg-red-500`)}),h===`connected`?`STREAMING`:`OFFLINE`,(0,A.jsx)(`span`,{className:`mx-1 opacity-30`,children:`|`}),y.length,` de `,e.length,` entradas`]})]})}),(0,A.jsx)(zR,{className:`flex-1 overflow-hidden border-2`,children:(0,A.jsx)(UR,{className:`p-0 h-full bg-black/95`,children:(0,A.jsx)(AJ,{className:`h-full w-full`,ref:p,children:(0,A.jsxs)(`div`,{className:`p-4 font-mono text-[11px] leading-relaxed`,children:[y.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-muted-foreground opacity-50`,children:[(0,A.jsx)(Bt,{className:`h-10 w-10 mb-4 stroke-[1]`}),(0,A.jsx)(`p`,{children:n?`Analizando registros...`:`No se encontraron logs con los filtros activos.`})]}):(0,A.jsx)(`div`,{className:`space-y-0.5`,children:y.map(e=>(0,A.jsxs)(`div`,{className:`group flex items-start gap-3 py-0.5 hover:bg-white/5 rounded px-1 transition-colors`,children:[(0,A.jsx)(`span`,{className:`text-slate-600 shrink-0 select-none hidden md:inline`,children:e.timestamp.includes(`T`)?e.timestamp.split(`T`)[1].split(`.`)[0]:e.timestamp}),(0,A.jsx)(Hz,{variant:`outline`,className:H(`px-1 py-0 h-4 text-[9px] uppercase font-bold shrink-0 border`,b(e.level)),children:e.level}),(0,A.jsxs)(`div`,{className:`flex-1 break-all text-slate-300`,children:[(0,A.jsxs)(`span`,{className:`text-slate-500 mr-2`,children:[`[`,e.source,`]`]}),e.message,e.meta&&(0,A.jsx)(`span`,{className:`text-slate-500 ml-2 italic opacity-60`,children:JSON.stringify(e.meta)})]})]},`${e.timestamp}-${e.source}-${e.message.slice(0,30)}`))}),(0,A.jsx)(`div`,{className:`h-4`}),` `]})})})})]})}function QCe({channel:e,onEdit:t,onToggle:n}){let r=e.status===`connected`,i=e.isConfigured===!1;return(0,A.jsxs)(`div`,{onClick:()=>t(e),className:`hive-card group transition-all duration-500 cursor-pointer ${r?`hive-card--active border-emerald-500/20`:i?`opacity-50 border-dashed hover:opacity-80 hover:border-blue-500/30`:`opacity-60 grayscale-[0.8] hover:opacity-100 hover:grayscale-0`}`,children:[(0,A.jsxs)(`div`,{className:`hive-card-body relative overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between mb-8`,children:[(0,A.jsx)(`div`,{className:`h-12 w-12 rounded-xl flex items-center justify-center border transition-all duration-500 ${r?`bg-emerald-500/10 border-emerald-500/30 text-emerald-400 shadow-[0_0_15px_rgba(16,185,129,0.2)]`:i?`bg-blue-500/5 border-blue-500/20 text-blue-400/40`:`bg-white/5 border-white/10 text-white/30`}`,children:(0,A.jsx)(er,{className:`h-6 w-6`})}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[r&&(0,A.jsx)(`span`,{className:`text-[9px] font-black tracking-widest text-emerald-500 shadow-emerald-glow`,children:`CONECTADO`}),i?(0,A.jsx)(`span`,{className:`text-[9px] font-black tracking-widest text-blue-400/60 uppercase`,children:`DISPONIBLE`}):(0,A.jsx)(sq,{checked:e.active,onCheckedChange:t=>n(e.id,t),onClick:e=>e.stopPropagation(),className:`data-[state=checked]:bg-emerald-500 scale-75 origin-right`})]})]}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h3`,{className:`text-xl font-black text-white uppercase tracking-tighter mb-1 line-clamp-1 group-hover:text-emerald-400 transition-colors`,children:e.type}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/20 font-black tracking-[0.2em] mb-4`,children:i?`CLICK PARA CONFIGURAR`:`ID: ${e.id.substring(0,12).toUpperCase()}`})]}),(0,A.jsxs)(`div`,{className:`pt-4 border-t border-white/5 flex items-center gap-6`,children:[(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`VOZ`}),(0,A.jsx)(`span`,{className:`hive-stat__value ${e.voice_enabled?`text-emerald-500`:`text-white/20`}`,children:e.voice_enabled?`ON`:`OFF`})]}),(0,A.jsxs)(`div`,{className:`hive-stat`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`SÍNTESIS`}),(0,A.jsx)(`span`,{className:`hive-stat__value ${e.tts_enabled?`text-emerald-500`:`text-white/20`}`,children:e.tts_enabled?`ON`:`OFF`})]})]})]}),r&&(0,A.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--emerald -bottom-10 -right-10 h-24 w-24 opacity-20`})]}),(0,A.jsx)(`div`,{className:`hive-strip--bottom ${r?`bg-emerald-500`:i?`bg-blue-500/30`:`bg-white/10`}`})]})}var $Ce=r(((e,t)=>{t.exports=function(){return typeof Promise==`function`&&Promise.prototype&&Promise.prototype.then}})),M7=r((e=>{var t,n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];e.getSymbolSize=function(e){if(!e)throw Error(`"version" cannot be null or undefined`);if(e<1||e>40)throw Error(`"version" should be in range from 1 to 40`);return e*4+17},e.getSymbolTotalCodewords=function(e){return n[e]},e.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t},e.setToSJISFunction=function(e){if(typeof e!=`function`)throw Error(`"toSJISFunc" is not a valid function.`);t=e},e.isKanjiModeEnabled=function(){return t!==void 0},e.toSJIS=function(e){return t(e)}})),N7=r((e=>{e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`l`:case`low`:return e.L;case`m`:case`medium`:return e.M;case`q`:case`quartile`:return e.Q;case`h`:case`high`:return e.H;default:throw Error(`Unknown EC Level: `+t)}}e.isValid=function(e){return e&&e.bit!==void 0&&e.bit>=0&&e.bit<4},e.from=function(n,r){if(e.isValid(n))return n;try{return t(n)}catch{return r}}})),ewe=r(((e,t)=>{function n(){this.buffer=[],this.length=0}n.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},t.exports=n})),twe=r(((e,t)=>{function n(e){if(!e||e<1)throw Error(`BitMatrix size must be defined and greater than 0`);this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}n.prototype.set=function(e,t,n,r){let i=e*this.size+t;this.data[i]=n,r&&(this.reservedBit[i]=!0)},n.prototype.get=function(e,t){return this.data[e*this.size+t]},n.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n},n.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},t.exports=n})),nwe=r((e=>{var t=M7().getSymbolSize;e.getRowColCoords=function(e){if(e===1)return[];let n=Math.floor(e/7)+2,r=t(e),i=r===145?26:Math.ceil((r-13)/(2*n-2))*2,a=[r-7];for(let e=1;e<n-1;e++)a[e]=a[e-1]-i;return a.push(6),a.reverse()},e.getPositions=function(t){let n=[],r=e.getRowColCoords(t),i=r.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)e===0&&t===0||e===0&&t===i-1||e===i-1&&t===0||n.push([r[e],r[t]]);return n}})),rwe=r((e=>{var t=M7().getSymbolSize,n=7;e.getPositions=function(e){let r=t(e);return[[0,0],[r-n,0],[0,r-n]]}})),iwe=r((e=>{e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(e){return e!=null&&e!==``&&!isNaN(e)&&e>=0&&e<=7},e.from=function(t){return e.isValid(t)?parseInt(t,10):void 0},e.getPenaltyN1=function(e){let n=e.size,r=0,i=0,a=0,o=null,s=null;for(let c=0;c<n;c++){i=a=0,o=s=null;for(let l=0;l<n;l++){let n=e.get(c,l);n===o?i++:(i>=5&&(r+=t.N1+(i-5)),o=n,i=1),n=e.get(l,c),n===s?a++:(a>=5&&(r+=t.N1+(a-5)),s=n,a=1)}i>=5&&(r+=t.N1+(i-5)),a>=5&&(r+=t.N1+(a-5))}return r},e.getPenaltyN2=function(e){let n=e.size,r=0;for(let t=0;t<n-1;t++)for(let i=0;i<n-1;i++){let n=e.get(t,i)+e.get(t,i+1)+e.get(t+1,i)+e.get(t+1,i+1);(n===4||n===0)&&r++}return r*t.N2},e.getPenaltyN3=function(e){let n=e.size,r=0,i=0,a=0;for(let t=0;t<n;t++){i=a=0;for(let o=0;o<n;o++)i=i<<1&2047|e.get(t,o),o>=10&&(i===1488||i===93)&&r++,a=a<<1&2047|e.get(o,t),o>=10&&(a===1488||a===93)&&r++}return r*t.N3},e.getPenaltyN4=function(e){let n=0,r=e.data.length;for(let t=0;t<r;t++)n+=e.data[t];return Math.abs(Math.ceil(n*100/r/5)-10)*t.N4};function n(t,n,r){switch(t){case e.Patterns.PATTERN000:return(n+r)%2==0;case e.Patterns.PATTERN001:return n%2==0;case e.Patterns.PATTERN010:return r%3==0;case e.Patterns.PATTERN011:return(n+r)%3==0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(r/3))%2==0;case e.Patterns.PATTERN101:return n*r%2+n*r%3==0;case e.Patterns.PATTERN110:return(n*r%2+n*r%3)%2==0;case e.Patterns.PATTERN111:return(n*r%3+(n+r)%2)%2==0;default:throw Error(`bad maskPattern:`+t)}}e.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let a=0;a<r;a++)t.isReserved(a,i)||t.xor(a,i,n(e,a,i))},e.getBestMask=function(t,n){let r=Object.keys(e.Patterns).length,i=0,a=1/0;for(let o=0;o<r;o++){n(o),e.applyMask(o,t);let r=e.getPenaltyN1(t)+e.getPenaltyN2(t)+e.getPenaltyN3(t)+e.getPenaltyN4(t);e.applyMask(o,t),r<a&&(a=r,i=o)}return i}})),P7=r((e=>{var t=N7(),n=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];e.getBlocksCount=function(e,r){switch(r){case t.L:return n[(e-1)*4+0];case t.M:return n[(e-1)*4+1];case t.Q:return n[(e-1)*4+2];case t.H:return n[(e-1)*4+3];default:return}},e.getTotalCodewordsCount=function(e,n){switch(n){case t.L:return r[(e-1)*4+0];case t.M:return r[(e-1)*4+1];case t.Q:return r[(e-1)*4+2];case t.H:return r[(e-1)*4+3];default:return}}})),awe=r((e=>{var t=new Uint8Array(512),n=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)t[r]=e,n[e]=r,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)t[e]=t[e-255]})(),e.log=function(e){if(e<1)throw Error(`log(`+e+`)`);return n[e]},e.exp=function(e){return t[e]},e.mul=function(e,r){return e===0||r===0?0:t[n[e]+n[r]]}})),owe=r((e=>{var t=awe();e.mul=function(e,n){let r=new Uint8Array(e.length+n.length-1);for(let i=0;i<e.length;i++)for(let a=0;a<n.length;a++)r[i+a]^=t.mul(e[i],n[a]);return r},e.mod=function(e,n){let r=new Uint8Array(e);for(;r.length-n.length>=0;){let e=r[0];for(let i=0;i<n.length;i++)r[i]^=t.mul(n[i],e);let i=0;for(;i<r.length&&r[i]===0;)i++;r=r.slice(i)}return r},e.generateECPolynomial=function(n){let r=new Uint8Array([1]);for(let i=0;i<n;i++)r=e.mul(r,new Uint8Array([1,t.exp(i)]));return r}})),swe=r(((e,t)=>{var n=owe();function r(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}r.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},r.prototype.encode=function(e){if(!this.genPoly)throw Error(`Encoder not initialized`);let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},t.exports=r})),F7=r((e=>{e.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}})),I7=r((e=>{var t=`[0-9]+`,n=`[A-Z $%*+\\-./:]+`,r=`(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+`;r=r.replace(/u/g,`\\u`);var i=`(?:(?![A-Z0-9 $%*+\\-./:]|`+r+`)(?:.|[\r
246
+ ]))+`;e.KANJI=new RegExp(r,`g`),e.BYTE_KANJI=RegExp(`[^A-Z0-9 $%*+\\-./:]+`,`g`),e.BYTE=new RegExp(i,`g`),e.NUMERIC=new RegExp(t,`g`),e.ALPHANUMERIC=new RegExp(n,`g`);var a=RegExp(`^`+r+`$`),o=RegExp(`^`+t+`$`),s=RegExp(`^[A-Z0-9 $%*+\\-./:]+$`);e.testKanji=function(e){return a.test(e)},e.testNumeric=function(e){return o.test(e)},e.testAlphanumeric=function(e){return s.test(e)}})),L7=r((e=>{var t=F7(),n=I7();e.NUMERIC={id:`Numeric`,bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:`Alphanumeric`,bit:2,ccBits:[9,11,13]},e.BYTE={id:`Byte`,bit:4,ccBits:[8,16,16]},e.KANJI={id:`Kanji`,bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(e,n){if(!e.ccBits)throw Error(`Invalid mode: `+e);if(!t.isValid(n))throw Error(`Invalid version: `+n);return n>=1&&n<10?e.ccBits[0]:n<27?e.ccBits[1]:e.ccBits[2]},e.getBestModeForData=function(t){return n.testNumeric(t)?e.NUMERIC:n.testAlphanumeric(t)?e.ALPHANUMERIC:n.testKanji(t)?e.KANJI:e.BYTE},e.toString=function(e){if(e&&e.id)return e.id;throw Error(`Invalid mode`)},e.isValid=function(e){return e&&e.bit&&e.ccBits};function r(t){if(typeof t!=`string`)throw Error(`Param is not a string`);switch(t.toLowerCase()){case`numeric`:return e.NUMERIC;case`alphanumeric`:return e.ALPHANUMERIC;case`kanji`:return e.KANJI;case`byte`:return e.BYTE;default:throw Error(`Unknown mode: `+t)}}e.from=function(t,n){if(e.isValid(t))return t;try{return r(t)}catch{return n}}})),cwe=r((e=>{var t=M7(),n=P7(),r=N7(),i=L7(),a=F7(),o=7973,s=t.getBCHDigit(o);function c(t,n,r){for(let i=1;i<=40;i++)if(n<=e.getCapacity(i,r,t))return i}function l(e,t){return i.getCharCountIndicator(e,t)+4}function u(e,t){let n=0;return e.forEach(function(e){let r=l(e.mode,t);n+=r+e.getBitsLength()}),n}function d(t,n){for(let r=1;r<=40;r++)if(u(t,r)<=e.getCapacity(r,n,i.MIXED))return r}e.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},e.getCapacity=function(e,r,o){if(!a.isValid(e))throw Error(`Invalid QR Code version`);o===void 0&&(o=i.BYTE);let s=(t.getSymbolTotalCodewords(e)-n.getTotalCodewordsCount(e,r))*8;if(o===i.MIXED)return s;let c=s-l(o,e);switch(o){case i.NUMERIC:return Math.floor(c/10*3);case i.ALPHANUMERIC:return Math.floor(c/11*2);case i.KANJI:return Math.floor(c/13);case i.BYTE:default:return Math.floor(c/8)}},e.getBestVersionForData=function(e,t){let n,i=r.from(t,r.M);if(Array.isArray(e)){if(e.length>1)return d(e,i);if(e.length===0)return 1;n=e[0]}else n=e;return c(n.mode,n.getLength(),i)},e.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error(`Invalid QR Code version`);let n=e<<12;for(;t.getBCHDigit(n)-s>=0;)n^=o<<t.getBCHDigit(n)-s;return e<<12|n}})),lwe=r((e=>{var t=M7(),n=1335,r=21522,i=t.getBCHDigit(n);e.getEncodedBits=function(e,a){let o=e.bit<<3|a,s=o<<10;for(;t.getBCHDigit(s)-i>=0;)s^=n<<t.getBCHDigit(s)-i;return(o<<10|s)^r}})),uwe=r(((e,t)=>{var n=L7();function r(e){this.mode=n.NUMERIC,this.data=e.toString()}r.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){let t,n,r;for(t=0;t+3<=this.data.length;t+=3)n=this.data.substr(t,3),r=parseInt(n,10),e.put(r,10);let i=this.data.length-t;i>0&&(n=this.data.substr(t),r=parseInt(n,10),e.put(r,i*3+1))},t.exports=r})),dwe=r(((e,t)=>{var n=L7(),r=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`.split(``);function i(e){this.mode=n.ALPHANUMERIC,this.data=e}i.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let n=r.indexOf(this.data[t])*45;n+=r.indexOf(this.data[t+1]),e.put(n,11)}this.data.length%2&&e.put(r.indexOf(this.data[t]),6)},t.exports=i})),fwe=r(((e,t)=>{var n=L7();function r(e){this.mode=n.BYTE,typeof e==`string`?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}r.getBitsLength=function(e){return e*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)},t.exports=r})),pwe=r(((e,t)=>{var n=L7(),r=M7();function i(e){this.mode=n.KANJI,this.data=e}i.getBitsLength=function(e){return e*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=r.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw Error(`Invalid SJIS character: `+this.data[t]+`
247
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},t.exports=i})),mwe=r(((e,t)=>{var n={single_source_shortest_paths:function(e,t,r){var i={},a={};a[t]=0;var o=n.PriorityQueue.make();o.push(t,0);for(var s,c,l,u,d,f,p,m,h;!o.empty();)for(l in s=o.pop(),c=s.value,u=s.cost,d=e[c]||{},d)d.hasOwnProperty(l)&&(f=d[l],p=u+f,m=a[l],h=a[l]===void 0,(h||m>p)&&(a[l]=p,o.push(l,p),i[l]=c));if(r!==void 0&&a[r]===void 0){var g=[`Could not find a path from `,t,` to `,r,`.`].join(``);throw Error(g)}return i},extract_shortest_path_from_predecessor_list:function(e,t){for(var n=[],r=t;r;)n.push(r),e[r],r=e[r];return n.reverse(),n},find_path:function(e,t,r){var i=n.single_source_shortest_paths(e,t,r);return n.extract_shortest_path_from_predecessor_list(i,r)},PriorityQueue:{make:function(e){var t=n.PriorityQueue,r={},i;for(i in e||={},t)t.hasOwnProperty(i)&&(r[i]=t[i]);return r.queue=[],r.sorter=e.sorter||t.default_sorter,r},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var n={value:e,cost:t};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t!==void 0&&(t.exports=n)})),hwe=r((e=>{var t=L7(),n=uwe(),r=dwe(),i=fwe(),a=pwe(),o=I7(),s=M7(),c=mwe();function l(e){return unescape(encodeURIComponent(e)).length}function u(e,t,n){let r=[],i;for(;(i=e.exec(n))!==null;)r.push({data:i[0],index:i.index,mode:t,length:i[0].length});return r}function d(e){let n=u(o.NUMERIC,t.NUMERIC,e),r=u(o.ALPHANUMERIC,t.ALPHANUMERIC,e),i,a;return s.isKanjiModeEnabled()?(i=u(o.BYTE,t.BYTE,e),a=u(o.KANJI,t.KANJI,e)):(i=u(o.BYTE_KANJI,t.BYTE,e),a=[]),n.concat(r,i,a).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function f(e,o){switch(o){case t.NUMERIC:return n.getBitsLength(e);case t.ALPHANUMERIC:return r.getBitsLength(e);case t.KANJI:return a.getBitsLength(e);case t.BYTE:return i.getBitsLength(e)}}function p(e){return e.reduce(function(e,t){let n=e.length-1>=0?e[e.length-1]:null;return n&&n.mode===t.mode?(e[e.length-1].data+=t.data,e):(e.push(t),e)},[])}function m(e){let n=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case t.NUMERIC:n.push([i,{data:i.data,mode:t.ALPHANUMERIC,length:i.length},{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.ALPHANUMERIC:n.push([i,{data:i.data,mode:t.BYTE,length:i.length}]);break;case t.KANJI:n.push([i,{data:i.data,mode:t.BYTE,length:l(i.data)}]);break;case t.BYTE:n.push([{data:i.data,mode:t.BYTE,length:l(i.data)}])}}return n}function h(e,n){let r={},i={start:{}},a=[`start`];for(let o=0;o<e.length;o++){let s=e[o],c=[];for(let e=0;e<s.length;e++){let l=s[e],u=``+o+e;c.push(u),r[u]={node:l,lastCount:0},i[u]={};for(let e=0;e<a.length;e++){let o=a[e];r[o]&&r[o].node.mode===l.mode?(i[o][u]=f(r[o].lastCount+l.length,l.mode)-f(r[o].lastCount,l.mode),r[o].lastCount+=l.length):(r[o]&&(r[o].lastCount=l.length),i[o][u]=f(l.length,l.mode)+4+t.getCharCountIndicator(l.mode,n))}}a=c}for(let e=0;e<a.length;e++)i[a[e]].end=0;return{map:i,table:r}}function g(e,o){let c,l=t.getBestModeForData(e);if(c=t.from(o,l),c!==t.BYTE&&c.bit<l.bit)throw Error(`"`+e+`" cannot be encoded with mode `+t.toString(c)+`.
248
+ Suggested mode is: `+t.toString(l));switch(c===t.KANJI&&!s.isKanjiModeEnabled()&&(c=t.BYTE),c){case t.NUMERIC:return new n(e);case t.ALPHANUMERIC:return new r(e);case t.KANJI:return new a(e);case t.BYTE:return new i(e)}}e.fromArray=function(e){return e.reduce(function(e,t){return typeof t==`string`?e.push(g(t,null)):t.data&&e.push(g(t.data,t.mode)),e},[])},e.fromString=function(t,n){let r=h(m(d(t,s.isKanjiModeEnabled())),n),i=c.find_path(r.map,`start`,`end`),a=[];for(let e=1;e<i.length-1;e++)a.push(r.table[i[e]].node);return e.fromArray(p(a))},e.rawSplit=function(t){return e.fromArray(d(t,s.isKanjiModeEnabled()))}})),gwe=r((e=>{var t=M7(),n=N7(),r=ewe(),i=twe(),a=nwe(),o=rwe(),s=iwe(),c=P7(),l=swe(),u=cwe(),d=lwe(),f=L7(),p=hwe();function m(e,t){let n=e.size,r=o.getPositions(t);for(let t=0;t<r.length;t++){let i=r[t][0],a=r[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1||n<=i+t))for(let r=-1;r<=7;r++)a+r<=-1||n<=a+r||(t>=0&&t<=6&&(r===0||r===6)||r>=0&&r<=6&&(t===0||t===6)||t>=2&&t<=4&&r>=2&&r<=4?e.set(i+t,a+r,!0,!0):e.set(i+t,a+r,!1,!0))}}function h(e){let t=e.size;for(let n=8;n<t-8;n++){let t=n%2==0;e.set(n,6,t,!0),e.set(6,n,t,!0)}}function g(e,t){let n=a.getPositions(t);for(let t=0;t<n.length;t++){let r=n[t][0],i=n[t][1];for(let t=-2;t<=2;t++)for(let n=-2;n<=2;n++)t===-2||t===2||n===-2||n===2||t===0&&n===0?e.set(r+t,i+n,!0,!0):e.set(r+t,i+n,!1,!0)}}function _(e,t){let n=e.size,r=u.getEncodedBits(t),i,a,o;for(let t=0;t<18;t++)i=Math.floor(t/3),a=t%3+n-8-3,o=(r>>t&1)==1,e.set(i,a,o,!0),e.set(a,i,o,!0)}function v(e,t,n){let r=e.size,i=d.getEncodedBits(t,n),a,o;for(a=0;a<15;a++)o=(i>>a&1)==1,a<6?e.set(a,8,o,!0):a<8?e.set(a+1,8,o,!0):e.set(r-15+a,8,o,!0),a<8?e.set(8,r-a-1,o,!0):a<9?e.set(8,15-a-1+1,o,!0):e.set(8,15-a-1,o,!0);e.set(r-8,8,1,!0)}function y(e,t){let n=e.size,r=-1,i=n-1,a=7,o=0;for(let s=n-1;s>0;s-=2)for(s===6&&s--;;){for(let n=0;n<2;n++)if(!e.isReserved(i,s-n)){let r=!1;o<t.length&&(r=(t[o]>>>a&1)==1),e.set(i,s-n,r),a--,a===-1&&(o++,a=7)}if(i+=r,i<0||n<=i){i-=r,r=-r;break}}}function b(e,n,i){let a=new r;i.forEach(function(t){a.put(t.mode.bit,4),a.put(t.getLength(),f.getCharCountIndicator(t.mode,e)),t.write(a)});let o=(t.getSymbolTotalCodewords(e)-c.getTotalCodewordsCount(e,n))*8;for(a.getLengthInBits()+4<=o&&a.put(0,4);a.getLengthInBits()%8!=0;)a.putBit(0);let s=(o-a.getLengthInBits())/8;for(let e=0;e<s;e++)a.put(e%2?17:236,8);return x(a,e,n)}function x(e,n,r){let i=t.getSymbolTotalCodewords(n),a=i-c.getTotalCodewordsCount(n,r),o=c.getBlocksCount(n,r),s=o-i%o,u=Math.floor(i/o),d=Math.floor(a/o),f=d+1,p=u-d,m=new l(p),h=0,g=Array(o),_=Array(o),v=0,y=new Uint8Array(e.buffer);for(let e=0;e<o;e++){let t=e<s?d:f;g[e]=y.slice(h,h+t),_[e]=m.encode(g[e]),h+=t,v=Math.max(v,t)}let b=new Uint8Array(i),x=0,S,C;for(S=0;S<v;S++)for(C=0;C<o;C++)S<g[C].length&&(b[x++]=g[C][S]);for(S=0;S<p;S++)for(C=0;C<o;C++)b[x++]=_[C][S];return b}function S(e,n,r,a){let o;if(Array.isArray(e))o=p.fromArray(e);else if(typeof e==`string`){let t=n;if(!t){let n=p.rawSplit(e);t=u.getBestVersionForData(n,r)}o=p.fromString(e,t||40)}else throw Error(`Invalid data`);let c=u.getBestVersionForData(o,r);if(!c)throw Error(`The amount of data is too big to be stored in a QR Code`);if(!n)n=c;else if(n<c)throw Error(`
249
+ The chosen QR Code version cannot contain this amount of data.
250
+ Minimum version required to store current data is: `+c+`.
251
+ `);let l=b(n,r,o),d=new i(t.getSymbolSize(n));return m(d,n),h(d),g(d,n),v(d,r,0),n>=7&&_(d,n),y(d,l),isNaN(a)&&(a=s.getBestMask(d,v.bind(null,d,r))),s.applyMask(a,d),v(d,r,a),{modules:d,version:n,errorCorrectionLevel:r,maskPattern:a,segments:o}}e.create=function(e,r){if(e===void 0||e===``)throw Error(`No input text`);let i=n.M,a,o;return r!==void 0&&(i=n.from(r.errorCorrectionLevel,n.M),a=u.from(r.version),o=s.from(r.maskPattern),r.toSJISFunc&&t.setToSJISFunction(r.toSJISFunc)),S(e,a,i,o)}})),R7=r((e=>{function t(e){if(typeof e==`number`&&(e=e.toString()),typeof e!=`string`)throw Error(`Color should be defined as hex string`);let t=e.slice().replace(`#`,``).split(``);if(t.length<3||t.length===5||t.length>8)throw Error(`Invalid hex color: `+e);(t.length===3||t.length===4)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),t.length===6&&t.push(`F`,`F`);let n=parseInt(t.join(``),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:`#`+t.slice(0,6).join(``)}}e.getOptions=function(e){e||={},e.color||={};let n=e.margin===void 0||e.margin===null||e.margin<0?4:e.margin,r=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:r,scale:r?4:i,margin:n,color:{dark:t(e.color.dark||`#000000ff`),light:t(e.color.light||`#ffffffff`)},type:e.type,rendererOpts:e.rendererOpts||{}}},e.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},e.getImageWidth=function(t,n){let r=e.getScale(t,n);return Math.floor((t+n.margin*2)*r)},e.qrToImageData=function(t,n,r){let i=n.modules.size,a=n.modules.data,o=e.getScale(i,r),s=Math.floor((i+r.margin*2)*o),c=r.margin*o,l=[r.color.light,r.color.dark];for(let e=0;e<s;e++)for(let n=0;n<s;n++){let u=(e*s+n)*4,d=r.color.light;if(e>=c&&n>=c&&e<s-c&&n<s-c){let t=Math.floor((e-c)/o),r=Math.floor((n-c)/o);d=l[a[t*i+r]?1:0]}t[u++]=d.r,t[u++]=d.g,t[u++]=d.b,t[u]=d.a}}})),_we=r((e=>{var t=R7();function n(e,t,n){e.clearRect(0,0,t.width,t.height),t.style||={},t.height=n,t.width=n,t.style.height=n+`px`,t.style.width=n+`px`}function r(){try{return document.createElement(`canvas`)}catch{throw Error(`You need to specify a canvas element`)}}e.render=function(e,i,a){let o=a,s=i;o===void 0&&(!i||!i.getContext)&&(o=i,i=void 0),i||(s=r()),o=t.getOptions(o);let c=t.getImageWidth(e.modules.size,o),l=s.getContext(`2d`),u=l.createImageData(c,c);return t.qrToImageData(u.data,e,o),n(l,s,c),l.putImageData(u,0,0),s},e.renderToDataURL=function(t,n,r){let i=r;i===void 0&&(!n||!n.getContext)&&(i=n,n=void 0),i||={};let a=e.render(t,n,i),o=i.type||`image/png`,s=i.rendererOpts||{};return a.toDataURL(o,s.quality)}})),vwe=r((e=>{var t=R7();function n(e,t){let n=e.a/255,r=t+`="`+e.hex+`"`;return n<1?r+` `+t+`-opacity="`+n.toFixed(2).slice(1)+`"`:r}function r(e,t,n){let r=e+t;return n!==void 0&&(r+=` `+n),r}function i(e,t,n){let i=``,a=0,o=!1,s=0;for(let c=0;c<e.length;c++){let l=Math.floor(c%t),u=Math.floor(c/t);!l&&!o&&(o=!0),e[c]?(s++,c>0&&l>0&&e[c-1]||(i+=o?r(`M`,l+n,.5+u+n):r(`m`,a,0),a=0,o=!1),l+1<t&&e[c+1]||(i+=r(`h`,s),s=0)):a++}return i}e.render=function(e,r,a){let o=t.getOptions(r),s=e.modules.size,c=e.modules.data,l=s+o.margin*2,u=o.color.light.a?`<path `+n(o.color.light,`fill`)+` d="M0 0h`+l+`v`+l+`H0z"/>`:``,d=`<path `+n(o.color.dark,`stroke`)+` d="`+i(c,s,o.margin)+`"/>`,f=`viewBox="0 0 `+l+` `+l+`"`,p=`<svg xmlns="http://www.w3.org/2000/svg" `+(o.width?`width="`+o.width+`" height="`+o.width+`" `:``)+f+` shape-rendering="crispEdges">`+u+d+`</svg>
252
+ `;return typeof a==`function`&&a(null,p),p}})),ywe=e(r((e=>{var t=$Ce(),n=gwe(),r=_we(),i=vwe();function a(e,r,i,a,o){let s=[].slice.call(arguments,1),c=s.length,l=typeof s[c-1]==`function`;if(!l&&!t())throw Error(`Callback required as last argument`);if(l){if(c<2)throw Error(`Too few arguments provided`);c===2?(o=i,i=r,r=a=void 0):c===3&&(r.getContext&&o===void 0?(o=a,a=void 0):(o=a,a=i,i=r,r=void 0))}else{if(c<1)throw Error(`Too few arguments provided`);return c===1?(i=r,r=a=void 0):c===2&&!r.getContext&&(a=i,i=r,r=void 0),new Promise(function(t,o){try{t(e(n.create(i,a),r,a))}catch(e){o(e)}})}try{let t=n.create(i,a);o(null,e(t,r,a))}catch(e){o(e)}}e.create=n.create,e.toCanvas=a.bind(null,r.render),e.toDataURL=a.bind(null,r.renderToDataURL),e.toString=a.bind(null,function(e,t,n){return i.render(e,n)})}))(),1),bwe=[{id:`whisper-large-v3-turbo`,name:`Whisper Large V3 Turbo (Groq)`,provider:`groq`},{id:`whisper-large-v3`,name:`Whisper Large V3 (Groq)`,provider:`groq`},{id:`distil-whisper-large-v3-en`,name:`Distil Whisper V3 EN (Groq)`,provider:`groq`},{id:`whisper-1`,name:`Whisper 1 (OpenAI)`,provider:`openai`}],xwe=[{group:`ElevenLabs`,provider:`elevenlabs`,models:[{id:`eleven_flash_v2_5`,name:`Flash v2.5`},{id:`eleven_turbo_v2_5`,name:`Turbo v2.5`},{id:`eleven_multilingual_v2`,name:`Multilingual v2`},{id:`eleven_v3`,name:`V3`}]},{group:`OpenAI`,provider:`openai`,models:[{id:`tts-1`,name:`TTS-1`},{id:`tts-1-hd`,name:`TTS-1 HD`},{id:`gpt-4o-mini-tts`,name:`GPT-4o Mini TTS`}]},{group:`Google Gemini`,provider:`gemini`,models:[{id:`gemini-2.5-flash-preview-tts`,name:`Gemini 2.5 Flash TTS`},{id:`gemini-2.5-pro-preview-tts`,name:`Gemini 2.5 Pro TTS`}]},{group:`Qwen`,provider:`qwen`,models:[{id:`qwen3-tts-instruct-flash`,name:`Qwen3 TTS Instruct Flash`},{id:`qwen3-tts-flash`,name:`Qwen3 TTS Flash`},{id:`qwen-tts`,name:`Qwen TTS`}]}];function Swe(e){return e.startsWith(`eleven`)?`elevenlabs`:e.startsWith(`tts-`)||e.startsWith(`gpt-`)?`openai`:e.startsWith(`gemini`)?`gemini`:e.startsWith(`qwen`)?`qwen`:null}function Cwe({data:e}){let t=(0,u.useRef)(null);return(0,u.useEffect)(()=>{!e||!t.current||ywe.toCanvas(t.current,e,{width:220,margin:2,color:{dark:`#000000`,light:`#ffffff`}}).catch(console.error)},[e]),(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`rounded-xl overflow-hidden border-4 border-white shadow-lg`,children:(0,A.jsx)(`canvas`,{ref:t})}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 text-center`,children:`Abre WhatsApp → Ajustes → Dispositivos vinculados → Vincular dispositivo`})]})}function wwe({channel:e,isOpen:t,onClose:n,onSave:r}){let i=Fd(),{createChannel:a,reconnectChannel:o,fetchChannels:s}=IR(),{configuredVoiceProviders:c,fetchConfiguredVoiceProviders:l}=LR(),[d,f]=(0,u.useState)(e?`settings`:`type`),[p,m]=(0,u.useState)(`telegram`),[h,g]=(0,u.useState)(``),[_,v]=(0,u.useState)(``),[y,b]=(0,u.useState)(``),[x,S]=(0,u.useState)(!1),[C,w]=(0,u.useState)(!1),[T,E]=(0,u.useState)(null),[D,O]=(0,u.useState)(null),[k,j]=(0,u.useState)(!1),[M,N]=(0,u.useState)(null),[P,F]=(0,u.useState)(!1),ee=(0,u.useRef)(null),[I,L]=(0,u.useState)({}),[R,te]=(0,u.useState)(!1),[ne,z]=(0,u.useState)([]),[re,ie]=(0,u.useState)(!1),[ae,oe]=(0,u.useState)(!1),[se,B]=(0,u.useState)(``),[ce,le]=(0,u.useState)(!1),ue=e&&e.status!==`connected`,de=e&&e.isConfigured===!1;(0,u.useEffect)(()=>{t?e?(f(ue?`reconnect`:`settings`),m(e.type),g(``),v(``),b(``),E(e.id),O(null),j(!1),N(null),L(e),oe(!1),B(``),le(!1)):(f(`type`),m(`telegram`),g(``),v(``),b(``),E(null),O(null),j(!1),N(null)):fe()},[t,e]),(0,u.useEffect)(()=>{l()},[l]),(0,u.useEffect)(()=>{let e=I.tts_provider?Swe(I.tts_provider):null;if(!e){z([]);return}ie(!0),K(`/api/voice/${e}/voices`,{showError:!1}).then(e=>z(e.voices||[])).catch(()=>z([])).finally(()=>ie(!1))},[I.tts_provider]);let fe=(0,u.useCallback)(()=>{ee.current&&=(clearInterval(ee.current),null)},[]),pe=(0,u.useCallback)((e,t)=>{fe(),ee.current=setInterval(async()=>{try{let n=await K(`/api/channels/${e}/${t}/status`,{showError:!1});n.status===`qr`&&n.qrCode?(O(n.qrCode),j(!1),f(`qr`)):n.status===`connected`?(fe(),await s(),f(`success`)):n.status===`error`?(fe(),N(`Error de conexión. Intenta de nuevo.`),f(`credentials`)):(n.status===`disconnected`||n.status===`not_found`)&&j(!0)}catch{}},2e3)},[fe,s]),me=async()=>{if(e){F(!0),N(null);try{let t={};p===`telegram`&&h.trim()&&(t.botToken=h),p===`discord`&&(h.trim()&&(t.botToken=h),_.trim()&&(t.applicationId=_)),await o(e.id,Object.keys(t).length>0?t:void 0),f(`connecting`),pe(p,e.id)}catch(e){N(e.message||`Error al reconectar`)}finally{F(!1)}}},he=async()=>{F(!0),N(null);try{let e={};p===`telegram`&&(e.botToken=h),p===`discord`&&(e.botToken=h,e.applicationId=_),p===`slack`&&(e.botToken=h,e.signingSecret=y);let{id:t}=await a(p,e);E(t),p===`whatsapp`?(f(`connecting`),pe(`whatsapp`,t)):(f(`connecting`),pe(p,t))}catch(e){N(e.message||`Error al conectar`)}finally{F(!1)}},ge=async()=>{if(e?.id){te(!0);try{if(se.trim().length>10&&(e.type===`telegram`||e.type===`discord`)){let t={botToken:se.trim()};await o(e.id,t)}await r(e.id,I),n()}catch(e){console.error(`Save failed`,e)}finally{te(!1)}}},_e=()=>{fe(),n()},ve=p===`whatsapp`||p===`webchat`||p===`telegram`&&h.trim().length>10||p===`discord`&&h.trim().length>10&&_.trim().length>0||p===`slack`&&h.trim().length>10&&y.trim().length>10,ye=()=>d===`reconnect`?(0,A.jsxs)(`div`,{className:`space-y-4 py-2`,children:[M&&(0,A.jsxs)(HQ,{variant:`destructive`,className:`bg-red-500/10 border-red-500/30`,children:[(0,A.jsx)(an,{className:`h-4 w-4`}),(0,A.jsx)(WQ,{children:M})]}),(0,A.jsxs)(`div`,{className:`p-4 rounded-xl ${de?`bg-blue-500/10 border border-blue-500/20`:`bg-amber-500/10 border border-amber-500/20`}`,children:[(0,A.jsx)(`p`,{className:`text-xs font-semibold uppercase tracking-widest mb-1 ${de?`text-blue-300`:`text-amber-300`}`,children:de?`Canal no configurado`:`Canal desconectado`}),(0,A.jsx)(`p`,{className:`text-xs ${de?`text-blue-200/70`:`text-amber-200/70`}`,children:de?p===`whatsapp`?`Haz clic en Conectar para generar el código QR.`:p===`webchat`?`Haz clic en Conectar para activar el canal web.`:`Ingresa las credenciales para activar este canal.`:p===`whatsapp`?`Haz clic en Reconectar para generar un nuevo código QR.`:p===`webchat`?`Haz clic en Reconectar para activar el canal.`:`Puedes reconectar con las credenciales existentes o ingresar un nuevo token.`})]}),(p===`telegram`||p===`discord`)&&(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsx)(`p`,{className:`text-[10px] text-white/30 uppercase tracking-widest`,children:de?`Credenciales`:`Actualizar credenciales (opcional)`}),(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/50`,children:`Bot Token`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{type:C?`text`:`password`,value:h,onChange:e=>g(e.target.value),placeholder:de?p===`telegram`?`123456789:AAF...`:`MTA5NDY...`:`Dejar vacío para usar el token actual`,className:`bg-white/5 border-white/10 pr-10 font-mono text-sm`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>w(e=>!e),className:`absolute right-2 top-1/2 -translate-y-1/2 text-white/40 hover:text-white/70`,children:C?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),p===`discord`&&(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/50`,children:`Application ID`}),(0,A.jsx)(G,{value:_,onChange:e=>v(e.target.value),placeholder:de?`123456789012345678`:`Dejar vacío para usar el actual`,className:`bg-white/5 border-white/10 font-mono text-sm`})]})]})]}):d===`type`?(0,A.jsxs)(`div`,{className:`space-y-4 py-2`,children:[(0,A.jsx)(`p`,{className:`text-sm text-white/50`,children:`Selecciona el tipo de canal a conectar:`}),(0,A.jsx)(`div`,{className:`grid grid-cols-2 gap-3`,children:[{id:`telegram`,label:`Telegram`,icon:`✈️`},{id:`whatsapp`,label:`WhatsApp`,icon:`💬`},{id:`discord`,label:`Discord`,icon:`🎮`},{id:`slack`,label:`Slack`,icon:`💼`},{id:`webchat`,label:`WebChat`,icon:`🌐`}].map(e=>(0,A.jsxs)(`button`,{onClick:()=>m(e.id),className:`p-4 rounded-xl border text-left transition-all duration-200 ${p===e.id?`border-blue-500 bg-blue-500/10 text-white`:`border-white/10 bg-white/5 text-white/50 hover:border-white/20 hover:text-white/70`}`,children:[(0,A.jsx)(`div`,{className:`text-2xl mb-1`,children:e.icon}),(0,A.jsx)(`div`,{className:`text-sm font-semibold`,children:e.label})]},e.id))})]}):d===`credentials`?(0,A.jsxs)(`div`,{className:`space-y-4 py-2`,children:[M&&(0,A.jsxs)(HQ,{variant:`destructive`,className:`bg-red-500/10 border-red-500/30`,children:[(0,A.jsx)(an,{className:`h-4 w-4`}),(0,A.jsx)(WQ,{children:M})]}),p===`whatsapp`&&(0,A.jsx)(`div`,{className:`p-4 rounded-xl bg-emerald-500/10 border border-emerald-500/20 text-sm text-emerald-300`,children:`WhatsApp no requiere token. Haz clic en "Conectar" y escanea el código QR con tu teléfono.`}),p===`webchat`&&(0,A.jsx)(`div`,{className:`p-4 rounded-xl bg-blue-500/10 border border-blue-500/20 text-sm text-blue-300`,children:`WebChat no requiere configuración. Haz clic en "Conectar" para activarlo.`}),(p===`telegram`||p===`discord`||p===`slack`)&&(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/50 uppercase tracking-widest`,children:`Bot Token`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{type:C?`text`:`password`,value:h,onChange:e=>g(e.target.value),placeholder:p===`telegram`?`123456789:AAF...`:p===`slack`?`xoxb-...`:`MTA5NDY...`,className:`bg-white/5 border-white/10 pr-10 font-mono text-sm`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>w(e=>!e),className:`absolute right-2 top-1/2 -translate-y-1/2 text-white/40 hover:text-white/70`,children:C?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),p===`discord`&&(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/50 uppercase tracking-widest`,children:`Application ID`}),(0,A.jsx)(G,{value:_,onChange:e=>v(e.target.value),placeholder:`123456789012345678`,className:`bg-white/5 border-white/10 font-mono text-sm`})]}),p===`slack`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/50 uppercase tracking-widest`,children:`Signing Secret`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{type:x?`text`:`password`,value:y,onChange:e=>b(e.target.value),placeholder:`a1b2c3d4e5f6...`,className:`bg-white/5 border-white/10 pr-10 font-mono text-sm`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>S(e=>!e),className:`absolute right-2 top-1/2 -translate-y-1/2 text-white/40 hover:text-white/70`,children:x?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),(0,A.jsxs)(`div`,{className:`p-3 rounded-lg bg-amber-500/10 border border-amber-500/20 text-xs text-amber-200/80`,children:[`Slack requiere una URL pública para webhooks. Usa ngrok, cloudflared o Tailscale y configura la Request URL en tu Slack App: `,(0,A.jsx)(`span`,{className:`font-mono`,children:`https://tu-url/slack/events`})]})]})]})]}):d===`connecting`?(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-4 py-8`,children:[(0,A.jsx)(`div`,{className:`relative`,children:(0,A.jsx)(`div`,{className:`h-16 w-16 rounded-full border-2 border-white/10 flex items-center justify-center`,children:(0,A.jsx)(Yn,{className:`h-8 w-8 animate-spin text-blue-400`})})}),(0,A.jsx)(`p`,{className:`text-sm text-white/60 text-center`,children:p===`whatsapp`?`Iniciando WhatsApp... Generando código QR`:`Conectando canal...`}),(0,A.jsx)(`p`,{className:`text-xs text-white/30`,children:`Esto puede tardar unos segundos`})]}):d===`qr`?(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-4 py-4`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[D?(0,A.jsx)(Cwe,{data:D}):(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6`,children:[(0,A.jsx)(dr,{className:`h-16 w-16 text-white/20`}),(0,A.jsx)(`p`,{className:`text-xs text-white/40`,children:`Generando QR...`})]}),k&&(0,A.jsxs)(`div`,{className:`absolute inset-0 flex flex-col items-center justify-center rounded-xl bg-zinc-950/80 backdrop-blur-sm gap-2`,children:[(0,A.jsx)(Yn,{className:`h-8 w-8 animate-spin text-amber-400`}),(0,A.jsx)(`p`,{className:`text-xs text-amber-300 font-medium`,children:`QR expirado, renovando...`})]})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-2 text-xs text-white/30`,children:k?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-amber-400 animate-pulse`}),`Renovando código QR...`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`div`,{className:`h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse`}),`Esperando escaneo...`]})}),(0,A.jsx)(`p`,{className:`text-[11px] text-white/30 text-center`,children:`Abre WhatsApp → Ajustes → Dispositivos vinculados → Vincular dispositivo`})]}):d===`success`?(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-4 py-8`,children:[(0,A.jsx)(`div`,{className:`h-16 w-16 rounded-full bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-center`,children:(0,A.jsx)(sn,{className:`h-8 w-8 text-emerald-400`})}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-white`,children:`Canal conectado`}),(0,A.jsxs)(`p`,{className:`text-xs text-white/40 mt-1`,children:[p.charAt(0).toUpperCase()+p.slice(1),` está activo y listo para recibir mensajes.`]})]})]}):null,be=()=>(0,A.jsxs)(`div`,{className:`grid gap-4 py-4`,children:[(e?.type===`telegram`||e?.type===`discord`)&&(0,A.jsxs)(`div`,{className:`space-y-2 pb-2 border-b border-white/10`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(Z,{className:`text-xs text-white/50 uppercase tracking-widest`,children:`Bot Token`}),!ae&&(0,A.jsx)(`button`,{type:`button`,onClick:()=>oe(!0),className:`text-[11px] text-blue-400 hover:text-blue-300 transition-colors`,children:`Cambiar token`})]}),ae?(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{type:ce?`text`:`password`,value:se,onChange:e=>B(e.target.value),placeholder:e?.type===`telegram`?`123456789:AAF...`:`MTA5NDY...`,className:`bg-white/5 border-white/10 pr-10 font-mono text-sm`,autoFocus:!0}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>le(e=>!e),className:`absolute right-2 top-1/2 -translate-y-1/2 text-white/40 hover:text-white/70`,children:ce?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>{oe(!1),B(``),le(!1)},className:`text-[11px] text-white/40 hover:text-white/60 transition-colors`,children:`Cancelar`}),se.trim().length>0&&(0,A.jsx)(`span`,{className:`text-[11px] text-amber-400/70`,children:`Se aplicará al guardar`})]})]}):(0,A.jsx)(`div`,{className:`flex items-center gap-2 px-3 py-2 rounded-lg bg-white/5 border border-white/10`,children:(0,A.jsx)(`span`,{className:`font-mono text-sm text-white/30 tracking-widest select-none`,children:`••••••••••••••••••••••••`})})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,A.jsx)(Z,{className:`text-right text-xs`,children:`Voz (STT)`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 col-span-3`,children:[(0,A.jsx)(sq,{checked:I.voice_enabled,onCheckedChange:e=>L(t=>({...t,voice_enabled:e}))}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Procesar notas de voz`})]})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,A.jsx)(Z,{className:`text-right text-xs`,children:`TTS`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 col-span-3`,children:[(0,A.jsx)(sq,{checked:I.tts_enabled,onCheckedChange:e=>L(t=>({...t,tts_enabled:e}))}),(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Responder por voz`})]})]}),I.voice_enabled&&(0,A.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,A.jsx)(Z,{className:`text-right text-xs`,children:`Modelo STT`}),(0,A.jsxs)(BK,{value:I.stt_provider||``,onValueChange:e=>L(t=>({...t,stt_provider:e})),children:[(0,A.jsx)(UK,{className:`col-span-3`,children:(0,A.jsx)(HK,{placeholder:`Selecciona modelo STT`})}),(0,A.jsx)(KK,{children:bwe.filter(e=>c[e.provider]).map(e=>(0,A.jsx)(Q,{value:e.id,children:e.name},e.id))})]})]}),I.tts_enabled&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,A.jsx)(Z,{className:`text-right text-xs`,children:`Modelo TTS`}),(0,A.jsxs)(BK,{value:I.tts_provider||``,onValueChange:e=>L(t=>({...t,tts_provider:e,tts_voice_id:``})),children:[(0,A.jsx)(UK,{className:`col-span-3`,children:(0,A.jsx)(HK,{placeholder:`Selecciona modelo TTS`})}),(0,A.jsx)(KK,{children:xwe.filter(e=>c[e.provider]).map(e=>(0,A.jsxs)(VK,{children:[(0,A.jsx)(qK,{children:e.group}),e.models.map(e=>(0,A.jsx)(Q,{value:e.id,children:e.name},e.id))]},e.group))})]})]}),I.tts_provider&&(0,A.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,A.jsx)(Z,{className:`text-right text-xs`,children:`Voz`}),(0,A.jsxs)(BK,{value:I.tts_voice_id||``,onValueChange:e=>L(t=>({...t,tts_voice_id:e})),disabled:re||ne.length===0,children:[(0,A.jsx)(UK,{className:`col-span-3`,children:(0,A.jsx)(HK,{placeholder:re?`Cargando...`:`Selecciona una voz`})}),(0,A.jsx)(KK,{children:ne.map(e=>(0,A.jsx)(Q,{value:e.id,children:e.name},e.id))})]})]}),!c.elevenlabs&&!c.openai&&!c.gemini&&!c.qwen&&(0,A.jsxs)(HQ,{variant:`destructive`,className:`bg-yellow-500/10 border-yellow-500/30 text-yellow-200`,children:[(0,A.jsx)(an,{className:`h-4 w-4`}),(0,A.jsxs)(WQ,{className:`text-yellow-200/80`,children:[`Configura un provider TTS.`,` `,(0,A.jsx)(`button`,{className:`underline`,onClick:()=>{n(),i(`/settings/voz`)},children:`Ir a Configuración de Voz`})]})]})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-4 items-center gap-4`,children:[(0,A.jsx)(Z,{className:`text-right text-xs`,children:`Entrega`}),(0,A.jsxs)(BK,{value:I.step_delivery_mode,onValueChange:e=>L(t=>({...t,step_delivery_mode:e})),children:[(0,A.jsx)(UK,{className:`col-span-3`,children:(0,A.jsx)(HK,{placeholder:`Modo de entrega`})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`new_messages`,children:`Solo Mensajes Nuevos`}),(0,A.jsx)(Q,{value:`all`,children:`Todo (Sincronización)`})]})]})]})]}),xe=p===`whatsapp`||p===`webchat`||!de||p===`telegram`&&h.trim().length>10||p===`discord`&&h.trim().length>10&&_.trim().length>0;return t?(0,A.jsx)(`div`,{className:`fixed inset-0 z-[9999] bg-black/80 flex items-center justify-center`,onClick:_e,children:(0,A.jsxs)(`div`,{className:`relative w-full max-w-[480px] mx-4 hive-card border-white/10 overflow-hidden`,onClick:e=>e.stopPropagation(),children:[(0,A.jsx)(`button`,{onClick:_e,className:`absolute right-4 top-4 z-10 text-white/40 hover:text-white transition-colors`,children:(0,A.jsx)(Ur,{className:`h-4 w-4`})}),(0,A.jsxs)(`div`,{className:`p-6 border-b border-white/5 bg-white/5 relative overflow-hidden`,children:[(0,A.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--blue -top-10 -right-10 h-32 w-32 opacity-20`}),(0,A.jsxs)(`h2`,{className:`text-xl font-black text-white uppercase tracking-tighter relative z-10 flex items-center gap-2`,children:[(0,A.jsx)(xr,{className:`h-4 w-4 text-blue-400`}),{type:`Nuevo Canal`,credentials:`Conectar ${p.charAt(0).toUpperCase()+p.slice(1)}`,reconnect:de?`Configurar ${p.charAt(0).toUpperCase()+p.slice(1)}`:`Reconectar ${p.charAt(0).toUpperCase()+p.slice(1)}`,connecting:`Conectando...`,qr:`Escanea el código QR`,success:`¡Canal conectado!`,settings:`Configurar ${e?.type??`canal`}`}[d]??`Nuevo Canal`]}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 font-medium mt-1 relative z-10`,children:d===`settings`?`Ajusta el comportamiento y las opciones de voz del canal.`:d===`qr`?`Abre WhatsApp en tu teléfono y escanea el código para vincular el dispositivo.`:d===`reconnect`?de?`Ingresa las credenciales para activar este canal.`:`Reconecta el canal con las credenciales existentes o actualízalas.`:`Conecta un nuevo canal de comunicación a Hive.`})]}),(0,A.jsx)(`div`,{className:`p-6`,children:e&&d===`settings`?be():ye()}),(0,A.jsx)(`div`,{className:`p-6 pt-4 flex gap-2`,children:e&&d===`settings`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(W,{variant:`outline`,onClick:_e,disabled:R,children:`Cancelar`}),(0,A.jsx)(W,{onClick:ge,disabled:R,children:R?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`h-4 w-4 animate-spin mr-2`}),`Guardando...`]}):`Guardar Cambios`})]}):d===`reconnect`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(W,{variant:`outline`,onClick:_e,children:`Cancelar`}),(0,A.jsx)(W,{onClick:me,disabled:P||!xe,children:P?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`h-4 w-4 animate-spin mr-2`}),`Conectando...`]}):de?`Conectar`:`Reconectar`})]}):d===`type`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(W,{variant:`outline`,onClick:_e,children:`Cancelar`}),(0,A.jsx)(W,{onClick:()=>f(`credentials`),children:`Siguiente →`})]}):d===`credentials`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(W,{variant:`outline`,onClick:()=>f(`type`),children:`← Atrás`}),(0,A.jsx)(W,{onClick:he,disabled:P||!ve,children:P?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`h-4 w-4 animate-spin mr-2`}),`Conectando...`]}):`Conectar`})]}):d===`connecting`?(0,A.jsx)(W,{variant:`outline`,onClick:_e,children:`Cancelar`}):d===`qr`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(W,{variant:`outline`,size:`sm`,onClick:()=>{T&&pe(p,T)},children:[(0,A.jsx)(fr,{className:`h-3.5 w-3.5 mr-2`}),`Actualizar QR`]}),(0,A.jsx)(W,{variant:`outline`,onClick:_e,children:`Cancelar`})]}):d===`success`?(0,A.jsx)(W,{onClick:_e,children:`Cerrar`}):null})]})}):null}function Twe(){let{channels:e,activeChannels:t,fetchChannels:n,isLoading:r,toggleChannel:i,updateChannel:a}=IR(),[o,s]=(0,u.useState)(`all`),[c,l]=(0,u.useState)(null),[d,f]=(0,u.useState)(!1);(0,u.useEffect)(()=>{n()},[]);let p=(0,u.useMemo)(()=>o===`all`?e:o===`active`?e.filter(e=>e.active):o===`inactive`?e.filter(e=>!e.active):e,[e,o]),m=e=>{l(e),f(!0)},h=()=>{l(null),f(!0)};return(0,A.jsxs)(`div`,{className:`hive-page-container animate-fade-in mt-10`,children:[(0,A.jsx)(`div`,{className:`hive-page-header`,children:(0,A.jsxs)(`div`,{className:`flex flex-col md:flex-row md:items-center justify-between gap-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,A.jsx)(`div`,{className:`h-10 w-10 rounded-xl bg-blue-500/10 border border-blue-500/20 flex items-center justify-center text-blue-400`,children:(0,A.jsx)(Kn,{className:`h-6 w-6`})}),(0,A.jsx)(`h1`,{className:`text-3xl font-black text-white uppercase tracking-tighter`,children:`Canales`})]}),(0,A.jsx)(`p`,{className:`hive-subtitle`,children:`Gestiona tus puntos de entrada y salida de comunicación en la red Hive.`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsxs)(`button`,{onClick:()=>n(),disabled:r,className:`hive-btn hive-btn--ghost px-6 text-[10px]`,children:[(0,A.jsx)(fr,{className:`h-3.5 w-3.5 mr-2 ${r?`animate-spin`:``}`}),`SINCRONIZAR`]}),(0,A.jsxs)(`button`,{onClick:h,className:`hive-btn hive-btn--primary px-8 text-[10px]`,children:[(0,A.jsx)(lr,{className:`h-3.5 w-3.5 mr-2`}),`NUEVO CANAL`]})]})]})}),(0,A.jsxs)(`div`,{className:`hive-card border-blue-500/10 !bg-blue-500/[0.02] mb-8 overflow-hidden relative`,children:[(0,A.jsxs)(`div`,{className:`hive-card-body py-4 px-6 flex items-center justify-between relative z-10`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-lg bg-blue-500/10 flex items-center justify-center text-blue-400`,children:(0,A.jsx)(Wr,{className:`h-4 w-4`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-[10px] font-black tracking-widest text-blue-500/50 uppercase`,children:`Estado Operativo`}),(0,A.jsxs)(`p`,{className:`text-xs text-white/60`,children:[`Actualmente tienes `,(0,A.jsx)(`span`,{className:`text-blue-400 font-black`,children:t.length}),` canales procesando datos.`]})]})]}),(0,A.jsx)(`div`,{className:`text-[10px] text-white/20 font-black tracking-widest uppercase`,children:`HIVE NODE SECURE`})]}),(0,A.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--blue -top-10 -right-10 h-32 w-32 opacity-10`})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-1.5 p-1 bg-white/5 rounded-2xl w-fit border border-white/5 mb-8`,children:[{id:`all`,label:`TODOS (${e.length})`},{id:`active`,label:`ACTIVOS (${e.filter(e=>e.active).length})`},{id:`inactive`,label:`INACTIVOS (${e.filter(e=>!e.active).length})`}].map(e=>(0,A.jsx)(`button`,{onClick:()=>s(e.id),className:`px-8 py-2.5 rounded-xl text-[10px] font-black tracking-widest uppercase transition-all duration-300 ${o===e.id?`bg-blue-500 text-white shadow-blue-glow`:`text-white/20 hover:text-white/40 hover:bg-white/5`}`,children:e.label},e.id))}),(0,A.jsx)(`div`,{className:`animate-fade-in`,children:p.length>0?(0,A.jsx)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6`,children:p.map(e=>(0,A.jsx)(QCe,{channel:e,onEdit:m,onToggle:i},e.id))}):(0,A.jsx)(`div`,{className:`hive-card border-dashed border-white/10 bg-white/[0.02]`,children:(0,A.jsxs)(`div`,{className:`hive-card-body flex flex-col items-center justify-center py-20 px-4`,children:[(0,A.jsx)(`div`,{className:`h-20 w-20 rounded-2xl bg-white/5 flex items-center justify-center mb-6`,children:(0,A.jsx)(Kn,{className:`h-10 w-10 text-white/10`})}),(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`p`,{className:`hive-title-section text-center mb-2`,children:`No se detectaron canales`}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 mb-8 max-w-[300px] mx-auto leading-relaxed`,children:`Configura tu primer punto de enlace para empezar a recibir datos en tiempo real.`}),(0,A.jsx)(`button`,{onClick:h,className:`hive-btn hive-btn--primary px-10 text-[10px]`,children:`ESTABLECER CONEXIÓNHORA`})]})]})})}),(0,A.jsx)(wwe,{channel:c,isOpen:d,onClose:()=>f(!1),onSave:async(e,t)=>{await a(e,t)}})]})}var Ewe=i((e,t)=>({projects:[],isLoading:!1,fetchProjects:async t=>{e({isLoading:!0});try{let n=await K(t?`/api/projects?status=${t}`:`/api/projects`,{showLoader:!1,showError:!0});console.log(`[ProjectsStore] fetchProjects - API Response:`,n);let r=[];Array.isArray(n)?(r=n,console.log(`[ProjectsStore] Response es array directo:`,r.length,`proyectos`)):`projects`in n?(r=n.projects,console.log(`[ProjectsStore] Response tiene propiedad 'projects':`,r.length,`proyectos`)):`project`in n?(r=n.project?[n.project]:[],console.log(`[ProjectsStore] Response tiene propiedad 'project':`,r.length,`proyecto(s)`)):n&&typeof n==`object`&&`id`in n?(r=[n],console.log(`[ProjectsStore] Response es un proyecto directo:`,r.length,`proyecto`)):console.warn(`[ProjectsStore] Formato de respuesta desconocido:`,n),e({projects:r})}catch(t){console.error(`[ProjectsStore] Error en fetchProjects:`,t),e({projects:[]})}finally{e({isLoading:!1})}},fetchActiveProjects:async()=>{e({isLoading:!0});try{let t=await K(`/api/projects/active`,{showLoader:!1,showError:!0});console.log(`[ProjectsStore] fetchActiveProjects - API Response:`,t);let n=[];Array.isArray(t)?(n=t,console.log(`[ProjectsStore] Response es array directo:`,n.length,`proyectos`)):`projects`in t?(n=t.projects,console.log(`[ProjectsStore] Response tiene propiedad 'projects':`,n.length,`proyectos`)):`project`in t?(n=t.project?[t.project]:[],console.log(`[ProjectsStore] Response tiene propiedad 'project':`,n.length,`proyecto(s)`)):t&&typeof t==`object`&&`id`in t?(n=[t],console.log(`[ProjectsStore] Response es un proyecto directo:`,n.length,`proyecto`)):console.warn(`[ProjectsStore] Formato de respuesta desconocido:`,t),e({projects:n})}catch(t){console.error(`[ProjectsStore] Error en fetchActiveProjects:`,t),e({projects:[]})}finally{e({isLoading:!1})}},updateTaskLocal:(t,n)=>{e(e=>({projects:e.projects.map(e=>({...e,tasks:e.tasks.map(e=>e.id===t?{...e,...n}:e)}))}))},updateProjectLocal:(t,n)=>{e(e=>({projects:e.projects.map(e=>e.id===t?{...e,...n}:e)}))}}));function z7({icon:e,...t}){return(0,A.jsx)(e,{...t})}var Dwe={code:`Código`,research:`Investigación`,content:`Contenido`,data:`Datos`,general:`General`},B7={code:`bg-blue-500/10 text-blue-400 border-blue-500/20`,research:`bg-purple-500/10 text-purple-400 border-purple-500/20`,content:`bg-green-500/10 text-green-400 border-green-500/20`,data:`bg-orange-500/10 text-orange-400 border-orange-500/20`,general:`bg-gray-500/10 text-gray-400 border-gray-500/20`},Owe={active:`bg-green-500/10 text-green-400 border-green-500/20`,pending:`bg-yellow-500/10 text-yellow-400 border-yellow-500/20`,paused:`bg-gray-500/10 text-gray-400 border-gray-500/20`,done:`bg-blue-500/10 text-blue-400 border-blue-500/20`,failed:`bg-red-500/10 text-red-400 border-red-500/20`},kwe={active:`Activo`,pending:`Pendiente`,paused:`Pausado`,done:`Completado`,failed:`Fallido`,in_progress:`En progreso`,completed:`Completada`,blocked:`Bloqueada`};function Awe({status:e}){switch(e){case`completed`:return(0,A.jsx)(z7,{icon:sn,className:`h-3.5 w-3.5 text-green-400`});case`in_progress`:return(0,A.jsx)(z7,{icon:Yn,className:`h-3.5 w-3.5 text-yellow-400 animate-spin`});case`failed`:return(0,A.jsx)(z7,{icon:un,className:`h-3.5 w-3.5 text-red-400`});case`blocked`:return(0,A.jsx)(z7,{icon:cn,className:`h-3.5 w-3.5 text-orange-400`});default:return(0,A.jsx)(z7,{icon:dn,className:`h-3.5 w-3.5 text-muted-foreground`})}}function jwe({task:e}){return(0,A.jsxs)(`div`,{className:`flex items-center gap-3 py-1.5 px-3 rounded-md hover:bg-white/5 transition-colors group`,children:[(0,A.jsx)(Awe,{status:e.status}),(0,A.jsx)(`span`,{className:`text-sm flex-1 text-white/40 group-hover:text-white/80 transition-colors`,children:e.name}),e.description&&(0,A.jsx)(`span`,{className:`text-xs text-white/20 hidden sm:block max-w-[200px] truncate`,children:e.description}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[e.status===`in_progress`&&(0,A.jsx)(`div`,{className:`w-16`,children:(0,A.jsx)(cB,{value:e.progress,className:`h-1`})}),(0,A.jsxs)(`span`,{className:`text-[11px] text-white/30 w-8 text-right`,children:[e.progress,`%`]})]})]})}function Mwe({project:e}){let[t,n]=(0,u.useState)(e.status===`active`||e.status===`pending`);return console.log(`[ProjectsPage] ProjectCard - Project:`,t),(0,A.jsxs)(`div`,{className:`hive-card group overflow-hidden mt-10`,children:[(0,A.jsxs)(`button`,{className:`w-full flex items-center gap-3 p-4 hover:bg-white/5 transition-colors text-left`,onClick:()=>n(!t),children:[(0,A.jsx)(z7,{icon:t?en:nn,className:`h-4 w-4 text-white/30 shrink-0`}),(0,A.jsx)(z7,{icon:jn,className:`h-4 w-4 text-blue-400 shrink-0`}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,A.jsx)(`span`,{className:`font-medium text-sm text-white`,children:e.name}),(0,A.jsx)(Hz,{variant:`outline`,className:`text-[10px] px-1.5 py-0 ${B7[e.type]??B7.general}`,children:Dwe[e.type]??e.type}),(0,A.jsx)(Hz,{variant:`outline`,className:`text-[10px] px-1.5 py-0 ${Owe[e.status]??``}`,children:kwe[e.status]??e.status})]}),e.description&&(0,A.jsx)(`p`,{className:`hive-subtitle !mt-0.5 truncate`,children:e.description})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 shrink-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,A.jsx)(`div`,{className:`w-20`,children:(0,A.jsx)(cB,{value:e.progress,className:`h-1.5`})}),(0,A.jsxs)(`span`,{className:`text-xs text-white/30 w-8 text-right`,children:[e.progress,`%`]})]}),(e.tasks??[]).length>0&&(0,A.jsxs)(`span`,{className:`text-xs text-white/30`,children:[(e.tasks??[]).filter(e=>e.status===`completed`).length,`/`,(e.tasks??[]).length]})]})]}),t&&(e.tasks??[]).length>0&&(0,A.jsx)(`div`,{className:`border-t border-white/5 px-2 py-2`,children:(e.tasks??[]).map(e=>(0,A.jsx)(jwe,{task:e},e.id))}),t&&(e.tasks??[]).length===0&&(0,A.jsx)(`div`,{className:`border-t border-white/5 px-4 py-3 text-xs text-white/20`,children:`Sin tareas registradas`})]})}function Nwe(){let{projects:e,isLoading:t,fetchProjects:n,fetchActiveProjects:r}=Ewe(),[i,a]=(0,u.useState)(`active`),o=()=>{i===`active`?r():i===`done`?n(`done`):n()};return(0,u.useEffect)(()=>{o()},[i]),(0,A.jsx)(`div`,{className:`hive-page`,children:(0,A.jsxs)(`div`,{className:`hive-page-container`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,A.jsx)(`div`,{className:`hive-page-header__dot`}),(0,A.jsx)(`span`,{className:`hive-page-header__label`,children:`GESTIÓN`})]}),(0,A.jsxs)(`h1`,{className:`hive-title-page`,children:[`Proyectos`,(0,A.jsx)(`span`,{className:`hive-title-page__accent`,children:`.`})]}),(0,A.jsx)(`p`,{className:`hive-subtitle`,children:`Seguimiento de tareas y proyectos activos del agente`})]}),(0,A.jsxs)(`button`,{className:`hive-btn hive-btn--primary`,onClick:o,disabled:t,children:[(0,A.jsx)(z7,{icon:fr,className:`h-3.5 w-3.5 mr-1.5 ${t?`animate-spin`:``}`}),`Actualizar`]})]}),(0,A.jsx)(`div`,{className:`flex gap-1 mt-6 bg-white/[0.02] rounded-xl p-1 border border-white/5`,children:[{key:`active`,label:`Activos`},{key:`all`,label:`Todos`},{key:`done`,label:`Completados`}].map(e=>(0,A.jsx)(`button`,{onClick:()=>a(e.key),className:`px-6 py-2 rounded-xl text-[10px] font-black tracking-widest uppercase transition-all duration-300 ${i===e.key?`bg-blue-600 text-white shadow-btn-primary`:`text-white/20 hover:text-white/40 hover:bg-white/5`}`,children:e.label},e.key))}),(0,A.jsx)(`div`,{className:`mt-6 space-y-3`,children:t?(0,A.jsxs)(`div`,{className:`hive-empty-state`,children:[(0,A.jsx)(z7,{icon:Yn,className:`h-5 w-5 animate-spin mr-2`}),`Cargando proyectos...`]}):e.length===0?(0,A.jsxs)(`div`,{className:`hive-empty-state`,children:[(0,A.jsx)(z7,{icon:jn,className:`h-10 w-10 opacity-30 mb-3`}),(0,A.jsxs)(`p`,{className:`text-sm text-white/30`,children:[`No hay proyectos `,i===`active`?`activos`:``]}),(0,A.jsx)(`p`,{className:`text-xs text-white/15 mt-1`,children:`El agente creará proyectos automáticamente cuando reciba tareas complejas`})]}):e.filter(Boolean).map(e=>(0,A.jsx)(Mwe,{project:e},e.id))})]})})}function Pwe({provider:e,onSave:t,onCancel:n}){let[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(e?.baseUrl||e?.base_url||``),[l,d]=(0,u.useState)(e?.config?.headers?JSON.stringify(e.config.headers,null,2):``),[f,p]=(0,u.useState)(e?.num_ctx?String(e.num_ctx):``),m=s||e?.baseUrl||e?.base_url||``,h=e?.id===`ollama`||m.includes(`localhost`)||m.includes(`127.0.0.1`),g=!!e?.has_api_key,_=!!e?.has_headers;return(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`API Key`}),g&&(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] font-bold text-emerald-400`,children:[(0,A.jsx)(sn,{className:`h-3 w-3`}),`Configurada`]})]}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{type:r?`text`:`password`,value:a,onChange:e=>o(e.target.value),placeholder:g?`•••••••••••••••• (dejar vacío para conservar)`:`sk-...`,className:`hive-input !h-8 text-xs pr-8`}),(0,A.jsx)(W,{variant:`ghost`,size:`icon`,className:`absolute right-0 top-0 h-8 w-8 text-white/40 hover:text-white`,onClick:()=>i(!r),children:r?(0,A.jsx)(En,{className:`h-3 w-3`}):(0,A.jsx)(Dn,{className:`h-3 w-3`})})]})]}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`Base URL (opcional)`}),(0,A.jsx)(G,{value:s,onChange:e=>c(e.target.value),placeholder:`https://api.example.com`,className:`hive-input !h-8 text-xs`})]}),h&&(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`Context Window (num_ctx)`}),(0,A.jsx)(`span`,{className:`text-[10px] text-white/30`,children:`tokens — por defecto 32 768`})]}),(0,A.jsx)(G,{type:`number`,value:f,onChange:e=>p(e.target.value),placeholder:`8192`,min:512,step:512,className:`hive-input !h-8 text-xs font-mono`}),(0,A.jsx)(`p`,{className:`text-[10px] text-amber-400/60`,children:`Aumenta si ves errores de contexto. Tu modelo soporta hasta 262 144 tokens.`})]}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`Custom Headers (JSON)`}),_&&(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] font-bold text-emerald-400`,children:[(0,A.jsx)(sn,{className:`h-3 w-3`}),`Configurados`]})]}),(0,A.jsx)(`textarea`,{value:l,onChange:e=>d(e.target.value),placeholder:_?`{ ... } (dejar vacío para conservar)`:`{ "x-custom-header": "value" }`,rows:3,className:`w-full bg-white/5 border border-white/10 rounded-md p-2 text-xs text-white/70 focus:outline-none focus:border-blue-500/50 transition-all font-mono`})]}),(0,A.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,A.jsx)(`button`,{className:`hive-btn hive-btn--form-cancel flex-1`,onClick:n,children:`Cancelar`}),(0,A.jsx)(`button`,{className:`hive-btn hive-btn--form-submit flex-1`,onClick:()=>{let e;if(l.trim())try{e=JSON.parse(l.trim())}catch{eg.fire(`Error`,`JSON de Headers inválido`,`error`);return}t&&t({apiKey:a,baseUrl:s||void 0,headers:e,numCtx:f.trim()?Number(f.trim()):null})},children:`Guardar`})]}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/20 pt-2`,children:`La API key se guarda cifrada en la base de datos.`})]})}var Fwe=xr,Iwe=en,Lwe=nn,V7=gn,Rwe=lr,zwe=Un,Bwe=Pn,Vwe=fr,Hwe=sr,Uwe=Nr,Wwe=$t,Gwe=Ur;function Kwe({provider:e,updateProvider:t,onManageModels:n}){let[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(``),[l,d]=(0,u.useState)(!1),[f,p]=(0,u.useState)(!1),[m,h]=(0,u.useState)(null),[g,_]=(0,u.useState)(``),[v,y]=(0,u.useState)(``),[b,x]=(0,u.useState)(null),{models:S,toggleModel:C,createModel:w,syncModels:T,deleteModel:E,updateModel:D}=jR(),{toggleProvider:O}=AR(),k=(0,u.useMemo)(()=>{let t=S.filter(t=>(t.providerId||t.provider_id)===e.id);return t.length>0?t:e.models||[]},[S,e.id,e.models]),j=k.filter(e=>e.enabled||e.active),M=n=>{t(e.id,n),i(!1)},N=async t=>{try{await O(e.id,t)}catch(e){console.error(`Failed to toggle provider:`,e)}},P=async(e,t)=>{try{await C(e.id,t)}catch(e){console.error(`Failed to toggle model:`,e)}},F=async()=>{p(!0);try{await T(e.id),o(!0)}catch(e){console.error(`Failed to sync models:`,e)}finally{p(!1)}},ee=e=>{h(e.id),_(e.name),y(e.id)},I=()=>{h(null),_(``),y(``)},L=async e=>{let t=g.trim()||e.name,n=v.trim()||e.id;if(t===e.name&&n===e.id){I();return}try{await D(e.id,{name:t,id:n}),I()}catch(e){console.error(`Failed to update model:`,e)}},R=async e=>{x(e.id);try{await E(e.id)}catch(e){console.error(`Failed to delete model:`,e)}finally{x(null)}},te=async()=>{let t=s.trim();if(t){d(!0);try{await w(e.id,t),c(``)}catch(e){console.error(`Failed to add model:`,e)}finally{d(!1)}}},ne=!!e.active,z=e.base_url||e.baseUrl,re=e.id===`ollama`||z?.includes(`localhost`)||z?.includes(`127.0.0.1`);return(0,A.jsxs)(`div`,{className:`hive-card group overflow-hidden flex flex-col gap-0 transition-all duration-500 ${ne?`hive-card--active`:`opacity-70 grayscale-[0.5] hover:grayscale-0 hover:opacity-100`}`,children:[(0,A.jsx)(`div`,{className:`hive-card-body pb-3`,children:(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,A.jsx)(`div`,{className:`shrink-0 h-10 w-10 sm:h-11 sm:w-11 rounded-xl flex items-center justify-center border transition-all duration-500 ${ne?`bg-blue-500/10 border-blue-500/30 text-blue-400 shadow-[0_0_16px_rgba(59,130,246,0.15)]`:`bg-white/5 border-white/10 text-white/30`}`,children:(0,A.jsx)(V7,{className:`h-5 w-5`})}),(0,A.jsxs)(`div`,{className:`min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-0.5`,children:[(0,A.jsx)(`h3`,{className:`font-black text-white tracking-tight text-base sm:text-lg uppercase leading-none truncate`,children:e.name}),ne&&(0,A.jsx)(`div`,{className:`hive-status-dot--active h-1.5 w-1.5 shrink-0`})]}),(0,A.jsx)(`p`,{className:`text-[11px] text-white/35 font-medium leading-none truncate`,children:e.id})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,A.jsx)(`span`,{className:`hidden sm:block text-[10px] font-black tracking-widest ${ne?`text-blue-400`:`text-white/30`}`,children:ne?`ON`:`OFF`}),(0,A.jsx)(sq,{checked:ne,onCheckedChange:N,className:`data-[state=checked]:bg-blue-500`})]})]})}),(0,A.jsxs)(`div`,{className:`px-5 pb-3 space-y-2 border-b border-white/5`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,A.jsx)(zwe,{className:`h-3.5 w-3.5 shrink-0 ${e.has_api_key?`text-emerald-400`:re?`text-amber-400`:`text-white/20`}`}),(0,A.jsx)(`span`,{className:`text-[11px] font-mono truncate`,children:e.masked_api_key?(0,A.jsx)(`span`,{className:`text-white/50`,children:e.masked_api_key}):e.has_api_key?(0,A.jsx)(`span`,{className:`text-white/50`,children:`••••••••••••••••`}):re?(0,A.jsx)(`span`,{className:`text-amber-400/70`,children:`Local — sin API key`}):(0,A.jsx)(`span`,{className:`text-white/25`,children:`Sin API key`})})]}),z&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,A.jsx)(Bwe,{className:`h-3.5 w-3.5 shrink-0 text-white/20`}),(0,A.jsx)(`span`,{className:`text-[11px] text-white/40 truncate font-mono`,children:z})]}),re&&(0,A.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,A.jsx)(V7,{className:`h-3.5 w-3.5 shrink-0 text-white/20`}),(0,A.jsxs)(`span`,{className:`text-[11px] text-white/40 font-mono`,children:[`ctx: `,(0,A.jsx)(`span`,{className:e.num_ctx?`text-amber-400/70`:`text-white/25`,children:e.num_ctx?`${e.num_ctx.toLocaleString()} tokens`:`32 768 (default)`})]})]})]}),(0,A.jsxs)(`div`,{className:`px-5 py-3 flex-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,A.jsxs)(`button`,{type:`button`,className:`flex items-center gap-2 flex-1 text-left text-[10px] font-black uppercase tracking-widest text-white/40 hover:text-white transition-colors`,onClick:()=>o(!a),children:[a?(0,A.jsx)(Iwe,{className:`h-3 w-3`}):(0,A.jsx)(Lwe,{className:`h-3 w-3`}),`MODELOS`,(0,A.jsxs)(`span`,{className:`hive-tag scale-90 origin-left`,children:[j.length,`/`,k.length]})]}),re&&(0,A.jsx)(`button`,{type:`button`,onClick:F,disabled:f,title:`Sincronizar modelos instalados en Ollama`,className:`h-6 w-6 flex items-center justify-center rounded-md text-white/30 hover:text-amber-400 hover:bg-amber-400/10 disabled:opacity-40 transition-colors`,children:(0,A.jsx)(Vwe,{className:`h-3 w-3 ${f?`animate-spin`:``}`})})]}),!a&&k.length>0&&(0,A.jsxs)(`div`,{className:`flex flex-wrap gap-1 mt-1`,children:[k.slice(0,3).map(e=>(0,A.jsx)(`span`,{className:`hive-tag text-[10px] ${e.enabled||e.active?``:`opacity-40`}`,children:e.name.split(`/`).pop()||e.name},e.id)),k.length>3&&(0,A.jsxs)(`span`,{className:`hive-tag text-[10px] text-white/30`,children:[`+`,k.length-3]})]}),a&&(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`hive-scroll max-h-44 overflow-y-auto flex flex-col gap-0.5 pr-1`,children:[k.length===0&&(0,A.jsx)(`p`,{className:`text-[11px] text-white/25 py-2 text-center`,children:`Sin modelos configurados`}),k.map(e=>{let t=e.enabled||!!e.active,n=m===e.id;return(0,A.jsx)(`div`,{className:`rounded-lg transition-colors ${t&&!n||n?`bg-white/5`:`bg-transparent opacity-40`}`,children:n?(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 px-2.5 py-1.5`,children:[(0,A.jsx)(`input`,{type:`text`,value:g,onChange:e=>_(e.target.value),placeholder:`Display name`,className:`w-full bg-white/5 border border-white/10 rounded-md px-2 h-7 text-[11px] text-white/70 placeholder-white/20 focus:outline-none focus:border-blue-500/50 transition-all`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(`input`,{type:`text`,value:v,onChange:e=>y(e.target.value),placeholder:`API model ID`,className:`flex-1 min-w-0 bg-white/5 border border-white/10 rounded-md px-2 h-7 text-[11px] text-white/70 placeholder-white/20 focus:outline-none focus:border-blue-500/50 transition-all font-mono`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>L(e),className:`shrink-0 h-7 w-7 flex items-center justify-center rounded-md bg-emerald-500/10 border border-emerald-500/20 text-emerald-400 hover:bg-emerald-500/20 transition-colors`,children:(0,A.jsx)(Wwe,{className:`h-3 w-3`})}),(0,A.jsx)(`button`,{type:`button`,onClick:I,className:`shrink-0 h-7 w-7 flex items-center justify-center rounded-md bg-white/5 border border-white/10 text-white/40 hover:text-white hover:bg-white/10 transition-colors`,children:(0,A.jsx)(Gwe,{className:`h-3 w-3`})})]})]}):(0,A.jsxs)(`div`,{className:`flex items-center justify-between px-2.5 py-1.5`,children:[(0,A.jsx)(`span`,{className:`text-[11px] font-medium text-white truncate flex-1 mr-2`,children:e.name}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,A.jsx)(`button`,{type:`button`,onClick:()=>ee(e),title:`Editar modelo`,className:`h-5 w-5 flex items-center justify-center rounded text-white/25 hover:text-blue-400 hover:bg-blue-400/10 transition-colors`,children:(0,A.jsx)(Hwe,{className:`h-3 w-3`})}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>R(e),disabled:b===e.id,title:`Eliminar modelo`,className:`h-5 w-5 flex items-center justify-center rounded text-white/25 hover:text-red-400 hover:bg-red-400/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:(0,A.jsx)(Uwe,{className:`h-3 w-3`})}),(0,A.jsx)(sq,{checked:t,onCheckedChange:t=>P(e,t),className:`scale-[0.7] origin-right data-[state=checked]:bg-blue-400 ml-0.5`})]})]})},e.id)})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 pt-1.5 border-t border-white/5`,children:[(0,A.jsx)(`input`,{type:`text`,value:s,onChange:e=>c(e.target.value),onKeyDown:e=>e.key===`Enter`&&te(),placeholder:`nombre-del-modelo`,className:`flex-1 min-w-0 bg-white/5 border border-white/10 rounded-md px-2 h-7 text-[11px] text-white/70 placeholder-white/20 focus:outline-none focus:border-blue-500/50 transition-all font-mono`}),(0,A.jsxs)(`button`,{type:`button`,onClick:te,disabled:l||!s.trim(),className:`shrink-0 h-7 px-2.5 flex items-center gap-1 rounded-md bg-blue-500/10 border border-blue-500/20 text-blue-400 text-[10px] font-black uppercase tracking-wider hover:bg-blue-500/20 disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[(0,A.jsx)(Rwe,{className:`h-3 w-3`}),(0,A.jsx)(`span`,{className:`hidden xs:inline`,children:`ADD`})]})]})]})]}),(0,A.jsxs)(`div`,{className:`px-4 py-3 border-t border-white/5 flex items-center justify-between gap-2 overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 overflow-hidden`,children:[(0,A.jsxs)(`div`,{className:`hive-stat shrink-0`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`Uptime`}),(0,A.jsx)(`span`,{className:`hive-stat__value`,children:`99.9%`})]}),(0,A.jsxs)(`div`,{className:`hive-stat shrink-0`,children:[(0,A.jsx)(`span`,{className:`hive-stat__label`,children:`Estado`}),(0,A.jsx)(`span`,{className:`hive-stat__value ${ne?`text-emerald-400`:`text-white/30`}`,children:ne?`Activo`:`Inactivo`})]})]}),(0,A.jsxs)(cq,{open:r,onOpenChange:i,children:[(0,A.jsx)(lq,{asChild:!0,children:(0,A.jsxs)(`button`,{className:`hive-btn hive-btn--ghost h-8 px-2.5 text-[10px] font-black uppercase tracking-widest text-blue-400 shrink-0 flex items-center gap-1.5`,children:[(0,A.jsx)(Fwe,{className:`h-3 w-3`}),(0,A.jsx)(`span`,{children:`CONFIG`})]})}),(0,A.jsxs)(pq,{className:`rounded-xl border border-white/10 p-0 overflow-hidden w-[calc(100vw-2rem)] max-w-md bg-[#09090b]`,children:[(0,A.jsxs)(`div`,{className:`p-5 border-b border-white/5 bg-white/5 relative overflow-hidden`,children:[(0,A.jsx)(`div`,{className:`absolute -top-10 -right-10 h-32 w-32 bg-blue-600/10 rounded-full blur-[80px] pointer-events-none`}),(0,A.jsx)(gq,{className:`text-lg font-black text-white uppercase tracking-tighter`,children:e.name}),(0,A.jsx)(_q,{className:`text-xs text-white/40 font-medium mt-0.5`,children:`Autenticación y punto de enlace.`})]}),(0,A.jsx)(`div`,{className:`p-5`,children:(0,A.jsx)(Pwe,{provider:e,onSave:M,onCancel:()=>i(!1)})})]})]})]}),(0,A.jsx)(`div`,{className:`hive-strip--bottom ${ne?``:`opacity-20`}`})]})}function qwe(){let{providers:e,updateProvider:t}=AR(),n=e.filter(e=>e.active).length;return(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(`h3`,{className:`hive-title-section`,children:`Providers de IA`}),(0,A.jsxs)(`span`,{className:`hive-tag hive-tag--provider`,children:[n,` activos / `,e.length,` total`]})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4 sm:gap-5`,children:[e.map(e=>(0,A.jsx)(Kwe,{provider:e,updateProvider:t},e.id)),e.length===0&&(0,A.jsx)(`div`,{className:`hive-empty-state col-span-full`,children:`No hay providers disponibles.`})]})]})}function Jwe({onSave:e,onCancel:t}){let[n,r]=(0,u.useState)(!1),[i,a]=(0,u.useState)(``),[o,s]=(0,u.useState)(``),[c,l]=(0,u.useState)(``),[d,f]=(0,u.useState)(``),[p,m]=(0,u.useState)(``),[h,g]=(0,u.useState)(``),_=o.toLowerCase()===`ollama`||d.includes(`localhost`)||d.includes(`127.0.0.1`);return(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`Nombre del Provider`}),(0,A.jsx)(G,{value:i,onChange:e=>a(e.target.value),placeholder:`Mi Provider Personalizado`,className:`hive-input !h-8 text-xs`}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Se usará como identificador interno`})]}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`Tipo de Provider`}),(0,A.jsx)(G,{value:o,onChange:e=>s(e.target.value),placeholder:`openai, anthropic, ollama...`,className:`hive-input !h-8 text-xs`}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/30`,children:`Ej: openai, anthropic, ollama, custom...`})]}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,A.jsx)(Z,{className:`hive-label`,children:`API Key`})}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{type:n?`text`:`password`,value:c,onChange:e=>l(e.target.value),placeholder:_?`Opcional para providers locales`:`sk-...`,className:`hive-input !h-8 text-xs pr-8`}),(0,A.jsx)(`button`,{type:`button`,onClick:()=>r(!n),className:`absolute right-0 top-0 h-8 w-8 flex items-center justify-center text-white/40 hover:text-white`,children:n?(0,A.jsx)(En,{className:`h-3 w-3`}):(0,A.jsx)(Dn,{className:`h-3 w-3`})})]})]}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`Base URL (opcional)`}),(0,A.jsx)(G,{value:d,onChange:e=>f(e.target.value),placeholder:`https://api.example.com o http://localhost:11434`,className:`hive-input !h-8 text-xs`})]}),_&&(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(Z,{className:`hive-label`,children:`Context Window (num_ctx)`}),(0,A.jsx)(`span`,{className:`text-[10px] text-white/30`,children:`tokens — por defecto 32 768`})]}),(0,A.jsx)(G,{type:`number`,value:h,onChange:e=>g(e.target.value),placeholder:`32768`,min:512,step:512,className:`hive-input !h-8 text-xs font-mono`}),(0,A.jsx)(`p`,{className:`text-[10px] text-amber-400/60`,children:`Aumenta si ves errores de contexto.`})]}),(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,A.jsx)(Z,{className:`hive-label`,children:`Custom Headers (JSON)`})}),(0,A.jsx)(`textarea`,{value:p,onChange:e=>m(e.target.value),placeholder:`{ "x-custom-header": "value" }`,rows:3,className:`w-full bg-white/5 border border-white/10 rounded-md p-2 text-xs text-white/70 focus:outline-none focus:border-blue-500/50 transition-all font-mono`})]}),(0,A.jsxs)(`div`,{className:`flex gap-2 pt-2`,children:[(0,A.jsx)(`button`,{className:`hive-btn hive-btn--form-cancel flex-1`,onClick:t,children:`Cancelar`}),(0,A.jsx)(`button`,{className:`hive-btn hive-btn--form-submit flex-1`,onClick:()=>{if(!i.trim()){eg.fire(`Error`,`El nombre del provider es requerido`,`error`);return}if(!o){eg.fire(`Error`,`Selecciona un tipo de provider`,`error`);return}if(!c.trim()&&!_){eg.fire(`Error`,`La API Key es requerida para este provider`,`error`);return}let t;if(p.trim())try{t=JSON.parse(p.trim())}catch{eg.fire(`Error`,`JSON de Headers inválido`,`error`);return}e({id:i.trim().toLowerCase().replace(/\s+/g,`-`),name:i.trim(),type:o,apiKey:c.trim()||``,baseUrl:d.trim()||void 0,headers:t,numCtx:h.trim()?Number(h.trim()):null})},children:`Crear Provider`})]}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/20 pt-2`,children:`La API key se guarda cifrada en la base de datos.`})]})}var Ywe=lr;function Xwe(){let{providers:e,createProvider:t}=AR(),[n,r]=(0,u.useState)(!1);return(0,A.jsxs)(`div`,{className:`space-y-4 mt-6 sm:mt-10`,children:[(0,A.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 mb-2`,children:[(0,A.jsx)(`div`,{className:`hive-page-header__dot`}),(0,A.jsx)(`span`,{className:`hive-page-header__label`,children:`INFRAESTRUCTURA`})]}),(0,A.jsxs)(`h2`,{className:`hive-title-page`,children:[`Providers de IA`,(0,A.jsx)(`span`,{className:`hive-title-page__accent`,children:`.`})]})]}),(0,A.jsxs)(cq,{open:n,onOpenChange:e=>{r(e)},children:[(0,A.jsx)(lq,{asChild:!0,children:(0,A.jsxs)(`button`,{className:`hive-btn hive-btn--primary`,children:[(0,A.jsx)(Ywe,{className:`mr-1 h-4 w-4`}),`Añadir Provider`]})}),(0,A.jsxs)(pq,{className:`max-w-md`,children:[(0,A.jsxs)(mq,{className:`p-6 border-b border-white/5 bg-white/5 relative overflow-hidden`,children:[(0,A.jsx)(`div`,{className:`hive-glow-blob hive-glow-blob--blue -top-10 -right-10 h-32 w-32 opacity-20`}),(0,A.jsx)(gq,{className:`text-xl font-black text-white uppercase tracking-tighter`,children:`Añadir Provider`}),(0,A.jsx)(_q,{className:`text-xs text-white/40 font-medium mt-1`,children:`Crea un nuevo provider de IA para tu infraestructura.`})]}),(0,A.jsx)(`div`,{className:`p-6`,children:(0,A.jsx)(Jwe,{onSave:async e=>{try{await t({id:e.id,name:e.name,base_url:e.baseUrl,api_key:e.apiKey,headers:e.headers,num_ctx:e.numCtx}),r(!1)}catch(e){console.error(`Error creating provider:`,e)}},onCancel:()=>r(!1)})})]})]})]}),(0,A.jsx)(qwe,{})]})}var Zwe=25e3,H7=1500,U7=3e4;function Qwe(){return`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/hivelearn-events?sessionId=hl-ui`}function $we(){let[e,t]=(0,u.useState)(!1),[n,r]=(0,u.useState)(!1),[i,a]=(0,u.useState)({}),[o,s]=(0,u.useState)(null),c=(0,u.useRef)(null),l=(0,u.useRef)(null),d=(0,u.useRef)(null),f=(0,u.useRef)(H7),p=(0,u.useRef)(!1),m=(0,u.useCallback)(()=>{l.current&&clearInterval(l.current),d.current&&clearTimeout(d.current),l.current=null,d.current=null},[]),h=(0,u.useCallback)(()=>{if(!p.current)try{let e=new WebSocket(Qwe());c.current=e,e.onopen=()=>{if(p.current){e.close();return}t(!0),f.current=H7,l.current=setInterval(()=>{e.readyState===WebSocket.OPEN&&e.send(JSON.stringify({type:`ping`}))},Zwe)},e.onmessage=t=>{if(!p.current)try{let n=JSON.parse(t.data);switch(n.type){case`ping`:e.send(JSON.stringify({type:`pong`}));break;case`pong`:break;case`hl:connected`:break;case`swarm_started`:r(!0),a({}),s(null);break;case`swarm_completed`:r(!1),s(null);break;case`agent_started`:{let e=n.agentId;s(e),a(t=>({...t,[e]:`running`}));break}case`agent_completed`:{let e=n.agentId;a(t=>({...t,[e]:`completed`})),s(t=>t===e?null:t);break}case`agent_failed`:{let e=n.agentId;a(t=>({...t,[e]:`failed`})),s(t=>t===e?null:t);break}}}catch{}},e.onclose=()=>{p.current||(t(!1),clearInterval(l.current),l.current=null,d.current=setTimeout(()=>{f.current=Math.min(f.current*2,U7),h()},f.current))},e.onerror=()=>{e.close()}}catch{d.current=setTimeout(()=>h(),U7)}},[m]);return(0,u.useEffect)(()=>(p.current=!1,h(),()=>{p.current=!0,m(),c.current?.close()}),[h,m]),{isConnected:e,isGenerating:n,agentStatuses:i,currentAgentId:o}}var eTe={"hl-profile-agent":{emoji:`👤`,label:`Perfil`,accion:`Analiza edad, nivel y estilo de aprendizaje`,phase:0},"hl-intent-agent":{emoji:`🎯`,label:`Intención`,accion:`Extrae el tema y define los objetivos`,phase:0},"hl-structure-agent":{emoji:`🗺️`,label:`Estructura`,accion:`Diseña el mapa de nodos del currículo`,phase:0},"hl-explanation-agent":{emoji:`📖`,label:`Explicación`,accion:`Genera teoría clara y ejemplos`,phase:1},"hl-exercise-agent":{emoji:`✏️`,label:`Ejercicios`,accion:`Crea práctica activa paso a paso`,phase:1},"hl-quiz-agent":{emoji:`❓`,label:`Quiz`,accion:`Prepara preguntas de verificación`,phase:1},"hl-challenge-agent":{emoji:`⚡`,label:`Reto`,accion:`Diseña desafíos integradores`,phase:1},"hl-code-agent":{emoji:`💻`,label:`Código`,accion:`Genera ejemplos ejecutables`,phase:1},"hl-svg-agent":{emoji:`📊`,label:`Diagrama`,accion:`Dibuja visualizaciones SVG`,phase:1},"hl-gif-agent":{emoji:`🎞️`,label:`Animación`,accion:`Crea guías animadas paso a paso`,phase:1},"hl-image-agent":{emoji:`🖼️`,label:`Imagen`,accion:`Genera imágenes educativas con IA`,phase:1},"hl-infographic-agent":{emoji:`📈`,label:`Infografía`,accion:`Construye resumen visual del tema`,phase:2},"hl-gamification-agent":{emoji:`🏆`,label:`Gamificación`,accion:`Asigna XP, logros y rachas`,phase:2},"hl-evaluation-agent":{emoji:`📝`,label:`Evaluación`,accion:`Prepara examen final adaptativo`,phase:2},"hl-coordinator-agent":{emoji:`🔍`,label:`Coordinador`,accion:`Revisa coherencia pedagógica`,phase:2},"hl-feedback-agent":{emoji:`🧠`,label:`Feedback`,accion:`Evalúa comprensión semántica del alumno`,phase:2}},W7=[[`hl-profile-agent`,`hl-intent-agent`,`hl-structure-agent`],[`hl-explanation-agent`,`hl-exercise-agent`,`hl-quiz-agent`,`hl-challenge-agent`,`hl-code-agent`,`hl-svg-agent`,`hl-gif-agent`,`hl-image-agent`],[`hl-infographic-agent`,`hl-gamification-agent`,`hl-evaluation-agent`,`hl-coordinator-agent`,`hl-feedback-agent`]],G7=[{label:`Análisis`,pill:`bg-amber-500/10 border-amber-500/30 text-amber-400`,cardBg:`bg-amber-500/[0.06]`,cardBorder:`border-amber-500/20`,cardBorderActive:`border-amber-500/60 shadow-[0_0_20px_rgba(245,158,11,0.2)]`,accent:`via-amber-500/60`,note:`Secuencial · cada uno espera al anterior`},{label:`Contenido`,pill:`bg-blue-500/10 border-blue-500/30 text-blue-400`,cardBg:`bg-blue-500/[0.06]`,cardBorder:`border-blue-500/20`,cardBorderActive:`border-blue-500/60 shadow-[0_0_20px_rgba(59,130,246,0.2)]`,accent:`via-blue-500/60`,note:`Paralelo · 8 agentes simultáneos`},{label:`Finalización`,pill:`bg-green-500/10 border-green-500/30 text-green-400`,cardBg:`bg-green-500/[0.06]`,cardBorder:`border-green-500/20`,cardBorderActive:`border-green-500/60 shadow-[0_0_20px_rgba(34,197,94,0.2)]`,accent:`via-green-500/60`,note:`Paralelo · revisión y cierre`}];function tTe({isConnected:e}){return(0,A.jsx)(`div`,{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-full border text-[10px] font-bold uppercase tracking-widest transition-all
253
+ ${e?`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`:`bg-white/5 border-white/10 text-white/30`}`,children:e?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Vr,{className:`h-3 w-3 animate-pulse`}),` Live`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Br,{className:`h-3 w-3`}),` Offline`]})})}function K7({agentId:e,dbAgent:t,liveStatus:n,isCurrentlyRunning:r,compact:i=!1,phase:a}){let o=Fd(),s=eTe[e];if(!s)return null;let c=G7[a],l=n===`running`||r,u=n===`completed`,d=n===`failed`,f=t&&!t.enabled,p=l?c.cardBorderActive:u?a===0?`border-amber-500/40`:a===1?`border-blue-500/40`:`border-green-500/40`:d?`border-red-500/30`:`${c.cardBorder} hover:border-white/20`,m=l?c.cardBg:u?`bg-white/[0.03]`:d?`bg-red-500/[0.04]`:`bg-white/[0.02] hover:bg-white/[0.03]`;return(0,A.jsxs)(`div`,{className:`
254
+ relative overflow-hidden rounded-xl border transition-all duration-300 group cursor-default
255
+ ${i?`p-3`:`p-4`}
256
+ ${m} ${p}
257
+ ${f?`opacity-50 grayscale`:``}
258
+ `,children:[l&&(0,A.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent ${c.accent} to-transparent animate-pulse`}),u&&(0,A.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent ${c.accent} to-transparent opacity-40`}),(0,A.jsxs)(`div`,{className:`flex ${i?`items-center gap-2`:`flex-col gap-2.5`}`,children:[(0,A.jsx)(`span`,{className:`${i?`text-xl`:`text-2xl`} leading-none flex-shrink-0 ${l?`animate-bounce`:``}`,children:s.emoji}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-wrap`,children:[(0,A.jsx)(`p`,{className:`font-bold text-white leading-tight ${i?`text-xs`:`text-sm`}`,children:s.label}),!i&&t?.enabled===!1&&(0,A.jsx)(`span`,{className:`text-[9px] px-1.5 py-0.5 rounded bg-white/5 text-white/30 border border-white/10`,children:`Inactivo`})]}),!i&&(0,A.jsx)(`p`,{className:`text-[11px] leading-tight mt-0.5 transition-colors ${l?`text-white/70`:`text-white/35`}`,children:l?`▶ ${s.accion}...`:s.accion})]}),(0,A.jsxs)(`div`,{className:`flex items-center ${i?`gap-1`:`justify-between gap-2 mt-1`}`,children:[(0,A.jsx)(q7,{liveStatus:n,isCurrentlyRunning:r}),!i&&t&&(0,A.jsx)(`button`,{onClick:()=>o(`/agents/${t.id}`),className:`p-1 rounded opacity-0 group-hover:opacity-100 transition-opacity text-white/30 hover:text-white hover:bg-white/10`,title:`Configurar agente`,children:(0,A.jsx)(or,{className:`h-3 w-3`})})]})]}),l&&(0,A.jsx)(`div`,{className:`absolute inset-0 rounded-xl pointer-events-none animate-pulse opacity-30 ring-1 ring-inset ring-current`})]})}function q7({liveStatus:e,isCurrentlyRunning:t}){return e===`running`||t?(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[9px] font-bold bg-amber-500/20 text-amber-300 border border-amber-500/30`,children:[(0,A.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse`}),` Activo ▶`]}):e===`completed`?(0,A.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[9px] font-bold bg-green-500/15 text-green-400 border border-green-500/20`,children:`✓ Listo`}):e===`failed`?(0,A.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[9px] font-bold bg-red-500/15 text-red-400 border border-red-500/20`,children:`✗ Error`}):(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[9px] font-bold bg-white/5 text-white/30 border border-white/10`,children:[(0,A.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-white/20`}),` En espera`]})}function nTe({isActive:e}){return(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-0.5 px-1 self-center flex-shrink-0`,children:[(0,A.jsx)(`div`,{className:`h-px w-6 border-t-2 border-dashed transition-colors ${e?`border-amber-500/60`:`border-white/10`}`}),(0,A.jsx)(`span`,{className:`text-xs font-bold transition-colors ${e?`text-amber-400/60`:`text-white/15`}`,children:`→`})]})}function J7({icon:e,title:t,description:n,colorClass:r}){return(0,A.jsxs)(`div`,{className:`rounded-xl border p-4 space-y-3 transition-all duration-200 hover:scale-[1.01] ${r}`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(e,{className:`h-4 w-4 text-white/40`}),(0,A.jsx)(`p`,{className:`font-bold text-white/90 text-sm`,children:t})]}),(0,A.jsx)(`p`,{className:`text-xs text-white/40 leading-relaxed`,children:n})]})}function rTe(){let e=Fd(),[t,n]=(0,u.useState)([]),[r,i]=(0,u.useState)(!0),[a,o]=(0,u.useState)(null),{isConnected:s,isGenerating:c,agentStatuses:l,currentAgentId:d}=$we(),f=async()=>{i(!0),o(null);try{n((await(await fetch(`/api/hivelearn/agents`)).json()).agents??[])}catch{o(`No se pudo cargar el enjambre HiveLearn.`)}finally{i(!1)}};(0,u.useEffect)(()=>{f()},[]);let p=new Map(t.map(e=>[e.id,e])),m=t.find(e=>e.role===`coordinator`),h=!!m?.providerId,g=W7.map(e=>e.some(e=>l[e]===`running`||l[e]===`completed`));return(0,A.jsx)(`div`,{className:`hive-page mt-8 animate-in fade-in duration-700`,children:(0,A.jsxs)(`div`,{className:`hive-page-container relative`,children:[(0,A.jsx)(`div`,{className:`absolute -top-40 -left-40 h-[500px] w-[500px] bg-amber-600/10 rounded-full blur-[120px] pointer-events-none opacity-50`}),(0,A.jsx)(`div`,{className:`absolute top-40 -right-40 h-[400px] w-[400px] bg-orange-600/8 rounded-full blur-[100px] pointer-events-none opacity-40`}),(0,A.jsxs)(`div`,{className:`relative z-10 flex flex-col sm:flex-row sm:items-end justify-between gap-6 mb-10 animate-in slide-in-from-left-8 duration-700`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 mb-3 opacity-80`,children:[(0,A.jsx)(`div`,{className:`h-2 w-2 rounded-full bg-amber-500 animate-pulse shadow-[0_0_10px_rgba(245,158,11,0.6)]`}),(0,A.jsx)(`span`,{className:`text-[10px] font-bold tracking-[0.2em] text-amber-400 uppercase`,children:`HIVELEARN · ENJAMBRE`})]}),(0,A.jsxs)(`h2`,{className:`text-4xl md:text-5xl font-black tracking-tight text-white mb-3`,children:[`Enjambre`,` `,(0,A.jsx)(`span`,{className:`text-transparent bg-clip-text bg-gradient-to-r from-amber-400 to-orange-500`,children:`Educativo`})]}),(0,A.jsxs)(`p`,{className:`text-white/50 text-sm max-w-xl leading-relaxed font-light`,children:[t.length||16,` agentes especializados colaboran en pipeline para generar lecciones adaptativas.`]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 animate-in slide-in-from-right-8 duration-700`,children:[(0,A.jsx)(tTe,{isConnected:s}),c&&(0,A.jsxs)(`span`,{className:`flex items-center gap-1.5 px-3 py-1 rounded-full bg-amber-500/15 border border-amber-500/30 text-amber-300 text-[10px] font-bold uppercase tracking-widest animate-pulse`,children:[(0,A.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse`}),` Generando...`]}),!h&&!r&&(0,A.jsxs)(`button`,{onClick:()=>e(`/hivelearn/config`),className:`px-4 py-2 bg-amber-600/20 hover:bg-amber-600/30 text-amber-400 hover:text-amber-300 rounded-lg border border-amber-500/30 hover:border-amber-400/50 transition-all duration-300 flex items-center gap-2 font-medium text-sm`,children:[(0,A.jsx)(br,{className:`h-4 w-4`}),`Configurar modelo`]}),(0,A.jsxs)(`button`,{className:`px-4 py-2 bg-white/5 hover:bg-white/10 text-white/70 hover:text-white rounded-lg border border-white/10 hover:border-white/20 transition-all duration-300 flex items-center gap-2 font-medium text-sm backdrop-blur-sm group`,onClick:f,disabled:r,children:[(0,A.jsx)(fr,{className:`h-4 w-4 text-amber-400 transition-transform duration-500 group-hover:rotate-180 ${r?`animate-spin`:``}`}),`Refrescar`]})]})]}),a&&(0,A.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border border-red-500/20 bg-red-500/5 mb-8`,children:[(0,A.jsx)(`div`,{className:`absolute top-0 left-0 w-1 h-full bg-red-500`}),(0,A.jsx)(`p`,{className:`px-6 py-5 text-red-400 text-sm font-medium`,children:a})]}),(0,A.jsxs)(`div`,{className:`relative z-10 space-y-10`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`p`,{className:`text-[10px] font-bold uppercase tracking-widest text-white/25 mb-5 px-1`,children:[`Pipeline · `,W7.flat().length,` agentes · 3 fases`]}),(0,A.jsx)(`div`,{className:`flex gap-1 items-start overflow-x-auto pb-3`,children:W7.map((e,t)=>{let n=G7[t],r=g[t];return(0,A.jsxs)(`div`,{className:`flex items-start gap-1 flex-shrink-0`,children:[(0,A.jsxs)(`div`,{className:`flex-shrink-0 space-y-2 transition-all duration-500 ${t===1?`w-[420px]`:`w-52`}`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-3 flex-wrap`,children:[(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 px-2.5 py-1 rounded-full text-[9px] font-bold uppercase tracking-widest border transition-all ${n.pill} ${r?`shadow-[0_0_12px_rgba(255,255,255,0.05)]`:``}`,children:[(0,A.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-current ${r?`animate-pulse`:``}`}),`Fase `,t,` · `,n.label]}),t===1&&(0,A.jsxs)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[9px] font-bold bg-blue-500/10 border border-blue-500/20 text-blue-400`,children:[(0,A.jsx)(Wr,{className:`h-3 w-3`}),` 8 en paralelo`]})]}),(0,A.jsx)(`p`,{className:`text-[10px] text-white/20 uppercase tracking-widest mb-3`,children:n.note}),t===1?(0,A.jsx)(`div`,{className:`grid grid-cols-4 gap-2`,children:e.map(e=>(0,A.jsx)(K7,{agentId:e,dbAgent:p.get(e),liveStatus:l[e]??`idle`,isCurrentlyRunning:d===e,compact:!0,phase:1},e))}):(0,A.jsx)(`div`,{className:`space-y-2`,children:e.map((n,i)=>(0,A.jsxs)(`div`,{children:[(0,A.jsx)(K7,{agentId:n,dbAgent:p.get(n),liveStatus:l[n]??`idle`,isCurrentlyRunning:d===n,phase:t}),t===0&&i<e.length-1&&(0,A.jsx)(`div`,{className:`flex justify-center py-1`,children:(0,A.jsx)(`div`,{className:`w-px h-4 border-l-2 border-dashed transition-colors ${r?`border-amber-500/30`:`border-white/8`}`})})]},n))})]}),t<2&&(0,A.jsx)(nTe,{isActive:g[t]||g[t+1]})]},t)})}),(0,A.jsxs)(`div`,{className:`mt-4 flex items-center justify-center gap-3 text-[10px] text-white/20 font-mono`,children:[(0,A.jsx)(`span`,{children:`⏱ Primera lección: ~2 min`}),(0,A.jsx)(`span`,{className:`text-white/8`,children:`·`}),(0,A.jsx)(`span`,{children:`🐝 Con caché: ~10 seg`}),c&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`text-white/8`,children:`·`}),(0,A.jsx)(`span`,{className:`text-amber-400/60 animate-pulse`,children:`🔄 Generando ahora...`})]})]})]}),!r&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`px-1 pb-3 text-[10px] font-bold uppercase tracking-widest text-amber-400/50`,children:`Coordinador del enjambre`}),(0,A.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border border-amber-500/30 bg-gradient-to-br from-amber-500/10 via-amber-500/5 to-transparent backdrop-blur-sm p-6`,children:[(0,A.jsx)(`div`,{className:`absolute top-0 left-0 w-1 h-full bg-gradient-to-b from-amber-400 to-orange-500`}),(0,A.jsx)(`div`,{className:`absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-amber-500/60 to-transparent`}),(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,A.jsx)(`div`,{className:`p-3 rounded-xl bg-amber-500/15 border border-amber-500/30 shadow-[0_0_20px_rgba(245,158,11,0.15)] flex-shrink-0`,children:(0,A.jsx)(_n,{className:`h-6 w-6 text-amber-400`})}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-1 flex-wrap`,children:[(0,A.jsx)(`h3`,{className:`font-bold text-white text-lg`,children:m?.name??`hl-coordinator-agent`}),(0,A.jsx)(`span`,{className:`px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider bg-amber-500/20 text-amber-400 border border-amber-500/30`,children:`Coordinador`}),m&&(0,A.jsx)(q7,{liveStatus:l[`hl-coordinator-agent`]??`idle`,isCurrentlyRunning:d===`hl-coordinator-agent`})]}),(0,A.jsx)(`p`,{className:`text-white/50 text-sm leading-relaxed`,children:m?.description??`Coordina el enjambre educativo completo y revisa la coherencia pedagógica del programa generado.`}),(0,A.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-white/20 text-xs`,children:[(0,A.jsx)(nr,{className:`h-3.5 w-3.5 text-amber-400/40`}),(0,A.jsxs)(`span`,{children:[`Delega tareas a `,W7.flat().length-1,` agentes workers · revisión final antes de entregar`]})]})]})]}),(0,A.jsxs)(`div`,{className:`flex flex-col items-end gap-2 shrink-0`,children:[m?.providerId&&(0,A.jsxs)(`div`,{className:`text-[10px] text-white/30 text-right`,children:[(0,A.jsx)(`div`,{className:`font-mono`,children:m.providerId}),(0,A.jsx)(`div`,{className:`font-mono text-amber-400/60`,children:m.modelId})]}),m&&(0,A.jsxs)(`button`,{onClick:()=>e(`/agents/${m.id}`),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-white/5 border border-white/10 text-white/50 hover:text-white hover:bg-white/10 text-xs transition-all`,children:[(0,A.jsx)(or,{className:`h-3 w-3`}),` Configurar`]})]})]}),(0,A.jsx)(`div`,{className:`absolute bottom-0 right-0 left-0 h-px bg-gradient-to-r from-transparent via-amber-500/20 to-transparent`})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`px-1 pb-4 text-[10px] font-bold uppercase tracking-widest text-white/25`,children:`¿Cómo funciona el enjambre?`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-4`,children:[(0,A.jsx)(J7,{icon:Nn,title:`DAG Scheduler`,description:`Orquesta los 16 agentes en orden óptimo con un grafo de dependencias. Ningún agente comienza hasta que sus dependencias estén listas.`,colorClass:`bg-amber-500/5 border-amber-500/20 hover:border-amber-500/40`}),(0,A.jsx)(J7,{icon:Wr,title:`Paralelismo Inteligente`,description:`8 agentes de contenido trabajan simultáneamente. El tiempo total = el más lento. Hasta 8× más rápido que secuencial.`,colorClass:`bg-blue-500/5 border-blue-500/20 hover:border-blue-500/40`}),(0,A.jsx)(J7,{icon:vn,title:`Caché de Nodos`,description:`Los nodos ya generados se reutilizan. Segunda lección del mismo tema: disponible en ~10 segundos sin re-ejecutar agentes.`,colorClass:`bg-purple-500/5 border-purple-500/20 hover:border-purple-500/40`})]})]})]})]})})}function iTe({providers:e,selectedId:t,onSelect:n}){return e.length===0?(0,A.jsxs)(`div`,{className:`rounded-xl border border-dashed border-white/10 bg-white/[0.02] p-6 text-center`,children:[(0,A.jsx)(an,{className:`mx-auto mb-3 h-8 w-8 text-white/20`}),(0,A.jsxs)(`p`,{className:`text-sm text-white/40 italic`,children:[`No hay proveedores activos. Configura uno en`,` `,(0,A.jsx)(`a`,{href:`/providers`,className:`text-amber-400 hover:text-amber-300 hover:underline transition-colors`,children:`Providers`}),`.`]})]}):(0,A.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3`,children:e.map(e=>{let r=t===e.id;return(0,A.jsxs)(`button`,{onClick:()=>n(e.id),className:`relative rounded-xl py-4 px-4 text-sm font-medium border transition-all duration-300 text-left overflow-hidden group
259
+ ${r?`border-amber-500/60 text-amber-300 shadow-[0_0_20px_hsl(var(--hive-amber)/0.12)]`:`border-white/[0.06] text-white/60 hover:border-amber-500/30 hover:text-white/90`}`,style:{background:r?`hsl(var(--hive-amber) / 0.15)`:`hsl(0 0% 100% / 0.02)`},children:[r&&(0,A.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-br from-amber-500/10 to-transparent pointer-events-none`}),(0,A.jsxs)(`div`,{className:`relative z-10`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,A.jsx)(`span`,{className:`font-bold text-sm`,children:e.name}),(0,A.jsx)(`div`,{className:`h-2 w-2 rounded-full ${e.active?`bg-green-500`:`bg-red-500/50`}`})]}),(0,A.jsx)(`div`,{className:`text-[9px] font-mono opacity-50 tracking-wider mb-2`,children:e.id}),(0,A.jsx)(`div`,{className:`flex items-center gap-1.5`,children:e.hasApiKey?(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[9px] text-emerald-400`,children:[(0,A.jsx)(Un,{className:`h-2.5 w-2.5`}),`Configurado`]}):e.isLocal?(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[9px] text-amber-400/70`,children:[(0,A.jsx)(sn,{className:`h-2.5 w-2.5`}),`Local`]}):(0,A.jsxs)(`span`,{className:`flex items-center gap-1 text-[9px] text-white/20`,children:[(0,A.jsx)(an,{className:`h-2.5 w-2.5`}),`Sin clave`]})})]})]},e.id)})})}function aTe({models:e,selectedId:t,onSelect:n}){return e.length===0?(0,A.jsxs)(`div`,{className:`rounded-xl border border-dashed border-white/10 bg-white/[0.02] p-6 text-center`,children:[(0,A.jsx)(gn,{className:`mx-auto mb-3 h-8 w-8 text-white/20`}),(0,A.jsx)(`p`,{className:`text-sm text-white/40 italic`,children:`No hay modelos disponibles para este proveedor.`})]}):(0,A.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3`,children:e.map(e=>{let r=t===e.id;return(0,A.jsxs)(`button`,{onClick:()=>n(e.id),className:`relative rounded-xl py-4 px-4 text-sm font-medium border transition-all duration-300 text-left overflow-hidden
260
+ ${r?`border-amber-500/60 text-amber-300 shadow-[0_0_20px_hsl(var(--hive-amber)/0.12)]`:`border-white/[0.06] text-white/60 hover:border-amber-500/30 hover:text-white/90`}`,style:{background:r?`hsl(var(--hive-amber) / 0.15)`:`hsl(0 0% 100% / 0.02)`},children:[r&&(0,A.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-br from-amber-500/10 to-transparent pointer-events-none`}),(0,A.jsxs)(`div`,{className:`relative z-10`,children:[(0,A.jsx)(`div`,{className:`font-bold text-sm mb-1`,children:e.name}),e.context_window&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1 text-[9px] font-mono opacity-50 tracking-wider mb-2`,children:[(0,A.jsx)(gn,{className:`h-2.5 w-2.5`}),(e.context_window/1e3).toFixed(0),`K tokens`]}),e.capabilities&&Array.isArray(e.capabilities)&&e.capabilities.length>0&&(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1 mt-2`,children:e.capabilities.map(e=>(0,A.jsx)(`span`,{className:`px-1.5 py-0.5 rounded text-[8px] font-medium uppercase tracking-wider border`,style:{background:`hsl(var(--hive-blue) / 0.1)`,borderColor:`hsl(var(--hive-blue) / 0.2)`,color:`hsl(var(--hive-blue))`},children:e},e))})]})]},e.id)})})}function oTe({providerName:e,modelName:t,agentCount:n}){return(0,A.jsxs)(`div`,{className:`rounded-xl border p-5`,style:{borderColor:`hsl(var(--hive-amber) / 0.2)`,background:`hsl(var(--hive-amber) / 0.05)`,boxShadow:`0 0 25px hsl(var(--hive-amber) / 0.06)`},children:[(0,A.jsx)(`div`,{className:`text-[9px] uppercase tracking-[0.2em] mb-2 font-bold`,style:{color:`hsl(var(--hive-amber) / 0.6)`},children:`Configuración seleccionada`}),(0,A.jsxs)(`div`,{className:`text-sm flex items-center gap-3`,style:{color:`hsl(var(--hive-surface-foreground))`},children:[(0,A.jsx)(`span`,{className:`font-bold`,style:{color:`hsl(var(--hive-amber))`},children:e}),(0,A.jsx)(Ht,{className:`h-4 w-4 flex-shrink-0`,style:{color:`hsl(var(--hive-amber) / 0.4)`}}),(0,A.jsx)(`span`,{className:`font-bold`,style:{color:`hsl(var(--hive-amber))`},children:t})]}),(0,A.jsxs)(`div`,{className:`text-[11px] mt-2 font-mono tracking-wide`,style:{color:`hsl(var(--hive-muted-foreground))`},children:[`Se aplicará a los `,n,` agentes del enjambre`]})]})}var Y7=[{label:`Análisis`,agents:[`👤`,`🎯`,`🗺️`],color:`text-amber-400`,pillBg:`bg-amber-500/10`,pillBorder:`border-amber-500/20`},{label:`Contenido`,agents:[`📖`,`✏️`,`❓`,`⚡`,`💻`,`📊`,`🎞️`,`🖼️`],color:`text-blue-400`,pillBg:`bg-blue-500/10`,pillBorder:`border-blue-500/20`},{label:`Final`,agents:[`📈`,`🏆`,`📝`,`🔍`,`🧠`],color:`text-emerald-400`,pillBg:`bg-emerald-500/10`,pillBorder:`border-emerald-500/20`}];function sTe({agentCount:e}){let[t,n]=(0,u.useState)(!1);return(0,A.jsxs)(`div`,{className:`rounded-2xl border overflow-hidden`,style:{borderColor:`hsl(0 0% 100% / 0.06)`,background:`hsl(220 15% 11% / 0.8)`,backdropFilter:`blur(20px)`},children:[(0,A.jsxs)(`button`,{onClick:()=>n(e=>!e),className:`w-full flex items-center justify-between px-6 py-4 text-left hover:bg-white/[0.02] transition-colors`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-lg`,children:`🐝`}),(0,A.jsxs)(`span`,{className:`text-sm font-semibold`,style:{color:`hsl(var(--hive-muted-foreground))`},children:[`Ver cómo trabajan los `,e,` agentes`]})]}),(0,A.jsx)(en,{className:`h-4 w-4 transition-transform duration-300 ${t?`rotate-180`:``}`,style:{color:`hsl(0 0% 100% / 0.3)`}})]}),t&&(0,A.jsxs)(`div`,{className:`px-6 pb-6 animate-in fade-in slide-in-from-top-2 duration-300`,children:[(0,A.jsx)(`div`,{className:`h-px bg-gradient-to-r from-transparent via-white/8 to-transparent mb-5`}),(0,A.jsx)(`div`,{className:`flex items-start gap-3 overflow-x-auto pb-2`,children:Y7.map((e,t)=>(0,A.jsxs)(`div`,{className:`flex items-center gap-3 flex-shrink-0`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(`span`,{className:`inline-flex items-center px-2.5 py-1 rounded-full text-[9px] font-bold uppercase tracking-[0.15em] border ${e.pillBg} ${e.pillBorder} ${e.color}`,children:e.label}),(0,A.jsx)(`div`,{className:`flex flex-wrap gap-1.5 max-w-[200px]`,children:e.agents.map(e=>(0,A.jsx)(`span`,{className:`w-8 h-8 rounded-lg flex items-center justify-center text-base hover:bg-white/[0.08] hover:border-white/10 transition-all cursor-default border`,style:{background:`hsl(0 0% 100% / 0.04)`,borderColor:`hsl(0 0% 100% / 0.06)`},children:e},e))})]}),t<Y7.length-1&&(0,A.jsxs)(`div`,{className:`flex flex-col items-center gap-1 self-center mt-4`,children:[(0,A.jsx)(`div`,{className:`w-8 h-px border-t-2 border-dashed`,style:{borderTopColor:`hsl(var(--hive-amber) / 0.2)`}}),(0,A.jsx)(`span`,{className:`text-xs`,style:{color:`hsl(var(--hive-amber) / 0.25)`},children:`→`})]})]},e.label))})]})]})}var cTe={amber:{bg:`bg-amber-500/5`,border:`border-amber-500/15`,borderHover:`hover:border-amber-500/25`,iconBg:`bg-amber-500/10`,iconBorder:`border-amber-500/20`,iconColor:`text-amber-400`},blue:{bg:`bg-blue-500/5`,border:`border-blue-500/15`,borderHover:`hover:border-blue-500/25`,iconBg:`bg-blue-500/10`,iconBorder:`border-blue-500/20`,iconColor:`text-blue-400`},purple:{bg:`bg-purple-500/5`,border:`border-purple-500/15`,borderHover:`hover:border-purple-500/25`,iconBg:`bg-purple-500/10`,iconBorder:`border-purple-500/20`,iconColor:`text-purple-400`}};function X7({icon:e,title:t,description:n,theme:r}){let i=cTe[r];return(0,A.jsxs)(`div`,{className:`rounded-xl border p-5 space-y-3 transition-all duration-300 hover:scale-[1.02] ${i.bg} ${i.border} ${i.borderHover}`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsx)(`div`,{className:`p-2 rounded-lg border ${i.iconBg} ${i.iconBorder}`,children:(0,A.jsx)(e,{className:`h-4 w-4 ${i.iconColor}`})}),(0,A.jsx)(`p`,{className:`text-xs font-bold`,style:{color:`hsl(var(--hive-foreground) / 0.8)`},children:t})]}),(0,A.jsx)(`p`,{className:`text-[11px] leading-relaxed`,style:{color:`hsl(var(--hive-muted-foreground))`},children:n})]})}function lTe({type:e,message:t}){return e===`loading`?(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5 text-sm animate-in fade-in duration-300`,style:{color:`hsl(var(--hive-amber))`},children:[(0,A.jsx)(Yn,{className:`h-4 w-4 animate-spin flex-shrink-0`}),(0,A.jsx)(`span`,{children:`Guardando configuración...`})]}):e===`success`?(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5 text-sm animate-in fade-in duration-300`,style:{color:`hsl(var(--hive-green))`},children:[(0,A.jsx)(sn,{className:`h-4 w-4 flex-shrink-0`}),(0,A.jsx)(`span`,{children:t})]}):(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5 text-sm rounded-xl p-3 animate-in fade-in duration-300 border`,style:{color:`hsl(var(--hive-red))`,background:`hsl(var(--hive-red) / 0.05)`,borderColor:`hsl(var(--hive-red) / 0.2)`},children:[(0,A.jsx)(an,{className:`h-4 w-4 flex-shrink-0`}),(0,A.jsx)(`span`,{children:t})]})}function uTe(){let[e,t]=(0,u.useState)([]),[n,r]=(0,u.useState)([]),[i,a]=(0,u.useState)(null),[o,s]=(0,u.useState)(null),[c,l]=(0,u.useState)(!0),[d,f]=(0,u.useState)(!1),[p,m]=(0,u.useState)(`idle`),[h,g]=(0,u.useState)(null),[_,v]=(0,u.useState)(0);(0,u.useEffect)(()=>{(async()=>{l(!0);try{let[e,n,i,o]=await Promise.all([fetch(`/api/providers`),fetch(`/api/models`),fetch(`/api/hivelearn/config`),fetch(`/api/hivelearn/agents`)]),c=await e.json(),l=await n.json(),u=await i.json(),d=await o.json(),f=(c.providers??[]).filter(e=>e.enabled||e.active).map(e=>({id:e.id,name:e.name,active:e.active??!1,hasApiKey:!!e.config?.apiKey||e.isLocal||!!e.api_key,isLocal:e.isLocal??!1})),p=(l.models??[]).filter(e=>e.enabled||e.active).map(e=>({id:e.id,name:e.name,provider_id:e.provider_id,context_window:e.context_window,capabilities:Array.isArray(e.capabilities)?e.capabilities:[],active:e.active??!1}));t(f),r(p),v((d.agents??[]).length||16),u.configured&&u.providerId&&(a(u.providerId),s(u.modelId))}catch{}finally{l(!1)}})()},[]);let y=n.filter(e=>e.provider_id===i),b=(0,u.useCallback)(async()=>{if(!(!i||!o)){f(!0),m(`loading`),g(null);try{let e=await(await fetch(`/api/hivelearn/config`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({providerId:i,modelId:o})})).json();e.ok||e.configured?(m(`success`),setTimeout(()=>m(`idle`),3e3)):(m(`error`),g(e.error??`Error al guardar`))}catch{m(`error`),g(`Error de conexión`)}finally{f(!1)}}},[i,o]),x=e.find(e=>e.id===i)?.name??``,S=n.find(e=>e.id===o)?.name??``;return(0,A.jsxs)(`div`,{className:`hive-page`,children:[(0,A.jsxs)(`div`,{className:`fixed inset-0 pointer-events-none`,children:[(0,A.jsx)(`div`,{className:`absolute top-0 left-1/4 h-[600px] w-[600px] rounded-full blur-[150px]`,style:{background:`hsl(var(--hive-amber) / 0.05)`}}),(0,A.jsx)(`div`,{className:`absolute bottom-0 right-0 h-[500px] w-[500px] rounded-full blur-[150px]`,style:{background:`hsl(var(--hive-blue-dark) / 0.05)`}})]}),(0,A.jsxs)(`div`,{className:`hive-page-container`,children:[(0,A.jsx)(`div`,{className:`mb-12 animate-in slide-in-from-left-8 duration-700`,children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between mb-6`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3 mb-4`,children:[(0,A.jsx)(`div`,{className:`h-2 w-2 rounded-full animate-pulse`,style:{background:`hsl(var(--hive-amber))`,boxShadow:`0 0 10px hsl(var(--hive-amber) / 0.6)`}}),(0,A.jsx)(`span`,{className:`text-[10px] font-bold tracking-[0.25em] uppercase`,style:{color:`hsl(var(--hive-amber))`},children:`HIVELEARN`})]}),(0,A.jsxs)(`h1`,{className:`text-4xl md:text-5xl font-black tracking-tight mb-4`,style:{letterSpacing:`-0.02em`,color:`hsl(var(--hive-foreground))`},children:[`Configuración del`,` `,(0,A.jsx)(`span`,{className:`italic`,style:{color:`hsl(var(--hive-amber))`},children:`Enjambre`})]}),(0,A.jsxs)(`p`,{className:`text-sm max-w-lg leading-relaxed font-light`,style:{color:`hsl(var(--hive-muted-foreground))`},children:[`Selecciona el proveedor y modelo que usarán los `,_||16,` agentes educativos. Esta configuración se aplica a todo el enjambre.`]})]}),(0,A.jsxs)(`div`,{className:`hidden sm:flex items-center gap-2 px-4 py-2 rounded-full border`,style:{background:`hsl(var(--hive-surface) / 0.8)`,borderColor:`hsl(0 0% 100% / 0.06)`},children:[(0,A.jsx)(qt,{className:`h-4 w-4`,style:{color:`hsl(var(--hive-amber))`}}),(0,A.jsxs)(`span`,{className:`text-sm font-semibold`,children:[_||16,` agentes activos`]})]})]})}),c?(0,A.jsx)(`div`,{className:`h-64 rounded-2xl animate-pulse border`,style:{background:`hsl(var(--hive-surface))`,borderColor:`hsl(0 0% 100% / 0.05)`}}):(0,A.jsxs)(`div`,{className:`space-y-8`,children:[(0,A.jsxs)(`div`,{className:`rounded-2xl border backdrop-blur-xl p-8 space-y-6`,style:{borderColor:`hsl(0 0% 100% / 0.06)`,background:`hsl(220 15% 11% / 0.8)`,boxShadow:`0 20px 60px hsl(0 0% 0% / 0.4)`},children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,A.jsx)(`div`,{className:`p-3 rounded-xl border`,style:{background:`hsl(var(--hive-amber) / 0.1)`,borderColor:`hsl(var(--hive-amber) / 0.2)`,boxShadow:`0 0 15px hsl(var(--hive-amber) / 0.1)`},children:(0,A.jsx)(Jt,{className:`h-5 w-5`,style:{color:`hsl(var(--hive-amber))`}})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{className:`text-lg font-semibold`,style:{color:`hsl(var(--hive-foreground))`},children:`Motor de Inteligencia`}),(0,A.jsx)(`p`,{className:`text-xs mt-0.5`,style:{color:`hsl(var(--hive-muted-foreground) / 0.5)`},children:`Configura el cerebro compartido del enjambre`})]})]}),(0,A.jsx)(`div`,{className:`h-px bg-gradient-to-r from-transparent via-white/8 to-transparent`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block text-xs font-bold uppercase tracking-widest mb-4`,style:{color:`hsl(var(--hive-muted-foreground) / 0.6)`},children:`Proveedor`}),(0,A.jsx)(iTe,{providers:e,selectedId:i,onSelect:e=>{a(e),s(null),m(`idle`)}})]}),i&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`block text-xs font-bold uppercase tracking-widest mb-4`,style:{color:`hsl(var(--hive-muted-foreground) / 0.6)`},children:`Modelo`}),(0,A.jsx)(aTe,{models:y,selectedId:o,onSelect:e=>{s(e),m(`idle`)}})]}),i&&o&&x&&S&&(0,A.jsx)(oTe,{providerName:x,modelName:S,agentCount:_||16}),(0,A.jsx)(`button`,{onClick:b,disabled:!i||!o||d,className:`w-full py-3.5 px-6 rounded-xl text-black font-bold text-sm disabled:opacity-40 disabled:cursor-not-allowed transition-all duration-300 flex items-center justify-center gap-2.5 active:scale-[0.98]`,style:{background:`linear-gradient(135deg, hsl(var(--hive-amber)), hsl(var(--hive-orange)))`,boxShadow:`0 0 20px hsl(var(--hive-amber) / 0.25)`},onMouseEnter:e=>{e.currentTarget.disabled||(e.currentTarget.style.background=`linear-gradient(135deg, hsl(var(--hive-amber) / 0.9), hsl(var(--hive-orange) / 0.9))`,e.currentTarget.style.boxShadow=`0 0 30px hsl(var(--hive-amber) / 0.4)`)},onMouseLeave:e=>{e.currentTarget.disabled||(e.currentTarget.style.background=`linear-gradient(135deg, hsl(var(--hive-amber)), hsl(var(--hive-orange)))`,e.currentTarget.style.boxShadow=`0 0 20px hsl(var(--hive-amber) / 0.25)`)},children:d?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(br,{className:`h-4 w-4 animate-spin`}),`Guardando...`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(br,{className:`h-4 w-4`}),`Guardar configuración`]})}),p!==`idle`&&(0,A.jsx)(lTe,{type:p===`loading`?`loading`:p===`success`?`success`:`error`,message:p===`success`?`Configuración guardada — los ${_||16} agentes ahora usan ${x} / ${S}`:h??`Error desconocido`})]}),(0,A.jsx)(sTe,{agentCount:_||16}),(0,A.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-4`,children:[(0,A.jsx)(X7,{icon:Nn,title:`DAG Scheduler`,description:`Orquesta los agentes en orden óptimo con grafo de dependencias.`,theme:`amber`}),(0,A.jsx)(X7,{icon:Wr,title:`Paralelismo`,description:`8 agentes de contenido trabajan simultáneamente. Hasta 8× más rápido.`,theme:`blue`}),(0,A.jsx)(X7,{icon:vn,title:`Caché Inteligente`,description:`Nodos ya generados se reutilizan. Segunda lección del mismo tema: ~10s.`,theme:`purple`})]}),(0,A.jsx)(`div`,{className:`rounded-xl border p-4 text-center backdrop-blur-sm`,style:{background:`hsl(220 15% 11% / 0.6)`,borderColor:`hsl(0 0% 100% / 0.06)`},children:(0,A.jsxs)(`p`,{className:`text-[11px] font-mono tracking-wider`,style:{color:`hsl(var(--hive-muted-foreground) / 0.35)`},children:[`⏱ Primera lección: ~2 min \xA0·\xA0 🐝 Con caché: ~10 seg \xA0·\xA0 `,_||16,` agentes activos`]})})]})]})]})}var dTe={nino:`Niño`,adolescente:`Adolescente`,adulto:`Adulto`},fTe={principiante:`🌱`,intermedio:`⚡`,avanzado:`🔥`,experto:`💎`};function Z7({icon:e,value:t,label:n,color:r}){return(0,A.jsxs)(`div`,{className:`flex-1 rounded-xl border p-4 flex flex-col gap-1 ${r}`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(e,{className:`h-3.5 w-3.5 opacity-70`}),(0,A.jsx)(`span`,{className:`text-[10px] uppercase tracking-widest font-bold opacity-60`,children:n})]}),(0,A.jsx)(`span`,{className:`text-xl font-black`,children:t})]})}function pTe({session:e,onDelete:t,onResume:n}){let[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(!1),s=e.total_nodos>0?Math.round(e.nodos_completados/e.total_nodos*100):0,c=new Date((e.created_at||0)*1e3).toLocaleDateString(`es`,{day:`numeric`,month:`short`,year:`numeric`}),l=fTe[e.nivel_alcanzado]??`📚`,d=!!e.completada;return(0,A.jsxs)(`div`,{className:`relative overflow-hidden rounded-2xl border transition-all duration-300 group flex flex-col
261
+ ${d?`bg-green-500/[0.03] border-green-500/20 hover:border-green-500/40 hover:shadow-[0_0_20px_rgba(34,197,94,0.08)]`:`bg-white/[0.02] border-white/8 hover:border-amber-500/30 hover:shadow-[0_0_20px_rgba(245,158,11,0.08)]`}`,children:[(0,A.jsx)(`div`,{className:`h-px w-full ${d?`bg-gradient-to-r from-transparent via-green-500/50 to-transparent`:`bg-gradient-to-r from-transparent via-amber-500/40 to-transparent`}`}),(0,A.jsx)(`div`,{className:`absolute top-0 left-0 w-0.5 h-full
262
+ ${d?`bg-gradient-to-b from-green-400/60 to-transparent`:`bg-gradient-to-b from-amber-400/60 to-transparent`}`}),(0,A.jsxs)(`div`,{className:`p-5 flex flex-col flex-1 gap-3`,children:[(0,A.jsx)(`div`,{className:`flex items-start justify-between gap-2`,children:(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[(0,A.jsx)(`span`,{className:`text-lg`,children:l}),(0,A.jsx)(`span`,{className:`text-[10px] px-2 py-0.5 rounded-full font-bold uppercase tracking-wider border
263
+ ${d?`bg-green-500/15 border-green-500/25 text-green-400`:`bg-amber-500/15 border-amber-500/25 text-amber-400`}`,children:d?`Completada`:`En progreso`})]}),(0,A.jsx)(`p`,{className:`text-white font-bold text-sm leading-snug line-clamp-2 group-hover:text-white transition-colors`,children:e.meta||`Sesión sin título`}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mt-1.5 flex-wrap`,children:[(0,A.jsx)(`span`,{className:`text-white/40 text-xs`,children:e.nombre}),e.rango_edad&&(0,A.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-white/5 text-white/30 uppercase tracking-wider font-medium`,children:dTe[e.rango_edad]??e.rango_edad})]})]})}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`div`,{className:`flex justify-between text-[11px] text-white/30 mb-1.5`,children:[(0,A.jsxs)(`span`,{children:[e.nodos_completados,` / `,e.total_nodos,` nodos`]}),(0,A.jsxs)(`span`,{className:`font-bold ${d?`text-green-400`:`text-amber-400`}`,children:[s,`%`]})]}),(0,A.jsx)(`div`,{className:`h-1.5 rounded-full bg-white/5 overflow-hidden`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full transition-all duration-700 ${d?`bg-green-500/60`:`bg-gradient-to-r from-amber-500/70 to-orange-500/70`}`,style:{width:`${s}%`}})})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 text-xs`,children:[e.xp_total>0&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1 text-amber-400/80 font-semibold`,children:[(0,A.jsx)(Wr,{className:`h-3 w-3`}),e.xp_total,` XP`]}),e.evaluacion_puntaje!=null&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1 text-purple-400/80 font-semibold`,children:[(0,A.jsx)(kr,{className:`h-3 w-3`}),e.evaluacion_puntaje,`%`]}),e.nivel_alcanzado&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1 text-blue-400/60 font-medium capitalize`,children:[(0,A.jsx)(Wt,{className:`h-3 w-3`}),e.nivel_alcanzado]}),(0,A.jsx)(`span`,{className:`ml-auto text-white/20`,children:c})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mt-auto pt-1 border-t border-white/5`,children:[!d&&(0,A.jsxs)(`button`,{onClick:()=>n(e.session_id),className:`flex-1 flex items-center justify-center gap-1.5 py-2 rounded-lg bg-amber-500/10 hover:bg-amber-500/20 border border-amber-500/20 hover:border-amber-500/40 text-amber-400 text-xs font-bold transition-all`,children:[(0,A.jsx)(cr,{className:`h-3.5 w-3.5`}),`Continuar`]}),d&&(0,A.jsxs)(`button`,{onClick:()=>n(e.session_id),className:`flex-1 flex items-center justify-center gap-1.5 py-2 rounded-lg bg-green-500/10 hover:bg-green-500/20 border border-green-500/20 hover:border-green-500/30 text-green-400 text-xs font-bold transition-all`,children:[(0,A.jsx)(Kt,{className:`h-3.5 w-3.5`}),`Revisar`]}),(0,A.jsxs)(`button`,{onClick:async()=>{if(!r){i(!0);return}o(!0);try{await fetch(`/api/hivelearn/sessions/${e.session_id}`,{method:`DELETE`}),t(e.session_id)}catch{o(!1),i(!1)}},disabled:a,onBlur:()=>i(!1),className:`flex items-center justify-center gap-1.5 py-2 px-3 rounded-lg border text-xs font-bold transition-all
264
+ ${r?`bg-red-500/20 border-red-500/40 text-red-400 hover:bg-red-500/30`:`bg-white/[0.02] border-white/8 text-white/30 hover:text-red-400 hover:border-red-500/30 hover:bg-red-500/8`}`,children:[a?(0,A.jsx)(fr,{className:`h-3.5 w-3.5 animate-spin`}):(0,A.jsx)(Nr,{className:`h-3.5 w-3.5`}),r&&!a&&(0,A.jsx)(`span`,{children:`¿Eliminar?`})]})]})]})]})}function mTe(){return(0,A.jsx)(`div`,{className:`h-52 rounded-2xl border border-white/5 bg-white/[0.02] animate-pulse`})}function hTe(){let e=Fd(),[t,n]=(0,u.useState)([]),[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(!0),[s,c]=(0,u.useState)(`all`),l=async()=>{o(!0);try{let[e,t]=await Promise.all([fetch(`/api/hivelearn/sessions`),fetch(`/api/hivelearn/metrics`).catch(()=>null)]);n((await e.json()).sessions??[]),t?.ok&&i(await t.json())}catch{n([])}finally{o(!1)}};(0,u.useEffect)(()=>{l()},[]);let d=e=>{n(t=>t.filter(t=>t.session_id!==e))},f=t=>{e(`/hivelearn?session=${t}`)},p=t.filter(e=>s===`active`?!e.completada:s===`completed`?!!e.completada:!0),m=t.filter(e=>e.completada).length,h=t.filter(e=>!e.completada).length,g=r?.total_xp??t.reduce((e,t)=>e+(t.xp_total||0),0),_=r?.avg_score??(t.filter(e=>e.evaluacion_puntaje!=null).length>0?Math.round(t.reduce((e,t)=>e+(t.evaluacion_puntaje??0),0)/t.filter(e=>e.evaluacion_puntaje!=null).length):null);return(0,A.jsx)(`div`,{className:`hive-page mt-10 animate-in fade-in duration-700`,children:(0,A.jsxs)(`div`,{className:`hive-page-container`,children:[(0,A.jsx)(`div`,{className:`absolute -top-40 -left-40 h-[500px] w-[500px] bg-amber-600/8 rounded-full blur-[120px] pointer-events-none opacity-60`}),(0,A.jsx)(`div`,{className:`absolute top-20 -right-40 h-[400px] w-[400px] bg-orange-600/6 rounded-full blur-[100px] pointer-events-none opacity-50`}),(0,A.jsxs)(`div`,{className:`relative z-10 flex flex-col sm:flex-row sm:items-end justify-between gap-6 mb-8`,children:[(0,A.jsxs)(`div`,{className:`animate-in slide-in-from-left-8 duration-700`,children:[(0,A.jsxs)(`div`,{className:`hive-page-header__eyebrow mb-3 opacity-80`,children:[(0,A.jsx)(`div`,{className:`hive-page-header__dot animate-pulse shadow-[0_0_10px_rgba(245,158,11,0.6)]`}),(0,A.jsx)(`span`,{className:`hive-page-header__label tracking-widest font-semibold text-amber-400`,children:`HIVELEARN`})]}),(0,A.jsxs)(`h2`,{className:`text-4xl md:text-5xl font-black tracking-tight text-white drop-shadow-lg mb-2`,children:[`Mis `,(0,A.jsx)(`span`,{className:`text-transparent bg-clip-text bg-gradient-to-r from-amber-400 to-orange-500`,children:`Sesiones`})]}),(0,A.jsx)(`p`,{className:`text-white/50 text-sm font-light`,children:a?`Cargando...`:t.length===0?`¡Empieza tu primera lección!`:`${t.length} sesión${t.length===1?``:`es`} · ${m} completada${m===1?``:`s`} · ${h} en progreso`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3 animate-in slide-in-from-right-8 duration-700`,children:[(0,A.jsxs)(`button`,{onClick:()=>e(`/hivelearn`),className:`px-5 py-2.5 bg-amber-500 hover:bg-amber-400 text-black font-bold rounded-xl text-sm transition-all shadow-[0_0_20px_rgba(245,158,11,0.3)] hover:shadow-[0_0_30px_rgba(245,158,11,0.5)] flex items-center gap-2`,children:[(0,A.jsx)(Wr,{className:`h-4 w-4`}),`Nueva lección`]}),(0,A.jsx)(`button`,{onClick:l,disabled:a,className:`p-2.5 rounded-xl bg-white/5 hover:bg-white/10 border border-white/10 hover:border-white/20 transition-all group`,title:`Refrescar`,children:(0,A.jsx)(fr,{className:`h-4 w-4 text-amber-400/70 transition-transform group-hover:rotate-180 ${a?`animate-spin`:``}`})})]})]}),!a&&t.length>0&&(0,A.jsxs)(`div`,{className:`relative z-10 grid grid-cols-2 sm:grid-cols-4 gap-3 mb-8 animate-in slide-in-from-bottom-4 duration-700`,children:[(0,A.jsx)(Z7,{icon:Ir,value:m,label:`Completadas`,color:`bg-green-500/5 border-green-500/20 text-green-400`}),(0,A.jsx)(Z7,{icon:jr,value:h,label:`En progreso`,color:`bg-amber-500/5 border-amber-500/20 text-amber-400`}),(0,A.jsx)(Z7,{icon:Wr,value:`${g} XP`,label:`XP total`,color:`bg-orange-500/5 border-orange-500/20 text-orange-400`}),(0,A.jsx)(Z7,{icon:Pr,value:_==null?`—`:`${_}%`,label:`Puntaje medio`,color:`bg-purple-500/5 border-purple-500/20 text-purple-400`})]}),!a&&t.length>0&&(0,A.jsx)(`div`,{className:`relative z-10 flex items-center gap-1 mb-6 p-1 bg-white/[0.02] rounded-xl border border-white/5 w-fit`,children:[`all`,`active`,`completed`].map(e=>(0,A.jsx)(`button`,{onClick:()=>c(e),className:`px-4 py-1.5 rounded-lg text-xs font-bold uppercase tracking-wider transition-all
265
+ ${s===e?`bg-amber-500/20 border border-amber-500/30 text-amber-400 shadow-[0_0_10px_rgba(245,158,11,0.1)]`:`text-white/30 hover:text-white/60 border border-transparent`}`,children:e===`all`?`Todas`:e===`active`?`En progreso`:`Completadas`},e))}),(0,A.jsx)(`div`,{className:`relative z-10`,children:a?(0,A.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:[...[,,,,,,]].map((e,t)=>(0,A.jsx)(mTe,{},t))}):p.length===0&&t.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-24 text-center border border-white/5 rounded-3xl bg-black/20 backdrop-blur-sm`,children:[(0,A.jsx)(`div`,{className:`text-6xl mb-4 animate-bounce`,children:`🐝`}),(0,A.jsx)(`h3`,{className:`text-xl font-bold text-white mb-2`,children:`Sin sesiones todavía`}),(0,A.jsx)(`p`,{className:`text-white/40 mb-6 text-sm max-w-xs leading-relaxed`,children:`Completa tu primera lección para ver tu historial, XP ganado y estadísticas de aprendizaje.`}),(0,A.jsx)(`button`,{onClick:()=>e(`/hivelearn`),className:`px-6 py-3 bg-amber-500 hover:bg-amber-400 text-black font-bold rounded-xl transition-all shadow-[0_0_20px_rgba(245,158,11,0.3)]`,children:`Empezar a aprender`})]}):p.length===0?(0,A.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-center`,children:[(0,A.jsx)(`div`,{className:`text-4xl mb-3 opacity-50`,children:s===`active`?`✅`:`⏳`}),(0,A.jsx)(`p`,{className:`text-white/30 text-sm`,children:s===`active`?`¡Has completado todas tus sesiones!`:`Todavía no has completado ninguna sesión.`})]}):(0,A.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 animate-in slide-in-from-bottom-8 duration-700`,children:p.map(e=>(0,A.jsx)(pTe,{session:e,onDelete:d,onResume:f},e.session_id))})}),!a&&m>0&&(0,A.jsx)(`div`,{className:`relative z-10 mt-8 text-center`,children:(0,A.jsxs)(`p`,{className:`text-[11px] text-white/25 font-mono tracking-wider`,children:[`🏆 `,m,` lección`,m===1?``:`es`,` completada`,m===1?``:`s`,` \xA0·\xA0 ⚡ `,g,` XP ganados \xA0·\xA0`,_==null?`🐝 Sigue aprendiendo`:`📊 ${_}% promedio`]})})]})})}var Q7=i(e=>({messages:[],isLoading:!1,currentSteps:[],addMessage:t=>e(e=>({messages:[...e.messages,t]})),addMessages:t=>e(e=>({messages:[...e.messages,...t]})),updateMessage:(t,n)=>e(e=>({messages:e.messages.map(e=>e.id===t?{...e,...n}:e)})),setMessages:t=>e({messages:t}),clearMessages:()=>e({messages:[]}),setLoading:t=>e({isLoading:t}),addStep:t=>e(e=>({currentSteps:[...e.currentSteps.slice(-4),t]})),clearSteps:()=>e({currentSteps:[]})}));function $7(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function gTe(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function _Te(e,t,n){let r=mQ((n||{}).ignore||[]),i=vTe(t),a=-1;for(;++a<i.length;)_Q(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function vTe(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([yTe(e[0]),bTe(e[1])])}return t}function yTe(e){return typeof e==`string`?new RegExp(gTe(e),`g`):e}function bTe(e){return typeof e==`function`?e:function(){return e}}var e9=`phrasing`,t9=[`autolink`,`link`,`image`,`label`];function xTe(){return{transforms:[OTe],enter:{literalAutolink:CTe,literalAutolinkEmail:n9,literalAutolinkHttp:n9,literalAutolinkWww:n9},exit:{literalAutolink:DTe,literalAutolinkEmail:ETe,literalAutolinkHttp:wTe,literalAutolinkWww:TTe}}}function STe(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:e9,notInConstruct:t9},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:e9,notInConstruct:t9},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:e9,notInConstruct:t9}]}}function CTe(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function n9(e){this.config.enter.autolinkProtocol.call(this,e)}function wTe(e){this.config.exit.autolinkProtocol.call(this,e)}function TTe(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function ETe(e){this.config.exit.autolinkEmail.call(this,e)}function DTe(e){this.exit(e)}function OTe(e){_Te(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,kTe],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,ATe]],{ignore:[`link`,`linkReference`]})}function kTe(e,t,n,r,i){let a=``;if(!r9(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!jTe(n)))return!1;let o=MTe(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function ATe(e,t,n,r){return!r9(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function jTe(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function MTe(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=$7(e,`(`),a=$7(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function r9(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||ZX(n)||XX(n))&&(!t||n!==47)}i9.peek=VTe;function NTe(){this.buffer()}function PTe(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function FTe(){this.buffer()}function ITe(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function LTe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function RTe(e){this.exit(e)}function zTe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=zX(this.sliceSerialize(e)).toLowerCase(),n.label=t}function BTe(e){this.exit(e)}function VTe(){return`[`}function i9(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function HTe(){return{enter:{gfmFootnoteCallString:NTe,gfmFootnoteCall:PTe,gfmFootnoteDefinitionLabelString:FTe,gfmFootnoteDefinition:ITe},exit:{gfmFootnoteCallString:LTe,gfmFootnoteCall:RTe,gfmFootnoteDefinitionLabelString:zTe,gfmFootnoteDefinition:BTe}}}function UTe(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:i9},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
266
+ `:` `)+r.indentLines(r.containerFlow(e,a.current()),t?a9:WTe))),s(),o}}function WTe(e,t,n){return t===0?e:a9(e,t,n)}function a9(e,t,n){return(n?``:` `)+e}var GTe=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];o9.peek=XTe;function KTe(){return{canContainEols:[`delete`],enter:{strikethrough:JTe},exit:{strikethrough:YTe}}}function qTe(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:GTe}],handlers:{delete:o9}}}function JTe(e){this.enter({type:`delete`,children:[]},e)}function YTe(e){this.exit(e)}function o9(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function XTe(){return`~`}function ZTe(e){return e.length}function QTe(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||ZTe,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=$Te(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=s9(r[d]);else{let e=s9(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&!(n.alignDelimiters===!1&&i===``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
267
+ `)}function $Te(e){return e==null?``:String(e)}function s9(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function eEe(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),tEe);return i(),o}function tEe(e,t,n){return`>`+(n?``:` `)+e}function nEe(e,t){return c9(e,t.inConstruct,!0)&&!c9(e,t.notInConstruct,!1)}function c9(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function l9(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;)if(n.unsafe[i].character===`
268
+ `&&nEe(n.stack,n.unsafe[i]))return/[ \t]/.test(r.before)?``:` `;return`\\
269
+ `}function rEe(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function iEe(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function aEe(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function oEe(e,t,n,r){let i=aEe(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(iEe(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,sEe);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(rEe(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:`
270
+ `,encode:["`"],...s.current()})),t()}return u+=s.move(`
271
+ `),a&&(u+=s.move(a+`
272
+ `)),u+=s.move(c),l(),u}function sEe(e,t,n){return(n?``:` `)+e}function u9(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function cEe(e,t,n,r){let i=u9(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
273
+ `,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function lEe(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function d9(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function f9(e,t,n){let r=sZ(e),i=sZ(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}p9.peek=uEe;function p9(e,t,n,r){let i=lEe(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=f9(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=d9(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=f9(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+d9(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function uEe(e,t,n){return n.options.emphasis||`*`}function dEe(e,t){let n=!1;return vQ(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&EX(e)&&(t.options.setext||n))}function fEe(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(dEe(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
274
+ `,after:`
275
+ `});return r(),t(),o+`
276
+ `+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
277
+ `))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
278
+ `,...a.current()});return/^[\t ]/.test(l)&&(l=d9(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}m9.peek=pEe;function m9(e){return e.value||``}function pEe(){return`<`}h9.peek=mEe;function h9(e,t,n,r){let i=u9(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function mEe(){return`!`}g9.peek=hEe;function g9(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function hEe(){return`!`}_9.peek=gEe;function _9(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function gEe(){return"`"}function v9(e,t){let n=EX(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}y9.peek=_Ee;function y9(e,t,n,r){let i=u9(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(v9(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function _Ee(e,t,n){return v9(e,n)?`<`:`[`}b9.peek=vEe;function b9(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function vEe(){return`[`}function x9(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function yEe(e){let t=x9(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function bEe(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function S9(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function xEe(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?bEe(n):x9(n),s=e.ordered?o===`.`?`)`:`.`:yEe(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),S9(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function SEe(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function CEe(e,t,n,r){let i=SEe(n),a=n.bulletCurrent||x9(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function wEe(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var TEe=mQ([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function EEe(e,t,n,r){return(e.children.some(function(e){return TEe(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function DEe(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}C9.peek=OEe;function C9(e,t,n,r){let i=DEe(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=f9(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=d9(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=f9(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+d9(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function OEe(e,t,n){return n.options.strong||`*`}function kEe(e,t,n,r){return n.safe(e.value,r)}function AEe(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function jEe(e,t,n){let r=(S9(n)+(n.options.ruleSpaces?` `:``)).repeat(AEe(n));return n.options.ruleSpaces?r.slice(0,-1):r}var w9={blockquote:eEe,break:l9,code:oEe,definition:cEe,emphasis:p9,hardBreak:l9,heading:fEe,html:m9,image:h9,imageReference:g9,inlineCode:_9,link:y9,linkReference:b9,list:xEe,listItem:CEe,paragraph:wEe,root:EEe,strong:C9,text:kEe,thematicBreak:jEe};function MEe(){return{enter:{table:NEe,tableData:E9,tableHeader:E9,tableRow:FEe},exit:{codeText:IEe,table:PEe,tableData:T9,tableHeader:T9,tableRow:T9}}}function NEe(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function PEe(e){this.exit(e),this.data.inTable=void 0}function FEe(e){this.enter({type:`tableRow`,children:[]},e)}function T9(e){this.exit(e)}function E9(e){this.enter({type:`tableCell`,children:[]},e)}function IEe(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,LEe));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function LEe(e,t){return t===`|`?t:e}function REe(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
279
+ `,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
280
+ `))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return QTe(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=w9.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function zEe(){return{exit:{taskListCheckValueChecked:D9,taskListCheckValueUnchecked:D9,paragraph:VEe}}}function BEe(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:HEe}}}function D9(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function VEe(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function HEe(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=w9.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function UEe(){return[xTe(),HTe(),KTe(),MEe(),zEe()]}function WEe(e){return{extensions:[STe(),UTe(e),qTe(),REe(e),BEe()]}}var GEe={tokenize:ZEe,partial:!0},O9={tokenize:QEe,partial:!0},k9={tokenize:$Ee,partial:!0},A9={tokenize:eDe,partial:!0},KEe={tokenize:tDe,partial:!0},j9={name:`wwwAutolink`,tokenize:YEe,previous:I9},M9={name:`protocolAutolink`,tokenize:XEe,previous:L9},N9={name:`emailAutolink`,tokenize:JEe,previous:R9},P9={};function qEe(){return{text:P9}}for(var F9=48;F9<123;)P9[F9]=N9,F9++,F9===58?F9=65:F9===91&&(F9=97);P9[43]=N9,P9[45]=N9,P9[46]=N9,P9[95]=N9,P9[72]=[N9,M9],P9[104]=[N9,M9],P9[87]=[N9,j9],P9[119]=[N9,j9];function JEe(e,t,n){let r=this,i,a;return o;function o(t){return!z9(t)||!R9.call(r,r.previous)||B9(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return z9(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(KEe,u,l)(t):t===45||t===95||VX(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&BX(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function YEe(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!I9.call(r,r.previous)||B9(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(GEe,e.attempt(O9,e.attempt(k9,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function XEe(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&L9.call(r,r.previous)&&!B9(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(BX(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||UX(t)||JX(t)||ZX(t)||XX(t)?n(t):e.attempt(O9,e.attempt(k9,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function ZEe(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function QEe(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(A9,c,s)(t):t===null||JX(t)||ZX(t)||t!==45&&XX(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function $Ee(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(A9,t,a)(o):o===null||JX(o)||ZX(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function eDe(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||JX(o)||ZX(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||JX(e)||ZX(e)?t(e):r(e)}function a(e){return BX(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):BX(t)?(e.consume(t),o):n(t)}}function tDe(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return VX(e)?n(e):t(e)}}function I9(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||JX(e)}function L9(e){return!BX(e)}function R9(e){return!(e===47||z9(e))}function z9(e){return e===43||e===45||e===46||e===95||VX(e)}function B9(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var nDe={tokenize:uDe,partial:!0};function rDe(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:sDe,continuation:{tokenize:cDe},exit:lDe}},text:{91:{name:`gfmFootnoteCall`,tokenize:oDe},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:iDe,resolveTo:aDe}}}}function iDe(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=zX(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function aDe(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function oDe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||JX(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(zX(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return JX(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function sDe(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||JX(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=zX(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return JX(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),eZ(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function cDe(e,t,n){return e.check(hZ,t,e.attempt(nDe,t,n))}function lDe(e){e.exit(`gfmFootnoteDefinition`)}function uDe(e,t,n){let r=this;return eZ(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function dDe(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&MX(o,o.length,0,cZ(s,e.slice(r+1,n),t)),MX(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),MX(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=sZ(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=sZ(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var fDe=class{constructor(){this.map=[]}add(e,t,n){pDe(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function pDe(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function mDe(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function hDe(){return{flow:{null:{name:`table`,tokenize:gDe,resolveAll:_De}}}}function gDe(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):qX(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):YX(t)?eZ(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||JX(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,YX(t)?eZ(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return YX(t)?eZ(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||qX(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return YX(t)?eZ(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||qX(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||qX(n)?(e.exit(`tableRow`),t(n)):YX(n)?eZ(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||JX(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function _De(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new fDe;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(H9(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=V9(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=V9(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=V9(f,t,o,i,n,d)):(o[0]=o[1],d=V9(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&H9(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=mDe(t.events,n))}return e}function V9(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},U9(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=U9(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=U9(t.events,n[2]),a=U9(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},U9(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function H9(e,t,n,r,i){let a=[],o=U9(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function U9(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var vDe={name:`tasklistCheck`,tokenize:bDe};function yDe(){return{text:{91:vDe}}}function bDe(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return JX(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return qX(r)?t(r):YX(r)?e.check({tokenize:xDe},t,n)(r):n(r)}}function xDe(e,t,n){return eZ(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function SDe(e){return FX([qEe(),rDe(),dDe(e),hDe(),yDe()])}var CDe={};function wDe(e){let t=this,n=e||CDe,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(SDe(n)),a.push(UEe()),o.push(WEe(n))}function TDe(e){return e.split(` `).map(e=>e[0]).slice(0,2).join(``).toUpperCase()||`?`}function W9(e){return new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`})}function G9({audio:e,mimeType:t=`audio/webm`}){let[n,r]=(0,u.useState)(!1),[i,a]=(0,u.useState)(null);return e?(0,A.jsxs)(`div`,{className:`flex items-center gap-2 mt-2`,children:[(0,A.jsx)(`button`,{onClick:n?()=>{r(!1)}:()=>{i||a(`data:${t};base64,${e}`),r(!0)},className:`h-8 w-8 rounded-full bg-cyan-600 hover:bg-cyan-500 flex items-center justify-center transition-colors`,children:n?(0,A.jsx)(ar,{className:`h-4 w-4 text-white`}):(0,A.jsx)(cr,{className:`h-4 w-4 text-white ml-0.5`})}),i&&(0,A.jsx)(`audio`,{src:i,onEnded:()=>r(!1),autoPlay:n,className:`hidden`}),(0,A.jsx)(`div`,{className:`flex-1 h-8 bg-zinc-800 rounded-lg overflow-hidden`,children:(0,A.jsxs)(`div`,{className:`h-full w-full flex items-center px-2`,children:[(0,A.jsx)(Rr,{className:`h-4 w-4 text-zinc-400 mr-2`}),(0,A.jsx)(`div`,{className:`flex-1 h-1.5 bg-zinc-700 rounded-full overflow-hidden`,children:(0,A.jsx)(`div`,{className:`h-full w-1/3 bg-cyan-500 rounded-full animate-pulse`})})]})})]}):null}function EDe({message:e,userName:t=`Tú`,agentName:n=`Agente`}){let r=e.type===`user`,i=e.type===`error`,a=e.type===`system`,o=!!e.audio?.base64||!!e.audio?.url;return a?(0,A.jsx)(`div`,{className:`flex justify-center my-1`,children:(0,A.jsx)(`span`,{className:`text-[10px] text-zinc-600 bg-zinc-900/50 border border-white/5 px-3 py-1 rounded-full font-mono`,children:e.content})}):i?(0,A.jsx)(`div`,{className:`flex items-center gap-2 justify-center my-1`,children:(0,A.jsxs)(`div`,{className:`flex items-center gap-2 text-[11px] text-red-400 bg-red-500/10 border border-red-500/20 px-3 py-1.5 rounded-xl`,children:[(0,A.jsx)(Fr,{className:`h-3 w-3 shrink-0`}),e.content]})}):r?(0,A.jsxs)(`div`,{className:`flex items-end justify-end gap-2 group`,children:[(0,A.jsxs)(`div`,{className:`flex flex-col items-end gap-1 max-w-[72%]`,children:[(0,A.jsx)(`div`,{className:`bg-gradient-to-br from-blue-600 to-indigo-600 text-white px-4 py-2.5 rounded-2xl rounded-tr-sm shadow-lg shadow-blue-600/10 text-sm leading-relaxed whitespace-pre-wrap`,children:e.content}),o&&e.audio?.base64&&(0,A.jsx)(G9,{audio:e.audio.base64,mimeType:e.audio.mimeType}),(0,A.jsx)(`span`,{className:`text-[10px] text-zinc-600 pr-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:W9(e.timestamp)})]}),(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center text-[11px] font-bold text-white shrink-0 shadow ring-2 ring-zinc-950`,children:TDe(t)})]}):(0,A.jsxs)(`div`,{className:`flex items-end gap-2 group`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-zinc-900 border border-cyan-500/20 flex items-center justify-center shrink-0 shadow ring-2 ring-zinc-950`,children:(0,A.jsx)(qt,{className:`h-4 w-4 text-cyan-400`})}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1 max-w-[72%]`,children:[(0,A.jsx)(`span`,{className:`text-[10px] font-semibold text-cyan-500 pl-1 uppercase tracking-wider`,children:n}),(0,A.jsx)(`div`,{className:`bg-zinc-900 border border-white/5 text-zinc-100 px-4 py-2.5 rounded-2xl rounded-tl-sm text-sm leading-relaxed shadow prose prose-invert prose-p:leading-relaxed prose-pre:bg-black/50 prose-pre:border prose-pre:border-white/10 max-w-none prose-sm`,children:(0,A.jsx)(VQ,{remarkPlugins:[wDe],children:e.content})}),o&&e.audio?.base64&&(0,A.jsx)(G9,{audio:e.audio.base64,mimeType:e.audio.mimeType}),(0,A.jsx)(`span`,{className:`text-[10px] text-zinc-600 pl-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:W9(e.timestamp)})]})]})}function DDe({messages:e,isLoading:t=!1,currentSteps:n=[],userName:r,agentName:i}){let a=(0,u.useRef)(null);return(0,u.useEffect)(()=>{a.current?.scrollIntoView({behavior:`smooth`})},[e,t,n]),e.length===0&&!t?(0,A.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center p-8 gap-4`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`div`,{className:`h-16 w-16 rounded-2xl bg-zinc-900 border border-cyan-500/20 flex items-center justify-center shadow-xl`,children:(0,A.jsx)(qt,{className:`h-8 w-8 text-cyan-400`})}),(0,A.jsx)(`span`,{className:`absolute -bottom-1 -right-1 h-4 w-4 rounded-full bg-emerald-500 border-2 border-zinc-950 shadow`})]}),(0,A.jsxs)(`div`,{className:`text-center space-y-1`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-zinc-300`,children:i?`${i} está listo`:`Agente listo`}),(0,A.jsx)(`p`,{className:`text-xs text-zinc-600`,children:`Inicia la conversación escribiendo un mensaje`})]}),(0,A.jsx)(`div`,{className:`flex items-center gap-2 mt-2`,children:[`¿Qué puedes hacer?`,`Dame un resumen`,`Ayúdame con una tarea`].map(e=>(0,A.jsx)(`span`,{className:`text-[11px] text-zinc-600 border border-white/5 bg-zinc-900/50 px-3 py-1 rounded-full`,children:e},e))})]}):(0,A.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4 p-4 min-h-0`,children:[e.map(e=>(0,A.jsx)(EDe,{message:e,userName:r,agentName:i},e.id)),t&&(0,A.jsxs)(`div`,{className:`flex items-end gap-2`,children:[(0,A.jsx)(`div`,{className:`h-8 w-8 rounded-full bg-zinc-900 border border-cyan-500/20 flex items-center justify-center shrink-0 ring-2 ring-zinc-950`,children:(0,A.jsx)(qt,{className:`h-4 w-4 text-cyan-400`})}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-1.5 max-w-[72%]`,children:[n.length>0&&(0,A.jsx)(`div`,{className:`flex flex-col gap-1`,children:n.map((e,t)=>{let r=t===n.length-1;return(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl border text-xs transition-all ${r?`bg-zinc-900 border-cyan-500/20 text-cyan-300`:`bg-zinc-950/50 border-white/5 text-zinc-600`}`,children:[(0,A.jsx)(Wr,{className:`h-3 w-3 shrink-0 ${r?`text-cyan-500 animate-pulse`:`text-zinc-700`}`}),(0,A.jsx)(`span`,{className:`leading-tight`,children:e})]},t)})}),(0,A.jsxs)(`div`,{className:`bg-zinc-900 border border-white/5 px-4 py-3 rounded-2xl rounded-tl-sm flex items-center gap-1.5 w-fit`,children:[(0,A.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-cyan-500 animate-bounce [animation-delay:0ms]`}),(0,A.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-cyan-500 animate-bounce [animation-delay:150ms]`}),(0,A.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full bg-cyan-500 animate-bounce [animation-delay:300ms]`})]})]})]}),(0,A.jsx)(`div`,{ref:a,className:`h-0`})]})}function ODe({onSendMessage:e,disabled:t=!1}){let[n,r]=(0,u.useState)(``),[i,a]=(0,u.useState)(!1),o=(0,u.useRef)(null),s=(0,u.useRef)([]),c=()=>{n.trim()&&!t&&(e(n.trim()),r(``))};return(0,A.jsxs)(`div`,{className:`px-4 py-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-end gap-2 rounded-2xl border bg-zinc-900/50 backdrop-blur-sm px-3 py-2 transition-all ${t?`border-white/5 opacity-60`:`border-white/10 focus-within:border-blue-500/40 focus-within:shadow-lg focus-within:shadow-blue-500/5`}`,children:[(0,A.jsx)(`button`,{onClick:i?()=>{o.current&&i&&(o.current.stop(),a(!1))}:async()=>{try{let t=await navigator.mediaDevices.getUserMedia({audio:!0}),n=new MediaRecorder(t,{mimeType:`audio/webm`});o.current=n,s.current=[],n.ondataavailable=e=>{e.data.size>0&&s.current.push(e.data)},n.onstop=async()=>{let n=new Blob(s.current,{type:`audio/webm`}),r=new FileReader;r.readAsDataURL(n),r.onloadend=()=>{let t=r.result.split(`,`)[1];e(`[Audio mensaje]`,t)},t.getTracks().forEach(e=>e.stop())},n.start(),a(!0)}catch(e){console.error(`Error accessing microphone:`,e)}},disabled:t,className:`h-8 w-8 rounded-xl flex items-center justify-center shrink-0 mb-0.5 transition-all ${i?`bg-red-600 hover:bg-red-500 animate-pulse`:`bg-zinc-700 hover:bg-zinc-600`} disabled:opacity-30 disabled:cursor-not-allowed text-white`,children:i?(0,A.jsx)(Or,{className:`h-3.5 w-3.5`}):(0,A.jsx)(tr,{className:`h-3.5 w-3.5`})}),(0,A.jsx)(uG,{value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),c())},placeholder:t?`Conectando al agente...`:`Escribe un mensaje...`,disabled:t,className:`flex-1 min-h-[36px] max-h-[160px] resize-none border-0 bg-transparent p-0 text-sm text-zinc-100 placeholder:text-zinc-600 focus-visible:ring-0 focus-visible:ring-offset-0 leading-relaxed`,rows:1}),(0,A.jsx)(`button`,{onClick:c,disabled:!n.trim()||t,className:`h-8 w-8 rounded-xl flex items-center justify-center shrink-0 mb-0.5 transition-all disabled:opacity-30 disabled:cursor-not-allowed bg-blue-600 hover:bg-blue-500 disabled:bg-zinc-800 text-white shadow shadow-blue-600/20`,children:(0,A.jsx)(_r,{className:`h-3.5 w-3.5`})})]}),(0,A.jsx)(`p`,{className:`text-[10px] text-zinc-700 mt-1.5 text-center`,children:i?`Grabando... haz clic en ■ para enviar`:`Enter para enviar · Shift+Enter nueva línea · 🎤 para audio`})]})}function kDe(e){return e.split(` `).map(e=>e[0]).slice(0,2).join(``).toUpperCase()||`?`}function ADe({agentId:e=`agent_id`,sessionId:t=`user_id`}){let{messages:n,addMessage:r,setMessages:i,isLoading:a,setLoading:o,currentSteps:s,addStep:c,clearSteps:l}=Q7(),{status:d,send:f,subscribe:p}=bh(),{currentUser:m,fetchUser:h}=ig(),g=X(e=>e.agents),_=X(e=>e.fetchAgents),v=d===`connected`,y=d===`connecting`,b=g.find(e=>e.role===`coordinator`&&e.enabled)?.name??`Coordinador`,x=m?.name??`Usuario`;return(0,u.useEffect)(()=>{m||h(),g.length===0&&_()},[]),(0,u.useEffect)(()=>{t&&(async()=>{try{let n=await K(`/api/chat/history?sessionId=${t}`);n.messages&&i(n.messages.map(t=>({id:t.id,conversationId:t.session_id,type:t.role===`user`?`user`:`agent`,content:t.content,agentId:e,timestamp:t.created_at})))}catch(e){console.error(`Failed to fetch chat history:`,e)}})()},[t,e,i]),(0,u.useEffect)(()=>{let n=n=>{let r=n.id||`agent-streaming-id`,{messages:i,addMessage:a,updateMessage:o,setLoading:s,clearSteps:c}=Q7.getState(),l=i.find(e=>e.id===r);n.isChunk&&l?o(r,{content:(l.content||``)+n.content,timestamp:n.timestamp||l.timestamp}):n.isChunk&&!l?a({id:r,conversationId:t,type:`agent`,content:n.content||``,agentId:e,timestamp:n.timestamp||new Date().toISOString()}):l?o(r,{content:n.content||l.content,timestamp:n.timestamp||l.timestamp}):a({id:r,conversationId:t,type:`agent`,content:n.content||n.message||JSON.stringify(n),agentId:e,timestamp:n.timestamp||new Date().toISOString()}),n.isChunk||(c(),s(!1))},r=n=>{let r=n.id||Ui(),{addMessage:i,setLoading:a,clearSteps:o}=Q7.getState();i({id:r,conversationId:t,type:`agent`,content:n.content||``,agentId:e,timestamp:n.timestamp||new Date().toISOString(),audio:n.audio?{base64:n.audio,mimeType:n.mimeType}:void 0}),o(),a(!1)},i=e=>{e.content&&Q7.getState().addStep(e.content)},a=e=>{let{setLoading:t,clearSteps:n}=Q7.getState();e.isTyping===!1&&(n(),t(!1))},o=p(`message`,n),s=p(`response`,n),c=p(`audio`,r),l=p(`progress`,i),u=p(`typing`,a);return()=>{o(),s(),c(),l(),u()}},[p,t,e,r,o]),(0,A.jsxs)(`div`,{className:`flex h-full flex-col min-h-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between border-b border-white/5 px-5 py-3 shrink-0 bg-zinc-950/80 backdrop-blur-sm z-10`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(`div`,{className:`h-9 w-9 rounded-xl bg-zinc-900 border border-cyan-500/20 flex items-center justify-center shadow`,children:(0,A.jsx)(qt,{className:`h-4.5 w-4.5 text-cyan-400`})}),(0,A.jsx)(`span`,{className:`absolute -bottom-0.5 -right-0.5 h-2.5 w-2.5 rounded-full border-2 border-zinc-950 ${v?`bg-emerald-500`:y?`bg-yellow-500 animate-pulse`:`bg-zinc-600`}`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`text-sm font-bold text-white leading-tight`,children:b}),(0,A.jsx)(`p`,{className:`text-[10px] text-zinc-500 font-mono uppercase tracking-wider`,children:`Coordinador`})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5 px-2 py-0.5 rounded-full border text-[10px] font-bold uppercase tracking-wider ml-1 ${v?`bg-emerald-500/10 border-emerald-500/20 text-emerald-400`:y?`bg-yellow-500/10 border-yellow-500/20 text-yellow-400`:`bg-zinc-800 border-zinc-700 text-zinc-500`}`,children:[(0,A.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full ${v?`bg-emerald-500 animate-pulse`:y?`bg-yellow-500 animate-pulse`:`bg-zinc-600`}`}),v?`En línea`:y?`Conectando`:`Desconectado`]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,A.jsxs)(`div`,{className:`text-right`,children:[(0,A.jsx)(`p`,{className:`text-sm font-semibold text-zinc-200 leading-tight`,children:x}),(0,A.jsx)(`p`,{className:`text-[10px] text-zinc-600 font-mono`,children:`Usuario`})]}),(0,A.jsx)(`div`,{className:`h-9 w-9 rounded-xl bg-gradient-to-br from-blue-500 to-indigo-600 flex items-center justify-center text-[12px] font-bold text-white shadow ring-2 ring-zinc-950`,children:m?.name?kDe(m.name):(0,A.jsx)(Lr,{className:`h-4 w-4`})})]})]}),(0,A.jsx)(`div`,{className:`flex-1 overflow-y-auto min-h-0 bg-zinc-950/30`,children:(0,A.jsx)(DDe,{messages:n,isLoading:a,currentSteps:s,userName:x,agentName:b})}),(0,A.jsx)(`div`,{className:`shrink-0 border-t border-white/5 bg-zinc-950/80 backdrop-blur-sm`,children:(0,A.jsx)(ODe,{onSendMessage:(n,i)=>{let s=Ui();r(i?{id:s,conversationId:t,type:`user`,content:n,agentId:e,timestamp:new Date().toISOString(),audio:{base64:i,mimeType:`audio/webm`}}:{id:s,conversationId:t,type:`user`,content:n,agentId:e,timestamp:new Date().toISOString()}),o(!0),v?f(i?{type:`audio`,audio:i,sessionId:t,timestamp:new Date().toISOString()}:{type:`message`,content:n,sessionId:t,timestamp:new Date().toISOString()}):setTimeout(()=>{a&&(o(!1),r({id:Ui(),conversationId:t,type:`error`,content:`No se pudo conectar al agente. Verifica que el gateway esté funcionando.`,timestamp:new Date().toISOString()}))},3e3)},disabled:!v&&!y})})]})}function jDe(){let{currentUser:e}=ig();return(0,A.jsx)(`div`,{className:`h-full bg-zinc-950 overflow-hidden mt-10`,children:(0,A.jsx)(`div`,{className:`max-w-4xl mx-auto h-full flex flex-col border-x border-white/5`,children:(0,A.jsx)(ADe,{agentId:`main`,sessionId:e?.id||`default`})})})}var MDe={gemini:`🔵`,anthropic:`🟠`,openai:`🟢`,groq:`🔴`,ollama:`🟣`,openrouter:`🟡`,deepseek:`🔷`,mistral:`🔸`,kimi:`🌙`},K9={gemini:`https://aistudio.google.com/app/apikey`,anthropic:`https://console.anthropic.com/keys`,openai:`https://platform.openai.com/api-keys`,groq:`https://console.groq.com/keys`,openrouter:`https://openrouter.ai/keys`,deepseek:`https://platform.deepseek.com/api_keys`,mistral:`https://console.mistral.ai/api-keys`,kimi:`https://platform.moonshot.cn/console/api-keys`},q9=[{id:`webchat`,name:`WebChat`,description:`Chat web integrado`,icon:`💬`,required:!0},{id:`telegram`,name:`Telegram`,description:`Bot de Telegram`,icon:`✈️`,required:!1},{id:`discord`,name:`Discord`,description:`Bot de Discord`,icon:`🎮`,required:!1},{id:`whatsapp`,name:`WhatsApp`,description:`Bot de WhatsApp`,icon:`📱`,required:!1},{id:`slack`,name:`Slack`,description:`Bot de Slack`,icon:`💼`,required:!1}],J9=`hive_setup_wizard_data`;function NDe(){try{let e=sessionStorage.getItem(J9);if(e){let t=JSON.parse(e);return{...X9(),...t}}}catch(e){console.error(`Failed to load wizard data:`,e)}return null}function PDe(e){try{sessionStorage.setItem(J9,JSON.stringify(e))}catch(e){console.error(`Failed to save wizard data:`,e)}}function Y9(){try{sessionStorage.removeItem(J9)}catch(e){console.error(`Failed to clear wizard data:`,e)}}function X9(){return{userName:``,userLanguage:`es`,userTimezone:Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`,userOccupation:``,userNotes:``,agentName:`Bee`,agentDescription:``,agentTone:`friendly`,provider:``,apiKey:``,model:``,apiKeyVerified:!1,channels:{webchat:{enabled:!0},telegram:{enabled:!1},discord:{enabled:!1},whatsapp:{enabled:!1},slack:{enabled:!1}},voiceEnabled:!1,sttProvider:`groq-whisper`,ttsProvider:`elevenlabs`,ttsVoice:``,ethicsRules:{},customRules:[]}}function FDe(){let e=Fd(),[t,n]=(0,u.useState)(1),[r,i]=(0,u.useState)(()=>NDe()||X9()),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(!1),{showLoader:l,hideLoader:d}=Zh(),[f,p]=(0,u.useState)(`idle`),[m,h]=(0,u.useState)(null),[g,_]=(0,u.useState)([]),[v,y]=(0,u.useState)(null),[b,x]=(0,u.useState)(!1),[S,C]=(0,u.useState)([]);(0,u.useEffect)(()=>{fetch(`${_h()}/api/setup/providers`).then(e=>e.json()).then(e=>{Array.isArray(e)&&_(e)}).catch(()=>{}),fetch(`${_h()}/api/setup/ethics`).then(e=>e.json()).then(e=>{Array.isArray(e)&&(C(e),i(t=>Object.keys(t.ethicsRules).length===0?{...t,ethicsRules:Object.fromEntries(e.map(e=>[e.id,!0]))}:t))}).catch(()=>{})},[]),(0,u.useEffect)(()=>{PDe(r)},[r]),(0,u.useEffect)(()=>{fetch(`${_h()}/api/setup/status`).then(e=>e.json()).then(t=>{t.configured&&e(`/ui`)}).catch(()=>{})},[e]);let w=e=>{h(null),i(t=>({...t,...e}))},T=()=>{switch(t){case 1:return r.userName.trim()?r.userName.trim().length<2?`El nombre debe tener al menos 2 caracteres.`:null:`El nombre es obligatorio.`;case 2:return r.agentName.trim()?r.agentName.trim().length<2?`El nombre debe tener al menos 2 caracteres.`:null:`El nombre del agente es obligatorio.`;case 3:return r.provider?r.provider!==`ollama`&&!r.apiKey?`Ingresa tu API key.`:r.provider!==`ollama`&&!r.apiKeyVerified?`Verifica tu API key antes de continuar.`:r.model?null:`Selecciona un modelo.`:`Selecciona un proveedor LLM.`;default:return null}},E=()=>{let e=T();if(e){h(e);return}h(null),t<7&&n(e=>e+1)},D=()=>{t>1&&n(e=>e-1)},O=()=>{confirm(`¿Estás seguro de que quieres reiniciar la configuración? Se perderá todo el progreso.`)&&(Y9(),i(X9()),n(1))},k=async()=>{if(!(!r.apiKey||!r.provider)){p(`verifying`);try{(await K(`/api/setup/verify-provider`,{method:`POST`,body:{provider:r.provider,apiKey:r.apiKey},showLoader:`Verificando conexión...`,showError:!1})).success?(p(`success`),w({apiKeyVerified:!0})):(p(`error`),w({apiKeyVerified:!1}))}catch{p(`error`),w({apiKeyVerified:!1})}}},j=async()=>{o(!0);try{let t=await K(`/api/setup/complete`,{method:`POST`,body:r,showLoader:`Finalizando configuración...`,showError:!0});if(t.success){let n=t.authToken;n&&localStorage.setItem(`hive-auth-token`,n),c(!0),Y9(),(async()=>{await new Promise(e=>setTimeout(e,1500)),l(`Iniciando a ${r.agentName}... esto toma unos segundos`);for(let t=0;t<40;t++){try{let t=await fetch(`${_h()}/api/setup/status`);if(t.ok){let{configured:r}=await t.json();if(r){d(),e(n?`/?token=${n}`:`/`);return}}}catch{}await new Promise(e=>setTimeout(e,1e3))}d(),e(n?`/?token=${n}`:`/`)})()}}catch{}finally{o(!1)}},M=()=>{switch(t){case 1:return N();case 2:return P();case 3:return F();case 4:return ee();case 5:return I();case 6:return L();case 7:return R();default:return null}},N=()=>(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-4`,children:[(0,A.jsx)(`div`,{className:`flex justify-center`,children:(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(Bn,{className:`w-24 h-24 text-amber-500`,fill:`currentColor`}),(0,A.jsx)(Dr,{className:`w-8 h-8 text-amber-300 absolute -top-2 -right-2`})]})}),(0,A.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Bienvenido a Hive`}),(0,A.jsx)(`p`,{className:`text-muted-foreground max-w-md mx-auto`,children:`Hive es tu colmena de agentes IA. Local-first. Multi-canal. Open source. En los próximos minutos configurarás tu agente personal Bee.`})]}),(0,A.jsxs)(zR,{children:[(0,A.jsxs)(BR,{children:[(0,A.jsx)(VR,{children:`Tu información`}),(0,A.jsx)(HR,{children:`Comencemos con tus datos básicos`})]}),(0,A.jsxs)(UR,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`userName`,children:`Tu nombre`}),(0,A.jsx)(G,{id:`userName`,placeholder:`¿Cómo te llamas?`,value:r.userName,onChange:e=>w({userName:e.target.value})})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`userLanguage`,children:`Idioma preferido`}),(0,A.jsxs)(BK,{value:r.userLanguage,onValueChange:e=>w({userLanguage:e}),children:[(0,A.jsx)(UK,{children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`es`,children:`Español`}),(0,A.jsx)(Q,{value:`en`,children:`English`}),(0,A.jsx)(Q,{value:`pt`,children:`Português`}),(0,A.jsx)(Q,{value:`fr`,children:`Français`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`userTimezone`,children:`Zona horaria`}),(0,A.jsx)(G,{id:`userTimezone`,value:r.userTimezone,onChange:e=>w({userTimezone:e.target.value}),placeholder:`America/Bogota`}),(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Detectada automáticamente: `,Intl.DateTimeFormat().resolvedOptions().timeZone]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(Z,{htmlFor:`userOccupation`,children:[`Ocupación `,(0,A.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(opcional)`})]}),(0,A.jsx)(G,{id:`userOccupation`,value:r.userOccupation,onChange:e=>w({userOccupation:e.target.value}),placeholder:`Ej: Desarrollador de software, diseñador, estudiante...`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsxs)(Z,{htmlFor:`userNotes`,children:[`Preferencias de comunicación `,(0,A.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:`(opcional)`})]}),(0,A.jsx)(`textarea`,{id:`userNotes`,className:`w-full min-h-[80px] p-3 border rounded-md bg-background resize-none text-sm`,value:r.userNotes,onChange:e=>w({userNotes:e.target.value}),placeholder:`Ej: Prefiero respuestas cortas y directas. Usa ejemplos de código cuando expliques conceptos técnicos...`})]})]})]})]}),P=()=>(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Tu agente`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Personaliza a Bee, tu agente personal`})]}),(0,A.jsxs)(zR,{children:[(0,A.jsx)(BR,{children:(0,A.jsx)(VR,{children:`Identidad del agente`})}),(0,A.jsxs)(UR,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`agentName`,children:`Nombre del agente`}),(0,A.jsx)(G,{id:`agentName`,value:r.agentName,onChange:e=>w({agentName:e.target.value}),placeholder:`Bee`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`agentDescription`,children:`Descripción / Personalidad`}),(0,A.jsx)(`textarea`,{id:`agentDescription`,className:`w-full min-h-[100px] p-3 border rounded-md bg-background resize-none`,value:r.agentDescription,onChange:e=>w({agentDescription:e.target.value}),placeholder:`Ej: Eres un asistente útil y amable. Respondes de forma concisa pero completa. Te especializas en ayudar con tareas de programación y productividad...`})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`agentTone`,children:`Tono de comunicación`}),(0,A.jsxs)(BK,{value:r.agentTone,onValueChange:e=>w({agentTone:e}),children:[(0,A.jsx)(UK,{children:(0,A.jsx)(HK,{placeholder:`Selecciona un tono`})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`friendly`,children:`Amigable y cercano`}),(0,A.jsx)(Q,{value:`professional`,children:`Profesional y formal`}),(0,A.jsx)(Q,{value:`direct`,children:`Directo y conciso`}),(0,A.jsx)(Q,{value:`casual`,children:`Casual y relajado`})]})]}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Define cómo se comunicará tu agente contigo`})]})]})]})]}),F=()=>(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Proveedor LLM`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Selecciona el cerebro de tu agente`})]}),(0,A.jsx)(`div`,{className:`grid gap-3`,children:g.map(e=>(0,A.jsx)(zR,{className:H(`cursor-pointer transition-all hover:shadow-md`,r.provider===e.id&&`border-amber-500 ring-2 ring-amber-500`),onClick:()=>{w({provider:e.id,model:``,apiKeyVerified:!1}),e.id===`ollama`&&y(null)},children:(0,A.jsxs)(UR,{className:`flex items-center gap-4 p-4`,children:[(0,A.jsx)(`span`,{className:`text-3xl`,children:MDe[e.id]??`🤖`}),(0,A.jsxs)(`div`,{className:`flex-1`,children:[(0,A.jsx)(`h3`,{className:`font-semibold`,children:e.name}),(0,A.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[e.models.length,` modelo`,e.models.length===1?``:`s`,` disponible`,e.models.length===1?``:`s`]})]}),r.provider===e.id&&(0,A.jsx)(sn,{className:`w-5 h-5 text-amber-500`})]})},e.id))}),r.provider&&(()=>{let e=g.find(e=>e.id===r.provider);return(0,A.jsxs)(zR,{className:`mt-4`,children:[(0,A.jsx)(BR,{children:(0,A.jsxs)(VR,{children:[`Configuración de `,e?.name]})}),(0,A.jsxs)(UR,{className:`space-y-4`,children:[r.provider!==`ollama`&&(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`apiKey`,children:`API Key`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsx)(G,{id:`apiKey`,type:`password`,value:r.apiKey,onChange:e=>w({apiKey:e.target.value,apiKeyVerified:!1}),placeholder:`sk-...`,className:H(m?.includes(`API key`)&&!r.apiKey&&`border-red-500`)}),(0,A.jsx)(W,{variant:`outline`,onClick:k,disabled:!r.apiKey||f===`verifying`,children:f===`verifying`?(0,A.jsx)(Yn,{className:`w-4 h-4 animate-spin`}):f===`success`?(0,A.jsx)(sn,{className:`w-4 h-4 text-green-500`}):f===`error`?(0,A.jsx)(un,{className:`w-4 h-4 text-red-500`}):`Verificar`})]}),f===`success`&&(0,A.jsxs)(`p`,{className:`text-sm text-green-600 flex items-center gap-1`,children:[(0,A.jsx)(sn,{className:`w-4 h-4`}),` API key verificada correctamente`]}),f===`error`&&(0,A.jsxs)(`p`,{className:`text-sm text-red-600 flex items-center gap-1`,children:[(0,A.jsx)(un,{className:`w-4 h-4`}),` API key inválida o error de conexión`]}),K9[r.provider]&&(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`¿No tienes tu API key?`,` `,(0,A.jsx)(`a`,{href:K9[r.provider],target:`_blank`,rel:`noopener noreferrer`,className:`text-amber-500 hover:underline`,children:`Obtener aquí`})]})]}),r.provider===`ollama`&&(0,A.jsxs)(`div`,{className:`space-y-3`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(W,{type:`button`,variant:`outline`,size:`sm`,disabled:b,onClick:()=>{y(null),x(!0),w({model:``}),fetch(`${_h()}/api/setup/ollama-models`).then(e=>e.json()).then(e=>{y(e.models??[]),x(!1)}).catch(()=>{y([]),x(!1)})},children:b?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`w-3 h-3 animate-spin mr-1`}),`Detectando...`]}):`🔍 Detectar modelos`}),!b&&v!==null&&(0,A.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:v.length>0?`${v.length} modelo${v.length===1?``:`s`} encontrado${v.length===1?``:`s`}`:`Sin modelos — instala uno con ollama pull`})]}),v&&v.length>0&&(0,A.jsxs)(`div`,{className:`space-y-1`,children:[(0,A.jsx)(Z,{htmlFor:`model`,children:`Modelo`}),(0,A.jsxs)(BK,{value:r.model,onValueChange:e=>w({model:e}),children:[(0,A.jsx)(UK,{className:H(!r.model&&m?.includes(`modelo`)&&`border-red-500`),children:(0,A.jsx)(HK,{placeholder:`Selecciona un modelo`})}),(0,A.jsx)(KK,{children:v.map((e,t)=>(0,A.jsxs)(Q,{value:e.id,children:[e.name,t===0?` (Recomendado)`:``]},e.id))})]})]}),!b&&v!==null&&v.length===0&&(0,A.jsxs)(`p`,{className:`text-xs text-amber-600`,children:[`Asegúrate que Ollama esté corriendo (`,(0,A.jsx)(`code`,{children:`ollama serve`}),`) y tengas modelos (`,(0,A.jsx)(`code`,{children:`ollama pull llama3.2`}),`).`]})]}),r.provider!==`ollama`&&r.apiKeyVerified&&(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`model`,children:`Modelo`}),(0,A.jsxs)(BK,{value:r.model,onValueChange:e=>w({model:e}),children:[(0,A.jsx)(UK,{className:H(!r.model&&m?.includes(`modelo`)&&`border-red-500`),children:(0,A.jsx)(HK,{placeholder:`Selecciona un modelo`})}),(0,A.jsx)(KK,{children:(e?.models??[]).map((e,t)=>(0,A.jsxs)(Q,{value:e.id,children:[e.name||e.id,t===0?` (Recomendado)`:``]},e.id))})]})]})]})]})})()]}),ee=()=>(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Canales`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`¿Dónde quieres que Bee esté disponible?`})]}),(0,A.jsx)(`div`,{className:`grid gap-3`,children:q9.map(e=>(0,A.jsx)(zR,{className:H(`transition-all`,r.channels[e.id]?.enabled&&`border-amber-500`),children:(0,A.jsxs)(UR,{className:`p-4`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`span`,{className:`text-2xl`,children:e.icon}),(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`h3`,{className:`font-semibold flex items-center gap-2`,children:[e.name,e.required&&(0,A.jsx)(Hz,{variant:`secondary`,className:`text-xs`,children:`Requerido`})]}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description})]})]}),(0,A.jsx)(sq,{checked:r.channels[e.id]?.enabled,onCheckedChange:t=>{e.required&&!t||w({channels:{...r.channels,[e.id]:{enabled:t}}})},disabled:e.required})]}),!e.required&&r.channels[e.id]?.enabled&&(0,A.jsx)(T3,{type:`single`,collapsible:!0,className:`mt-4`,children:(0,A.jsxs)(E3,{value:`config`,children:[(0,A.jsx)(D3,{children:`Configuración`}),(0,A.jsx)(O3,{children:(0,A.jsxs)(`div`,{className:`space-y-3 pt-2`,children:[e.id===`telegram`&&(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`telegramToken`,children:`Token del Bot`}),(0,A.jsx)(G,{id:`telegramToken`,placeholder:`123456789:ABCdefGHIjklMNOpqrsTUVwxyz`,value:r.channels.telegram.config?.botToken||``,onChange:e=>w({channels:{...r.channels,telegram:{enabled:!0,config:{botToken:e.target.value}}}})}),(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,A.jsx)(`a`,{href:`https://t.me/BotFather`,target:`_blank`,rel:`noopener noreferrer`,className:`text-amber-500 hover:underline`,children:`Obtén tu token en BotFather`})})]})}),e.id===`discord`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`discordToken`,children:`Token del Bot`}),(0,A.jsx)(G,{id:`discordToken`,placeholder:`MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.GJKlMn.OpQrStUvWxYz`,value:r.channels.discord.config?.botToken||``,onChange:e=>w({channels:{...r.channels,discord:{enabled:!0,config:{botToken:e.target.value}}}})})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`discordClientId`,children:`Client ID`}),(0,A.jsx)(G,{id:`discordClientId`,placeholder:`1234567890123456789`,value:r.channels.discord.config?.clientId||``,onChange:e=>w({channels:{...r.channels,discord:{enabled:!0,config:{clientId:e.target.value}}}})})]})]}),e.id===`whatsapp`&&(0,A.jsx)(A.Fragment,{children:(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`whatsappToken`,children:`Token de la API`}),(0,A.jsx)(G,{id:`whatsappToken`,placeholder:`...`,value:r.channels.whatsapp.config?.apiToken||``,onChange:e=>w({channels:{...r.channels,whatsapp:{enabled:!0,config:{apiToken:e.target.value}}}})})]})}),e.id===`slack`&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`slackToken`,children:`Bot Token`}),(0,A.jsx)(G,{id:`slackToken`,placeholder:`xoxb-...`,value:r.channels.slack.config?.botToken||``,onChange:e=>w({channels:{...r.channels,slack:{enabled:!0,config:{botToken:e.target.value}}}})})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`slackSigningSecret`,children:`Signing Secret`}),(0,A.jsx)(G,{id:`slackSigningSecret`,placeholder:`...`,value:r.channels.slack.config?.signingSecret||``,onChange:e=>w({channels:{...r.channels,slack:{enabled:!0,config:{signingSecret:e.target.value}}}})})]})]})]})})]})})]})},e.id))})]}),I=()=>(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Voz (opcional)`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Permite que Bee hable y escuche`})]}),(0,A.jsxs)(zR,{children:[(0,A.jsx)(BR,{children:(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsx)(VR,{children:`Activar voz`}),(0,A.jsx)(sq,{checked:r.voiceEnabled,onCheckedChange:e=>w({voiceEnabled:e})})]})}),(0,A.jsx)(UR,{children:r.voiceEnabled?(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`sttProvider`,children:`Reconocimiento de voz (STT)`}),(0,A.jsxs)(BK,{value:r.sttProvider,onValueChange:e=>w({sttProvider:e}),children:[(0,A.jsx)(UK,{children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`groq-whisper`,children:`Groq Whisper (Recomendado)`}),(0,A.jsx)(Q,{value:`openai-whisper`,children:`OpenAI Whisper`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`ttsProvider`,children:`Síntesis de voz (TTS)`}),(0,A.jsxs)(BK,{value:r.ttsProvider,onValueChange:e=>w({ttsProvider:e}),children:[(0,A.jsx)(UK,{children:(0,A.jsx)(HK,{})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`elevenlabs`,children:`ElevenLabs (Recomendado)`}),(0,A.jsx)(Q,{value:`openai`,children:`OpenAI TTS`}),(0,A.jsx)(Q,{value:`gemini`,children:`Google Gemini`})]})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`ttsVoice`,children:`Voz`}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(BK,{value:r.ttsVoice,onValueChange:e=>w({ttsVoice:e}),children:[(0,A.jsx)(UK,{children:(0,A.jsx)(HK,{placeholder:`Selecciona una voz`})}),(0,A.jsxs)(KK,{children:[(0,A.jsx)(Q,{value:`Rachel`,children:`Rachel (ElevenLabs)`}),(0,A.jsx)(Q,{value:`Adam`,children:`Adam (ElevenLabs)`}),(0,A.jsx)(Q,{value:`Antoni`,children:`Antoni (ElevenLabs)`}),(0,A.jsx)(Q,{value:`Elli`,children:`Elli (ElevenLabs)`}),(0,A.jsx)(Q,{value:`Josh`,children:`Josh (ElevenLabs)`}),(0,A.jsx)(Q,{value:`alloy`,children:`Alloy (OpenAI)`}),(0,A.jsx)(Q,{value:`echo`,children:`Echo (OpenAI)`}),(0,A.jsx)(Q,{value:`fable`,children:`Fable (OpenAI)`}),(0,A.jsx)(Q,{value:`onyx`,children:`Onyx (OpenAI)`}),(0,A.jsx)(Q,{value:`nova`,children:`Nova (OpenAI)`}),(0,A.jsx)(Q,{value:`shimmer`,children:`Shimmer (OpenAI)`})]})]}),(0,A.jsx)(W,{variant:`outline`,size:`icon`,children:(0,A.jsx)(Rr,{className:`w-4 h-4`})})]})]}),(0,A.jsx)(HQ,{children:(0,A.jsx)(WQ,{className:`text-sm`,children:r.provider===r.ttsProvider&&(0,A.jsxs)(`span`,{className:`text-green-600 flex items-center gap-1`,children:[(0,A.jsx)(sn,{className:`w-4 h-4`}),` Ya tienes la API key configurada`]})})})]}):(0,A.jsx)(`p`,{className:`text-muted-foreground text-center py-4`,children:`Puedes activar la voz más tarde en la configuración`})})]})]}),L=()=>(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-bold`,children:`Reglas éticas`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Define los límites de tu agente`})]}),(0,A.jsx)(HQ,{children:(0,A.jsxs)(WQ,{className:`text-sm`,children:[`Las reglas de categoría `,(0,A.jsx)(`strong`,{className:`text-red-500`,children:`NUNCA`}),` son las protecciones más importantes. Desactivarlas puede comprometer la seguridad.`]})}),(0,A.jsxs)(`div`,{className:`space-y-3`,children:[S.map(e=>{let t=r.ethicsRules[e.id]!==!1;return(0,A.jsx)(zR,{className:H(!t&&`opacity-60`),children:(0,A.jsx)(UR,{className:`p-4`,children:(0,A.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,A.jsx)(n$,{checked:t,onCheckedChange:t=>{e.isDefault&&!t&&!confirm(`¿Estás seguro de desactivar los lineamientos éticos por defecto?`)||w({ethicsRules:{...r.ethicsRules,[e.id]:t}})}}),(0,A.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(`h3`,{className:`font-medium`,children:e.name}),e.isDefault&&(0,A.jsx)(Hz,{className:`text-xs bg-blue-500/10 text-blue-500`,children:`Por defecto`})]}),e.description&&(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:e.description}),(0,A.jsxs)(`details`,{className:`mt-2`,children:[(0,A.jsx)(`summary`,{className:`text-xs text-muted-foreground cursor-pointer hover:text-foreground`,children:`Ver contenido`}),(0,A.jsx)(`pre`,{className:`text-xs mt-2 p-2 bg-muted rounded whitespace-pre-wrap font-mono`,children:e.content})]})]})]})})},e.id)}),S.length===0&&(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-4`,children:`Cargando lineamientos éticos...`})]}),(0,A.jsx)(W,{variant:`outline`,className:`w-full`,onClick:()=>{let e=prompt(`Ingresa tu regla personalizada:`);if(e){let t=prompt(`Categoría (SIEMPRE/NUNCA/CONFIRMAR):`,`CONFIRMAR`);t&&[`SIEMPRE`,`NUNCA`,`CONFIRMAR`].includes(t.toUpperCase())&&w({customRules:[...r.customRules,{text:e,category:t.toUpperCase()}]})}},children:`+ Añadir regla personalizada`}),r.customRules.length>0&&(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{children:`Reglas personalizadas`}),r.customRules.map((e,t)=>(0,A.jsx)(zR,{children:(0,A.jsxs)(UR,{className:`p-4 flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`p`,{className:`font-medium`,children:e.text}),(0,A.jsx)(Hz,{className:H(`text-xs mt-1`,e.category===`NUNCA`&&`text-red-500 bg-red-500/10`,e.category===`SIEMPRE`&&`text-green-500 bg-green-500/10`,e.category===`CONFIRMAR`&&`text-amber-500 bg-amber-500/10`),children:e.category})]}),(0,A.jsx)(W,{variant:`ghost`,size:`sm`,onClick:()=>{w({customRules:r.customRules.filter((e,n)=>n!==t)})},children:`Eliminar`})]})},t))]})]}),R=()=>(0,A.jsxs)(`div`,{className:`space-y-6`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`h2`,{className:`text-2xl font-bold`,children:`¡Todo listo!`}),(0,A.jsx)(`p`,{className:`text-muted-foreground`,children:`Revisa tu configuración antes de continuar`})]}),s?(0,A.jsx)(zR,{className:`border-green-500 bg-green-500/10`,children:(0,A.jsxs)(UR,{className:`p-8 text-center space-y-4`,children:[(0,A.jsx)(`div`,{className:`flex justify-center`,children:(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(Bn,{className:`w-24 h-24 text-amber-500 animate-pulse`,fill:`currentColor`}),(0,A.jsx)(Dr,{className:`w-8 h-8 text-amber-300 absolute -top-2 -right-2 animate-bounce`})]})}),(0,A.jsx)(`h3`,{className:`text-xl font-bold`,children:`¡Bienvenido a Hive!`}),(0,A.jsxs)(`p`,{className:`text-muted-foreground`,children:[r.agentName,` está listo para ayudarte.`]})]})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(zR,{children:[(0,A.jsxs)(BR,{children:[(0,A.jsxs)(VR,{className:`flex items-center gap-3`,children:[(0,A.jsx)(`div`,{className:`w-10 h-10 rounded-lg flex items-center justify-center bg-amber-500`,children:(0,A.jsx)(Bn,{className:`w-6 h-6 text-white`,fill:`currentColor`})}),r.agentName]}),(0,A.jsx)(HR,{children:r.agentDescription||`Sin descripción`})]}),(0,A.jsxs)(UR,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(Z,{className:`text-sm text-muted-foreground`,children:`Proveedor`}),(0,A.jsxs)(`p`,{className:`font-medium`,children:[g.find(e=>e.id===r.provider)?.name||r.provider,` — `,r.model]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(Z,{className:`text-sm text-muted-foreground`,children:`Canales activos`}),(0,A.jsx)(`div`,{className:`flex gap-2 flex-wrap mt-1`,children:Object.entries(r.channels).filter(([e,t])=>t.enabled).map(([e])=>{let t=q9.find(t=>t.id===e);return(0,A.jsxs)(Hz,{variant:`secondary`,children:[t?.icon,` `,t?.name]},e)})})]}),r.voiceEnabled&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(Z,{className:`text-sm text-muted-foreground`,children:`Voz`}),(0,A.jsxs)(`p`,{className:`font-medium`,children:[`STT: `,r.sttProvider,` | TTS: `,r.ttsProvider,r.ttsVoice&&` (${r.ttsVoice})`]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(Z,{className:`text-sm text-muted-foreground`,children:`Reglas éticas activas`}),(0,A.jsx)(`div`,{className:`flex gap-2 flex-wrap mt-1`,children:Object.entries(r.ethicsRules).filter(([e,t])=>t).map(([e])=>(0,A.jsx)(Hz,{variant:`outline`,children:S.find(t=>t.id===e)?.name??e},e))})]})]})]}),(0,A.jsx)(W,{className:`w-full h-14 text-lg bg-amber-500 hover:bg-amber-600`,onClick:j,disabled:a,children:a?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Yn,{className:`w-5 h-5 mr-2 animate-spin`}),`Configurando...`]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(Dr,{className:`w-5 h-5 mr-2`}),`Iniciar a `,r.agentName]})})]})]});return(0,A.jsx)(`div`,{className:`min-h-screen bg-gradient-to-b from-background to-muted/20`,children:(0,A.jsxs)(`div`,{className:`container max-w-2xl mx-auto py-8 px-4`,children:[(0,A.jsxs)(`div`,{className:`mb-8 space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex justify-between text-sm text-muted-foreground`,children:[(0,A.jsxs)(`span`,{children:[`Paso `,t,` de 7`]}),(0,A.jsx)(`button`,{onClick:O,className:`text-xs text-muted-foreground hover:text-foreground`,children:`Reiniciar configuración`})]}),(0,A.jsx)(cB,{value:t/7*100,className:`h-2`})]}),M(),m&&(0,A.jsx)(HQ,{variant:`destructive`,className:`mt-6`,children:(0,A.jsx)(WQ,{children:m})}),!s&&(0,A.jsxs)(`div`,{className:`flex justify-between mt-6 pt-6 border-t`,children:[(0,A.jsx)(W,{variant:`outline`,onClick:D,disabled:t===1,children:`← Anterior`}),t<7?(0,A.jsx)(W,{onClick:E,className:`bg-amber-500 hover:bg-amber-600`,children:`Siguiente →`}):(0,A.jsx)(`div`,{})]})]})})}function IDe(){let e=Fd(),[t,n]=(0,u.useState)(``),[r,i]=(0,u.useState)(``),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(!1),[l,d]=(0,u.useState)(``);(0,u.useEffect)(()=>{fetch(`/api/auth/status`).then(e=>e.json()).then(({hasCredentials:t})=>{t||e(`/`,{replace:!0})}).catch(()=>{})},[]);async function f(n){n.preventDefault(),d(``),c(!0);try{let n=await fetch(`/api/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({email:t,password:r})}),i=await n.json();if(!n.ok){d(i.error||`Credenciales inválidas`);return}localStorage.setItem(`hive-auth-token`,i.authToken),e(`/`,{replace:!0})}catch{d(`No se pudo conectar al servidor`)}finally{c(!1)}}return(0,A.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,A.jsxs)(`div`,{className:`w-full max-w-sm space-y-6 p-8`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`div`,{className:`text-4xl`,children:`🐝`}),(0,A.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:`Hive`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Inicia sesión para continuar`})]}),(0,A.jsxs)(`form`,{onSubmit:f,className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`email`,children:`Email`}),(0,A.jsx)(G,{id:`email`,type:`email`,autoComplete:`email`,placeholder:`tu@email.com`,value:t,onChange:e=>n(e.target.value),required:!0,disabled:s})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`password`,children:`Contraseña`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{id:`password`,type:a?`text`:`password`,autoComplete:`current-password`,placeholder:`••••••••`,value:r,onChange:e=>i(e.target.value),required:!0,disabled:s,className:`pr-10`}),(0,A.jsx)(`button`,{type:`button`,className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>o(e=>!e),tabIndex:-1,children:a?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),l&&(0,A.jsx)(`p`,{className:`text-sm text-destructive`,children:l}),(0,A.jsxs)(W,{type:`submit`,className:`w-full`,disabled:s,children:[s&&(0,A.jsx)(Yn,{className:`mr-2 h-4 w-4 animate-spin`}),`Iniciar Sesión`]})]}),(0,A.jsx)(`div`,{className:`text-center`,children:(0,A.jsx)(`button`,{type:`button`,onClick:()=>e(`/recover`),className:`text-sm text-muted-foreground hover:text-foreground underline underline-offset-4`,children:`¿Olvidaste tu contraseña?`})})]})})}function LDe(){let e=Fd(),[t,n]=(0,u.useState)(``),[r,i]=(0,u.useState)(``),[a,o]=(0,u.useState)(``),[s,c]=(0,u.useState)(!1),[l,d]=(0,u.useState)(!1),[f,p]=(0,u.useState)(``);async function m(n){if(n.preventDefault(),p(``),r!==a){p(`Las contraseñas no coinciden`);return}if(r.length<8){p(`La contraseña debe tener al menos 8 caracteres`);return}d(!0);try{let n=await fetch(`/api/auth/recover`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({recoveryKey:t,newPassword:r})}),i=await n.json();if(!n.ok){p(i.error||`Recovery key inválido`);return}localStorage.setItem(`hive-auth-token`,i.authToken),e(`/`,{replace:!0})}catch{p(`No se pudo conectar al servidor`)}finally{d(!1)}}return(0,A.jsx)(`div`,{className:`min-h-screen flex items-center justify-center bg-background`,children:(0,A.jsxs)(`div`,{className:`w-full max-w-sm space-y-6 p-8`,children:[(0,A.jsxs)(`div`,{className:`text-center space-y-2`,children:[(0,A.jsx)(`div`,{className:`text-4xl`,children:`🐝`}),(0,A.jsx)(`h1`,{className:`text-2xl font-bold tracking-tight`,children:`Recuperar acceso`}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Usa tu recovery key para restablecer la contraseña`})]}),(0,A.jsxs)(`form`,{onSubmit:m,className:`space-y-4`,children:[(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`recoveryKey`,children:`Recovery Key`}),(0,A.jsx)(G,{id:`recoveryKey`,type:`text`,placeholder:`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`,value:t,onChange:e=>n(e.target.value),required:!0,disabled:l,className:`font-mono text-sm`}),(0,A.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Encuéntralo en `,(0,A.jsx)(`code`,{className:`bg-muted px-1 rounded`,children:`~/.hive/.auth_token`})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`newPassword`,children:`Nueva contraseña`}),(0,A.jsxs)(`div`,{className:`relative`,children:[(0,A.jsx)(G,{id:`newPassword`,type:s?`text`:`password`,placeholder:`••••••••`,value:r,onChange:e=>i(e.target.value),required:!0,disabled:l,className:`pr-10`}),(0,A.jsx)(`button`,{type:`button`,className:`absolute right-3 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>c(e=>!e),tabIndex:-1,children:s?(0,A.jsx)(En,{className:`h-4 w-4`}):(0,A.jsx)(Dn,{className:`h-4 w-4`})})]})]}),(0,A.jsxs)(`div`,{className:`space-y-2`,children:[(0,A.jsx)(Z,{htmlFor:`confirmPassword`,children:`Confirmar contraseña`}),(0,A.jsx)(G,{id:`confirmPassword`,type:s?`text`:`password`,placeholder:`••••••••`,value:a,onChange:e=>o(e.target.value),required:!0,disabled:l})]}),f&&(0,A.jsx)(`p`,{className:`text-sm text-destructive`,children:f}),(0,A.jsxs)(W,{type:`submit`,className:`w-full`,disabled:l,children:[l&&(0,A.jsx)(Yn,{className:`mr-2 h-4 w-4 animate-spin`}),`Recuperar acceso`]})]}),(0,A.jsx)(`div`,{className:`text-center`,children:(0,A.jsxs)(`button`,{type:`button`,onClick:()=>e(`/login`),className:`text-sm text-muted-foreground hover:text-foreground inline-flex items-center gap-1`,children:[(0,A.jsx)(Vt,{className:`h-3 w-3`}),`Volver al login`]})})]})})}var RDe=()=>{let e=Md();return(0,u.useEffect)(()=>{console.error(`404 Error: User attempted to access non-existent route:`,e.pathname)},[e.pathname]),(0,A.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-muted`,children:(0,A.jsxs)(`div`,{className:`text-center`,children:[(0,A.jsx)(`h1`,{className:`mb-4 text-4xl font-bold`,children:`404`}),(0,A.jsx)(`p`,{className:`mb-4 text-xl text-muted-foreground`,children:`Oops! Page not found`}),(0,A.jsx)(`a`,{href:`/`,className:`text-primary underline hover:text-primary/90`,children:`Return to Home`})]})})};function Z9({delay:e,startX:t,startY:n,duration:r}){return(0,A.jsxs)(`svg`,{style:{position:`absolute`,left:`${t}%`,top:`${n}%`,animation:`flyBee ${r}s ease-in-out ${e}s infinite`,opacity:0},width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,className:`drop-shadow-lg`,children:[(0,A.jsx)(`ellipse`,{cx:`12`,cy:`14`,rx:`6`,ry:`8`,fill:`#FBBF24`}),(0,A.jsx)(`ellipse`,{cx:`12`,cy:`14`,rx:`3`,ry:`6`,fill:`#1F2937`}),(0,A.jsx)(`circle`,{cx:`8`,cy:`10`,r:`2`,fill:`#1F2937`}),(0,A.jsx)(`circle`,{cx:`16`,cy:`10`,r:`2`,fill:`#1F2937`}),(0,A.jsx)(`path`,{d:`M6 8 Q4 4 8 6`,stroke:`#1F2937`,strokeWidth:`1`,fill:`none`}),(0,A.jsx)(`path`,{d:`M18 8 Q20 4 16 6`,stroke:`#1F2937`,strokeWidth:`1`,fill:`none`}),(0,A.jsx)(`path`,{d:`M9 18 L6 22 L9 20 Z`,fill:`#1F2937`}),(0,A.jsx)(`path`,{d:`M15 18 L18 22 L15 20 Z`,fill:`#1F2937`})]})}function Q9({delay:e,x:t,y:n}){return(0,A.jsx)(`svg`,{style:{position:`absolute`,left:`${t}%`,top:`${n}%`,animation:`sparkle 2s ease-in-out ${e}s infinite`},width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,children:(0,A.jsx)(`path`,{d:`M12 2 L14 10 L22 12 L14 14 L12 22 L10 14 L2 12 L10 10 Z`,fill:`#FCD34D`,className:`animate-pulse`})})}function zDe(){let{isOpen:e,data:t,close:n}=dh(),[r,i]=(0,u.useState)(4);if((0,u.useEffect)(()=>{if(e){i(4);let e=setInterval(()=>{i(t=>t<=1?(clearInterval(e),n(),0):t-1)},1e3);return()=>clearInterval(e)}},[e,n]),!e||!t)return null;let a=t.channels?.length>0?t.channels.join(`, `):`WebChat`;return(0,A.jsxs)(Mm,{open:e,onOpenChange:e=>!e&&n(),children:[(0,A.jsxs)(Pm,{children:[(0,A.jsx)(Fm,{className:`fixed inset-0 bg-black/60 backdrop-blur-sm z-50 animate-fade-in`}),(0,A.jsxs)(Im,{className:`fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-50 w-full max-w-lg focus:outline-none`,children:[(0,A.jsx)(Lm,{className:`sr-only`,children:`Bienvenido al Enjambre`}),(0,A.jsxs)(`div`,{className:`relative bg-gradient-to-br from-amber-50 via-yellow-50 to-orange-100 rounded-3xl shadow-2xl overflow-hidden border-4 border-amber-300/50`,children:[(0,A.jsxs)(`div`,{className:`absolute inset-0 overflow-hidden pointer-events-none`,children:[(0,A.jsx)(`div`,{className:`absolute inset-0 bg-gradient-to-b from-amber-200/30 to-orange-200/30`}),(0,A.jsx)(Z9,{delay:0,startX:10,startY:20,duration:8}),(0,A.jsx)(Z9,{delay:1,startX:80,startY:30,duration:7}),(0,A.jsx)(Z9,{delay:2,startX:20,startY:60,duration:9}),(0,A.jsx)(Z9,{delay:.5,startX:70,startY:70,duration:8}),(0,A.jsx)(Z9,{delay:1.5,startX:40,startY:10,duration:10}),(0,A.jsx)(Z9,{delay:2.5,startX:60,startY:50,duration:7}),(0,A.jsx)(Q9,{delay:0,x:15,y:15}),(0,A.jsx)(Q9,{delay:.5,x:85,y:25}),(0,A.jsx)(Q9,{delay:1,x:25,y:75}),(0,A.jsx)(Q9,{delay:1.5,x:75,y:80}),(0,A.jsx)(Q9,{delay:2,x:50,y:10})]}),(0,A.jsxs)(`div`,{className:`relative p-8 text-center`,children:[(0,A.jsxs)(`div`,{className:`mb-6`,children:[(0,A.jsx)(`h1`,{className:`text-4xl font-black text-transparent bg-clip-text bg-gradient-to-r from-amber-600 via-orange-600 to-amber-700 drop-shadow-sm`,children:`🐝 BIENVENIDO AL ENJAMBRE 🐝`}),(0,A.jsx)(`p`,{className:`text-lg font-semibold text-amber-800 mt-2`,children:`✦在你的 Hive✦`})]}),(0,A.jsx)(`div`,{className:`w-full h-px bg-gradient-to-r from-transparent via-amber-400 to-transparent mb-6`}),(0,A.jsxs)(`div`,{className:`mb-6`,children:[t.user&&(0,A.jsxs)(`p`,{className:`text-2xl font-bold text-gray-800 mb-4`,children:[`👋 Hola, `,(0,A.jsx)(`span`,{className:`text-amber-700`,children:t.user.name}),`!`]}),(0,A.jsxs)(`div`,{className:`flex flex-col gap-2 text-left bg-white/60 rounded-xl p-4 backdrop-blur-sm`,children:[t.agent&&(0,A.jsxs)(`p`,{className:`text-gray-700`,children:[(0,A.jsx)(`span`,{className:`font-semibold`,children:`🤖 Tu agente:`}),` `,(0,A.jsx)(`span`,{className:`text-amber-700`,children:t.agent.name})]}),t.agent&&(0,A.jsxs)(`p`,{className:`text-gray-700`,children:[(0,A.jsx)(`span`,{className:`font-semibold`,children:`🧠 Provider:`}),` `,(0,A.jsxs)(`span`,{className:`text-amber-700`,children:[t.agent.provider,`/`,t.agent.model]})]}),(0,A.jsxs)(`p`,{className:`text-gray-700`,children:[(0,A.jsx)(`span`,{className:`font-semibold`,children:`📡 Canales:`}),` `,(0,A.jsx)(`span`,{className:`text-amber-700`,children:a})]}),t.voice?.enabled&&(0,A.jsxs)(`p`,{className:`text-gray-700`,children:[(0,A.jsx)(`span`,{className:`font-semibold`,children:`🎤 Voz:`}),` `,(0,A.jsxs)(`span`,{className:`text-amber-700`,children:[t.voice.sttProvider,` + `,t.voice.ttsProvider]})]})]})]}),(0,A.jsx)(`div`,{className:`w-full h-px bg-gradient-to-r from-transparent via-amber-400 to-transparent mb-6`}),(0,A.jsxs)(`div`,{className:`mb-6 text-left`,children:[(0,A.jsx)(`p`,{className:`text-lg font-bold text-gray-800 mb-3 text-center`,children:`💡 LO QUE PUEDES HACER CON HIVE:`}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-2 text-sm`,children:[(0,A.jsx)($9,{icon:`🗣️`,text:`Voz en tiempo real (STT/TTS)`}),(0,A.jsx)($9,{icon:`🔧`,text:`Code Bridge (claude-code, gemini)`}),(0,A.jsx)($9,{icon:`🔌`,text:`MCP Servers`}),(0,A.jsx)($9,{icon:`🎨`,text:`Canvas visual`}),(0,A.jsx)($9,{icon:`📱`,text:`Múltiples canales`}),(0,A.jsx)($9,{icon:`🧠`,text:`Múltiples agentes`}),(0,A.jsx)($9,{icon:`💬`,text:`Memoria conversacional`}),(0,A.jsx)($9,{icon:`⚡`,text:`Ejecución de tools`})]})]}),(0,A.jsx)(`div`,{className:`mt-4`,children:(0,A.jsxs)(`p`,{className:`text-amber-600 font-medium animate-pulse`,children:[`🌐 Abriendo Dashboard en `,r,`s...`]})}),(0,A.jsx)(zm,{asChild:!0,children:(0,A.jsx)(`button`,{className:`absolute top-4 right-4 p-2 rounded-full bg-amber-200/80 hover:bg-amber-300 transition-colors`,"aria-label":`Cerrar`,children:(0,A.jsx)(Ur,{className:`w-5 h-5 text-amber-800`})})})]})]})]})]}),(0,A.jsx)(`style`,{children:`
281
+ @keyframes flyBee {
282
+ 0% {
283
+ transform: translate(0, 0) rotate(0deg);
284
+ opacity: 0;
285
+ }
286
+ 10% {
287
+ opacity: 1;
288
+ }
289
+ 25% {
290
+ transform: translate(100px, -50px) rotate(15deg);
291
+ }
292
+ 50% {
293
+ transform: translate(50px, 50px) rotate(-10deg);
294
+ }
295
+ 75% {
296
+ transform: translate(-80px, 20px) rotate(20deg);
297
+ }
298
+ 90% {
299
+ opacity: 1;
300
+ }
301
+ 100% {
302
+ transform: translate(0, 0) rotate(0deg);
303
+ opacity: 0;
304
+ }
305
+ }
306
+
307
+ @keyframes sparkle {
308
+ 0%, 100% {
309
+ opacity: 0;
310
+ transform: scale(0.5);
311
+ }
312
+ 50% {
313
+ opacity: 1;
314
+ transform: scale(1.2);
315
+ }
316
+ }
317
+
318
+ .animate-fade-in {
319
+ animation: fadeIn 0.3s ease-out;
320
+ }
321
+
322
+ @keyframes fadeIn {
323
+ from { opacity: 0; }
324
+ to { opacity: 1; }
325
+ }
326
+ `})]})}function $9({icon:e,text:t}){return(0,A.jsxs)(`div`,{className:`flex items-center gap-2 bg-white/50 rounded-lg px-3 py-2`,children:[(0,A.jsx)(`span`,{className:`text-lg`,children:e}),(0,A.jsx)(`span`,{className:`text-gray-700 text-xs`,children:t})]})}var BDe=()=>{let{isLoading:e,message:t}=Zh();return e?(0,A.jsxs)(`div`,{className:`fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-background/60 backdrop-blur-md animate-in fade-in duration-300`,children:[(0,A.jsx)(`div`,{className:`relative h-32 w-32 animate-bounce duration-[2000ms]`,children:(0,A.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`h-full w-full drop-shadow-[0_0_15px_rgba(245,158,11,0.5)]`,children:[(0,A.jsxs)(`g`,{className:`animate-[wing-flap_0.1s_infinite]`,children:[(0,A.jsx)(`path`,{d:`M50 40 C30 20 10 30 20 50 C30 70 50 60 50 40`,fill:`rgba(255,255,255,0.7)`,stroke:`white`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M50 40 C70 20 90 30 80 50 C70 70 50 60 50 40`,fill:`rgba(255,255,255,0.7)`,stroke:`white`,strokeWidth:`1`})]}),(0,A.jsx)(`ellipse`,{cx:`50`,cy:`55`,rx:`20`,ry:`15`,fill:`#F59E0B`}),(0,A.jsx)(`path`,{d:`M40 45 Q50 40 60 45`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M35 55 Q50 50 65 55`,fill:`none`,stroke:`#1F2937`,strokeWidth:`3`}),(0,A.jsx)(`path`,{d:`M40 65 Q50 60 60 65`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`}),(0,A.jsx)(`circle`,{cx:`68`,cy:`50`,r:`8`,fill:`#F59E0B`}),(0,A.jsx)(`circle`,{cx:`72`,cy:`48`,r:`1.5`,fill:`#1F2937`}),(0,A.jsx)(`path`,{d:`M70 42 Q75 35 80 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M68 42 Q65 35 60 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M30 55 L20 55`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`})]})}),t&&(0,A.jsx)(`p`,{className:`mt-8 text-lg font-medium tracking-wide text-primary animate-pulse italic`,children:t}),(0,A.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`
327
+ @keyframes wing-flap {
328
+ 0%, 100% { transform: scaleY(1); }
329
+ 50% { transform: scaleY(0.5); }
330
+ }
331
+ `}})]}):null},VDe=(0,u.lazy)(()=>Ru(()=>import(`./ui-Dea4K2Mp.js`).then(e=>({default:e.LessonCanvas})),__vite__mapDeps([0,1,2])).catch(()=>({default:()=>(0,A.jsx)(`div`,{className:`flex h-screen items-center justify-center text-gray-400`,children:`HiveLearn no disponible — verifica que Ollama esté corriendo.`})}))),HDe=new _u;function UDe({children:e}){let t=localStorage.getItem(`hive-auth-token`),[n,r]=(0,u.useState)(`loading`);return(0,u.useEffect)(()=>{fetch(`/api/auth/status`).then(e=>e.json()).then(e=>r(e.hasCredentials?`protected`:`open`)).catch(()=>r(`open`))},[]),n===`loading`?null:n===`open`||t?(0,A.jsx)(A.Fragment,{children:e}):(0,A.jsx)(lf,{to:`/login`,replace:!0})}var WDe=()=>{let e=ig(e=>e.fetchUser),t=Fd(),n=Md(),[r,i]=(0,u.useState)(!1),[a,o]=(0,u.useState)(!1),[s,c]=(0,u.useState)(!1);return kR(!s&&a&&r),(0,u.useEffect)(()=>{let e=!1,t=`${_h()}/health`;async function n(){for(;!e;){try{if((await(await fetch(t)).json().catch(()=>({}))).status===`ok`){i(!0);return}}catch{}await new Promise(e=>setTimeout(e,1e3))}}return n(),()=>{e=!0}},[]),(0,u.useEffect)(()=>{if(!r)return;let i=new URLSearchParams(window.location.search).get(`token`);if(i){localStorage.setItem(`hive-auth-token`,i);let e=window.location.pathname+window.location.hash;window.history.replaceState({},``,e)}fetch(`/api/setup/status`).then(e=>e.json()).then(({setupMode:r})=>{c(!!r),r&&n.pathname!==`/setup`?t(`/setup`,{replace:!0}):!r&&n.pathname===`/setup`&&t(`/`,{replace:!0}),o(!0),r||localStorage.getItem(`hive-auth-token`)&&e()}).catch(()=>{o(!0),localStorage.getItem(`hive-auth-token`)&&e()})},[r]),!r||!a?(0,A.jsxs)(`div`,{className:`fixed inset-0 z-[9999] flex flex-col items-center justify-center bg-background/60 backdrop-blur-md`,children:[(0,A.jsx)(`div`,{className:`relative h-32 w-32 animate-bounce`,style:{animationDuration:`2000ms`},children:(0,A.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`h-full w-full`,style:{filter:`drop-shadow(0 0 15px rgba(245,158,11,0.5))`},children:[(0,A.jsx)(`ellipse`,{cx:`50`,cy:`55`,rx:`20`,ry:`15`,fill:`#F59E0B`}),(0,A.jsx)(`path`,{d:`M40 45 Q50 40 60 45`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`}),(0,A.jsx)(`path`,{d:`M35 55 Q50 50 65 55`,fill:`none`,stroke:`#1F2937`,strokeWidth:`3`}),(0,A.jsx)(`path`,{d:`M40 65 Q50 60 60 65`,fill:`none`,stroke:`#1F2937`,strokeWidth:`2`}),(0,A.jsx)(`circle`,{cx:`68`,cy:`50`,r:`8`,fill:`#F59E0B`}),(0,A.jsx)(`circle`,{cx:`72`,cy:`48`,r:`1.5`,fill:`#1F2937`}),(0,A.jsx)(`path`,{d:`M70 42 Q75 35 80 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M68 42 Q65 35 60 38`,fill:`none`,stroke:`#1F2937`,strokeWidth:`1`}),(0,A.jsx)(`path`,{d:`M30 55 L20 55`,stroke:`#1F2937`,strokeWidth:`2`,strokeLinecap:`round`})]})}),(0,A.jsx)(`p`,{className:`mt-8 text-lg font-medium tracking-wide text-primary animate-pulse italic`,children:r?`Sincronizando...`:`Iniciando la colmena...`})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(BDe,{}),(0,A.jsx)(zDe,{}),(0,A.jsxs)(See,{children:[(0,A.jsx)(df,{path:`/setup`,element:(0,A.jsx)(FDe,{})}),(0,A.jsx)(df,{path:`/login`,element:(0,A.jsx)(IDe,{})}),(0,A.jsx)(df,{path:`/recover`,element:(0,A.jsx)(LDe,{})}),(0,A.jsxs)(df,{element:(0,A.jsx)(UDe,{children:(0,A.jsx)(og,{})}),children:[(0,A.jsx)(df,{path:`/`,element:(0,A.jsx)(dB,{})}),(0,A.jsx)(df,{path:`/chat`,element:(0,A.jsx)(jDe,{})}),(0,A.jsx)(df,{path:`/agents`,element:(0,A.jsx)(xq,{})}),(0,A.jsx)(df,{path:`/agents/new`,element:(0,A.jsx)(KJ,{})}),(0,A.jsx)(df,{path:`/agents/:id`,element:(0,A.jsx)(Eq,{})}),(0,A.jsx)(df,{path:`/notas`,element:(0,A.jsx)(GJ,{forcePanel:`notas`})}),(0,A.jsx)(df,{path:`/cron-jobs`,element:(0,A.jsx)(GJ,{forcePanel:`cron-jobs`})}),(0,A.jsx)(df,{path:`/settings`,element:(0,A.jsx)(GJ,{})}),(0,A.jsx)(df,{path:`/settings/:panel`,element:(0,A.jsx)(GJ,{})}),(0,A.jsx)(df,{path:`/canvas`,element:(0,A.jsx)(C7,{})}),(0,A.jsx)(df,{path:`/canvas/:sessionId`,element:(0,A.jsx)(C7,{})}),(0,A.jsx)(df,{path:`/projects`,element:(0,A.jsx)(Nwe,{})}),(0,A.jsx)(df,{path:`/bridge`,element:(0,A.jsx)(XCe,{})}),(0,A.jsx)(df,{path:`/channels`,element:(0,A.jsx)(Twe,{})}),(0,A.jsx)(df,{path:`/providers`,element:(0,A.jsx)(Xwe,{})}),(0,A.jsx)(df,{path:`/logs`,element:(0,A.jsx)(ZCe,{})}),(0,A.jsx)(df,{path:`/hivelearn`,element:(0,A.jsx)(u.Suspense,{fallback:(0,A.jsx)(`div`,{className:`flex h-screen items-center justify-center text-amber-400`,children:`Cargando HiveLearn...`}),children:(0,A.jsx)(VDe,{})})}),(0,A.jsx)(df,{path:`/hivelearn/sessions`,element:(0,A.jsx)(hTe,{})}),(0,A.jsx)(df,{path:`/hivelearn/swarm`,element:(0,A.jsx)(rTe,{})}),(0,A.jsx)(df,{path:`/hivelearn/config`,element:(0,A.jsx)(uTe,{})})]}),(0,A.jsx)(df,{path:`*`,element:(0,A.jsx)(RDe,{})})]})]})};(0,l.createRoot)(document.getElementById(`root`)).render((0,A.jsx)(()=>(0,A.jsx)(bu,{client:HDe,children:(0,A.jsxs)(al,{children:[(0,A.jsx)(Qi,{}),(0,A.jsx)(Na,{}),(0,A.jsx)(Yee,{children:(0,A.jsx)(WDe,{})})]})}),{}));export{JC as a,c,YC as i,$C as n,AC as o,QC as r,k as s,p1 as t};