@danhachuel/leadmaster 0.1.1 → 0.1.3

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.
@@ -1,90 +0,0 @@
1
- var y0=Object.defineProperty;var b0=(e,t,n)=>t in e?y0(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var I=(e,t,n)=>b0(e,typeof t!="symbol"?t+"":t,n);function w0(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(r,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function _0(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jp={exports:{}},Oa={},Np={exports:{}},H={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Oi=Symbol.for("react.element"),S0=Symbol.for("react.portal"),k0=Symbol.for("react.fragment"),C0=Symbol.for("react.strict_mode"),j0=Symbol.for("react.profiler"),N0=Symbol.for("react.provider"),E0=Symbol.for("react.context"),M0=Symbol.for("react.forward_ref"),P0=Symbol.for("react.suspense"),R0=Symbol.for("react.memo"),O0=Symbol.for("react.lazy"),zd=Symbol.iterator;function D0(e){return e===null||typeof e!="object"?null:(e=zd&&e[zd]||e["@@iterator"],typeof e=="function"?e:null)}var Ep={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Mp=Object.assign,Pp={};function cs(e,t,n){this.props=e,this.context=t,this.refs=Pp,this.updater=n||Ep}cs.prototype.isReactComponent={};cs.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};cs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rp(){}Rp.prototype=cs.prototype;function cu(e,t,n){this.props=e,this.context=t,this.refs=Pp,this.updater=n||Ep}var uu=cu.prototype=new Rp;uu.constructor=cu;Mp(uu,cs.prototype);uu.isPureReactComponent=!0;var Id=Array.isArray,Op=Object.prototype.hasOwnProperty,du={current:null},Dp={key:!0,ref:!0,__self:!0,__source:!0};function Tp(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Op.call(t,r)&&!Dp.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),c=0;c<a;c++)l[c]=arguments[c+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Oi,type:e,key:i,ref:o,props:s,_owner:du.current}}function T0(e,t){return{$$typeof:Oi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function fu(e){return typeof e=="object"&&e!==null&&e.$$typeof===Oi}function L0(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Fd=/\/+/g;function ul(e,t){return typeof e=="object"&&e!==null&&e.key!=null?L0(""+e.key):t.toString(36)}function Co(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Oi:case S0:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+ul(o,0):r,Id(s)?(n="",e!=null&&(n=e.replace(Fd,"$&/")+"/"),Co(s,t,n,"",function(c){return c})):s!=null&&(fu(s)&&(s=T0(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Fd,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Id(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+ul(i,a);o+=Co(i,t,n,l,s)}else if(l=D0(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+ul(i,a++),o+=Co(i,t,n,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ki(e,t,n){if(e==null)return e;var r=[],s=0;return Co(e,r,"","",function(i){return t.call(n,i,s++)}),r}function A0(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var We={current:null},jo={transition:null},z0={ReactCurrentDispatcher:We,ReactCurrentBatchConfig:jo,ReactCurrentOwner:du};function Lp(){throw Error("act(...) is not supported in production builds of React.")}H.Children={map:Ki,forEach:function(e,t,n){Ki(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ki(e,function(){t++}),t},toArray:function(e){return Ki(e,function(t){return t})||[]},only:function(e){if(!fu(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};H.Component=cs;H.Fragment=k0;H.Profiler=j0;H.PureComponent=cu;H.StrictMode=C0;H.Suspense=P0;H.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=z0;H.act=Lp;H.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Mp({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=du.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Op.call(t,l)&&!Dp.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var c=0;c<l;c++)a[c]=arguments[c+2];r.children=a}return{$$typeof:Oi,type:e.type,key:s,ref:i,props:r,_owner:o}};H.createContext=function(e){return e={$$typeof:E0,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:N0,_context:e},e.Consumer=e};H.createElement=Tp;H.createFactory=function(e){var t=Tp.bind(null,e);return t.type=e,t};H.createRef=function(){return{current:null}};H.forwardRef=function(e){return{$$typeof:M0,render:e}};H.isValidElement=fu;H.lazy=function(e){return{$$typeof:O0,_payload:{_status:-1,_result:e},_init:A0}};H.memo=function(e,t){return{$$typeof:R0,type:e,compare:t===void 0?null:t}};H.startTransition=function(e){var t=jo.transition;jo.transition={};try{e()}finally{jo.transition=t}};H.unstable_act=Lp;H.useCallback=function(e,t){return We.current.useCallback(e,t)};H.useContext=function(e){return We.current.useContext(e)};H.useDebugValue=function(){};H.useDeferredValue=function(e){return We.current.useDeferredValue(e)};H.useEffect=function(e,t){return We.current.useEffect(e,t)};H.useId=function(){return We.current.useId()};H.useImperativeHandle=function(e,t,n){return We.current.useImperativeHandle(e,t,n)};H.useInsertionEffect=function(e,t){return We.current.useInsertionEffect(e,t)};H.useLayoutEffect=function(e,t){return We.current.useLayoutEffect(e,t)};H.useMemo=function(e,t){return We.current.useMemo(e,t)};H.useReducer=function(e,t,n){return We.current.useReducer(e,t,n)};H.useRef=function(e){return We.current.useRef(e)};H.useState=function(e){return We.current.useState(e)};H.useSyncExternalStore=function(e,t,n){return We.current.useSyncExternalStore(e,t,n)};H.useTransition=function(){return We.current.useTransition()};H.version="18.3.1";Np.exports=H;var b=Np.exports;const fe=_0(b),I0=w0({__proto__:null,default:fe},[b]);/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var F0=b,B0=Symbol.for("react.element"),W0=Symbol.for("react.fragment"),$0=Object.prototype.hasOwnProperty,H0=F0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,V0={key:!0,ref:!0,__self:!0,__source:!0};function Ap(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)$0.call(t,r)&&!V0.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:B0,type:e,key:i,ref:o,props:s,_owner:H0.current}}Oa.Fragment=W0;Oa.jsx=Ap;Oa.jsxs=Ap;jp.exports=Oa;var u=jp.exports,Zl={},zp={exports:{}},lt={},Ip={exports:{}},Fp={};/**
18
- * @license React
19
- * scheduler.production.min.js
20
- *
21
- * Copyright (c) Facebook, Inc. and its affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(O,T){var L=O.length;O.push(T);e:for(;0<L;){var V=L-1>>>1,W=O[V];if(0<s(W,T))O[V]=T,O[L]=W,L=V;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var T=O[0],L=O.pop();if(L!==T){O[0]=L;e:for(var V=0,W=O.length,se=W>>>1;V<se;){var U=2*(V+1)-1,be=O[U],G=U+1,bt=O[G];if(0>s(be,L))G<W&&0>s(bt,be)?(O[V]=bt,O[G]=L,V=G):(O[V]=be,O[U]=L,V=U);else if(G<W&&0>s(bt,L))O[V]=bt,O[G]=L,V=G;else break e}}return T}function s(O,T){var L=O.sortIndex-T.sortIndex;return L!==0?L:O.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],c=[],d=1,f=null,h=3,p=!1,v=!1,m=!1,w=typeof setTimeout=="function"?setTimeout:null,x=typeof clearTimeout=="function"?clearTimeout:null,g=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(O){for(var T=n(c);T!==null;){if(T.callback===null)r(c);else if(T.startTime<=O)r(c),T.sortIndex=T.expirationTime,t(l,T);else break;T=n(c)}}function _(O){if(m=!1,y(O),!v)if(n(l)!==null)v=!0,q(k);else{var T=n(c);T!==null&&J(_,T.startTime-O)}}function k(O,T){v=!1,m&&(m=!1,x(j),j=-1),p=!0;var L=h;try{for(y(T),f=n(l);f!==null&&(!(f.expirationTime>T)||O&&!R());){var V=f.callback;if(typeof V=="function"){f.callback=null,h=f.priorityLevel;var W=V(f.expirationTime<=T);T=e.unstable_now(),typeof W=="function"?f.callback=W:f===n(l)&&r(l),y(T)}else r(l);f=n(l)}if(f!==null)var se=!0;else{var U=n(c);U!==null&&J(_,U.startTime-T),se=!1}return se}finally{f=null,h=L,p=!1}}var S=!1,C=null,j=-1,P=5,E=-1;function R(){return!(e.unstable_now()-E<P)}function A(){if(C!==null){var O=e.unstable_now();E=O;var T=!0;try{T=C(!0,O)}finally{T?N():(S=!1,C=null)}}else S=!1}var N;if(typeof g=="function")N=function(){g(A)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,z=F.port2;F.port1.onmessage=A,N=function(){z.postMessage(null)}}else N=function(){w(A,0)};function q(O){C=O,S||(S=!0,N())}function J(O,T){j=w(function(){O(e.unstable_now())},T)}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(O){O.callback=null},e.unstable_continueExecution=function(){v||p||(v=!0,q(k))},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(O){switch(h){case 1:case 2:case 3:var T=3;break;default:T=h}var L=h;h=T;try{return O()}finally{h=L}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(O,T){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var L=h;h=O;try{return T()}finally{h=L}},e.unstable_scheduleCallback=function(O,T,L){var V=e.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?V+L:V):L=V,O){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=L+W,O={id:d++,callback:T,priorityLevel:O,startTime:L,expirationTime:W,sortIndex:-1},L>V?(O.sortIndex=L,t(c,O),n(l)===null&&O===n(c)&&(m?(x(j),j=-1):m=!0,J(_,L-V))):(O.sortIndex=W,t(l,O),v||p||(v=!0,q(k))),O},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(O){var T=h;return function(){var L=h;h=T;try{return O.apply(this,arguments)}finally{h=L}}}})(Fp);Ip.exports=Fp;var U0=Ip.exports;/**
26
- * @license React
27
- * react-dom.production.min.js
28
- *
29
- * Copyright (c) Facebook, Inc. and its affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Y0=b,at=U0;function M(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 Bp=new Set,oi={};function wr(e,t){es(e,t),es(e+"Capture",t)}function es(e,t){for(oi[e]=t,e=0;e<t.length;e++)Bp.add(t[e])}var sn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ec=Object.prototype.hasOwnProperty,K0=/^[: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]*$/,Bd={},Wd={};function X0(e){return ec.call(Wd,e)?!0:ec.call(Bd,e)?!1:K0.test(e)?Wd[e]=!0:(Bd[e]=!0,!1)}function Q0(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function G0(e,t,n,r){if(t===null||typeof t>"u"||Q0(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function $e(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var De={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){De[e]=new $e(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];De[t]=new $e(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){De[e]=new $e(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){De[e]=new $e(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){De[e]=new $e(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){De[e]=new $e(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){De[e]=new $e(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){De[e]=new $e(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){De[e]=new $e(e,5,!1,e.toLowerCase(),null,!1,!1)});var hu=/[\-:]([a-z])/g;function pu(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(hu,pu);De[t]=new $e(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(hu,pu);De[t]=new $e(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(hu,pu);De[t]=new $e(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){De[e]=new $e(e,1,!1,e.toLowerCase(),null,!1,!1)});De.xlinkHref=new $e("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){De[e]=new $e(e,1,!1,e.toLowerCase(),null,!0,!0)});function gu(e,t,n,r){var s=De.hasOwnProperty(t)?De[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(G0(t,n,s,r)&&(n=null),r||s===null?X0(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var un=Y0.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Xi=Symbol.for("react.element"),Rr=Symbol.for("react.portal"),Or=Symbol.for("react.fragment"),mu=Symbol.for("react.strict_mode"),tc=Symbol.for("react.profiler"),Wp=Symbol.for("react.provider"),$p=Symbol.for("react.context"),xu=Symbol.for("react.forward_ref"),nc=Symbol.for("react.suspense"),rc=Symbol.for("react.suspense_list"),vu=Symbol.for("react.memo"),vn=Symbol.for("react.lazy"),Hp=Symbol.for("react.offscreen"),$d=Symbol.iterator;function _s(e){return e===null||typeof e!="object"?null:(e=$d&&e[$d]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Object.assign,dl;function As(e){if(dl===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);dl=t&&t[1]||""}return`
34
- `+dl+e}var fl=!1;function hl(e,t){if(!e||fl)return"";fl=!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(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var s=c.stack.split(`
35
- `),i=r.stack.split(`
36
- `),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
37
- `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{fl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?As(e):""}function q0(e){switch(e.tag){case 5:return As(e.type);case 16:return As("Lazy");case 13:return As("Suspense");case 19:return As("SuspenseList");case 0:case 2:case 15:return e=hl(e.type,!1),e;case 11:return e=hl(e.type.render,!1),e;case 1:return e=hl(e.type,!0),e;default:return""}}function sc(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 Or:return"Fragment";case Rr:return"Portal";case tc:return"Profiler";case mu:return"StrictMode";case nc:return"Suspense";case rc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $p:return(e.displayName||"Context")+".Consumer";case Wp:return(e._context.displayName||"Context")+".Provider";case xu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case vu:return t=e.displayName||null,t!==null?t:sc(e.type)||"Memo";case vn:t=e._payload,e=e._init;try{return sc(e(t))}catch{}}return null}function J0(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sc(t);case 8:return t===mu?"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 $n(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Z0(e){var t=Vp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Qi(e){e._valueTracker||(e._valueTracker=Z0(e))}function Up(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Vp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ho(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function ic(e,t){var n=t.checked;return pe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$n(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Yp(e,t){t=t.checked,t!=null&&gu(e,"checked",t,!1)}function oc(e,t){Yp(e,t);var n=$n(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")?ac(e,t.type,n):t.hasOwnProperty("defaultValue")&&ac(e,t.type,$n(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Vd(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 ac(e,t,n){(t!=="number"||Ho(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var zs=Array.isArray;function Vr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$n(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function lc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(M(91));return pe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ud(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(M(92));if(zs(n)){if(1<n.length)throw Error(M(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$n(n)}}function Kp(e,t){var n=$n(t.value),r=$n(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 Yd(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Xp(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 cc(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Xp(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Gi,Qp=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Gi=Gi||document.createElement("div"),Gi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Gi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ai(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Us={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},ev=["Webkit","ms","Moz","O"];Object.keys(Us).forEach(function(e){ev.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Us[t]=Us[e]})});function Gp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Us.hasOwnProperty(e)&&Us[e]?(""+t).trim():t+"px"}function qp(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=Gp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var tv=pe({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 uc(e,t){if(t){if(tv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(M(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(M(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(M(61))}if(t.style!=null&&typeof t.style!="object")throw Error(M(62))}}function dc(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 fc=null;function yu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hc=null,Ur=null,Yr=null;function Kd(e){if(e=Li(e)){if(typeof hc!="function")throw Error(M(280));var t=e.stateNode;t&&(t=za(t),hc(e.stateNode,e.type,t))}}function Jp(e){Ur?Yr?Yr.push(e):Yr=[e]:Ur=e}function Zp(){if(Ur){var e=Ur,t=Yr;if(Yr=Ur=null,Kd(e),t)for(e=0;e<t.length;e++)Kd(t[e])}}function eg(e,t){return e(t)}function tg(){}var pl=!1;function ng(e,t,n){if(pl)return e(t,n);pl=!0;try{return eg(e,t,n)}finally{pl=!1,(Ur!==null||Yr!==null)&&(tg(),Zp())}}function li(e,t){var n=e.stateNode;if(n===null)return null;var r=za(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(M(231,t,typeof n));return n}var pc=!1;if(sn)try{var Ss={};Object.defineProperty(Ss,"passive",{get:function(){pc=!0}}),window.addEventListener("test",Ss,Ss),window.removeEventListener("test",Ss,Ss)}catch{pc=!1}function nv(e,t,n,r,s,i,o,a,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(d){this.onError(d)}}var Ys=!1,Vo=null,Uo=!1,gc=null,rv={onError:function(e){Ys=!0,Vo=e}};function sv(e,t,n,r,s,i,o,a,l){Ys=!1,Vo=null,nv.apply(rv,arguments)}function iv(e,t,n,r,s,i,o,a,l){if(sv.apply(this,arguments),Ys){if(Ys){var c=Vo;Ys=!1,Vo=null}else throw Error(M(198));Uo||(Uo=!0,gc=c)}}function _r(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 rg(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 Xd(e){if(_r(e)!==e)throw Error(M(188))}function ov(e){var t=e.alternate;if(!t){if(t=_r(e),t===null)throw Error(M(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return Xd(s),e;if(i===r)return Xd(s),t;i=i.sibling}throw Error(M(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(M(189))}}if(n.alternate!==r)throw Error(M(190))}if(n.tag!==3)throw Error(M(188));return n.stateNode.current===n?e:t}function sg(e){return e=ov(e),e!==null?ig(e):null}function ig(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=ig(e);if(t!==null)return t;e=e.sibling}return null}var og=at.unstable_scheduleCallback,Qd=at.unstable_cancelCallback,av=at.unstable_shouldYield,lv=at.unstable_requestPaint,xe=at.unstable_now,cv=at.unstable_getCurrentPriorityLevel,bu=at.unstable_ImmediatePriority,ag=at.unstable_UserBlockingPriority,Yo=at.unstable_NormalPriority,uv=at.unstable_LowPriority,lg=at.unstable_IdlePriority,Da=null,Ht=null;function dv(e){if(Ht&&typeof Ht.onCommitFiberRoot=="function")try{Ht.onCommitFiberRoot(Da,e,void 0,(e.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:pv,fv=Math.log,hv=Math.LN2;function pv(e){return e>>>=0,e===0?32:31-(fv(e)/hv|0)|0}var qi=64,Ji=4194304;function Is(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 Ko(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Is(a):(i&=o,i!==0&&(r=Is(i)))}else o=n&~s,o!==0?r=Is(o):i!==0&&(r=Is(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-jt(t),s=1<<n,r|=e[n],t&=~s;return r}function gv(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 mv(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-jt(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=gv(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function mc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function cg(){var e=qi;return qi<<=1,!(qi&4194240)&&(qi=64),e}function gl(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Di(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function xv(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 s=31-jt(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function wu(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var ee=0;function ug(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var dg,_u,fg,hg,pg,xc=!1,Zi=[],Pn=null,Rn=null,On=null,ci=new Map,ui=new Map,wn=[],vv="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 Gd(e,t){switch(e){case"focusin":case"focusout":Pn=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":ci.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ui.delete(t.pointerId)}}function ks(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Li(t),t!==null&&_u(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function yv(e,t,n,r,s){switch(t){case"focusin":return Pn=ks(Pn,e,t,n,r,s),!0;case"dragenter":return Rn=ks(Rn,e,t,n,r,s),!0;case"mouseover":return On=ks(On,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return ci.set(i,ks(ci.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,ui.set(i,ks(ui.get(i)||null,e,t,n,r,s)),!0}return!1}function gg(e){var t=ar(e.target);if(t!==null){var n=_r(t);if(n!==null){if(t=n.tag,t===13){if(t=rg(n),t!==null){e.blockedOn=t,pg(e.priority,function(){fg(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 No(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vc(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);fc=r,n.target.dispatchEvent(r),fc=null}else return t=Li(n),t!==null&&_u(t),e.blockedOn=n,!1;t.shift()}return!0}function qd(e,t,n){No(e)&&n.delete(t)}function bv(){xc=!1,Pn!==null&&No(Pn)&&(Pn=null),Rn!==null&&No(Rn)&&(Rn=null),On!==null&&No(On)&&(On=null),ci.forEach(qd),ui.forEach(qd)}function Cs(e,t){e.blockedOn===t&&(e.blockedOn=null,xc||(xc=!0,at.unstable_scheduleCallback(at.unstable_NormalPriority,bv)))}function di(e){function t(s){return Cs(s,e)}if(0<Zi.length){Cs(Zi[0],e);for(var n=1;n<Zi.length;n++){var r=Zi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Pn!==null&&Cs(Pn,e),Rn!==null&&Cs(Rn,e),On!==null&&Cs(On,e),ci.forEach(t),ui.forEach(t),n=0;n<wn.length;n++)r=wn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<wn.length&&(n=wn[0],n.blockedOn===null);)gg(n),n.blockedOn===null&&wn.shift()}var Kr=un.ReactCurrentBatchConfig,Xo=!0;function wv(e,t,n,r){var s=ee,i=Kr.transition;Kr.transition=null;try{ee=1,Su(e,t,n,r)}finally{ee=s,Kr.transition=i}}function _v(e,t,n,r){var s=ee,i=Kr.transition;Kr.transition=null;try{ee=4,Su(e,t,n,r)}finally{ee=s,Kr.transition=i}}function Su(e,t,n,r){if(Xo){var s=vc(e,t,n,r);if(s===null)Cl(e,t,r,Qo,n),Gd(e,r);else if(yv(s,e,t,n,r))r.stopPropagation();else if(Gd(e,r),t&4&&-1<vv.indexOf(e)){for(;s!==null;){var i=Li(s);if(i!==null&&dg(i),i=vc(e,t,n,r),i===null&&Cl(e,t,r,Qo,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else Cl(e,t,r,null,n)}}var Qo=null;function vc(e,t,n,r){if(Qo=null,e=yu(r),e=ar(e),e!==null)if(t=_r(e),t===null)e=null;else if(n=t.tag,n===13){if(e=rg(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 Qo=e,null}function mg(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(cv()){case bu:return 1;case ag:return 4;case Yo:case uv:return 16;case lg:return 536870912;default:return 16}default:return 16}}var Sn=null,ku=null,Eo=null;function xg(){if(Eo)return Eo;var e,t=ku,n=t.length,r,s="value"in Sn?Sn.value:Sn.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return Eo=s.slice(e,1<r?1-r:void 0)}function Mo(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 eo(){return!0}function Jd(){return!1}function ct(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?eo:Jd,this.isPropagationStopped=Jd,this}return pe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=eo)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=eo)},persist:function(){},isPersistent:eo}),t}var us={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cu=ct(us),Ti=pe({},us,{view:0,detail:0}),Sv=ct(Ti),ml,xl,js,Ta=pe({},Ti,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ju,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!==js&&(js&&e.type==="mousemove"?(ml=e.screenX-js.screenX,xl=e.screenY-js.screenY):xl=ml=0,js=e),ml)},movementY:function(e){return"movementY"in e?e.movementY:xl}}),Zd=ct(Ta),kv=pe({},Ta,{dataTransfer:0}),Cv=ct(kv),jv=pe({},Ti,{relatedTarget:0}),vl=ct(jv),Nv=pe({},us,{animationName:0,elapsedTime:0,pseudoElement:0}),Ev=ct(Nv),Mv=pe({},us,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pv=ct(Mv),Rv=pe({},us,{data:0}),ef=ct(Rv),Ov={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dv={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"},Tv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Lv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Tv[e])?!!t[e]:!1}function ju(){return Lv}var Av=pe({},Ti,{key:function(e){if(e.key){var t=Ov[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Mo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Dv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ju,charCode:function(e){return e.type==="keypress"?Mo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Mo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zv=ct(Av),Iv=pe({},Ta,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),tf=ct(Iv),Fv=pe({},Ti,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ju}),Bv=ct(Fv),Wv=pe({},us,{propertyName:0,elapsedTime:0,pseudoElement:0}),$v=ct(Wv),Hv=pe({},Ta,{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}),Vv=ct(Hv),Uv=[9,13,27,32],Nu=sn&&"CompositionEvent"in window,Ks=null;sn&&"documentMode"in document&&(Ks=document.documentMode);var Yv=sn&&"TextEvent"in window&&!Ks,vg=sn&&(!Nu||Ks&&8<Ks&&11>=Ks),nf=" ",rf=!1;function yg(e,t){switch(e){case"keyup":return Uv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function bg(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dr=!1;function Kv(e,t){switch(e){case"compositionend":return bg(t);case"keypress":return t.which!==32?null:(rf=!0,nf);case"textInput":return e=t.data,e===nf&&rf?null:e;default:return null}}function Xv(e,t){if(Dr)return e==="compositionend"||!Nu&&yg(e,t)?(e=xg(),Eo=ku=Sn=null,Dr=!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 vg&&t.locale!=="ko"?null:t.data;default:return null}}var Qv={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 sf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Qv[e.type]:t==="textarea"}function wg(e,t,n,r){Jp(r),t=Go(t,"onChange"),0<t.length&&(n=new Cu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Xs=null,fi=null;function Gv(e){Og(e,0)}function La(e){var t=Ar(e);if(Up(t))return e}function qv(e,t){if(e==="change")return t}var _g=!1;if(sn){var yl;if(sn){var bl="oninput"in document;if(!bl){var of=document.createElement("div");of.setAttribute("oninput","return;"),bl=typeof of.oninput=="function"}yl=bl}else yl=!1;_g=yl&&(!document.documentMode||9<document.documentMode)}function af(){Xs&&(Xs.detachEvent("onpropertychange",Sg),fi=Xs=null)}function Sg(e){if(e.propertyName==="value"&&La(fi)){var t=[];wg(t,fi,e,yu(e)),ng(Gv,t)}}function Jv(e,t,n){e==="focusin"?(af(),Xs=t,fi=n,Xs.attachEvent("onpropertychange",Sg)):e==="focusout"&&af()}function Zv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return La(fi)}function ey(e,t){if(e==="click")return La(t)}function ty(e,t){if(e==="input"||e==="change")return La(t)}function ny(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Et=typeof Object.is=="function"?Object.is:ny;function hi(e,t){if(Et(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!ec.call(t,s)||!Et(e[s],t[s]))return!1}return!0}function lf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function cf(e,t){var n=lf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=lf(n)}}function kg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Cg(){for(var e=window,t=Ho();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ho(e.document)}return t}function Eu(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 ry(e){var t=Cg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&kg(n.ownerDocument.documentElement,n)){if(r!==null&&Eu(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 s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=cf(n,i);var o=cf(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var sy=sn&&"documentMode"in document&&11>=document.documentMode,Tr=null,yc=null,Qs=null,bc=!1;function uf(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bc||Tr==null||Tr!==Ho(r)||(r=Tr,"selectionStart"in r&&Eu(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}),Qs&&hi(Qs,r)||(Qs=r,r=Go(yc,"onSelect"),0<r.length&&(t=new Cu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function to(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Lr={animationend:to("Animation","AnimationEnd"),animationiteration:to("Animation","AnimationIteration"),animationstart:to("Animation","AnimationStart"),transitionend:to("Transition","TransitionEnd")},wl={},jg={};sn&&(jg=document.createElement("div").style,"AnimationEvent"in window||(delete Lr.animationend.animation,delete Lr.animationiteration.animation,delete Lr.animationstart.animation),"TransitionEvent"in window||delete Lr.transitionend.transition);function Aa(e){if(wl[e])return wl[e];if(!Lr[e])return e;var t=Lr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jg)return wl[e]=t[n];return e}var Ng=Aa("animationend"),Eg=Aa("animationiteration"),Mg=Aa("animationstart"),Pg=Aa("transitionend"),Rg=new Map,df="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 Kn(e,t){Rg.set(e,t),wr(t,[e])}for(var _l=0;_l<df.length;_l++){var Sl=df[_l],iy=Sl.toLowerCase(),oy=Sl[0].toUpperCase()+Sl.slice(1);Kn(iy,"on"+oy)}Kn(Ng,"onAnimationEnd");Kn(Eg,"onAnimationIteration");Kn(Mg,"onAnimationStart");Kn("dblclick","onDoubleClick");Kn("focusin","onFocus");Kn("focusout","onBlur");Kn(Pg,"onTransitionEnd");es("onMouseEnter",["mouseout","mouseover"]);es("onMouseLeave",["mouseout","mouseover"]);es("onPointerEnter",["pointerout","pointerover"]);es("onPointerLeave",["pointerout","pointerover"]);wr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));wr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));wr("onBeforeInput",["compositionend","keypress","textInput","paste"]);wr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));wr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fs="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(" "),ay=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fs));function ff(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,iv(r,t,void 0,e),e.currentTarget=null}function Og(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,c=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;ff(s,a,c),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,c=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;ff(s,a,c),i=l}}}if(Uo)throw e=gc,Uo=!1,gc=null,e}function ie(e,t){var n=t[Cc];n===void 0&&(n=t[Cc]=new Set);var r=e+"__bubble";n.has(r)||(Dg(t,e,2,!1),n.add(r))}function kl(e,t,n){var r=0;t&&(r|=4),Dg(n,e,r,t)}var no="_reactListening"+Math.random().toString(36).slice(2);function pi(e){if(!e[no]){e[no]=!0,Bp.forEach(function(n){n!=="selectionchange"&&(ay.has(n)||kl(n,!1,e),kl(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[no]||(t[no]=!0,kl("selectionchange",!1,t))}}function Dg(e,t,n,r){switch(mg(t)){case 1:var s=wv;break;case 4:s=_v;break;default:s=Su}n=s.bind(null,t,n,e),s=void 0,!pc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function Cl(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=ar(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}ng(function(){var c=i,d=yu(n),f=[];e:{var h=Rg.get(e);if(h!==void 0){var p=Cu,v=e;switch(e){case"keypress":if(Mo(n)===0)break e;case"keydown":case"keyup":p=zv;break;case"focusin":v="focus",p=vl;break;case"focusout":v="blur",p=vl;break;case"beforeblur":case"afterblur":p=vl;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=Zd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=Cv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=Bv;break;case Ng:case Eg:case Mg:p=Ev;break;case Pg:p=$v;break;case"scroll":p=Sv;break;case"wheel":p=Vv;break;case"copy":case"cut":case"paste":p=Pv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=tf}var m=(t&4)!==0,w=!m&&e==="scroll",x=m?h!==null?h+"Capture":null:h;m=[];for(var g=c,y;g!==null;){y=g;var _=y.stateNode;if(y.tag===5&&_!==null&&(y=_,x!==null&&(_=li(g,x),_!=null&&m.push(gi(g,_,y)))),w)break;g=g.return}0<m.length&&(h=new p(h,v,null,n,d),f.push({event:h,listeners:m}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==fc&&(v=n.relatedTarget||n.fromElement)&&(ar(v)||v[on]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(v=n.relatedTarget||n.toElement,p=c,v=v?ar(v):null,v!==null&&(w=_r(v),v!==w||v.tag!==5&&v.tag!==6)&&(v=null)):(p=null,v=c),p!==v)){if(m=Zd,_="onMouseLeave",x="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(m=tf,_="onPointerLeave",x="onPointerEnter",g="pointer"),w=p==null?h:Ar(p),y=v==null?h:Ar(v),h=new m(_,g+"leave",p,n,d),h.target=w,h.relatedTarget=y,_=null,ar(d)===c&&(m=new m(x,g+"enter",v,n,d),m.target=y,m.relatedTarget=w,_=m),w=_,p&&v)t:{for(m=p,x=v,g=0,y=m;y;y=Er(y))g++;for(y=0,_=x;_;_=Er(_))y++;for(;0<g-y;)m=Er(m),g--;for(;0<y-g;)x=Er(x),y--;for(;g--;){if(m===x||x!==null&&m===x.alternate)break t;m=Er(m),x=Er(x)}m=null}else m=null;p!==null&&hf(f,h,p,m,!1),v!==null&&w!==null&&hf(f,w,v,m,!0)}}e:{if(h=c?Ar(c):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var k=qv;else if(sf(h))if(_g)k=ty;else{k=Zv;var S=Jv}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(k=ey);if(k&&(k=k(e,c))){wg(f,k,n,d);break e}S&&S(e,h,c),e==="focusout"&&(S=h._wrapperState)&&S.controlled&&h.type==="number"&&ac(h,"number",h.value)}switch(S=c?Ar(c):window,e){case"focusin":(sf(S)||S.contentEditable==="true")&&(Tr=S,yc=c,Qs=null);break;case"focusout":Qs=yc=Tr=null;break;case"mousedown":bc=!0;break;case"contextmenu":case"mouseup":case"dragend":bc=!1,uf(f,n,d);break;case"selectionchange":if(sy)break;case"keydown":case"keyup":uf(f,n,d)}var C;if(Nu)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else Dr?yg(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(vg&&n.locale!=="ko"&&(Dr||j!=="onCompositionStart"?j==="onCompositionEnd"&&Dr&&(C=xg()):(Sn=d,ku="value"in Sn?Sn.value:Sn.textContent,Dr=!0)),S=Go(c,j),0<S.length&&(j=new ef(j,e,null,n,d),f.push({event:j,listeners:S}),C?j.data=C:(C=bg(n),C!==null&&(j.data=C)))),(C=Yv?Kv(e,n):Xv(e,n))&&(c=Go(c,"onBeforeInput"),0<c.length&&(d=new ef("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:c}),d.data=C))}Og(f,t)})}function gi(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Go(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=li(e,n),i!=null&&r.unshift(gi(e,i,s)),i=li(e,t),i!=null&&r.push(gi(e,i,s))),e=e.return}return r}function Er(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function hf(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,c=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&c!==null&&(a=c,s?(l=li(n,i),l!=null&&o.unshift(gi(n,l,a))):s||(l=li(n,i),l!=null&&o.push(gi(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var ly=/\r\n?/g,cy=/\u0000|\uFFFD/g;function pf(e){return(typeof e=="string"?e:""+e).replace(ly,`
38
- `).replace(cy,"")}function ro(e,t,n){if(t=pf(t),pf(e)!==t&&n)throw Error(M(425))}function qo(){}var wc=null,_c=null;function Sc(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 kc=typeof setTimeout=="function"?setTimeout:void 0,uy=typeof clearTimeout=="function"?clearTimeout:void 0,gf=typeof Promise=="function"?Promise:void 0,dy=typeof queueMicrotask=="function"?queueMicrotask:typeof gf<"u"?function(e){return gf.resolve(null).then(e).catch(fy)}:kc;function fy(e){setTimeout(function(){throw e})}function jl(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),di(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);di(t)}function Dn(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 mf(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 ds=Math.random().toString(36).slice(2),$t="__reactFiber$"+ds,mi="__reactProps$"+ds,on="__reactContainer$"+ds,Cc="__reactEvents$"+ds,hy="__reactListeners$"+ds,py="__reactHandles$"+ds;function ar(e){var t=e[$t];if(t)return t;for(var n=e.parentNode;n;){if(t=n[on]||n[$t]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=mf(e);e!==null;){if(n=e[$t])return n;e=mf(e)}return t}e=n,n=e.parentNode}return null}function Li(e){return e=e[$t]||e[on],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ar(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(M(33))}function za(e){return e[mi]||null}var jc=[],zr=-1;function Xn(e){return{current:e}}function le(e){0>zr||(e.current=jc[zr],jc[zr]=null,zr--)}function re(e,t){zr++,jc[zr]=e.current,e.current=t}var Hn={},Ie=Xn(Hn),Ge=Xn(!1),pr=Hn;function ts(e,t){var n=e.type.contextTypes;if(!n)return Hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function qe(e){return e=e.childContextTypes,e!=null}function Jo(){le(Ge),le(Ie)}function xf(e,t,n){if(Ie.current!==Hn)throw Error(M(168));re(Ie,t),re(Ge,n)}function Tg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(M(108,J0(e)||"Unknown",s));return pe({},n,r)}function Zo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hn,pr=Ie.current,re(Ie,e),re(Ge,Ge.current),!0}function vf(e,t,n){var r=e.stateNode;if(!r)throw Error(M(169));n?(e=Tg(e,t,pr),r.__reactInternalMemoizedMergedChildContext=e,le(Ge),le(Ie),re(Ie,e)):le(Ge),re(Ge,n)}var Jt=null,Ia=!1,Nl=!1;function Lg(e){Jt===null?Jt=[e]:Jt.push(e)}function gy(e){Ia=!0,Lg(e)}function Qn(){if(!Nl&&Jt!==null){Nl=!0;var e=0,t=ee;try{var n=Jt;for(ee=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Jt=null,Ia=!1}catch(s){throw Jt!==null&&(Jt=Jt.slice(e+1)),og(bu,Qn),s}finally{ee=t,Nl=!1}}return null}var Ir=[],Fr=0,ea=null,ta=0,ht=[],pt=0,gr=null,en=1,tn="";function sr(e,t){Ir[Fr++]=ta,Ir[Fr++]=ea,ea=e,ta=t}function Ag(e,t,n){ht[pt++]=en,ht[pt++]=tn,ht[pt++]=gr,gr=e;var r=en;e=tn;var s=32-jt(r)-1;r&=~(1<<s),n+=1;var i=32-jt(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,en=1<<32-jt(t)+s|n<<s|r,tn=i+e}else en=1<<i|n<<s|r,tn=e}function Mu(e){e.return!==null&&(sr(e,1),Ag(e,1,0))}function Pu(e){for(;e===ea;)ea=Ir[--Fr],Ir[Fr]=null,ta=Ir[--Fr],Ir[Fr]=null;for(;e===gr;)gr=ht[--pt],ht[pt]=null,tn=ht[--pt],ht[pt]=null,en=ht[--pt],ht[pt]=null}var ot=null,it=null,ce=!1,kt=null;function zg(e,t){var n=gt(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 yf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ot=e,it=Dn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ot=e,it=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=gr!==null?{id:en,overflow:tn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=gt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ot=e,it=null,!0):!1;default:return!1}}function Nc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ec(e){if(ce){var t=it;if(t){var n=t;if(!yf(e,t)){if(Nc(e))throw Error(M(418));t=Dn(n.nextSibling);var r=ot;t&&yf(e,t)?zg(r,n):(e.flags=e.flags&-4097|2,ce=!1,ot=e)}}else{if(Nc(e))throw Error(M(418));e.flags=e.flags&-4097|2,ce=!1,ot=e}}}function bf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ot=e}function so(e){if(e!==ot)return!1;if(!ce)return bf(e),ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Sc(e.type,e.memoizedProps)),t&&(t=it)){if(Nc(e))throw Ig(),Error(M(418));for(;t;)zg(e,t),t=Dn(t.nextSibling)}if(bf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(M(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){it=Dn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}it=null}}else it=ot?Dn(e.stateNode.nextSibling):null;return!0}function Ig(){for(var e=it;e;)e=Dn(e.nextSibling)}function ns(){it=ot=null,ce=!1}function Ru(e){kt===null?kt=[e]:kt.push(e)}var my=un.ReactCurrentBatchConfig;function Ns(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(M(309));var r=n.stateNode}if(!r)throw Error(M(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(M(284));if(!n._owner)throw Error(M(290,e))}return e}function io(e,t){throw e=Object.prototype.toString.call(t),Error(M(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wf(e){var t=e._init;return t(e._payload)}function Fg(e){function t(x,g){if(e){var y=x.deletions;y===null?(x.deletions=[g],x.flags|=16):y.push(g)}}function n(x,g){if(!e)return null;for(;g!==null;)t(x,g),g=g.sibling;return null}function r(x,g){for(x=new Map;g!==null;)g.key!==null?x.set(g.key,g):x.set(g.index,g),g=g.sibling;return x}function s(x,g){return x=zn(x,g),x.index=0,x.sibling=null,x}function i(x,g,y){return x.index=y,e?(y=x.alternate,y!==null?(y=y.index,y<g?(x.flags|=2,g):y):(x.flags|=2,g)):(x.flags|=1048576,g)}function o(x){return e&&x.alternate===null&&(x.flags|=2),x}function a(x,g,y,_){return g===null||g.tag!==6?(g=Tl(y,x.mode,_),g.return=x,g):(g=s(g,y),g.return=x,g)}function l(x,g,y,_){var k=y.type;return k===Or?d(x,g,y.props.children,_,y.key):g!==null&&(g.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vn&&wf(k)===g.type)?(_=s(g,y.props),_.ref=Ns(x,g,y),_.return=x,_):(_=Ao(y.type,y.key,y.props,null,x.mode,_),_.ref=Ns(x,g,y),_.return=x,_)}function c(x,g,y,_){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=Ll(y,x.mode,_),g.return=x,g):(g=s(g,y.children||[]),g.return=x,g)}function d(x,g,y,_,k){return g===null||g.tag!==7?(g=fr(y,x.mode,_,k),g.return=x,g):(g=s(g,y),g.return=x,g)}function f(x,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=Tl(""+g,x.mode,y),g.return=x,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case Xi:return y=Ao(g.type,g.key,g.props,null,x.mode,y),y.ref=Ns(x,null,g),y.return=x,y;case Rr:return g=Ll(g,x.mode,y),g.return=x,g;case vn:var _=g._init;return f(x,_(g._payload),y)}if(zs(g)||_s(g))return g=fr(g,x.mode,y,null),g.return=x,g;io(x,g)}return null}function h(x,g,y,_){var k=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return k!==null?null:a(x,g,""+y,_);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Xi:return y.key===k?l(x,g,y,_):null;case Rr:return y.key===k?c(x,g,y,_):null;case vn:return k=y._init,h(x,g,k(y._payload),_)}if(zs(y)||_s(y))return k!==null?null:d(x,g,y,_,null);io(x,y)}return null}function p(x,g,y,_,k){if(typeof _=="string"&&_!==""||typeof _=="number")return x=x.get(y)||null,a(g,x,""+_,k);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case Xi:return x=x.get(_.key===null?y:_.key)||null,l(g,x,_,k);case Rr:return x=x.get(_.key===null?y:_.key)||null,c(g,x,_,k);case vn:var S=_._init;return p(x,g,y,S(_._payload),k)}if(zs(_)||_s(_))return x=x.get(y)||null,d(g,x,_,k,null);io(g,_)}return null}function v(x,g,y,_){for(var k=null,S=null,C=g,j=g=0,P=null;C!==null&&j<y.length;j++){C.index>j?(P=C,C=null):P=C.sibling;var E=h(x,C,y[j],_);if(E===null){C===null&&(C=P);break}e&&C&&E.alternate===null&&t(x,C),g=i(E,g,j),S===null?k=E:S.sibling=E,S=E,C=P}if(j===y.length)return n(x,C),ce&&sr(x,j),k;if(C===null){for(;j<y.length;j++)C=f(x,y[j],_),C!==null&&(g=i(C,g,j),S===null?k=C:S.sibling=C,S=C);return ce&&sr(x,j),k}for(C=r(x,C);j<y.length;j++)P=p(C,x,j,y[j],_),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?j:P.key),g=i(P,g,j),S===null?k=P:S.sibling=P,S=P);return e&&C.forEach(function(R){return t(x,R)}),ce&&sr(x,j),k}function m(x,g,y,_){var k=_s(y);if(typeof k!="function")throw Error(M(150));if(y=k.call(y),y==null)throw Error(M(151));for(var S=k=null,C=g,j=g=0,P=null,E=y.next();C!==null&&!E.done;j++,E=y.next()){C.index>j?(P=C,C=null):P=C.sibling;var R=h(x,C,E.value,_);if(R===null){C===null&&(C=P);break}e&&C&&R.alternate===null&&t(x,C),g=i(R,g,j),S===null?k=R:S.sibling=R,S=R,C=P}if(E.done)return n(x,C),ce&&sr(x,j),k;if(C===null){for(;!E.done;j++,E=y.next())E=f(x,E.value,_),E!==null&&(g=i(E,g,j),S===null?k=E:S.sibling=E,S=E);return ce&&sr(x,j),k}for(C=r(x,C);!E.done;j++,E=y.next())E=p(C,x,j,E.value,_),E!==null&&(e&&E.alternate!==null&&C.delete(E.key===null?j:E.key),g=i(E,g,j),S===null?k=E:S.sibling=E,S=E);return e&&C.forEach(function(A){return t(x,A)}),ce&&sr(x,j),k}function w(x,g,y,_){if(typeof y=="object"&&y!==null&&y.type===Or&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Xi:e:{for(var k=y.key,S=g;S!==null;){if(S.key===k){if(k=y.type,k===Or){if(S.tag===7){n(x,S.sibling),g=s(S,y.props.children),g.return=x,x=g;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===vn&&wf(k)===S.type){n(x,S.sibling),g=s(S,y.props),g.ref=Ns(x,S,y),g.return=x,x=g;break e}n(x,S);break}else t(x,S);S=S.sibling}y.type===Or?(g=fr(y.props.children,x.mode,_,y.key),g.return=x,x=g):(_=Ao(y.type,y.key,y.props,null,x.mode,_),_.ref=Ns(x,g,y),_.return=x,x=_)}return o(x);case Rr:e:{for(S=y.key;g!==null;){if(g.key===S)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(x,g.sibling),g=s(g,y.children||[]),g.return=x,x=g;break e}else{n(x,g);break}else t(x,g);g=g.sibling}g=Ll(y,x.mode,_),g.return=x,x=g}return o(x);case vn:return S=y._init,w(x,g,S(y._payload),_)}if(zs(y))return v(x,g,y,_);if(_s(y))return m(x,g,y,_);io(x,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(x,g.sibling),g=s(g,y),g.return=x,x=g):(n(x,g),g=Tl(y,x.mode,_),g.return=x,x=g),o(x)):n(x,g)}return w}var rs=Fg(!0),Bg=Fg(!1),na=Xn(null),ra=null,Br=null,Ou=null;function Du(){Ou=Br=ra=null}function Tu(e){var t=na.current;le(na),e._currentValue=t}function Mc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Xr(e,t){ra=e,Ou=Br=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function xt(e){var t=e._currentValue;if(Ou!==e)if(e={context:e,memoizedValue:t,next:null},Br===null){if(ra===null)throw Error(M(308));Br=e,ra.dependencies={lanes:0,firstContext:e}}else Br=Br.next=e;return t}var lr=null;function Lu(e){lr===null?lr=[e]:lr.push(e)}function Wg(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,Lu(t)):(n.next=s.next,s.next=n),t.interleaved=n,an(e,r)}function an(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 yn=!1;function Au(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $g(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 rn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Tn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,an(e,n)}return s=r.interleaved,s===null?(t.next=t,Lu(r)):(t.next=s.next,s.next=t),r.interleaved=t,an(e,n)}function Po(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wu(e,n)}}function _f(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function sa(e,t,n,r){var s=e.updateQueue;yn=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=c:a.next=c,d.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,d=c=l=null,a=i;do{var h=a.lane,p=a.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var v=e,m=a;switch(h=t,p=n,m.tag){case 1:if(v=m.payload,typeof v=="function"){f=v.call(p,f,h);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=m.payload,h=typeof v=="function"?v.call(p,f,h):v,h==null)break e;f=pe({},f,h);break e;case 2:yn=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else p={eventTime:p,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(c=d=p,l=f):d=d.next=p,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(d===null&&(l=f),s.baseState=l,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);xr|=o,e.lanes=o,e.memoizedState=f}}function Sf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(M(191,s));s.call(r)}}}var Ai={},Vt=Xn(Ai),xi=Xn(Ai),vi=Xn(Ai);function cr(e){if(e===Ai)throw Error(M(174));return e}function zu(e,t){switch(re(vi,t),re(xi,e),re(Vt,Ai),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:cc(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=cc(t,e)}le(Vt),re(Vt,t)}function ss(){le(Vt),le(xi),le(vi)}function Hg(e){cr(vi.current);var t=cr(Vt.current),n=cc(t,e.type);t!==n&&(re(xi,e),re(Vt,n))}function Iu(e){xi.current===e&&(le(Vt),le(xi))}var de=Xn(0);function ia(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 El=[];function Fu(){for(var e=0;e<El.length;e++)El[e]._workInProgressVersionPrimary=null;El.length=0}var Ro=un.ReactCurrentDispatcher,Ml=un.ReactCurrentBatchConfig,mr=0,he=null,we=null,je=null,oa=!1,Gs=!1,yi=0,xy=0;function Le(){throw Error(M(321))}function Bu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Et(e[n],t[n]))return!1;return!0}function Wu(e,t,n,r,s,i){if(mr=i,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ro.current=e===null||e.memoizedState===null?wy:_y,e=n(r,s),Gs){i=0;do{if(Gs=!1,yi=0,25<=i)throw Error(M(301));i+=1,je=we=null,t.updateQueue=null,Ro.current=Sy,e=n(r,s)}while(Gs)}if(Ro.current=aa,t=we!==null&&we.next!==null,mr=0,je=we=he=null,oa=!1,t)throw Error(M(300));return e}function $u(){var e=yi!==0;return yi=0,e}function Ft(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?he.memoizedState=je=e:je=je.next=e,je}function vt(){if(we===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=je===null?he.memoizedState:je.next;if(t!==null)je=t,we=e;else{if(e===null)throw Error(M(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},je===null?he.memoizedState=je=e:je=je.next=e}return je}function bi(e,t){return typeof t=="function"?t(e):t}function Pl(e){var t=vt(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=we,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,c=i;do{var d=c.lane;if((mr&d)===d)l!==null&&(l=l.next={lane:0,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null}),r=c.hasEagerState?c.eagerState:e(r,c.action);else{var f={lane:d,action:c.action,hasEagerState:c.hasEagerState,eagerState:c.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,he.lanes|=d,xr|=d}c=c.next}while(c!==null&&c!==i);l===null?o=r:l.next=a,Et(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,he.lanes|=i,xr|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Rl(e){var t=vt(),n=t.queue;if(n===null)throw Error(M(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);Et(i,t.memoizedState)||(Ke=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Vg(){}function Ug(e,t){var n=he,r=vt(),s=t(),i=!Et(r.memoizedState,s);if(i&&(r.memoizedState=s,Ke=!0),r=r.queue,Hu(Xg.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||je!==null&&je.memoizedState.tag&1){if(n.flags|=2048,wi(9,Kg.bind(null,n,r,s,t),void 0,null),Me===null)throw Error(M(349));mr&30||Yg(n,t,s)}return s}function Yg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Kg(e,t,n,r){t.value=n,t.getSnapshot=r,Qg(t)&&Gg(e)}function Xg(e,t,n){return n(function(){Qg(t)&&Gg(e)})}function Qg(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Et(e,n)}catch{return!0}}function Gg(e){var t=an(e,1);t!==null&&Nt(t,e,1,-1)}function kf(e){var t=Ft();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bi,lastRenderedState:e},t.queue=e,e=e.dispatch=by.bind(null,he,e),[t.memoizedState,e]}function wi(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=he.updateQueue,t===null?(t={lastEffect:null,stores:null},he.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 qg(){return vt().memoizedState}function Oo(e,t,n,r){var s=Ft();he.flags|=e,s.memoizedState=wi(1|t,n,void 0,r===void 0?null:r)}function Fa(e,t,n,r){var s=vt();r=r===void 0?null:r;var i=void 0;if(we!==null){var o=we.memoizedState;if(i=o.destroy,r!==null&&Bu(r,o.deps)){s.memoizedState=wi(t,n,i,r);return}}he.flags|=e,s.memoizedState=wi(1|t,n,i,r)}function Cf(e,t){return Oo(8390656,8,e,t)}function Hu(e,t){return Fa(2048,8,e,t)}function Jg(e,t){return Fa(4,2,e,t)}function Zg(e,t){return Fa(4,4,e,t)}function em(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 tm(e,t,n){return n=n!=null?n.concat([e]):null,Fa(4,4,em.bind(null,t,e),n)}function Vu(){}function nm(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function rm(e,t){var n=vt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Bu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function sm(e,t,n){return mr&21?(Et(n,t)||(n=cg(),he.lanes|=n,xr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function vy(e,t){var n=ee;ee=n!==0&&4>n?n:4,e(!0);var r=Ml.transition;Ml.transition={};try{e(!1),t()}finally{ee=n,Ml.transition=r}}function im(){return vt().memoizedState}function yy(e,t,n){var r=An(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},om(e))am(t,n);else if(n=Wg(e,t,n,r),n!==null){var s=Be();Nt(n,e,r,s),lm(n,t,r)}}function by(e,t,n){var r=An(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(om(e))am(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,Et(a,o)){var l=t.interleaved;l===null?(s.next=s,Lu(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Wg(e,t,s,r),n!==null&&(s=Be(),Nt(n,e,r,s),lm(n,t,r))}}function om(e){var t=e.alternate;return e===he||t!==null&&t===he}function am(e,t){Gs=oa=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function lm(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wu(e,n)}}var aa={readContext:xt,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useInsertionEffect:Le,useLayoutEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useMutableSource:Le,useSyncExternalStore:Le,useId:Le,unstable_isNewReconciler:!1},wy={readContext:xt,useCallback:function(e,t){return Ft().memoizedState=[e,t===void 0?null:t],e},useContext:xt,useEffect:Cf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Oo(4194308,4,em.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Oo(4194308,4,e,t)},useInsertionEffect:function(e,t){return Oo(4,2,e,t)},useMemo:function(e,t){var n=Ft();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ft();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=yy.bind(null,he,e),[r.memoizedState,e]},useRef:function(e){var t=Ft();return e={current:e},t.memoizedState=e},useState:kf,useDebugValue:Vu,useDeferredValue:function(e){return Ft().memoizedState=e},useTransition:function(){var e=kf(!1),t=e[0];return e=vy.bind(null,e[1]),Ft().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=he,s=Ft();if(ce){if(n===void 0)throw Error(M(407));n=n()}else{if(n=t(),Me===null)throw Error(M(349));mr&30||Yg(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Cf(Xg.bind(null,r,i,e),[e]),r.flags|=2048,wi(9,Kg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ft(),t=Me.identifierPrefix;if(ce){var n=tn,r=en;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=yi++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=xy++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},_y={readContext:xt,useCallback:nm,useContext:xt,useEffect:Hu,useImperativeHandle:tm,useInsertionEffect:Jg,useLayoutEffect:Zg,useMemo:rm,useReducer:Pl,useRef:qg,useState:function(){return Pl(bi)},useDebugValue:Vu,useDeferredValue:function(e){var t=vt();return sm(t,we.memoizedState,e)},useTransition:function(){var e=Pl(bi)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Vg,useSyncExternalStore:Ug,useId:im,unstable_isNewReconciler:!1},Sy={readContext:xt,useCallback:nm,useContext:xt,useEffect:Hu,useImperativeHandle:tm,useInsertionEffect:Jg,useLayoutEffect:Zg,useMemo:rm,useReducer:Rl,useRef:qg,useState:function(){return Rl(bi)},useDebugValue:Vu,useDeferredValue:function(e){var t=vt();return we===null?t.memoizedState=e:sm(t,we.memoizedState,e)},useTransition:function(){var e=Rl(bi)[0],t=vt().memoizedState;return[e,t]},useMutableSource:Vg,useSyncExternalStore:Ug,useId:im,unstable_isNewReconciler:!1};function _t(e,t){if(e&&e.defaultProps){t=pe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Pc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:pe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ba={isMounted:function(e){return(e=e._reactInternals)?_r(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Be(),s=An(e),i=rn(r,s);i.payload=t,n!=null&&(i.callback=n),t=Tn(e,i,s),t!==null&&(Nt(t,e,s,r),Po(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Be(),s=An(e),i=rn(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Tn(e,i,s),t!==null&&(Nt(t,e,s,r),Po(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Be(),r=An(e),s=rn(n,r);s.tag=2,t!=null&&(s.callback=t),t=Tn(e,s,r),t!==null&&(Nt(t,e,r,n),Po(t,e,r))}};function jf(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!hi(n,r)||!hi(s,i):!0}function cm(e,t,n){var r=!1,s=Hn,i=t.contextType;return typeof i=="object"&&i!==null?i=xt(i):(s=qe(t)?pr:Ie.current,r=t.contextTypes,i=(r=r!=null)?ts(e,s):Hn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Ba,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Nf(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&&Ba.enqueueReplaceState(t,t.state,null)}function Rc(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},Au(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=xt(i):(i=qe(t)?pr:Ie.current,s.context=ts(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Pc(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Ba.enqueueReplaceState(s,s.state,null),sa(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function is(e,t){try{var n="",r=t;do n+=q0(r),r=r.return;while(r);var s=n}catch(i){s=`
39
- Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:s,digest:null}}function Ol(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Oc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var ky=typeof WeakMap=="function"?WeakMap:Map;function um(e,t,n){n=rn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ca||(ca=!0,$c=r),Oc(e,t)},n}function dm(e,t,n){n=rn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){Oc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Oc(e,t),typeof r!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ef(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new ky;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=Iy.bind(null,e,t,n),t.then(e,e))}function Mf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Pf(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=rn(-1,1),t.tag=2,Tn(n,t,1))),n.lanes|=1),e)}var Cy=un.ReactCurrentOwner,Ke=!1;function Fe(e,t,n,r){t.child=e===null?Bg(t,null,n,r):rs(t,e.child,n,r)}function Rf(e,t,n,r,s){n=n.render;var i=t.ref;return Xr(t,s),r=Wu(e,t,n,r,i,s),n=$u(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ln(e,t,s)):(ce&&n&&Mu(t),t.flags|=1,Fe(e,t,r,s),t.child)}function Of(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!Ju(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,fm(e,t,i,r,s)):(e=Ao(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:hi,n(o,r)&&e.ref===t.ref)return ln(e,t,s)}return t.flags|=1,e=zn(i,r),e.ref=t.ref,e.return=t,t.child=e}function fm(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(hi(i,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,ln(e,t,s)}return Dc(e,t,n,r,s)}function hm(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},re($r,st),st|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,re($r,st),st|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,re($r,st),st|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,re($r,st),st|=r;return Fe(e,t,s,n),t.child}function pm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Dc(e,t,n,r,s){var i=qe(n)?pr:Ie.current;return i=ts(t,i),Xr(t,s),n=Wu(e,t,n,r,i,s),r=$u(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,ln(e,t,s)):(ce&&r&&Mu(t),t.flags|=1,Fe(e,t,n,s),t.child)}function Df(e,t,n,r,s){if(qe(n)){var i=!0;Zo(t)}else i=!1;if(Xr(t,s),t.stateNode===null)Do(e,t),cm(t,n,r),Rc(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=xt(c):(c=qe(n)?pr:Ie.current,c=ts(t,c));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==c)&&Nf(t,o,r,c),yn=!1;var h=t.memoizedState;o.state=h,sa(t,r,o,s),l=t.memoizedState,a!==r||h!==l||Ge.current||yn?(typeof d=="function"&&(Pc(t,n,d,r),l=t.memoizedState),(a=yn||jf(t,n,a,r,h,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=c,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,$g(e,t),a=t.memoizedProps,c=t.type===t.elementType?a:_t(t.type,a),o.props=c,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=xt(l):(l=qe(n)?pr:Ie.current,l=ts(t,l));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&Nf(t,o,r,l),yn=!1,h=t.memoizedState,o.state=h,sa(t,r,o,s);var v=t.memoizedState;a!==f||h!==v||Ge.current||yn?(typeof p=="function"&&(Pc(t,n,p,r),v=t.memoizedState),(c=yn||jf(t,n,c,r,h,v,l)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,v,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=v),o.props=r,o.state=v,o.context=l,r=c):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Tc(e,t,n,r,i,s)}function Tc(e,t,n,r,s,i){pm(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&vf(t,n,!1),ln(e,t,i);r=t.stateNode,Cy.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=rs(t,e.child,null,i),t.child=rs(t,null,a,i)):Fe(e,t,a,i),t.memoizedState=r.state,s&&vf(t,n,!0),t.child}function gm(e){var t=e.stateNode;t.pendingContext?xf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xf(e,t.context,!1),zu(e,t.containerInfo)}function Tf(e,t,n,r,s){return ns(),Ru(s),t.flags|=256,Fe(e,t,n,r),t.child}var Lc={dehydrated:null,treeContext:null,retryLane:0};function Ac(e){return{baseLanes:e,cachePool:null,transitions:null}}function mm(e,t,n){var r=t.pendingProps,s=de.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),re(de,s&1),e===null)return Ec(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Ha(o,r,0,null),e=fr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Ac(n),t.memoizedState=Lc,e):Uu(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return jy(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=zn(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=zn(a,i):(i=fr(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Ac(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Lc,r}return i=e.child,e=i.sibling,r=zn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Uu(e,t){return t=Ha({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function oo(e,t,n,r){return r!==null&&Ru(r),rs(t,e.child,null,n),e=Uu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function jy(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Ol(Error(M(422))),oo(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=Ha({mode:"visible",children:r.children},s,0,null),i=fr(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&rs(t,e.child,null,o),t.child.memoizedState=Ac(o),t.memoizedState=Lc,i);if(!(t.mode&1))return oo(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(M(419)),r=Ol(i,r,void 0),oo(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ke||a){if(r=Me,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,an(e,s),Nt(r,e,s,-1))}return qu(),r=Ol(Error(M(421))),oo(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Fy.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,it=Dn(s.nextSibling),ot=t,ce=!0,kt=null,e!==null&&(ht[pt++]=en,ht[pt++]=tn,ht[pt++]=gr,en=e.id,tn=e.overflow,gr=t),t=Uu(t,r.children),t.flags|=4096,t)}function Lf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Mc(e.return,t,n)}function Dl(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function xm(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Fe(e,t,r.children,n),r=de.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lf(e,n,t);else if(e.tag===19)Lf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(re(de,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&ia(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),Dl(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ia(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}Dl(t,!0,n,null,i);break;case"together":Dl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Do(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function ln(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(M(153));if(t.child!==null){for(e=t.child,n=zn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=zn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ny(e,t,n){switch(t.tag){case 3:gm(t),ns();break;case 5:Hg(t);break;case 1:qe(t.type)&&Zo(t);break;case 4:zu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;re(na,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(re(de,de.current&1),t.flags|=128,null):n&t.child.childLanes?mm(e,t,n):(re(de,de.current&1),e=ln(e,t,n),e!==null?e.sibling:null);re(de,de.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return xm(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),re(de,de.current),r)break;return null;case 22:case 23:return t.lanes=0,hm(e,t,n)}return ln(e,t,n)}var vm,zc,ym,bm;vm=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}};zc=function(){};ym=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,cr(Vt.current);var i=null;switch(n){case"input":s=ic(e,s),r=ic(e,r),i=[];break;case"select":s=pe({},s,{value:void 0}),r=pe({},r,{value:void 0}),i=[];break;case"textarea":s=lc(e,s),r=lc(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=qo)}uc(n,r);var o;n=null;for(c in s)if(!r.hasOwnProperty(c)&&s.hasOwnProperty(c)&&s[c]!=null)if(c==="style"){var a=s[c];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(oi.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var l=r[c];if(a=s!=null?s[c]:void 0,r.hasOwnProperty(c)&&l!==a&&(l!=null||a!=null))if(c==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(c,n)),n=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(oi.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&ie("scroll",e),i||a===l||(i=[])):(i=i||[]).push(c,l))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};bm=function(e,t,n,r){n!==r&&(t.flags|=4)};function Es(e,t){if(!ce)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 Ae(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ey(e,t,n){var r=t.pendingProps;switch(Pu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ae(t),null;case 1:return qe(t.type)&&Jo(),Ae(t),null;case 3:return r=t.stateNode,ss(),le(Ge),le(Ie),Fu(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(so(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,kt!==null&&(Uc(kt),kt=null))),zc(e,t),Ae(t),null;case 5:Iu(t);var s=cr(vi.current);if(n=t.type,e!==null&&t.stateNode!=null)ym(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(M(166));return Ae(t),null}if(e=cr(Vt.current),so(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[$t]=t,r[mi]=i,e=(t.mode&1)!==0,n){case"dialog":ie("cancel",r),ie("close",r);break;case"iframe":case"object":case"embed":ie("load",r);break;case"video":case"audio":for(s=0;s<Fs.length;s++)ie(Fs[s],r);break;case"source":ie("error",r);break;case"img":case"image":case"link":ie("error",r),ie("load",r);break;case"details":ie("toggle",r);break;case"input":Hd(r,i),ie("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},ie("invalid",r);break;case"textarea":Ud(r,i),ie("invalid",r)}uc(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&ro(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ro(r.textContent,a,e),s=["children",""+a]):oi.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ie("scroll",r)}switch(n){case"input":Qi(r),Vd(r,i,!0);break;case"textarea":Qi(r),Yd(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=qo)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Xp(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[$t]=t,e[mi]=r,vm(e,t,!1,!1),t.stateNode=e;e:{switch(o=dc(n,r),n){case"dialog":ie("cancel",e),ie("close",e),s=r;break;case"iframe":case"object":case"embed":ie("load",e),s=r;break;case"video":case"audio":for(s=0;s<Fs.length;s++)ie(Fs[s],e);s=r;break;case"source":ie("error",e),s=r;break;case"img":case"image":case"link":ie("error",e),ie("load",e),s=r;break;case"details":ie("toggle",e),s=r;break;case"input":Hd(e,r),s=ic(e,r),ie("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=pe({},r,{value:void 0}),ie("invalid",e);break;case"textarea":Ud(e,r),s=lc(e,r),ie("invalid",e);break;default:s=r}uc(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?qp(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&Qp(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&ai(e,l):typeof l=="number"&&ai(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(oi.hasOwnProperty(i)?l!=null&&i==="onScroll"&&ie("scroll",e):l!=null&&gu(e,i,l,o))}switch(n){case"input":Qi(e),Vd(e,r,!1);break;case"textarea":Qi(e),Yd(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$n(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Vr(e,!!r.multiple,i,!1):r.defaultValue!=null&&Vr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=qo)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Ae(t),null;case 6:if(e&&t.stateNode!=null)bm(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(M(166));if(n=cr(vi.current),cr(Vt.current),so(t)){if(r=t.stateNode,n=t.memoizedProps,r[$t]=t,(i=r.nodeValue!==n)&&(e=ot,e!==null))switch(e.tag){case 3:ro(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ro(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[$t]=t,t.stateNode=r}return Ae(t),null;case 13:if(le(de),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ce&&it!==null&&t.mode&1&&!(t.flags&128))Ig(),ns(),t.flags|=98560,i=!1;else if(i=so(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(M(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(M(317));i[$t]=t}else ns(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ae(t),i=!1}else kt!==null&&(Uc(kt),kt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||de.current&1?Se===0&&(Se=3):qu())),t.updateQueue!==null&&(t.flags|=4),Ae(t),null);case 4:return ss(),zc(e,t),e===null&&pi(t.stateNode.containerInfo),Ae(t),null;case 10:return Tu(t.type._context),Ae(t),null;case 17:return qe(t.type)&&Jo(),Ae(t),null;case 19:if(le(de),i=t.memoizedState,i===null)return Ae(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Es(i,!1);else{if(Se!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ia(e),o!==null){for(t.flags|=128,Es(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return re(de,de.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>os&&(t.flags|=128,r=!0,Es(i,!1),t.lanes=4194304)}else{if(!r)if(e=ia(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Es(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ce)return Ae(t),null}else 2*xe()-i.renderingStartTime>os&&n!==1073741824&&(t.flags|=128,r=!0,Es(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=xe(),t.sibling=null,n=de.current,re(de,r?n&1|2:n&1),t):(Ae(t),null);case 22:case 23:return Gu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?st&1073741824&&(Ae(t),t.subtreeFlags&6&&(t.flags|=8192)):Ae(t),null;case 24:return null;case 25:return null}throw Error(M(156,t.tag))}function My(e,t){switch(Pu(t),t.tag){case 1:return qe(t.type)&&Jo(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ss(),le(Ge),le(Ie),Fu(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Iu(t),null;case 13:if(le(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(M(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(de),null;case 4:return ss(),null;case 10:return Tu(t.type._context),null;case 22:case 23:return Gu(),null;case 24:return null;default:return null}}var ao=!1,ze=!1,Py=typeof WeakSet=="function"?WeakSet:Set,D=null;function Wr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ge(e,t,r)}else n.current=null}function Ic(e,t,n){try{n()}catch(r){ge(e,t,r)}}var Af=!1;function Ry(e,t){if(wc=Xo,e=Cg(),Eu(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,c=0,d=0,f=e,h=null;t:for(;;){for(var p;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++c===s&&(a=o),h===i&&++d===r&&(l=o),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(_c={focusedElem:e,selectionRange:n},Xo=!1,D=t;D!==null;)if(t=D,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,D=e;else for(;D!==null;){t=D;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var m=v.memoizedProps,w=v.memoizedState,x=t.stateNode,g=x.getSnapshotBeforeUpdate(t.elementType===t.type?m:_t(t.type,m),w);x.__reactInternalSnapshotBeforeUpdate=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(M(163))}}catch(_){ge(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,D=e;break}D=t.return}return v=Af,Af=!1,v}function qs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&Ic(t,n,i)}s=s.next}while(s!==r)}}function Wa(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Fc(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 wm(e){var t=e.alternate;t!==null&&(e.alternate=null,wm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[$t],delete t[mi],delete t[Cc],delete t[hy],delete t[py])),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 _m(e){return e.tag===5||e.tag===3||e.tag===4}function zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_m(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Bc(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=qo));else if(r!==4&&(e=e.child,e!==null))for(Bc(e,t,n),e=e.sibling;e!==null;)Bc(e,t,n),e=e.sibling}function Wc(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(Wc(e,t,n),e=e.sibling;e!==null;)Wc(e,t,n),e=e.sibling}var Re=null,St=!1;function mn(e,t,n){for(n=n.child;n!==null;)Sm(e,t,n),n=n.sibling}function Sm(e,t,n){if(Ht&&typeof Ht.onCommitFiberUnmount=="function")try{Ht.onCommitFiberUnmount(Da,n)}catch{}switch(n.tag){case 5:ze||Wr(n,t);case 6:var r=Re,s=St;Re=null,mn(e,t,n),Re=r,St=s,Re!==null&&(St?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(St?(e=Re,n=n.stateNode,e.nodeType===8?jl(e.parentNode,n):e.nodeType===1&&jl(e,n),di(e)):jl(Re,n.stateNode));break;case 4:r=Re,s=St,Re=n.stateNode.containerInfo,St=!0,mn(e,t,n),Re=r,St=s;break;case 0:case 11:case 14:case 15:if(!ze&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Ic(n,t,o),s=s.next}while(s!==r)}mn(e,t,n);break;case 1:if(!ze&&(Wr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ge(n,t,a)}mn(e,t,n);break;case 21:mn(e,t,n);break;case 22:n.mode&1?(ze=(r=ze)||n.memoizedState!==null,mn(e,t,n),ze=r):mn(e,t,n);break;default:mn(e,t,n)}}function If(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Py),t.forEach(function(r){var s=By.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function wt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Re=a.stateNode,St=!1;break e;case 3:Re=a.stateNode.containerInfo,St=!0;break e;case 4:Re=a.stateNode.containerInfo,St=!0;break e}a=a.return}if(Re===null)throw Error(M(160));Sm(i,o,s),Re=null,St=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(c){ge(s,t,c)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)km(t,e),t=t.sibling}function km(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(wt(t,e),Tt(e),r&4){try{qs(3,e,e.return),Wa(3,e)}catch(m){ge(e,e.return,m)}try{qs(5,e,e.return)}catch(m){ge(e,e.return,m)}}break;case 1:wt(t,e),Tt(e),r&512&&n!==null&&Wr(n,n.return);break;case 5:if(wt(t,e),Tt(e),r&512&&n!==null&&Wr(n,n.return),e.flags&32){var s=e.stateNode;try{ai(s,"")}catch(m){ge(e,e.return,m)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Yp(s,i),dc(a,o);var c=dc(a,i);for(o=0;o<l.length;o+=2){var d=l[o],f=l[o+1];d==="style"?qp(s,f):d==="dangerouslySetInnerHTML"?Qp(s,f):d==="children"?ai(s,f):gu(s,d,f,c)}switch(a){case"input":oc(s,i);break;case"textarea":Kp(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?Vr(s,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?Vr(s,!!i.multiple,i.defaultValue,!0):Vr(s,!!i.multiple,i.multiple?[]:"",!1))}s[mi]=i}catch(m){ge(e,e.return,m)}}break;case 6:if(wt(t,e),Tt(e),r&4){if(e.stateNode===null)throw Error(M(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(m){ge(e,e.return,m)}}break;case 3:if(wt(t,e),Tt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{di(t.containerInfo)}catch(m){ge(e,e.return,m)}break;case 4:wt(t,e),Tt(e);break;case 13:wt(t,e),Tt(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Xu=xe())),r&4&&If(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(ze=(c=ze)||d,wt(t,e),ze=c):wt(t,e),Tt(e),r&8192){if(c=e.memoizedState!==null,(e.stateNode.isHidden=c)&&!d&&e.mode&1)for(D=e,d=e.child;d!==null;){for(f=D=d;D!==null;){switch(h=D,p=h.child,h.tag){case 0:case 11:case 14:case 15:qs(4,h,h.return);break;case 1:Wr(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(m){ge(r,n,m)}}break;case 5:Wr(h,h.return);break;case 22:if(h.memoizedState!==null){Bf(f);continue}}p!==null?(p.return=h,D=p):Bf(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{s=f.stateNode,c?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=Gp("display",o))}catch(m){ge(e,e.return,m)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=c?"":f.memoizedProps}catch(m){ge(e,e.return,m)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:wt(t,e),Tt(e),r&4&&If(e);break;case 21:break;default:wt(t,e),Tt(e)}}function Tt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(_m(n)){var r=n;break e}n=n.return}throw Error(M(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(ai(s,""),r.flags&=-33);var i=zf(e);Wc(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=zf(e);Bc(e,a,o);break;default:throw Error(M(161))}}catch(l){ge(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Oy(e,t,n){D=e,Cm(e)}function Cm(e,t,n){for(var r=(e.mode&1)!==0;D!==null;){var s=D,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||ao;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||ze;a=ao;var c=ze;if(ao=o,(ze=l)&&!c)for(D=s;D!==null;)o=D,l=o.child,o.tag===22&&o.memoizedState!==null?Wf(s):l!==null?(l.return=o,D=l):Wf(s);for(;i!==null;)D=i,Cm(i),i=i.sibling;D=s,ao=a,ze=c}Ff(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,D=i):Ff(e)}}function Ff(e){for(;D!==null;){var t=D;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ze||Wa(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!ze)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:_t(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Sf(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Sf(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;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 c=t.alternate;if(c!==null){var d=c.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&di(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(M(163))}ze||t.flags&512&&Fc(t)}catch(h){ge(t,t.return,h)}}if(t===e){D=null;break}if(n=t.sibling,n!==null){n.return=t.return,D=n;break}D=t.return}}function Bf(e){for(;D!==null;){var t=D;if(t===e){D=null;break}var n=t.sibling;if(n!==null){n.return=t.return,D=n;break}D=t.return}}function Wf(e){for(;D!==null;){var t=D;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Wa(4,t)}catch(l){ge(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){ge(t,s,l)}}var i=t.return;try{Fc(t)}catch(l){ge(t,i,l)}break;case 5:var o=t.return;try{Fc(t)}catch(l){ge(t,o,l)}}}catch(l){ge(t,t.return,l)}if(t===e){D=null;break}var a=t.sibling;if(a!==null){a.return=t.return,D=a;break}D=t.return}}var Dy=Math.ceil,la=un.ReactCurrentDispatcher,Yu=un.ReactCurrentOwner,mt=un.ReactCurrentBatchConfig,X=0,Me=null,ye=null,Oe=0,st=0,$r=Xn(0),Se=0,_i=null,xr=0,$a=0,Ku=0,Js=null,Ue=null,Xu=0,os=1/0,qt=null,ca=!1,$c=null,Ln=null,lo=!1,kn=null,ua=0,Zs=0,Hc=null,To=-1,Lo=0;function Be(){return X&6?xe():To!==-1?To:To=xe()}function An(e){return e.mode&1?X&2&&Oe!==0?Oe&-Oe:my.transition!==null?(Lo===0&&(Lo=cg()),Lo):(e=ee,e!==0||(e=window.event,e=e===void 0?16:mg(e.type)),e):1}function Nt(e,t,n,r){if(50<Zs)throw Zs=0,Hc=null,Error(M(185));Di(e,n,r),(!(X&2)||e!==Me)&&(e===Me&&(!(X&2)&&($a|=n),Se===4&&_n(e,Oe)),Je(e,r),n===1&&X===0&&!(t.mode&1)&&(os=xe()+500,Ia&&Qn()))}function Je(e,t){var n=e.callbackNode;mv(e,t);var r=Ko(e,e===Me?Oe:0);if(r===0)n!==null&&Qd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Qd(n),t===1)e.tag===0?gy($f.bind(null,e)):Lg($f.bind(null,e)),dy(function(){!(X&6)&&Qn()}),n=null;else{switch(ug(r)){case 1:n=bu;break;case 4:n=ag;break;case 16:n=Yo;break;case 536870912:n=lg;break;default:n=Yo}n=Dm(n,jm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function jm(e,t){if(To=-1,Lo=0,X&6)throw Error(M(327));var n=e.callbackNode;if(Qr()&&e.callbackNode!==n)return null;var r=Ko(e,e===Me?Oe:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=da(e,r);else{t=r;var s=X;X|=2;var i=Em();(Me!==e||Oe!==t)&&(qt=null,os=xe()+500,dr(e,t));do try{Ay();break}catch(a){Nm(e,a)}while(!0);Du(),la.current=i,X=s,ye!==null?t=0:(Me=null,Oe=0,t=Se)}if(t!==0){if(t===2&&(s=mc(e),s!==0&&(r=s,t=Vc(e,s))),t===1)throw n=_i,dr(e,0),_n(e,r),Je(e,xe()),n;if(t===6)_n(e,r);else{if(s=e.current.alternate,!(r&30)&&!Ty(s)&&(t=da(e,r),t===2&&(i=mc(e),i!==0&&(r=i,t=Vc(e,i))),t===1))throw n=_i,dr(e,0),_n(e,r),Je(e,xe()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(M(345));case 2:ir(e,Ue,qt);break;case 3:if(_n(e,r),(r&130023424)===r&&(t=Xu+500-xe(),10<t)){if(Ko(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Be(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=kc(ir.bind(null,e,Ue,qt),t);break}ir(e,Ue,qt);break;case 4:if(_n(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-jt(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Dy(r/1960))-r,10<r){e.timeoutHandle=kc(ir.bind(null,e,Ue,qt),r);break}ir(e,Ue,qt);break;case 5:ir(e,Ue,qt);break;default:throw Error(M(329))}}}return Je(e,xe()),e.callbackNode===n?jm.bind(null,e):null}function Vc(e,t){var n=Js;return e.current.memoizedState.isDehydrated&&(dr(e,t).flags|=256),e=da(e,t),e!==2&&(t=Ue,Ue=n,t!==null&&Uc(t)),e}function Uc(e){Ue===null?Ue=e:Ue.push.apply(Ue,e)}function Ty(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 s=n[r],i=s.getSnapshot;s=s.value;try{if(!Et(i(),s))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 _n(e,t){for(t&=~Ku,t&=~$a,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-jt(t),r=1<<n;e[n]=-1,t&=~r}}function $f(e){if(X&6)throw Error(M(327));Qr();var t=Ko(e,0);if(!(t&1))return Je(e,xe()),null;var n=da(e,t);if(e.tag!==0&&n===2){var r=mc(e);r!==0&&(t=r,n=Vc(e,r))}if(n===1)throw n=_i,dr(e,0),_n(e,t),Je(e,xe()),n;if(n===6)throw Error(M(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ir(e,Ue,qt),Je(e,xe()),null}function Qu(e,t){var n=X;X|=1;try{return e(t)}finally{X=n,X===0&&(os=xe()+500,Ia&&Qn())}}function vr(e){kn!==null&&kn.tag===0&&!(X&6)&&Qr();var t=X;X|=1;var n=mt.transition,r=ee;try{if(mt.transition=null,ee=1,e)return e()}finally{ee=r,mt.transition=n,X=t,!(X&6)&&Qn()}}function Gu(){st=$r.current,le($r)}function dr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,uy(n)),ye!==null)for(n=ye.return;n!==null;){var r=n;switch(Pu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Jo();break;case 3:ss(),le(Ge),le(Ie),Fu();break;case 5:Iu(r);break;case 4:ss();break;case 13:le(de);break;case 19:le(de);break;case 10:Tu(r.type._context);break;case 22:case 23:Gu()}n=n.return}if(Me=e,ye=e=zn(e.current,null),Oe=st=t,Se=0,_i=null,Ku=$a=xr=0,Ue=Js=null,lr!==null){for(t=0;t<lr.length;t++)if(n=lr[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}lr=null}return e}function Nm(e,t){do{var n=ye;try{if(Du(),Ro.current=aa,oa){for(var r=he.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}oa=!1}if(mr=0,je=we=he=null,Gs=!1,yi=0,Yu.current=null,n===null||n.return===null){Se=1,_i=t,ye=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Oe,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var c=l,d=a,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=Mf(o);if(p!==null){p.flags&=-257,Pf(p,o,a,i,t),p.mode&1&&Ef(i,c,t),t=p,l=c;var v=t.updateQueue;if(v===null){var m=new Set;m.add(l),t.updateQueue=m}else v.add(l);break e}else{if(!(t&1)){Ef(i,c,t),qu();break e}l=Error(M(426))}}else if(ce&&a.mode&1){var w=Mf(o);if(w!==null){!(w.flags&65536)&&(w.flags|=256),Pf(w,o,a,i,t),Ru(is(l,a));break e}}i=l=is(l,a),Se!==4&&(Se=2),Js===null?Js=[i]:Js.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var x=um(i,l,t);_f(i,x);break e;case 1:a=l;var g=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ln===null||!Ln.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var _=dm(i,a,t);_f(i,_);break e}}i=i.return}while(i!==null)}Pm(n)}catch(k){t=k,ye===n&&n!==null&&(ye=n=n.return);continue}break}while(!0)}function Em(){var e=la.current;return la.current=aa,e===null?aa:e}function qu(){(Se===0||Se===3||Se===2)&&(Se=4),Me===null||!(xr&268435455)&&!($a&268435455)||_n(Me,Oe)}function da(e,t){var n=X;X|=2;var r=Em();(Me!==e||Oe!==t)&&(qt=null,dr(e,t));do try{Ly();break}catch(s){Nm(e,s)}while(!0);if(Du(),X=n,la.current=r,ye!==null)throw Error(M(261));return Me=null,Oe=0,Se}function Ly(){for(;ye!==null;)Mm(ye)}function Ay(){for(;ye!==null&&!av();)Mm(ye)}function Mm(e){var t=Om(e.alternate,e,st);e.memoizedProps=e.pendingProps,t===null?Pm(e):ye=t,Yu.current=null}function Pm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=My(n,t),n!==null){n.flags&=32767,ye=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Se=6,ye=null;return}}else if(n=Ey(n,t,st),n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);Se===0&&(Se=5)}function ir(e,t,n){var r=ee,s=mt.transition;try{mt.transition=null,ee=1,zy(e,t,n,r)}finally{mt.transition=s,ee=r}return null}function zy(e,t,n,r){do Qr();while(kn!==null);if(X&6)throw Error(M(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(M(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(xv(e,i),e===Me&&(ye=Me=null,Oe=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||lo||(lo=!0,Dm(Yo,function(){return Qr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=mt.transition,mt.transition=null;var o=ee;ee=1;var a=X;X|=4,Yu.current=null,Ry(e,n),km(n,e),ry(_c),Xo=!!wc,_c=wc=null,e.current=n,Oy(n),lv(),X=a,ee=o,mt.transition=i}else e.current=n;if(lo&&(lo=!1,kn=e,ua=s),i=e.pendingLanes,i===0&&(Ln=null),dv(n.stateNode),Je(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(ca)throw ca=!1,e=$c,$c=null,e;return ua&1&&e.tag!==0&&Qr(),i=e.pendingLanes,i&1?e===Hc?Zs++:(Zs=0,Hc=e):Zs=0,Qn(),null}function Qr(){if(kn!==null){var e=ug(ua),t=mt.transition,n=ee;try{if(mt.transition=null,ee=16>e?16:e,kn===null)var r=!1;else{if(e=kn,kn=null,ua=0,X&6)throw Error(M(331));var s=X;for(X|=4,D=e.current;D!==null;){var i=D,o=i.child;if(D.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var c=a[l];for(D=c;D!==null;){var d=D;switch(d.tag){case 0:case 11:case 15:qs(8,d,i)}var f=d.child;if(f!==null)f.return=d,D=f;else for(;D!==null;){d=D;var h=d.sibling,p=d.return;if(wm(d),d===c){D=null;break}if(h!==null){h.return=p,D=h;break}D=p}}}var v=i.alternate;if(v!==null){var m=v.child;if(m!==null){v.child=null;do{var w=m.sibling;m.sibling=null,m=w}while(m!==null)}}D=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,D=o;else e:for(;D!==null;){if(i=D,i.flags&2048)switch(i.tag){case 0:case 11:case 15:qs(9,i,i.return)}var x=i.sibling;if(x!==null){x.return=i.return,D=x;break e}D=i.return}}var g=e.current;for(D=g;D!==null;){o=D;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,D=y;else e:for(o=g;D!==null;){if(a=D,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Wa(9,a)}}catch(k){ge(a,a.return,k)}if(a===o){D=null;break e}var _=a.sibling;if(_!==null){_.return=a.return,D=_;break e}D=a.return}}if(X=s,Qn(),Ht&&typeof Ht.onPostCommitFiberRoot=="function")try{Ht.onPostCommitFiberRoot(Da,e)}catch{}r=!0}return r}finally{ee=n,mt.transition=t}}return!1}function Hf(e,t,n){t=is(n,t),t=um(e,t,1),e=Tn(e,t,1),t=Be(),e!==null&&(Di(e,1,t),Je(e,t))}function ge(e,t,n){if(e.tag===3)Hf(e,e,n);else for(;t!==null;){if(t.tag===3){Hf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ln===null||!Ln.has(r))){e=is(n,e),e=dm(t,e,1),t=Tn(t,e,1),e=Be(),t!==null&&(Di(t,1,e),Je(t,e));break}}t=t.return}}function Iy(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Be(),e.pingedLanes|=e.suspendedLanes&n,Me===e&&(Oe&n)===n&&(Se===4||Se===3&&(Oe&130023424)===Oe&&500>xe()-Xu?dr(e,0):Ku|=n),Je(e,t)}function Rm(e,t){t===0&&(e.mode&1?(t=Ji,Ji<<=1,!(Ji&130023424)&&(Ji=4194304)):t=1);var n=Be();e=an(e,t),e!==null&&(Di(e,t,n),Je(e,n))}function Fy(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Rm(e,n)}function By(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(M(314))}r!==null&&r.delete(t),Rm(e,n)}var Om;Om=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ge.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,Ny(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,ce&&t.flags&1048576&&Ag(t,ta,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Do(e,t),e=t.pendingProps;var s=ts(t,Ie.current);Xr(t,n),s=Wu(null,t,r,e,s,n);var i=$u();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,qe(r)?(i=!0,Zo(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Au(t),s.updater=Ba,t.stateNode=s,s._reactInternals=t,Rc(t,r,e,n),t=Tc(null,t,r,!0,i,n)):(t.tag=0,ce&&i&&Mu(t),Fe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Do(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=$y(r),e=_t(r,e),s){case 0:t=Dc(null,t,r,e,n);break e;case 1:t=Df(null,t,r,e,n);break e;case 11:t=Rf(null,t,r,e,n);break e;case 14:t=Of(null,t,r,_t(r.type,e),n);break e}throw Error(M(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),Dc(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),Df(e,t,r,s,n);case 3:e:{if(gm(t),e===null)throw Error(M(387));r=t.pendingProps,i=t.memoizedState,s=i.element,$g(e,t),sa(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=is(Error(M(423)),t),t=Tf(e,t,r,n,s);break e}else if(r!==s){s=is(Error(M(424)),t),t=Tf(e,t,r,n,s);break e}else for(it=Dn(t.stateNode.containerInfo.firstChild),ot=t,ce=!0,kt=null,n=Bg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ns(),r===s){t=ln(e,t,n);break e}Fe(e,t,r,n)}t=t.child}return t;case 5:return Hg(t),e===null&&Ec(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Sc(r,s)?o=null:i!==null&&Sc(r,i)&&(t.flags|=32),pm(e,t),Fe(e,t,o,n),t.child;case 6:return e===null&&Ec(t),null;case 13:return mm(e,t,n);case 4:return zu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=rs(t,null,r,n):Fe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),Rf(e,t,r,s,n);case 7:return Fe(e,t,t.pendingProps,n),t.child;case 8:return Fe(e,t,t.pendingProps.children,n),t.child;case 12:return Fe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,re(na,r._currentValue),r._currentValue=o,i!==null)if(Et(i.value,o)){if(i.children===s.children&&!Ge.current){t=ln(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=rn(-1,n&-n),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?l.next=l:(l.next=d.next,d.next=l),c.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Mc(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(M(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),Mc(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Fe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,Xr(t,n),s=xt(s),r=r(s),t.flags|=1,Fe(e,t,r,n),t.child;case 14:return r=t.type,s=_t(r,t.pendingProps),s=_t(r.type,s),Of(e,t,r,s,n);case 15:return fm(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:_t(r,s),Do(e,t),t.tag=1,qe(r)?(e=!0,Zo(t)):e=!1,Xr(t,n),cm(t,r,s),Rc(t,r,s,n),Tc(null,t,r,!0,e,n);case 19:return xm(e,t,n);case 22:return hm(e,t,n)}throw Error(M(156,t.tag))};function Dm(e,t){return og(e,t)}function Wy(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 gt(e,t,n,r){return new Wy(e,t,n,r)}function Ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $y(e){if(typeof e=="function")return Ju(e)?1:0;if(e!=null){if(e=e.$$typeof,e===xu)return 11;if(e===vu)return 14}return 2}function zn(e,t){var n=e.alternate;return n===null?(n=gt(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 Ao(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")Ju(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Or:return fr(n.children,s,i,t);case mu:o=8,s|=8;break;case tc:return e=gt(12,n,t,s|2),e.elementType=tc,e.lanes=i,e;case nc:return e=gt(13,n,t,s),e.elementType=nc,e.lanes=i,e;case rc:return e=gt(19,n,t,s),e.elementType=rc,e.lanes=i,e;case Hp:return Ha(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Wp:o=10;break e;case $p:o=9;break e;case xu:o=11;break e;case vu:o=14;break e;case vn:o=16,r=null;break e}throw Error(M(130,e==null?e:typeof e,""))}return t=gt(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function fr(e,t,n,r){return e=gt(7,e,r,t),e.lanes=n,e}function Ha(e,t,n,r){return e=gt(22,e,r,t),e.elementType=Hp,e.lanes=n,e.stateNode={isHidden:!1},e}function Tl(e,t,n){return e=gt(6,e,null,t),e.lanes=n,e}function Ll(e,t,n){return t=gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Hy(e,t,n,r,s){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=gl(0),this.expirationTimes=gl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Zu(e,t,n,r,s,i,o,a,l){return e=new Hy(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=gt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Au(i),e}function Vy(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Tm(e){if(!e)return Hn;e=e._reactInternals;e:{if(_r(e)!==e||e.tag!==1)throw Error(M(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(qe(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(M(171))}if(e.tag===1){var n=e.type;if(qe(n))return Tg(e,n,t)}return t}function Lm(e,t,n,r,s,i,o,a,l){return e=Zu(n,r,!0,e,s,i,o,a,l),e.context=Tm(null),n=e.current,r=Be(),s=An(n),i=rn(r,s),i.callback=t??null,Tn(n,i,s),e.current.lanes=s,Di(e,s,r),Je(e,r),e}function Va(e,t,n,r){var s=t.current,i=Be(),o=An(s);return n=Tm(n),t.context===null?t.context=n:t.pendingContext=n,t=rn(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Tn(s,t,o),e!==null&&(Nt(e,s,o,i),Po(e,s,o)),o}function fa(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 Vf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ed(e,t){Vf(e,t),(e=e.alternate)&&Vf(e,t)}function Uy(){return null}var Am=typeof reportError=="function"?reportError:function(e){console.error(e)};function td(e){this._internalRoot=e}Ua.prototype.render=td.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(M(409));Va(e,t,null,null)};Ua.prototype.unmount=td.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;vr(function(){Va(null,e,null,null)}),t[on]=null}};function Ua(e){this._internalRoot=e}Ua.prototype.unstable_scheduleHydration=function(e){if(e){var t=hg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wn.length&&t!==0&&t<wn[n].priority;n++);wn.splice(n,0,e),n===0&&gg(e)}};function nd(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ya(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Uf(){}function Yy(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var c=fa(o);i.call(c)}}var o=Lm(t,r,e,0,null,!1,!1,"",Uf);return e._reactRootContainer=o,e[on]=o.current,pi(e.nodeType===8?e.parentNode:e),vr(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var c=fa(l);a.call(c)}}var l=Zu(e,0,!1,null,null,!1,!1,"",Uf);return e._reactRootContainer=l,e[on]=l.current,pi(e.nodeType===8?e.parentNode:e),vr(function(){Va(t,l,n,r)}),l}function Ka(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=fa(o);a.call(l)}}Va(t,o,e,s)}else o=Yy(n,t,e,s,r);return fa(o)}dg=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Is(t.pendingLanes);n!==0&&(wu(t,n|1),Je(t,xe()),!(X&6)&&(os=xe()+500,Qn()))}break;case 13:vr(function(){var r=an(e,1);if(r!==null){var s=Be();Nt(r,e,1,s)}}),ed(e,1)}};_u=function(e){if(e.tag===13){var t=an(e,134217728);if(t!==null){var n=Be();Nt(t,e,134217728,n)}ed(e,134217728)}};fg=function(e){if(e.tag===13){var t=An(e),n=an(e,t);if(n!==null){var r=Be();Nt(n,e,t,r)}ed(e,t)}};hg=function(){return ee};pg=function(e,t){var n=ee;try{return ee=e,t()}finally{ee=n}};hc=function(e,t,n){switch(t){case"input":if(oc(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 s=za(r);if(!s)throw Error(M(90));Up(r),oc(r,s)}}}break;case"textarea":Kp(e,n);break;case"select":t=n.value,t!=null&&Vr(e,!!n.multiple,t,!1)}};eg=Qu;tg=vr;var Ky={usingClientEntryPoint:!1,Events:[Li,Ar,za,Jp,Zp,Qu]},Ms={findFiberByHostInstance:ar,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Xy={bundleType:Ms.bundleType,version:Ms.version,rendererPackageName:Ms.rendererPackageName,rendererConfig:Ms.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:un.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=sg(e),e===null?null:e.stateNode},findFiberByHostInstance:Ms.findFiberByHostInstance||Uy,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 co=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!co.isDisabled&&co.supportsFiber)try{Da=co.inject(Xy),Ht=co}catch{}}lt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ky;lt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!nd(t))throw Error(M(200));return Vy(e,t,null,n)};lt.createRoot=function(e,t){if(!nd(e))throw Error(M(299));var n=!1,r="",s=Am;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=Zu(e,1,!1,null,null,n,!1,r,s),e[on]=t.current,pi(e.nodeType===8?e.parentNode:e),new td(t)};lt.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(M(188)):(e=Object.keys(e).join(","),Error(M(268,e)));return e=sg(t),e=e===null?null:e.stateNode,e};lt.flushSync=function(e){return vr(e)};lt.hydrate=function(e,t,n){if(!Ya(t))throw Error(M(200));return Ka(null,e,t,!0,n)};lt.hydrateRoot=function(e,t,n){if(!nd(e))throw Error(M(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Am;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Lm(t,null,e,1,n??null,s,!1,i,o),e[on]=t.current,pi(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Ua(t)};lt.render=function(e,t,n){if(!Ya(t))throw Error(M(200));return Ka(null,e,t,!1,n)};lt.unmountComponentAtNode=function(e){if(!Ya(e))throw Error(M(40));return e._reactRootContainer?(vr(function(){Ka(null,null,e,!1,function(){e._reactRootContainer=null,e[on]=null})}),!0):!1};lt.unstable_batchedUpdates=Qu;lt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ya(n))throw Error(M(200));if(e==null||e._reactInternals===void 0)throw Error(M(38));return Ka(e,t,n,!1,r)};lt.version="18.3.1-next-f1338f8080-20240426";function zm(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(zm)}catch(e){console.error(e)}}zm(),zp.exports=lt;var Hr=zp.exports,Yf=Hr;Zl.createRoot=Yf.createRoot,Zl.hydrateRoot=Yf.hydrateRoot;/**
41
- * @remix-run/router v1.23.4
42
- *
43
- * Copyright (c) Remix Software Inc.
44
- *
45
- * This source code is licensed under the MIT license found in the
46
- * LICENSE.md file in the root directory of this source tree.
47
- *
48
- * @license MIT
49
- */function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Si.apply(null,arguments)}var Cn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Cn||(Cn={}));const Kf="popstate";function Qy(e){e===void 0&&(e={});function t(r,s){let{pathname:i,search:o,hash:a}=r.location;return Yc("",{pathname:i,search:o,hash:a},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:ha(s)}return qy(t,n,null,e)}function me(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Im(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Gy(){return Math.random().toString(36).substr(2,8)}function Xf(e,t){return{usr:e.state,key:e.key,idx:t}}function Yc(e,t,n,r){return n===void 0&&(n=null),Si({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?fs(t):t,{state:n,key:t&&t.key||r||Gy()})}function ha(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function fs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function qy(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Cn.Pop,l=null,c=d();c==null&&(c=0,o.replaceState(Si({},o.state,{idx:c}),""));function d(){return(o.state||{idx:null}).idx}function f(){a=Cn.Pop;let w=d(),x=w==null?null:w-c;c=w,l&&l({action:a,location:m.location,delta:x})}function h(w,x){a=Cn.Push;let g=Yc(m.location,w,x);c=d()+1;let y=Xf(g,c),_=m.createHref(g);try{o.pushState(y,"",_)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(_)}i&&l&&l({action:a,location:m.location,delta:1})}function p(w,x){a=Cn.Replace;let g=Yc(m.location,w,x);c=d();let y=Xf(g,c),_=m.createHref(g);o.replaceState(y,"",_),i&&l&&l({action:a,location:m.location,delta:0})}function v(w){let x=s.location.origin!=="null"?s.location.origin:s.location.href,g=typeof w=="string"?w:ha(w);return g=g.replace(/ $/,"%20"),me(x,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,x)}let m={get action(){return a},get location(){return e(s,o)},listen(w){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Kf,f),l=w,()=>{s.removeEventListener(Kf,f),l=null}},createHref(w){return t(s,w)},createURL:v,encodeLocation(w){let x=v(w);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:h,replace:p,go(w){return o.go(w)}};return m}var Qf;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Qf||(Qf={}));function Jy(e,t,n){return n===void 0&&(n="/"),Zy(e,t,n)}function Zy(e,t,n,r){let s=typeof t=="string"?fs(t):t,i=as(s.pathname||"/",n);if(i==null)return null;let o=Fm(e);eb(o);let a=null,l=db(i);for(let c=0;a==null&&c<o.length;++c)a=cb(o[c],l);return a}function Fm(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let s=(i,o,a)=>{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(me(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let c=In([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(me(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),Fm(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:ab(c,i.index),routesMeta:d})};return e.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of Bm(i.path))s(i,o,l)}),t}function Bm(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=Bm(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function eb(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:lb(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const tb=/^:[\w-]+$/,nb=3,rb=2,sb=1,ib=10,ob=-2,Gf=e=>e==="*";function ab(e,t){let n=e.split("/"),r=n.length;return n.some(Gf)&&(r+=ob),t&&(r+=rb),n.filter(s=>!Gf(s)).reduce((s,i)=>s+(tb.test(i)?nb:i===""?sb:ib),r)}function lb(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function cb(e,t,n){let{routesMeta:r}=e,s={},i="/",o=[];for(let a=0;a<r.length;++a){let l=r[a],c=a===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=Kc({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},d),h=l.route;if(!f)return null;Object.assign(s,f.params),o.push({params:s,pathname:In([i,f.pathname]),pathnameBase:pb(In([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=In([i,f.pathnameBase]))}return o}function Kc(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=ub(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),a=s.slice(1);return{params:r.reduce((c,d,f)=>{let{paramName:h,isOptional:p}=d;if(h==="*"){let m=a[f]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const v=a[f];return p&&!v?c[h]=void 0:c[h]=(v||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function ub(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Im(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function db(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Im(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function as(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function fb(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?fs(e):e,i;return n?(n=Hm(n),n.startsWith("/")?i=qf(n.substring(1),"/"):i=qf(n,t)):i=t,{pathname:i,search:gb(r),hash:mb(s)}}function qf(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Al(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 hb(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Wm(e,t){let n=hb(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function $m(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=fs(e):(s=Si({},e),me(!s.pathname||!s.pathname.includes("?"),Al("?","pathname","search",s)),me(!s.pathname||!s.pathname.includes("#"),Al("#","pathname","hash",s)),me(!s.search||!s.search.includes("#"),Al("#","search","hash",s)));let i=e===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let h=o.split("/");for(;h[0]==="..";)h.shift(),f-=1;s.pathname=h.join("/")}a=f>=0?t[f]:"/"}let l=fb(s,a),c=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(c||d)&&(l.pathname+="/"),l}const Hm=e=>e.replace(/\/\/+/g,"/"),In=e=>Hm(e.join("/")),pb=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),gb=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,mb=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function xb(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Vm=["post","put","patch","delete"];new Set(Vm);const vb=["get",...Vm];new Set(vb);/**
50
- * React Router v6.30.6
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */function ki(){return ki=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ki.apply(null,arguments)}const Xa=b.createContext(null),Um=b.createContext(null),Gn=b.createContext(null),Qa=b.createContext(null),Sr=b.createContext({outlet:null,matches:[],isDataRoute:!1}),Ym=b.createContext(null);function yb(e,t){let{relative:n}=t===void 0?{}:t;zi()||me(!1);let{basename:r,navigator:s}=b.useContext(Gn),{hash:i,pathname:o,search:a}=Ga(e,{relative:n}),l=o;return r!=="/"&&(l=o==="/"?r:In([r,o])),s.createHref({pathname:l,search:a,hash:i})}function zi(){return b.useContext(Qa)!=null}function qn(){return zi()||me(!1),b.useContext(Qa).location}function Km(e){b.useContext(Gn).static||b.useLayoutEffect(e)}function Xm(){let{isDataRoute:e}=b.useContext(Sr);return e?Ob():bb()}function bb(){zi()||me(!1);let e=b.useContext(Xa),{basename:t,future:n,navigator:r}=b.useContext(Gn),{matches:s}=b.useContext(Sr),{pathname:i}=qn(),o=JSON.stringify(Wm(s,n.v7_relativeSplatPath)),a=b.useRef(!1);return Km(()=>{a.current=!0}),b.useCallback(function(c,d){if(d===void 0&&(d={}),!a.current)return;if(typeof c=="number"){r.go(c);return}let f=$m(c,JSON.parse(o),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:In([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,i,e])}function Ga(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=b.useContext(Gn),{matches:s}=b.useContext(Sr),{pathname:i}=qn(),o=JSON.stringify(Wm(s,r.v7_relativeSplatPath));return b.useMemo(()=>$m(e,JSON.parse(o),i,n==="path"),[e,o,i,n])}function wb(e,t){return _b(e,t)}function _b(e,t,n,r){zi()||me(!1);let{navigator:s}=b.useContext(Gn),{matches:i}=b.useContext(Sr),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let c=qn(),d;if(t){var f;let w=typeof t=="string"?fs(t):t;l==="/"||(f=w.pathname)!=null&&f.startsWith(l)||me(!1),d=w}else d=c;let h=d.pathname||"/",p=h;if(l!=="/"){let w=l.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(w.length).join("/")}let v=Jy(e,{pathname:p}),m=Nb(v&&v.map(w=>Object.assign({},w,{params:Object.assign({},a,w.params),pathname:In([l,s.encodeLocation?s.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:In([l,s.encodeLocation?s.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&m?b.createElement(Qa.Provider,{value:{location:ki({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Cn.Pop}},m):m}function Sb(){let e=Rb(),t=xb(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},t),n?b.createElement("pre",{style:s},n):null,null)}const kb=b.createElement(Sb,null);class Cb extends b.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?b.createElement(Sr.Provider,{value:this.props.routeContext},b.createElement(Ym.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function jb(e){let{routeContext:t,match:n,children:r}=e,s=b.useContext(Xa);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(Sr.Provider,{value:t},r)}function Nb(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);d>=0||me(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<o.length;d++){let f=o[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(c=d),f.route.id){let{loaderData:h,errors:p}=n,v=f.route.loader&&h[f.route.id]===void 0&&(!p||p[f.route.id]===void 0);if(f.route.lazy||v){l=!0,c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}return o.reduceRight((d,f,h)=>{let p,v=!1,m=null,w=null;n&&(p=a&&f.route.id?a[f.route.id]:void 0,m=f.route.errorElement||kb,l&&(c<0&&h===0?(Db("route-fallback"),v=!0,w=null):c===h&&(v=!0,w=f.route.hydrateFallbackElement||null)));let x=t.concat(o.slice(0,h+1)),g=()=>{let y;return p?y=m:v?y=w:f.route.Component?y=b.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=d,b.createElement(jb,{match:f,routeContext:{outlet:d,matches:x,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?b.createElement(Cb,{location:n.location,revalidation:n.revalidation,component:m,error:p,children:g(),routeContext:{outlet:null,matches:x,isDataRoute:!0}}):g()},null)}var Qm=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Qm||{}),Gm=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Gm||{});function Eb(e){let t=b.useContext(Xa);return t||me(!1),t}function Mb(e){let t=b.useContext(Um);return t||me(!1),t}function Pb(e){let t=b.useContext(Sr);return t||me(!1),t}function qm(e){let t=Pb(),n=t.matches[t.matches.length-1];return n.route.id||me(!1),n.route.id}function Rb(){var e;let t=b.useContext(Ym),n=Mb(),r=qm();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Ob(){let{router:e}=Eb(Qm.UseNavigateStable),t=qm(Gm.UseNavigateStable),n=b.useRef(!1);return Km(()=>{n.current=!0}),b.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,ki({fromRouteId:t},i)))},[e,t])}const Jf={};function Db(e,t,n){Jf[e]||(Jf[e]=!0)}function Tb(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function zt(e){me(!1)}function Lb(e){let{basename:t="/",children:n=null,location:r,navigationType:s=Cn.Pop,navigator:i,static:o=!1,future:a}=e;zi()&&me(!1);let l=t.replace(/^\/*/,"/"),c=b.useMemo(()=>({basename:l,navigator:i,static:o,future:ki({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=fs(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:v="default"}=r,m=b.useMemo(()=>{let w=as(d,l);return w==null?null:{location:{pathname:w,search:f,hash:h,state:p,key:v},navigationType:s}},[l,d,f,h,p,v,s]);return m==null?null:b.createElement(Gn.Provider,{value:c},b.createElement(Qa.Provider,{children:n,value:m}))}function Ab(e){let{children:t,location:n}=e;return wb(Xc(t),n)}new Promise(()=>{});function Xc(e,t){t===void 0&&(t=[]);let n=[];return b.Children.forEach(e,(r,s)=>{if(!b.isValidElement(r))return;let i=[...t,s];if(r.type===b.Fragment){n.push.apply(n,Xc(r.props.children,i));return}r.type!==zt&&me(!1),!r.props.index||!r.props.children||me(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=Xc(r.props.children,i)),n.push(o)}),n}/**
59
- * React Router DOM v6.30.6
60
- *
61
- * Copyright (c) Remix Software Inc.
62
- *
63
- * This source code is licensed under the MIT license found in the
64
- * LICENSE.md file in the root directory of this source tree.
65
- *
66
- * @license MIT
67
- */function pa(){return pa=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pa.apply(null,arguments)}function Jm(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function zb(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ib(e,t){return e.button===0&&(!t||t==="_self")&&!zb(e)}function Qc(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Fb(e,t){let n=Qc(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const Bb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Wb=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],$b="6";try{window.__reactRouterVersion=$b}catch{}const Hb=b.createContext({isTransitioning:!1}),Vb="startTransition",Zf=I0[Vb];function Ub(e){let{basename:t,children:n,future:r,window:s}=e,i=b.useRef();i.current==null&&(i.current=Qy({window:s,v5Compat:!0}));let o=i.current,[a,l]=b.useState({action:o.action,location:o.location}),{v7_startTransition:c}=r||{},d=b.useCallback(f=>{c&&Zf?Zf(()=>l(f)):l(f)},[l,c]);return b.useLayoutEffect(()=>o.listen(d),[o,d]),b.useEffect(()=>Tb(r),[r]),b.createElement(Lb,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const Yb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Kb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xb=b.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:c,preventScrollReset:d,viewTransition:f}=t,h=Jm(t,Bb),{basename:p}=b.useContext(Gn),v,m=!1;if(typeof c=="string"&&Kb.test(c)&&(v=c,Yb))try{let y=new URL(window.location.href),_=c.startsWith("//")?new URL(y.protocol+c):new URL(c),k=as(_.pathname,p);_.origin===y.origin&&k!=null?c=k+_.search+_.hash:m=!0}catch{}let w=yb(c,{relative:s}),x=Gb(c,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:f});function g(y){r&&r(y),y.defaultPrevented||x(y)}return b.createElement("a",pa({},h,{href:v||w,onClick:m||i?r:g,ref:n,target:l}))}),Zm=b.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:c,children:d}=t,f=Jm(t,Wb),h=Ga(l,{relative:f.relative}),p=qn(),v=b.useContext(Um),{navigator:m,basename:w}=b.useContext(Gn),x=v!=null&&qb(h)&&c===!0,g=m.encodeLocation?m.encodeLocation(h).pathname:h.pathname,y=p.pathname,_=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;s||(y=y.toLowerCase(),_=_?_.toLowerCase():null,g=g.toLowerCase()),_&&w&&(_=as(_,w)||_);const k=g!=="/"&&g.endsWith("/")?g.length-1:g.length;let S=y===g||!o&&y.startsWith(g)&&y.charAt(k)==="/",C=_!=null&&(_===g||!o&&_.startsWith(g)&&_.charAt(g.length)==="/"),j={isActive:S,isPending:C,isTransitioning:x},P=S?r:void 0,E;typeof i=="function"?E=i(j):E=[i,S?"active":null,C?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let R=typeof a=="function"?a(j):a;return b.createElement(Xb,pa({},f,{"aria-current":P,className:E,ref:n,style:R,to:l,viewTransition:c}),typeof d=="function"?d(j):d)});var Gc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Gc||(Gc={}));var eh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(eh||(eh={}));function Qb(e){let t=b.useContext(Xa);return t||me(!1),t}function Gb(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=t===void 0?{}:t,l=Xm(),c=qn(),d=Ga(e,{relative:o});return b.useCallback(f=>{if(Ib(f,n)){f.preventDefault();let h=r!==void 0?r:ha(c)===ha(d);l(e,{replace:h,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[c,l,d,r,s,n,e,i,o,a])}function ex(e){let t=b.useRef(Qc(e)),n=b.useRef(!1),r=qn(),s=b.useMemo(()=>Fb(r.search,n.current?null:t.current),[r.search]),i=Xm(),o=b.useCallback((a,l)=>{const c=Qc(typeof a=="function"?a(s):a);n.current=!0,i("?"+c,l)},[i,s]);return[s,o]}function qb(e,t){t===void 0&&(t={});let n=b.useContext(Hb);n==null&&me(!1);let{basename:r}=Qb(Gc.useViewTransitionState),s=Ga(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=as(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=as(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Kc(s.pathname,o)!=null||Kc(s.pathname,i)!=null}const Jb="/api";class Zb extends Error{constructor(n,r){super(r);I(this,"status");this.status=n,this.name="ApiError"}}async function Y(e,t={}){const n=await fetch(Jb+e,{...t,headers:t.body?{"Content-Type":"application/json",...t.headers||{}}:t.headers});if(!n.ok){let r=`Erro HTTP ${n.status}`;try{const s=await n.json();r=String(s.detail||s.mensagem||r)}catch{}throw new Zb(n.status,r)}if(n.status!==204)return n.json()}const Ce=e=>({method:"POST",body:JSON.stringify(e)}),B={health:()=>Y("/health"),doctor:()=>Y("/doctor"),shutdown:()=>Y("/shutdown",Ce({})),metricas:()=>Y("/metrics"),leads:{listar:()=>Y("/leads"),criar:e=>Y("/leads",Ce(e)),atualizar:(e,t)=>Y(`/leads/${e}`,{method:"PATCH",body:JSON.stringify(t)}),remover:e=>Y(`/leads/${e}`,{method:"DELETE"}),importar:e=>Y("/leads/import",Ce({leads:e})),enriquecer:e=>Y(`/leads/${e}/enrich`,Ce({}))},crm:{sugestoes:()=>Y("/crm/sugestoes"),aplicar:(e,t)=>Y("/crm/sugestoes/aplicar",Ce({lead_id:e,para:t}))},campanhas:{listar:()=>Y("/campaigns"),criar:e=>Y("/campaigns",Ce(e)),iniciar:e=>Y(`/campaigns/${e}/start`,Ce({})),pausar:e=>Y(`/campaigns/${e}/pause`,Ce({})),parar:e=>Y(`/campaigns/${e}/stop`,Ce({})),remover:e=>Y(`/campaigns/${e}`,{method:"DELETE"})},extrair:{googleMaps:e=>Y("/extract/google-maps",Ce(e)),instagram:e=>Y("/extract/instagram",Ce({profile_url:e})),cnpj:e=>Y("/extract/cnpj",Ce({cnpj:e})),cnpjBusca:e=>Y("/extract/cnpj/search",Ce(e))},config:{obter:()=>Y("/config"),salvar:e=>Y("/config",{method:"PUT",body:JSON.stringify(e)}),testarLlm:()=>Y("/config/test/llm",Ce({})),testarIntegracao:e=>Y("/config/test/integracao",Ce({url:e}))},integracoes:()=>Y("/integrations/status"),agentes:{templates:()=>Y("/agents/templates"),salvarTemplates:e=>Y("/agents/templates",{method:"PUT",body:JSON.stringify(e)}),testarTemplate:(e,t)=>Y("/agents/templates/test",Ce({template:e,lead_id:t})),chat:e=>Y("/agents/attendance/chat",Ce({mensagens:e}))},webhook:{obter:()=>Y("/webhook"),salvar:e=>Y("/webhook",{method:"PUT",body:JSON.stringify(e)}),testar:e=>Y("/webhook/test",Ce({url:e}))}};function $(...e){return e.filter(Boolean).join(" ")}function ew(e){return(e||"?").trim().charAt(0).toUpperCase()||"?"}function qc(e){if(!e)return"—";try{return new Date(e).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",year:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function rd(e){const t=(e||"").replace(/\D/g,"");return t?t.length===11?`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`:t.length===10?`(${t.slice(0,2)}) ${t.slice(2,6)}-${t.slice(6)}`:e||"—":"—"}function tw(e){const t=["nome","telefone","email","empresa","cidade","observacoes"],n=t.filter(r=>String(e[r]||"").trim().length>0);return Math.round(n.length/t.length*100)}function nw(e){const t={nome:"nome",telefone:"telefone",email:"e-mail",empresa:"empresa",cidade:"cidade",observacoes:"observações"};return["nome","telefone","email","empresa","cidade","observacoes"].filter(r=>String(e[r]||"").trim().length===0).map(r=>t[r])}function rw(e,t){if(e>=100)return"Lead 100% completo — excelente! 🎉";const n=t.slice(0,2).join(" e ");return`Faltam ${100-e}% (${n}${t.length>2?"...":""}) para o lead ficar completo`}function sw(e,t){const n=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),r=URL.createObjectURL(n),s=document.createElement("a");s.href=r,s.download=t,s.click(),URL.revokeObjectURL(r)}const iw={md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"};function Yt({aberto:e,onFechar:t,titulo:n,children:r,icone:s="fas fa-circle-info",largura:i="md"}){return b.useEffect(()=>{const o=a=>{a.key==="Escape"&&t()};return e&&window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[e,t]),e?u.jsx("div",{className:"fixed inset-0 z-50 bg-black/40 flex items-center justify-center p-4",onMouseDown:o=>{o.target===o.currentTarget&&t()},children:u.jsxs("div",{className:$("bg-white rounded-2xl shadow-xl w-full",iw[i]),children:[u.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[u.jsxs("h3",{className:"text-base font-semibold text-gray-800 flex items-center gap-2",children:[u.jsx("i",{className:$(s,"text-indigo-500")})," ",n]}),u.jsx("button",{onClick:t,className:"text-gray-400 hover:text-gray-600","aria-label":"Fechar",children:u.jsx("i",{className:"fas fa-times"})})]}),u.jsx("div",{className:"px-6 py-5 max-h-[70vh] overflow-y-auto",children:r})]})}):null}const ow=[{icone:"fas fa-users",texto:"Cadastre leads manualmente ou importe pelos Extratores (Maps, Instagram, CNPJ)."},{icone:"fas fa-columns",texto:"Arraste os cards no CRM conforme avança no funil (Leads → Em contato → Proposta → Fechado)."},{icone:"fas fa-bullhorn",texto:"Monte campanhas de disparo com seus templates e acompanhe as taxas no Painel."},{icone:"fas fa-robot",texto:"Use os Agentes (disparo e atendimento) e configure o LLM em Ferramentas para turbiná-los."}];function aw({titulo:e,nomeUsuario:t}){const[n,r]=b.useState(!1);return u.jsxs("header",{className:"bg-white shadow-sm px-8 py-4 flex items-center justify-between shrink-0",children:[u.jsx("div",{children:u.jsx("h2",{className:"text-lg font-semibold text-gray-800",children:e})}),u.jsxs("div",{className:"flex items-center space-x-4",children:[u.jsxs("button",{onClick:()=>r(!0),className:"text-sm text-indigo-600 hover:text-indigo-800 font-medium",children:[u.jsx("i",{className:"fas fa-play-circle mr-1"})," Ver tutorial"]}),u.jsx("div",{className:"w-8 h-8 rounded-full bg-indigo-100 flex items-center justify-center text-indigo-600 font-bold text-sm",children:ew(t)}),u.jsx("span",{className:"text-sm font-medium text-gray-700",children:t})]}),u.jsxs(Yt,{aberto:n,onFechar:()=>r(!1),titulo:"Tutorial rápido",icone:"fas fa-graduation-cap",children:[u.jsx("ol",{className:"space-y-4",children:ow.map((s,i)=>u.jsxs("li",{className:"flex gap-3 items-start",children:[u.jsx("span",{className:"w-8 h-8 rounded-full bg-indigo-100 text-indigo-600 flex items-center justify-center shrink-0",children:u.jsx("i",{className:s.icone})}),u.jsx("p",{className:"text-sm text-gray-600 pt-1.5",children:s.texto})]},i))}),u.jsx("p",{className:"text-xs text-gray-400 mt-5",children:"Dica: o LLM (para enriquecimento e agentes) é configurado em Ferramentas."})]})]})}const lw=[{itens:[{para:"/",icone:"fas fa-chart-pie text-indigo-300",rotulo:"Painel",fim:!0}]},{secao:"Conexões",itens:[{para:"/leads",icone:"fas fa-users",rotulo:"Leads"},{para:"/agentes",icone:"fas fa-robot",rotulo:"Agentes"},{para:"/ferramentas",icone:"fas fa-tools",rotulo:"Ferramentas"}]},{itens:[{para:"/extratores?tab=maps",icone:"fas fa-map-marked-alt",rotulo:"Extrator Maps"},{para:"/extratores?tab=instagram",icone:"fab fa-instagram",rotulo:"Extrator Instagram"},{para:"/extratores?tab=cnpj",icone:"fas fa-building",rotulo:"Extrator CNPJ"}]},{secao:"Gestão",itens:[{para:"/disparos",icone:"fas fa-bullhorn",rotulo:"Disparos"},{para:"/crm",icone:"fas fa-columns",rotulo:"CRM"}]},{secao:"Integrações",itens:[{para:"/webhook",icone:"fas fa-link",rotulo:"Webhook"},{para:"/suporte",icone:"fas fa-headset",rotulo:"Suporte"}]}];function cw({onSair:e}){const t=qn(),[n,r]=b.useState(!1);b.useEffect(()=>{t.pathname==="/agentes"&&r(!0)},[t.pathname]);const s=i=>{if(i.rotulo==="Agentes")return t.pathname==="/agentes";const[o,a]=i.para.split("?");return a?t.pathname===o&&t.search.includes(a):i.fim?t.pathname===o:t.pathname.startsWith(o)};return u.jsxs("aside",{className:"w-64 bg-[#1e1b4b] text-white flex flex-col shrink-0 h-screen sticky top-0",children:[u.jsx("div",{className:"p-6 border-b border-gray-700",children:u.jsxs("h1",{className:"text-2xl font-bold tracking-tight flex items-center gap-2",children:[u.jsx("span",{className:"text-2xl",children:"⚡"}),"LeadMaster"]})}),u.jsx("nav",{className:"flex-1 overflow-y-auto py-4",children:u.jsx("ul",{className:"space-y-1",children:lw.map((i,o)=>u.jsx("li",{children:u.jsxs("ul",{children:[i.secao&&u.jsx("li",{className:"px-6 py-2 text-xs font-semibold text-gray-400 uppercase tracking-wider list-none",children:i.secao}),i.itens.map(a=>a.rotulo==="Agentes"?u.jsxs("li",{children:[u.jsxs("button",{type:"button",onClick:()=>r(l=>!l),className:$("sidebar-link w-full flex items-center px-6 py-2.5 text-sm",s(a)&&"active"),children:[u.jsx("i",{className:$(a.icone,"w-5 text-gray-400")}),u.jsx("span",{className:"ml-3",children:a.rotulo}),u.jsx("i",{className:$("fas fa-chevron-down ml-auto text-xs text-gray-400 transition-transform",n&&"rotate-180")})]}),n&&u.jsxs("ul",{className:"pl-12 space-y-1 mt-1",children:[u.jsx("li",{children:u.jsx(th,{para:"/agentes?tab=disparo",rotulo:"Agente de Disparo",ativo:t.pathname==="/agentes"&&t.search.includes("disparo")})}),u.jsx("li",{children:u.jsx(th,{para:"/agentes?tab=atendimento",rotulo:"Agente de Atendimento",ativo:t.pathname==="/agentes"&&t.search.includes("atendimento")})})]})]},"agentes"):u.jsx("li",{children:u.jsxs(Zm,{to:a.para,className:$("sidebar-link flex items-center px-6 py-2.5 text-sm",s(a)&&"active"),children:[u.jsx("i",{className:$(a.icone,"w-5 text-gray-400")}),u.jsx("span",{className:"ml-3",children:a.rotulo})]})},a.para))]})},o))})}),u.jsx("div",{className:"p-4 border-t border-gray-700",children:u.jsxs("button",{onClick:e,className:"w-full flex items-center justify-center px-4 py-2.5 bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg text-sm font-medium hover:opacity-90 transition",children:[u.jsx("i",{className:"fas fa-sign-out-alt mr-2"})," Sair"]})})]})}function th({para:e,rotulo:t,ativo:n}){return u.jsx(Zm,{to:e,className:$("sidebar-link block px-4 py-2 text-xs text-gray-300 rounded",n&&"active"),children:t})}const tx=b.createContext({toast:()=>{}});function Rt(){return b.useContext(tx)}const uw={sucesso:"bg-green-600",erro:"bg-red-600",info:"bg-indigo-600"},dw={sucesso:"fas fa-check-circle",erro:"fas fa-exclamation-circle",info:"fas fa-info-circle"};function fw({children:e}){const[t,n]=b.useState([]),r=b.useRef(0),s=b.useCallback((i,o)=>{const a=++r.current;n(l=>[...l,{id:a,tipo:i,mensagem:o}]),setTimeout(()=>n(l=>l.filter(c=>c.id!==a)),4500)},[]);return u.jsxs(tx.Provider,{value:{toast:s},children:[e,u.jsx("div",{className:"fixed top-4 right-4 z-[100] space-y-2 w-80",children:t.map(i=>u.jsxs("div",{className:$(uw[i.tipo],"text-white text-sm rounded-lg shadow-lg px-4 py-3 flex items-start gap-2 animate-pulse-once"),role:"status",children:[u.jsx("i",{className:$(dw[i.tipo],"mt-0.5")}),u.jsx("span",{className:"flex-1",children:i.mensagem}),u.jsx("button",{className:"opacity-70 hover:opacity-100",onClick:()=>n(o=>o.filter(a=>a.id!==i.id)),"aria-label":"Fechar",children:u.jsx("i",{className:"fas fa-times"})})]},i.id))})]})}function uo({rotulo:e,valor:t,subtitulo:n,children:r,icone:s}){return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-5 border border-gray-100",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"text-sm text-gray-500 font-medium",children:e}),s&&u.jsx("i",{className:`${s} text-indigo-300`})]}),r??u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-2xl font-bold text-gray-800 mt-1",children:t}),n&&u.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:n})]})]})}/*!
68
- * @kurkle/color v0.3.4
69
- * https://github.com/kurkle/color#readme
70
- * (c) 2024 Jukka Kurkela
71
- * Released under the MIT License
72
- */function Ii(e){return e+.5|0}const jn=(e,t,n)=>Math.max(Math.min(e,n),t);function Bs(e){return jn(Ii(e*2.55),0,255)}function Fn(e){return jn(Ii(e*255),0,255)}function Zt(e){return jn(Ii(e/2.55)/100,0,1)}function nh(e){return jn(Ii(e*100),0,100)}const dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Jc=[..."0123456789ABCDEF"],hw=e=>Jc[e&15],pw=e=>Jc[(e&240)>>4]+Jc[e&15],fo=e=>(e&240)>>4===(e&15),gw=e=>fo(e.r)&&fo(e.g)&&fo(e.b)&&fo(e.a);function mw(e){var t=e.length,n;return e[0]==="#"&&(t===4||t===5?n={r:255&dt[e[1]]*17,g:255&dt[e[2]]*17,b:255&dt[e[3]]*17,a:t===5?dt[e[4]]*17:255}:(t===7||t===9)&&(n={r:dt[e[1]]<<4|dt[e[2]],g:dt[e[3]]<<4|dt[e[4]],b:dt[e[5]]<<4|dt[e[6]],a:t===9?dt[e[7]]<<4|dt[e[8]]:255})),n}const xw=(e,t)=>e<255?t(e):"";function vw(e){var t=gw(e)?hw:pw;return e?"#"+t(e.r)+t(e.g)+t(e.b)+xw(e.a,t):void 0}const yw=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function nx(e,t,n){const r=t*Math.min(n,1-n),s=(i,o=(i+e/30)%12)=>n-r*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function bw(e,t,n){const r=(s,i=(s+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5),r(3),r(1)]}function ww(e,t,n){const r=nx(e,1,.5);let s;for(t+n>1&&(s=1/(t+n),t*=s,n*=s),s=0;s<3;s++)r[s]*=1-t-n,r[s]+=t;return r}function _w(e,t,n,r,s){return e===s?(t-n)/r+(t<n?6:0):t===s?(n-e)/r+2:(e-t)/r+4}function sd(e){const n=e.r/255,r=e.g/255,s=e.b/255,i=Math.max(n,r,s),o=Math.min(n,r,s),a=(i+o)/2;let l,c,d;return i!==o&&(d=i-o,c=a>.5?d/(2-i-o):d/(i+o),l=_w(n,r,s,d,i),l=l*60+.5),[l|0,c||0,a]}function id(e,t,n,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,n,r)).map(Fn)}function od(e,t,n){return id(nx,e,t,n)}function Sw(e,t,n){return id(ww,e,t,n)}function kw(e,t,n){return id(bw,e,t,n)}function rx(e){return(e%360+360)%360}function Cw(e){const t=yw.exec(e);let n=255,r;if(!t)return;t[5]!==r&&(n=t[6]?Bs(+t[5]):Fn(+t[5]));const s=rx(+t[2]),i=+t[3]/100,o=+t[4]/100;return t[1]==="hwb"?r=Sw(s,i,o):t[1]==="hsv"?r=kw(s,i,o):r=od(s,i,o),{r:r[0],g:r[1],b:r[2],a:n}}function jw(e,t){var n=sd(e);n[0]=rx(n[0]+t),n=od(n),e.r=n[0],e.g=n[1],e.b=n[2]}function Nw(e){if(!e)return;const t=sd(e),n=t[0],r=nh(t[1]),s=nh(t[2]);return e.a<255?`hsla(${n}, ${r}%, ${s}%, ${Zt(e.a)})`:`hsl(${n}, ${r}%, ${s}%)`}const rh={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},sh={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function Ew(){const e={},t=Object.keys(sh),n=Object.keys(rh);let r,s,i,o,a;for(r=0;r<t.length;r++){for(o=a=t[r],s=0;s<n.length;s++)i=n[s],a=a.replace(i,rh[i]);i=parseInt(sh[o],16),e[a]=[i>>16&255,i>>8&255,i&255]}return e}let ho;function Mw(e){ho||(ho=Ew(),ho.transparent=[0,0,0,0]);const t=ho[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const Pw=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Rw(e){const t=Pw.exec(e);let n=255,r,s,i;if(t){if(t[7]!==r){const o=+t[7];n=t[8]?Bs(o):jn(o*255,0,255)}return r=+t[1],s=+t[3],i=+t[5],r=255&(t[2]?Bs(r):jn(r,0,255)),s=255&(t[4]?Bs(s):jn(s,0,255)),i=255&(t[6]?Bs(i):jn(i,0,255)),{r,g:s,b:i,a:n}}}function Ow(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${Zt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const zl=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,Mr=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function Dw(e,t,n){const r=Mr(Zt(e.r)),s=Mr(Zt(e.g)),i=Mr(Zt(e.b));return{r:Fn(zl(r+n*(Mr(Zt(t.r))-r))),g:Fn(zl(s+n*(Mr(Zt(t.g))-s))),b:Fn(zl(i+n*(Mr(Zt(t.b))-i))),a:e.a+n*(t.a-e.a)}}function po(e,t,n){if(e){let r=sd(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*n,t===0?360:1)),r=od(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function sx(e,t){return e&&Object.assign(t||{},e)}function ih(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Fn(e[3]))):(t=sx(e,{r:0,g:0,b:0,a:1}),t.a=Fn(t.a)),t}function Tw(e){return e.charAt(0)==="r"?Rw(e):Cw(e)}class Ci{constructor(t){if(t instanceof Ci)return t;const n=typeof t;let r;n==="object"?r=ih(t):n==="string"&&(r=mw(t)||Mw(t)||Tw(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=sx(this._rgb);return t&&(t.a=Zt(t.a)),t}set rgb(t){this._rgb=ih(t)}rgbString(){return this._valid?Ow(this._rgb):void 0}hexString(){return this._valid?vw(this._rgb):void 0}hslString(){return this._valid?Nw(this._rgb):void 0}mix(t,n){if(t){const r=this.rgb,s=t.rgb;let i;const o=n===i?.5:n,a=2*o-1,l=r.a-s.a,c=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;i=1-c,r.r=255&c*r.r+i*s.r+.5,r.g=255&c*r.g+i*s.g+.5,r.b=255&c*r.b+i*s.b+.5,r.a=o*r.a+(1-o)*s.a,this.rgb=r}return this}interpolate(t,n){return t&&(this._rgb=Dw(this._rgb,t._rgb,n)),this}clone(){return new Ci(this.rgb)}alpha(t){return this._rgb.a=Fn(t),this}clearer(t){const n=this._rgb;return n.a*=1-t,this}greyscale(){const t=this._rgb,n=Ii(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=n,this}opaquer(t){const n=this._rgb;return n.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return po(this._rgb,2,t),this}darken(t){return po(this._rgb,2,-t),this}saturate(t){return po(this._rgb,1,t),this}desaturate(t){return po(this._rgb,1,-t),this}rotate(t){return jw(this._rgb,t),this}}/*!
73
- * Chart.js v4.6.1
74
- * https://www.chartjs.org
75
- * (c) 2026 Chart.js Contributors
76
- * Released under the MIT License
77
- */function Xt(){}const Lw=(()=>{let e=0;return()=>e++})();function ne(e){return e==null}function Ee(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function Q(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function yt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Lt(e,t){return yt(e)?e:t}function K(e,t){return typeof e>"u"?t:e}const Aw=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,ix=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function oe(e,t,n){if(e&&typeof e.call=="function")return e.apply(n,t)}function Z(e,t,n,r){let s,i,o;if(Ee(e))for(i=e.length,s=0;s<i;s++)t.call(n,e[s],s);else if(Q(e))for(o=Object.keys(e),i=o.length,s=0;s<i;s++)t.call(n,e[o[s]],o[s])}function ga(e,t){let n,r,s,i;if(!e||!t||e.length!==t.length)return!1;for(n=0,r=e.length;n<r;++n)if(s=e[n],i=t[n],s.datasetIndex!==i.datasetIndex||s.index!==i.index)return!1;return!0}function ma(e){if(Ee(e))return e.map(ma);if(Q(e)){const t=Object.create(null),n=Object.keys(e),r=n.length;let s=0;for(;s<r;++s)t[n[s]]=ma(e[n[s]]);return t}return e}function ox(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function zw(e,t,n,r){if(!ox(e))return;const s=t[e],i=n[e];Q(s)&&Q(i)?ji(s,i,r):t[e]=ma(i)}function ji(e,t,n){const r=Ee(t)?t:[t],s=r.length;if(!Q(e))return e;n=n||{};const i=n.merger||zw;let o;for(let a=0;a<s;++a){if(o=r[a],!Q(o))continue;const l=Object.keys(o);for(let c=0,d=l.length;c<d;++c)i(l[c],e,o,n)}return e}function ei(e,t){return ji(e,t,{merger:Iw})}function Iw(e,t,n){if(!ox(e))return;const r=t[e],s=n[e];Q(r)&&Q(s)?ei(r,s):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ma(s))}const oh={"":e=>e,x:e=>e.x,y:e=>e.y};function Fw(e){const t=e.split("."),n=[];let r="";for(const s of t)r+=s,r.endsWith("\\")?r=r.slice(0,-1)+".":(n.push(r),r="");return n}function Bw(e){const t=Fw(e);return n=>{for(const r of t){if(r==="")break;n=n&&n[r]}return n}}function yr(e,t){return(oh[t]||(oh[t]=Bw(t)))(e)}function ad(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Ni=e=>typeof e<"u",Vn=e=>typeof e=="function",ah=(e,t)=>{if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0};function Ww(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const ae=Math.PI,ue=2*ae,xa=Number.POSITIVE_INFINITY,$w=ae/180,ke=ae/2,er=ae/4,lh=ae*2/3,ax=Math.log10,Bn=Math.sign;function zo(e,t,n){return Math.abs(e-t)<n}function ch(e){const t=Math.round(e);e=zo(e,t,e/1e3)?t:e;const n=Math.pow(10,Math.floor(ax(e))),r=e/n;return(r<=1?1:r<=2?2:r<=5?5:10)*n}function Hw(e){const t=[],n=Math.sqrt(e);let r;for(r=1;r<n;r++)e%r===0&&(t.push(r),t.push(e/r));return n===(n|0)&&t.push(n),t.sort((s,i)=>s-i).pop(),t}function Vw(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function va(e){return!Vw(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Uw(e,t){const n=Math.round(e);return n-t<=e&&n+t>=e}function Yw(e,t,n){let r,s,i;for(r=0,s=e.length;r<s;r++)i=e[r][n],isNaN(i)||(t.min=Math.min(t.min,i),t.max=Math.max(t.max,i))}function nn(e){return e*(ae/180)}function Kw(e){return e*(180/ae)}function uh(e){if(!yt(e))return;let t=1,n=0;for(;Math.round(e*t)/t!==e;)t*=10,n++;return n}function lx(e,t){const n=t.x-e.x,r=t.y-e.y,s=Math.sqrt(n*n+r*r);let i=Math.atan2(r,n);return i<-.5*ae&&(i+=ue),{angle:i,distance:s}}function Xw(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function Wt(e){return(e%ue+ue)%ue}function ya(e,t,n,r){const s=Wt(e),i=Wt(t),o=Wt(n),a=Wt(i-s),l=Wt(o-s),c=Wt(s-i),d=Wt(s-o);return s===i||s===o||r&&i===o||a>l&&c<d}function Xe(e,t,n){return Math.max(t,Math.min(n,e))}function Qw(e){return Xe(e,-32768,32767)}function ur(e,t,n,r=1e-6){return e>=Math.min(t,n)-r&&e<=Math.max(t,n)+r}function ld(e,t,n){n=n||(o=>e[o]<t);let r=e.length-1,s=0,i;for(;r-s>1;)i=s+r>>1,n(i)?s=i:r=i;return{lo:s,hi:r}}const Zc=(e,t,n,r)=>ld(e,n,r?s=>{const i=e[s][t];return i<n||i===n&&e[s+1][t]===n}:s=>e[s][t]<n),Gw=(e,t,n)=>ld(e,n,r=>e[r][t]>=n);function qw(e,t,n){let r=0,s=e.length;for(;r<s&&e[r]<t;)r++;for(;s>r&&e[s-1]>n;)s--;return r>0||s<e.length?e.slice(r,s):e}const cx=["push","pop","shift","splice","unshift"];function Jw(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),cx.forEach(n=>{const r="_onData"+ad(n),s=e[n];Object.defineProperty(e,n,{configurable:!0,enumerable:!1,value(...i){const o=s.apply(this,i);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...i)}),o}})})}function dh(e,t){const n=e._chartjs;if(!n)return;const r=n.listeners,s=r.indexOf(t);s!==-1&&r.splice(s,1),!(r.length>0)&&(cx.forEach(i=>{delete e[i]}),delete e._chartjs)}function ux(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const dx=function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame}();function fx(e,t){let n=[],r=!1;return function(...s){n=s,r||(r=!0,dx.call(window,()=>{r=!1,e.apply(t,n)}))}}function Zw(e,t){let n;return function(...r){return t?(clearTimeout(n),n=setTimeout(e,t,r)):e.apply(this,r),t}}const hx=e=>e==="start"?"left":e==="end"?"right":"center",rt=(e,t,n)=>e==="start"?t:e==="end"?n:(t+n)/2,e1=(e,t,n,r)=>e===(r?"left":"right")?n:e==="center"?(t+n)/2:t,go=e=>e===0||e===1,fh=(e,t,n)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*ue/n)),hh=(e,t,n)=>Math.pow(2,-10*e)*Math.sin((e-t)*ue/n)+1,ti={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ke)+1,easeOutSine:e=>Math.sin(e*ke),easeInOutSine:e=>-.5*(Math.cos(ae*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>go(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>go(e)?e:fh(e,.075,.3),easeOutElastic:e=>go(e)?e:hh(e,.075,.3),easeInOutElastic(e){return go(e)?e:e<.5?.5*fh(e*2,.1125,.45):.5+.5*hh(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-ti.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?ti.easeInBounce(e*2)*.5:ti.easeOutBounce(e*2-1)*.5+.5};function px(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function ph(e){return px(e)?e:new Ci(e)}function Il(e){return px(e)?e:new Ci(e).saturate(.5).darken(.1).hexString()}const t1=["x","y","borderWidth","radius","tension"],n1=["color","borderColor","backgroundColor"];function r1(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:n1},numbers:{type:"number",properties:t1}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function s1(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const gh=new Map;function i1(e,t){t=t||{};const n=e+JSON.stringify(t);let r=gh.get(n);return r||(r=new Intl.NumberFormat(e,t),gh.set(n,r)),r}function cd(e,t,n){return i1(t,n).format(e)}const o1={values(e){return Ee(e)?e:""+e},numeric(e,t,n){if(e===0)return"0";const r=this.chart.options.locale;let s,i=e;if(n.length>1){const c=Math.max(Math.abs(n[0].value),Math.abs(n[n.length-1].value));(c<1e-4||c>1e15)&&(s="scientific"),i=a1(e,n)}const o=ax(Math.abs(i)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),l={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),cd(e,r,l)}};function a1(e,t){let n=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(n)>=1&&e!==Math.floor(e)&&(n=e-Math.floor(e)),n}var gx={formatters:o1};function l1(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,n)=>n.lineWidth,tickColor:(t,n)=>n.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:gx.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const br=Object.create(null),eu=Object.create(null);function ni(e,t){if(!t)return e;const n=t.split(".");for(let r=0,s=n.length;r<s;++r){const i=n[r];e=e[i]||(e[i]=Object.create(null))}return e}function Fl(e,t,n){return typeof t=="string"?ji(ni(e,t),n):ji(ni(e,""),t)}class c1{constructor(t,n){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,s)=>Il(s.backgroundColor),this.hoverBorderColor=(r,s)=>Il(s.borderColor),this.hoverColor=(r,s)=>Il(s.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(n)}set(t,n){return Fl(this,t,n)}get(t){return ni(this,t)}describe(t,n){return Fl(eu,t,n)}override(t,n){return Fl(br,t,n)}route(t,n,r,s){const i=ni(this,t),o=ni(this,r),a="_"+n;Object.defineProperties(i,{[a]:{value:i[n],writable:!0},[n]:{enumerable:!0,get(){const l=this[a],c=o[s];return Q(l)?Object.assign({},c,l):K(l,c)},set(l){this[a]=l}}})}apply(t){t.forEach(n=>n(this))}}var ve=new c1({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[r1,s1,l1]);function u1(e){return!e||ne(e.size)||ne(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function mh(e,t,n,r,s){let i=t[s];return i||(i=t[s]=e.measureText(s).width,n.push(s)),i>r&&(r=i),r}function tr(e,t,n){const r=e.currentDevicePixelRatio,s=n!==0?Math.max(n/2,.5):0;return Math.round((t-s)*r)/r+s}function xh(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function vh(e,t,n,r){mx(e,t,n,r,null)}function mx(e,t,n,r,s){let i,o,a,l,c,d,f,h;const p=t.pointStyle,v=t.rotation,m=t.radius;let w=(v||0)*$w;if(p&&typeof p=="object"&&(i=p.toString(),i==="[object HTMLImageElement]"||i==="[object HTMLCanvasElement]")){e.save(),e.translate(n,r),e.rotate(w),e.drawImage(p,-p.width/2,-p.height/2,p.width,p.height),e.restore();return}if(!(isNaN(m)||m<=0)){switch(e.beginPath(),p){default:s?e.ellipse(n,r,s/2,m,0,0,ue):e.arc(n,r,m,0,ue),e.closePath();break;case"triangle":d=s?s/2:m,e.moveTo(n+Math.sin(w)*d,r-Math.cos(w)*m),w+=lh,e.lineTo(n+Math.sin(w)*d,r-Math.cos(w)*m),w+=lh,e.lineTo(n+Math.sin(w)*d,r-Math.cos(w)*m),e.closePath();break;case"rectRounded":c=m*.516,l=m-c,o=Math.cos(w+er)*l,f=Math.cos(w+er)*(s?s/2-c:l),a=Math.sin(w+er)*l,h=Math.sin(w+er)*(s?s/2-c:l),e.arc(n-f,r-a,c,w-ae,w-ke),e.arc(n+h,r-o,c,w-ke,w),e.arc(n+f,r+a,c,w,w+ke),e.arc(n-h,r+o,c,w+ke,w+ae),e.closePath();break;case"rect":if(!v){l=Math.SQRT1_2*m,d=s?s/2:l,e.rect(n-d,r-l,2*d,2*l);break}w+=er;case"rectRot":f=Math.cos(w)*(s?s/2:m),o=Math.cos(w)*m,a=Math.sin(w)*m,h=Math.sin(w)*(s?s/2:m),e.moveTo(n-f,r-a),e.lineTo(n+h,r-o),e.lineTo(n+f,r+a),e.lineTo(n-h,r+o),e.closePath();break;case"crossRot":w+=er;case"cross":f=Math.cos(w)*(s?s/2:m),o=Math.cos(w)*m,a=Math.sin(w)*m,h=Math.sin(w)*(s?s/2:m),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"star":f=Math.cos(w)*(s?s/2:m),o=Math.cos(w)*m,a=Math.sin(w)*m,h=Math.sin(w)*(s?s/2:m),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o),w+=er,f=Math.cos(w)*(s?s/2:m),o=Math.cos(w)*m,a=Math.sin(w)*m,h=Math.sin(w)*(s?s/2:m),e.moveTo(n-f,r-a),e.lineTo(n+f,r+a),e.moveTo(n+h,r-o),e.lineTo(n-h,r+o);break;case"line":o=s?s/2:Math.cos(w)*m,a=Math.sin(w)*m,e.moveTo(n-o,r-a),e.lineTo(n+o,r+a);break;case"dash":e.moveTo(n,r),e.lineTo(n+Math.cos(w)*(s?s/2:m),r+Math.sin(w)*m);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function xx(e,t,n){return n=n||.5,!t||e&&e.x>t.left-n&&e.x<t.right+n&&e.y>t.top-n&&e.y<t.bottom+n}function ud(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function dd(e){e.restore()}function d1(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),ne(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function f1(e,t,n,r,s){if(s.strikethrough||s.underline){const i=e.measureText(r),o=t-i.actualBoundingBoxLeft,a=t+i.actualBoundingBoxRight,l=n-i.actualBoundingBoxAscent,c=n+i.actualBoundingBoxDescent,d=s.strikethrough?(l+c)/2:c;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(o,d),e.lineTo(a,d),e.stroke()}}function h1(e,t){const n=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=n}function ba(e,t,n,r,s,i={}){const o=Ee(t)?t:[t],a=i.strokeWidth>0&&i.strokeColor!=="";let l,c;for(e.save(),e.font=s.string,d1(e,i),l=0;l<o.length;++l)c=o[l],i.backdrop&&h1(e,i.backdrop),a&&(i.strokeColor&&(e.strokeStyle=i.strokeColor),ne(i.strokeWidth)||(e.lineWidth=i.strokeWidth),e.strokeText(c,n,r,i.maxWidth)),e.fillText(c,n,r,i.maxWidth),f1(e,n,r,c,i),r+=Number(s.lineHeight);e.restore()}function wa(e,t){const{x:n,y:r,w:s,h:i,radius:o}=t;e.arc(n+o.topLeft,r+o.topLeft,o.topLeft,1.5*ae,ae,!0),e.lineTo(n,r+i-o.bottomLeft),e.arc(n+o.bottomLeft,r+i-o.bottomLeft,o.bottomLeft,ae,ke,!0),e.lineTo(n+s-o.bottomRight,r+i),e.arc(n+s-o.bottomRight,r+i-o.bottomRight,o.bottomRight,ke,0,!0),e.lineTo(n+s,r+o.topRight),e.arc(n+s-o.topRight,r+o.topRight,o.topRight,0,-ke,!0),e.lineTo(n+o.topLeft,r)}const p1=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,g1=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function m1(e,t){const n=(""+e).match(p1);if(!n||n[1]==="normal")return t*1.2;switch(e=+n[2],n[3]){case"px":return e;case"%":e/=100;break}return t*e}const x1=e=>+e||0;function fd(e,t){const n={},r=Q(t),s=r?Object.keys(t):t,i=Q(e)?r?o=>K(e[o],e[t[o]]):o=>e[o]:()=>e;for(const o of s)n[o]=x1(i(o));return n}function vx(e){return fd(e,{top:"y",right:"x",bottom:"y",left:"x"})}function Gr(e){return fd(e,["topLeft","topRight","bottomLeft","bottomRight"])}function Mt(e){const t=vx(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Qe(e,t){e=e||{},t=t||ve.font;let n=K(e.size,t.size);typeof n=="string"&&(n=parseInt(n,10));let r=K(e.style,t.style);r&&!(""+r).match(g1)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const s={family:K(e.family,t.family),lineHeight:m1(K(e.lineHeight,t.lineHeight),n),size:n,style:r,weight:K(e.weight,t.weight),string:""};return s.string=u1(s),s}function mo(e,t,n,r){let s,i,o;for(s=0,i=e.length;s<i;++s)if(o=e[s],o!==void 0&&o!==void 0)return o}function v1(e,t,n){const{min:r,max:s}=e,i=ix(t,(s-r)/2),o=(a,l)=>n&&a===0?0:a+l;return{min:o(r,-Math.abs(i)),max:o(s,i)}}function hs(e,t){return Object.assign(Object.create(e),t)}function hd(e,t=[""],n,r,s=()=>e[0]){const i=n||e;typeof r>"u"&&(r=_x("_fallback",e));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:i,_fallback:r,_getTarget:s,override:a=>hd([a,...e],t,i,r)};return new Proxy(o,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return bx(a,l,()=>j1(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return bh(a).includes(l)},ownKeys(a){return bh(a)},set(a,l,c){const d=a._storage||(a._storage=s());return a[l]=d[l]=c,delete a._keys,!0}})}function ls(e,t,n,r){const s={_cacheable:!1,_proxy:e,_context:t,_subProxy:n,_stack:new Set,_descriptors:yx(e,r),setContext:i=>ls(e,i,n,r),override:i=>ls(e.override(i),t,n,r)};return new Proxy(s,{deleteProperty(i,o){return delete i[o],delete e[o],!0},get(i,o,a){return bx(i,o,()=>b1(i,o,a))},getOwnPropertyDescriptor(i,o){return i._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(i,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(i,o,a){return e[o]=a,delete i[o],!0}})}function yx(e,t={scriptable:!0,indexable:!0}){const{_scriptable:n=t.scriptable,_indexable:r=t.indexable,_allKeys:s=t.allKeys}=e;return{allKeys:s,scriptable:n,indexable:r,isScriptable:Vn(n)?n:()=>n,isIndexable:Vn(r)?r:()=>r}}const y1=(e,t)=>e?e+ad(t):t,pd=(e,t)=>Q(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function bx(e,t,n){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=n();return e[t]=r,r}function b1(e,t,n){const{_proxy:r,_context:s,_subProxy:i,_descriptors:o}=e;let a=r[t];return Vn(a)&&o.isScriptable(t)&&(a=w1(t,a,e,n)),Ee(a)&&a.length&&(a=_1(t,a,e,o.isIndexable)),pd(t,a)&&(a=ls(a,s,i&&i[t],o)),a}function w1(e,t,n,r){const{_proxy:s,_context:i,_subProxy:o,_stack:a}=n;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(i,o||r);return a.delete(e),pd(e,l)&&(l=gd(s._scopes,s,e,l)),l}function _1(e,t,n,r){const{_proxy:s,_context:i,_subProxy:o,_descriptors:a}=n;if(typeof i.index<"u"&&r(e))return t[i.index%t.length];if(Q(t[0])){const l=t,c=s._scopes.filter(d=>d!==l);t=[];for(const d of l){const f=gd(c,s,e,d);t.push(ls(f,i,o&&o[e],a))}}return t}function wx(e,t,n){return Vn(e)?e(t,n):e}const S1=(e,t)=>e===!0?t:typeof e=="string"?yr(t,e):void 0;function k1(e,t,n,r,s){for(const i of t){const o=S1(n,i);if(o){e.add(o);const a=wx(o._fallback,n,s);if(typeof a<"u"&&a!==n&&a!==r)return a}else if(o===!1&&typeof r<"u"&&n!==r)return null}return!1}function gd(e,t,n,r){const s=t._rootScopes,i=wx(t._fallback,n,r),o=[...e,...s],a=new Set;a.add(r);let l=yh(a,o,n,i||n,r);return l===null||typeof i<"u"&&i!==n&&(l=yh(a,o,i,l,r),l===null)?!1:hd(Array.from(a),[""],s,i,()=>C1(t,n,r))}function yh(e,t,n,r,s){for(;n;)n=k1(e,t,n,r,s);return n}function C1(e,t,n){const r=e._getTarget();t in r||(r[t]={});const s=r[t];return Ee(s)&&Q(n)?n:s||{}}function j1(e,t,n,r){let s;for(const i of t)if(s=_x(y1(i,e),n),typeof s<"u")return pd(e,s)?gd(n,r,e,s):s}function _x(e,t){for(const n of t){if(!n)continue;const r=n[e];if(typeof r<"u")return r}}function bh(e){let t=e._keys;return t||(t=e._keys=N1(e._scopes)),t}function N1(e){const t=new Set;for(const n of e)for(const r of Object.keys(n).filter(s=>!s.startsWith("_")))t.add(r);return Array.from(t)}function md(){return typeof window<"u"&&typeof document<"u"}function xd(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function _a(e,t,n){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[n])):r=e,r}const qa=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function E1(e,t){return qa(e).getPropertyValue(t)}const M1=["top","right","bottom","left"];function hr(e,t,n){const r={};n=n?"-"+n:"";for(let s=0;s<4;s++){const i=M1[s];r[i]=parseFloat(e[t+"-"+i+n])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const P1=(e,t,n)=>(e>0||t>0)&&(!n||!n.shadowRoot);function R1(e,t){const n=e.touches,r=n&&n.length?n[0]:e,{offsetX:s,offsetY:i}=r;let o=!1,a,l;if(P1(s,i,e.target))a=s,l=i;else{const c=t.getBoundingClientRect();a=r.clientX-c.left,l=r.clientY-c.top,o=!0}return{x:a,y:l,box:o}}function or(e,t){if("native"in e)return e;const{canvas:n,currentDevicePixelRatio:r}=t,s=qa(n),i=s.boxSizing==="border-box",o=hr(s,"padding"),a=hr(s,"border","width"),{x:l,y:c,box:d}=R1(e,n),f=o.left+(d&&a.left),h=o.top+(d&&a.top);let{width:p,height:v}=t;return i&&(p-=o.width+a.width,v-=o.height+a.height),{x:Math.round((l-f)/p*n.width/r),y:Math.round((c-h)/v*n.height/r)}}function O1(e,t,n){let r,s;if(t===void 0||n===void 0){const i=e&&xd(e);if(!i)t=e.clientWidth,n=e.clientHeight;else{const o=i.getBoundingClientRect(),a=qa(i),l=hr(a,"border","width"),c=hr(a,"padding");t=o.width-c.width-l.width,n=o.height-c.height-l.height,r=_a(a.maxWidth,i,"clientWidth"),s=_a(a.maxHeight,i,"clientHeight")}}return{width:t,height:n,maxWidth:r||xa,maxHeight:s||xa}}const Nn=e=>Math.round(e*10)/10;function D1(e,t,n,r){const s=qa(e),i=hr(s,"margin"),o=_a(s.maxWidth,e,"clientWidth")||xa,a=_a(s.maxHeight,e,"clientHeight")||xa,l=O1(e,t,n);let{width:c,height:d}=l;if(s.boxSizing==="content-box"){const h=hr(s,"border","width"),p=hr(s,"padding");c-=p.width+h.width,d-=p.height+h.height}return c=Math.max(0,c-i.width),d=Math.max(0,r?c/r:d-i.height),c=Nn(Math.min(c,o,l.maxWidth)),d=Nn(Math.min(d,a,l.maxHeight)),c&&!d&&(d=Nn(c/2)),(t!==void 0||n!==void 0)&&r&&l.height&&d>l.height&&(d=l.height,c=Nn(Math.floor(d*r))),{width:c,height:d}}function wh(e,t,n){const r=t||1,s=Nn(e.height*r),i=Nn(e.width*r);e.height=Nn(e.height),e.width=Nn(e.width);const o=e.canvas;o.style&&(n||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`);const a=Math.floor(s),l=Math.floor(i);return e.currentDevicePixelRatio!==r||o.height!==a||o.width!==l?(e.currentDevicePixelRatio=r,o.height=a,o.width=l,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const T1=function(){let e=!1;try{const t={get passive(){return e=!0,!1}};md()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e}();function _h(e,t){const n=E1(e,t),r=n&&n.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}const L1=function(e,t){return{x(n){return e+e+t-n},setWidth(n){t=n},textAlign(n){return n==="center"?n:n==="right"?"left":"right"},xPlus(n,r){return n-r},leftForLtr(n,r){return n-r}}},A1=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function qr(e,t,n){return e?L1(t,n):A1()}function Sx(e,t){let n,r;(t==="ltr"||t==="rtl")&&(n=e.canvas.style,r=[n.getPropertyValue("direction"),n.getPropertyPriority("direction")],n.setProperty("direction",t,"important"),e.prevTextDirection=r)}function kx(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function xo(e,t,n){return e.options.clip?e[n]:t[n]}function z1(e,t){const{xScale:n,yScale:r}=e;return n&&r?{left:xo(n,t,"left"),right:xo(n,t,"right"),top:xo(r,t,"top"),bottom:xo(r,t,"bottom")}:t}function I1(e,t){const n=t._clip;if(n.disabled)return!1;const r=z1(t,e.chartArea);return{left:n.left===!1?0:r.left-(n.left===!0?0:n.left),right:n.right===!1?e.width:r.right+(n.right===!0?0:n.right),top:n.top===!1?0:r.top-(n.top===!0?0:n.top),bottom:n.bottom===!1?e.height:r.bottom+(n.bottom===!0?0:n.bottom)}}/*!
78
- * Chart.js v4.6.1
79
- * https://www.chartjs.org
80
- * (c) 2026 Chart.js Contributors
81
- * Released under the MIT License
82
- */class F1{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,n,r,s){const i=n.listeners[s],o=n.duration;i.forEach(a=>a({chart:t,initial:n.initial,numSteps:o,currentStep:Math.min(r-n.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=dx.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let n=0;this._charts.forEach((r,s)=>{if(!r.running||!r.items.length)return;const i=r.items;let o=i.length-1,a=!1,l;for(;o>=0;--o)l=i[o],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(i[o]=i[i.length-1],i.pop());a&&(s.draw(),this._notify(s,r,t,"progress")),i.length||(r.running=!1,this._notify(s,r,t,"complete"),r.initial=!1),n+=i.length}),this._lastDate=t,n===0&&(this._running=!1)}_getAnims(t){const n=this._charts;let r=n.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},n.set(t,r)),r}listen(t,n,r){this._getAnims(t).listeners[n].push(r)}add(t,n){!n||!n.length||this._getAnims(t).items.push(...n)}has(t){return this._getAnims(t).items.length>0}start(t){const n=this._charts.get(t);n&&(n.running=!0,n.start=Date.now(),n.duration=n.items.reduce((r,s)=>Math.max(r,s._duration),0),this._refresh())}running(t){if(!this._running)return!1;const n=this._charts.get(t);return!(!n||!n.running||!n.items.length)}stop(t){const n=this._charts.get(t);if(!n||!n.items.length)return;const r=n.items;let s=r.length-1;for(;s>=0;--s)r[s].cancel();n.items=[],this._notify(t,n,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var Qt=new F1;const Sh="transparent",B1={boolean(e,t,n){return n>.5?t:e},color(e,t,n){const r=ph(e||Sh),s=r.valid&&ph(t||Sh);return s&&s.valid?s.mix(r,n).hexString():t},number(e,t,n){return e+(t-e)*n}};class W1{constructor(t,n,r,s){const i=n[r];s=mo([t.to,s,i,t.from]);const o=mo([t.from,i,s]);this._active=!0,this._fn=t.fn||B1[t.type||typeof o],this._easing=ti[t.easing]||ti.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=n,this._prop=r,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,n,r){if(this._active){this._notify(!1);const s=this._target[this._prop],i=r-this._start,o=this._duration-i;this._start=r,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=i,this._loop=!!t.loop,this._to=mo([t.to,n,s,t.from]),this._from=mo([t.from,s,n])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const n=t-this._start,r=this._duration,s=this._prop,i=this._from,o=this._loop,a=this._to;let l;if(this._active=i!==a&&(o||n<r),!this._active){this._target[s]=a,this._notify(!0);return}if(n<0){this._target[s]=i;return}l=n/r%2,l=o&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[s]=this._fn(i,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((n,r)=>{t.push({res:n,rej:r})})}_notify(t){const n=t?"res":"rej",r=this._promises||[];for(let s=0;s<r.length;s++)r[s][n]()}}class Cx{constructor(t,n){this._chart=t,this._properties=new Map,this.configure(n)}configure(t){if(!Q(t))return;const n=Object.keys(ve.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(s=>{const i=t[s];if(!Q(i))return;const o={};for(const a of n)o[a]=i[a];(Ee(i.properties)&&i.properties||[s]).forEach(a=>{(a===s||!r.has(a))&&r.set(a,o)})})}_animateOptions(t,n){const r=n.options,s=H1(t,r);if(!s)return[];const i=this._createAnimations(s,r);return r.$shared&&$1(t.options.$animations,r).then(()=>{t.options=r},()=>{}),i}_createAnimations(t,n){const r=this._properties,s=[],i=t.$animations||(t.$animations={}),o=Object.keys(n),a=Date.now();let l;for(l=o.length-1;l>=0;--l){const c=o[l];if(c.charAt(0)==="$")continue;if(c==="options"){s.push(...this._animateOptions(t,n));continue}const d=n[c];let f=i[c];const h=r.get(c);if(f)if(h&&f.active()){f.update(h,d,a);continue}else f.cancel();if(!h||!h.duration){t[c]=d;continue}i[c]=f=new W1(h,t,c,d),s.push(f)}return s}update(t,n){if(this._properties.size===0){Object.assign(t,n);return}const r=this._createAnimations(t,n);if(r.length)return Qt.add(this._chart,r),!0}}function $1(e,t){const n=[],r=Object.keys(t);for(let s=0;s<r.length;s++){const i=e[r[s]];i&&i.active()&&n.push(i.wait())}return Promise.all(n)}function H1(e,t){if(!t)return;let n=e.options;if(!n){e.options=t;return}return n.$shared&&(e.options=n=Object.assign({},n,{$shared:!1,$animations:{}})),n}function kh(e,t){const n=e&&e.options||{},r=n.reverse,s=n.min===void 0?t:0,i=n.max===void 0?t:0;return{start:r?i:s,end:r?s:i}}function V1(e,t,n){if(n===!1)return!1;const r=kh(e,n),s=kh(t,n);return{top:s.end,right:r.end,bottom:s.start,left:r.start}}function U1(e){let t,n,r,s;return Q(e)?(t=e.top,n=e.right,r=e.bottom,s=e.left):t=n=r=s=e,{top:t,right:n,bottom:r,left:s,disabled:e===!1}}function jx(e,t){const n=[],r=e._getSortedDatasetMetas(t);let s,i;for(s=0,i=r.length;s<i;++s)n.push(r[s].index);return n}function Ch(e,t,n,r={}){const s=e.keys,i=r.mode==="single";let o,a,l,c;if(t===null)return;let d=!1;for(o=0,a=s.length;o<a;++o){if(l=+s[o],l===n){if(d=!0,r.all)continue;break}c=e.values[l],yt(c)&&(i||t===0||Bn(t)===Bn(c))&&(t+=c)}return!d&&!r.all?0:t}function Y1(e,t){const{iScale:n,vScale:r}=t,s=n.axis==="x"?"x":"y",i=r.axis==="x"?"x":"y",o=Object.keys(e),a=new Array(o.length);let l,c,d;for(l=0,c=o.length;l<c;++l)d=o[l],a[l]={[s]:d,[i]:e[d]};return a}function Bl(e,t){const n=e&&e.options.stacked;return n||n===void 0&&t.stack!==void 0}function K1(e,t,n){return`${e.id}.${t.id}.${n.stack||n.type}`}function X1(e){const{min:t,max:n,minDefined:r,maxDefined:s}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:s?n:Number.POSITIVE_INFINITY}}function Q1(e,t,n){const r=e[t]||(e[t]={});return r[n]||(r[n]={})}function jh(e,t,n,r){for(const s of t.getMatchingVisibleMetas(r).reverse()){const i=e[s.index];if(n&&i>0||!n&&i<0)return s.index}return null}function Nh(e,t){const{chart:n,_cachedMeta:r}=e,s=n._stacks||(n._stacks={}),{iScale:i,vScale:o,index:a}=r,l=i.axis,c=o.axis,d=K1(i,o,r),f=t.length;let h;for(let p=0;p<f;++p){const v=t[p],{[l]:m,[c]:w}=v,x=v._stacks||(v._stacks={});h=x[c]=Q1(s,d,m),h[a]=w,h._top=jh(h,o,!0,r.type),h._bottom=jh(h,o,!1,r.type);const g=h._visualValues||(h._visualValues={});g[a]=w}}function Wl(e,t){const n=e.scales;return Object.keys(n).filter(r=>n[r].axis===t).shift()}function G1(e,t){return hs(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function q1(e,t,n){return hs(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:n,index:t,mode:"default",type:"data"})}function Ps(e,t){const n=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const s of t){const i=s._stacks;!i||i[r]===void 0||i[r][n]===void 0||(delete i[r][n],i[r]._visualValues!==void 0&&i[r]._visualValues[n]!==void 0&&delete i[r]._visualValues[n])}}}const $l=e=>e==="reset"||e==="none",Eh=(e,t)=>t?e:Object.assign({},e),J1=(e,t,n)=>e&&!t.hidden&&t._stacked&&{keys:jx(n,!0),values:null};class Jr{constructor(t,n){this.chart=t,this._ctx=t.ctx,this.index=n,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Bl(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Ps(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,n=this._cachedMeta,r=this.getDataset(),s=(f,h,p,v)=>f==="x"?h:f==="r"?v:p,i=n.xAxisID=K(r.xAxisID,Wl(t,"x")),o=n.yAxisID=K(r.yAxisID,Wl(t,"y")),a=n.rAxisID=K(r.rAxisID,Wl(t,"r")),l=n.indexAxis,c=n.iAxisID=s(l,i,o,a),d=n.vAxisID=s(l,o,i,a);n.xScale=this.getScaleForId(i),n.yScale=this.getScaleForId(o),n.rScale=this.getScaleForId(a),n.iScale=this.getScaleForId(c),n.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const n=this._cachedMeta;return t===n.iScale?n.vScale:n.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&dh(this._data,this),t._stacked&&Ps(t)}_dataCheck(){const t=this.getDataset(),n=t.data||(t.data=[]),r=this._data;if(Q(n)){const s=this._cachedMeta;this._data=Y1(n,s)}else if(r!==n){if(r){dh(r,this);const s=this._cachedMeta;Ps(s),s._parsed=[]}n&&Object.isExtensible(n)&&Jw(n,this),this._syncList=[],this._data=n}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const n=this._cachedMeta,r=this.getDataset();let s=!1;this._dataCheck();const i=n._stacked;n._stacked=Bl(n.vScale,n),n.stack!==r.stack&&(s=!0,Ps(n),n.stack=r.stack),this._resyncElements(t),(s||i!==n._stacked)&&(Nh(this,n._parsed),n._stacked=Bl(n.vScale,n))}configure(){const t=this.chart.config,n=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),n,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,n){const{_cachedMeta:r,_data:s}=this,{iScale:i,_stacked:o}=r,a=i.axis;let l=t===0&&n===s.length?!0:r._sorted,c=t>0&&r._parsed[t-1],d,f,h;if(this._parsing===!1)r._parsed=s,r._sorted=!0,h=s;else{Ee(s[t])?h=this.parseArrayData(r,s,t,n):Q(s[t])?h=this.parseObjectData(r,s,t,n):h=this.parsePrimitiveData(r,s,t,n);const p=()=>f[a]===null||c&&f[a]<c[a];for(d=0;d<n;++d)r._parsed[d+t]=f=h[d],l&&(p()&&(l=!1),c=f);r._sorted=l}o&&Nh(this,h)}parsePrimitiveData(t,n,r,s){const{iScale:i,vScale:o}=t,a=i.axis,l=o.axis,c=i.getLabels(),d=i===o,f=new Array(s);let h,p,v;for(h=0,p=s;h<p;++h)v=h+r,f[h]={[a]:d||i.parse(c[v],v),[l]:o.parse(n[v],v)};return f}parseArrayData(t,n,r,s){const{xScale:i,yScale:o}=t,a=new Array(s);let l,c,d,f;for(l=0,c=s;l<c;++l)d=l+r,f=n[d],a[l]={x:i.parse(f[0],d),y:o.parse(f[1],d)};return a}parseObjectData(t,n,r,s){const{xScale:i,yScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=new Array(s);let d,f,h,p;for(d=0,f=s;d<f;++d)h=d+r,p=n[h],c[d]={x:i.parse(yr(p,a),h),y:o.parse(yr(p,l),h)};return c}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,n,r){const s=this.chart,i=this._cachedMeta,o=n[t.axis],a={keys:jx(s,!0),values:n._stacks[t.axis]._visualValues};return Ch(a,o,i.index,{mode:r})}updateRangeFromParsed(t,n,r,s){const i=r[n.axis];let o=i===null?NaN:i;const a=s&&r._stacks[n.axis];s&&a&&(s.values=a,o=Ch(s,i,this._cachedMeta.index)),t.min=Math.min(t.min,o),t.max=Math.max(t.max,o)}getMinMax(t,n){const r=this._cachedMeta,s=r._parsed,i=r._sorted&&t===r.iScale,o=s.length,a=this._getOtherScale(t),l=J1(n,r,this.chart),c={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:f}=X1(a);let h,p;function v(){p=s[h];const m=p[a.axis];return!yt(p[t.axis])||d>m||f<m}for(h=0;h<o&&!(!v()&&(this.updateRangeFromParsed(c,t,p,l),i));++h);if(i){for(h=o-1;h>=0;--h)if(!v()){this.updateRangeFromParsed(c,t,p,l);break}}return c}getAllParsedValues(t){const n=this._cachedMeta._parsed,r=[];let s,i,o;for(s=0,i=n.length;s<i;++s)o=n[s][t.axis],yt(o)&&r.push(o);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const n=this._cachedMeta,r=n.iScale,s=n.vScale,i=this.getParsed(t);return{label:r?""+r.getLabelForValue(i[r.axis]):"",value:s?""+s.getLabelForValue(i[s.axis]):""}}_update(t){const n=this._cachedMeta;this.update(t||"default"),n._clip=U1(K(this.options.clip,V1(n.xScale,n.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,n=this.chart,r=this._cachedMeta,s=r.data||[],i=n.chartArea,o=[],a=this._drawStart||0,l=this._drawCount||s.length-a,c=this.options.drawActiveElementsOnTop;let d;for(r.dataset&&r.dataset.draw(t,i,a,l),d=a;d<a+l;++d){const f=s[d];f.hidden||(f.active&&c?o.push(f):f.draw(t,i))}for(d=0;d<o.length;++d)o[d].draw(t,i)}getStyle(t,n){const r=n?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,n,r){const s=this.getDataset();let i;if(t>=0&&t<this._cachedMeta.data.length){const o=this._cachedMeta.data[t];i=o.$context||(o.$context=q1(this.getContext(),t,o)),i.parsed=this.getParsed(t),i.raw=s.data[t],i.index=i.dataIndex=t}else i=this.$context||(this.$context=G1(this.chart.getContext(),this.index)),i.dataset=s,i.index=i.datasetIndex=this.index;return i.active=!!n,i.mode=r,i}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,n){return this._resolveElementOptions(this.dataElementType.id,n,t)}_resolveElementOptions(t,n="default",r){const s=n==="active",i=this._cachedDataOpts,o=t+"-"+n,a=i[o],l=this.enableOptionSharing&&Ni(r);if(a)return Eh(a,l);const c=this.chart.config,d=c.datasetElementScopeKeys(this._type,t),f=s?[`${t}Hover`,"hover",t,""]:[t,""],h=c.getOptionScopes(this.getDataset(),d),p=Object.keys(ve.elements[t]),v=()=>this.getContext(r,s,n),m=c.resolveNamedOptions(h,p,v,f);return m.$shared&&(m.$shared=l,i[o]=Object.freeze(Eh(m,l))),m}_resolveAnimations(t,n,r){const s=this.chart,i=this._cachedDataOpts,o=`animation-${n}`,a=i[o];if(a)return a;let l;if(s.options.animation!==!1){const d=this.chart.config,f=d.datasetAnimationScopeKeys(this._type,n),h=d.getOptionScopes(this.getDataset(),f);l=d.createResolver(h,this.getContext(t,r,n))}const c=new Cx(s,l&&l.animations);return l&&l._cacheable&&(i[o]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,n){return!n||$l(t)||this.chart._animationsDisabled}_getSharedOptions(t,n){const r=this.resolveDataElementOptions(t,n),s=this._sharedOptions,i=this.getSharedOptions(r),o=this.includeOptions(n,i)||i!==s;return this.updateSharedOptions(i,n,r),{sharedOptions:i,includeOptions:o}}updateElement(t,n,r,s){$l(s)?Object.assign(t,r):this._resolveAnimations(n,s).update(t,r)}updateSharedOptions(t,n,r){t&&!$l(n)&&this._resolveAnimations(void 0,n).update(t,r)}_setStyle(t,n,r,s){t.active=s;const i=this.getStyle(n,s);this._resolveAnimations(n,r,s).update(t,{options:!s&&this.getSharedOptions(i)||i})}removeHoverStyle(t,n,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,n,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const n=this._data,r=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const s=r.length,i=n.length,o=Math.min(i,s);o&&this.parse(0,o),i>s?this._insertElements(s,i-s,t):i<s&&this._removeElements(i,s-i)}_insertElements(t,n,r=!0){const s=this._cachedMeta,i=s.data,o=t+n;let a;const l=c=>{for(c.length+=n,a=c.length-1;a>=o;a--)c[a]=c[a-n]};for(l(i),a=t;a<o;++a)i[a]=new this.dataElementType;this._parsing&&l(s._parsed),this.parse(t,n),r&&this.updateElements(i,t,n,"reset")}updateElements(t,n,r,s){}_removeElements(t,n){const r=this._cachedMeta;if(this._parsing){const s=r._parsed.splice(t,n);r._stacked&&Ps(r,s)}r.data.splice(t,n)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[n,r,s]=t;this[n](r,s)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,n){n&&this._sync(["_removeElements",t,n]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}I(Jr,"defaults",{}),I(Jr,"datasetElementType",null),I(Jr,"dataElementType",null);function Z1(e,t){if(!e._cache.$bar){const n=e.getMatchingVisibleMetas(t);let r=[];for(let s=0,i=n.length;s<i;s++)r=r.concat(n[s].controller.getAllParsedValues(e));e._cache.$bar=ux(r.sort((s,i)=>s-i))}return e._cache.$bar}function e_(e){const t=e.iScale,n=Z1(t,e.type);let r=t._length,s,i,o,a;const l=()=>{o===32767||o===-32768||(Ni(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,i=n.length;s<i;++s)o=t.getPixelForValue(n[s]),l();for(a=void 0,s=0,i=t.ticks.length;s<i;++s)o=t.getPixelForTick(s),l();return r}function t_(e,t,n,r){const s=n.barThickness;let i,o;return ne(s)?(i=t.min*n.categoryPercentage,o=n.barPercentage):(i=s*r,o=1),{chunk:i/r,ratio:o,start:t.pixels[e]-i/2}}function n_(e,t,n,r){const s=t.pixels,i=s[e];let o=e>0?s[e-1]:null,a=e<s.length-1?s[e+1]:null;const l=n.categoryPercentage;o===null&&(o=i-(a===null?t.end-t.start:a-i)),a===null&&(a=i+i-o);const c=i-(i-Math.min(o,a))/2*l;return{chunk:Math.abs(a-o)/2*l/r,ratio:n.barPercentage,start:c}}function r_(e,t,n,r){const s=n.parse(e[0],r),i=n.parse(e[1],r),o=Math.min(s,i),a=Math.max(s,i);let l=o,c=a;Math.abs(o)>Math.abs(a)&&(l=a,c=o),t[n.axis]=c,t._custom={barStart:l,barEnd:c,start:s,end:i,min:o,max:a}}function Nx(e,t,n,r){return Ee(e)?r_(e,t,n,r):t[n.axis]=n.parse(e,r),t}function Mh(e,t,n,r){const s=e.iScale,i=e.vScale,o=s.getLabels(),a=s===i,l=[];let c,d,f,h;for(c=n,d=n+r;c<d;++c)h=t[c],f={},f[s.axis]=a||s.parse(o[c],c),l.push(Nx(h,f,i,c));return l}function Hl(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function s_(e,t,n){return e!==0?Bn(e):(t.isHorizontal()?1:-1)*(t.min>=n?1:-1)}function i_(e){let t,n,r,s,i;return e.horizontal?(t=e.base>e.x,n="left",r="right"):(t=e.base<e.y,n="bottom",r="top"),t?(s="end",i="start"):(s="start",i="end"),{start:n,end:r,reverse:t,top:s,bottom:i}}function o_(e,t,n,r){let s=t.borderSkipped;const i={};if(!s){e.borderSkipped=i;return}if(s===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:a,reverse:l,top:c,bottom:d}=i_(e);s==="middle"&&n&&(e.enableBorderRadius=!0,(n._top||0)===r?s=c:(n._bottom||0)===r?s=d:(i[Ph(d,o,a,l)]=!0,s=c)),i[Ph(s,o,a,l)]=!0,e.borderSkipped=i}function Ph(e,t,n,r){return r?(e=a_(e,t,n),e=Rh(e,n,t)):e=Rh(e,t,n),e}function a_(e,t,n){return e===t?n:e===n?t:e}function Rh(e,t,n){return e==="start"?t:e==="end"?n:e}function l_(e,{inflateAmount:t},n){e.inflateAmount=t==="auto"?n===1?.33:0:t}class Io extends Jr{parsePrimitiveData(t,n,r,s){return Mh(t,n,r,s)}parseArrayData(t,n,r,s){return Mh(t,n,r,s)}parseObjectData(t,n,r,s){const{iScale:i,vScale:o}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,c=i.axis==="x"?a:l,d=o.axis==="x"?a:l,f=[];let h,p,v,m;for(h=r,p=r+s;h<p;++h)m=n[h],v={},v[i.axis]=i.parse(yr(m,c),h),f.push(Nx(yr(m,d),v,o,h));return f}updateRangeFromParsed(t,n,r,s){super.updateRangeFromParsed(t,n,r,s);const i=r._custom;i&&n===this._cachedMeta.vScale&&(t.min=Math.min(t.min,i.min),t.max=Math.max(t.max,i.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const n=this._cachedMeta,{iScale:r,vScale:s}=n,i=this.getParsed(t),o=i._custom,a=Hl(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(i[s.axis]);return{label:""+r.getLabelForValue(i[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const n=this._cachedMeta;this.updateElements(n.data,0,n.data.length,t)}updateElements(t,n,r,s){const i=s==="reset",{index:o,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),c=a.isHorizontal(),d=this._getRuler(),{sharedOptions:f,includeOptions:h}=this._getSharedOptions(n,s);for(let p=n;p<n+r;p++){const v=this.getParsed(p),m=i||ne(v[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(p),w=this._calculateBarIndexPixels(p,d),x=(v._stacks||{})[a.axis],g={horizontal:c,base:m.base,enableBorderRadius:!x||Hl(v._custom)||o===x._top||o===x._bottom,x:c?m.head:w.center,y:c?w.center:m.head,height:c?w.size:Math.abs(m.size),width:c?Math.abs(m.size):w.size};h&&(g.options=f||this.resolveDataElementOptions(p,t[p].active?"active":s));const y=g.options||t[p].options;o_(g,y,x,o),l_(g,y,d.ratio),this.updateElement(t[p],p,g,s)}}_getStacks(t,n){const{iScale:r}=this._cachedMeta,s=r.getMatchingVisibleMetas(this._type).filter(d=>d.controller.options.grouped),i=r.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(n),l=a&&a[r.axis],c=d=>{const f=d._parsed.find(p=>p[r.axis]===l),h=f&&f[d.vScale.axis];if(ne(h)||isNaN(h))return!0};for(const d of s)if(!(n!==void 0&&c(d))&&((i===!1||o.indexOf(d.stack)===-1||i===void 0&&d.stack===void 0)&&o.push(d.stack),d.index===t))break;return o.length||o.push(void 0),o}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,n=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===n).shift()}_getAxis(){const t={},n=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[K(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,n)]=!0;return Object.keys(t)}_getStackIndex(t,n,r){const s=this._getStacks(t,r),i=n!==void 0?s.indexOf(n):-1;return i===-1?s.length-1:i}_getRuler(){const t=this.options,n=this._cachedMeta,r=n.iScale,s=[];let i,o;for(i=0,o=n.data.length;i<o;++i)s.push(r.getPixelForValue(this.getParsed(i)[r.axis],i));const a=t.barThickness;return{min:a||e_(n),pixels:s,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:n,_stacked:r,index:s},options:{base:i,minBarLength:o}}=this,a=i||0,l=this.getParsed(t),c=l._custom,d=Hl(c);let f=l[n.axis],h=0,p=r?this.applyStack(n,l,r):f,v,m;p!==f&&(h=p-f,p=f),d&&(f=c.barStart,p=c.barEnd-c.barStart,f!==0&&Bn(f)!==Bn(c.barEnd)&&(h=0),h+=f);const w=!ne(i)&&!d?i:h;let x=n.getPixelForValue(w);if(this.chart.getDataVisibility(t)?v=n.getPixelForValue(h+p):v=x,m=v-x,Math.abs(m)<o){m=s_(m,n,a)*o,f===a&&(x-=m/2);const g=n.getPixelForDecimal(0),y=n.getPixelForDecimal(1),_=Math.min(g,y),k=Math.max(g,y);x=Math.max(Math.min(x,k),_),v=x+m,r&&!d&&(l._stacks[n.axis]._visualValues[s]=n.getValueForPixel(v)-n.getValueForPixel(x))}if(x===n.getPixelForValue(a)){const g=Bn(m)*n.getLineWidthForValue(a)/2;x+=g,m-=g}return{size:m,base:x,head:v,center:v+m/2}}_calculateBarIndexPixels(t,n){const r=n.scale,s=this.options,i=s.skipNull,o=K(s.maxBarThickness,1/0);let a,l;const c=this._getAxisCount();if(n.grouped){const d=i?this._getStackCount(t):n.stackCount,f=s.barThickness==="flex"?n_(t,n,s,d*c):t_(t,n,s,d*c),h=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,p=this._getAxis().indexOf(K(h,this.getFirstScaleIdForIndexAxis())),v=this._getStackIndex(this.index,this._cachedMeta.stack,i?t:void 0)+p;a=f.start+f.chunk*v+f.chunk/2,l=Math.min(o,f.chunk*f.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(o,n.min*n.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,n=t.vScale,r=t.data,s=r.length;let i=0;for(;i<s;++i)this.getParsed(i)[n.axis]!==null&&!r[i].hidden&&r[i].draw(this._ctx)}}I(Io,"id","bar"),I(Io,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),I(Io,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});function c_(e,t,n){let r=1,s=1,i=0,o=0;if(t<ue){const a=e,l=a+t,c=Math.cos(a),d=Math.sin(a),f=Math.cos(l),h=Math.sin(l),p=(y,_,k)=>ya(y,a,l,!0)?1:Math.max(_,_*n,k,k*n),v=(y,_,k)=>ya(y,a,l,!0)?-1:Math.min(_,_*n,k,k*n),m=p(0,c,f),w=p(ke,d,h),x=v(ae,c,f),g=v(ae+ke,d,h);r=(m-x)/2,s=(w-g)/2,i=-(m+x)/2,o=-(w+g)/2}return{ratioX:r,ratioY:s,offsetX:i,offsetY:o}}class Ws extends Jr{constructor(t,n){super(t,n),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,n){const r=this.getDataset().data,s=this._cachedMeta;if(this._parsing===!1)s._parsed=r;else{let i=l=>+r[l];if(Q(r[t])){const{key:l="value"}=this._parsing;i=c=>+yr(r[c],l)}let o,a;for(o=t,a=t+n;o<a;++o)s._parsed[o]=i(o)}}_getRotation(){return nn(this.options.rotation-90)}_getCircumference(){return nn(this.options.circumference)}_getRotationExtents(){let t=ue,n=-ue;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const s=this.chart.getDatasetMeta(r).controller,i=s._getRotation(),o=s._getCircumference();t=Math.min(t,i),n=Math.max(n,i+o)}return{rotation:t,circumference:n-t}}update(t){const n=this.chart,{chartArea:r}=n,s=this._cachedMeta,i=s.data,o=this.getMaxBorderWidth()+this.getMaxOffset(i)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-o)/2,0),l=Math.min(Aw(this.options.cutout,a),1),c=this._getRingWeight(this.index),{circumference:d,rotation:f}=this._getRotationExtents(),{ratioX:h,ratioY:p,offsetX:v,offsetY:m}=c_(f,d,l),w=(r.width-o)/h,x=(r.height-o)/p,g=Math.max(Math.min(w,x)/2,0),y=ix(this.options.radius,g),_=Math.max(y*l,0),k=(y-_)/this._getVisibleDatasetWeightTotal();this.offsetX=v*y,this.offsetY=m*y,s.total=this.calculateTotal(),this.outerRadius=y-k*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-k*c,0),this.updateElements(i,0,i.length,t)}_circumference(t,n){const r=this.options,s=this._cachedMeta,i=this._getCircumference();return n&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||s._parsed[t]===null||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*i/ue)}updateElements(t,n,r,s){const i=s==="reset",o=this.chart,a=o.chartArea,c=o.options.animation,d=(a.left+a.right)/2,f=(a.top+a.bottom)/2,h=i&&c.animateScale,p=h?0:this.innerRadius,v=h?0:this.outerRadius,{sharedOptions:m,includeOptions:w}=this._getSharedOptions(n,s);let x=this._getRotation(),g;for(g=0;g<n;++g)x+=this._circumference(g,i);for(g=n;g<n+r;++g){const y=this._circumference(g,i),_=t[g],k={x:d+this.offsetX,y:f+this.offsetY,startAngle:x,endAngle:x+y,circumference:y,outerRadius:v,innerRadius:p};w&&(k.options=m||this.resolveDataElementOptions(g,_.active?"active":s)),x+=y,this.updateElement(_,g,k,s)}}calculateTotal(){const t=this._cachedMeta,n=t.data;let r=0,s;for(s=0;s<n.length;s++){const i=t._parsed[s];i!==null&&!isNaN(i)&&this.chart.getDataVisibility(s)&&!n[s].hidden&&(r+=Math.abs(i))}return r}calculateCircumference(t){const n=this._cachedMeta.total;return n>0&&!isNaN(t)?ue*(Math.abs(t)/n):0}getLabelAndValue(t){const n=this._cachedMeta,r=this.chart,s=r.data.labels||[],i=cd(n._parsed[t],r.options.locale);return{label:s[t]||"",value:i}}getMaxBorderWidth(t){let n=0;const r=this.chart;let s,i,o,a,l;if(!t){for(s=0,i=r.data.datasets.length;s<i;++s)if(r.isDatasetVisible(s)){o=r.getDatasetMeta(s),t=o.data,a=o.controller;break}}if(!t)return 0;for(s=0,i=t.length;s<i;++s)l=a.resolveDataElementOptions(s),l.borderAlign!=="inner"&&(n=Math.max(n,l.borderWidth||0,l.hoverBorderWidth||0));return n}getMaxOffset(t){let n=0;for(let r=0,s=t.length;r<s;++r){const i=this.resolveDataElementOptions(r);n=Math.max(n,i.offset||0,i.hoverOffset||0)}return n}_getRingWeightOffset(t){let n=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(n+=this._getRingWeight(r));return n}_getRingWeight(t){return Math.max(K(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}I(Ws,"id","doughnut"),I(Ws,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,spacingMode:"angular",indexAxis:"r"}),I(Ws,"descriptors",{_scriptable:t=>t!=="spacing"&&t!=="spacingMode",_indexable:t=>t!=="spacing"&&t!=="spacingMode"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),I(Ws,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const n=t.data,{labels:{pointStyle:r,textAlign:s,color:i,useBorderRadius:o,borderRadius:a}}=t.legend.options;return n.labels.length&&n.datasets.length?n.labels.map((l,c)=>{const f=t.getDatasetMeta(0).controller.getStyle(c);return{text:l,fillStyle:f.backgroundColor,fontColor:i,hidden:!t.getDataVisibility(c),lineDash:f.borderDash,lineDashOffset:f.borderDashOffset,lineJoin:f.borderJoinStyle,lineWidth:f.borderWidth,strokeStyle:f.borderColor,textAlign:s,pointStyle:r,borderRadius:o&&(a||f.borderRadius),index:c}}):[]}},onClick(t,n,r){r.chart.toggleDataVisibility(n.index),r.chart.update()}}}});function nr(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class vd{constructor(t){I(this,"options");this.options=t||{}}static override(t){Object.assign(vd.prototype,t)}init(){}formats(){return nr()}parse(){return nr()}format(){return nr()}add(){return nr()}diff(){return nr()}startOf(){return nr()}endOf(){return nr()}}var u_={_date:vd};function d_(e,t,n,r){const{controller:s,data:i,_sorted:o}=e,a=s._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&o&&i.length){const c=a._reversePixels?Gw:Zc;if(r){if(s._sharedOptions){const d=i[0],f=typeof d.getRange=="function"&&d.getRange(t);if(f){const h=c(i,t,n-f),p=c(i,t,n+f);return{lo:h.lo,hi:p.hi}}}}else{const d=c(i,t,n);if(l){const{vScale:f}=s._cachedMeta,{_parsed:h}=e,p=h.slice(0,d.lo+1).reverse().findIndex(m=>!ne(m[f.axis]));d.lo-=Math.max(0,p);const v=h.slice(d.hi).findIndex(m=>!ne(m[f.axis]));d.hi+=Math.max(0,v)}return d}}return{lo:0,hi:i.length-1}}function Ja(e,t,n,r,s){const i=e.getSortedVisibleDatasetMetas(),o=n[t];for(let a=0,l=i.length;a<l;++a){const{index:c,data:d}=i[a],{lo:f,hi:h}=d_(i[a],t,o,s);for(let p=f;p<=h;++p){const v=d[p];v.skip||r(v,c,p)}}}function f_(e){const t=e.indexOf("x")!==-1,n=e.indexOf("y")!==-1;return function(r,s){const i=t?Math.abs(r.x-s.x):0,o=n?Math.abs(r.y-s.y):0;return Math.sqrt(Math.pow(i,2)+Math.pow(o,2))}}function Vl(e,t,n,r,s){const i=[];return!s&&!e.isPointInArea(t)||Ja(e,n,t,function(a,l,c){!s&&!xx(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&i.push({element:a,datasetIndex:l,index:c})},!0),i}function h_(e,t,n,r){let s=[];function i(o,a,l){const{startAngle:c,endAngle:d}=o.getProps(["startAngle","endAngle"],r),{angle:f}=lx(o,{x:t.x,y:t.y});ya(f,c,d)&&s.push({element:o,datasetIndex:a,index:l})}return Ja(e,n,t,i),s}function p_(e,t,n,r,s,i){let o=[];const a=f_(n);let l=Number.POSITIVE_INFINITY;function c(d,f,h){const p=d.inRange(t.x,t.y,s);if(r&&!p)return;const v=d.getCenterPoint(s);if(!(!!i||e.isPointInArea(v))&&!p)return;const w=a(t,v);w<l?(o=[{element:d,datasetIndex:f,index:h}],l=w):w===l&&o.push({element:d,datasetIndex:f,index:h})}return Ja(e,n,t,c),o}function Ul(e,t,n,r,s,i){return!i&&!e.isPointInArea(t)?[]:n==="r"&&!r?h_(e,t,n,s):p_(e,t,n,r,s,i)}function Oh(e,t,n,r,s){const i=[],o=n==="x"?"inXRange":"inYRange";let a=!1;return Ja(e,n,t,(l,c,d)=>{l[o]&&l[o](t[n],s)&&(i.push({element:l,datasetIndex:c,index:d}),a=a||l.inRange(t.x,t.y,s))}),r&&!a?[]:i}var g_={modes:{index(e,t,n,r){const s=or(t,e),i=n.axis||"x",o=n.includeInvisible||!1,a=n.intersect?Vl(e,s,i,r,o):Ul(e,s,i,!1,r,o),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(c=>{const d=a[0].index,f=c.data[d];f&&!f.skip&&l.push({element:f,datasetIndex:c.index,index:d})}),l):[]},dataset(e,t,n,r){const s=or(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;let a=n.intersect?Vl(e,s,i,r,o):Ul(e,s,i,!1,r,o);if(a.length>0){const l=a[0].datasetIndex,c=e.getDatasetMeta(l).data;a=[];for(let d=0;d<c.length;++d)a.push({element:c[d],datasetIndex:l,index:d})}return a},point(e,t,n,r){const s=or(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;return Vl(e,s,i,r,o)},nearest(e,t,n,r){const s=or(t,e),i=n.axis||"xy",o=n.includeInvisible||!1;return Ul(e,s,i,n.intersect,r,o)},x(e,t,n,r){const s=or(t,e);return Oh(e,s,"x",n.intersect,r)},y(e,t,n,r){const s=or(t,e);return Oh(e,s,"y",n.intersect,r)}}};const Ex=["left","top","right","bottom"];function Rs(e,t){return e.filter(n=>n.pos===t)}function Dh(e,t){return e.filter(n=>Ex.indexOf(n.pos)===-1&&n.box.axis===t)}function Os(e,t){return e.sort((n,r)=>{const s=t?r:n,i=t?n:r;return s.weight===i.weight?s.index-i.index:s.weight-i.weight})}function m_(e){const t=[];let n,r,s,i,o,a;for(n=0,r=(e||[]).length;n<r;++n)s=e[n],{position:i,options:{stack:o,stackWeight:a=1}}=s,t.push({index:n,box:s,pos:i,horizontal:s.isHorizontal(),weight:s.weight,stack:o&&i+o,stackWeight:a});return t}function x_(e){const t={};for(const n of e){const{stack:r,pos:s,stackWeight:i}=n;if(!r||!Ex.includes(s))continue;const o=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=i}return t}function v_(e,t){const n=x_(e),{vBoxMaxWidth:r,hBoxMaxHeight:s}=t;let i,o,a;for(i=0,o=e.length;i<o;++i){a=e[i];const{fullSize:l}=a.box,c=n[a.stack],d=c&&a.stackWeight/c.weight;a.horizontal?(a.width=d?d*r:l&&t.availableWidth,a.height=s):(a.width=r,a.height=d?d*s:l&&t.availableHeight)}return n}function y_(e){const t=m_(e),n=Os(t.filter(c=>c.box.fullSize),!0),r=Os(Rs(t,"left"),!0),s=Os(Rs(t,"right")),i=Os(Rs(t,"top"),!0),o=Os(Rs(t,"bottom")),a=Dh(t,"x"),l=Dh(t,"y");return{fullSize:n,leftAndTop:r.concat(i),rightAndBottom:s.concat(l).concat(o).concat(a),chartArea:Rs(t,"chartArea"),vertical:r.concat(s).concat(l),horizontal:i.concat(o).concat(a)}}function Th(e,t,n,r){return Math.max(e[n],t[n])+Math.max(e[r],t[r])}function Mx(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function b_(e,t,n,r){const{pos:s,box:i}=n,o=e.maxPadding;if(!Q(s)){n.size&&(e[s]-=n.size);const f=r[n.stack]||{size:0,count:1};f.size=Math.max(f.size,n.horizontal?i.height:i.width),n.size=f.size/f.count,e[s]+=n.size}i.getPadding&&Mx(o,i.getPadding());const a=Math.max(0,t.outerWidth-Th(o,e,"left","right")),l=Math.max(0,t.outerHeight-Th(o,e,"top","bottom")),c=a!==e.w,d=l!==e.h;return e.w=a,e.h=l,n.horizontal?{same:c,other:d}:{same:d,other:c}}function w_(e){const t=e.maxPadding;function n(r){const s=Math.max(t[r]-e[r],0);return e[r]+=s,s}e.y+=n("top"),e.x+=n("left"),n("right"),n("bottom")}function __(e,t){const n=t.maxPadding;function r(s){const i={left:0,top:0,right:0,bottom:0};return s.forEach(o=>{i[o]=Math.max(t[o],n[o])}),i}return r(e?["left","right"]:["top","bottom"])}function $s(e,t,n,r){const s=[];let i,o,a,l,c,d;for(i=0,o=e.length,c=0;i<o;++i){a=e[i],l=a.box,l.update(a.width||t.w,a.height||t.h,__(a.horizontal,t));const{same:f,other:h}=b_(t,n,a,r);c|=f&&s.length,d=d||h,l.fullSize||s.push(a)}return c&&$s(s,t,n,r)||d}function vo(e,t,n,r,s){e.top=n,e.left=t,e.right=t+r,e.bottom=n+s,e.width=r,e.height=s}function Lh(e,t,n,r){const s=n.padding;let{x:i,y:o}=t;for(const a of e){const l=a.box,c=r[a.stack]||{placed:0,weight:1},d=a.stackWeight/c.weight||1;if(a.horizontal){const f=t.w*d,h=c.size||l.height;Ni(c.start)&&(o=c.start),l.fullSize?vo(l,s.left,o,n.outerWidth-s.right-s.left,h):vo(l,t.left+c.placed,o,f,h),c.start=o,c.placed+=f,o=l.bottom}else{const f=t.h*d,h=c.size||l.width;Ni(c.start)&&(i=c.start),l.fullSize?vo(l,i,s.top,h,n.outerHeight-s.bottom-s.top):vo(l,i,t.top+c.placed,h,f),c.start=i,c.placed+=f,i=l.right}}t.x=i,t.y=o}var En={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(n){t.draw(n)}}]},e.boxes.push(t)},removeBox(e,t){const n=e.boxes?e.boxes.indexOf(t):-1;n!==-1&&e.boxes.splice(n,1)},configure(e,t,n){t.fullSize=n.fullSize,t.position=n.position,t.weight=n.weight},update(e,t,n,r){if(!e)return;const s=Mt(e.options.layout.padding),i=Math.max(t-s.width,0),o=Math.max(n-s.height,0),a=y_(e.boxes),l=a.vertical,c=a.horizontal;Z(e.boxes,m=>{typeof m.beforeLayout=="function"&&m.beforeLayout()});const d=l.reduce((m,w)=>w.box.options&&w.box.options.display===!1?m:m+1,0)||1,f=Object.freeze({outerWidth:t,outerHeight:n,padding:s,availableWidth:i,availableHeight:o,vBoxMaxWidth:i/2/d,hBoxMaxHeight:o/2}),h=Object.assign({},s);Mx(h,Mt(r));const p=Object.assign({maxPadding:h,w:i,h:o,x:s.left,y:s.top},s),v=v_(l.concat(c),f);$s(a.fullSize,p,f,v),$s(l,p,f,v),$s(c,p,f,v)&&$s(l,p,f,v),w_(p),Lh(a.leftAndTop,p,f,v),p.x+=p.w,p.y+=p.h,Lh(a.rightAndBottom,p,f,v),e.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},Z(a.chartArea,m=>{const w=m.box;Object.assign(w,e.chartArea),w.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Px{acquireContext(t,n){}releaseContext(t){return!1}addEventListener(t,n,r){}removeEventListener(t,n,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,n,r,s){return n=Math.max(0,n||t.width),r=r||t.height,{width:n,height:Math.max(0,s?Math.floor(n/s):r)}}isAttached(t){return!0}updateConfig(t){}}class S_ extends Px{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Fo="$chartjs",k_={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Ah=e=>e===null||e==="";function C_(e,t){const n=e.style,r=e.getAttribute("height"),s=e.getAttribute("width");if(e[Fo]={initial:{height:r,width:s,style:{display:n.display,height:n.height,width:n.width}}},n.display=n.display||"block",n.boxSizing=n.boxSizing||"border-box",Ah(s)){const i=_h(e,"width");i!==void 0&&(e.width=i)}if(Ah(r))if(e.style.height==="")e.height=e.width/(t||2);else{const i=_h(e,"height");i!==void 0&&(e.height=i)}return e}const Rx=T1?{passive:!0}:!1;function j_(e,t,n){e&&e.addEventListener(t,n,Rx)}function N_(e,t,n){e&&e.canvas&&e.canvas.removeEventListener(t,n,Rx)}function E_(e,t){const n=k_[e.type]||e.type,{x:r,y:s}=or(e,t);return{type:n,chart:t,native:e,x:r!==void 0?r:null,y:s!==void 0?s:null}}function Sa(e,t){for(const n of e)if(n===t||n.contains(t))return!0}function M_(e,t,n){const r=e.canvas,s=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Sa(a.addedNodes,r),o=o&&!Sa(a.removedNodes,r);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}function P_(e,t,n){const r=e.canvas,s=new MutationObserver(i=>{let o=!1;for(const a of i)o=o||Sa(a.removedNodes,r),o=o&&!Sa(a.addedNodes,r);o&&n()});return s.observe(document,{childList:!0,subtree:!0}),s}const Ei=new Map;let zh=0;function Ox(){const e=window.devicePixelRatio;e!==zh&&(zh=e,Ei.forEach((t,n)=>{n.currentDevicePixelRatio!==e&&t()}))}function R_(e,t){Ei.size||window.addEventListener("resize",Ox),Ei.set(e,t)}function O_(e){Ei.delete(e),Ei.size||window.removeEventListener("resize",Ox)}function D_(e,t,n){const r=e.canvas,s=r&&xd(r);if(!s)return;const i=fx((a,l)=>{const c=s.clientWidth;n(a,l),c<s.clientWidth&&n()},window),o=new ResizeObserver(a=>{const l=a[0],c=l.contentRect.width,d=l.contentRect.height;c===0&&d===0||i(c,d)});return o.observe(s),R_(e,i),o}function Yl(e,t,n){n&&n.disconnect(),t==="resize"&&O_(e)}function T_(e,t,n){const r=e.canvas,s=fx(i=>{e.ctx!==null&&n(E_(i,e))},e);return j_(r,t,s),s}class L_ extends Px{acquireContext(t,n){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(C_(t,n),r):null}releaseContext(t){const n=t.canvas;if(!n[Fo])return!1;const r=n[Fo].initial;["height","width"].forEach(i=>{const o=r[i];ne(o)?n.removeAttribute(i):n.setAttribute(i,o)});const s=r.style||{};return Object.keys(s).forEach(i=>{n.style[i]=s[i]}),n.width=n.width,delete n[Fo],!0}addEventListener(t,n,r){this.removeEventListener(t,n);const s=t.$proxies||(t.$proxies={}),o={attach:M_,detach:P_,resize:D_}[n]||T_;s[n]=o(t,n,r)}removeEventListener(t,n){const r=t.$proxies||(t.$proxies={}),s=r[n];if(!s)return;({attach:Yl,detach:Yl,resize:Yl}[n]||N_)(t,n,s),r[n]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,n,r,s){return D1(t,n,r,s)}isAttached(t){const n=t&&xd(t);return!!(n&&n.isConnected)}}function A_(e){return!md()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?S_:L_}class Un{constructor(){I(this,"x");I(this,"y");I(this,"active",!1);I(this,"options");I(this,"$animations")}tooltipPosition(t){const{x:n,y:r}=this.getProps(["x","y"],t);return{x:n,y:r}}hasValue(){return va(this.x)&&va(this.y)}getProps(t,n){const r=this.$animations;if(!n||!r)return this;const s={};return t.forEach(i=>{s[i]=r[i]&&r[i].active()?r[i]._to:this[i]}),s}}I(Un,"defaults",{}),I(Un,"defaultRoutes");function z_(e,t){const n=e.options.ticks,r=I_(e),s=Math.min(n.maxTicksLimit||r,r),i=n.major.enabled?B_(t):[],o=i.length,a=i[0],l=i[o-1],c=[];if(o>s)return W_(t,c,i,o/s),c;const d=F_(i,t,s);if(o>0){let f,h;const p=o>1?Math.round((l-a)/(o-1)):null;for(yo(t,c,d,ne(p)?0:a-p,a),f=0,h=o-1;f<h;f++)yo(t,c,d,i[f],i[f+1]);return yo(t,c,d,l,ne(p)?t.length:l+p),c}return yo(t,c,d),c}function I_(e){const t=e.options.offset,n=e._tickSize(),r=e._length/n+(t?0:1),s=e._maxLength/n;return Math.floor(Math.min(r,s))}function F_(e,t,n){const r=$_(e),s=t.length/n;if(!r)return Math.max(s,1);const i=Hw(r);for(let o=0,a=i.length-1;o<a;o++){const l=i[o];if(l>s)return l}return Math.max(s,1)}function B_(e){const t=[];let n,r;for(n=0,r=e.length;n<r;n++)e[n].major&&t.push(n);return t}function W_(e,t,n,r){let s=0,i=n[0],o;for(r=Math.ceil(r),o=0;o<e.length;o++)o===i&&(t.push(e[o]),s++,i=n[s*r])}function yo(e,t,n,r,s){const i=K(r,0),o=Math.min(K(s,e.length),e.length);let a=0,l,c,d;for(n=Math.ceil(n),s&&(l=s-r,n=l/Math.floor(l/n)),d=i;d<0;)a++,d=Math.round(i+a*n);for(c=Math.max(i,0);c<o;c++)c===d&&(t.push(e[c]),a++,d=Math.round(i+a*n))}function $_(e){const t=e.length;let n,r;if(t<2)return!1;for(r=e[0],n=1;n<t;++n)if(e[n]-e[n-1]!==r)return!1;return r}const H_=e=>e==="left"?"right":e==="right"?"left":e,Ih=(e,t,n)=>t==="top"||t==="left"?e[t]+n:e[t]-n,Fh=(e,t)=>Math.min(t||e,e);function Bh(e,t){const n=[],r=e.length/t,s=e.length;let i=0;for(;i<s;i+=r)n.push(e[Math.floor(i)]);return n}function V_(e,t,n){const r=e.ticks.length,s=Math.min(t,r-1),i=e._startPixel,o=e._endPixel,a=1e-6;let l=e.getPixelForTick(s),c;if(!(n&&(r===1?c=Math.max(l-i,o-l):t===0?c=(e.getPixelForTick(1)-l)/2:c=(l-e.getPixelForTick(s-1))/2,l+=s<t?c:-c,l<i-a||l>o+a)))return l}function U_(e,t){Z(e,n=>{const r=n.gc,s=r.length/2;let i;if(s>t){for(i=0;i<s;++i)delete n.data[r[i]];r.splice(0,s)}})}function Ds(e){return e.drawTicks?e.tickLength:0}function Wh(e,t){if(!e.display)return 0;const n=Qe(e.font,t),r=Mt(e.padding);return(Ee(e.text)?e.text.length:1)*n.lineHeight+r.height}function Y_(e,t){return hs(e,{scale:t,type:"scale"})}function K_(e,t,n){return hs(e,{tick:n,index:t,type:"tick"})}function X_(e,t,n){let r=hx(e);return(n&&t!=="right"||!n&&t==="right")&&(r=H_(r)),r}function Q_(e,t,n,r){const{top:s,left:i,bottom:o,right:a,chart:l}=e,{chartArea:c,scales:d}=l;let f=0,h,p,v;const m=o-s,w=a-i;if(e.isHorizontal()){if(p=rt(r,i,a),Q(n)){const x=Object.keys(n)[0],g=n[x];v=d[x].getPixelForValue(g)+m-t}else n==="center"?v=(c.bottom+c.top)/2+m-t:v=Ih(e,n,t);h=a-i}else{if(Q(n)){const x=Object.keys(n)[0],g=n[x];p=d[x].getPixelForValue(g)-w+t}else n==="center"?p=(c.left+c.right)/2-w+t:p=Ih(e,n,t);v=rt(r,o,s),f=n==="left"?-ke:ke}return{titleX:p,titleY:v,maxWidth:h,rotation:f}}class ps extends Un{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,n){return t}getUserBounds(){let{_userMin:t,_userMax:n,_suggestedMin:r,_suggestedMax:s}=this;return t=Lt(t,Number.POSITIVE_INFINITY),n=Lt(n,Number.NEGATIVE_INFINITY),r=Lt(r,Number.POSITIVE_INFINITY),s=Lt(s,Number.NEGATIVE_INFINITY),{min:Lt(t,r),max:Lt(n,s),minDefined:yt(t),maxDefined:yt(n)}}getMinMax(t){let{min:n,max:r,minDefined:s,maxDefined:i}=this.getUserBounds(),o;if(s&&i)return{min:n,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,c=a.length;l<c;++l)o=a[l].controller.getMinMax(this,t),s||(n=Math.min(n,o.min)),i||(r=Math.max(r,o.max));return n=i&&n>r?r:n,r=s&&n>r?n:r,{min:Lt(n,Lt(r,n)),max:Lt(r,Lt(n,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){oe(this.options.beforeUpdate,[this])}update(t,n,r){const{beginAtZero:s,grace:i,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=n,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=v1(this,i,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?Bh(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=z_(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,n,r;this.isHorizontal()?(n=this.left,r=this.right):(n=this.top,r=this.bottom,t=!t),this._startPixel=n,this._endPixel=r,this._reversePixels=t,this._length=r-n,this._alignToPixels=this.options.alignToPixels}afterUpdate(){oe(this.options.afterUpdate,[this])}beforeSetDimensions(){oe(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){oe(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),oe(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){oe(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const n=this.options.ticks;let r,s,i;for(r=0,s=t.length;r<s;r++)i=t[r],i.label=oe(n.callback,[i.value,r,t],this)}afterTickToLabelConversion(){oe(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){oe(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,n=t.ticks,r=Fh(this.ticks.length,t.ticks.maxTicksLimit),s=n.minRotation||0,i=n.maxRotation;let o=s,a,l,c;if(!this._isVisible()||!n.display||s>=i||r<=1||!this.isHorizontal()){this.labelRotation=s;return}const d=this._getLabelSizes(),f=d.widest.width,h=d.highest.height,p=Xe(this.chart.width-f,0,this.maxWidth);a=t.offset?this.maxWidth/r:p/(r-1),f+6>a&&(a=p/(r-(t.offset?.5:1)),l=this.maxHeight-Ds(t.grid)-n.padding-Wh(t.title,this.chart.options.font),c=Math.sqrt(f*f+h*h),o=Kw(Math.min(Math.asin(Xe((d.highest.height+6)/a,-1,1)),Math.asin(Xe(l/c,-1,1))-Math.asin(Xe(h/c,-1,1)))),o=Math.max(s,Math.min(i,o))),this.labelRotation=o}afterCalculateLabelRotation(){oe(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){oe(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:n,options:{ticks:r,title:s,grid:i}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const l=Wh(s,n.options.font);if(a?(t.width=this.maxWidth,t.height=Ds(i)+l):(t.height=this.maxHeight,t.width=Ds(i)+l),r.display&&this.ticks.length){const{first:c,last:d,widest:f,highest:h}=this._getLabelSizes(),p=r.padding*2,v=nn(this.labelRotation),m=Math.cos(v),w=Math.sin(v);if(a){const x=r.mirror?0:w*f.width+m*h.height;t.height=Math.min(this.maxHeight,t.height+x+p)}else{const x=r.mirror?0:m*f.width+w*h.height;t.width=Math.min(this.maxWidth,t.width+x+p)}this._calculatePadding(c,d,w,m)}}this._handleMargins(),a?(this.width=this._length=n.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=n.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,n,r,s){const{ticks:{align:i,padding:o},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const d=this.getPixelForTick(0)-this.left,f=this.right-this.getPixelForTick(this.ticks.length-1);let h=0,p=0;l?c?(h=s*t.width,p=r*n.height):(h=r*t.height,p=s*n.width):i==="start"?p=n.width:i==="end"?h=t.width:i!=="inner"&&(h=t.width/2,p=n.width/2),this.paddingLeft=Math.max((h-d+o)*this.width/(this.width-d),0),this.paddingRight=Math.max((p-f+o)*this.width/(this.width-f),0)}else{let d=n.height/2,f=t.height/2;i==="start"?(d=0,f=t.height):i==="end"&&(d=n.height,f=0),this.paddingTop=d+o,this.paddingBottom=f+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){oe(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:n}=this.options;return n==="top"||n==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let n,r;for(n=0,r=t.length;n<r;n++)ne(t[n].label)&&(t.splice(n,1),r--,n--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const n=this.options.ticks.sampleSize;let r=this.ticks;n<r.length&&(r=Bh(r,n)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,n,r){const{ctx:s,_longestTextCache:i}=this,o=[],a=[],l=Math.floor(n/Fh(n,r));let c=0,d=0,f,h,p,v,m,w,x,g,y,_,k;for(f=0;f<n;f+=l){if(v=t[f].label,m=this._resolveTickFontOptions(f),s.font=w=m.string,x=i[w]=i[w]||{data:{},gc:[]},g=m.lineHeight,y=_=0,!ne(v)&&!Ee(v))y=mh(s,x.data,x.gc,y,v),_=g;else if(Ee(v))for(h=0,p=v.length;h<p;++h)k=v[h],!ne(k)&&!Ee(k)&&(y=mh(s,x.data,x.gc,y,k),_+=g);o.push(y),a.push(_),c=Math.max(y,c),d=Math.max(_,d)}U_(i,n);const S=o.indexOf(c),C=a.indexOf(d),j=P=>({width:o[P]||0,height:a[P]||0});return{first:j(0),last:j(n-1),widest:j(S),highest:j(C),widths:o,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,n){return NaN}getValueForPixel(t){}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const n=this._startPixel+t*this._length;return Qw(this._alignToPixels?tr(this.chart,n,0):n)}getDecimalForPixel(t){const n=(t-this._startPixel)/this._length;return this._reversePixels?1-n:n}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:n}=this;return t<0&&n<0?n:t>0&&n>0?t:0}getContext(t){const n=this.ticks||[];if(t>=0&&t<n.length){const r=n[t];return r.$context||(r.$context=K_(this.getContext(),t,r))}return this.$context||(this.$context=Y_(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,n=nn(this.labelRotation),r=Math.abs(Math.cos(n)),s=Math.abs(Math.sin(n)),i=this._getLabelSizes(),o=t.autoSkipPadding||0,a=i?i.widest.width+o:0,l=i?i.highest.height+o:0;return this.isHorizontal()?l*r>a*s?a/r:l/s:l*s<a*r?l/r:a/s}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const n=this.axis,r=this.chart,s=this.options,{grid:i,position:o,border:a}=s,l=i.offset,c=this.isHorizontal(),f=this.ticks.length+(l?1:0),h=Ds(i),p=[],v=a.setContext(this.getContext()),m=v.display?v.width:0,w=m/2,x=function(q){return tr(r,q,m)};let g,y,_,k,S,C,j,P,E,R,A,N;if(o==="top")g=x(this.bottom),C=this.bottom-h,P=g-w,R=x(t.top)+w,N=t.bottom;else if(o==="bottom")g=x(this.top),R=t.top,N=x(t.bottom)-w,C=g+w,P=this.top+h;else if(o==="left")g=x(this.right),S=this.right-h,j=g-w,E=x(t.left)+w,A=t.right;else if(o==="right")g=x(this.left),E=t.left,A=x(t.right)-w,S=g+w,j=this.left+h;else if(n==="x"){if(o==="center")g=x((t.top+t.bottom)/2+.5);else if(Q(o)){const q=Object.keys(o)[0],J=o[q];g=x(this.chart.scales[q].getPixelForValue(J))}R=t.top,N=t.bottom,C=g+w,P=C+h}else if(n==="y"){if(o==="center")g=x((t.left+t.right)/2);else if(Q(o)){const q=Object.keys(o)[0],J=o[q];g=x(this.chart.scales[q].getPixelForValue(J))}S=g-w,j=S-h,E=t.left,A=t.right}const F=K(s.ticks.maxTicksLimit,f),z=Math.max(1,Math.ceil(f/F));for(y=0;y<f;y+=z){const q=this.getContext(y),J=i.setContext(q),O=a.setContext(q),T=J.lineWidth,L=J.color,V=O.dash||[],W=O.dashOffset,se=J.tickWidth,U=J.tickColor,be=J.tickBorderDash||[],G=J.tickBorderDashOffset;_=V_(this,y,l),_!==void 0&&(k=tr(r,_,T),c?S=j=E=A=k:C=P=R=N=k,p.push({tx1:S,ty1:C,tx2:j,ty2:P,x1:E,y1:R,x2:A,y2:N,width:T,color:L,borderDash:V,borderDashOffset:W,tickWidth:se,tickColor:U,tickBorderDash:be,tickBorderDashOffset:G}))}return this._ticksLength=f,this._borderValue=g,p}_computeLabelItems(t){const n=this.axis,r=this.options,{position:s,ticks:i}=r,o=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:c,padding:d,mirror:f}=i,h=Ds(r.grid),p=h+d,v=f?-d:p,m=-nn(this.labelRotation),w=[];let x,g,y,_,k,S,C,j,P,E,R,A,N="middle";if(s==="top")S=this.bottom-v,C=this._getXAxisLabelAlignment();else if(s==="bottom")S=this.top+v,C=this._getXAxisLabelAlignment();else if(s==="left"){const z=this._getYAxisLabelAlignment(h);C=z.textAlign,k=z.x}else if(s==="right"){const z=this._getYAxisLabelAlignment(h);C=z.textAlign,k=z.x}else if(n==="x"){if(s==="center")S=(t.top+t.bottom)/2+p;else if(Q(s)){const z=Object.keys(s)[0],q=s[z];S=this.chart.scales[z].getPixelForValue(q)+p}C=this._getXAxisLabelAlignment()}else if(n==="y"){if(s==="center")k=(t.left+t.right)/2-p;else if(Q(s)){const z=Object.keys(s)[0],q=s[z];k=this.chart.scales[z].getPixelForValue(q)}C=this._getYAxisLabelAlignment(h).textAlign}n==="y"&&(l==="start"?N="top":l==="end"&&(N="bottom"));const F=this._getLabelSizes();for(x=0,g=a.length;x<g;++x){y=a[x],_=y.label;const z=i.setContext(this.getContext(x));j=this.getPixelForTick(x)+i.labelOffset,P=this._resolveTickFontOptions(x),E=P.lineHeight,R=Ee(_)?_.length:1;const q=R/2,J=z.color,O=z.textStrokeColor,T=z.textStrokeWidth;let L=C;o?(k=j,C==="inner"&&(x===g-1?L=this.options.reverse?"left":"right":x===0?L=this.options.reverse?"right":"left":L="center"),s==="top"?c==="near"||m!==0?A=-R*E+E/2:c==="center"?A=-F.highest.height/2-q*E+E:A=-F.highest.height+E/2:c==="near"||m!==0?A=E/2:c==="center"?A=F.highest.height/2-q*E:A=F.highest.height-R*E,f&&(A*=-1),m!==0&&!z.showLabelBackdrop&&(k+=E/2*Math.sin(m))):(S=j,A=(1-R)*E/2);let V;if(z.showLabelBackdrop){const W=Mt(z.backdropPadding),se=F.heights[x],U=F.widths[x];let be=A-W.top,G=0-W.left;switch(N){case"middle":be-=se/2;break;case"bottom":be-=se;break}switch(C){case"center":G-=U/2;break;case"right":G-=U;break;case"inner":x===g-1?G-=U:x>0&&(G-=U/2);break}V={left:G,top:be,width:U+W.width,height:se+W.height,color:z.backdropColor}}w.push({label:_,font:P,textOffset:A,options:{rotation:m,color:J,strokeColor:O,strokeWidth:T,textAlign:L,textBaseline:N,translation:[k,S],backdrop:V}})}return w}_getXAxisLabelAlignment(){const{position:t,ticks:n}=this.options;if(-nn(this.labelRotation))return t==="top"?"left":"right";let s="center";return n.align==="start"?s="left":n.align==="end"?s="right":n.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){const{position:n,ticks:{crossAlign:r,mirror:s,padding:i}}=this.options,o=this._getLabelSizes(),a=t+i,l=o.widest.width;let c,d;return n==="left"?s?(d=this.right+i,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d+=l)):(d=this.right-a,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d=this.left)):n==="right"?s?(d=this.left+i,r==="near"?c="right":r==="center"?(c="center",d-=l/2):(c="left",d-=l)):(d=this.left+a,r==="near"?c="left":r==="center"?(c="center",d+=l/2):(c="right",d=this.right)):c="right",{textAlign:c,x:d}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,n=this.options.position;if(n==="left"||n==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(n==="top"||n==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:n},left:r,top:s,width:i,height:o}=this;n&&(t.save(),t.fillStyle=n,t.fillRect(r,s,i,o),t.restore())}getLineWidthForValue(t){const n=this.options.grid;if(!this._isVisible()||!n.display)return 0;const s=this.ticks.findIndex(i=>i.value===t);return s>=0?n.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){const n=this.options.grid,r=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let i,o;const a=(l,c,d)=>{!d.width||!d.color||(r.save(),r.lineWidth=d.width,r.strokeStyle=d.color,r.setLineDash(d.borderDash||[]),r.lineDashOffset=d.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(c.x,c.y),r.stroke(),r.restore())};if(n.display)for(i=0,o=s.length;i<o;++i){const l=s[i];n.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),n.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:n,options:{border:r,grid:s}}=this,i=r.setContext(this.getContext()),o=r.display?i.width:0;if(!o)return;const a=s.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let c,d,f,h;this.isHorizontal()?(c=tr(t,this.left,o)-o/2,d=tr(t,this.right,a)+a/2,f=h=l):(f=tr(t,this.top,o)-o/2,h=tr(t,this.bottom,a)+a/2,c=d=l),n.save(),n.lineWidth=i.width,n.strokeStyle=i.color,n.beginPath(),n.moveTo(c,f),n.lineTo(d,h),n.stroke(),n.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,s=this._computeLabelArea();s&&ud(r,s);const i=this.getLabelItems(t);for(const o of i){const a=o.options,l=o.font,c=o.label,d=o.textOffset;ba(r,c,0,d,l,a)}s&&dd(r)}drawTitle(){const{ctx:t,options:{position:n,title:r,reverse:s}}=this;if(!r.display)return;const i=Qe(r.font),o=Mt(r.padding),a=r.align;let l=i.lineHeight/2;n==="bottom"||n==="center"||Q(n)?(l+=o.bottom,Ee(r.text)&&(l+=i.lineHeight*(r.text.length-1))):l+=o.top;const{titleX:c,titleY:d,maxWidth:f,rotation:h}=Q_(this,l,n,a);ba(t,r.text,0,0,i,{color:r.color,maxWidth:f,rotation:h,textAlign:X_(a,n,s),textBaseline:"middle",translation:[c,d],strokeColor:r.strokeColor,strokeWidth:r.strokeWidth})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,n=t.ticks&&t.ticks.z||0,r=K(t.grid&&t.grid.z,-1),s=K(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==ps.prototype.draw?[{z:n,draw:i=>{this.draw(i)}}]:[{z:r,draw:i=>{this.drawBackground(),this.drawGrid(i),this.drawTitle()}},{z:s,draw:()=>{this.drawBorder()}},{z:n,draw:i=>{this.drawLabels(i)}}]}getMatchingVisibleMetas(t){const n=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",s=[];let i,o;for(i=0,o=n.length;i<o;++i){const a=n[i];a[r]===this.id&&(!t||a.type===t)&&s.push(a)}return s}_resolveTickFontOptions(t){const n=this.options.ticks.setContext(this.getContext(t));return Qe(n.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class bo{constructor(t,n,r){this.type=t,this.scope=n,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const n=Object.getPrototypeOf(t);let r;J_(n)&&(r=this.register(n));const s=this.items,i=t.id,o=this.scope+"."+i;if(!i)throw new Error("class does not have id: "+t);return i in s||(s[i]=t,G_(t,o,r),this.override&&ve.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const n=this.items,r=t.id,s=this.scope;r in n&&delete n[r],s&&r in ve[s]&&(delete ve[s][r],this.override&&delete br[r])}}function G_(e,t,n){const r=ji(Object.create(null),[n?ve.get(n):{},ve.get(t),e.defaults]);ve.set(t,r),e.defaultRoutes&&q_(t,e.defaultRoutes),e.descriptors&&ve.describe(t,e.descriptors)}function q_(e,t){Object.keys(t).forEach(n=>{const r=n.split("."),s=r.pop(),i=[e].concat(r).join("."),o=t[n].split("."),a=o.pop(),l=o.join(".");ve.route(i,s,l,a)})}function J_(e){return"id"in e&&"defaults"in e}class Z_{constructor(){this.controllers=new bo(Jr,"datasets",!0),this.elements=new bo(Un,"elements"),this.plugins=new bo(Object,"plugins"),this.scales=new bo(ps,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,n,r){[...n].forEach(s=>{const i=r||this._getRegistryForType(s);r||i.isForType(s)||i===this.plugins&&s.id?this._exec(t,i,s):Z(s,o=>{const a=r||this._getRegistryForType(o);this._exec(t,a,o)})})}_exec(t,n,r){const s=ad(t);oe(r["before"+s],[],r),n[t](r),oe(r["after"+s],[],r)}_getRegistryForType(t){for(let n=0;n<this._typedRegistries.length;n++){const r=this._typedRegistries[n];if(r.isForType(t))return r}return this.plugins}_get(t,n,r){const s=n.get(t);if(s===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return s}}var Bt=new Z_;class eS{constructor(){this._init=void 0}notify(t,n,r,s){if(n==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const i=s?this._descriptors(t).filter(s):this._descriptors(t),o=this._notify(i,t,n,r);return n==="afterDestroy"&&(this._notify(i,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),o}_notify(t,n,r,s){s=s||{};for(const i of t){const o=i.plugin,a=o[r],l=[n,s,i.options];if(oe(a,l,o)===!1&&s.cancelable)return!1}return!0}invalidate(){ne(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const n=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),n}_createDescriptors(t,n){const r=t&&t.config,s=K(r.options&&r.options.plugins,{}),i=tS(r);return s===!1&&!n?[]:rS(t,i,s,n)}_notifyStateChanges(t){const n=this._oldCache||[],r=this._cache,s=(i,o)=>i.filter(a=>!o.some(l=>a.plugin.id===l.plugin.id));this._notify(s(n,r),t,"stop"),this._notify(s(r,n),t,"start")}}function tS(e){const t={},n=[],r=Object.keys(Bt.plugins.items);for(let i=0;i<r.length;i++)n.push(Bt.getPlugin(r[i]));const s=e.plugins||[];for(let i=0;i<s.length;i++){const o=s[i];n.indexOf(o)===-1&&(n.push(o),t[o.id]=!0)}return{plugins:n,localIds:t}}function nS(e,t){return!t&&e===!1?null:e===!0?{}:e}function rS(e,{plugins:t,localIds:n},r,s){const i=[],o=e.getContext();for(const a of t){const l=a.id,c=nS(r[l],s);c!==null&&i.push({plugin:a,options:sS(e.config,{plugin:a,local:n[l]},c,o)})}return i}function sS(e,{plugin:t,local:n},r,s){const i=e.pluginScopeKeys(t),o=e.getOptionScopes(r,i);return n&&t.defaults&&o.push(t.defaults),e.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function tu(e,t){const n=ve.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||n.indexAxis||"x"}function iS(e,t){let n=e;return e==="_index_"?n=t:e==="_value_"&&(n=t==="x"?"y":"x"),n}function oS(e,t){return e===t?"_index_":"_value_"}function $h(e){if(e==="x"||e==="y"||e==="r")return e}function aS(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function nu(e,...t){if($h(e))return e;for(const n of t){const r=n.axis||aS(n.position)||e.length>1&&$h(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function Hh(e,t,n){if(n[t+"AxisID"]===e)return{axis:t}}function lS(e,t){if(t.data&&t.data.datasets){const n=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(n.length)return Hh(e,"x",n[0])||Hh(e,"y",n[0])}return{}}function cS(e,t){const n=br[e.type]||{scales:{}},r=t.scales||{},s=tu(e.type,t),i=Object.create(null);return Object.keys(r).forEach(o=>{const a=r[o];if(!Q(a))return console.error(`Invalid scale configuration for scale: ${o}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const l=nu(o,a,lS(o,e),ve.scales[a.type]),c=oS(l,s),d=n.scales||{};i[o]=ei(Object.create(null),[{axis:l},a,d[l],d[c]])}),e.data.datasets.forEach(o=>{const a=o.type||e.type,l=o.indexAxis||tu(a,t),d=(br[a]||{}).scales||{};Object.keys(d).forEach(f=>{const h=iS(f,l),p=o[h+"AxisID"]||h;i[p]=i[p]||Object.create(null),ei(i[p],[{axis:h},r[p],d[f]])})}),Object.keys(i).forEach(o=>{const a=i[o];ei(a,[ve.scales[a.type],ve.scale])}),i}function Dx(e){const t=e.options||(e.options={});t.plugins=K(t.plugins,{}),t.scales=cS(e,t)}function Tx(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function uS(e){return e=e||{},e.data=Tx(e.data),Dx(e),e}const Vh=new Map,Lx=new Set;function wo(e,t){let n=Vh.get(e);return n||(n=t(),Vh.set(e,n),Lx.add(n)),n}const Ts=(e,t,n)=>{const r=yr(t,n);r!==void 0&&e.add(r)};class dS{constructor(t){this._config=uS(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Tx(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Dx(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return wo(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,n){return wo(`${t}.transition.${n}`,()=>[[`datasets.${t}.transitions.${n}`,`transitions.${n}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,n){return wo(`${t}-${n}`,()=>[[`datasets.${t}.elements.${n}`,`datasets.${t}`,`elements.${n}`,""]])}pluginScopeKeys(t){const n=t.id,r=this.type;return wo(`${r}-plugin-${n}`,()=>[[`plugins.${n}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,n){const r=this._scopeCache;let s=r.get(t);return(!s||n)&&(s=new Map,r.set(t,s)),s}getOptionScopes(t,n,r){const{options:s,type:i}=this,o=this._cachedScopes(t,r),a=o.get(n);if(a)return a;const l=new Set;n.forEach(d=>{t&&(l.add(t),d.forEach(f=>Ts(l,t,f))),d.forEach(f=>Ts(l,s,f)),d.forEach(f=>Ts(l,br[i]||{},f)),d.forEach(f=>Ts(l,ve,f)),d.forEach(f=>Ts(l,eu,f))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),Lx.has(n)&&o.set(n,c),c}chartOptionScopes(){const{options:t,type:n}=this;return[t,br[n]||{},ve.datasets[n]||{},{type:n},ve,eu]}resolveNamedOptions(t,n,r,s=[""]){const i={$shared:!0},{resolver:o,subPrefixes:a}=Uh(this._resolverCache,t,s);let l=o;if(hS(o,n)){i.$shared=!1,r=Vn(r)?r():r;const c=this.createResolver(t,r,a);l=ls(o,r,c)}for(const c of n)i[c]=l[c];return i}createResolver(t,n,r=[""],s){const{resolver:i}=Uh(this._resolverCache,t,r);return Q(n)?ls(i,n,void 0,s):i}}function Uh(e,t,n){let r=e.get(t);r||(r=new Map,e.set(t,r));const s=n.join();let i=r.get(s);return i||(i={resolver:hd(t,n),subPrefixes:n.filter(a=>!a.toLowerCase().includes("hover"))},r.set(s,i)),i}const fS=e=>Q(e)&&Object.getOwnPropertyNames(e).some(t=>Vn(e[t]));function hS(e,t){const{isScriptable:n,isIndexable:r}=yx(e);for(const s of t){const i=n(s),o=r(s),a=(o||i)&&e[s];if(i&&(Vn(a)||fS(a))||o&&Ee(a))return!0}return!1}var pS="4.6.1";const gS=["top","bottom","left","right","chartArea"];function Yh(e,t){return e==="top"||e==="bottom"||gS.indexOf(e)===-1&&t==="x"}function Kh(e,t){return function(n,r){return n[e]===r[e]?n[t]-r[t]:n[e]-r[e]}}function Xh(e){const t=e.chart,n=t.options.animation;t.notifyPlugins("afterRender"),oe(n&&n.onComplete,[e],t)}function mS(e){const t=e.chart,n=t.options.animation;oe(n&&n.onProgress,[e],t)}function Ax(e){return md()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Bo={},Qh=e=>{const t=Ax(e);return Object.values(Bo).filter(n=>n.canvas===t).pop()};function xS(e,t,n){const r=Object.keys(e);for(const s of r){const i=+s;if(i>=t){const o=e[s];delete e[s],(n>0||i>t)&&(e[i+n]=o)}}}function vS(e,t,n,r){return!n||e.type==="mouseout"?null:r?t:e}var xn;let Za=(xn=class{static register(...t){Bt.add(...t),Gh()}static unregister(...t){Bt.remove(...t),Gh()}constructor(t,n){const r=this.config=new dS(n),s=Ax(t),i=Qh(s);if(i)throw new Error("Canvas is already in use. Chart with ID '"+i.id+"' must be destroyed before the canvas with ID '"+i.canvas.id+"' can be reused.");const o=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||A_(s)),this.platform.updateConfig(r);const a=this.platform.acquireContext(s,o.aspectRatio),l=a&&a.canvas,c=l&&l.height,d=l&&l.width;if(this.id=Lw(),this.ctx=a,this.canvas=l,this.width=d,this.height=c,this._options=o,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new eS,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Zw(f=>this.update(f),o.resizeDelay||0),this._dataChanges=[],Bo[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}Qt.listen(this,"complete",Xh),Qt.listen(this,"progress",mS),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:n},width:r,height:s,_aspectRatio:i}=this;return ne(t)?n&&i?i:s?r/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return Bt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():wh(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return xh(this.canvas,this.ctx),this}stop(){return Qt.stop(this),this}resize(t,n){Qt.running(this)?this._resizeBeforeDraw={width:t,height:n}:this._resize(t,n)}_resize(t,n){const r=this.options,s=this.canvas,i=r.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,n,i),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,wh(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),oe(r.onResize,[this,o],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const n=this.options.scales||{};Z(n,(r,s)=>{r.id=s})}buildOrUpdateScales(){const t=this.options,n=t.scales,r=this.scales,s=Object.keys(r).reduce((o,a)=>(o[a]=!1,o),{});let i=[];n&&(i=i.concat(Object.keys(n).map(o=>{const a=n[o],l=nu(o,a),c=l==="r",d=l==="x";return{options:a,dposition:c?"chartArea":d?"bottom":"left",dtype:c?"radialLinear":d?"category":"linear"}}))),Z(i,o=>{const a=o.options,l=a.id,c=nu(l,a),d=K(a.type,o.dtype);(a.position===void 0||Yh(a.position,c)!==Yh(o.dposition))&&(a.position=o.dposition),s[l]=!0;let f=null;if(l in r&&r[l].type===d)f=r[l];else{const h=Bt.getScale(d);f=new h({id:l,type:d,ctx:this.ctx,chart:this}),r[f.id]=f}f.init(a,t)}),Z(s,(o,a)=>{o||delete r[a]}),Z(r,o=>{En.configure(this,o,o.options),En.addBox(this,o)})}_updateMetasets(){const t=this._metasets,n=this.data.datasets.length,r=t.length;if(t.sort((s,i)=>s.index-i.index),r>n){for(let s=n;s<r;++s)this._destroyDatasetMeta(s);t.splice(n,r-n)}this._sortedMetasets=t.slice(0).sort(Kh("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:n}}=this;t.length>n.length&&delete this._stacks,t.forEach((r,s)=>{n.filter(i=>i===r._dataset).length===0&&this._destroyDatasetMeta(s)})}buildOrUpdateControllers(){const t=[],n=this.data.datasets;let r,s;for(this._removeUnreferencedMetasets(),r=0,s=n.length;r<s;r++){const i=n[r];let o=this.getDatasetMeta(r);const a=i.type||this.config.type;if(o.type&&o.type!==a&&(this._destroyDatasetMeta(r),o=this.getDatasetMeta(r)),o.type=a,o.indexAxis=i.indexAxis||tu(a,this.options),o.order=i.order||0,o.index=r,o.label=""+i.label,o.visible=this.isDatasetVisible(r),o.controller)o.controller.updateIndex(r),o.controller.linkScales();else{const l=Bt.getController(a),{datasetElementType:c,dataElementType:d}=ve.datasets[a];Object.assign(l,{dataElementType:Bt.getElement(d),datasetElementType:c&&Bt.getElement(c)}),o.controller=new l(this,r),t.push(o.controller)}}return this._updateMetasets(),t}_resetElements(){Z(this.data.datasets,(t,n)=>{this.getDatasetMeta(n).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const n=this.config;n.update();const r=this._options=n.createResolver(n.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const i=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let c=0,d=this.data.datasets.length;c<d;c++){const{controller:f}=this.getDatasetMeta(c),h=!s&&i.indexOf(f)===-1;f.buildOrUpdateElements(h),o=Math.max(+f.getMaxOverflow(),o)}o=this._minPadding=r.layout.autoPadding?o:0,this._updateLayout(o),s||Z(i,c=>{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Kh("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Z(this.scales,t=>{En.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,n=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!ah(n,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,n=this._getUniformDataChanges()||[];for(const{method:r,start:s,count:i}of n){const o=r==="_removeElements"?-i:i;xS(t,s,o)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const n=this.data.datasets.length,r=i=>new Set(t.filter(o=>o[0]===i).map((o,a)=>a+","+o.splice(1).join(","))),s=r(0);for(let i=1;i<n;i++)if(!ah(s,r(i)))return;return Array.from(s).map(i=>i.split(",")).map(i=>({method:i[1],start:+i[2],count:+i[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;En.update(this,this.width,this.height,t);const n=this.chartArea,r=n.width<=0||n.height<=0;this._layers=[],Z(this.boxes,s=>{r&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,i)=>{s._idx=i}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let n=0,r=this.data.datasets.length;n<r;++n)this.getDatasetMeta(n).controller.configure();for(let n=0,r=this.data.datasets.length;n<r;++n)this._updateDataset(n,Vn(t)?t({datasetIndex:n}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,n){const r=this.getDatasetMeta(t),s={meta:r,index:t,mode:n,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(r.controller._update(n),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(Qt.has(this)?this.attached&&!Qt.running(this)&&Qt.start(this):(this.draw(),Xh({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:s}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,s)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const n=this._layers;for(t=0;t<n.length&&n[t].z<=0;++t)n[t].draw(this.chartArea);for(this._drawDatasets();t<n.length;++t)n[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const n=this._sortedMetasets,r=[];let s,i;for(s=0,i=n.length;s<i;++s){const o=n[s];(!t||o.visible)&&r.push(o)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let n=t.length-1;n>=0;--n)this._drawDataset(t[n]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const n=this.ctx,r={meta:t,index:t.index,cancelable:!0},s=I1(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(s&&ud(n,s),t.controller.draw(),s&&dd(n),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return xx(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,n,r,s){const i=g_.modes[n];return typeof i=="function"?i(this,t,r,s):[]}getDatasetMeta(t){const n=this.data.datasets[t],r=this._metasets;let s=r.filter(i=>i&&i._dataset===n).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:n&&n.order||0,index:t,_dataset:n,_parsed:[],_sorted:!1},r.push(s)),s}getContext(){return this.$context||(this.$context=hs(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const n=this.data.datasets[t];if(!n)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!n.hidden}setDatasetVisibility(t,n){const r=this.getDatasetMeta(t);r.hidden=!n}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,n,r){const s=r?"show":"hide",i=this.getDatasetMeta(t),o=i.controller._resolveAnimations(void 0,s);Ni(n)?(i.data[n].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),o.update(i,{visible:r}),this.update(a=>a.datasetIndex===t?s:void 0))}hide(t,n){this._updateVisibility(t,n,!1)}show(t,n){this._updateVisibility(t,n,!0)}_destroyDatasetMeta(t){const n=this._metasets[t];n&&n.controller&&n.controller._destroy(),delete this._metasets[t]}_stop(){let t,n;for(this.stop(),Qt.remove(this),t=0,n=this.data.datasets.length;t<n;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:n}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),xh(t,n),this.platform.releaseContext(n),this.canvas=null,this.ctx=null),delete Bo[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,n=this.platform,r=(i,o)=>{n.addEventListener(this,i,o),t[i]=o},s=(i,o,a)=>{i.offsetX=o,i.offsetY=a,this._eventHandler(i)};Z(this.options.events,i=>r(i,s))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,n=this.platform,r=(l,c)=>{n.addEventListener(this,l,c),t[l]=c},s=(l,c)=>{t[l]&&(n.removeEventListener(this,l,c),delete t[l])},i=(l,c)=>{this.canvas&&this.resize(l,c)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),r("resize",i),r("detach",o)};o=()=>{this.attached=!1,s("resize",i),this._stop(),this._resize(0,0),r("attach",a)},n.isAttached(this.canvas)?a():o()}unbindEvents(){Z(this._listeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._listeners={},Z(this._responsiveListeners,(t,n)=>{this.platform.removeEventListener(this,n,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,n,r){const s=r?"set":"remove";let i,o,a,l;for(n==="dataset"&&(i=this.getDatasetMeta(t[0].datasetIndex),i.controller["_"+s+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){o=t[a];const c=o&&this.getDatasetMeta(o.datasetIndex).controller;c&&c[s+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const n=this._active||[],r=t.map(({datasetIndex:i,index:o})=>{const a=this.getDatasetMeta(i);if(!a)throw new Error("No dataset found at index "+i);return{datasetIndex:i,element:a.data[o],index:o}});!ga(r,n)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,n))}notifyPlugins(t,n,r){return this._plugins.notify(this,t,n,r)}isPluginEnabled(t){return this._plugins._cache.filter(n=>n.plugin.id===t).length===1}_updateHoverStyles(t,n,r){const s=this.options.hover,i=(l,c)=>l.filter(d=>!c.some(f=>d.datasetIndex===f.datasetIndex&&d.index===f.index)),o=i(n,t),a=r?t:i(t,n);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,n){const r={event:t,replay:n,cancelable:!0,inChartArea:this.isPointInArea(t)},s=o=>(o.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,s)===!1)return;const i=this._handleEvent(t,n,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,s),(i||r.changed)&&this.render(),this}_handleEvent(t,n,r){const{_active:s=[],options:i}=this,o=n,a=this._getActiveElements(t,s,r,o),l=Ww(t),c=vS(t,this._lastEvent,r,l);r&&(this._lastEvent=null,oe(i.onHover,[t,a,this],this),l&&oe(i.onClick,[t,a,this],this));const d=!ga(a,s);return(d||n)&&(this._active=a,this._updateHoverStyles(a,s,n)),this._lastEvent=c,d}_getActiveElements(t,n,r,s){if(t.type==="mouseout")return[];if(!r)return n;const i=this.options.hover;return this.getElementsAtEventForMode(t,i.mode,i,s)}},I(xn,"defaults",ve),I(xn,"instances",Bo),I(xn,"overrides",br),I(xn,"registry",Bt),I(xn,"version",pS),I(xn,"getChart",Qh),xn);function Gh(){return Z(Za.instances,e=>e._plugins.invalidate())}function yS(e,t,n){const{startAngle:r,x:s,y:i,outerRadius:o,innerRadius:a,options:l}=t,{borderWidth:c,borderJoinStyle:d}=l,f=Math.min(c/o,Wt(r-n));if(e.beginPath(),e.arc(s,i,o-c/2,r+f/2,n-f/2),a>0){const h=Math.min(c/a,Wt(r-n));e.arc(s,i,a+c/2,n-h/2,r+h/2,!0)}else{const h=Math.min(c/2,o*Wt(r-n));if(d==="round")e.arc(s,i,h,n-ae/2,r+ae/2,!0);else if(d==="bevel"){const p=2*h*h,v=-p*Math.cos(n+ae/2)+s,m=-p*Math.sin(n+ae/2)+i,w=p*Math.cos(r+ae/2)+s,x=p*Math.sin(r+ae/2)+i;e.lineTo(v,m),e.lineTo(w,x)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function bS(e,t,n){const{startAngle:r,pixelMargin:s,x:i,y:o,outerRadius:a,innerRadius:l}=t;let c=s/a;e.beginPath(),e.arc(i,o,a,r-c,n+c),l>s?(c=s/l,e.arc(i,o,l,n+c,r-c,!0)):e.arc(i,o,s,n+ke,r-ke),e.closePath(),e.clip()}function wS(e){return fd(e,["outerStart","outerEnd","innerStart","innerEnd"])}function _S(e,t,n,r){const s=wS(e.options.borderRadius),i=(n-t)/2,o=Math.min(i,r*t/2),a=l=>{const c=(n-Math.min(i,l))*r/2;return Xe(l,0,Math.min(i,c))};return{outerStart:a(s.outerStart),outerEnd:a(s.outerEnd),innerStart:Xe(s.innerStart,0,o),innerEnd:Xe(s.innerEnd,0,o)}}function Pr(e,t,n,r){return{x:n+e*Math.cos(t),y:r+e*Math.sin(t)}}function SS(e,t,n,r){const{x:s,y:i,startAngle:o,pixelMargin:a,innerRadius:l}=t,c=Math.max(t.outerRadius+r+n-a,0),d=l>0?l+r+n+a:0;e.beginPath(),e.arc(s,i,c,o,o+ue),d>0&&(e.moveTo(s+Math.cos(o)*d,i+Math.sin(o)*d),e.arc(s,i,d,o+ue,o,!0)),e.closePath()}function ka(e,t,n,r,s,i){const{x:o,y:a,startAngle:l,pixelMargin:c,innerRadius:d}=t,{spacingMode:f="angular"}=t.options,h=s-l;if(i&&t.options.selfJoin&&Math.abs(h)>=ue-1e-4){SS(e,t,n,r);return}const p=Math.max(t.outerRadius+r+n-c,0);let v=d>0?d+r+n+c:0,m=0,w=0;const x=p>0?Math.max(.001,h*p-n/ae)/p:.001,g=(h-x)/2;if(r){const L=d>0?d-r:0,V=p>0?p-r:0,W=(L+V)/2,se=(()=>{const bt=W!==0?h*W/(W+r):h;return(h-bt)/2})(),U=W>0?Math.asin(Math.min(1,r/W)):0,be=Math.max(0,x/2-.001),G=Math.sin(be);if(f==="parallel"){if(v===0&&G>0){const Hi=r/G,Ze=Math.max(0,p-.001);v=Math.min(Hi,Ze)}const bt=Math.min(p>0?p*G:Number.POSITIVE_INFINITY,v>0?v*G:Number.POSITIVE_INFINITY),xs=Math.min(r,bt);m=p>0?Math.asin(Math.min(1,xs/p)):Math.min(be,U),w=v>0?Math.asin(Math.min(1,xs/v)):m}else f==="proportional"?(m=Math.min(be,se),w=Math.min(be,se)):(m=Math.min(be,U),w=Math.min(be,U))}const y=l+g+m,_=s-g-m,k=l+g+w,S=s-g-w,C=Math.min(_-y,S-k),{outerStart:j,outerEnd:P,innerStart:E,innerEnd:R}=_S(t,v,p,C),A=p-j,N=p-P,F=y+j/A,z=_-P/N,q=v+E,J=v+R,O=k+E/q,T=S-R/J;if(e.beginPath(),i){const L=(F+z)/2;if(e.arc(o,a,p,F,L),e.arc(o,a,p,L,z),P>0){const U=Pr(N,z,o,a);e.arc(U.x,U.y,P,z,_+ke)}const V=Pr(J,S,o,a);if(e.lineTo(V.x,V.y),R>0){const U=Pr(J,T,o,a);e.arc(U.x,U.y,R,S+ke,T+Math.PI)}const W=(S-R/v+(k+E/v))/2;if(e.arc(o,a,v,S-R/v,W,!0),e.arc(o,a,v,W,k+E/v,!0),E>0){const U=Pr(q,O,o,a);e.arc(U.x,U.y,E,O+Math.PI,k-ke)}const se=Pr(A,y,o,a);if(e.lineTo(se.x,se.y),j>0){const U=Pr(A,F,o,a);e.arc(U.x,U.y,j,y-ke,F)}}else{e.moveTo(o,a);const L=Math.cos(F)*p+o,V=Math.sin(F)*p+a;e.lineTo(L,V);const W=Math.cos(z)*p+o,se=Math.sin(z)*p+a;e.lineTo(W,se)}e.closePath()}function kS(e,t,n,r,s){const{fullCircles:i,startAngle:o,circumference:a}=t;let l=t.endAngle;if(i){ka(e,t,n,r,l,s);for(let c=0;c<i;++c)e.fill();isNaN(a)||(l=o+(a%ue||ue))}return ka(e,t,n,r,l,s),e.fill(),l}function CS(e,t,n,r,s){const{fullCircles:i,startAngle:o,circumference:a,options:l}=t,{borderWidth:c,borderJoinStyle:d,borderDash:f,borderDashOffset:h,borderRadius:p}=l,v=l.borderAlign==="inner";if(!c)return;e.setLineDash(f||[]),e.lineDashOffset=h,v?(e.lineWidth=c*2,e.lineJoin=d||"round"):(e.lineWidth=c,e.lineJoin=d||"bevel");let m=t.endAngle;const w=Math.abs(m-o)>=ue-1e-4;if(i){ka(e,t,n,r,m,s);for(let g=0;g<i;++g)e.stroke();isNaN(a)||(m=o+(a%ue||ue))}v&&bS(e,t,m),!(w&&t.innerRadius>0)&&l.selfJoin&&m-o>=ae&&p===0&&d!=="miter"&&yS(e,t,m),i||(ka(e,t,n,r,m,s),e.stroke())}class Hs extends Un{constructor(n){super();I(this,"circumference");I(this,"endAngle");I(this,"fullCircles");I(this,"innerRadius");I(this,"outerRadius");I(this,"pixelMargin");I(this,"startAngle");I(this,"circular");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,this.circular=!1,n&&Object.assign(this,n)}inRange(n,r,s){const i=this.getProps(["x","y"],s),{angle:o,distance:a}=lx(i,{x:n,y:r}),{startAngle:l,endAngle:c,innerRadius:d,outerRadius:f,circumference:h}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],s),p=(this.options.spacing+this.options.borderWidth)/2,v=K(h,c-l),m=ya(o,l,c)&&l!==c,w=v>=ue||m,x=ur(a,d+p,f+p);return w&&x}getCenterPoint(n){const{x:r,y:s,startAngle:i,endAngle:o,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],n),{offset:c,spacing:d}=this.options,f=(i+o)/2,h=(a+l+d+c)/2;return{x:r+Math.cos(f)*h,y:s+Math.sin(f)*h}}tooltipPosition(n){return this.getCenterPoint(n)}draw(n){const{options:r,circumference:s}=this,i=(r.offset||0)/4,o=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=s>ue?Math.floor(s/ue):0,s===0||this.innerRadius<0||this.outerRadius<0)return;n.save();const l=(this.startAngle+this.endAngle)/2;n.translate(Math.cos(l)*i,Math.sin(l)*i);const c=1-Math.sin(Math.min(ae,s||0)),d=i*c;n.fillStyle=r.backgroundColor,n.strokeStyle=r.borderColor,kS(n,this,d,o,a),CS(n,this,d,o,a),n.restore()}}I(Hs,"id","arc"),I(Hs,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,spacingMode:"angular",angle:void 0,circular:!0,selfJoin:!1}),I(Hs,"defaultRoutes",{backgroundColor:"backgroundColor"}),I(Hs,"descriptors",{_scriptable:!0,_indexable:n=>n!=="borderDash"});function zx(e,t){const{x:n,y:r,base:s,width:i,height:o}=e.getProps(["x","y","base","width","height"],t);let a,l,c,d,f;return e.horizontal?(f=o/2,a=Math.min(n,s),l=Math.max(n,s),c=r-f,d=r+f):(f=i/2,a=n-f,l=n+f,c=Math.min(r,s),d=Math.max(r,s)),{left:a,top:c,right:l,bottom:d}}function Mn(e,t,n,r){return e?0:Xe(t,n,r)}function jS(e,t,n){const r=e.options.borderWidth,s=e.borderSkipped,i=vx(r);return{t:Mn(s.top,i.top,0,n),r:Mn(s.right,i.right,0,t),b:Mn(s.bottom,i.bottom,0,n),l:Mn(s.left,i.left,0,t)}}function NS(e,t,n){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),s=e.options.borderRadius,i=Gr(s),o=Math.min(t,n),a=e.borderSkipped,l=r||Q(s);return{topLeft:Mn(!l||a.top||a.left,i.topLeft,0,o),topRight:Mn(!l||a.top||a.right,i.topRight,0,o),bottomLeft:Mn(!l||a.bottom||a.left,i.bottomLeft,0,o),bottomRight:Mn(!l||a.bottom||a.right,i.bottomRight,0,o)}}function ES(e){const t=zx(e),n=t.right-t.left,r=t.bottom-t.top,s=jS(e,n/2,r/2),i=NS(e,n/2,r/2);return{outer:{x:t.left,y:t.top,w:n,h:r,radius:i},inner:{x:t.left+s.l,y:t.top+s.t,w:n-s.l-s.r,h:r-s.t-s.b,radius:{topLeft:Math.max(0,i.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,i.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,i.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,i.bottomRight-Math.max(s.b,s.r))}}}}function Kl(e,t,n,r){const s=t===null,i=n===null,a=e&&!(s&&i)&&zx(e,r);return a&&(s||ur(t,a.left,a.right))&&(i||ur(n,a.top,a.bottom))}function MS(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function PS(e,t){e.rect(t.x,t.y,t.w,t.h)}function Xl(e,t,n={}){const r=e.x!==n.x?-t:0,s=e.y!==n.y?-t:0,i=(e.x+e.w!==n.x+n.w?t:0)-r,o=(e.y+e.h!==n.y+n.h?t:0)-s;return{x:e.x+r,y:e.y+s,w:e.w+i,h:e.h+o,radius:e.radius}}class Wo extends Un{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:n,options:{borderColor:r,backgroundColor:s}}=this,{inner:i,outer:o}=ES(this),a=MS(o.radius)?wa:PS;t.save(),(o.w!==i.w||o.h!==i.h)&&(t.beginPath(),a(t,Xl(o,n,i)),t.clip(),a(t,Xl(i,-n,o)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Xl(i,n)),t.fillStyle=s,t.fill(),t.restore()}inRange(t,n,r){return Kl(this,t,n,r)}inXRange(t,n){return Kl(this,t,null,n)}inYRange(t,n){return Kl(this,null,t,n)}getCenterPoint(t){const{x:n,y:r,base:s,horizontal:i}=this.getProps(["x","y","base","horizontal"],t);return{x:i?(n+s)/2:n,y:i?r:(r+s)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}I(Wo,"id","bar"),I(Wo,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),I(Wo,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});const qh=(e,t)=>{let{boxHeight:n=t,boxWidth:r=t}=e;return e.usePointStyle&&(n=Math.min(n,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:n,itemHeight:Math.max(t,n)}},RS=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class Jh extends Un{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,n,r){this.maxWidth=t,this.maxHeight=n,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let n=oe(t.generateLabels,[this.chart],this)||[];t.filter&&(n=n.filter(r=>t.filter(r,this.chart.data))),t.sort&&(n=n.sort((r,s)=>t.sort(r,s,this.chart.data))),this.options.reverse&&n.reverse(),this.legendItems=n}fit(){const{options:t,ctx:n}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,s=Qe(r.font),i=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=qh(r,i);let c,d;n.font=s.string,this.isHorizontal()?(c=this.maxWidth,d=this._fitRows(o,i,a,l)+10):(d=this.maxHeight,c=this._fitCols(o,s,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,n,r,s){const{ctx:i,maxWidth:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],d=s+a;let f=t;i.textAlign="left",i.textBaseline="middle";let h=-1,p=-d;return this.legendItems.forEach((v,m)=>{const w=r+n/2+i.measureText(v.text).width;(m===0||c[c.length-1]+w+2*a>o)&&(f+=d,c[c.length-(m>0?0:1)]=0,p+=d,h++),l[m]={left:0,top:p,row:h,width:w,height:s},c[c.length-1]+=w+a}),f}_fitCols(t,n,r,s){const{ctx:i,maxHeight:o,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],d=o-t;let f=a,h=0,p=0,v=0,m=0;return this.legendItems.forEach((w,x)=>{const{itemWidth:g,itemHeight:y}=OS(r,n,i,w,s);x>0&&p+y+2*a>d&&(f+=h+a,c.push({width:h,height:p}),v+=h+a,m++,h=p=0),l[x]={left:v,top:p,col:m,width:g,height:y},h=Math.max(h,g),p+=y+a}),f+=h,c.push({width:h,height:p}),f}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:n,options:{align:r,labels:{padding:s},rtl:i}}=this,o=qr(i,this.left,this.width);if(this.isHorizontal()){let a=0,l=rt(r,this.left+s,this.right-this.lineWidths[a]);for(const c of n)a!==c.row&&(a=c.row,l=rt(r,this.left+s,this.right-this.lineWidths[a])),c.top+=this.top+t+s,c.left=o.leftForLtr(o.x(l),c.width),l+=c.width+s}else{let a=0,l=rt(r,this.top+t+s,this.bottom-this.columnSizes[a].height);for(const c of n)c.col!==a&&(a=c.col,l=rt(r,this.top+t+s,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+s,c.left=o.leftForLtr(o.x(c.left),c.width),l+=c.height+s}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;ud(t,this),this._draw(),dd(t)}}_draw(){const{options:t,columnSizes:n,lineWidths:r,ctx:s}=this,{align:i,labels:o}=t,a=ve.color,l=qr(t.rtl,this.left,this.width),c=Qe(o.font),{padding:d}=o,f=c.size,h=f/2;let p;this.drawTitle(),s.textAlign=l.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:v,boxHeight:m,itemHeight:w}=qh(o,f),x=function(S,C,j){if(isNaN(v)||v<=0||isNaN(m)||m<0)return;s.save();const P=K(j.lineWidth,1);if(s.fillStyle=K(j.fillStyle,a),s.lineCap=K(j.lineCap,"butt"),s.lineDashOffset=K(j.lineDashOffset,0),s.lineJoin=K(j.lineJoin,"miter"),s.lineWidth=P,s.strokeStyle=K(j.strokeStyle,a),s.setLineDash(K(j.lineDash,[])),o.usePointStyle){const E={radius:m*Math.SQRT2/2,pointStyle:j.pointStyle,rotation:j.rotation,borderWidth:P},R=l.xPlus(S,v/2),A=C+h;mx(s,E,R,A,o.pointStyleWidth&&v)}else{const E=C+Math.max((f-m)/2,0),R=l.leftForLtr(S,v),A=Gr(j.borderRadius);s.beginPath(),Object.values(A).some(N=>N!==0)?wa(s,{x:R,y:E,w:v,h:m,radius:A}):s.rect(R,E,v,m),s.fill(),P!==0&&s.stroke()}s.restore()},g=function(S,C,j){ba(s,j.text,S,C+w/2,c,{strikethrough:j.hidden,textAlign:l.textAlign(j.textAlign)})},y=this.isHorizontal(),_=this._computeTitleHeight();y?p={x:rt(i,this.left+d,this.right-r[0]),y:this.top+d+_,line:0}:p={x:this.left+d,y:rt(i,this.top+_+d,this.bottom-n[0].height),line:0},Sx(this.ctx,t.textDirection);const k=w+d;this.legendItems.forEach((S,C)=>{s.strokeStyle=S.fontColor,s.fillStyle=S.fontColor;const j=s.measureText(S.text).width,P=l.textAlign(S.textAlign||(S.textAlign=o.textAlign)),E=v+h+j;let R=p.x,A=p.y;l.setWidth(this.width),y?C>0&&R+E+d>this.right&&(A=p.y+=k,p.line++,R=p.x=rt(i,this.left+d,this.right-r[p.line])):C>0&&A+k>this.bottom&&(R=p.x=R+n[p.line].width+d,p.line++,A=p.y=rt(i,this.top+_+d,this.bottom-n[p.line].height));const N=l.x(R);if(x(N,A,S),R=e1(P,R+v+h,y?R+E:this.right,t.rtl),g(l.x(R),A,S),y)p.x+=E+d;else if(typeof S.text!="string"){const F=c.lineHeight;p.y+=Ix(S,F)+d}else p.y+=k}),kx(this.ctx,t.textDirection)}drawTitle(){const t=this.options,n=t.title,r=Qe(n.font),s=Mt(n.padding);if(!n.display)return;const i=qr(t.rtl,this.left,this.width),o=this.ctx,a=n.position,l=r.size/2,c=s.top+l;let d,f=this.left,h=this.width;if(this.isHorizontal())h=Math.max(...this.lineWidths),d=this.top+c,f=rt(t.align,f,this.right-h);else{const v=this.columnSizes.reduce((m,w)=>Math.max(m,w.height),0);d=c+rt(t.align,this.top,this.bottom-v-t.labels.padding-this._computeTitleHeight())}const p=rt(a,f,f+h);o.textAlign=i.textAlign(hx(a)),o.textBaseline="middle",o.strokeStyle=n.color,o.fillStyle=n.color,o.font=r.string,ba(o,n.text,p,d,r)}_computeTitleHeight(){const t=this.options.title,n=Qe(t.font),r=Mt(t.padding);return t.display?n.lineHeight+r.height:0}_getLegendItemAt(t,n){let r,s,i;if(ur(t,this.left,this.right)&&ur(n,this.top,this.bottom)){for(i=this.legendHitBoxes,r=0;r<i.length;++r)if(s=i[r],ur(t,s.left,s.left+s.width)&&ur(n,s.top,s.top+s.height))return this.legendItems[r]}return null}handleEvent(t){const n=this.options;if(!LS(t.type,n))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const s=this._hoveredItem,i=RS(s,r);s&&!i&&oe(n.onLeave,[t,s,this],this),this._hoveredItem=r,r&&!i&&oe(n.onHover,[t,r,this],this)}else r&&oe(n.onClick,[t,r,this],this)}}function OS(e,t,n,r,s){const i=DS(r,e,t,n),o=TS(s,r,t.lineHeight);return{itemWidth:i,itemHeight:o}}function DS(e,t,n,r){let s=e.text;return s&&typeof s!="string"&&(s=s.reduce((i,o)=>i.length>o.length?i:o)),t+n.size/2+r.measureText(s).width}function TS(e,t,n){let r=e;return typeof t.text!="string"&&(r=Ix(t,n)),r}function Ix(e,t){const n=e.text?e.text.length:0;return t*n}function LS(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var AS={id:"legend",_element:Jh,start(e,t,n){const r=e.legend=new Jh({ctx:e.ctx,options:n,chart:e});En.configure(e,r,n),En.addBox(e,r)},stop(e){En.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,n){const r=e.legend;En.configure(e,r,n),r.options=n},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,n){const r=t.datasetIndex,s=n.chart;s.isDatasetVisible(r)?(s.hide(r),t.hidden=!0):(s.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:n,pointStyle:r,textAlign:s,color:i,useBorderRadius:o,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(n?0:void 0),d=Mt(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:i,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:c.borderColor,pointStyle:r||c.pointStyle,rotation:c.rotation,textAlign:s||c.textAlign,borderRadius:o&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};const Vs={average(e){if(!e.length)return!1;let t,n,r=new Set,s=0,i=0;for(t=0,n=e.length;t<n;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),s+=l.y,++i}}return i===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:s/i}},nearest(e,t){if(!e.length)return!1;let n=t.x,r=t.y,s=Number.POSITIVE_INFINITY,i,o,a;for(i=0,o=e.length;i<o;++i){const l=e[i].element;if(l&&l.hasValue()){const c=l.getCenterPoint(),d=Xw(t,c);d<s&&(s=d,a=l)}}if(a){const l=a.tooltipPosition();n=l.x,r=l.y}return{x:n,y:r}}};function It(e,t){return t&&(Ee(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function Gt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
83
- `)>-1?e.split(`
84
- `):e}function zS(e,t){const{element:n,datasetIndex:r,index:s}=t,i=e.getDatasetMeta(r).controller,{label:o,value:a}=i.getLabelAndValue(s);return{chart:e,label:o,parsed:i.getParsed(s),raw:e.data.datasets[r].data[s],formattedValue:a,dataset:i.getDataset(),dataIndex:s,datasetIndex:r,element:n}}function Zh(e,t){const n=e.chart.ctx,{body:r,footer:s,title:i}=e,{boxWidth:o,boxHeight:a}=t,l=Qe(t.bodyFont),c=Qe(t.titleFont),d=Qe(t.footerFont),f=i.length,h=s.length,p=r.length,v=Mt(t.padding);let m=v.height,w=0,x=r.reduce((_,k)=>_+k.before.length+k.lines.length+k.after.length,0);if(x+=e.beforeBody.length+e.afterBody.length,f&&(m+=f*c.lineHeight+(f-1)*t.titleSpacing+t.titleMarginBottom),x){const _=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=p*_+(x-p)*l.lineHeight+(x-1)*t.bodySpacing}h&&(m+=t.footerMarginTop+h*d.lineHeight+(h-1)*t.footerSpacing);let g=0;const y=function(_){w=Math.max(w,n.measureText(_).width+g)};return n.save(),n.font=c.string,Z(e.title,y),n.font=l.string,Z(e.beforeBody.concat(e.afterBody),y),g=t.displayColors?o+2+t.boxPadding:0,Z(r,_=>{Z(_.before,y),Z(_.lines,y),Z(_.after,y)}),g=0,n.font=d.string,Z(e.footer,y),n.restore(),w+=v.width,{width:w,height:m}}function IS(e,t){const{y:n,height:r}=t;return n<r/2?"top":n>e.height-r/2?"bottom":"center"}function FS(e,t,n,r){const{x:s,width:i}=r,o=n.caretSize+n.caretPadding;if(e==="left"&&s+i+o>t.width||e==="right"&&s-i-o<0)return!0}function BS(e,t,n,r){const{x:s,width:i}=n,{width:o,chartArea:{left:a,right:l}}=e;let c="center";return r==="center"?c=s<=(a+l)/2?"left":"right":s<=i/2?c="left":s>=o-i/2&&(c="right"),FS(c,e,t,n)&&(c="center"),c}function ep(e,t,n){const r=n.yAlign||t.yAlign||IS(e,n);return{xAlign:n.xAlign||t.xAlign||BS(e,t,n,r),yAlign:r}}function WS(e,t){let{x:n,width:r}=e;return t==="right"?n-=r:t==="center"&&(n-=r/2),n}function $S(e,t,n){let{y:r,height:s}=e;return t==="top"?r+=n:t==="bottom"?r-=s+n:r-=s/2,r}function tp(e,t,n,r){const{caretSize:s,caretPadding:i,cornerRadius:o}=e,{xAlign:a,yAlign:l}=n,c=s+i,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:p}=Gr(o);let v=WS(t,a);const m=$S(t,l,c);return l==="center"?a==="left"?v+=c:a==="right"&&(v-=c):a==="left"?v-=Math.max(d,h)+s:a==="right"&&(v+=Math.max(f,p)+s),{x:Xe(v,0,r.width-t.width),y:Xe(m,0,r.height-t.height)}}function _o(e,t,n){const r=Mt(n.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function np(e){return It([],Gt(e))}function HS(e,t,n){return hs(e,{tooltip:t,tooltipItems:n,type:"tooltip"})}function rp(e,t){const n=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return n?e.override(n):e}const Fx={beforeTitle:Xt,title(e){if(e.length>0){const t=e[0],n=t.chart.data.labels,r=n?n.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return n[t.dataIndex]}return""},afterTitle:Xt,beforeBody:Xt,beforeLabel:Xt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const n=e.formattedValue;return ne(n)||(t+=n),t},labelColor(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:n.borderColor,backgroundColor:n.backgroundColor,borderWidth:n.borderWidth,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const n=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:n.pointStyle,rotation:n.rotation}},afterLabel:Xt,afterBody:Xt,beforeFooter:Xt,footer:Xt,afterFooter:Xt};function Ve(e,t,n,r){const s=e[t].call(n,r);return typeof s>"u"?Fx[t].call(n,r):s}class ru extends Un{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const n=this.chart,r=this.options.setContext(this.getContext()),s=r.enabled&&n.options.animation&&r.animations,i=new Cx(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(i)),i}getContext(){return this.$context||(this.$context=HS(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,n){const{callbacks:r}=n,s=Ve(r,"beforeTitle",this,t),i=Ve(r,"title",this,t),o=Ve(r,"afterTitle",this,t);let a=[];return a=It(a,Gt(s)),a=It(a,Gt(i)),a=It(a,Gt(o)),a}getBeforeBody(t,n){return np(Ve(n.callbacks,"beforeBody",this,t))}getBody(t,n){const{callbacks:r}=n,s=[];return Z(t,i=>{const o={before:[],lines:[],after:[]},a=rp(r,i);It(o.before,Gt(Ve(a,"beforeLabel",this,i))),It(o.lines,Ve(a,"label",this,i)),It(o.after,Gt(Ve(a,"afterLabel",this,i))),s.push(o)}),s}getAfterBody(t,n){return np(Ve(n.callbacks,"afterBody",this,t))}getFooter(t,n){const{callbacks:r}=n,s=Ve(r,"beforeFooter",this,t),i=Ve(r,"footer",this,t),o=Ve(r,"afterFooter",this,t);let a=[];return a=It(a,Gt(s)),a=It(a,Gt(i)),a=It(a,Gt(o)),a}_createItems(t){const n=this._active,r=this.chart.data,s=[],i=[],o=[];let a=[],l,c;for(l=0,c=n.length;l<c;++l)a.push(zS(this.chart,n[l]));return t.filter&&(a=a.filter((d,f,h)=>t.filter(d,f,h,r))),t.itemSort&&(a=a.sort((d,f)=>t.itemSort(d,f,r))),Z(a,d=>{const f=rp(t.callbacks,d);s.push(Ve(f,"labelColor",this,d)),i.push(Ve(f,"labelPointStyle",this,d)),o.push(Ve(f,"labelTextColor",this,d))}),this.labelColors=s,this.labelPointStyles=i,this.labelTextColors=o,this.dataPoints=a,a}update(t,n){const r=this.options.setContext(this.getContext()),s=this._active;let i,o=[];if(!s.length)this.opacity!==0&&(i={opacity:0});else{const a=Vs[r.position].call(this,s,this._eventPosition);o=this._createItems(r),this.title=this.getTitle(o,r),this.beforeBody=this.getBeforeBody(o,r),this.body=this.getBody(o,r),this.afterBody=this.getAfterBody(o,r),this.footer=this.getFooter(o,r);const l=this._size=Zh(this,r),c=Object.assign({},a,l),d=ep(this.chart,r,c),f=tp(r,c,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,i={opacity:1,x:f.x,y:f.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=o,this.$context=void 0,i&&this._resolveAnimations().update(this,i),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:n})}drawCaret(t,n,r,s){const i=this.getCaretPosition(t,r,s);n.lineTo(i.x1,i.y1),n.lineTo(i.x2,i.y2),n.lineTo(i.x3,i.y3)}getCaretPosition(t,n,r){const{xAlign:s,yAlign:i}=this,{caretSize:o,cornerRadius:a}=r,{topLeft:l,topRight:c,bottomLeft:d,bottomRight:f}=Gr(a),{x:h,y:p}=t,{width:v,height:m}=n;let w,x,g,y,_,k;return i==="center"?(_=p+m/2,s==="left"?(w=h,x=w-o,y=_+o,k=_-o):(w=h+v,x=w+o,y=_-o,k=_+o),g=w):(s==="left"?x=h+Math.max(l,d)+o:s==="right"?x=h+v-Math.max(c,f)-o:x=this.caretX,i==="top"?(y=p,_=y-o,w=x-o,g=x+o):(y=p+m,_=y+o,w=x+o,g=x-o),k=y),{x1:w,x2:x,x3:g,y1:y,y2:_,y3:k}}drawTitle(t,n,r){const s=this.title,i=s.length;let o,a,l;if(i){const c=qr(r.rtl,this.x,this.width);for(t.x=_o(this,r.titleAlign,r),n.textAlign=c.textAlign(r.titleAlign),n.textBaseline="middle",o=Qe(r.titleFont),a=r.titleSpacing,n.fillStyle=r.titleColor,n.font=o.string,l=0;l<i;++l)n.fillText(s[l],c.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+a,l+1===i&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,n,r,s,i){const o=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:c}=i,d=Qe(i.bodyFont),f=_o(this,"left",i),h=s.x(f),p=l<d.lineHeight?(d.lineHeight-l)/2:0,v=n.y+p;if(i.usePointStyle){const m={radius:Math.min(c,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},w=s.leftForLtr(h,c)+c/2,x=v+l/2;t.strokeStyle=i.multiKeyBackground,t.fillStyle=i.multiKeyBackground,vh(t,m,w,x),t.strokeStyle=o.borderColor,t.fillStyle=o.backgroundColor,vh(t,m,w,x)}else{t.lineWidth=Q(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,t.strokeStyle=o.borderColor,t.setLineDash(o.borderDash||[]),t.lineDashOffset=o.borderDashOffset||0;const m=s.leftForLtr(h,c),w=s.leftForLtr(s.xPlus(h,1),c-2),x=Gr(o.borderRadius);Object.values(x).some(g=>g!==0)?(t.beginPath(),t.fillStyle=i.multiKeyBackground,wa(t,{x:m,y:v,w:c,h:l,radius:x}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),wa(t,{x:w,y:v+1,w:c-2,h:l-2,radius:x}),t.fill()):(t.fillStyle=i.multiKeyBackground,t.fillRect(m,v,c,l),t.strokeRect(m,v,c,l),t.fillStyle=o.backgroundColor,t.fillRect(w,v+1,c-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,n,r){const{body:s}=this,{bodySpacing:i,bodyAlign:o,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:d}=r,f=Qe(r.bodyFont);let h=f.lineHeight,p=0;const v=qr(r.rtl,this.x,this.width),m=function(j){n.fillText(j,v.x(t.x+p),t.y+h/2),t.y+=h+i},w=v.textAlign(o);let x,g,y,_,k,S,C;for(n.textAlign=o,n.textBaseline="middle",n.font=f.string,t.x=_o(this,w,r),n.fillStyle=r.bodyColor,Z(this.beforeBody,m),p=a&&w!=="right"?o==="center"?c/2+d:c+2+d:0,_=0,S=s.length;_<S;++_){for(x=s[_],g=this.labelTextColors[_],n.fillStyle=g,Z(x.before,m),y=x.lines,a&&y.length&&(this._drawColorBox(n,t,_,v,r),h=Math.max(f.lineHeight,l)),k=0,C=y.length;k<C;++k)m(y[k]),h=f.lineHeight;Z(x.after,m)}p=0,h=f.lineHeight,Z(this.afterBody,m),t.y-=i}drawFooter(t,n,r){const s=this.footer,i=s.length;let o,a;if(i){const l=qr(r.rtl,this.x,this.width);for(t.x=_o(this,r.footerAlign,r),t.y+=r.footerMarginTop,n.textAlign=l.textAlign(r.footerAlign),n.textBaseline="middle",o=Qe(r.footerFont),n.fillStyle=r.footerColor,n.font=o.string,a=0;a<i;++a)n.fillText(s[a],l.x(t.x),t.y+o.lineHeight/2),t.y+=o.lineHeight+r.footerSpacing}}drawBackground(t,n,r,s){const{xAlign:i,yAlign:o}=this,{x:a,y:l}=t,{width:c,height:d}=r,{topLeft:f,topRight:h,bottomLeft:p,bottomRight:v}=Gr(s.cornerRadius);n.fillStyle=s.backgroundColor,n.strokeStyle=s.borderColor,n.lineWidth=s.borderWidth,n.beginPath(),n.moveTo(a+f,l),o==="top"&&this.drawCaret(t,n,r,s),n.lineTo(a+c-h,l),n.quadraticCurveTo(a+c,l,a+c,l+h),o==="center"&&i==="right"&&this.drawCaret(t,n,r,s),n.lineTo(a+c,l+d-v),n.quadraticCurveTo(a+c,l+d,a+c-v,l+d),o==="bottom"&&this.drawCaret(t,n,r,s),n.lineTo(a+p,l+d),n.quadraticCurveTo(a,l+d,a,l+d-p),o==="center"&&i==="left"&&this.drawCaret(t,n,r,s),n.lineTo(a,l+f),n.quadraticCurveTo(a,l,a+f,l),n.closePath(),n.fill(),s.borderWidth>0&&n.stroke()}_updateAnimationTarget(t){const n=this.chart,r=this.$animations,s=r&&r.x,i=r&&r.y;if(s||i){const o=Vs[t.position].call(this,this._active,this._eventPosition);if(!o)return;const a=this._size=Zh(this,t),l=Object.assign({},o,this._size),c=ep(n,t,l),d=tp(t,l,c,n);(s._to!==d.x||i._to!==d.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=o.x,this.caretY=o.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){const n=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(n);const s={width:this.width,height:this.height},i={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const o=Mt(n.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;n.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(i,t,s,n),Sx(t,n.textDirection),i.y+=o.top,this.drawTitle(i,t,n),this.drawBody(i,t,n),this.drawFooter(i,t,n),kx(t,n.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,n){const r=this._active,s=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),i=!ga(r,s),o=this._positionChanged(s,n);(i||o)&&(this._active=s,this._eventPosition=n,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,n,r=!0){if(n&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,i=this._active||[],o=this._getActiveElements(t,i,n,r),a=this._positionChanged(o,t),l=n||!ga(o,i)||a;return l&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,n))),l}_getActiveElements(t,n,r,s){const i=this.options;if(t.type==="mouseout")return[];if(!s)return n.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const o=this.chart.getElementsAtEventForMode(t,i.mode,i,r);return i.reverse&&o.reverse(),o}_positionChanged(t,n){const{caretX:r,caretY:s,options:i}=this,o=Vs[i.position].call(this,t,n);return o!==!1&&(r!==o.x||s!==o.y)}}I(ru,"positioners",Vs);var VS={id:"tooltip",_element:ru,positioners:Vs,afterInit(e,t,n){n&&(e.tooltip=new ru({chart:e,options:n}))},beforeUpdate(e,t,n){e.tooltip&&e.tooltip.initialize(n)},reset(e,t,n){e.tooltip&&e.tooltip.initialize(n)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const n={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...n,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",n)}},afterEvent(e,t){if(e.tooltip){const n=t.replay;e.tooltip.handleEvent(t.event,n,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Fx},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const US=(e,t,n,r)=>(typeof t=="string"?(n=e.push(t)-1,r.unshift({index:n,label:t})):isNaN(t)&&(n=null),n);function YS(e,t,n,r){const s=e.indexOf(t);if(s===-1)return US(e,t,n,r);const i=e.lastIndexOf(t);return s!==i?n:s}const KS=(e,t)=>e===null?null:Xe(Math.round(e),0,t);function sp(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class su extends ps{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const n=this._addedLabels;if(n.length){const r=this.getLabels();for(const{index:s,label:i}of n)r[s]===i&&r.splice(s,1);this._addedLabels=[]}super.init(t)}parse(t,n){if(ne(t))return null;const r=this.getLabels();return n=isFinite(n)&&r[n]===t?n:YS(r,t,K(n,t),this._addedLabels),KS(n,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:n}=this.getUserBounds();let{min:r,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),n||(s=this.getLabels().length-1)),this.min=r,this.max=s}buildTicks(){const t=this.min,n=this.max,r=this.options.offset,s=[];let i=this.getLabels();i=t===0&&n===i.length-1?i:i.slice(t,n+1),this._valueRange=Math.max(i.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let o=t;o<=n;o++)s.push({value:o});return s}getLabelForValue(t){return sp.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const n=this.ticks;return t<0||t>n.length-1?null:this.getPixelForValue(n[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}I(su,"id","category"),I(su,"defaults",{ticks:{callback:sp}});function XS(e,t){const n=[],{bounds:s,step:i,min:o,max:a,precision:l,count:c,maxTicks:d,maxDigits:f,includeBounds:h}=e,p=i||1,v=d-1,{min:m,max:w}=t,x=!ne(o),g=!ne(a),y=!ne(c),_=(w-m)/(f+1);let k=ch((w-m)/v/p)*p,S,C,j,P;if(k<1e-14&&!x&&!g)return[{value:m},{value:w}];P=Math.ceil(w/k)-Math.floor(m/k),P>v&&(k=ch(P*k/v/p)*p),ne(l)||(S=Math.pow(10,l),k=Math.ceil(k*S)/S),s==="ticks"?(C=Math.floor(m/k)*k,j=Math.ceil(w/k)*k):(C=m,j=w),x&&g&&i&&Uw((a-o)/i,k/1e3)?(P=Math.round(Math.min((a-o)/k,d)),k=(a-o)/P,C=o,j=a):y?(C=x?o:C,j=g?a:j,P=c-1,k=(j-C)/P):(P=(j-C)/k,zo(P,Math.round(P),k/1e3)?P=Math.round(P):P=Math.ceil(P));const E=Math.max(uh(k),uh(C));S=Math.pow(10,ne(l)?E:l),C=Math.round(C*S)/S,j=Math.round(j*S)/S;let R=0;for(x&&(h&&C!==o?(n.push({value:o}),C<o&&R++,zo(Math.round((C+R*k)*S)/S,o,ip(o,_,e))&&R++):C<o&&R++);R<P;++R){const A=Math.round((C+R*k)*S)/S;if(g&&A>a)break;n.push({value:A})}return g&&h&&j!==a?n.length&&zo(n[n.length-1].value,a,ip(a,_,e))?n[n.length-1].value=a:n.push({value:a}):(!g||j===a)&&n.push({value:j}),n}function ip(e,t,{horizontal:n,minRotation:r}){const s=nn(r),i=(n?Math.sin(s):Math.cos(s))||.001,o=.75*t*(""+e).length;return Math.min(t/i,o)}class QS extends ps{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,n){return ne(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:n,maxDefined:r}=this.getUserBounds();let{min:s,max:i}=this;const o=l=>s=n?s:l,a=l=>i=r?i:l;if(t){const l=Bn(s),c=Bn(i);l<0&&c<0?a(0):l>0&&c>0&&o(0)}if(s===i){let l=i===0?1:Math.abs(i*.05);a(i+l),t||o(s-l)}this.min=s,this.max=i}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:n,stepSize:r}=t,s;return r?(s=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,s>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${s} ticks. Limiting to 1000.`),s=1e3)):(s=this.computeTickLimit(),n=n||11),n&&(s=Math.min(n,s)),s}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,n=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const s={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:n.precision,step:n.stepSize,count:n.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:n.minRotation||0,includeBounds:n.includeBounds!==!1},i=this._range||this,o=XS(s,i);return t.bounds==="ticks"&&Yw(o,this,"value"),t.reverse?(o.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),o}configure(){const t=this.ticks;let n=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const s=(r-n)/Math.max(t.length-1,1)/2;n-=s,r+=s}this._startValue=n,this._endValue=r,this._valueRange=r-n}getLabelForValue(t){return cd(t,this.chart.options.locale,this.options.ticks.format)}}class iu extends QS{determineDataLimits(){const{min:t,max:n}=this.getMinMax(!0);this.min=yt(t)?t:0,this.max=yt(n)?n:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),n=t?this.width:this.height,r=nn(this.options.ticks.minRotation),s=(t?Math.sin(r):Math.cos(r))||.001,i=this._resolveTickFontOptions(0);return Math.ceil(n/Math.min(40,i.lineHeight/s))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}I(iu,"id","linear"),I(iu,"defaults",{ticks:{callback:gx.formatters.numeric}});const el={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ye=Object.keys(el);function op(e,t){return e-t}function ap(e,t){if(ne(t))return null;const n=e._adapter,{parser:r,round:s,isoWeekday:i}=e._parseOpts;let o=t;return typeof r=="function"&&(o=r(o)),yt(o)||(o=typeof r=="string"?n.parse(o,r):n.parse(o)),o===null?null:(s&&(o=s==="week"&&(va(i)||i===!0)?n.startOf(o,"isoWeek",i):n.startOf(o,s)),+o)}function lp(e,t,n,r){const s=Ye.length;for(let i=Ye.indexOf(e);i<s-1;++i){const o=el[Ye[i]],a=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((n-t)/(a*o.size))<=r)return Ye[i]}return Ye[s-1]}function GS(e,t,n,r,s){for(let i=Ye.length-1;i>=Ye.indexOf(n);i--){const o=Ye[i];if(el[o].common&&e._adapter.diff(s,r,o)>=t-1)return o}return Ye[n?Ye.indexOf(n):0]}function qS(e){for(let t=Ye.indexOf(e)+1,n=Ye.length;t<n;++t)if(el[Ye[t]].common)return Ye[t]}function cp(e,t,n){if(!n)e[t]=!0;else if(n.length){const{lo:r,hi:s}=ld(n,t),i=n[r]>=t?n[r]:n[s];e[i]=!0}}function JS(e,t,n,r){const s=e._adapter,i=+s.startOf(t[0].value,r),o=t[t.length-1].value;let a,l;for(a=i;a<=o;a=+s.add(a,1,r))l=n[a],l>=0&&(t[l].major=!0);return t}function up(e,t,n){const r=[],s={},i=t.length;let o,a;for(o=0;o<i;++o)a=t[o],s[a]=o,r.push({value:a,major:!1});return i===0||!n?r:JS(e,r,s,n)}class Ca extends ps{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,n={}){const r=t.time||(t.time={}),s=this._adapter=new u_._date(t.adapters.date);s.init(n),ei(r.displayFormats,s.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=n.normalized}parse(t,n){return t===void 0?null:ap(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,n=this._adapter,r=t.time.unit||"day";let{min:s,max:i,minDefined:o,maxDefined:a}=this.getUserBounds();function l(c){!o&&!isNaN(c.min)&&(s=Math.min(s,c.min)),!a&&!isNaN(c.max)&&(i=Math.max(i,c.max))}(!o||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),s=yt(s)&&!isNaN(s)?s:+n.startOf(Date.now(),r),i=yt(i)&&!isNaN(i)?i:+n.endOf(Date.now(),r)+1,this.min=Math.min(s,i-1),this.max=Math.max(s+1,i)}_getLabelBounds(){const t=this.getLabelTimestamps();let n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(n=t[0],r=t[t.length-1]),{min:n,max:r}}buildTicks(){const t=this.options,n=t.time,r=t.ticks,s=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const i=this.min,o=this.max,a=qw(s,i,o);return this._unit=n.unit||(r.autoSkip?lp(n.minUnit,this.min,this.max,this._getLabelCapacity(i)):GS(this,a.length,n.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:qS(this._unit),this.initOffsets(s),t.reverse&&a.reverse(),up(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let n=0,r=0,s,i;this.options.offset&&t.length&&(s=this.getDecimalForValue(t[0]),t.length===1?n=1-s:n=(this.getDecimalForValue(t[1])-s)/2,i=this.getDecimalForValue(t[t.length-1]),t.length===1?r=i:r=(i-this.getDecimalForValue(t[t.length-2]))/2);const o=t.length<3?.5:.25;n=Xe(n,0,o),r=Xe(r,0,o),this._offsets={start:n,end:r,factor:1/(n+1+r)}}_generate(){const t=this._adapter,n=this.min,r=this.max,s=this.options,i=s.time,o=i.unit||lp(i.minUnit,n,r,this._getLabelCapacity(n)),a=K(s.ticks.stepSize,1),l=o==="week"?i.isoWeekday:!1,c=va(l)||l===!0,d={};let f=n,h,p;if(c&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,c?"day":o),t.diff(r,n,o)>1e5*a)throw new Error(n+" and "+r+" are too far apart with stepSize of "+a+" "+o);const v=s.ticks.source==="data"&&this.getDataTimestamps();for(h=f,p=0;h<r;h=+t.add(h,a,o),p++)cp(d,h,v);return(h===r||s.bounds==="ticks"||p===1)&&cp(d,h,v),Object.keys(d).sort(op).map(m=>+m)}getLabelForValue(t){const n=this._adapter,r=this.options.time;return r.tooltipFormat?n.format(t,r.tooltipFormat):n.format(t,r.displayFormats.datetime)}format(t,n){const s=this.options.time.displayFormats,i=this._unit,o=n||s[i];return this._adapter.format(t,o)}_tickFormatFunction(t,n,r,s){const i=this.options,o=i.ticks.callback;if(o)return oe(o,[t,n,r],this);const a=i.time.displayFormats,l=this._unit,c=this._majorUnit,d=l&&a[l],f=c&&a[c],h=r[n],p=c&&f&&h&&h.major;return this._adapter.format(t,s||(p?f:d))}generateTickLabels(t){let n,r,s;for(n=0,r=t.length;n<r;++n)s=t[n],s.label=this._tickFormatFunction(s.value,n,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const n=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((n.start+r)*n.factor)}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const n=this.options.ticks,r=this.ctx.measureText(t).width,s=nn(this.isHorizontal()?n.maxRotation:n.minRotation),i=Math.cos(s),o=Math.sin(s),a=this._resolveTickFontOptions(0).size;return{w:r*i+a*o,h:r*o+a*i}}_getLabelCapacity(t){const n=this.options.time,r=n.displayFormats,s=r[n.unit]||r.millisecond,i=this._tickFormatFunction(t,0,up(this,[t],this._majorUnit),s),o=this._getLabelSize(i),a=Math.floor(this.isHorizontal()?this.width/o.w:this.height/o.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],n,r;if(t.length)return t;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(n=0,r=s.length;n<r;++n)t=t.concat(s[n].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let n,r;if(t.length)return t;const s=this.getLabels();for(n=0,r=s.length;n<r;++n)t.push(ap(this,s[n]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return ux(t.sort(op))}}I(Ca,"id","time"),I(Ca,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function So(e,t,n){let r=0,s=e.length-1,i,o,a,l;n?(t>=e[r].pos&&t<=e[s].pos&&({lo:r,hi:s}=Zc(e,"pos",t)),{pos:i,time:a}=e[r],{pos:o,time:l}=e[s]):(t>=e[r].time&&t<=e[s].time&&({lo:r,hi:s}=Zc(e,"time",t)),{time:i,pos:a}=e[r],{time:o,pos:l}=e[s]);const c=o-i;return c?a+(l-a)*(t-i)/c:a}class dp extends Ca{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),n=this._table=this.buildLookupTable(t);this._minPos=So(n,this.min),this._tableRange=So(n,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:n,max:r}=this,s=[],i=[];let o,a,l,c,d;for(o=0,a=t.length;o<a;++o)c=t[o],c>=n&&c<=r&&s.push(c);if(s.length<2)return[{time:n,pos:0},{time:r,pos:1}];for(o=0,a=s.length;o<a;++o)d=s[o+1],l=s[o-1],c=s[o],Math.round((d+l)/2)!==c&&i.push({time:c,pos:o/(a-1)});return i}_generate(){const t=this.min,n=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(n)||r.length===1)&&r.push(n),r.sort((s,i)=>s-i)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const n=this.getDataTimestamps(),r=this.getLabelTimestamps();return n.length&&r.length?t=this.normalize(n.concat(r)):t=n.length?n:r,t=this._cache.all=t,t}getDecimalForValue(t){return(So(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const n=this._offsets,r=this.getDecimalForPixel(t)/n.factor-n.end;return So(this._table,r*this._tableRange+this._minPos,!0)}}I(dp,"id","timeseries"),I(dp,"defaults",Ca.defaults);const Bx="label";function fp(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function ZS(e,t){const n=e.options;n&&t&&Object.assign(n,t)}function Wx(e,t){e.labels=t}function $x(e,t,n=Bx){const r=[];e.datasets=t.map(s=>{const i=e.datasets.find(o=>o[n]===s[n]);return!i||!s.data||r.includes(i)?{...s}:(r.push(i),Object.assign(i,s),i)})}function ek(e,t=Bx){const n={labels:[],datasets:[]};return Wx(n,e.labels),$x(n,e.datasets,t),n}function tk(e,t){const{height:n=150,width:r=300,redraw:s=!1,datasetIdKey:i,type:o,data:a,options:l,plugins:c=[],fallbackContent:d,updateMode:f,...h}=e,p=b.useRef(null),v=b.useRef(null),m=()=>{p.current&&(v.current=new Za(p.current,{type:o,data:ek(a,i),options:l&&{...l},plugins:c}),fp(t,v.current))},w=()=>{fp(t,null),v.current&&(v.current.destroy(),v.current=null)};return b.useEffect(()=>{!s&&v.current&&l&&ZS(v.current,l)},[s,l]),b.useEffect(()=>{!s&&v.current&&Wx(v.current.config.data,a.labels)},[s,a.labels]),b.useEffect(()=>{!s&&v.current&&a.datasets&&$x(v.current.config.data,a.datasets,i)},[s,a.datasets]),b.useEffect(()=>{v.current&&(s?(w(),setTimeout(m)):v.current.update(f))},[s,l,a.labels,a.datasets,f]),b.useEffect(()=>{v.current&&(w(),setTimeout(m))},[o]),b.useEffect(()=>(m(),()=>w()),[]),u.jsx("canvas",{ref:p,role:"img",height:n,width:r,...h,children:d})}const nk=b.forwardRef(tk);function Hx(e,t){return Za.register(t),b.forwardRef((n,r)=>u.jsx(nk,{...n,ref:r,type:e}))}const rk=Hx("bar",Io),sk=Hx("doughnut",Ws),Yn=["leads","em_contato","proposta","fechado"],Wn={leads:"Leads",em_contato:"Em contato",proposta:"Proposta",fechado:"Fechado"};Za.register(Hs,Wo,su,iu,AS,VS);function ik({porEtapa:e}){const t=Yn.map(r=>e[r]??0),n=Math.max(20,Math.ceil((Math.max(...t)+1)/20)*20);return u.jsx("div",{className:"mt-4 h-64",children:u.jsx(rk,{data:{labels:Yn.map(r=>Wn[r]),datasets:[{label:"Quantidade",data:t,backgroundColor:["rgba(59, 130, 246, 0.8)","rgba(59, 130, 246, 0.6)","rgba(59, 130, 246, 0.4)","rgba(59, 130, 246, 0.3)"],borderRadius:4,barThickness:24}]},options:{indexAxis:"y",responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{x:{beginAtZero:!0,max:n,grid:{color:"#f3f4f6"},ticks:{stepSize:20}},y:{grid:{display:!1}}}}})})}function ok({enviadas:e,erros:t}){return u.jsx("div",{className:"mt-4 h-64 flex items-center justify-center",children:u.jsx(sk,{data:{labels:["Enviadas","Erros"],datasets:[{data:[e,t],backgroundColor:["#3b82f6","#ef4444"],borderWidth:0}]},options:{responsive:!0,maintainAspectRatio:!1,cutout:"70%",plugins:{legend:{display:!1},tooltip:{callbacks:{label:n=>`${n.label}: ${n.parsed}`}}}}})})}function ak({nomeUsuario:e}){const[t,n]=b.useState(null),[r,s]=b.useState(!0),[i,o]=b.useState(""),a=b.useCallback(async()=>{try{o(""),n(await B.metricas())}catch(d){o(d instanceof Error?d.message:"Falha ao carregar métricas.")}finally{s(!1)}},[]);b.useEffect(()=>{a();const d=setInterval(a,15e3);return()=>clearInterval(d)},[a]);const l=t==null?void 0:t.perfil,c=l==null?void 0:l.licenca.restam_dias;return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{children:[u.jsxs("h1",{className:"text-2xl font-bold text-gray-800",children:["Olá, ",e," 👋 bem-vindo ao seu painel"]}),u.jsxs("div",{className:"mt-2 flex items-center justify-between text-sm text-gray-500",children:[u.jsxs("span",{children:[l!=null&&l.licenca.ativa?"Licença ativa":"Sem licença"," •"," ",l!=null&&l.licenca.expira_em?`expira em ${l.licenca.expira_em}`:"—"," • dados 100% locais"]}),c!=null&&u.jsxs("span",{children:["Restam ",u.jsx("strong",{className:"text-gray-700",children:c===null?"∞":`${c} dias`})]})]})]}),i&&u.jsxs("div",{className:"bg-red-50 border border-red-200 text-red-700 rounded-xl px-4 py-3 text-sm",children:[u.jsx("i",{className:"fas fa-exclamation-triangle mr-2"}),i]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[u.jsxs(uo,{rotulo:"Status da Conexão",icone:"fas fa-plug",children:[u.jsx("div",{className:"mt-2 flex items-center",children:u.jsxs("span",{className:$("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium",t!=null&&t.conexao.geral?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:[u.jsx("span",{className:$("w-2 h-2 mr-1.5 rounded-full",t!=null&&t.conexao.geral?"bg-green-500":"bg-red-500")}),t!=null&&t.conexao.geral?"Conectado":"Desconectado"]})}),u.jsxs("p",{className:"text-[11px] text-gray-400 mt-2",children:[u.jsx("i",{className:"fas fa-brain mr-1"}),t!=null&&t.conexao.llm?"LLM ✓":"LLM não configurado"," ·"," ",u.jsx("i",{className:"fas fa-paper-plane mr-1"}),t!=null&&t.conexao.openoutreach?"OpenOutreach ✓":"OpenOutreach não configurado"]})]}),u.jsx(uo,{rotulo:"Taxa de entrega",valor:r?"—":`${(t==null?void 0:t.taxa_entrega)??0}%`,subtitulo:`${(t==null?void 0:t.total_enviadas)??0} enviadas • total`,icone:"fas fa-paper-plane"}),u.jsx(uo,{rotulo:"Taxa de erro",valor:r?"—":`${(t==null?void 0:t.taxa_erro)??0}%`,subtitulo:`${(t==null?void 0:t.total_erros)??0} erros • total`,icone:"fas fa-triangle-exclamation"}),u.jsx(uo,{rotulo:"Leads cadastrados",valor:r?"—":(t==null?void 0:t.leads_total)??0,subtitulo:"Total na base",icone:"fas fa-users"})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6 border border-gray-100",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-semibold text-gray-800",children:"Leads por etapa (CRM)"}),u.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Quantidade de leads em cada coluna do Kanban"})]}),u.jsx("button",{onClick:a,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:"Atualizar"})]}),t?u.jsx(ik,{porEtapa:t.leads_por_etapa}):u.jsx(lk,{})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm p-6 border border-gray-100",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-semibold text-gray-800",children:"Desempenho das campanhas"}),u.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Agregação de todas as campanhas (Enviadas × Erros)"})]}),u.jsx("button",{onClick:a,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:"Atualizar"})]}),u.jsx(ok,{enviadas:(t==null?void 0:t.campanhas.enviadas)??0,erros:(t==null?void 0:t.campanhas.erros)??0}),u.jsxs("div",{className:"mt-4 flex items-center justify-center space-x-6 text-xs",children:[u.jsxs("span",{className:"flex items-center",children:[u.jsx("span",{className:"w-3 h-3 bg-blue-500 rounded-full mr-1.5"})," Enviadas (",(t==null?void 0:t.campanhas.enviadas)??0,")"]}),u.jsxs("span",{className:"flex items-center",children:[u.jsx("span",{className:"w-3 h-3 bg-red-500 rounded-full mr-1.5"})," Erros (",(t==null?void 0:t.campanhas.erros)??0,")"]})]})]})]})]})}function lk(){return u.jsx("div",{className:"mt-4 h-64 flex items-center justify-center text-gray-300",children:u.jsx("i",{className:"fas fa-spinner fa-spin text-2xl"})})}function Ct({titulo:e,icone:t="fas fa-sliders",children:n,abertoInicial:r=!1}){const[s,i]=b.useState(r);return u.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden",children:[u.jsxs("button",{type:"button",onClick:()=>i(o=>!o),className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-gray-600 bg-gray-50 hover:bg-gray-100 transition",children:[u.jsxs("span",{className:"flex items-center gap-2",children:[u.jsx("i",{className:$(t,"text-gray-400")})," ",e]}),u.jsx("i",{className:$("fas fa-chevron-down text-xs text-gray-400 transition-transform",s&&"rotate-180")})]}),s&&u.jsx("div",{className:"px-4 py-4 bg-white space-y-3",children:n})]})}function Vx({valor:e,altura:t="md",mostrarLabel:n=!1,className:r}){const s=Math.max(0,Math.min(100,Math.round(e))),i={sm:"h-1.5",md:"h-2.5"};return u.jsxs("div",{className:$("w-full",r),children:[n&&u.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-1",children:[u.jsx("span",{children:"Progresso"}),u.jsxs("span",{className:"font-semibold text-gray-700",children:[s,"%"]})]}),u.jsx("div",{className:$("w-full bg-gray-200 rounded-full overflow-hidden",i[t]),children:u.jsx("div",{className:$("h-full rounded-full bg-gradient-to-r from-indigo-500 to-purple-500 transition-all duration-500"),style:{width:`${s}%`}})})]})}const ck={leads:"bg-blue-100 text-blue-800",em_contato:"bg-amber-100 text-amber-800",proposta:"bg-violet-100 text-violet-800",fechado:"bg-green-100 text-green-800",rascunho:"bg-gray-100 text-gray-600",em_andamento:"bg-blue-100 text-blue-800",pausado:"bg-amber-100 text-amber-800",pausada:"bg-amber-100 text-amber-800",concluido:"bg-green-100 text-green-800",cancelado:"bg-gray-100 text-gray-600",erro:"bg-red-100 text-red-800",concluida:"bg-green-100 text-green-800",pendente:"bg-gray-100 text-gray-600",pulada:"bg-gray-100 text-gray-500",enviada:"bg-green-100 text-green-800",ativo:"bg-green-100 text-green-800",inativo:"bg-gray-100 text-gray-600"},uk={leads:"Leads",em_contato:"Em contato",proposta:"Proposta",fechado:"Fechado",rascunho:"Rascunho",em_andamento:"Em andamento",pausado:"Pausado",pausada:"Pausada",concluido:"Concluído",concluida:"Concluída",cancelado:"Cancelado",erro:"Erro",pendente:"Pendente",pulada:"Pulada",enviada:"Enviada",ativo:"Ativo",inativo:"Inativo",texto:"Texto",audio:"Áudio"};function Ut({status:e,rotulo:t,className:n}){const r=ck[e]||"bg-gray-100 text-gray-600";return u.jsx("span",{className:$("inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium whitespace-nowrap",r,n),children:t||uk[e]||e})}const dk={nome:"",telefone:"",email:"",fonte:"Manual",etapa:"leads"};function fk(){const{toast:e}=Rt(),[t,n]=b.useState([]),[r,s]=b.useState(""),[i,o]=b.useState("todas"),[a,l]=b.useState(!1),[c,d]=b.useState(null),[f,h]=b.useState(null),[p,v]=b.useState(null),m=b.useCallback(async()=>{n(await B.leads.listar())},[]);b.useEffect(()=>{m().catch(S=>e("erro",S.message))},[m,e]);const w=b.useMemo(()=>{const S=r.trim().toLowerCase();return t.filter(C=>{const j=!S||C.nome.toLowerCase().includes(S)||C.telefone.includes(S)||C.email.toLowerCase().includes(S),P=i==="todas"||C.etapa===i;return j&&P})},[t,r,i]),x=()=>{d({...dk}),l(!0)},g=S=>{d({...S}),l(!0)},y=async()=>{var S;if(!((S=c==null?void 0:c.nome)!=null&&S.trim())){e("erro","O nome do lead é obrigatório.");return}try{if(c.id){const{id:C,criado_em:j,atualizado_em:P,...E}=c;await B.leads.atualizar(C,E),e("sucesso","Lead atualizado.")}else await B.leads.criar(c),e("sucesso","Lead criado com sucesso.");l(!1),d(null),await m()}catch(C){e("erro",C instanceof Error?C.message:"Falha ao salvar lead.")}},_=async()=>{if(f)try{await B.leads.remover(f.id),e("sucesso",`Lead "${f.nome}" removido.`),h(null),await m()}catch(S){e("erro",S instanceof Error?S.message:"Falha ao remover.")}},k=async S=>{v(S.id);try{(await B.leads.enriquecer(S.id)).notas.forEach(j=>e("info",j)),e("sucesso","Lead enriquecido."),await m()}catch(C){e("erro",C instanceof Error?C.message:"Falha ao enriquecer.")}finally{v(null)}};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[u.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-[280px]",children:[u.jsxs("div",{className:"relative flex-1 max-w-md",children:[u.jsx("i",{className:"fas fa-search absolute left-3 top-2.5 text-gray-400 text-sm"}),u.jsx("input",{value:r,onChange:S=>s(S.target.value),placeholder:"Buscar por nome, telefone ou e-mail...",className:"w-full pl-9 pr-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 focus:border-indigo-400 outline-none"})]}),u.jsxs("select",{value:i,onChange:S=>o(S.target.value),className:"text-sm border border-gray-200 rounded-lg px-3 py-2 bg-white focus:ring-2 focus:ring-indigo-400 outline-none",children:[u.jsx("option",{value:"todas",children:"Todas as etapas"}),Yn.map(S=>u.jsx("option",{value:S,children:Wn[S]},S))]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("button",{onClick:()=>sw(t,"leadmaster-leads.json"),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50 transition",children:[u.jsx("i",{className:"fas fa-download mr-2"})," Exportar"]}),u.jsxs("button",{onClick:x,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition shadow-sm",children:[u.jsx("i",{className:"fas fa-plus mr-2"})," Novo Lead"]})]})]}),u.jsx("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden",children:u.jsx("div",{className:"overflow-x-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{children:u.jsxs("tr",{className:"text-left text-xs text-gray-500 uppercase border-b border-gray-100 bg-gray-50/50",children:[u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Lead"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Contato"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Etapa"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Completude"}),u.jsx("th",{className:"px-5 py-3 font-semibold",children:"Atualizado"}),u.jsx("th",{className:"px-5 py-3 font-semibold text-right",children:"Ações"})]})}),u.jsxs("tbody",{children:[w.map(S=>{const C=tw(S),j=nw(S);return u.jsxs("tr",{className:"border-b border-gray-50 hover:bg-indigo-50/40 transition",children:[u.jsxs("td",{className:"px-5 py-3",children:[u.jsx("p",{className:"font-medium text-gray-800",children:S.nome}),u.jsxs("p",{className:"text-xs text-gray-400",children:[S.fonte,S.empresa?` · ${S.empresa}`:""]})]}),u.jsxs("td",{className:"px-5 py-3 text-gray-600",children:[u.jsx("p",{children:S.telefone||"—"}),u.jsx("p",{className:"text-xs text-gray-400",children:S.email||"sem e-mail"})]}),u.jsx("td",{className:"px-5 py-3",children:u.jsx(Ut,{status:S.etapa})}),u.jsxs("td",{className:"px-5 py-3 w-52",children:[u.jsx(Vx,{valor:C,altura:"sm"}),u.jsx("p",{className:"text-[11px] text-gray-400 mt-1",children:rw(C,j)})]}),u.jsx("td",{className:"px-5 py-3 text-xs text-gray-400",children:qc(S.atualizado_em)}),u.jsxs("td",{className:"px-5 py-3 text-right whitespace-nowrap",children:[u.jsx("button",{onClick:()=>k(S),disabled:p===S.id,title:" Enriquecer com IA / BrasilAPI",className:"text-gray-400 hover:text-indigo-600 px-1.5 disabled:opacity-40",children:u.jsx("i",{className:$("fas fa-wand-magic-sparkles",p===S.id&&"fa-spin")})}),u.jsx("button",{onClick:()=>g(S),title:"Editar",className:"text-gray-400 hover:text-indigo-600 px-1.5",children:u.jsx("i",{className:"fas fa-pen"})}),u.jsx("button",{onClick:()=>h(S),title:"Excluir",className:"text-gray-400 hover:text-red-600 px-1.5",children:u.jsx("i",{className:"fas fa-trash"})})]})]},S.id)}),w.length===0&&u.jsx("tr",{children:u.jsxs("td",{colSpan:6,className:"px-5 py-16 text-center text-gray-400",children:[u.jsx("i",{className:"fas fa-users text-3xl text-gray-200 block mb-3"}),"Nenhum lead encontrado. Crie um novo ou importe pelos Extratores."]})})]})]})})}),u.jsx(Yt,{aberto:a,onFechar:()=>l(!1),titulo:c!=null&&c.id?"Editar lead":"Novo lead",icone:"fas fa-user-plus",children:c&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(rr,{rotulo:"Nome *",valor:c.nome||"",onChange:S=>d({...c,nome:S})}),u.jsx(rr,{rotulo:"Telefone",valor:c.telefone||"",onChange:S=>d({...c,telefone:S}),placeholder:"(11) 99999-9999"}),u.jsx(rr,{rotulo:"E-mail",tipo:"email",valor:c.email||"",onChange:S=>d({...c,email:S}),placeholder:"contato@empresa.com.br"}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Etapa"}),u.jsx("select",{value:c.etapa||"leads",onChange:S=>d({...c,etapa:S.target.value}),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:Yn.map(S=>u.jsx("option",{value:S,children:Wn[S]},S))})]})]}),u.jsxs(Ct,{titulo:"Campos avançados",icone:"fas fa-sliders",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(rr,{rotulo:"Empresa",valor:c.empresa||"",onChange:S=>d({...c,empresa:S})}),u.jsx(rr,{rotulo:"CNPJ",valor:c.cnpj||"",onChange:S=>d({...c,cnpj:S}),placeholder:"00.000.000/0000-00"}),u.jsx(rr,{rotulo:"Cidade",valor:c.cidade||"",onChange:S=>d({...c,cidade:S}),placeholder:"São Paulo/SP"}),u.jsx(rr,{rotulo:"Fonte",valor:c.fonte||"",onChange:S=>d({...c,fonte:S}),placeholder:"Google Maps, Instagram, CNPJ..."})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Observações"}),u.jsx("textarea",{value:c.observacoes||"",onChange:S=>d({...c,observacoes:S.target.value}),rows:3,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",placeholder:"Histórico de conversas, próximos passos..."})]})]}),u.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[u.jsx("button",{onClick:()=>l(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:y,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar"]})]})]})}),u.jsxs(Yt,{aberto:!!f,onFechar:()=>h(null),titulo:"Excluir lead",icone:"fas fa-trash",children:[u.jsxs("p",{className:"text-sm text-gray-600",children:["Tem certeza que deseja excluir ",u.jsx("strong",{children:f==null?void 0:f.nome}),"? Essa ação não pode ser desfeita."]}),u.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[u.jsx("button",{onClick:()=>h(null),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsx("button",{onClick:_,className:"px-6 py-2.5 text-sm font-medium text-white bg-red-600 rounded-lg hover:bg-red-700",children:"Excluir"})]})]})]})}function rr({rotulo:e,valor:t,onChange:n,tipo:r="text",placeholder:s}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("input",{type:r,value:t,onChange:i=>n(i.target.value),placeholder:s,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}const tl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function gs(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function yd(e){return"nodeType"in e}function He(e){var t,n;return e?gs(e)?e:yd(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bd(e){const{Document:t}=He(e);return e instanceof t}function Fi(e){return gs(e)?!1:e instanceof He(e).HTMLElement}function Ux(e){return e instanceof He(e).SVGElement}function ms(e){return e?gs(e)?e.document:yd(e)?bd(e)?e:Fi(e)||Ux(e)?e.ownerDocument:document:document:document}const cn=tl?b.useLayoutEffect:b.useEffect;function nl(e){const t=b.useRef(e);return cn(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return t.current==null?void 0:t.current(...r)},[])}function hk(){const e=b.useRef(null),t=b.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),n=b.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Mi(e,t){t===void 0&&(t=[e]);const n=b.useRef(e);return cn(()=>{n.current!==e&&(n.current=e)},t),n}function Bi(e,t){const n=b.useRef();return b.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ja(e){const t=nl(e),n=b.useRef(null),r=b.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,r]}function Na(e){const t=b.useRef();return b.useEffect(()=>{t.current=e},[e]),t.current}let Ql={};function rl(e,t){return b.useMemo(()=>{if(t)return t;const n=Ql[e]==null?0:Ql[e]+1;return Ql[e]=n,e+"-"+n},[e,t])}function Yx(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return r.reduce((i,o)=>{const a=Object.entries(o);for(const[l,c]of a){const d=i[l];d!=null&&(i[l]=d+e*c)}return i},{...t})}}const Zr=Yx(1),Ea=Yx(-1);function pk(e){return"clientX"in e&&"clientY"in e}function wd(e){if(!e)return!1;const{KeyboardEvent:t}=He(e.target);return t&&e instanceof t}function gk(e){if(!e)return!1;const{TouchEvent:t}=He(e.target);return t&&e instanceof t}function Ma(e){if(gk(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return pk(e)?{x:e.clientX,y:e.clientY}:null}const Pi=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Pi.Translate.toString(e),Pi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),hp="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function mk(e){return e.matches(hp)?e:e.querySelector(hp)}const xk={display:"none"};function vk(e){let{id:t,value:n}=e;return fe.createElement("div",{id:t,style:xk},n)}function yk(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const s={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return fe.createElement("div",{id:t,style:s,role:"status","aria-live":r,"aria-atomic":!0},n)}function bk(){const[e,t]=b.useState("");return{announce:b.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Kx=b.createContext(null);function wk(e){const t=b.useContext(Kx);b.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function _k(){const[e]=b.useState(()=>new Set),t=b.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[b.useCallback(r=>{let{type:s,event:i}=r;e.forEach(o=>{var a;return(a=o[s])==null?void 0:a.call(o,i)})},[e]),t]}const Sk={draggable:`
85
- To pick up a draggable item, press the space bar.
86
- While dragging, use the arrow keys to move the item.
87
- Press space again to drop the item in its new position, or press escape to cancel.
88
- `},kk={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function Ck(e){let{announcements:t=kk,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=Sk}=e;const{announce:i,announcement:o}=bk(),a=rl("DndLiveRegion"),[l,c]=b.useState(!1);if(b.useEffect(()=>{c(!0)},[]),wk(b.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&i(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;i(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;i(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;i(t.onDragCancel({active:h,over:p}))}}),[i,t])),!l)return null;const d=fe.createElement(fe.Fragment,null,fe.createElement(vk,{id:r,value:s.draggable}),fe.createElement(yk,{id:a,announcement:o}));return n?Hr.createPortal(d,n):d}var _e;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(_e||(_e={}));function Pa(){}function jk(e,t){return b.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Nk(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return b.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Pt=Object.freeze({x:0,y:0});function Ek(e,t){const n=Ma(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function Mk(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Pk(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Rk(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-r,a=i-n;if(r<s&&n<i){const l=t.width*t.height,c=e.width*e.height,d=o*a,f=d/(l+c-d);return Number(f.toFixed(4))}return 0}const Ok=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:o}=i,a=n.get(o);if(a){const l=Rk(a,t);l>0&&s.push({id:o,data:{droppableContainer:i,value:l}})}}return s.sort(Mk)};function Dk(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Xx(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Pt}function Tk(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,a)=>({...o,top:o.top+e*a.y,bottom:o.bottom+e*a.y,left:o.left+e*a.x,right:o.right+e*a.x}),{...n})}}const Lk=Tk(1);function Qx(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Ak(e,t,n){const r=Qx(t);if(!r)return e;const{scaleX:s,scaleY:i,x:o,y:a}=r,l=e.left-o-(1-s)*parseFloat(n),c=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?e.width/s:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l}}const zk={ignoreTransform:!1};function Wi(e,t){t===void 0&&(t=zk);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=He(e).getComputedStyle(e);c&&(n=Ak(n,c,d))}const{top:r,left:s,width:i,height:o,bottom:a,right:l}=n;return{top:r,left:s,width:i,height:o,bottom:a,right:l}}function pp(e){return Wi(e,{ignoreTransform:!0})}function Ik(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Fk(e,t){return t===void 0&&(t=He(e).getComputedStyle(e)),t.position==="fixed"}function Bk(e,t){t===void 0&&(t=He(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function _d(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(bd(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!Fi(s)||Ux(s)||n.includes(s))return n;const i=He(e).getComputedStyle(s);return s!==e&&Bk(s,i)&&n.push(s),Fk(s,i)?n:r(s.parentNode)}return e?r(e):n}function Gx(e){const[t]=_d(e,1);return t??null}function Gl(e){return!tl||!e?null:gs(e)?e:yd(e)?bd(e)||e===ms(e).scrollingElement?window:Fi(e)?e:null:null}function qx(e){return gs(e)?e.scrollX:e.scrollLeft}function Jx(e){return gs(e)?e.scrollY:e.scrollTop}function ou(e){return{x:qx(e),y:Jx(e)}}var Ne;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ne||(Ne={}));function Zx(e){return!tl||!e?!1:e===document.scrollingElement}function e0(e){const t={x:0,y:0},n=Zx(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:a,maxScroll:r,minScroll:t}}const Wk={x:.2,y:.2};function $k(e,t,n,r,s){let{top:i,left:o,right:a,bottom:l}=n;r===void 0&&(r=10),s===void 0&&(s=Wk);const{isTop:c,isBottom:d,isLeft:f,isRight:h}=e0(e),p={x:0,y:0},v={x:0,y:0},m={height:t.height*s.y,width:t.width*s.x};return!c&&i<=t.top+m.height?(p.y=Ne.Backward,v.y=r*Math.abs((t.top+m.height-i)/m.height)):!d&&l>=t.bottom-m.height&&(p.y=Ne.Forward,v.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!h&&a>=t.right-m.width?(p.x=Ne.Forward,v.x=r*Math.abs((t.right-m.width-a)/m.width)):!f&&o<=t.left+m.width&&(p.x=Ne.Backward,v.x=r*Math.abs((t.left+m.width-o)/m.width)),{direction:p,speed:v}}function Hk(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function t0(e){return e.reduce((t,n)=>Zr(t,ou(n)),Pt)}function Vk(e){return e.reduce((t,n)=>t+qx(n),0)}function Uk(e){return e.reduce((t,n)=>t+Jx(n),0)}function n0(e,t){if(t===void 0&&(t=Wi),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);Gx(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Yk=[["x",["left","right"],Vk],["y",["top","bottom"],Uk]];class Sd{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=_d(n),s=t0(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,a]of Yk)for(const l of o)Object.defineProperty(this,l,{get:()=>{const c=a(r),d=s[i]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ri{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Kk(e){const{EventTarget:t}=He(e);return e instanceof t?e:ms(e)}function ql(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var ft;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(ft||(ft={}));function gp(e){e.preventDefault()}function Xk(e){e.stopPropagation()}var te;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(te||(te={}));const r0={start:[te.Space,te.Enter],cancel:[te.Esc],end:[te.Space,te.Enter,te.Tab]},Qk=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case te.Right:return{...n,x:n.x+25};case te.Left:return{...n,x:n.x-25};case te.Down:return{...n,y:n.y+25};case te.Up:return{...n,y:n.y-25}}};class s0{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new ri(ms(n)),this.windowListeners=new ri(He(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(ft.Resize,this.handleCancel),this.windowListeners.add(ft.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(ft.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&n0(r),n(Pt)}handleKeyDown(t){if(wd(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=r0,coordinateGetter:o=Qk,scrollBehavior:a="smooth"}=s,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:Pt;this.referenceCoordinates||(this.referenceCoordinates=d);const f=o(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=Ea(f,d),p={x:0,y:0},{scrollableAncestors:v}=r.current;for(const m of v){const w=t.code,{isTop:x,isRight:g,isLeft:y,isBottom:_,maxScroll:k,minScroll:S}=e0(m),C=Hk(m),j={x:Math.min(w===te.Right?C.right-C.width/2:C.right,Math.max(w===te.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(w===te.Down?C.bottom-C.height/2:C.bottom,Math.max(w===te.Down?C.top:C.top+C.height/2,f.y))},P=w===te.Right&&!g||w===te.Left&&!y,E=w===te.Down&&!_||w===te.Up&&!x;if(P&&j.x!==f.x){const R=m.scrollLeft+h.x,A=w===te.Right&&R<=k.x||w===te.Left&&R>=S.x;if(A&&!h.y){m.scrollTo({left:R,behavior:a});return}A?p.x=m.scrollLeft-R:p.x=w===te.Right?m.scrollLeft-k.x:m.scrollLeft-S.x,p.x&&m.scrollBy({left:-p.x,behavior:a});break}else if(E&&j.y!==f.y){const R=m.scrollTop+h.y,A=w===te.Down&&R<=k.y||w===te.Up&&R>=S.y;if(A&&!h.x){m.scrollTo({top:R,behavior:a});return}A?p.y=m.scrollTop-R:p.y=w===te.Down?m.scrollTop-k.y:m.scrollTop-S.y,p.y&&m.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(t,Zr(Ea(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}s0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=r0,onActivation:s}=t,{active:i}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function mp(e){return!!(e&&"distance"in e)}function xp(e){return!!(e&&"delay"in e)}class kd{constructor(t,n,r){var s;r===void 0&&(r=Kk(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:o}=i;this.props=t,this.events=n,this.document=ms(o),this.documentListeners=new ri(this.document),this.listeners=new ri(r),this.windowListeners=new ri(He(o)),this.initialCoordinates=(s=Ma(i))!=null?s:Pt,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(ft.Resize,this.handleCancel),this.windowListeners.add(ft.DragStart,gp),this.windowListeners.add(ft.VisibilityChange,this.handleCancel),this.windowListeners.add(ft.ContextMenu,gp),this.documentListeners.add(ft.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(xp(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(mp(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(ft.Click,Xk,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(ft.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:a}}=i;if(!s)return;const l=(n=Ma(t))!=null?n:Pt,c=Ea(s,l);if(!r&&a){if(mp(a)){if(a.tolerance!=null&&ql(c,a.tolerance))return this.handleCancel();if(ql(c,a.distance))return this.handleStart()}if(xp(a)&&ql(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),o(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===te.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Gk={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Cd extends kd{constructor(t){const{event:n}=t,r=ms(n.target);super(t,Gk,r)}}Cd.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const qk={move:{name:"mousemove"},end:{name:"mouseup"}};var au;(function(e){e[e.RightClick=2]="RightClick"})(au||(au={}));class Jk extends kd{constructor(t){super(t,qk,ms(t.event.target))}}Jk.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===au.RightClick?!1:(r==null||r({event:n}),!0)}}];const Jl={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Zk extends kd{constructor(t){super(t,Jl)}static setup(){return window.addEventListener(Jl.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Jl.move.name,t)};function t(){}}}Zk.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r==null||r({event:n}),!0)}}];var si;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(si||(si={}));var Ra;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ra||(Ra={}));function eC(e){let{acceleration:t,activator:n=si.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:a=Ra.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=nC({delta:f,disabled:!i}),[v,m]=hk(),w=b.useRef({x:0,y:0}),x=b.useRef({x:0,y:0}),g=b.useMemo(()=>{switch(n){case si.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case si.DraggableRect:return s}},[n,s,l]),y=b.useRef(null),_=b.useCallback(()=>{const S=y.current;if(!S)return;const C=w.current.x*x.current.x,j=w.current.y*x.current.y;S.scrollBy(C,j)},[]),k=b.useMemo(()=>a===Ra.TreeOrder?[...c].reverse():c,[a,c]);b.useEffect(()=>{if(!i||!c.length||!g){m();return}for(const S of k){if((r==null?void 0:r(S))===!1)continue;const C=c.indexOf(S),j=d[C];if(!j)continue;const{direction:P,speed:E}=$k(S,j,g,t,h);for(const R of["x","y"])p[R][P[R]]||(E[R]=0,P[R]=0);if(E.x>0||E.y>0){m(),y.current=S,v(_,o),w.current=E,x.current=P;return}}w.current={x:0,y:0},x.current={x:0,y:0},m()},[t,_,r,m,i,o,JSON.stringify(g),JSON.stringify(p),v,c,k,d,JSON.stringify(h)])}const tC={x:{[Ne.Backward]:!1,[Ne.Forward]:!1},y:{[Ne.Backward]:!1,[Ne.Forward]:!1}};function nC(e){let{delta:t,disabled:n}=e;const r=Na(t);return Bi(s=>{if(n||!r||!s)return tC;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ne.Backward]:s.x[Ne.Backward]||i.x===-1,[Ne.Forward]:s.x[Ne.Forward]||i.x===1},y:{[Ne.Backward]:s.y[Ne.Backward]||i.y===-1,[Ne.Forward]:s.y[Ne.Forward]||i.y===1}}},[n,t,r])}function rC(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Bi(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function sC(e,t){return b.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...i]},[]),[e,t])}var Ri;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ri||(Ri={}));var lu;(function(e){e.Optimized="optimized"})(lu||(lu={}));const vp=new Map;function iC(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,o]=b.useState(null),{frequency:a,measure:l,strategy:c}=s,d=b.useRef(e),f=w(),h=Mi(f),p=b.useCallback(function(x){x===void 0&&(x=[]),!h.current&&o(g=>g===null?x:g.concat(x.filter(y=>!g.includes(y))))},[h]),v=b.useRef(null),m=Bi(x=>{if(f&&!n)return vp;if(!x||x===vp||d.current!==e||i!=null){const g=new Map;for(let y of e){if(!y)continue;if(i&&i.length>0&&!i.includes(y.id)&&y.rect.current){g.set(y.id,y.rect.current);continue}const _=y.node.current,k=_?new Sd(l(_),_):null;y.rect.current=k,k&&g.set(y.id,k)}return g}return x},[e,i,n,f,l]);return b.useEffect(()=>{d.current=e},[e]),b.useEffect(()=>{f||p()},[n,f]),b.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),b.useEffect(()=>{f||typeof a!="number"||v.current!==null||(v.current=setTimeout(()=>{p(),v.current=null},a))},[a,f,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:i!=null};function w(){switch(c){case Ri.Always:return!1;case Ri.BeforeDragging:return n;default:return!n}}}function jd(e,t){return Bi(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function oC(e,t){return jd(e,t)}function aC(e){let{callback:t,disabled:n}=e;const r=nl(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function sl(e){let{callback:t,disabled:n}=e;const r=nl(t),s=b.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return b.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function lC(e){return new Sd(Wi(e),e)}function yp(e,t,n){t===void 0&&(t=lC);const[r,s]=b.useState(null);function i(){s(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const o=aC({callback(l){if(e)for(const c of l){const{type:d,target:f}=c;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),a=sl({callback:i});return cn(()=>{i(),e?(a==null||a.observe(e),o==null||o.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),o==null||o.disconnect())},[e]),r}function cC(e){const t=jd(e);return Xx(e,t)}const bp=[];function uC(e){const t=b.useRef(e),n=Bi(r=>e?r&&r!==bp&&e&&t.current&&e.parentNode===t.current.parentNode?r:_d(e):bp,[e]);return b.useEffect(()=>{t.current=e},[e]),n}function dC(e){const[t,n]=b.useState(null),r=b.useRef(e),s=b.useCallback(i=>{const o=Gl(i.target);o&&n(a=>a?(a.set(o,ou(o)),new Map(a)):null)},[]);return b.useEffect(()=>{const i=r.current;if(e!==i){o(i);const a=e.map(l=>{const c=Gl(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,ou(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{o(e),o(i)};function o(a){a.forEach(l=>{const c=Gl(l);c==null||c.removeEventListener("scroll",s)})}},[s,e]),b.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>Zr(i,o),Pt):t0(e):Pt,[e,t])}function wp(e,t){t===void 0&&(t=[]);const n=b.useRef(null);return b.useEffect(()=>{n.current=null},t),b.useEffect(()=>{const r=e!==Pt;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Ea(e,n.current):Pt}function fC(e){b.useEffect(()=>{if(!tl)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function hC(e,t){return b.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,t)},n},{}),[e,t])}function i0(e){return b.useMemo(()=>e?Ik(e):null,[e])}const _p=[];function pC(e,t){t===void 0&&(t=Wi);const[n]=e,r=i0(n?He(n):null),[s,i]=b.useState(_p);function o(){i(()=>e.length?e.map(l=>Zx(l)?r:new Sd(t(l),l)):_p)}const a=sl({callback:o});return cn(()=>{a==null||a.disconnect(),o(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),s}function o0(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Fi(t)?t:e}function gC(e){let{measure:t}=e;const[n,r]=b.useState(null),s=b.useCallback(c=>{for(const{target:d}of c)if(Fi(d)){r(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=sl({callback:s}),o=b.useCallback(c=>{const d=o0(c);i==null||i.disconnect(),d&&(i==null||i.observe(d)),r(d?t(d):null)},[t,i]),[a,l]=ja(o);return b.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const mC=[{sensor:Cd,options:{}},{sensor:s0,options:{}}],xC={current:{}},$o={draggable:{measure:pp},droppable:{measure:pp,strategy:Ri.WhileDragging,frequency:lu.Optimized},dragOverlay:{measure:Wi}};class ii extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const vC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ii,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Pa},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:$o,measureDroppableContainers:Pa,windowRect:null,measuringScheduled:!1},a0={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Pa,draggableNodes:new Map,over:null,measureDroppableContainers:Pa},$i=b.createContext(a0),l0=b.createContext(vC);function yC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ii}}}function bC(e,t){switch(t.type){case _e.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case _e.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case _e.DragEnd:case _e.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case _e.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new ii(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case _e.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new ii(e.droppable.containers);return o.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case _e.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new ii(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function wC(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=b.useContext($i),i=Na(r),o=Na(n==null?void 0:n.id);return b.useEffect(()=>{if(!t&&!r&&i&&o!=null){if(!wd(i)||document.activeElement===i.target)return;const a=s.get(o);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const f=mk(d);if(f){f.focus();break}}})}},[r,t,s,o,i]),null}function c0(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function _C(e){return b.useMemo(()=>({draggable:{...$o.draggable,...e==null?void 0:e.draggable},droppable:{...$o.droppable,...e==null?void 0:e.droppable},dragOverlay:{...$o.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function SC(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=b.useRef(!1),{x:o,y:a}=typeof s=="boolean"?{x:s,y:s}:s;cn(()=>{if(!o&&!a||!t){i.current=!1;return}if(i.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=n(c),f=Xx(d,r);if(o||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Gx(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,o,a,r,n])}const il=b.createContext({...Pt,scaleX:1,scaleY:1});var bn;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(bn||(bn={}));const kC=b.memo(function(t){var n,r,s,i;let{id:o,accessibility:a,autoScroll:l=!0,children:c,sensors:d=mC,collisionDetection:f=Ok,measuring:h,modifiers:p,...v}=t;const m=b.useReducer(bC,void 0,yC),[w,x]=m,[g,y]=_k(),[_,k]=b.useState(bn.Uninitialized),S=_===bn.Initialized,{draggable:{active:C,nodes:j,translate:P},droppable:{containers:E}}=w,R=C!=null?j.get(C):null,A=b.useRef({initial:null,translated:null}),N=b.useMemo(()=>{var Te;return C!=null?{id:C,data:(Te=R==null?void 0:R.data)!=null?Te:xC,rect:A}:null},[C,R]),F=b.useRef(null),[z,q]=b.useState(null),[J,O]=b.useState(null),T=Mi(v,Object.values(v)),L=rl("DndDescribedBy",o),V=b.useMemo(()=>E.getEnabled(),[E]),W=_C(h),{droppableRects:se,measureDroppableContainers:U,measuringScheduled:be}=iC(V,{dragging:S,dependencies:[P.x,P.y],config:W.droppable}),G=rC(j,C),bt=b.useMemo(()=>J?Ma(J):null,[J]),xs=v0(),Hi=oC(G,W.draggable.measure);SC({activeNode:C!=null?j.get(C):null,config:xs.layoutShiftCompensation,initialRect:Hi,measure:W.draggable.measure});const Ze=yp(G,W.draggable.measure,Hi),ol=yp(G?G.parentElement:null),Jn=b.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:E,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ed=E.getNodeFor((n=Jn.current.over)==null?void 0:n.id),Zn=gC({measure:W.dragOverlay.measure}),Vi=(r=Zn.nodeRef.current)!=null?r:G,kr=S?(s=Zn.rect)!=null?s:Ze:null,Md=!!(Zn.nodeRef.current&&Zn.rect),Pd=cC(Md?null:Ze),al=i0(Vi?He(Vi):null),dn=uC(S?Ed??G:null),Ui=pC(dn),Yi=c0(p,{transform:{x:P.x-Pd.x,y:P.y-Pd.y,scaleX:1,scaleY:1},activatorEvent:J,active:N,activeNodeRect:Ze,containerNodeRect:ol,draggingNodeRect:kr,over:Jn.current.over,overlayNodeRect:Zn.rect,scrollableAncestors:dn,scrollableAncestorRects:Ui,windowRect:al}),Rd=bt?Zr(bt,P):null,Od=dC(dn),d0=wp(Od),f0=wp(Od,[Ze]),Cr=Zr(Yi,d0),jr=kr?Lk(kr,Yi):null,vs=N&&jr?f({active:N,collisionRect:jr,droppableRects:se,droppableContainers:V,pointerCoordinates:Rd}):null,Dd=Pk(vs,"id"),[fn,Td]=b.useState(null),h0=Md?Yi:Zr(Yi,f0),p0=Dk(h0,(i=fn==null?void 0:fn.rect)!=null?i:null,Ze),ll=b.useRef(null),Ld=b.useCallback((Te,et)=>{let{sensor:tt,options:hn}=et;if(F.current==null)return;const ut=j.get(F.current);if(!ut)return;const nt=Te.nativeEvent,Ot=new tt({active:F.current,activeNode:ut,event:nt,options:hn,context:Jn,onAbort(Pe){if(!j.get(Pe))return;const{onDragAbort:Dt}=T.current,Kt={id:Pe};Dt==null||Dt(Kt),g({type:"onDragAbort",event:Kt})},onPending(Pe,pn,Dt,Kt){if(!j.get(Pe))return;const{onDragPending:bs}=T.current,gn={id:Pe,constraint:pn,initialCoordinates:Dt,offset:Kt};bs==null||bs(gn),g({type:"onDragPending",event:gn})},onStart(Pe){const pn=F.current;if(pn==null)return;const Dt=j.get(pn);if(!Dt)return;const{onDragStart:Kt}=T.current,ys={activatorEvent:nt,active:{id:pn,data:Dt.data,rect:A}};Hr.unstable_batchedUpdates(()=>{Kt==null||Kt(ys),k(bn.Initializing),x({type:_e.DragStart,initialCoordinates:Pe,active:pn}),g({type:"onDragStart",event:ys}),q(ll.current),O(nt)})},onMove(Pe){x({type:_e.DragMove,coordinates:Pe})},onEnd:Nr(_e.DragEnd),onCancel:Nr(_e.DragCancel)});ll.current=Ot;function Nr(Pe){return async function(){const{active:Dt,collisions:Kt,over:ys,scrollAdjustedTranslate:bs}=Jn.current;let gn=null;if(Dt&&bs){const{cancelDrop:ws}=T.current;gn={activatorEvent:nt,active:Dt,collisions:Kt,delta:bs,over:ys},Pe===_e.DragEnd&&typeof ws=="function"&&await Promise.resolve(ws(gn))&&(Pe=_e.DragCancel)}F.current=null,Hr.unstable_batchedUpdates(()=>{x({type:Pe}),k(bn.Uninitialized),Td(null),q(null),O(null),ll.current=null;const ws=Pe===_e.DragEnd?"onDragEnd":"onDragCancel";if(gn){const cl=T.current[ws];cl==null||cl(gn),g({type:ws,event:gn})}})}}},[j]),g0=b.useCallback((Te,et)=>(tt,hn)=>{const ut=tt.nativeEvent,nt=j.get(hn);if(F.current!==null||!nt||ut.dndKit||ut.defaultPrevented)return;const Ot={active:nt};Te(tt,et.options,Ot)===!0&&(ut.dndKit={capturedBy:et.sensor},F.current=hn,Ld(tt,et))},[j,Ld]),Ad=sC(d,g0);fC(d),cn(()=>{Ze&&_===bn.Initializing&&k(bn.Initialized)},[Ze,_]),b.useEffect(()=>{const{onDragMove:Te}=T.current,{active:et,activatorEvent:tt,collisions:hn,over:ut}=Jn.current;if(!et||!tt)return;const nt={active:et,activatorEvent:tt,collisions:hn,delta:{x:Cr.x,y:Cr.y},over:ut};Hr.unstable_batchedUpdates(()=>{Te==null||Te(nt),g({type:"onDragMove",event:nt})})},[Cr.x,Cr.y]),b.useEffect(()=>{const{active:Te,activatorEvent:et,collisions:tt,droppableContainers:hn,scrollAdjustedTranslate:ut}=Jn.current;if(!Te||F.current==null||!et||!ut)return;const{onDragOver:nt}=T.current,Ot=hn.get(Dd),Nr=Ot&&Ot.rect.current?{id:Ot.id,rect:Ot.rect.current,data:Ot.data,disabled:Ot.disabled}:null,Pe={active:Te,activatorEvent:et,collisions:tt,delta:{x:ut.x,y:ut.y},over:Nr};Hr.unstable_batchedUpdates(()=>{Td(Nr),nt==null||nt(Pe),g({type:"onDragOver",event:Pe})})},[Dd]),cn(()=>{Jn.current={activatorEvent:J,active:N,activeNode:G,collisionRect:jr,collisions:vs,droppableRects:se,draggableNodes:j,draggingNode:Vi,draggingNodeRect:kr,droppableContainers:E,over:fn,scrollableAncestors:dn,scrollAdjustedTranslate:Cr},A.current={initial:kr,translated:jr}},[N,G,vs,jr,j,Vi,kr,se,E,fn,dn,Cr]),eC({...xs,delta:P,draggingRect:jr,pointerCoordinates:Rd,scrollableAncestors:dn,scrollableAncestorRects:Ui});const m0=b.useMemo(()=>({active:N,activeNode:G,activeNodeRect:Ze,activatorEvent:J,collisions:vs,containerNodeRect:ol,dragOverlay:Zn,draggableNodes:j,droppableContainers:E,droppableRects:se,over:fn,measureDroppableContainers:U,scrollableAncestors:dn,scrollableAncestorRects:Ui,measuringConfiguration:W,measuringScheduled:be,windowRect:al}),[N,G,Ze,J,vs,ol,Zn,j,E,se,fn,U,dn,Ui,W,be,al]),x0=b.useMemo(()=>({activatorEvent:J,activators:Ad,active:N,activeNodeRect:Ze,ariaDescribedById:{draggable:L},dispatch:x,draggableNodes:j,over:fn,measureDroppableContainers:U}),[J,Ad,N,Ze,x,L,j,fn,U]);return fe.createElement(Kx.Provider,{value:y},fe.createElement($i.Provider,{value:x0},fe.createElement(l0.Provider,{value:m0},fe.createElement(il.Provider,{value:p0},c)),fe.createElement(wC,{disabled:(a==null?void 0:a.restoreFocus)===!1})),fe.createElement(Ck,{...a,hiddenTextDescribedById:L}));function v0(){const Te=(z==null?void 0:z.autoScrollEnabled)===!1,et=typeof l=="object"?l.enabled===!1:l===!1,tt=S&&!Te&&!et;return typeof l=="object"?{...l,enabled:tt}:{enabled:tt}}}),CC=b.createContext(null),Sp="button",jC="Draggable";function NC(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=rl(jC),{activators:o,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:h}=b.useContext($i),{role:p=Sp,roleDescription:v="draggable",tabIndex:m=0}=s??{},w=(l==null?void 0:l.id)===t,x=b.useContext(w?il:CC),[g,y]=ja(),[_,k]=ja(),S=hC(o,t),C=Mi(n);cn(()=>(f.set(t,{id:t,key:i,node:g,activatorNode:_,data:C}),()=>{const P=f.get(t);P&&P.key===i&&f.delete(t)}),[f,t]);const j=b.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":w&&p===Sp?!0:void 0,"aria-roledescription":v,"aria-describedby":d.draggable}),[r,p,m,w,v,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:j,isDragging:w,listeners:r?void 0:S,node:g,over:h,setNodeRef:y,setActivatorNodeRef:k,transform:x}}function EC(){return b.useContext(l0)}const MC="Droppable",PC={timeout:25};function RC(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=rl(MC),{active:o,dispatch:a,over:l,measureDroppableContainers:c}=b.useContext($i),d=b.useRef({disabled:n}),f=b.useRef(!1),h=b.useRef(null),p=b.useRef(null),{disabled:v,updateMeasurementsFor:m,timeout:w}={...PC,...s},x=Mi(m??r),g=b.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(x.current)?x.current:[x.current]),p.current=null},w)},[w]),y=sl({callback:g,disabled:v||!o}),_=b.useCallback((j,P)=>{y&&(P&&(y.unobserve(P),f.current=!1),j&&y.observe(j))},[y]),[k,S]=ja(_),C=Mi(t);return b.useEffect(()=>{!y||!k.current||(y.disconnect(),f.current=!1,y.observe(k.current))},[k,y]),b.useEffect(()=>(a({type:_e.RegisterDroppable,element:{id:r,key:i,disabled:n,node:k,rect:h,data:C}}),()=>a({type:_e.UnregisterDroppable,key:i,id:r})),[r]),b.useEffect(()=>{n!==d.current.disabled&&(a({type:_e.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:o,rect:h,isOver:(l==null?void 0:l.id)===r,node:k,over:l,setNodeRef:S}}function OC(e){let{animation:t,children:n}=e;const[r,s]=b.useState(null),[i,o]=b.useState(null),a=Na(n);return!n&&!r&&a&&s(a),cn(()=>{if(!i)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){s(null);return}Promise.resolve(t(c,i)).then(()=>{s(null)})},[t,r,i]),fe.createElement(fe.Fragment,null,n,r?b.cloneElement(r,{ref:o}):null)}const DC={x:0,y:0,scaleX:1,scaleY:1};function TC(e){let{children:t}=e;return fe.createElement($i.Provider,{value:a0},fe.createElement(il.Provider,{value:DC},t))}const LC={position:"fixed",touchAction:"none"},AC=e=>wd(e)?"transform 250ms ease":void 0,zC=b.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:a,style:l,transform:c,transition:d=AC}=e;if(!a)return null;const f=s?c:{...c,scaleX:1,scaleY:1},h={...LC,width:a.width,height:a.height,top:a.top,left:a.left,transform:Pi.Transform.toString(f),transformOrigin:s&&r?Ek(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return fe.createElement(n,{className:o,style:h,ref:t},i)}),IC=e=>t=>{let{active:n,dragOverlay:r}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(s[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[l,c]of Object.entries(s))n.node.style.setProperty(l,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},FC=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Pi.Transform.toString(t)},{transform:Pi.Transform.toString(n)}]},BC={duration:250,easing:"ease",keyframes:FC,sideEffects:IC({styles:{active:{opacity:"0"}}})};function WC(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=e;return nl((i,o)=>{if(t===null)return;const a=n.get(i);if(!a)return;const l=a.node.current;if(!l)return;const c=o0(o);if(!c)return;const{transform:d}=He(o).getComputedStyle(o),f=Qx(d);if(!f)return;const h=typeof t=="function"?t:$C(t);return n0(l,s.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:f})})}function $C(e){const{duration:t,easing:n,sideEffects:r,keyframes:s}={...BC,...e};return i=>{let{active:o,dragOverlay:a,transform:l,...c}=i;if(!t)return;const d={x:a.rect.left-o.rect.left,y:a.rect.top-o.rect.top},f={scaleX:l.scaleX!==1?o.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?o.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-d.x,y:l.y-d.y,...f},p=s({...c,active:o,dragOverlay:a,transform:{initial:l,final:h}}),[v]=p,m=p[p.length-1];if(JSON.stringify(v)===JSON.stringify(m))return;const w=r==null?void 0:r({active:o,dragOverlay:a,...c}),x=a.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(g=>{x.onfinish=()=>{w==null||w(),g()}})}}let kp=0;function HC(e){return b.useMemo(()=>{if(e!=null)return kp++,kp},[e])}const VC=fe.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:v,droppableContainers:m,dragOverlay:w,over:x,measuringConfiguration:g,scrollableAncestors:y,scrollableAncestorRects:_,windowRect:k}=EC(),S=b.useContext(il),C=HC(f==null?void 0:f.id),j=c0(o,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:w.rect,over:x,overlayNodeRect:w.rect,scrollableAncestors:y,scrollableAncestorRects:_,transform:S,windowRect:k}),P=jd(h),E=WC({config:r,draggableNodes:v,droppableContainers:m,measuringConfiguration:g}),R=P?w.setRef:void 0;return fe.createElement(TC,null,fe.createElement(OC,{animation:E},f&&C?fe.createElement(zC,{key:C,id:f.id,ref:R,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:P,style:{zIndex:c,...s},transform:j},n):null))});function u0({lead:e,onAbrir:t,emOverlay:n=!1}){const{attributes:r,listeners:s,setNodeRef:i,transform:o,isDragging:a}=NC({id:e.id});return u.jsxs("div",{ref:i,...s,...r,style:o?{transform:`translate3d(${o.x}px, ${o.y}px, 0)`}:void 0,className:$("bg-white rounded-lg shadow-sm border border-gray-100 p-3 cursor-grab active:cursor-grabbing select-none",a&&!n&&"opacity-40",n&&"shadow-xl rotate-2"),onDoubleClick:()=>t==null?void 0:t(e),title:"Arraste para mudar de etapa · duplo clique para editar",children:[u.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:e.nome}),u.jsx("p",{className:"text-xs text-gray-500 mt-0.5",children:rd(e.telefone)}),u.jsxs("div",{className:"flex items-center justify-between mt-2",children:[u.jsx("span",{className:"text-[10px] uppercase tracking-wide bg-indigo-50 text-indigo-700 px-1.5 py-0.5 rounded font-medium",children:e.fonte}),u.jsxs("span",{className:"text-[10px] text-gray-400",children:[u.jsx("i",{className:"fas fa-star text-amber-400 mr-0.5"}),e.score??0]})]})]})}function UC({etapa:e,leads:t,onAbrirLead:n,cor:r}){const{setNodeRef:s,isOver:i}=RC({id:e});return u.jsxs("div",{ref:s,className:$("bg-gray-50 rounded-xl p-3 w-72 shrink-0 flex flex-col min-h-[420px] transition-colors",i&&"bg-indigo-50 ring-2 ring-indigo-300"),children:[u.jsxs("div",{className:"flex items-center justify-between px-1 pb-3",children:[u.jsxs("span",{className:"flex items-center gap-2 text-sm font-semibold text-gray-700",children:[u.jsx("span",{className:$("w-2.5 h-2.5 rounded-full",r)}),Wn[e]]}),u.jsx("span",{className:"text-xs font-medium text-gray-500 bg-white border border-gray-200 rounded-full px-2 py-0.5",children:t.length})]}),u.jsxs("div",{className:"flex-1 space-y-2 overflow-y-auto pr-0.5",style:{maxHeight:"calc(100vh - 320px)"},children:[t.length===0&&u.jsxs("div",{className:"text-center text-xs text-gray-400 border-2 border-dashed border-gray-200 rounded-lg py-10 mt-8",children:[u.jsx("i",{className:"fas fa-inbox text-2xl text-gray-300 mb-2 block"}),"Arraste leads para cá"]}),t.map(o=>u.jsx(u0,{lead:o,onAbrir:n},o.id))]})]})}const YC={leads:"bg-blue-500",em_contato:"bg-amber-500",proposta:"bg-violet-500",fechado:"bg-green-500"};function KC({leads:e,onMover:t,onAbrirLead:n}){const[r,s]=b.useState(null),i=Nk(jk(Cd,{activationConstraint:{distance:6}})),o=l=>{const c=e.find(d=>d.id===l.active.id);s(c??null)},a=l=>{var f;s(null);const c=(f=l.over)==null?void 0:f.id;if(!c)return;const d=e.find(h=>h.id===l.active.id);!d||d.etapa===c||t(d.id,c)};return u.jsxs(kC,{sensors:i,onDragStart:o,onDragEnd:a,children:[u.jsx("div",{className:"flex gap-4 overflow-x-auto pb-2",children:Yn.map(l=>u.jsx(UC,{etapa:l,cor:YC[l],leads:e.filter(c=>c.etapa===l),onAbrirLead:n},l))}),u.jsx(VC,{children:r?u.jsx(u0,{lead:r,emOverlay:!0}):null})]})}function XC(){const{toast:e}=Rt(),[t,n]=b.useState([]),[r,s]=b.useState(null),[i,o]=b.useState(!1),[a,l]=b.useState(null),[c,d]=b.useState(""),f=b.useCallback(async()=>{n(await B.leads.listar())},[]);b.useEffect(()=>{f().catch(g=>e("erro",g.message))},[f,e]);const h=async(g,y)=>{const _=t;n(k=>k.map(S=>S.id===g?{...S,etapa:y}:S));try{await B.leads.atualizar(g,{etapa:y}),e("sucesso",`Lead movido para "${Wn[y]}".`)}catch(k){n(_),e("erro",k instanceof Error?k.message:"Falha ao mover lead.")}},p=async()=>{o(!0);try{const g=await B.crm.sugestoes();s(g.sugestoes)}catch(g){e("erro",g instanceof Error?g.message:"Falha ao pedir sugestões.")}finally{o(!1)}},v=async g=>{try{await B.crm.aplicar(g.lead_id,g.para),s(y=>(y==null?void 0:y.filter(_=>_!==g))??null),await f(),e("sucesso",`Sugestão aplicada: ${g.lead_nome} → ${Wn[g.para]}.`)}catch(y){e("erro",y instanceof Error?y.message:"Falha ao aplicar sugestão.")}},m=async g=>{try{(await B.leads.enriquecer(g.id)).notas.forEach(_=>e("info",_)),await f()}catch(y){e("erro",y instanceof Error?y.message:"Falha ao enriquecer.")}},w=async()=>{if(a)try{await B.leads.atualizar(a.id,{observacoes:c}),l(null),await f(),e("sucesso","Observações salvas.")}catch(g){e("erro",g instanceof Error?g.message:"Falha ao salvar.")}},x=b.useMemo(()=>Object.fromEntries(Yn.map(g=>[g,t.filter(y=>y.etapa===g).length])),[t]);return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[u.jsxs("div",{className:"flex items-center gap-4 text-sm text-gray-500",children:[u.jsxs("span",{children:[u.jsx("strong",{className:"text-gray-800",children:t.length})," leads no funil"]}),Yn.map(g=>u.jsxs("span",{className:"hidden md:inline",children:[Wn[g],": ",u.jsx("strong",{className:"text-gray-700",children:x[g]})]},g))]}),u.jsxs("button",{onClick:p,disabled:i,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:$("fas fa-wand-magic-sparkles mr-2",i&&"fa-spin")}),"Sugestões da IA"]})]}),u.jsx(KC,{leads:t,onMover:h,onAbrirLead:g=>{l(g),d(g.observacoes||"")}}),u.jsxs(Yt,{aberto:r!==null,onFechar:()=>s(null),titulo:"Sugestões de movimentação (Agente de CRM)",icone:"fas fa-robot",largura:"lg",children:[r&&r.length===0&&u.jsxs("p",{className:"text-sm text-gray-500 text-center py-8",children:[u.jsx("i",{className:"fas fa-circle-check text-green-500 text-2xl block mb-3"}),"Nenhuma sugestão no momento — o funil está equilibrado. 🎯"]}),u.jsx("div",{className:"space-y-3",children:r==null?void 0:r.map((g,y)=>u.jsxs("div",{className:"border border-gray-100 rounded-xl p-4 flex items-start justify-between gap-4 hover:border-indigo-200 transition",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:g.lead_nome}),u.jsxs("p",{className:"text-xs text-gray-500 mt-1 flex items-center gap-2",children:[u.jsx(Ut,{status:g.de})," ",u.jsx("i",{className:"fas fa-arrow-right text-gray-300"})," ",u.jsx(Ut,{status:g.para}),u.jsxs("span",{className:"text-gray-400",children:["confiança ",Math.round(g.confianca*100),"%"]})]}),u.jsx("p",{className:"text-xs text-gray-600 mt-2",children:g.motivo})]}),u.jsx("button",{onClick:()=>v(g),className:"shrink-0 px-4 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:"Aplicar"})]},y))})]}),u.jsx(Yt,{aberto:!!a,onFechar:()=>l(null),titulo:"Lead",icone:"fas fa-address-card",children:a&&u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-base font-semibold text-gray-800",children:a.nome}),u.jsxs("p",{className:"text-xs text-gray-500 mt-0.5",children:[rd(a.telefone)," · ",a.fonte]})]}),u.jsx(Ut,{status:a.etapa})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Observações"}),u.jsx("textarea",{value:c,onChange:g=>d(g.target.value),rows:4,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",placeholder:"Ex.: ligou pedindo proposta, retorna na sexta..."})]}),u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("button",{onClick:()=>m(a),className:"text-sm text-indigo-600 hover:text-indigo-800 font-medium",children:[u.jsx("i",{className:"fas fa-wand-magic-sparkles mr-1"})," Enriquecer com IA"]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:()=>l(null),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:w,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar"]})]})]})]})})]})}function QC(){const{toast:e}=Rt(),[t,n]=b.useState([]),[r,s]=b.useState([]),[i,o]=b.useState({}),[a,l]=b.useState(!1),[c,d]=b.useState(null),[f,h]=b.useState(""),[p,v]=b.useState("texto"),[m,w]=b.useState("texto"),[x,g]=b.useState(new Set),[y,_]=b.useState("todas"),k=b.useCallback(async()=>{const[N,F,z]=await Promise.all([B.campanhas.listar(),B.leads.listar(),B.agentes.templates()]);n(N),s(F),o(z)},[]);b.useEffect(()=>{k().catch(N=>e("erro",N.message))},[k,e]);const S=t.some(N=>N.status==="em_andamento");b.useEffect(()=>{if(!S)return;const N=setInterval(()=>k().catch(()=>{}),4e3);return()=>clearInterval(N)},[S,k]);const C=b.useMemo(()=>y==="todas"?r:r.filter(N=>N.etapa===y),[r,y]),j=N=>{g(F=>{const z=new Set(F);return z.has(N)?z.delete(N):z.add(N),z})},P=()=>{g(new Set(C.map(N=>N.id)))},E=async()=>{if(!f.trim()){e("erro","Dê um nome para a campanha.");return}if(x.size===0){e("erro","Selecione ao menos um lead para disparar.");return}try{await B.campanhas.criar({nome:f.trim(),canal:p,template:m,lead_ids:[...x]}),e("sucesso","Campanha criada — clique em Iniciar quando estiver pronto."),l(!1),h(""),g(new Set),await k()}catch(N){e("erro",N instanceof Error?N.message:"Falha ao criar campanha.")}},R=async(N,F)=>{try{const z=F==="iniciar"?await B.campanhas.iniciar(N.id):F==="pausar"?await B.campanhas.pausar(N.id):await B.campanhas.parar(N.id);e(z.ok?"sucesso":"info",z.mensagem),await k()}catch(z){e("erro",z instanceof Error?z.message:"Falha na ação.")}},A=async N=>{try{await B.campanhas.remover(N.id),e("sucesso",`Campanha "${N.nome}" removida.`),await k()}catch(F){e("erro",F instanceof Error?F.message:"Falha ao remover.")}};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("p",{className:"text-sm text-gray-500",children:[u.jsx("strong",{className:"text-gray-800",children:t.length})," campanhas • templates configuráveis em Agentes"]}),u.jsxs("button",{onClick:()=>l(!0),className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition shadow-sm",children:[u.jsx("i",{className:"fas fa-plus mr-2"})," Nova Campanha"]})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[t.map(N=>{const F=Math.max(N.total,N.enviadas+N.erros),z=F?Math.round((N.enviadas+N.erros)/F*100):0,q=N.status==="em_andamento";return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-5 space-y-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsxs("div",{className:"min-w-0",children:[u.jsx("p",{className:"text-sm font-semibold text-gray-800 truncate",children:N.nome}),u.jsxs("p",{className:"text-xs text-gray-400 mt-0.5",children:["criada em ",qc(N.criado_em),' · template "',N.template,'"']})]}),u.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[u.jsx(Ut,{status:GC(N.canal),rotulo:N.canal==="audio"?"Áudio":"Texto"}),u.jsx(Ut,{status:N.status})]})]}),u.jsx(Vx,{valor:z,mostrarLabel:!0}),u.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-500",children:[u.jsxs("span",{children:[u.jsx("i",{className:"fas fa-paper-plane text-blue-500 mr-1"}),N.enviadas," enviadas"]}),u.jsxs("span",{children:[u.jsx("i",{className:"fas fa-circle-exclamation text-red-500 mr-1"}),N.erros," erros"]}),u.jsxs("span",{children:[F," leads"]})]}),u.jsxs("div",{className:"flex items-center justify-between pt-1",children:[u.jsxs("button",{onClick:()=>d(N),className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:[u.jsx("i",{className:"fas fa-list mr-1"})," Ver eventos"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[(N.status==="rascunho"||N.status==="pausada"||N.status==="concluida")&&u.jsxs("button",{onClick:()=>R(N,"iniciar"),className:"px-4 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-play mr-1"})," ",N.status==="pausada"?"Retomar":"Iniciar"]}),q&&u.jsxs(u.Fragment,{children:[u.jsxs("button",{onClick:()=>R(N,"pausar"),className:"px-4 py-2 text-xs font-medium text-amber-700 bg-amber-50 border border-amber-200 rounded-lg hover:bg-amber-100",children:[u.jsx("i",{className:"fas fa-pause mr-1"})," Pausar"]}),u.jsxs("button",{onClick:()=>R(N,"parar"),className:"px-4 py-2 text-xs font-medium text-red-700 bg-red-50 border border-red-200 rounded-lg hover:bg-red-100",children:[u.jsx("i",{className:"fas fa-stop mr-1"})," Parar"]})]}),u.jsx("button",{onClick:()=>A(N),className:"text-gray-400 hover:text-red-600 px-2 py-2",title:"Excluir campanha",children:u.jsx("i",{className:"fas fa-trash"})})]})]})]},N.id)}),t.length===0&&u.jsxs("div",{className:"lg:col-span-2 bg-white rounded-xl border border-dashed border-gray-200 py-16 text-center text-gray-400",children:[u.jsx("i",{className:"fas fa-bullhorn text-3xl text-gray-200 block mb-3"}),'Nenhuma campanha ainda. Crie a primeira com "Nova Campanha".']})]}),u.jsx(Yt,{aberto:a,onFechar:()=>l(!1),titulo:"Nova campanha de disparo",icone:"fas fa-bullhorn",largura:"lg",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsxs("div",{className:"md:col-span-3",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Nome da campanha *"}),u.jsx("input",{value:f,onChange:N=>h(N.target.value),placeholder:"Ex.: Reativação de leads de novembro",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Canal"}),u.jsxs("select",{value:p,onChange:N=>{const F=N.target.value;v(F),w(F)},className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:[u.jsx("option",{value:"texto",children:"Texto"}),u.jsx("option",{value:"audio",children:"Áudio"})]})]}),u.jsxs("div",{className:"md:col-span-2",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Template"}),u.jsx("select",{value:m,onChange:N=>w(N.target.value),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:Object.keys(i).map(N=>u.jsxs("option",{value:N,children:[N==="texto"?"Texto":"Áudio"," — ",i[N].slice(0,40),"..."]},N))})]})]}),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("label",{className:"text-xs font-medium text-gray-500",children:["Leads destinatários — ",x.size," selecionado(s)"]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsxs("select",{value:y,onChange:N=>_(N.target.value),className:"text-xs border border-gray-200 rounded-lg px-2 py-1.5 bg-white",children:[u.jsx("option",{value:"todas",children:"Todas as etapas"}),Yn.map(N=>u.jsx("option",{value:N,children:Wn[N]},N))]}),u.jsx("button",{onClick:P,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:"Selecionar todos"})]})]}),u.jsxs("div",{className:"max-h-52 overflow-y-auto border border-gray-100 rounded-lg divide-y divide-gray-50",children:[C.map(N=>u.jsxs("label",{className:"flex items-center gap-3 px-3 py-2.5 text-sm cursor-pointer hover:bg-indigo-50/50",children:[u.jsx("input",{type:"checkbox",checked:x.has(N.id),onChange:()=>j(N.id),className:"w-4 h-4 accent-indigo-500"}),u.jsx("span",{className:"text-gray-700 flex-1 truncate",children:N.nome}),u.jsx("span",{className:"text-xs text-gray-400",children:N.telefone||N.email||"sem contato"})]},N.id)),C.length===0&&u.jsx("p",{className:"px-3 py-6 text-center text-xs text-gray-400",children:"Nenhum lead nesta etapa."})]})]}),u.jsx(Ct,{titulo:"Como funciona o disparo?",icone:"fas fa-circle-question",children:u.jsxs("p",{className:"text-xs text-gray-500",children:["O disparo é executado pelo ",u.jsx("strong",{children:"OpenOutreach"})," (eracle/OpenOutreach). Se ainda não configurou, a validação acontece na hora de iniciar — configure em ",u.jsx("strong",{children:"Ferramentas → OpenOutreach"}),"."]})}),u.jsxs("div",{className:"flex justify-end gap-3 pt-1",children:[u.jsx("button",{onClick:()=>l(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:E,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-plus mr-2"})," Criar campanha"]})]})]})}),u.jsx(Yt,{aberto:!!c,onFechar:()=>d(null),titulo:`Eventos — ${(c==null?void 0:c.nome)??""}`,icone:"fas fa-list",largura:"lg",children:c&&u.jsxs("div",{className:"space-y-2 max-h-96 overflow-y-auto",children:[c.eventos.length===0&&u.jsx("p",{className:"text-sm text-gray-400 text-center py-8",children:"Nenhum evento ainda — inicie a campanha para gerar disparos."}),c.eventos.slice().reverse().map((N,F)=>{var z;return u.jsxs("div",{className:"flex items-start gap-3 text-sm border-b border-gray-50 pb-2",children:[u.jsx("i",{className:$("mt-1 text-xs",N.status==="enviado"?"fas fa-circle-check text-green-500":"fas fa-circle-xmark text-red-500")}),u.jsxs("div",{className:"min-w-0 flex-1",children:[u.jsx("p",{className:"text-gray-700 truncate",children:((z=r.find(q=>q.id===N.lead_id))==null?void 0:z.nome)??N.lead_id}),N.mensagem&&u.jsx("p",{className:"text-xs text-gray-400 truncate",children:N.mensagem})]}),u.jsx("span",{className:"text-xs text-gray-300 shrink-0",children:qc(N.momento)})]},F)})]})})]})}function GC(e){return e==="audio"?"audio":"texto"}const qC=[{id:"maps",rotulo:"Google Maps",icone:"fas fa-map-marked-alt"},{id:"instagram",rotulo:"Instagram",icone:"fab fa-instagram"},{id:"cnpj",rotulo:"CNPJ",icone:"fas fa-building"}];function JC(){const[e,t]=ex(),n=e.get("tab")||"maps";return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"flex gap-2",children:qC.map(r=>u.jsxs("button",{onClick:()=>t({tab:r.id}),className:$("px-5 py-2.5 text-sm font-medium rounded-lg transition",n===r.id?"bg-[#1e1b4b] text-white shadow-sm":"bg-white text-gray-600 border border-gray-200 hover:bg-gray-50"),children:[u.jsx("i",{className:$(r.icone,"mr-2")}),r.rotulo]},r.id))}),n==="maps"&&u.jsx(ej,{}),n==="instagram"&&u.jsx(tj,{}),n==="cnpj"&&u.jsx(nj,{})]})}function Nd({resultados:e,onImportar:t,importando:n}){const[r,s]=b.useState(()=>new Set(e.leads.map((a,l)=>l))),i=a=>s(l=>{const c=new Set(l);return c.has(a)?c.delete(a):c.add(a),c}),o=r.size===e.leads.length;return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-gray-100 bg-gray-50/50",children:[u.jsxs("p",{className:"text-sm font-medium text-gray-700",children:[e.leads.length," resultado(s) — ",r.size," selecionado(s)"]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{onClick:()=>s(o?new Set:new Set(e.leads.map((a,l)=>l))),className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium",children:o?"Limpar seleção":"Selecionar todos"}),u.jsxs("button",{onClick:()=>t(e.leads.filter((a,l)=>r.has(l))),disabled:r.size===0||n,className:"px-5 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-50",children:[u.jsx("i",{className:"fas fa-file-import mr-1"})," ",n?"Importando...":`Importar ${r.size}`]})]})]}),u.jsx("div",{className:"overflow-x-auto max-h-[420px] overflow-y-auto",children:u.jsxs("table",{className:"w-full text-sm",children:[u.jsx("thead",{className:"sticky top-0",children:u.jsxs("tr",{className:"text-left text-xs text-gray-500 uppercase border-b border-gray-100 bg-white",children:[u.jsx("th",{className:"px-4 py-2 w-8"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Nome / Empresa"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Contato"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Cidade"}),u.jsx("th",{className:"px-4 py-2 font-semibold",children:"Detalhes"})]})}),u.jsx("tbody",{children:e.leads.map((a,l)=>u.jsxs("tr",{className:"border-b border-gray-50 hover:bg-indigo-50/40",children:[u.jsx("td",{className:"px-4 py-2",children:u.jsx("input",{type:"checkbox",checked:r.has(l),onChange:()=>i(l),className:"w-4 h-4 accent-indigo-500"})}),u.jsx("td",{className:"px-4 py-2 text-gray-800",children:a.nome||a.empresa||"—"}),u.jsxs("td",{className:"px-4 py-2 text-gray-600",children:[u.jsx("p",{children:rd(a.telefone)}),u.jsx("p",{className:"text-xs text-gray-400",children:a.email||"sem e-mail"})]}),u.jsx("td",{className:"px-4 py-2 text-gray-500 text-xs",children:a.cidade||"—"}),u.jsx("td",{className:"px-4 py-2 text-xs text-gray-400",children:ZC(a)})]},l))})]})})]})}function ZC(e){const t=e.extras;if(!t)return"—";const n=[];return t.seguidores!==void 0&&n.push(`${t.seguidores} seguidores`),t.avaliacao!==void 0&&n.push(`★ ${t.avaliacao}`),t.qtd_avaliacoes!==void 0&&n.push(`(${t.qtd_avaliacoes} avaliações)`),n.join(" · ")||"—"}function ej(){const{toast:e}=Rt(),[t,n]=b.useState(""),[r,s]=b.useState(""),[i,o]=b.useState(100),[a,l]=b.useState(null),[c,d]=b.useState(!1),[f,h]=b.useState(!1),[p,v]=b.useState(null);b.useEffect(()=>{B.config.obter().then(v).catch(()=>{})},[]);const m=async()=>{if(t.trim().length<2||r.trim().length<2){e("erro",'Preencha a palavra-chave e a localização (ex.: "dentista", "São Paulo").');return}d(!0),l(null);try{const g=await B.extrair.googleMaps({palavra_chave:t.trim(),localizacao:r.trim(),max_resultados:i});l(g),e("sucesso",`${g.leads.length} leads extraídos — revise e importe.`)}catch(g){e("erro",g instanceof Error?g.message:"Falha na extração.")}finally{d(!1)}},w=async g=>{h(!0);try{const y=await B.leads.importar(g);e("sucesso",`${y.importados.length} importados, ${y.duplicados.length} duplicados ignorados.`),l(null)}catch(y){e("erro",y instanceof Error?y.message:"Falha ao importar.")}finally{h(!1)}},x=!!(p!=null&&p.extratores.google_maps_cli);return u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"text-sm text-gray-500",children:"Busque empresas por palavra-chave e localização (dados públicos do Google Maps)."}),u.jsx(Ut,{status:x?"ativo":"inativo",rotulo:x?"Scraper configurado":"Scraper não configurado"})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[u.jsxs("div",{className:"md:col-span-2",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Palavra-chave *"}),u.jsx("input",{value:t,onChange:g=>n(g.target.value),placeholder:"Ex.: dentista, barbearia, academia...",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Localização *"}),u.jsx("input",{value:r,onChange:g=>s(g.target.value),placeholder:"Ex.: São Paulo, SP",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Máx. resultados"}),u.jsx("input",{type:"number",min:1,max:500,value:i,onChange:g=>o(Number(g.target.value)||100),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})]}),u.jsxs("button",{onClick:m,disabled:c,className:"w-full md:w-auto px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:$("fas fa-magnifying-glass mr-2",c&&"fa-spin")}),c?"Extraindo leads...":"Extrair Leads"]}),u.jsx(Ct,{titulo:"Como instalar o Google Maps Scraper",icone:"fas fa-circle-question",children:u.jsxs("ol",{className:"text-xs text-gray-500 space-y-1 list-decimal pl-4",children:[u.jsxs("li",{children:["Instale o scraper:"," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"github.com/gosom/google-maps-scraper"})]}),u.jsxs("li",{children:["Compile (Go) e informe o caminho do binário em ",u.jsx("strong",{children:"Ferramentas → Extratores"}),"."]}),u.jsx("li",{children:"As flags do comando são ajustáveis no template de argumentos em Ferramentas."})]})})]}),a&&u.jsx(Nd,{resultados:a,onImportar:w,importando:f})]})}function tj(){const{toast:e}=Rt(),[t,n]=b.useState(""),[r,s]=b.useState(null),[i,o]=b.useState(!1),[a,l]=b.useState(!1),[c,d]=b.useState(null);b.useEffect(()=>{B.config.obter().then(d).catch(()=>{})},[]);const f=async()=>{if(!t.includes("instagram.com")){e("erro","Informe a URL do perfil (ex.: https://instagram.com/perfil).");return}o(!0),s(null);try{const v=await B.extrair.instagram(t.trim());s(v),e("sucesso","Dados extraídos — revise e importe.")}catch(v){e("erro",v instanceof Error?v.message:"Falha na extração.")}finally{o(!1)}},h=async v=>{l(!0);try{const m=await B.leads.importar(v);e("sucesso",`${m.importados.length} importados, ${m.duplicados.length} duplicados ignorados.`),s(null)}catch(m){e("erro",m instanceof Error?m.message:"Falha ao importar.")}finally{l(!1)}},p=!!(c!=null&&c.extratores.igmapper_cli);return u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"text-sm text-gray-500",children:"Extraia contatos públicos de um perfil do Instagram."}),u.jsx(Ut,{status:p?"ativo":"inativo",rotulo:p?"igmapper configurado":"igmapper não configurado"})]}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:u.jsxs("div",{className:"md:col-span-3",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"URL do perfil *"}),u.jsx("input",{value:t,onChange:v=>n(v.target.value),placeholder:"https://www.instagram.com/perfil_do_negocio/",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}),u.jsxs("button",{onClick:f,disabled:i,className:"w-full md:w-auto px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:$("fab fa-instagram mr-2",i&&"fa-spin")}),i?"Extraindo...":"Extrair do Instagram"]}),u.jsx(Ct,{titulo:"Como instalar o igmapper",icone:"fas fa-circle-question",children:u.jsxs("ol",{className:"text-xs text-gray-500 space-y-1 list-decimal pl-4",children:[u.jsxs("li",{children:["Instale: ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"github.com/lucasoal/igmapper"})]}),u.jsxs("li",{children:["Informe o caminho do CLI em ",u.jsx("strong",{children:"Ferramentas → Extratores"}),"."]})]})})]}),r&&u.jsx(Nd,{resultados:r,onImportar:h,importando:a})]})}function nj(){const{toast:e}=Rt(),[t,n]=b.useState("cnpj"),[r,s]=b.useState(""),[i,o]=b.useState(""),[a,l]=b.useState("SP"),[c,d]=b.useState(20),[f,h]=b.useState(null),[p,v]=b.useState(!1),[m,w]=b.useState(!1),x=b.useCallback(async()=>{v(!0),h(null);try{if(t==="cnpj"){const _=await B.extrair.cnpj(r.trim());h({leads:[_]}),e("sucesso","CNPJ localizado — revise e importe.")}else{const _=await B.extrair.cnpjBusca({cnae:i.trim(),uf:a.trim(),quantidade:c});h(_),e("sucesso",`${_.leads.length} empresas encontradas via ${_.provedor}.`)}}catch(_){e("erro",_ instanceof Error?_.message:"Falha na consulta.")}finally{v(!1)}},[t,r,i,a,c,e]),g=async _=>{w(!0);try{const k=await B.leads.importar(_);e("sucesso",`${k.importados.length} importados, ${k.duplicados.length} duplicados ignorados.`),h(null)}catch(k){e("erro",k instanceof Error?k.message:"Falha ao importar.")}finally{w(!1)}},y=b.useMemo(()=>["AC","AL","AP","AM","BA","CE","DF","ES","GO","MA","MT","MS","MG","PA","PB","PR","PE","PI","RJ","RN","RS","RO","RR","SC","SP","SE","TO"],[]);return u.jsxs("div",{className:"space-y-5",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{onClick:()=>n("cnpj"),className:$("px-4 py-2 text-xs font-medium rounded-lg transition",t==="cnpj"?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:bg-gray-50"),children:"Consulta por CNPJ"}),u.jsx("button",{onClick:()=>n("cnae"),className:$("px-4 py-2 text-xs font-medium rounded-lg transition",t==="cnae"?"bg-indigo-100 text-indigo-700":"text-gray-500 hover:bg-gray-50"),children:"Busca por CNAE + UF"})]}),t==="cnpj"?u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:u.jsxs("div",{className:"md:col-span-2",children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"CNPJ *"}),u.jsx("input",{value:r,onChange:_=>s(_.target.value),placeholder:"00.000.000/0000-00 (a BrasilAPI aceita com ou sem pontuação)",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}):u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"CNAE (código) *"}),u.jsx("input",{value:i,onChange:_=>o(_.target.value),placeholder:"Ex.: 6202-3/01 (desenvolvimento de software)",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"UF *"}),u.jsx("select",{value:a,onChange:_=>l(_.target.value),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none",children:y.map(_=>u.jsx("option",{children:_},_))})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Quantidade"}),u.jsx("input",{type:"number",min:1,max:100,value:c,onChange:_=>d(Number(_.target.value)||20),className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})]}),u.jsxs("button",{onClick:x,disabled:p,className:"w-full md:w-auto px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60",children:[u.jsx("i",{className:$("fas fa-building mr-2",p&&"fa-spin")}),p?"Consultando...":t==="cnpj"?"Consultar CNPJ":"Buscar empresas"]}),u.jsx(Ct,{titulo:"Fontes e scraping profundo",icone:"fas fa-circle-question",children:u.jsxs("ul",{className:"text-xs text-gray-500 space-y-1 list-disc pl-4",children:[u.jsxs("li",{children:["Consulta direta usa a ",u.jsx("strong",{children:"BrasilAPI"})," (brasilapi.com.br) — sem chave."]}),u.jsxs("li",{children:["A busca por CNAE/UF usa um ",u.jsx("strong",{children:"provedor configurável"})," (padrão: OpenCNPJ) — ajuste a URL em"," ",u.jsx("strong",{children:"Ferramentas → Extratores"})," conforme o provedor que você usa."]}),u.jsxs("li",{children:["Scraping profundo de contatos no site da empresa via ",u.jsx("strong",{children:"Scrapling"})," (D4Vinci/Scrapling), se configurado."]})]})})]}),f&&u.jsx(Nd,{resultados:f,onImportar:g,importando:m})]})}function rj(){const[e,t]=ex(),n=e.get("tab")||"disparo";return u.jsxs("div",{className:"space-y-6",children:[u.jsx("div",{className:"flex gap-2",children:[{id:"disparo",rotulo:"Agente de Disparo",icone:"fas fa-paper-plane"},{id:"atendimento",rotulo:"Agente de Atendimento",icone:"fas fa-headset"}].map(r=>u.jsxs("button",{onClick:()=>t({tab:r.id}),className:$("px-5 py-2.5 text-sm font-medium rounded-lg transition",n===r.id?"bg-[#1e1b4b] text-white shadow-sm":"bg-white text-gray-600 border border-gray-200 hover:bg-gray-50"),children:[u.jsx("i",{className:$(r.icone,"mr-2")}),r.rotulo]},r.id))}),n==="disparo"?u.jsx(sj,{}):u.jsx(ij,{})]})}function sj(){const{toast:e}=Rt(),[t,n]=b.useState({texto:"",audio:""}),[r,s]=b.useState("LeadMaster"),[i,o]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),[f,h]=b.useState(null),p=b.useCallback(async()=>{const[w,x]=await Promise.all([B.agentes.templates(),B.config.obter()]);n({texto:w.texto??"",audio:w.audio??""}),s(x.agentes.disparo.minha_empresa??"LeadMaster"),h(x.integracoes.openoutreach)},[]);b.useEffect(()=>{p().catch(w=>e("erro",w.message))},[p,e]);const v=async()=>{d(!0);try{await B.agentes.salvarTemplates(t),await B.config.salvar({agentes:{disparo:{templates:t,minha_empresa:r}}}),e("sucesso","Templates do agente de disparo salvos."),await p()}catch(w){e("erro",w instanceof Error?w.message:"Falha ao salvar templates.")}finally{d(!1)}},m=async()=>{try{const w=await B.agentes.testarTemplate(t.texto);o(w.renderizado),l(!0)}catch(w){e("erro",w instanceof Error?w.message:"Falha ao renderizar template.")}};return u.jsxs("div",{className:"space-y-5 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:"Templates de mensagem"}),u.jsx(Ut,{status:f!=null&&f.url&&f.enabled!==!1?"ativo":"inativo",rotulo:f!=null&&f.url&&f.enabled!==!1?"OpenOutreach configurado":"OpenOutreach não configurado"})]}),u.jsxs("p",{className:"text-xs text-gray-500",children:["Variáveis disponíveis: ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{nome}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{primeiro_nome}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{empresa}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{cidade}}"}),","," ",u.jsx("code",{className:"bg-gray-100 px-1 rounded",children:"{{minha_empresa}}"}),"."]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Template — texto"}),u.jsx("textarea",{value:t.texto,onChange:w=>n({...t,texto:w.target.value}),rows:4,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Template — áudio (texto para gravação)"}),u.jsx("textarea",{value:t.audio,onChange:w=>n({...t,audio:w.target.value}),rows:4,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"Nome da sua empresa"}),u.jsx("input",{value:r,onChange:w=>s(w.target.value),className:"w-full max-w-xs px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{onClick:v,disabled:c,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar templates"]}),u.jsxs("button",{onClick:m,className:"px-4 py-2.5 text-sm font-medium text-indigo-600 bg-indigo-50 border border-indigo-200 rounded-lg hover:bg-indigo-100",children:[u.jsx("i",{className:"fas fa-vial mr-2"})," Testar com lead de exemplo"]})]})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 text-sm text-gray-500 space-y-2",children:[u.jsx("p",{className:"font-medium text-gray-700 text-xs uppercase tracking-wide",children:"Como funciona"}),u.jsxs("p",{children:["O envio em massa é executado pelo ",u.jsx("strong",{children:"OpenOutreach"})," (eracle/OpenOutreach). As campanhas ficam na página ",u.jsx("strong",{children:"Disparos"}),"; a validação da integração acontece na hora de iniciar a campanha — sem travas de pré-registro."]})]}),u.jsx(Yt,{aberto:a,onFechar:()=>l(!1),titulo:"Pré-visualização do template",icone:"fas fa-comment-dots",children:u.jsx("div",{className:"bg-gray-50 border border-gray-100 rounded-lg p-4 text-sm text-gray-700 whitespace-pre-wrap",children:i})})]})}function ij(){const{toast:e}=Rt(),[t,n]=b.useState("texto"),[r,s]=b.useState(""),[i,o]=b.useState([{role:"assistant",content:"Olá! Sou o assistente de atendimento do LeadMaster. Como posso ajudar?"}]),[a,l]=b.useState(""),[c,d]=b.useState(!1),f=b.useCallback(async()=>{const v=await B.config.obter();n(v.agentes.atendimento.modo==="voz"?"voz":"texto"),s(v.integracoes.pipecat.url||"")},[]);b.useEffect(()=>{f().catch(v=>e("erro",v.message))},[f,e]);const h=async v=>{n(v);try{await B.config.salvar({agentes:{atendimento:{modo:v}},integracoes:{pipecat:{url:r}}}),e("sucesso",`Modo de atendimento: ${v==="voz"?"voz (pipecat)":"texto (LLM)"}.`)}catch(m){e("erro",m instanceof Error?m.message:"Falha ao salvar modo.")}},p=async()=>{const v=a.trim();if(!v)return;const m=[...i,{role:"user",content:v}];o(m),l(""),d(!0);try{const w=await B.agentes.chat(m.map(x=>({role:x.role==="assistant"?"assistant":"user",content:x.content})));w.ok&&w.resposta?o([...m,{role:"assistant",content:w.resposta}]):(o([...m,{role:"assistant",content:`⚠ ${w.mensagem??"Sem resposta."}`}]),e("erro",w.mensagem??"Sem resposta do agente."))}catch(w){e("erro",w instanceof Error?w.message:"Falha no chat.")}finally{d(!1)}};return u.jsxs("div",{className:"space-y-5 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-800",children:"Modo do agente de atendimento"}),u.jsx("div",{className:"flex gap-3",children:[{id:"texto",rotulo:"Texto (LLM)",icone:"fas fa-keyboard",descricao:"Chat via LLM configurado"},{id:"voz",rotulo:"Voz (pipecat)",icone:"fas fa-microphone",descricao:"Atendimento por voz"}].map(v=>u.jsxs("button",{onClick:()=>h(v.id),className:$("flex-1 px-4 py-3 rounded-lg border text-left transition",t===v.id?"bg-indigo-50 border-indigo-400":"bg-white border-gray-200 hover:bg-gray-50"),children:[u.jsxs("p",{className:$("text-sm font-medium flex items-center gap-2",t===v.id?"text-indigo-700":"text-gray-600"),children:[u.jsx("i",{className:v.icone})," ",v.rotulo]}),u.jsx("p",{className:"text-xs text-gray-400 mt-1",children:v.descricao})]},v.id))}),t==="voz"&&u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"URL do serviço pipecat"}),u.jsx("input",{value:r,onChange:v=>s(v.target.value),onBlur:()=>h("voz"),placeholder:"http://localhost:5000",className:"w-full max-w-md px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6",children:[u.jsx("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:"Testar conversa"}),u.jsxs("div",{className:"space-y-3 max-h-80 overflow-y-auto mb-4",children:[i.map((v,m)=>u.jsx("div",{className:$("flex",v.role==="user"?"justify-end":"justify-start"),children:u.jsx("div",{className:$("max-w-[80%] px-4 py-2.5 rounded-2xl text-sm",v.role==="user"?"bg-indigo-500 text-white rounded-br-sm":"bg-gray-100 text-gray-700 rounded-bl-sm"),children:v.content})},m)),c&&u.jsxs("div",{className:"text-xs text-gray-400 flex items-center gap-2",children:[u.jsx("i",{className:"fas fa-spinner fa-spin"})," pensando..."]})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("input",{value:a,onChange:v=>l(v.target.value),onKeyDown:v=>v.key==="Enter"&&p(),placeholder:"Digite uma mensagem do cliente para testar...",className:"flex-1 px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"}),u.jsx("button",{onClick:p,disabled:c,className:"px-5 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:u.jsx("i",{className:"fas fa-paper-plane"})})]})]})]})}function oj({onConfigSalva:e}){const{toast:t}=Rt(),[n,r]=b.useState(null),[s,i]=b.useState(!1),[o,a]=b.useState(""),l=b.useCallback(async()=>{const h=await B.config.obter();r(h)},[]);if(b.useEffect(()=>{l().catch(h=>t("erro",h.message))},[l,t]),!n)return u.jsx("div",{className:"text-center text-gray-400 py-16",children:u.jsx("i",{className:"fas fa-spinner fa-spin text-2xl"})});const c=h=>{r(p=>{if(!p)return p;const v=JSON.parse(JSON.stringify(p));return h(v),v})},d=async()=>{i(!0);try{const h=await B.config.salvar(n);r(h),e==null||e(h),t("sucesso","Configurações salvas localmente (config.json).")}catch(h){t("erro",h instanceof Error?h.message:"Falha ao salvar configurações.")}finally{i(!1)}},f=async()=>{a("llm");try{const h=await B.config.testarLlm();t(h.ok?"sucesso":"erro",h.ok?`LLM respondeu: ${h.resposta}`:h.mensagem??"Falha no teste.")}finally{a("")}};return u.jsxs("div",{className:"space-y-6 max-w-4xl",children:[u.jsxs(ko,{titulo:"LLM (agentes de IA)",icone:"fas fa-brain",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsx(At,{rotulo:"Base URL",valor:n.llm.base_url,onChange:h=>c(p=>{p.llm.base_url=h}),placeholder:"https://api.openai.com/v1"}),u.jsx(At,{rotulo:"Modelo",valor:n.llm.modelo,onChange:h=>c(p=>{p.llm.modelo=h}),placeholder:"gpt-4o-mini"}),u.jsx(lj,{rotulo:"API Key",configurado:!!n.llm.api_key_configurado,onChange:h=>c(p=>{p.llm.api_key=h})})]}),u.jsx(cj,{rotulo:"Testar conexão LLM",carregando:o==="llm",onClick:f})]}),u.jsxs(ko,{titulo:"Extratores de leads",icone:"fas fa-magnifying-glass-location",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(At,{rotulo:"Google Maps Scraper — binário",valor:n.extratores.google_maps_cli,onChange:h=>c(p=>{p.extratores.google_maps_cli=h}),placeholder:"C:\\ferramentas\\google-maps-scraper.exe"}),u.jsx(At,{rotulo:"igmapper — binário",valor:n.extratores.igmapper_cli,onChange:h=>c(p=>{p.extratores.igmapper_cli=h}),placeholder:"Caminho do CLI igmapper"})]}),u.jsxs(Ct,{titulo:"Argumentos dos scrapers (templates)",icone:"fas fa-terminal",children:[u.jsx(Cp,{rotulo:"Google Maps — template de argumentos",valor:n.extratores.google_maps_args,onChange:h=>c(p=>{p.extratores.google_maps_args=h}),linhas:2}),u.jsx(Cp,{rotulo:"igmapper — template de argumentos",valor:n.extratores.igmapper_args,onChange:h=>c(p=>{p.extratores.igmapper_args=h}),linhas:2})]}),u.jsxs(Ct,{titulo:"CNPJ e Scrapling",icone:"fas fa-building",children:[u.jsx(At,{rotulo:"Provedor de busca CNAE/UF — URL",valor:n.extratores.cnpj_provedor_busca,onChange:h=>c(p=>{p.extratores.cnpj_provedor_busca=h}),placeholder:"https://api.opencnpj.org"}),u.jsx(At,{rotulo:"Scrapling — binário (scraping profundo)",valor:n.extratores.scrapling_cli,onChange:h=>c(p=>{p.extratores.scrapling_cli=h}),placeholder:"Caminho do CLI Scrapling"})]})]}),u.jsxs(ko,{titulo:"Agentes — integrações",icone:"fas fa-robot",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsx(At,{rotulo:"OpenOutreach — URL",valor:n.integracoes.openoutreach.url,onChange:h=>c(p=>{p.integracoes.openoutreach.url=h}),placeholder:"http://localhost:9090"}),u.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-600 bg-indigo-50 border border-indigo-100 rounded-lg px-3 py-2.5 cursor-pointer h-fit mt-5",children:[u.jsx("input",{type:"checkbox",checked:n.integracoes.openoutreach.enabled,onChange:h=>c(p=>{p.integracoes.openoutreach.enabled=h.target.checked}),className:"w-4 h-4 accent-indigo-500"}),"OpenOutreach ativo"]})]}),u.jsx(At,{rotulo:"pipecat — URL (atendimento por voz)",valor:n.integracoes.pipecat.url,onChange:h=>c(p=>{p.integracoes.pipecat.url=h}),placeholder:"http://localhost:5000"})]}),u.jsx(ko,{titulo:"Perfil e licença",icone:"fas fa-user",children:u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[u.jsx(At,{rotulo:"Seu nome",valor:n.perfil.nome,onChange:h=>c(p=>{p.perfil.nome=h})}),u.jsx(At,{rotulo:"Expira em",valor:n.perfil.licenca.expira_em,onChange:h=>c(p=>{p.perfil.licenca.expira_em=h})}),u.jsx(aj,{rotulo:"Dias restantes (vazio = infinito)",valor:n.perfil.licenca.restam_dias??0,onChange:h=>c(p=>{p.perfil.licenca.restam_dias=h>0?h:null})})]})}),u.jsx("div",{className:"flex justify-end",children:u.jsxs("button",{onClick:d,disabled:s,className:"px-8 py-3 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 transition disabled:opacity-60 shadow-sm",children:[u.jsx("i",{className:$("fas fa-save mr-2",s&&"fa-spin")}),s?"Salvando...":"Salvar configurações"]})})]})}function ko({titulo:e,icone:t,children:n}){return u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-4",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-800 flex items-center gap-2",children:[u.jsx("i",{className:$(t,"text-indigo-400")})," ",e]}),n]})}function At({rotulo:e,valor:t,onChange:n,placeholder:r,tipo:s="text"}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("input",{type:s,value:t,onChange:i=>n(i.target.value),placeholder:r,className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function aj({rotulo:e,valor:t,onChange:n}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("input",{type:"number",value:t??0,onChange:r=>n(Number(r.target.value)||0),className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function lj({rotulo:e,configurado:t,onChange:n}){return u.jsxs("div",{children:[u.jsxs("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:[e," ",t&&u.jsx("span",{className:"text-green-600",children:"• configurado"})]}),u.jsx("input",{type:"password",onChange:r=>n(r.target.value),placeholder:t?"•••••••• (deixe vazio para manter)":"cole a chave aqui",className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function Cp({rotulo:e,valor:t,onChange:n,linhas:r=3}){return u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:e}),u.jsx("textarea",{value:t,onChange:s=>n(s.target.value),rows:r,className:"w-full px-3 py-2 text-xs font-mono border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]})}function cj({rotulo:e,onClick:t,carregando:n}){return u.jsxs("button",{onClick:t,disabled:n,className:"text-xs text-indigo-600 hover:text-indigo-800 font-medium disabled:opacity-50",children:[u.jsx("i",{className:$("fas fa-vial-circle-check mr-1",n&&"fa-spin")})," ",e]})}const uj=[{id:"lead.criado",rotulo:"Lead criado"},{id:"lead.etapa",rotulo:"Lead mudou de etapa"},{id:"campanha.concluida",rotulo:"Campanha concluída"}];function dj(){const{toast:e}=Rt(),[t,n]=b.useState(""),[r,s]=b.useState(new Set),[i,o]=b.useState(""),[a,l]=b.useState(!1),[c,d]=b.useState(!1),f=b.useCallback(async()=>{const m=await B.webhook.obter();n(m.url),s(new Set(m.eventos))},[]);b.useEffect(()=>{f().catch(m=>e("erro",m.message))},[f,e]);const h=m=>s(w=>{const x=new Set(w);return x.has(m)?x.delete(m):x.add(m),x}),p=async()=>{d(!0);try{await B.webhook.salvar({url:t.trim(),eventos:[...r]}),e("sucesso","Webhook salvo.")}catch(m){e("erro",m instanceof Error?m.message:"Falha ao salvar webhook.")}finally{d(!1)}},v=async()=>{if(!t.trim()){e("erro","Informe a URL do webhook antes de testar.");return}try{const m=await B.webhook.testar(t.trim());m.ok?o(`✅ HTTP ${m.status_http} — o endpoint recebeu o evento de teste.
89
-
90
- ${m.resposta??""}`):o(`❌ ${m.mensagem??"Falha no teste."}`),l(!0)}catch(m){e("erro",m instanceof Error?m.message:"Falha no teste.")}};return u.jsxs("div",{className:"space-y-6 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-5",children:[u.jsx("p",{className:"text-sm text-gray-500",children:"Receba eventos do LeadMaster (lead criado, mudança de etapa, campanha concluída) em qualquer endpoint local ou externo — útil para integrar com automações (n8n, Make, Zapier etc.)."}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:"URL do webhook"}),u.jsx("input",{value:t,onChange:m=>n(m.target.value),placeholder:"https://seu-endpoint.com/webhook",className:"w-full px-3 py-2.5 text-sm border border-gray-200 rounded-lg focus:ring-2 focus:ring-indigo-400 outline-none"})]}),u.jsxs("div",{children:[u.jsx("label",{className:"block text-xs font-medium text-gray-500 mb-2",children:"Eventos enviados"}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:uj.map(m=>u.jsxs("label",{className:$("flex items-center gap-3 px-4 py-3 rounded-lg border text-sm cursor-pointer transition",r.has(m.id)?"bg-indigo-50 border-indigo-300 text-indigo-700":"bg-white border-gray-200 text-gray-500 hover:bg-gray-50"),children:[u.jsx("input",{type:"checkbox",checked:r.has(m.id),onChange:()=>h(m.id),className:"w-4 h-4 accent-indigo-500"}),m.rotulo,u.jsx("code",{className:"text-[10px] text-gray-400 ml-auto",children:m.id})]},m.id))})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{onClick:p,disabled:c,className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:[u.jsx("i",{className:"fas fa-save mr-2"})," Salvar"]}),u.jsxs("button",{onClick:v,className:"px-4 py-2.5 text-sm font-medium text-indigo-600 bg-indigo-50 border border-indigo-200 rounded-lg hover:bg-indigo-100",children:[u.jsx("i",{className:"fas fa-paper-plane mr-2"})," Enviar evento de teste"]})]})]}),u.jsx(Yt,{aberto:a,onFechar:()=>l(!1),titulo:"Resultado do teste",icone:"fas fa-satellite-dish",children:u.jsx("pre",{className:"text-xs text-gray-600 bg-gray-50 rounded-lg p-4 whitespace-pre-wrap",children:i})})]})}function fj(){const{toast:e}=Rt(),[t,n]=b.useState(null),[r,s]=b.useState(!1),i=async()=>{s(!0);try{n(await B.doctor()),e("sucesso","Diagnóstico concluído.")}catch(o){e("erro",o instanceof Error?o.message:"Falha no diagnóstico.")}finally{s(!1)}};return b.useEffect(()=>{i()},[]),u.jsxs("div",{className:"space-y-6 max-w-3xl",children:[u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-800 flex items-center gap-2",children:[u.jsx("i",{className:"fas fa-heart-pulse text-indigo-400"})," Diagnóstico do ambiente"]}),u.jsxs("button",{onClick:i,disabled:r,className:"px-4 py-2 text-xs font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90 disabled:opacity-60",children:[u.jsx("i",{className:$("fas fa-rotate mr-1",r&&"fa-spin")})," Executar novamente"]})]}),t&&u.jsxs("div",{className:"mt-4 space-y-2 text-sm",children:[u.jsx(Ls,{rotulo:"Versão do LeadMaster",valor:t.versao}),u.jsx(Ls,{rotulo:"Python",valor:t.python}),u.jsx(Ls,{rotulo:"Sistema",valor:t.sistema}),u.jsx(Ls,{rotulo:"Interface construída (dist)",valor:t.dist_frontend?"presente":"ausente (modo dev)"}),u.jsx(Ls,{rotulo:"Pasta de dados",valor:t.storage}),u.jsx("div",{className:"pt-2 flex flex-wrap gap-2",children:Object.entries(t.integracoes).map(([o,a])=>u.jsx(Ut,{status:a?"ativo":"inativo",rotulo:`${hj(o)}: ${a?"ativo":"inativo"}`},o))})]})]}),u.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6",children:[u.jsxs("h3",{className:"text-sm font-semibold text-gray-800 mb-3",children:[u.jsx("i",{className:"fas fa-circle-question text-indigo-400 mr-2"})," Perguntas frequentes"]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx(Ct,{titulo:"Meus dados ficam na nuvem?",icone:"fas fa-cloud",children:"Não. O LeadMaster é 100% local: todos os dados (leads, campanhas e configuração) ficam em arquivos JSON na sua pasta de dados."}),u.jsx(Ct,{titulo:"Como turbinar os agentes com IA?",icone:"fas fa-brain",children:"Em Ferramentas → LLM, informe base URL, modelo e API key de qualquer API OpenAI-compatível. O agente de CRM passa a enriquecer e sugerir com mais contexto, e o de atendimento conversa por texto. Sem LLM, as heurísticas locais continuam funcionando."}),u.jsx(Ct,{titulo:"Como funcionam os disparos?",icone:"fas fa-paper-plane",children:"As campanhas de Disparos usam o OpenOutreach (eracle/OpenOutreach). Configure a URL em Ferramentas → Agentes — a validação acontece só na hora de iniciar a campanha."}),u.jsx(Ct,{titulo:"Onde reporto problemas?",icone:"fas fa-bug",children:"Abra uma issue em github.com/DanHachuel/LeadMaster ou use a página de diagnóstico acima ao pedir ajuda — ela resume todo o ambiente."})]})]}),u.jsxs("div",{className:"bg-[#1e1b4b] text-white rounded-xl p-6 flex items-center justify-between flex-wrap gap-4",children:[u.jsxs("div",{children:[u.jsx("p",{className:"text-sm font-semibold",children:"LeadMaster — SaaS local de prospecção e automação de conteúdo"}),u.jsx("p",{className:"text-xs text-gray-300 mt-1",children:"Instalável via npx · dados 100% locais · sem mensalidade de nuvem"})]}),u.jsxs("a",{href:"https://github.com/DanHachuel/LeadMaster",target:"_blank",rel:"noreferrer",className:"px-4 py-2.5 text-sm font-medium bg-white/10 hover:bg-white/20 rounded-lg transition",children:[u.jsx("i",{className:"fab fa-github mr-2"})," Repositório"]})]})]})}function Ls({rotulo:e,valor:t}){return u.jsxs("div",{className:"flex items-center justify-between border-b border-gray-50 pb-2",children:[u.jsx("span",{className:"text-xs text-gray-500",children:e}),u.jsx("span",{className:"text-xs font-medium text-gray-700 text-right break-all max-w-[60%]",children:t})]})}function hj(e){return{llm_configurado:"LLM",openoutreach:"OpenOutreach",pipecat:"pipecat"}[e]??e}const pj={"/":"Painel","/leads":"Leads","/agentes":"Agentes","/ferramentas":"Ferramentas","/extratores":"Extratores de Leads","/disparos":"Disparos","/crm":"CRM — Kanban","/webhook":"Webhook","/suporte":"Suporte"};function gj(){const[e,t]=b.useState(null),[n,r]=b.useState(!1),[s,i]=b.useState(!1),o=b.useCallback(async()=>{try{t(await B.config.obter())}catch{}},[]);return b.useEffect(()=>{o()},[o]),s?u.jsx("div",{className:"min-h-screen bg-[#1e1b4b] text-white flex items-center justify-center p-8",children:u.jsxs("div",{className:"text-center max-w-md",children:[u.jsx("i",{className:"fas fa-power-off text-4xl text-indigo-300 mb-4 block"}),u.jsx("h1",{className:"text-xl font-bold",children:"LeadMaster encerrado"}),u.jsx("p",{className:"text-sm text-gray-300 mt-3",children:"O servidor local foi desligado com sucesso. Seus dados estão salvos na pasta de dados."}),u.jsxs("p",{className:"text-xs text-gray-400 mt-6",children:["Para voltar, execute: ",u.jsx("code",{className:"bg-white/10 px-2 py-1 rounded",children:"npx --yes @danhachuel/leadmaster"})]})]})}):u.jsx(fw,{children:u.jsxs(Ub,{children:[u.jsx(mj,{nomeUsuario:(e==null?void 0:e.perfil.nome)??"...",onSair:()=>r(!0),onConfigSalva:a=>t(a)}),u.jsxs(Yt,{aberto:n,onFechar:()=>r(!1),titulo:"Encerrar o LeadMaster",icone:"fas fa-power-off",children:[u.jsx("p",{className:"text-sm text-gray-600",children:"Isso encerra o servidor local (os processos do terminal também fecham). Seus dados permanecem salvos nos arquivos JSON da pasta de dados. Deseja continuar?"}),u.jsxs("div",{className:"flex justify-end gap-3 mt-6",children:[u.jsx("button",{onClick:()=>r(!1),className:"px-4 py-2.5 text-sm font-medium text-gray-600 bg-white border border-gray-200 rounded-lg hover:bg-gray-50",children:"Cancelar"}),u.jsxs("button",{onClick:async()=>{r(!1);try{await B.shutdown()}catch{}setTimeout(()=>i(!0),400)},className:"px-6 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-indigo-500 to-purple-500 rounded-lg hover:opacity-90",children:[u.jsx("i",{className:"fas fa-power-off mr-2"})," Encerrar"]})]})]})]})})}function mj({nomeUsuario:e,onSair:t,onConfigSalva:n}){const r=qn(),s=pj[r.pathname]??"LeadMaster";return u.jsxs("div",{className:"bg-gray-100 min-h-screen flex",children:[u.jsx(cw,{onSair:t}),u.jsxs("main",{className:"flex-1 flex flex-col min-w-0",children:[u.jsx(aw,{titulo:s,nomeUsuario:e}),u.jsxs("div",{className:"p-8 space-y-6 overflow-y-auto flex-1",children:[u.jsxs(Ab,{children:[u.jsx(zt,{path:"/",element:u.jsx(ak,{nomeUsuario:e})}),u.jsx(zt,{path:"/leads",element:u.jsx(fk,{})}),u.jsx(zt,{path:"/crm",element:u.jsx(XC,{})}),u.jsx(zt,{path:"/disparos",element:u.jsx(QC,{})}),u.jsx(zt,{path:"/extratores",element:u.jsx(JC,{})}),u.jsx(zt,{path:"/agentes",element:u.jsx(rj,{})}),u.jsx(zt,{path:"/ferramentas",element:u.jsx(oj,{onConfigSalva:n})}),u.jsx(zt,{path:"/webhook",element:u.jsx(dj,{})}),u.jsx(zt,{path:"/suporte",element:u.jsx(fj,{})})]}),u.jsxs("footer",{className:"flex items-center justify-between text-xs text-gray-400 pt-4 border-t border-gray-200",children:[u.jsx("span",{children:"© 2026 LeadMaster. Todos os direitos reservados."}),u.jsx("span",{children:"Dados 100% locais — sem nuvem"})]})]})]})]})}Zl.createRoot(document.getElementById("root")).render(u.jsx(fe.StrictMode,{children:u.jsx(gj,{})}));