vendor: 4,872 bytes, lines 1-9
1function YL(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in t)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();var xp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ft(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function MG(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var eb={exports:{}},Kd={},tb={exports:{}},_t={};/** 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 AT;function RG(){if(AT)return _t;AT=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function p(O){return O===null||typeof O!="object"?null:(O=m&&O[m]||O["@@iterator"],typeof O=="function"?O:null)}var v={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function x(O,W,q){this.props=O,this.context=W,this.refs=y,this.updater=q||v}x.prototype.isReactComponent={},x.prototype.setState=function(O,W){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,W,"setState")},x.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function j(){}j.prototype=x.prototype;function N(O,W,q){this.props=O,this.context=W,this.refs=y,this.updater=q||v}var S=N.prototype=new j;S.constructor=N,b(S,x.prototype),S.isPureReactComponent=!0;var k=Array.isArray,C=Object.prototype.hasOwnProperty,A={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(O,W,q){var se,me={},fe=null,Q=null;if(W!=null)for(se in W.ref!==void 0&&(Q=W.ref),W.key!==void 0&&(fe=""+W.key),W)C.call(W,se)&&!T.hasOwnProperty(se)&&(me[se]=W[se]);var pe=arguments.length-2;if(pe===1)me.children=q;else if(1<pe){for(var V=Array(pe),J=0;J<pe;J++)V[J]=arguments[J+2];me.children=V}if(O&&O.defaultProps)for(se in pe=O.defaultProps,pe)me[se]===void 0&&(me[se]=pe[se]);return{$$typeof:t,type:O,key:fe,ref:Q,props:me,_owner:A.current}}function I(O,W){return{$$typeof:t,type:O.type,key:W,ref:O.ref,props:O.props,_owner:O._owner}}function D(O){return typeof O=="object"&&O!==null&&O.$$typeof===t}function L(O){var W={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(q){return W[q]})}var z=/\/+/g;function H(O,W){return typeof O=="object"&&O!==null&&O.key!=null?L(""+O.key):W.toString(36)}function Z(O,W,q,se,me){var fe=typeof O;(fe==="undefined"||fe==="boolean")&&(O=null);var Q=!1;if(O===null)Q=!0;else switch(fe){case"string":case"number":Q=!0;break;case"object":switch(O.$$typeof){case t:case e:Q=!0}}if(Q)return Q=O,me=me(Q),O=se===""?"."+H(Q,0):se,k(me)?(q="",O!=null&&(q=O.replace(z,"$&/")+"/"),Z(me,W,q,"",function(J){return J})):me!=null&&(D(me)&&(me=I(me,q+(!me.key||Q&&Q.key===me.key?"":(""+me.key).replace(z,"$&/")+"/")+O)),W.push(me)),1;if(Q=0,se=se===""?".":se+":",k(O))for(var pe=0;pe<O.length;pe++){fe=O[pe];var V=se+H(fe,pe);Q+=Z(fe,W,q,V,me)}
vendor: 10,671 bytes, lines 9-33
9else if(V=p(O),typeof V=="function")for(O=V.call(O),pe=0;!(fe=O.next()).done;)fe=fe.value,V=se+H(fe,pe++),Q+=Z(fe,W,q,V,me);else if(fe==="object")throw W=String(O),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.");return Q}function te(O,W,q){if(O==null)return O;var se=[],me=0;return Z(O,se,"","",function(fe){return W.call(q,fe,me++)}),se}function G(O){if(O._status===-1){var W=O._result;W=W(),W.then(function(q){(O._status===0||O._status===-1)&&(O._status=1,O._result=q)},function(q){(O._status===0||O._status===-1)&&(O._status=2,O._result=q)}),O._status===-1&&(O._status=0,O._result=W)}if(O._status===1)return O._result.default;throw O._result}var M={current:null},F={transition:null},K={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:F,ReactCurrentOwner:A};function B(){throw Error("act(...) is not supported in production builds of React.")}return _t.Children={map:te,forEach:function(O,W,q){te(O,function(){W.apply(this,arguments)},q)},count:function(O){var W=0;return te(O,function(){W++}),W},toArray:function(O){return te(O,function(W){return W})||[]},only:function(O){if(!D(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},_t.Component=x,_t.Fragment=r,_t.Profiler=a,_t.PureComponent=N,_t.StrictMode=n,_t.Suspense=u,_t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=K,_t.act=B,_t.cloneElement=function(O,W,q){if(O==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+O+".");var se=b({},O.props),me=O.key,fe=O.ref,Q=O._owner;if(W!=null){if(W.ref!==void 0&&(fe=W.ref,Q=A.current),W.key!==void 0&&(me=""+W.key),O.type&&O.type.defaultProps)var pe=O.type.defaultProps;for(V in W)C.call(W,V)&&!T.hasOwnProperty(V)&&(se[V]=W[V]===void 0&&pe!==void 0?pe[V]:W[V])}var V=arguments.length-2;if(V===1)se.children=q;else if(1<V){pe=Array(V);for(var J=0;J<V;J++)pe[J]=arguments[J+2];se.children=pe}return{$$typeof:t,type:O.type,key:me,ref:fe,props:se,_owner:Q}},_t.createContext=function(O){return O={$$typeof:o,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},O.Provider={$$typeof:i,_context:O},O.Consumer=O},_t.createElement=R,_t.createFactory=function(O){var W=R.bind(null,O);return W.type=O,W},_t.createRef=function(){return{current:null}},_t.forwardRef=function(O){return{$$typeof:l,render:O}},_t.isValidElement=D,_t.lazy=function(O){return{$$typeof:h,_payload:{_status:-1,_result:O},_init:G}},_t.memo=function(O,W){return{$$typeof:d,type:O,compare:W===void 0?null:W}},_t.startTransition=function(O){var W=F.transition;F.transition={};try{O()}finally{F.transition=W}},_t.unstable_act=B,_t.useCallback=function(O,W){return M.current.useCallback(O,W)},_t.useContext=function(O){return M.current.useContext(O)},_t.useDebugValue=function(){},_t.useDeferredValue=function(O){return M.current.useDeferredValue(O)},_t.useEffect=function(O,W){return M.current.useEffect(O,W)},_t.useId=function(){return M.current.useId()},_t.useImperativeHandle=function(O,W,q){return M.current.useImperativeHandle(O,W,q)},_t.useInsertionEffect=function(O,W){return M.current.useInsertionEffect(O,W)},_t.useLayoutEffect=function(O,W){return M.current.useLayoutEffect(O,W)},_t.useMemo=function(O,W){return M.current.useMemo(O,W)},_t.useReducer=function(O,W,q){return M.current.useReducer(O,W,q)},_t.useRef=function(O){return M.current.useRef(O)},_t.useState=function(O){return M.current.useState(O)},_t.useSyncExternalStore=function(O,W,q){return M.current.useSyncExternalStore(O,W,q)},_t.useTransition=function(){return M.current.useTransition()},_t.version="18.3.1",_t}var PT;function H2(){return PT||(PT=1,tb.exports=RG()),tb.exports}/** 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 TT;function IG(){if(TT)return Kd;TT=1;var t=H2(),e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function o(l,u,d){var h,m={},p=null,v=null;d!==void 0&&(p=""+d),u.key!==void 0&&(p=""+u.key),u.ref!==void 0&&(v=u.ref);for(h in u)n.call(u,h)&&!i.hasOwnProperty(h)&&(m[h]=u[h]);if(l&&l.defaultProps)for(h in u=l.defaultProps,u)m[h]===void 0&&(m[h]=u[h]);return{$$typeof:e,type:l,key:p,ref:v,props:m,_owner:a.current}}return Kd.Fragment=r,Kd.jsx=o,Kd.jsxs=o,Kd}var OT;function DG(){return OT||(OT=1,eb.exports=IG()),eb.exports}var s=DG(),w=H2();const U=Ft(w),Zv=YL({__proto__:null,default:U},[w]);var yp={},rb={exports:{}},Sn={},nb={exports:{}},ab={};/** 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 */var MT;function $G(){return MT||(MT=1,(function(t){function e(F,K){var B=F.length;F.push(K);e:for(;0<B;){var O=B-1>>>1,W=F[O];if(0<a(W,K))F[O]=K,F[B]=W,B=O;else break e}}function r(F){return F.length===0?null:F[0]}function n(F){if(F.length===0)return null;var K=F[0],B=F.pop();if(B!==K){F[0]=B;e:for(var O=0,W=F.length,q=W>>>1;O<q;){var se=2*(O+1)-1,me=F[se],fe=se+1,Q=F[fe];if(0>a(me,B))fe<W&&0>a(Q,me)?(F[O]=Q,F[fe]=B,O=fe):(F[O]=me,F[se]=B,O=se);else if(fe<W&&0>a(Q,B))F[O]=Q,F[fe]=B,O=fe;else break e}}return K}function a(F,K){var B=F.sortIndex-K.sortIndex;return B!==0?B:F.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var u=[],d=[],h=1,m=null,p=3,v=!1,b=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(F){for(var K=r(d);K!==null;){if(K.callback===null)n(d);else if(K.startTime<=F)n(d),K.sortIndex=K.expirationTime,e(u,K);else break;K=r(d)}}function k(F){if(y=!1,S(F),!b)if(r(u)!==null)b=!0,G(C);else{var K=r(d);K!==null&&M(k,K.startTime-F)}}function C(F,K){b=!1,y&&(y=!1,j(R),R=-1),v=!0;var B=p;try{for(S(K),m=r(u);m!==null&&(!(m.expirationTime>K)||F&&!L());){var O=m.callback;if(typeof O=="function"){m.callback=null,p=m.priorityLevel;var W=O(m.expirationTime<=K);K=t.unstable_now(),typeof W=="function"?m.callback=W:m===r(u)&&n(u),S(K)}else n(u);m=r(u)}if(m!==null)var q=!0;else{var se=r(d);se!==null&&M(k,se.startTime-K),q=!1}return q}finally{m=null,p=B,v=!1}}var A=!1,T=null,R=-1,I=5,D=-1;function L(){return!(t.unstable_now()-D<I)}function z(){if(T!==null){var F=t.unstable_now();D=F;var K=!0;try{K=T(!0,F)}finally{K?H():(A=!1,T=null)}}else A=!1}var H;if(typeof N=="function")H=function(){N(z)};else if(typeof MessageChannel<"u"){var Z=new MessageChannel,te=Z.port2;Z.port1.onmessage=z,H=function(){te.postMessage(null)}}else H=function(){x(z,0)};function G(F){T=F,A||(A=!0,H())}function M(F,K){R=x(function(){F(t.unstable_now())},K)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(F){F.callback=null},t.unstable_continueExecution=function(){b||v||(b=!0,G(C))},t.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<F?Math.floor(1e3/F):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return r(u)},t.unstable_next=function(F){switch(p){case 1:case 2:case 3:var K=3;break;default:K=p}var B=p;p=K;try{return F()}finally{p=B}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(F,K){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var B=p;p=F;try{return K()}finally{p=B}},t.unstable_scheduleCallback=function(F,K,B){var O=t.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?O+B:O):B=O,F){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=B+W,F={id:h++,callback:K,priorityLevel:F,startTime:B,expirationTime:W,sortIndex:-1},B>O?(F.sortIndex=B,e(d,F),r(u)===null&&F===r(d)&&(y?(j(R),R=-1):y=!0,M(k,B-O))):(F.sortIndex=W,e(u,F),b||v||(b=!0,G(C))),F},t.unstable_shouldYield=L,t.unstable_wrapCallback=function(F){var K=p;return function(){var B=p;p=K;try{return F.apply(this,arguments)}finally{p=B}}}})(ab)),ab}var RT;function LG(){return RT||(RT=1,nb.exports=$G()),nb.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 IT;function FG(){if(IT)return Sn;IT=1;var t=H2(),e=LG();function r(c){for(var f="https://reactjs.org/docs/error-decoder.html?invariant="+c,g=1;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g]);return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var n=new Set,a={};function i(c,f){o(c,f),o(c+"Capture",f)}function o(c,f){for(a[c]=f,c=0;c<f.length;c++)n.add(f[c])}var l=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),u=Object.prototype.hasOwnProperty,d=/^[: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]*$/,h={},m={};function p(c){return u.call(m,c)?!0:u.call(h,c)?!1:d.test(c)?m[c]=!0:(h[c]=!0,!1)}function v(c,f,g,_){if(g!==null&&g.type===0)return!1;switch(typeof f){case"function":case"symbol":return!0;case"boolean":return _?!1:g!==null?!g.acceptsBooleans:(c=c.toLowerCase().slice(0,5),c!=="data-"&&c!=="aria-");default:return!1}}function b(c,f,g,_){if(f===null||typeof f>"u"||v(c,f,g,_))return!0;
vendor: 45,197 bytes, lines 33-38
33if(_)return!1;if(g!==null)switch(g.type){case 3:return!f;case 4:return f===!1;case 5:return isNaN(f);case 6:return isNaN(f)||1>f}return!1}function y(c,f,g,_,E,P,$){this.acceptsBooleans=f===2||f===3||f===4,this.attributeName=_,this.attributeNamespace=E,this.mustUseProperty=g,this.propertyName=c,this.type=f,this.sanitizeURL=P,this.removeEmptyString=$}var x={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(c){x[c]=new y(c,0,!1,c,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(c){var f=c[0];x[f]=new y(f,1,!1,c[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(c){x[c]=new y(c,2,!1,c.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(c){x[c]=new y(c,2,!1,c,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(c){x[c]=new y(c,3,!1,c.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(c){x[c]=new y(c,3,!0,c,null,!1,!1)}),["capture","download"].forEach(function(c){x[c]=new y(c,4,!1,c,null,!1,!1)}),["cols","rows","size","span"].forEach(function(c){x[c]=new y(c,6,!1,c,null,!1,!1)}),["rowSpan","start"].forEach(function(c){x[c]=new y(c,5,!1,c.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function N(c){return c[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(c){var f=c.replace(j,N);x[f]=new y(f,1,!1,c,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(c){var f=c.replace(j,N);x[f]=new y(f,1,!1,c,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(c){var f=c.replace(j,N);x[f]=new y(f,1,!1,c,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(c){x[c]=new y(c,1,!1,c.toLowerCase(),null,!1,!1)}),x.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(c){x[c]=new y(c,1,!1,c.toLowerCase(),null,!0,!0)});function S(c,f,g,_){var E=x.hasOwnProperty(f)?x[f]:null;(E!==null?E.type!==0:_||!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(b(f,g,E,_)&&(g=null),_||E===null?p(f)&&(g===null?c.removeAttribute(f):c.setAttribute(f,""+g)):E.mustUseProperty?c[E.propertyName]=g===null?E.type===3?!1:"":g:(f=E.attributeName,_=E.attributeNamespace,g===null?c.removeAttribute(f):(E=E.type,g=E===3||E===4&&g===!0?"":""+g,_?c.setAttributeNS(_,f,g):c.setAttribute(f,g))))}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,C=Symbol.for("react.element"),A=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),L=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),G=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),F=Symbol.iterator;function K(c){return c===null||typeof c!="object"?null:(c=F&&c[F]||c["@@iterator"],typeof c=="function"?c:null)}var B=Object.assign,O;function W(c){if(O===void 0)try{throw Error()}catch(g){var f=g.stack.trim().match(/\n( *(at )?)/);O=f&&f[1]||""}return` 34`+O+c}var q=!1;function se(c,f){if(!c||q)return"";q=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(f)if(f=function(){throw Error()},Object.defineProperty(f.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(f,[])}catch(ge){var _=ge}Reflect.construct(c,[],f)}else{try{f.call()}catch(ge){_=ge}c.call(f.prototype)}else{try{throw Error()}catch(ge){_=ge}c()}}catch(ge){if(ge&&_&&typeof ge.stack=="string"){for(var E=ge.stack.split(` 35`),P=_.stack.split(` 36`),$=E.length-1,X=P.length-1;1<=$&&0<=X&&E[$]!==P[X];)X--;for(;1<=$&&0<=X;$--,X--)if(E[$]!==P[X]){if($!==1||X!==1)do if($--,X--,0>X||E[$]!==P[X]){var ae=` 37`+E[$].replace(" at new "," at ");return c.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",c.displayName)),ae}while(1<=$&&0<=X);break}}}finally{q=!1,Error.prepareStackTrace=g}return(c=c?c.displayName||c.name:"")?W(c):""}function me(c){switch(c.tag){case 5:return W(c.type);case 16:return W("Lazy");case 13:return W("Suspense");case 19:return W("SuspenseList");case 0:case 2:case 15:return c=se(c.type,!1),c;case 11:return c=se(c.type.render,!1),c;case 1:return c=se(c.type,!0),c;default:return""}}function fe(c){if(c==null)return null;if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case T:return"Fragment";case A:return"Portal";case I:return"Profiler";case R:return"StrictMode";case H:return"Suspense";case Z:return"SuspenseList"}if(typeof c=="object")switch(c.$$typeof){case L:return(c.displayName||"Context")+".Consumer";case D:return(c._context.displayName||"Context")+".Provider";case z:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case te:return f=c.displayName||null,f!==null?f:fe(c.type)||"Memo";case G:f=c._payload,c=c._init;try{return fe(c(f))}catch{}}return null}function Q(c){var f=c.type;switch(c.tag){case 24:return"Cache";case 9:return(f.displayName||"Context")+".Consumer";case 10:return(f._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return c=f.render,c=c.displayName||c.name||"",f.displayName||(c!==""?"ForwardRef("+c+")":"ForwardRef");case 7:return"Fragment";case 5:return f;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(f);case 8:return f===R?"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 f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f}return null}function pe(c){switch(typeof c){case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function V(c){var f=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function J(c){var f=V(c)?"checked":"value",g=Object.getOwnPropertyDescriptor(c.constructor.prototype,f),_=""+c[f];if(!c.hasOwnProperty(f)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var E=g.get,P=g.set;return Object.defineProperty(c,f,{configurable:!0,get:function(){return E.call(this)},set:function($){_=""+$,P.call(this,$)}}),Object.defineProperty(c,f,{enumerable:g.enumerable}),{getValue:function(){return _},setValue:function($){_=""+$},stopTracking:function(){c._valueTracker=null,delete c[f]}}}}function oe(c){c._valueTracker||(c._valueTracker=J(c))}function re(c){if(!c)return!1;var f=c._valueTracker;if(!f)return!0;var g=f.getValue(),_="";return c&&(_=V(c)?c.checked?"true":"false":c.value),c=_,c!==g?(f.setValue(c),!0):!1}function Me(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}function ee(c,f){var g=f.checked;return B({},f,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:g??c._wrapperState.initialChecked})}function ce(c,f){var g=f.defaultValue==null?"":f.defaultValue,_=f.checked!=null?f.checked:f.defaultChecked;g=pe(f.value!=null?f.value:g),c._wrapperState={initialChecked:_,initialValue:g,controlled:f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null}}function je(c,f){f=f.checked,f!=null&&S(c,"checked",f,!1)}function de(c,f){je(c,f);var g=pe(f.value),_=f.type;if(g!=null)_==="number"?(g===0&&c.value===""||c.value!=g)&&(c.value=""+g):c.value!==""+g&&(c.value=""+g);else if(_==="submit"||_==="reset"){c.removeAttribute("value");return}f.hasOwnProperty("value")?ke(c,f.type,g):f.hasOwnProperty("defaultValue")&&ke(c,f.type,pe(f.defaultValue)),f.checked==null&&f.defaultChecked!=null&&(c.defaultChecked=!!f.defaultChecked)}function we(c,f,g){if(f.hasOwnProperty("value")||f.hasOwnProperty("defaultValue")){var _=f.type;if(!(_!=="submit"&&_!=="reset"||f.value!==void 0&&f.value!==null))return;f=""+c._wrapperState.initialValue,g||f===c.value||(c.value=f),c.defaultValue=f}g=c.name,g!==""&&(c.name=""),c.defaultChecked=!!c._wrapperState.initialChecked,g!==""&&(c.name=g)}function ke(c,f,g){(f!=="number"||Me(c.ownerDocument)!==c)&&(g==null?c.defaultValue=""+c._wrapperState.initialValue:c.defaultValue!==""+g&&(c.defaultValue=""+g))}var Y=Array.isArray;function ne(c,f,g,_){if(c=c.options,f){f={};for(var E=0;E<g.length;E++)f["$"+g[E]]=!0;for(g=0;g<c.length;g++)E=f.hasOwnProperty("$"+c[g].value),c[g].selected!==E&&(c[g].selected=E),E&&_&&(c[g].defaultSelected=!0)}else{for(g=""+pe(g),f=null,E=0;E<c.length;E++){if(c[E].value===g){c[E].selected=!0,_&&(c[E].defaultSelected=!0);return}f!==null||c[E].disabled||(f=c[E])}f!==null&&(f.selected=!0)}}function le(c,f){if(f.dangerouslySetInnerHTML!=null)throw Error(r(91));return B({},f,{value:void 0,defaultValue:void 0,children:""+c._wrapperState.initialValue})}function Se(c,f){var g=f.value;if(g==null){if(g=f.children,f=f.defaultValue,g!=null){if(f!=null)throw Error(r(92));if(Y(g)){if(1<g.length)throw Error(r(93));g=g[0]}f=g}f==null&&(f=""),g=f}c._wrapperState={initialValue:pe(g)}}function Ae(c,f){var g=pe(f.value),_=pe(f.defaultValue);g!=null&&(g=""+g,g!==c.value&&(c.value=g),f.defaultValue==null&&c.defaultValue!==g&&(c.defaultValue=g)),_!=null&&(c.defaultValue=""+_)}function Ce(c){var f=c.textContent;f===c._wrapperState.initialValue&&f!==""&&f!==null&&(c.value=f)}function $e(c){switch(c){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 Be(c,f){return c==null||c==="http://www.w3.org/1999/xhtml"?$e(f):c==="http://www.w3.org/2000/svg"&&f==="foreignObject"?"http://www.w3.org/1999/xhtml":c}var tt,Dt=(function(c){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(f,g,_,E){MSApp.execUnsafeLocalFunction(function(){return c(f,g,_,E)})}:c})(function(c,f){if(c.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in c)c.innerHTML=f;else{for(tt=tt||document.createElement("div"),tt.innerHTML="<svg>"+f.valueOf().toString()+"</svg>",f=tt.firstChild;c.firstChild;)c.removeChild(c.firstChild);for(;f.firstChild;)c.appendChild(f.firstChild)}});function ye(c,f){if(f){var g=c.firstChild;if(g&&g===c.lastChild&&g.nodeType===3){g.nodeValue=f;return}}c.textContent=f}var mt={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},qt=["Webkit","ms","Moz","O"];Object.keys(mt).forEach(function(c){qt.forEach(function(f){f=f+c.charAt(0).toUpperCase()+c.substring(1),mt[f]=mt[c]})});function cr(c,f,g){return f==null||typeof f=="boolean"||f===""?"":g||typeof f!="number"||f===0||mt.hasOwnProperty(c)&&mt[c]?(""+f).trim():f+"px"}function Je(c,f){c=c.style;for(var g in f)if(f.hasOwnProperty(g)){var _=g.indexOf("--")===0,E=cr(g,f[g],_);g==="float"&&(g="cssFloat"),_?c.setProperty(g,E):c[g]=E}}var Rt=B({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 bt(c,f){if(f){if(Rt[c]&&(f.children!=null||f.dangerouslySetInnerHTML!=null))throw Error(r(137,c));if(f.dangerouslySetInnerHTML!=null){if(f.children!=null)throw Error(r(60));if(typeof f.dangerouslySetInnerHTML!="object"||!("__html"in f.dangerouslySetInnerHTML))throw Error(r(61))}if(f.style!=null&&typeof f.style!="object")throw Error(r(62))}}function it(c,f){if(c.indexOf("-")===-1)return typeof f.is=="string";switch(c){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 wt=null;function Ds(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var Kl=null,Si=null,us=null;function Ea(c){if(c=Md(c)){if(typeof Kl!="function")throw Error(r(280));var f=c.stateNode;f&&(f=Mm(f),Kl(c.stateNode,c.type,f))}}function um(c){Si?us?us.push(c):us=[c]:Si=c}function ut(){if(Si){var c=Si,f=us;if(us=Si=null,Ea(c),f)for(c=0;c<f.length;c++)Ea(f[c])}}function It(c,f){return c(f)}function Wt(){}var cn=!1;function xn(c,f,g){if(cn)return c(f,g);cn=!0;try{return It(c,f,g)}finally{cn=!1,(Si!==null||us!==null)&&(Wt(),ut())}}function yn(c,f){var g=c.stateNode;if(g===null)return null;var _=Mm(g);if(_===null)return null;g=_[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(_=!_.disabled)||(c=c.type,_=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!_;break e;default:c=!1}if(c)return null;if(g&&typeof g!="function")throw Error(r(231,f,typeof g));return g}var Aa=!1;if(l)try{var zr={};Object.defineProperty(zr,"passive",{get:function(){Aa=!0}}),window.addEventListener("test",zr,zr),window.removeEventListener("test",zr,zr)}catch{Aa=!1}function ds(c,f,g,_,E,P,$,X,ae){var ge=Array.prototype.slice.call(arguments,3);try{f.apply(g,ge)}catch(Pe){this.onError(Pe)}}var md=!1,dm=null,fm=!1,yx=null,BW={onError:function(c){md=!0,dm=c}};function VW(c,f,g,_,E,P,$,X,ae){md=!1,dm=null,ds.apply(BW,arguments)}function zW(c,f,g,_,E,P,$,X,ae){if(VW.apply(this,arguments),md){if(md){var ge=dm;md=!1,dm=null}else throw Error(r(198));fm||(fm=!0,yx=ge)}}function Do(c){var f=c,g=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,(f.flags&4098)!==0&&(g=f.return),c=f.return;while(c)}return f.tag===3?g:null}function QE(c){if(c.tag===13){var f=c.memoizedState;if(f===null&&(c=c.alternate,c!==null&&(f=c.memoizedState)),f!==null)return f.dehydrated}return null}function JE(c){if(Do(c)!==c)throw Error(r(188))}function UW(c){var f=c.alternate;if(!f){if(f=Do(c),f===null)throw Error(r(188));return f!==c?null:c}for(var g=c,_=f;;){var E=g.return;if(E===null)break;var P=E.alternate;if(P===null){if(_=E.return,_!==null){g=_;continue}break}if(E.child===P.child){for(P=E.child;P;){if(P===g)return JE(E),c;if(P===_)return JE(E),f;P=P.sibling}throw Error(r(188))}if(g.return!==_.return)g=E,_=P;else{for(var $=!1,X=E.child;X;){if(X===g){$=!0,g=E,_=P;break}if(X===_){$=!0,_=E,g=P;break}X=X.sibling}if(!$){for(X=P.child;X;){if(X===g){$=!0,g=P,_=E;break}if(X===_){$=!0,_=P,g=E;break}X=X.sibling}if(!$)throw Error(r(189))}}if(g.alternate!==_)throw Error(r(190))}if(g.tag!==3)throw Error(r(188));return g.stateNode.current===g?c:f}function eA(c){return c=UW(c),c!==null?tA(c):null}function tA(c){if(c.tag===5||c.tag===6)return c;for(c=c.child;c!==null;){var f=tA(c);if(f!==null)return f;c=c.sibling}return null}var rA=e.unstable_scheduleCallback,nA=e.unstable_cancelCallback,qW=e.unstable_shouldYield,WW=e.unstable_requestPaint,mr=e.unstable_now,HW=e.unstable_getCurrentPriorityLevel,bx=e.unstable_ImmediatePriority,aA=e.unstable_UserBlockingPriority,hm=e.unstable_NormalPriority,GW=e.unstable_LowPriority,sA=e.unstable_IdlePriority,mm=null,fs=null;function KW(c){if(fs&&typeof fs.onCommitFiberRoot=="function")try{fs.onCommitFiberRoot(mm,c,void 0,(c.current.flags&128)===128)}catch{}}var Pa=Math.clz32?Math.clz32:ZW,YW=Math.log,XW=Math.LN2;function ZW(c){return c>>>=0,c===0?32:31-(YW(c)/XW|0)|0}var pm=64,gm=4194304;function pd(c){switch(c&-c){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 c&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return c&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return c}}function vm(c,f){var g=c.pendingLanes;if(g===0)return 0;var _=0,E=c.suspendedLanes,P=c.pingedLanes,$=g&268435455;if($!==0){var X=$&~E;X!==0?_=pd(X):(P&=$,P!==0&&(_=pd(P)))}else $=g&~E,$!==0?_=pd($):P!==0&&(_=pd(P));if(_===0)return 0;if(f!==0&&f!==_&&(f&E)===0&&(E=_&-_,P=f&-f,E>=P||E===16&&(P&4194240)!==0))return f;if((_&4)!==0&&(_|=g&16),f=c.entangledLanes,f!==0)for(c=c.entanglements,f&=_;0<f;)g=31-Pa(f),E=1<<g,_|=c[g],f&=~E;return _}function QW(c,f){switch(c){case 1:case 2:case 4:return f+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 f+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 JW(c,f){for(var g=c.suspendedLanes,_=c.pingedLanes,E=c.expirationTimes,P=c.pendingLanes;0<P;){var $=31-Pa(P),X=1<<$,ae=E[$];ae===-1?((X&g)===0||(X&_)!==0)&&(E[$]=QW(X,f)):ae<=f&&(c.expiredLanes|=X),P&=~X}}function wx(c){return c=c.pendingLanes&-1073741825,c!==0?c:c&1073741824?1073741824:0}function iA(){var c=pm;return pm<<=1,(pm&4194240)===0&&(pm=64),c}function _x(c){for(var f=[],g=0;31>g;g++)f.push(c);return f}function gd(c,f,g){c.pendingLanes|=f,f!==536870912&&(c.suspendedLanes=0,c.pingedLanes=0),c=c.eventTimes,f=31-Pa(f),c[f]=g}function eH(c,f){var g=c.pendingLanes&~f;c.pendingLanes=f,c.suspendedLanes=0,c.pingedLanes=0,c.expiredLanes&=f,c.mutableReadLanes&=f,c.entangledLanes&=f,f=c.entanglements;var _=c.eventTimes;for(c=c.expirationTimes;0<g;){var E=31-Pa(g),P=1<<E;f[E]=0,_[E]=-1,c[E]=-1,g&=~P}}function jx(c,f){var g=c.entangledLanes|=f;for(c=c.entanglements;g;){var _=31-Pa(g),E=1<<_;E&f|c[_]&f&&(c[_]|=f),g&=~E}}var Bt=0;function oA(c){return c&=-c,1<c?4<c?(c&268435455)!==0?16:536870912:4:1}var lA,Nx,cA,uA,dA,Sx=!1,xm=[],Ci=null,ki=null,Ei=null,vd=new Map,xd=new Map,Ai=[],tH="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 fA(c,f){switch(c){case"focusin":case"focusout":Ci=null;break;case"dragenter":case"dragleave":ki=null;break;case"mouseover":case"mouseout":Ei=null;break;case"pointerover":case"pointerout":vd.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":xd.delete(f.pointerId)}}function yd(c,f,g,_,E,P){return c===null||c.nativeEvent!==P?(c={blockedOn:f,domEventName:g,eventSystemFlags:_,nativeEvent:P,targetContainers:[E]},f!==null&&(f=Md(f),f!==null&&Nx(f)),c):(c.eventSystemFlags|=_,f=c.targetContainers,E!==null&&f.indexOf(E)===-1&&f.push(E),c)}function rH(c,f,g,_,E){switch(f){case"focusin":return Ci=yd(Ci,c,f,g,_,E),!0;case"dragenter":return ki=yd(ki,c,f,g,_,E),!0;case"mouseover":return Ei=yd(Ei,c,f,g,_,E),!0;case"pointerover":var P=E.pointerId;return vd.set(P,yd(vd.get(P)||null,c,f,g,_,E)),!0;case"gotpointercapture":return P=E.pointerId,xd.set(P,yd(xd.get(P)||null,c,f,g,_,E)),!0}return!1}function hA(c){var f=$o(c.target);if(f!==null){var g=Do(f);if(g!==null){if(f=g.tag,f===13){if(f=QE(g),f!==null){c.blockedOn=f,dA(c.priority,function(){cA(g)});return}}else if(f===3&&g.stateNode.current.memoizedState.isDehydrated){c.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}c.blockedOn=null}function ym(c){if(c.blockedOn!==null)return!1;for(var f=c.targetContainers;0<f.length;){var g=kx(c.domEventName,c.eventSystemFlags,f[0],c.nativeEvent);if(g===null){g=c.nativeEvent;var _=new g.constructor(g.type,g);wt=_,g.target.dispatchEvent(_),wt=null}else return f=Md(g),f!==null&&Nx(f),c.blockedOn=g,!1;f.shift()}return!0}function mA(c,f,g){ym(c)&&g.delete(f)}function nH(){Sx=!1,Ci!==null&&ym(Ci)&&(Ci=null),ki!==null&&ym(ki)&&(ki=null),Ei!==null&&ym(Ei)&&(Ei=null),vd.forEach(mA),xd.forEach(mA)}function bd(c,f){c.blockedOn===f&&(c.blockedOn=null,Sx||(Sx=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,nH)))}function wd(c){function f(E){return bd(E,c)}if(0<xm.length){bd(xm[0],c);for(var g=1;g<xm.length;g++){var _=xm[g];_.blockedOn===c&&(_.blockedOn=null)}}for(Ci!==null&&bd(Ci,c),ki!==null&&bd(ki,c),Ei!==null&&bd(Ei,c),vd.forEach(f),xd.forEach(f),g=0;g<Ai.length;g++)_=Ai[g],_.blockedOn===c&&(_.blockedOn=null);for(;0<Ai.length&&(g=Ai[0],g.blockedOn===null);)hA(g),g.blockedOn===null&&Ai.shift()}var Yl=k.ReactCurrentBatchConfig,bm=!0;function aH(c,f,g,_){var E=Bt,P=Yl.transition;Yl.transition=null;try{Bt=1,Cx(c,f,g,_)}finally{Bt=E,Yl.transition=P}}function sH(c,f,g,_){var E=Bt,P=Yl.transition;Yl.transition=null;try{Bt=4,Cx(c,f,g,_)}finally{Bt=E,Yl.transition=P}}function Cx(c,f,g,_){if(bm){var E=kx(c,f,g,_);if(E===null)qx(c,f,_,wm,g),fA(c,_);else if(rH(E,c,f,g,_))_.stopPropagation();else if(fA(c,_),f&4&&-1<tH.indexOf(c)){for(;E!==null;){var P=Md(E);if(P!==null&&lA(P),P=kx(c,f,g,_),P===null&&qx(c,f,_,wm,g),P===E)break;E=P}E!==null&&_.stopPropagation()}else qx(c,f,_,null,g)}}var wm=null;function kx(c,f,g,_){if(wm=null,c=Ds(_),c=$o(c),c!==null)if(f=Do(c),f===null)c=null;else if(g=f.tag,g===13){if(c=QE(f),c!==null)return c;c=null}else if(g===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;c=null}else f!==c&&(c=null);return wm=c,null}function pA(c){switch(c){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(HW()){case bx:return 1;case aA:return 4;case hm:case GW:return 16;case sA:return 536870912;default:return 16}default:return 16}}var Pi=null,Ex=null,_m=null;function gA(){if(_m)return _m;var c,f=Ex,g=f.length,_,E="value"in Pi?Pi.value:Pi.textContent,P=E.length;for(c=0;c<g&&f[c]===E[c];c++);var $=g-c;for(_=1;_<=$&&f[g-_]===E[P-_];_++);return _m=E.slice(c,1<_?1-_:void 0)}function jm(c){var f=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&f===13&&(c=13)):c=f,c===10&&(c=13),32<=c||c===13?c:0}function Nm(){return!0}function vA(){return!1}function Dn(c){function f(g,_,E,P,$){this._reactName=g,this._targetInst=E,this.type=_,this.nativeEvent=P,this.target=$,this.currentTarget=null;for(var X in c)c.hasOwnProperty(X)&&(g=c[X],this[X]=g?g(P):P[X]);return this.isDefaultPrevented=(P.defaultPrevented!=null?P.defaultPrevented:P.returnValue===!1)?Nm:vA,this.isPropagationStopped=vA,this}return B(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=Nm)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=Nm)},persist:function(){},isPersistent:Nm}),f}var Xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ax=Dn(Xl),_d=B({},Xl,{view:0,detail:0}),iH=Dn(_d),Px,Tx,jd,Sm=B({},_d,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mx,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==jd&&(jd&&c.type==="mousemove"?(Px=c.screenX-jd.screenX,Tx=c.screenY-jd.screenY):Tx=Px=0,jd=c),Px)},movementY:function(c){return"movementY"in c?c.movementY:Tx}}),xA=Dn(Sm),oH=B({},Sm,{dataTransfer:0}),lH=Dn(oH),cH=B({},_d,{relatedTarget:0}),Ox=Dn(cH),uH=B({},Xl,{animationName:0,elapsedTime:0,pseudoElement:0}),dH=Dn(uH),fH=B({},Xl,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),hH=Dn(fH),mH=B({},Xl,{data:0}),yA=Dn(mH),pH={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gH={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"},vH={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xH(c){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(c):(c=vH[c])?!!f[c]:!1}function Mx(){return xH}var yH=B({},_d,{key:function(c){if(c.key){var f=pH[c.key]||c.key;if(f!=="Unidentified")return f}return c.type==="keypress"?(c=jm(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?gH[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mx,charCode:function(c){return c.type==="keypress"?jm(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?jm(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),bH=Dn(yH),wH=B({},Sm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bA=Dn(wH),_H=B({},_d,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mx}),jH=Dn(_H),NH=B({},Xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),SH=Dn(NH),CH=B({},Sm,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),kH=Dn(CH),EH=[9,13,27,32],Rx=l&&"CompositionEvent"in window,Nd=null;l&&"documentMode"in document&&(Nd=document.documentMode);var AH=l&&"TextEvent"in window&&!Nd,wA=l&&(!Rx||Nd&&8<Nd&&11>=Nd),_A=" ",jA=!1;function NA(c,f){switch(c){case"keyup":return EH.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function SA(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Zl=!1;function PH(c,f){switch(c){case"compositionend":return SA(f);case"keypress":return f.which!==32?null:(jA=!0,_A);case"textInput":return c=f.data,c===_A&&jA?null:c;default:return null}}function TH(c,f){if(Zl)return c==="compositionend"||!Rx&&NA(c,f)?(c=gA(),_m=Ex=Pi=null,Zl=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return wA&&f.locale!=="ko"?null:f.data;default:return null}}var OH={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 CA(c){var f=c&&c.nodeName&&c.nodeName.toLowerCase();return f==="input"?!!OH[c.type]:f==="textarea"}function kA(c,f,g,_){um(_),f=Pm(f,"onChange"),0<f.length&&(g=new Ax("onChange","change",null,g,_),c.push({event:g,listeners:f}))}var Sd=null,Cd=null;function MH(c){WA(c,0)}function Cm(c){var f=rc(c);if(re(f))return c}function RH(c,f){if(c==="change")return f}var EA=!1;if(l){var Ix;if(l){var Dx="oninput"in document;if(!Dx){var AA=document.createElement("div");AA.setAttribute("oninput","return;"),Dx=typeof AA.oninput=="function"}Ix=Dx}else Ix=!1;EA=Ix&&(!document.documentMode||9<document.documentMode)}function PA(){Sd&&(Sd.detachEvent("onpropertychange",TA),Cd=Sd=null)}function TA(c){if(c.propertyName==="value"&&Cm(Cd)){var f=[];kA(f,Cd,c,Ds(c)),xn(MH,f)}}function IH(c,f,g){c==="focusin"?(PA(),Sd=f,Cd=g,Sd.attachEvent("onpropertychange",TA)):c==="focusout"&&PA()}function DH(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return Cm(Cd)}function $H(c,f){if(c==="click")return Cm(f)}function LH(c,f){if(c==="input"||c==="change")return Cm(f)}function FH(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var Ta=typeof Object.is=="function"?Object.is:FH;function kd(c,f){if(Ta(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var g=Object.keys(c),_=Object.keys(f);if(g.length!==_.length)return!1;for(_=0;_<g.length;_++){var E=g[_];if(!u.call(f,E)||!Ta(c[E],f[E]))return!1}return!0}function OA(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function MA(c,f){var g=OA(c);c=0;for(var _;g;){if(g.nodeType===3){if(_=c+g.textContent.length,c<=f&&_>=f)return{node:g,offset:f-c};c=_}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=OA(g)}}function RA(c,f){return c&&f?c===f?!0:c&&c.nodeType===3?!1:f&&f.nodeType===3?RA(c,f.parentNode):"contains"in c?c.contains(f):c.compareDocumentPosition?!!(c.compareDocumentPosition(f)&16):!1:!1}function IA(){for(var c=window,f=Me();f instanceof c.HTMLIFrameElement;){try{var g=typeof f.contentWindow.location.href=="string"}catch{g=!1}if(g)c=f.contentWindow;else break;f=Me(c.document)}return f}function $x(c){var f=c&&c.nodeName&&c.nodeName.toLowerCase();return f&&(f==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||f==="textarea"||c.contentEditable==="true")}function BH(c){var f=IA(),g=c.focusedElem,_=c.selectionRange;if(f!==g&&g&&g.ownerDocument&&RA(g.ownerDocument.documentElement,g)){if(_!==null&&$x(g)){if(f=_.start,c=_.end,c===void 0&&(c=f),"selectionStart"in g)g.selectionStart=f,g.selectionEnd=Math.min(c,g.value.length);else if(c=(f=g.ownerDocument||document)&&f.defaultView||window,c.getSelection){c=c.getSelection();var E=g.textContent.length,P=Math.min(_.start,E);_=_.end===void 0?P:Math.min(_.end,E),!c.extend&&P>_&&(E=_,_=P,P=E),E=MA(g,P);var $=MA(g,_);E&&$&&(c.rangeCount!==1||c.anchorNode!==E.node||c.anchorOffset!==E.offset||c.focusNode!==$.node||c.focusOffset!==$.offset)&&(f=f.createRange(),f.setStart(E.node,E.offset),c.removeAllRanges(),P>_?(c.addRange(f),c.extend($.node,$.offset)):(f.setEnd($.node,$.offset),c.addRange(f)))}}for(f=[],c=g;c=c.parentNode;)c.nodeType===1&&f.push({element:c,left:c.scrollLeft,top:c.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<f.length;g++)c=f[g],c.element.scrollLeft=c.left,c.element.scrollTop=c.top}}var VH=l&&"documentMode"in document&&11>=document.documentMode,Ql=null,Lx=null,Ed=null,Fx=!1;function DA(c,f,g){var _=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;Fx||Ql==null||Ql!==Me(_)||(_=Ql,"selectionStart"in _&&$x(_)?_={start:_.selectionStart,end:_.selectionEnd}:(_=(_.ownerDocument&&_.ownerDocument.defaultView||window).getSelection(),_={anchorNode:_.anchorNode,anchorOffset:_.anchorOffset,focusNode:_.focusNode,focusOffset:_.focusOffset}),Ed&&kd(Ed,_)||(Ed=_,_=Pm(Lx,"onSelect"),0<_.length&&(f=new Ax("onSelect","select",null,f,g),c.push({event:f,listeners:_}),f.target=Ql)))}function km(c,f){var g={};return g[c.toLowerCase()]=f.toLowerCase(),g["Webkit"+c]="webkit"+f,g["Moz"+c]="moz"+f,g}var Jl={animationend:km("Animation","AnimationEnd"),animationiteration:km("Animation","AnimationIteration"),animationstart:km("Animation","AnimationStart"),transitionend:km("Transition","TransitionEnd")},Bx={},$A={};l&&($A=document.createElement("div").style,"AnimationEvent"in window||(delete Jl.animationend.animation,delete Jl.animationiteration.animation,delete Jl.animationstart.animation),"TransitionEvent"in window||delete Jl.transitionend.transition);function Em(c){if(Bx[c])return Bx[c];if(!Jl[c])return c;var f=Jl[c],g;for(g in f)if(f.hasOwnProperty(g)&&g in $A)return Bx[c]=f[g];return c}var LA=Em("animationend"),FA=Em("animationiteration"),BA=Em("animationstart"),VA=Em("transitionend"),zA=new Map,UA="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 Ti(c,f){zA.set(c,f),i(f,[c])}for(var Vx=0;Vx<UA.length;Vx++){var zx=UA[Vx],zH=zx.toLowerCase(),UH=zx[0].toUpperCase()+zx.slice(1);Ti(zH,"on"+UH)}Ti(LA,"onAnimationEnd"),Ti(FA,"onAnimationIteration"),Ti(BA,"onAnimationStart"),Ti("dblclick","onDoubleClick"),Ti("focusin","onFocus"),Ti("focusout","onBlur"),Ti(VA,"onTransitionEnd"),o("onMouseEnter",["mouseout","mouseover"]),o("onMouseLeave",["mouseout","mouseover"]),o("onPointerEnter",["pointerout","pointerover"]),o("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ad="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(" "),qH=new Set("cancel close invalid load scroll toggle".split(" ").concat(Ad));function qA(c,f,g){var _=c.type||"unknown-event";c.currentTarget=g,zW(_,f,void 0,c),c.currentTarget=null}function WA(c,f){f=(f&4)!==0;for(var g=0;g<c.length;g++){var _=c[g],E=_.event;_=_.listeners;e:{var P=void 0;if(f)for(var $=_.length-1;0<=$;$--){var X=_[$],ae=X.instance,ge=X.currentTarget;if(X=X.listener,ae!==P&&E.isPropagationStopped())break e;qA(E,X,ge),P=ae}else for($=0;$<_.length;$++){if(X=_[$],ae=X.instance,ge=X.currentTarget,X=X.listener,ae!==P&&E.isPropagationStopped())break e;qA(E,X,ge),P=ae}}}if(fm)throw c=yx,fm=!1,yx=null,c}function Zt(c,f){var g=f[Xx];g===void 0&&(g=f[Xx]=new Set);var _=c+"__bubble";g.has(_)||(HA(f,c,2,!1),g.add(_))}function Ux(c,f,g){var _=0;f&&(_|=4),HA(g,c,_,f)}var Am="_reactListening"+Math.random().toString(36).slice(2);function Pd(c){if(!c[Am]){c[Am]=!0,n.forEach(function(g){g!=="selectionchange"&&(qH.has(g)||Ux(g,!1,c),Ux(g,!0,c))});var f=c.nodeType===9?c:c.ownerDocument;f===null||f[Am]||(f[Am]=!0,Ux("selectionchange",!1,f))}}function HA(c,f,g,_){switch(pA(f)){case 1:var E=aH;break;case 4:E=sH;break;default:E=Cx}g=E.bind(null,f,g,c),E=void 0,!Aa||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(E=!0),_?E!==void 0?c.addEventListener(f,g,{capture:!0,passive:E}):c.addEventListener(f,g,!0):E!==void 0?c.addEventListener(f,g,{passive:E}):c.addEventListener(f,g,!1)}function qx(c,f,g,_,E){var P=_;if((f&1)===0&&(f&2)===0&&_!==null)e:for(;;){if(_===null)return;var $=_.tag;if($===3||$===4){var X=_.stateNode.containerInfo;if(X===E||X.nodeType===8&&X.parentNode===E)break;if($===4)for($=_.return;$!==null;){var ae=$.tag;if((ae===3||ae===4)&&(ae=$.stateNode.containerInfo,ae===E||ae.nodeType===8&&ae.parentNode===E))return;$=$.return}for(;X!==null;){if($=$o(X),$===null)return;if(ae=$.tag,ae===5||ae===6){_=P=$;continue e}X=X.parentNode}}_=_.return}xn(function(){var ge=P,Pe=Ds(g),Te=[];e:{var Ee=zA.get(c);if(Ee!==void 0){var Ve=Ax,qe=c;switch(c){case"keypress":if(jm(g)===0)break e;case"keydown":case"keyup":Ve=bH;break;case"focusin":qe="focus",Ve=Ox;break;case"focusout":qe="blur",Ve=Ox;break;case"beforeblur":case"afterblur":Ve=Ox;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ve=xA;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ve=lH;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ve=jH;break;case LA:case FA:case BA:Ve=dH;break;case VA:Ve=SH;break;case"scroll":Ve=iH;break;case"wheel":Ve=kH;break;case"copy":case"cut":case"paste":Ve=hH;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ve=bA}var He=(f&4)!==0,pr=!He&&c==="scroll",ue=He?Ee!==null?Ee+"Capture":null:Ee;He=[];for(var ie=ge,he;ie!==null;){he=ie;var Re=he.stateNode;if(he.tag===5&&Re!==null&&(he=Re,ue!==null&&(Re=yn(ie,ue),Re!=null&&He.push(Td(ie,Re,he)))),pr)break;ie=ie.return}0<He.length&&(Ee=new Ve(Ee,qe,null,g,Pe),Te.push({event:Ee,listeners:He}))}}if((f&7)===0){e:{if(Ee=c==="mouseover"||c==="pointerover",Ve=c==="mouseout"||c==="pointerout",Ee&&g!==wt&&(qe=g.relatedTarget||g.fromElement)&&($o(qe)||qe[$s]))break e;if((Ve||Ee)&&(Ee=Pe.window===Pe?Pe:(Ee=Pe.ownerDocument)?Ee.defaultView||Ee.parentWindow:window,Ve?(qe=g.relatedTarget||g.toElement,Ve=ge,qe=qe?$o(qe):null,qe!==null&&(pr=Do(qe),qe!==pr||qe.tag!==5&&qe.tag!==6)&&(qe=null)):(Ve=null,qe=ge),Ve!==qe)){if(He=xA,Re="onMouseLeave",ue="onMouseEnter",ie="mouse",(c==="pointerout"||c==="pointerover")&&(He=bA,Re="onPointerLeave",ue="onPointerEnter",ie="pointer"),pr=Ve==null?Ee:rc(Ve),he=qe==null?Ee:rc(qe),Ee=new He(Re,ie+"leave",Ve,g,Pe),Ee.target=pr,Ee.relatedTarget=he,Re=null,$o(Pe)===ge&&(He=new He(ue,ie+"enter",qe,g,Pe),He.target=he,He.relatedTarget=pr,Re=He),pr=Re,Ve&&qe)t:{for(He=Ve,ue=qe,ie=0,he=He;he;he=ec(he))ie++;for(he=0,Re=ue;Re;Re=ec(Re))he++;for(;0<ie-he;)He=ec(He),ie--;for(;0<he-ie;)ue=ec(ue),he--;for(;ie--;){if(He===ue||ue!==null&&He===ue.alternate)break t;He=ec(He),ue=ec(ue)}He=null}else He=null;Ve!==null&&GA(Te,Ee,Ve,He,!1),qe!==null&&pr!==null&&GA(Te,pr,qe,He,!0)}}e:{if(Ee=ge?rc(ge):window,Ve=Ee.nodeName&&Ee.nodeName.toLowerCase(),Ve==="select"||Ve==="input"&&Ee.type==="file")var Ke=RH;else if(CA(Ee))if(EA)Ke=LH;else{Ke=DH;var rt=IH}else(Ve=Ee.nodeName)&&Ve.toLowerCase()==="input"&&(Ee.type==="checkbox"||Ee.type==="radio")&&(Ke=$H);if(Ke&&(Ke=Ke(c,ge))){kA(Te,Ke,g,Pe);break e}rt&&rt(c,Ee,ge),c==="focusout"&&(rt=Ee._wrapperState)&&rt.controlled&&Ee.type==="number"&&ke(Ee,"number",Ee.value)}switch(rt=ge?rc(ge):window,c){case"focusin":(CA(rt)||rt.contentEditable==="true")&&(Ql=rt,Lx=ge,Ed=null);break;case"focusout":Ed=Lx=Ql=null;break;case"mousedown":Fx=!0;break;case"contextmenu":case"mouseup":case"dragend":Fx=!1,DA(Te,g,Pe);break;case"selectionchange":if(VH)break;case"keydown":case"keyup":DA(Te,g,Pe)}var nt;if(Rx)e:{switch(c){case"compositionstart":var ct="onCompositionStart";break e;case"compositionend":ct="onCompositionEnd";break e;case"compositionupdate":ct="onCompositionUpdate";break e}ct=void 0}else Zl?NA(c,g)&&(ct="onCompositionEnd"):c==="keydown"&&g.keyCode===229&&(ct="onCompositionStart");ct&&(wA&&g.locale!=="ko"&&(Zl||ct!=="onCompositionStart"?ct==="onCompositionEnd"&&Zl&&(nt=gA()):(Pi=Pe,Ex="value"in Pi?Pi.value:Pi.textContent,Zl=!0)),rt=Pm(ge,ct),0<rt.length&&(ct=new yA(ct,c,null,g,Pe),Te.push({event:ct,listeners:rt}),nt?ct.data=nt:(nt=SA(g),nt!==null&&(ct.data=nt)))),(nt=AH?PH(c,g):TH(c,g))&&(ge=Pm(ge,"onBeforeInput"),0<ge.length&&(Pe=new yA("onBeforeInput","beforeinput",null,g,Pe),Te.push({event:Pe,listeners:ge}),Pe.data=nt))}WA(Te,f)})}function Td(c,f,g){return{instance:c,listener:f,currentTarget:g}}function Pm(c,f){for(var g=f+"Capture",_=[];c!==null;){var E=c,P=E.stateNode;E.tag===5&&P!==null&&(E=P,P=yn(c,g),P!=null&&_.unshift(Td(c,P,E)),P=yn(c,f),P!=null&&_.push(Td(c,P,E))),c=c.return}return _}function ec(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5);return c||null}function GA(c,f,g,_,E){for(var P=f._reactName,$=[];g!==null&&g!==_;){var X=g,ae=X.alternate,ge=X.stateNode;if(ae!==null&&ae===_)break;X.tag===5&&ge!==null&&(X=ge,E?(ae=yn(g,P),ae!=null&&$.unshift(Td(g,ae,X))):E||(ae=yn(g,P),ae!=null&&$.push(Td(g,ae,X)))),g=g.return}$.length!==0&&c.push({event:f,listeners:$})}var WH=/\r\n?/g,HH=/\u0000|\uFFFD/g;function KA(c){return(typeof c=="string"?c:""+c).replace(WH,` 38`).replace(HH,"")}function Tm(c,f,g){if(f=KA(f),KA(c)!==f&&g)throw Error(r(425))}function Om(){}var Wx=null,Hx=null;function Gx(c,f){return c==="textarea"||c==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var Kx=typeof setTimeout=="function"?setTimeout:void 0,GH=typeof clearTimeout=="function"?clearTimeout:void 0,YA=typeof Promise=="function"?Promise:void 0,KH=typeof queueMicrotask=="function"?queueMicrotask:typeof YA<"u"?function(c){return YA.resolve(null).then(c).catch(YH)}:Kx;function YH(c){setTimeout(function(){throw c})}function Yx(c,f){var g=f,_=0;do{var E=g.nextSibling;if(c.removeChild(g),E&&E.nodeType===8)if(g=E.data,g==="/$"){if(_===0){c.removeChild(E),wd(f);return}_--}else g!=="$"&&g!=="$?"&&g!=="$!"||_++;g=E}while(g);wd(f)}function Oi(c){for(;c!=null;c=c.nextSibling){var f=c.nodeType;if(f===1||f===3)break;if(f===8){if(f=c.data,f==="$"||f==="$!"||f==="$?")break;if(f==="/$")return null}}return c}function XA(c){c=c.previousSibling;for(var f=0;c;){if(c.nodeType===8){var g=c.data;if(g==="$"||g==="$!"||g==="$?"){if(f===0)return c;f--}else g==="/$"&&f++}c=c.previousSibling}return null}var tc=Math.random().toString(36).slice(2),hs="__reactFiber$"+tc,Od="__reactProps$"+tc,$s="__reactContainer$"+tc,Xx="__reactEvents$"+tc,XH="__reactListeners$"+tc,ZH="__reactHandles$"+tc;function $o(c){var f=c[hs];if(f)return f;for(var g=c.parentNode;g;){if(f=g[$s]||g[hs]){if(g=f.alternate,f.child!==null||g!==null&&g.child!==null)for(c=XA(c);c!==null;){if(g=c[hs])return g;c=XA(c)}return f}c=g,g=c.parentNode}return null}function Md(c){return c=c[hs]||c[$s],!c||c.tag!==5&&c.tag!==6&&c.tag!==13&&c.tag!==3?null:c}function rc(c){if(c.tag===5||c.tag===6)return c.stateNode;throw Error(r(33))}function Mm(c){return c[Od]||null}var Zx=[],nc=-1;function Mi(c){return{current:c}}function Qt(c){0>nc||(c.current=Zx[nc],Zx[nc]=null,nc--)}
vendor: 6,916 bytes, line 38
38function Gt(c,f){nc++,Zx[nc]=c.current,c.current=f}var Ri={},Zr=Mi(Ri),bn=Mi(!1),Lo=Ri;function ac(c,f){var g=c.type.contextTypes;if(!g)return Ri;var _=c.stateNode;if(_&&_.__reactInternalMemoizedUnmaskedChildContext===f)return _.__reactInternalMemoizedMaskedChildContext;var E={},P;for(P in g)E[P]=f[P];return _&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=f,c.__reactInternalMemoizedMaskedChildContext=E),E}function wn(c){return c=c.childContextTypes,c!=null}function Rm(){Qt(bn),Qt(Zr)}function ZA(c,f,g){if(Zr.current!==Ri)throw Error(r(168));Gt(Zr,f),Gt(bn,g)}function QA(c,f,g){var _=c.stateNode;if(f=f.childContextTypes,typeof _.getChildContext!="function")return g;_=_.getChildContext();for(var E in _)if(!(E in f))throw Error(r(108,Q(c)||"Unknown",E));return B({},g,_)}function Im(c){return c=(c=c.stateNode)&&c.__reactInternalMemoizedMergedChildContext||Ri,Lo=Zr.current,Gt(Zr,c),Gt(bn,bn.current),!0}function JA(c,f,g){var _=c.stateNode;if(!_)throw Error(r(169));g?(c=QA(c,f,Lo),_.__reactInternalMemoizedMergedChildContext=c,Qt(bn),Qt(Zr),Gt(Zr,c)):Qt(bn),Gt(bn,g)}var Ls=null,Dm=!1,Qx=!1;function eP(c){Ls===null?Ls=[c]:Ls.push(c)}function QH(c){Dm=!0,eP(c)}function Ii(){if(!Qx&&Ls!==null){Qx=!0;var c=0,f=Bt;try{var g=Ls;for(Bt=1;c<g.length;c++){var _=g[c];do _=_(!0);while(_!==null)}Ls=null,Dm=!1}catch(E){throw Ls!==null&&(Ls=Ls.slice(c+1)),rA(bx,Ii),E}finally{Bt=f,Qx=!1}}return null}var sc=[],ic=0,$m=null,Lm=0,na=[],aa=0,Fo=null,Fs=1,Bs="";function Bo(c,f){sc[ic++]=Lm,sc[ic++]=$m,$m=c,Lm=f}function tP(c,f,g){na[aa++]=Fs,na[aa++]=Bs,na[aa++]=Fo,Fo=c;var _=Fs;c=Bs;var E=32-Pa(_)-1;_&=~(1<<E),g+=1;var P=32-Pa(f)+E;if(30<P){var $=E-E%5;P=(_&(1<<$)-1).toString(32),_>>=$,E-=$,Fs=1<<32-Pa(f)+E|g<<E|_,Bs=P+c}else Fs=1<<P|g<<E|_,Bs=c}function Jx(c){c.return!==null&&(Bo(c,1),tP(c,1,0))}function ey(c){for(;c===$m;)$m=sc[--ic],sc[ic]=null,Lm=sc[--ic],sc[ic]=null;for(;c===Fo;)Fo=na[--aa],na[aa]=null,Bs=na[--aa],na[aa]=null,Fs=na[--aa],na[aa]=null}var $n=null,Ln=null,tr=!1,Oa=null;function rP(c,f){var g=la(5,null,null,0);g.elementType="DELETED",g.stateNode=f,g.return=c,f=c.deletions,f===null?(c.deletions=[g],c.flags|=16):f.push(g)}function nP(c,f){switch(c.tag){case 5:var g=c.type;return f=f.nodeType!==1||g.toLowerCase()!==f.nodeName.toLowerCase()?null:f,f!==null?(c.stateNode=f,$n=c,Ln=Oi(f.firstChild),!0):!1;case 6:return f=c.pendingProps===""||f.nodeType!==3?null:f,f!==null?(c.stateNode=f,$n=c,Ln=null,!0):!1;case 13:return f=f.nodeType!==8?null:f,f!==null?(g=Fo!==null?{id:Fs,overflow:Bs}:null,c.memoizedState={dehydrated:f,treeContext:g,retryLane:1073741824},g=la(18,null,null,0),g.stateNode=f,g.return=c,c.child=g,$n=c,Ln=null,!0):!1;default:return!1}}function ty(c){return(c.mode&1)!==0&&(c.flags&128)===0}function ry(c){if(tr){var f=Ln;if(f){var g=f;if(!nP(c,f)){if(ty(c))throw Error(r(418));f=Oi(g.nextSibling);var _=$n;f&&nP(c,f)?rP(_,g):(c.flags=c.flags&-4097|2,tr=!1,$n=c)}}else{if(ty(c))throw Error(r(418));c.flags=c.flags&-4097|2,tr=!1,$n=c}}}function aP(c){for(c=c.return;c!==null&&c.tag!==5&&c.tag!==3&&c.tag!==13;)c=c.return;$n=c}function Fm(c){if(c!==$n)return!1;if(!tr)return aP(c),tr=!0,!1;var f;if((f=c.tag!==3)&&!(f=c.tag!==5)&&(f=c.type,f=f!=="head"&&f!=="body"&&!Gx(c.type,c.memoizedProps)),f&&(f=Ln)){if(ty(c))throw sP(),Error(r(418));for(;f;)rP(c,f),f=Oi(f.nextSibling)}if(aP(c),c.tag===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(r(317));e:{for(c=c.nextSibling,f=0;c;){if(c.nodeType===8){var g=c.data;if(g==="/$"){if(f===0){Ln=Oi(c.nextSibling);break e}f--}else g!=="$"&&g!=="$!"&&g!=="$?"||f++}c=c.nextSibling}Ln=null}}else Ln=$n?Oi(c.stateNode.nextSibling):null;return!0}function sP(){for(var c=Ln;c;)c=Oi(c.nextSibling)}function oc(){Ln=$n=null,tr=!1}function ny(c){Oa===null?Oa=[c]:Oa.push(c)}var JH=k.ReactCurrentBatchConfig;function Rd(c,f,g){if(c=g.ref,c!==null&&typeof c!="function"&&typeof c!="object"){if(g._owner){if(g=g._owner,g){if(g.tag!==1)throw Error(r(309));var _=g.stateNode}if(!_)throw Error(r(147,c));var E=_,P=""+c;return f!==null&&f.ref!==null&&typeof f.ref=="function"&&f.ref._stringRef===P?f.ref:(f=function($){var X=E.refs;$===null?delete X[P]:X[P]=$},f._stringRef=P,f)}if(typeof c!="string")throw Error(r(284));if(!g._owner)throw Error(r(290,c))}return c}function Bm(c,f){throw c=Object.prototype.toString.call(f),Error(r(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c))}function iP(c){var f=c._init;return f(c._payload)}function oP(c){function f(ue,ie){if(c){var he=ue.deletions;he===null?(ue.deletions=[ie],ue.flags|=16):he.push(ie)}}function g(ue,ie){if(!c)return null;for(;ie!==null;)f(ue,ie),ie=ie.sibling;return null}function _(ue,ie){for(ue=new Map;ie!==null;)ie.key!==null?ue.set(ie.key,ie):ue.set(ie.index,ie),ie=ie.sibling;return ue}function E(ue,ie){return ue=Ui(ue,ie),ue.index=0,ue.sibling=null,ue}function P(ue,ie,he){return ue.index=he,c?(he=ue.alternate,he!==null?(he=he.index,he<ie?(ue.flags|=2,ie):he):(ue.flags|=2,ie)):(ue.flags|=1048576,ie)}function $(ue){return c&&ue.alternate===null&&(ue.flags|=2),ue}function X(ue,ie,he,Re){return ie===null||ie.tag!==6?(ie=Ky(he,ue.mode,Re),ie.return=ue,ie):(ie=E(ie,he),ie.return=ue,ie)}function ae(ue,ie,he,Re){var Ke=he.type;return Ke===T?Pe(ue,ie,he.props.children,Re,he.key):ie!==null&&(ie.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===G&&iP(Ke)===ie.type)?(Re=E(ie,he.props),Re.ref=Rd(ue,ie,he),Re.return=ue,Re):(Re=up(he.type,he.key,he.props,null,ue.mode,Re),Re.ref=Rd(ue,ie,he),Re.return=ue,Re)}function ge(ue,ie,he,Re){return ie===null||ie.tag!==4||ie.stateNode.containerInfo!==he.containerInfo||ie.stateNode.implementation!==he.implementation?(ie=Yy(he,ue.mode,Re),ie.return=ue,ie):(ie=E(ie,he.children||[]),ie.return=ue,ie)}function Pe(ue,ie,he,Re,Ke){return ie===null||ie.tag!==7?(ie=Ko(he,ue.mode,Re,Ke),ie.return=ue,ie):(ie=E(ie,he),ie.return=ue,ie)}function Te(ue,ie,he){if(typeof ie=="string"&&ie!==""||typeof ie=="number")return ie=Ky(""+ie,ue.mode,he),ie.return=ue,ie;if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case C:return he=up(ie.type,ie.key,ie.props,null,ue.mode,he),he.ref=Rd(ue,null,ie),he.return=ue,he;case A:return ie=Yy(ie,ue.mode,he),ie.return=ue,ie;case G:var Re=ie._init;return Te(ue,Re(ie._payload),he)}if(Y(ie)||K(ie))return ie=Ko(ie,ue.mode,he,null),ie.return=ue,ie;Bm(ue,ie)}return null}function Ee(ue,ie,he,Re){var Ke=ie!==null?ie.key:null;if(typeof he=="string"&&he!==""||typeof he=="number")return Ke!==null?null:X(ue,ie,""+he,Re);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case C:return he.key===Ke?ae(ue,ie,he,Re):null;case A:return he.key===Ke?ge(ue,ie,he,Re):null;case G:return Ke=he._init,Ee(ue,ie,Ke(he._payload),Re)}if(Y(he)||K(he))return Ke!==null?null:Pe(ue,ie,he,Re,null);Bm(ue,he)}return null}function Ve(ue,ie,he,Re,Ke){if(typeof Re=="string"&&Re!==""||typeof Re=="number")return ue=ue.get(he)||null,X(ie,ue,""+Re,Ke);
vendor: 8,520 bytes, line 38
38if(typeof Re=="object"&&Re!==null){switch(Re.$$typeof){case C:return ue=ue.get(Re.key===null?he:Re.key)||null,ae(ie,ue,Re,Ke);case A:return ue=ue.get(Re.key===null?he:Re.key)||null,ge(ie,ue,Re,Ke);case G:var rt=Re._init;return Ve(ue,ie,he,rt(Re._payload),Ke)}if(Y(Re)||K(Re))return ue=ue.get(he)||null,Pe(ie,ue,Re,Ke,null);Bm(ie,Re)}return null}function qe(ue,ie,he,Re){for(var Ke=null,rt=null,nt=ie,ct=ie=0,$r=null;nt!==null&&ct<he.length;ct++){nt.index>ct?($r=nt,nt=null):$r=nt.sibling;var Ot=Ee(ue,nt,he[ct],Re);if(Ot===null){nt===null&&(nt=$r);break}c&&nt&&Ot.alternate===null&&f(ue,nt),ie=P(Ot,ie,ct),rt===null?Ke=Ot:rt.sibling=Ot,rt=Ot,nt=$r}if(ct===he.length)return g(ue,nt),tr&&Bo(ue,ct),Ke;if(nt===null){for(;ct<he.length;ct++)nt=Te(ue,he[ct],Re),nt!==null&&(ie=P(nt,ie,ct),rt===null?Ke=nt:rt.sibling=nt,rt=nt);return tr&&Bo(ue,ct),Ke}for(nt=_(ue,nt);ct<he.length;ct++)$r=Ve(nt,ue,ct,he[ct],Re),$r!==null&&(c&&$r.alternate!==null&&nt.delete($r.key===null?ct:$r.key),ie=P($r,ie,ct),rt===null?Ke=$r:rt.sibling=$r,rt=$r);return c&&nt.forEach(function(qi){return f(ue,qi)}),tr&&Bo(ue,ct),Ke}function He(ue,ie,he,Re){var Ke=K(he);if(typeof Ke!="function")throw Error(r(150));if(he=Ke.call(he),he==null)throw Error(r(151));for(var rt=Ke=null,nt=ie,ct=ie=0,$r=null,Ot=he.next();nt!==null&&!Ot.done;ct++,Ot=he.next()){nt.index>ct?($r=nt,nt=null):$r=nt.sibling;var qi=Ee(ue,nt,Ot.value,Re);if(qi===null){nt===null&&(nt=$r);break}c&&nt&&qi.alternate===null&&f(ue,nt),ie=P(qi,ie,ct),rt===null?Ke=qi:rt.sibling=qi,rt=qi,nt=$r}if(Ot.done)return g(ue,nt),tr&&Bo(ue,ct),Ke;if(nt===null){for(;!Ot.done;ct++,Ot=he.next())Ot=Te(ue,Ot.value,Re),Ot!==null&&(ie=P(Ot,ie,ct),rt===null?Ke=Ot:rt.sibling=Ot,rt=Ot);return tr&&Bo(ue,ct),Ke}for(nt=_(ue,nt);!Ot.done;ct++,Ot=he.next())Ot=Ve(nt,ue,ct,Ot.value,Re),Ot!==null&&(c&&Ot.alternate!==null&&nt.delete(Ot.key===null?ct:Ot.key),ie=P(Ot,ie,ct),rt===null?Ke=Ot:rt.sibling=Ot,rt=Ot);return c&&nt.forEach(function(OG){return f(ue,OG)}),tr&&Bo(ue,ct),Ke}function pr(ue,ie,he,Re){if(typeof he=="object"&&he!==null&&he.type===T&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case C:e:{for(var Ke=he.key,rt=ie;rt!==null;){if(rt.key===Ke){if(Ke=he.type,Ke===T){if(rt.tag===7){g(ue,rt.sibling),ie=E(rt,he.props.children),ie.return=ue,ue=ie;break e}}else if(rt.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===G&&iP(Ke)===rt.type){g(ue,rt.sibling),ie=E(rt,he.props),ie.ref=Rd(ue,rt,he),ie.return=ue,ue=ie;break e}g(ue,rt);break}else f(ue,rt);rt=rt.sibling}he.type===T?(ie=Ko(he.props.children,ue.mode,Re,he.key),ie.return=ue,ue=ie):(Re=up(he.type,he.key,he.props,null,ue.mode,Re),Re.ref=Rd(ue,ie,he),Re.return=ue,ue=Re)}return $(ue);case A:e:{for(rt=he.key;ie!==null;){if(ie.key===rt)if(ie.tag===4&&ie.stateNode.containerInfo===he.containerInfo&&ie.stateNode.implementation===he.implementation){g(ue,ie.sibling),ie=E(ie,he.children||[]),ie.return=ue,ue=ie;break e}else{g(ue,ie);break}else f(ue,ie);ie=ie.sibling}ie=Yy(he,ue.mode,Re),ie.return=ue,ue=ie}return $(ue);case G:return rt=he._init,pr(ue,ie,rt(he._payload),Re)}if(Y(he))return qe(ue,ie,he,Re);if(K(he))return He(ue,ie,he,Re);Bm(ue,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,ie!==null&&ie.tag===6?(g(ue,ie.sibling),ie=E(ie,he),ie.return=ue,ue=ie):(g(ue,ie),ie=Ky(he,ue.mode,Re),ie.return=ue,ue=ie),$(ue)):g(ue,ie)}return pr}var lc=oP(!0),lP=oP(!1),Vm=Mi(null),zm=null,cc=null,ay=null;function sy(){ay=cc=zm=null}function iy(c){var f=Vm.current;Qt(Vm),c._currentValue=f}function oy(c,f,g){for(;c!==null;){var _=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,_!==null&&(_.childLanes|=f)):_!==null&&(_.childLanes&f)!==f&&(_.childLanes|=f),c===g)break;c=c.return}}function uc(c,f){zm=c,ay=cc=null,c=c.dependencies,c!==null&&c.firstContext!==null&&((c.lanes&f)!==0&&(_n=!0),c.firstContext=null)}function sa(c){var f=c._currentValue;if(ay!==c)if(c={context:c,memoizedValue:f,next:null},cc===null){if(zm===null)throw Error(r(308));cc=c,zm.dependencies={lanes:0,firstContext:c}}else cc=cc.next=c;return f}var Vo=null;function ly(c){Vo===null?Vo=[c]:Vo.push(c)}function cP(c,f,g,_){var E=f.interleaved;return E===null?(g.next=g,ly(f)):(g.next=E.next,E.next=g),f.interleaved=g,Vs(c,_)}function Vs(c,f){c.lanes|=f;var g=c.alternate;for(g!==null&&(g.lanes|=f),g=c,c=c.return;c!==null;)c.childLanes|=f,g=c.alternate,g!==null&&(g.childLanes|=f),g=c,c=c.return;return g.tag===3?g.stateNode:null}var Di=!1;function cy(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function uP(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,effects:c.effects})}function zs(c,f){return{eventTime:c,lane:f,tag:0,payload:null,callback:null,next:null}}function $i(c,f,g){var _=c.updateQueue;if(_===null)return null;if(_=_.shared,(At&2)!==0){var E=_.pending;return E===null?f.next=f:(f.next=E.next,E.next=f),_.pending=f,Vs(c,g)}return E=_.interleaved,E===null?(f.next=f,ly(_)):(f.next=E.next,E.next=f),_.interleaved=f,Vs(c,g)}function Um(c,f,g){if(f=f.updateQueue,f!==null&&(f=f.shared,(g&4194240)!==0)){var _=f.lanes;_&=c.pendingLanes,g|=_,f.lanes=g,jx(c,g)}}function dP(c,f){var g=c.updateQueue,_=c.alternate;if(_!==null&&(_=_.updateQueue,g===_)){var E=null,P=null;if(g=g.firstBaseUpdate,g!==null){do{var $={eventTime:g.eventTime,lane:g.lane,tag:g.tag,payload:g.payload,callback:g.callback,next:null};P===null?E=P=$:P=P.next=$,g=g.next}while(g!==null);P===null?E=P=f:P=P.next=f}else E=P=f;g={baseState:_.baseState,firstBaseUpdate:E,lastBaseUpdate:P,shared:_.shared,effects:_.effects},c.updateQueue=g;return}c=g.lastBaseUpdate,c===null?g.firstBaseUpdate=f:c.next=f,g.lastBaseUpdate=f}function qm(c,f,g,_){var E=c.updateQueue;Di=!1;var P=E.firstBaseUpdate,$=E.lastBaseUpdate,X=E.shared.pending;if(X!==null){E.shared.pending=null;var ae=X,ge=ae.next;ae.next=null,$===null?P=ge:$.next=ge,$=ae;var Pe=c.alternate;Pe!==null&&(Pe=Pe.updateQueue,X=Pe.lastBaseUpdate,X!==$&&(X===null?Pe.firstBaseUpdate=ge:X.next=ge,Pe.lastBaseUpdate=ae))}if(P!==null){var Te=E.baseState;$=0,Pe=ge=ae=null,X=P;do{var Ee=X.lane,Ve=X.eventTime;if((_&Ee)===Ee){Pe!==null&&(Pe=Pe.next={eventTime:Ve,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var qe=c,He=X;switch(Ee=f,Ve=g,He.tag){case 1:if(qe=He.payload,typeof qe=="function"){Te=qe.call(Ve,Te,Ee);break e}Te=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=He.payload,Ee=typeof qe=="function"?qe.call(Ve,Te,Ee):qe,Ee==null)break e;Te=B({},Te,Ee);break e;case 2:Di=!0}}X.callback!==null&&X.lane!==0&&(c.flags|=64,Ee=E.effects,Ee===null?E.effects=[X]:Ee.push(X))}else Ve={eventTime:Ve,lane:Ee,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Pe===null?(ge=Pe=Ve,ae=Te):Pe=Pe.next=Ve,$|=Ee;if(X=X.next,X===null){if(X=E.shared.pending,X===null)break;Ee=X,X=Ee.next,Ee.next=null,E.lastBaseUpdate=Ee,E.shared.pending=null}}while(!0);if(Pe===null&&(ae=Te),E.baseState=ae,E.firstBaseUpdate=ge,E.lastBaseUpdate=Pe,f=E.shared.interleaved,f!==null){E=f;do $|=E.lane,E=E.next;while(E!==f)}else P===null&&(E.shared.lanes=0);qo|=$,c.lanes=$,c.memoizedState=Te}}function fP(c,f,g){if(c=f.effects,f.effects=null,c!==null)for(f=0;f<c.length;f++){var _=c[f],E=_.callback;if(E!==null){if(_.callback=null,_=g,typeof E!="function")throw Error(r(191,E));E.call(_)}}}var Id={},ms=Mi(Id),Dd=Mi(Id),$d=Mi(Id);function zo(c){if(c===Id)throw Error(r(174));return c}function uy(c,f){switch(Gt($d,f),Gt(Dd,c),Gt(ms,Id),c=f.nodeType,c){case 9:case 11:f=(f=f.documentElement)?f.namespaceURI:Be(null,"");break;default:c=c===8?f.parentNode:f,f=c.namespaceURI||null,c=c.tagName,f=Be(f,c)}Qt(ms),Gt(ms,f)}function dc(){Qt(ms),Qt(Dd),Qt($d)}function hP(c){zo($d.current);var f=zo(ms.current),g=Be(f,c.type);f!==g&&(Gt(Dd,c),Gt(ms,g))}function dy(c){Dd.current===c&&(Qt(ms),Qt(Dd))}var ar=Mi(0);function Wm(c){for(var f=c;f!==null;){if(f.tag===13){var g=f.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||g.data==="$?"||g.data==="$!"))return f}else if(f.tag===19&&f.memoizedProps.revealOrder!==void 0){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var fy=[];function hy(){for(var c=0;c<fy.length;c++)fy[c]._workInProgressVersionPrimary=null;
vendor: 7,074 bytes, line 38
38fy.length=0}var Hm=k.ReactCurrentDispatcher,my=k.ReactCurrentBatchConfig,Uo=0,sr=null,Sr=null,Ir=null,Gm=!1,Ld=!1,Fd=0,eG=0;function Qr(){throw Error(r(321))}function py(c,f){if(f===null)return!1;for(var g=0;g<f.length&&g<c.length;g++)if(!Ta(c[g],f[g]))return!1;return!0}function gy(c,f,g,_,E,P){if(Uo=P,sr=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,Hm.current=c===null||c.memoizedState===null?aG:sG,c=g(_,E),Ld){P=0;do{if(Ld=!1,Fd=0,25<=P)throw Error(r(301));P+=1,Ir=Sr=null,f.updateQueue=null,Hm.current=iG,c=g(_,E)}while(Ld)}if(Hm.current=Xm,f=Sr!==null&&Sr.next!==null,Uo=0,Ir=Sr=sr=null,Gm=!1,f)throw Error(r(300));return c}function vy(){var c=Fd!==0;return Fd=0,c}function ps(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ir===null?sr.memoizedState=Ir=c:Ir=Ir.next=c,Ir}function ia(){if(Sr===null){var c=sr.alternate;c=c!==null?c.memoizedState:null}else c=Sr.next;var f=Ir===null?sr.memoizedState:Ir.next;if(f!==null)Ir=f,Sr=c;else{if(c===null)throw Error(r(310));Sr=c,c={memoizedState:Sr.memoizedState,baseState:Sr.baseState,baseQueue:Sr.baseQueue,queue:Sr.queue,next:null},Ir===null?sr.memoizedState=Ir=c:Ir=Ir.next=c}return Ir}function Bd(c,f){return typeof f=="function"?f(c):f}function xy(c){var f=ia(),g=f.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=c;var _=Sr,E=_.baseQueue,P=g.pending;if(P!==null){if(E!==null){var $=E.next;E.next=P.next,P.next=$}_.baseQueue=E=P,g.pending=null}if(E!==null){P=E.next,_=_.baseState;var X=$=null,ae=null,ge=P;do{var Pe=ge.lane;if((Uo&Pe)===Pe)ae!==null&&(ae=ae.next={lane:0,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),_=ge.hasEagerState?ge.eagerState:c(_,ge.action);else{var Te={lane:Pe,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null};ae===null?(X=ae=Te,$=_):ae=ae.next=Te,sr.lanes|=Pe,qo|=Pe}ge=ge.next}while(ge!==null&&ge!==P);ae===null?$=_:ae.next=X,Ta(_,f.memoizedState)||(_n=!0),f.memoizedState=_,f.baseState=$,f.baseQueue=ae,g.lastRenderedState=_}if(c=g.interleaved,c!==null){E=c;do P=E.lane,sr.lanes|=P,qo|=P,E=E.next;while(E!==c)}else E===null&&(g.lanes=0);return[f.memoizedState,g.dispatch]}function yy(c){var f=ia(),g=f.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=c;var _=g.dispatch,E=g.pending,P=f.memoizedState;if(E!==null){g.pending=null;var $=E=E.next;do P=c(P,$.action),$=$.next;while($!==E);Ta(P,f.memoizedState)||(_n=!0),f.memoizedState=P,f.baseQueue===null&&(f.baseState=P),g.lastRenderedState=P}return[P,_]}function mP(){}function pP(c,f){var g=sr,_=ia(),E=f(),P=!Ta(_.memoizedState,E);if(P&&(_.memoizedState=E,_n=!0),_=_.queue,by(xP.bind(null,g,_,c),[c]),_.getSnapshot!==f||P||Ir!==null&&Ir.memoizedState.tag&1){if(g.flags|=2048,Vd(9,vP.bind(null,g,_,E,f),void 0,null),Dr===null)throw Error(r(349));(Uo&30)!==0||gP(g,f,E)}return E}function gP(c,f,g){c.flags|=16384,c={getSnapshot:f,value:g},f=sr.updateQueue,f===null?(f={lastEffect:null,stores:null},sr.updateQueue=f,f.stores=[c]):(g=f.stores,g===null?f.stores=[c]:g.push(c))}function vP(c,f,g,_){f.value=g,f.getSnapshot=_,yP(f)&&bP(c)}function xP(c,f,g){return g(function(){yP(f)&&bP(c)})}function yP(c){var f=c.getSnapshot;c=c.value;try{var g=f();return!Ta(c,g)}catch{return!0}}function bP(c){var f=Vs(c,1);f!==null&&Da(f,c,1,-1)}function wP(c){var f=ps();return typeof c=="function"&&(c=c()),f.memoizedState=f.baseState=c,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Bd,lastRenderedState:c},f.queue=c,c=c.dispatch=nG.bind(null,sr,c),[f.memoizedState,c]}function Vd(c,f,g,_){return c={tag:c,create:f,destroy:g,deps:_,next:null},f=sr.updateQueue,f===null?(f={lastEffect:null,stores:null},sr.updateQueue=f,f.lastEffect=c.next=c):(g=f.lastEffect,g===null?f.lastEffect=c.next=c:(_=g.next,g.next=c,c.next=_,f.lastEffect=c)),c}function _P(){return ia().memoizedState}function Km(c,f,g,_){var E=ps();sr.flags|=c,E.memoizedState=Vd(1|f,g,void 0,_===void 0?null:_)}function Ym(c,f,g,_){var E=ia();_=_===void 0?null:_;var P=void 0;if(Sr!==null){var $=Sr.memoizedState;if(P=$.destroy,_!==null&&py(_,$.deps)){E.memoizedState=Vd(f,g,P,_);return}}sr.flags|=c,E.memoizedState=Vd(1|f,g,P,_)}function jP(c,f){return Km(8390656,8,c,f)}function by(c,f){return Ym(2048,8,c,f)}function NP(c,f){return Ym(4,2,c,f)}function SP(c,f){return Ym(4,4,c,f)}function CP(c,f){if(typeof f=="function")return c=c(),f(c),function(){f(null)};if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function kP(c,f,g){return g=g!=null?g.concat([c]):null,Ym(4,4,CP.bind(null,f,c),g)}function wy(){}function EP(c,f){var g=ia();f=f===void 0?null:f;var _=g.memoizedState;return _!==null&&f!==null&&py(f,_[1])?_[0]:(g.memoizedState=[c,f],c)}function AP(c,f){var g=ia();f=f===void 0?null:f;var _=g.memoizedState;return _!==null&&f!==null&&py(f,_[1])?_[0]:(c=c(),g.memoizedState=[c,f],c)}function PP(c,f,g){return(Uo&21)===0?(c.baseState&&(c.baseState=!1,_n=!0),c.memoizedState=g):(Ta(g,f)||(g=iA(),sr.lanes|=g,qo|=g,c.baseState=!0),f)}function tG(c,f){var g=Bt;Bt=g!==0&&4>g?g:4,c(!0);var _=my.transition;my.transition={};try{c(!1),f()}finally{Bt=g,my.transition=_}}function TP(){return ia().memoizedState}function rG(c,f,g){var _=Vi(c);if(g={lane:_,action:g,hasEagerState:!1,eagerState:null,next:null},OP(c))MP(f,g);else if(g=cP(c,f,g,_),g!==null){var E=dn();Da(g,c,_,E),RP(g,f,_)}}function nG(c,f,g){var _=Vi(c),E={lane:_,action:g,hasEagerState:!1,eagerState:null,next:null};if(OP(c))MP(f,E);else{var P=c.alternate;if(c.lanes===0&&(P===null||P.lanes===0)&&(P=f.lastRenderedReducer,P!==null))try{var $=f.lastRenderedState,X=P($,g);if(E.hasEagerState=!0,E.eagerState=X,Ta(X,$)){var ae=f.interleaved;ae===null?(E.next=E,ly(f)):(E.next=ae.next,ae.next=E),f.interleaved=E;return}}catch{}finally{}g=cP(c,f,E,_),g!==null&&(E=dn(),Da(g,c,_,E),RP(g,f,_))}}function OP(c){var f=c.alternate;return c===sr||f!==null&&f===sr}function MP(c,f){Ld=Gm=!0;var g=c.pending;g===null?f.next=f:(f.next=g.next,g.next=f),c.pending=f}function RP(c,f,g){if((g&4194240)!==0){var _=f.lanes;_&=c.pendingLanes,g|=_,f.lanes=g,jx(c,g)}}var Xm={readContext:sa,useCallback:Qr,useContext:Qr,useEffect:Qr,useImperativeHandle:Qr,useInsertionEffect:Qr,useLayoutEffect:Qr,useMemo:Qr,useReducer:Qr,useRef:Qr,useState:Qr,useDebugValue:Qr,useDeferredValue:Qr,useTransition:Qr,useMutableSource:Qr,useSyncExternalStore:Qr,useId:Qr,unstable_isNewReconciler:!1},aG={readContext:sa,useCallback:function(c,f){return ps().memoizedState=[c,f===void 0?null:f],c},useContext:sa,useEffect:jP,useImperativeHandle:function(c,f,g){return g=g!=null?g.concat([c]):null,Km(4194308,4,CP.bind(null,f,c),g)},useLayoutEffect:function(c,f){return Km(4194308,4,c,f)},useInsertionEffect:function(c,f){return Km(4,2,c,f)},useMemo:function(c,f){var g=ps();return f=f===void 0?null:f,c=c(),g.memoizedState=[c,f],c},useReducer:function(c,f,g){var _=ps();return f=g!==void 0?g(f):f,_.memoizedState=_.baseState=f,c={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:f},_.queue=c,c=c.dispatch=rG.bind(null,sr,c),[_.memoizedState,c]}
vendor: 5,122 bytes, lines 38-40
38,useRef:function(c){var f=ps();return c={current:c},f.memoizedState=c},useState:wP,useDebugValue:wy,useDeferredValue:function(c){return ps().memoizedState=c},useTransition:function(){var c=wP(!1),f=c[0];return c=tG.bind(null,c[1]),ps().memoizedState=c,[f,c]},useMutableSource:function(){},useSyncExternalStore:function(c,f,g){var _=sr,E=ps();if(tr){if(g===void 0)throw Error(r(407));g=g()}else{if(g=f(),Dr===null)throw Error(r(349));(Uo&30)!==0||gP(_,f,g)}E.memoizedState=g;var P={value:g,getSnapshot:f};return E.queue=P,jP(xP.bind(null,_,P,c),[c]),_.flags|=2048,Vd(9,vP.bind(null,_,P,g,f),void 0,null),g},useId:function(){var c=ps(),f=Dr.identifierPrefix;if(tr){var g=Bs,_=Fs;g=(_&~(1<<32-Pa(_)-1)).toString(32)+g,f=":"+f+"R"+g,g=Fd++,0<g&&(f+="H"+g.toString(32)),f+=":"}else g=eG++,f=":"+f+"r"+g.toString(32)+":";return c.memoizedState=f},unstable_isNewReconciler:!1},sG={readContext:sa,useCallback:EP,useContext:sa,useEffect:by,useImperativeHandle:kP,useInsertionEffect:NP,useLayoutEffect:SP,useMemo:AP,useReducer:xy,useRef:_P,useState:function(){return xy(Bd)},useDebugValue:wy,useDeferredValue:function(c){var f=ia();return PP(f,Sr.memoizedState,c)},useTransition:function(){var c=xy(Bd)[0],f=ia().memoizedState;return[c,f]},useMutableSource:mP,useSyncExternalStore:pP,useId:TP,unstable_isNewReconciler:!1},iG={readContext:sa,useCallback:EP,useContext:sa,useEffect:by,useImperativeHandle:kP,useInsertionEffect:NP,useLayoutEffect:SP,useMemo:AP,useReducer:yy,useRef:_P,useState:function(){return yy(Bd)},useDebugValue:wy,useDeferredValue:function(c){var f=ia();return Sr===null?f.memoizedState=c:PP(f,Sr.memoizedState,c)},useTransition:function(){var c=yy(Bd)[0],f=ia().memoizedState;return[c,f]},useMutableSource:mP,useSyncExternalStore:pP,useId:TP,unstable_isNewReconciler:!1};function Ma(c,f){if(c&&c.defaultProps){f=B({},f),c=c.defaultProps;for(var g in c)f[g]===void 0&&(f[g]=c[g]);return f}return f}function _y(c,f,g,_){f=c.memoizedState,g=g(_,f),g=g==null?f:B({},f,g),c.memoizedState=g,c.lanes===0&&(c.updateQueue.baseState=g)}var Zm={isMounted:function(c){return(c=c._reactInternals)?Do(c)===c:!1},enqueueSetState:function(c,f,g){c=c._reactInternals;var _=dn(),E=Vi(c),P=zs(_,E);P.payload=f,g!=null&&(P.callback=g),f=$i(c,P,E),f!==null&&(Da(f,c,E,_),Um(f,c,E))},enqueueReplaceState:function(c,f,g){c=c._reactInternals;var _=dn(),E=Vi(c),P=zs(_,E);P.tag=1,P.payload=f,g!=null&&(P.callback=g),f=$i(c,P,E),f!==null&&(Da(f,c,E,_),Um(f,c,E))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var g=dn(),_=Vi(c),E=zs(g,_);E.tag=2,f!=null&&(E.callback=f),f=$i(c,E,_),f!==null&&(Da(f,c,_,g),Um(f,c,_))}};function IP(c,f,g,_,E,P,$){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(_,P,$):f.prototype&&f.prototype.isPureReactComponent?!kd(g,_)||!kd(E,P):!0}function DP(c,f,g){var _=!1,E=Ri,P=f.contextType;return typeof P=="object"&&P!==null?P=sa(P):(E=wn(f)?Lo:Zr.current,_=f.contextTypes,P=(_=_!=null)?ac(c,E):Ri),f=new f(g,P),c.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=Zm,c.stateNode=f,f._reactInternals=c,_&&(c=c.stateNode,c.__reactInternalMemoizedUnmaskedChildContext=E,c.__reactInternalMemoizedMaskedChildContext=P),f}function $P(c,f,g,_){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(g,_),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(g,_),f.state!==c&&Zm.enqueueReplaceState(f,f.state,null)}function jy(c,f,g,_){var E=c.stateNode;E.props=g,E.state=c.memoizedState,E.refs={},cy(c);var P=f.contextType;typeof P=="object"&&P!==null?E.context=sa(P):(P=wn(f)?Lo:Zr.current,E.context=ac(c,P)),E.state=c.memoizedState,P=f.getDerivedStateFromProps,typeof P=="function"&&(_y(c,f,P,g),E.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(f=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),f!==E.state&&Zm.enqueueReplaceState(E,E.state,null),qm(c,g,E,_),E.state=c.memoizedState),typeof E.componentDidMount=="function"&&(c.flags|=4194308)}function fc(c,f){try{var g="",_=f;do g+=me(_),_=_.return;while(_);var E=g}catch(P){E=` 39Error generating stack: `+P.message+` 40`+P.stack}return{value:c,source:f,stack:E,digest:null}}function Ny(c,f,g){return{value:c,source:null,stack:g??null,digest:f??null}}function Sy(c,f){try{console.error(f.value)}catch(g){setTimeout(function(){throw g})}}var oG=typeof WeakMap=="function"?WeakMap:Map;function LP(c,f,g){g=zs(-1,g),g.tag=3,g.payload={element:null};var _=f.value;return g.callback=function(){ap||(ap=!0,By=_),Sy(c,f)},g}function FP(c,f,g){g=zs(-1,g),g.tag=3;var _=c.type.getDerivedStateFromError;if(typeof _=="function"){var E=f.value;g.payload=function(){return _(E)},g.callback=function(){Sy(c,f)}}var P=c.stateNode;return P!==null&&typeof P.componentDidCatch=="function"&&(g.callback=function(){Sy(c,f),typeof _!="function"&&(Fi===null?Fi=new Set([this]):Fi.add(this));
vendor: 24,349 bytes, line 40
40var $=f.stack;this.componentDidCatch(f.value,{componentStack:$!==null?$:""})}),g}function BP(c,f,g){var _=c.pingCache;if(_===null){_=c.pingCache=new oG;var E=new Set;_.set(f,E)}else E=_.get(f),E===void 0&&(E=new Set,_.set(f,E));E.has(g)||(E.add(g),c=wG.bind(null,c,f,g),f.then(c,c))}function VP(c){do{var f;if((f=c.tag===13)&&(f=c.memoizedState,f=f!==null?f.dehydrated!==null:!0),f)return c;c=c.return}while(c!==null);return null}function zP(c,f,g,_,E){return(c.mode&1)===0?(c===f?c.flags|=65536:(c.flags|=128,g.flags|=131072,g.flags&=-52805,g.tag===1&&(g.alternate===null?g.tag=17:(f=zs(-1,1),f.tag=2,$i(g,f,1))),g.lanes|=1),c):(c.flags|=65536,c.lanes=E,c)}var lG=k.ReactCurrentOwner,_n=!1;function un(c,f,g,_){f.child=c===null?lP(f,null,g,_):lc(f,c.child,g,_)}function UP(c,f,g,_,E){g=g.render;var P=f.ref;return uc(f,E),_=gy(c,f,g,_,P,E),g=vy(),c!==null&&!_n?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~E,Us(c,f,E)):(tr&&g&&Jx(f),f.flags|=1,un(c,f,_,E),f.child)}function qP(c,f,g,_,E){if(c===null){var P=g.type;return typeof P=="function"&&!Gy(P)&&P.defaultProps===void 0&&g.compare===null&&g.defaultProps===void 0?(f.tag=15,f.type=P,WP(c,f,P,_,E)):(c=up(g.type,null,_,f,f.mode,E),c.ref=f.ref,c.return=f,f.child=c)}if(P=c.child,(c.lanes&E)===0){var $=P.memoizedProps;if(g=g.compare,g=g!==null?g:kd,g($,_)&&c.ref===f.ref)return Us(c,f,E)}return f.flags|=1,c=Ui(P,_),c.ref=f.ref,c.return=f,f.child=c}function WP(c,f,g,_,E){if(c!==null){var P=c.memoizedProps;if(kd(P,_)&&c.ref===f.ref)if(_n=!1,f.pendingProps=_=P,(c.lanes&E)!==0)(c.flags&131072)!==0&&(_n=!0);else return f.lanes=c.lanes,Us(c,f,E)}return Cy(c,f,g,_,E)}function HP(c,f,g){var _=f.pendingProps,E=_.children,P=c!==null?c.memoizedState:null;if(_.mode==="hidden")if((f.mode&1)===0)f.memoizedState={baseLanes:0,cachePool:null,transitions:null},Gt(mc,Fn),Fn|=g;else{if((g&1073741824)===0)return c=P!==null?P.baseLanes|g:g,f.lanes=f.childLanes=1073741824,f.memoizedState={baseLanes:c,cachePool:null,transitions:null},f.updateQueue=null,Gt(mc,Fn),Fn|=c,null;f.memoizedState={baseLanes:0,cachePool:null,transitions:null},_=P!==null?P.baseLanes:g,Gt(mc,Fn),Fn|=_}else P!==null?(_=P.baseLanes|g,f.memoizedState=null):_=g,Gt(mc,Fn),Fn|=_;return un(c,f,E,g),f.child}function GP(c,f){var g=f.ref;(c===null&&g!==null||c!==null&&c.ref!==g)&&(f.flags|=512,f.flags|=2097152)}function Cy(c,f,g,_,E){var P=wn(g)?Lo:Zr.current;return P=ac(f,P),uc(f,E),g=gy(c,f,g,_,P,E),_=vy(),c!==null&&!_n?(f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~E,Us(c,f,E)):(tr&&_&&Jx(f),f.flags|=1,un(c,f,g,E),f.child)}function KP(c,f,g,_,E){if(wn(g)){var P=!0;Im(f)}else P=!1;if(uc(f,E),f.stateNode===null)Jm(c,f),DP(f,g,_),jy(f,g,_,E),_=!0;else if(c===null){var $=f.stateNode,X=f.memoizedProps;$.props=X;var ae=$.context,ge=g.contextType;typeof ge=="object"&&ge!==null?ge=sa(ge):(ge=wn(g)?Lo:Zr.current,ge=ac(f,ge));var Pe=g.getDerivedStateFromProps,Te=typeof Pe=="function"||typeof $.getSnapshotBeforeUpdate=="function";Te||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(X!==_||ae!==ge)&&$P(f,$,_,ge),Di=!1;var Ee=f.memoizedState;$.state=Ee,qm(f,_,$,E),ae=f.memoizedState,X!==_||Ee!==ae||bn.current||Di?(typeof Pe=="function"&&(_y(f,g,Pe,_),ae=f.memoizedState),(X=Di||IP(f,g,X,_,Ee,ae,ge))?(Te||typeof $.UNSAFE_componentWillMount!="function"&&typeof $.componentWillMount!="function"||(typeof $.componentWillMount=="function"&&$.componentWillMount(),typeof $.UNSAFE_componentWillMount=="function"&&$.UNSAFE_componentWillMount()),typeof $.componentDidMount=="function"&&(f.flags|=4194308)):(typeof $.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=_,f.memoizedState=ae),$.props=_,$.state=ae,$.context=ge,_=X):(typeof $.componentDidMount=="function"&&(f.flags|=4194308),_=!1)}else{$=f.stateNode,uP(c,f),X=f.memoizedProps,ge=f.type===f.elementType?X:Ma(f.type,X),$.props=ge,Te=f.pendingProps,Ee=$.context,ae=g.contextType,typeof ae=="object"&&ae!==null?ae=sa(ae):(ae=wn(g)?Lo:Zr.current,ae=ac(f,ae));var Ve=g.getDerivedStateFromProps;(Pe=typeof Ve=="function"||typeof $.getSnapshotBeforeUpdate=="function")||typeof $.UNSAFE_componentWillReceiveProps!="function"&&typeof $.componentWillReceiveProps!="function"||(X!==Te||Ee!==ae)&&$P(f,$,_,ae),Di=!1,Ee=f.memoizedState,$.state=Ee,qm(f,_,$,E);var qe=f.memoizedState;X!==Te||Ee!==qe||bn.current||Di?(typeof Ve=="function"&&(_y(f,g,Ve,_),qe=f.memoizedState),(ge=Di||IP(f,g,ge,_,Ee,qe,ae)||!1)?(Pe||typeof $.UNSAFE_componentWillUpdate!="function"&&typeof $.componentWillUpdate!="function"||(typeof $.componentWillUpdate=="function"&&$.componentWillUpdate(_,qe,ae),typeof $.UNSAFE_componentWillUpdate=="function"&&$.UNSAFE_componentWillUpdate(_,qe,ae)),typeof $.componentDidUpdate=="function"&&(f.flags|=4),typeof $.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof $.componentDidUpdate!="function"||X===c.memoizedProps&&Ee===c.memoizedState||(f.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||X===c.memoizedProps&&Ee===c.memoizedState||(f.flags|=1024),f.memoizedProps=_,f.memoizedState=qe),$.props=_,$.state=qe,$.context=ae,_=ge):(typeof $.componentDidUpdate!="function"||X===c.memoizedProps&&Ee===c.memoizedState||(f.flags|=4),typeof $.getSnapshotBeforeUpdate!="function"||X===c.memoizedProps&&Ee===c.memoizedState||(f.flags|=1024),_=!1)}return ky(c,f,g,_,P,E)}function ky(c,f,g,_,E,P){GP(c,f);var $=(f.flags&128)!==0;if(!_&&!$)return E&&JA(f,g,!1),Us(c,f,P);_=f.stateNode,lG.current=f;var X=$&&typeof g.getDerivedStateFromError!="function"?null:_.render();return f.flags|=1,c!==null&&$?(f.child=lc(f,c.child,null,P),f.child=lc(f,null,X,P)):un(c,f,X,P),f.memoizedState=_.state,E&&JA(f,g,!0),f.child}function YP(c){var f=c.stateNode;f.pendingContext?ZA(c,f.pendingContext,f.pendingContext!==f.context):f.context&&ZA(c,f.context,!1),uy(c,f.containerInfo)}function XP(c,f,g,_,E){return oc(),ny(E),f.flags|=256,un(c,f,g,_),f.child}var Ey={dehydrated:null,treeContext:null,retryLane:0};function Ay(c){return{baseLanes:c,cachePool:null,transitions:null}}function ZP(c,f,g){var _=f.pendingProps,E=ar.current,P=!1,$=(f.flags&128)!==0,X;if((X=$)||(X=c!==null&&c.memoizedState===null?!1:(E&2)!==0),X?(P=!0,f.flags&=-129):(c===null||c.memoizedState!==null)&&(E|=1),Gt(ar,E&1),c===null)return ry(f),c=f.memoizedState,c!==null&&(c=c.dehydrated,c!==null)?((f.mode&1)===0?f.lanes=1:c.data==="$!"?f.lanes=8:f.lanes=1073741824,null):($=_.children,c=_.fallback,P?(_=f.mode,P=f.child,$={mode:"hidden",children:$},(_&1)===0&&P!==null?(P.childLanes=0,P.pendingProps=$):P=dp($,_,0,null),c=Ko(c,_,g,null),P.return=f,c.return=f,P.sibling=c,f.child=P,f.child.memoizedState=Ay(g),f.memoizedState=Ey,c):Py(f,$));if(E=c.memoizedState,E!==null&&(X=E.dehydrated,X!==null))return cG(c,f,$,_,X,E,g);if(P){P=_.fallback,$=f.mode,E=c.child,X=E.sibling;var ae={mode:"hidden",children:_.children};return($&1)===0&&f.child!==E?(_=f.child,_.childLanes=0,_.pendingProps=ae,f.deletions=null):(_=Ui(E,ae),_.subtreeFlags=E.subtreeFlags&14680064),X!==null?P=Ui(X,P):(P=Ko(P,$,g,null),P.flags|=2),P.return=f,_.return=f,_.sibling=P,f.child=_,_=P,P=f.child,$=c.child.memoizedState,$=$===null?Ay(g):{baseLanes:$.baseLanes|g,cachePool:null,transitions:$.transitions},P.memoizedState=$,P.childLanes=c.childLanes&~g,f.memoizedState=Ey,_}return P=c.child,c=P.sibling,_=Ui(P,{mode:"visible",children:_.children}),(f.mode&1)===0&&(_.lanes=g),_.return=f,_.sibling=null,c!==null&&(g=f.deletions,g===null?(f.deletions=[c],f.flags|=16):g.push(c)),f.child=_,f.memoizedState=null,_}function Py(c,f){return f=dp({mode:"visible",children:f},c.mode,0,null),f.return=c,c.child=f}function Qm(c,f,g,_){return _!==null&&ny(_),lc(f,c.child,null,g),c=Py(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function cG(c,f,g,_,E,P,$){if(g)return f.flags&256?(f.flags&=-257,_=Ny(Error(r(422))),Qm(c,f,$,_)):f.memoizedState!==null?(f.child=c.child,f.flags|=128,null):(P=_.fallback,E=f.mode,_=dp({mode:"visible",children:_.children},E,0,null),P=Ko(P,E,$,null),P.flags|=2,_.return=f,P.return=f,_.sibling=P,f.child=_,(f.mode&1)!==0&&lc(f,c.child,null,$),f.child.memoizedState=Ay($),f.memoizedState=Ey,P);if((f.mode&1)===0)return Qm(c,f,$,null);if(E.data==="$!"){if(_=E.nextSibling&&E.nextSibling.dataset,_)var X=_.dgst;return _=X,P=Error(r(419)),_=Ny(P,_,void 0),Qm(c,f,$,_)}if(X=($&c.childLanes)!==0,_n||X){if(_=Dr,_!==null){switch($&-$){case 4:E=2;break;case 16:E=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:E=32;break;case 536870912:E=268435456;break;default:E=0}E=(E&(_.suspendedLanes|$))!==0?0:E,E!==0&&E!==P.retryLane&&(P.retryLane=E,Vs(c,E),Da(_,c,E,-1))}return Hy(),_=Ny(Error(r(421))),Qm(c,f,$,_)}return E.data==="$?"?(f.flags|=128,f.child=c.child,f=_G.bind(null,c),E._reactRetry=f,null):(c=P.treeContext,Ln=Oi(E.nextSibling),$n=f,tr=!0,Oa=null,c!==null&&(na[aa++]=Fs,na[aa++]=Bs,na[aa++]=Fo,Fs=c.id,Bs=c.overflow,Fo=f),f=Py(f,_.children),f.flags|=4096,f)}function QP(c,f,g){c.lanes|=f;var _=c.alternate;_!==null&&(_.lanes|=f),oy(c.return,f,g)}function Ty(c,f,g,_,E){var P=c.memoizedState;P===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:_,tail:g,tailMode:E}:(P.isBackwards=f,P.rendering=null,P.renderingStartTime=0,P.last=_,P.tail=g,P.tailMode=E)}function JP(c,f,g){var _=f.pendingProps,E=_.revealOrder,P=_.tail;if(un(c,f,_.children,g),_=ar.current,(_&2)!==0)_=_&1|2,f.flags|=128;else{if(c!==null&&(c.flags&128)!==0)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&QP(c,g,f);else if(c.tag===19)QP(c,g,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}_&=1}if(Gt(ar,_),(f.mode&1)===0)f.memoizedState=null;else switch(E){case"forwards":for(g=f.child,E=null;g!==null;)c=g.alternate,c!==null&&Wm(c)===null&&(E=g),g=g.sibling;g=E,g===null?(E=f.child,f.child=null):(E=g.sibling,g.sibling=null),Ty(f,!1,E,g,P);break;case"backwards":for(g=null,E=f.child,f.child=null;E!==null;){if(c=E.alternate,c!==null&&Wm(c)===null){f.child=E;break}c=E.sibling,E.sibling=g,g=E,E=c}Ty(f,!0,g,null,P);break;case"together":Ty(f,!1,null,null,void 0);break;default:f.memoizedState=null}return f.child}function Jm(c,f){(f.mode&1)===0&&c!==null&&(c.alternate=null,f.alternate=null,f.flags|=2)}function Us(c,f,g){if(c!==null&&(f.dependencies=c.dependencies),qo|=f.lanes,(g&f.childLanes)===0)return null;if(c!==null&&f.child!==c.child)throw Error(r(153));if(f.child!==null){for(c=f.child,g=Ui(c,c.pendingProps),f.child=g,g.return=f;c.sibling!==null;)c=c.sibling,g=g.sibling=Ui(c,c.pendingProps),g.return=f;g.sibling=null}return f.child}function uG(c,f,g){switch(f.tag){case 3:YP(f),oc();break;case 5:hP(f);break;case 1:wn(f.type)&&Im(f);break;case 4:uy(f,f.stateNode.containerInfo);break;case 10:var _=f.type._context,E=f.memoizedProps.value;Gt(Vm,_._currentValue),_._currentValue=E;break;case 13:if(_=f.memoizedState,_!==null)return _.dehydrated!==null?(Gt(ar,ar.current&1),f.flags|=128,null):(g&f.child.childLanes)!==0?ZP(c,f,g):(Gt(ar,ar.current&1),c=Us(c,f,g),c!==null?c.sibling:null);Gt(ar,ar.current&1);break;case 19:if(_=(g&f.childLanes)!==0,(c.flags&128)!==0){if(_)return JP(c,f,g);f.flags|=128}if(E=f.memoizedState,E!==null&&(E.rendering=null,E.tail=null,E.lastEffect=null),Gt(ar,ar.current),_)break;return null;case 22:case 23:return f.lanes=0,HP(c,f,g)}return Us(c,f,g)}var eT,Oy,tT,rT;eT=function(c,f){for(var g=f.child;g!==null;){if(g.tag===5||g.tag===6)c.appendChild(g.stateNode);else if(g.tag!==4&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===f)break;for(;g.sibling===null;){if(g.return===null||g.return===f)return;g=g.return}g.sibling.return=g.return,g=g.sibling}},Oy=function(){},tT=function(c,f,g,_){var E=c.memoizedProps;if(E!==_){c=f.stateNode,zo(ms.current);var P=null;switch(g){case"input":E=ee(c,E),_=ee(c,_),P=[];break;case"select":E=B({},E,{value:void 0}),_=B({},_,{value:void 0}),P=[];break;case"textarea":E=le(c,E),_=le(c,_),P=[];break;default:typeof E.onClick!="function"&&typeof _.onClick=="function"&&(c.onclick=Om)}bt(g,_);var $;g=null;for(ge in E)if(!_.hasOwnProperty(ge)&&E.hasOwnProperty(ge)&&E[ge]!=null)if(ge==="style"){var X=E[ge];for($ in X)X.hasOwnProperty($)&&(g||(g={}),g[$]="")}else ge!=="dangerouslySetInnerHTML"&&ge!=="children"&&ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&ge!=="autoFocus"&&(a.hasOwnProperty(ge)?P||(P=[]):(P=P||[]).push(ge,null));for(ge in _){var ae=_[ge];if(X=E!=null?E[ge]:void 0,_.hasOwnProperty(ge)&&ae!==X&&(ae!=null||X!=null))if(ge==="style")if(X){for($ in X)!X.hasOwnProperty($)||ae&&ae.hasOwnProperty($)||(g||(g={}),g[$]="");for($ in ae)ae.hasOwnProperty($)&&X[$]!==ae[$]&&(g||(g={}),g[$]=ae[$])}else g||(P||(P=[]),P.push(ge,g)),g=ae;else ge==="dangerouslySetInnerHTML"?(ae=ae?ae.__html:void 0,X=X?X.__html:void 0,ae!=null&&X!==ae&&(P=P||[]).push(ge,ae)):ge==="children"?typeof ae!="string"&&typeof ae!="number"||(P=P||[]).push(ge,""+ae):ge!=="suppressContentEditableWarning"&&ge!=="suppressHydrationWarning"&&(a.hasOwnProperty(ge)?(ae!=null&&ge==="onScroll"&&Zt("scroll",c),P||X===ae||(P=[])):(P=P||[]).push(ge,ae))}g&&(P=P||[]).push("style",g);var ge=P;(f.updateQueue=ge)&&(f.flags|=4)}},rT=function(c,f,g,_){g!==_&&(f.flags|=4)};function zd(c,f){if(!tr)switch(c.tailMode){case"hidden":f=c.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?c.tail=null:g.sibling=null;break;case"collapsed":g=c.tail;for(var _=null;g!==null;)g.alternate!==null&&(_=g),g=g.sibling;_===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:_.sibling=null}}function Jr(c){var f=c.alternate!==null&&c.alternate.child===c.child,g=0,_=0;if(f)for(var E=c.child;E!==null;)g|=E.lanes|E.childLanes,_|=E.subtreeFlags&14680064,_|=E.flags&14680064,E.return=c,E=E.sibling;else for(E=c.child;E!==null;)g|=E.lanes|E.childLanes,_|=E.subtreeFlags,_|=E.flags,E.return=c,E=E.sibling;return c.subtreeFlags|=_,c.childLanes=g,f}function dG(c,f,g){var _=f.pendingProps;switch(ey(f),f.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jr(f),null;case 1:return wn(f.type)&&Rm(),Jr(f),null;case 3:return _=f.stateNode,dc(),Qt(bn),Qt(Zr),hy(),_.pendingContext&&(_.context=_.pendingContext,_.pendingContext=null),(c===null||c.child===null)&&(Fm(f)?f.flags|=4:c===null||c.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,Oa!==null&&(Uy(Oa),Oa=null))),Oy(c,f),Jr(f),null;case 5:dy(f);var E=zo($d.current);if(g=f.type,c!==null&&f.stateNode!=null)tT(c,f,g,_,E),c.ref!==f.ref&&(f.flags|=512,f.flags|=2097152);else{if(!_){if(f.stateNode===null)throw Error(r(166));return Jr(f),null}if(c=zo(ms.current),Fm(f)){_=f.stateNode,g=f.type;var P=f.memoizedProps;switch(_[hs]=f,_[Od]=P,c=(f.mode&1)!==0,g){case"dialog":Zt("cancel",_),Zt("close",_);break;case"iframe":case"object":case"embed":Zt("load",_);break;case"video":case"audio":for(E=0;E<Ad.length;E++)Zt(Ad[E],_);break;case"source":Zt("error",_);break;case"img":case"image":case"link":Zt("error",_),Zt("load",_);break;case"details":Zt("toggle",_);break;case"input":ce(_,P),Zt("invalid",_);break;case"select":_._wrapperState={wasMultiple:!!P.multiple},Zt("invalid",_);break;case"textarea":Se(_,P),Zt("invalid",_)}bt(g,P),E=null;for(var $ in P)if(P.hasOwnProperty($)){var X=P[$];$==="children"?typeof X=="string"?_.textContent!==X&&(P.suppressHydrationWarning!==!0&&Tm(_.textContent,X,c),E=["children",X]):typeof X=="number"&&_.textContent!==""+X&&(P.suppressHydrationWarning!==!0&&Tm(_.textContent,X,c),E=["children",""+X]):a.hasOwnProperty($)&&X!=null&&$==="onScroll"&&Zt("scroll",_)}switch(g){case"input":oe(_),we(_,P,!0);break;case"textarea":oe(_),Ce(_);break;case"select":case"option":break;default:typeof P.onClick=="function"&&(_.onclick=Om)}_=E,f.updateQueue=_,_!==null&&(f.flags|=4)}else{$=E.nodeType===9?E:E.ownerDocument,c==="http://www.w3.org/1999/xhtml"&&(c=$e(g)),c==="http://www.w3.org/1999/xhtml"?g==="script"?(c=$.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild)):typeof _.is=="string"?c=$.createElement(g,{is:_.is}):(c=$.createElement(g),g==="select"&&($=c,_.multiple?$.multiple=!0:_.size&&($.size=_.size))):c=$.createElementNS(c,g),c[hs]=f,c[Od]=_,eT(c,f,!1,!1),f.stateNode=c;e:{switch($=it(g,_),g){case"dialog":Zt("cancel",c),Zt("close",c),E=_;break;case"iframe":case"object":case"embed":Zt("load",c),E=_;break;case"video":case"audio":for(E=0;E<Ad.length;E++)Zt(Ad[E],c);E=_;break;case"source":Zt("error",c),E=_;break;case"img":case"image":case"link":Zt("error",c),Zt("load",c),E=_;break;case"details":Zt("toggle",c),E=_;break;case"input":ce(c,_),E=ee(c,_),Zt("invalid",c);break;case"option":E=_;break;case"select":c._wrapperState={wasMultiple:!!_.multiple},E=B({},_,{value:void 0}),Zt("invalid",c);break;case"textarea":Se(c,_),E=le(c,_),Zt("invalid",c);break;default:E=_}bt(g,E),X=E;for(P in X)if(X.hasOwnProperty(P)){var ae=X[P];P==="style"?Je(c,ae):P==="dangerouslySetInnerHTML"?(ae=ae?ae.__html:void 0,ae!=null&&Dt(c,ae)):P==="children"?typeof ae=="string"?(g!=="textarea"||ae!=="")&&ye(c,ae):typeof ae=="number"&&ye(c,""+ae):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(a.hasOwnProperty(P)?ae!=null&&P==="onScroll"&&Zt("scroll",c):ae!=null&&S(c,P,ae,$))}switch(g){case"input":oe(c),we(c,_,!1);break;case"textarea":oe(c),Ce(c);break;case"option":_.value!=null&&c.setAttribute("value",""+pe(_.value));break;case"select":c.multiple=!!_.multiple,P=_.value,P!=null?ne(c,!!_.multiple,P,!1):_.defaultValue!=null&&ne(c,!!_.multiple,_.defaultValue,!0);break;default:typeof E.onClick=="function"&&(c.onclick=Om)}switch(g){case"button":case"input":case"select":case"textarea":_=!!_.autoFocus;break e;case"img":_=!0;break e;default:_=!1}}_&&(f.flags|=4)}f.ref!==null&&(f.flags|=512,f.flags|=2097152)}return Jr(f),null;case 6:if(c&&f.stateNode!=null)rT(c,f,c.memoizedProps,_);else{if(typeof _!="string"&&f.stateNode===null)throw Error(r(166));if(g=zo($d.current),zo(ms.current),Fm(f)){if(_=f.stateNode,g=f.memoizedProps,_[hs]=f,(P=_.nodeValue!==g)&&(c=$n,c!==null))switch(c.tag){case 3:Tm(_.nodeValue,g,(c.mode&1)!==0);break;case 5:c.memoizedProps.suppressHydrationWarning!==!0&&Tm(_.nodeValue,g,(c.mode&1)!==0)}P&&(f.flags|=4)}else _=(g.nodeType===9?g:g.ownerDocument).createTextNode(_),_[hs]=f,f.stateNode=_}return Jr(f),null;case 13:if(Qt(ar),_=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(tr&&Ln!==null&&(f.mode&1)!==0&&(f.flags&128)===0)sP(),oc(),f.flags|=98560,P=!1;else if(P=Fm(f),_!==null&&_.dehydrated!==null){if(c===null){if(!P)throw Error(r(318));if(P=f.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(r(317));P[hs]=f}else oc(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Jr(f),P=!1}else Oa!==null&&(Uy(Oa),Oa=null),P=!0;if(!P)return f.flags&65536?f:null}return(f.flags&128)!==0?(f.lanes=g,f):(_=_!==null,_!==(c!==null&&c.memoizedState!==null)&&_&&(f.child.flags|=8192,(f.mode&1)!==0&&(c===null||(ar.current&1)!==0?Cr===0&&(Cr=3):Hy())),f.updateQueue!==null&&(f.flags|=4),Jr(f),null);case 4:return dc(),Oy(c,f),c===null&&Pd(f.stateNode.containerInfo),Jr(f),null;case 10:return iy(f.type._context),Jr(f),null;case 17:return wn(f.type)&&Rm(),Jr(f),null;case 19:if(Qt(ar),P=f.memoizedState,P===null)return Jr(f),null;if(_=(f.flags&128)!==0,$=P.rendering,$===null)if(_)zd(P,!1);else{if(Cr!==0||c!==null&&(c.flags&128)!==0)for(c=f.child;c!==null;){if($=Wm(c),$!==null){for(f.flags|=128,zd(P,!1),_=$.updateQueue,_!==null&&(f.updateQueue=_,f.flags|=4),f.subtreeFlags=0,_=g,g=f.child;g!==null;)P=g,c=_,P.flags&=14680066,$=P.alternate,$===null?(P.childLanes=0,P.lanes=c,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=$.childLanes,P.lanes=$.lanes,P.child=$.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=$.memoizedProps,P.memoizedState=$.memoizedState,P.updateQueue=$.updateQueue,P.type=$.type,c=$.dependencies,P.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),g=g.sibling;return Gt(ar,ar.current&1|2),f.child}c=c.sibling}P.tail!==null&&mr()>pc&&(f.flags|=128,_=!0,zd(P,!1),f.lanes=4194304)}else{if(!_)if(c=Wm($),c!==null){if(f.flags|=128,_=!0,g=c.updateQueue,g!==null&&(f.updateQueue=g,f.flags|=4),zd(P,!0),P.tail===null&&P.tailMode==="hidden"&&!$.alternate&&!tr)return Jr(f),null}else 2*mr()-P.renderingStartTime>pc&&g!==1073741824&&(f.flags|=128,_=!0,zd(P,!1),f.lanes=4194304);P.isBackwards?($.sibling=f.child,f.child=$):(g=P.last,g!==null?g.sibling=$:f.child=$,P.last=$)}return P.tail!==null?(f=P.tail,P.rendering=f,P.tail=f.sibling,P.renderingStartTime=mr(),f.sibling=null,g=ar.current,Gt(ar,_?g&1|2:g&1),f):(Jr(f),null);case 22:case 23:return Wy(),_=f.memoizedState!==null,c!==null&&c.memoizedState!==null!==_&&(f.flags|=8192),_&&(f.mode&1)!==0?(Fn&1073741824)!==0&&(Jr(f),f.subtreeFlags&6&&(f.flags|=8192)):Jr(f),null;case 24:return null;case 25:return null}throw Error(r(156,f.tag))}function fG(c,f){switch(ey(f),f.tag){case 1:return wn(f.type)&&Rm(),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return dc(),Qt(bn),Qt(Zr),hy(),c=f.flags,(c&65536)!==0&&(c&128)===0?(f.flags=c&-65537|128,f):null;case 5:return dy(f),null;case 13:if(Qt(ar),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(r(340));oc()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return Qt(ar),null;case 4:return dc(),null;case 10:return iy(f.type._context),null;case 22:case 23:return Wy(),null;case 24:return null;default:return null}}var ep=!1,en=!1,hG=typeof WeakSet=="function"?WeakSet:Set,ze=null;function hc(c,f){var g=c.ref;if(g!==null)if(typeof g=="function")try{g(null)}catch(_){ur(c,f,_)}else g.current=null}function My(c,f,g){try{g()}catch(_){ur(c,f,_)}}var nT=!1;function mG(c,f){if(Wx=bm,c=IA(),$x(c)){if("selectionStart"in c)var g={start:c.selectionStart,end:c.selectionEnd};else e:{g=(g=c.ownerDocument)&&g.defaultView||window;var _=g.getSelection&&g.getSelection();if(_&&_.rangeCount!==0){g=_.anchorNode;var E=_.anchorOffset,P=_.focusNode;_=_.focusOffset;try{g.nodeType,P.nodeType}catch{g=null;break e}var $=0,X=-1,ae=-1,ge=0,Pe=0,Te=c,Ee=null;t:for(;;){for(var Ve;Te!==g||E!==0&&Te.nodeType!==3||(X=$+E),Te!==P||_!==0&&Te.nodeType!==3||(ae=$+_),Te.nodeType===3&&($+=Te.nodeValue.length),(Ve=Te.firstChild)!==null;)Ee=Te,Te=Ve;for(;;){if(Te===c)break t;if(Ee===g&&++ge===E&&(X=$),Ee===P&&++Pe===_&&(ae=$),(Ve=Te.nextSibling)!==null)break;Te=Ee,Ee=Te.parentNode}Te=Ve}g=X===-1||ae===-1?null:{start:X,end:ae}}else g=null}g=g||{start:0,end:0}}else g=null;for(Hx={focusedElem:c,selectionRange:g},bm=!1,ze=f;ze!==null;)if(f=ze,c=f.child,(f.subtreeFlags&1028)!==0&&c!==null)c.return=f,ze=c;else for(;ze!==null;){f=ze;try{var qe=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(qe!==null){var He=qe.memoizedProps,pr=qe.memoizedState,ue=f.stateNode,ie=ue.getSnapshotBeforeUpdate(f.elementType===f.type?He:Ma(f.type,He),pr);ue.__reactInternalSnapshotBeforeUpdate=ie}break;case 3:var he=f.stateNode.containerInfo;he.nodeType===1?he.textContent="":he.nodeType===9&&he.documentElement&&he.removeChild(he.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(Re){ur(f,f.return,Re)}if(c=f.sibling,c!==null){c.return=f.return,ze=c;break}ze=f.return}return qe=nT,nT=!1,qe}function Ud(c,f,g){var _=f.updateQueue;if(_=_!==null?_.lastEffect:null,_!==null){var E=_=_.next;do{if((E.tag&c)===c){var P=E.destroy;E.destroy=void 0,P!==void 0&&My(f,g,P)}E=E.next}while(E!==_)}}function tp(c,f){if(f=f.updateQueue,f=f!==null?f.lastEffect:null,f!==null){var g=f=f.next;do{if((g.tag&c)===c){var _=g.create;g.destroy=_()}g=g.next}while(g!==f)}}function Ry(c){var f=c.ref;if(f!==null){var g=c.stateNode;switch(c.tag){case 5:c=g;break;default:c=g}typeof f=="function"?f(c):f.current=c}}function aT(c){var f=c.alternate;f!==null&&(c.alternate=null,aT(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&(delete f[hs],delete f[Od],delete f[Xx],delete f[XH],delete f[ZH])),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pe
vendor: 1,502 bytes, line 40
40ndingProps=null,c.stateNode=null,c.updateQueue=null}function sT(c){return c.tag===5||c.tag===3||c.tag===4}function iT(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||sT(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Iy(c,f,g){var _=c.tag;if(_===5||_===6)c=c.stateNode,f?g.nodeType===8?g.parentNode.insertBefore(c,f):g.insertBefore(c,f):(g.nodeType===8?(f=g.parentNode,f.insertBefore(c,g)):(f=g,f.appendChild(c)),g=g._reactRootContainer,g!=null||f.onclick!==null||(f.onclick=Om));else if(_!==4&&(c=c.child,c!==null))for(Iy(c,f,g),c=c.sibling;c!==null;)Iy(c,f,g),c=c.sibling}function Dy(c,f,g){var _=c.tag;if(_===5||_===6)c=c.stateNode,f?g.insertBefore(c,f):g.appendChild(c);else if(_!==4&&(c=c.child,c!==null))for(Dy(c,f,g),c=c.sibling;c!==null;)Dy(c,f,g),c=c.sibling}var Ur=null,Ra=!1;function Li(c,f,g){for(g=g.child;g!==null;)oT(c,f,g),g=g.sibling}function oT(c,f,g){if(fs&&typeof fs.onCommitFiberUnmount=="function")try{fs.onCommitFiberUnmount(mm,g)}catch{}switch(g.tag){case 5:en||hc(g,f);case 6:var _=Ur,E=Ra;Ur=null,Li(c,f,g),Ur=_,Ra=E,Ur!==null&&(Ra?(c=Ur,g=g.stateNode,c.nodeType===8?c.parentNode.removeChild(g):c.removeChild(g)):Ur.removeChild(g.stateNode));break;case 18:Ur!==null&&(Ra?(c=Ur,g=g.stateNode,c.nodeType===8?Yx(c.parentNode,g):c.nodeType===1&&Yx(c,g),wd(c)):Yx(Ur,g.stateNode));break;
vendor: 14,113 bytes, line 40
40case 4:_=Ur,E=Ra,Ur=g.stateNode.containerInfo,Ra=!0,Li(c,f,g),Ur=_,Ra=E;break;case 0:case 11:case 14:case 15:if(!en&&(_=g.updateQueue,_!==null&&(_=_.lastEffect,_!==null))){E=_=_.next;do{var P=E,$=P.destroy;P=P.tag,$!==void 0&&((P&2)!==0||(P&4)!==0)&&My(g,f,$),E=E.next}while(E!==_)}Li(c,f,g);break;case 1:if(!en&&(hc(g,f),_=g.stateNode,typeof _.componentWillUnmount=="function"))try{_.props=g.memoizedProps,_.state=g.memoizedState,_.componentWillUnmount()}catch(X){ur(g,f,X)}Li(c,f,g);break;case 21:Li(c,f,g);break;case 22:g.mode&1?(en=(_=en)||g.memoizedState!==null,Li(c,f,g),en=_):Li(c,f,g);break;default:Li(c,f,g)}}function lT(c){var f=c.updateQueue;if(f!==null){c.updateQueue=null;var g=c.stateNode;g===null&&(g=c.stateNode=new hG),f.forEach(function(_){var E=jG.bind(null,c,_);g.has(_)||(g.add(_),_.then(E,E))})}}function Ia(c,f){var g=f.deletions;if(g!==null)for(var _=0;_<g.length;_++){var E=g[_];try{var P=c,$=f,X=$;e:for(;X!==null;){switch(X.tag){case 5:Ur=X.stateNode,Ra=!1;break e;case 3:Ur=X.stateNode.containerInfo,Ra=!0;break e;case 4:Ur=X.stateNode.containerInfo,Ra=!0;break e}X=X.return}if(Ur===null)throw Error(r(160));oT(P,$,E),Ur=null,Ra=!1;var ae=E.alternate;ae!==null&&(ae.return=null),E.return=null}catch(ge){ur(E,f,ge)}}if(f.subtreeFlags&12854)for(f=f.child;f!==null;)cT(f,c),f=f.sibling}function cT(c,f){var g=c.alternate,_=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:if(Ia(f,c),gs(c),_&4){try{Ud(3,c,c.return),tp(3,c)}catch(He){ur(c,c.return,He)}try{Ud(5,c,c.return)}catch(He){ur(c,c.return,He)}}break;case 1:Ia(f,c),gs(c),_&512&&g!==null&&hc(g,g.return);break;case 5:if(Ia(f,c),gs(c),_&512&&g!==null&&hc(g,g.return),c.flags&32){var E=c.stateNode;try{ye(E,"")}catch(He){ur(c,c.return,He)}}if(_&4&&(E=c.stateNode,E!=null)){var P=c.memoizedProps,$=g!==null?g.memoizedProps:P,X=c.type,ae=c.updateQueue;if(c.updateQueue=null,ae!==null)try{X==="input"&&P.type==="radio"&&P.name!=null&&je(E,P),it(X,$);var ge=it(X,P);for($=0;$<ae.length;$+=2){var Pe=ae[$],Te=ae[$+1];Pe==="style"?Je(E,Te):Pe==="dangerouslySetInnerHTML"?Dt(E,Te):Pe==="children"?ye(E,Te):S(E,Pe,Te,ge)}switch(X){case"input":de(E,P);break;case"textarea":Ae(E,P);break;case"select":var Ee=E._wrapperState.wasMultiple;E._wrapperState.wasMultiple=!!P.multiple;var Ve=P.value;Ve!=null?ne(E,!!P.multiple,Ve,!1):Ee!==!!P.multiple&&(P.defaultValue!=null?ne(E,!!P.multiple,P.defaultValue,!0):ne(E,!!P.multiple,P.multiple?[]:"",!1))}E[Od]=P}catch(He){ur(c,c.return,He)}}break;case 6:if(Ia(f,c),gs(c),_&4){if(c.stateNode===null)throw Error(r(162));E=c.stateNode,P=c.memoizedProps;try{E.nodeValue=P}catch(He){ur(c,c.return,He)}}break;case 3:if(Ia(f,c),gs(c),_&4&&g!==null&&g.memoizedState.isDehydrated)try{wd(f.containerInfo)}catch(He){ur(c,c.return,He)}break;case 4:Ia(f,c),gs(c);break;case 13:Ia(f,c),gs(c),E=c.child,E.flags&8192&&(P=E.memoizedState!==null,E.stateNode.isHidden=P,!P||E.alternate!==null&&E.alternate.memoizedState!==null||(Fy=mr())),_&4&&lT(c);break;case 22:if(Pe=g!==null&&g.memoizedState!==null,c.mode&1?(en=(ge=en)||Pe,Ia(f,c),en=ge):Ia(f,c),gs(c),_&8192){if(ge=c.memoizedState!==null,(c.stateNode.isHidden=ge)&&!Pe&&(c.mode&1)!==0)for(ze=c,Pe=c.child;Pe!==null;){for(Te=ze=Pe;ze!==null;){switch(Ee=ze,Ve=Ee.child,Ee.tag){case 0:case 11:case 14:case 15:Ud(4,Ee,Ee.return);break;case 1:hc(Ee,Ee.return);var qe=Ee.stateNode;if(typeof qe.componentWillUnmount=="function"){_=Ee,g=Ee.return;try{f=_,qe.props=f.memoizedProps,qe.state=f.memoizedState,qe.componentWillUnmount()}catch(He){ur(_,g,He)}}break;case 5:hc(Ee,Ee.return);break;case 22:if(Ee.memoizedState!==null){fT(Te);continue}}Ve!==null?(Ve.return=Ee,ze=Ve):fT(Te)}Pe=Pe.sibling}e:for(Pe=null,Te=c;;){if(Te.tag===5){if(Pe===null){Pe=Te;try{E=Te.stateNode,ge?(P=E.style,typeof P.setProperty=="function"?P.setProperty("display","none","important"):P.display="none"):(X=Te.stateNode,ae=Te.memoizedProps.style,$=ae!=null&&ae.hasOwnProperty("display")?ae.display:null,X.style.display=cr("display",$))}catch(He){ur(c,c.return,He)}}}else if(Te.tag===6){if(Pe===null)try{Te.stateNode.nodeValue=ge?"":Te.memoizedProps}catch(He){ur(c,c.return,He)}}else if((Te.tag!==22&&Te.tag!==23||Te.memoizedState===null||Te===c)&&Te.child!==null){Te.child.return=Te,Te=Te.child;continue}if(Te===c)break e;for(;Te.sibling===null;){if(Te.return===null||Te.return===c)break e;Pe===Te&&(Pe=null),Te=Te.return}Pe===Te&&(Pe=null),Te.sibling.return=Te.return,Te=Te.sibling}}break;case 19:Ia(f,c),gs(c),_&4&&lT(c);break;case 21:break;default:Ia(f,c),gs(c)}}function gs(c){var f=c.flags;if(f&2){try{e:{for(var g=c.return;g!==null;){if(sT(g)){var _=g;break e}g=g.return}throw Error(r(160))}switch(_.tag){case 5:var E=_.stateNode;_.flags&32&&(ye(E,""),_.flags&=-33);var P=iT(c);Dy(c,P,E);break;case 3:case 4:var $=_.stateNode.containerInfo,X=iT(c);Iy(c,X,$);break;default:throw Error(r(161))}}catch(ae){ur(c,c.return,ae)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function pG(c,f,g){ze=c,uT(c)}function uT(c,f,g){for(var _=(c.mode&1)!==0;ze!==null;){var E=ze,P=E.child;if(E.tag===22&&_){var $=E.memoizedState!==null||ep;if(!$){var X=E.alternate,ae=X!==null&&X.memoizedState!==null||en;X=ep;var ge=en;if(ep=$,(en=ae)&&!ge)for(ze=E;ze!==null;)$=ze,ae=$.child,$.tag===22&&$.memoizedState!==null?hT(E):ae!==null?(ae.return=$,ze=ae):hT(E);for(;P!==null;)ze=P,uT(P),P=P.sibling;ze=E,ep=X,en=ge}dT(c)}else(E.subtreeFlags&8772)!==0&&P!==null?(P.return=E,ze=P):dT(c)}}function dT(c){for(;ze!==null;){var f=ze;if((f.flags&8772)!==0){var g=f.alternate;try{if((f.flags&8772)!==0)switch(f.tag){case 0:case 11:case 15:en||tp(5,f);break;case 1:var _=f.stateNode;if(f.flags&4&&!en)if(g===null)_.componentDidMount();else{var E=f.elementType===f.type?g.memoizedProps:Ma(f.type,g.memoizedProps);_.componentDidUpdate(E,g.memoizedState,_.__reactInternalSnapshotBeforeUpdate)}var P=f.updateQueue;P!==null&&fP(f,P,_);break;case 3:var $=f.updateQueue;if($!==null){if(g=null,f.child!==null)switch(f.child.tag){case 5:g=f.child.stateNode;break;case 1:g=f.child.stateNode}fP(f,$,g)}break;case 5:var X=f.stateNode;if(g===null&&f.flags&4){g=X;var ae=f.memoizedProps;switch(f.type){case"button":case"input":case"select":case"textarea":ae.autoFocus&&g.focus();break;case"img":ae.src&&(g.src=ae.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(f.memoizedState===null){var ge=f.alternate;if(ge!==null){var Pe=ge.memoizedState;if(Pe!==null){var Te=Pe.dehydrated;Te!==null&&wd(Te)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}en||f.flags&512&&Ry(f)}catch(Ee){ur(f,f.return,Ee)}}if(f===c){ze=null;break}if(g=f.sibling,g!==null){g.return=f.return,ze=g;break}ze=f.return}}function fT(c){for(;ze!==null;){var f=ze;if(f===c){ze=null;break}var g=f.sibling;if(g!==null){g.return=f.return,ze=g;break}ze=f.return}}function hT(c){for(;ze!==null;){var f=ze;try{switch(f.tag){case 0:case 11:case 15:var g=f.return;try{tp(4,f)}catch(ae){ur(f,g,ae)}break;case 1:var _=f.stateNode;if(typeof _.componentDidMount=="function"){var E=f.return;try{_.componentDidMount()}catch(ae){ur(f,E,ae)}}var P=f.return;try{Ry(f)}catch(ae){ur(f,P,ae)}break;case 5:var $=f.return;try{Ry(f)}catch(ae){ur(f,$,ae)}}}catch(ae){ur(f,f.return,ae)}if(f===c){ze=null;break}var X=f.sibling;if(X!==null){X.return=f.return,ze=X;break}ze=f.return}}var gG=Math.ceil,rp=k.ReactCurrentDispatcher,$y=k.ReactCurrentOwner,oa=k.ReactCurrentBatchConfig,At=0,Dr=null,vr=null,qr=0,Fn=0,mc=Mi(0),Cr=0,qd=null,qo=0,np=0,Ly=0,Wd=null,jn=null,Fy=0,pc=1/0,qs=null,ap=!1,By=null,Fi=null,sp=!1,Bi=null,ip=0,Hd=0,Vy=null,op=-1,lp=0;function dn(){return(At&6)!==0?mr():op!==-1?op:op=mr()}function Vi(c){return(c.mode&1)===0?1:(At&2)!==0&&qr!==0?qr&-qr:JH.transition!==null?(lp===0&&(lp=iA()),lp):(c=Bt,c!==0||(c=window.event,c=c===void 0?16:pA(c.type)),c)}function Da(c,f,g,_){if(50<Hd)throw Hd=0,Vy=null,Error(r(185));gd(c,g,_),((At&2)===0||c!==Dr)&&(c===Dr&&((At&2)===0&&(np|=g),Cr===4&&zi(c,qr)),Nn(c,_),g===1&&At===0&&(f.mode&1)===0&&(pc=mr()+500,Dm&&Ii()))}function Nn(c,f){var g=c.callbackNode;JW(c,f);var _=vm(c,c===Dr?qr:0);if(_===0)g!==null&&nA(g),c.callbackNode=null,c.callbackPriority=0;else if(f=_&-_,c.callbackPriority!==f){if(g!=null&&nA(g),f===1)c.tag===0?QH(pT.bind(null,c)):eP(pT.bind(null,c)),KH(function(){(At&6)===0&&Ii()}),g=null;else{switch(oA(_)){case 1:g=bx;break;case 4:g=aA;break;case 16:g=hm;break;case 536870912:g=sA;break;default:g=hm}g=jT(g,mT.bind(null,c))}c.callbackPriority=f,c.callbackNode=g}}function mT(c,f){if(op=-1,lp=0,(At&6)!==0)throw Error(r(327));var g=c.callbackNode;if(gc()&&c.callbackNode!==g)return null;var _=vm(c,c===Dr?qr:0);if(_===0)return null;if((_&30)!==0||(_&c.expiredLanes)!==0||f)f=cp(c,_);else{f=_;var E=At;At|=2;var P=vT();(Dr!==c||qr!==f)&&(qs=null,pc=mr()+500,Ho(c,f));do try{yG();break}catch(X){gT(c,X)}while(!0);sy(),rp.current=P,At=E,vr!==null?f=0:(Dr=null,qr=0,f=Cr)}if(f!==0){if(f===2&&(E=wx(c),E!==0&&(_=E,f=zy(c,E))),f===1)throw g=qd,Ho(c,0),zi(c,_),Nn(c,mr()),g;if(f===6)zi(c,_);else{if(E=c.current.alternate,(_&30)===0&&!vG(E)&&(f=cp(c,_),f===2&&(P=wx(c),P!==0&&(_=P,f=zy(c,P))),f===1))throw g=qd,Ho(c,0),zi(c,_),Nn(c,mr()),g;switch(c.finishedWork=E,c.finishedLanes=_,f){case 0:case 1:throw Error(r(345));case 2:Go(c,jn,qs);break;case 3:if(zi(c,_),(_&130023424)===_&&(f=Fy+500-mr(),10<f)){if(vm(c,0)!==0)break;if(E=c.suspendedLanes,(E&_)!==_){dn(),c.pingedLanes|=c.suspendedLanes&E;break}c.timeoutHandle=Kx(Go.bind(null,c,jn,qs),f);break}Go(c,jn,qs);break;case 4:if(zi(c,_),(_&4194240)===_)break;for(f=c.eventTimes,E=-1;0<_;){var $=31-Pa(_);P=1<<$,$=f[$],$>E&&(E=$),_&=~P}if(_=E,_=mr()-_,_=(120>_?120:480>_?480:1080>_?1080:1920>_?1920:3e3>_?3e3:4320>_?4320:1960*gG(_/1960))-_,10<_){c.timeoutHandle=Kx(Go.bind(null,c,jn,qs),_);break}Go(c,jn,qs);break;case 5:Go(c,jn,qs);break;default:throw Error(r(329))}}}return Nn(c,mr()),c.callbackNode===g?mT.bind(null,c):null}function zy(c,f){var g=Wd;return c.current.memoizedState.isDehydrated&&(Ho(c,f).flags|=256),c=cp(c,f),c!==2&&(f=jn,jn=g,f!==null&&Uy(f)),c}function Uy(c){jn===null?jn=c:jn.push.apply(jn,c)}function vG(c){for(var f=c;;){if(f.flags&16384){var g=f.updateQueue;if(g!==null&&(g=g.stores,g!==null))for(var _=0;_<g.length;_++){var E=g[_],P=E.getSnapshot;E=E.value;try{if(!Ta(P(),E))return!1}catch{return!1}}}if(g=f.child,f.subtreeFlags&16384&&g!==null)g.return=f,f=g;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function zi(c,f){for(f&=~Ly,f&=~np,c.suspendedLanes|=f,c.pingedLanes&=~f,c=c.expirationTimes;0<f;){var g=31-Pa(f),_=1<<g;c[g]=-1,f&=~_}}function pT(c){if((At&6)!==0)throw Error(r(327));gc();var f=vm(c,0);if((f&1)===0)return Nn(c,mr()),null;var g=cp(c,f);if(c.tag!==0&&g===2){var _=wx(c);_!==0&&(f=_,g=zy(c,_))}if(g===1)throw g=qd,Ho(c,0),zi(c,f),Nn(c,mr()),g;if(g===6)throw Error(r(345));return c.finishedWork=c.current.alternate,c.finishedLanes=f,Go(c,jn,qs),Nn(c,mr()),null}function qy(c,f){var g=At;At|=1;try{return c(f)}finally{At=g,At===0&&(pc=mr()+500,Dm&&Ii())}}function Wo(c){Bi!==null&&Bi.tag===0&&(At&6)===0&&gc();var f=At;At|=1;var g=oa.transition,_=Bt;try{if(oa.transition=null,Bt=1,c)return c()}finally{Bt=_,oa.transition=g,At=f,(At&6)===0&&Ii()}}function Wy(){Fn=mc.current,Qt(mc)}function Ho(c,f){c.finishedWork=null,c.finishedLanes=0;var g=c.timeoutHandle;if(g!==-1&&(c.timeoutHandle=-1,GH(g)),vr!==null)for(g=vr.return;g!==null;){var _=g;switch(ey(_),_.tag){case 1:_=_.type.childContextTypes,_!=null&&Rm();break;case 3:dc(),Qt(bn),Qt(Zr),hy();break;case 5:dy(_);break;case 4:dc();break;case 13:Qt(ar);break;case 19:Qt(ar);break;case 10:iy(_.type._context);break;case 22:case 23:Wy()}g=g.return}if(Dr=c,vr=c=Ui(c.current,null),qr=Fn=f,Cr=0,qd=null,Ly=np=qo=0,jn=Wd=null,Vo!==null){for(f=0;f<Vo.length;f++)if(g=Vo[f],_=g.interleaved,_!==null){g.interleaved=null;var E=_.next,P=g.pending;if(P!==null){var $=P.next;P.next=E,_.next=$}g.pending=_}Vo=null}return c}function gT(c,f){do{var g=vr;try{if(sy(),Hm.current=Xm,Gm){for(var _=sr.memoizedState;_!==null;){var E=_.queue;E!==null&&(E.pending=null),_=_.next}Gm=!1}if(Uo=0,Ir=Sr=sr=null,Ld=!1,Fd=0,$y.current=null,g===null||g.return===null){Cr=1,qd=f,vr=null;break}e:{var P=c,$=g.return,X=g,ae=f;if(f=qr,X.flags|=32768,ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var ge=ae,Pe=X,Te=Pe.tag;if((Pe.mode&1)===0&&(Te===0||Te===11||Te===15)){var Ee=Pe.alternate;Ee?(Pe.updateQueue=Ee.updateQueue,Pe.memoizedState=Ee.memoizedState,Pe.lanes=Ee.lanes):(Pe.updateQueue=null,Pe.memoizedState=null)}var Ve=VP($);if(Ve!==null){Ve.flags&=-257,zP(Ve,$,X,P,f),Ve.mode&1&&BP(P,ge,f),f=Ve,ae=ge;var qe=f.updateQueue;if(qe===null){var He=new Set;He.add(ae),f.updateQueue=He}else qe.add(ae);break e}else{if((f&1)===0){BP(P,ge,f),Hy();break e}ae=Error(r(426))}}else if(tr&&X.mode&1){var pr=VP($);if(pr!==null){(pr.flags&65536)===0&&(pr.flags|=256),zP(pr,$,X,P,f),ny(fc(ae,X));break e}}P=ae=fc(ae,X),Cr!==4&&(Cr=2),Wd===null?Wd=[P]:Wd.push(P),P=$;do{switch(P.tag){case 3:P.flags|=65536,f&=-f,P.lanes|=f;var ue=LP(P,ae,f);dP(P,ue);break e;case 1:X=ae;var ie=P.type,he=P.stateNode;if((P.flags&128)===0&&(typeof ie.getDerivedStateFromError=="function"||he!==null&&typeof he.componentDidCatch=="function"&&(Fi===null||!Fi.has(he)))){P.flags|=65536,f&=-f,P.lanes|=f;var Re=FP(P,X,f);dP(P,Re);break e}}P=P.return}while(P!==null)}yT(g)}catch(Ke){f=Ke,vr===g&&g!==null&&(vr=g=g.return);continue}break}while(!0)}function vT(){var c=rp.current;return rp.current=Xm,c===null?Xm:c}function Hy(){(Cr===0||Cr===3||Cr===2)&&(Cr=4),Dr===null||(qo&268435455)===0&&(np&268435455)===0||zi(Dr,qr)}function cp(c,f){var g=At;At|=2;var _=vT();(Dr!==c||qr!==f)&&(qs=null,Ho(c,f));do try{xG();break}catch(E){gT(c,E)}while(!0);if(sy(),At=g,rp.current=_,vr!==null)throw Error(r(261));return Dr=null,qr=0,Cr}function xG(){for(;vr!==null;)xT(vr)}function yG(){for(;vr!==null&&!qW();)xT(vr)}function xT(c){var f=_T(c.alternate,c,Fn);c.memoizedProps=c.pendingProps,f===null?yT(c):vr=f,$y.current=null}function yT(c){var f=c;do{var g=f.alternate;if(c=f.return,(f.flags&32768)===0){if(g=dG(g,f,Fn),g!==null){vr=g;return}}else{if(g=fG(g,f),g!==null){g.flags&=32767,vr=g;return}
vendor: 5,940 bytes, line 40
40if(c!==null)c.flags|=32768,c.subtreeFlags=0,c.deletions=null;else{Cr=6,vr=null;return}}if(f=f.sibling,f!==null){vr=f;return}vr=f=c}while(f!==null);Cr===0&&(Cr=5)}function Go(c,f,g){var _=Bt,E=oa.transition;try{oa.transition=null,Bt=1,bG(c,f,g,_)}finally{oa.transition=E,Bt=_}return null}function bG(c,f,g,_){do gc();while(Bi!==null);if((At&6)!==0)throw Error(r(327));g=c.finishedWork;var E=c.finishedLanes;if(g===null)return null;if(c.finishedWork=null,c.finishedLanes=0,g===c.current)throw Error(r(177));c.callbackNode=null,c.callbackPriority=0;var P=g.lanes|g.childLanes;if(eH(c,P),c===Dr&&(vr=Dr=null,qr=0),(g.subtreeFlags&2064)===0&&(g.flags&2064)===0||sp||(sp=!0,jT(hm,function(){return gc(),null})),P=(g.flags&15990)!==0,(g.subtreeFlags&15990)!==0||P){P=oa.transition,oa.transition=null;var $=Bt;Bt=1;var X=At;At|=4,$y.current=null,mG(c,g),cT(g,c),BH(Hx),bm=!!Wx,Hx=Wx=null,c.current=g,pG(g),WW(),At=X,Bt=$,oa.transition=P}else c.current=g;if(sp&&(sp=!1,Bi=c,ip=E),P=c.pendingLanes,P===0&&(Fi=null),KW(g.stateNode),Nn(c,mr()),f!==null)for(_=c.onRecoverableError,g=0;g<f.length;g++)E=f[g],_(E.value,{componentStack:E.stack,digest:E.digest});if(ap)throw ap=!1,c=By,By=null,c;return(ip&1)!==0&&c.tag!==0&&gc(),P=c.pendingLanes,(P&1)!==0?c===Vy?Hd++:(Hd=0,Vy=c):Hd=0,Ii(),null}function gc(){if(Bi!==null){var c=oA(ip),f=oa.transition,g=Bt;try{if(oa.transition=null,Bt=16>c?16:c,Bi===null)var _=!1;else{if(c=Bi,Bi=null,ip=0,(At&6)!==0)throw Error(r(331));var E=At;for(At|=4,ze=c.current;ze!==null;){var P=ze,$=P.child;if((ze.flags&16)!==0){var X=P.deletions;if(X!==null){for(var ae=0;ae<X.length;ae++){var ge=X[ae];for(ze=ge;ze!==null;){var Pe=ze;switch(Pe.tag){case 0:case 11:case 15:Ud(8,Pe,P)}var Te=Pe.child;if(Te!==null)Te.return=Pe,ze=Te;else for(;ze!==null;){Pe=ze;var Ee=Pe.sibling,Ve=Pe.return;if(aT(Pe),Pe===ge){ze=null;break}if(Ee!==null){Ee.return=Ve,ze=Ee;break}ze=Ve}}}var qe=P.alternate;if(qe!==null){var He=qe.child;if(He!==null){qe.child=null;do{var pr=He.sibling;He.sibling=null,He=pr}while(He!==null)}}ze=P}}if((P.subtreeFlags&2064)!==0&&$!==null)$.return=P,ze=$;else e:for(;ze!==null;){if(P=ze,(P.flags&2048)!==0)switch(P.tag){case 0:case 11:case 15:Ud(9,P,P.return)}var ue=P.sibling;if(ue!==null){ue.return=P.return,ze=ue;break e}ze=P.return}}var ie=c.current;for(ze=ie;ze!==null;){$=ze;var he=$.child;if(($.subtreeFlags&2064)!==0&&he!==null)he.return=$,ze=he;else e:for($=ie;ze!==null;){if(X=ze,(X.flags&2048)!==0)try{switch(X.tag){case 0:case 11:case 15:tp(9,X)}}catch(Ke){ur(X,X.return,Ke)}if(X===$){ze=null;break e}var Re=X.sibling;if(Re!==null){Re.return=X.return,ze=Re;break e}ze=X.return}}if(At=E,Ii(),fs&&typeof fs.onPostCommitFiberRoot=="function")try{fs.onPostCommitFiberRoot(mm,c)}catch{}_=!0}return _}finally{Bt=g,oa.transition=f}}return!1}function bT(c,f,g){f=fc(g,f),f=LP(c,f,1),c=$i(c,f,1),f=dn(),c!==null&&(gd(c,1,f),Nn(c,f))}function ur(c,f,g){if(c.tag===3)bT(c,c,g);else for(;f!==null;){if(f.tag===3){bT(f,c,g);break}else if(f.tag===1){var _=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(Fi===null||!Fi.has(_))){c=fc(g,c),c=FP(f,c,1),f=$i(f,c,1),c=dn(),f!==null&&(gd(f,1,c),Nn(f,c));break}}f=f.return}}function wG(c,f,g){var _=c.pingCache;_!==null&&_.delete(f),f=dn(),c.pingedLanes|=c.suspendedLanes&g,Dr===c&&(qr&g)===g&&(Cr===4||Cr===3&&(qr&130023424)===qr&&500>mr()-Fy?Ho(c,0):Ly|=g),Nn(c,f)}function wT(c,f){f===0&&((c.mode&1)===0?f=1:(f=gm,gm<<=1,(gm&130023424)===0&&(gm=4194304)));var g=dn();c=Vs(c,f),c!==null&&(gd(c,f,g),Nn(c,g))}function _G(c){var f=c.memoizedState,g=0;f!==null&&(g=f.retryLane),wT(c,g)}function jG(c,f){var g=0;switch(c.tag){case 13:var _=c.stateNode,E=c.memoizedState;E!==null&&(g=E.retryLane);break;case 19:_=c.stateNode;break;default:throw Error(r(314))}_!==null&&_.delete(f),wT(c,g)}var _T;_T=function(c,f,g){if(c!==null)if(c.memoizedProps!==f.pendingProps||bn.current)_n=!0;else{if((c.lanes&g)===0&&(f.flags&128)===0)return _n=!1,uG(c,f,g);_n=(c.flags&131072)!==0}else _n=!1,tr&&(f.flags&1048576)!==0&&tP(f,Lm,f.index);switch(f.lanes=0,f.tag){case 2:var _=f.type;Jm(c,f),c=f.pendingProps;var E=ac(f,Zr.current);uc(f,g),E=gy(null,f,_,c,E,g);var P=vy();return f.flags|=1,typeof E=="object"&&E!==null&&typeof E.render=="function"&&E.$$typeof===void 0?(f.tag=1,f.memoizedState=null,f.updateQueue=null,wn(_)?(P=!0,Im(f)):P=!1,f.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,cy(f),E.updater=Zm,f.stateNode=E,E._reactInternals=f,jy(f,_,c,g),f=ky(null,f,_,!0,P,g)):(f.tag=0,tr&&P&&Jx(f),un(null,f,E,g),f=f.child),f;case 16:_=f.elementType;e:{switch(Jm(c,f),c=f.pendingProps,E=_._init,_=E(_._payload),f.type=_,E=f.tag=SG(_),c=Ma(_,c),E){case 0:f=Cy(null,f,_,c,g);break e;case 1:f=KP(null,f,_,c,g);break e;case 11:f=UP(null,f,_,c,g);break e;case 14:f=qP(null,f,_,Ma(_.type,c),g);break e}throw Error(r(306,_,""))}return f;case 0:return _=f.type,E=f.pendingProps,E=f.elementType===_?E:Ma(_,E),Cy(c,f,_,E,g);case 1:return _=f.type,E=f.pendingProps,E=f.elementType===_?E:Ma(_,E),KP(c,f,_,E,g);case 3:e:{if(YP(f),c===null)throw Error(r(387));_=f.pendingProps,P=f.memoizedState,E=P.element,uP(c,f),qm(f,_,null,g);var $=f.memoizedState;if(_=$.element,P.isDehydrated)if(P={element:_,isDehydrated:!1,cache:$.cache,pendingSuspenseBoundaries:$.pendingSuspenseBoundaries,transitions:$.transitions},f.updateQueue.baseState=P,f.memoizedState=P,f.flags&256){E=fc(Error(r(423)),f),f=XP(c,f,_,g,E);break e}else if(_!==E){E=fc(Error(r(424)),f),f=XP(c,f,_,g,E);break e}else for(Ln=Oi(f.stateNode.containerInfo.firstChild),$n=f,tr=!0,Oa=null,g=lP(f,null,_,g),f.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(oc(),_===E){f=Us(c,f,g);break e}un(c,f,_,g)}f=f.child}return f;case 5:return hP(f),c===null&&ry(f),_=f.type,E=f.pendingProps,P=c!==null?c.memoizedProps:null,$=E.children,Gx(_,E)?$=null:P!==null&&Gx(_,P)&&(f.flags|=32),GP(c,f),un(c,f,$,g),f.child;case 6:return c===null&&ry(f),null;case 13:return ZP(c,f,g);
vendor: 9,527 bytes, line 40
40case 4:return uy(f,f.stateNode.containerInfo),_=f.pendingProps,c===null?f.child=lc(f,null,_,g):un(c,f,_,g),f.child;case 11:return _=f.type,E=f.pendingProps,E=f.elementType===_?E:Ma(_,E),UP(c,f,_,E,g);case 7:return un(c,f,f.pendingProps,g),f.child;case 8:return un(c,f,f.pendingProps.children,g),f.child;case 12:return un(c,f,f.pendingProps.children,g),f.child;case 10:e:{if(_=f.type._context,E=f.pendingProps,P=f.memoizedProps,$=E.value,Gt(Vm,_._currentValue),_._currentValue=$,P!==null)if(Ta(P.value,$)){if(P.children===E.children&&!bn.current){f=Us(c,f,g);break e}}else for(P=f.child,P!==null&&(P.return=f);P!==null;){var X=P.dependencies;if(X!==null){$=P.child;for(var ae=X.firstContext;ae!==null;){if(ae.context===_){if(P.tag===1){ae=zs(-1,g&-g),ae.tag=2;var ge=P.updateQueue;if(ge!==null){ge=ge.shared;var Pe=ge.pending;Pe===null?ae.next=ae:(ae.next=Pe.next,Pe.next=ae),ge.pending=ae}}P.lanes|=g,ae=P.alternate,ae!==null&&(ae.lanes|=g),oy(P.return,g,f),X.lanes|=g;break}ae=ae.next}}else if(P.tag===10)$=P.type===f.type?null:P.child;else if(P.tag===18){if($=P.return,$===null)throw Error(r(341));$.lanes|=g,X=$.alternate,X!==null&&(X.lanes|=g),oy($,g,f),$=P.sibling}else $=P.child;if($!==null)$.return=P;else for($=P;$!==null;){if($===f){$=null;break}if(P=$.sibling,P!==null){P.return=$.return,$=P;break}$=$.return}P=$}un(c,f,E.children,g),f=f.child}return f;case 9:return E=f.type,_=f.pendingProps.children,uc(f,g),E=sa(E),_=_(E),f.flags|=1,un(c,f,_,g),f.child;case 14:return _=f.type,E=Ma(_,f.pendingProps),E=Ma(_.type,E),qP(c,f,_,E,g);case 15:return WP(c,f,f.type,f.pendingProps,g);case 17:return _=f.type,E=f.pendingProps,E=f.elementType===_?E:Ma(_,E),Jm(c,f),f.tag=1,wn(_)?(c=!0,Im(f)):c=!1,uc(f,g),DP(f,_,E),jy(f,_,E,g),ky(null,f,_,!0,c,g);case 19:return JP(c,f,g);case 22:return HP(c,f,g)}throw Error(r(156,f.tag))};function jT(c,f){return rA(c,f)}function NG(c,f,g,_){this.tag=c,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function la(c,f,g,_){return new NG(c,f,g,_)}function Gy(c){return c=c.prototype,!(!c||!c.isReactComponent)}function SG(c){if(typeof c=="function")return Gy(c)?1:0;if(c!=null){if(c=c.$$typeof,c===z)return 11;if(c===te)return 14}return 2}function Ui(c,f){var g=c.alternate;return g===null?(g=la(c.tag,f,c.key,c.mode),g.elementType=c.elementType,g.type=c.type,g.stateNode=c.stateNode,g.alternate=c,c.alternate=g):(g.pendingProps=f,g.type=c.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=c.flags&14680064,g.childLanes=c.childLanes,g.lanes=c.lanes,g.child=c.child,g.memoizedProps=c.memoizedProps,g.memoizedState=c.memoizedState,g.updateQueue=c.updateQueue,f=c.dependencies,g.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},g.sibling=c.sibling,g.index=c.index,g.ref=c.ref,g}function up(c,f,g,_,E,P){var $=2;if(_=c,typeof c=="function")Gy(c)&&($=1);else if(typeof c=="string")$=5;else e:switch(c){case T:return Ko(g.children,E,P,f);case R:$=8,E|=8;break;case I:return c=la(12,g,f,E|2),c.elementType=I,c.lanes=P,c;case H:return c=la(13,g,f,E),c.elementType=H,c.lanes=P,c;case Z:return c=la(19,g,f,E),c.elementType=Z,c.lanes=P,c;case M:return dp(g,E,P,f);default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case D:$=10;break e;case L:$=9;break e;case z:$=11;break e;case te:$=14;break e;case G:$=16,_=null;break e}throw Error(r(130,c==null?c:typeof c,""))}return f=la($,g,f,E),f.elementType=c,f.type=_,f.lanes=P,f}function Ko(c,f,g,_){return c=la(7,c,_,f),c.lanes=g,c}function dp(c,f,g,_){return c=la(22,c,_,f),c.elementType=M,c.lanes=g,c.stateNode={isHidden:!1},c}function Ky(c,f,g){return c=la(6,c,null,f),c.lanes=g,c}function Yy(c,f,g){return f=la(4,c.children!==null?c.children:[],c.key,f),f.lanes=g,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function CG(c,f,g,_,E){this.tag=f,this.containerInfo=c,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=_x(0),this.expirationTimes=_x(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_x(0),this.identifierPrefix=_,this.onRecoverableError=E,this.mutableSourceEagerHydrationData=null}function Xy(c,f,g,_,E,P,$,X,ae){return c=new CG(c,f,g,X,ae),f===1?(f=1,P===!0&&(f|=8)):f=0,P=la(3,null,null,f),c.current=P,P.stateNode=c,P.memoizedState={element:_,isDehydrated:g,cache:null,transitions:null,pendingSuspenseBoundaries:null},cy(P),c}function kG(c,f,g){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:A,key:_==null?null:""+_,children:c,containerInfo:f,implementation:g}}function NT(c){if(!c)return Ri;c=c._reactInternals;e:{if(Do(c)!==c||c.tag!==1)throw Error(r(170));var f=c;do{switch(f.tag){case 3:f=f.stateNode.context;break e;case 1:if(wn(f.type)){f=f.stateNode.__reactInternalMemoizedMergedChildContext;break e}}f=f.return}while(f!==null);throw Error(r(171))}if(c.tag===1){var g=c.type;if(wn(g))return QA(c,g,f)}return f}function ST(c,f,g,_,E,P,$,X,ae){return c=Xy(g,_,!0,c,E,P,$,X,ae),c.context=NT(null),g=c.current,_=dn(),E=Vi(g),P=zs(_,E),P.callback=f??null,$i(g,P,E),c.current.lanes=E,gd(c,E,_),Nn(c,_),c}function fp(c,f,g,_){var E=f.current,P=dn(),$=Vi(E);return g=NT(g),f.context===null?f.context=g:f.pendingContext=g,f=zs(P,$),f.payload={element:c},_=_===void 0?null:_,_!==null&&(f.callback=_),c=$i(E,f,$),c!==null&&(Da(c,E,$,P),Um(c,E,$)),$}function hp(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 5:return c.child.stateNode;default:return c.child.stateNode}}function CT(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var g=c.retryLane;c.retryLane=g!==0&&g<f?g:f}}function Zy(c,f){CT(c,f),(c=c.alternate)&&CT(c,f)}function EG(){return null}var kT=typeof reportError=="function"?reportError:function(c){console.error(c)};function Qy(c){this._internalRoot=c}mp.prototype.render=Qy.prototype.render=function(c){var f=this._internalRoot;if(f===null)throw Error(r(409));fp(c,f,null,null)},mp.prototype.unmount=Qy.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var f=c.containerInfo;Wo(function(){fp(null,c,null,null)}),f[$s]=null}};function mp(c){this._internalRoot=c}mp.prototype.unstable_scheduleHydration=function(c){if(c){var f=uA();c={blockedOn:null,target:c,priority:f};for(var g=0;g<Ai.length&&f!==0&&f<Ai[g].priority;g++);Ai.splice(g,0,c),g===0&&hA(c)}};function Jy(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)}function pp(c){return!(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11&&(c.nodeType!==8||c.nodeValue!==" react-mount-point-unstable "))}function ET(){}function AG(c,f,g,_,E){if(E){if(typeof _=="function"){var P=_;_=function(){var ge=hp($);P.call(ge)}}var $=ST(f,_,c,0,null,!1,!1,"",ET);return c._reactRootContainer=$,c[$s]=$.current,Pd(c.nodeType===8?c.parentNode:c),Wo(),$}for(;E=c.lastChild;)c.removeChild(E);if(typeof _=="function"){var X=_;_=function(){var ge=hp(ae);X.call(ge)}}var ae=Xy(c,0,!1,null,null,!1,!1,"",ET);return c._reactRootContainer=ae,c[$s]=ae.current,Pd(c.nodeType===8?c.parentNode:c),Wo(function(){fp(f,ae,g,_)}),ae}function gp(c,f,g,_,E){var P=g._reactRootContainer;if(P){var $=P;if(typeof E=="function"){var X=E;E=function(){var ae=hp($);X.call(ae)}}fp(f,$,c,E)}else $=AG(g,f,c,E,_);return hp($)}lA=function(c){switch(c.tag){case 3:var f=c.stateNode;if(f.current.memoizedState.isDehydrated){var g=pd(f.pendingLanes);g!==0&&(jx(f,g|1),Nn(f,mr()),(At&6)===0&&(pc=mr()+500,Ii()))}break;case 13:Wo(function(){var _=Vs(c,1);if(_!==null){var E=dn();Da(_,c,1,E)}}),Zy(c,1)}},Nx=function(c){if(c.tag===13){var f=Vs(c,134217728);if(f!==null){var g=dn();Da(f,c,134217728,g)}Zy(c,134217728)}},cA=function(c){if(c.tag===13){var f=Vi(c),g=Vs(c,f);if(g!==null){var _=dn();Da(g,c,f,_)}Zy(c,f)}},uA=function(){return Bt},dA=function(c,f){var g=Bt;try{return Bt=c,f()}finally{Bt=g}},Kl=function(c,f,g){switch(f){case"input":if(de(c,g),f=g.name,g.type==="radio"&&f!=null){for(g=c;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll("input[name="+JSON.stringify(""+f)+'][type="radio"]'),f=0;f<g.length;f++){var _=g[f];if(_!==c&&_.form===c.form){var E=Mm(_);if(!E)throw Error(r(90));re(_),de(_,E)}}}break;case"textarea":Ae(c,g);break;case"select":f=g.value,f!=null&&ne(c,!!g.multiple,f,!1)}},It=qy,Wt=Wo;var PG={usingClientEntryPoint:!1,Events:[Md,rc,Mm,um,ut,qy]},Gd={findFiberByHostInstance:$o,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},TG={bundleType:Gd.bundleType,version:Gd.version,rendererPackageName:Gd.rendererPackageName,rendererConfig:Gd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:k.ReactCurrentDispatcher,findHostInstanceByFiber:function(c){return c=eA(c),c===null?null:c.stateNode},findFiberByHostInstance:Gd.findFiberByHostInstance||EG,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vp.isDisabled&&vp.supportsFiber)try{mm=vp.inject(TG),fs=vp}catch{}}return Sn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=PG,Sn.createPortal=function(c,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Jy(f))throw Error(r(200));return kG(c,f,null,g)},Sn.createRoot=function(c,f){if(!Jy(c))throw Error(r(299));var g=!1,_="",E=kT;return f!=null&&(f.unstable_strictMode===!0&&(g=!0),f.identifierPrefix!==void 0&&(_=f.identifierPrefix),f.onRecoverableError!==void 0&&(E=f.onRecoverableError)),f=Xy(c,1,!1,null,null,g,!1,_,E),c[$s]=f.current,Pd(c.nodeType===8?c.parentNode:c),new Qy(f)},Sn.findDOMNode=function(c){if(c==null)return null;if(c.nodeType===1)return c;var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(r(188)):(c=Object.keys(c).join(","),Error(r(268,c)));return c=eA(f),c=c===null?null:c.stateNode,c},Sn.flushSync=function(c){return Wo(c)},Sn.hydrate=function(c,f,g){if(!pp(f))throw Error(r(200));return gp(null,c,f,!0,g)},Sn.hydrateRoot=function(c,f,g){if(!Jy(c))throw Error(r(405));var _=g!=null&&g.hydratedSources||null,E=!1,P="",$=kT;if(g!=null&&(g.unstable_strictMode===!0&&(E=!0),g.identifierPrefix!==void 0&&(P=g.identifierPrefix),g.onRecoverableError!==void 0&&($=g.onRecoverableError)),f=ST(f,null,c,1,g??null,E,!1,P,$),c[$s]=f.current,Pd(c),_)for(c=0;c<_.length;c++)g=_[c],E=g._getVersion,E=E(g._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[g,E]:f.mutableSourceEagerHydrationData.push(g,E);return new mp(f)},Sn.render=function(c,f,g){if(!pp(f))throw Error(r(200));return gp(null,c,f,!1,g)},Sn.unmountComponentAtNode=function(c){if(!pp(c))throw Error(r(40));return c._reactRootContainer?(Wo(function(){gp(null,null,c,!1,function(){c._reactRootContainer=null,c[$s]=null})}),!0):!1},Sn.unstable_batchedUpdates=qy,Sn.unstable_renderSubtreeIntoContainer=function(c,f,g,_){if(!pp(g))throw Error(r(200));if(c==null||c._reactInternals===void 0)throw Error(r(38));return gp(c,f,g,!1,_)},Sn.version="18.3.1-next-f1338f8080-20240426",Sn}var DT;function XL(){if(DT)return rb.exports;DT=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),rb.exports=FG(),rb.exports}var $T;function BG(){if($T)return yp;$T=1;var t=XL();return yp.createRoot=t.createRoot,yp.hydrateRoot=t.hydrateRoot,yp}var VG=BG();const zG=Ft(VG);var $h=XL();const ZL=Ft($h);/** 41 * @remix-run/router v1.23.1 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 Df(){return Df=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Df.apply(this,arguments)}var no;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(no||(no={}));const LT="popstate";function UG(t){t===void 0&&(t={});function e(n,a){let{pathname:i,search:o,hash:l}=n.location;return nN("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:gg(a)}return WG(e,r,null,t)}function gr(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function G2(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function qG(){return Math.random().toString(36).substr(2,8)}function FT(t,e){return{usr:t.state,key:t.key,idx:e}}function nN(t,e,r,n){return r===void 0&&(r=null),Df({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Uu(e):e,{state:r,key:e&&e.key||n||qG()})}function gg(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Uu(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function WG(t,e,r,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=no.Pop,u=null,d=h();d==null&&(d=0,o.replaceState(Df({},o.state,{idx:d}),""));function h(){return(o.state||{idx:null}).idx}function m(){l=no.Pop;let x=h(),j=x==null?null:x-d;d=x,u&&u({action:l,location:y.location,delta:j})}function p(x,j){l=no.Push;let N=nN(y.location,x,j);d=h()+1;let S=FT(N,d),k=y.createHref(N);try{o.pushState(S,"",k)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;a.location.assign(k)}i&&u&&u({action:l,location:y.location,delta:1})}function v(x,j){l=no.Replace;let N=nN(y.location,x,j);d=h();let S=FT(N,d),k=y.createHref(N);o.replaceState(S,"",k),i&&u&&u({action:l,location:y.location,delta:0})}function b(x){let j=a.location.origin!=="null"?a.location.origin:a.location.href,N=typeof x=="str
49ing"?x:gg(x);return N=N.replace(/ $/,"%20"),gr(j,"No window.location.(origin|href) available to create URL for href: "+N),new URL(N,j)}let y={get action(){return l},get location(){return t(a,o)},listen(x){if(u)throw new Error("A history only accepts one active listener");return a.addEventListener(LT,m),u=x,()=>{a.removeEventListener(LT,m),u=null}},createHref(x){return e(a,x)},createURL:b,encodeLocation(x){let j=b(x);return{pathname:j.pathname,search:j.search,hash:j.hash}},push:p,replace:v,go(x){return o.go(x)}};return y}var BT;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(BT||(BT={}));function HG(t,e,r){return r===void 0&&(r="/"),GG(t,e,r)}function GG(t,e,r,n){let a=typeof e=="string"?Uu(e):e,i=K2(a.pathname||"/",r);if(i==null)return null;let o=QL(t);KG(o);let l=null;for(let u=0;l==null&&u<o.length;++u){let d=iK(i);l=nK(o[u],d)}return l}function QL(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let a=(i,o,l)=>{let u={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};u.relativePath.startsWith("/")&&(gr(u.relativePath.startsWith(n),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(n.length));let d=io([n,u.relativePath]),h=r.concat(u);i.children&&i.children.length>0&&(gr(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),QL(i.children,e,h,d)),!(i.path==null&&!i.index)&&e.push({path:d,score:tK(d,i.index),routesMeta:h})};return t.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let u of JL(i.path))a(i,o,u)}),e}function JL(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=JL(n.join("/")),l=[];return l.push(...o.map(u=>u===""?i:[i,u].join("/"))),a&&l.push(...o),l.map(u=>t.startsWith("/")&&u===""?"/":u)}function KG(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:rK(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const YG=/^:[\w-]+$/,XG=3,ZG=2,QG=1,JG=10,eK=-2,VT=t=>t==="*";function tK(t,e){let r=t.split("/"),n=r.length;return r.some(VT)&&(n+=eK),e&&(n+=ZG),r.filter(a=>!VT(a)).reduce((a,i)=>a+(YG.test(i)?XG:i===""?QG:JG),n)}function rK(t,e){return t.length===e.length&&t.slice(0,-1).every((n,a)=>n===e[a])?t[t.length-1]-e[e.length-1]:0}function nK(t,e,r){let{routesMeta:n}=t,a={},i="/",o=[];for(let l=0;l<n.length;++l){let u=n[l],d=l===n.length-1,h=i==="/"?e:e.slice(i.length)||"/",m=aK({path:u.relativePath,caseSensitive:u.caseSensitive,end:d},h),p=u.route;if(!m)return null;
vendor: 4,204 bytes, lines 49-57
49Object.assign(a,m.params),o.push({params:a,pathname:io([i,m.pathname]),pathnameBase:dK(io([i,m.pathnameBase])),route:p}),m.pathnameBase!=="/"&&(i=io([i,m.pathnameBase]))}return o}function aK(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=sK(t.path,t.caseSensitive,t.end),a=e.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((d,h,m)=>{let{paramName:p,isOptional:v}=h;if(p==="*"){let y=l[m]||"";o=i.slice(0,i.length-y.length).replace(/(.)\/+$/,"$1")}const b=l[m];return v&&!b?d[p]=void 0:d[p]=(b||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:t}}function sK(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),G2(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,u)=>(n.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),n]}function iK(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return G2(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function K2(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}const oK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lK=t=>oK.test(t);function cK(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:a=""}=typeof t=="string"?Uu(t):t,i;if(r)if(lK(r))i=r;else{if(r.includes("//")){let o=r;r=r.replace(/\/\/+/g,"/"),G2(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+r))}r.startsWith("/")?i=zT(r.substring(1),"/"):i=zT(r,e)}else i=e;return{pathname:i,search:fK(n),hash:hK(a)}}function zT(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function sb(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function uK(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Y2(t,e){let r=uK(t);return e?r.map((n,a)=>a===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function X2(t,e,r,n){n===void 0&&(n=!1);let a;typeof t=="string"?a=Uu(t):(a=Df({},t),gr(!a.pathname||!a.pathname.includes("?"),sb("?","pathname","search",a)),gr(!a.pathname||!a.pathname.includes("#"),sb("#","pathname","hash",a)),gr(!a.search||!a.search.includes("#"),sb("#","search","hash",a)));let i=t===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=r;else{let m=e.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),m-=1;a.pathname=p.join("/")}l=m>=0?e[m]:"/"}let u=cK(a,l),d=o&&o!=="/"&&o.endsWith("/"),h=(i||o===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(d||h)&&(u.pathname+="/"),u}const io=t=>t.join("/").replace(/\/\/+/g,"/"),dK=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),fK=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,hK=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function mK(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const e8=["post","put","patch","delete"];new Set(e8);const pK=["get",...e8];new Set(pK);/** 50 * React Router v6.30.2 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 $f(){return $f=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},$f.apply(this,arguments)}const Z2=w.createContext(null),gK=w.createContext(null),jo=w.createContext(null),Qv=w.createContext(null),yi=w.createContext({outlet:null,matches:[],isDataRoute:!1}),t8=w.createContext(null);function vK(t,e){let{relative:r}=e===void 0?{}:e;qu()||gr(!1);let{basename:n,navigator:a}=w.useContext(jo),{hash:i,pathname:o,search:l}=s8(t,{relative:r}),u=o;return n!=="/"&&(u=o==="/"?n:io([n,o])),a.createHref({pathname:u,search:l,hash:i})}function qu(){return w.useContext(Qv)!=null}function Vl(){return qu()||gr(!1),w.useContext(Qv).location}function r8(t){w.useContext(jo).static||w.useLayoutEffect(t)}function Wu(){let{isDataRoute:t}=w.useContext(yi);return t?TK():xK()}function xK(){qu()||gr(!1);let t=w.useContext(Z2),{basename:e,future:r,navigator:n}=w.useContext(jo),{matches:a}=w.useContext(yi),{pathname:i}=Vl(),o=JSON.stringify(Y2(a,r.v7_relativeSplatPath)),l=w.useRef(!1);return r8(()=>{l.current=!0}),w.useCallback(function(d,h){if(h===void 0&&(h={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=X2(d,JSON.parse(o),i,h.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:io([e,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[e,n,o,i,t])}const n8=w.createContext(null);function a8(){return w.useContext(n8)}function yK(t){let e=w.useContext(yi).outlet;return e&&w.createElement(n8.Provider,{value:t},e)}function s8(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=w.useContext(jo),{matches:a}=w.useContext(yi),{pathname:i}=Vl(),o=JSON.stringify(Y2(a,n.v7_relativeSplatPath));return w.useMemo(()=>X2(t,JSON.parse(o),i,r==="path"),[t,o,i,r])}function bK(t,e){return wK(t,e)}function wK(t,e,r,n){qu()||gr(!1);let{navigator:a}=w.useContext(jo),{matches:i}=w.useContext(yi),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let u=o?o.pathnameBase:"/";o&&o.route;let d=Vl(),h;if(e){var m;let x=typeof e=="string"?Uu(e):e;u==="/"||(m=x.pathname)!=null&&m.startsWith(u)||gr(!1),h=x}else h=d;let p=h.pathname||"/",v=p;if(u!=="/"){let x=u.replace(/^\//,"").split("/");v="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let b=HG(t,{pathname:v}),y=CK(b&&b.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:io([u,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:io([u,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,r,n);return e&&y?w.createElement(Qv.Provider,{value:{location:$f({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:no.Pop}},y):y}function _K(){let t=PK(),e=mK(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},e),r?w.createElement("pre",{style:a},r):null,null)}const jK=w.createElement(_K,null);class NK extends w.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?w.createElement(yi.Provider,{value:this.props.routeContext},w.createElement(t8.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function SK(t){let{routeContext:e,match:r,children:n}=t,a=w.useContext(Z2);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),w.createElement(yi.Provider,{value:e},n)}function CK(t,e,r,n){var a;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var i;if(!r)return null;if(r.errors)t=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,l=(a=r)==null?void 0:a.errors;if(l!=null){let h=o.findIndex(m=>m.route.id&&(l==null?void 0:l[m.route.id])!==void 0);h>=0||gr(!1),o=o.slice(0,Math.min(o.length,h+1))}let u=!1,d=-1;if(r&&n&&n.v7_partialHydration)for(let h=0;h<o.length;h++){let m=o[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=h),m.route.id){let{loaderData:p,errors:v}=r,b=m.route.loader&&p[m.route.id]===void 0&&(!v||v[m.route.id]===void 0);if(m.route.lazy||b){u=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((h,m,p)=>{let v,b=!1,y=null,x=null;r&&(v=l&&m.route.id?l[m.route.id]:void 0,y=m.route.errorElement||jK,u&&(d<0&&p===0?(OK("route-fallback"),b=!0,x=null):d===p&&(b=!0,x=m.route.hydrateFallbackElement||null)));let j=e.concat(o.slice(0,p+1)),N=()=>{let S;return v?S=y:b?S=x:m.route.Component?S=w.createElement(m.route.Component,null):m.route.element?S=m.route.element:S=h,w.createElement(SK,{match:m,routeContext:{outlet:h,matches:j,isDataRoute:r!=null},children:S})};return r&&(m.route.ErrorBoundary||m.route.errorElement||p===0)?w.createElement(NK,{location:r.location,revalidation:r.revalidation,component:y,error:v,children:N(),routeC
58ontext:{outlet:null,matches:j,isDataRoute:!0}}):N()},null)}var i8=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(i8||{}),o8=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(o8||{});function kK(t){let e=w.useContext(Z2);return e||gr(!1),e}function EK(t){let e=w.useContext(gK);return e||gr(!1),e}function AK(t){let e=w.useContext(yi);return e||gr(!1),e}function l8(t){let e=AK(),r=e.matches[e.matches.length-1];return r.route.id||gr(!1),r.route.id}function PK(){var t;let e=w.useContext(t8),r=EK(),n=l8();return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function TK(){let{router:t}=kK(i8.UseNavigateStable),e=l8(o8.UseNavigateStable),r=w.useRef(!1);return r8(()=>{r.current=!0}),w.useCallback(function(a,i){i===void 0&&(i={}),r.current&&(typeof a=="number"?t.navigate(a):t.navigate(a,$f({fromRouteId:e},i)))},[t,e])}const UT={};function OK(t,e,r){UT[t]||(UT[t]=!0)}function MK(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Jv(t){let{to:e,replace:r,state:n,relative:a}=t;qu()||gr(!1);let{future:i,static:o}=w.useContext(jo),{matches:l}=w.useContext(yi),{pathname:u}=Vl(),d=Wu(),h=X2(e,Y2(l,i.v7_relativeSplatPath),u,a==="path"),m=JSON.stringify(h);return w.useEffect(()=>d(JSON.parse(m),{replace:r,state:n,relative:a}),[d,m,a,r,n]),null}function RK(t){return yK(t.context)}function Wr(t){gr(!1)}function IK(t){let{basename:e="/",children:r=null,location:n,navigationType:a=no.Pop,navigator:i,static:o=!1,future:l}=t;qu()&&gr(!1);let u=e.replace(/^\/*/,"/"),d=w.useMemo(()=>({basename:u,navigator:i,static:o,future:$f({v7_relativeSplatPath:!1},l)}),[u,l,i,o]);typeof n=="string"&&(n=Uu(n));let{pathname:h="/",search:m="",hash:p="",state:v=null,key:b="default"}=n,y=w.useMemo(()=>{let x=K2(h,u);return x==null?null:{location:{pathname:x,search:m,hash:p,state:v,key:b},navigationType:a}},[u,h,m,p,v,b,a]);return y==null?null:w.createElement(jo.Provider,{value:d},w.createElement(Qv.Provider,{children:r,value:y}))}function DK(t){let{children:e,location:r}=t;return bK(aN(e),r)}new Promise(()=>{});function aN(t,e){e===void 0&&(e=[]);let r=[];return w.Children.forEach(t,(n,a)=>{if(!w.isValidElement(n))return;let i=[...e,a];if(n.type===w.Fragment){r.push.apply(r,aN(n.props.children,i));return}n.type!==Wr&&gr(!1),!n.props.index||!n.props.children||gr(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=aN(n.props.children,i)),r.push(o)}),r}/** 59 * React Router DOM v6.30.2 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 sN(){return sN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sN.apply(this,arguments)}function $K(t,e){if(t==null)return{};var r={},n=Object.keys(t),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(r[a]=t[a]);return r}function LK(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function FK(t,e){return t.button===0&&(!e||e==="_self")&&!LK(t)}const BK=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],VK="6";try{window.__reactRouterVersion=VK}catch{}const zK="startTransition",qT=Zv[zK];function UK(t){let{basename:e,children:r,future:n,window:a}=t,i=w.useRef();i.current==null&&(i.current=UG({window:a,v5Compat:!0}));let o=i.current,[l,u]=w.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},h=w.useCallback(m=>{d&&qT?qT(()=>u(m)):u(m)},[u,d]);return w.useLayoutEffect(()=>o.listen(h),[o,h]),w.useEffect(()=>
67MK(n),[n]),w.createElement(IK,{basename:e,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const qK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",WK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Q2=w.forwardRef(function(e,r){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:u,to:d,preventScrollReset:h,viewTransition:m}=e,p=$K(e,BK),{basename:v}=w.useContext(jo),b,y=!1;if(typeof d=="string"&&WK.test(d)&&(b=d,qK))try{let S=new URL(window.location.href),k=d.startsWith("//")?new URL(S.protocol+d):new URL(d),C=K2(k.pathname,v);k.origin===S.origin&&C!=null?d=C+k.search+k.hash:y=!0}catch{}let x=vK(d,{relative:a}),j=HK(d,{replace:o,state:l,target:u,preventScrollReset:h,relative:a,viewTransition:m});function N(S){n&&n(S),S.defaultPrevented||j(S)}return w.createElement("a",sN({},p,{href:b||x,onClick:y||i?n:N,ref:r,target:u}))});var WT;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(WT||(WT={}));var HT;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(HT||(HT={}));function HK(t,e){let{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=e===void 0?{}:e,u=Wu(),d=Vl(),h=s8(t,{relative:o});return w.useCallback(m=>{if(FK(m,r)){m.preventDefault();let p=n!==void 0?n:gg(d)===gg(h);u(t,{replace:p,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,u,h,n,a,r,t,i,o,l])}/** 68 * @license lucide-react v0.462.0 - ISC 69 * 70 * This source code is licensed under the ISC license. 71 * See the LICENSE file in the root directory of this source tree. 72 */const GK=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),c8=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim();/** 73 * @license lucide-react v0.462.0 - ISC 74 * 75 * This source code is licensed under the ISC license. 76 * See the LICENSE file in the root directory of this source tree. 77 */var KK={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 78 * @license lucide-react v0.462.0 - ISC 79 * 80 * This source code is licensed under the ISC license. 81 * See the LICENSE file in the root directory of this source tree. 82 */const YK=w.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},u)=>w.createElement("svg",{ref:u,...KK,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:c8("lucide",a),...l},[...o.map(([d,h])=>w.createElement(d,h)),...Array.isArray(i)?i:[i]]));/** 83 * @license lucide-react v0.462.0 - ISC 84 * 85 * This source code is licensed under the ISC license. 86 * See the LICENSE file in the root directory of this source tree. 87 */const _e=(t,e)=>{const r=w.forwardRef(({className:n,...a},i)=>w.createElement(YK,{ref:i,iconNode:e,className:c8(`lucide-${GK(t)}`,n),...a}));return r.displayName=`${t}`,r};/** 88 * @license lucide-react v0.462.0 - ISC 89 * 90 * This source code is licensed under the ISC license. 91 * See the LICENSE file in the root directory of this source tree. 92 */const XK=_e("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 93 * @license lucide-react v0.462.0 - ISC 94 * 95 * This source code is licensed under the ISC license. 96 * See the LICENSE file in the root directory of this source tree. 97 */const GT=_e("AlignLeft",[["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 18H3",key:"1amg6g"}],["path",{d:"M21 6H3",key:"1jwq7v"}]]);/** 98 * @license lucide-react v0.462.0 - ISC 99 * 100 * This source code is licensed under the ISC license. 101 * See the LICENSE file in the root directory of this source tree. 102 */const u8=_e("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 103 * @license lucide-react v0.462.0 - ISC 104 * 105 * This source code is licensed under the ISC license. 106 * See the LICENSE file in the root directory of this source tree. 107 */const ZK=_e("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** 108 * @license lucide-react v0.462.0 - ISC 109 * 110 * This source code is licensed under the ISC license. 111 * See the LICENSE file in the root directory of this source tree. 112 */const QK=_e("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 113 * @license lucide-react v0.462.0 - ISC 114 * 115 * This source code is licensed under the ISC license. 116 * See the LICENSE file in the root directory of this source tree. 117 */const Or=_e("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 118 * @license lucide-react v0.462.0 - ISC 119 * 120 * This source code is licensed under the ISC license. 121 * See the LICENSE file in the root directory of this source tree. 122 */const d8=_e("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** 123 * @license lucide-react v0.462.0 - ISC 124 * 125 * This source code is licensed under the ISC license. 126 * See the LICENSE file in the root directory of this source tree. 127 */const Lf=_e("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
127],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 128 * @license lucide-react v0.462.0 - ISC 129 * 130 * This source code is licensed under the ISC license. 131 * See the LICENSE file in the root directory of this source tree. 132 */const f8=_e("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** 133 * @license lucide-react v0.462.0 - ISC 134 * 135 * This source code is licensed under the ISC license. 136 * See the LICENSE file in the root directory of this source tree. 137 */const JK=_e("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/** 138 * @license lucide-react v0.462.0 - ISC 139 * 140 * This source code is licensed under the ISC license. 141 * See the LICENSE file in the root directory of this source tree. 142 */const eY=_e("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 143 * @license lucide-react v0.462.0 - ISC 144 * 145 * This source code is licensed under the ISC license. 146 * See the LICENSE file in the root directory of this source tree. 147 */const Ya=_e("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 148 * @license lucide-react v0.462.0 - ISC 149 * 150 * This source code is licensed under the ISC license. 151 * See the LICENSE file in the root directory of this source tree. 152 */const KT=_e("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 153 * @license lucide-react v0.462.0 - ISC 154 * 155 * This source code is licensed under the ISC license. 156 * See the LICENSE file in the root directory of this source tree. 157 */const YT=_e("CheckCheck",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);/** 158 * @license lucide-react v0.462.0 - ISC 159 * 160 * This source code is licensed under the ISC license. 161 * See the LICENSE file in the root directory of this source tree. 162 */const ci=_e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 163 * @license lucide-react v0.462.0 - ISC 164 * 165 * This source code is licensed under the ISC license. 166 * See the LICENSE file in the root directory of this source tree. 167 */const Ga=_e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 168 * @license lucide-react v0.462.0 - ISC 169 * 170 * This source code is licensed under the ISC license. 171 * See the LICENSE file in the root directory of this source tree. 172 */const e0=_e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** 173 * @license lucide-react v0.462.0 - ISC 174 * 175 * This source code is licensed under the ISC license. 176 * See the LICENSE file in the root directory of this source tree. 177 */const t0=_e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 178 * @license lucide-react v0.462.0 - ISC 179 * 180 * This source code is licensed under the ISC license. 181 * See the LICENSE file in the root directory of this source tree. 182 */const h8=_e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 183 * @license lucide-react v0.462.0 - ISC 184 * 185 * This source code is licensed under the ISC license. 186 * See the LICENSE file in the root directory of this source tree. 187 */const tY=_e("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/** 188 * @license lucide-react v0.462.0 - ISC 189 * 190 * This source code is licensed under the ISC license. 191 * See the LICENSE file in the root directory of this source tree. 192 */const vg=_e("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 193 * @license lucide-react v0.462.0 - ISC 194 * 195 * This source code is licensed under the ISC license. 196 * See the LICENSE file in the root directory of this source tree. 197 */const Lr=_e("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 198 * @license lucide-react v0.462.0 - ISC 199 * 200 * This source code is licensed under the ISC license. 201 * See the LICENSE file in the root directory of this source tree. 202 */const rY=_e("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 203 * @license lucide-react v0.462.0 - ISC 204 * 205 * This source code is licensed under the ISC license. 206 * See the LICENSE file in the root directory of this source tree. 207 */const ib=_e("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/** 208 * @license lucide-react v0.462.0 - ISC 209 * 210 * This source code is licensed under the ISC license. 211 * See the LICENSE file in the root directory of this source tree. 212 */const au=_e("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 213 * @license lucide-react v0.462.0 - ISC 214 * 215 * This source code is licensed under the ISC license. 216 * See the LICENSE file in the root directory of this source tree. 217 */const m8=_e("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** 218 * @license lucide-react v0.462.0 - ISC 219 * 220 * This source code is licensed under the ISC license. 221 * See the LICENSE file in the root directory of this source tree. 222 */const oo=_e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 223 * @license lucide-react v0.462.0 - ISC 224 * 225 * This source code is licensed under the ISC license. 226 * See the LICENSE file in the root directory of this source tree. 227 */const nY=_e("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/** 228 * @license lucide-react v0.462.0 - ISC 229 * 230 * This source code is licensed under the ISC license. 231 * See the LICENSE file in the root directory of this source tree. 232 */const aY=_e("ContactRound",[["path",{d:"M16 2v2",key:"scm5qe"}],["path",{d:"M17.915 22a6 6 0 0 0-12 0",key:"suqz9p"}
232],["path",{d:"M8 2v2",key:"pbkmx"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["rect",{x:"3",y:"4",width:"18",height:"18",rx:"2",key:"12vinp"}]]);/** 233 * @license lucide-react v0.462.0 - ISC 234 * 235 * This source code is licensed under the ISC license. 236 * See the LICENSE file in the root directory of this source tree. 237 */const iN=_e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 238 * @license lucide-react v0.462.0 - ISC 239 * 240 * This source code is licensed under the ISC license. 241 * See the LICENSE file in the root directory of this source tree. 242 */const sY=_e("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}
242],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** 243 * @license lucide-react v0.462.0 - ISC 244 * 245 * This source code is licensed under the ISC license. 246 * See the LICENSE file in the root directory of this source tree. 247 */const p8=_e("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 248 * @license lucide-react v0.462.0 - ISC 249 * 250 * This source code is licensed under the ISC license. 251 * See the LICENSE file in the root directory of this source tree. 252 */const yl=_e("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/** 253 * @license lucide-react v0.462.0 - ISC 254 * 255 * This source code is licensed under the ISC license. 256 * See the LICENSE file in the root directory of this source tree. 257 */const g8=_e("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 258 * @license lucide-react v0.462.0 - ISC 259 * 260 * This source code is licensed under the ISC license. 261 * See the LICENSE file in the root directory of this source tree. 262 */const v8=_e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 263 * @license lucide-react v0.462.0 - ISC 264 * 265 * This source code is licensed under the ISC license. 266 * See the LICENSE file in the root directory of this source tree. 267 */const iY=_e("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/** 268 * @license lucide-react v0.462.0 - ISC 269 * 270 * This source code is licensed under the ISC license. 271 * See the LICENSE file in the root directory of this source tree. 272 */const x8=_e("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** 273 * @license lucide-react v0.462.0 - ISC 274 * 275 * This source code is licensed under the ISC license. 276 * See the LICENSE file in the root directory of this source tree. 277 */const Qi=_e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 278 * @license lucide-react v0.462.0 - ISC 279 * 280 * This source code is licensed under the ISC license. 281 * See the LICENSE file in the root directory of this source tree. 282 */const oN=_e("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 283 * @license lucide-react v0.462.0 - ISC 284 * 285 * This source code is licensed under the ISC license. 286 * See the LICENSE file in the root directory of this source tree. 287 */const su=_e("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 288 * @license lucide-react v0.462.0 - ISC 289 * 290 * This source code is licensed under the ISC license. 291 * See the LICENSE file in the root directory of this source tree. 292 */const ob=_e("FileAudio",[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]]);/** 293 * @license lucide-react v0.462.0 - ISC 294 * 295 * This source code is licensed under the ISC license. 296 * See the LICENSE file in the root directory of this source tree. 297 */const XT=_e("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",ke
297y:"1mlx9k"}]]);/** 298 * @license lucide-react v0.462.0 - ISC 299 * 300 * This source code is licensed under the ISC license. 301 * See the LICENSE file in the root directory of this source tree. 302 */const ZT=_e("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 303 * @license lucide-react v0.462.0 - ISC 304 * 305 * This source code is licensed under the ISC license. 306 * See the LICENSE file in the root directory of this source tree. 307 */const oY=_e("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/** 308 * @license lucide-react v0.462.0 - ISC 309 * 310 * This source code is licensed under the ISC license. 311 * See the LICENSE file in the root directory of this source tree. 312 */const lY=_e("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/** 313 * @license lucide-react v0.462.0 - ISC 314 * 315 * This source code is licensed under the ISC license. 316 * See the LICENSE file in the root directory of this source tree. 317 */const cY=_e("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 318 * @license lucide-react v0.462.0 - ISC 319 * 320 * This source code is licensed under the ISC license. 321 * See the LICENSE file in the root directory of this source tree. 322 */const uY=_e("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** 323 * @license lucide-react v0.462.0 - ISC 324 * 325 * This source code is licensed under the ISC license. 326 * See the LICENSE file in the root directory of this source tree. 327 */const Js=_e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 328 * @license lucide-react v0.462.0 - ISC 329 * 330 * This source code is licensed under the ISC license. 331 * See the LICENSE file in the root directory of this source tree. 332 */const dY=_e("Kanban",[["path",{d:"M6 5v11",key:"mdvv1e"}],["path",{d:"M12 5v6",key:"14ar3b"}],["path",{d:"M18 5v14",key:"7ji314"}]]);/** 333 * @license lucide-react v0.462.0 - ISC 334 * 335 * This source code is licensed under the ISC license. 336 * See the LICENSE file in the root directory of this source tree. 337 */const y8=_e("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** 338 * @license lucide-react v0.462.0 - ISC 339 * 340 * This source code is licensed under the ISC license. 341 * See the LICENSE file in the root directory of this source tree. 342 */const lN=_e("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** 343 * @license lucide-react v0.462.0 - ISC 344 * 345 * This source code is licensed under the ISC license. 346 * See the LICENSE file in the root directory of this source tree. 347 */const b8=_e("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 348 * @license lucide-react v0.462.0 - ISC 349 * 350 * This source code is licensed under the ISC license. 351 * See the LICENSE file in the root directory of this source tree.
352 */const fY=_e("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 353 * @license lucide-react v0.462.0 - ISC 354 * 355 * This source code is licensed under the ISC license. 356 * See the LICENSE file in the root directory of this source tree. 357 */const hY=_e("LayoutGrid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]);/** 358 * @license lucide-react v0.462.0 - ISC 359 * 360 * This source code is licensed under the ISC license. 361 * See the LICENSE file in the root directory of this source tree. 362 */const mY=_e("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** 363 * @license lucide-react v0.462.0 - ISC 364 * 365 * This source code is licensed under the ISC license. 366 * See the LICENSE file in the root directory of this source tree. 367 */const pY=_e("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** 368 * @license lucide-react v0.462.0 - ISC 369 * 370 * This source code is licensed under the ISC license. 371 * See the LICENSE file in the root directory of this source tree. 372 */const gt=_e("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 373 * @license lucide-react v0.462.0 - ISC 374 * 375 * This source code is licensed under the ISC license. 376 * See the LICENSE file in the root directory of this source tree. 377 */const xg=_e("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 378 * @license lucide-react v0.462.0 - ISC 379 * 380 * This source code is licensed under the ISC license. 381 * See the LICENSE file in the root directory of this source tree. 382 */const gY=_e("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 383 * @license lucide-react v0.462.0 - ISC 384 * 385 * This source code is licensed under the ISC license. 386 * See the LICENSE file in the root directory of this source tree. 387 */const iu=_e("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 388 * @license lucide-react v0.462.0 - ISC 389 * 390 * This source code is licensed under the ISC license. 391 * See the LICENSE file in the root directory of this source tree. 392 */const vY=_e("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 393 * @license lucide-react v0.462.0 - ISC 394 * 395 * This source code is licensed under the ISC license. 396 * See the LICENSE file in the root directory of this source tree. 397 */const xY=_e("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 398 * @license lucide-react v0.462.0 - ISC 399 * 400 * This source code is licensed under the ISC license. 401 * See the LICENSE file in the root directory of this source tree. 402 */const w8=_e("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 403 * @license lucide-react v0.462.0 - ISC 404 * 405 * This source code is licensed under the ISC license. 406 * See the LICENSE file in the root directory of this source tree. 407 */const Tn=_e("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 408 * @license lucide-react v0.462.0 - ISC 409 * 410 * This source code is licensed under the ISC license. 411 * See the LICENSE file in the root directory of this source tree. 412 */const Ff=_e("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 413 * @license lucide-react v0.462.0 - ISC 414 * 415 * This source code is licensed under the ISC license. 416 * See the LICENSE file in the root directory of this source tree. 417 */const yY=_e("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** 418 * @license lucide-react v0.462.0 - ISC 419 * 420 * This source code is licensed under the ISC license. 421 * See the LICENSE file in the root directory of this source tree. 422 */const bY=_e("Navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);/** 423 * @license lucide-react v0.462.0 - ISC 424 * 425 * This source code is licensed under the ISC license. 426 * See the LICENSE file in the root directory of this source tree. 427 */const wY=_e("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/** 428 * @license lucide-react v0.462.0 - ISC 429 * 430 * This source code is licensed under the ISC license. 431 * See the LICENSE file in the root directory of this source tree. 432 */const _Y=_e("PanelsTopLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]]);/** 433 * @license lucide-react v0.462.0 - ISC 434 * 435 * This source code is licensed under the ISC license. 436 * See the LICENSE file in the root directory of this source tree. 437 */const _8=_e("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** 438 * @license lucide-react v0.462.0 - ISC 439 * 440 * This source code is licensed under the ISC license. 441 * See the LICENSE file in the root directory of this source tree. 442 */const lb=_e("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/** 443 * @license lucide-react v0.462.0 - ISC 444 * 445 * This source code is licensed under the ISC license. 446 * See the LICENSE file in the root directory of this source tree. 447 */const cN=_e("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/** 448 * @license lucide-react v0.462.0 - ISC 449 * 450 * This source code is licensed under the ISC license. 451 * See the LICENSE file in the root directory of this source tree. 452 */const yg=_e("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 453 * @license lucide-react v0.462.0 - ISC 454 * 455 * This source code is licensed under the ISC license. 456 * See the LICENSE file in the root directory of this source tree. 457 */const Hu=_e("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 458 * @license lucide-react v0.462.0 - ISC 459 * 460 * This source code is licensed under the ISC license. 461 * See the LICENSE file in the root directory of this source tree. 462 */const j8=_e("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 463 * @license lucide-react v0.462.0 - ISC 464 * 465 * This source code is licensed under the ISC license. 466 * See the LICENSE file in the root directory of this source tree. 467 */const jY=_e("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}
467],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** 468 * @license lucide-react v0.462.0 - ISC 469 * 470 * This source code is licensed under the ISC license. 471 * See the LICENSE file in the root directory of this source tree. 472 */const ts=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 473 * @license lucide-react v0.462.0 - ISC 474 * 475 * This source code is licensed under the ISC license. 476 * See the LICENSE file in the root directory of this source tree. 477 */const lo=_e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** 478 * @license lucide-react v0.462.0 - ISC 479 * 480 * This source code is licensed under the ISC license. 481 * See the LICENSE file in the root directory of this source tree. 482 */const uN=_e("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);/** 483 * @license lucide-react v0.462.0 - ISC 484 * 485 * This source code is licensed under the ISC license. 486 * See the LICENSE file in the root directory of this source tree. 487 */const N8=_e("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/** 488 * @license lucide-react v0.462.0 - ISC 489 * 490 * This source code is licensed under the ISC license. 491 * See the LICENSE file in the root directory of this source tree. 492 */const dN=_e("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 493 * @license lucide-react v0.462.0 - ISC 494 * 495 * This source code is licensed under the ISC license. 496 * See the LICENSE file in the root directory of this source tree. 497 */const Gu=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 498 * @license lucide-react v0.462.0 - ISC 499 * 500 * This source code is licensed under the ISC license. 501 * See the LICENSE file in the root directory of this source tree. 502 */const ou=_e("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 503 * @license lucide-react v0.462.0 - ISC 504 * 505 * This source code is licensed under the ISC license. 506 * See the LICENSE file in the root directory of this source tree. 507 */const QT=_e("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** 508 * @license lucide-react v0.462.0 - ISC 509 * 510 * This source code is licensed under the ISC license. 511 * See the LICENSE file in the root directory of this source tree. 512 */const NY=_e("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** 513 * @license lucide-react v0.462.0 - ISC 514 * 515 * This source code is licensed under the ISC license. 516 * See the LICENSE file in the root directory of this source tree. 517 */const r0=_e("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 518 * @license lucide-react v0.462.0 - ISC 519 * 520 * This source code is licensed under the ISC license. 521 * See the LICENSE file in the root directory of this source tree. 522 */const n0=_e("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
522y:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 523 * @license lucide-react v0.462.0 - ISC 524 * 525 * This source code is licensed under the ISC license. 526 * See the LICENSE file in the root directory of this source tree. 527 */const S8=_e("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 528 * @license lucide-react v0.462.0 - ISC 529 * 530 * This source code is licensed under the ISC license. 531 * See the LICENSE file in the root directory of this source tree. 532 */const SY=_e("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/** 533 * @license lucide-react v0.462.0 - ISC 534 * 535 * This source code is licensed under the ISC license. 536 * See the LICENSE file in the root directory of this source tree. 537 */const CY=_e("Smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);/** 538 * @license lucide-react v0.462.0 - ISC 539 * 540 * This source code is licensed under the ISC license. 541 * See the LICENSE file in the root directory of this source tree. 542 */const kY=_e("Smile",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);/** 543 * @license lucide-react v0.462.0 - ISC 544 * 545 * This source code is licensed under the ISC license. 546 * See the LICENSE file in the root directory of this source tree. 547 */const C8=_e("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 548 * @license lucide-react v0.462.0 - ISC 549 * 550 * This source code is licensed under the ISC license. 551 * See the LICENSE file in the root directory of this source tree. 552 */const EY=_e("SquareCheckBig",[["path",{d:"M21 10.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.5",key:"1uzm8b"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 553 * @license lucide-react v0.462.0 - ISC 554 * 555 * This source code is licensed under the ISC license. 556 * See the LICENSE file in the root directory of this source tree. 557 */const lu=_e("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/** 558 * @license lucide-react v0.462.0 - ISC 559 * 560 * This source code is licensed under the ISC license. 561 * See the LICENSE file in the root directory of this source tree. 562 */const AY=_e("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 563 * @license lucide-react v0.462.0 - ISC 564 * 565 * This source code is licensed under the ISC license. 566 * See the LICENSE file in the root directory of this source tree. 567 */const k8=_e("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** 568 * @license lucide-react v0.462.0 - ISC 569 * 570 * This source code is licensed under the ISC license. 571 * See the LICENSE file in the root directory of this source tree. 572 */const cu=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}
572],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 573 * @license lucide-react v0.462.0 - ISC 574 * 575 * This source code is licensed under the ISC license. 576 * See the LICENSE file in the root directory of this source tree. 577 */const PY=_e("TrendingDown",[["polyline",{points:"22 17 13.5 8.5 8.5 13.5 2 7",key:"1r2t7k"}],["polyline",{points:"16 17 22 17 22 11",key:"11uiuu"}]]);/** 578 * @license lucide-react v0.462.0 - ISC 579 * 580 * This source code is licensed under the ISC license. 581 * See the LICENSE file in the root directory of this source tree. 582 */const TY=_e("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 583 * @license lucide-react v0.462.0 - ISC 584 * 585 * This source code is licensed under the ISC license. 586 * See the LICENSE file in the root directory of this source tree. 587 */const ei=_e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 588 * @license lucide-react v0.462.0 - ISC 589 * 590 * This source code is licensed under the ISC license. 591 * See the LICENSE file in the root directory of this source tree. 592 */const OY=_e("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 593 * @license lucide-react v0.462.0 - ISC 594 * 595 * This source code is licensed under the ISC license. 596 * See the LICENSE file in the root directory of this source tree. 597 */const MY=_e("UserCog",[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]]);/** 598 * @license lucide-react v0.462.0 - ISC 599 * 600 * This source code is licensed under the ISC license. 601 * See the LICENSE file in the root directory of this source tree. 602 */const bg=_e("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 603 * @license lucide-react v0.462.0 - ISC 604 * 605 * This source code is licensed under the ISC license. 606 * See the LICENSE file in the root directory of this source tree. 607 */const E8=_e("UserRoundCog",[["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"m19.5 14.3-.4.9",key:"1eb35c"}],["path",{d:"m16.9 20.8-.4.9",key:"dfjc4z"}],["path",{d:"m21.7 19.5-.9-.4",key:"q4dx6b"}],["path",{d:"m15.2 16.9-.9-.4",key:"1r0w5f"}],["path",{d:"m21.7 16.5-.9.4",key:"1knoei"}],["path",{d:"m15.2 19.1-.9.4",key:"j188fs"}],["path",{d:"m19.5 21.7-.4-.9",key:"1tonu5"}],["path",{d:"m16.9 15.2-.4-.9",key:"699xu"}]]);/** 608 * @license lucide-react v0.462.0 - ISC 609 * 610 * This source code is licensed under the ISC license. 611 * See the LICENSE file in the root directory of this source tree. 612 */const mn=_e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 613 * @license lucide-react v0.462.0 - ISC 614 * 615 * This source code is licensed under the ISC license. 616 * See the LICENSE file in the root directory of this source tree. 617 */const fo=_e("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 618 * @license lucide-react v0.462.0 - ISC 619 * 620 * This source code is licensed under the ISC license. 621 * See the LICENSE file in the root directory of this source tree.
622 */const RY=_e("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 623 * @license lucide-react v0.462.0 - ISC 624 * 625 * This source code is licensed under the ISC license. 626 * See the LICENSE file in the root directory of this source tree. 627 */const sg=_e("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/** 628 * @license lucide-react v0.462.0 - ISC 629 * 630 * This source code is licensed under the ISC license. 631 * See the LICENSE file in the root directory of this source tree. 632 */const wg=_e("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/** 633 * @license lucide-react v0.462.0 - ISC 634 * 635 * This source code is licensed under the ISC license. 636 * See the LICENSE file in the root directory of this source tree. 637 */const Xn=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 638 * @license lucide-react v0.462.0 - ISC 639 * 640 * This source code is licensed under the ISC license. 641 * See the LICENSE file in the root directory of this source tree. 642 */const Yd=_e("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]);
vendor: 1,978 bytes, line 642
642var fN=function(t,e){return fN=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},fN(t,e)};function A8(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");fN(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var xa=function(){return xa=Object.assign||function(e){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},xa.apply(this,arguments)};function No(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r}function P8(t,e,r,n){var a=arguments.length,i=a<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,n);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(i=(a<3?o(i):a>3?o(e,r,i):o(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i}function T8(t,e){return function(r,n){e(r,n,t)}}function O8(t,e,r,n,a,i){function o(j){if(j!==void 0&&typeof j!="function")throw new TypeError("Function expected");return j}for(var l=n.kind,u=l==="getter"?"get":l==="setter"?"set":"value",d=!e&&t?n.static?t:t.prototype:null,h=e||(d?Object.getOwnPropertyDescriptor(d,n.name):{}),m,p=!1,v=r.length-1;v>=0;v--){var b={};for(var y in n)b[y]=y==="access"?{}:n[y];for(var y in n.access)b.access[y]=n.access[y];b.addInitializer=function(j){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(o(j||null))};var x=(0,r[v])(l==="accessor"?{get:h.get,set:h.set}:h[u],b);
vendor: 8,417 bytes, line 642
642if(l==="accessor"){if(x===void 0)continue;if(x===null||typeof x!="object")throw new TypeError("Object expected");(m=o(x.get))&&(h.get=m),(m=o(x.set))&&(h.set=m),(m=o(x.init))&&a.unshift(m)}else(m=o(x))&&(l==="field"?a.unshift(m):h[u]=m)}d&&Object.defineProperty(d,n.name,h),p=!0}function M8(t,e,r){for(var n=arguments.length>2,a=0;a<e.length;a++)r=n?e[a].call(t,r):e[a].call(t);return n?r:void 0}function R8(t){return typeof t=="symbol"?t:"".concat(t)}function I8(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function D8(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function Xe(t,e,r,n){function a(i){return i instanceof r?i:new r(function(o){o(i)})}return new(r||(r=Promise))(function(i,o){function l(h){try{d(n.next(h))}catch(m){o(m)}}function u(h){try{d(n.throw(h))}catch(m){o(m)}}function d(h){h.done?i(h.value):a(h.value).then(l,u)}d((n=n.apply(t,e||[])).next())})}function $8(t,e){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,a,i,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(d){return function(h){return u([d,h])}}function u(d){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,d[0]&&(r=0)),r;)try{if(n=1,a&&(i=d[0]&2?a.return:d[0]?a.throw||((i=a.return)&&i.call(a),0):a.next)&&!(i=i.call(a,d[1])).done)return i;switch(a=0,i&&(d=[d[0]&2,i.value]),d[0]){case 0:case 1:i=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,a=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(i=r.trys,!(i=i.length>0&&i[i.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!i||d[1]>i[0]&&d[1]<i[3])){r.label=d[1];break}if(d[0]===6&&r.label<i[1]){r.label=i[1],i=d;break}if(i&&r.label<i[2]){r.label=i[2],r.ops.push(d);break}i[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(h){d=[6,h],a=0}finally{n=i=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}var a0=Object.create?(function(t,e,r,n){n===void 0&&(n=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,a)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]});function L8(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&a0(e,t,r)}function _g(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function J2(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),a,i=[],o;try{for(;(e===void 0||e-- >0)&&!(a=n.next()).done;)i.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return i}function F8(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(J2(arguments[e]));return t}function B8(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),a=0,e=0;e<r;e++)for(var i=arguments[e],o=0,l=i.length;o<l;o++,a++)n[a]=i[o];return n}function eC(t,e,r){if(r||arguments.length===2)for(var n=0,a=e.length,i;n<a;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function uu(t){return this instanceof uu?(this.v=t,this):new uu(t)}function V8(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),a,i=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),a[Symbol.asyncIterator]=function(){return this},a;function o(v){return function(b){return Promise.resolve(b).then(v,m)}}function l(v,b){n[v]&&(a[v]=function(y){return new Promise(function(x,j){i.push([v,y,x,j])>1||u(v,y)})},b&&(a[v]=b(a[v])))}function u(v,b){try{d(n[v](b))}catch(y){p(i[0][3],y)}}function d(v){v.value instanceof uu?Promise.resolve(v.value.v).then(h,m):p(i[0][2],v)}function h(v){u("next",v)}function m(v){u("throw",v)}function p(v,b){v(b),i.shift(),i.length&&u(i[0][0],i[0][1])}}function z8(t){var e,r;return e={},n("next"),n("throw",function(a){throw a}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(a,i){e[a]=t[a]?function(o){return(r=!r)?{value:uu(t[a](o)),done:!1}:i?i(o):o}:i}}function U8(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof _g=="function"?_g(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(o){return new Promise(function(l,u){o=t[i](o),a(l,u,o.done,o.value)})}}function a(i,o,l,u){Promise.resolve(u).then(function(d){i({value:d,done:l})},o)}}function q8(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var IY=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},hN=function(t){return hN=Object.getOwnPropertyNames||function(e){var r=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[r.length]=n);return r},hN(t)};function W8(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=hN(t),n=0;n<r.length;n++)r[n]!=="default"&&a0(e,t,r[n]);return IY(e,t),e}function H8(t){return t&&t.__esModule?t:{default:t}}function G8(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function K8(t,e,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r}function Y8(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function X8(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,a;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(a=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");a&&(n=function(){try{a.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var DY=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function Z8(t){function e(i){t.error=t.hasError?new DY(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(a,function(o){return e(o),a()})}else n|=1}catch(o){e(o)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}function Q8(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,n,a,i,o){return n?e?".jsx":".js":a&&(!i||!o)?r:a+i+"."+o.toLowerCase()+"js"}):t}const $Y={__extends:A8,__assign:xa,__rest:No,__decorate:P8,__param:T8,__esDecorate:O8,__runInitializers:M8,__propKey:R8,__setFunctionName:I8,__metadata:D8,__awaiter:Xe,__generator:$8,__createBinding:a0,__exportStar:L8,__values:_g,__read:J2,__spread:F8,__spreadArrays:B8,__spreadArray:eC,__await:uu,__asyncGenerator:V8,__asyncDelegator:z8,__asyncValues:U8,__makeTemplateOb
642ject:q8,__importStar:W8,__importDefault:H8,__classPrivateFieldGet:G8,__classPrivateFieldSet:K8,__classPrivateFieldIn:Y8,__addDisposableResource:X8,__disposeResources:Z8,__rewriteRelativeImportExtension:Q8},LY=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:X8,get __assign(){return xa},__asyncDelegator:z8,__asyncGenerator:V8,__asyncValues:U8,__await:uu,__awaiter:Xe,__classPrivateFieldGet:G8,__classPrivateFieldIn:Y8,__classPrivateFieldSet:K8,__createBinding:a0,__decorate:P8,__disposeResources:Z8,__esDecorate:O8,__exportStar:L8,__extends:A8,__generator:$8,__importDefault:H8,__importStar:W8,__makeTemplateObject:q8,__metadata:D8,__param:T8,__propKey:R8,__read:J2,__rest:No,__rewriteRelativeImportExtension:Q8,__runInitializers:M8,__setFunctionName:I8,__spread:F8,__spreadArray:eC,__spreadArrays:B8,__values:_g,default:$Y},Symbol.toStringTag,{value:"Module"})),FY=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class tC extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}}class BY extends tC{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class JT extends tC{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class mN extends tC{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var pN;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(pN||(pN={}));class VY{constructor(e,{headers:r={},customFetch:n,region:a=pN.Any}={}){this.url=e,this.headers=r,this.region=a,this.fetch=FY(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return Xe(this,arguments,void 0,function*(r,n={}){var a;let i,o;try{const{headers:l,method:u,body:d,signal:h,timeout:m}=n;let p={},{region:v}=n;v||(v=this.region);const b=new URL(`${this.url}/${r}`);v&&v!=="any"&&(p["x-region"]=v,b.searchParams.set("forceFunctionRegion",v));let y;d&&(l&&!Object.prototype.hasOwnProperty.call(l,"Content-Type")||!l)?typeof Blob<"u"&&d instanceof Blob||d instanceof ArrayBuffer?(p["Content-Type"]="application/octet-stream",y=d):typeof d=="string"?(p["Content-Type"]="text/plain",y=d):typeof FormData<"u"&&d instanceof FormData?y=d:(p["Content-Type"]="application/json",y=JSON.stringify(d)):y=d;let x=h;m&&(o=new AbortController,i=setTimeout(()=>o.abort(),m),h?(x=o.signal,h.addEventListener("abort",()=>o.abort())):x=o.signal);const j=yield this.fetch(b.toString(),{method:u||"POST",headers:Object.assign(Object.assign(Object.assign({},p),this.headers),l),body:y,signal:x}).catch(C=>{throw new BY(C)}),N=j.headers.get("x-relay-error");if(N&&N==="true")throw new JT(j);if(!j.ok)throw new mN(j);let S=((a=j.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),k;return S==="application/json"?k=yield j.json():S==="application/octet-stream"||S==="application/pdf"?k=yield j.blob():S==="text/event-stream"?k=j:S==="multipart/form-data"?k=yield j.formData():k=yield j.text(),{data:k,error:null,response:j}}catch(l){return{data:null,error:l,response:l instanceof mN||l instanceof JT?l.context:void 0}}finally{i&&clearTimeout(i)}})}}var tn={};const Ku=MG(LY);var bp={},wp={},_p={},jp={},Np={},Sp={},eO;function J8(){if(eO)return Sp;eO=1,Object.defineProperty(Sp,"__esModule",{value:!0});class t extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.co
642de=r.code}}return Sp.default=t,Sp}var tO;function e6(){if(tO)return Np;tO=1,Object.defineProperty(Np,"__esModule",{value:!0});const e=Ku.__importDefault(J8());class r{constructor(a){var i,o;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(i=a.shouldThrowOnError)!==null&&i!==void 0?i:!1,this.signal=a.signal,this.isMaybeSingle=(o=a.isMaybeSingle)!==null&&o!==void 0?o:!1,a.fetch?this.fetch=a.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,i){return this.headers=new Headers(this.headers),this.headers.set(a,i),this}then(a,i){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const o=this.fetch;let l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async u=>{var d,h,m,p;let v=null,b=null,y=null,x=u.status,j=u.statusText;if(u.ok){if(this.method!=="HEAD"){const C=await u.text();C===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&(!((d=this.headers.get("Accept"))===null||d===void 0)&&d.includes("application/vnd.pgrst.plan+text"))?b=C:b=JSON.parse(C))}const S=(h=this.headers.get("Prefer"))===null||h===void 0?void 0:h.match(/count=(exact|planned|estimated)/),k=(m=u.headers.get("content-range"))===null||m===void 0?void 0:m.split("/");S&&k&&k.length>1&&(y=parseInt(k[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(b)&&(b.length>1?(v={code:"PGRST116",details:`Results contain ${b.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},b=null,y=null,x=406,j="Not Acceptable"):b.length===1?b=b[0]:b=null)}else{const S=await u.text();try{v=JSON.parse(S),Array.isArray(v)&&u.status===404&&(b=[],v=null,x=200,j="OK")}catch{u.status===404&&S===""?(x=204,j="No Content"):v={message:S}}if(v&&this.isMaybeSingle&&(!((p=v==null?void 0:v.details)===null||p===void 0)&&p.includes("0 rows"))&&(v=null,x=200,j="OK"),v&&this.shouldThrowOnError)throw new e.default(v)}return{error:v,data:b,count:y,status:x,statusText:j}});return this.shouldThrowOnError||(l=l.catch(u=>{var d,h,m,p,v,b;let y="";const x=u==null?void 0:u.cause;if(x){const j=(d=x==null?void 0:x.message)!==null&&d!==void 0?d:"",N=(h=x==null?void 0:x.code)!==null&&h!==void 0?h:"";y=`${(m=u==null?void 0:u.name)!==null&&m!==void 0?m:"FetchError"}: ${u==null?void 0:u.message}`,y+=` 643 644Caused by: ${(p=x==null?void 0:x.name)!==null&&p!==void 0?p:"Error"}: ${j}`,N&&(y+=` (${N})`),x!=null&&x.stack&&(y+=` 645${x.stack}`)}else y=(v=u==null?void 0:u.stack)!==null&&v!==void 0?v:"";return{error:{message:`${(b=u==null?void 0:u.name)!==null&&b!==void 0?b:"FetchError"}: ${u==null?void 0:u.message}`,details:y,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),l.then(a,i)}returns(){return this}overrideTypes(){return this}}return Np.default=r,Np}var rO;function t6(){if(rO)return jp;rO=1,Object.defineProperty(jp,"__esModule",{value:!0});const e=Ku.__importDefault(e6());class r extends e.default{select(a){let i=!1;const o=(a??"*").split("").map(l=>/\s/.test(l)&&!i?"":(l==='"'&&(i=!i),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(a,{ascending:i=!0,nullsFirst:o,foreignTable:l,referencedTable:u=l}={}){const d=u?`${u}.order`:"order",h=this.url.searchParams.get(d);return this.url.searchParams.set(d,`${h?`${h},`:""}${a}.${i?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(a,{foreignTable:i,referencedTable:o=i}={}){const l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${a}`),this}range(a,i,{foreignTable:o,referencedTable:l=o}={}){const u=typeof l>"u"?"offset":`${l}.offset`,d=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(u,`${a}`),this.url.searchParams.set(d,`${i-a+1}`),this}abortSignal(a){return this.signal=a,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}
645explain({analyze:a=!1,verbose:i=!1,settings:o=!1,buffers:l=!1,wal:u=!1,format:d="text"}={}){var h;const m=[a?"analyze":null,i?"verbose":null,o?"settings":null,l?"buffers":null,u?"wal":null].filter(Boolean).join("|"),p=(h=this.headers.get("Accept"))!==null&&h!==void 0?h:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${d}; for="${p}"; options=${m};`),d==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(a){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${a}`),this}}return jp.default=r,jp}var nO;function rC(){if(nO)return _p;nO=1,Object.defineProperty(_p,"__esModule",{value:!0});const e=Ku.__importDefault(t6()),r=new RegExp("[,()]");class n extends e.default{eq(i,o){return this.url.searchParams.append(i,`eq.${o}`),this}neq(i,o){return this.url.searchParams.append(i,`neq.${o}`),this}gt(i,o){return this.url.searchParams.append(i,`gt.${o}`),this}gte(i,o){return this.url.searchParams.append(i,`gte.${o}`),this}lt(i,o){return this.url.searchParams.append(i,`lt.${o}`),this}lte(i,o){return this.url.searchParams.append(i,`lte.${o}`),this}like(i,o){return this.url.searchParams.append(i,`like.${o}`),this}likeAllOf(i,o){return this.url.searchParams.append(i,`like(all).{${o.join(",")}}`),this}likeAnyOf(i,o){return this.url.searchParams.append(i,`like(any).{${o.join(",")}}`),this}ilike(i,o){return this.url.searchParams.append(i,`ilike.${o}`),this}ilikeAllOf(i,o){return this.url.searchParams.append(i,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(i,o){return this.url.searchParams.append(i,`ilike(any).{${o.join(",")}}`),this}regexMatch(i,o){return this.url.searchParams.append(i,`match.${o}`),this}regexIMatch(i,o){return this.url.searchParams.append(i,`imatch.${o}`),this}is(i,o){return this.url.searchParams.append(i,`is.${o}`),this}isDistinct(i,o){return this.url.searchParams.append(i,`isdistinct.${o}`),this}in(i,o){const l=Array.from(new Set(o)).map(u=>typeof u=="string"&&r.test(u)?`"${u}"`:`${u}`).join(",");return this.url.searchParams.append(i,`in.(${l})`),this}contains(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cs.{${o.join(",")}}`):this.url.searchParams.append(i,`cs.${JSON.stringify(o)}`),this}containedBy(i,o){return typeof o=="string"?this.url.searchParams.append(i,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(i,`cd.{${o.join(",")}}`):this.url.searchParams.append(i,`cd.${JSON.stringify(o)}`),this}rangeGt(i,o){return this.url.searchParams.append(i,`sr.${o}`),this}rangeGte(i,o){return this.url.searchParams.append(i,`nxl.${o}`),this}rangeLt(i,o){return this.url.searchParams.append(i,`sl.${o}`),this}rangeLte(i,o){return this.url.searchParams.append(i,`nxr.${o}`),this}rangeAdjacent(i,o){return this.url.searchParams.append(i,`adj.${o}`),this}overlaps(i,o){return typeof o=="string"?this.url.searchParams.append(i,`ov.${o}`):this.url.searchParams.append(i,`ov.{${o.join(",")}}`),this}textSearch(i,o,{config:l,type:u}={}){let d="";u==="plain"?d="pl":u==="phrase"?d="ph":u==="websearch"&&(d="w");const h=l===void 0?"":`(${l})`;return this.url.searchParams.append(i,`${d}fts${h}.${o}`),this}match(i){return Object.entries(i).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(i,o,l){return this.url.searchParams.append(i,`not.${o}.${l}`),this}or(i,{foreignTable:o,referencedTable:l=o}={}){const u=l?`${l}.or`:"or";return this.url.searchParams.append(u,`(${i})`),this}filter(i,o,l){return this.url.searchParams.append(i,`${o}.${l}`),this}}return _p.default=n,_p}var aO;function r6(){if(aO)return wp;aO=1,Object.defineProperty(wp,"__esModule",{value:!0});const e=Ku.__importDefault(rC());class r{constructor(a,{headers:i={},schema:o,fetch:l}){this.url=a,this.headers=new Headers(i),this.schema=o,this.fetch=l}select(a,i){const{head:o=!1,count:l}=i??{},u=o?"HEAD":"GET";let d=!1;const h=(a??"*").split("").map(m=>/\s/.test(m)&&!d?"":(m==='"'&&(d=!d),m)).join("");return this.url.searchParams.set("select",h),l&&this.headers.append("Prefer",`count=${l}`),new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(a,{count:i,defaultToNull:o=!0}={}){var l;const u="POST";if(i&&this.headers.append("Prefer",`count=${i}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(a)){const d=a.reduce((h,m)=>h.concat(Object.keys(m)),[]);if(d.length>0){const h=[...new Set(d)].map(m=>`"${m}"`);this.url.searchParams.set("columns",h.join(","))}}return new e.default({method:u,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(a,{onConflict:i,ignoreDuplicates:o=!1,count:l,defaultToNull:u=!0}={}){var d;const h="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),i!==void 0&&this.url.searchParams.set("on_conflict",i),l&&this.headers.append("Prefer",`count=${l}`),u||this.headers.append("Prefer","missing=default"),Array.isArray(a)){const m=a.reduce((p,v)=>p.concat(Object.keys(v)),[]);if(m.length>0){const p=[...new Set(m)].map(v=>`"${v}"`);this.url.searchParams.set("columns",p.join(","))}}return new e.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(d=this.fetch)!==null&&d!==void 0?d:fetch})}update(a,{count:i}={}){var o;const l="PATCH";return i&&this.headers.append("Prefer",`count=${i}`),new e.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:a}={}){var i;const o="DELETE";return a&&this.headers.append("Prefer",`count=${a}`),new e.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}}return wp.default=r,wp}var sO;function zY(){if(sO)return bp;sO=1,Object.defineProperty(bp,"__esModule",{value:!0});const t=Ku,e=t.__importDefault(r6()),r=t.__importDefault(rC());
645class n{constructor(i,{headers:o={},schema:l,fetch:u}={}){this.url=i,this.headers=new Headers(o),this.schemaName=l,this.fetch=u}from(i){if(!i||typeof i!="string"||i.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");const o=new URL(`${this.url}/${i}`);return new e.default(o,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(i){return new n(this.url,{headers:this.headers,schema:i,fetch:this.fetch})}rpc(i,o={},{head:l=!1,get:u=!1,count:d}={}){var h;let m;const p=new URL(`${this.url}/rpc/${i}`);let v;l||u?(m=l?"HEAD":"GET",Object.entries(o).filter(([y,x])=>x!==void 0).map(([y,x])=>[y,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([y,x])=>{p.searchParams.append(y,x)})):(m="POST",v=o);const b=new Headers(this.headers);return d&&b.set("Prefer",`count=${d}`),new r.default({method:m,url:p,headers:b,schema:this.schemaName,body:v,fetch:(h=this.fetch)!==null&&h!==void 0?h:fetch})}}return bp.default=n,bp}var iO;function UY(){if(iO)return tn;iO=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.PostgrestError=tn.PostgrestBuilder=tn.PostgrestTransformBuilder=tn.PostgrestFilterBuilder=tn.PostgrestQueryBuilder=tn.PostgrestClient=void 0;const t=Ku,e=t.__importDefault(zY());tn.PostgrestClient=e.default;const r=t.__importDefault(r6());tn.PostgrestQueryBuilder=r.default;const n=t.__importDefault(rC());tn.PostgrestFilterBuilder=n.default;const a=t.__importDefault(t6());tn.PostgrestTransformBuilder=a.default;const i=t.__importDefault(e6());tn.PostgrestBuilder=i.default;const o=t.__importDefault(J8());return tn.PostgrestError=o.default,tn.default={PostgrestClient:e.default,PostgrestQueryBuilder:r.default,PostgrestFilterBuilder:n.default,PostgrestTransformBuilder:a.default,PostgrestBuilder:i.default,PostgrestError:o.default},tn}var n6=UY();const a6=Ft(n6),qY=YL({__proto__:null,default:a6},[n6]),{PostgrestClient:WY,PostgrestQueryBuilder:$Ae,PostgrestFilterBuilder:LAe,PostgrestTransformBuilder:FAe,PostgrestBuilder:BAe,PostgrestError:VAe}=a6||qY;class HY{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};if(typeof process<"u"){const r=process.versions;if(r&&r.node){const n=r.node,a=parseInt(n.replace(/^v/,"").split(".")[0]);return a>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${a} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${a} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option: 646import ws from "ws" 647new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.constructor)return e.constructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=` 648 649Suggested solution: ${e.workaround}`),new Error(r)}static createWebSocket(e,r){const n=this.getWebSocketConstructor();return new n(e,r)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const GY="2.84.0",KY=`realtime-js/${GY}`,s6="1.0.0",YY="2.0.0",oO=s6,gN=1e4,XY=1e3,ZY=100;var sl;(function(t){t[t.connecting=0]="connecting",t[t.open=1]="open",t[t.closing=2]="closing",t[t.closed=3]="closed"})(sl||(sl={}));var Ar;(function(t){t.closed="closed",t.errored="errored",t.joined="joined",t.joining="joining",t.leaving="leaving"})(Ar||(Ar={}));var Wa;(function(t){t.close="phx_close",t.error="phx_error",t.join="phx_join",t.reply="phx_reply",t.leave="phx_leave",t.access_token="access_token"})(Wa||(Wa={}));var vN;(function(t){t.websocket="websocket"})(vN||(vN={}));var il;(function(t){t.Connecting="connecting",t.Open="open",t.Closing="closing",t.Closed="closed"})(il||(il={}));class QY{constructor(){this.HEADER_LENGTH=1,this.META_LENGTH=4,this.USER_BROADCAST_PUSH_META_LENGTH=5,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast"}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n,a,i;const o=e.topic,l=(r=e.ref)!==null&&r!==void 0?r:"",u=(n=e.join_ref)!==null&&n!==void 0?n:"",d=e.payload.event,h=(i=(a=e.payload)===null||a===void 0?void 0:a.payload)!==null&&i!==void 0?i:new ArrayBuffer(0),m=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+l.length+o.length+d.length,p=new ArrayBuffer(this.HEADER_LENGTH+m);let v=new DataView(p),b=0;v.setUint8(b++,this.KINDS.userBroadcastPush),v.setUint8(b++,u.length),v.setUint8(b++,l.length),v.setUint8(b++,o.length),v.setUint8(b++,d.length),v.setUint8(b++,this.BINARY_ENCODING),Array.from(u,x=>v.setUint8(b++,x.charCodeAt(0))),Array.from(l,x=>v.setUint8(b++,x.charCodeAt(0))),Array.from(o,x=>v.setUint8(b++,x.charCodeAt(0))),Array.from(d,x=>v.setUint8(b++,x.charCodeAt(0)));var y=new Uint8Array(p.byteLength+h.byteLength);return y.set(new Uint8Array(p),0),y.set(new Uint8Array(h),p.byteLength),y.buffer}_encodeJsonUserBroadcastPush(e){var r,n,a,i;const o=e.topic,l=(r=e.ref)!==null&&r!==void 0?r:"",u=(n=e.join_ref)!==null&&n!==void 0?n:"",d=e.payload.event,h=(i=(a=e.payload)===null||a===void 0?void 0:a.payload)!==null&&i!==void 0?i:{},p=new TextEncoder().encode(JSON.stringify(h)).buffer,v=this.USER_BROADCAST_PUSH_META_LENGTH+u.length+l.length+o.length+d.length,b=new ArrayBuffer(this.HEADER_LENGTH+v);let y=new DataView(b),x=0;y.setUint8(x++,this.KINDS.userBroadcastPush),y.setUint8(x++,u.length),y.setUint8(x++,l.length),y.setUint8(x++,o.length),y.setUint8(x++,d.length),y.setUint8(x++,this.JSON_ENCODING),Array.from(u,N=>
649y.setUint8(x++,N.charCodeAt(0))),Array.from(l,N=>y.setUint8(x++,N.charCodeAt(0))),Array.from(o,N=>y.setUint8(x++,N.charCodeAt(0))),Array.from(d,N=>y.setUint8(x++,N.charCodeAt(0)));var j=new Uint8Array(b.byteLength+p.byteLength);return j.set(new Uint8Array(b),0),j.set(new Uint8Array(p),b.byteLength),j.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[a,i,o,l,u]=n;return r({join_ref:a,ref:i,topic:o,event:l,payload:u})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),a=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,a)}}_decodeUserBroadcast(e,r,n){const a=r.getUint8(1),i=r.getUint8(2),o=r.getUint8(3),l=r.getUint8(4);let u=this.HEADER_LENGTH+4;const d=n.decode(e.slice(u,u+a));u=u+a;const h=n.decode(e.slice(u,u+i));u=u+i;const m=n.decode(e.slice(u,u+o));u=u+o;const p=e.slice(u,e.byteLength),v=l===this.JSON_ENCODING?JSON.parse(n.decode(p)):p,b={type:this.BROADCAST_EVENT,event:h,payload:v};return o>0&&(b.meta=JSON.parse(m)),{join_ref:null,ref:null,topic:d,event:this.BROADCAST_EVENT,payload:b}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}}class i6{constructor(e,r){this.callback=e,this.timerCalc=r,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=r}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var Kt;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(Kt||(Kt={}));const lO=(t,e,r={})=>{var n;const a=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((i,o)=>(i[o]=JY(o,t,e,a),i),{}):{}},JY=(t,e,r,n)=>{const a=e.find(l=>
649l.name===t),i=a==null?void 0:a.type,o=r[t];return i&&!n.includes(i)?o6(i,o):xN(o)},o6=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return nX(e,r)}switch(t){case Kt.bool:return eX(e);case Kt.float4:case Kt.float8:case Kt.int2:case Kt.int4:case Kt.int8:case Kt.numeric:case Kt.oid:return tX(e);case Kt.json:case Kt.jsonb:return rX(e);case Kt.timestamp:return aX(e);case Kt.abstime:case Kt.date:case Kt.daterange:case Kt.int4range:case Kt.int8range:case Kt.money:case Kt.reltime:case Kt.text:case Kt.time:case Kt.timestamptz:case Kt.timetz:case Kt.tsrange:case Kt.tstzrange:return xN(e);default:return xN(e)}},xN=t=>t,eX=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},tX=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},rX=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch(e){return console.log(`JSON parse error: ${e}`),t}return t},nX=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let i;const o=t.slice(1,r);try{i=JSON.parse("["+o+"]")}catch{i=o?o.split(","):[]}return i.map(l=>o6(e,l))}return t},aX=t=>typeof t=="string"?t.replace(" ","T"):t,l6=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};class cb{constructor(e,r,n={},a=gN){this.channel=e,this.event=r,this.payload=n,this.timeout=a,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,r){var n;return this._hasReceived(e)&&r((n=this.receivedResp)===null||n===void 0?void 0:n.response),this.recHooks.push({status:e,callback:r}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=r=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=r,this._matchReceive(r)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,r){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:r})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:r}){this.recHooks.filter(n=>n.status===e).forEach(n=>n.callback(r))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var cO;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(cO||(cO={}));class jf{constructor(e,r){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const n=(r==null?void 0:r.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(n.state,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.joinRef=this.channel._joinRef(),this.state=jf.syncState(this.state,a,i,o),this.pendingDiffs.forEach(u=>{this.state=jf.syncDiff(this.state,u,i,o)}),this.pendingDiffs=[],l()}),this.channel._on(n.diff,{},a=>{const{onJoin:i,onLeave:o,onSync:l}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=jf.syncDiff(this.state,a,i,o),l())}),this.onJoin((a,i,o)=>{this.channel._trigger("presence",{event:"join",key:a,currentPresences:i,newPresences:o})}),this.onLeave((a,i,o)=>{this.channel._trigger("presence",{event:"leave",key:a,currentPresences:i,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,r,n,a){const i=this.cloneDeep(e),o=this.transformState(r),l={},u={};return this.map(i,(d,h)=>{o[d]||(u[d]=h)}),this.map(o,(d,h)=>{const m=i[d];if(m){const p=h.map(x=>x.presence_ref),v=m.map(x=>x.presence_ref),b=h.filter(x=>v.indexOf(x.presence_ref)<0),y=m.filter(x=>p.indexOf(x.presence_ref)<0);b.length>0&&(l[d]=b),y.length>0&&(u[d]=y)}else l[d]=h}),this.syncDiff(i,{joins:l,leaves:u},n,a)}static syncDiff(e,r,n,a){const{joins:i,leaves:o}={joins:this.transformState(r.joins),leaves:this.transformState(r.leaves)};return n||(n=()=>{}),a||(a=()=>{}),this.map(i,(l,u)=>{var d;const h=(d=e[l])!==null&&d!==void 0?d:[];if(e[l]=this.cloneDeep(u),h.length>0){const m=e[l].map(v=>v.presence_ref),p=h.filter(v=>m.indexOf(v.presence_ref)<0);e[l].unshift(...p)}n(l,h,u)}),this.map(o,(l,u)=>{let d=e[l];
649if(!d)return;const h=u.map(m=>m.presence_ref);d=d.filter(m=>h.indexOf(m.presence_ref)<0),e[l]=d,a(l,d,u),d.length===0&&delete e[l]}),e}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const a=e[n];return"metas"in a?r[n]=a.metas.map(i=>(i.presence_ref=i.phx_ref,delete i.phx_ref,delete i.phx_ref_prev,i)):r[n]=a,r},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var uO;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(uO||(uO={}));var Nf;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Nf||(Nf={}));var Qs;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(Qs||(Qs={}));class nC{constructor(e,r={config:{}},n){var a,i;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.state=Ar.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.timeout=this.socket.timeout,this.joinPush=new cb(this,Wa.join,this.params,this.timeout),this.rejoinTimer=new i6(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Ar.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(o=>o.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Ar.closed,this.socket._remove(this)}),this._onError(o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Ar.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Ar.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",o=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,o),this.state=Ar.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Wa.reply,{},(o,l)=>{this._trigger(this._replyEventName(l),o)}),this.presence=new jf(this),this.broadcastEndpointURL=l6(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((i=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||i===void 0)&&i.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(e,r=this.timeout){var n,a,i;if(this.socket.isConnected()||this.socket.connect(),this.state==Ar.closed){const{config:{broadcast:o,presence:l,private:u}}=this.params,d=(a=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(v=>v.filter))!==null&&a!==void 0?a:[],h=!!this.bindings[Nf.PRESENCE]&&this.bindings[Nf.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,m={},p={broadcast:o,presence:Object.assign(Object.assign({},l),{enabled:h}),postgres_changes:d,private:u};this.socket.accessTokenValue&&(m.access_token=this.socket.accessTokenValue),this._onError(v=>e==null?void 0:e(Qs.CHANNEL_ERROR,v)),this._onClose(()=>e==null?void 0:e(Qs.CLOSED)),this.updateJoinPayload(Object.assign({config:p},m)),this.joinedOnce=!0,this._rejoin(r),this.joinPush.receive("ok",async({postgres_changes:v})=>{var b;if(this.socket.setAuth(),v===void 0){e==null||e(Qs.SUBSCRIBED);return}else{const y=this.bindings.postgres_changes,x=(b=y==null?void 0:y.length)!==null&&b!==void 0?b:0,j=[];for(let N=0;N<x;N++){const S=y[N],{filter:{event:k,schema:C,table:A,filter:T}}=S,R=v&&v[N];if(R&&R.event===k&&R.schema===C&&R.table===A&&R.filter===T)j.push(Object.assign(Object.assign({},S),{id:R.id}));else{this.unsubscribe(),this.state=Ar.errored,e==null||e(Qs.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=j,e&&e(Qs.SUBSCRIBED);return}}).receive("error",v=>{this.state=Ar.errored,e==null||e(Qs.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(v).join(", ")||"error")))}).receive("timeout",()=>{e==null||e(Qs.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){return this.state===Ar.joined&&e===Nf.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(()=>this.subscribe())),this._on(e,r,n)}async httpSend(e,r,n={}){var a;const i=this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"";if(r==null)return Promise.reject("Payload is required for httpSend()");const o={method:"POST",headers:{Authorization:i,apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:e,payload:r,private:this.private}]})},l=await this._fetchWithTimeout(this.broadcastEndpointURL,o,(a=n.timeout)!==null&&a!==void 0?a:this.timeout);if(l.status===202)return{success:!0};let u=l.statusText;
649try{const d=await l.json();u=d.error||d.message||u}catch{}return Promise.reject(new Error(u))}async send(e,r={}){var n,a;if(!this._canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:o}=e,u={method:"POST",headers:{Authorization:this.socket.accessTokenValue?`Bearer ${this.socket.accessTokenValue}`:"",apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:o,private:this.private}]})};try{const d=await this._fetchWithTimeout(this.broadcastEndpointURL,u,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((a=d.body)===null||a===void 0?void 0:a.cancel()),d.ok?"ok":"error"}catch(d){return d.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var o,l,u;const d=this._push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((u=(l=(o=this.params)===null||o===void 0?void 0:o.config)===null||l===void 0?void 0:l.broadcast)===null||u===void 0)&&u.ack)&&i("ok"),d.receive("ok",()=>i("ok")),d.receive("error",()=>i("error")),d.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=Ar.leaving;const r=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Wa.close,"leave",this._joinRef())};this.joinPush.destroy();let n=null;return new Promise(a=>{n=new cb(this,Wa.leave,{},e),n.receive("ok",()=>{r(),a("ok")}).receive("timeout",()=>{r(),a("timed out")}).receive("error",()=>{a("error")}),n.send(),this._canPush()||n.trigger("ok",{})}).finally(()=>{n==null||n.destroy()})}teardown(){this.pushBuffer.forEach(e=>e.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Ar.closed,this.bindings={}}async _fetchWithTimeout(e,r,n){const a=new AbortController,i=setTimeout(()=>a.abort(),n),o=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:a.signal}));return clearTimeout(i),o}_push(e,r,n=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let a=new cb(this,e,r,n);return this._canPush()?a.send():this._addToPushBuffer(a),a}_addToPushBuffer(e){if(e.startTimeout(),this.pushBuffer.push(e),this.pushBuffer.length>ZY){const r=this.pushBuffer.shift();r&&(r.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${r.event}`,r.payload))}}_onMessage(e,r,n){return r}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,r,n){var a,i;const o=e.toLocaleLowerCase(),{close:l,error:u,leave:d,join:h}=Wa;if(n&&[l,u,d,h].indexOf(o)>=0&&n!==this._joinRef())return;let p=this._onMessage(o,r,n);if(r&&!p)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(a=this.bindings.postgres_changes)===null||a===void 0||a.filter(v=>{var b,y,x;return((b=v.filter)===null||b===void 0?void 0:b.event)==="*"||((x=(y=v.filter)===null||y===void 0?void 0:y.event)===null||x===void 0?void 0:x.toLocaleLowerCase())===o}).map(v=>v.callback(p,n)):(i=this.bindings[o])===null||i===void 0||i.filter(v=>{var b,y,x,j,N,S;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in v){const k=v.id,C=(b=v.filter)===null||b===void 0?void 0:b.event;return k&&((y=r.ids)===null||y===void 0?void 0:y.includes(k))&&(C==="*"||(C==null?void 0:C.toLocaleLowerCase())===((x=r.data)===null||x===void 0?void 0:x.type.toLocaleLowerCase()))}else{const k=(N=(j=v==null?void 0:v.filter)===null||j===void 0?void 0:j.event)===null||N===void 0?void 0:N.toLocaleLowerCase();return k==="*"||k===((S=r==null?void 0:r.event)===null||S===void 0?void 0:S.toLocaleLowerCase())}else return v.type.toLocaleLowerCase()===o}).map(v=>{if(typeof p=="object"&&"ids"in p){const b=p.data,{schema:y,table:x,commit_timestamp:j,type:N,errors:S}=b;p=Object.assign(Object.assign({},{schema:y,table:x,commit_timestamp:j,eventType:N,new:{},old:{},errors:S}),this._getPayloadRecords(b))}v.callback(p,n)})}_isClosed(){return this.state===Ar.closed}_isJoined(){return this.state===Ar.joined}_isJoining(){return this.state===Ar.joining}_isLeaving(){return this.state===Ar.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,r,n){const a=e.toLocaleLowerCase(),i={type:a,filter:r,callback:n};return this.bindings[a]?this.bindings[a].push(i):this.bindings[a]=[i],this}_off(e,r){const n=e.toLocaleLowerCase();return this.bindings[n]&&(this.bindings[n]=this.bindings[n].filter(a=>{var i;return!(((i=a.type)===null||i===void 0?void 0:i.toLocaleLowerCase())===n&&nC.isEqual(a.filter,r))})),this}static isEqual(e,r){if(Object.keys(e).length!==Object.keys(r).length)return!1;for(const n in e)if(e[n]!==r[n])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(Wa.close,{},e)}_onError(e){this._on(Wa.error,{},r=>e(r))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Ar.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=lO(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=lO(e.columns,e.old_record)),r}}const ub=()=>{},Cp={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},sX=[1e3,2e3,5e3,1e4],iX=1e4,oX=` 650 addEventListener("message", (e) => { 651 if (e.data.event === "start") { 652 setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval); 653 } 654 });`;class lX{constructor(e,r){var n;if(this.accessTokenValue=null,this.apiKey=null,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=gN,this.transport=null,this.heartbeatIntervalMs=Cp.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=ub,this.ref=0,this.reconnectTimer=null,this.vsn=oO,this.logger=ub,this.conn=null,this.sendBuffer=[],this.serializer
654=new QY,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._resolveFetch=a=>a?(...i)=>a(...i):(...i)=>fetch(...i),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey,this.endPoint=`${e}/${vN.websocket}`,this.httpEndpoint=l6(e),this._initializeOptions(r),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=HY.createWebSocket(this.endpointURL())}catch(e){this._setConnectionState("disconnected");const r=e.message;throw r.includes("Node.js")?new Error(`${r} 655 656To use Realtime in Node.js, you need to provide a WebSocket implementation: 657 658Option 1: Use Node.js 22+ which has native WebSocket support 659Option 2: Install and provide the "ws" package: 660 661 npm install ws 662 663 import ws from "ws" 664 const client = new RealtimeClient(url, { 665 ...options, 666 transport: ws 667 })`):new Error(`WebSocket not available: ${r}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(e,r){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const n=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(n),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(e?this.conn.close(e,r??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),r}async removeAllChannels(){const e=await Promise.all(this.channels.map(r=>r.unsubscribe()));return this.channels=[],this.disconnect(),e}log(e,r,n){this.logger(e,r,n)}connectionState(){switch(this.conn&&this.conn.readyState){case sl.connecting:return il.Connecting;case sl.open:return il.Open;case sl.closing:return il.Closing;default:return il.Closed}}isConnected(){return this.connectionState()===il.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(e,r={config:{}}){const n=`realtime:${e}`,a=this.getChannels().find(i=>i.topic===n);if(a)return a;{const i=new nC(`realtime:${e}`,r,this);return this.channels.push(i),i}}push(e){const{topic:r,event:n,payload:a,ref:i}=e,o=()=>{this.encode(e,l=>{var u;(u=this.conn)===null||u===void 0||u.send(l)})};this.log("push",`${r} ${n} (${i})`,a),this.isConnected()?o():this.sendBuffer.push(o)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}async sendHeartbeat(){var e;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(r){this.log("error","error in heartbeat callback",r)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(r){this.log("error","error in heartbeat callback",r)}this._wasManualDisconnect=!1,(e=this.conn)===null||e===void 0||e.close(XY,"heartbeat timeout"),setTimeout(()=>{var r;this.isConnected()||(r=this.reconnectTimer)===null||r===void 0||r.sc
667heduleTimeout()},Cp.HEARTBEAT_TIMEOUT_FALLBACK);return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(r){this.log("error","error in heartbeat callback",r)}this._setAuthSafely("heartbeat")}onHeartbeat(e){this.heartbeatCallback=e}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let r=this.channels.find(n=>n.topic===e&&(n._isJoined()||n._isJoining()));r&&(this.log("transport",`leaving duplicate topic "${e}"`),r.unsubscribe())}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic)}_onConnMessage(e){this.decode(e.data,r=>{if(r.topic==="phoenix"&&r.event==="phx_reply")try{this.heartbeatCallback(r.payload.status==="ok"?"ok":"error")}catch(d){this.log("error","error in heartbeat callback",d)}r.ref&&r.ref===this.pendingHeartbeatRef&&(this.pendingHeartbeatRef=null);const{topic:n,event:a,payload:i,ref:o}=r,l=o?`(${o})`:"",u=i.status||"";this.log("receive",`${u} ${n} ${a} ${l}`.trim(),i),this.channels.filter(d=>d._isMember(n)).forEach(d=>d._trigger(a,i,o)),this._triggerStateCallbacks("message",r)})}_clearTimer(e){var r;e==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):e==="reconnect"&&((r=this.reconnectTimer)===null||r===void 0||r.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e))}_teardownConnection(){if(this.conn){if(this.conn.readyState===sl.open||this.conn.readyState===sl.connecting)try{this.conn.close()}catch(e){this.log("error","Error closing connection",e)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this.channels.forEach(e=>e.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(r=>{this.log("error","error waiting for auth on connect",r),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this.workerRef.terminate()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_onConnClose(e){var r;this._setConnectionState("disconnected"),this.log("transport","close",e),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(r=this.reconnectTimer)===null||r===void 0||r.sc
667heduleTimeout(),this._triggerStateCallbacks("close",e)}_onConnError(e){this._setConnectionState("disconnected"),this.log("transport",`${e}`),this._triggerChanError(),this._triggerStateCallbacks("error",e)}_triggerChanError(){this.channels.forEach(e=>e._trigger(Wa.error))}_appendParams(e,r){if(Object.keys(r).length===0)return e;const n=e.match(/\?/)?"&":"?",a=new URLSearchParams(r);return`${e}${n}${a}`}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([oX],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_setConnectionState(e,r=!1){this._connectionState=e,e==="connecting"?this._wasManualDisconnect=!1:e==="disconnecting"&&(this._wasManualDisconnect=r)}async _performAuth(e=null){let r;e?r=e:this.accessToken?r=await this.accessToken():r=this.accessTokenValue,this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(n=>{const a={access_token:r,version:KY};r&&n.updateJoinPayload(a),n.joinedOnce&&n._isJoined()&&n._push(Wa.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this.setAuth().catch(r=>{this.log("error",`error setting auth in ${e}`,r)})}_triggerStateCallbacks(e,r){try{this.stateChangeCallbacks[e].forEach(n=>{try{n(r)}catch(a){this.log("error",`error in ${e} callback`,a)}})}catch(n){this.log("error",`error triggering ${e} callbacks`,n)}}_setupReconnectionTimer(){this.reconnectTimer=new i6(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Cp.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(e){var r,n,a,i,o,l,u,d,h,m,p,v;switch(this.transport=(r=e==null?void 0:e.transport)!==null&&r!==void 0?r:null,this.timeout=(n=e==null?void 0:e.timeout)!==null&&n!==void 0?n:gN,this.heartbeatIntervalMs=(a=e==null?void 0:e.heartbeatIntervalMs)!==null&&a!==void 0?a:Cp.HEARTBEAT_INTERVAL,this.worker=(i=e==null?void 0:e.worker)!==null&&i!==void 0?i:!1,this.accessToken=(o=e==null?void 0:e.accessToken)!==null&&o!==void 0?o:null,this.heartbeatCallback=(l=e==null?void 0:e.heartbeatCallback)!==null&&l!==void 0?l:ub,this.vsn=(u=e==null?void 0:e.vsn)!==null&&u!==void 0?u:oO,e!=null&&e.params&&(this.params=e.params),e!=null&&e.logger&&(this.logger=e.logger),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(d=e==null?void 0:e.reconnectAfterMs)!==null&&d!==void 0?d:(b=>sX[b-1]||iX),this.vsn){case s6:this.encode=(h=e==null?void 0:e.encode)!==null&&h!==void 0?h:((b,y)=>y(JSON.stringify(b))),this.decode=(m=e==null?void 0:e.decode)!==null&&m!==void 0?m:((b,y)=>y(JSON.parse(b)));break;case YY:this.encode=(p=e==null?void 0:e.encode)!==null&&p!==void 0?p:this.serializer.encode.bind(this.serializer),this.decode=(v=e==null?void 0:e.decode)!==null&&v!==void 0?v:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl}}}
667class aC extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function ir(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}class cX extends aC{constructor(e,r,n){super(e),this.name="StorageApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class yN extends aC{constructor(e,r){super(e),this.name="StorageUnknownError",this.originalError=r}}const sC=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),uX=()=>Response,bN=t=>{if(Array.isArray(t))return t.map(r=>bN(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const a=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[a]=bN(n)}),e},dX=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},db=t=>{var e;return t.msg||t.message||t.error_description||(typeof t.error=="string"?t.error:(e=t.error)===null||e===void 0?void 0:e.message)||JSON.stringify(t)},fX=(t,e,r)=>Xe(void 0,void 0,void 0,function*(){const n=yield uX();t instanceof n&&!(r!=null&&r.noResolveJson)?t.json().then(a=>{const i=t.status||500,o=(a==null?void 0:a.statusCode)||i+"";e(new cX(db(a),i,o))}).catch(a=>{e(new yN(db(a),a))}):e(new yN(db(t),t))}),hX=(t,e,r,n)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"||!n?a:(dX(n)?(a.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),a.body=JSON.stringify(n)):a.body=n,e!=null&&e.duplex&&(a.duplex=e.duplex),Object.assign(Object.assign({},a),r))};function Lh(t,e,r,n,a,i){return Xe(this,void 0,void 0,function*(){return new Promise((o,l)=>{t(r,hX(e,n,a,i)).then(u=>{if(!u.ok)throw u;return n!=null&&n.noResolveJson?u:u.json()}).then(u=>o(u)).catch(u=>fX(u,l,n))})})}function Bf(t,e,r,n){return Xe(this,void 0,void 0,function*(){return Lh(t,"GET",e,r,n)})}function qa(t,e,r,n,a){return Xe(this,void 0,void 0,function*(){return Lh(t,"POST",e,n,a,r)})}function wN(t,e,r,n,a){return Xe(this,void 0,void 0,function*(){return Lh(t,"PUT",e,n,a,r)})}function mX(t,e,r,n){return Xe(this,void 0,void 0,function*(){return Lh(t,"HEAD",e,Object.assign(Object.assign({},r),{noResolveJson:!0}),n)})}function iC(t,e,r,n,a){return Xe(this,void 0,void 0,function*(){return Lh(t,"DELETE",e,n,a,r)})}class pX{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r}then(e,r){return this.execute().then(e,r)}execute(){return Xe(this,void 0,void 0,function*(){try{return{data:(yield this.downloadFn()).body,error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ir(e))return{data:null,error:e};throw e}})}}var c6;class gX{constructor(e,r){this.downloadFn=e,this.shouldThrowOnError=r,this[c6]="BlobDownloadBuilder",this.promise=null}asStream(){return new pX(this.downloadFn,this.shouldThrowOnError)}then(e,r){return this.getPromise().then(e,r)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}execute(){return Xe(this,void 0,void 0,function*(){try{return{data:yield(yield this.downloadFn()).blob(),error:null}}catch(e){if(this.shouldThrowOnError)throw e;if(ir(e))return{data:null,error:e};throw e}})}}c6=Symbol.toStringTag;const vX={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},dO={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class xX{constructor(e,r={},n,a){this.shouldThrowOnError=!1,this.url=e,this.headers=r,this.bucketId=n,this.fetch=sC(a)}throwOnError(){return this.shouldThrowOnError=!0,this}uploadOrUpdate(e,r,n,a){return Xe(this,void 0,void 0,function*(){try{let i;const o=Object.assign(Object.assign({},dO),a);let l=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});const u=o.metadata;typeof Blob<"u"&&n instanceof Blob?(i=new FormData,i.append("cacheControl",o.cacheControl),u&&i.append("metadata",this.encodeMetadata(u)),i.append("",n)):typeof FormData<"u"&&n instanceof FormData?(i=n,i.has("cacheControl")||i.append("cacheControl",o.cacheControl),u&&!i.has("metadata")&&i.append("metadata",this.encodeMetadata(u))):(i=n,l["cache-control"]=`max-age=${o.cacheControl}`,l["content-type"]=o.contentType,u&&(l["x-metadata"]=this.toBase64(this.encodeMetadata(u))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!o.duplex&&(o.duplex="half")),a!=null&&a.headers&&(l=Object.assign(Object.assign({},l),a.headers));const d=this._removeEmptyFolders(r),h=this._getFinalPath(d),m=yield(e=="PUT"?wN:qa)(this.fetch,`${this.url}/object/${h}`,i,Object.assign({headers:l},o!=null&&o.duplex?{duplex:o.duplex}:{}));return{data:{path:d,id:m.Id,fullPath:m.Key},error:null}}catch(i){if(this.shouldThrowOnError)throw i;if(ir(i))return{data:null,error:i};throw i}})}upload(e,r,n){return Xe(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,r,n)})}uploadToSignedUrl(e,r,n,a){return Xe(this,void 0,void 0,function*(){const i=this._removeEmptyFolders(e),o=this._getFinalPath(i),l=new URL(this.url+`/object/upload/sign/${o}`);l.searchParams.set("token",r);try{let u;const d=Object.assign({upsert:dO.upsert},a),h=Object.assign(Object.assign({},this.headers),{"x-upsert":String(d.upsert)});typeof Blob<"u"&&n instanceof Blob?(u=new FormData,u.append("cacheControl",d.cacheControl),u.append("",n)):typeof FormData<"u"&&n instanceof FormData?(u=n,u.append("cacheControl",d.cacheControl)):(u=n,h["cache-control"]=`max-age=${d.cacheControl}`,h["content-type"]=d.contentType);const m=yield wN(this.fetch,l.toString(),u,{headers:h});return{data:{path:i,fullPath:m.Key},error:null}}catch(u){if(this.shouldThrowOnError)throw u;if(ir(u))return{data:null,error:u};throw u}})}createSignedUploadUrl(e,r){return Xe(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e);const a=Object.assign({},this.headers);r!=null&&r.upsert&&(a["x-upsert"]="true");const i=yield qa(this.fetch,`${this.url}/object/upload/sign/${n}`,{},{headers:a}),o=new URL(this.url+i.url),l=o.searchParams.get("token");if(!l)throw new aC("No token returned by API");return{data:{signedUrl:o.toString(),path:e,token:l},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ir(n))return{data:null,error:n};throw n}})}update(e,r,n){return Xe(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,r,n)})}move(e,r,n){return Xe(this,void 0,void 0,function*(){try{return{data:yield qa(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers}),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ir(a))return{data:null,error:a};throw a}})}copy(e,r,n){return Xe(this,void 0,void 0,function*(){try{return{data:{path:(yield qa(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:r,destinationBucket:n==null?void 0:n.destinationBucket},{headers:this.headers})).Key},error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ir(a))return{data:null,error:a};throw a}})}createSignedUrl(e,r,n){return Xe(this,void 0,void 0,function*(){try{let a=this._getFinalPath(e),i=yield qa(this.fetch,`${this.url}/object/sign/${a}
667`,Object.assign({expiresIn:r},n!=null&&n.transform?{transform:n.transform}:{}),{headers:this.headers});const o=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return i={signedUrl:encodeURI(`${this.url}${i.signedURL}${o}`)},{data:i,error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ir(a))return{data:null,error:a};throw a}})}createSignedUrls(e,r,n){return Xe(this,void 0,void 0,function*(){try{const a=yield qa(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:r,paths:e},{headers:this.headers}),i=n!=null&&n.download?`&download=${n.download===!0?"":n.download}`:"";return{data:a.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${i}`):null})),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ir(a))return{data:null,error:a};throw a}})}download(e,r){const a=typeof(r==null?void 0:r.transform)<"u"?"render/image/authenticated":"object",i=this.transformOptsToQueryString((r==null?void 0:r.transform)||{}),o=i?`?${i}`:"",l=this._getFinalPath(e),u=()=>Bf(this.fetch,`${this.url}/${a}/${l}${o}`,{headers:this.headers,noResolveJson:!0});return new gX(u,this.shouldThrowOnError)}info(e){return Xe(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{const n=yield Bf(this.fetch,`${this.url}/object/info/${r}`,{headers:this.headers});return{data:bN(n),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ir(n))return{data:null,error:n};throw n}})}exists(e){return Xe(this,void 0,void 0,function*(){const r=this._getFinalPath(e);try{return yield mX(this.fetch,`${this.url}/object/${r}`,{headers:this.headers}),{data:!0,error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ir(n)&&n instanceof yN){const a=n.originalError;if([400,404].includes(a==null?void 0:a.status))return{data:!1,error:n}}throw n}})}getPublicUrl(e,r){const n=this._getFinalPath(e),a=[],i=r!=null&&r.download?`download=${r.download===!0?"":r.download}`:"";i!==""&&a.push(i);const l=typeof(r==null?void 0:r.transform)<"u"?"render/image":"object",u=this.transformOptsToQueryString((r==null?void 0:r.transform)||{});u!==""&&a.push(u);let d=a.join("&");return d!==""&&(d=`?${d}`),{data:{publicUrl:encodeURI(`${this.url}/${l}/public/${n}${d}`)}}}remove(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield iC(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}list(e,r,n){return Xe(this,void 0,void 0,function*(){try{const a=Object.assign(Object.assign(Object.assign({},vX),r),{prefix:e||""});return{data:yield qa(this.fetch,`${this.url}/object/list/${this.bucketId}`,a,{headers:this.headers},n),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ir(a))return{data:null,error:a};throw a}})}listV2(e,r){return Xe(this,void 0,void 0,function*(){try{const n=Object.assign({},e);return{data:yield qa(this.fetch,`${this.url}/object/list-v2/${this.bucketId}`,n,{headers:this.headers},r),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ir(n))return{data:null,error:n};throw n}})}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const r=[];return e.width&&r.push(`width=${e.width}`),e.height&&r.push(`height=${e.height}`),e.resize&&r.push(`resize=${e.resize}`),e.format&&r.push(`format=${e.format}`),e.quality&&r.push(`quality=${e.quality}`),r.join("&")}}const u6="2.84.0",d6={"X-Client-Info":`storage-js/${u6}`};class yX{constructor(e,r={},n,a){this.shouldThrowOnError=!1;const i=new URL(e);a!=null&&a.useNewHostname&&/supabase\.(co|in|red)$/.test(i.hostname)&&!i.hostname.includes("storage.supabase.")&&(i.hostname=i.hostname.replace("supabase.","storage.supabase.")),this.url=i.href.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},d6),r),this.fetch=sC(n)}throwOnError(){return this.shouldThrowOnError=!0,this}listBuckets(e){return Xe(this,void 0,void 0,function*(){try{const r=this.listBucketOptionsToQueryString(e);return{data:yield Bf(this.fetch,`${this.url}/bucket${r}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}getBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield Bf(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}createBucket(e){return Xe(this,arguments,void 0,function*(r,n={public:!1}){try{return{data:yield qa(this.fetch,`${this.url}/bucket`,{id:r,name:r,type:n.type,public:n.public,file_size_limit:n.fileSizeLimit,allowed_mime_types:n.allowedMimeTypes},{headers:this.headers}),error:null}}catch(a){if(this.shouldThrowOnError)throw a;if(ir(a))return{data:null,error:a};throw a}})}updateBucket(e,r){return Xe(this,void 0,void 0,function*(){try{return{data:yield wN(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:r.public,file_size_limit:r.fileSizeLimit,allowed_mime_types:r.allowedMimeTypes},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(ir(n))return{data:null,error:n};throw n}})}emptyBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield qa(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield iC(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}listBucketOptionsToQueryString(e){const r={};return e&&("limit"in e&&(r.limit=String(e.limit)),"offset"in e&&(r.offset=String(e.offset)),e.search&&(r.search=e.search),e.sortColumn&&(r.sortColumn=e.sortColumn),e.sortOrder&&(r.sortOrder=e.sortOrder)),Object.keys(r).length>0?"?"+new URLSearchParams(r).toString():""}}class bX{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},d6),r),this.fetch=sC(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield qa(this.fetch,`${this.url}/bucket`,{name:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}listBuckets(e){return Xe(this,void 0,void 0,function*(){try{const r=new
667URLSearchParams;(e==null?void 0:e.limit)!==void 0&&r.set("limit",e.limit.toString()),(e==null?void 0:e.offset)!==void 0&&r.set("offset",e.offset.toString()),e!=null&&e.sortColumn&&r.set("sortColumn",e.sortColumn),e!=null&&e.sortOrder&&r.set("sortOrder",e.sortOrder),e!=null&&e.search&&r.set("search",e.search);const n=r.toString(),a=n?`${this.url}/bucket?${n}`:`${this.url}/bucket`;return{data:yield Bf(this.fetch,a,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield iC(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(ir(r))return{data:null,error:r};throw r}})}}const oC={"X-Client-Info":`storage-js/${u6}`,"Content-Type":"application/json"};class f6 extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}}function Hn(t){return typeof t=="object"&&t!==null&&"__isStorageVectorsError"in t}class fb extends f6{constructor(e,r,n){super(e),this.name="StorageVectorsApiError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}}class wX extends f6{constructor(e,r){super(e),this.name="StorageVectorsUnknownError",this.originalError=r}}var fO;(function(t){t.InternalError="InternalError",t.S3VectorConflictException="S3VectorConflictException",t.S3VectorNotFoundException="S3VectorNotFoundException",t.S3VectorBucketNotEmpty="S3VectorBucketNotEmpty",t.S3VectorMaxBucketsExceeded="S3VectorMaxBucketsExceeded",t.S3VectorMaxIndexesExceeded="S3VectorMaxIndexesExceeded"})(fO||(fO={}));const lC=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),_X=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},hO=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),jX=(t,e,r)=>Xe(void 0,void 0,void 0,function*(){if(t&&typeof t=="object"&&"status"in t&&"ok"in t&&typeof t.status=="number"&&!(r!=null&&r.noResolveJson)){const a=t.status||500,i=t;if(typeof i.json=="function")i.json().then(o=>{const l=(o==null?void 0:o.statusCode)||(o==null?void 0:o.code)||a+"";e(new fb(hO(o),a,l))}).catch(()=>{const o=a+"",l=i.statusText||`HTTP ${a} error`;e(new fb(l,a,o))});else{const o=a+"",l=i.statusText||`HTTP ${a} error`;e(new fb(l,a,o))}}else e(new wX(hO(t),t))}),NX=(t,e,r,n)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};return n?(_X(n)?(a.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),a.body=JSON.stringify(n)):a.body=n,Object.assign(Object.assign({},a),r)):a};function SX(t,e,r,n,a,i){return Xe(this,void 0,void 0,function*(){return new Promise((o,l)=>{t(r,NX(e,n,a,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;const d=u.headers.get("content-type");return!d||!d.includes("application/json")?{}:u.json()}).then(u=>o(u)).catch(u=>jX(u,l,n))})})}function Gn(t,e,r,n,a){return Xe(this,void 0,void 0,function*(){return SX(t,"POST",e,n,a,r)})}class CX{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},oC),r),this.fetch=lC(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createIndex(e){return Xe(this,void 0,void 0,function*(){try{return{data:(yield Gn(this.fetch,`${this.url}/CreateIndex`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}getIndex(e,r){return Xe(this,void 0,void 0,function*(){try{return{data:yield Gn(this.fetch,`${this.url}/GetIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}),error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Hn(n))return{data:null,error:n};throw n}})}listIndexes(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield Gn(this.fetch,`${this.url}/ListIndexes`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}deleteIndex(e,r){return Xe(this,void 0,void 0,function*(){try{return{data:(yield Gn(this.fetch,`${this.url}/DeleteIndex`,{vectorBucketName:e,indexName:r},{headers:this.headers}))||{},error:null}}catch(n){if(this.shouldThrowOnError)throw n;if(Hn(n))return{data:null,error:n};throw n}})}}class kX{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},oC),r),this.fetch=lC(n)}throwOnError(){return this.shouldThrowOnError=!0,this}putVectors(e){return Xe(this,void 0,void 0,function*(){try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:(yield Gn(this.fetch,`${this.url}/PutVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}getVectors(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield Gn(this.fetch,`${this.url}/GetVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}listVectors(e){return Xe(this,void 0,void 0,function*(){try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");
667if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:yield Gn(this.fetch,`${this.url}/ListVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}queryVectors(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield Gn(this.fetch,`${this.url}/QueryVectors`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}deleteVectors(e){return Xe(this,void 0,void 0,function*(){try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:(yield Gn(this.fetch,`${this.url}/DeleteVectors`,e,{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}}class EX{constructor(e,r={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=Object.assign(Object.assign({},oC),r),this.fetch=lC(n)}throwOnError(){return this.shouldThrowOnError=!0,this}createBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:(yield Gn(this.fetch,`${this.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}getBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:yield Gn(this.fetch,`${this.url}/GetVectorBucket`,{vectorBucketName:e},{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}listBuckets(){return Xe(this,arguments,void 0,function*(e={}){try{return{data:yield Gn(this.fetch,`${this.url}/ListVectorBuckets`,e,{headers:this.headers}),error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}deleteBucket(e){return Xe(this,void 0,void 0,function*(){try{return{data:(yield Gn(this.fetch,`${this.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:this.headers}))||{},error:null}}catch(r){if(this.shouldThrowOnError)throw r;if(Hn(r))return{data:null,error:r};throw r}})}}class AX extends EX{constructor(e,r={}){super(e,r.headers||{},r.fetch)}from(e){return new PX(this.url,this.headers,e,this.fetch)}}class PX extends CX{constructor(e,r,n,a){super(e,r,a),this.vectorBucketName=n}createIndex(e){const r=Object.create(null,{createIndex:{get:()=>super.createIndex}});return Xe(this,void 0,void 0,function*(){return r.createIndex.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName}))})}listIndexes(){const e=Object.create(null,{listIndexes:{get:()=>super.listIndexes}});return Xe(this,arguments,void 0,function*(r={}){return e.listIndexes.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName}))})}getIndex(e){const r=Object.create(null,{getIndex:{get:()=>super.getIndex}});return Xe(this,void 0,void 0,function*(){return r.getIndex.call(this,this.vectorBucketName,e)})}deleteIndex(e){const r=Object.create(null,{deleteIndex:{get:()=>super.deleteIndex}});return Xe(this,void 0,void 0,function*(){return r.deleteIndex.call(this,this.vectorBucketName,e)})}index(e){return new TX(this.url,this.headers,this.vectorBucketName,e,this.fetch)}}class TX extends kX{constructor(e,r,n,a,i){super(e,r,i),this.vectorBucketName=n,this.indexName=a}putVectors(e){const r=Object.create(null,{putVectors:{get:()=>super.putVectors}});return Xe(this,void 0,void 0,function*(){return r.putVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}getVectors(e){const r=Object.create(null,{getVectors:{get:()=>super.getVectors}});return Xe(this,void 0,void 0,function*(){return r.getVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}listVectors(){const e=Object.create(null,{listVectors:{get:()=>super.listVectors}});return Xe(this,arguments,void 0,function*(r={}){return e.listVectors.call(this,Object.assign(Object.assign({},r),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}queryVectors(e){const r=Object.create(null,{queryVectors:{get:()=>super.queryVectors}});return Xe(this,void 0,void 0,function*(){return r.queryVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}deleteVectors(e){const r=Object.create(null,{deleteVectors:{get:()=>super.deleteVectors}});return Xe(this,void 0,void 0,function*(){return r.deleteVectors.call(this,Object.assign(Object.assign({},e),{vectorBucketName:this.vectorBucketName,indexName:this.indexName}))})}}class OX extends yX{constructor(e,r={},n,a){super(e,r,n,a)}from(e){return new xX(this.url,this.headers,e,this.fetch)}get vectors(){return new AX(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new bX(this.url+"/iceberg",this.headers,this.fetch)}}const MX="2.84.0";let mf="";typeof Deno<"u"?mf="deno":typeof document<"u"?mf="web":typeof navigator<"u"&&navigator.product==="ReactNative"?mf="react-native":mf="node";const RX={"X-Client-Info":`supabase-js-${mf}/${MX}
667`},IX={headers:RX},DX={schema:"public"},$X={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},LX={},FX=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),BX=()=>Headers,VX=(t,e,r)=>{const n=FX(r),a=BX();return async(i,o)=>{var l;const u=(l=await e())!==null&&l!==void 0?l:t;let d=new a(o==null?void 0:o.headers);return d.has("apikey")||d.set("apikey",t),d.has("Authorization")||d.set("Authorization",`Bearer ${u}`),n(i,Object.assign(Object.assign({},o),{headers:d}))}};function zX(t){return t.endsWith("/")?t:t+"/"}function UX(t,e){var r,n;const{db:a,auth:i,realtime:o,global:l}=t,{db:u,auth:d,realtime:h,global:m}=e,p={db:Object.assign(Object.assign({},u),a),auth:Object.assign(Object.assign({},d),i),realtime:Object.assign(Object.assign({},h),o),storage:{},global:Object.assign(Object.assign(Object.assign({},m),l),{headers:Object.assign(Object.assign({},(r=m==null?void 0:m.headers)!==null&&r!==void 0?r:{}),(n=l==null?void 0:l.headers)!==null&&n!==void 0?n:{})}),accessToken:async()=>""};return t.accessToken?p.accessToken=t.accessToken:delete p.accessToken,p}function qX(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(zX(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}const h6="2.84.0",Tc=30*1e3,_N=3,hb=_N*Tc,WX="http://localhost:9999",HX="supabase.auth.token",GX={"X-Client-Info":`gotrue-js/${h6}`},jN="X-Supabase-Api-Version",m6={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},KX=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,YX=600*1e3;class Vf extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}}function Ze(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class XX extends Vf{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function ZX(t){return Ze(t)&&t.name==="AuthApiError"}class ol extends Vf{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class So extends Vf{constructor(e,r,n,a){super(e,n,a),this.name=r,this.status=n}}class Bn extends So{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function QX(t){return Ze(t)&&t.name==="AuthSessionMissingError"}class vc extends So{constructor(){super("Auth session or user missing","AuthInvalidToken
667ResponseError",500,void 0)}}class kp extends So{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Ep extends So{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function JX(t){return Ze(t)&&t.name==="AuthImplicitGrantRedirectError"}class mO extends So{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class NN extends So{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function mb(t){return Ze(t)&&t.name==="AuthRetryableFetchError"}class pO extends So{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}}class SN extends So{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const jg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),gO=` 668\r=`.split(""),eZ=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<gO.length;e+=1)t[gO[e].charCodeAt(0)]=-2;for(let e=0;e<jg.length;e+=1)t[jg[e].charCodeAt(0)]=e;return t})();function vO(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(jg[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(jg[n]),e.queuedBits-=6}}function p6(t,e,r){const n=eZ[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function xO(t){const e=[],r=o=>{e.push(String.fromCodePoint(o))},n={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},i=o=>{nZ(o,n,r)};for(let o=0;o<t.length;o+=1)p6(t.charCodeAt(o),a,i);return e.join("")}function tZ(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function rZ(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const a=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|a)+65536,r+=1}tZ(n,e)}}function nZ(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if((t>>7-n&1)===0){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function Wc(t){const e=[],r={queue:0,queuedBits:0},n=a=>{e.push(a)};for(let a=0;a<t.length;a+=1)p6(t.charCodeAt(a),r,n);return new Uint8Array(e)}function aZ(t){const e=[];return rZ(t,r=>e.push(r)),new Uint8Array(e)}function cl(t){const e=[],r={queue:0,queuedBits:0},n=a=>{e.push(a)};return t.forEach(a=>vO(a,r,n)),vO(null,r,n),e.join("")}function sZ(t){return Math.round(Date.now()/1e3)+t}function iZ(){return Symbol("auth-callback")}const Hr=()=>typeof window<"u"&&typeof document<"u",Yo={tested:!1,writable:!1},g6=()=>{if(!Hr())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Yo.tested)return Yo.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Yo.tested=!0,Yo.writable=!0}catch{Yo.tested=!0,Yo.writable=!1}return Yo.writable};function oZ(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((a,i)=>{e[i]=a})}catch{}return r.searchParams.forEach((n,a)=>{e[a]=n}),e}const v6=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),lZ=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Oc=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},Xo=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return r}},Wi=async(t,e)=>{await t.removeItem(e)};class s0{constructor(){this.promise=new s0.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}s0.promiseConstructor=Promise;function pb(t){const e=t.split(".");if(e.length!==3)throw new SN("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!KX.test(e[n]))throw new SN("JWT not in base64url format");return{header:JSON.parse(xO(e[0])),payload:JSON.parse(xO(e[1])),signature:Wc(e[2]),raw:{header:e[0],payload:e[1]}}}async function cZ(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function uZ(t,e){return new Promise((n,a)=>{(async()=>{for(let i=0;i<1/0;i++)try{const o=await t(i);if(!e(i,null,o)){n(o);return}}catch(o){if(!e(i,o)){a(o);return}}})()})}function dZ(t){return("0"+t.toString(16)).substr(-2)}function fZ(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let a="";for(let i=0;i<56;i++)a+=r.charAt(Math.floor(Math.random()*n));return a}return crypto.getRandomValues(e),Array.from(e,dZ).join("")}async function hZ(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),a=new Uint8Array(n);return Array.from(a).map(i=>String.fromCharCode(i)).join("")}async function mZ(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code
668challenge method will default to use plain instead of sha256."),t;const r=await hZ(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function xc(t,e,r=!1){const n=fZ();let a=n;r&&(a+="/PASSWORD_RECOVERY"),await Oc(t,`${e}-code-verifier`,a);const i=await mZ(n);return[i,n===i?"plain":"s256"]}const pZ=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function gZ(t){const e=t.headers.get(jN);if(!e||!e.match(pZ))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function vZ(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function xZ(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const yZ=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function yc(t){if(!yZ.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function gb(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function bZ(t,e){return new Proxy(t,{get:(r,n,a)=>{if(n==="__isInsecureUserWarningProxy")return!0;if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,a)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,a)}})}function yO(t){return JSON.parse(JSON.stringify(t))}const el=t=>t.msg||t.message||t.error_description||t.error||JSON.stringify(t),wZ=[502,503,504];async function bO(t){var e;if(!lZ(t))throw new NN(el(t),0);if(wZ.includes(t.status))throw new NN(el(t),t.status);let r;try{r=await t.json()}catch(i){throw new ol(el(i),i)}let n;const a=gZ(t);if(a&&a.getTime()>=m6["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new pO(el(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new Bn}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,o)=>i&&typeof o=="string",!0))throw new pO(el(r),t.status,r.weak_password.reasons);throw new XX(el(r),t.status||500,n)}const _Z=(t,e,r,n)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),a.body=JSON.stringify(n),Object.assign(Object.assign({},a),r))};async function st(t,e,r,n){var a;const i=Object.assign({},n==null?void 0:n.headers);
668i[jN]||(i[jN]=m6["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const o=(a=n==null?void 0:n.query)!==null&&a!==void 0?a:{};n!=null&&n.redirectTo&&(o.redirect_to=n.redirectTo);const l=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",u=await jZ(t,e,r+l,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(u):{data:Object.assign({},u),error:null}}async function jZ(t,e,r,n,a,i){const o=_Z(e,n,a,i);let l;try{l=await t(r,Object.assign({},o))}catch(u){throw console.error(u),new NN(el(u),0)}if(l.ok||await bO(l),n!=null&&n.noResolveJson)return l;try{return await l.json()}catch(u){await bO(u)}}function Va(t){var e;let r=null;CZ(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=sZ(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:t;return{data:{session:r,user:n},error:null}}function wO(t){const e=Va(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function to(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function NZ(t){return{data:t,error:null}}function SZ(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:a,verification_type:i}=t,o=No(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),l={action_link:e,email_otp:r,hashed_token:n,redirect_to:a,verification_type:i},u=Object.assign({},o);return{data:{properties:l,user:u},error:null}}function _O(t){return t}function CZ(t){return t.access_token&&t.refresh_token&&t.expires_in}const vb=["global","local","others"];class kZ{constructor({url:e="",headers:r={},fetch:n}){this.url=e,this.headers=r,this.fetch=v6(n),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(e,r=vb[0]){if(vb.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${vb.join(", ")}`);try{return await st(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ze(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await st(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:to})}catch(n){if(Ze(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=No(e,["options"]),a=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(a.new_email=n==null?void 0:n.newEmail,delete a.newEmail),await st(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:SZ,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(Ze(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await st(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:to})}catch(r){if(Ze(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,a,i,o,l,u;try{const d={nextPage:null,lastPage:0,total:0},h=await st(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(a=e==null?void 0:e.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:_O});if(h.error)throw h.error;const m=await h.json(),p=(o=h.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(b=>{const y=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(b.split(";")[1].split("=")[1]);d[`${x}Page`]=y}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},m),d),error:null}}catch(d){if(Ze(d))return{data:{users:[]},error:d};throw d}}async getUserById(e){yc(e);try{return await st(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:to})}catch(r){if(Ze(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){yc(e);try{return await st(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:to})}catch(n){if(Ze(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){yc(e);
668try{return await st(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:to})}catch(n){if(Ze(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){yc(e.userId);try{const{data:r,error:n}=await st(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:r,error:n}}catch(r){if(Ze(r))return{data:null,error:r};throw r}}async _deleteFactor(e){yc(e.userId),yc(e.id);try{return{data:await st(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(Ze(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,a,i,o,l,u;try{const d={nextPage:null,lastPage:0,total:0},h=await st(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(a=e==null?void 0:e.perPage)===null||a===void 0?void 0:a.toString())!==null&&i!==void 0?i:""},xform:_O});if(h.error)throw h.error;const m=await h.json(),p=(o=h.headers.get("x-total-count"))!==null&&o!==void 0?o:0,v=(u=(l=h.headers.get("link"))===null||l===void 0?void 0:l.split(","))!==null&&u!==void 0?u:[];return v.length>0&&(v.forEach(b=>{const y=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),x=JSON.parse(b.split(";")[1].split("=")[1]);d[`${x}Page`]=y}),d.total=parseInt(p)),{data:Object.assign(Object.assign({},m),d),error:null}}catch(d){if(Ze(d))return{data:{clients:[]},error:d};throw d}}async _createOAuthClient(e){try{return await st(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ze(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await st(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ze(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await st(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ze(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await st(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ze(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await st(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ze(r))return{data:null,error:r};throw r}}}function jO(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}const bc={debug:!!(globalThis&&g6()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class x6 extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}class EZ extends x6{}async function AZ(t,e,r){bc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",t,e);const n=new globalThis.AbortController;return e>0&&setTimeout(()=>{n.abort(),bc.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",t)},e),await Promise.resolve().then(()=>globalThis.navigator.locks.request(t,e===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:n.signal},async a=>{if(a){bc.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",t,a.name);try{return await r()}finally{bc.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",t,a.name)}}else{if(e===0)throw bc.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",t),new EZ(`Acquiring an exclusive Navigator LockManager lock "${t}" immediately failed`);if(bc.debug)try{const i=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(i,null," "))}catch(i){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",i)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await r()}}))}function PZ(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function y6(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}
668" is invalid.`);return t.toLowerCase()}function TZ(t){return parseInt(t,16)}function OZ(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function MZ(t){var e;const{chainId:r,domain:n,expirationTime:a,issuedAt:i=new Date,nonce:o,notBefore:l,requestId:u,resources:d,scheme:h,uri:m,version:p}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(o&&o.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${o}`);if(!m)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(p!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${p}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(` 669`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const v=y6(t.address),b=h?`${h}://${n}`:n,y=t.statement?`${t.statement} 670`:"",x=`${b} wants you to sign in with your Ethereum account: 671${v} 672 673${y}`;let j=`URI: ${m} 674Version: ${p} 675Chain ID: ${r}${o?` 676Nonce: ${o}`:""} 677Issued At: ${i.toISOString()}`;if(a&&(j+=` 678Expiration Time: ${a.toISOString()}`),l&&(j+=` 679Not Before: ${l.toISOString()}`),u&&(j+=` 680Request ID: ${u}`),d){let N=` 681Resources:`;for(const S of d){if(!S||typeof S!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${S}`);N+=` 682- ${S}`}j+=N}return`${x} 683${j}`}class br extends Error{constructor({message:e,code:r,cause:n,name:a}){var i;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=a??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}}class Ng extends br{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function RZ({error:t,options:e}){var r,n,a;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new br({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new br({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new br({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((a=i.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new br({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new br({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new br({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(l=>l.type==="public-key").length===0?new br({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new br({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const o=window.location.hostname;if(b6(o)){if(i.rp.id!==o)return new br({message:`The RP ID "${i.rp.id}
683" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new br({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new br({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new br({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new br({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function IZ({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new br({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new br({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(b6(n)){if(r.rpId!==n)return new br({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new br({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new br({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new br({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class DZ{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const $Z=new DZ;function LZ(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,a=No(t,["challenge","user","excludeCredentials"]),i=Wc(e).buffer,o=Object.assign(Object.assign({},r),{id:Wc(r.id).buffer}),l=Object.assign(Object.assign({},a),{challenge:i,user:o});if(n&&n.length>0){l.excludeCredentials=new Array(n.length);for(let u=0;u<n.length;u++){const d=n[u];l.excludeCredentials[u]=Object.assign(Object.assign({},d),{id:Wc(d.id).buffer,type:d.type||"public-key",transports:d.transports})}}return l}function FZ(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=No(t,["challenge","allowCredentials"]),a=Wc(e).buffer,i=Object.assign(Object.assign({},n),{challenge:a});if(r&&r.length>0){i.allowCredentials=new Array(r.length);for(let o=0;o<r.length;o++){const l=r[o];i.allowCredentials[o]=Object.assign(Object.assign({},l),{id:Wc(l.id).buffer,type:l.type||"public-key",transports:l.transports})}}return i}function BZ(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:cl(new Uint8Array(t.response.attestationObject)),clientDataJSON:cl(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function VZ(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),a=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:cl(new Uint8Array(a.authenticatorData)),clientDataJSON:cl(new Uint8Array(a.clientDataJSON)),signature:cl(new Uint8Array(a.signature)),userHandle:a.userHandle?cl(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function b6(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function NO(){var t,e;return!!(Hr()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function zZ(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ng("Browser returned unexpected credential type",e)}:{data:null,error:new Ng("Empty credential response",e)}}catch(e){return{data:null,error:RZ({error:e,options:t})}}}async function UZ(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ng("Browser returned unexpected credential type",e)}:{data:null,error:new Ng("Empty credential response",e)}}catch(e){return{data:null,error:IZ({error:e,options:t})}}}const qZ={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},WZ={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Sg(...t){const e=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),r=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),n={};for(const a of t)if(a)for(const i in a){const o=a[i];if(o!==void 0)if(Array.isArray(o))n[i]=o;else if(r(o))n[i]=o;else if(e(o)){const l=n[i];e(l)?n[i]=Sg(l,o):n[i]=Sg(o)}else n[i]=o}return n}function HZ(t,e){return Sg(qZ,t,e||{})}function GZ(t,e){return Sg(WZ,t,e||{})}class KZ{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:a},i){try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:l};const u=a??$Z.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:d}=o.webauthn.credential_options.publicKey;d.name||(d.name=`${d.id}:${n}`),d.displayName||(d.displayName=d.name)}switch(o.webauthn.type){case"create":{const d=HZ(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:h,error:m}=await zZ({publicKey:d,signal:u});return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:m}}case"request":{const d=GZ(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:h,error:m}=await UZ(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:d,signal:u}));return h?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:h}},error:null}:{data:null,error:m}}}}catch(o){return Ze(o)?{data:null,error:o}:{data:null,error:new ol("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!r)return{data:null,error:new Vf("rpId is required for WebAuthn authentication")};try{if(!NO())return{data:null,error:new ol("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:a},{request:i});if(!o)return{data:null,error:l};const{webauthn:u}=o;return this._verify({factorId:e,challengeId:o.challengeId,webauthn:{type:u.type,rpId:r,rpOrigins:n,credential_response:u.credential_response}})}catch(o){return Ze(o)?{data:null,error:o}:{data:null,error:new ol("Unexpected error in authenticate",o)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},i){if(!r)return{data:null,error:new Vf("rpId is required for WebAuthn registration")};try{if(!NO())return{data:null,error:new ol("Browser does not support WebAuthn",null)};const{data:o,error:l}=await this._enroll({friendlyName:e});if(!o)return await this.client.mfa.listFactors().then(h=>{var m;return(m=h.data)===null||m===void 0?void 0:m.all.find(p=>p.factor_type==="webauthn"&&p.friendly_name===e&&p.status!=="unverified")}).then(h=>h?this.client.mfa.unenroll({factorId:h==null?void 0:h.id}):void 0),{data:null,error:l};const{data:u,error:d}=await this._challenge({factorId:o.id,friendlyName:o.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:a},{create:i});return u?this._verify({factorId:o.id,challengeId:u.challengeId,webauthn:{rpId:r,rpOrigins:n,type:u.webauthn.type,credential_response:u.webauthn.credential_response}}):{data:null,error:d}}catch(o){return Ze(o)?{data:null,error:o}:{data:null,error:new ol("Unexpected error in register",o)}}}}PZ();const YZ={url:WX,storageKey:HX,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:GX,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1};async function SO(t,e,r){return await r()}const wc={};class zf{get jwks(){var e,r;return(r=(e=wc[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){wc[this.storageKey]=Object.assign(Object.assign({},wc[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=wc[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){wc[this.storageKey]=Object.assign(Object.assign({},wc[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},YZ),e);if(this.storageKey=i.storageKey,this.instanceID=(r=zf.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,zf.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&Hr()){const o=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(o),this.logDebugMessages&&console.trace(o)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.admin=new kZ({url:i.url,headers:i.headers,fetch:i.fetch}),this.url=i.url,this.headers=i.headers,this.fetch=v6(i.fetch),this.lock=i.lock||SO,this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,i.lock?this.lock=i.lock:Hr()&&(!((n=globalThis==null?void 0:globalThis.navigator)===null||n===void 0)&&n.locks)?this.lock=AZ:this.lock=SO,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new KZ(this)}
683,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:g6()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=jO(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=jO(this.memoryStorage)),Hr()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(o){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",o)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async o=>{this._debug("received broadcast notification from other tab or client",o),await this._notifyAllSubscribers(o.data.event,o.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${h6}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(Hr()&&(r=oZ(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),Hr()&&this.detectSessionInUrl&&n!=="none"){const{data:a,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),JX(i)){const u=(e=i.details)===null||e===void 0?void 0:e.code;if(u==="identity_already_exists"||u==="identity_not_found"||u==="single_identity_not_deletable")return{error:i}}return await this._removeSession(),{error:i}}const{session:o,redirectType:l}=a;return this._debug("#_initialize()","detected session in URL",o,"redirect type",l),await this._saveSession(o),setTimeout(async()=>{l==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",o):await this._notifyAllSubscribers("SIGNED_IN",o)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return Ze(r)?this._returnResult({error:r}):this._returnResult({error:new ol("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,a;try{const i=await st(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(a=e==null?void 0:e.options)===null||a===void 0?void 0:a.captchaToken}},xform:Va}),{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(i){if(Ze(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var r,n,a;try{let i;if("email"in e){const{email:h,password:m,options:p}=e;let v=null,b=null;this.flowType==="pkce"&&([v,b]=await xc(this.storage,this.storageKey)),i=await st(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:p==null?void 0:p.emailRedirectTo,body:{email:h,password:m,data:(r=p==null?void 0:p.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken},code_challenge:v,code_challenge_method:b},xform:Va})}else if("phone"in e){const{phone:h,password:m,options:p}=e;i=await st(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:m,data:(n=p==null?void 0:p.data)!==null&&n!==void 0?n:{},channel:(a=p==null?void 0:p.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:p==null?void 0:p.captchaToken}},xform:Va})}else throw new kp("You must provide either an email or phone number and a password");const{data:o,error:l}=i;if(l||!o)return this._returnResult({data:{user:null,session:null},error:l});const u=o.session,d=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(i){if(Ze(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let r;if("email"in e){const{email:i,password:o,options:l}=e;r=await st(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:wO})}else if("phone"in e){const{phone:i,password:o,options:l}=e;r=await st(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:o,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:wO})}else throw new kp("You must provide either an email or phone number and a password");const{data:n,error:a}=r;if(a)return this._returnResult({data:{user:null,session:null},error:a});
683if(!n||!n.session||!n.user){const i=new vc;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:a})}catch(r){if(Ze(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,a,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,a,i,o,l,u,d,h,m,p;let v,b;if("message"in e)v=e.message,b=e.signature;else{const{chain:y,wallet:x,statement:j,options:N}=e;let S;if(Hr())if(typeof x=="object")S=x;else{const I=window;if("ethereum"in I&&typeof I.ethereum=="object"&&"request"in I.ethereum&&typeof I.ethereum.request=="function")S=I.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof x!="object"||!(N!=null&&N.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");S=x}const k=new URL((r=N==null?void 0:N.url)!==null&&r!==void 0?r:window.location.href),C=await S.request({method:"eth_requestAccounts"}).then(I=>I).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!C||C.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const A=y6(C[0]);let T=(n=N==null?void 0:N.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!T){const I=await S.request({method:"eth_chainId"});T=TZ(I)}const R={domain:k.host,address:A,statement:j,uri:k.href,version:"1",chainId:T,nonce:(a=N==null?void 0:N.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(o=(i=N==null?void 0:N.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&o!==void 0?o:new Date,expirationTime:(l=N==null?void 0:N.signInWithEthereum)===null||l===void 0?void 0:l.expirationTime,notBefore:(u=N==null?void 0:N.signInWithEthereum)===null||u===void 0?void 0:u.notBefore,requestId:(d=N==null?void 0:N.signInWithEthereum)===null||d===void 0?void 0:d.requestId,resources:(h=N==null?void 0:N.signInWithEthereum)===null||h===void 0?void 0:h.resources};v=MZ(R),b=await S.request({method:"personal_sign",params:[OZ(v),A]})}try{const{data:y,error:x}=await st(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:v,signature:b},!((m=e.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(p=e.options)===null||p===void 0?void 0:p.captchaToken}}:null),xform:Va});if(x)throw x;if(!y||!y.session||!y.user){const j=new vc;return this._returnResult({data:{user:null,session:null},error:j})}return y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("SIGNED_IN",y.session)),this._returnResult({data:Object.assign({},y),error:x})}catch(y){if(Ze(y))return this._returnResult({data:{user:null,session:null},error:y});throw y}}async signInWithSolana(e){var r,n,a,i,o,l,u,d,h,m,p,v;let b,y;if("message"in e)b=e.message,y=e.signature;else{const{chain:x,wallet:j,statement:N,options:S}=e;let k;if(Hr())if(typeof j=="object")k=j;else{const A=window;if("solana"in A&&typeof A.solana=="object"&&("signIn"in A.solana&&typeof A.solana.signIn=="function"||"signMessage"in A.solana&&typeof A.solana.signMessage=="function"))k=A.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof j!="object"||!(S!=null&&S.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");k=j}const C=new URL((r=S==null?void 0:S.url)!==null&&r!==void 0?r:window.location.href);
683if("signIn"in k&&k.signIn){const A=await k.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},S==null?void 0:S.signInWithSolana),{version:"1",domain:C.host,uri:C.href}),N?{statement:N}:null));let T;if(Array.isArray(A)&&A[0]&&typeof A[0]=="object")T=A[0];else if(A&&typeof A=="object"&&"signedMessage"in A&&"signature"in A)T=A;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in T&&"signature"in T&&(typeof T.signedMessage=="string"||T.signedMessage instanceof Uint8Array)&&T.signature instanceof Uint8Array)b=typeof T.signedMessage=="string"?T.signedMessage:new TextDecoder().decode(T.signedMessage),y=T.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in k)||typeof k.signMessage!="function"||!("publicKey"in k)||typeof k!="object"||!k.publicKey||!("toBase58"in k.publicKey)||typeof k.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${C.host} wants you to sign in with your Solana account:`,k.publicKey.toBase58(),...N?["",N,""]:[""],"Version: 1",`URI: ${C.href}`,`Issued At: ${(a=(n=S==null?void 0:S.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((i=S==null?void 0:S.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${S.signInWithSolana.notBefore}`]:[],...!((o=S==null?void 0:S.signInWithSolana)===null||o===void 0)&&o.expirationTime?[`Expiration Time: ${S.signInWithSolana.expirationTime}`]:[],...!((l=S==null?void 0:S.signInWithSolana)===null||l===void 0)&&l.chainId?[`Chain ID: ${S.signInWithSolana.chainId}`]:[],...!((u=S==null?void 0:S.signInWithSolana)===null||u===void 0)&&u.nonce?[`Nonce: ${S.signInWithSolana.nonce}`]:[],...!((d=S==null?void 0:S.signInWithSolana)===null||d===void 0)&&d.requestId?[`Request ID: ${S.signInWithSolana.requestId}`]:[],...!((m=(h=S==null?void 0:S.signInWithSolana)===null||h===void 0?void 0:h.resources)===null||m===void 0)&&m.length?["Resources",...S.signInWithSolana.resources.map(T=>`- ${T}`)]:[]].join(` 684`);const A=await k.signMessage(new TextEncoder().encode(b),"utf8");if(!A||!(A instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");y=A}}try{const{data:x,error:j}=await st(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:cl(y)},!((p=e.options)===null||p===void 0)&&p.captchaToken?{gotrue_meta_security:{captcha_token:(v=e.options)===null||v===void 0?void 0:v.captchaToken}}:null),xform:Va});if(j)throw j;if(!x||!x.session||!x.user){const N=new vc;return this._returnResult({data:{user:null,session:null},error:N})}return x.session&&(await this._saveSession(x.session),await this._notifyAllSubscribers("SIGNED_IN",x.session)),this._returnResult({data:Object.assign({},x),error:j})}catch(x){if(Ze(x))return this._returnResult({data:{user:null,session:null},error:x});throw x}}async _exchangeCodeForSession(e){const r=await Xo(this.storage,`${this.storageKey}-code-verifier`),[n,a]=(r??"").split("/");try{const{data:i,error:o}=await st(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:Va});if(await Wi(this.storage,`${this.storageKey}-code-verifier`),o)throw o;if(!i||!i.session||!i.user){const l=new vc;return this._returnResult({data:{user:null,session:null,redirectType:null},error:l})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers("SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:a??null}),error:o})}catch(i){if(Ze(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:r,provider:n,token:a,access_token:i,nonce:o}=e,l=await st(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:a,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:Va}),{data:u,error:d}=l;if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!u||!u.session||!u.user){const h=new vc;return this._returnResult({data:{user:null,session:null},error:h})}return u.session&&(await this._saveSession(u.session),await this._notifyAllSubscribers("SIGNED_IN",u.session)),this._returnResult({data:u,error:d})}catch(r){if(Ze(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,a,i,o;try{if("email"in e){const{email:l,options:u}=e;let d=null,h=null;this.flowType==="pkce"&&([d,h]=await xc(this.storage,this.storageKey));const{error:m}=await st(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:l,data:(r=u==null?void 0:u.data)!==null&&r!==void 0?r:{},create_user:(n=u==null?void 0:u.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:d,code_challenge_method:h},redirectTo:u==null?void 0:u.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:m})}if("phone"in e){const{phone:l,options:u}=e,{data:d,error:h}=await st(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:l,data:(a=u==null?void 0:u.data)!==null&&a!==void 0?a:{},create_user:(i=u==null?void 0:u.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},channel:(o=u==null?void 0:u.channel)!==null&&o!==void 0?o:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:d==null?void 0:d.message_id},error:h})}throw new kp("You must provide either an email or phone number.")}catch(l){if(Ze(l))return this._returnResult({data:{user:null,session:null},error:l});throw l}}async verifyOtp(e){var r,n;try{let a,i;"options"in e&&(a=(r=e.options)===null||r===void 0?void 0:r.redirectTo,i=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:o,error:l}=await st(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:a,xform:Va});if(l)throw l;if(!o)throw new Error("An error occurred on token verification.");const u=o.session,d=o.user;return u!=null&&u.access_token&&(await this._saveSession(u),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",u)),this._returnResult({data:{user:d,session:u},error:null})}catch(a){if(Ze(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(e){var r,n,a,i,o;try{let l=null,u=null;this.flowType==="pkce"&&([l,u]=await xc(this.storage,this.storageKey));const d=await st(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((a=e==null?void 0:e.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:l,code_challenge_method:u}),headers:this.headers,xform:NZ});return!((i=d.data)===null||i===void 0)&&i.url&&Hr()&&!(!((o=e.options)===null||o===void 0)&&o.skipBrowserRedirect)&&window.location.assign(d.data.url),this._returnResult(d)}catch(l){if(Ze(l))return this._returnResult({data:null,error:l});throw l}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new Bn;const{error:a}=await st(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(e){if(Ze(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:a,options:i}=e,{error:o}=await st(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}},redirectTo:i==null?void 0:i.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:o})}else if("phone"in e){const{phone:n,type:a,options:i}=e,{data:o,error:l}=await st(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:a,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:l})}throw new kp("You must provide either an email or phone number and a type")}catch(r){if(Ze(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,await this._acquireLock(-1,async()=>this._useSession(async r=>r))}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await Xo(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not val
684id"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<hb:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const o=await Xo(this.userStorage,this.storageKey+"-user");o!=null&&o.user?e.user=o.user:e.user=gb()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const o={value:this.suppressGetSessionWarning};e.user=bZ(e.user,o),o.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:a,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{session:null},error:i}):this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,await this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await st(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:to}):await this._useSession(async r=>{var n,a,i;const{data:o,error:l}=r;if(l)throw l;return!(!((n=o.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Bn}:await st(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(a=o.session)===null||a===void 0?void 0:a.access_token)!==null&&i!==void 0?i:void 0,xform:to})})}catch(r){if(Ze(r))return QX(r)&&(await this._removeSession(),await Wi(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,r))}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:a,error:i}=n;if(i)throw i;if(!a.session)throw new Bn;const o=a.session;let l=null,u=null;this.flowType==="pkce"&&e.email!=null&&([l,u]=await xc(this.storage,this.storageKey));const{data:d,error:h}=await st(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:l,code_challenge_method:u}),jwt:o.access_token,xform:to});if(h)throw h;return o.user=d.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),this._returnResult({data:{user:o.user},error:null})})}catch(n){if(Ze(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Bn;const r=Date.now()/1e3;let n=r,a=!0,i=null;const{payload:o}=pb(e.access_token);if(o.exp&&(n=o.exp,a=n<=r),a){const{data:l,error:u}=await this._callRefreshToken(e.refresh_token);if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l)return{data:{user:null,session:null},error:null};i=l}else{const{data:l,error:u}=await this._getUser(e.access_token);if(u)throw u;i={access_token:e.access_token,refresh_token:e.refresh_token,user:l.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(Ze(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:o,error:l}=r;if(l)throw l;e=(n=o.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new Bn;const{data:a,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(Ze(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){try{if(!Hr())throw new Ep("No browser detected.");
684if(e.error||e.error_description||e.error_code)throw new Ep(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new mO("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Ep("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new mO("No code detected.");const{data:N,error:S}=await this._exchangeCodeForSession(e.code);if(S)throw S;const k=new URL(window.location.href);return k.searchParams.delete("code"),window.history.replaceState(window.history.state,"",k.toString()),{data:{session:N.session,redirectType:null},error:null}}const{provider_token:n,provider_refresh_token:a,access_token:i,refresh_token:o,expires_in:l,expires_at:u,token_type:d}=e;if(!i||!l||!o||!d)throw new Ep("No session defined in URL");const h=Math.round(Date.now()/1e3),m=parseInt(l);let p=h+m;u&&(p=parseInt(u));const v=p-h;v*1e3<=Tc&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${v}s, should have been closer to ${m}s`);const b=p-m;h-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,p,h):h-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,p,h);const{data:y,error:x}=await this._getUser(i);if(x)throw x;const j={provider_token:n,provider_refresh_token:a,access_token:i,expires_in:m,expires_at:p,refresh_token:o,token_type:d,user:y.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:j,redirectType:e.type},error:null})}catch(n){if(Ze(n))return this._returnResult({data:{session:null,redirectType:null},error:n});throw n}}_isImplicitGrantCallback(e){return!!(e.access_token||e.error_description)}async _isPKCECallback(e){const r=await Xo(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:a,error:i}=r;if(i)return this._returnResult({error:i});const o=(n=a.session)===null||n===void 0?void 0:n.access_token;if(o){const{error:l}=await this.admin.signOut(o,e);if(l&&!(ZX(l)&&(l.status===404||l.status===401||l.status===403)))return this._returnResult({error:l})}return e!=="others"&&(await this._removeSession(),await Wi(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=iZ(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(r)})))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,a;try{const{data:{session:i},error:o}=r;if(o)throw o;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((a=this.stateChangeEmitters.get(e))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),console.error(i)}})}async resetPasswordForEmail(e,r={}){let n=null,a=null;this.flowType==="pkce"&&([n,a]=await xc(this.storage,this.storageKey,!0));try{return await st(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:a,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(Ze(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:a}=await this._useSession(async i=>{var o,l,u,d,h;const{data:m,error:p}=i;if(p)throw p;const v=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(o=e.options)===null||o===void 0?void 0:o.redirectTo,scopes:(l=e.options)===null||l===void 0?void 0:l.scopes,queryParams:(u=e.options)===null||u===void 0?void 0:u.queryParams,skipBrowserRedirect:!0});return await st(this.fetch,"GET",v,{headers:this.headers,jwt:(h=(d=m.session)===null||d===void 0?void 0:d.access_token)!==null&&h!==void 0?h:void 0})});if(a)throw a;return Hr()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(Ze(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:a,data:{session:i}}=r;if(a)throw a;const{options:o,provider:l,token:u,access_token:d,nonce:h}=e,m=await st(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:l,id_token:u,access_token:d,nonce:h,link_identity:!0,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:Va}),{data:p,error:v}=m;return v?this._returnResult({data:{user:null,session:null},error:v}):!p||!p.session||!p.user?this._returnResult({data:{user:null,session:null},error:new vc}):(p.session&&(await this._saveSession(p.session),await this._notifyAllSubscribers("USER_UPDATED",p.session)),this._returnResult({data:p,error:v}))}catch(a){if(Ze(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,a;const{data:i,error:o}=r;if(o)throw o;
684return await st(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(a=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&a!==void 0?a:void 0})})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(r,"begin");try{const n=Date.now();return await uZ(async a=>(a>0&&await cZ(200*Math.pow(2,a-1)),this._debug(r,"refreshing attempt",a),await st(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:Va})),(a,i)=>{const o=200*Math.pow(2,a);return i&&mb(i)&&Date.now()+o-n<Tc})}catch(n){if(this._debug(r,"error",n),Ze(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),Hr()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const a=await Xo(this.storage,this.storageKey);if(a&&this.userStorage){let o=await Xo(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!o&&(o={user:a.user},await Oc(this.userStorage,this.storageKey+"-user",o)),a.user=(e=o==null?void 0:o.user)!==null&&e!==void 0?e:gb()}else if(a&&!a.user&&!a.user){const o=await Xo(this.storage,this.storageKey+"-user");o&&(o!=null&&o.user)?(a.user=o.user,await Wi(this.storage,this.storageKey+"-user"),await Oc(this.storage,this.storageKey,a)):a.user=gb()}if(this._debug(n,"session from storage",a),!this._isValidSession(a)){this._debug(n,"session is not valid"),a!==null&&await this._removeSession();return}const i=((r=a.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<hb;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${hb}s`),i){if(this.autoRefreshToken&&a.refresh_token){const{error:o}=await this._callRefreshToken(a.refresh_token);o&&(console.error(o),mb(o)||(this._debug(n,"refresh failed with a non-retryable error, removing the session",o),await this._removeSession()))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:o,error:l}=await this._getUser(a.access_token);!l&&(o!=null&&o.user)?(a.user=o.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(o){console.error("Error getting user data:",o),this._debug(n,"error getting user data, skipping SIGNED_IN notification",o)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(n,"error",a),console.error(a);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new Bn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const a=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(a,"begin");try{this.refreshingDeferred=new s0;const{data:i,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!i.session)throw new Bn;await this._saveSession(i.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",i.session);const l={data:i.session,error:null};return this.refreshingDeferred.resolve(l),l}catch(i){if(this._debug(a,"error",i),Ze(i)){const o={data:null,error:i};return mb(i)||await this._removeSession(),(r=this.refreshingDeferred)===null||r===void 0||r.resolve(o),o}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(e,r,n=!0){const a=`#_notifyAllSubscribers(${e})`;this._debug(a,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const i=[],o=Array.from(this.stateChangeEmitters.values()).map(async l=>{try{await l.callback(e,r)}catch(u){i.push(u)}});if(await Promise.all(o),i.length>0){for(let l=0;l<i.length;l+=1)console.error(i[l]);throw i[0]}}finally{this._debug(a,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0;const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Oc(this.userStorage,this.storageKey+"-user",{user:r.user});const a=Object.assign({},r);delete a.user;const i=yO(a);await Oc(this.storage,this.storageKey,i)}else{const a=yO(r);await Oc(this.storage,this.storageKey,a)}}async _removeSession(){this._debug("#_removeSession()"),await Wi(this.storage,this.storageKey),await Wi(this.storage,this.storageKey+"-code-verifier"),await Wi(this.storage,this.storageKey+"-user"),this.userStorage&&await Wi(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&Hr()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}
684catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Tc);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((n.expires_at*1e3-e)/Tc);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${Tc}ms, refresh threshold is ${_N} ticks`),a<=_N&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof x6)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!Hr()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const a=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&a.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&a.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,o]=await xc(this.storage,this.storageKey),l=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(o)}`});a.push(l.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);a.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&a.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${a.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:a,error:i}=r;return i?this._returnResult({data:null,error:i}):await st(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,a;const{data:i,error:o}=r;if(o)return this._returnResult({data:null,error:o});const l=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:u,error:d}=await st(this.fetch,"POST",`${this.url}/factors`,{body:l,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return d?this._returnResult({data:null,error:d}):(e.factorType==="totp"&&u.type==="totp"&&(!((a=u==null?void 0:u.totp)===null||a===void 0)&&a.qr_code)&&(u.totp.qr_code=`data:image/svg+xml;utf-8,${u.totp.qr_code}`),this._returnResult({data:u,error:null}))})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:a,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?BZ(e.webauthn.credential_response):VZ(e.webauthn.credential_response)})}:{code:e.code}),{data:l,error:u}=await st(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:u}))})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async r=>{var n;const{data:a,error:i}=r;if(i)return this._returnResult({data:null,error:i});const o=await st(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(n=a==null?void 0:a.session)===null||n===void 0?void 0:n.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:LZ(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:FZ(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}})}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const a={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])a.all.push(i),i.status==="verified"&&a[i.factor_type].push(i);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(){var e,r;const{data:{session:n},error:a}
684=await this.getSession();if(a)return this._returnResult({data:null,error:a});if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:i}=pb(n.access_token);let o=null;i.aal&&(o=i.aal);let l=o;((r=(e=n.user.factors)===null||e===void 0?void 0:e.filter(h=>h.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(l="aal2");const d=i.amr||[];return{data:{currentLevel:o,nextLevel:l,currentAuthenticationMethods:d},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;return a?this._returnResult({data:null,error:a}):n?await st(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new Bn})})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new Bn});const o=await st(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Hr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(Ze(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:a},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!a)return this._returnResult({data:null,error:new Bn});const o=await st(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:l=>({data:l,error:null})});return o.data&&o.data.redirect_url&&Hr()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(o.data.redirect_url),o})}catch(n){if(Ze(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await st(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Bn})})}catch(e){if(Ze(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:a}=r;return a?this._returnResult({data:null,error:a}):n?await st(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},xform:()=>({data:{},error:null})}):this._returnResult({data:null,error:new Bn})})}catch(r){if(Ze(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(l=>l.kid===e);if(n)return n;const a=Date.now();if(n=this.jwks.keys.find(l=>l.kid===e),n&&this.jwks_cached_at+YX>a)return n;const{data:i,error:o}=await st(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(o)throw o;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=a,n=i.keys.find(l=>l.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:v,error:b}
684=await this.getSession();if(b||!v.session)return this._returnResult({data:null,error:b});n=v.session.access_token}const{header:a,payload:i,signature:o,raw:{header:l,payload:u}}=pb(n);r!=null&&r.allowExpired||vZ(i.exp);const d=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!d){const{error:v}=await this.getUser(n);if(v)throw v;return{data:{claims:i,header:a,signature:o},error:null}}const h=xZ(a.alg),m=await crypto.subtle.importKey("jwk",d,h,!0,["verify"]);if(!await crypto.subtle.verify(h,m,o,aZ(`${l}.${u}`)))throw new SN("Invalid JWT signature");return{data:{claims:i,header:a,signature:o},error:null}}catch(n){if(Ze(n))return this._returnResult({data:null,error:n});throw n}}}zf.nextInstanceID={};const XZ=zf;class ZZ extends XZ{constructor(e){super(e)}}class QZ{constructor(e,r,n){var a,i,o;this.supabaseUrl=e,this.supabaseKey=r;const l=qX(e);if(!r)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",l),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",l),this.storageUrl=new URL("storage/v1",l),this.functionsUrl=new URL("functions/v1",l);const u=`sb-${l.hostname.split(".")[0]}-auth-token`,d={db:DX,realtime:LX,auth:Object.assign(Object.assign({},$X),{storageKey:u}),global:IX},h=UX(n??{},d);this.storageKey=(a=h.auth.storageKey)!==null&&a!==void 0?a:"",this.headers=(i=h.global.headers)!==null&&i!==void 0?i:{},h.accessToken?(this.accessToken=h.accessToken,this.auth=new Proxy({},{get:(m,p)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(p)} is not possible`)}})):this.auth=this._initSupabaseAuthClient((o=h.auth)!==null&&o!==void 0?o:{},this.headers,h.global.fetch),this.fetch=VX(r,this._getAccessToken.bind(this),h.global.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers,accessToken:this._getAccessToken.bind(this)},h.realtime)),this.accessToken&&this.accessToken().then(m=>this.realtime.setAuth(m)).catch(m=>console.warn("Failed to set initial Realtime auth token:",m)),this.rest=new WY(new URL("rest/v1",l).href,{headers:this.headers,schema:h.db.schema,fetch:this.fetch}),this.storage=new OX(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),h.accessToken||this._listenForAuthEvents()}get functions(){return new VY(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,r={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,r,n)}channel(e,r={config:{}}){return this.realtime.channel(e,r)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e,r;if(this.accessToken)return await this.accessToken();const{data:n}=await this.auth.getSession();return(r=(e=n.session)===null||e===void 0?void 0:e.access_token)!==null&&r!==void 0?r:this.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:a,userStorage:i,storageKey:o,flowType:l,lock:u,debug:d,throwOnError:h},m,p){const v={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new ZZ({url:this.authUrl.href,headers:Object.assign(Object.assign({},v),m),storageKey:o,autoRefreshToken:e,persistSession:r,detectSessionInUrl:n,storage:a,userStorage:i,flowType:l,lock:u,debug:d,throwOnError:h,fetch:p,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new lX(this.realtimeUrl.href,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((r,n)=>{this._handleTokenChanged(r,"CLIENT",n==null?void 0:n.access_token)})}_handleTokenChanged(e,r,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),r=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const JZ=(t,e,r)=>new QZ(t,e,r);function eQ(){if(typeof window<"u"||typeof process>"u")return!1;const t=process.version;if(t==null)return!1;const e=t.match(/^v(\d+)\./);return e?parseInt(e[1],10)<=18:!1}eQ()&&console.warn("â ï¸ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
684ode.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");function tQ(){var x,j;if(typeof window>"u")return;const t=location.hostname,r=["lovableproject.com","lovableproject-dev.com","lovable.app","gpt-eng.com","gptengineer.run"].some(N=>t===N||t.endsWith("."+N)),n="[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}",a=r?((x=t.match(new RegExp("^(?:id-preview(?:-[a-z0-9]+)?|project)--("+n+")(?:-dev)?(?=\\.|$)","i")))==null?void 0:x[1])??((j=t.match(new RegExp("^("+n+")(?=[.-])","i")))==null?void 0:j[1]):void 0,i=window.parent&&window.parent!==window;if(!a||!i)return localStorage;const o=t.endsWith(".lovableproject-dev.com")||t.endsWith(".gpt-eng.com"),l=o?/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/:/^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/,u=location.ancestorOrigins&&location.ancestorOrigins[0]||(document.referrer?new URL(document.referrer).origin:""),d=u&&l.test(u)?[u]:o?["https://lovable.dev","http://localhost:3000"]:["https://lovable.dev"],h="lovable-preview-auth:result",m=2e3,p=()=>Math.random().toString(36).slice(2)+Date.now().toString(36),v=(N,S,k)=>new Promise(C=>{const A=p();let T=!1,R;const I=z=>{T||(T=!0,clearTimeout(R),window.removeEventListener("message",D),C(z))},D=z=>{if(d.indexOf(z.origin)<0)return;const H=z.data;H&&H.type===h&&H.requestId===A&&I(H)};window.addEventListener("message",D);const L={type:N,requestId:A,projectId:a,key:S};k!==void 0&&(L.value=k);for(const z of d)window.parent.postMessage(L,z);R=setTimeout(()=>I(null),m)});let b=!0;const y=250;return{getItem:async N=>{let S=await v("lovable-preview-auth:get",N);return!S&&b&&(await new Promise(k=>setTimeout(k,y)),S=await v("lovable-preview-auth:get",N)),b=!1,S&&S.ok&&typeof S.value=="string"?S.value===""?(localStorage.removeItem(N),null):S.value:localStorage.getItem(N)},setItem:(N,S)=>(localStorage.setItem(N,S),v("lovable-preview-auth:set",N,S).then(k=>{k&&k.ok&&typeof k.value=="string"&&localStorage.getItem(N)===S&&(k.value===""?localStorage.removeItem(N):localStorage.setItem(N,k.value))})),removeItem:N=>(localStorage.removeItem(N),v("lovable-preview-auth:remove",N).then(()=>{}))}}const rQ="https://wqwtmxciixqilaulodpv.supabase.co",CO="sb_publishable_epQ_hOInv_IuuUsqV_J6yg_FvOv30qr";function nQ(t){return t.startsWith("sb_publishable_")||t.startsWith("sb_secret_")}function aQ(t){return(e,r)=>{const n=new Headers(typeof Request<"u"&&e instanceof Request?e.headers:void 0);return r!=null&&r.headers&&new Headers(r.headers).forEach((a,i)=>n.set(i,a)),nQ(t)&&n.get("Authorization")===`Bearer ${t}`&&n.delete("Authorization"),n.set("apikey",t),fetch(e,{...r,headers:n})}}const ve=JZ(rQ,CO,{global:{fetch:aQ(CO)},auth:{storage:tQ(),persistSession:!0,autoRefreshToken:!0}}),w6=w.createContext(void 0),sQ=({children:t})=>{const[e,r]=w.useState(null),[n,a]=w.useState(null),[i,o]=w.useState(!0);w.useEffect(()=>{const{data:{subscription:h}}=ve.auth.onAuthStateChange((m,p)=>{a(p),r((p==null?void 0:p.user)??null),o(!1)});return ve.auth.getSession().then(({data:{session:m}})=>{a(m),r((m==null?void 0:m.user)??null),o(!1)}),()=>h.unsubscribe()},[]);const l=async(h,m,p)=>{const v=`${window.location.origin}/`,{data:b,error:y}=await ve.auth.signUp({email:h,password:m,options:{emailRedirectTo:v,data:{full_name:p||""}}});if(!y&&b.user)try{await ve.functions.invoke("initialize-system"),console.log("System initialized for new user")}catch(x){console.error("Error initializing system:",x)}return{error:y}},u=async(h,m)=>{const{error:p}=await ve.auth.signInWithPassword({email:h,password:m});return{error:p}},d=async()=>{const{error:h}=await ve.auth.signOut({scope:"local"});return a(null),r(null),{error:h}};return s.jsx(w6.Provider,{value:{user:e,session:n,loading:i,signUp:l,signIn:u,signOut:d},children:t})},Na=()=>{const t=w.useContext(w6);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},_6=w.createContext(void 0),iQ=({children:t})=>{const[e,r]=w.useState(""),[n,a]=w.useState(""),[i,o]=w.useState(!0),[l,u]=w.useState(!1),{user:d}=Na(),h=async()=>
vendor: 13,382 bytes, line 684
684{if(!d){o(!1);return}try{o(!0);const{data:p}=await ve.from("user_roles").select("role").eq("user_id",d.id).maybeSingle();u((p==null?void 0:p.role)==="admin");const{data:v,error:b}=await ve.from("nina_settings").select("company_name, sdr_name").limit(1).maybeSingle();if(b&&b.code!=="PGRST116")throw console.error("[useCompanySettings] Query error:",b),b;v?(r(v.company_name||"Sua Empresa"),a(v.sdr_name||"Agente")):(r("Sua Empresa"),a("Agente"))}catch(p){console.error("[useCompanySettings] Error:",p)}finally{o(!1)}};w.useEffect(()=>{h()},[d]);const m={companyName:e,sdrName:n,loading:i,isAdmin:l,refetch:h};return s.jsx(_6.Provider,{value:m,children:t})},Yu=()=>{const t=w.useContext(_6);if(t===void 0)throw new Error("useCompanySettings must be used within a CompanySettingsProvider");return t};function j6(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=j6(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Ct(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=j6(t))&&(n&&(n+=" "),n+=e);return n}const cC="-",oQ=t=>{const e=cQ(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{const l=o.split(cC);return l[0]===""&&l.length!==1&&l.shift(),N6(l,e)||lQ(o)},getConflictingClassGroupIds:(o,l)=>{const u=r[o]||[];return l&&n[o]?[...u,...n[o]]:u}}},N6=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const r=t[0],n=e.nextPart.get(r),a=n?N6(t.slice(1),n):void 0;if(a)return a;if(e.validators.length===0)return;const i=t.join(cC);return(o=e.validators.find(({validator:l})=>l(i)))==null?void 0:o.classGroupId},kO=/^\[(.+)\]$/,lQ=t=>{if(kO.test(t)){const e=kO.exec(t)[1],r=e==null?void 0:e.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},cQ=t=>{const{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return dQ(Object.entries(t.classGroups),r).forEach(([i,o])=>{CN(o,n,i,e)}),n},CN=(t,e,r,n)=>{t.forEach(a=>{if(typeof a=="string"){const i=a===""?e:EO(e,a);i.classGroupId=r;return}if(typeof a=="function"){if(uQ(a)){CN(a(n),e,r,n);return}e.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,o])=>{CN(o,EO(e,i),r,n)})})},EO=(t,e)=>{let r=t;return e.split(cC).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},uQ=t=>t.isThemeGetter,dQ=(t,e)=>e?t.map(([r,n])=>{const a=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,l])=>[e+o,l])):i);return[r,a]}):t,fQ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map;const a=(i,o)=>{r.set(i,o),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let o=r.get(i);if(o!==void 0)return o;if((o=n.get(i))!==void 0)return a(i,o),o},set(i,o){r.has(i)?r.set(i,o):a(i,o)}}},S6="!",hQ=t=>{const{separator:e,experimentalParseClassName:r}=t,n=e.length===1,a=e[0],i=e.length,o=l=>{const u=[];let d=0,h=0,m;for(let x=0;x<l.length;x++){let j=l[x];if(d===0){if(j===a&&(n||l.slice(x,x+i)===e)){u.push(l.slice(h,x)),h=x+i;continue}if(j==="/"){m=x;continue}}j==="["?d++:j==="]"&&d--}const p=u.length===0?l:l.substring(h),v=p.startsWith(S6),b=v?p.substring(1):p,y=m&&m>h?m-h:void 0;return{modifiers:u,hasImportantModifier:v,baseClassName:b,maybePostfixModifierPosition:y}};return r?l=>r({className:l,parseClassName:o}):o},mQ=t=>{if(t.length<=1)return t;const e=[];let r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},pQ=t=>({cache:fQ(t.cacheSize),parseClassName:hQ(t),...oQ(t)}),gQ=/\s+/,vQ=(t,e)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=e,i=[],o=t.trim().split(gQ);let l="";for(let u=o.length-1;u>=0;u-=1){const d=o[u],{modifiers:h,hasImportantModifier:m,baseClassName:p,maybePostfixModifierPosition:v}=r(d);let b=!!v,y=n(b?p.substring(0,v):p);if(!y){if(!b){l=d+(l.length>0?" "+l:l);continue}if(y=n(p),!y){l=d+(l.length>0?" "+l:l);continue}b=!1}const x=mQ(h).join(":"),j=m?x+S6:x,N=j+y;if(i.includes(N))continue;i.push(N);const S=a(y,b);for(let k=0;k<S.length;++k){const C=S[k];i.push(j+C)}l=d+(l.length>0?" "+l:l)}return l};function xQ(){let t=0,e,r,n="";for(;t<arguments.length;)(e=arguments[t++])&&(r=C6(e))&&(n&&(n+=" "),n+=r);return n}const C6=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n<t.length;n++)t[n]&&(e=C6(t[n]))&&(r&&(r+=" "),r+=e);return r};function yQ(t,...e){let r,n,a,i=o;function o(u){const d=e.reduce((h,m)=>m(h),t());return r=pQ(d),n=r.cache.get,a=r.cache.set,i=l,l(u)}function l(u){const d=n(u);if(d)return d;const h=vQ(u,r);return a(u,h),h}return function(){return i(xQ.apply(null,arguments))}}const Jt=t=>{const e=r=>r[t]||[];return e.isThemeGetter=!0,e},k6=/^\[(?:([a-z-]+):)?(.+)\]$/i,bQ=/^\d+\/\d+$/,wQ=new Set(["px","full","screen"]),_Q=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,jQ=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,NQ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,SQ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,CQ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ws=t=>Hc(t)||wQ.has(t)||bQ.test(t),Hi=t=>Xu(t,"length",RQ),Hc=t=>!!t&&!Number.isNaN(Number(t)),xb=t=>Xu(t,"number",Hc),Xd=t=>!!t&&Number.isInteger(Number(t)),kQ=t=>t.endsWith("%")&&Hc(t.slice(0,-1)),vt=t=>k6.test(t),Gi=t=>_Q.test(t),EQ=new Set(["length","size","percentage"]),AQ=t=>Xu(t,EQ,E6),PQ=t=>Xu(t,"position",E6),TQ=new Set(["image","url"]),OQ=t=>Xu(t,TQ,DQ),MQ=t=>Xu(t,"",IQ),Zd=()=>!0,Xu=(t,e,r)=>{const n=k6.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},RQ=t=>jQ.test(t)&&!NQ.test(t),E6=()=>!1,IQ=t=>SQ.test(t),DQ=t=>CQ.test(t),$Q=()=>{const t=Jt("colors"),e=Jt("spacing"),r=Jt("blur"),n=Jt("brightness"),a=Jt("borderColor"),i=Jt("borderRadius"),o=Jt("borderSpacing"),l=Jt("borderWidth"),u=Jt("contrast"),d=Jt("grayscale"),h=Jt("hueRotate"),m=Jt("invert"),p=Jt("gap"),v=Jt("gradientColorStops"),b=Jt("gradientColorStopPositions"),y=Jt("inset"),x=Jt("margin"),j=Jt("opacity"),N=Jt("padding"),S=Jt("saturate"),k=Jt("scale"),C=Jt("sepia"),A=Jt("skew"),T=Jt("space"),R=Jt("translate"),I=()=>["auto","contain","none"],D=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto",vt,e],z=()=>[vt,e],H=()=>["",Ws,Hi],Z=()=>["auto",Hc,vt],te=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],M=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],F=()=>["start","end","center","between","around","evenly","stretch"],K=()=>["","0",vt],B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>[Hc,vt];return{cacheSize:500,separator:":",theme:{colors:[Zd],spacing:[Ws,Hi],blur:["none","",Gi,vt],brightness:O(),borderColor:[t],borderRadius:["none","","full",Gi,vt],borderSpacing:z(),borderWidth:H(),contrast:O(),grayscale:K(),hueRotate:O(),invert:K(),gap:z(),gradientColorStops:[t],gradientColorStopPositions:[kQ,Hi],inset:L(),margin:L(),opacity:O(),padding:z(),saturate:O(),scale:O(),sepia:K(),skew:O(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",vt]}],container:["container"],columns:[{columns:[Gi]}],"break-after":[{"break-after":B()}],"break-before":[{"break-before":B()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...te(),vt]}],overflow:[{overflow:D()}],"overflow-x":[{"overflow-x":D()}],"overflow-y":[{"overflow-y":D()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[y]}],"inset-x":[{"inset-x":[y]}],"inset-y":[{"inset-y":[y]}],start:[{start:[y]}],end:[{end:[y]}],top:[{top:[y]}],right:[{right:[y]}],bottom:[{bottom:[y]}],left:[{left:[y]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Xd,vt]}],basis:[{basis:L()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",vt]}],grow:[{grow:K()}],shrink:[{shrink:K()}],order:[{order:["first","last","none",Xd,vt]}],"grid-cols":[{"grid-cols":[Zd]}],"col-start-end":[{col:["auto",{span:["full",Xd,vt]},vt]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[Zd]}],"row-start-end":[{row:["auto",{span:[Xd,vt]},vt]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",vt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",vt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...F()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...F(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...F(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[N]}],px:[{px:[N]}],py:[{py:[N]}],ps:[{ps:[N]}],pe:[{pe:[N]}],pt:[{pt:[N]}],pr:[{pr:[N]}],pb:[{pb:[N]}],pl:[{pl:[N]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",vt,e]}],"min-w":[{"min-w":[vt,e,"min","max","fit"]}],"max-w":[{"max-w":[vt,e,"none","full","min","max","fit","prose",{screen:[Gi]},Gi]}],h:[{h:[vt,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[vt,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[vt,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[vt,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Gi,Hi]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",xb]}],"font-family":[{font:[Zd]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",vt]}],"line-clamp":[{"line-clamp":["none",Hc,xb]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ws,vt]}],"list-image":[{"list-image":["none",vt]}],"list-style-type":[{list:["none","disc","decimal",vt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ws,Hi]}],"underline-offset":[{"underline-offset":["auto",Ws,vt]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",vt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",vt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...te(),PQ]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",AQ]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},OQ]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[b]}
vendor: 5,180 bytes, line 684
684],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[v]}],"gradient-via":[{via:[v]}],"gradient-to":[{to:[v]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[j]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[j]}],"divide-style":[{divide:G()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[Ws,vt]}],"outline-w":[{outline:[Ws,Hi]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[Ws,Hi]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Gi,MQ]}],"shadow-color":[{shadow:[Zd]}],opacity:[{opacity:[j]}],"mix-blend":[{"mix-blend":[...M(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":M()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",Gi,vt]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[m]}],saturate:[{saturate:[S]}],sepia:[{sepia:[C]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[j]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[C]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",vt]}],duration:[{duration:O()}],ease:[{ease:["linear","in","out","in-out",vt]}],delay:[{delay:O()}],animate:[{animate:["none","spin","ping","pulse","bounce",vt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[k]}],"scale-x":[{"scale-x":[k]}],"scale-y":[{"scale-y":[k]}],rotate:[{rotate:[Xd,vt]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",vt]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",vt]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}
684],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",vt]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[Ws,Hi,xb]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},LQ=yQ($Q);function Qe(...t){return LQ(Ct(t))}const uC=w.createContext({});function dC(t){const e=w.useRef(null);return e.current===null&&(e.current=t()),e.current}const fC=typeof window<"u",A6=fC?w.useLayoutEffect:w.useEffect,i0=w.createContext(null);function hC(t,e){t.indexOf(e)===-1&&t.push(e)}function mC(t,e){const r=t.indexOf(e);r>-1&&t.splice(r,1)}const ui=(t,e,r)=>r>e?e:r<t?t:r;let pC=()=>{};const di={},P6=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function T6(t){return typeof t=="object"&&t!==null}const O6=t=>/^0[^.\s]+$/u.test(t);function gC(t){let e;return()=>(e===void 0&&(e=t()),e)}const wa=t=>t,FQ=(t,e)=>r=>e(t(r)),Fh=(...t)=>t.reduce(FQ),Uf=(t,e,r)=>{const n=e-t;return n===0?1:(r-t)/n};class vC{constructor(){this.subscriptions=[]}add(e){return hC(this.subscriptions,e),()=>mC(this.subscriptions,e)}notify(e,r,n){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,r,n);else for(let i=0;i<a;i++){const o=this.subscriptions[i];o&&o(e,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ns=t=>t*1e3,ya=t=>t/1e3;function M6(t,e){return e?t*(1e3/e):0}const R6=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,BQ=1e-7,VQ=12;function zQ(t,e,r,n,a){let i,o,l=0;do o=e+(r-e)/2,i=R6(o,n,a)-t,i>0?r=o:e=o;while(Math.abs(i)>BQ&&++l<VQ);return o}function Bh(t,e,r,n){if(t===e&&r===n)return wa;const a=i=>zQ(i,0,1,t,r);return i=>i===0||i===1?i:R6(a(i),e,n)}const I6=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,D6=t=>e=>1-t(1-e),$6=Bh(.33,1.53,.69,.99),xC=D6($6),L6=I6(xC),F6=t=>(t*=2)<1?.5*xC(t):.5*(2-Math.pow(2,-10*(t-1))),yC=t=>1-Math.sin(Math.acos(t)),B6=D6(yC),V6=I6(yC),UQ=Bh(.42,0,1,1),qQ=Bh(0,0,.58,1),z6=Bh(.42,0,.58,1),WQ=t=>Array.isArray(t)&&typeof t[0]!="number",U6=t=>Array.isArray(t)&&typeof t[0]=="number",HQ={linear:wa,easeIn:UQ,easeInOut:z6,easeOut:qQ,circIn:yC,circInOut:V6,circOut:B6,backIn:xC,backInOut:L6,backOut:$6,anticipate:F6},GQ=t=>typeof t=="string",AO=t=>{if(U6(t)){pC(t.length===4);const[e,r,n,a]=t;return Bh(e,r,n,a)}else if(GQ(t))return HQ[t];return t},Ap=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function KQ(t,e){let r=new Set,n=new Set,a=!1,i=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function u(h){o.has(h)&&(d.schedule(h),t()),h(l)}
vendor: 25,658 bytes, line 684
684const d={schedule:(h,m=!1,p=!1)=>{const b=p&&a?r:n;return m&&o.add(h),b.has(h)||b.add(h),h},cancel:h=>{n.delete(h),o.delete(h)},process:h=>{if(l=h,a){i=!0;return}a=!0,[r,n]=[n,r],r.forEach(u),r.clear(),a=!1,i&&(i=!1,d.process(h))}};return d}const YQ=40;function q6(t,e){let r=!1,n=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>r=!0,o=Ap.reduce((S,k)=>(S[k]=KQ(i),S),{}),{setup:l,read:u,resolveKeyframes:d,preUpdate:h,update:m,preRender:p,render:v,postRender:b}=o,y=()=>{const S=di.useManualTiming?a.timestamp:performance.now();r=!1,di.useManualTiming||(a.delta=n?1e3/60:Math.max(Math.min(S-a.timestamp,YQ),1)),a.timestamp=S,a.isProcessing=!0,l.process(a),u.process(a),d.process(a),h.process(a),m.process(a),p.process(a),v.process(a),b.process(a),a.isProcessing=!1,r&&e&&(n=!1,t(y))},x=()=>{r=!0,n=!0,a.isProcessing||t(y)};return{schedule:Ap.reduce((S,k)=>{const C=o[k];return S[k]=(A,T=!1,R=!1)=>(r||x(),C.schedule(A,T,R)),S},{}),cancel:S=>{for(let k=0;k<Ap.length;k++)o[Ap[k]].cancel(S)},state:a,steps:o}}const{schedule:rr,cancel:ho,state:Kr,steps:yb}=q6(typeof requestAnimationFrame<"u"?requestAnimationFrame:wa,!0);let ig;function XQ(){ig=void 0}const En={now:()=>(ig===void 0&&En.set(Kr.isProcessing||di.useManualTiming?Kr.timestamp:performance.now()),ig),set:t=>{ig=t,queueMicrotask(XQ)}},W6=t=>e=>typeof e=="string"&&e.startsWith(t),bC=W6("--"),ZQ=W6("var(--"),wC=t=>ZQ(t)?QQ.test(t.split("/*")[0].trim()):!1,QQ=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Zu={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},qf={...Zu,transform:t=>ui(0,1,t)},Pp={...Zu,default:1},Sf=t=>Math.round(t*1e5)/1e5,_C=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function JQ(t){return t==null}const eJ=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,jC=(t,e)=>r=>!!(typeof r=="string"&&eJ.test(r)&&r.startsWith(t)||e&&!JQ(r)&&Object.prototype.hasOwnProperty.call(r,e)),H6=(t,e,r)=>n=>{if(typeof n!="string")return n;const[a,i,o,l]=n.match(_C);return{[t]:parseFloat(a),[e]:parseFloat(i),[r]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},tJ=t=>ui(0,255,t),bb={...Zu,transform:t=>Math.round(tJ(t))},ul={test:jC("rgb","red"),parse:H6("red","green","blue"),transform:({red:t,green:e,blue:r,alpha:n=1})=>"rgba("+bb.transform(t)+", "+bb.transform(e)+", "+bb.transform(r)+", "+Sf(qf.transform(n))+")"};function rJ(t){let e="",r="",n="",a="";return t.length>5?(e=t.substring(1,3),r=t.substring(3,5),n=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),r=t.substring(2,3),n=t.substring(3,4),a=t.substring(4,5),e+=e,r+=r,n+=n,a+=a),{red:parseInt(e,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:a?parseInt(a,16)/255:1}}const kN={test:jC("#"),parse:rJ,transform:ul.transform},Vh=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Yi=Vh("deg"),Ss=Vh("%"),ot=Vh("px"),nJ=Vh("vh"),aJ=Vh("vw"),PO={...Ss,parse:t=>Ss.parse(t)/100,transform:t=>Ss.transform(t*100)},Ic={test:jC("hsl","hue"),parse:H6("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:r,alpha:n=1})=>"hsla("+Math.round(t)+", "+Ss.transform(Sf(e))+", "+Ss.transform(Sf(r))+", "+Sf(qf.transform(n))+")"},wr={test:t=>ul.test(t)||kN.test(t)||Ic.test(t),parse:t=>ul.test(t)?ul.parse(t):Ic.test(t)?Ic.parse(t):kN.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?ul.transform(t):Ic.transform(t),getAnimatableNone:t=>{const e=wr.parse(t);return e.alpha=0,wr.transform(e)}},sJ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function iJ(t){var e,r;return isNaN(t)&&typeof t=="string"&&(((e=t.match(_C))==null?void 0:e.length)||0)+(((r=t.match(sJ))==null?void 0:r.length)||0)>0}const G6="number",K6="color",oJ="var",lJ="var(",TO="${}",cJ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Wf(t){const e=t.toString(),r=[],n={color:[],number:[],var:[]},a=[];let i=0;const l=e.replace(cJ,u=>(wr.test(u)?(n.color.push(i),a.push(K6),r.push(wr.parse(u))):u.startsWith(lJ)?(n.var.push(i),a.push(oJ),r.push(u)):(n.number.push(i),a.push(G6),r.push(parseFloat(u))),++i,TO)).split(TO);return{values:r,split:l,indexes:n,types:a}}function Y6(t){return Wf(t).values}function X6(t){const{split:e,types:r}=Wf(t),n=e.length;return a=>{let i="";for(let o=0;o<n;o++)if(i+=e[o],a[o]!==void 0){const l=r[o];l===G6?i+=Sf(a[o]):l===K6?i+=wr.transform(a[o]):i+=a[o]}return i}}const uJ=t=>typeof t=="number"?0:wr.test(t)?wr.getAnimatableNone(t):t;function dJ(t){const e=Y6(t);return X6(t)(e.map(uJ))}const mo={test:iJ,parse:Y6,createTransformer:X6,getAnimatableNone:dJ};function wb(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*(2/3-r)*6:t}function fJ({hue:t,saturation:e,lightness:r,alpha:n}){t/=360,e/=100,r/=100;let a=0,i=0,o=0;if(!e)a=i=o=r;else{const l=r<.5?r*(1+e):r+e-r*e,u=2*r-l;a=wb(u,l,t+1/3),i=wb(u,l,t),o=wb(u,l,t-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:n}}function Cg(t,e){return r=>r>0?e:t}const or=(t,e,r)=>t+(e-t)*r,_b=(t,e,r)=>{const n=t*t,a=r*(e*e-n)+n;return a<0?0:Math.sqrt(a)},hJ=[kN,ul,Ic],mJ=t=>hJ.find(e=>e.test(t));function OO(t){const e=mJ(t);if(!e)return!1;let r=e.parse(t);return e===Ic&&(r=fJ(r)),r}const MO=(t,e)=>{const r=OO(t),n=OO(e);if(!r||!n)return Cg(t,e);const a={...r};return i=>(a.red=_b(r.red,n.red,i),a.green=_b(r.green,n.green,i),a.blue=_b(r.blue,n.blue,i),a.alpha=or(r.alpha,n.alpha,i),ul.transform(a))},EN=new Set(["none","hidden"]);function pJ(t,e){return EN.has(t)?r=>r<=0?t:e:r=>r>=1?e:t}function gJ(t,e){return r=>or(t,e,r)}function NC(t){return typeof t=="number"?gJ:typeof t=="string"?wC(t)?Cg:wr.test(t)?MO:yJ:Array.isArray(t)?Z6:typeof t=="object"?wr.test(t)?MO:vJ:Cg}function Z6(t,e){const r=[...t],n=r.length,a=t.map((i,o)=>NC(i)(i,e[o]));return i=>{for(let o=0;o<n;o++)r[o]=a[o](i);return r}}function vJ(t,e){const r={...t,...e},n={};for(const a in r)t[a]!==void 0&&e[a]!==void 0&&(n[a]=NC(t[a])(t[a],e[a]));return a=>{for(const i in n)r[i]=n[i](a);return r}}function xJ(t,e){const r=[],n={color:0,var:0,number:0};for(let a=0;a<e.values.length;a++){const i=e.types[a],o=t.indexes[i][n[i]],l=t.values[o]??0;r[a]=l,n[i]++}return r}const yJ=(t,e)=>{const r=mo.createTransformer(e),n=Wf(t),a=Wf(e);return n.indexes.var.length===a.indexes.var.length&&n.indexes.color.length===a.indexes.color.length&&n.indexes.number.length>=a.indexes.number.length?EN.has(t)&&!a.values.length||EN.has(e)&&!n.values.length?pJ(t,e):Fh(Z6(xJ(n,a),a.values),r):Cg(t,e)};function Q6(t,e,r){return typeof t=="number"&&typeof e=="number"&&typeof r=="number"?or(t,e,r):NC(t)(t,e)}const bJ=t=>{const e=({timestamp:r})=>t(r);return{start:(r=!0)=>rr.update(e,r),stop:()=>ho(e),now:()=>Kr.isProcessing?Kr.timestamp:En.now()}},J6=(t,e,r=10)=>{let n="";const a=Math.max(Math.round(e/r),2);for(let i=0;i<a;i++)n+=Math.round(t(i/(a-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},kg=2e4;function SC(t){let e=0;const r=50;let n=t.next(e);for(;!n.done&&e<kg;)e+=r,n=t.next(e);return e>=kg?1/0:e}function wJ(t,e=100,r){const n=r({...t,keyframes:[0,e]}),a=Math.min(SC(n),kg);return{type:"keyframes",ease:i=>n.next(a*i).value/e,duration:ya(a)}}const _J=5;function e9(t,e,r){const n=Math.max(e-_J,0);return M6(r-t(n),e-n)}const dr={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},jb=.001;function jJ({duration:t=dr.duration,bounce:e=dr.bounce,velocity:r=dr.velocity,mass:n=dr.mass}){let a,i,o=1-e;o=ui(dr.minDamping,dr.maxDamping,o),t=ui(dr.minDuration,dr.maxDuration,ya(t)),o<1?(a=d=>{const h=d*o,m=h*t,p=h-r,v=AN(d,o),b=Math.exp(-m);return jb-p/v*b},i=d=>{const m=d*o*t,p=m*r+r,v=Math.pow(o,2)*Math.pow(d,2)*t,b=Math.exp(-m),y=AN(Math.pow(d,2),o);return(-a(d)+jb>0?-1:1)*((p-v)*b)/y}):(a=d=>{const h=Math.exp(-d*t),m=(d-r)*t+1;return-jb+h*m},i=d=>{const h=Math.exp(-d*t),m=(r-d)*(t*t);return h*m});const l=5/t,u=SJ(a,i,l);if(t=Ns(t),isNaN(u))return{stiffness:dr.stiffness,damping:dr.damping,duration:t};{const d=Math.pow(u,2)*n;return{stiffness:d,damping:o*2*Math.sqrt(n*d),duration:t}}}const NJ=12;function SJ(t,e,r){let n=r;for(let a=1;a<NJ;a++)n=n-t(n)/e(n);return n}function AN(t,e){return t*Math.sqrt(1-e*e)}const CJ=["duration","bounce"],kJ=["stiffness","damping","mass"];function RO(t,e){return e.some(r=>t[r]!==void 0)}function EJ(t){let e={velocity:dr.velocity,stiffness:dr.stiffness,damping:dr.damping,mass:dr.mass,isResolvedFromDuration:!1,...t};if(!RO(t,kJ)&&RO(t,CJ))if(t.visualDuration){const r=t.visualDuration,n=2*Math.PI/(r*1.2),a=n*n,i=2*ui(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:dr.mass,stiffness:a,damping:i}}else{const r=jJ(t);e={...e,...r,mass:dr.mass},e.isResolvedFromDuration=!0}return e}function Eg(t=dr.visualDuration,e=dr.bounce){const r=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:a}=r;const i=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],l={done:!1,value:i},{stiffness:u,damping:d,mass:h,duration:m,velocity:p,isResolvedFromDuration:v}=EJ({...r,velocity:-ya(r.velocity||0)}),b=p||0,y=d/(2*Math.sqrt(u*h)),x=o-i,j=ya(Math.sqrt(u/h)),N=Math.abs(x)<5;n||(n=N?dr.restSpeed.granular:dr.restSpeed.default),a||(a=N?dr.restDelta.granular:dr.restDelta.default);let S;if(y<1){const C=AN(j,y);S=A=>{const T=Math.exp(-y*j*A);return o-T*((b+y*j*x)/C*Math.sin(C*A)+x*Math.cos(C*A))}}else if(y===1)S=C=>o-Math.exp(-j*C)*(x+(b+j*x)*C);else{const C=j*Math.sqrt(y*y-1);S=A=>{const T=Math.exp(-y*j*A),R=Math.min(C*A,300);return o-T*((b+y*j*x)*Math.sinh(R)+C*x*Math.cosh(R))/C}}const k={calculatedDuration:v&&m||null,next:C=>{const A=S(C);if(v)l.done=C>=m;else{let T=C===0?b:0;y<1&&(T=C===0?Ns(b):e9(S,C,A));const R=Math.abs(T)<=n,I=Math.abs(o-A)<=a;l.done=R&&I}return l.value=l.done?o:A,l},toString:()=>{const C=Math.min(SC(k),kg),A=J6(T=>k.next(C*T).value,C,30);return C+"ms "+A},toTransition:()=>{}};return k}Eg.applyToOptions=t=>{const e=wJ(t,100,Eg);return t.ease=e.ease,t.duration=Ns(e.duration),t.type="keyframes",t};function PN({keyframes:t,velocity:e=0,power:r=.8,timeConstant:n=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:u,restDelta:d=.5,restSpeed:h}){const m=t[0],p={done:!1,value:m},v=R=>l!==void 0&&R<l||u!==void 0&&R>u,b=R=>l===void 0?u:u===void 0||Math.abs(l-R)<Math.abs(u-R)?l:u;let y=r*e;const x=m+y,j=o===void 0?x:o(x);j!==x&&(y=j-m);const N=R=>-y*Math.exp(-R/n),S=R=>j+N(R),k=R=>{const I=N(R),D=S(R);p.done=Math.abs(I)<=d,p.value=p.done?j:D};let C,A;const T=R=>{v(p.value)&&(C=R,A=Eg({keyframes:[p.value,b(p.value)],velocity:e9(S,R,p.value),damping:a,stiffness:i,restDelta:d,restSpeed:h}))};return T(0),{calculatedDuration:null,next:R=>{let I=!1;return!A&&C===void 0&&(I=!0,k(R),T(R)),C!==void 0&&R>=C?A.next(R-C):(!I&&k(R),p)}}}function AJ(t,e,r){const n=[],a=r||di.mix||Q6,i=t.length-1;for(let o=0;o<i;o++){let l=a(t[o],t[o+1]);if(e){const u=Array.isArray(e)?e[o]||wa:e;l=Fh(u,l)}n.push(l)}return n}function PJ(t,e,{clamp:r=!0,ease:n,mixer:a}={}){const i=t.length;if(pC(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=AJ(e,n,a),u=l.length,d=h=>{if(o&&h<t[0])return e[0];let m=0;if(u>1)for(;m<t.length-2&&!(h<t[m+1]);m++);const p=Uf(t[m],t[m+1],h);return l[m](p)};return r?h=>d(ui(t[0],t[i-1],h)):d}function TJ(t,e){const r=t[t.length-1];for(let n=1;n<=e;n++){const a=Uf(0,e,n);t.push(or(r,1,a))}}function OJ(t){const e=[0];return TJ(e,t.length-1),e}function MJ(t,e){return t.map(r=>r*e)}function RJ(t,e){return t.map(()=>e||z6).splice(0,t.length-1)}function Cf({duration:t=300,keyframes:e,times:r,ease:n="easeInOut"}){const a=WQ(n)?n.map(AO):AO(n),i={done:!1,value:e[0]},o=MJ(r&&r.length===e.length?r:OJ(e),t),l=PJ(o,e,{ease:Array.isArray(a)?a:RJ(e,a)});return{calculatedDuration:t,next:u=>(i.value=l(u),i.done=u>=t,i)}}const IJ=t=>t!==null;function CC(t,{repeat:e,repeatType:r="loop"},n,a=1){const i=t.filter(IJ),l=a<0||e&&r!=="loop"&&e%2===1?0:i.length-1;return!l||n===void 0?i[l]:n}const DJ={decay:PN,inertia:PN,tween:Cf,keyframes:Cf,spring:Eg};function t9(t){typeof t.type=="string"&&(t.type=DJ[t.type])}class kC{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,r){return this.finished.then(e,r)}}const $J=t=>t/100;class EC extends kC{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,a;const{motionValue:r}=this.options;r&&r.updatedAt!==En.now()&&this.tick(En.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(n=this.options).onStop)==null||a.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;t9(e);const{type:r=Cf,repeat:n=0,repeatDelay:a=0,repeatType:i,velocity:o=0}=e;let{keyframes:l}=e;const u=r||Cf;u!==Cf&&typeof l[0]!="number"&&(this.mixKeyframes=Fh($J,Q6(l[0],l[1])),l=[0,100]);const d=u({...e,keyframes:l});i==="mirror"&&(this.mirroredGenerator=u({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=SC(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+a,this.totalDuration=this.resolvedDuration*(n+1)-a,this.generator=d}updateTime(e){const r=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(e,r=!1){const{generator:n,totalDuration:a,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:u}=this;if(this.startTime===null)return n.next(0);const{delay:d=0,keyframes:h,repeat:m,repeatType:p,repeatDelay:v,type:b,onUpdate:y,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),r?this.currentTime=e:this.updateTime(e);const j=this.currentTime-d*(this.playbackSpeed>=0?1:-1),N=this.playbackSpeed>=0?j<0:j>a;this.currentTime=Math.max(j,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let S=this.currentTime,k=n;if(m){const R=Math.min(this.currentTime,a)/l;let I=Math.floor(R),D=R%1;!D&&R>=1&&(D=1),D===1&&I--,I=Math.min(I,m+1),!!(I%2)&&(p==="reverse"?(D=1-D,v&&(D-=v/l)):p==="mirror"&&(k=o)),S=ui(0,1,D)*l}const C=N?{done:!1,value:h[0]}:k.next(S);i&&(C.value=i(C.value));let{done:A}=C;!N&&u!==null&&(A=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const T=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&A);return T&&b!==PN&&(C.value=CC(h,this.options,x,this.speed)),y&&y(C.value),T&&this.finish(),C}then(e,r){return this.finished.then(e,r)}get duration(){return ya(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ya(e)}get time(){return ya(this.currentTime)}set time(e){var r;e=Ns(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(r=this.driver)==null||r.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(En.now());const r=this.playbackSpeed!==e;this.playbackSpeed=e,r&&(this.time=ya(this.currentTime))}play(){var a,i;if(this.isStopped)return;const{driver:e=bJ,startTime:r}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(a=this.options).onPlay)==null||i.call(a);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(En.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(e=this.options).onComplete)==null||r.call(e)}cancel(){var e,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(e=this.options).onCancel)==null||r.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),e.observe(this)}}function LJ(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const dl=t=>t*180/Math.PI,TN=t=>{const e=dl(Math.atan2(t[1],t[0]));return ON(e)},FJ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:TN,rotateZ:TN,skewX:t=>dl(Math.atan(t[1])),skewY:t=>dl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},ON=t=>(t=t%360,t<0&&(t+=360),t),IO=TN,DO=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$O=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),BJ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:DO,scaleY:$O,scale:t=>(DO(t)+$O(t))/2,rotateX:t=>ON(dl(Math.atan2(t[6],t[5]))),rotateY:t=>ON(dl(Math.atan2(-t[2],t[0]))),rotateZ:IO,rotate:IO,skewX:t=>dl(Math.atan(t[4])),skewY:t=>dl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function MN(t){return t.includes("scale")?1:0}function RN(t,e){if(!t||t==="none")return MN(e);const r=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,a;if(r)n=BJ,a=r;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=FJ,a=l}if(!a)return MN(e);const i=n[e],o=a[1].split(",").map(zJ);return typeof i=="function"?i(o):o[i]}const VJ=(t,e)=>{const{transform:r="none"}=getComputedStyle(t);return RN(r,e)};function zJ(t){return parseFloat(t.trim())}const Qu=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ju=new Set(Qu),LO=t=>t===Zu||t===ot,UJ=new Set(["x","y","z"]),qJ=Qu.filter(t=>!UJ.has(t));function WJ(t){const e=[];return qJ.forEach(r=>{const n=t.getValue(r);n!==void 0&&(e.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),e}const bl={width:({x:t},{paddingLeft:e="0",paddingRight:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),height:({y:t},{paddingTop:e="0",paddingBottom:r="0"})=>t.max-t.min-parseFloat(e)-parseFloat(r),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>RN(e,"x"),y:(t,{transform:e})=>RN(e,"y")};bl.translateX=bl.x;bl.translateY=bl.y;const wl=new Set;let IN=!1,DN=!1,$N=!1;function r9(){if(DN){const t=Array.from(wl).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),r=new Map;e.forEach(n=>{const a=WJ(n);a.length&&(r.set(n,a),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const a=r.get(n);a&&a.forEach(([i,o])=>{var l;(l=n.getValue(i))==null||l.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}DN=!1,IN=!1,wl.forEach(t=>t.complete($N)),wl.clear()}function n9(){wl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(DN=!0)})}function HJ(){$N=!0,n9(),r9(),$N=!1}class AC{constructor(e,r,n,a,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=r,this.name=n,this.motionValue=a,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(wl.add(this),IN||(IN=!0,rr.read(n9),rr.resolveKeyframes(r9))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:r,element:n,motionValue:a}=this;if(e[0]===null){const i=a==null?void 0:a.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&r){const l=n.readValue(r,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),a&&i===void 0&&a.set(e[0])}LJ(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),wl.delete(this)}cancel(){this.state==="scheduled"&&(wl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const GJ=t=>t.startsWith("--");function KJ(t,e,r){GJ(e)?t.style.setProperty(e,r):t.style[e]=r}const YJ=gC(()=>window.ScrollTimeline!==void 0),XJ={};function ZJ(t,e){const r=gC(t);return()=>XJ[e]??r()}const a9=ZJ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),pf=([t,e,r,n])=>`cubic-bezier(${t}, ${e}, ${r}, ${n})`,FO={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:pf([0,.65,.55,1]),circOut:pf([.55,0,1,.45]),backIn:pf([.31,.01,.66,-.59]),backOut:pf([.33,1.53,.69,.99])};function s9(t,e){if(t)return typeof t=="function"?a9()?J6(t,e):"ease-out":U6(t)?pf(t):Array.isArray(t)?t.map(r=>s9(r,e)||FO.easeOut):FO[t]}function QJ(t,e,r,{delay:n=0,duration:a=300,repeat:i=0,repeatType:o="loop",ease:l="easeOut",times:u}={},d=void 0){const h={[e]:r};u&&(h.offset=u);const m=s9(l,a);Array.isArray(m)&&(h.easing=m);const p={delay:n,duration:a,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return d&&(p.pseudoElement=d),t.animate(h,p)}function i9(t){return typeof t=="function"&&"applyToOptions"in t}function JJ({type:t,...e}){return i9(t)&&a9()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class eee extends kC{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:r,name:n,keyframes:a,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:l,onComplete:u}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,pC(typeof e.type!="string");const d=JJ(e);this.animation=QJ(r,n,a,d,i),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const h=CC(a,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(h):KJ(r,n,h),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,r;(r=(e=this.animation).finish)==null||r.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,r;this.isPseudoElement||(r=(e=this.animation).commitStyles)==null||r.call(e)}get duration(){var r,n;const e=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return ya(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+ya(e)}get time(){return ya(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Ns(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:r}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&YJ()?(this.animation.timeline=e,wa):r(this)}}const o9={anticipate:F6,backInOut:L6,circInOut:V6};function tee(t){return t in o9}function ree(t){typeof t.ease=="string"&&tee(t.ease)&&(t.ease=o9[t.ease])}const BO=10;class nee extends eee{constructor(e){ree(e),t9(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:r,onUpdate:n,onComplete:a,element:i,...o}=this.options;if(!r)return;if(e!==void 0){r.set(e);return}const l=new EC({...o,autoplay:!1}),u=Ns(this.finishedTime??this.time);r.setWithVelocity(l.sample(u-BO).value,l.sample(u).value,BO),l.stop()}}const VO=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(mo.test(t)||t==="0")&&!t.startsWith("url("));function aee(t){const e=t[0];if(t.length===1)return!0;for(let r=0;r<t.length;r++)if(t[r]!==e)return!0}function see(t,e,r,n){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=VO(a,e),l=VO(i,e);return!o||!l?!1:aee(t)||(r==="spring"||i9(r))&&n}function LN(t){t.duration=0,t.type="keyframes"}const iee=new Set(["opacity","clipPath","filter","transform"]),oee=gC(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function lee(t){var h;const{motionValue:e,name:r,repeatDelay:n,repeatType:a,damping:i,type:o}=t;if(!(((h=e==null?void 0:e.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:u,transformTemplate:d}=e.owner.getProps();return oee()&&r&&iee.has(r)&&(r!=="transform"||!d)&&!u&&!n&&a!=="mirror"&&i!==0&&o!=="inertia"}const cee=40;class uee extends kC{constructor({autoplay:e=!0,delay:r=0,type:n="keyframes",repeat:a=0,repeatDelay:i=0,repeatType:
684o="loop",keyframes:l,name:u,motionValue:d,element:h,...m}){var b;super(),this.stop=()=>{var y,x;this._animation&&(this._animation.stop(),(y=this.stopTimeline)==null||y.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=En.now();const p={autoplay:e,delay:r,type:n,repeat:a,repeatDelay:i,repeatType:o,name:u,motionValue:d,element:h,...m},v=(h==null?void 0:h.KeyframeResolver)||AC;this.keyframeResolver=new v(l,(y,x,j)=>this.onKeyframesResolved(y,x,p,!j),u,d,h),(b=this.keyframeResolver)==null||b.scheduleResolve()}onKeyframesResolved(e,r,n,a){this.keyframeResolver=void 0;const{name:i,type:o,velocity:l,delay:u,isHandoff:d,onUpdate:h}=n;this.resolvedAt=En.now(),see(e,i,o,l)||((di.instantAnimations||!u)&&(h==null||h(CC(e,n,r))),e[0]=e[e.length-1],LN(n),n.repeat=0);const p={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>cee?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:e},v=!d&&lee(p)?new nee({...p,element:p.motionValue.owner.current}):new EC(p);v.finished.then(()=>this.notifyFinished()).catch(wa),this.pendingTimeline&&(this.stopTimeline=v.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=v}get finished(){return this._animation?this.animation.finished:this._finished}then(e,r){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),HJ()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const dee=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fee(t){const e=dee.exec(t);if(!e)return[,];const[,r,n,a]=e;return[`--${r??n}`,a]}function l9(t,e,r=1){const[n,a]=fee(t);if(!n)return;const i=window.getComputedStyle(e).getPropertyValue(n);if(i){const o=i.trim();return P6(o)?parseFloat(o):o}return wC(a)?l9(a,e,r+1):a}function PC(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const c9=new Set(["width","height","top","left","right","bottom",...Qu]),hee={test:t=>t==="auto",parse:t=>t},u9=t=>e=>e.test(t),d9=[Zu,ot,Ss,Yi,aJ,nJ,hee],zO=t=>d9.find(u9(t));function mee(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||O6(t):!0}const pee=new Set(["brightness","contrast","saturate","opacity"]);function gee(t){const[e,r]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=r.match(_C)||[];if(!n)return t;const a=r.replace(n,"");let i=pee.has(e)?1:0;return n!==r&&(i*=100),e+"("+i+a+")"}const vee=/\b([a-z-]*)\(.*?\)/gu,FN={...mo,getAnimatableNone:t=>{const e=t.match(vee);return e?e.map(gee).join(" "):t}},UO={...Zu,transform:Math.round},xee={rotate:Yi,rotateX:Yi,rotateY:Yi,rotateZ:Yi,scale:Pp,scaleX:Pp,scaleY:Pp,scaleZ:Pp,skew:Yi,skewX:Yi,skewY:Yi,distance:ot,translateX:ot,translateY:ot,translateZ:ot,x:ot,y:ot,z:ot,perspective:ot,transformPerspective:ot,opacity:qf,originX:PO,originY:PO,originZ:ot},TC={borderWidth:ot,borderTopWidth:ot,borderRightWidth:ot,borderBottomWidth:ot,borderLeftWidth:ot,borderRadius:ot,radius:ot,borderTopLeftRadius:ot,borderTopRightRadius:ot,borderBottomRightRadius:ot,borderBottomLeftRadius:ot,width:ot,maxWidth:ot,height:ot,maxHeight:ot,top:ot,right:ot,bottom:ot,left:ot,padding:ot,paddingTop:ot,paddingRight:ot,paddingBottom:ot,paddingLeft:ot,margin:ot,marginTop:ot,marginRight:ot,marginBottom:ot,marginLeft:ot,backgroundPositionX:ot,backgroundPositionY:ot,...xee,zIndex:UO,fillOpacity:qf,strokeOpacity:qf,numOctaves:UO},yee={...TC,color:wr,backgroundColor:wr,outlineColor:wr,fill:wr,stroke:wr,borderColor:wr,borderTopColor:wr,borderRightColor:wr,borderBottomColor:wr,borderLeftColor:wr,filter:FN,WebkitFilter:FN},f9=t=>yee[t];function h9(t,e){let r=f9(t);return r!==FN&&(r=mo),r.getAnimatableNone?r.getAnimatableNone(e):void 0}
vendor: 10,377 bytes, lines 684-692
684const bee=new Set(["auto","none","0"]);function wee(t,e,r){let n=0,a;for(;n<t.length&&!a;){const i=t[n];typeof i=="string"&&!bee.has(i)&&Wf(i).values.length&&(a=t[n]),n++}if(a&&r)for(const i of e)t[i]=h9(r,a)}class _ee extends AC{constructor(e,r,n,a,i){super(e,r,n,a,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let u=0;u<e.length;u++){let d=e[u];if(typeof d=="string"&&(d=d.trim(),wC(d))){const h=l9(d,r.current);h!==void 0&&(e[u]=h),u===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!c9.has(n)||e.length!==2)return;const[a,i]=e,o=zO(a),l=zO(i);if(o!==l)if(LO(o)&&LO(l))for(let u=0;u<e.length;u++){const d=e[u];typeof d=="string"&&(e[u]=parseFloat(d))}else bl[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:r}=this,n=[];for(let a=0;a<e.length;a++)(e[a]===null||mee(e[a]))&&n.push(a);n.length&&wee(e,n,r)}measureInitialState(){const{element:e,unresolvedKeyframes:r,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=bl[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r[0]=this.measuredOrigin;const a=r[r.length-1];a!==void 0&&e.getValue(n,a).jump(a,!1)}measureEndState(){var l;const{element:e,name:r,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const a=e.getValue(r);a&&a.jump(this.measuredOrigin,!1);const i=n.length-1,o=n[i];n[i]=bl[r](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([u,d])=>{e.getValue(u).set(d)}),this.resolveNoneKeyframes()}}function jee(t,e,r){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let n=document;const a=(r==null?void 0:r[t])??n.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}const m9=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function p9(t){return T6(t)&&"offsetHeight"in t}const qO=30,Nee=t=>!isNaN(parseFloat(t));class See{constructor(e,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var i;const a=En.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=r.owner}setCurrent(e){this.current=e,this.updatedAt=En.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Nee(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,r){this.events[e]||(this.events[e]=new vC);const n=this.events[e].add(r);return e==="change"?()=>{n(),rr.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,r){this.passiveEffect=e,this.stopPassiveEffect=r}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,r=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=En.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>qO)return 0;const r=Math.min(this.updatedAt-this.prevUpdatedAt,qO);return M6(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(e){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=e(r),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,r;(e=this.dependents)==null||e.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function du(t,e){return new See(t,e)}const{schedule:OC}=q6(queueMicrotask,!1),za={x:!1,y:!1};function g9(){return za.x||za.y}function Cee(t){return t==="x"||t==="y"?za[t]?null:(za[t]=!0,()=>{za[t]=!1}):za.x||za.y?null:(za.x=za.y=!0,()=>{za.x=za.y=!1})}function v9(t,e){const r=jee(t),n=new AbortController,a={passive:!0,...e,signal:n.signal};return[r,a,()=>n.abort()]}function WO(t){return!(t.pointerType==="touch"||g9())}function kee(t,e,r={}){const[n,a,i]=v9(t,r),o=l=>{if(!WO(l))return;const{target:u}=l,d=e(u,l);if(typeof d!="function"||!u)return;const h=m=>{WO(m)&&(d(m),u.removeEventListener("pointerleave",h))};u.addEventListener("pointerleave",h,a)};return n.forEach(l=>{l.addEventListener("pointerenter",o,a)}),i}const x9=(t,e)=>e?t===e?!0:x9(t,e.parentElement):!1,MC=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,Eee=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Aee(t){return Eee.has(t.tagName)||t.tabIndex!==-1}const og=new WeakSet;function HO(t){return e=>{e.key==="Enter"&&t(e)}}function Nb(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const Pee=(t,e)=>{const r=t.currentTarget;if(!r)return;const n=HO(()=>{if(og.has(r))return;Nb(r,"down");const a=HO(()=>{Nb(r,"up")}),i=()=>Nb(r,"cancel");r.addEventListener("keyup",a,e),r.addEventListener("blur",i,e)});r.addEventListener("keydown",n,e),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),e)};function GO(t){return MC(t)&&!g9()}function Tee(t,e,r={}){const[n,a,i]=v9(t,r),o=l=>{const u=l.currentTarget;if(!GO(l))return;og.add(u);const d=e(u,l),h=(v,b)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",p),og.has(u)&&og.delete(u),GO(v)&&typeof d=="function"&&d(v,{success:b})},m=v=>{h(v,u===window||u===document||r.useGlobalTarget||x9(u,v.target))},p=v=>{h(v,!1)};window.addEventListener("pointerup",m,a),window.addEventListener("pointercancel",p,a)};return n.forEach(l=>{(r.useGlobalTarget?window:l).addEventListener("pointerdown",o,a),p9(l)&&(l.addEventListener("focus",d=>Pee(d,a)),!Aee(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}function y9(t){return T6(t)&&"ownerSVGElement"in t}function Oee(t){return y9(t)&&t.tagName==="svg"}const ln=t=>!!(t&&t.getVelocity),Mee=[...d9,wr,mo],Ree=t=>Mee.find(u9(t)),RC=w.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function KO(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Iee(...t){return e=>{let r=!1;const n=t.map(a=>{const i=KO(a,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():KO(t[a],null)}}}}function Dee(...t){return w.useCallback(Iee(...t),t)}class $ee extends w.Component{getSnapshotBeforeUpdate(e){const r=this.props.childRef.current;if(r&&e.isPresent&&!this.props.isPresent){const n=r.offsetParent,a=p9(n)&&n.offsetWidth||0,i=this.props.sizeRef.current;i.height=r.offsetHeight||0,i.width=r.offsetWidth||0,i.top=r.offsetTop,i.left=r.offsetLeft,i.right=a-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Lee({children:t,isPresent:e,anchorX:r,root:n}){const a=w.useId(),i=w.useRef(null),o=w.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=w.useContext(RC),u=Dee(i,t==null?void 0:t.ref);return w.useInsertionEffect(()=>{const{width:d,height:h,top:m,left:p,right:v}=o.current;if(e||!i.current||!d||!h)return;const b=r==="left"?`left: ${p}`:`right: ${v}`;i.current.dataset.motionPopId=a;const y=document.createElement("style");l&&(y.nonce=l);const x=n??document.head;return x.appendChild(y),y.sheet&&y.sheet.insertRule(` 685 [data-motion-pop-id="${a}"] { 686 position: absolute !important; 687 width: ${d}px !important; 688 height: ${h}px !important; 689 ${b}px !important; 690 top: ${m}px !important; 691 } 692 `),()=>{x.contains(y)&&x.removeChild(y)}},[e]),s.jsx($ee,{isPresent:e,childRef:i,sizeRef:o,children:w.cloneElement(t,{ref:u})})}const Fee=({children:t,initial:e,isPresent:r,onExitComplete:n,custom:a,presenceAffectsLayout:i,mode:o,anchorX:l,root:u})=>{const d=dC(Bee),h=w.useId();let m=!0,p=w.useMemo(()=>(m=!1,{id:h,initial:e,isPresent:r,custom:a,onExitComplete:v=>{d.set(v,!0);for(const b of d.values())if(!b)return;n&&n()},register:v=>(d.set(v,!1),()=>d.delete(v))}),[r,d,n]);return i&&m&&(p={...p}),w.useMemo(()=>{d.forEach((v,b)=>d.set(b,!1))},[r]),w.useEffect(()=>{!r&&!d.size&&n&&n()},[r]),o==="popLayout"&&(t=s.jsx(Lee,{isPresent:r,anchorX:l,root:u,children:t})),s.jsx(i0.Provider,{value:p,children:t})};function Bee(){return new Map}function b9(t=!0){const e=w.useContext(i0);if(e===null)return[!0,null];const{isPresent:r,onExitComplete:n,register:a}=e,i=w.useId();w.useEffect(()=>{if(t)return a(i)},[t]);const o=w.useCallback(()=>t&&n&&n(i),[i,n,t]);return!r&&n?[!1,o]:[!0]}const Tp=t=>t.key||"";function YO(t){const e=[];return w.Children.forEach(t,r=>{w.isValidElement(r)&&e.push(r)}),e}const Ag=({children:t,custom:e,initial:r=!0,onExitComplete:n,presenceAffectsLayout:a=!0,mode:i="sync",propagate:o=!1,anchorX:l="left",root:u})=>{const[d,h]=b9(o),m=w.useMemo(()=>YO(t),[t]),p=o&&!d?[]:m.map(Tp),v=w.useRef(!0),b=w.useRef(m),y=dC(()=>new Map),[x,j]=w.useState(m),[N,S]=w.useState(m);A6(()=>{v.current=!1,b.current=m;for(let A=0;A<N.length;A++){const T=Tp(N[A]);p.includes(T)?y.delete(T):y.get(T)!==!0&&y.set(T,!1)}},[N,p.length,p.join("-")]);const k=[];if(m!==x){let A=[...m];for(let T=0;T<N.length;T++){const R=N[T],I=Tp(R);p.includes(I)||(A.splice(T,0,R),k.push(R))}return i==="wait"&&k.length&&(A=k),S(YO(A)),j(m),null}const{forceRender:C}=w.useContext(uC);return s.jsx(s.Fragment,{children:N.map(A=>{const T=Tp(A),R=o&&!d?!1:m===N||p.includes(T),I=()=>{if(y.has(T))y.set(T,!0);else return;let D=!0;
vendor: 4,577 bytes, line 692
692y.forEach(L=>{L||(D=!1)}),D&&(C==null||C(),S(b.current),o&&(h==null||h()),n&&n())};return s.jsx(Fee,{isPresent:R,initial:!v.current||r?void 0:!1,custom:e,presenceAffectsLayout:a,mode:i,root:u,onExitComplete:R?void 0:I,anchorX:l,children:A},T)})})},w9=w.createContext({strict:!1}),XO={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},fu={};for(const t in XO)fu[t]={isEnabled:e=>XO[t].some(r=>!!e[r])};function Vee(t){for(const e in t)fu[e]={...fu[e],...t[e]}}const zee=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Pg(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||zee.has(t)}let _9=t=>!Pg(t);function Uee(t){typeof t=="function"&&(_9=e=>e.startsWith("on")?!Pg(e):t(e))}try{Uee(require("@emotion/is-prop-valid").default)}catch{}function qee(t,e,r){const n={};for(const a in t)a==="values"&&typeof t.values=="object"||(_9(a)||r===!0&&Pg(a)||!e&&!Pg(a)||t.draggable&&a.startsWith("onDrag"))&&(n[a]=t[a]);return n}const o0=w.createContext({});function l0(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Hf(t){return typeof t=="string"||Array.isArray(t)}const IC=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],DC=["initial",...IC];function c0(t){return l0(t.animate)||DC.some(e=>Hf(t[e]))}function j9(t){return!!(c0(t)||t.variants)}function Wee(t,e){if(c0(t)){const{initial:r,animate:n}=t;return{initial:r===!1||Hf(r)?r:void 0,animate:Hf(n)?n:void 0}}return t.inherit!==!1?e:{}}function Hee(t){const{initial:e,animate:r}=Wee(t,w.useContext(o0));return w.useMemo(()=>({initial:e,animate:r}),[ZO(e),ZO(r)])}function ZO(t){return Array.isArray(t)?t.join(" "):t}const Gf={};function Gee(t){for(const e in t)Gf[e]=t[e],bC(e)&&(Gf[e].isCSSVariable=!0)}function N9(t,{layout:e,layoutId:r}){return Ju.has(t)||t.startsWith("origin")||(e||r!==void 0)&&(!!Gf[t]||t==="opacity")}const Kee={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Yee=Qu.length;function Xee(t,e,r){let n="",a=!0;for(let i=0;i<Yee;i++){const o=Qu[i],l=t[o];if(l===void 0)continue;let u=!0;if(typeof l=="number"?u=l===(o.startsWith("scale")?1:0):u=parseFloat(l)===0,!u||r){const d=m9(l,TC[o]);if(!u){a=!1;const h=Kee[o]||o;n+=`${h}(${d}) `}r&&(e[o]=d)}}return n=n.trim(),r?n=r(e,a?"":n):a&&(n="none"),n}function $C(t,e,r){const{style:n,vars:a,transformOrigin:i}=t;let o=!1,l=!1;for(const u in e){const d=e[u];if(Ju.has(u)){o=!0;continue}else if(bC(u)){a[u]=d;continue}else{const h=m9(d,TC[u]);u.startsWith("origin")?(l=!0,i[u]=h):n[u]=h}}if(e.transform||(o||r?n.transform=Xee(e,t.transform,r):n.transform&&(n.transform="none")),l){const{originX:u="50%",originY:d="50%",originZ:h=0}=i;n.transformOrigin=`${u} ${d} ${h}`}}const LC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function S9(t,e,r){for(const n in e)!ln(e[n])&&!N9(n,r)&&(t[n]=e[n])}function Zee({transformTemplate:t},e){return w.useMemo(()=>{const r=LC();return $C(r,e,t),Object.assign({},r.vars,r.style)},[e])}function Qee(t,e){const r=t.style||{},n={};return S9(n,r,t),Object.assign(n,Zee(t,e)),n}function Jee(t,e){const r={},n=Qee(t,e);return t.drag&&t.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=n,r}const ete={offset:"stroke-dashoffset",array:"stroke-dasharray"},tte={offset:"strokeDashoffset",array:"strokeDasharray"};function rte(t,e,r=1,n=0,a=!0){t.pathLength=1;const i=a?ete:tte;t[i.offset]=ot.transform(-n);const o=ot.transform(e),l=ot.transform(r);t[i.array]=`${o} ${l}`}function C9(t,{attrX:e,attrY:r,attrScale:n,pathLength:a,pathSpacing:i=1,pathOffset:o=0,...l}
vendor: 5,403 bytes, line 692
692,u,d,h){if($C(t,l,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:m,style:p}=t;m.transform&&(p.transform=m.transform,delete m.transform),(p.transform||m.transformOrigin)&&(p.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),p.transform&&(p.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete m.transformBox),e!==void 0&&(m.x=e),r!==void 0&&(m.y=r),n!==void 0&&(m.scale=n),a!==void 0&&rte(m,a,i,o,!1)}const k9=()=>({...LC(),attrs:{}}),E9=t=>typeof t=="string"&&t.toLowerCase()==="svg";function nte(t,e,r,n){const a=w.useMemo(()=>{const i=k9();return C9(i,e,E9(n),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};S9(i,t.style,t),a.style={...i,...a.style}}return a}const ate=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function FC(t){return typeof t!="string"||t.includes("-")?!1:!!(ate.indexOf(t)>-1||/[A-Z]/u.test(t))}function ste(t,e,r,{latestValues:n},a,i=!1){const l=(FC(t)?nte:Jee)(e,n,a,t),u=qee(e,typeof t=="string",i),d=t!==w.Fragment?{...u,...l,ref:r}:{},{children:h}=e,m=w.useMemo(()=>ln(h)?h.get():h,[h]);return w.createElement(t,{...d,children:m})}function QO(t){const e=[{},{}];return t==null||t.values.forEach((r,n)=>{e[0][n]=r.get(),e[1][n]=r.getVelocity()}),e}function BC(t,e,r,n){if(typeof e=="function"){const[a,i]=QO(n);e=e(r!==void 0?r:t.custom,a,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,i]=QO(n);e=e(r!==void 0?r:t.custom,a,i)}return e}function lg(t){return ln(t)?t.get():t}function ite({scrapeMotionValuesFromProps:t,createRenderState:e},r,n,a){return{latestValues:ote(r,n,a,t),renderState:e()}}function ote(t,e,r,n){const a={},i=n(t,{});for(const p in i)a[p]=lg(i[p]);let{initial:o,animate:l}=t;const u=c0(t),d=j9(t);e&&d&&!u&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let h=r?r.initial===!1:!1;h=h||o===!1;const m=h?l:o;if(m&&typeof m!="boolean"&&!l0(m)){const p=Array.isArray(m)?m:[m];for(let v=0;v<p.length;v++){const b=BC(t,p[v]);if(b){const{transitionEnd:y,transition:x,...j}=b;for(const N in j){let S=j[N];if(Array.isArray(S)){const k=h?S.length-1:0;S=S[k]}S!==null&&(a[N]=S)}for(const N in y)a[N]=y[N]}}}return a}const A9=t=>(e,r)=>{const n=w.useContext(o0),a=w.useContext(i0),i=()=>ite(t,e,n,a);return r?i():dC(i)};function VC(t,e,r){var i;const{style:n}=t,a={};for(const o in n)(ln(n[o])||e.style&&ln(e.style[o])||N9(o,t)||((i=r==null?void 0:r.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(a[o]=n[o]);return a}const lte=A9({scrapeMotionValuesFromProps:VC,createRenderState:LC});function P9(t,e,r){const n=VC(t,e,r);for(const a in t)if(ln(t[a])||ln(e[a])){const i=Qu.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;n[i]=t[a]}return n}const cte=A9({scrapeMotionValuesFromProps:P9,createRenderState:k9}),ute=Symbol.for("motionComponentSymbol");function Dc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function dte(t,e,r){return w.useCallback(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),r&&(typeof r=="function"?r(n):Dc(r)&&(r.current=n))},[e])}const zC=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),fte="framerAppearId",T9="data-"+zC(fte),O9=w.createContext({});function hte(t,e,r,n,a){var y,x;const{visualElement:i}=w.useContext(o0),o=w.useContext(w9),l=w.useContext(i0),u=w.useContext(RC).reducedMotion,d=w.useRef(null);n=n||o.renderer,!d.current&&n&&(d.current=n(t,{visualState:e,parent:i,props:r,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:u}));const h=d.current,m=w.useContext(O9);h&&!h.projection&&a&&(h.type==="html"||h.type==="svg")&&mte(d.current,r,a,m);const p=w.useRef(!1);w.useInsertionEffect(()=>{h&&p.current&&h.update(r,l)});const v=r[T9],b=w.useRef(!!v&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,v))&&((x=window.MotionHasOptimisedAnimation)==null?void 0:x.call(window,v)));return A6(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),b.current&&h.animationState&&h.animationState.animateChanges())}),w.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var j;(j=window.MotionHandoffMarkAsComplete)==null||j.call(window,v)}),b.current=!1),h.enteringChildren=void 0)}),h}function mte(t,e,r,n){const{layoutId:a,layout:i,drag:o,dragConstraints:l,layoutScroll:u,layoutRoot:d,layoutCrossfade:h}=e;t.projection=new r(t.latestValues,e["data-framer-portal-id"]?void 0:M9(t.parent)),t.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!o||l&&Dc(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:n,crossfade:h,layoutScroll:u,layoutRoot:d})}function M9(t){if(t)return t.options.allowProjection!==!1?t.projection:M9(t.parent)}function Sb(t,{forwardMotionProps:e=!1}={},r,n){r&&Vee(r);const a=FC(t)?cte:lte;function i(l,u){let d;const h={...w.useContext(RC),...l,layoutId:pte(l)},{isStatic:m}=h,p=Hee(l),v=a(l,m);if(!m&&fC){gte();const b=vte(h);d=b.MeasureLayout,p.visualElement=hte(t,v,h,n,b.ProjectionNode)}return s.jsxs(o0.Provider,{value:p,children:[d&&p.visualElement?s.jsx(d,{visualElement:p.visualElement,...h}
vendor: 9,591 bytes, line 692
692):null,ste(t,l,dte(v,p.visualElement,u),v,m,e)]})}i.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const o=w.forwardRef(i);return o[ute]=t,o}function pte({layoutId:t}){const e=w.useContext(uC).id;return e&&t!==void 0?e+"-"+t:t}function gte(t,e){w.useContext(w9).strict}function vte(t){const{drag:e,layout:r}=fu;if(!e&&!r)return{};const n={...e,...r};return{MeasureLayout:e!=null&&e.isEnabled(t)||r!=null&&r.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}function xte(t,e){if(typeof Proxy>"u")return Sb;const r=new Map,n=(i,o)=>Sb(i,o,t,e),a=(i,o)=>n(i,o);return new Proxy(a,{get:(i,o)=>o==="create"?n:(r.has(o)||r.set(o,Sb(o,void 0,t,e)),r.get(o))})}function R9({top:t,left:e,right:r,bottom:n}){return{x:{min:e,max:r},y:{min:t,max:n}}}function yte({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function bte(t,e){if(!e)return t;const r=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function Cb(t){return t===void 0||t===1}function BN({scale:t,scaleX:e,scaleY:r}){return!Cb(t)||!Cb(e)||!Cb(r)}function tl(t){return BN(t)||I9(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function I9(t){return JO(t.x)||JO(t.y)}function JO(t){return t&&t!=="0%"}function Tg(t,e,r){const n=t-r,a=e*n;return r+a}function e4(t,e,r,n,a){return a!==void 0&&(t=Tg(t,a,n)),Tg(t,r,n)+e}function VN(t,e=0,r=1,n,a){t.min=e4(t.min,e,r,n,a),t.max=e4(t.max,e,r,n,a)}function D9(t,{x:e,y:r}){VN(t.x,e.translate,e.scale,e.originPoint),VN(t.y,r.translate,r.scale,r.originPoint)}const t4=.999999999999,r4=1.0000000000001;function wte(t,e,r,n=!1){const a=r.length;if(!a)return;e.x=e.y=1;let i,o;for(let l=0;l<a;l++){i=r[l],o=i.projectionDelta;const{visualElement:u}=i.options;u&&u.props.style&&u.props.style.display==="contents"||(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Lc(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,D9(t,o)),n&&tl(i.latestValues)&&Lc(t,i.latestValues))}e.x<r4&&e.x>t4&&(e.x=1),e.y<r4&&e.y>t4&&(e.y=1)}function $c(t,e){t.min=t.min+e,t.max=t.max+e}function n4(t,e,r,n,a=.5){const i=or(t.min,t.max,a);VN(t,e,r,i,n)}function Lc(t,e){n4(t.x,e.x,e.scaleX,e.scale,e.originX),n4(t.y,e.y,e.scaleY,e.scale,e.originY)}function $9(t,e){return R9(bte(t.getBoundingClientRect(),e))}function _te(t,e,r){const n=$9(t,r),{scroll:a}=e;return a&&($c(n.x,a.offset.x),$c(n.y,a.offset.y)),n}const a4=()=>({translate:0,scale:1,origin:0,originPoint:0}),Fc=()=>({x:a4(),y:a4()}),s4=()=>({min:0,max:0}),Tr=()=>({x:s4(),y:s4()}),zN={current:null},L9={current:!1};function jte(){if(L9.current=!0,!!fC)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>zN.current=t.matches;t.addEventListener("change",e),e()}else zN.current=!1}const Nte=new WeakMap;function Ste(t,e,r){for(const n in e){const a=e[n],i=r[n];if(ln(a))t.addValue(n,a);else if(ln(i))t.addValue(n,du(a,{owner:t}));else if(i!==a)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(a):o.hasAnimated||o.set(a)}else{const o=t.getStaticValue(n);t.addValue(n,du(o!==void 0?o:a,{owner:t}))}}for(const n in r)e[n]===void 0&&t.removeValue(n);return e}const i4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Cte{scrapeMotionValuesFromProps(e,r,n){return{}}constructor({parent:e,props:r,presenceContext:n,reducedMotionConfig:a,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=AC,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=En.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,rr.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=o;this.latestValues=u,this.baseTarget={...u},this.initialValues=r.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=r,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=c0(r),this.isVariantNode=j9(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(r,{},this);for(const p in m){const v=m[p];u[p]!==void 0&&ln(v)&&v.set(u[p])}}mount(e){var r;this.current=e,Nte.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,a)=>this.bindToMotionValue(a,n)),L9.current||jte(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:zN.current,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),ho(this.notifyUpdate),ho(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const r in this.events)this.events[r].clear();for(const r in this.features){const n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,r){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Ju.has(e);n&&this.onBindTransform&&this.onBindTransform();const a=r.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&rr.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,r)),this.valueSubscriptions.set(e,()=>{a(),i&&i(),r.owner&&r.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in fu){const r=fu[e];if(!r)continue;const{isEnabled:n,Feature:a}=r;if(!this.features[e]&&a&&n(this.props)&&(this.features[e]=new a(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Tr()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,r){this.latestValues[e]=r}update(e,r){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<i4.length;n++){const a=i4[n];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,o=e[i];o&&(this.propEventSubscriptions[a]=this.on(a,o))}this.prevMotionValues=Ste(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(e),()=>r.variantChildren.delete(e)}addValue(e,r){const n=this.values.get(e);r!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,r),this.values.set(e,r),this.latestValues[e]=r.get())}removeValue(e){this.values.delete(e);const r=this.valueSubscriptions.get(e);r&&(r(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,r){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&r!==void 0&&(n=du(r===null?void 0:r,{owner:this}),this.addValue(e,n)),n}readValue(e,r){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(P6(n)||O6(n))?n=parseFloat(n):!Ree(n)&&mo.test(r)&&(n=h9(e,r)),this.setBaseTarget(e,ln(n)?n.get():n)),ln(n)?n.get():n}setBaseTarget(e,r){this.baseTarget[e]=r}getBaseTarget(e){var i;const{initial:r}=this.props;let n;if(typeof r=="string"||typeof r=="object"){const o=BC(this.props,r,(i=this.presenceContext)==null?void 0:i.custom);o&&(n=o[e])}if(r&&n!==void 0)return n;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!ln(a)?a:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,r){return this.events[e]||(this.events[e]=new vC),this.events[e].add(r)}notify(e,...r){this.events[e]&&this.events[e].notify(...r)}scheduleRenderMicrotask(){OC.render(this.render)}}
692class F9 extends Cte{constructor(){super(...arguments),this.KeyframeResolver=_ee}sortInstanceNodePosition(e,r){return e.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(e,r){return e.style?e.style[r]:void 0}removeValueFromRenderState(e,{vars:r,style:n}){delete r[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ln(e)&&(this.childSubscription=e.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}}function B9(t,{style:e,vars:r},n,a){const i=t.style;let o;for(o in e)i[o]=e[o];a==null||a.applyProjectionStyles(i,n);for(o in r)i.setProperty(o,r[o])}function kte(t){return window.getComputedStyle(t)}class Ete extends F9{constructor(){super(...arguments),this.type="html",this.renderInstance=B9}readValueFromInstance(e,r){var n;if(Ju.has(r))return(n=this.projection)!=null&&n.isProjecting?MN(r):VJ(e,r);{const a=kte(e),i=(bC(r)?a.getPropertyValue(r):a[r])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:r}){return $9(e,r)}build(e,r,n){$C(e,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,r,n){return VC(e,r,n)}}const V9=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ate(t,e,r,n){B9(t,e,void 0,n);for(const a in e.attrs)t.setAttribute(V9.has(a)?a:zC(a),e.attrs[a])}class Pte extends F9{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Tr}getBaseTargetFromProps(e,r){return e[r]}readValueFromInstance(e,r){if(Ju.has(r)){const n=f9(r);return n&&n.default||0}return r=V9.has(r)?r:zC(r),e.getAttribute(r)}scrapeMotionValuesFromProps(e,r,n){return P9(e,r,n)}
vendor: 11,372 bytes, line 692
692build(e,r,n){C9(e,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,r,n,a){Ate(e,r,n,a)}mount(e){this.isSVGTag=E9(e.tagName),super.mount(e)}}const Tte=(t,e)=>FC(t)?new Pte(e):new Ete(e,{allowProjection:t!==w.Fragment});function Gc(t,e,r){const n=t.getProps();return BC(n,e,r!==void 0?r:n.custom,t)}const UN=t=>Array.isArray(t);function Ote(t,e,r){t.hasValue(e)?t.getValue(e).set(r):t.addValue(e,du(r))}function Mte(t){return UN(t)?t[t.length-1]||0:t}function Rte(t,e){const r=Gc(t,e);let{transitionEnd:n={},transition:a={},...i}=r||{};i={...i,...n};for(const o in i){const l=Mte(i[o]);Ote(t,o,l)}}function Ite(t){return!!(ln(t)&&t.add)}function qN(t,e){const r=t.getValue("willChange");if(Ite(r))return r.add(e);if(!r&&di.WillChange){const n=new di.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function z9(t){return t.props[T9]}const Dte=t=>t!==null;function $te(t,{repeat:e,repeatType:r="loop"},n){const a=t.filter(Dte),i=e&&r!=="loop"&&e%2===1?0:a.length-1;return a[i]}const Lte={type:"spring",stiffness:500,damping:25,restSpeed:10},Fte=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Bte={type:"keyframes",duration:.8},Vte={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},zte=(t,{keyframes:e})=>e.length>2?Bte:Ju.has(t)?t.startsWith("scale")?Fte(e[1]):Lte:Vte;function Ute({when:t,delay:e,delayChildren:r,staggerChildren:n,staggerDirection:a,repeat:i,repeatType:o,repeatDelay:l,from:u,elapsed:d,...h}){return!!Object.keys(h).length}const UC=(t,e,r,n={},a,i)=>o=>{const l=PC(n,t)||{},u=l.delay||n.delay||0;let{elapsed:d=0}=n;d=d-Ns(u);const h={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:p=>{e.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:a};Ute(l)||Object.assign(h,zte(t,h)),h.duration&&(h.duration=Ns(h.duration)),h.repeatDelay&&(h.repeatDelay=Ns(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let m=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(LN(h),h.delay===0&&(m=!0)),(di.instantAnimations||di.skipAnimations)&&(m=!0,LN(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,m&&!i&&e.get()!==void 0){const p=$te(h.keyframes,l);if(p!==void 0){rr.update(()=>{h.onUpdate(p),h.onComplete()});return}}return l.isSync?new EC(h):new uee(h)};function qte({protectedKeys:t,needsAnimating:e},r){const n=t.hasOwnProperty(r)&&e[r]!==!0;return e[r]=!1,n}function U9(t,e,{delay:r=0,transitionOverride:n,type:a}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...l}=e;n&&(i=n);const u=[],d=a&&t.animationState&&t.animationState.getState()[a];for(const h in l){const m=t.getValue(h,t.latestValues[h]??null),p=l[h];if(p===void 0||d&&qte(d,h))continue;const v={delay:r,...PC(i||{},h)},b=m.get();if(b!==void 0&&!m.isAnimating&&!Array.isArray(p)&&p===b&&!v.velocity)continue;let y=!1;if(window.MotionHandoffAnimation){const j=z9(t);if(j){const N=window.MotionHandoffAnimation(j,h,rr);N!==null&&(v.startTime=N,y=!0)}}qN(t,h),m.start(UC(h,m,p,t.shouldReduceMotion&&c9.has(h)?{type:!1}:v,t,y));const x=m.animation;x&&u.push(x)}return o&&Promise.all(u).then(()=>{rr.update(()=>{o&&Rte(t,o)})}),u}function q9(t,e,r,n=0,a=1){const i=Array.from(t).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),o=t.size,l=(o-1)*n;return typeof r=="function"?r(i,o):a===1?i*n:l-i*n}function WN(t,e,r={}){var u;const n=Gc(t,e,r.type==="exit"?(u=t.presenceContext)==null?void 0:u.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(a=r.transitionOverride);const i=n?()=>Promise.all(U9(t,n,r)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=a;return Wte(t,e,d,h,m,p,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[d,h]=l==="beforeChildren"?[i,o]:[o,i];return d().then(()=>h())}else return Promise.all([i(),o(r.delay)])}function Wte(t,e,r=0,n=0,a=0,i=1,o){const l=[];for(const u of t.variantChildren)u.notify("AnimationStart",e),l.push(WN(u,e,{...o,delay:r+(typeof n=="function"?0:n)+q9(t.variantChildren,u,n,a,i)}).then(()=>u.notify("AnimationComplete",e)));return Promise.all(l)}function Hte(t,e,r={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const a=e.map(i=>WN(t,i,r));n=Promise.all(a)}else if(typeof e=="string")n=WN(t,e,r);else{const a=typeof e=="function"?Gc(t,e,r.custom):e;n=Promise.all(U9(t,a,r))}return n.then(()=>{t.notify("AnimationComplete",e)})}function W9(t,e){if(!Array.isArray(e))return!1;const r=e.length;if(r!==t.length)return!1;for(let n=0;n<r;n++)if(e[n]!==t[n])return!1;return!0}const Gte=DC.length;function H9(t){if(!t)return;if(!t.isControllingVariants){const r=t.parent?H9(t.parent)||{}:{};return t.props.initial!==void 0&&(r.initial=t.props.initial),r}const e={};for(let r=0;r<Gte;r++){const n=DC[r],a=t.props[n];(Hf(a)||a===!1)&&(e[n]=a)}return e}const Kte=[...IC].reverse(),Yte=IC.length;function Xte(t){return e=>Promise.all(e.map(({animation:r,options:n})=>Hte(t,r,n)))}function Zte(t){let e=Xte(t),r=o4(),n=!0;const a=u=>(d,h)=>{var p;const m=Gc(t,h,u==="exit"?(p=t.presenceContext)==null?void 0:p.custom:void 0);if(m){const{transition:v,transitionEnd:b,...y}=m;d={...d,...y,...b}}return d};function i(u){e=u(t)}function o(u){const{props:d}=t,h=H9(t.parent)||{},m=[],p=new Set;let v={},b=1/0;for(let x=0;x<Yte;x++){const j=Kte[x],N=r[j],S=d[j]!==void 0?d[j]:h[j],k=Hf(S),C=j===u?N.isActive:null;C===!1&&(b=x);let A=S===h[j]&&S!==d[j]&&k;if(A&&n&&t.manuallyAnimateOnMount&&(A=!1),N.protectedKeys={...v},!N.isActive&&C===null||!S&&!N.prevProp||l0(S)||typeof S=="boolean")continue;const T=Qte(N.prevProp,S);let R=T||j===u&&N.isActive&&!A&&k||x>b&&k,I=!1;const D=Array.isArray(S)?S:[S];let L=D.reduce(a(j),{});C===!1&&(L={});const{prevResolvedValues:z={}}=N,H={...z,...L},Z=M=>{R=!0,p.has(M)&&(I=!0,p.delete(M)),N.needsAnimating[M]=!0;const F=t.getValue(M);F&&(F.liveStyle=!1)};for(const M in H){const F=L[M],K=z[M];if(v.hasOwnProperty(M))continue;let B=!1;UN(F)&&UN(K)?B=!W9(F,K):B=F!==K,B?F!=null?Z(M):p.add(M):F!==void 0&&p.has(M)?Z(M):N.protectedKeys[M]=!0}N.prevProp=S,N.prevResolvedValues=L,N.isActive&&(v={...v,...L}),n&&t.blockInitialAnimation&&(R=!1);const te=A&&T;R&&(!te||I)&&m.push(...D.map(M=>{const F={type:j};if(typeof M=="string"&&n&&!te&&t.manuallyAnimateOnMount&&t.parent){const{parent:K}=t,B=Gc(K,M);if(K.enteringChildren&&B){const{delayChildren:O}=B.transition||{};F.delay=q9(K.enteringChildren,t,O)}}return{animation:M,options:F}}))}if(p.size){const x={};if(typeof d.initial!="boolean"){const j=Gc(t,Array.isArray(d.initial)?d.initial[0]:d.initial);j&&j.transition&&(x.transition=j.transition)}p.forEach(j=>{const N=t.getBaseTarget(j),S=t.getValue(j);S&&(S.liveStyle=!0),x[j]=N??null}),m.push({animation:x})}let y=!!m.length;return n&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(y=!1),n=!1,y?e(m):Promise.resolve()}function l(u,d){var m;if(r[u].isActive===d)return Promise.resolve();(m=t.variantChildren)==null||m.forEach(p=>{var v;return(v=p.animationState)==null?void 0:v.setActive(u,d)}),r[u].isActive=d;const h=o(u);for(const p in r)r[p].protectedKeys={};return h}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>r,reset:()=>{r=o4()}}}function Qte(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!W9(e,t):!1}function Zo(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function o4(){return{animate:Zo(!0),whileInView:Zo(),whileHover:Zo(),whileTap:Zo(),whileDrag:Zo(),whileFocus:Zo(),exit:Zo()}}class Co{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Jte extends Co{constructor(e){super(e),e.animationState||(e.animationState=Zte(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();l0(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:r}=this.node.prevProps||{};e!==r&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let ere=0;class tre extends Co{constructor(){super(...arguments),this.id=ere++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const a=this.node.animationState.setActive("exit",!e);r&&!e&&a.then(()=>{r(this.id)})}mount(){const{register:e,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const rre={animation:{Feature:Jte},exit:{Feature:tre}};function Kf(t,e,r,n={passive:!0}){return t.addEventListener(e,r,n),()=>t.removeEventListener(e,r)}function zh(t){return{point:{x:t.pageX,y:t.pageY}}}const nre=t=>e=>MC(e)&&t(e,zh(e));function kf(t,e,r,n){return Kf(t,e,nre(r),n)}const G9=1e-4,are=1-G9,sre=1+G9,K9=.01,ire=0-K9,ore=0+K9;function pn(t){return t.max-t.min}function lre(t,e,r){return Math.abs(t-e)<=r}function l4(t,e,r,n=.5){t.origin=n,t.originPoint=or(e.min,e.max,t.origin),t.scale=pn(r)/pn(e),t.translate=or(r.min,r.max,t.origin)-t.originPoint,(t.scale>=are&&t.scale<=sre||isNaN(t.scale))&&(t.scale=1),(t.translate>=ire&&t.translate<=ore||isNaN(t.translate))&&(t.translate=0)}function Ef(t,e,r,n){l4(t.x,e.x,r.x,n?n.originX:void 0),l4(t.y,e.y,r.y,n?n.originY:void 0)}function c4(t,e,r){t.min=r.min+e.min,t.max=t.min+pn(e)}function cre(t,e,r){c4(t.x,e.x,r.x),c4(t.y,e.y,r.y)}function u4(t,e,r){t.min=e.min-r.min,t.max=t.min+pn(e)}function Og(t,e,r){u4(t.x,e.x,r.x),u4(t.y,e.y,r.y)}function ga(t){return[t("x"),t("y")]}const Y9=({current:t})=>t?t.ownerDocument.defaultView:null,d4=(t,e)=>Math.abs(t-e);function ure(t,e){const r=d4(t.x,e.x),n=d4(t.y,e.y);return Math.sqrt(r**2+n**2)}class X9{constructor(e,r,{transformPagePoint:n,contextWindow:a=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=Eb(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,b=ure(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!b)return;const{point:y}=p,{timestamp:x}=Kr;this.history.push({...y,timestamp:x});const{onStart:j,onMove:N}=this.handlers;v||(j&&j(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,p)},this.handlePointerMove=(p,v)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=kb(v,this.transformPagePoint),rr.update(this.updatePoint,!0)},this.handlePointerUp=(p,v)=>{this.end();const{onEnd:b,onSessionEnd:y,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const j=Eb(p.type==="pointercancel"?this.lastMoveEventInfo:kb(v,this.transformPagePoint),this.history);this.startEvent&&b&&b(p,j),y&&y(p,j)},!MC(e))return;this.dragSnapToOrigin=i,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=a||window;const l=zh(e),u=kb(l,this.transformPagePoint),{point:d}=u,{timestamp:h}=Kr;this.history=[{...d,timestamp:h}];const{onSessionStart:m}=r;m&&m(e,Eb(u,this.history)),this.removeListeners=Fh(kf(this.contextWindow,"pointermove",this.handlePointerMove),kf(this.contextWindow,"pointerup",this.handlePointerUp),kf
vendor: 7,576 bytes, line 692
692(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ho(this.updatePoint)}}function kb(t,e){return e?{point:e(t.point)}:t}function f4(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Eb({point:t},e){return{point:t,delta:f4(t,Z9(e)),offset:f4(t,dre(e)),velocity:fre(e,.1)}}function dre(t){return t[0]}function Z9(t){return t[t.length-1]}function fre(t,e){if(t.length<2)return{x:0,y:0};let r=t.length-1,n=null;const a=Z9(t);for(;r>=0&&(n=t[r],!(a.timestamp-n.timestamp>Ns(e)));)r--;if(!n)return{x:0,y:0};const i=ya(a.timestamp-n.timestamp);if(i===0)return{x:0,y:0};const o={x:(a.x-n.x)/i,y:(a.y-n.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function hre(t,{min:e,max:r},n){return e!==void 0&&t<e?t=n?or(e,t,n.min):Math.max(t,e):r!==void 0&&t>r&&(t=n?or(r,t,n.max):Math.min(t,r)),t}function h4(t,e,r){return{min:e!==void 0?t.min+e:void 0,max:r!==void 0?t.max+r-(t.max-t.min):void 0}}function mre(t,{top:e,left:r,bottom:n,right:a}){return{x:h4(t.x,r,a),y:h4(t.y,e,n)}}function m4(t,e){let r=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([r,n]=[n,r]),{min:r,max:n}}function pre(t,e){return{x:m4(t.x,e.x),y:m4(t.y,e.y)}}function gre(t,e){let r=.5;const n=pn(t),a=pn(e);return a>n?r=Uf(e.min,e.max-n,t.min):n>a&&(r=Uf(t.min,t.max-a,e.min)),ui(0,1,r)}function vre(t,e){const r={};return e.min!==void 0&&(r.min=e.min-t.min),e.max!==void 0&&(r.max=e.max-t.min),r}const HN=.35;function xre(t=HN){return t===!1?t=0:t===!0&&(t=HN),{x:p4(t,"left","right"),y:p4(t,"top","bottom")}}function p4(t,e,r){return{min:g4(t,e),max:g4(t,r)}}function g4(t,e){return typeof t=="number"?t:t[e]||0}const yre=new WeakMap;class bre{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Tr(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:r=!1,distanceThreshold:n}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const i=m=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),r&&this.snapToCursor(zh(m).point)},o=(m,p)=>{const{drag:v,dragPropagation:b,onDragStart:y}=this.getProps();if(v&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=Cee(v),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ga(j=>{let N=this.getAxisMotionValue(j).get()||0;if(Ss.test(N)){const{projection:S}=this.visualElement;if(S&&S.layout){const k=S.layout.layoutBox[j];k&&(N=pn(k)*(parseFloat(N)/100))}}this.originPoint[j]=N}),y&&rr.postRender(()=>y(m,p)),qN(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p;const{dragPropagation:v,dragDirectionLock:b,onDirectionLock:y,onDrag:x}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:j}=p;if(b&&this.currentDirection===null){this.currentDirection=wre(j),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",p.point,j),this.updateAxis("y",p.point,j),this.visualElement.render(),x&&x(m,p)},u=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p,this.stop(m,p),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>ga(m=>{var p;return this.getAnimationState(m)==="paused"&&((p=this.getAxisMotionValue(m).animation)==null?void 0:p.play())}),{dragSnapToOrigin:h}=this.getProps();this.panSession=new X9(e,{onSessionStart:i,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:n,contextWindow:Y9(this.visualElement)})}stop(e,r){const n=e||this.latestPointerEvent,a=r||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!a||!n)return;const{velocity:o}=a;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&rr.postRender(()=>l(n,a))}cancel(){this.isDragging=!1;const{projection:e,animationState:r}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}updateAxis(e,r,n){const{drag:a}=this.getProps();if(!n||!Op(e,a,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=hre(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,a=this.constraints;e&&Dc(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=mre(n.layoutBox,e):this.constraints=!1,this.elastic=xre(r),a!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&ga(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=vre(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:r}=this.getProps();if(!e||!Dc(e))return!1;const n=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const i=_te(n,a.root,this.visualElement.getTransformPagePoint());let o=pre(a.layout.layoutBox,i);if(r){const l=r(yte(o));this.hasMutatedConstraints=!!l,l&&(o=R9(l))}return o}startAnimation(e){const{drag:r,dragMomentum:n,dragElastic:a,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),u=this.constraints||{},d=ga(h=>{if(!Op(h,r,this.currentDirection))return;let m=u&&u[h]||{};o&&(m={min:0,max:0});const p=a?200:1e6,v=a?40:1e7,b={type:"inertia",velocity:n?e[h]:0,bounceStiffness:p,bounceDamping:v,timeConstant:750,restDelta:1,restSpeed:10,...i,...m};return this.startAxisValueAnimation(h,b)});return Promise.all(d).then(l)}startAxisValueAnimation(e,r){const n=this.getAxisMotionValue(e);return qN(this.visualElement,e),n.start(UC(e,n,0,r,this.visualElement,!1))}stopAnimation(){ga(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){ga(e=>{var r;return(r=this.getAxisMotionValue(e).animation)==null?void 0:r.pause()})}getAnimationState(e){var r;return(r=this.getAxisMotionValue(e).animation)==null?void 0:r.state}getAxisMotionValue(e){const r=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),a=n[r];return a||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){ga(r=>{const{drag:n}=this.getProps();if(!Op(r,n,this.currentDirection))return;const{projection:a}=this.visualElement,i=this.getAxisMotionValue(r);if(a&&a.layout){const{min:o,max:l}=a.layout.layoutBox[r];i.set(e[r]-or(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Dc(r)||!n||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};ga(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const u=l.get();a[o]=gre({min:u,max:u},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),ga(o=>
vendor: 4,684 bytes, line 692
692{if(!Op(o,e,null))return;const l=this.getAxisMotionValue(o),{min:u,max:d}=this.constraints[o];l.set(or(u,d,a[o]))})}addListeners(){if(!this.visualElement.current)return;yre.set(this.visualElement,this);const e=this.visualElement.current,r=kf(e,"pointerdown",u=>{const{drag:d,dragListener:h=!0}=this.getProps();d&&h&&this.start(u)}),n=()=>{const{dragConstraints:u}=this.getProps();Dc(u)&&u.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,i=a.addEventListener("measure",n);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),rr.read(n);const o=Kf(window,"resize",()=>this.scalePositionWithinConstraints()),l=a.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(ga(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=u[h].translate,m.set(m.get()+u[h].translate))}),this.visualElement.render())}));return()=>{o(),r(),i(),l&&l()}}getProps(){const e=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:a=!1,dragConstraints:i=!1,dragElastic:o=HN,dragMomentum:l=!0}=e;return{...e,drag:r,dragDirectionLock:n,dragPropagation:a,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Op(t,e,r){return(e===!0||e===t)&&(r===null||r===t)}function wre(t,e=10){let r=null;return Math.abs(t.y)>e?r="y":Math.abs(t.x)>e&&(r="x"),r}class _re extends Co{constructor(e){super(e),this.removeGroupControls=wa,this.removeListeners=wa,this.controls=new bre(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||wa}unmount(){this.removeGroupControls(),this.removeListeners()}}const v4=t=>(e,r)=>{t&&rr.postRender(()=>t(e,r))};class jre extends Co{constructor(){super(...arguments),this.removePointerDownListener=wa}onPointerDown(e){this.session=new X9(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Y9(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:r,onPan:n,onPanEnd:a}=this.node.getProps();return{onSessionStart:v4(e),onStart:v4(r),onMove:n,onEnd:(i,o)=>{delete this.session,a&&rr.postRender(()=>a(i,o))}}}mount(){this.removePointerDownListener=kf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const cg={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function x4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Qd={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(ot.test(t))t=parseFloat(t);else return t;const r=x4(t,e.target.x),n=x4(t,e.target.y);return`${r}% ${n}%`}},Nre={correct:(t,{treeScale:e,projectionDelta:r})=>{const n=t,a=mo.parse(t);if(a.length>5)return n;const i=mo.createTransformer(t),o=typeof a[0]!="number"?1:0,l=r.x.scale*e.x,u=r.y.scale*e.y;a[0+o]/=l,a[1+o]/=u;const d=or(l,u,.5);return typeof a[2+o]=="number"&&(a[2+o]/=d),typeof a[3+o]=="number"&&(a[3+o]/=d),i(a)}};let Ab=!1;class Sre extends w.Component{componentDidMount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n,layoutId:a}=this.props,{projection:i}=e;Gee(Cre),i&&(r.group&&r.group.add(i),n&&n.register&&a&&n.register(i),Ab&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),cg.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:r,visualElement:n,drag:a,isPresent:i}=this.props,{projection:o}=n;return o&&(o.isPresent=i,Ab=!0,a||e.layoutDependency!==r||r===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||rr.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),OC.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:a}=e;Ab=!0,a&&(a.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(a),n&&n.deregister&&n.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Q9(t){const[e,r]=b9(),n=w.useContext(uC);return s.jsx(Sre,{...t,layoutGroup:n,switchLayoutGroup:w.useContext(O9),isPresent:e,safeToRemove:r})}const Cre={borderRadius:{...Qd,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Qd,borderTopRightRadius:Qd,borderBottomLeftRadius:Qd,borderBottomRightRadius:Qd,boxSh
vendor: 4,391 bytes, line 692
692adow:Nre};function kre(t,e,r){const n=ln(t)?t:du(t);return n.start(UC("",n,e,r)),n.animation}const Ere=(t,e)=>t.depth-e.depth;class Are{constructor(){this.children=[],this.isDirty=!1}add(e){hC(this.children,e),this.isDirty=!0}remove(e){mC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ere),this.isDirty=!1,this.children.forEach(e)}}function Pre(t,e){const r=En.now(),n=({timestamp:a})=>{const i=a-r;i>=e&&(ho(n),t(i-e))};return rr.setup(n,!0),()=>ho(n)}const J9=["TopLeft","TopRight","BottomLeft","BottomRight"],Tre=J9.length,y4=t=>typeof t=="string"?parseFloat(t):t,b4=t=>typeof t=="number"||ot.test(t);function Ore(t,e,r,n,a,i){a?(t.opacity=or(0,r.opacity??1,Mre(n)),t.opacityExit=or(e.opacity??1,0,Rre(n))):i&&(t.opacity=or(e.opacity??1,r.opacity??1,n));for(let o=0;o<Tre;o++){const l=`border${J9[o]}Radius`;let u=w4(e,l),d=w4(r,l);if(u===void 0&&d===void 0)continue;u||(u=0),d||(d=0),u===0||d===0||b4(u)===b4(d)?(t[l]=Math.max(or(y4(u),y4(d),n),0),(Ss.test(d)||Ss.test(u))&&(t[l]+="%")):t[l]=d}(e.rotate||r.rotate)&&(t.rotate=or(e.rotate||0,r.rotate||0,n))}function w4(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Mre=eF(0,.5,B6),Rre=eF(.5,.95,wa);function eF(t,e,r){return n=>n<t?0:n>e?1:r(Uf(t,e,n))}function _4(t,e){t.min=e.min,t.max=e.max}function $a(t,e){_4(t.x,e.x),_4(t.y,e.y)}function j4(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function N4(t,e,r,n,a){return t-=e,t=Tg(t,1/r,n),a!==void 0&&(t=Tg(t,1/a,n)),t}function Ire(t,e=0,r=1,n=.5,a,i=t,o=t){if(Ss.test(e)&&(e=parseFloat(e),e=or(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=or(i.min,i.max,n);t===i&&(l-=e),t.min=N4(t.min,e,r,l,a),t.max=N4(t.max,e,r,l,a)}function S4(t,e,[r,n,a],i,o){Ire(t,e[r],e[n],e[a],e.scale,i,o)}const Dre=["x","scaleX","originX"],$re=["y","scaleY","originY"];function C4(t,e,r,n){S4(t.x,e,Dre,r?r.x:void 0,n?n.x:void 0),S4(t.y,e,$re,r?r.y:void 0,n?n.y:void 0)}function k4(t){return t.translate===0&&t.scale===1}function tF(t){return k4(t.x)&&k4(t.y)}function E4(t,e){return t.min===e.min&&t.max===e.max}function Lre(t,e){return E4(t.x,e.x)&&E4(t.y,e.y)}function A4(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function rF(t,e){return A4(t.x,e.x)&&A4(t.y,e.y)}function P4(t){return pn(t.x)/pn(t.y)}function T4(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Fre{constructor(){this.members=[]}add(e){hC(this.members,e),e.scheduleRender()}remove(e){if(mC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(e){const r=this.members.findIndex(a=>e===a);if(r===0)return!1;let n;for(let a=r;a>=0;a--){const i=this.members[a];if(i.isPresent!==!1){n=i;break}}return n?(this.promote(n),!0):!1}promote(e,r){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,r&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:r,resumingFrom:n}=e;r.onExitComplete&&r.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Bre(t,e,r){let n="";const a=t.x.translate/e.x,i=t.y.translate/e.y,o=(r==null?void 0:r.z)||0;if((a||i||o)&&(n=`translate3d(${a}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),r){const{transformPerspective:d,rotate:h,rotateX:m,rotateY:p,skewX:v,skewY:b}=r;d&&(n=`perspective(${d}px) ${n}`),h&&(n+=`rotate(${h}deg) `),m&&(n+=`rotateX(${m}deg) `),p&&(n+=`rotateY(${p}deg) `),v&&(n+=`skewX(${v}deg) `),b&&(n+=`skewY(${b}deg) `)}const l=t.x.scale*e.x,u=t.y.scale*e.y;return(l!==1||u!==1)&&(n+=`scale(${l}, ${u})`),n||"none"}const Pb=["","X","Y","Z"],Vre=1e3;let zre=0;function Tb(t,e,r,n){const{latestValues:a}=e;a[t]&&(r[t]=a[t],e.setStaticValue(t,0),n&&(n[t]=0))}function nF(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const r=z9(e);
vendor: 11,688 bytes, line 692
692if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:a,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(r,"transform",rr,!(a||i))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&nF(n)}function aF({attachResizeListener:t,defaultParent:e,measureScroll:r,checkIsScrollRoot:n,resetTransform:a}){return class{constructor(o={},l=e==null?void 0:e()){this.id=zre++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Wre),this.nodes.forEach(Yre),this.nodes.forEach(Xre),this.nodes.forEach(Hre)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Are)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new vC),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const u=this.eventHandlers.get(o);u&&u.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=y9(o)&&!Oee(o),this.instance=o;const{layoutId:l,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||l)&&(this.isLayoutDirty=!0),t){let h,m=0;const p=()=>this.root.updateBlockedByResize=!1;rr.read(()=>{m=window.innerWidth}),t(o,()=>{const v=window.innerWidth;v!==m&&(m=v,this.root.updateBlockedByResize=!0,h&&h(),h=Pre(p,250),cg.hasAnimatedSinceResize&&(cg.hasAnimatedSinceResize=!1,this.nodes.forEach(R4)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m,hasRelativeLayoutChanged:p,layout:v})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||d.getDefaultTransition()||tne,{onLayoutAnimationStart:y,onLayoutAnimationComplete:x}=d.getProps(),j=!this.targetLayout||!rF(this.targetLayout,v),N=!m&&p;if(this.options.layoutRoot||this.resumeFrom||N||m&&(j||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...PC(b,"layout"),onPlay:y,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(h,N)}else m||R4(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=v})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ho(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Zre),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&nF(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const m=this.path[h];m.shouldResetTransform=!0,m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:l,layout:u}=this.options;if(l===void 0&&!u)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(O4);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(M4);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Kre),this.nodes.forEach(Ure),this.nodes.forEach(qre)):this.nodes.forEach(M4),this.clearAllSnapshots();const l=En.now();Kr.delta=ui(0,1e3/60,l-Kr.timestamp),Kr.timestamp=l,Kr.isProcessing=!0,yb.update.process(Kr),yb.preRender.process(Kr),yb.render.process(Kr),Kr.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,OC.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Gre),this.sharedNodes.forEach(Qre)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,rr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){rr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!pn(this.snapshot.measuredBox.x)&&!pn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u<this.path.length;u++)this.path[u].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Tr(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const u=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!a)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!tF(this.projectionDelta),u=this.getTransformTemplate(),d=u?u(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||tl(this.latestValues)||h)&&(a(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let u=this.removeElementScroll(l);return o&&(u=this.removeTransform(u)),rne(u),{animationId:this.root.animationId,measuredBox:l,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Tr();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(nne))){const{scroll:h}=this.root;h&&($c(l.x,h.offset.x),$c(l.y,h.offset.y))}return l}removeElementScroll(o){var u;const l=Tr();if($a(l,o),(u=this.scroll)!=null&&u.wasRoot)return l;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:m,options:p}=h;h!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&$a(l,o),$c(l.x,m.offset.x),$c(l.y,m.offset.y))}return l}applyTransform(o,l=!1){const u=Tr();$a(u,o);for(let d=0;d<this.path.length;d++){const h=this.path[d];!l&&h.options.layoutScroll&&h.scroll&&h!==h.root&&Lc(u,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),tl(h.latestValues)&&Lc(u,h.latestValues)}return tl(this.latestValues)&&Lc(u,this.latestValues),u}removeTransform(o){const l=Tr();$a(l,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];if(!d.instance||!tl(d.latestValues))continue;BN(d.latestValues)&&d.updateSnapshot();const h=Tr(),m=d.measurePageBox();$a(h,m),C4(l,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,h)}return tl(this.latestValues)&&C4(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Kr.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var v;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const u=!!this.resumingFrom||this!==l;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:m}=this.options;if(!this.layout||!(h||m))return;this.resolvedRelativeTargetAt=Kr.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Tr(),this.targetWithTransforms=Tr()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),cre(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):$a(this.target,this.layout.layoutBox),D9(this.target,this.targetDelta)):$a(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||BN(this.parent.latestValues)||I9(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Tr(),this.relativeTargetOrigin=Tr(),Og(this.relativeTargetOrigin,l,u),$a(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var b;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let u=!0;if((this.isProjectionDirty||(b=this.parent)!=null&&b.isProjectionDirty)&&
vendor: 5,279 bytes, line 692
692(u=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===Kr.timestamp&&(u=!1),u)return;const{layout:d,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||h))return;$a(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,p=this.treeScale.y;wte(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Tr());const{target:v}=o;if(!v){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(j4(this.prevProjectionDelta.x,this.projectionDelta.x),j4(this.prevProjectionDelta.y,this.projectionDelta.y)),Ef(this.projectionDelta,this.layoutCorrected,v,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==p||!T4(this.projectionDelta.x,this.prevProjectionDelta.x)||!T4(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",v))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fc(),this.projectionDelta=Fc(),this.projectionDeltaWithTransform=Fc()}setAnimationOrigin(o,l=!1){const u=this.snapshot,d=u?u.latestValues:{},h={...this.latestValues},m=Fc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=Tr(),v=u?u.source:void 0,b=this.layout?this.layout.source:void 0,y=v!==b,x=this.getStack(),j=!x||x.members.length<=1,N=!!(y&&!j&&this.options.crossfade===!0&&!this.path.some(ene));this.animationProgress=0;let S;this.mixTargetDelta=k=>{const C=k/1e3;I4(m.x,o.x,C),I4(m.y,o.y,C),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Og(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Jre(this.relativeTarget,this.relativeTargetOrigin,p,C),S&&Lre(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=Tr()),$a(S,this.relativeTarget)),y&&(this.animationValues=h,Ore(h,d,this.latestValues,C,N,j)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,u,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||d.stop(),this.pendingAnimation&&(ho(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=rr.update(()=>{cg.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=du(0)),this.currentAnimation=kre(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),o.onUpdate&&o.onUpdate(h)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Vre),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:u,layout:d,latestValues:h}=o;if(!(!l||!u||!d)){if(this!==o&&this.layout&&d&&sF(this.options.animationType,this.layout.layoutBox,d.layoutBox)){u=this.target||Tr();const m=pn(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+m;const p=pn(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+p}$a(l,u),Lc(l,h),Ef(this.projectionDeltaWithTransform,this.layoutCorrected,l,h)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Fre),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:u}={}){const d=this.getStack();d&&d.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}
vendor: 4,220 bytes, line 692
692resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(l=!0),!l)return;const d={};u.z&&Tb("z",o,d,this.animationValues);for(let h=0;h<Pb.length;h++)Tb(`rotate${Pb[h]}`,o,d,this.animationValues),Tb(`skew${Pb[h]}`,o,d,this.animationValues);o.render();for(const h in d)o.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=lg(l==null?void 0:l.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=lg(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!tl(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let m=Bre(this.projectionDeltaWithTransform,this.treeScale,h);u&&(m=u(h,m)),o.transform=m;const{x:p,y:v}=this.projectionDelta;o.transformOrigin=`${p.origin*100}% ${v.origin*100}% 0`,d.animationValues?o.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:o.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in Gf){if(h[b]===void 0)continue;const{correct:y,applyTo:x,isCSSVariable:j}=Gf[b],N=m==="none"?h[b]:y(h[b],d);if(x){const S=x.length;for(let k=0;k<S;k++)o[x[k]]=N}else j?this.options.visualElement.renderState.vars[b]=N:o[b]=N}this.options.layoutId&&(o.pointerEvents=d===this?lg(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(O4),this.root.sharedNodes.clear()}}}function Ure(t){t.updateLayout()}function qre(t){var r;const e=((r=t.resumeFrom)==null?void 0:r.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;i==="size"?ga(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],v=pn(p);p.min=n[m].min,p.max=p.min+v}):sF(i,e.layoutBox,n)&&ga(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],v=pn(n[m]);p.max=p.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[m].max=t.relativeTarget[m].min+v)});const l=Fc();Ef(l,n,e.layoutBox);const u=Fc();o?Ef(u,t.applyTransform(a,!0),e.measuredBox):Ef(u,n,e.layoutBox);const d=!tF(l);let h=!1;if(!t.resumeFrom){const m=t.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:v}=m;if(p&&v){const b=Tr();Og(b,e.layoutBox,p.layoutBox);const y=Tr();Og(y,n,v.layoutBox),rF(b,y)||(h=!0),m.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=b,t.relativeParent=m)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:u,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Wre(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Hre(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Gre(t){t.clearSnapshot()}function O4(t){t.clearMeasurements()}function M4(t){t.isLayoutDirty=!1}function Kre(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function R4(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Yre(t){t.resolveTargetDelta()}function Xre(t){t.calcProjection()}
vendor: 5,698 bytes, lines 692-696
692function Zre(t){t.resetSkewAndRotation()}function Qre(t){t.removeLeadSnapshot()}function I4(t,e,r){t.translate=or(e.translate,0,r),t.scale=or(e.scale,1,r),t.origin=e.origin,t.originPoint=e.originPoint}function D4(t,e,r,n){t.min=or(e.min,r.min,n),t.max=or(e.max,r.max,n)}function Jre(t,e,r,n){D4(t.x,e.x,r.x,n),D4(t.y,e.y,r.y,n)}function ene(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const tne={duration:.45,ease:[.4,0,.1,1]},$4=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),L4=$4("applewebkit/")&&!$4("chrome/")?Math.round:wa;function F4(t){t.min=L4(t.min),t.max=L4(t.max)}function rne(t){F4(t.x),F4(t.y)}function sF(t,e,r){return t==="position"||t==="preserve-aspect"&&!lre(P4(e),P4(r),.2)}function nne(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const ane=aF({attachResizeListener:(t,e)=>Kf(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ob={current:void 0},iF=aF({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ob.current){const t=new ane({});t.mount(window),t.setOptions({layoutScroll:!0}),Ob.current=t}return Ob.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),sne={pan:{Feature:jre},drag:{Feature:_re,ProjectionNode:iF,MeasureLayout:Q9}};function B4(t,e,r){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",r==="Start");const a="onHover"+r,i=n[a];i&&rr.postRender(()=>i(e,zh(e)))}class ine extends Co{mount(){const{current:e}=this.node;e&&(this.unmount=kee(e,(r,n)=>(B4(this.node,n,"Start"),a=>B4(this.node,a,"End"))))}unmount(){}}class one extends Co{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fh(Kf(this.node.current,"focus",()=>this.onFocus()),Kf(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function V4(t,e,r){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",r==="Start");const a="onTap"+(r==="End"?"":r),i=n[a];i&&rr.postRender(()=>i(e,zh(e)))}class lne extends Co{mount(){const{current:e}=this.node;e&&(this.unmount=Tee(e,(r,n)=>(V4(this.node,n,"Start"),(a,{success:i})=>V4(this.node,a,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const GN=new WeakMap,Mb=new WeakMap,cne=t=>{const e=GN.get(t.target);e&&e(t)},une=t=>{t.forEach(cne)};function dne({root:t,...e}){const r=t||document;Mb.has(r)||Mb.set(r,{});const n=Mb.get(r),a=JSON.stringify(e);return n[a]||(n[a]=new IntersectionObserver(une,{root:t,...e})),n[a]}function fne(t,e,r){const n=dne(e);return GN.set(t,r),n.observe(t),()=>{GN.delete(t),n.unobserve(t)}}const hne={some:0,all:1};class mne extends Co{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:r,margin:n,amount:a="some",once:i}=e,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof a=="number"?a:hne[a]},l=u=>{const{isIntersecting:d}=u;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),p=d?h:m;p&&p(u)};return fne(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:r}=this.node;["amount","margin","root"].some(pne(e,r))&&this.startObserver()}unmount(){}}function pne({viewport:t={}},{viewport:e={}}={}){return r=>t[r]!==e[r]}const gne={inView:{Feature:mne},tap:{Feature:lne},focus:{Feature:one},hover:{Feature:ine}},vne={layout:{ProjectionNode:iF,MeasureLayout:Q9}},xne={...rre,...gne,...sne,...vne},Ie=xte(xne,Tte),oF=w.createContext(void 0),u0=()=>{const t=w.useContext(oF);if(!t)throw new Error("useSidebar must be used within a SidebarProvider");return t},yne=({children:t,open:e,setOpen:r,animate:n=!0})=>{const[a,i]=w.useState(!1),o=e!==void 0?e:a,l=r!==void 0?r:i;return s.jsx(oF.Provider,{value:{open:o,setOpen:l,animate:n},children:t})},bne=({children:t,open:e,setOpen:r,animate:n})=>s.jsx(yne,{open:e,setOpen:r,animate:n,children:t}),wne=({className:t,children:e})=>s.jsxs(s.Fragment,{children:[s.jsx(_ne,{className:t,children:e}),s.jsx(jne,{className:t,children:e})]}),_ne=({className:t,children:e,...r})=>{const{open:n,setOpen:a,animate:i}=u0();return s.jsxs("div",{className:"relative hidden h-full flex-shrink-0 md:block",children:[s.jsx(Ie.div,{className:Qe("h-full px-4 py-4 hidden md:flex md:flex-col w-[260px]",t),animate:{width:i?n?"260px":"76px":"260px"},transition:{duration:.3,ease:"easeInOut"},...r,children:e}),s.jsx("button",{onClick:()=>a(!n),className:`absolute -right-3 top-1/2 -translate-y-1/2 w-6 h-6 693 bg-slate-800 border border-slate-700 rounded-full 694 hidden md:flex items-center justify-center 695 hover:bg-slate-700 hover:border-primary/50 696 transition-all shadow-lg z-50 group`,children:s.jsx(e0,{className:Qe("w-4 h-4 text-slate-400 group-hover:text-primary transition-all duration-300",!n&&"rotate-180")}
696)})]})},jne=({className:t,children:e,...r})=>{const{open:n,setOpen:a}=u0();return s.jsx(s.Fragment,{children:s.jsxs("div",{className:Qe("h-14 flex-shrink-0 px-4 py-4 flex flex-row md:hidden items-center justify-between bg-slate-950/80 backdrop-blur-xl w-full border-b border-slate-800/50"),...r,children:[s.jsx("div",{className:"flex justify-end z-20 w-full",children:s.jsx(xY,{className:"text-slate-200 cursor-pointer hover:text-primary transition-colors",onClick:()=>a(!n)})}),s.jsx(Ag,{children:n&&s.jsxs(Ie.div,{initial:{x:"-100%",opacity:0},animate:{x:0,opacity:1},exit:{x:"-100%",opacity:0},transition:{duration:.3,ease:"easeInOut"},className:Qe("fixed inset-0 z-[100] flex h-dvh w-full flex-col justify-between overflow-y-auto bg-sidebar p-6 pt-16",t),children:[s.jsx("div",{className:"absolute right-10 top-10 z-50 text-slate-200 cursor-pointer hover:text-primary transition-colors",onClick:()=>a(!n),children:s.jsx(Xn,{})}),e]})})]})})},Nne=({link:t,className:e,isActive:r,onClick:n,...a})=>{const{open:i,animate:o,setOpen:l}=u0();return s.jsxs(Q2,{to:t.href,onClick:()=>{window.matchMedia("(max-width: 767px)").matches&&l(!1),n==null||n()},className:Qe("flex items-center justify-start gap-3 group/sidebar py-3 px-3 rounded-xl transition-all duration-200 relative overflow-hidden",r?"bg-primary/20 text-primary shadow-lg shadow-black/20 ring-1 ring-primary/30":"text-slate-400 hover:bg-slate-800/40 hover:text-slate-200",e),...a,children:[r&&s.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary rounded-l-md shadow-[0_0_10px_hsl(var(--primary)/0.5)]"}),s.jsx("span",{className:Qe("flex-shrink-0 transition-colors",r?"text-primary":"text-slate-500 group-hover/sidebar:text-slate-300"),children:t.icon}),s.jsx(Ie.span,{animate:{display:o?i?"inline-block":"none":"inline-block",opacity:o?i?1:0:1},transition:{duration:.2,ease:"easeInOut"},className:Qe("text-sm font-medium group-hover/sidebar:translate-x-1 transition duration-150 whitespace-pre",r&&"text-primary-foreground"),children:t.label})]})};var Sne=t=>{switch(t){case"success":return Ene;case"info":return Pne;case"warning":return Ane;case"error":return Tne;default:return null}},Cne=Array(12).fill(0),kne=({visible:t,className:e})=>U.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},U.createElement("div",{className:"sonner-spinner"},Cne.map((r,n)=>U.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Ene=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ane=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Pne=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Tne=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},U.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),One=U.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},U.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),U.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Mne=()=>{let[t,e]=U.useState(document.hidden);return U.useEffect(()=>{let r=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",r),()=>window.removeEventListener("visibilitychange",r)},[]),t},KN=1,Rne=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>
696{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:r,...n}=t,a=typeof(t==null?void 0:t.id)=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:KN++,i=this.toasts.find(l=>l.id===a),o=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),i?this.toasts=this.toasts.map(l=>l.id===a?(this.publish({...l,...t,id:a,title:r}),{...l,...t,id:a,dismissible:o,title:r}):l):this.addToast({title:r,...n,dismissible:o,id:a}),a},this.dismiss=t=>(this.dismissedToasts.add(t),t||this.toasts.forEach(e=>{this.subscribers.forEach(r=>r({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let r;e.loading!==void 0&&(r=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),a=r!==void 0,i,o=n.then(async u=>{if(i=["resolve",u],U.isValidElement(u))a=!1,this.create({id:r,type:"default",message:u});else if(Dne(u)&&!u.ok){a=!1;let d=typeof e.error=="function"?await e.error(`HTTP error! status: ${u.status}`):e.error,h=typeof e.description=="function"?await e.description(`HTTP error! status: ${u.status}`):e.description;this.create({id:r,type:"error",message:d,description:h})}else if(e.success!==void 0){a=!1;let d=typeof e.success=="function"?await e.success(u):e.success,h=typeof e.description=="function"?await e.description(u):e.description;this.create({id:r,type:"success",message:d,description:h})}}).catch(async u=>{if(i=["reject",u],e.error!==void 0){a=!1;let d=typeof e.error=="function"?await e.error(u):e.error,h=typeof e.description=="function"?await e.description(u):e.description;this.create({id:r,type:"error",message:d,description:h})}}).finally(()=>{var u;a&&(this.dismiss(r),r=void 0),(u=e.finally)==null||u.call(e)}),l=()=>new Promise((u,d)=>o.then(()=>i[0]==="reject"?d(i[1]):u(i[1])).catch(d));return typeof r!="string"&&typeof r!="number"?{unwrap:l}:Object.assign(r,{unwrap:l})},this.custom=(t,e)=>{let r=(e==null?void 0:e.id)||KN++;return this.create({jsx:t(r),id:r,...e}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Cn=new Rne,Ine=(t,e)=>{let r=(e==null?void 0:e.id)||KN++;return Cn.addToast({title:t,...e,id:r}),r},Dne=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",$ne=Ine,Lne=()=>Cn.toasts,Fne=()=>Cn.getActiveToasts(),xe=Object.assign($ne,{success:Cn.success,info:Cn.info,warning:Cn.warning,error:Cn.error,custom:Cn.custom,message:Cn.message,promise:Cn.promise,dismiss:Cn.dismiss,loading:Cn.loading},{getHistory:Lne,getToasts:Fne});function Bne(t,{insertAt:e}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}Bne(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;
696left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}
696:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);
696--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} 697`);function Mp(t){return t.label!==void 0}var Vne=3,zne="32px",Une="16px",z4=4e3,qne=356,Wne=14,Hne=20,Gne=200;function La(...t){return t.filter(Boolean).join(" ")}function Kne(t){let[e,r]=t.split("-"),n=[];return e&&n.push(e),r&&n.push(r),n}var Yne=t=>{var e,r,n,a,i,o,l,u,d,h,m;let{invert:p,toast:v,unstyled:b,interacting:y,setHeights:x,visibleToasts:j,heights:N,index:S,toasts:k,expanded:C,removeToast:A,defaultRichColors:T,closeButton:R,style:I,cancelButtonStyle:D,actionButtonStyle:L,className:z="",descriptionClassName:H="",duration:Z,position:te,gap:G,loadingIcon:M,expandByDefault:F,classNames:K,icons:B,closeButtonAriaLabel:O="Close toast",pauseWhenPageIsHidden:W}=t,[q,se]=U.useState(null),[me,fe]=U.useState(null),[Q,pe]=U.useState(!1),[V,J]=U.useState(!1),[oe,re]=U.useState(!1),[Me,ee]=U.useState(!1),[ce,je]=U.useState(!1),[de,we]=U.useState(0),[ke,Y]=U.useState(0),ne=U.useRef(v.duration||Z||z4),le=U.useRef(null),Se=U.useRef(null),Ae=S===0,Ce=S+1<=j,$e=v.type,Be=v.dismissible!==!1,tt=v.className||"",Dt=v.descriptionClassName||"",ye=U.useMemo(()=>N.findIndex(ut=>ut.toastId===v.id)||0,[N,v.id]),mt=U.useMemo(()=>{var ut;return(ut=v.closeButton)!=null?ut:R},[v.closeButton,R]),qt=U.useMemo(()=>v.duration||Z||z4,[v.duration,Z]),cr=U.useRef(0),Je=U.useRef(0),Rt=U.useRef(0),bt=U.useRef(null),[it,wt]=te.split("-"),Ds=U.useMemo(()=>N.reduce((ut,It,Wt)=>Wt>=ye?ut:ut+It.height,0),[N,ye]),Kl=Mne(),Si=v.invert||p,us=$e==="loading";Je.current=U.useMemo(()=>ye*G+Ds,[ye,Ds]),U.useEffect(()=>{ne.current=qt},[qt]),U.useEffect(()=>{pe(!0)},[]),U.useEffect(()=>{let ut=Se.current;if(ut){let It=ut.getBoundingClientRect().height;return Y(It),x(Wt=>[{toastId:v.id,height:It,position:v.position},...Wt]),()=>x(Wt=>Wt.filter(cn=>cn.toastId!==v.id))}},[x,v.id]),U.useLayoutEffect(()=>{if(!Q)return;let ut=Se.current,It=ut.style.height;ut.style.height="auto";let Wt=ut.getBoundingClientRect().height;ut.style.height=It,Y(Wt),x(cn=>cn.find(xn=>xn.toastId===v.id)?cn.map(xn=>xn.toastId===v.id?{...xn,height:Wt}:xn):[{toastId:v.id,height:Wt,position:v.position},...cn])},[Q,v.title,v.description,x,v.id]);let Ea=U.useCallback(()=>{J(!0),we(Je.current),x(ut=>ut.filter(It=>It.toastId!==v.id)),setTimeout(()=>{A(v)},Gne)},[v,A,x,Je]);U.useEffect(()=>{if(v.promise&&$e==="loading"||v.duration===1/0||v.type==="loading")return;let ut;return C||y||W&&Kl?(()=>{if(Rt.current<cr.current){let It=new Date().getTime()-cr.current;ne.current=ne.current-It}
697Rt.current=new Date().getTime()})():ne.current!==1/0&&(cr.current=new Date().getTime(),ut=setTimeout(()=>{var It;(It=v.onAutoClose)==null||It.call(v,v),Ea()},ne.current)),()=>clearTimeout(ut)},[C,y,v,$e,W,Kl,Ea]),U.useEffect(()=>{v.delete&&Ea()},[Ea,v.delete]);function um(){var ut,It,Wt;return B!=null&&B.loading?U.createElement("div",{className:La(K==null?void 0:K.loader,(ut=v==null?void 0:v.classNames)==null?void 0:ut.loader,"sonner-loader"),"data-visible":$e==="loading"},B.loading):M?U.createElement("div",{className:La(K==null?void 0:K.loader,(It=v==null?void 0:v.classNames)==null?void 0:It.loader,"sonner-loader"),"data-visible":$e==="loading"},M):U.createElement(kne,{className:La(K==null?void 0:K.loader,(Wt=v==null?void 0:v.classNames)==null?void 0:Wt.loader),visible:$e==="loading"})}return U.createElement("li",{tabIndex:0,ref:Se,className:La(z,tt,K==null?void 0:K.toast,(e=v==null?void 0:v.classNames)==null?void 0:e.toast,K==null?void 0:K.default,K==null?void 0:K[$e],(r=v==null?void 0:v.classNames)==null?void 0:r[$e]),"data-sonner-toast":"","data-rich-colors":(n=v.richColors)!=null?n:T,"data-styled":!(v.jsx||v.unstyled||b),"data-mounted":Q,"data-promise":!!v.promise,"data-swiped":ce,"data-removed":V,"data-visible":Ce,"data-y-position":it,"data-x-position":wt,"data-index":S,"data-front":Ae,"data-swiping":oe,"data-dismissible":Be,"data-type":$e,"data-invert":Si,"data-swipe-out":Me,"data-swipe-direction":me,"data-expanded":!!(C||F&&Q),style:{"--index":S,"--toasts-before":S,"--z-index":k.length-S,"--offset":`${V?de:Je.current}px`,"--initial-height":F?"auto":`${ke}px`,...I,...v.style},onDragEnd:()=>{re(!1),se(null),bt.current=null},onPointerDown:ut=>{us||!Be||(le.current=new Date,we(Je.current),ut.target.setPointerCapture(ut.pointerId),ut.target.tagName!=="BUTTON"&&(re(!0),bt.current={x:ut.clientX,y:ut.clientY}))},onPointerUp:()=>{var ut,It,Wt,cn;if(Me||!Be)return;bt.current=null;let xn=Number(((ut=Se.current)==null?void 0:ut.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),yn=Number(((It=Se.current)==null?void 0:It.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Aa=new Date().getTime()-((Wt=le.current)==null?void 0:Wt.getTime()),zr=q==="x"?xn:yn,ds=Math.abs(zr)/Aa;if(Math.abs(zr)>=Hne||ds>.11){we(Je.current),(cn=v.onDismiss)==null||cn.call(v,v),fe(q==="x"?xn>0?"right":"left":yn>0?"down":"up"),Ea(),ee(!0),je(!1);return}re(!1),se(null)},onPointerMove:ut=>{var It,Wt,cn,xn;if(!bt.current||!Be||((It=window.getSelection())==null?void 0:It.toString().length)>0)return;let yn=ut.clientY-bt.current.y,Aa=ut.clientX-bt.current.x,zr=(Wt=t.swipeDirections)!=null?Wt:Kne(te);!q&&(Math.abs(Aa)>1||Math.abs(yn)>1)&&se(Math.abs(Aa)>Math.abs(yn)?"x":"y");let ds={x:0,y:0};q==="y"?(zr.includes("top")||zr.includes("bottom"))&&(zr.includes("top")&&yn<0||zr.includes("bottom")&&yn>0)&&(ds.y=yn):q==="x"&&(zr.includes("left")||zr.includes("right"))&&(zr.includes("left")&&Aa<0||zr.includes("right")&&Aa>0)&&(ds.x=Aa),(Math.abs(ds.x)>0||Math.abs(ds.y)>0)&&je(!0),(cn=Se.current)==null||cn.style.setProperty("--swipe-amount-x",`${ds.x}px`),(xn=Se.current)==null||xn.style.setProperty("--swipe-amount-y",`${ds.y}px`)}},mt&&!v.jsx?U.createElement("button",{"aria-label":O,"data-disabled":us,"data-close-button":!0,onClick:us||!Be?()=>{}:()=>{var ut;Ea(),(ut=v.onDismiss)==null||ut.call(v,v)},className:La(K==null?void 0:K.closeButton,(a=v==null?void 0:v.classNames)==null?void 0:a.closeButton)},(i=B==null?void 0:B.close)!=null?i:One):null,v.jsx||w.isValidElement(v.title)?v.jsx?v.jsx:typeof v.title=="function"?v.title():v.title:U.createElement(U.Fragment,null,$e||v.icon||v.promise?U.createElement("div",{"data-icon":"",className:La(K==null?void 0:K.icon,(o=v==null?void 0:v.classNames)==null?void 0:o.icon)},v.promise||v.type==="loading"&&!v.icon?v.icon||um():null,v.type!=="loading"?v.icon||(B==null?void 0:B[$e])||Sne($e):null):null,U.createElement("div",{"data-content":"",className:La(K==null?void 0:K.content,(l=v==null?void 0:v.classNames)==null?void 0:l.content)},U.createElement("div",{"data-title":"",className:La(K==null?void 0:K.title,(u=v==null?void 0:v.classNames)==null?void 0:u.title)}
vendor: 7,963 bytes, line 697
697,typeof v.title=="function"?v.title():v.title),v.description?U.createElement("div",{"data-description":"",className:La(H,Dt,K==null?void 0:K.description,(d=v==null?void 0:v.classNames)==null?void 0:d.description)},typeof v.description=="function"?v.description():v.description):null),w.isValidElement(v.cancel)?v.cancel:v.cancel&&Mp(v.cancel)?U.createElement("button",{"data-button":!0,"data-cancel":!0,style:v.cancelButtonStyle||D,onClick:ut=>{var It,Wt;Mp(v.cancel)&&Be&&((Wt=(It=v.cancel).onClick)==null||Wt.call(It,ut),Ea())},className:La(K==null?void 0:K.cancelButton,(h=v==null?void 0:v.classNames)==null?void 0:h.cancelButton)},v.cancel.label):null,w.isValidElement(v.action)?v.action:v.action&&Mp(v.action)?U.createElement("button",{"data-button":!0,"data-action":!0,style:v.actionButtonStyle||L,onClick:ut=>{var It,Wt;Mp(v.action)&&((Wt=(It=v.action).onClick)==null||Wt.call(It,ut),!ut.defaultPrevented&&Ea())},className:La(K==null?void 0:K.actionButton,(m=v==null?void 0:v.classNames)==null?void 0:m.actionButton)},v.action.label):null))};function U4(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function Xne(t,e){let r={};return[t,e].forEach((n,a)=>{let i=a===1,o=i?"--mobile-offset":"--offset",l=i?Une:zne;function u(d){["top","right","bottom","left"].forEach(h=>{r[`${o}-${h}`]=typeof d=="number"?`${d}px`:d})}typeof n=="number"||typeof n=="string"?u(n):typeof n=="object"?["top","right","bottom","left"].forEach(d=>{n[d]===void 0?r[`${o}-${d}`]=l:r[`${o}-${d}`]=typeof n[d]=="number"?`${n[d]}px`:n[d]}):u(l)}),r}var Zne=w.forwardRef(function(t,e){let{invert:r,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:i,closeButton:o,className:l,offset:u,mobileOffset:d,theme:h="light",richColors:m,duration:p,style:v,visibleToasts:b=Vne,toastOptions:y,dir:x=U4(),gap:j=Wne,loadingIcon:N,icons:S,containerAriaLabel:k="Notifications",pauseWhenPageIsHidden:C}=t,[A,T]=U.useState([]),R=U.useMemo(()=>Array.from(new Set([n].concat(A.filter(W=>W.position).map(W=>W.position)))),[A,n]),[I,D]=U.useState([]),[L,z]=U.useState(!1),[H,Z]=U.useState(!1),[te,G]=U.useState(h!=="system"?h:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),M=U.useRef(null),F=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),K=U.useRef(null),B=U.useRef(!1),O=U.useCallback(W=>{T(q=>{var se;return(se=q.find(me=>me.id===W.id))!=null&&se.delete||Cn.dismiss(W.id),q.filter(({id:me})=>me!==W.id)})},[]);return U.useEffect(()=>Cn.subscribe(W=>{if(W.dismiss){T(q=>q.map(se=>se.id===W.id?{...se,delete:!0}:se));return}setTimeout(()=>{ZL.flushSync(()=>{T(q=>{let se=q.findIndex(me=>me.id===W.id);return se!==-1?[...q.slice(0,se),{...q[se],...W},...q.slice(se+1)]:[W,...q]})})})}),[]),U.useEffect(()=>{if(h!=="system"){G(h);return}if(h==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?G("dark"):G("light")),typeof window>"u")return;let W=window.matchMedia("(prefers-color-scheme: dark)");try{W.addEventListener("change",({matches:q})=>{G(q?"dark":"light")})}catch{W.addListener(({matches:se})=>{try{G(se?"dark":"light")}catch(me){console.error(me)}})}},[h]),U.useEffect(()=>{A.length<=1&&z(!1)},[A]),U.useEffect(()=>{let W=q=>{var se,me;a.every(fe=>q[fe]||q.code===fe)&&(z(!0),(se=M.current)==null||se.focus()),q.code==="Escape"&&(document.activeElement===M.current||(me=M.current)!=null&&me.contains(document.activeElement))&&z(!1)};return document.addEventListener("keydown",W),()=>document.removeEventListener("keydown",W)},[a]),U.useEffect(()=>{if(M.current)return()=>{K.current&&(K.current.focus({preventScroll:!0}),K.current=null,B.current=!1)}},[M.current]),U.createElement("section",{ref:e,"aria-label":`${k} ${F}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},R.map((W,q)=>{var se;let[me,fe]=W.split("-");return A.length?U.createElement("ol",{key:W,dir:x==="auto"?U4():x,tabIndex:-1,ref:M,className:l,"data-sonner-toaster":!0,"data-theme":te,"data-y-position":me,"data-lifted":L&&A.length>1&&!i,"data-x-position":fe,style:{"--front-toast-height":`${((se=I[0])==null?void 0:se.height)||0}px`,"--width":`${qne}px`,"--gap":`${j}px`,...v,...Xne(u,d)},onBlur:Q=>{B.current&&!Q.currentTarget.contains(Q.relatedTarget)&&(B.current=!1,K.current&&(K.current.focus({preventScroll:!0}),K.current=null))},onFocus:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||B.current||(B.current=!0,K.current=Q.relatedTarget)},onMouseEnter:()=>z(!0),onMouseMove:()=>z(!0),onMouseLeave:()=>{H||z(!1)},onDragEnd:()=>z(!1),onPointerDown:Q=>{Q.target instanceof HTMLElement&&Q.target.dataset.dismissible==="false"||Z(!0)},onPointerUp:()=>Z(!1)},A.filter(Q=>!Q.position&&q===0||Q.position===W).map((Q,pe)=>{var V,J;return U.createElement(Yne,{key:Q.id,icons:S,index:pe,toast:Q,defaultRichColors:m,duration:(V=y==null?void 0:y.duration)!=null?V:p,className:y==null?void 0:y.className,descriptionClassName:y==null?void 0:y.descriptionClassName,invert:r,visibleToasts:b,closeButton:(J=y==null?void 0:y.closeButton)!=null?J:o,interacting:H,position:W,style:y==null?void 0:y.style,unstyled:y==null?void 0:y.unstyled,classNames:y==null?void 0:y.classNames,cancelButtonStyle:y==null?void 0:y.cancelButtonStyle,actionButtonStyle:y==null?void 0:y.actionButtonStyle,removeToast:O,toasts:A.filter(oe=>oe.position==Q.position),heights:I.filter(oe=>oe.position==Q.position),setHeights:D,expandByDefault:i,gap:j,loadingIcon:N,expanded:L,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});const q4=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,W4=Ct,qC=(t,e)=>r=>{var n;if((e==null?void 0:e.variants)==null)return W4(t,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:a,defaultVariants:i}=e,o=Object.keys(a).map(d=>{const h=r==null?void 0:r[d],m=i==null?void 0:i[d];if(h===null)return null;const p=q4(h)||q4(m);return a[d][p]}),l=r&&Object.entries(r).reduce((d,h)=>{let[m,p]=h;return p===void 0||(d[m]=p),d},{}),u=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((d,h)=>{let{class:m,className:p,...v}=h;return Object.entries(v).every(b=>{let[y,x]=b;return Array.isArray(x)?x.includes({...i,...l}[y]):{...i,...l}[y]===x})?[...d,m,p]:d},[]);return W4(t,o,u,r==null?void 0:r.class,r==null?void 0:r.className)},YN=qC("inline-flex items-center justify-center rounded-lg font-medium transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:pointer-events-none disabled:opacity-50 active:scale-95",{variants:{variant:{primary:"bg-gradient-to-r from-primary to-[hsl(12_90%_50%)] text-primary-foreground hover:opacity-90 shadow-[0_0_15px_hsl(var(--primary)/0.35)] hover:shadow-[0_0_20px_hsl(var(--primary)/0.55)] border border-transparent",secondary:"bg-slate-800 text-slate-100 hover:bg-slate-700 border border-slate-700",outline:"border border-slate-700 bg-transparent text-slate-300 hover:bg-slate-800 hover:text-white hover:border-slate-600",ghost:"text-slate-400 hover:bg-slate-800/50 hover:text-primary",danger:"bg-red-500/10 text-red-500 hover:bg-red-500/20 border border-red-500/20",default:"bg-slate-800 text-slate-100 hover:bg-slate-700 border border-slate-700"},size:{sm:"h-8 px-3 text-xs",md:"h-10 px-4 py-2 text-sm",lg:"h-12 px-8 text-base",icon:"h-10 w-10 p-2",default:"h-10 px-4 py-2 text-sm"}},defaultVariants:{variant:"primary",size:"md"}}),Ne=U.forwardRef(({children:t,variant:e,size:r,className:n="",...a},i)=>s.jsx("button",{ref:i,className:Qe(YN({variant:e,size:r,className:n})),...a,children:t}));Ne.displayName="Button";const WC="/assets/inovacell-logo-white-K32drMal.png",lF=w.createContext(void 0),Qne=({children:t})=>{const{user:e,loading:r}=Na(),[n,a]=w.useState(null),[i,o]=w.useState(null),[l,u]=w.useState(!1),[d,h]=w.useState(!0),m=async()=>
697{if(r)return;if(!e){a(null),o(null),u(!1),h(!1);return}h(!0);const{data:v,error:b}=await ve.from("panel_user_access").select("role, regional, is_active, must_change_password").eq("user_id",e.id).maybeSingle();b||!(v!=null&&v.is_active)?(a(null),o(null),u(!1)):(a(v.role),o(v.regional??null),u(v.must_change_password)),h(!1)};w.useEffect(()=>{m()},[e,r]);const p=w.useMemo(()=>({role:n,regional:i,mustChangePassword:l,loading:d||r,isAdmin:n==="admin",isMaster:n==="master",isCoordinator:n==="coordinator",canManageUsers:n==="admin"||n==="master",canAccessSettings:n==="admin",canAccessGeneralPanel:n==="admin"||n==="master",refresh:m}),[n,i,l,d,r]);return s.jsx(lF.Provider,{value:p,children:t})},zl=()=>{const t=w.useContext(lF);if(!t)throw new Error("usePanelAccess must be used within PanelAccessProvider");return t},Jne=[{id:"dashboard",label:"Dashboard",icon:fY},{id:"pipeline",label:"Pipeline",icon:dY},{id:"leads-campanha",label:"Leads Campanha",icon:k8},{id:"collaborators",label:"Colaboradores",icon:aY},{id:"panel-users",label:"Usuários do painel",icon:E8},{id:"chat",label:"Chat Ao Vivo",icon:Tn},{id:"contacts",label:"Contatos",icon:fo},{id:"scheduling",label:"Agendamentos",icon:Ya},{id:"team",label:"Equipe",icon:n0},{id:"settings",label:"Configurações",icon:r0}],eae=({href:t})=>s.jsx(Q2,{to:t,className:"flex h-16 items-center overflow-hidden py-1",children:s.jsx("img",{src:WC,alt:"Inovacell",className:"h-auto w-48 object-contain object-left"})}),tae=({href:t})=>s.jsx(Q2,{to:t,className:"flex items-center py-1",children:s.jsx("div",{className:"relative h-10 w-10 flex-shrink-0 overflow-hidden",children:s.jsx("img",{src:WC,alt:"Inovacell",className:"absolute right-0 top-1/2 h-9 w-auto max-w-none -translate-y-1/2"})})}),rae=()=>{Yu();const{user:t,signOut:e}=Na(),r=Vl(),n=Wu(),a=r.pathname.substring(1)||"dashboard",{open:i,setOpen:o}=u0(),{isAdmin:l,isCoordinator:u,canManageUsers:d}=zl(),m=Jne.filter(y=>u?y.id==="leads-campanha"||y.id==="scheduling":y.id==="settings"?l:y.id==="panel-users"?d:!0).map(y=>({label:y.label,href:`/${y.id}`,icon:s.jsx(y.icon,{className:"h-5 w-5"})})),p=async()=>{try{const{error:y}=await e();if(y)throw y;xe.success("Logout realizado com sucesso"),n("/auth",{replace:!0})}catch{xe.error("Erro ao fazer logout")}},v=()=>t!=null&&t.email?t.email.substring(0,2).toUpperCase():"US",b=()=>{var y;return(y=t==null?void 0:t.user_metadata)!=null&&y.full_name?t.user_metadata.full_name:"Usuário"};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto overflow-x-hidden",children:[s.jsx("div",{className:"mb-6",children:i?s.jsx(eae,{href:u?"/leads-campanha":"/dashboard"}):s.jsx(tae,{href:u?"/leads-campanha":"/dashboard"})}),s.jsx("nav",{className:"flex flex-col gap-1.5",children:m.map((y,x)=>s.jsx(Nne,{link:y,isActive:a.startsWith(y.href.slice(1))},x))})]}),s.jsx("div",{className:"border-t border-border/50 pt-4",children:s.jsxs("div",{className:"flex items-center gap-3 p-2 rounded-xl hover:bg-secondary/50 transition-colors cursor-pointer group",children:[s.jsx("div",{className:"w-9 h-9 rounded-full bg-secondary flex items-center justify-center text-xs font-bold text-foreground border border-border ring-2 ring-transparent group-hover:ring-foreground/20 transition-all flex-shrink-0",children:v()}),s.jsxs(Ie.div,{animate:{display:i?"block":"none",opacity:i?1:0},transition:{duration:.2},className:"flex-1 overflow-hidden",children:[s.jsx("p",{className:"text-sm font-medium text-foreground group-hover:text-foreground whitespace-nowrap",children:b()}),s.jsx("p",{className:"text-xs text-muted-foreground truncate",children:(t==null?void 0:t.email)||"[email protected]"})]}),s.jsx(Ie.div,{animate:{display:i?"block":"none",opacity:i?1:0},transition:{duration:.2},children:s.jsx(Ne,{type:"button",variant:"ghost",size:"icon",onClick:p,className:"h-8 w-8",title:"Sair","aria-label":"Sair da conta",children:s.jsx(gY,{className:"w-4 h-4 text-foreground hover:text-destructive-foreground transition-colors"})})})]})})]})},nae=()=>{const[t,e]=w.useState(()=>typeof window<"u"&&window.matchMedia("(min-width: 768px)").matches);return s.jsx(bne,{open:t,setOpen:e,children:s.jsx(wne,{className:"justify-between gap-10 bg-card/50 backdrop-blur-xl border-r border-border/50",children:s.jsx(rae,{})})})};var Rb,H4;function In(){if(H4)return Rb;H4=1;var t=Array.isArray;return Rb=t,Rb}var Ib,G4;function cF(){if(G4)return Ib;G4=1;
vendor: 9,219 bytes, line 697
697var t=typeof xp=="object"&&xp&&xp.Object===Object&&xp;return Ib=t,Ib}var Db,K4;function Rs(){if(K4)return Db;K4=1;var t=cF(),e=typeof self=="object"&&self&&self.Object===Object&&self,r=t||e||Function("return this")();return Db=r,Db}var $b,Y4;function Uh(){if(Y4)return $b;Y4=1;var t=Rs(),e=t.Symbol;return $b=e,$b}var Lb,X4;function aae(){if(X4)return Lb;X4=1;var t=Uh(),e=Object.prototype,r=e.hasOwnProperty,n=e.toString,a=t?t.toStringTag:void 0;function i(o){var l=r.call(o,a),u=o[a];try{o[a]=void 0;var d=!0}catch{}var h=n.call(o);return d&&(l?o[a]=u:delete o[a]),h}return Lb=i,Lb}var Fb,Z4;function sae(){if(Z4)return Fb;Z4=1;var t=Object.prototype,e=t.toString;function r(n){return e.call(n)}return Fb=r,Fb}var Bb,Q4;function bi(){if(Q4)return Bb;Q4=1;var t=Uh(),e=aae(),r=sae(),n="[object Null]",a="[object Undefined]",i=t?t.toStringTag:void 0;function o(l){return l==null?l===void 0?a:n:i&&i in Object(l)?e(l):r(l)}return Bb=o,Bb}var Vb,J4;function wi(){if(J4)return Vb;J4=1;function t(e){return e!=null&&typeof e=="object"}return Vb=t,Vb}var zb,e5;function ed(){if(e5)return zb;e5=1;var t=bi(),e=wi(),r="[object Symbol]";function n(a){return typeof a=="symbol"||e(a)&&t(a)==r}return zb=n,zb}var Ub,t5;function HC(){if(t5)return Ub;t5=1;var t=In(),e=ed(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function a(i,o){if(t(i))return!1;var l=typeof i;return l=="number"||l=="symbol"||l=="boolean"||i==null||e(i)?!0:n.test(i)||!r.test(i)||o!=null&&i in Object(o)}return Ub=a,Ub}var qb,r5;function ko(){if(r5)return qb;r5=1;function t(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}return qb=t,qb}var Wb,n5;function GC(){if(n5)return Wb;n5=1;var t=bi(),e=ko(),r="[object AsyncFunction]",n="[object Function]",a="[object GeneratorFunction]",i="[object Proxy]";function o(l){if(!e(l))return!1;var u=t(l);return u==n||u==a||u==r||u==i}return Wb=o,Wb}var Hb,a5;function iae(){if(a5)return Hb;a5=1;var t=Rs(),e=t["__core-js_shared__"];return Hb=e,Hb}var Gb,s5;function oae(){if(s5)return Gb;s5=1;var t=iae(),e=(function(){var n=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!e&&e in n}return Gb=r,Gb}var Kb,i5;function uF(){if(i5)return Kb;i5=1;var t=Function.prototype,e=t.toString;function r(n){if(n!=null){try{return e.call(n)}catch{}try{return n+""}catch{}}return""}return Kb=r,Kb}var Yb,o5;function lae(){if(o5)return Yb;o5=1;var t=GC(),e=oae(),r=ko(),n=uF(),a=/[\\^$.*+?()[\]{}|]/g,i=/^\[object .+?Constructor\]$/,o=Function.prototype,l=Object.prototype,u=o.toString,d=l.hasOwnProperty,h=RegExp("^"+u.call(d).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function m(p){if(!r(p)||e(p))return!1;var v=t(p)?h:i;return v.test(n(p))}return Yb=m,Yb}var Xb,l5;function cae(){if(l5)return Xb;l5=1;function t(e,r){return e==null?void 0:e[r]}return Xb=t,Xb}var Zb,c5;function Ul(){if(c5)return Zb;c5=1;var t=lae(),e=cae();function r(n,a){var i=e(n,a);return t(i)?i:void 0}return Zb=r,Zb}var Qb,u5;function d0(){if(u5)return Qb;u5=1;var t=Ul(),e=t(Object,"create");return Qb=e,Qb}var Jb,d5;function uae(){if(d5)return Jb;d5=1;var t=d0();function e(){this.__data__=t?t(null):{},this.size=0}return Jb=e,Jb}var ew,f5;function dae(){if(f5)return ew;f5=1;function t(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}return ew=t,ew}var tw,h5;function fae(){if(h5)return tw;h5=1;var t=d0(),e="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function a(i){var o=this.__data__;if(t){var l=o[i];return l===e?void 0:l}return n.call(o,i)?o[i]:void 0}return tw=a,tw}var rw,m5;function hae(){if(m5)return rw;m5=1;var t=d0(),e=Object.prototype,r=e.hasOwnProperty;function n(a){var i=this.__data__;return t?i[a]!==void 0:r.call(i,a)}return rw=n,rw}var nw,p5;function mae(){if(p5)return nw;p5=1;var t=d0(),e="__lodash_hash_undefined__";function r(n,a){var i=this.__data__;return this.size+=this.has(n)?0:1,i[n]=t&&a===void 0?e:a,this}return nw=r,nw}var aw,g5;function pae(){if(g5)return aw;g5=1;var t=uae(),e=dae(),r=fae(),n=hae(),a=mae();function i(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var d=o[l];this.set(d[0],d[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,aw=i,aw}var sw,v5;function gae(){if(v5)return sw;v5=1;function t(){this.__data__=[],this.size=0}return sw=t,sw}var iw,x5;function KC(){if(x5)return iw;x5=1;function t(e,r){return e===r||e!==e&&r!==r}return iw=t,iw}var ow,y5;function f0(){if(y5)return ow;y5=1;var t=KC();function e(r,n){for(var a=r.length;a--;)if(t(r[a][0],n))return a;return-1}return ow=e,ow}var lw,b5;function vae(){if(b5)return lw;b5=1;var t=f0(),e=Array.prototype,r=e.splice;function n(a){var i=this.__data__,o=t(i,a);if(o<0)return!1;var l=i.length-1;return o==l?i.pop():r.call(i,o,1),--this.size,!0}return lw=n,lw}var cw,w5;function xae(){if(w5)return cw;w5=1;var t=f0();function e(r){var n=this.__data__,a=t(n,r);return a<0?void 0:n[a][1]}return cw=e,cw}var uw,_5;function yae(){if(_5)return uw;_5=1;var t=f0();function e(r){return t(this.__data__,r)>-1}return uw=e,uw}var dw,j5;function bae(){if(j5)return dw;j5=1;var t=f0();function e(r,n){var a=this.__data__,i=t(a,r);return i<0?(++this.size,a.push([r,n])):a[i][1]=n,this}return dw=e,dw}var fw,N5;function h0(){if(N5)return fw;N5=1;var t=gae(),e=vae(),r=xae(),n=yae(),a=bae();function i(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var d=o[l];this.set(d[0],d[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,fw=i,fw}var hw,S5;function YC(){if(S5)return hw;S5=1;var t=Ul(),e=Rs(),r=t(e,"Map");return hw=r,hw}var mw,C5;function wae(){if(C5)return mw;C5=1;var t=pae(),e=h0(),r=YC();function n(){this.size=0,this.__data__={hash:new t,map:new(r||e),string:new t}}return mw=n,mw}var pw,k5;function _ae(){if(k5)return pw;k5=1;function t(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}return pw=t,pw}var gw,E5;function m0(){if(E5)return gw;E5=1;var t=_ae();function e(r,n){var a=r.__data__;return t(n)?a[typeof n=="string"?"string":"hash"]:a.map}return gw=e,gw}var vw,A5;function jae(){if(A5)return vw;A5=1;var t=m0();function e(r){var n=t(this,r).delete(r);return this.size-=n?1:0,n}return vw=e,vw}var xw,P5;function Nae(){if(P5)return xw;P5=1;var t=m0();function e(r){return t(this,r).get(r)}return xw=e,xw}var yw,T5;function Sae(){if(T5)return yw;T5=1;var t=m0();function e(r){return t(this,r).has(r)}return yw=e,yw}var bw,O5;function Cae(){if(O5)return bw;O5=1;var t=m0();function e(r,n){var a=t(this,r),i=a.size;return a.set(r,n),this.size+=a.size==i?0:1,this}return bw=e,bw}var ww,M5;function XC(){if(M5)return ww;M5=1;var t=wae(),e=jae(),r=Nae(),n=Sae(),a=Cae();function i(o){var l=-1,u=o==null?0:o.length;for(this.clear();++l<u;){var d=o[l];this.set(d[0],d[1])}}return i.prototype.clear=t,i.prototype.delete=e,i.prototype.get=r,i.prototype.has=n,i.prototype.set=a,ww=i,ww}var _w,R5;function dF(){if(R5)return _w;R5=1;var t=XC(),e="Expected a function";function r(n,a){if(typeof n!="function"||a!=null&&typeof a!="function")throw new TypeError(e);var i=function(){var o=arguments,l=a?a.apply(this,o):o[0],u=i.cache;if(u.has(l))return u.get(l);var d=n.apply(this,o);return i.cache=u.set(l,d)||u,d};return i.cache=new(r.Cache||t),i}return r.Cache=t,_w=r,_w}var jw,I5;function kae(){if(I5)return jw;I5=1;var t=dF(),e=500;function r(n){var a=t(n,function(o){return i.size===e&&i.clear(),o}),i=a.cache;return a}return jw=r,jw}var Nw,D5;function Eae(){if(D5)return Nw;D5=1;var t=kae(),e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,r=/\\(\\)?/g,n=t(function(a){var i=[];return a.charCodeAt(0)===46&&i.push(""),a.replace(e,function(o,l,u,d){i.push(u?d.replace(r,"$1"):l||o)}),i});return Nw=n,Nw}var Sw,$5;function ZC(){if($5)return Sw;$5=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=Array(a);++n<a;)i[n]=r(e[n],n,e);return i}return Sw=t,Sw}var Cw,L5;function Aae(){if(L5)return Cw;L5=1;var t=Uh(),e=ZC(),r=In(),n=ed(),a=t?t.prototype:void 0,i=a?a.toString:void 0;function o(l){if(typeof l=="string")return l;if(r(l))return e(l,o)+"";if(n(l))return i?i.call(l):"";var u=l+"";return u=="0"&&1/l==-1/0?"-0":u}return Cw=o,Cw}var kw,F5;function fF(){if(F5)return kw;F5=1;var t=Aae();function e(r){return r==null?"":t(r)}return kw=e,kw}var Ew,B5;function hF(){if(B5)return Ew;B5=1;var t=In(),e=HC(),r=Eae(),n=fF();function a(i,o){return t(i)?i:e(i,o)?[i]:r(n(i))}return Ew=a,Ew}var Aw,V5;function p0(){if(V5)return Aw;V5=1;var t=ed();function e(r){if(typeof r=="string"||t(r))return r;var n=r+"";return n=="0"&&1/r==-1/0?"-0":n}return Aw=e,Aw}var Pw,z5;function QC(){if(z5)return Pw;z5=1;var t=hF(),e=p0();function r(n,a){a=t(a,n);for(var i=0,o=a.length;n!=null&&i<o;)n=n[e(a[i++])];return i&&i==o?n:void 0}return Pw=r,Pw}var Tw,U5;function mF(){if(U5)return Tw;U5=1;var t=QC();function e(r,n,a){var i=r==null?void 0:t(r,n);return i===void 0?a:i}return Tw=e,Tw}var Pae=mF();const _a=Ft(Pae);var Ow,q5;function Tae(){if(q5)return Ow;q5=1;function t(e){return e==null}return Ow=t,Ow}var Oae=Tae();const St=Ft(Oae);var Mw,W5;
vendor: 5,736 bytes, lines 697-705
697function Mae(){if(W5)return Mw;W5=1;var t=bi(),e=In(),r=wi(),n="[object String]";function a(i){return typeof i=="string"||!e(i)&&r(i)&&t(i)==n}return Mw=a,Mw}var Rae=Mae();const Nl=Ft(Rae);var Iae=GC();const xt=Ft(Iae);var Dae=ko();const td=Ft(Dae);var Rw={exports:{}},$t={};/** 698 * @license React 699 * react-is.production.min.js 700 * 701 * Copyright (c) Facebook, Inc. and its affiliates. 702 * 703 * This source code is licensed under the MIT license found in the 704 * LICENSE file in the root directory of this source tree. 705 */var H5;function $ae(){if(H5)return $t;H5=1;var t=Symbol.for("react.element"),e=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),o=Symbol.for("react.context"),l=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),b;b=Symbol.for("react.module.reference");function y(x){if(typeof x=="object"&&x!==null){var j=x.$$typeof;switch(j){case t:switch(x=x.type,x){case r:case a:case n:case d:case h:return x;default:switch(x=x&&x.$$typeof,x){case l:case o:case u:case p:case m:case i:return x;default:return j}}case e:return j}}}return $t.ContextConsumer=o,$t.ContextProvider=i,$t.Element=t,$t.ForwardRef=u,$t.Fragment=r,$t.Lazy=p,$t.Memo=m,$t.Portal=e,$t.Profiler=a,$t.StrictMode=n,$t.Suspense=d,$t.SuspenseList=h,$t.isAsyncMode=function(){return!1},$t.isConcurrentMode=function(){return!1},$t.isContextConsumer=function(x){return y(x)===o},$t.isContextProvider=function(x){return y(x)===i},$t.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},$t.isForwardRef=function(x){return y(x)===u},$t.isFragment=function(x){return y(x)===r},$t.isLazy=function(x){return y(x)===p},$t.isMemo=function(x){return y(x)===m},$t.isPortal=function(x){return y(x)===e},$t.isProfiler=function(x){return y(x)===a},$t.isStrictMode=function(x){return y(x)===n},$t.isSuspense=function(x){return y(x)===d},$t.isSuspenseList=function(x){return y(x)===h},$t.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===r||x===a||x===n||x===d||x===h||x===v||typeof x=="object"&&x!==null&&(x.$$typeof===p||x.$$typeof===m||x.$$typeof===i||x.$$typeof===o||x.$$typeof===u||x.$$typeof===b||x.getModuleId!==void 0)},$t.typeOf=y,$t}var G5;function Lae(){return G5||(G5=1,Rw.exports=$ae()),Rw.exports}var Fae=Lae(),Iw,K5;function pF(){if(K5)return Iw;K5=1;var t=bi(),e=wi(),r="[object Number]";function n(a){return typeof a=="number"||e(a)&&t(a)==r}return Iw=n,Iw}var Dw,Y5;function Bae(){if(Y5)return Dw;Y5=1;var t=pF();function e(r){return t(r)&&r!=+r}return Dw=e,Dw}var Vae=Bae();const rd=Ft(Vae);var zae=pF();const Uae=Ft(zae);var es=function(e){return e===0?0:e>0?1:-1},fl=function(e){return Nl(e)&&e.indexOf("%")===e.length-1},De=function(e){return Uae(e)&&!rd(e)},qae=function(e){return St(e)},Mr=function(e){return De(e)||Nl(e)},Wae=0,qh=function(e){var r=++Wae;return"".concat(e||"").concat(r)},Sl=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!De(e)&&!Nl(e))return n;var i;if(fl(e)){var o=e.indexOf("%");i=r*parseFloat(e.slice(0,o))/100}else i=+e;return rd(i)&&(i=n),a&&i>r&&(i=r),i},ro=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},Hae=function(e){if(!Array.isArray(e))return!1;for(var r=e.length,n={},a=0;a<r;a++)if(!n[e[a]])n[e[a]]=!0;else return!0;return!1},va=function(e,r){return De(e)&&De(r)?function(n){return e+n*(r-e)}:function(){return r}};function Mg(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):_a(n,e))===r})}var Gae=function(e,r){return De(e)&&De(r)?e-r:Nl(e)&&Nl(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function Kc(t,e){for(var r in t)if({}.hasOwnProperty.call(t,r)&&(!{}.hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if({}.hasOwnProperty.call(e,n)&&!{}.hasOwnProperty.call(t,n))return!1;return!0}function XN(t){"@babel/helpers - typeof";return XN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},XN(t)}var Kae=["viewBox","children"],Yae=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRen
705dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],X5=["points","pathLength"],$w={svg:Kae,polygon:X5,polyline:X5},JC=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDrag
705Capture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Rg=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(w.isValidElement(e)&&(n=e.props),!td(n))return null;var a={};return Object.keys(n).forEach(function(i){JC.includes(i)&&(a[i]=r||function(o){return n[i](n,o)})}),a},Xae=function(e,r,n){return function(a){return e(r,n,a),null}},Ig=function(e,r,n){if(!td(e)||XN(e)!=="object")return null;var a=null;return Object.keys(e).forEach(function(i){var o=e[i];JC.includes(i)&&typeof o=="function"&&(a||(a={}),a[i]=Xae(o,r,n))}),a},Zae=["children"],Qae=["children"];function Z5(t,e){if(t==null)return{};var r=Jae(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Jae(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function ZN(t){"@babel/helpers - typeof";return ZN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ZN(t)}var Q5={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},si=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},J5=null,Lw=null,ek=function t(e){if(e===J5&&Array.isArray(Lw))return Lw;var r=[];return w.Children.forEach(e,function(n){St(n)||(Fae.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),Lw=r,J5=e,r};function rs(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(a){return si(a)}):n=[si(e)],ek(t).forEach(function(a){var i=_a(a,"type.displayName")||_a(a,"type.name");n.indexOf(i)!==-1&&r.push(a)}),r}function Un(t,e){var r=rs(t,e);return r&&r[0]}var eM=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,a=r.height;return!(!De(n)||n<=0||!De(a)||a<=0)},ese=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],tse=function(e){return e&&e.type&&Nl(e.type)&&ese.indexOf(e.type)>=0},rse=function(e){return e&&ZN(e)==="object"&&"clipDot"in e},nse=function(e,r,n,a){var i,o=(i=$w==null?void 0:$w[a])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!xt(e)&&(a&&o.includes(r)||Yae.includes(r))||n&&JC.includes(r)},jt=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var a=e;if(w.isValidElement(e)&&(a=e.props),!td(a))return null;var i={};
vendor: 4,362 bytes, line 705
705return Object.keys(a).forEach(function(o){var l;nse((l=a)===null||l===void 0?void 0:l[o],o,r,n)&&(i[o]=a[o])}),i},QN=function t(e,r){if(e===r)return!0;var n=w.Children.count(e);if(n!==w.Children.count(r))return!1;if(n===0)return!0;if(n===1)return tM(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var a=0;a<n;a++){var i=e[a],o=r[a];if(Array.isArray(i)||Array.isArray(o)){if(!t(i,o))return!1}else if(!tM(i,o))return!1}return!0},tM=function(e,r){if(St(e)&&St(r))return!0;if(!St(e)&&!St(r)){var n=e.props||{},a=n.children,i=Z5(n,Zae),o=r.props||{},l=o.children,u=Z5(o,Qae);return a&&l?Kc(i,u)&&QN(a,l):!a&&!l?Kc(i,u):!1}return!1},rM=function(e,r){var n=[],a={};return ek(e).forEach(function(i,o){if(tse(i))n.push(i);else if(i){var l=si(i.type),u=r[l]||{},d=u.handler,h=u.once;if(d&&(!h||!a[l])){var m=d(i,l,o);n.push(m),a[l]=!0}}}),n},ase=function(e){var r=e&&e.type;return r&&Q5[r]?Q5[r]:null},sse=function(e,r){return ek(r).indexOf(e)},ise=["children","width","height","viewBox","className","style","title","desc"];function JN(){return JN=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},JN.apply(this,arguments)}function ose(t,e){if(t==null)return{};var r=lse(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function lse(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function eS(t){var e=t.children,r=t.width,n=t.height,a=t.viewBox,i=t.className,o=t.style,l=t.title,u=t.desc,d=ose(t,ise),h=a||{width:r,height:n,x:0,y:0},m=Ct("recharts-surface",i);return U.createElement("svg",JN({},jt(d,!0,"svg"),{className:m,width:r,height:n,style:o,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),U.createElement("title",null,l),U.createElement("desc",null,u),e)}var cse=["children","className"];function tS(){return tS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},tS.apply(this,arguments)}function use(t,e){if(t==null)return{};var r=dse(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function dse(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var lr=U.forwardRef(function(t,e){var r=t.children,n=t.className,a=use(t,cse),i=Ct("recharts-layer",n);return U.createElement("g",tS({className:i},jt(a,!0),{ref:e}),r)}),ii=function(e,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i]},Fw,nM;function fse(){if(nM)return Fw;nM=1;function t(e,r,n){var a=-1,i=e.length;r<0&&(r=-r>i?0:i+r),n=n>i?i:n,n<0&&(n+=i),i=r>n?0:n-r>>>0,r>>>=0;for(var o=Array(i);++a<i;)o[a]=e[a+r];return o}return Fw=t,Fw}var Bw,aM;function hse(){if(aM)return Bw;aM=1;var t=fse();function e(r,n,a){var i=r.length;return a=a===void 0?i:a,!n&&a>=i?r:t(r,n,a)}return Bw=e,Bw}var Vw,sM;function gF(){if(sM)return Vw;sM=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="\\u200d",l=RegExp("["+o+t+a+i+"]");function u(d){return l.test(d)}return Vw=u,Vw}var zw,iM;function mse(){if(iM)return zw;iM=1;function t(e){return e.split("")}return zw=t,zw}var Uw,oM;function pse(){if(oM)return Uw;oM=1;var t="\\ud800-\\udfff",e="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",a=e+r+n,i="\\ufe0e\\ufe0f",o="["+t+"]",l="["+a+"]",u="\\ud83c[\\udffb-\\udfff]",d="(?:"+l+"|"+u+")",h="[^"+t+"]",m="(?:\\ud83c[\\udde6-\\uddff]){2}",p="[\\ud800-\\udbff][\\udc00-\\udfff]",v="\\u200d",b=d+"?",y="["+i+"]?",x="(?:"+v+"(?:"+[h,m,p].join("|")+")"+y+b+")*",j=y+b+x,N="(?:"+[h+l+"?",l,m,p,o].join("|")+")",S=RegExp(u+"(?="+u+")|"+N+j,"g");function k(C){return C.match(S)||[]}return Uw=k,Uw}var qw,lM;function gse(){if(lM)return qw;lM=1;var t=mse(),e=gF(),r=pse();function n(a){return e(a)?r(a):t(a)}return qw=n,qw}var Ww,cM;
705function vse(){if(cM)return Ww;cM=1;var t=hse(),e=gF(),r=gse(),n=fF();function a(i){return function(o){o=n(o);var l=e(o)?r(o):void 0,u=l?l[0]:o.charAt(0),d=l?t(l,1).join(""):o.slice(1);return u[i]()+d}}return Ww=a,Ww}var Hw,uM;function xse(){if(uM)return Hw;uM=1;var t=vse(),e=t("toUpperCase");return Hw=e,Hw}var yse=xse();const g0=Ft(yse);function Yt(t){return function(){return t}}const vF=Math.cos,Dg=Math.sin,ls=Math.sqrt,$g=Math.PI,v0=2*$g,rS=Math.PI,nS=2*rS,rl=1e-6,bse=nS-rl;function xF(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function wse(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return xF;const r=10**e;return function(n){this._+=n[0];for(let a=1,i=n.length;a<i;++a)this._+=Math.round(arguments[a]*r)/r+n[a]}}class _se{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?xF:wse(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,a){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+a}`}bezierCurveTo(e,r,n,a,i,o){this._append`C${+e},${+r},${+n},${+a},${this._x1=+i},${this._y1=+o}`}arcTo(e,r,n,a,i){if(e=+e,r=+r,n=+n,a=+a,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,u=n-e,d=a-r,h=o-e,m=l-r,p=h*h+m*m;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(p>rl)if(!(Math.abs(m*u-d*h)>rl)||!i)this._append`L${this._x1=e},${this._y1=r}`;else{let v=n-o,b=a-l,y=u*u+d*d,x=v*v+b*b,j=Math.sqrt(y),N=Math.sqrt(p),S=i*Math.tan((rS-Math.acos((y+p-x)/(2*j*N)))/2),k=S/N,C=S/j;Math.abs(k-1)>rl&&this._append`L${e+k*h},${r+k*m}`,this._append`A${i},${i},0,0,${+(m*v>h*b)},${this._x1=e+C*u},${this._y1=r+C*d}`}}arc(e,r,n,a,i,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),u=n*Math.sin(a),d=e+l,h=r+u,m=1^o,p=o?a-i:i-a;this._x1===null?this._append`M${d},${h}`:(Math.abs(this._x1-d)>rl||Math.abs(this._y1-h)>rl)&&this._append`L${d},${h}`,n&&(p<0&&(p=p%nS+nS),p>bse?this._append`A${n},${n},0,1,${m},${e-l},${r-u}A${n},${n},0,1,${m},${this._x1=d},${this._y1=h}`:p>rl&&this._append`A${n},${n},0,${+(p>=rS)},${m},${this._x1=e+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(e,r,n,a){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function tk(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new _se(e)}function rk(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function yF(t){this._context=t}yF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function x0(t){return new yF(t)}function bF(t){return t[0]}function wF(t){return t[1]}function _F(t,e){var r=Yt(!0),n=null,a=x0,i=null,o=tk(l);t=typeof t=="function"?t:t===void 0?bF:Yt(t),e=typeof e=="function"?e:e===void 0?wF:Yt(e);function l(u){var d,h=(u=rk(u)).length,m,p=!1,v;for(n==null&&(i=a(v=o())),d=0;d<=h;++d)!(d<h&&r(m=u[d],d,u))===p&&((p=!p)?i.lineStart():i.lineEnd()),p&&i.point(+t(m,d,u),+e(m,d,u));if(v)return i=null,v+""||null}return l.x=function(u){return arguments.length?(t=typeof u=="function"?u:Yt(+u),l):t},l.y=function(u){return arguments.length?(e=typeof u=="function"?u:Yt(+u),l):e},l.defined=function(u){return arguments.length?(r=typeof u=="function"?u:Yt(!!u),l):r},l.curve=function(u){return arguments.length?(a=u,n!=null&&(i=a(n)),l):a},l.context=function(u){return arguments.length?(u==null?n=i=null:i=a(n=u),l):n},l}function Rp(t,e,r){var n=null,a=Yt(!0),i=null,o=x0,l=null,u=tk(d);t=typeof t=="function"?t:t===void 0?bF:Yt(+t),e=typeof e=="function"?e:Yt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?wF:Yt(+r);function d(m){var p,v,b,y=(m=rk(m)).length,x,j=!1,N,S=new Array(y),k=new Array(y);for(i==null&&(l=o(N=u())),p=0;p<=y;++p){if(!(p<y&&a(x=m[p],p,m))===j)if(j=!j)v=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),b=p-1;b>=v;--b)l.point(S[b],k[b]);l.lineEnd(),l.areaEnd()}j&&(S[p]=+t(x,p,m),k[p]=+e(x,p,m),l.point(n?+n(x,p,m):S[p],r?+r(x,p,m):k[p]))}if(N)return l=null,N+""||null}function h(){return _F().defined(a).curve(o).context(i)}return d.x=function(m){return arguments.length?(t=typeof m=="function"?m:Yt(+m),n=null,d):t},d.x0=function(m){return arguments.length?(t=typeof m=="function"?m:Yt(+m),d):t},d.x1=function(m){return arguments.length?(n=m==null?null:typeof m=="function"?m:Yt(+m),d):n},d.y=function(m){return arguments.length?(e=typeof m=="function"?m:Yt(+m),r=null,d):e},d.y0=function(m){return arguments.length?(e=typeof m=="function"?m:Yt(+m),d):e},d.y1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:Yt(+m),d):r},d.lineX0=d.lineY0=function(){return h().x(t).y(e)},d.lineY1=function(){return h().x(t).y(r)},d.lineX1=function(){return h().x(n).y(e)},d.defined=function(m){return arguments.length?(a=typeof m=="function"?m:Yt(!!m),d):a},d.curve=function(m){return arguments.length?(o=m,i!=null&&(l=o(i)),d):o},d.context=function(m){return arguments.length?(m==null?i=l=null:l=o(i=m),d):i},d}class jF{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function jse(t){return new jF(t,!0)}function Nse(t){return new jF(t,!1)}const nk={draw(t,e){const r=ls(e/$g);t.moveTo(r,0),t.arc(0,0,r,0,v0)}},Sse={draw(t,e){const r=ls(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},NF=ls(1/3),Cse=NF*2,kse={draw(t,e){const r=ls(e/Cse),n=r*NF;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},Ese={draw(t,e){const r=ls(e),n=-r/2;t.rect(n,n,r,r)}},Ase=.8908130915292852,SF=Dg($g/10)/Dg(7*$g/10),Pse=Dg(v0/10)*SF,Tse=-vF(v0/10)*SF,Ose={draw(t,e){const r=ls(e*Ase),n=Pse*r,a=Tse*r;t.moveTo(0,-r),t.lineTo(n,a);for(let i=1;i<5;++i){const o=v0*i/5,l=vF(o),u=Dg(o);t.lineTo(u*r,-l*r),t.lineTo(l*n-u*a,u*n+l*a)}t.closePath()}},Gw=ls(3),Mse={draw(t,e){const r=-ls(e/(Gw*3));t.moveTo(0,r*2),t.lineTo(-Gw*r,-r),t.lineTo(Gw*r,-r),t.closePath()}},ca=-.5,ua=ls(3)/2,aS=1/ls(12),Rse=(aS/2+1)*3,Ise={draw(t,e){const r=ls(e/Rse),n=r/2,a=r*aS,i=n,o=r*aS+r,l=-i,u=o;t.moveTo(n,a),t.lineTo(i,o),t.lineTo(l,u),t.lineTo(ca*n-ua*a,ua*n+ca*a),t.lineTo(ca*i-ua*o,ua*i+ca*o),t.lineTo(ca*l-ua*u,ua*l+ca*u),t.lineTo(ca*n+ua*a,ca*a-ua*n),t.lineTo(ca*i+ua*o,ca*o-ua*i),t.lineTo(ca*l+ua*u,ca*u-ua*l),t.closePath()}};function Dse(t,e){let r=null,n=tk(a);t=typeof t=="function"?t:Yt(t||nk),e=typeof e=="function"?e:Yt(e===void 0?64:+e);function a(){let i;if(r||(r=i=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),i)return r=null,i+""||null}return a.type=function(i){return arguments.length?(t=typeof i=="function"?i:Yt(i),a):t},a.size=function(i){return arguments.length?(e=typeof i=="function"?i:Yt(+i),a):e},a.context=function(i){return arguments.length?(r=i??null,a):r},a}function Lg(){}function Fg(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function CF(t){this._context=t}CF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Fg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Fg(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function $se(t){return new CF(t)}function kF(t){this._context=t}kF.prototype={areaStart:Lg,areaEnd:Lg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Fg(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Lse(t){return new kF(t)}function EF(t){this._context=t}EF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Fg(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Fse(t){return new EF(t)}function AF(t){this._context=t}AF.prototype={areaStart:Lg,areaEnd:Lg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function Bse(t){return new AF(t)}function dM(t){return t<0?-1:1}function fM(t,e,r){var n=t._x1-t._x0,a=e-t._x1,i=(t._y1-t._y0)/(n||a<0&&-0),o=(r-t._y1)/(a||n<0&&-0),l=(i*a+o*n)/(n+a);return(dM(i)+dM(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function hM(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function Kw(t,e,r){var n=t._x0,a=t._y0,i=t._x1,o=t._y1,l=(i-n)/3;t._context.bezierCurveTo(n+l,a+l*e,i-l,o-l*r,i,o)}function Bg(t){this._context=t}Bg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Kw(this,this._t0,hM(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,Kw(this,hM(this,r=fM(this,t,e)),r);break;default:Kw(this,this._t0,r=fM(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function PF(t){this._context=new TF(t)}(PF.prototype=Object.create(Bg.prototype)).point=function(t,e){Bg.prototype.point.call(this,e,t)};function TF(t){this._context=t}TF.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,a,i){this._context.bezierCurveTo(e,t,n,r,i,a)}};function Vse(t){return new Bg(t)}function zse(t){return new PF(t)}function OF(t){this._context=t}OF.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=mM(t),a=mM(e),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],a[0][i],n[1][i],a[1][i],t[o],e[o
705]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function mM(t){var e,r=t.length-1,n,a=new Array(r),i=new Array(r),o=new Array(r);for(a[0]=0,i[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)a[e]=1,i[e]=4,o[e]=4*t[e]+2*t[e+1];for(a[r-1]=2,i[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=a[e]/i[e-1],i[e]-=n,o[e]-=n*o[e-1];for(a[r-1]=o[r-1]/i[r-1],e=r-2;e>=0;--e)a[e]=(o[e]-a[e+1])/i[e];for(i[r-1]=(t[r]+a[r-1])/2,e=0;e<r-1;++e)i[e]=2*t[e+1]-a[e+1];return[a,i]}function Use(t){return new OF(t)}function y0(t,e){this._context=t,this._t=e}y0.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function qse(t){return new y0(t,.5)}function Wse(t){return new y0(t,0)}function Hse(t){return new y0(t,1)}function hu(t,e){if((o=t.length)>1)for(var r=1,n,a,i=t[e[0]],o,l=i.length;r<o;++r)for(a=i,i=t[e[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(a[n][1])?a[n][0]:a[n][1]}function sS(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Gse(t,e){return t[e]}function Kse(t){const e=[];return e.key=t,e}function Yse(){var t=Yt([]),e=sS,r=hu,n=Gse;function a(i){var o=Array.from(t.apply(this,arguments),Kse),l,u=o.length,d=-1,h;for(const m of i)for(l=0,++d;l<u;++l)(o[l][d]=[0,+n(m,o[l].key,d,i)]).data=m;for(l=0,h=rk(e(o));l<u;++l)o[h[l]].index=l;return r(o,h),o}return a.keys=function(i){return arguments.length?(t=typeof i=="function"?i:Yt(Array.from(i)),a):t},a.value=function(i){return arguments.length?(n=typeof i=="function"?i:Yt(+i),a):n},a.order=function(i){return arguments.length?(e=i==null?sS:typeof i=="function"?i:Yt(Array.from(i)),a):e},a.offset=function(i){return arguments.length?(r=i??hu,a):r},a}function Xse(t,e){if((n=t.length)>0){for(var r,n,a=0,i=t[0].length,o;a<i;++a){for(o=r=0;r<n;++r)o+=t[r][a][1]||0;if(o)for(r=0;r<n;++r)t[r][a][1]/=o}hu(t,e)}}function Zse(t,e){if((a=t.length)>0){for(var r=0,n=t[e[0]],a,i=n.length;r<i;++r){for(var o=0,l=0;o<a;++o)l+=t[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}hu(t,e)}}function Qse(t,e){if(!(!((o=t.length)>0)||!((i=(a=t[e[0]]).length)>0))){for(var r=0,n=1,a,i,o;n<i;++n){for(var l=0,u=0,d=0;l<o;++l){for(var h=t[e[l]],m=h[n][1]||0,p=h[n-1][1]||0,v=(m-p)/2,b=0;b<l;++b){var y=t[e[b]],x=y[n][1]||0,j=y[n-1][1]||0;v+=x-j}u+=m,d+=v*m}a[n-1][1]+=a[n-1][0]=r,u&&(r-=d/u)}a[n-1][1]+=a[n-1][0]=r,hu(t,e)}}function Yf(t){"@babel/helpers - typeof";return Yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yf(t)}var Jse=["type","size","sizeType"];function iS(){return iS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},iS.apply(this,arguments)}function pM(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function gM(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?pM(Object(r),!0).forEach(function(n){eie(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):pM(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function eie(t,e,r){return e=tie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function tie(t){var e=rie(t,"string");return Yf(e)=="symbol"?e:e+""}function rie(t,e){if(Yf(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Yf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nie(t,e){if(t==null)return{};var r=aie(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function aie(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var MF={symbolCircle:nk,symbolCross:Sse,symbolDiamond:kse,symbolSquare:Ese,symbolStar:Ose,symbolTriangle:Mse,symbolWye:Ise},sie=Math.PI/180,iie=function(e){var r="symbol".concat(g0(e));return MF[r]||nk},oie=function(e,r,n){if(r==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var a=18*sie;return 1.25*e*e*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},lie=function(e,r){MF["symbol".concat(g0(e))]=r},ak=function(e){var r=e.type,n=r===void 0?"circle":r,a=e.size,i=a===void 0?64:a,o=e.sizeType,l=o===void 0?"area":o,u=nie(e,Jse),d=gM(gM({},u),{},{type:n,size:i,sizeType:l}
vendor: 14,956 bytes, lines 705-708
705),h=function(){var x=iie(n),j=Dse().type(x).size(oie(i,l,n));return j()},m=d.className,p=d.cx,v=d.cy,b=jt(d,!0);return p===+p&&v===+v&&i===+i?U.createElement("path",iS({},b,{className:Ct("recharts-symbols",m),transform:"translate(".concat(p,", ").concat(v,")"),d:h()})):null};ak.registerSymbol=lie;function mu(t){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mu(t)}function oS(){return oS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},oS.apply(this,arguments)}function vM(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function cie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?vM(Object(r),!0).forEach(function(n){Xf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):vM(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function uie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function die(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,IF(n.key),n)}}function fie(t,e,r){return e&&die(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function hie(t,e,r){return e=Vg(e),mie(t,RF()?Reflect.construct(e,r||[],Vg(t).constructor):e.apply(t,r))}function mie(t,e){if(e&&(mu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return pie(t)}function pie(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function RF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(RF=function(){return!!t})()}function Vg(t){return Vg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Vg(t)}function gie(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&lS(t,e)}function lS(t,e){return lS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},lS(t,e)}function Xf(t,e,r){return e=IF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function IF(t){var e=vie(t,"string");return mu(e)=="symbol"?e:e+""}function vie(t,e){if(mu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var da=32,sk=(function(t){function e(){return uie(this,e),hie(this,e,arguments)}return gie(e,t),fie(e,[{key:"renderIcon",value:function(n){var a=this.props.inactiveColor,i=da/2,o=da/6,l=da/3,u=n.inactive?a:n.color;if(n.type==="plainline")return U.createElement("line",{strokeWidth:4,fill:"none",stroke:u,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:da,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return U.createElement("path",{strokeWidth:4,fill:"none",stroke:u,d:"M0,".concat(i,"h").concat(l,` 706 A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,` 707 H`).concat(da,"M").concat(2*l,",").concat(i,` 708 A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return U.createElement("path",{stroke:"none",fill:u,d:"M0,".concat(da/8,"h").concat(da,"v").concat(da*3/4,"h").concat(-da,"z"),className:"recharts-legend-icon"});if(U.isValidElement(n.legendIcon)){var d=cie({},n);return delete d.legendIcon,U.cloneElement(n.legendIcon,d)}return U.createElement(ak,{fill:u,cx:i,cy:i,size:da,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,a=this.props,i=a.payload,o=a.iconSize,l=a.layout,u=a.formatter,d=a.inactiveColor,h={x:0,y:0,width:da,height:da},m={display:l==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(v,b){var y=v.formatter||u,x=Ct(Xf(Xf({"recharts-legend-item":!0},"legend-item-".concat(b),!0),"inactive",v.inactive));if(v.type==="none")return null;var j=xt(v.value)?null:v.value;ii(!xt(v.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var N=v.inactive?d:v.color;return U.createElement("li",oS({className:x,style:m,key:"legend-item-".concat(b)},Ig(n.props,v,b)),U.createElement(eS,{width:o,height:o,viewBox:h,style:p},n.renderIcon(v)),U.createElement("span",{className:"recharts-legend-item-text",style:{color:N}},y?y(j,v,b):j))})}},{key:"render",value:function(){var n=this.props,a=n.payload,i=n.layout,o=n.align;if(!a||!a.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return U.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])})(w.PureComponent);Xf(sk,"displayName","Legend");Xf(sk,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Yw,xM;function xie(){if(xM)return Yw;xM=1;var t=h0();function e(){this.__data__=new t,this.size=0}return Yw=e,Yw}var Xw,yM;function yie(){if(yM)return Xw;yM=1;function t(e){var r=this.__data__,n=r.delete(e);return this.size=r.size,n}return Xw=t,Xw}var Zw,bM;function bie(){if(bM)return Zw;bM=1;function t(e){return this.__data__.get(e)}return Zw=t,Zw}var Qw,wM;function wie(){if(wM)return Qw;wM=1;function t(e){return this.__data__.has(e)}return Qw=t,Qw}var Jw,_M;function _ie(){if(_M)return Jw;_M=1;var t=h0(),e=YC(),r=XC(),n=200;function a(i,o){var l=this.__data__;if(l instanceof t){var u=l.__data__;if(!e||u.length<n-1)return u.push([i,o]),this.size=++l.size,this;l=this.__data__=new r(u)}return l.set(i,o),this.size=l.size,this}return Jw=a,Jw}var e1,jM;function DF(){if(jM)return e1;jM=1;var t=h0(),e=xie(),r=yie(),n=bie(),a=wie(),i=_ie();function o(l){var u=this.__data__=new t(l);this.size=u.size}return o.prototype.clear=e,o.prototype.delete=r,o.prototype.get=n,o.prototype.has=a,o.prototype.set=i,e1=o,e1}var t1,NM;function jie(){if(NM)return t1;NM=1;var t="__lodash_hash_undefined__";function e(r){return this.__data__.set(r,t),this}return t1=e,t1}var r1,SM;function Nie(){if(SM)return r1;SM=1;function t(e){return this.__data__.has(e)}return r1=t,r1}var n1,CM;function $F(){if(CM)return n1;CM=1;var t=XC(),e=jie(),r=Nie();function n(a){var i=-1,o=a==null?0:a.length;for(this.__data__=new t;++i<o;)this.add(a[i])}return n.prototype.add=n.prototype.push=e,n.prototype.has=r,n1=n,n1}var a1,kM;function LF(){if(kM)return a1;kM=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(r(e[n],n,e))return!0;return!1}return a1=t,a1}var s1,EM;function FF(){if(EM)return s1;EM=1;function t(e,r){return e.has(r)}return s1=t,s1}var i1,AM;function BF(){if(AM)return i1;AM=1;var t=$F(),e=LF(),r=FF(),n=1,a=2;function i(o,l,u,d,h,m){var p=u&n,v=o.length,b=l.length;if(v!=b&&!(p&&b>v))return!1;var y=m.get(o),x=m.get(l);if(y&&x)return y==l&&x==o;var j=-1,N=!0,S=u&a?new t:void 0;for(m.set(o,l),m.set(l,o);++j<v;){var k=o[j],C=l[j];if(d)var A=p?d(C,k,j,l,o,m):d(k,C,j,o,l,m);if(A!==void 0){if(A)continue;N=!1;break}if(S){if(!e(l,function(T,R){if(!r(S,R)&&(k===T||h(k,T,u,d,m)))return S.push(R)})){N=!1;break}}else if(!(k===C||h(k,C,u,d,m))){N=!1;break}}return m.delete(o),m.delete(l),N}return i1=i,i1}var o1,PM;function Sie(){if(PM)return o1;PM=1;var t=Rs(),e=t.Uint8Array;return o1=e,o1}var l1,TM;function Cie(){if(TM)return l1;TM=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a,i){n[++r]=[i,a]}),n}return l1=t,l1}var c1,OM;function ik(){if(OM)return c1;OM=1;function t(e){var r=-1,n=Array(e.size);return e.forEach(function(a){n[++r]=a}),n}return c1=t,c1}var u1,MM;function kie(){if(MM)return u1;MM=1;var t=Uh(),e=Sie(),r=KC(),n=BF(),a=Cie(),i=ik(),o=1,l=2,u="[object Boolean]",d="[object Date]",h="[object Error]",m="[object Map]",p="[object Number]",v="[object RegExp]",b="[object Set]",y="[object String]",x="[object Symbol]",j="[object ArrayBuffer]",N="[object DataView]",S=t?t.prototype:void 0,k=S?S.valueOf:void 0;function C(A,T,R,I,D,L,z){switch(R){case N:if(A.byteLength!=T.byteLength||A.byteOffset!=T.byteOffset)return!1;A=A.buffer,T=T.buffer;case j:return!(A.byteLength!=T.byteLength||!L(new e(A),new e(T)));case u:case d:case p:return r(+A,+T);case h:return A.name==T.name&&A.message==T.message;case v:case y:return A==T+"";case m:var H=a;case b:var Z=I&o;if(H||(H=i),A.size!=T.size&&!Z)return!1;var te=z.get(A);if(te)return te==T;I|=l,z.set(A,T);var G=n(H(A),H(T),I,D,L,z);return z.delete(A),G;case x:if(k)return k.call(A)==k.call(T)}return!1}return u1=C,u1}var d1,RM;function VF(){if(RM)return d1;RM=1;function t(e,r){for(var n=-1,a=r.length,i=e.length;++n<a;)e[i+n]=r[n];return e}return d1=t,d1}var f1,IM;function Eie(){if(IM)return f1;IM=1;var t=VF(),e=In();function r(n,a,i){var o=a(n);return e(n)?o:t(o,i(n))}return f1=r,f1}var h1,DM;function Aie(){if(DM)return h1;DM=1;function t(e,r){for(var n=-1,a=e==null?0:e.length,i=0,o=[];++n<a;){var l=e[n];r(l,n,e)&&(o[i++]=l)}return o}return h1=t,h1}var m1,$M;function Pie(){if($M)return m1;$M=1;function t(){return[]}return m1=t,m1}var p1,LM;function Tie(){if(LM)return p1;LM=1;var t=Aie(),e=Pie(),r=Object.prototype,n=r.propertyIsEnumerable,a=Object.getOwnPropertySymbols,i=a?function(o){return o==null?[]:(o=Object(o),t(a(o),function(l){return n.call(o,l)}))}:e;return p1=i,p1}var g1,FM;function Oie(){if(FM)return g1;FM=1;function t(e,r){for(var n=-1,a=Array(e);++n<e;)a[n]=r(n);return a}return g1=t,g1}var v1,BM;function Mie(){if(BM)return v1;BM=1;var t=bi(),e=wi(),r="[object Arguments]";function n(a){return e(a)&&t(a)==r}return v1=n,v1}var x1,VM;function ok(){if(VM)return x1;VM=1;var t=Mie(),e=wi(),r=Object.prototype,n=r.hasOwnProperty,a=r.propertyIsEnumerable,i=t((function(){return arguments})())?t:function(o){return e(o)&&n.call(o,"callee")&&!a.call(o,"callee")};return x1=i,x1}var gf={exports:{}},y1,zM;function Rie(){if(zM)return y1;zM=1;function t(){return!1}return y1=t,y1}gf.exports;var UM;function zF(){return UM||(UM=1,(function(t,e){var r=Rs(),n=Rie(),a=e&&!e.nodeType&&e,i=a&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===a,l=o?r.Buffer:void 0,u=l?l.isBuffer:void 0,d=u||n;t.exports=d})(gf,gf.exports)),gf.exports}var b1,qM;function lk(){if(qM)return b1;qM=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function r(n,a){var i=typeof n;return a=a??t,!!a&&(i=="number"||i!="symbol"&&e.test(n))&&n>-1&&n%1==0&&n<a}return b1=r,b1}var w1,WM;function ck(){if(WM)return w1;WM=1;var t=9007199254740991;function e(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=t}return w1=e,w1}var _1,HM;function Iie(){if(HM)return _1;HM=1;var t=bi(),e=ck(),r=wi(),n="[object Arguments]",a="[object Array]",i="[object Boolean]",o="[object Date]",l="[object Error]",u="[object Function]",d="[object Map]",h="[object Number]",m="[object Object]",p="[object RegExp]",v="[object Set]",b="[object String]",y="[object WeakMap]",x="[object ArrayBuffer]",j="[object DataView]",N="[object Float32Array]",S="[object Float64Array]",k="[object Int8Array]",C="[object Int16Array]",A="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",I="[object Uint16Array]",D="[object Uint32Array]",L={};L[N]=L[S]=L[k]=L[C]=L[A]=L[T]=L[R]=L[I]=L[D]=!0,L[n]=L[a]=L[x]=L[i]=L[j]=L[o]=L[l]=L[u]=L[d]=L[h]=L[m]=L[p]=L[v]=L[b]=L[y]=!1;function z(H){return r(H)&&e(H.length)&&!!L[t(H)]}return _1=z,_1}var j1,GM;function UF(){if(GM)return j1;GM=1;function t(e){return function(r){return e(r)}}return j1=t,j1}var vf={exports:{}};vf.exports;var KM;function Die(){return KM||(KM=1,(function(t,e){var r=cF(),n=e&&!e.nodeType&&e,a=n&&!0&&t&&!t.nodeType&&t,i=a&&a.exports===n,o=i&&r.process,l=(function(){try{var u=a&&a.require&&a.require("util").types;return u||o&&o.binding&&o.binding("util")}catch{}})();t.exports=l})(vf,vf.exports)),vf.exports}var N1,YM;function qF(){if(YM)return N1;YM=1;var t=Iie(),e=UF(),r=Die(),n=r&&r.isTypedArray,a=n?e(n):t;return N1=a,N1}var S1,XM;function $ie(){if(XM)return S1;XM=1;var t=Oie(),e=ok(),r=In(),n=zF(),a=lk(),i=qF(),o=Object.prototype,l=o.hasOwnProperty;function u(d,h){var m=r(d),p=!m&&e(d),v=!m&&!p&&n(d),b=!m&&!p&&!v&&i(d),y=m||p||v||b,x=y?t(d.length,String):[],j=x.length;for(var N in d)(h||l.call(d,N))&&!(y&&(N=="length"||v&&(N=="offset"||N=="parent")||b&&(N=="buffer"||N=="byteLength"||N=="byteOffset")||a(N,j)))&&x.push(N);return x}return S1=u,S1}var C1,ZM;function Lie(){if(ZM)return C1;ZM=1;var t=Object.prototype;function e(r){var n=r&&r.constructor,a=typeof n=="function"&&n.prototype||t;return r===a}return C1=e,C1}var k1,QM;function WF(){if(QM)return k1;QM=1;function t(e,r){return function(n){return e(r(n))}}return k1=t,k1}var E1,JM;function Fie(){if(JM)return E1;JM=1;var t=WF(),e=t(Object.keys,Object);return E1=e,E1}var A1,eR;function Bie(){if(eR)return A1;eR=1;var t=Lie(),e=Fie(),r=Object.prototype,n=r.hasOwnProperty;function a(i){if(!t(i))return e(i);var o=[];for(var l in Object(i))n.call(i,l)&&l!="constructor"&&o.push(l);return o}return A1=a,A1}var P1,tR;function Wh(){if(tR)return P1;tR=1;var t=GC(),e=ck();function r(n){return n!=null&&e(n.length)&&!t(n)}return P1=r,P1}var T1,rR;function b0(){if(rR)return T1;rR=1;var t=$ie(),e=Bie(),r=Wh();function n(a){return r(a)?t(a):e(a)}return T1=n,T1}var O1,nR;function Vie(){if(nR)return O1;nR=1;var t=Eie(),e=Tie(),r=b0();function n(a){return t(a,r,e)}return O1=n,O1}var M1,aR;function zie(){if(aR)return M1;aR=1;var t=Vie(),e=1,r=Object.prototype,n=r.hasOwnProperty;function a(i,o,l,u,d,h){var m=l&e,p=t(i),v=p.length,b=t(o),y=b.length;if(v!=y&&!m)return!1;for(var x=v;x--;){var j=p[x];if(!(m?j in o:n.call(o,j)))return!1}var N=h.get(i),S=h.get(o);if(N&&S)return N==o&&S==i;var k=!0;h.set(i,o),h.set(o,i);for(var C=m;++x<v;){j=p[x];var A=i[j],T=o[j];if(u)var R=m?u(T,A,j,o,i,h):u(A,T,j,i,o,h);if(!(R===void 0?A===T||d(A,T,l,u,h):R)){k=!1;break}C||(C=j=="constructor")}if(k&&!C){var I=i.constructor,D=o.constructor;I!=D&&"constructor"in i&&"constructor"in o&&!(typeof I=="function"&&I instanceof I&&typeof D=="function"&&D instanceof D)&&(k=!1)}return h.delete(i),h.delete(o),k}return M1=a,M1}var R1,sR;function Uie(){if(sR)return R1;sR=1;var t=Ul(),e=Rs(),r=t(e,"DataView");return R1=r,R1}var I1,iR;
vendor: 1,332 bytes, line 708
708function qie(){if(iR)return I1;iR=1;var t=Ul(),e=Rs(),r=t(e,"Promise");return I1=r,I1}var D1,oR;function HF(){if(oR)return D1;oR=1;var t=Ul(),e=Rs(),r=t(e,"Set");return D1=r,D1}var $1,lR;function Wie(){if(lR)return $1;lR=1;var t=Ul(),e=Rs(),r=t(e,"WeakMap");return $1=r,$1}var L1,cR;function Hie(){if(cR)return L1;cR=1;var t=Uie(),e=YC(),r=qie(),n=HF(),a=Wie(),i=bi(),o=uF(),l="[object Map]",u="[object Object]",d="[object Promise]",h="[object Set]",m="[object WeakMap]",p="[object DataView]",v=o(t),b=o(e),y=o(r),x=o(n),j=o(a),N=i;return(t&&N(new t(new ArrayBuffer(1)))!=p||e&&N(new e)!=l||r&&N(r.resolve())!=d||n&&N(new n)!=h||a&&N(new a)!=m)&&(N=function(S){var k=i(S),C=k==u?S.constructor:void 0,A=C?o(C):"";if(A)switch(A){case v:return p;case b:return l;case y:return d;case x:return h;case j:return m}return k}),L1=N,L1}var F1,uR;function Gie(){if(uR)return F1;uR=1;var t=DF(),e=BF(),r=kie(),n=zie(),a=Hie(),i=In(),o=zF(),l=qF(),u=1,d="[object Arguments]",h="[object Array]",m="[object Object]",p=Object.prototype,v=p.hasOwnProperty;function b(y,x,j,N,S,k){var C=i(y),A=i(x),T=C?h:a(y),R=A?h:a(x);T=T==d?m:T,R=R==d?m:R;var I=T==m,D=R==m,L=T==R;if(L&&o(y)){if(!o(x))return!1;C=!0,I=!1}if(L&&!I)return k||(k=new t),C||l(y)?e(y,x,j,N,S,k):r(y,x,T,j,N,S,k);if(!(j&u)){var z=I&&v.call(y,"__wrapped__"),H=D&&v.call(x,"__wrapped__");
vendor: 43,364 bytes, lines 708-715
708if(z||H){var Z=z?y.value():y,te=H?x.value():x;return k||(k=new t),S(Z,te,j,N,k)}}return L?(k||(k=new t),n(y,x,j,N,S,k)):!1}return F1=b,F1}var B1,dR;function uk(){if(dR)return B1;dR=1;var t=Gie(),e=wi();function r(n,a,i,o,l){return n===a?!0:n==null||a==null||!e(n)&&!e(a)?n!==n&&a!==a:t(n,a,i,o,r,l)}return B1=r,B1}var V1,fR;function Kie(){if(fR)return V1;fR=1;var t=DF(),e=uk(),r=1,n=2;function a(i,o,l,u){var d=l.length,h=d,m=!u;if(i==null)return!h;for(i=Object(i);d--;){var p=l[d];if(m&&p[2]?p[1]!==i[p[0]]:!(p[0]in i))return!1}for(;++d<h;){p=l[d];var v=p[0],b=i[v],y=p[1];if(m&&p[2]){if(b===void 0&&!(v in i))return!1}else{var x=new t;if(u)var j=u(b,y,v,i,o,x);if(!(j===void 0?e(y,b,r|n,u,x):j))return!1}}return!0}return V1=a,V1}var z1,hR;function GF(){if(hR)return z1;hR=1;var t=ko();function e(r){return r===r&&!t(r)}return z1=e,z1}var U1,mR;function Yie(){if(mR)return U1;mR=1;var t=GF(),e=b0();function r(n){for(var a=e(n),i=a.length;i--;){var o=a[i],l=n[o];a[i]=[o,l,t(l)]}return a}return U1=r,U1}var q1,pR;function KF(){if(pR)return q1;pR=1;function t(e,r){return function(n){return n==null?!1:n[e]===r&&(r!==void 0||e in Object(n))}}return q1=t,q1}var W1,gR;function Xie(){if(gR)return W1;gR=1;var t=Kie(),e=Yie(),r=KF();function n(a){var i=e(a);return i.length==1&&i[0][2]?r(i[0][0],i[0][1]):function(o){return o===a||t(o,a,i)}}return W1=n,W1}var H1,vR;function Zie(){if(vR)return H1;vR=1;function t(e,r){return e!=null&&r in Object(e)}return H1=t,H1}var G1,xR;function Qie(){if(xR)return G1;xR=1;var t=hF(),e=ok(),r=In(),n=lk(),a=ck(),i=p0();function o(l,u,d){u=t(u,l);for(var h=-1,m=u.length,p=!1;++h<m;){var v=i(u[h]);if(!(p=l!=null&&d(l,v)))break;l=l[v]}return p||++h!=m?p:(m=l==null?0:l.length,!!m&&a(m)&&n(v,m)&&(r(l)||e(l)))}return G1=o,G1}var K1,yR;function Jie(){if(yR)return K1;yR=1;var t=Zie(),e=Qie();function r(n,a){return n!=null&&e(n,a,t)}return K1=r,K1}var Y1,bR;function eoe(){if(bR)return Y1;bR=1;var t=uk(),e=mF(),r=Jie(),n=HC(),a=GF(),i=KF(),o=p0(),l=1,u=2;function d(h,m){return n(h)&&a(m)?i(o(h),m):function(p){var v=e(p,h);return v===void 0&&v===m?r(p,h):t(m,v,l|u)}}return Y1=d,Y1}var X1,wR;function nd(){if(wR)return X1;wR=1;function t(e){return e}return X1=t,X1}var Z1,_R;function toe(){if(_R)return Z1;_R=1;function t(e){return function(r){return r==null?void 0:r[e]}}return Z1=t,Z1}var Q1,jR;function roe(){if(jR)return Q1;jR=1;var t=QC();function e(r){return function(n){return t(n,r)}}return Q1=e,Q1}var J1,NR;function noe(){if(NR)return J1;NR=1;var t=toe(),e=roe(),r=HC(),n=p0();function a(i){return r(i)?t(n(i)):e(i)}return J1=a,J1}var e_,SR;function Eo(){if(SR)return e_;SR=1;var t=Xie(),e=eoe(),r=nd(),n=In(),a=noe();function i(o){return typeof o=="function"?o:o==null?r:typeof o=="object"?n(o)?e(o[0],o[1]):t(o):a(o)}return e_=i,e_}var t_,CR;function YF(){if(CR)return t_;CR=1;function t(e,r,n,a){for(var i=e.length,o=n+(a?1:-1);a?o--:++o<i;)if(r(e[o],o,e))return o;return-1}return t_=t,t_}var r_,kR;function aoe(){if(kR)return r_;kR=1;function t(e){return e!==e}return r_=t,r_}var n_,ER;function soe(){if(ER)return n_;ER=1;function t(e,r,n){for(var a=n-1,i=e.length;++a<i;)if(e[a]===r)return a;return-1}return n_=t,n_}var a_,AR;function ioe(){if(AR)return a_;AR=1;var t=YF(),e=aoe(),r=soe();function n(a,i,o){return i===i?r(a,i,o):t(a,e,o)}return a_=n,a_}var s_,PR;function ooe(){if(PR)return s_;PR=1;var t=ioe();function e(r,n){var a=r==null?0:r.length;return!!a&&t(r,n,0)>-1}return s_=e,s_}var i_,TR;function loe(){if(TR)return i_;TR=1;function t(e,r,n){for(var a=-1,i=e==null?0:e.length;++a<i;)if(n(r,e[a]))return!0;return!1}return i_=t,i_}var o_,OR;function coe(){if(OR)return o_;OR=1;function t(){}return o_=t,o_}var l_,MR;function uoe(){if(MR)return l_;MR=1;var t=HF(),e=coe(),r=ik(),n=1/0,a=t&&1/r(new t([,-0]))[1]==n?function(i){return new t(i)}:e;return l_=a,l_}var c_,RR;function doe(){if(RR)return c_;RR=1;var t=$F(),e=ooe(),r=loe(),n=FF(),a=uoe(),i=ik(),o=200;function l(u,d,h){var m=-1,p=e,v=u.length,b=!0,y=[],x=y;if(h)b=!1,p=r;else if(v>=o){var j=d?null:a(u);if(j)return i(j);b=!1,p=n,x=new t}else x=d?[]:y;e:for(;++m<v;){var N=u[m],S=d?d(N):N;if(N=h||N!==0?N:0,b&&S===S){for(var k=x.length;k--;)if(x[k]===S)continue e;d&&x.push(S),y.push(N)}else p(x,S,h)||(x!==y&&x.push(S),y.push(N))}return y}return c_=l,c_}var u_,IR;function foe(){if(IR)return u_;IR=1;var t=Eo(),e=doe();function r(n,a){return n&&n.length?e(n,t(a,2)):[]}return u_=r,u_}var hoe=foe();const DR=Ft(hoe);function XF(t,e,r){return e===!0?DR(t,r):xt(e)?DR(t,e):t}function pu(t){"@babel/helpers - typeof";return pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pu(t)}var moe=["ref"];function $R(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Hs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$R(Object(r),!0).forEach(function(n){w0(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$R(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function poe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function LR(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,QF(n.key),n)}}function goe(t,e,r){return e&&LR(t.prototype,e),r&&LR(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function voe(t,e,r){return e=zg(e),xoe(t,ZF()?Reflect.construct(e,r||[],zg(t).constructor):e.apply(t,r))}function xoe(t,e){if(e&&(pu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return yoe(t)}function yoe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ZF(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZF=function(){return!!t})()}function zg(t){return zg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},zg(t)}function boe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&cS(t,e)}function cS(t,e){return cS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},cS(t,e)}function w0(t,e,r){return e=QF(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function QF(t){var e=woe(t,"string");return pu(e)=="symbol"?e:e+""}function woe(t,e){if(pu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function _oe(t,e){if(t==null)return{};var r=joe(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function joe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Noe(t){return t.value}function Soe(t,e){if(U.isValidElement(t))return U.cloneElement(t,e);if(typeof t=="function")return U.createElement(t,e);e.ref;var r=_oe(e,moe);return U.createElement(sk,r)}var FR=1,Yc=(function(t){function e(){var r;poe(this,e);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=voe(this,e,[].concat(a)),w0(r,"lastBoundingBox",{width:-1,height:-1}),r}return boe(e,t),goe(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,a=this.getBBox();a?(Math.abs(a.width-this.lastBoundingBox.width)>FR||Math.abs(a.height-this.lastBoundingBox.height)>FR)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,n&&n(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Hs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var a=this.props,i=a.layout,o=a.align,l=a.verticalAlign,u=a.margin,d=a.chartWidth,h=a.chartHeight,m,p;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var v=this.getBBoxSnapshot();m={left:((d||0)-v.width)/2}}else m=o==="right"?{right:u&&u.right||0}:{left:u&&u.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var b=this.getBBoxSnapshot();p={top:((h||0)-b.height)/2}}else p=l==="bottom"?{bottom:u&&u.bottom||0}:{top:u&&u.top||0};return Hs(Hs({},m),p)}},{key:"render",value:function(){var n=this,a=this.props,i=a.content,o=a.width,l=a.height,u=a.wrapperStyle,d=a.payloadUniqBy,h=a.payload,m=Hs(Hs({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(u)),u);return U.createElement("div",{className:"recharts-legend-wrapper",style:m,ref:function(v){n.wrapperNode=v}},Soe(i,Hs(Hs({},this.props),{},{payload:XF(h,d,Noe)})))}}],[{key:"getWithHeight",value:function(n,a){var i=Hs(Hs({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&De(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||a}:null}}])})(w.PureComponent);w0(Yc,"displayName","Legend");w0(Yc,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var d_,BR;function Coe(){if(BR)return d_;BR=1;var t=Uh(),e=ok(),r=In(),n=t?t.isConcatSpreadable:void 0;function a(i){return r(i)||e(i)||!!(n&&i&&i[n])}return d_=a,d_}var f_,VR;function JF(){if(VR)return f_;VR=1;var t=VF(),e=Coe();function r(n,a,i,o,l){var u=-1,d=n.length;for(i||(i=e),l||(l=[]);++u<d;){var h=n[u];a>0&&i(h)?a>1?r(h,a-1,i,o,l):t(l,h):o||(l[l.length]=h)}return l}return f_=r,f_}var h_,zR;function koe(){if(zR)return h_;zR=1;function t(e){return function(r,n,a){for(var i=-1,o=Object(r),l=a(r),u=l.length;u--;){var d=l[e?u:++i];if(n(o[d],d,o)===!1)break}return r}}return h_=t,h_}var m_,UR;function Eoe(){if(UR)return m_;UR=1;var t=koe(),e=t();return m_=e,m_}var p_,qR;function eB(){if(qR)return p_;qR=1;var t=Eoe(),e=b0();function r(n,a){return n&&t(n,a,e)}return p_=r,p_}var g_,WR;function Aoe(){if(WR)return g_;WR=1;var t=Wh();function e(r,n){return function(a,i){if(a==null)return a;if(!t(a))return r(a,i);for(var o=a.length,l=n?o:-1,u=Object(a);(n?l--:++l<o)&&i(u[l],l,u)!==!1;);return a}}return g_=e,g_}var v_,HR;function dk(){if(HR)return v_;HR=1;var t=eB(),e=Aoe(),r=e(t);return v_=r,v_}var x_,GR;function tB(){if(GR)return x_;GR=1;var t=dk(),e=Wh();function r(n,a){var i=-1,o=e(n)?Array(n.length):[];return t(n,function(l,u,d){o[++i]=a(l,u,d)}),o}return x_=r,x_}var y_,KR;function Poe(){if(KR)return y_;KR=1;function t(e,r){var n=e.length;for(e.sort(r);n--;)e[n]=e[n].value;return e}return y_=t,y_}var b_,YR;function Toe(){if(YR)return b_;YR=1;var t=ed();function e(r,n){if(r!==n){var a=r!==void 0,i=r===null,o=r===r,l=t(r),u=n!==void 0,d=n===null,h=n===n,m=t(n);if(!d&&!m&&!l&&r>n||l&&u&&h&&!d&&!m||i&&u&&h||!a&&h||!o)return 1;if(!i&&!l&&!m&&r<n||m&&a&&o&&!i&&!l||d&&a&&o||!u&&o||!h)return-1}return 0}return b_=e,b_}var w_,XR;function Ooe(){if(XR)return w_;XR=1;var t=Toe();function e(r,n,a){for(var i=-1,o=r.criteria,l=n.criteria,u=o.length,d=a.length;++i<u;){var h=t(o[i],l[i]);if(h){if(i>=d)return h;var m=a[i];return h*(m=="desc"?-1:1)}}return r.index-n.index}return w_=e,w_}var __,ZR;function Moe(){if(ZR)return __;ZR=1;var t=ZC(),e=QC(),r=Eo(),n=tB(),a=Poe(),i=UF(),o=Ooe(),l=nd(),u=In();function d(h,m,p){m.length?m=t(m,function(y){return u(y)?function(x){return e(x,y.length===1?y[0]:y)}:y}):m=[l];var v=-1;m=t(m,i(r));var b=n(h,function(y,x,j){var N=t(m,function(S){return S(y)});return{criteria:N,index:++v,value:y}});return a(b,function(y,x){return o(y,x,p)})}return __=d,__}var j_,QR;function Roe(){if(QR)return j_;QR=1;function t(e,r,n){switch(n.length){case 0:return e.call(r);case 1:return e.call(r,n[0]);case 2:return e.call(r,n[0],n[1]);case 3:return e.call(r,n[0],n[1],n[2])}return e.apply(r,n)}return j_=t,j_}var N_,JR;function Ioe(){if(JR)return N_;JR=1;var t=Roe(),e=Math.max;function r(n,a,i){return a=e(a===void 0?n.length-1:a,0),function(){for(var o=arguments,l=-1,u=e(o.length-a,0),d=Array(u);++l<u;)d[l]=o[a+l];l=-1;for(var h=Array(a+1);++l<a;)h[l]=o[l];return h[a]=i(d),t(n,this,h)}}return N_=r,N_}var S_,eI;function Doe(){if(eI)return S_;eI=1;function t(e){return function(){return e}}return S_=t,S_}var C_,tI;function rB(){if(tI)return C_;tI=1;var t=Ul(),e=(function(){try{var r=t(Object,"defineProperty");return r({},"",{}),r}catch{}})();return C_=e,C_}var k_,rI;function $oe(){if(rI)return k_;rI=1;var t=Doe(),e=rB(),r=nd(),n=e?function(a,i){return e(a,"toString",{configurable:!0,enumerable:!1,value:t(i),writable:!0})}:r;return k_=n,k_}var E_,nI;function Loe(){if(nI)return E_;nI=1;var t=800,e=16,r=Date.now;function n(a){var i=0,o=0;return function(){var l=r(),u=e-(l-o);if(o=l,u>0){if(++i>=t)return arguments[0]}else i=0;return a.apply(void 0,arguments)}}return E_=n,E_}var A_,aI;function Foe(){if(aI)return A_;aI=1;var t=$oe(),e=Loe(),r=e(t);return A_=r,A_}var P_,sI;function Boe(){if(sI)return P_;sI=1;var t=nd(),e=Ioe(),r=Foe();function n(a,i){return r(e(a,i,t),a+"")}return P_=n,P_}var T_,iI;function _0(){if(iI)return T_;iI=1;var t=KC(),e=Wh(),r=lk(),n=ko();function a(i,o,l){if(!n(l))return!1;var u=typeof o;return(u=="number"?e(l)&&r(o,l.length):u=="string"&&o in l)?t(l[o],i):!1}return T_=a,T_}var O_,oI;function Voe(){if(oI)return O_;oI=1;var t=JF(),e=Moe(),r=Boe(),n=_0(),a=r(function(i,o){if(i==null)return[];var l=o.length;return l>1&&n(i,o[0],o[1])?o=[]:l>2&&n(o[0],o[1],o[2])&&(o=[o[0]]),e(i,t(o,1),[])});return O_=a,O_}var zoe=Voe();const fk=Ft(zoe);function Zf(t){"@babel/helpers - typeof";return Zf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zf(t)}function uS(){return uS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},uS.apply(this,arguments)}function Uoe(t,e){return Goe(t)||Hoe(t,e)||Woe(t,e)||qoe()}function qoe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 709In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Woe(t,e){if(t){if(typeof t=="string")return lI(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lI(t,e)}}function lI(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Hoe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function Goe(t){if(Array.isArray(t))return t}function cI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function M_(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cI(Object(r),!0).forEach(function(n){Koe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Koe(t,e,r){return e=Yoe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Yoe(t){var e=Xoe(t,"string");return Zf(e)=="symbol"?e:e+""}function Xoe(t,e){if(Zf(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Zf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zoe(t){return Array.isArray(t)&&Mr(t[0])&&Mr(t[1])?t.join(" ~ "):t}var Qoe=function(e){var r=e.separator,n=r===void 0?" : ":r,a=e.contentStyle,i=a===void 0?{}:a,o=e.itemStyle,l=o===void 0?{}:o,u=e.labelStyle,d=u===void 0?{}:u,h=e.payload,m=e.formatter,p=e.itemSorter,v=e.wrapperClassName,b=e.labelClassName,y=e.label,x=e.labelFormatter,j=e.accessibilityLayer,N=j===void 0?!1:j,S=function(){if(h&&h.length){var z={padding:0,margin:0},H=(p?fk(h,p):h).map(function(Z,te){if(Z.type==="none")return null;var G=M_({display:"block",paddingTop:4,paddingBottom:4,color:Z.color||"#000"},l),M=Z.formatter||m||Zoe,F=Z.value,K=Z.name,B=F,O=K;if(M&&B!=null&&O!=null){var W=M(F,K,Z,te,h);if(Array.isArray(W)){var q=Uoe(W,2);B=q[0],O=q[1]}else B=W}return U.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(te),style:G},Mr(O)?U.createElement("span",{className:"recharts-tooltip-item-name"},O):null,Mr(O)?U.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,U.createElement("span",{className:"recharts-tooltip-item-value"},B),U.createElement("span",{className:"recharts-tooltip-item-unit"},Z.unit||""))});return U.createElement("ul",{className:"recharts-tooltip-item-list",style:z},H)}return null},k=M_({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),C=M_({margin:0},d),A=!St(y),T=A?y:"",R=Ct("recharts-default-tooltip",v),I=Ct("recharts-tooltip-label",b);A&&x&&h!==void 0&&h!==null&&(T=x(y,h));var D=N?{role:"status","aria-live":"assertive"}:{};return U.createElement("div",uS({className:R,style:k},D),U.createElement("p",{className:I,style:C},U.isValidElement(T)?T:"".concat(T)),S())};function Qf(t){"@babel/helpers - typeof";return Qf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qf(t)}function Ip(t,e,r){return e=Joe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Joe(t){var e=ele(t,"string");return Qf(e)=="symbol"?e:e+""}function ele(t,e){if(Qf(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Qf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Jd="recharts-tooltip-wrapper",tle={visibility:"hidden"};function rle(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return Ct(Jd,Ip(Ip(Ip(Ip({},"".concat(Jd,"-right"),De(r)&&e&&De(e.x)&&r>=e.x),"".concat(Jd,"-left"),De(r)&&e&&De(e.x)&&r<e.x),"".concat(Jd,"-bottom"),De(n)&&e&&De(e.y)&&n>=e.y),"".concat(Jd,"-top"),De(n)&&e&&De(e.y)&&n<e.y))}function uI(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,a=t.offsetTopLeft,i=t.position,o=t.reverseDirection,l=t.tooltipDimension,u=t.viewBox,d=t.viewBoxDimension;if(i&&De(i[n]))return i[n];var h=r[n]-l-a,m=r[n]+a;if(e[n])return o[n]?h:m;if(o[n]){var p=h,v=u[n];return p<v?Math.max(m,u[n]):Math.max(h,u[n])}var b=m+l,y=u[n]+d;return b>y?Math.max(h,u[n]):Math.max(m,u[n])}function nle(t){var e=t.translateX,r=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function ale(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,a=t.position,i=t.reverseDirection,o=t.tooltipBox,l=t.useTranslate3d,u=t.viewBox,d,h,m;return o.height>0&&o.width>0&&r?(h=uI({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.width,viewBox:u,viewBoxDimension:u.width}),m=uI({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:a,reverseDirection:i,tooltipDimension:o.height,viewBox:u,viewBoxDimension:u.height}),d=nle({translateX:h,translateY:m,useTranslate3d:l})):d=tle,{cssProperties:d,cssClasses:rle({translateX:h,translateY:m,coordinate:r})}}function gu(t){"@babel/helpers - typeof";return gu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gu(t)}function dI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function fI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?dI(Object(r),!0).forEach(function(n){fS(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function sle(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ile(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,aB(n.key),n)}}function ole(t,e,r){return e&&ile(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function lle(t,e,r){return e=Ug(e),cle(t,nB()?Reflect.construct(e,r||[],Ug(t).constructor):e.apply(t,r))}function cle(t,e){if(e&&(gu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ule(t)}function ule(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function nB(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(nB=function(){return!!t})()}function Ug(t){return Ug=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ug(t)}function dle(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&dS(t,e)}function dS(t,e){return dS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},dS(t,e)}function fS(t,e,r){return e=aB(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aB(t){var e=fle(t,"string");return gu(e)=="symbol"?e:e+""}function fle(t,e){if(gu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var hI=1,hle=(function(t){function e(){var r;sle(this,e);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=lle(this,e,[].concat(a)),fS(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),fS(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,u,d,h;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(u=r.props.coordinate)===null||u===void 0?void 0:u.x)!==null&&l!==void 0?l:0,y:(d=(h=r.props.coordinate)===null||h===void 0?void 0:h.y)!==null&&d!==void 0?d:0}})}}),r}return dle(e,t),ole(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>hI||Math.abs(n.height-this.state.lastBoundingBox.height)>hI)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,u=a.animationEasing,d=a.children,h=a.coordinate,m=a.hasPayload,p=a.isAnimationActive,v=a.offset,b=a.position,y=a.reverseDirection,x=a.useTranslate3d,j=a.viewBox,N=a.wrapperStyle,S=ale({allowEscapeViewBox:o,coordinate:h,offsetTopLeft:v,position:b,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:x,viewBox:j}),k=S.cssClasses,C=S.cssProperties,A=fI(fI({transition:p&&i?"transform ".concat(l,"ms ").concat(u):void 0},C),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&m?"visible":"hidden",position:"absolute",top:0,left:0},N);return U.createElement("div",{tabIndex:-1,className:k,style:A,ref:function(R){n.wrapperNode=R}},d)}}])})(w.PureComponent),mle=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ad={isSsr:mle()};function vu(t){"@babel/helpers - typeof";return vu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vu(t)}function mI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function pI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?mI(Object(r),!0).forEach(function(n){hk(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ple(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gle(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,iB(n.key),n)}}function vle(t,e,r){return e&&gle(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function xle(t,e,r){return e=qg(e),yle(t,sB()?Reflect.construct(e,r||[],qg(t).constructor):e.apply(t,r))}function yle(t,e){if(e&&(vu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ble(t)}function ble(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function sB(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sB=function(){return!!t})()}function qg(t){return qg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},qg(t)}function wle(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hS(t,e)}function hS(t,e){return hS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},hS(t,e)}function hk(t,e,r){return e=iB(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function iB(t){var e=_le(t,"string");return vu(e)=="symbol"?e:e+""}function _le(t,e){if(vu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(vu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function jle(t){return t.dataKey}function Nle(t,e){return U.isValidElement(t)?U.cloneElement(t,e):typeof t=="function"?U.createElement(t,e):U.createElement(Qoe,e)}var vs=(function(t){function e(){return ple(this,e),xle(this,e,arguments)}return wle(e,t),vle(e,[{key:"render",value:function(){var n=this,a=this.props,i=a.active,o=a.allowEscapeViewBox,l=a.animationDuration,u=a.animationEasing,d=a.content,h=a.coordinate,m=a.filterNull,p=a.isAnimationActive,v=a.offset,b=a.payload,y=a.payloadUniqBy,x=a.position,j=a.reverseDirection,N=a.useTranslate3d,S=a.viewBox,k=a.wrapperStyle,C=b??[];m&&C.length&&(C=XF(b.filter(function(T){return T.value!=null&&(T.hide!==!0||n.props.includeHidden)}),y,jle));var A=C.length>0;return U.createElement(hle,{allowEscapeViewBox:o,animationDuration:l,animationEasing:u,isAnimationActive:p,active:i,coordinate:h,hasPayload:A,offset:v,position:x,reverseDirection:j,useTranslate3d:N,viewBox:S,wrapperStyle:k},Nle(d,pI(pI({},this.props),{},{payload:C})))}}])})(w.PureComponent);hk(vs,"displayName","Tooltip");hk(vs,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ad.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var R_,gI;function Sle(){if(gI)return R_;gI=1;var t=Rs(),e=function(){return t.Date.now()};return R_=e,R_}var I_,vI;function Cle(){if(vI)return I_;vI=1;var t=/\s/;function e(r){for(var n=r.length;n--&&t.test(r.charAt(n)););return n}return I_=e,I_}var D_,xI;function kle(){if(xI)return D_;xI=1;var t=Cle(),e=/^\s+/;function r(n){return n&&n.slice(0,t(n)+1).replace(e,"")}return D_=r,D_}var $_,yI;function oB(){if(yI)return $_;yI=1;var t=kle(),e=ko(),r=ed(),n=NaN,a=/^[-+]0x[0-9a-f]+$/i,i=/^0b[01]+$/i,o=/^0o[0-7]+$/i,l=parseInt;function u(d){if(typeof d=="number")return d;if(r(d))return n;if(e(d)){var h=typeof d.valueOf=="function"?d.valueOf():d;d=e(h)?h+"":h}if(typeof d!="string")return d===0?d:+d;d=t(d);var m=i.test(d);return m||o.test(d)?l(d.slice(2),m?2:8):a.test(d)?n:+d}return $_=u,$_}var L_,bI;function Ele(){if(bI)return L_;bI=1;var t=ko(),e=Sle(),r=oB(),n="Expected a function",a=Math.max,i=Math.min;function o(l,u,d){var h,m,p,v,b,y,x=0,j=!1,N=!1,S=!0;if(typeof l!="function")throw new TypeError(n);u=r(u)||0,t(d)&&(j=!!d.leading,N="maxWait"in d,p=N?a(r(d.maxWait)||0,u):p,S="trailing"in d?!!d.trailing:S);function k(H){var Z=h,te=m;return h=m=void 0,x=H,v=l.apply(te,Z),v}function C(H){return x=H,b=setTimeout(R,u),j?k(H):v}function A(H){var Z=H-y,te=H-x,G=u-Z;return N?i(G,p-te):G}function T(H){var Z=H-y,te=H-x;return y===void 0||Z>=u||Z<0||N&&te>=p}function R(){var H=e();if(T(H))return I(H);b=setTimeout(R,A(H))}function I(H){return b=void 0,S&&h?k(H):(h=m=void 0,v)}function D(){b!==void 0&&clearTimeout(b),x=0,h=y=m=b=void 0}function L(){return b===void 0?v:I(e())}function z(){var H=e(),Z=T(H);if(h=arguments,m=this,y=H,Z){if(b===void 0)return C(y);if(N)return clearTimeout(b),b=setTimeout(R,u),k(y)}return b===void 0&&(b=setTimeout(R,u)),v}return z.cancel=D,z.flush=L,z}return L_=o,L_}var F_,wI;function Ale(){if(wI)return F_;wI=1;var t=Ele(),e=ko(),r="Expected a function";function n(a,i,o){var l=!0,u=!0;if(typeof a!="function")throw new TypeError(r);return e(o)&&(l="leading"in o?!!o.leading:l,u="trailing"in o?!!o.trailing:u),t(a,i,{leading:l,maxWait:i,trailing:u})}return F_=n,F_}var Ple=Ale();const lB=Ft(Ple);function Jf(t){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jf(t)}function _I(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Dp(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_I(Object(r),!0).forEach(function(n){Tle(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_I(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Tle(t,e,r){return e=Ole(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ole(t){var e=Mle(t,"string");return Jf(e)=="symbol"?e:e+""}function Mle(t,e){if(Jf(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Jf(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Rle(t,e){return Lle(t)||$le(t,e)||Dle(t,e)||Ile()}function Ile(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 710In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dle(t,e){if(t){if(typeof t=="string")return jI(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jI(t,e)}}function jI(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $le(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function Lle(t){if(Array.isArray(t))return t}var Fle=w.forwardRef(function(t,e){var r=t.aspect,n=t.initialDimension,a=n===void 0?{width:-1,height:-1}:n,i=t.width,o=i===void 0?"100%":i,l=t.height,u=l===void 0?"100%":l,d=t.minWidth,h=d===void 0?0:d,m=t.minHeight,p=t.maxHeight,v=t.children,b=t.debounce,y=b===void 0?0:b,x=t.id,j=t.className,N=t.onResize,S=t.style,k=S===void 0?{}:S,C=w.useRef(null),A=w.useRef();A.current=N,w.useImperativeHandle(e,function(){return Object.defineProperty(C.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),C.current},configurable:!0})});var T=w.useState({containerWidth:a.width,containerHeight:a.height}),R=Rle(T,2),I=R[0],D=R[1],L=w.useCallback(function(H,Z){D(function(te){var G=Math.round(H),M=Math.round(Z);return te.containerWidth===G&&te.containerHeight===M?te:{containerWidth:G,containerHeight:M}})},[]);w.useEffect(function(){var H=function(K){var B,O=K[0].contentRect,W=O.width,q=O.height;L(W,q),(B=A.current)===null||B===void 0||B.call(A,W,q)};y>0&&(H=lB(H,y,{trailing:!0,leading:!1}));var Z=new ResizeObserver(H),te=C.current.getBoundingClientRect(),G=te.width,M=te.height;return L(G,M),Z.observe(C.current),function(){Z.disconnect()}},[L,y]);var z=w.useMemo(function(){var H=I.containerWidth,Z=I.containerHeight;if(H<0||Z<0)return null;ii(fl(o)||fl(u),`The width(%s) and height(%s) are both fixed numbers, 711 maybe you don't need to use a ResponsiveContainer.`,o,u),ii(!r||r>0,"The aspect(%s) must be greater than zero.",r);var te=fl(o)?H:o,G=fl(u)?Z:u;r&&r>0&&(te?G=te/r:G&&(te=G*r),p&&G>p&&(G=p)),ii(te>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0, 712 please check the style of container, or the props width(%s) and height(%s), 713 or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the 714 height and width.`,te,G,o,u,h,m,r);var M=!Array.isArray(v)&&si(v.type).endsWith("Chart");return U.Children.map(v,function(F){return U.isValidElement(F)?w.cloneElement(F,Dp({width:te,height:G},M?{style:Dp({height:"100%",width:"100%",maxHeight:G,maxWidth:te},F.props.style)}:{})):F})},[r,v,u,p,m,h,I,o]);return U.createElement("div",{id:x?"".concat(x):void 0,className:Ct("recharts-responsive-container",j),style:Dp(Dp({},k),{},{width:o,height:u,minWidth:h,minHeight:m,maxHeight:p}),ref:C},z)}),cB=function(e){return null};cB.displayName="Cell";function eh(t){"@babel/helpers - typeof";return eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eh(t)}function NI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function mS(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?NI(Object(r),!0).forEach(function(n){Ble(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):NI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ble(t,e,r){return e=Vle(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Vle(t){var e=zle(t,"string");return eh(e)=="symbol"?e:e+""}function zle(t,e){if(eh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(eh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var _c={widthCache:{},cacheCount:0},Ule=2e3,qle={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},SI="recharts_measurement_span";function Wle(t){var e=mS({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var Af=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||ad.isSsr)return{width:0,height:0};var n=Wle(r),a=JSON.stringify({text:e,copyStyle:n});if(_c.widthCache[a])return _c.widthCache[a];try{var i=document.getElementById(SI);i||(i=document.createElement("span"),i.setAttribute("id",SI),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=mS(mS({},qle),n);Object.assign(i.style,o),i.textContent="".concat(e);var l=i.getBoundingClientRect(),u={width:l.width,height:l.height};return _c.widthCache[a]=u,++_c.cacheCount>Ule&&(_c.cacheCount=0,_c.widthCache={}),u}catch{return{width:0,height:0}}},Hle=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function th(t){"@babel/helpers - typeof";return th=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},th(t)}function Wg(t,e){return Xle(t)||Yle(t,e)||Kle(t,e)||Gle()}function Gle(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 715In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kle(t,e){if(t){if(typeof t=="string")return CI(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return CI(t,e)}}function CI(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Yle(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function Xle(t){if(Array.isArray(t))return t}function Zle(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kI(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Jle(n.key),n)}}function Qle(t,e,r){return e&&kI(t.prototype,e),r&&kI(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Jle(t){var e=ece(t,"string");return th(e)=="symbol"?e:e+""}function ece(t,e){if(th(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(th(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var EI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,AI=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,tce=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,rce=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,uB={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},nce=Object.keys(uB),Bc="NaN";function ace(t,e){return t*uB[e]}var $p=(function(){function t(e,r){Zle(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!tce.test(r)&&(this.num=NaN,this.unit=""),nce.includes(r)&&(this.num=ace(e,r),this.unit="px")}return Qle(t,[{key:"add",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,a=(n=rce.exec(r))!==null&&n!==void 0?n:[],i=Wg(a,3),o=i[1],l=i[2];return new t(parseFloat(o),l??"")}}])})();function dB(t){if(t.includes(Bc))return Bc;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=EI.exec(e))!==null&&r!==void 0?r:[],a=Wg(n,4),i=a[1],o=a[2],l=a[3],u=$p.parse(i??""),d=$p.parse(l??""),h=o==="*"?u.multiply(d):u.divi
715de(d);if(h.isNaN())return Bc;e=e.replace(EI,h.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var m,p=(m=AI.exec(e))!==null&&m!==void 0?m:[],v=Wg(p,4),b=v[1],y=v[2],x=v[3],j=$p.parse(b??""),N=$p.parse(x??""),S=y==="+"?j.add(N):j.subtract(N);if(S.isNaN())return Bc;e=e.replace(AI,S.toString())}return e}var PI=/\(([^()]*)\)/;function sce(t){for(var e=t;e.includes("(");){var r=PI.exec(e),n=Wg(r,2),a=n[1];e=e.replace(PI,dB(a))}return e}function ice(t){var e=t.replace(/\s+/g,"");return e=sce(e),e=dB(e),e}function oce(t){try{return ice(t)}catch{return Bc}}function B_(t){var e=oce(t.slice(5,-1));return e===Bc?"":e}var lce=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],cce=["dx","dy","angle","className","breakAll"];function pS(){return pS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},pS.apply(this,arguments)}function TI(t,e){if(t==null)return{};var r=uce(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function uce(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function OI(t,e){return mce(t)||hce(t,e)||fce(t,e)||dce()}function dce(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 716In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fce(t,e){if(t){if(typeof t=="string")return MI(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MI(t,e)}}function MI(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hce(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function mce(t){if(Array.isArray(t))return t}var fB=/[ \f\n\r\t\v\u2028\u2029]+/,hB=function(e){var r=e.children,n=e.breakAll,a=e.style;try{var i=[];St(r)||(n?i=r.toString().split(""):i=r.toString().split(fB));var o=i.map(function(u){return{word:u,width:Af(u,a).width}}),l=n?0:Af(" ",a).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},pce=function(e,r,n,a,i){var o=e.maxLines,l=e.children,u=e.style,d=e.breakAll,h=De(o),m=l,p=function(){var te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return te.reduce(function(G,M){var F=M.word,K=M.width,B=G[G.length-1];if(B&&(a==null||i||B.width+K+n<Number(a)))B.words.push(F),B.width+=K+n;else{var O={words:[F],width:K};G.push(O)}return G},[])},v=p(r),b=function(te){return te.reduce(function(G,M){return G.width>M.width?G:M})};if(!h)return v;for(var y="â¦",x=function(te){var G=m.slice(0,te),M=hB({breakAll:d,style:u,children:G+y}).wordsWithComputedWidth,F=p(M),K=F.length>o||b(F).width>Number(a);return[K,F]},j=0,N=m.length-1,S=0,k;j<=N&&S<=m.length-1;){var C=Math.floor((j+N)/2),A=C-1,T=x(A),R=OI(T,2),I=R[0],D=R[1],L=x(C),z=OI(L,1),H=z[0];if(!I&&!H&&(j=C+1),I&&H&&(N=C-1),!I&&H){k=D;break}S++}return k||v},RI=function(e){var r=St(e)?[]:e.toString().split(fB);return[{words:r}]},gce=function(e){var r=e.width,n=e.scaleToFit,a=e.children,i=e.style,o=e.breakAll,l=e.maxLines;if((r||n)&&!ad.isSsr){var u,d,h=hB({breakAll:o,children:a,style:i});if(h){var m=h.wordsWithComputedWidth,p=h.spaceWidth;u=m,d=p}else return RI(a);return pce({breakAll:o,children:a,maxLines:l,style:i},u,d,r,n)}return RI(a)},II="#808080",Hg=function(e){var r=e.x,n=r===void 0?0:r,a=e.y,i=a===void 0?0:a,o=e.lineHeight,l=o===void 0?"1em":o,u=e.capHeight,d=u===void 0?"0.71em":u,h=e.scaleToFit,m=h===void 0?!1:h,p=e.textAnchor,v=p===void 0?"start":p,b=e.verticalAnchor,y=b===void 0?"end":b,x=e.fill,j=x===void 0?II:x,N=TI(e,lce),S=w.useMemo(function(){return gce({breakAll:N.breakAll,children:N.children,maxLines:N.maxLines,scaleToFit:m,style:N.style,width:N.width})},[N.breakAll,N.children,N.maxLines,m,N.style,N.width]),k=N.dx,C=N.dy,A=N.angle,T=N.className,R=N.breakAll,I=TI(N,cce);if(!Mr(n)||!Mr(i))return null;var D=n+(De(k)?k:0),L=i+(De(C)?C:0),z;switch(y){case"start":z=B_("calc(".concat(d,")"));break;case"middle":z=B_("calc(".concat((S.length-1)/2," * -").concat(l," + (").concat(d," / 2))"));break;default:z=B_("calc(".concat(S.length-1," * -").concat(l,")"));break}var H=[];if(m){var Z=S[0].width,te=N.width;H.push("scale(".concat((De(te)?te/Z:1)/Z,")"))}return A&&H.push("rotate(".concat(A,", ").concat(D,", ").concat(L,")")),H.length&&(I.transform=H.join(" ")),U.createElement("text",pS({},jt(I,!0),{x:D,y:L,className:Ct("recharts-text",T),textAnchor:v,fill:j.includes("url")?II:j}),S.map(function(G,M){var F=G.words.join(R?"":" ");return U.createElement("tspan",{x:D,dy:M===0?z:l,key:"".concat(F,"-").concat(M)},F)}))};function co(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function vce(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function mk(t){let e,r,n;t.length!==2?(e=co,r=(l,u)=>co(t(l),u),n=(l,u)=>t(l)-u):(e=t===co||t===vce?t:xce,r=t,n=t);function a(l,u,d=0,h=l.length){if(d<h){if(e(u,u)!==0)return h;do{const m=d+h>>>1;r(l[m],u)<0?d=m+1:h=m}while(d<h)}return d}function i(l,u,d=0,h=l.length){if(d<h){if(e(u,u)!==0)return h;do{const m=d+h>>>1;r(l[m],u)<=0?d=m+1:h=m}while(d<h)}return d}function o(l,u,d=0,h=l.length){const m=a(l,u,d,h-1);return m>d&&n(l[m-1],u)>-n(l[m],u)?m-1:m}return{left:a,center:o,right:i}}function xce(){return 0}function mB(t){return t===null?NaN:+t}function*yce(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const bce=mk(co),Hh=bce.right;mk(mB).center;class DI extends Map{constructor(e,r=jce){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,a]of e)this.set(n,a)}get(e){return super.get($I(this,e))}has(e){return super.has($I(this,e))}set(e,r){return super.set(wce(this,e),r)}delete(e){return super.delete(_ce(this,e))}}function $I({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function wce({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function _ce({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function jce(t){return t!==null&&typeof t=="object"?t.valueOf():t}function Nce(t=co){if(t===co)return pB;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||n===0?n:(t(r,r)===0)-(t(e,e)===0)}}function pB(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const Sce=Math.sqrt(50),Cce=Math.sqrt(10),kce=Math.sqrt(2);function Gg(t,e,r){const n=(e-t)/Math.max(0,r),a=Math.floor(Math.log10(n)),i=n/Math.pow(10,a),o=i>=Sce?10:i>=Cce?5:i>=kce?2:1;let l,u,d;return a<0?(d=Math.pow(10,-a)/o,l=Math.round(t*d),u=Math.round(e*d),l/d<t&&++l,u/d>e&&--u,d=-d):(d=Math.pow(10,a)*o,l=Math.round(t/d),u=Math.round(e/d),l*d<t&&++l,u*d>e&&--u),u<l&&.5<=r&&r<2?Gg(t,e,r*2):[l,u,d]}function gS(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[a,i,o]=n?Gg(e,t,r):Gg(t,e,r);
716if(!(i>=a))return[];const l=i-a+1,u=new Array(l);if(n)if(o<0)for(let d=0;d<l;++d)u[d]=(i-d)/-o;else for(let d=0;d<l;++d)u[d]=(i-d)*o;else if(o<0)for(let d=0;d<l;++d)u[d]=(a+d)/-o;else for(let d=0;d<l;++d)u[d]=(a+d)*o;return u}function vS(t,e,r){return e=+e,t=+t,r=+r,Gg(t,e,r)[2]}function xS(t,e,r){e=+e,t=+t,r=+r;const n=e<t,a=n?vS(e,t,r):vS(t,e,r);return(n?-1:1)*(a<0?1/-a:a)}function LI(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function FI(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function gB(t,e,r=0,n=1/0,a){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(a=a===void 0?pB:Nce(a);n>r;){if(n-r>600){const u=n-r+1,d=e-r+1,h=Math.log(u),m=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*m*(u-m)/u)*(d-u/2<0?-1:1),v=Math.max(r,Math.floor(e-d*m/u+p)),b=Math.min(n,Math.floor(e+(u-d)*m/u+p));gB(t,e,v,b,a)}const i=t[e];let o=r,l=n;for(ef(t,r,e),a(t[n],i)>0&&ef(t,r,n);o<l;){for(ef(t,o,l),++o,--l;a(t[o],i)<0;)++o;for(;a(t[l],i)>0;)--l}a(t[r],i)===0?ef(t,r,l):(++l,ef(t,l,n)),l<=e&&(r=l+1),e<=l&&(n=l-1)}return t}function ef(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function Ece(t,e,r){if(t=Float64Array.from(yce(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return FI(t);if(e>=1)return LI(t);var n,a=(n-1)*e,i=Math.floor(a),o=LI(gB(t,i).subarray(0,i+1)),l=FI(t.subarray(i+1));return o+(l-o)*(a-i)}}function Ace(t,e,r=mB){if(!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,a=(n-1)*e,i=Math.floor(a),o=+r(t[i],i,t),l=+r(t[i+1],i+1,t);return o+(l-o)*(a-i)}}function Pce(t,e,r){t=+t,e=+e,r=(a=arguments.length)<2?(e=t,t=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((e-t)/r))|0,i=new Array(a);++n<a;)i[n]=t+n*r;return i}function Sa(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function _i(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const yS=Symbol("implicit");function pk(){var t=new DI,e=[],r=[],n=yS;function a(i){let o=t.get(i);if(o===void 0){if(n!==yS)return n;t.set(i,o=e.push(i)-1)}return r[o%r.length]}return a.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new DI;for(const o of i)t.has(o)||t.set(o,e.push(o)-1);return a},a.range=function(i){return arguments.length?(r=Array.from(i),a):r.slice()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return pk(e,r).unknown(n)},Sa.apply(a,arguments),a}function rh(){var t=pk().unknown(void 0),e=t.domain,r=t.range,n=0,a=1,i,o,l=!1,u=0,d=0,h=.5;delete t.unknown;function m(){var p=e().length,v=a<n,b=v?a:n,y=v?n:a;i=(y-b)/Math.max(1,p-u+d*2),l&&(i=Math.floor(i)),b+=(y-b-i*(p-u))*h,o=i*(1-u),l&&(b=Math.round(b),o=Math.round(o));var x=Pce(p).map(function(j){return b+i*j});return r(v?x.reverse():x)}return t.domain=function(p){return arguments.length?(e(p),m()):e()},t.range=function(p){return arguments.length?([n,a]=p,n=+n,a=+a,m()):[n,a]},t.rangeRound=function(p){return[n,a]=p,n=+n,a=+a,l=!0,m()},t.bandwidth=function(){return o},t.step=function(){return i},t.round=function(p){return arguments.length?(l=!!p,m()):l},t.padding=function(p){return arguments.length?(u=Math.min(1,d=+p),m()):u},t.paddingInner=function(p){return arguments.length?(u=Math.min(1,p),m()):u},t.paddingOuter=function(p){return arguments.length?(d=+p,m()):d},t.align=function(p){return arguments.length?(h=Math.max(0,Math.min(1,p)),m()):h},t.copy=function(){return rh(e(),[n,a]).round(l).paddingInner(u).paddingOuter(d).align(h)},Sa.apply(m(),arguments)}function vB(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return vB(e())},t}function Pf(){return vB(rh.apply(null,arguments).paddingInner(1))}function gk(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function xB(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Gh(){}var nh=.7,Kg=1/nh,Xc="\\s*([+-]?\\d+)\\s*",ah="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Cs="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Tce=/^#([0-9a-f]{3,8})$/,Oce=new RegExp(`^rgb\\(${Xc},${Xc},${Xc}\\)$`),Mce=new RegExp(`^rgb\\(${Cs},${Cs},${Cs}\\)$`),Rce=new RegExp(`^rgba\\(${Xc},${Xc},${Xc},${ah}\\)$`),Ice=new RegExp(`^rgba\\(${Cs},${Cs},${Cs},${ah}\\)$`),Dce=new RegExp(`^hsl\\(${ah},${Cs},${Cs}\\)$`),$ce=new RegExp(`^hsla\\(${ah},${Cs},${Cs},${ah}\\)$`),BI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};gk(Gh,sh,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:VI,formatHex:VI,formatHex8:Lce,formatHsl:Fce,formatRgb:zI,toString:zI});function VI(){return this.rgb().formatHex()}function Lce(){return this.rgb().formatHex8()}function Fce(){return yB(this).formatHsl()}function zI(){return this.rgb().formatRgb()}function sh(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=Tce.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?UI(e):r===3?new An(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?Lp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?Lp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=Oce.exec(t))?new An(e[1],e[2],e[3],1):(e=Mce.exec(t))?new An(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=
vendor: 4,693 bytes, line 716
716Rce.exec(t))?Lp(e[1],e[2],e[3],e[4]):(e=Ice.exec(t))?Lp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Dce.exec(t))?HI(e[1],e[2]/100,e[3]/100,1):(e=$ce.exec(t))?HI(e[1],e[2]/100,e[3]/100,e[4]):BI.hasOwnProperty(t)?UI(BI[t]):t==="transparent"?new An(NaN,NaN,NaN,0):null}function UI(t){return new An(t>>16&255,t>>8&255,t&255,1)}function Lp(t,e,r,n){return n<=0&&(t=e=r=NaN),new An(t,e,r,n)}function Bce(t){return t instanceof Gh||(t=sh(t)),t?(t=t.rgb(),new An(t.r,t.g,t.b,t.opacity)):new An}function bS(t,e,r,n){return arguments.length===1?Bce(t):new An(t,e,r,n??1)}function An(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}gk(An,bS,xB(Gh,{brighter(t){return t=t==null?Kg:Math.pow(Kg,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?nh:Math.pow(nh,t),new An(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new An(_l(this.r),_l(this.g),_l(this.b),Yg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qI,formatHex:qI,formatHex8:Vce,formatRgb:WI,toString:WI}));function qI(){return`#${hl(this.r)}${hl(this.g)}${hl(this.b)}`}function Vce(){return`#${hl(this.r)}${hl(this.g)}${hl(this.b)}${hl((isNaN(this.opacity)?1:this.opacity)*255)}`}function WI(){const t=Yg(this.opacity);return`${t===1?"rgb(":"rgba("}${_l(this.r)}, ${_l(this.g)}, ${_l(this.b)}${t===1?")":`, ${t})`}`}function Yg(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function _l(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function hl(t){return t=_l(t),(t<16?"0":"")+t.toString(16)}function HI(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new Xa(t,e,r,n)}function yB(t){if(t instanceof Xa)return new Xa(t.h,t.s,t.l,t.opacity);if(t instanceof Gh||(t=sh(t)),!t)return new Xa;if(t instanceof Xa)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,a=Math.min(e,r,n),i=Math.max(e,r,n),o=NaN,l=i-a,u=(i+a)/2;return l?(e===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-e)/l+2:o=(e-r)/l+4,l/=u<.5?i+a:2-i-a,o*=60):l=u>0&&u<1?0:o,new Xa(o,l,u,t.opacity)}function zce(t,e,r,n){return arguments.length===1?yB(t):new Xa(t,e,r,n??1)}function Xa(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}gk(Xa,zce,xB(Gh,{brighter(t){return t=t==null?Kg:Math.pow(Kg,t),new Xa(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?nh:Math.pow(nh,t),new Xa(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,a=2*r-n;return new An(V_(t>=240?t-240:t+120,a,n),V_(t,a,n),V_(t<120?t+240:t-120,a,n),this.opacity)},clamp(){return new Xa(GI(this.h),Fp(this.s),Fp(this.l),Yg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=Yg(this.opacity);return`${t===1?"hsl(":"hsla("}${GI(this.h)}, ${Fp(this.s)*100}%, ${Fp(this.l)*100}%${t===1?")":`, ${t})`}`}}));function GI(t){return t=(t||0)%360,t<0?t+360:t}function Fp(t){return Math.max(0,Math.min(1,t||0))}function V_(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const vk=t=>()=>t;function Uce(t,e){return function(r){return t+r*e}}function qce(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Wce(t){return(t=+t)==1?bB:function(e,r){return r-e?qce(e,r,t):vk(isNaN(e)?r:e)}}function bB(t,e){var r=e-t;return r?Uce(t,r):vk(isNaN(t)?e:t)}const KI=(function t(e){var r=Wce(e);function n(a,i){var o=r((a=bS(a)).r,(i=bS(i)).r),l=r(a.g,i.g),u=r(a.b,i.b),d=bB(a.opacity,i.opacity);return function(h){return a.r=o(h),a.g=l(h),a.b=u(h),a.opacity=d(h),a+""}}return n.gamma=t,n})(1);function Hce(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),a;return function(i){for(a=0;a<r;++a)n[a]=t[a]*(1-i)+e[a]*i;return n}}function Gce(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Kce(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,a=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)a[o]=sd(t[o],e[o]);for(;o<r;++o)i[o]=e[o];return function(l){for(o=0;o<n;++o)i[o]=a[o](l);return i}}function Yce(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function Xg(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function Xce(t,e){var r={},n={},a;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(a in e)a in t?r[a]=sd(t[a],e[a]):n[a]=e[a];return function(i){for(a in r)n[a]=r[a](i);return n}}var wS=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,z_=new RegExp(wS.source,"g");function Zce(t){return function(){return t}}function Qce(t){return function(e){return t(e)+""}}
vendor: 9,353 bytes, line 716
716function Jce(t,e){var r=wS.lastIndex=z_.lastIndex=0,n,a,i,o=-1,l=[],u=[];for(t=t+"",e=e+"";(n=wS.exec(t))&&(a=z_.exec(e));)(i=a.index)>r&&(i=e.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(a=a[0])?l[o]?l[o]+=a:l[++o]=a:(l[++o]=null,u.push({i:o,x:Xg(n,a)})),r=z_.lastIndex;return r<e.length&&(i=e.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?u[0]?Qce(u[0].x):Zce(e):(e=u.length,function(d){for(var h=0,m;h<e;++h)l[(m=u[h]).i]=m.x(d);return l.join("")})}function sd(t,e){var r=typeof e,n;return e==null||r==="boolean"?vk(e):(r==="number"?Xg:r==="string"?(n=sh(e))?(e=n,KI):Jce:e instanceof sh?KI:e instanceof Date?Yce:Gce(e)?Hce:Array.isArray(e)?Kce:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?Xce:Xg)(t,e)}function xk(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function eue(t,e){e===void 0&&(e=t,t=sd);for(var r=0,n=e.length-1,a=e[0],i=new Array(n<0?0:n);r<n;)i[r]=t(a,a=e[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function tue(t){return function(){return t}}function Zg(t){return+t}var YI=[0,1];function gn(t){return t}function _S(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:tue(isNaN(e)?NaN:.5)}function rue(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function nue(t,e,r){var n=t[0],a=t[1],i=e[0],o=e[1];return a<n?(n=_S(a,n),i=r(o,i)):(n=_S(n,a),i=r(i,o)),function(l){return i(n(l))}}function aue(t,e,r){var n=Math.min(t.length,e.length)-1,a=new Array(n),i=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)a[o]=_S(t[o],t[o+1]),i[o]=r(e[o],e[o+1]);return function(l){var u=Hh(t,l,1,n)-1;return i[u](a[u](l))}}function Kh(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function j0(){var t=YI,e=YI,r=sd,n,a,i,o=gn,l,u,d;function h(){var p=Math.min(t.length,e.length);return o!==gn&&(o=rue(t[0],t[p-1])),l=p>2?aue:nue,u=d=null,m}function m(p){return p==null||isNaN(p=+p)?i:(u||(u=l(t.map(n),e,r)))(n(o(p)))}return m.invert=function(p){return o(a((d||(d=l(e,t.map(n),Xg)))(p)))},m.domain=function(p){return arguments.length?(t=Array.from(p,Zg),h()):t.slice()},m.range=function(p){return arguments.length?(e=Array.from(p),h()):e.slice()},m.rangeRound=function(p){return e=Array.from(p),r=xk,h()},m.clamp=function(p){return arguments.length?(o=p?!0:gn,h()):o!==gn},m.interpolate=function(p){return arguments.length?(r=p,h()):r},m.unknown=function(p){return arguments.length?(i=p,m):i},function(p,v){return n=p,a=v,h()}}function yk(){return j0()(gn,gn)}function sue(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function Qg(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function xu(t){return t=Qg(Math.abs(t)),t?t[1]:NaN}function iue(t,e){return function(r,n){for(var a=r.length,i=[],o=0,l=t[0],u=0;a>0&&l>0&&(u+l+1>n&&(l=Math.max(1,n-u)),i.push(r.substring(a-=l,a+l)),!((u+=l+1)>n));)l=t[o=(o+1)%t.length];return i.reverse().join(e)}}function oue(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var lue=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function ih(t){if(!(e=lue.exec(t)))throw new Error("invalid format: "+t);var e;return new bk({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}ih.prototype=bk.prototype;function bk(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}bk.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function cue(t){e:for(var e=t.length,r=1,n=-1,a;r<e;++r)switch(t[r]){case".":n=a=r;break;case"0":n===0&&(n=r),a=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(a+1):t}var wB;function uue(t,e){var r=Qg(t,e);if(!r)return t+"";var n=r[0],a=r[1],i=a-(wB=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Qg(t,Math.max(0,e+i-1))[0]}function XI(t,e){var r=Qg(t,e);if(!r)return t+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const ZI={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:sue,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>XI(t*100,e),r:XI,s:uue,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function QI(t){return t}var JI=Array.prototype.map,e3=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function due(t){var e=t.grouping===void 0||t.thousands===void 0?QI:iue(JI.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",a=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?QI:oue(JI.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"â":t.minus+"",u=t.nan===void 0?"NaN":t.nan+"";function d(m){m=ih(m);var p=m.fill,v=m.align,b=m.sign,y=m.symbol,x=m.zero,j=m.width,N=m.comma,S=m.precision,k=m.trim,C=m.type;C==="n"?(N=!0,C="g"):ZI[C]||(S===void 0&&(S=12),k=!0,C="g"),(x||p==="0"&&v==="=")&&(x=!0,p="0",v="=");var A=y==="$"?r:y==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():"",T=y==="$"?n:/[%p]/.test(C)?o:"",R=ZI[C],I=/[defgprs%]/.test(C);S=S===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function D(L){var z=A,H=T,Z,te,G;if(C==="c")H=R(L)+H,L="";else{L=+L;var M=L<0||1/L<0;if(L=isNaN(L)?u:R(Math.abs(L),S),k&&(L=cue(L)),M&&+L==0&&b!=="+"&&(M=!1),z=(M?b==="("?b:l:b==="-"||b==="("?"":b)+z,H=(C==="s"?e3[8+wB/3]:"")+H+(M&&b==="("?")":""),I){for(Z=-1,te=L.length;++Z<te;)if(G=L.charCodeAt(Z),48>G||G>57){H=(G===46?a+L.slice(Z+1):L.slice(Z))+H,L=L.slice(0,Z);break}}}N&&!x&&(L=e(L,1/0));var F=z.length+L.length+H.length,K=F<j?new Array(j-F+1).join(p):"";switch(N&&x&&(L=e(K+L,K.length?j-H.length:1/0),K=""),v){case"<":L=z+L+H+K;break;case"=":L=z+K+L+H;break;case"^":L=K.slice(0,F=K.length>>1)+z+L+H+K.slice(F);break;default:L=K+z+L+H;break}return i(L)}return D.toString=function(){return m+""},D}function h(m,p){var v=d((m=ih(m),m.type="f",m)),b=Math.max(-8,Math.min(8,Math.floor(xu(p)/3)))*3,y=Math.pow(10,-b),x=e3[8+b/3];return function(j){return v(y*j)+x}}return{format:d,formatPrefix:h}}var Bp,wk,_B;fue({thousands:",",grouping:[3],currency:["$",""]});function fue(t){return Bp=due(t),wk=Bp.format,_B=Bp.formatPrefix,Bp}function hue(t){return Math.max(0,-xu(Math.abs(t)))}function mue(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(xu(e)/3)))*3-xu(Math.abs(t)))}function pue(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,xu(e)-xu(t))+1}function jB(t,e,r,n){var a=xS(t,e,r),i;switch(n=ih(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(i=mue(a,o))&&(n.precision=i),_B(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=pue(a,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=hue(a))&&(n.precision=i-(n.type==="%")*2);break}}return wk(n)}function Ao(t){var e=t.domain;return t.ticks=function(r){var n=e();return gS(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var a=e();return jB(a[0],a[a.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),a=0,i=n.length-1,o=n[a],l=n[i],u,d,h=10;for(l<o&&(d=o,o=l,l=d,d=a,a=i,i=d);h-- >0;){if(d=vS(o,l,r),d===u)return n[a]=o,n[i]=l,e(n);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;u=d}return t},t}function Jg(){var t=yk();return t.copy=function(){return Kh(t,Jg())},Sa.apply(t,arguments),Ao(t)}function NB(t){var e;function r(n){return n==null||isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=Array.from(n,Zg),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return NB(t).unknown(e)},t=arguments.length?Array.from(t,Zg):[0,1],Ao(r)}function SB(t,e){t=t.slice();var r=0,n=t.length-1,a=t[r],i=t[n],o;return i<a&&(o=r,r=n,n=o,o=a,a=i,i=o),t[r]=e.floor(a),t[n]=e.ceil(i),t}function t3(t){return Math.log(t)}function r3(t){return Math.exp(t)}function gue(t){return-Math.log(-t)}function vue(t){return-Math.exp(-t)}function xue(t){return isFinite(t)?+("1e"+t):t<0?0:t}function yue(t){return t===10?xue:t===Math.E?Math.exp:e=>Math.pow(t,e)}function bue(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function n3(t){return(e,r)=>-t(-e,r)}function _k(t){const e=t(t3,r3),r=e.domain;let n=10,a,i;
vendor: 5,086 bytes, line 716
716function o(){return a=bue(n),i=yue(n),r()[0]<0?(a=n3(a),i=n3(i),t(gue,vue)):t(t3,r3),e}return e.base=function(l){return arguments.length?(n=+l,o()):n},e.domain=function(l){return arguments.length?(r(l),o()):r()},e.ticks=l=>{const u=r();let d=u[0],h=u[u.length-1];const m=h<d;m&&([d,h]=[h,d]);let p=a(d),v=a(h),b,y;const x=l==null?10:+l;let j=[];if(!(n%1)&&v-p<x){if(p=Math.floor(p),v=Math.ceil(v),d>0){for(;p<=v;++p)for(b=1;b<n;++b)if(y=p<0?b/i(-p):b*i(p),!(y<d)){if(y>h)break;j.push(y)}}else for(;p<=v;++p)for(b=n-1;b>=1;--b)if(y=p>0?b/i(-p):b*i(p),!(y<d)){if(y>h)break;j.push(y)}j.length*2<x&&(j=gS(d,h,x))}else j=gS(p,v,Math.min(v-p,x)).map(i);return m?j.reverse():j},e.tickFormat=(l,u)=>{if(l==null&&(l=10),u==null&&(u=n===10?"s":","),typeof u!="function"&&(!(n%1)&&(u=ih(u)).precision==null&&(u.trim=!0),u=wk(u)),l===1/0)return u;const d=Math.max(1,n*l/e.ticks().length);return h=>{let m=h/i(Math.round(a(h)));return m*n<n-.5&&(m*=n),m<=d?u(h):""}},e.nice=()=>r(SB(r(),{floor:l=>i(Math.floor(a(l))),ceil:l=>i(Math.ceil(a(l)))})),e}function CB(){const t=_k(j0()).domain([1,10]);return t.copy=()=>Kh(t,CB()).base(t.base()),Sa.apply(t,arguments),t}function a3(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function s3(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function jk(t){var e=1,r=t(a3(e),s3(e));return r.constant=function(n){return arguments.length?t(a3(e=+n),s3(e)):e},Ao(r)}function kB(){var t=jk(j0());return t.copy=function(){return Kh(t,kB()).constant(t.constant())},Sa.apply(t,arguments)}function i3(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function wue(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function _ue(t){return t<0?-t*t:t*t}function Nk(t){var e=t(gn,gn),r=1;function n(){return r===1?t(gn,gn):r===.5?t(wue,_ue):t(i3(r),i3(1/r))}return e.exponent=function(a){return arguments.length?(r=+a,n()):r},Ao(e)}function Sk(){var t=Nk(j0());return t.copy=function(){return Kh(t,Sk()).exponent(t.exponent())},Sa.apply(t,arguments),t}function jue(){return Sk.apply(null,arguments).exponent(.5)}function o3(t){return Math.sign(t)*t*t}function Nue(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function EB(){var t=yk(),e=[0,1],r=!1,n;function a(i){var o=Nue(t(i));return isNaN(o)?n:r?Math.round(o):o}return a.invert=function(i){return t.invert(o3(i))},a.domain=function(i){return arguments.length?(t.domain(i),a):t.domain()},a.range=function(i){return arguments.length?(t.range((e=Array.from(i,Zg)).map(o3)),a):e.slice()},a.rangeRound=function(i){return a.range(i).round(!0)},a.round=function(i){return arguments.length?(r=!!i,a):r},a.clamp=function(i){return arguments.length?(t.clamp(i),a):t.clamp()},a.unknown=function(i){return arguments.length?(n=i,a):n},a.copy=function(){return EB(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},Sa.apply(a,arguments),Ao(a)}function AB(){var t=[],e=[],r=[],n;function a(){var o=0,l=Math.max(1,e.length);for(r=new Array(l-1);++o<l;)r[o-1]=Ace(t,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:e[Hh(r,o)]}return i.invertExtent=function(o){var l=e.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:t[0],l<r.length?r[l]:t[t.length-1]]},i.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let l of o)l!=null&&!isNaN(l=+l)&&t.push(l);return t.sort(co),a()},i.range=function(o){return arguments.length?(e=Array.from(o),a()):e.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return AB().domain(t).range(e).unknown(n)},Sa.apply(i,arguments)}function PB(){var t=0,e=1,r=1,n=[.5],a=[0,1],i;function o(u){return u!=null&&u<=u?a[Hh(n,u,0,r)]:i}function l(){var u=-1;for(n=new Array(r);++u<r;)n[u]=((u+1)*e-(u-r)*t)/(r+1);return o}return o.domain=function(u){return arguments.length?([t,e]=u,t=+t,e=+e,l()):[t,e]},o.range=function(u){return arguments.length?(r=(a=Array.from(u)).length-1,l()):a.slice()},o.invertExtent=function(u){var d=a.indexOf(u);return d<0?[NaN,NaN]:d<1?[t,n[0]]:d>=r?[n[r-1],e]:[n[d-1],n[d]]},o.unknown=function(u){return arguments.length&&(i=u),o},o.thresholds=function(){return n.slice()},o.copy=function(){return PB().domain([t,e]).range(a).unknown(i)},Sa.apply(Ao(o),arguments)}function TB(){var t=[.5],e=[0,1],r,n=1;function a(i){return i!=null&&i<=i?e[Hh(t,i,0,n)]:r}return a.domain=function(i){return arguments.length?(t=Array.from(i),n=Math.min(t.length,e.length-1),a):t.slice()},a.range=function(i){return arguments.length?(e=Array.from(i),n=Math.min(t.length,e.length-1),a):e.slice()},a.invertExtent=function(i){var o=e.indexOf(i);return[t[o-1],t[o]]},a.unknown=function(i){return arguments.length?(r=i,a):r},a.copy=function(){return TB().domain(t).range(e).unknown(r)},Sa.apply(a,arguments)}const U_=new Date,q_=new Date;function Rr(t,e,r,n){function a(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return a.floor=i=>(t(i=new Date(+i)),i),a.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),a.round=i=>{const o=a(i),l=a.ceil(i);return i-o<l-i?o:l},a.offset=(i,o)=>(e(i=new Date(+i),o==null?1:Math.floor(o)),i),a.range=(i,o,l)=>{const u=[];
vendor: 10,755 bytes, line 716
716if(i=a.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return u;let d;do u.push(d=new Date(+i)),e(i,l),t(i);while(d<i&&i<o);return u},a.filter=i=>Rr(o=>{if(o>=o)for(;t(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;e(o,-1),!i(o););else for(;--l>=0;)for(;e(o,1),!i(o););}),r&&(a.count=(i,o)=>(U_.setTime(+i),q_.setTime(+o),t(U_),t(q_),Math.floor(r(U_,q_))),a.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?a.filter(n?o=>n(o)%i===0:o=>a.count(0,o)%i===0):a)),a}const ev=Rr(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);ev.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?Rr(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):ev);ev.range;const ti=1e3,ba=ti*60,ri=ba*60,fi=ri*24,Ck=fi*7,l3=fi*30,W_=fi*365,ml=Rr(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*ti)},(t,e)=>(e-t)/ti,t=>t.getUTCSeconds());ml.range;const kk=Rr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ti)},(t,e)=>{t.setTime(+t+e*ba)},(t,e)=>(e-t)/ba,t=>t.getMinutes());kk.range;const Ek=Rr(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*ba)},(t,e)=>(e-t)/ba,t=>t.getUTCMinutes());Ek.range;const Ak=Rr(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ti-t.getMinutes()*ba)},(t,e)=>{t.setTime(+t+e*ri)},(t,e)=>(e-t)/ri,t=>t.getHours());Ak.range;const Pk=Rr(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*ri)},(t,e)=>(e-t)/ri,t=>t.getUTCHours());Pk.range;const Yh=Rr(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ba)/fi,t=>t.getDate()-1);Yh.range;const N0=Rr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/fi,t=>t.getUTCDate()-1);N0.range;const OB=Rr(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/fi,t=>Math.floor(t/fi));OB.range;function ql(t){return Rr(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*ba)/Ck)}const S0=ql(0),tv=ql(1),Sue=ql(2),Cue=ql(3),yu=ql(4),kue=ql(5),Eue=ql(6);S0.range;tv.range;Sue.range;Cue.range;yu.range;kue.range;Eue.range;function Wl(t){return Rr(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/Ck)}const C0=Wl(0),rv=Wl(1),Aue=Wl(2),Pue=Wl(3),bu=Wl(4),Tue=Wl(5),Oue=Wl(6);C0.range;rv.range;Aue.range;Pue.range;bu.range;Tue.range;Oue.range;const Tk=Rr(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());Tk.range;const Ok=Rr(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());Ok.range;const hi=Rr(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());hi.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Rr(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});hi.range;const mi=Rr(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());mi.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:Rr(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});mi.range;function MB(t,e,r,n,a,i){const o=[[ml,1,ti],[ml,5,5*ti],[ml,15,15*ti],[ml,30,30*ti],[i,1,ba],[i,5,5*ba],[i,15,15*ba],[i,30,30*ba],[a,1,ri],[a,3,3*ri],[a,6,6*ri],[a,12,12*ri],[n,1,fi],[n,2,2*fi],[r,1,Ck],[e,1,l3],[e,3,3*l3],[t,1,W_]];function l(d,h,m){const p=h<d;p&&([d,h]=[h,d]);const v=m&&typeof m.range=="function"?m:u(d,h,m),b=v?v.range(d,+h+1):[];return p?b.reverse():b}function u(d,h,m){const p=Math.abs(h-d)/m,v=mk(([,,x])=>x).right(o,p);if(v===o.length)return t.every(xS(d/W_,h/W_,m));if(v===0)return ev.every(Math.max(xS(d,h,m),1));const[b,y]=o[p/o[v-1][2]<o[v][2]/p?v-1:v];return b.every(y)}return[l,u]}const[Mue,Rue]=MB(mi,Ok,C0,OB,Pk,Ek),[Iue,Due]=MB(hi,Tk,S0,Yh,Ak,kk);function H_(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function G_(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function tf(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function $ue(t){var e=t.dateTime,r=t.date,n=t.time,a=t.periods,i=t.days,o=t.shortDays,l=t.months,u=t.shortMonths,d=rf(a),h=nf(a),m=rf(i),p=nf(i),v=rf(o),b=nf(o),y=rf(l),x=nf(l),j=rf(u),N=nf(u),S={a:M,A:F,b:K,B,c:null,d:m3,e:m3,f:ide,g:gde,G:xde,H:nde,I:ade,j:sde,L:RB,m:ode,M:lde,p:O,q:W,Q:v3,s:x3,S:cde,u:ude,U:dde,V:fde,w:hde,W:mde,x:null,X:null,y:pde,Y:vde,Z:yde,"%":g3},k={a:q,A:se,b:me,B:fe,c:null,d:p3,e:p3,f:jde,g:Mde,G:Ide,H:bde,I:wde,j:_de,L:DB,m:Nde,M:Sde,p:Q,q:pe,Q:v3,s:x3,S:Cde,u:kde,U:Ede,V:Ade,w:Pde,W:Tde,x:null,X:null,y:Ode,Y:Rde,Z:Dde,"%":g3},C={a:D,A:L,b:z,B:H,c:Z,d:f3,e:f3,f:Jue,g:d3,G:u3,H:h3,I:h3,j:Yue,L:Que,m:Kue,M:Xue,p:I,q:Gue,Q:tde,s:rde,S:Zue,u:zue,U:Uue,V:que,w:Vue,W:Wue,x:te,X:G,y:d3,Y:u3,Z:Hue,"%":ede};S.x=A(r,S),S.X=A(n,S),S.c=A(e,S),k.x=A(r,k),k.X=A(n,k),k.c=A(e,k);function A(V,J){return function(oe){var re=[],Me=-1,ee=0,ce=V.length,je,de,we;for(oe instanceof Date||(oe=new Date(+oe));++Me<ce;)V.charCodeAt(Me)===37&&(re.push(V.slice(ee,Me)),(de=c3[je=V.charAt(++Me)])!=null?je=V.charAt(++Me):de=je==="e"?" ":"0",(we=J[je])&&(je=we(oe,de)),re.push(je),ee=Me+1);return re.push(V.slice(ee,Me)),re.join("")}}function T(V,J){return function(oe){var re=tf(1900,void 0,1),Me=R(re,V,oe+="",0),ee,ce;if(Me!=oe.length)return null;if("Q"in re)return new Date(re.Q);if("s"in re)return new Date(re.s*1e3+("L"in re?re.L:0));if(J&&!("Z"in re)&&(re.Z=0),"p"in re&&(re.H=re.H%12+re.p*12),re.m===void 0&&(re.m="q"in re?re.q:0),"V"in re){if(re.V<1||re.V>53)return null;"w"in re||(re.w=1),"Z"in re?(ee=G_(tf(re.y,0,1)),ce=ee.getUTCDay(),ee=ce>4||ce===0?rv.ceil(ee):rv(ee),ee=N0.offset(ee,(re.V-1)*7),re.y=ee.getUTCFullYear(),re.m=ee.getUTCMonth(),re.d=ee.getUTCDate()+(re.w+6)%7):(ee=H_(tf(re.y,0,1)),ce=ee.getDay(),ee=ce>4||ce===0?tv.ceil(ee):tv(ee),ee=Yh.offset(ee,(re.V-1)*7),re.y=ee.getFullYear(),re.m=ee.getMonth(),re.d=ee.getDate()+(re.w+6)%7)}else("W"in re||"U"in re)&&("w"in re||(re.w="u"in re?re.u%7:"W"in re?1:0),ce="Z"in re?G_(tf(re.y,0,1)).getUTCDay():H_(tf(re.y,0,1)).getDay(),re.m=0,re.d="W"in re?(re.w+6)%7+re.W*7-(ce+5)%7:re.w+re.U*7-(ce+6)%7);return"Z"in re?(re.H+=re.Z/100|0,re.M+=re.Z%100,G_(re)):H_(re)}}function R(V,J,oe,re){for(var Me=0,ee=J.length,ce=oe.length,je,de;Me<ee;){if(re>=ce)return-1;if(je=J.charCodeAt(Me++),je===37){if(je=J.charAt(Me++),de=C[je in c3?J.charAt(Me++):je],!de||(re=de(V,oe,re))<0)return-1}else if(je!=oe.charCodeAt(re++))return-1}return re}function I(V,J,oe){var re=d.exec(J.slice(oe));return re?(V.p=h.get(re[0].toLowerCase()),oe+re[0].length):-1}function D(V,J,oe){var re=v.exec(J.slice(oe));return re?(V.w=b.get(re[0].toLowerCase()),oe+re[0].length):-1}function L(V,J,oe){var re=m.exec(J.slice(oe));return re?(V.w=p.get(re[0].toLowerCase()),oe+re[0].length):-1}function z(V,J,oe){var re=j.exec(J.slice(oe));return re?(V.m=N.get(re[0].toLowerCase()),oe+re[0].length):-1}function H(V,J,oe){var re=y.exec(J.slice(oe));return re?(V.m=x.get(re[0].toLowerCase()),oe+re[0].length):-1}function Z(V,J,oe){return R(V,e,J,oe)}function te(V,J,oe){return R(V,r,J,oe)}function G(V,J,oe){return R(V,n,J,oe)}function M(V){return o[V.getDay()]}function F(V){return i[V.getDay()]}function K(V){return u[V.getMonth()]}function B(V){return l[V.getMonth()]}function O(V){return a[+(V.getHours()>=12)]}function W(V){return 1+~~(V.getMonth()/3)}function q(V){return o[V.getUTCDay()]}function se(V){return i[V.getUTCDay()]}function me(V){return u[V.getUTCMonth()]}function fe(V){return l[V.getUTCMonth()]}function Q(V){return a[+(V.getUTCHours()>=12)]}function pe(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var J=A(V+="",S);return J.toString=function(){return V},J},parse:function(V){var J=T(V+="",!1);return J.toString=function(){return V},J},utcFormat:function(V){var J=A(V+="",k);return J.toString=function(){return V},J},utcParse:function(V){var J=T(V+="",!0);return J.toString=function(){return V},J}}}var c3={"-":"",_:" ",0:"0"},Vr=/^\s*\d+/,Lue=/^%/,Fue=/[\\^$*+?|[\]().{}]/g;function Mt(t,e,r){var n=t<0?"-":"",a=(n?-t:t)+"",i=a.length;return n+(i<r?new Array(r-i+1).join(e)+a:a)}function Bue(t){return t.replace(Fue,"\\$&")}function rf(t){return new RegExp("^(?:"+t.map(Bue).join("|")+")","i")}function nf(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function Vue(t,e,r){var n=Vr.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function zue(t,e,r){var n=Vr.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Uue(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function que(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Wue(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function u3(t,e,r){var n=Vr.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function d3(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Hue(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Gue(t,e,r){var n=Vr.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Kue(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function f3(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Yue(t,e,r){var n=Vr.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function h3(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Xue(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Zue(t,e,r){var n=Vr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Que(t,e,r){var n=Vr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Jue(t,e,r){var n=Vr.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function ede(t,e,r){var n=Lue.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function tde(t,e,r){var n=Vr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function rde(t,e,r){var n=Vr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function m3(t,e){return Mt(t.getDate(),e,2)}
716function nde(t,e){return Mt(t.getHours(),e,2)}function ade(t,e){return Mt(t.getHours()%12||12,e,2)}function sde(t,e){return Mt(1+Yh.count(hi(t),t),e,3)}function RB(t,e){return Mt(t.getMilliseconds(),e,3)}function ide(t,e){return RB(t,e)+"000"}function ode(t,e){return Mt(t.getMonth()+1,e,2)}function lde(t,e){return Mt(t.getMinutes(),e,2)}function cde(t,e){return Mt(t.getSeconds(),e,2)}function ude(t){var e=t.getDay();return e===0?7:e}function dde(t,e){return Mt(S0.count(hi(t)-1,t),e,2)}function IB(t){var e=t.getDay();return e>=4||e===0?yu(t):yu.ceil(t)}function fde(t,e){return t=IB(t),Mt(yu.count(hi(t),t)+(hi(t).getDay()===4),e,2)}function hde(t){return t.getDay()}function mde(t,e){return Mt(tv.count(hi(t)-1,t),e,2)}function pde(t,e){return Mt(t.getFullYear()%100,e,2)}function gde(t,e){return t=IB(t),Mt(t.getFullYear()%100,e,2)}function vde(t,e){return Mt(t.getFullYear()%1e4,e,4)}function xde(t,e){var r=t.getDay();return t=r>=4||r===0?yu(t):yu.ceil(t),Mt(t.getFullYear()%1e4,e,4)}function yde(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Mt(e/60|0,"0",2)+Mt(e%60,"0",2)}function p3(t,e){return Mt(t.getUTCDate(),e,2)}function bde(t,e){return Mt(t.getUTCHours(),e,2)}function wde(t,e){return Mt(t.getUTCHours()%12||12,e,2)}function _de(t,e){return Mt(1+N0.count(mi(t),t),e,3)}function DB(t,e){return Mt(t.getUTCMilliseconds(),e,3)}function jde(t,e){return DB(t,e)+"000"}function Nde(t,e){return Mt(t.getUTCMonth()+1,e,2)}function Sde(t,e){return Mt(t.getUTCMinutes(),e,2)}function Cde(t,e){return Mt(t.getUTCSeconds(),e,2)}function kde(t){var e=t.getUTCDay();return e===0?7:e}function Ede(t,e){return Mt(C0.count(mi(t)-1,t),e,2)}function $B(t){var e=t.getUTCDay();return e>=4||e===0?bu(t):bu.ceil(t)}function Ade(t,e){return t=$B(t),Mt(bu.count(mi(t),t)+(mi(t).getUTCDay()===4),e,2)}function Pde(t){return t.getUTCDay()}function Tde(t,e){return Mt(rv.count(mi(t)-1,t),e,2)}function Ode(t,e){return Mt(t.getUTCFullYear()%100,e,2)}function Mde(t,e){return t=$B(t),Mt(t.getUTCFullYear()%100,e,2)}function Rde(t,e){return Mt(t.getUTCFullYear()%1e4,e,4)}function Ide(t,e){var r=t.getUTCDay();return t=r>=4||r===0?bu(t):bu.ceil(t),Mt(t.getUTCFullYear()%1e4,e,4)}function Dde(){return"+0000"}function g3(){return"%"}function v3(t){return+t}function x3(t){return Math.floor(+t/1e3)}var jc,LB,FB;$de({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function $de(t){return jc=$ue(t),LB=jc.format,jc.parse,FB=jc.utcFormat,jc.utcParse,jc}function Lde(t){return new Date(t)}function Fde(t){return t instanceof Date?+t:+new Date(+t)}function Mk(t,e,r,n,a,i,o,l,u,d){var h=yk(),m=h.invert,p=h.domain,v=d(".%L"),b=d(":%S"),y=d("%I:%M"),x=d("%I %p"),j=d("%a %d"),N=d("%b %d"),S=d("%B"),k=d("%Y");function C(A){return(u(A)<A?v:l(A)<A?b:o(A)<A?y:i(A)<A?x:n(A)<A?a(A)<A?j:N:r(A)<A?S:k)(A)}return h.invert=function(A){return new Date(m(A))},h.domain=function(A){return arguments.length?p(Array.from(A,Fde)):p().map(Lde)},h.ticks=function(A){var T=p();return t(T[0],T[T.length-1],A??10)},h.tickFormat=function(A,T){return T==null?C:d(T)},h.nice=function(A){var T=p();return(!A||typeof A.range!="function")&&(A=e(T[0],T[T.length-1],A??10)),A?p(SB(T,A)):h},h.copy=function(){return Kh(h,Mk(t,e,r,n,a,i,o,l,u,d))},h}function Bde(){return Sa.apply(Mk(Iue,Due,hi,Tk,S0,Yh,Ak,kk,ml,LB).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Vde(){return Sa.apply(Mk(Mue,Rue,mi,Ok,C0,N0,Pk,Ek,ml,FB).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function k0(){var t=0,e=1,r,n,a,i,o=gn,l=!1,u;function d(m){return m==null||isNaN(m=+m)?u:o(a===0?.5:(m=(i(m)-r)*a,l?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([t,e]=m,r=i(t=+t),n=i(e=+e),a=r===n?0:1/(n-r),d):[t,e]},d.clamp=function(m){return arguments.length?(l=!!m,d):l},d.interpolator=function(m){return arguments.length?(o=m,d):o};function h(m){return function(p){var v,b;return arguments.length?([v,b]=p,o=m(v,b),d):[o(0),o(1)]}}return d.range=h(sd),d.rangeRound=h(xk),d.unknown=function(m){return arguments.length?(u=m,d):u},function(m){return i=m,r=m(t),n=m(e),a=r===n?0:1/(n-r),d}}function Po(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function BB(){var t=Ao(k0()(gn));return t.copy=function(){return Po(t,BB())},_i.apply(t,arguments)}function VB(){var t=_k(k0()).domain([1,10]);return t.copy=function(){return Po(t,VB()).base(t.base())},_i.apply(t,arguments)}function zB(){var t=jk(k0());return t.copy=function(){return Po(t,zB()).constant(t.constant())},_i.apply(t,arguments)}function Rk(){var t=Nk(k0());return t.copy=function(){return Po(t,Rk()).exponent(t.exponent())},_i.apply(t,arguments)}function zde(){return Rk.apply(null,arguments).exponent(.5)}function UB(){var t=[],e=gn;function r(n){if(n!=null&&!isNaN(n=+n))return e((Hh(t,n,1)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];
vendor: 66,912 bytes, lines 716-742
716for(let a of n)a!=null&&!isNaN(a=+a)&&t.push(a);return t.sort(co),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.range=function(){return t.map((n,a)=>e(a/(t.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,i)=>Ece(t,i/n))},r.copy=function(){return UB(e).domain(t)},_i.apply(r,arguments)}function E0(){var t=0,e=.5,r=1,n=1,a,i,o,l,u,d=gn,h,m=!1,p;function v(y){return isNaN(y=+y)?p:(y=.5+((y=+h(y))-i)*(n*y<n*i?l:u),d(m?Math.max(0,Math.min(1,y)):y))}v.domain=function(y){return arguments.length?([t,e,r]=y,a=h(t=+t),i=h(e=+e),o=h(r=+r),l=a===i?0:.5/(i-a),u=i===o?0:.5/(o-i),n=i<a?-1:1,v):[t,e,r]},v.clamp=function(y){return arguments.length?(m=!!y,v):m},v.interpolator=function(y){return arguments.length?(d=y,v):d};function b(y){return function(x){var j,N,S;return arguments.length?([j,N,S]=x,d=eue(y,[j,N,S]),v):[d(0),d(.5),d(1)]}}return v.range=b(sd),v.rangeRound=b(xk),v.unknown=function(y){return arguments.length?(p=y,v):p},function(y){return h=y,a=y(t),i=y(e),o=y(r),l=a===i?0:.5/(i-a),u=i===o?0:.5/(o-i),n=i<a?-1:1,v}}function qB(){var t=Ao(E0()(gn));return t.copy=function(){return Po(t,qB())},_i.apply(t,arguments)}function WB(){var t=_k(E0()).domain([.1,1,10]);return t.copy=function(){return Po(t,WB()).base(t.base())},_i.apply(t,arguments)}function HB(){var t=jk(E0());return t.copy=function(){return Po(t,HB()).constant(t.constant())},_i.apply(t,arguments)}function Ik(){var t=Nk(E0());return t.copy=function(){return Po(t,Ik()).exponent(t.exponent())},_i.apply(t,arguments)}function Ude(){return Ik.apply(null,arguments).exponent(.5)}const y3=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:rh,scaleDiverging:qB,scaleDivergingLog:WB,scaleDivergingPow:Ik,scaleDivergingSqrt:Ude,scaleDivergingSymlog:HB,scaleIdentity:NB,scaleImplicit:yS,scaleLinear:Jg,scaleLog:CB,scaleOrdinal:pk,scalePoint:Pf,scalePow:Sk,scaleQuantile:AB,scaleQuantize:PB,scaleRadial:EB,scaleSequential:BB,scaleSequentialLog:VB,scaleSequentialPow:Rk,scaleSequentialQuantile:UB,scaleSequentialSqrt:zde,scaleSequentialSymlog:zB,scaleSqrt:jue,scaleSymlog:kB,scaleThreshold:TB,scaleTime:Bde,scaleUtc:Vde,tickFormat:jB},Symbol.toStringTag,{value:"Module"}));var K_,b3;function GB(){if(b3)return K_;b3=1;var t=ed();function e(r,n,a){for(var i=-1,o=r.length;++i<o;){var l=r[i],u=n(l);if(u!=null&&(d===void 0?u===u&&!t(u):a(u,d)))var d=u,h=l}return h}return K_=e,K_}var Y_,w3;function qde(){if(w3)return Y_;w3=1;function t(e,r){return e>r}return Y_=t,Y_}var X_,_3;function Wde(){if(_3)return X_;_3=1;var t=GB(),e=qde(),r=nd();function n(a){return a&&a.length?t(a,r,e):void 0}return X_=n,X_}var Hde=Wde();const ao=Ft(Hde);var Z_,j3;function Gde(){if(j3)return Z_;j3=1;function t(e,r){return e<r}return Z_=t,Z_}var Q_,N3;function Kde(){if(N3)return Q_;N3=1;var t=GB(),e=Gde(),r=nd();function n(a){return a&&a.length?t(a,r,e):void 0}return Q_=n,Q_}var Yde=Kde();const A0=Ft(Yde);var J_,S3;function Xde(){if(S3)return J_;S3=1;var t=ZC(),e=Eo(),r=tB(),n=In();function a(i,o){var l=n(i)?t:r;return l(i,e(o,3))}return J_=a,J_}var ej,C3;function Zde(){if(C3)return ej;C3=1;var t=JF(),e=Xde();function r(n,a){return t(e(n,a),1)}return ej=r,ej}var Qde=Zde();const Jde=Ft(Qde);var tj,k3;function efe(){if(k3)return tj;k3=1;var t=uk();function e(r,n){return t(r,n)}return tj=e,tj}var tfe=efe();const oh=Ft(tfe);var id=1e9,rfe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},$k,nr=!0,ja="[DecimalError] ",jl=ja+"Invalid argument: ",Dk=ja+"Exponent out of range: ",od=Math.floor,nl=Math.pow,nfe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Kn,Fr=1e7,er=7,KB=9007199254740991,nv=od(KB/er),Ue={};Ue.absoluteValue=Ue.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};Ue.comparedTo=Ue.cmp=function(t){var e,r,n,a,i=this;if(t=new i.constructor(t),i.s!==t.s)return i.s||-t.s;if(i.e!==t.e)return i.e>t.e^i.s<0?1:-1;for(n=i.d.length,a=t.d.length,e=0,r=n<a?n:a;e<r;++e)if(i.d[e]!==t.d[e])return i.d[e]>t.d[e]^i.s<0?1:-1;return n===a?0:n>a^i.s<0?1:-1};Ue.decimalPlaces=Ue.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*er;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};Ue.dividedBy=Ue.div=function(t){return oi(this,new this.constructor(t))};Ue.dividedToIntegerBy=Ue.idiv=function(t){var e=this,r=e.constructor;return Ht(oi(e,new r(t),0,1),r.precision)};Ue.equals=Ue.eq=function(t){return!this.cmp(t)};Ue.exponent=function(){return jr(this)};Ue.greaterThan=Ue.gt=function(t){return this.cmp(t)>0};Ue.greaterThanOrEqualTo=Ue.gte=function(t){return this.cmp(t)>=0};Ue.isInteger=Ue.isint=function(){return this.e>this.d.length-2};Ue.isNegative=Ue.isneg=function(){return this.s<0};Ue.isPositive=Ue.ispos=function(){return this.s>0};Ue.isZero=function(){return this.s===0};Ue.lessThan=Ue.lt=function(t){return this.cmp(t)<0};Ue.lessThanOrEqualTo=Ue.lte=function(t){return this.cmp(t)<1};Ue.logarithm=Ue.log=function(t){var e,r=this,n=r.constructor,a=n.precision,i=a+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(Kn))throw Error(ja+"NaN");if(r.s<1)throw Error(ja+(r.s?"NaN":"-Infinity"));return r.eq(Kn)?new n(0):(nr=!1,e=oi(lh(r,i),lh(t,i),i),nr=!0,Ht(e,a))};Ue.minus=Ue.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?ZB(e,t):YB(e,(t.s=-t.s,t))};Ue.modulo=Ue.mod=function(t){var e,r=this,n=r.constructor,a=n.precision;if(t=new n(t),!t.s)throw Error(ja+"NaN");return r.s?(nr=!1,e=oi(r,t,0,1).times(t),nr=!0,r.minus(e)):Ht(new n(r),a)};Ue.naturalExponential=Ue.exp=function(){return XB(this)};Ue.naturalLogarithm=Ue.ln=function(){return lh(this)};Ue.negated=Ue.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};Ue.plus=Ue.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?YB(e,t):ZB(e,(t.s=-t.s,t))};Ue.precision=Ue.sd=function(t){var e,r,n,a=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(jl+t);if(e=jr(a)+1,n=a.d.length-1,r=n*er+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};Ue.squareRoot=Ue.sqrt=function(){var t,e,r,n,a,i,o,l=this,u=l.constructor;if(l.s<1){if(!l.s)return new u(0);throw Error(ja+"NaN")}for(t=jr(l),nr=!1,a=Math.sqrt(+l),a==0||a==1/0?(e=bs(l.d),(e.length+t)%2==0&&(e+="0"),a=Math.sqrt(e),t=od((t+1)/2)-(t<0||t%2),a==1/0?e="5e"+t:(e=a.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new u(e)):n=new u(a.toString()),r=u.precision,a=o=r+3;;)if(i=n,n=i.plus(oi(l,i,o+2)).times(.5),bs(i.d).slice(0,o)===(e=bs(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),a==o&&e=="4999"){if(Ht(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(e!="9999")break;o+=4}return nr=!0,Ht(n,r)};Ue.times=Ue.mul=function(t){var e,r,n,a,i,o,l,u,d,h=this,m=h.constructor,p=h.d,v=(t=new m(t)).d;if(!h.s||!t.s)return new m(0);for(t.s*=h.s,r=h.e+t.e,u=p.length,d=v.length,u<d&&(i=p,p=v,v=i,o=u,u=d,d=o),i=[],o=u+d,n=o;n--;)i.push(0);for(n=d;--n>=0;){for(e=0,a=u+n;a>n;)l=i[a]+v[n]*p[a-n-1]+e,i[a--]=l%Fr|0,e=l/Fr|0;i[a]=(i[a]+e)%Fr|0}for(;!i[--o];)i.pop();return e?++r:i.shift(),t.d=i,t.e=r,nr?Ht(t,m.precision):t};Ue.toDecimalPlaces=Ue.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Ps(t,0,id),e===void 0?e=n.rounding:Ps(e,0,8),Ht(r,t+jr(r)+1,e))};Ue.toExponential=function(t,e){var r,n=this,a=n.constructor;return t===void 0?r=Cl(n,!0):(Ps(t,0,id),e===void 0?e=a.rounding:Ps(e,0,8),n=Ht(new a(n),t+1,e),r=Cl(n,!0,t+1)),r};Ue.toFixed=function(t,e){var r,n,a=this,i=a.constructor;return t===void 0?Cl(a):(Ps(t,0,id),e===void 0?e=i.rounding:Ps(e,0,8),n=Ht(new i(a),t+jr(a)+1,e),r=Cl(n.abs(),!1,t+jr(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};Ue.toInteger=Ue.toint=function(){var t=this,e=t.constructor;return Ht(new e(t),jr(t)+1,e.rounding)};Ue.toNumber=function(){return+this};Ue.toPower=Ue.pow=function(t){var e,r,n,a,i,o,l=this,u=l.constructor,d=12,h=+(t=new u(t));if(!t.s)return new u(Kn);if(l=new u(l),!l.s){if(t.s<1)throw Error(ja+"Infinity");return l}if(l.eq(Kn))return l;if(n=u.precision,t.eq(Kn))return Ht(l,n);if(e=t.e,r=t.d.length-1,o=e>=r,i=l.s,o){if((r=h<0?-h:h)<=KB){for(a=new u(Kn),e=Math.ceil(n/er+4),nr=!1;r%2&&(a=a.times(l),A3(a.d,e)),r=od(r/2),r!==0;)l=l.times(l),A3(l.d,e);return nr=!0,t.s<0?new u(Kn).div(a):Ht(a,n)}}else if(i<0)throw Error(ja+"NaN");return i=i<0&&t.d[Math.max(e,r)]&1?-1:1,l.s=1,nr=!1,a=t.times(lh(l,n+d)),nr=!0,a=XB(a),a.s=i,a};Ue.toPrecision=function(t,e){var r,n,a=this,i=a.constructor;return t===void 0?(r=jr(a),n=Cl(a,r<=i.toExpNeg||r>=i.toExpPos)):(Ps(t,1,id),e===void 0?e=i.rounding:Ps(e,0,8),a=Ht(new i(a),t,e),r=jr(a),n=Cl(a,t<=r||r<=i.toExpNeg,t)),n};Ue.toSignificantDigits=Ue.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Ps(t,1,id),e===void 0?e=n.rounding:Ps(e,0,8)),Ht(new n(r),t,e)};Ue.toString=Ue.valueOf=Ue.val=Ue.toJSON=Ue[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=jr(t),r=t.constructor;return Cl(t,e<=r.toExpNeg||e>=r.toExpPos)};function YB(t,e){var r,n,a,i,o,l,u,d,h=t.constructor,m=h.precision;if(!t.s||!e.s)return e.s||(e=new h(t)),nr?Ht(e,m):e;if(u=t.d,d=e.d,o=t.e,a=e.e,u=u.slice(),i=o-a,i){for(i<0?(n=u,i=-i,l=d.length):(n=d,a=o,l=u.length),o=Math.ceil(m/er),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=u.length,i=d.length,l-i<0&&(i=l,n=d,d=u,u=n),r=0;i;)r=(u[--i]=u[i]+d[i]+r)/Fr|0,u[i]%=Fr;for(r&&(u.unshift(r),++a),l=u.length;u[--l]==0;)u.pop();return e.d=u,e.e=a,nr?Ht(e,m):e}function Ps(t,e,r){if(t!==~~t||t<e||t>r)throw Error(jl+t)}function bs(t){var e,r,n,a=t.length-1,i="",o=t[0];if(a>0){for(i+=o,e=1;e<a;e++)n=t[e]+"",r=er-n.length,r&&(i+=Ji(r)),i+=n;o=t[e],n=o+"",r=er-n.length,r&&(i+=Ji(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var oi=(function(){function t(n,a){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*a+o,n[l]=i%Fr|0,o=i/Fr|0;return o&&n.unshift(o),n}function e(n,a,i,o){var l,u;if(i!=o)u=i>o?1:-1;else for(l=u=0;l<i;l++)if(n[l]!=a[l]){u=n[l]>a[l]?1:-1;break}return u}function r(n,a,i){for(var o=0;i--;)n[i]-=o,o=n[i]<a[i]?1:0,n[i]=o*Fr+n[i]-a[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,a,i,o){var l,u,d,h,m,p,v,b,y,x,j,N,S,k,C,A,T,R,I=n.constructor,D=n.s==a.s?1:-1,L=n.d,z=a.d;if(!n.s)return new I(n);if(!a.s)throw Error(ja+"Division by zero");for(u=n.e-a.e,T=z.length,C=L.length,v=new I(D),b=v.d=[],d=0;z[d]==(L[d]||0);)++d;if(z[d]>(L[d]||0)&&--u,i==null?N=i=I.precision:o?N=i+(jr(n)-jr(a))+1:N=i,N<0)return new I(0);if(N=N/er+2|0,d=0,T==1)for(h=0,z=z[0],N++;(d<C||h)&&N--;d++)S=h*Fr+(L[d]||0),b[d]=S/z|0,h=S%z|0;else{for(h=Fr/(z[0]+1)|0,h>1&&(z=t(z,h),L=t(L,h),T=z.length,C=L.length),k=T,y=L.slice(0,T),x=y.length;x<T;)y[x++]=0;R=z.slice(),R.unshift(0),A=z[0],z[1]>=Fr/2&&++A;do h=0,l=e(z,y,T,x),l<0?(j=y[0],T!=x&&(j=j*Fr+(y[1]||0)),h=j/A|0,h>1?(h>=Fr&&(h=Fr-1),m=t(z,h),p=m.length,x=y.length,l=e(m,y,p,x),l==1&&(h--,r(m,T<p?R:z,p))):(h==0&&(l=h=1),m=z.slice()),p=m.length,p<x&&m.unshift(0),r(y,m,x),l==-1&&(x=y.length,l=e(z,y,T,x),l<1&&(h++,r(y,T<x?R:z,x))),x=y.length):l===0&&(h++,y=[0]),b[d++]=h,l&&y[0]?y[x++]=L[k]||0:(y=[L[k]],x=1);while((k++<C||y[0]!==void 0)&&N--)}return b[0]||b.shift(),v.e=u,Ht(v,o?i+jr(v)+1:i)}})();function XB(t,e){var r,n,a,i,o,l,u=0,d=0,h=t.constructor,m=h.precision;if(jr(t)>16)throw Error(Dk+jr(t));if(!t.s)return new h(Kn);for(nr=!1,l=m,o=new h(.03125);t.abs().gte(.1);)t=t.times(o),d+=5;for(n=Math.log(nl(2,d))/Math.LN10*2+5|0,l+=n,r=a=i=new h(Kn),h.precision=l;;){if(a=Ht(a.times(t),l),r=r.times(++u),o=i.plus(oi(a,r,l)),bs(o.d).slice(0,l)===bs(i.d).slice(0,l)){for(;d--;)i=Ht(i.times(i),l);return h.precision=m,e==null?(nr=!0,Ht(i,m)):i}i=o}}function jr(t){for(var e=t.e*er,r=t.d[0];r>=10;r/=10)e++;return e}function rj(t,e,r){if(e>t.LN10.sd())throw nr=!0,r&&(t.precision=r),Error(ja+"LN10 precision limit exceeded");return Ht(new t(t.LN10),e)}function Ji(t){for(var e="";t--;)e+="0";return e}function lh(t,e){var r,n,a,i,o,l,u,d,h,m=1,p=10,v=t,b=v.d,y=v.constructor,x=y.precision;if(v.s<1)throw Error(ja+(v.s?"NaN":"-Infinity"));if(v.eq(Kn))return new y(0);if(e==null?(nr=!1,d=x):d=e,v.eq(10))return e==null&&(nr=!0),rj(y,d);if(d+=p,y.precision=d,r=bs(b),n=r.charAt(0),i=jr(v),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)v=v.times(t),r=bs(v.d),n=r.charAt(0),m++;i=jr(v),n>1?(v=new y("0."+r),i++):v=new y(n+"."+r.slice(1))}else return u=rj(y,d+2,x).times(i+""),v=lh(new y(n+"."+r.slice(1)),d-p).plus(u),y.precision=x,e==null?(nr=!0,Ht(v,x)):v;for(l=o=v=oi(v.minus(Kn),v.plus(Kn),d),h=Ht(v.times(v),d),a=3;;){if(o=Ht(o.times(h),d),u=l.plus(oi(o,new y(a),d)),bs(u.d).slice(0,d)===bs(l.d).slice(0,d))return l=l.times(2),i!==0&&(l=l.plus(rj(y,d+2,x).times(i+""))),l=oi(l,new y(m),d),y.precision=x,e==null?(nr=!0,Ht(l,x)):l;l=u,a+=2}}function E3(t,e){var r,n,a;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(a=e.length;e.charCodeAt(a-1)===48;)--a;if(e=e.slice(n,a),e){if(a-=n,r=r-n-1,t.e=od(r/er),t.d=[],n=(r+1)%er,r<0&&(n+=er),n<a){for(n&&t.d.push(+e.slice(0,n)),a-=er;n<a;)t.d.push(+e.slice(n,n+=er));e=e.slice(n),n=er-e.length}else n-=a;for(;n--;)e+="0";if(t.d.push(+e),nr&&(t.e>nv||t.e<-nv))throw Error(Dk+r)}else t.s=0,t.e=0,t.d=[0];return t}function Ht(t,e,r){var n,a,i,o,l,u,d,h,m=t.d;for(o=1,i=m[0];i>=10;i/=10)o++;if(n=e-o,n<0)n+=er,a=e,d=m[h=0];else{if(h=Math.ceil((n+1)/er),i=m.length,h>=i)return t;for(d=i=m[h],o=1;i>=10;i/=10)o++;n%=er,a=n-er+o}if(r!==void 0&&(i=nl(10,o-a-1),l=d/i%10|0,u=e<0||m[h+1]!==void 0||d%i,u=r<4?(l||u)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||u||r==6&&(n>0?a>0?d/nl(10,o-a):0:m[h-1])%10&1||r==(t.s<0?8:7))),e<1||!m[0])return u?(i=jr(t),m.length=1,e=e-i-1,m[0]=nl(10,(er-e%er)%er),t.e=od(-e/er)||0):(m.length=1,m[0]=t.e=t.s=0),t;if(n==0?(m.length=h,i=1,h--):(m.length=h+1,i=nl(10,er-n),m[h]=a>0?(d/nl(10,o-a)%nl(10,a)|0)*i:0),u)for(;;)if(h==0){(m[0]+=i)==Fr&&(m[0]=1,++t.e);break}else{if(m[h]+=i,m[h]!=Fr)break;m[h--]=0,i=1}for(n=m.length;m[--n]===0;)m.pop();if(nr&&(t.e>nv||t.e<-nv))throw Error(Dk+jr(t));return t}function ZB(t,e){var r,n,a,i,o,l,u,d,h,m,p=t.constructor,v=p.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new p(t),nr?Ht(e,v):e;if(u=t.d,m=e.d,n=e.e,d=t.e,u=u.slice(),o=d-n,o){for(h=o<0,h?(r=u,o=-o,l=m.length):(r=m,n=d,l=u.length),a=Math.max(Math.ceil(v/er),l)+2,o>a&&(o=a,r.length=1),r.reverse(),a=o;a--;)r.push(0);r.reverse()}else{for(a=u.length,l=m.length,h=a<l,h&&(l=a),a=0;a<l;a++)if(u[a]!=m[a]){h=u[a]<m[a];break}o=0}for(h&&(r=u,u=m,m=r,e.s=-e.s),l=u.length,a=m.length-l;a>0;--a)u[l++]=0;for(a=m.length;a>o;){if(u[--a]<m[a]){for(i=a;i&&u[--i]===0;)u[i]=Fr-1;--u[i],u[a]+=Fr}u[a]-=m[a]}for(;u[--l]===0;)u.pop();for(;u[0]===0;u.shift())--n;return u[0]?(e.d=u,e.e=n,nr?Ht(e,v):e):new p(0)}function Cl(t,e,r){var n,a=jr(t),i=bs(t.d),o=i.length;return e?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Ji(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(a<0?"e":"e+")+a):a<0?(i="0."+Ji(-a-1)+i,r&&(n=r-o)>0&&(i+=Ji(n))):a>=o?(i+=Ji(a+1-o),r&&(n=r-a-1)>0&&(i=i+"."+Ji(n))):((n=a+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(a+1===o&&(i+="."),i+=Ji(n))),t.s<0?"-"+i:i}function A3(t,e){if(t.length>e)return t.length=e,!0}function QB(t){var e,r,n;function a(i){var o=this;if(!(o instanceof a))return new a(i);if(o.constructor=a,i instanceof a){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(jl+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return E3(o,i.toString())}else if(typeof i!="string")throw Error(jl+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,nfe.test(i))E3(o,i);else throw Error(jl+i)}if(a.prototype=Ue,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=QB,a.config=a.set=afe,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return a.config(t),a}function afe(t){if(!t||typeof t!="object")throw Error(ja+"Object expected");var e,r,n,a=["precision",1,id,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<a.length;e+=3)if((n=t[r=a[e]])!==void 0)if(od(n)===n&&n>=a[e+1]&&n<=a[e+2])this[r]=n;else throw Error(jl+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(jl+r+": "+n);return this}var $k=QB(rfe);Kn=new $k(1);const Ut=$k;function sfe(t){return cfe(t)||lfe(t)||ofe(t)||ife()}function ife(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 717In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ofe(t,e){if(t){if(typeof t=="string")return jS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jS(t,e)}}function lfe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function cfe(t){if(Array.isArray(t))return jS(t)}function jS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ufe=function(e){return e},JB={},eV=function(e){return e===JB},P3=function(e){return function r(){return arguments.length===0||arguments.length===1&&eV(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},dfe=function t(e,r){return e===1?r:P3(function(){for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];var o=a.filter(function(l){return l!==JB}).length;return o>=e?r.apply(void 0,a):t(e-o,P3(function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];var h=a.map(function(m){return eV(m)?u.shift():m});return r.apply(void 0,sfe(h).concat(u))}))})},P0=function(e){return dfe(e.length,e)},NS=function(e,r){for(var n=[],a=e;a<r;++a)n[a-e]=a;return n},ffe=P0(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),hfe=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return ufe;var a=r.reverse(),i=a[0],o=a.slice(1);return function(){return o.reduce(function(l,u){return u(l)},i.apply(void 0,arguments))}},SS=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},tV=function(e){var r=null,n=null;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return r&&i.every(function(l,u){return l===r[u]})||(r=i,n=e.apply(void 0,i)),n}};function mfe(t){var e;return t===0?e=1:e=Math.floor(new Ut(t).abs().log(10).toNumber())+1,e}function pfe(t,e,r){for(var n=new Ut(t),a=0,i=[];n.lt(e)&&a<1e5;)i.push(n.toNumber()),n=n.add(r),a++;return i}var gfe=P0(function(t,e,r){var n=+t,a=+e;return n+r*(a-n)}),vfe=P0(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),xfe=P0(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const T0={rangeStep:pfe,getDigitCount:mfe,interpolateNumber:gfe,uninterpolateNumber:vfe,uninterpolateTruncation:xfe};function CS(t){return wfe(t)||bfe(t)||rV(t)||yfe()}function yfe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 718In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bfe(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function wfe(t){if(Array.isArray(t))return kS(t)}function ch(t,e){return Nfe(t)||jfe(t,e)||rV(t,e)||_fe()}function _fe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 719In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rV(t,e){if(t){if(typeof t=="string")return kS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return kS(t,e)}}function kS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function jfe(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,a=!1,i=void 0;try{for(var o=t[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(e&&r.length===e));n=!0);}catch(u){a=!0,i=u}finally{try{!n&&o.return!=null&&o.return()}finally{if(a)throw i}}return r}}function Nfe(t){if(Array.isArray(t))return t}function nV(t){var e=ch(t,2),r=e[0],n=e[1],a=r,i=n;return r>n&&(a=n,i=r),[a,i]}function aV(t,e,r){if(t.lte(0))return new Ut(0);var n=T0.getDigitCount(t.toNumber()),a=new Ut(10).pow(n),i=t.div(a),o=n!==1?.05:.1,l=new Ut(Math.ceil(i.div(o).toNumber())).add(r).mul(o),u=l.mul(a);return e?u:new Ut(Math.ceil(u))}function Sfe(t,e,r){var n=1,a=new Ut(t);if(!a.isint()&&r){var i=Math.abs(t);i<1?(n=new Ut(10).pow(T0.getDigitCount(t)-1),a=new Ut(Math.floor(a.div(n).toNumber())).mul(n)):i>1&&(a=new Ut(Math.floor(t)))}else t===0?a=new Ut(Math.floor((e-1)/2)):r||(a=new Ut(Math.floor(t)));var o=Math.floor((e-1)/2),l=hfe(ffe(function(u){return a.add(new Ut(u-o).mul(n)).toNumber()}),NS);return l(0,e)}function sV(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(r-1)))return{step:new Ut(0),tickMin:new Ut(0),tickMax:new Ut(0)};var i=aV(new Ut(e).sub(t).div(r-1),n,a),o;t<=0&&e>=0?o=new Ut(0):(o=new Ut(t).add(e).div(2),o=o.sub(new Ut(o).mod(i)));var l=Math.ceil(o.sub(t).div(i).toNumber()),u=Math.ceil(new Ut(e).sub(o).div(i).toNumber()),d=l+u+1;return d>r?sV(t,e,r,n,a+1):(d<r&&(u=e>0?u+(r-d):u,l=e>0?l:l+(r-d)),{step:i,tickMin:o.sub(new Ut(l).mul(i)),tickMax:o.add(new Ut(u).mul(i))})}function Cfe(t){var e=ch(t,2),r=e[0],n=e[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(a,2),l=nV([r,n]),u=ch(l,2),d=u[0],h=u[1];if(d===-1/0||h===1/0){var m=h===1/0?[d].concat(CS(NS(0,a-1).map(function(){return 1/0}))):[].concat(CS(NS(0,a-1).map(function(){return-1/0})),[h]);return r>n?SS(m):m}if(d===h)return Sfe(d,a,i);var p=sV(d,h,o,i),v=p.step,b=p.tickMin,y=p.tickMax,x=T0.rangeStep(b,y.add(new Ut(.1).mul(v)),v);return r>n?SS(x):x}function kfe(t,e){var r=ch(t,2),n=r[0],a=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=nV([n,a]),l=ch(o,2),u=l[0],d=l[1];if(u===-1/0||d===1/0)return[n,a];if(u===d)return[u];var h=Math.max(e,2),m=aV(new Ut(d).sub(u).div(h-1),i,0),p=[].concat(CS(T0.rangeStep(new Ut(u),new Ut(d).sub(new Ut(.99).mul(m)),m)),[d]);return n>a?SS(p):p}var Efe=tV(Cfe),Afe=tV(kfe),Pfe="Invariant failed";function kl(t,e){throw new Error(Pfe)}var Tfe=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function wu(t){"@babel/helpers - typeof";return wu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wu(t)}function av(){return av=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},av.apply(this,arguments)}function Ofe(t,e){return Dfe(t)||Ife(t,e)||Rfe(t,e)||Mfe()}function Mfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 720In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Rfe(t,e){if(t){if(typeof t=="string")return T3(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return T3(t,e)}}function T3(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ife(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function Dfe(t){if(Array.isArray(t))return t}function $fe(t,e){if(t==null)return{};var r=Lfe(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Lfe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Ffe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Bfe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,lV(n.key),n)}}function Vfe(t,e,r){return e&&Bfe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function zfe(t,e,r){return e=sv(e),Ufe(t,iV()?Reflect.construct(e,r||[],sv(t).constructor):e.apply(t,r))}function Ufe(t,e){if(e&&(wu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qfe(t)}function qfe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function iV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(iV=function(){return!!t})()}function sv(t){return sv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},sv(t)}function Wfe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ES(t,e)}function ES(t,e){return ES=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},ES(t,e)}function oV(t,e,r){return e=lV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lV(t){var e=Hfe(t,"string");return wu(e)=="symbol"?e:e+""}function Hfe(t,e){if(wu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var O0=(function(t){function e(){return Ffe(this,e),zfe(this,e,arguments)}return Wfe(e,t),Vfe(e,[{key:"render",value:function(){var n=this.props,a=n.offset,i=n.layout,o=n.width,l=n.dataKey,u=n.data,d=n.dataPointFormatter,h=n.xAxis,m=n.yAxis,p=$fe(n,Tfe),v=jt(p,!1);this.props.direction==="x"&&h.type!=="number"&&kl();var b=u.map(function(y){var x=d(y,l),j=x.x,N=x.y,S=x.value,k=x.errorVal;if(!k)return null;var C=[],A,T;if(Array.isArray(k)){var R=Ofe(k,2);A=R[0],T=R[1]}else A=T=k;if(i==="vertical"){var I=h.scale,D=N+a,L=D+o,z=D-o,H=I(S-A),Z=I(S+T);C.push({x1:Z,y1:L,x2:Z,y2:z}),C.push({x1:H,y1:D,x2:Z,y2:D}),C.push({x1:H,y1:L,x2:H,y2:z})}else if(i==="horizontal"){var te=m.scale,G=j+a,M=G-o,F=G+o,K=te(S-A),B=te(S+T);C.push({x1:M,y1:B,x2:F,y2:B}),C.push({x1:G,y1:K,x2:G,y2:B}),C.push({x1:M,y1:K,x2:F,y2:K})}return U.createElement(lr,av({className:"recharts-errorBar",key:"bar-".concat(C.map(function(O){return"".concat(O.x1,"-").concat(O.x2,"-").concat(O.y1,"-").concat(O.y2)}))},v),C.map(function(O){return U.createElement("line",av({},O,{key:"line-".concat(O.x1,"-").concat(O.x2,"-").concat(O.y1,"-").concat(O.y2)}))}))});return U.createElement(lr,{className:"recharts-errorBars"},b)}}])})(U.Component);oV(O0,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});oV(O0,"displayName","ErrorBar");function uh(t){"@babel/helpers - typeof";return uh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uh(t)}function O3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Qo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?O3(Object(r),!0).forEach(function(n){Gfe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):O3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Gfe(t,e,r){return e=Kfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kfe(t){var e=Yfe(t,"string");return uh(e)=="symbol"?e:e+""}function Yfe(t,e){if(uh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(uh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var cV=function(e){var r=e.children,n=e.formattedGraphicalItems,a=e.legendWidth,i=e.legendContent,o=Un(r,Yc);if(!o)return null;var l=Yc.defaultProps,u=l!==void 0?Qo(Qo({},l),o.props):{},d;return o.props&&o.props.payload?d=o.props&&o.props.payload:i==="children"?d=(n||[]).reduce(function(h,m){var p=m.item,v=m.props,b=v.sectors||v.data||[];return h.concat(b.map(function(y){return{type:o.props.iconType||p.props.legendType,value:y.name,color:y.fill,payload:y}}))},[]):d=(n||[]).map(function(h){var m=h.item,p=m.type.defaultProps,v=p!==void 0?Qo(Qo({},p),m.props):{},b=v.dataKey,y=v.name,x=v.legendType,j=v.hide;return{inactive:j,dataKey:b,type:u.iconType||x||"square",color:Lk(m),value:y||b,payload:v}}),Qo(Qo(Qo({},u),Yc.getWithHeight(o,a)),{},{payload:d,item:o})};function dh(t){"@babel/helpers - typeof";return dh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dh(t)}function M3(t){return Jfe(t)||Qfe(t)||Zfe(t)||Xfe()}function Xfe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 721In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zfe(t,e){if(t){if(typeof t=="string")return AS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AS(t,e)}}function Qfe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Jfe(t){if(Array.isArray(t))return AS(t)}function AS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function R3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function fr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?R3(Object(r),!0).forEach(function(n){Zc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Zc(t,e,r){return e=ehe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ehe(t){var e=the(t,"string");return dh(e)=="symbol"?e:e+""}function the(t,e){if(dh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(dh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ea(t,e,r){return St(t)||St(e)?r:Mr(e)?_a(t,e,r):xt(e)?e(t):r}function Tf(t,e,r,n){var a=Jde(t,function(l){return ea(l,e)});if(r==="number"){var i=a.filter(function(l){return De(l)||parseFloat(l)});return i.length?[A0(i),ao(i)]:[1/0,-1/0]}var o=n?a.filter(function(l){return!St(l)}):a;return o.map(function(l){return Mr(l)||l instanceof Date?l:""})}var rhe=function(e){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var u=i.range,d=0;d<l;d++){var h=d>0?a[d-1].coordinate:a[l-1].coordinate,m=a[d].coordinate,p=d>=l-1?a[0].coordinate:a[d+1].coordinate,v=void 0;if(es(m-h)!==es(p-m)){var b=[];if(es(p-m)===es(u[1]-u[0])){v=p;var y=m+u[1]-u[0];b[0]=Math.min(y,(y+h)/2),b[1]=Math.max(y,(y+h)/2)}else{v=h;var x=p+u[1]-u[0];b[0]=Math.min(m,(x+m)/2),b[1]=Math.max(m,(x+m)/2)}var j=[Math.min(m,(v+m)/2),Math.max(m,(v+m)/2)];if(e>j[0]&&e<=j[1]||e>=b[0]&&e<=b[1]){o=a[d].index;break}}else{var N=Math.min(h,p),S=Math.max(h,p);if(e>(N+m)/2&&e<=(S+m)/2){o=a[d].index;break}}}else for(var k=0;k<l;k++)if(k===0&&e<=(n[k].coordinate+n[k+1].coordinate)/2||k>0&&k<l-1&&e>(n[k].coordinate+n[k-1].coordinate)/2&&e<=(n[k].coordinate+n[k+1].coordinate)/2||k===l-1&&e>(n[k].coordinate+n[k-1].coordinate)/2){o=n[k].index;break}return o},Lk=function(e){var r,n=e,a=n.type.displayName,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?fr(fr({},e.type.defaultProps),e.props):e.props,o=i.stroke,l=i.fill,u;switch(a){case"Line":u=o;break;case"Area":case"Radar":u=o&&o!=="none"?o:l;break;default:u=l;break}return u},nhe=function(e){var r=e.barSize,n=e.totalSize,a=e.stackGroups,i=a===void 0?{}:a;if(!i)return{};for(var o={},l=Object.keys(i),u=0,d=l.length;u<d;u++)for(var h=i[l[u]].stackGroups,m=Object.keys(h),p=0,v=m.length;p<v;p++){var b=h[m[p]],y=b.items,x=b.cateAxisId,j=y.filter(function(T){return si(T.type).indexOf("Bar")>=0});if(j&&j.length){var N=j[0].type.defaultProps,S=N!==void 0?fr(fr({},N),j[0].props):j[0].props,k=S.barSize,C=S[x];o[C]||(o[C]=[]);var A=St(k)?r:k;o[C].push({item:j[0],stackList:j.slice(1),barSize:St(A)?void 0:Sl(A,n,0)})}}return o},ahe=function(e){var r=e.barGap,n=e.barCategoryGap,a=e.bandSize,i=e.sizeList,o=i===void 0?[]:i,l=e.maxBarSize,u=o.length;if(u<1)return null;var d=Sl(r,a,0,!0),h,m=[];if(o[0].barSize===+o[0].barSize){var p=!1,v=a/u,b=o.reduce(function(k,C){return k+C.barSize||0},0);b+=(u-1)*d,b>=a&&(b-=(u-1)*d,d=0),b>=a&&v>0&&(p=!0,v*=.9,b=u*v);var y=(a-b)/2>>0,x={offset:y-d,size:0};h=o.reduce(function(k,C){var A={item:C.item,position:{offset:x.offset+x.size+d,size:p?v:C.barSize}},T=[].concat(M3(k),[A]);return x=T[T.length-1].position,C.stackList&&C.stackList.length&&C.stackList.forEach(function(R){T.push({item:R,position:x})}),T},m)}else{var j=Sl(n,a,0,!0);a-2*j-(u-1)*d<=0&&(d=0);var N=(a-2*j-(u-1)*d)/u;N>1&&(N>>=0);var S=l===+l?Math.min(N,l):N;h=o.reduce(function(k,C,A){var T=[].concat(M3(k),[{item:C.item,position:{offset:j+(N+d)*A+(N-S)/2,size:S}}]);return C.stackList&&C.stackList.length&&C.stackList.forEach(function(R){T.push({item:R,position:T[T.length-1].position})}),T},m)}return h},she=function(e,r,n,a){var i=n.children,o=n.width,l=n.margin,u=o-(l.left||0)-(l.right||0),d=cV({children:i,legendWidth:u});if(d){var h=a||{},m=h.width,p=h.height,v=d.align,b=d.verticalAlign,y=d.layout;if((y==="vertical"||y==="horizontal"&&b==="middle")&&v!=="center"&&De(e[v]))return fr(fr({},e),{},Zc({},v,e[v]+(m||0)));if((y==="horizontal"||y==="vertical"&&v==="center")&&b!=="middle"&&De(e[b]))return fr(fr({},e),{},Zc({},b,e[b]+(p||0)))}return e},ihe=function(e,r,n){return St(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},uV=function(e,r,n,a,i){var o=r.props.children,l=rs(o,O0).filter(function(d){return ihe(a,i,d.props.direction)});if(l&&l.length){var u=l.map(function(d){return d.props.dataKey});return e.reduce(function(d,h){var m=ea(h,n);if(St(m))return d;var p=Array.isArray(m)?[A0(m),ao(m)]:[m,m],v=u.reduce(function(b,y){var x=ea(h,y,0),j=p[0]-Math.abs(Array.isArray(x)?x[0]:x),N=p[1]+Math.abs(Array.isArray(x)?x[1]:x);return[Math.min(j,b[0]),Math.max(N,b[1])]},[1/0,-1/0]);return[Math.min(v[0],d[0]),Math.max(v[1],d[1])]},[1/0,-1/0])}return null},ohe=function(e,r,n,a,i){var o=r.map(function(l){return uV(e,l,n,i,a)}).filter(function(l){return!St(l)});return o&&o.length?o.reduce(function(l,u){return[Math.min(l[0],u[0]),Math.max(l[1],u[1])]},[1/0,-1/0]):null},dV=function(e,r,n,a,i){var o=r.map(function(u){var d=u.props.dataKey;return n==="number"&&d&&uV(e,u,d,a)||Tf(e,d,n,i)});if(n==="number")return o.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]);var l={};return o.reduce(function(u,d){for(var h=0,m=d.length;h<m;h++)l[d[h]]||(l[d[h]]=!0,u.push(d[h]));return u},[])},fV=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},hV=function(e,r,n,a){if(a)return e.map(function(u){return u.coordinate});var i,o,l=e.map(function(u){return u.coordinate===r&&(i=!0),u.coordinate===n&&(o=!0),u.coordinate});return i||l.push(r),o||l.push(n),l},ni=function(e,r,n){if(!e)return null;var a=e.scale,i=e.duplicateDomain,o=e.type,l=e.range,u=e.realScaleType==="scaleBand"?a.bandwidth()/2:2,d=(r||n)&&o==="category"&&a.bandwidth?a.bandwidth()/u:0;if(d=e.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?es(l[0]-l[1])*2*d:d,r&&(e.ticks||e.niceTicks)){var h=(e.ticks||e.niceTicks).map(function(m){var p=i?i.indexOf(m):m;return{coordinate:a(p)+d,value:m,offset:d}});return h.filter(function(m){return!rd(m.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(m,p){return{coordinate:a(m)+d,value:m,index:p,offset:d}}):a.ticks&&!n?a.ticks(e.tickCount).map(function(m){return{coordinate:a(m)+d,value:m,offset:d}}):a.domain().map(function(m,p){return{coordinate:a(m)+d,value:i?i[m]:m,index:p,offset:d}})},nj=new WeakMap,Vp=function(e,r){if(typeof r!="function")return e;nj.has(e)||nj.set(e,new WeakMap);var n=nj.get(e);if(n.has(r))return n.get(r);var a=function(){e.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,a),a},lhe=function(e,r,n){var a=e.scale,i=e.type,o=e.layout,l=e.axisType;if(a==="auto")return o==="radial"&&l==="radiusAxis"?{scale:rh(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:Jg(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:Pf(),realScaleType:"point"}:i==="category"?{scale:rh(),realScaleType:"band"}:{scale:Jg(),realScaleType:"linear"};if(Nl(a)){var u="scale".concat(g0(a));return{scale:(y3[u]||Pf)(),realScaleType:y3[u]?u:"point"}}return xt(a)?{scale:a}:{scale:Pf(),realScaleType:"point"}},I3=1e-4,che=function(e){var r=e.domain();if(!(!r||r.length<=2)){var n=r.length,a=e.range(),i=Math.min(a[0],a[1])-I3,o=Math.max(a[0],a[1])+I3,l=e(r[0]),u=e(r[n-1]);(l<i||l>o||u<i||u>o)&&e.domain([r[0],r[n-1]])}},uhe=function(e,r){if(!e)return null;for(var n=0,a=e.length;n<a;n++)if(e[n].item===r)return e[n].position;return null},dhe=function(e,r){if(!r||r.length!==2||!De(r[0])||!De(r[1]))return e;var n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]),i=[e[0],e[1]];return(!De(e[0])||e[0]<n)&&(i[0]=n),(!De(e[1])||e[1]>a)&&(i[1]=a),i[0]>a&&(i[0]=a),i[1]<n&&(i[1]=n),i},fhe=function(e){var r=e.length;if(!(r<=0))for(var n=0,a=e[0].length;n<a;++n)for(var i=0,o=0,l=0;l<r;++l){var u=rd(e[l][n][1])?e[l][n][0]:e[l][n][1];u>=0?(e[l][n][0]=i,e[l][n][1]=i+u,i=e[l][n][1]):(e[l][n][0]=o,e[l][n][1]=o+u,o=e[l][n][1])}},hhe=function(e){var r=e.length;if(!(r<=0))for(var n=0,a=e[0].length;n<a;++n)for(var i=0,o=0;o<r;++o){var l=rd(e[o][n][1])?e[o][n][0]:e[o][n][1];l>=0?(e[o][n][0]=i,e[o][n][1]=i+l,i=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},mhe={sign:fhe,expand:Xse,none:hu,silhouette:Zse,wiggle:Qse,positive:hhe},phe=function(e,r,n){var a=r.map(function(l){return l.props.dataKey}),i=mhe[n],o=Yse().keys(a).value(function(l,u){return+ea(l,u,0)}).order(sS).offset(i);return o(e)},ghe=function(e,r,n,a,i,o){if(!e)return null;var l=o?r.reverse():r,u={},d=l.reduce(function(m,p){var v,b=(v=p.type)!==null&&v!==void 0&&v.defaultProps?fr(fr({},p.type.defaultProps),p.props):p.props,y=b.stackId,x=b.hide;if(x)return m;var j=b[n],N=m[j]||{hasStack:!1,stackGroups:{}};if(Mr(y)){var S=N.stackGroups[y]||{numericAxisId:n,cateAxisId:a,items:[]};S.items.push(p),N.hasStack=!0,N.stackGroups[y]=S}else N.stackGroups[qh("_stackId_")]={numericAxisId:n,cateAxisId:a,items:[p]};return fr(fr({},m),{},Zc({},j,N))},u),h={};return Object.keys(d).reduce(function(m,p){var v=d[p];if(v.hasStack){var b={};v.stackGroups=Object.keys(v.stackGroups).reduce(function(y,x){var j=v.stackGroups[x];return fr(fr({},y),{},Zc({},x,{numericAxisId:n,cateAxisId:a,items:j.items,stackedData:phe(e,j.items,i)}))},b)}return fr(fr({},m),{},Zc({},p,v))},h)},vhe=function(e,r){var n=r.realScaleType,a=r.type,i=r.tickCount,o=r.originalDomain,l=r.allowDecimals,u=n||r.scale;if(u!=="auto"&&u!=="linear")return null;if(i&&a==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var d=e.domain();if(!d.length)return null;var h=Efe(d,i,l);return e.domain([A0(h),ao(h)]),{niceTicks:h}}if(i&&a==="number"){var m=e.domain(),p=Afe(m,i,l);return{niceTicks:p}}return null};function D3(t){var e=t.axis,r=t.ticks,n=t.bandSize,a=t.entry,i=t.index,o=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!St(a[e.dataKey])){var l=Mg(r,"value",a[e.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var u=ea(a,St(o)?e.dataKey:o);return St(u)?null:e.scale(u)}var $3=function(e){var r=e.axis,n=e.ticks,a=e.offset,i=e.bandSize,o=e.entry,l=e.index;if(r.type==="category")return n[l]?n[l].coordinate+a:null;var u=ea(o,r.dataKey,r.domain[l]);return St(u)?null:r.scale(u)-i/2+a},xhe=function(e){var r=e.numericAxis,n=r.scale.domain();if(r.type==="number"){var a=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return a<=0&&i>=0?0:i<0?i:a}return n[0]},yhe=function(e,r){var n,a=(n=e.type)!==null&&n!==void 0&&n.defaultProps?fr(fr({},e.type.defaultProps),e.props):e.props,i=a.stackId;if(Mr(i)){var o=r[i];if(o){var l=o.items.indexOf(e);return l>=0?o.stackedData[l]:null}}return null},bhe=function(e){return e.reduce(function(r,n){return[A0(n.concat([r[0]]).filter(De)),ao(n.concat([r[1]]).filter(De))]},[1/0,-1/0])},mV=function(e,r,n){return Object.keys(e).reduce(function(a,i){var o=e[i],l=o.stackedData,u=l.reduce(function(d,h){var m=bhe(h.slice(r,n+1));return[Math.min(d[0],m[0]),Math.max(d[1],m[1])]},[1/0,-1/0]);return[Math.min(u[0],a[0]),Math.max(u[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},L3=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,F3=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PS=function(e,r,n){if(xt(e))return e(r,n);if(!Array.isArray(e))return r;var a=[];if(De(e[0]))a[0]=n?e[0]:Math.min(e[0],r[0]);else if(L3.test(e[0])){var i=+L3.exec(e[0])[1];a[0]=r[0]-i}else xt(e[0])?a[0]=e[0](r[0]):a[0]=r[0];if(De(e[1]))a[1]=n?e[1]:Math.max(e[1],r[1]);else if(F3.test(e[1])){var o=+F3.exec(e[1])[1];a[1]=r[1]+o}else xt(e[1])?a[1]=e[1](r[1]):a[1]=r[1];return a},iv=function(e,r,n){if(e&&e.scale&&e.scale.bandwidth){var a=e.scale.bandwidth();if(!n||a>0)return a}if(e&&r&&r.length>=2){for(var i=fk(r,function(m){return m.coordinate}),o=1/0,l=1,u=i.length;l<u;l++){var d=i[l],h=i[l-1];o=Math.min((d.coordinate||0)-(h.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},B3=function(e,r,n){return!e||!e.length||oh(e,_a(n,"type.defaultProps.domain"))?r:e},pV=function(e,r){var n=e.type.defaultProps?fr(fr({},e.type.defaultProps),e.props):e.props,a=n.dataKey,i=n.name,o=n.unit,l=n.formatter,u=n.tooltipType,d=n.chartType,h=n.hide;return fr(fr({},jt(e,!1)),{},{dataKey:a,unit:o,formatter:l,name:i||a,color:Lk(e),value:ea(r,a),type:u,payload:r,chartType:d,hide:h})};function fh(t){"@babel/helpers - typeof";return fh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fh(t)}function V3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function z3(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?V3(Object(r),!0).forEach(function(n){whe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function whe(t,e,r){return e=_he(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function _he(t){var e=jhe(t,"string");return fh(e)=="symbol"?e:e+""}function jhe(t,e){if(fh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ov=Math.PI/180,Nhe=function(e){return e*180/Math.PI},Yr=function(e,r,n,a){return{x:e+Math.cos(-ov*a)*n,y:r+Math.sin(-ov*a)*n}},She=function(e,r){var n=e.x,a=e.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(a-o,2))},Che=function(e,r){var n=e.x,a=e.y,i=r.cx,o=r.cy,l=She({x:n,y:a},{x:i,y:o});if(l<=0)return{radius:l};var u=(n-i)/l,d=Math.acos(u);return a>o&&(d=2*Math.PI-d),{radius:l,angle:Nhe(d),angleInRadian:d}},khe=function(e){var r=e.startAngle,n=e.endAngle,a=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(a,i);return{startAngle:r-o*360,endAngle:n-o*360}},Ehe=function(e,r){var n=r.startAngle,a=r.endAngle,i=Math.floor(n/360),o=Math.floor(a/360),l=Math.min(i,o);return e+l*360},U3=function(e,r){var n=e.x,a=e.y,i=Che({x:n,y:a},r),o=i.radius,l=i.angle,u=r.innerRadius,d=r.outerRadius;if(o<u||o>d)return!1;if(o===0)return!0;var h=khe(r),m=h.startAngle,p=h.endAngle,v=l,b;if(m<=p){for(;v>p;)v-=360;for(;v<m;)v+=360;b=v>=m&&v<=p}else{for(;v>m;)v-=360;for(;v<p;)v+=360;b=v>=p&&v<=m}return b?z3(z3({},r),{},{radius:o,angle:Ehe(v,r)}):null};function hh(t){"@babel/helpers - typeof";return hh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hh(t)}var Ahe=["offset"];function Phe(t){return Rhe(t)||Mhe(t)||Ohe(t)||The()}function The(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 722In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ohe(t,e){if(t){if(typeof t=="string")return TS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return TS(t,e)}}function Mhe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Rhe(t){if(Array.isArray(t))return TS(t)}function TS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ihe(t,e){if(t==null)return{};var r=Dhe(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Dhe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function q3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Er(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?q3(Object(r),!0).forEach(function(n){$he(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):q3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $he(t,e,r){return e=Lhe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Lhe(t){var e=Fhe(t,"string");return hh(e)=="symbol"?e:e+""}function Fhe(t,e){if(hh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function mh(){return mh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},mh.apply(this,arguments)}var Bhe=function(e){var r=e.value,n=e.formatter,a=St(e.children)?r:e.children;return xt(n)?n(a):a},Vhe=function(e,r){var n=es(r-e),a=Math.min(Math.abs(r-e),360);return n*a},zhe=function(e,r,n){var a=e.position,i=e.viewBox,o=e.offset,l=e.className,u=i,d=u.cx,h=u.cy,m=u.innerRadius,p=u.outerRadius,v=u.startAngle,b=u.endAngle,y=u.clockWise,x=(m+p)/2,j=Vhe(v,b),N=j>=0?1:-1,S,k;a==="insideStart"?(S=v+N*o,k=y):a==="insideEnd"?(S=b-N*o,k=!y):a==="end"&&(S=b+N*o,k=y),k=j<=0?k:!k;var C=Yr(d,h,x,S),A=Yr(d,h,x,S+(k?1:-1)*359),T="M".concat(C.x,",").concat(C.y,` 723 A`).concat(x,",").concat(x,",0,1,").concat(k?0:1,`, 724 `).concat(A.x,",").concat(A.y),R=St(e.id)?qh("recharts-radial-line-"):e.id;return U.createElement("text",mh({},n,{dominantBaseline:"central",className:Ct("recharts-radial-bar-label",l)}),U.createElement("defs",null,U.createElement("path",{id:R,d:T})),U.createElement("textPath",{xlinkHref:"#".concat(R)},r))},Uhe=function(e){var r=e.viewBox,n=e.offset,a=e.position,i=r,o=i.cx,l=i.cy,u=i.innerRadius,d=i.outerRadius,h=i.startAngle,m=i.endAngle,p=(h+m)/2;if(a==="outside"){var v=Yr(o,l,d+n,p),b=v.x,y=v.y;return{x:b,y,textAnchor:b>=o?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var x=(u+d)/2,j=Yr(o,l,x,p),N=j.x,S=j.y;return{x:N,y:S,textAnchor:"middle",verticalAnchor:"middle"}},qhe=function(e){var r=e.viewBox,n=e.parentViewBox,a=e.offset,i=e.position,o=r,l=o.x,u=o.y,d=o.width,h=o.height,m=h>=0?1:-1,p=m*a,v=m>0?"end":"start",b=m>0?"start":"end",y=d>=0?1:-1,x=y*a,j=y>0?"end":"start",N=y>0?"start":"end";if(i==="top"){var S={x:l+d/2,y:u-m*a,textAnchor:"middle",verticalAnchor:v};return Er(Er({},S),n?{height:Math.max(u-n.y,0),width:d}:{})}if(i==="bottom"){var k={x:l+d/2,y:u+h+p,textAnchor:"middle",verticalAnchor:b};return Er(Er({},k),n?{height:Math.max(n.y+n.height-(u+h),0),width:d}:{})}if(i==="left"){var C={x:l-x,y:u+h/2,textAnchor:j,verticalAnchor:"middle"};return Er(Er({},C),n?{width:Math.max(C.x-n.x,0),height:h}:{})}if(i==="right"){var A={x:l+d+x,y:u+h/2,textAnchor:N,verticalAnchor:"middle"};return Er(Er({},A),n?{width:Math.max(n.x+n.width-A.x,0),height:h}:{})}var T=n?{width:d,height:h}:{};return i==="insideLeft"?Er({x:l+x,y:u+h/2,textAnchor:N,verticalAnchor:"middle"},T):i==="insideRight"?Er({x:l+d-x,y:u+h/2,textAnchor:j,verticalAnchor:"middle"},T):i==="insideTop"?Er({x:l+d/2,y:u+p,textAnchor:"middle",verticalAnchor:b},T):i==="insideBottom"?Er({x:l+d/2,y:u+h-p,textAnchor:"middle",verticalAnchor:v},T):i==="insideTopLeft"?Er({x:l+x,y:u+p,textAnchor:N,verticalAnchor:b},T):i==="insideTopRight"?Er({x:l+d-x,y:u+p,textAnchor:j,verticalAnchor:b},T):i==="insideBottomLeft"?Er({x:l+x,y:u+h-p,textAnchor:N,verticalAnchor:v},T):i==="insideBottomRight"?Er({x:l+d-x,y:u+h-p,textAnchor:j,verticalAnchor:v},T):td(i)&&(De(i.x)||fl(i.x))&&(De(i.y)||fl(i.y))?Er({x:l+Sl(i.x,d),y:u+Sl(i.y,h),textAnchor:"end",verticalAnchor:"end"},T):Er({x:l+d/2,y:u+h/2,textAnchor:"middle",verticalAnchor:"middle"},T)},Whe=function(e){return"cx"in e&&De(e.cx)};function an(t){var e=t.offset,r=e===void 0?5:e,n=Ihe(t,Ahe),a=Er({offset:r},n),i=a.viewBox,o=a.position,l=a.value,u=a.children,d=a.content,h=a.className,m=h===void 0?"":h,p=a.textBreakAll;if(!i||St(l)&&St(u)&&!w.isValidElement(d)&&!xt(d))return null;if(w.isValidElement(d))return w.cloneElement(d,a);var v;if(xt(d)){if(v=w.createElement(d,a),w.isValidElement(v))return v}else v=Bhe(a);var b=Whe(i),y=jt(a,!0);if(b&&(o==="insideStart"||o==="insideEnd"||o==="end"))return zhe(a,v,y);var x=b?Uhe(a):qhe(a);return U.createElement(Hg,mh({className:Ct("recharts-label",m)},y,x,{breakAll:p}),v)}an.displayName="Label";var gV=function(e){var r=e.cx,n=e.cy,a=e.angle,i=e.startAngle,o=e.endAngle,l=e.r,u=e.radius,d=e.innerRadius,h=e.outerRadius,m=e.x,p=e.y,v=e.top,b=e.left,y=e.width,x=e.height,j=e.clockWise,N=e.labelViewBox;if(N)return N;if(De(y)&&De(x)){if(De(m)&&De(p))return{x:m,y:p,width:y,height:x};if(De(v)&&De(b))return{x:v,y:b,width:y,height:x}}return De(m)&&De(p)?{x:m,y:p,width:0,height:0}:De(r)&&De(n)?{cx:r,cy:n,startAngle:i||a||0,endAngle:o||a||0,innerRadius:d||0,outerRadius:h||u||l||0,clockWise:j}:e.viewBox?e.viewBox:{}},Hhe=function(e,r){return e?e===!0?U.createElement(an,{key:"label-implicit",viewBox:r}):Mr(e)?U.createElement(an,{key:"label-implicit",viewBox:r,value:e}):w.isValidElement(e)?e.type===an?w.cloneElement(e,{key:"label-implicit",viewBox:r}):U.createElement(an,{key:"label-implicit",content:e,viewBox:r}):xt(e)?U.createElement(an,{key:"label-implicit",content:e,viewBox:r}):td(e)?U.createElement(an,mh({viewBox:r},e,{key:"label-implicit"})):null:null},Ghe=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var a=e.children,i=gV(e),o=rs(a,an).map(function(u,d){return w.cloneElement(u,{viewBox:r||i,key:"label-".concat(d)})});if(!n)return o;var l=Hhe(e.label,r||i);return[l].concat(Phe(o))};an.parseViewBox=gV;an.renderCallByParent=Ghe;var aj,W3;function Khe(){if(W3)return aj;W3=1;function t(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}return aj=t,aj}var Yhe=Khe();const Xhe=Ft(Yhe);function ph(t){"@babel/helpers - typeof";return ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ph(t)}var Zhe=["valueAccessor"],Qhe=["data","dataKey","clockWise","id","textBreakAll"];function Jhe(t){return nme(t)||rme(t)||tme(t)||eme()}function eme(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 725In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tme(t,e){if(t){if(typeof t=="string")return OS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OS(t,e)}}function rme(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function nme(t){if(Array.isArray(t))return OS(t)}function OS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function lv(){return lv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},lv.apply(this,arguments)}function H3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function G3(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?H3(Object(r),!0).forEach(function(n){ame(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):H3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ame(t,e,r){return e=sme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sme(t){var e=ime(t,"string");return ph(e)=="symbol"?e:e+""}function ime(t,e){if(ph(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ph(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function K3(t,e){if(t==null)return{};var r=ome(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ome(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var lme=function(e){return Array.isArray(e.value)?Xhe(e.value):e.value};function uo(t){var e=t.valueAccessor,r=e===void 0?lme:e,n=K3(t,Zhe),a=n.data,i=n.dataKey,o=n.clockWise,l=n.id,u=n.textBreakAll,d=K3(n,Qhe);return!a||!a.length?null:U.createElement(lr,{className:"recharts-label-list"},a.map(function(h,m){var p=St(i)?r(h,m):ea(h&&h.payload,i),v=St(l)?{}:{id:"".concat(l,"-").concat(m)};return U.createElement(an,lv({},jt(h,!0),d,v,{parentViewBox:h.parentViewBox,value:p,textBreakAll:u,viewBox:an.parseViewBox(St(o)?h:G3(G3({},h),{},{clockWise:o})),key:"label-".concat(m),index:m}))}))}uo.displayName="LabelList";function cme(t,e){return t?t===!0?U.createElement(uo,{key:"labelList-implicit",data:e}):U.isValidElement(t)||xt(t)?U.createElement(uo,{key:"labelList-implicit",data:e,content:t}):td(t)?U.createElement(uo,lv({data:e},t,{key:"labelList-implicit"})):null:null}function ume(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var n=t.children,a=rs(n,uo).map(function(o,l){return w.cloneElement(o,{data:e,key:"labelList-".concat(l)})});if(!r)return a;var i=cme(t.label,e);return[i].concat(Jhe(a))}uo.renderCallByParent=ume;function gh(t){"@babel/helpers - typeof";return gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gh(t)}function MS(){return MS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},MS.apply(this,arguments)}function Y3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function X3(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Y3(Object(r),!0).forEach(function(n){dme(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Y3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function dme(t,e,r){return e=fme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function fme(t){var e=hme(t,"string");return gh(e)=="symbol"?e:e+""}function hme(t,e){if(gh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var mme=function(e,r){var n=es(r-e),a=Math.min(Math.abs(r-e),359.999);return n*a},zp=function(e){var r=e.cx,n=e.cy,a=e.radius,i=e.angle,o=e.sign,l=e.isExternal,u=e.cornerRadius,d=e.cornerIsExternal,h=u*(l?1:-1)+a,m=Math.asin(u/h)/ov,p=d?i:i+o*m,v=Yr(r,n,h,p),b=Yr(r,n,a,p),y=d?i-o*m:i,x=Yr(r,n,h*Math.cos(m*ov),y);return{center:v,circleTangency:b,lineTangency:x,theta:m}},vV=function(e){var r=e.cx,n=e.cy,a=e.innerRadius,i=e.outerRadius,o=e.startAngle,l=e.endAngle,u=mme(o,l),d=o+u,h=Yr(r,n,i,o),m=Yr(r,n,i,d),p="M ".concat(h.x,",").concat(h.y,` 726 A `).concat(i,",").concat(i,`,0, 727 `).concat(+(Math.abs(u)>180),",").concat(+(o>d),`, 728 `).concat(m.x,",").concat(m.y,` 729 `);if(a>0){var v=Yr(r,n,a,o),b=Yr(r,n,a,d);p+="L ".concat(b.x,",").concat(b.y,` 730 A `).concat(a,",").concat(a,`,0, 731 `).concat(+(Math.abs(u)>180),",").concat(+(o<=d),`, 732 `).concat(v.x,",").concat(v.y," Z")}else p+="L ".concat(r,",").concat(n," Z");return p},pme=function(e){var r=e.cx,n=e.cy,a=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,l=e.forceCornerRadius,u=e.cornerIsExternal,d=e.startAngle,h=e.endAngle,m=es(h-d),p=zp({cx:r,cy:n,radius:i,angle:d,sign:m,cornerRadius:o,cornerIsExternal:u}),v=p.circleTangency,b=p.lineTangency,y=p.theta,x=zp({cx:r,cy:n,radius:i,angle:h,sign:-m,cornerRadius:o,cornerIsExternal:u}),j=x.circleTangency,N=x.lineTangency,S=x.theta,k=u?Math.abs(d-h):Math.abs(d-h)-y-S;if(k<0)return l?"M ".concat(b.x,",").concat(b.y,` 733 a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0 734 a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0 735 `):vV({cx:r,cy:n,innerRadius:a,outerRadius:i,startAngle:d,endAngle:h});var C="M ".concat(b.x,",").concat(b.y,` 736 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(v.x,",").concat(v.y,` 737 A`).concat(i,",").concat(i,",0,").concat(+(k>180),",").concat(+(m<0),",").concat(j.x,",").concat(j.y,` 738 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(N.x,",").concat(N.y,` 739 `);if(a>0){var A=zp({cx:r,cy:n,radius:a,angle:d,sign:m,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),T=A.circleTangency,R=A.lineTangency,I=A.theta,D=zp({cx:r,cy:n,radius:a,angle:h,sign:-m,isExternal:!0,cornerRadius:o,cornerIsExternal:u}),L=D.circleTangency,z=D.lineTangency,H=D.theta,Z=u?Math.abs(d-h):Math.abs(d-h)-I-H;if(Z<0&&o===0)return"".concat(C,"L").concat(r,",").concat(n,"Z");C+="L".concat(z.x,",").concat(z.y,` 740 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(L.x,",").concat(L.y,` 741 A`).concat(a,",").concat(a,",0,").concat(+(Z>180),",").concat(+(m>0),",").concat(T.x,",").concat(T.y,` 742 A`).concat(o,",").concat(o,",0,0,").concat(+(m<0),",").concat(R.x,",").concat(R.y,"Z")}else C+="L".concat(r,",").concat(n,"Z");return C},gme={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},xV=function(e){var r=X3(X3({},gme),e),n=r.cx,a=r.cy,i=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,u=r.forceCornerRadius,d=r.cornerIsExternal,h=r.startAngle,m=r.endAngle,p=r.className;if(o<i||h===m)return null;var v=Ct("recharts-sector",p),b=o-i,y=Sl(l,b,0,!0),x;return y>0&&Math.abs(h-m)<360?x=pme({cx:n,cy:a,innerRadius:i,outerRadius:o,cornerRadius:Math.min(y,b/2),forceCornerRadius:u,cornerIsExternal:d,startAngle:h,endAngle:m}):x=vV({cx:n,cy:a,innerRadius:i,outerRadius:o,startAngle:h,endAngle:m}),U.createElement("path",MS({},jt(r,!0),{className:v,d:x,role:"img"}))};function vh(t){"@babel/helpers - typeof";return vh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vh(t)}function RS(){return RS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},RS.apply(this,arguments)}function Z3(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Q3(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Z3(Object(r),!0).forEach(function(n){vme(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z3(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vme(t,e,r){return e=xme(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xme(t){var e=yme(t,"string");return vh(e)=="symbol"?e:e+""}function yme(t,e){if(vh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(vh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var J3={curveBasisClosed:Lse,curveBasisOpen:Fse,curveBasis:$se,curveBumpX:jse,curveBumpY:Nse,curveLinearClosed:Bse,curveLinear:x0,curveMonotoneX:Vse,curveMonotoneY:zse,curveNatural:Use,curveStep:qse,curveStepAfter:Hse,curveStepBefore:Wse},Up=function(e){return e.x===+e.x&&e.y===+e.y},af=function(e){return e.x},sf=function(e){return e.y},bme=function(e,r){if(xt(e))return e;var n="curve".concat(g0(e));return(n==="curveMonotone"||n==="curveBump")&&r?J3["".concat(n).concat(r==="vertical"?"Y":"X")]:J3[n]||x0},wme=function(e){var r=e.type,n=r===void 0?"linear":r,a=e.points,i=a===void 0?[]:a,o=e.baseLine,l=e.layout,u=e.connectNulls,d=u===void 0?!1:u,h=bme(n,l),m=d?i.filter(function(y){return Up(y)}):i,p;if(Array.isArray(o)){var v=d?o.filter(function(y){return Up(y)}):o,b=m.map(function(y,x){return Q3(Q3({},y),{},{base:v[x]})});return l==="vertical"?p=Rp().y(sf).x1(af).x0(function(y){return y.base.x}):p=Rp().x(af).y1(sf).y0(function(y){return y.base.y}),p.defined(Up).curve(h),p(b)}return l==="vertical"&&De(o)?p=Rp().y(sf).x1(af).x0(o):De(o)?p=Rp().x(af).y1(sf).y0(o):p=_F().x(af).y(sf),p.defined(Up).curve(h),p(m)},Of=function(e){var r=e.className,n=e.points,a=e.path,i=e.pathRef;if((!n||!n.length)&&!a)return null;var o=n&&n.length?wme(e):a;return w.createElement("path",RS({},jt(e,!1),Rg(e),{className:Ct("recharts-curve",r),d:o,ref:i}))},sj={exports:{}},ij,eD;function _me(){if(eD)return ij;eD=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ij=t,ij}var oj,tD;function jme(){if(tD)return oj;tD=1;var t=_me();function e(){}function r(){}return r.resetWarningCache=e,oj=function(){function n(o,l,u,d,h,m){if(m!==t){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}n.isRequired=n;function a(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},oj}var rD;function Nme(){return rD||(rD=1,sj.exports=jme()()),sj.exports}
742var Sme=Nme();const Lt=Ft(Sme);var Cme=Object.getOwnPropertyNames,kme=Object.getOwnPropertySymbols,Eme=Object.prototype.hasOwnProperty;function nD(t,e){return function(n,a,i){return t(n,a,i)&&e(n,a,i)}}function qp(t){return function(r,n,a){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,a);var i=a.cache,o=i.get(r),l=i.get(n);if(o&&l)return o===n&&l===r;i.set(r,n),i.set(n,r);var u=t(r,n,a);return i.delete(r),i.delete(n),u}}function Ame(t){return t!=null?t[Symbol.toStringTag]:void 0}function aD(t){return Cme(t).concat(kme(t))}var Pme=Object.hasOwn||(function(t,e){return Eme.call(t,e)});function Hl(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var Tme="__v",Ome="__o",Mme="_owner",sD=Object.getOwnPropertyDescriptor,iD=Object.keys;function Rme(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function Ime(t,e){return Hl(t.getTime(),e.getTime())}function Dme(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function $me(t,e){return t===e}function oD(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var a=new Array(n),i=t.entries(),o,l,u=0;(o=i.next())&&!o.done;){for(var d=e.entries(),h=!1,m=0;(l=d.next())&&!l.done;){if(a[m]){m++;continue}var p=o.value,v=l.value;if(r.equals(p[0],v[0],u,m,t,e,r)&&r.equals(p[1],v[1],p[0],v[0],t,e,r)){h=a[m]=!0;break}m++}if(!h)return!1;u++}return!0}var Lme=Hl;function Fme(t,e,r){var n=iD(t),a=n.length;if(iD(e).length!==a)return!1;for(;a-- >0;)if(!yV(t,e,r,n[a]))return!1;return!0}function of(t,e,r){var n=aD(t),a=n.length;if(aD(e).length!==a)return!1;for(var i,o,l;a-- >0;)if(i=n[a],!yV(t,e,r,i)||(o=sD(t,i),l=sD(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function Bme(t,e){return Hl(t.valueOf(),e.valueOf())}function Vme(t,e){return t.source===e.source&&t.flags===e.flags}function lD(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var a=new Array(n),i=t.values(),o,l;(o=i.next())&&!o.done;){for(var u=e.values(),d=!1,h=0;(l=u.next())&&!l.done;){if(!a[h]&&r.equals(o.value,l.value,o.value,l.value,t,e,r)){d=a[h]=!0;break}h++}if(!d)return!1}return!0}function zme(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function Ume(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function yV(t,e,r,n){return(n===Mme||n===Ome||n===Tme)&&(t.$$typeof||e.$$typeof)?!0:Pme(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var qme="[object Arguments]",Wme="[object Boolean]",Hme="[object Date]",Gme="[object Error]",Kme="[object Map]",Yme="[object Number]",Xme="[object Object]",Zme="[object RegExp]",Qme="[object Set]",Jme="[object String]",epe="[object URL]",tpe=Array.isArray,cD=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,uD=Object.assign,rpe=Object.prototype.toString.call.bind(Object.prototype.toString);function npe(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areErrorsEqual,a=t.areFunctionsEqual,i=t.areMapsEqual,o=t.areNumbersEqual,l=t.areObjectsEqual,u=t.arePrimitiveWrappersEqual,d=t.areRegExpsEqual,h=t.areSetsEqual,m=t.areTypedArraysEqual,p=t.areUrlsEqual,v=t.unknownTagComparators;return function(y,x,j){if(y===x)return!0;if(y==null||x==null)return!1;var N=typeof y;if(N!==typeof x)return!1;if(N!=="object")return N==="number"?o(y,x,j):N==="function"?a(y,x,j):!1;var S=y.constructor;if(S!==x.constructor)return!1;if(S===Object)return l(y,x,j);if(tpe(y))return e(y,x,j);if(cD!=null&&cD(y))return m(y,x,j);if(S===Date)return r(y,x,j);if(S===RegExp)return d(y,x,j);if(S===Map)return i(y,x,j);if(S===Set)return h(y,x,j);var k=rpe(y);if(k===Hme)return r(y,x,j);if(k===Zme)return d(y,x,j);if(k===Kme)return i(y,x,j);if(k===Qme)return h(y,x,j);if(k===Xme)return typeof y.then!="function"&&typeof x.then!="function"&&l(y,x,j);if(k===epe)return p(y,x,j);if(k===Gme)return n(y,x,j);if(k===qme)return l(y,x,j);if(k===Wme||k===Yme||k===Jme)return u(y,x,j);if(v){var C=v[k];if(!C){var A=Ame(y);A&&(C=v[A])}if(C)return C(y,x,j)}return!1}}function ape(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,a={areArraysEqual:n?of:Rme,areDatesEqual:Ime,areErrorsEqual:Dme,areFunctionsEqual:$me,areMapsEqual:n?nD(oD,of):oD,areNumbersEqual:Lme,areObjectsEqual:n?of:Fme,arePrimitiveWrappersEqual:Bme,areRegExpsEqual:Vme,areSetsEqual:n?nD(lD,of):lD,areTypedArraysEqual:n?of:zme,areUrlsEqual:Ume,unknownTagComparators:void 0};
vendor: 165,916 bytes, lines 742-764
742if(r&&(a=uD({},a,r(a))),e){var i=qp(a.areArraysEqual),o=qp(a.areMapsEqual),l=qp(a.areObjectsEqual),u=qp(a.areSetsEqual);a=uD({},a,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:u})}return a}function spe(t){return function(e,r,n,a,i,o,l){return t(e,r,l)}}function ipe(t){var e=t.circular,r=t.comparator,n=t.createState,a=t.equals,i=t.strict;if(n)return function(u,d){var h=n(),m=h.cache,p=m===void 0?e?new WeakMap:void 0:m,v=h.meta;return r(u,d,{cache:p,equals:a,meta:v,strict:i})};if(e)return function(u,d){return r(u,d,{cache:new WeakMap,equals:a,meta:void 0,strict:i})};var o={cache:void 0,equals:a,meta:void 0,strict:i};return function(u,d){return r(u,d,o)}}var ope=To();To({strict:!0});To({circular:!0});To({circular:!0,strict:!0});To({createInternalComparator:function(){return Hl}});To({strict:!0,createInternalComparator:function(){return Hl}});To({circular:!0,createInternalComparator:function(){return Hl}});To({circular:!0,createInternalComparator:function(){return Hl},strict:!0});function To(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,a=t.createState,i=t.strict,o=i===void 0?!1:i,l=ape(t),u=npe(l),d=n?n(u):spe(u);return ipe({circular:r,comparator:u,createState:a,equals:d,strict:o})}function lpe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function dD(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function a(i){r<0&&(r=i),i-r>e?(t(i),r=-1):lpe(a)};requestAnimationFrame(n)}function IS(t){"@babel/helpers - typeof";return IS=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},IS(t)}function cpe(t){return hpe(t)||fpe(t)||dpe(t)||upe()}function upe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 743In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dpe(t,e){if(t){if(typeof t=="string")return fD(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fD(t,e)}}function fD(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function fpe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function hpe(t){if(Array.isArray(t))return t}function mpe(){var t={},e=function(){return null},r=!1,n=function a(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,l=cpe(o),u=l[0],d=l.slice(1);if(typeof u=="number"){dD(a.bind(null,d),u);return}a(u),dD(a.bind(null,d));return}IS(i)==="object"&&(t=i,e(t)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return e=i,function(){e=function(){return null}}}}}function xh(t){"@babel/helpers - typeof";return xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xh(t)}function hD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function mD(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hD(Object(r),!0).forEach(function(n){bV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function bV(t,e,r){return e=ppe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ppe(t){var e=gpe(t,"string");return xh(e)==="symbol"?e:String(e)}function gpe(t,e){if(xh(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(xh(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var vpe=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,a){return n.filter(function(i){return a.includes(i)})})},xpe=function(e){return e},ype=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},Mf=function(e,r){return Object.keys(r).reduce(function(n,a){return mD(mD({},n),{},bV({},a,e(a,r[a])))},{})},pD=function(e,r,n){return e.map(function(a){return"".concat(ype(a)," ").concat(r,"ms ").concat(n)}).join(",")};function bpe(t,e){return jpe(t)||_pe(t,e)||wV(t,e)||wpe()}function wpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 744In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _pe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function jpe(t){if(Array.isArray(t))return t}function Npe(t){return kpe(t)||Cpe(t)||wV(t)||Spe()}function Spe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 745In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wV(t,e){if(t){if(typeof t=="string")return DS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return DS(t,e)}}function Cpe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function kpe(t){if(Array.isArray(t))return DS(t)}function DS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var cv=1e-4,_V=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},jV=function(e,r){return e.map(function(n,a){return n*Math.pow(r,a)}).reduce(function(n,a){return n+a})},gD=function(e,r){return function(n){var a=_V(e,r);return jV(a,n)}},Epe=function(e,r){return function(n){var a=_V(e,r),i=[].concat(Npe(a.map(function(o,l){return o*l}).slice(1)),[0]);return jV(i,n)}},vD=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var a=r[0],i=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":a=0,i=0,o=1,l=1;break;case"ease":a=.25,i=.1,o=.25,l=1;break;case"ease-in":a=.42,i=0,o=1,l=1;break;case"ease-out":a=.42,i=0,o=.58,l=1;break;case"ease-in-out":a=0,i=0,o=.58,l=1;break;default:{var u=r[0].split("(");if(u[0]==="cubic-bezier"&&u[1].split(")")[0].split(",").length===4){var d=u[1].split(")")[0].split(",").map(function(x){return parseFloat(x)}),h=bpe(d,4);a=h[0],i=h[1],o=h[2],l=h[3]}}}var m=gD(a,o),p=gD(i,l),v=Epe(a,o),b=function(j){return j>1?1:j<0?0:j},y=function(j){for(var N=j>1?1:j,S=N,k=0;k<8;++k){var C=m(S)-N,A=v(S);if(Math.abs(C-N)<cv||A<cv)return p(S);S=b(S-C/A)}return p(S)};return y.isStepper=!1,y},Ape=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.stiff,n=r===void 0?100:r,a=e.damping,i=a===void 0?8:a,o=e.dt,l=o===void 0?17:o,u=function(h,m,p){var v=-(h-m)*n,b=p*i,y=p+(v-b)*l/1e3,x=p*l/1e3+h;return Math.abs(x-m)<cv&&Math.abs(y)<cv?[m,0]:[x,y]};return u.isStepper=!0,u.dt=l,u},Ppe=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var a=r[0];if(typeof a=="string")switch(a){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return vD(a);case"spring":return Ape();default:if(a.split("(")[0]==="cubic-bezier")return vD(a)}return typeof a=="function"?a:null};function yh(t){"@babel/helpers - typeof";return yh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yh(t)}function xD(t){return Mpe(t)||Ope(t)||NV(t)||Tpe()}function Tpe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 746In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ope(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Mpe(t){if(Array.isArray(t))return LS(t)}function yD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Gr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?yD(Object(r),!0).forEach(function(n){$S(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function $S(t,e,r){return e=Rpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rpe(t){var e=Ipe(t,"string");return yh(e)==="symbol"?e:String(e)}function Ipe(t,e){if(yh(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(yh(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dpe(t,e){return Fpe(t)||Lpe(t,e)||NV(t,e)||$pe()}function $pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 747In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NV(t,e){if(t){if(typeof t=="string")return LS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return LS(t,e)}}function LS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Lpe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function Fpe(t){if(Array.isArray(t))return t}var uv=function(e,r,n){return e+(r-e)*n},FS=function(e){var r=e.from,n=e.to;return r!==n},Bpe=function t(e,r,n){var a=Mf(function(i,o){if(FS(o)){var l=e(o.from,o.to,o.velocity),u=Dpe(l,2),d=u[0],h=u[1];return Gr(Gr({},o),{},{from:d,velocity:h})}return o},r);return n<1?Mf(function(i,o){return FS(o)?Gr(Gr({},o),{},{velocity:uv(o.velocity,a[i].velocity,n),from:uv(o.from,a[i].from,n)}):o},r):t(e,a,n-1)};const Vpe=(function(t,e,r,n,a){var i=vpe(t,e),o=i.reduce(function(x,j){return Gr(Gr({},x),{},$S({},j,[t[j],e[j]]))},{}),l=i.reduce(function(x,j){return Gr(Gr({},x),{},$S({},j,{from:t[j],velocity:0,to:e[j]}))},{}),u=-1,d,h,m=function(){return null},p=function(){return Mf(function(j,N){return N.from},l)},v=function(){return!Object.values(l).filter(FS).length},b=function(j){d||(d=j);var N=j-d,S=N/r.dt;l=Bpe(r,l,S),a(Gr(Gr(Gr({},t),e),p())),d=j,v()||(u=requestAnimationFrame(m))},y=function(j){h||(h=j);var N=(j-h)/n,S=Mf(function(C,A){return uv.apply(void 0,xD(A).concat([r(N)]))},o);if(a(Gr(Gr(Gr({},t),e),S)),N<1)u=requestAnimationFrame(m);else{var k=Mf(function(C,A){return uv.apply(void 0,xD(A).concat([r(1)]))},o);a(Gr(Gr(Gr({},t),e),k))}};return m=r.isStepper?b:y,function(){return requestAnimationFrame(m),function(){cancelAnimationFrame(u)}}});function _u(t){"@babel/helpers - typeof";return _u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_u(t)}var zpe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function Upe(t,e){if(t==null)return{};var r=qpe(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function qpe(t,e){if(t==null)return{};var r={},n=Object.keys(t),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(r[a]=t[a]);return r}function lj(t){return Kpe(t)||Gpe(t)||Hpe(t)||Wpe()}function Wpe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 748In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hpe(t,e){if(t){if(typeof t=="string")return BS(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return BS(t,e)}}function Gpe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Kpe(t){if(Array.isArray(t))return BS(t)}function BS(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Fa(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bD(Object(r),!0).forEach(function(n){xf(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function xf(t,e,r){return e=SV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ype(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xpe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,SV(n.key),n)}}function Zpe(t,e,r){return e&&Xpe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function SV(t){var e=Qpe(t,"string");return _u(e)==="symbol"?e:String(e)}function Qpe(t,e){if(_u(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_u(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Jpe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&VS(t,e)}function VS(t,e){return VS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},VS(t,e)}function ege(t){var e=tge();return function(){var n=dv(t),a;if(e){var i=dv(this).constructor;a=Reflect.construct(n,arguments,i)}else a=n.apply(this,arguments);return zS(this,a)}}function zS(t,e){if(e&&(_u(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return US(t)}function US(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tge(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function dv(t){return dv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},dv(t)}var pi=(function(t){Jpe(r,t);var e=ege(r);function r(n,a){var i;Ype(this,r),i=e.call(this,n,a);var o=i.props,l=o.isActive,u=o.attributeName,d=o.from,h=o.to,m=o.steps,p=o.children,v=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(US(i)),i.changeStyle=i.changeStyle.bind(US(i)),!l||v<=0)return i.state={style:{}},typeof p=="function"&&(i.state={style:h}),zS(i);if(m&&m.length)i.state={style:m[0].style};else if(d){if(typeof p=="function")return i.state={style:d},zS(i);i.state={style:u?xf({},u,d):d}}else i.state={style:{}};return i}return Zpe(r,[{key:"componentDidMount",value:function(){var a=this.props,i=a.isActive,o=a.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var i=this.props,o=i.isActive,l=i.canBegin,u=i.attributeName,d=i.shouldReAnimate,h=i.to,m=i.from,p=this.state.style;if(l){if(!o){var v={style:u?xf({},u,h):h};this.state&&p&&(u&&p[u]!==h||!u&&p!==h)&&this.setState(v);return}if(!(ope(a.to,h)&&a.canBegin&&a.isActive)){var b=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=b||d?m:a.to;if(this.state&&p){var x={style:u?xf({},u,y):y};(u&&p[u]!==y||!u&&p!==y)&&this.setState(x)}this.runAnimation(Fa(Fa({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var i=this,o=a.from,l=a.to,u=a.duration,d=a.easing,h=a.begin,m=a.onAnimationEnd,p=a.onAnimationStart,v=Vpe(o,l,Ppe(d),u,this.changeStyle),b=function(){i.stopJSAnimation=v()};this.manager.start([p,h,b,u,m])}},{key:"runStepAnimation",value:function(a){var i=this,o=a.steps,l=a.begin,u=a.onAnimationStart,d=o[0],h=d.style,m=d.duration,p=m===void 0?0:m,v=function(y,x,j){if(j===0)return y;var N=x.duration,S=x.easing,k=S===void 0?"ease":S,C=x.style,A=x.properties,T=x.onAnimationEnd,R=j>0?o[j-1]:x,I=A||Object.keys(C);if(typeof k=="function"||k==="spring")return[].concat(lj(y),[i.runJSAnimation.bind(i,{from:R.style,to:C,duration:N,easing:k}),N]);var D=pD(I,N,k),L=Fa(Fa(Fa({},R.style),C),{},{transition:D});return[].concat(lj(y),[L,N,T]).filter(xpe)};return this.manager.start([u].concat(lj(o.reduce(v,[h,Math.max(p,l)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=mpe());var i=a.begin,o=a.duration,l=a.attributeName,u=a.to,d=a.easing,h=a.onAnimationStart,m=a.onAnimationEnd,p=a.steps,v=a.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof d=="function"||typeof v=="function"||d==="spring"){this.runJSAnimation(a);return}if(p.length>1){this.runStepAnimation(a);return}var y=l?xf({},l,u):u,x=pD(Object.keys(y),o,d);b.start([h,i,Fa(Fa({},y),{},{transition:x}),o,m])}},{key:"render",value:function(){var a=this.props,i=a.children;a.begin;var o=a.duration;a.attributeName,a.easing;var l=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var u=Upe(a,zpe),d=w.Children.count(i),h=this.state.style;if(typeof i=="function")return i(h);if(!l||d===0||o<=0)return i;var m=function(v){var b=v.props,y=b.style,x=y===void 0?{}:y,j=b.className,N=w.cloneElement(v,Fa(Fa({},u),{},{style:Fa(Fa({},x),h),className:j}));return N};return d===1?m(w.Children.only(i)):U.createElement("div",null,w.Children.map(i,function(p){return m(p)}))}}]),r})(w.PureComponent);pi.displayName="Animate";pi.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};pi.propTypes={from:Lt.oneOfType([Lt.object,Lt.string]),to:Lt.oneOfType([Lt.object,Lt.string]),attributeName:Lt.string,duration:Lt.number,begin:Lt.number,easing:Lt.oneOfType([Lt.string,Lt.func]),steps:Lt.arrayOf(Lt.shape({duration:Lt.number.isRequired,style:Lt.object.isRequired,easing:Lt.oneOfType([Lt.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Lt.func]),properties:Lt.arrayOf("string"),onAnimationEnd:Lt.func})),children:Lt.oneOfType([Lt.node,Lt.func]),isActive:Lt.bool,canBegin:Lt.bool,onAnimationEnd:Lt.func,shouldReAnimate:Lt.bool,onAnimationStart:Lt.func,onAnimationReStart:Lt.func};function bh(t){"@babel/helpers - typeof";return bh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bh(t)}function fv(){return fv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},fv.apply(this,arguments)}function rge(t,e){return ige(t)||sge(t,e)||age(t,e)||nge()}function nge(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 749In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function age(t,e){if(t){if(typeof t=="string")return wD(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wD(t,e)}}function wD(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sge(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function ige(t){if(Array.isArray(t))return t}function _D(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function jD(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_D(Object(r),!0).forEach(function(n){oge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_D(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oge(t,e,r){return e=lge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lge(t){var e=cge(t,"string");return bh(e)=="symbol"?e:e+""}function cge(t,e){if(bh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(bh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ND=function(e,r,n,a,i){var o=Math.min(Math.abs(n)/2,Math.abs(a)/2),l=a>=0?1:-1,u=n>=0?1:-1,d=a>=0&&n>=0||a<0&&n<0?1:0,h;if(o>0&&i instanceof Array){for(var m=[0,0,0,0],p=0,v=4;p<v;p++)m[p]=i[p]>o?o:i[p];h="M".concat(e,",").concat(r+l*m[0]),m[0]>0&&(h+="A ".concat(m[0],",").concat(m[0],",0,0,").concat(d,",").concat(e+u*m[0],",").concat(r)),h+="L ".concat(e+n-u*m[1],",").concat(r),m[1]>0&&(h+="A ".concat(m[1],",").concat(m[1],",0,0,").concat(d,`, 750 `).concat(e+n,",").concat(r+l*m[1])),h+="L ".concat(e+n,",").concat(r+a-l*m[2]),m[2]>0&&(h+="A ".concat(m[2],",").concat(m[2],",0,0,").concat(d,`, 751 `).concat(e+n-u*m[2],",").concat(r+a)),h+="L ".concat(e+u*m[3],",").concat(r+a),m[3]>0&&(h+="A ".concat(m[3],",").concat(m[3],",0,0,").concat(d,`, 752 `).concat(e,",").concat(r+a-l*m[3])),h+="Z"}else if(o>0&&i===+i&&i>0){var b=Math.min(o,i);h="M ".concat(e,",").concat(r+l*b,` 753 A `).concat(b,",").concat(b,",0,0,").concat(d,",").concat(e+u*b,",").concat(r,` 754 L `).concat(e+n-u*b,",").concat(r,` 755 A `).concat(b,",").concat(b,",0,0,").concat(d,",").concat(e+n,",").concat(r+l*b,` 756 L `).concat(e+n,",").concat(r+a-l*b,` 757 A `).concat(b,",").concat(b,",0,0,").concat(d,",").concat(e+n-u*b,",").concat(r+a,` 758 L `).concat(e+u*b,",").concat(r+a,` 759 A `).concat(b,",").concat(b,",0,0,").concat(d,",").concat(e,",").concat(r+a-l*b," Z")}else h="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(a," h ").concat(-n," Z");return h},uge=function(e,r){if(!e||!r)return!1;var n=e.x,a=e.y,i=r.x,o=r.y,l=r.width,u=r.height;if(Math.abs(l)>0&&Math.abs(u)>0){var d=Math.min(i,i+l),h=Math.max(i,i+l),m=Math.min(o,o+u),p=Math.max(o,o+u);return n>=d&&n<=h&&a>=m&&a<=p}return!1},dge={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Fk=function(e){var r=jD(jD({},dge),e),n=w.useRef(),a=w.useState(-1),i=rge(a,2),o=i[0],l=i[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var k=n.current.getTotalLength();k&&l(k)}catch{}},[]);var u=r.x,d=r.y,h=r.width,m=r.height,p=r.radius,v=r.className,b=r.animationEasing,y=r.animationDuration,x=r.animationBegin,j=r.isAnimationActive,N=r.isUpdateAnimationActive;if(u!==+u||d!==+d||h!==+h||m!==+m||h===0||m===0)return null;var S=Ct("recharts-rectangle",v);return N?U.createElement(pi,{canBegin:o>0,from:{width:h,height:m,x:u,y:d},to:{width:h,height:m,x:u,y:d},duration:y,animationEasing:b,isActive:N},function(k){var C=k.width,A=k.height,T=k.x,R=k.y;return U.createElement(pi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:y,isActive:j,easing:b},U.createElement("path",fv({},jt(r,!0),{className:S,d:ND(T,R,C,A,p),ref:n})))}):U.createElement("path",fv({},jt(r,!0),{className:S,d:ND(u,d,h,m,p)}))};function qS(){return qS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},qS.apply(this,arguments)}var Bk=function(e){var r=e.cx,n=e.cy,a=e.r,i=e.className,o=Ct("recharts-dot",i);return r===+r&&n===+n&&a===+a?w.createElement("circle",qS({},jt(e,!1),Rg(e),{className:o,cx:r,cy:n,r:a})):null};function wh(t){"@babel/helpers - typeof";return wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wh(t)}var fge=["x","y","top","left","width","height","className"];function WS(){return WS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},WS.apply(this,arguments)}function SD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function hge(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?SD(Object(r),!0).forEach(function(n){mge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):SD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function mge(t,e,r){return e=pge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pge(t){var e=gge(t,"string");return wh(e)=="symbol"?e:e+""}function gge(t,e){if(wh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function vge(t,e){if(t==null)return{};var r=xge(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function xge(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var yge=function(e,r,n,a,i,o){return"M".concat(e,",").concat(i,"v").concat(a,"M").concat(o,",").concat(r,"h").concat(n)},bge=function(e){var r=e.x,n=r===void 0?0:r,a=e.y,i=a===void 0?0:a,o=e.top,l=o===void 0?0:o,u=e.left,d=u===void 0?0:u,h=e.width,m=h===void 0?0:h,p=e.height,v=p===void 0?0:p,b=e.className,y=vge(e,fge),x=hge({x:n,y:i,top:l,left:d,width:m,height:v},y);return!De(n)||!De(i)||!De(m)||!De(v)||!De(l)||!De(d)?null:U.createElement("path",WS({},jt(x,!0),{className:Ct("recharts-cross",b),d:yge(n,i,m,v,l,d)}))},cj,CD;function wge(){if(CD)return cj;CD=1;var t=WF(),e=t(Object.getPrototypeOf,Object);return cj=e,cj}var uj,kD;function _ge(){if(kD)return uj;kD=1;var t=bi(),e=wge(),r=wi(),n="[object Object]",a=Function.prototype,i=Object.prototype,o=a.toString,l=i.hasOwnProperty,u=o.call(Object);function d(h){if(!r(h)||t(h)!=n)return!1;var m=e(h);if(m===null)return!0;var p=l.call(m,"constructor")&&m.constructor;return typeof p=="function"&&p instanceof p&&o.call(p)==u}return uj=d,uj}var jge=_ge();const Nge=Ft(jge);var dj,ED;function Sge(){if(ED)return dj;ED=1;var t=bi(),e=wi(),r="[object Boolean]";function n(a){return a===!0||a===!1||e(a)&&t(a)==r}return dj=n,dj}var Cge=Sge();const kge=Ft(Cge);function _h(t){"@babel/helpers - typeof";return _h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_h(t)}function hv(){return hv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hv.apply(this,arguments)}function Ege(t,e){return Oge(t)||Tge(t,e)||Pge(t,e)||Age()}function Age(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 760In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pge(t,e){if(t){if(typeof t=="string")return AD(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return AD(t,e)}}function AD(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Tge(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function Oge(t){if(Array.isArray(t))return t}function PD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function TD(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?PD(Object(r),!0).forEach(function(n){Mge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):PD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Mge(t,e,r){return e=Rge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rge(t){var e=Ige(t,"string");return _h(e)=="symbol"?e:e+""}function Ige(t,e){if(_h(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(_h(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var OD=function(e,r,n,a,i){var o=n-a,l;return l="M ".concat(e,",").concat(r),l+="L ".concat(e+n,",").concat(r),l+="L ".concat(e+n-o/2,",").concat(r+i),l+="L ".concat(e+n-o/2-a,",").concat(r+i),l+="L ".concat(e,",").concat(r," Z"),l},Dge={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$ge=function(e){var r=TD(TD({},Dge),e),n=w.useRef(),a=w.useState(-1),i=Ege(a,2),o=i[0],l=i[1];w.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var S=n.current.getTotalLength();S&&l(S)}catch{}},[]);var u=r.x,d=r.y,h=r.upperWidth,m=r.lowerWidth,p=r.height,v=r.className,b=r.animationEasing,y=r.animationDuration,x=r.animationBegin,j=r.isUpdateAnimationActive;if(u!==+u||d!==+d||h!==+h||m!==+m||p!==+p||h===0&&m===0||p===0)return null;var N=Ct("recharts-trapezoid",v);return j?U.createElement(pi,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:p,x:u,y:d},to:{upperWidth:h,lowerWidth:m,height:p,x:u,y:d},duration:y,animationEasing:b,isActive:j},function(S){var k=S.upperWidth,C=S.lowerWidth,A=S.height,T=S.x,R=S.y;return U.createElement(pi,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:x,duration:y,easing:b},U.createElement("path",hv({},jt(r,!0),{className:N,d:OD(T,R,k,C,A),ref:n})))}):U.createElement("g",null,U.createElement("path",hv({},jt(r,!0),{className:N,d:OD(u,d,h,m,p)})))},Lge=["option","shapeType","propTransformer","activeClassName","isActive"];function jh(t){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jh(t)}function Fge(t,e){if(t==null)return{};var r=Bge(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Bge(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function MD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function mv(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?MD(Object(r),!0).forEach(function(n){Vge(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):MD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Vge(t,e,r){return e=zge(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function zge(t){var e=Uge(t,"string");return jh(e)=="symbol"?e:e+""}function Uge(t,e){if(jh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(jh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function qge(t,e){return mv(mv({},e),t)}function Wge(t,e){return t==="symbols"}function RD(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return U.createElement(Fk,r);case"trapezoid":return U.createElement($ge,r);case"sector":return U.createElement(xV,r);case"symbols":if(Wge(e))return U.createElement(ak,r);break;default:return null}}function Hge(t){return w.isValidElement(t)?t.props:t}function Gge(t){var e=t.option,r=t.shapeType,n=t.propTransformer,a=n===void 0?qge:n,i=t.activeClassName,o=i===void 0?"recharts-active-shape":i,l=t.isActive,u=Fge(t,Lge),d;if(w.isValidElement(e))d=w.cloneElement(e,mv(mv({},u),Hge(e)));else if(xt(e))d=e(u);else if(Nge(e)&&!kge(e)){var h=a(e,u);d=U.createElement(RD,{shapeType:r,elementProps:h})}else{var m=u;d=U.createElement(RD,{shapeType:r,elementProps:m})}return l?U.createElement(lr,{className:o},d):d}function M0(t,e){return e!=null&&"trapezoids"in t.props}function R0(t,e){return e!=null&&"sectors"in t.props}function Nh(t,e){return e!=null&&"points"in t.props}function Kge(t,e){var r,n,a=t.x===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.x)||t.x===e.x,i=t.y===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.y)||t.y===e.y;return a&&i}function Yge(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function Xge(t,e){var r=t.x===e.x,n=t.y===e.y,a=t.z===e.z;return r&&n&&a}function Zge(t,e){var r;return M0(t,e)?r=Kge:R0(t,e)?r=Yge:Nh(t,e)&&(r=Xge),r}function Qge(t,e){var r;return M0(t,e)?r="trapezoids":R0(t,e)?r="sectors":Nh(t,e)&&(r="points"),r}function Jge(t,e){if(M0(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(R0(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return Nh(t,e)?e.payload:{}}function eve(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,a=Qge(r,e),i=Jge(r,e),o=n.filter(function(u,d){var h=oh(i,u),m=r.props[a].filter(function(b){var y=Zge(r,e);return y(b,e)}),p=r.props[a].indexOf(m[m.length-1]),v=d===p;return h&&v}),l=n.indexOf(o[o.length-1]);return l}var fj,ID;function tve(){if(ID)return fj;ID=1;var t=Math.ceil,e=Math.max;function r(n,a,i,o){for(var l=-1,u=e(t((a-n)/(i||1)),0),d=Array(u);u--;)d[o?u:++l]=n,n+=i;return d}return fj=r,fj}var hj,DD;function CV(){if(DD)return hj;DD=1;var t=oB(),e=1/0,r=17976931348623157e292;function n(a){if(!a)return a===0?a:0;if(a=t(a),a===e||a===-e){var i=a<0?-1:1;return i*r}return a===a?a:0}return hj=n,hj}var mj,$D;function rve(){if($D)return mj;$D=1;var t=tve(),e=_0(),r=CV();function n(a){return function(i,o,l){return l&&typeof l!="number"&&e(i,o,l)&&(o=l=void 0),i=r(i),o===void 0?(o=i,i=0):o=r(o),l=l===void 0?i<o?1:-1:r(l),t(i,o,l,a)}}return mj=n,mj}var pj,LD;function nve(){if(LD)return pj;LD=1;var t=rve(),e=t();return pj=e,pj}var ave=nve();const pv=Ft(ave);function Sh(t){"@babel/helpers - typeof";return Sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sh(t)}function FD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function BD(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?FD(Object(r),!0).forEach(function(n){kV(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):FD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function kV(t,e,r){return e=sve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function sve(t){var e=ive(t,"string");return Sh(e)=="symbol"?e:e+""}function ive(t,e){if(Sh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Sh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ove=["Webkit","Moz","O","ms"],lve=function(e,r){var n=e.replace(/(\w)/,function(i){return i.toUpperCase()}),a=ove.reduce(function(i,o){return BD(BD({},i),{},kV({},o+n,r))},{});return a[e]=r,a};function ju(t){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ju(t)}function gv(){return gv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gv.apply(this,arguments)}function VD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function gj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?VD(Object(r),!0).forEach(function(n){Vn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):VD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zD(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,AV(n.key),n)}}function uve(t,e,r){return e&&zD(t.prototype,e),r&&zD(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function dve(t,e,r){return e=vv(e),fve(t,EV()?Reflect.construct(e,r||[],vv(t).constructor):e.apply(t,r))}function fve(t,e){if(e&&(ju(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return hve(t)}function hve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function EV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(EV=function(){return!!t})()}function vv(t){return vv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vv(t)}function mve(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&HS(t,e)}function HS(t,e){return HS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},HS(t,e)}function Vn(t,e,r){return e=AV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function AV(t){var e=pve(t,"string");return ju(e)=="symbol"?e:e+""}function pve(t,e){if(ju(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ju(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var gve=function(e){var r=e.data,n=e.startIndex,a=e.endIndex,i=e.x,o=e.width,l=e.travellerWidth;if(!r||!r.length)return{};var u=r.length,d=Pf().domain(pv(0,u)).range([i,i+o-l]),h=d.domain().map(function(m){return d(m)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:d(n),endX:d(a),scale:d,scaleValues:h}},UD=function(e){return e.changedTouches&&!!e.changedTouches.length},Nu=(function(t){function e(r){var n;return cve(this,e),n=dve(this,e,[r]),Vn(n,"handleDrag",function(a){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(a):n.state.isSlideMoving&&n.handleSlideDrag(a)}),Vn(n,"handleTouchMove",function(a){a.changedTouches!=null&&a.changedTouches.length>0&&n.handleDrag(a.changedTouches[0])}),Vn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=n.props,i=a.endIndex,o=a.onDragEnd,l=a.startIndex;o==null||o({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),Vn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Vn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Vn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Vn(n,"handleSlideDragStart",function(a){var i=UD(a)?a.changedTouches[0]:a;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return mve(e,t),uve(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var a=n.startX,i=n.endX,o=this.state.scaleValues,l=this.props,u=l.gap,d=l.data,h=d.length-1,m=Math.min(a,i),p=Math.max(a,i),v=e.getIndexInRange(o,m),b=e.getIndexInRange(o,p);return{startIndex:v-v%u,endIndex:b===h?h:b-b%u}}},{key:"getTextOfTick",value:function(n){var a=this.props,i=a.data,o=a.tickFormatter,l=a.dataKey,u=ea(i[n],l,n);return xt(o)?o(u,n):u}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var a=this.state,i=a.slideMoveStartX,o=a.startX,l=a.endX,u=this.props,d=u.x,h=u.width,m=u.travellerWidth,p=u.startIndex,v=u.endIndex,b=u.onChange,y=n.pageX-i;y>0?y=Math.min(y,d+h-m-l,d+h-m-o):y<0&&(y=Math.max(y,d-o,d-l));var x=this.getIndex({startX:o+y,endX:l+y});(x.startIndex!==p||x.endIndex!==v)&&b&&b(x),this.setState({startX:o+y,endX:l+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,a){var i=UD(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var a=this.state,i=a.brushMoveStartX,o=a.movingTravellerId,l=a.endX,u=a.startX,d=this.state[o],h=this.props,m=h.x,p=h.width,v=h.travellerWidth,b=h.onChange,y=h.gap,x=h.data,j={startX:this.state.startX,endX:this.state.endX},N=n.pageX-i;N>0?N=Math.min(N,m+p-v-d):N<0&&(N=Math.max(N,m-d)),j[o]=d+N;var S=this.getIndex(j),k=S.startIndex,C=S.endIndex,A=function(){var R=x.length-1;return o==="startX"&&(l>u?k%y===0:C%y===0)||l<u&&C===R||o==="endX"&&(l>u?C%y===0:k%y===0)||l>u&&C===R};this.setState(Vn(Vn({},o,d+N),"brushMoveStartX",n.pageX),function(){b&&A()&&b(S)})}},{key:"handleTravellerMoveKeyboard",value:function(n,a){var i=this,o=this.state,l=o.scaleValues,u=o.startX,d=o.endX,h=this.state[a],m=l.indexOf(h);if(m!==-1){var p=m+n;if(!(p===-1||p>=l.length)){var v=l[p];a==="startX"&&v>=d||a==="endX"&&v<=u||this.setState(Vn({},a,v),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,u=n.fill,d=n.stroke;return U.createElement("rect",{stroke:d,fill:u,x:a,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,u=n.data,d=n.children,h=n.padding,m=w.Children.only(d);return m?U.cloneElement(m,{x:a,y:i,width:o,height:l,margin:h,compact:!0,data:u}):null}},{key:"renderTravellerLayer",value:function(n,a){var i,o,l=this,u=this.props,d=u.y,h=u.travellerWidth,m=u.height,p=u.traveller,v=u.ariaLabel,b=u.data,y=u.startIndex,x=u.endIndex,j=Math.max(n,this.props.x),N=gj(gj({},jt(this.props,!1)),{},{x:j,y:d,width:h,height:m}),S=v||"Min value: ".concat((i=b[y])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=b[x])===null||o===void 0?void 0:o.name);return U.createElement(lr,{tabIndex:0,role:"slider","aria-label":S,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),l.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,a))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(p,N))}},{key:"renderSlide",value:function(n,a){var i=this.props,o=i.y,l=i.height,u=i.stroke,d=i.travellerWidth,h=Math.min(n,a)+d,m=Math.max(Math.abs(a-n)-d,0);return U.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:u,fillOpacity:.2,x:h,y:o,width:m,height:l})}},{key:"renderText",value:function(){var n=this.props,a=n.startIndex,i=n.endIndex,o=n.y,l=n.height,u=n.travellerWidth,d=n.stroke,h=this.state,m=h.startX,p=h.endX,v=5,b={pointerEvents:"none",fill:d};return U.createElement(lr,{className:"recharts-brush-texts"},U.createElement(Hg,gv({textAnchor:"end",verticalAnchor:"middle",x:Math.min(m,p)-v,y:o+l/2},b),this.getTextOfTick(a)),U.createElement(Hg,gv({textAnchor:"start",verticalAnchor:"middle",x:Math.max(m,p)+u+v,y:o+l/2},b),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,a=n.data,i=n.className,o=n.children,l=n.x,u=n.y,d=n.width,h=n.height,m=n.alwaysShowText,p=this.state,v=p.startX,b=p.endX,y=p.isTextActive,x=p.isSlideMoving,j=p.isTravellerMoving,N=p.isTravellerFocused;if(!a||!a.length||!De(l)||!De(u)||!De(d)||!De(h)||d<=0||h<=0)return null;var S=Ct("recharts-brush",i),k=U.Children.count(o)===1,C=lve("userSelect","none");return U.createElement(lr,{className:S,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:C},this.renderBackground(),k&&this.renderPanorama(),this.renderSlide(v,b),this.renderTravellerLayer(v,"startX"),this.renderTravellerLayer(b,"endX"),(y||x||j||N||m)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var a=n.x,i=n.y,o=n.width,l=n.height,u=n.stroke,d=Math.floor(i+l/2)-1;return U.createElement(U.Fragment,null,U.createElement("rect",{x:a,y:i,width:o,height:l,fill:u,stroke:"none"}),U.createElement("line",{x1:a+1,y1:d,x2:a+o-1,y2:d,fill:"none",stroke:"#fff"}),U.createElement("line",{x1:a+1,y1:d+2,x2:a+o-1,y2:d+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,a){var i;return U.isValidElement(n)?i=U.cloneElement(n,a):xt(n)?i=n(a):i=e.renderDefaultTraveller(a),i}},{key:"getDerivedStateFromProps",value:function(n,a){var i=n.data,o=n.width,l=n.x,u=n.travellerWidth,d=n.updateId,h=n.startIndex,m=n.endIndex;if(i!==a.prevData||d!==a.prevUpdateId)return gj({prevData:i,prevTravellerWidth:u,prevUpdateId:d,prevX:l,prevWidth:o},i&&i.length?gve({data:i,width:o,x:l,travellerWidth:u,startIndex:h,endIndex:m}):{scale:null,scaleValues:null});if(a.scale&&(o!==a.prevWidth||l!==a.prevX||u!==a.prevTravellerWidth)){a.scale.range([l,l+o-u]);var p=a.scale.domain().map(function(v){return a.scale(v)});return{prevData:i,prevTravellerWidth:u,prevUpdateId:d,prevX:l,prevWidth:o,startX:a.scale(n.startIndex),endX:a.scale(n.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(n,a){for(var i=n.length,o=0,l=i-1;l-o>1;){var u=Math.floor((o+l)/2);n[u]>a?l=u:o=u}return a>=n[l]?l:o}}])})(w.PureComponent);Vn(Nu,"displayName","Brush");Vn(Nu,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var vj,qD;function vve(){if(qD)return vj;qD=1;var t=dk();function e(r,n){var a;return t(r,function(i,o,l){return a=n(i,o,l),!a}),!!a}return vj=e,vj}var xj,WD;function xve(){if(WD)return xj;WD=1;var t=LF(),e=Eo(),r=vve(),n=In(),a=_0();function i(o,l,u){var d=n(o)?t:r;return u&&a(o,l,u)&&(l=void 0),d(o,e(l,3))}return xj=i,xj}var yve=xve();const bve=Ft(yve);var ks=function(e,r){var n=e.alwaysShow,a=e.ifOverflow;return n&&(a="extendDomain"),a===r},yj,HD;function wve(){if(HD)return yj;HD=1;var t=rB();function e(r,n,a){n=="__proto__"&&t?t(r,n,{configurable:!0,enumerable:!0,value:a,writable:!0}):r[n]=a}return yj=e,yj}var bj,GD;function _ve(){if(GD)return bj;GD=1;var t=wve(),e=eB(),r=Eo();function n(a,i){var o={};return i=r(i,3),e(a,function(l,u,d){t(o,u,i(l,u,d))}),o}return bj=n,bj}var jve=_ve();const Nve=Ft(jve);var wj,KD;function Sve(){if(KD)return wj;KD=1;function t(e,r){for(var n=-1,a=e==null?0:e.length;++n<a;)if(!r(e[n],n,e))return!1;return!0}return wj=t,wj}var _j,YD;function Cve(){if(YD)return _j;YD=1;var t=dk();function e(r,n){var a=!0;return t(r,function(i,o,l){return a=!!n(i,o,l),a}),a}return _j=e,_j}var jj,XD;function kve(){if(XD)return jj;XD=1;var t=Sve(),e=Cve(),r=Eo(),n=In(),a=_0();function i(o,l,u){var d=n(o)?t:e;return u&&a(o,l,u)&&(l=void 0),d(o,r(l,3))}return jj=i,jj}var Eve=kve();const PV=Ft(Eve);var Ave=["x","y"];function Ch(t){"@babel/helpers - typeof";return Ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ch(t)}function GS(){return GS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},GS.apply(this,arguments)}function ZD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function lf(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ZD(Object(r),!0).forEach(function(n){Pve(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ZD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pve(t,e,r){return e=Tve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Tve(t){var e=Ove(t,"string");return Ch(e)=="symbol"?e:e+""}function Ove(t,e){if(Ch(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ch(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Mve(t,e){if(t==null)return{};var r=Rve(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Rve(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Ive(t,e){var r=t.x,n=t.y,a=Mve(t,Ave),i="".concat(r),o=parseInt(i,10),l="".concat(n),u=parseInt(l,10),d="".concat(e.height||a.height),h=parseInt(d,10),m="".concat(e.width||a.width),p=parseInt(m,10);return lf(lf(lf(lf(lf({},e),a),o?{x:o}:{}),u?{y:u}:{}),{},{height:h,width:p,name:e.name,radius:e.radius})}function QD(t){return U.createElement(Gge,GS({shapeType:"rectangle",propTransformer:Ive,activeClassName:"recharts-active-bar"},t))}var Dve=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,a){if(typeof e=="number")return e;var i=De(n)||qae(n);return i?e(n,a):(i||kl(),r)}},$ve=["value","background"],TV;function Su(t){"@babel/helpers - typeof";return Su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Su(t)}function Lve(t,e){if(t==null)return{};var r=Fve(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Fve(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function xv(){return xv=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},xv.apply(this,arguments)}function JD(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function yr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?JD(Object(r),!0).forEach(function(n){so(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):JD(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Bve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e$(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,MV(n.key),n)}}function Vve(t,e,r){return e&&e$(t.prototype,e),r&&e$(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function zve(t,e,r){return e=yv(e),Uve(t,OV()?Reflect.construct(e,r||[],yv(t).constructor):e.apply(t,r))}function Uve(t,e){if(e&&(Su(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return qve(t)}function qve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function OV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(OV=function(){return!!t})()}function yv(t){return yv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},yv(t)}function Wve(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&KS(t,e)}function KS(t,e){return KS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},KS(t,e)}function so(t,e,r){return e=MV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function MV(t){var e=Hve(t,"string");return Su(e)=="symbol"?e:e+""}function Hve(t,e){if(Su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Xh=(function(t){function e(){var r;Bve(this,e);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=zve(this,e,[].concat(a)),so(r,"state",{isAnimationFinished:!1}),so(r,"id",qh("recharts-bar-")),so(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),so(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return Wve(e,t),Vve(e,[{key:"renderRectanglesStatically",value:function(n){var a=this,i=this.props,o=i.shape,l=i.dataKey,u=i.activeIndex,d=i.activeBar,h=jt(this.props,!1);return n&&n.map(function(m,p){var v=p===u,b=v?d:o,y=yr(yr(yr({},h),m),{},{isActive:v,option:b,index:p,dataKey:l,onAnimationStart:a.handleAnimationStart,onAnimationEnd:a.handleAnimationEnd});return U.createElement(lr,xv({className:"recharts-bar-rectangle"},Ig(a.props,m,p),{key:"rectangle-".concat(m==null?void 0:m.x,"-").concat(m==null?void 0:m.y,"-").concat(m==null?void 0:m.value,"-").concat(p)}),U.createElement(QD,y))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,a=this.props,i=a.data,o=a.layout,l=a.isAnimationActive,u=a.animationBegin,d=a.animationDuration,h=a.animationEasing,m=a.animationId,p=this.state.prevData;return U.createElement(pi,{begin:u,duration:d,isActive:l,easing:h,from:{t:0},to:{t:1},key:"bar-".concat(m),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var b=v.t,y=i.map(function(x,j){var N=p&&p[j];if(N){var S=va(N.x,x.x),k=va(N.y,x.y),C=va(N.width,x.width),A=va(N.height,x.height);return yr(yr({},x),{},{x:S(b),y:k(b),width:C(b),height:A(b)})}if(o==="horizontal"){var T=va(0,x.height),R=T(b);return yr(yr({},x),{},{y:x.y+x.height-R,height:R})}var I=va(0,x.width),D=I(b);return yr(yr({},x),{},{width:D})});return U.createElement(lr,null,n.renderRectanglesStatically(y))})}},{key:"renderRectangles",value:function(){var n=this.props,a=n.data,i=n.isAnimationActive,o=this.state.prevData;return i&&a&&a.length&&(!o||!oh(o,a))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(a)}},{key:"renderBackground",value:function(){var n=this,a=this.props,i=a.data,o=a.dataKey,l=a.activeIndex,u=jt(this.props.background,!1);return i.map(function(d,h){d.value;var m=d.background,p=Lve(d,$ve);if(!m)return null;var v=yr(yr(yr(yr(yr({},p),{},{fill:"#eee"},m),u),Ig(n.props,d,h)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:h,className:"recharts-bar-background-rectangle"});return U.createElement(QD,xv({key:"background-bar-".concat(h),option:n.props.background,isActive:h===l},v))})}},{key:"renderErrorBar",value:function(n,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,u=i.yAxis,d=i.layout,h=i.children,m=rs(h,O0);if(!m)return null;var p=d==="vertical"?o[0].height/2:o[0].width/2,v=function(x,j){var N=Array.isArray(x.value)?x.value[1]:x.value;return{x:x.x,y:x.y,value:N,errorVal:ea(x,j)}},b={clipPath:n?"url(#clipPath-".concat(a,")"):null};return U.createElement(lr,b,m.map(function(y){return U.cloneElement(y,{key:"error-bar-".concat(a,"-").concat(y.props.dataKey),data:o,xAxis:l,yAxis:u,layout:d,offset:p,dataPointFormatter:v})}))}},{key:"render",value:function(){var n=this.props,a=n.hide,i=n.data,o=n.className,l=n.xAxis,u=n.yAxis,d=n.left,h=n.top,m=n.width,p=n.height,v=n.isAnimationActive,b=n.background,y=n.id;if(a||!i||!i.length)return null;var x=this.state.isAnimationFinished,j=Ct("recharts-bar",o),N=l&&l.allowDataOverflow,S=u&&u.allowDataOverflow,k=N||S,C=St(y)?this.id:y;return U.createElement(lr,{className:j},N||S?U.createElement("defs",null,U.createElement("clipPath",{id:"clipPath-".concat(C)},U.createElement("rect",{x:N?d:d-m/2,y:S?h:h-p/2,width:N?m:m*2,height:S?p:p*2}))):null,U.createElement(lr,{className:"recharts-bar-rectangles",clipPath:k?"url(#clipPath-".concat(C,")"):null},b?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(k,C),(!v||x)&&uo.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:a.curData}:n.data!==a.curData?{curData:n.data}:null}}])})(w.PureComponent);TV=Xh;so(Xh,"displayName","Bar");so(Xh,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!ad.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});so(Xh,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,a=t.bandSize,i=t.xAxis,o=t.yAxis,l=t.xAxisTicks,u=t.yAxisTicks,d=t.stackedData,h=t.dataStartIndex,m=t.displayedData,p=t.offset,v=uhe(n,r);if(!v)return null;var b=e.layout,y=r.type.defaultProps,x=y!==void 0?yr(yr({},y),r.props):r.props,j=x.dataKey,N=x.children,S=x.minPointSize,k=b==="horizontal"?o:i,C=d?k.scale.domain():null,A=xhe({numericAxis:k}),T=rs(N,cB),R=m.map(function(I,D){var L,z,H,Z,te,G;d?L=dhe(d[h+D],C):(L=ea(I,j),Array.isArray(L)||(L=[A,L]));var M=Dve(S,TV.defaultProps.minPointSize)(L[1],D);if(b==="horizontal"){var F,K=[o.scale(L[0]),o.scale(L[1])],B=K[0],O=K[1];z=$3({axis:i,ticks:l,bandSize:a,offset:v.offset,entry:I,index:D}),H=(F=O??B)!==null&&F!==void 0?F:void 0,Z=v.size;var W=B-O;if(te=Number.isNaN(W)?0:W,G={x:z,y:o.y,width:Z,height:o.height},Math.abs(M)>0&&Math.abs(te)<Math.abs(M)){var q=es(te||M)*(Math.abs(M)-Math.abs(te));H-=q,te+=q}}else{var se=[i.scale(L[0]),i.scale(L[1])],me=se[0],fe=se[1];if(z=me,H=$3({axis:o,ticks:u,bandSize:a,offset:v.offset,entry:I,index:D}),Z=fe-me,te=v.size,G={x:i.x,y:H,width:i.width,height:te},Math.abs(M)>0&&Math.abs(Z)<Math.abs(M)){var Q=es(Z||M)*(Math.abs(M)-Math.abs(Z));Z+=Q}}return yr(yr(yr({},I),{},{x:z,y:H,width:Z,height:te,value:d?L:L[1],payload:I,background:G},T&&T[D]&&T[D].props),{},{tooltipPayload:[pV(r,I)],tooltipPosition:{x:z+Z/2,y:H+te/2}})});return yr({data:R,layout:b},p)});function kh(t){"@babel/helpers - typeof";return kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kh(t)}function Gve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function t$(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,RV(n.key),n)}}function Kve(t,e,r){return e&&t$(t.prototype,e),r&&t$(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function r$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Ha(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?r$(Object(r),!0).forEach(function(n){I0(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):r$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function I0(t,e,r){return e=RV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function RV(t){var e=Yve(t,"string");return kh(e)=="symbol"?e:e+""}function Yve(t,e){if(kh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(kh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Xve=function(e,r,n,a,i){var o=e.width,l=e.height,u=e.layout,d=e.children,h=Object.keys(r),m={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},p=!!Un(d,Xh);return h.reduce(function(v,b){var y=r[b],x=y.orientation,j=y.domain,N=y.padding,S=N===void 0?{}:N,k=y.mirror,C=y.reversed,A="".concat(x).concat(k?"Mirror":""),T,R,I,D,L;if(y.type==="number"&&(y.padding==="gap"||y.padding==="no-gap")){var z=j[1]-j[0],H=1/0,Z=y.categoricalDomain.sort(Gae);if(Z.forEach(function(se,me){me>0&&(H=Math.min((se||0)-(Z[me-1]||0),H))}),Number.isFinite(H)){var te=H/z,G=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(T=te*G/2),y.padding==="no-gap"){var M=Sl(e.barCategoryGap,te*G),F=te*G/2;T=F-M-(F-M)/G*M}}}a==="xAxis"?R=[n.left+(S.left||0)+(T||0),n.left+n.width-(S.right||0)-(T||0)]:a==="yAxis"?R=u==="horizontal"?[n.top+n.height-(S.bottom||0),n.top+(S.top||0)]:[n.top+(S.top||0)+(T||0),n.top+n.height-(S.bottom||0)-(T||0)]:R=y.range,C&&(R=[R[1],R[0]]);var K=lhe(y,i,p),B=K.scale,O=K.realScaleType;B.domain(j).range(R),che(B);var W=vhe(B,Ha(Ha({},y),{},{realScaleType:O}));a==="xAxis"?(L=x==="top"&&!k||x==="bottom"&&k,I=n.left,D=m[A]-L*y.height):a==="yAxis"&&(L=x==="left"&&!k||x==="right"&&k,I=m[A]-L*y.width,D=n.top);var q=Ha(Ha(Ha({},y),W),{},{realScaleType:O,x:I,y:D,scale:B,width:a==="xAxis"?n.width:y.width,height:a==="yAxis"?n.height:y.height});return q.bandSize=iv(q,W),!y.hide&&a==="xAxis"?m[A]+=(L?-1:1)*q.height:y.hide||(m[A]+=(L?-1:1)*q.width),Ha(Ha({},v),{},I0({},b,q))},{})},IV=function(e,r){var n=e.x,a=e.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(a,o),width:Math.abs(i-n),height:Math.abs(o-a)}},Zve=function(e){var r=e.x1,n=e.y1,a=e.x2,i=e.y2;return IV({x:r,y:n},{x:a,y:i})},DV=(function(){function t(e){Gve(this,t),this.scale=e}return Kve(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(a){var u=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+u}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),a=n[0],i=n[n.length-1];return a<=i?r>=a&&r<=i:r>=i&&r<=a}}],[{key:"create",value:function(r){return new t(r)}}])})();I0(DV,"EPS",1e-4);var Vk=function(e){var r=Object.keys(e).reduce(function(n,a){return Ha(Ha({},n),{},I0({},a,DV.create(e[a])))},{});return Ha(Ha({},r),{},{apply:function(a){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return Nve(a,function(u,d){return r[d].apply(u,{bandAware:o,position:l})})},isInRange:function(a){return PV(a,function(i,o){return r[o].isInRange(i)})}})};function Qve(t){return(t%180+180)%180}var Jve=function(e){var r=e.width,n=e.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=Qve(a),o=i*Math.PI/180,l=Math.atan(n/r),u=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(u)},Nj,n$;function e0e(){if(n$)return Nj;n$=1;var t=Eo(),e=Wh(),r=b0();function n(a){return function(i,o,l){var u=Object(i);if(!e(i)){var d=t(o,3);i=r(i),o=function(m){return d(u[m],m,u)}}var h=a(i,o,l);return h>-1?u[d?i[h]:h]:void 0}}return Nj=n,Nj}var Sj,a$;function t0e(){if(a$)return Sj;a$=1;var t=CV();function e(r){var n=t(r),a=n%1;return n===n?a?n-a:n:0}return Sj=e,Sj}var Cj,s$;function r0e(){if(s$)return Cj;s$=1;var t=YF(),e=Eo(),r=t0e(),n=Math.max;function a(i,o,l){var u=i==null?0:i.length;if(!u)return-1;var d=l==null?0:r(l);return d<0&&(d=n(u+d,0)),t(i,e(o,3),d)}return Cj=a,Cj}var kj,i$;function n0e(){if(i$)return kj;i$=1;var t=e0e(),e=r0e(),r=t(e);return kj=r,kj}var a0e=n0e();const s0e=Ft(a0e);var i0e=dF();const o0e=Ft(i0e);var l0e=o0e(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),zk=w.createContext(void 0),Uk=w.createContext(void 0),$V=w.createContext(void 0),LV=w.createContext({}),FV=w.createContext(void 0),BV=w.createContext(0),VV=w.createContext(0),o$=function(e){var r=e.state,n=r.xAxisMap,a=r.yAxisMap,i=r.offset,o=e.clipPathId,l=e.children,u=e.width,d=e.height,h=l0e(i);return U.createElement(zk.Provider,{value:n},U.createElement(Uk.Provider,{value:a},U.createElement(LV.Provider,{value:i},U.createElement($V.Provider,{value:h},U.createElement(FV.Provider,{value:o},U.createElement(BV.Provider,{value:d},U.createElement(VV.Provider,{value:u},l)))))))},c0e=function(){return w.useContext(FV)},zV=function(e){var r=w.useContext(zk);r==null&&kl();var n=r[e];return n==null&&kl(),n},u0e=function(){var e=w.useContext(zk);return ro(e)},d0e=function(){var e=w.useContext(Uk),r=s0e(e,function(n){return PV(n.domain,Number.isFinite)});return r||ro(e)},UV=function(e){var r=w.useContext(Uk);r==null&&kl();var n=r[e];return n==null&&kl(),n},f0e=function(){var e=w.useContext($V);return e},h0e=function(){return w.useContext(LV)},qk=function(){return w.useContext(VV)},Wk=function(){return w.useContext(BV)};function Cu(t){"@babel/helpers - typeof";return Cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cu(t)}function m0e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p0e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,WV(n.key),n)}}function g0e(t,e,r){return e&&p0e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function v0e(t,e,r){return e=bv(e),x0e(t,qV()?Reflect.construct(e,r||[],bv(t).constructor):e.apply(t,r))}function x0e(t,e){if(e&&(Cu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y0e(t)}function y0e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qV=function(){return!!t})()}function bv(t){return bv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},bv(t)}function b0e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&YS(t,e)}function YS(t,e){return YS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},YS(t,e)}function l$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function c$(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?l$(Object(r),!0).forEach(function(n){Hk(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):l$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Hk(t,e,r){return e=WV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function WV(t){var e=w0e(t,"string");return Cu(e)=="symbol"?e:e+""}function w0e(t,e){if(Cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function _0e(t,e){return C0e(t)||S0e(t,e)||N0e(t,e)||j0e()}function j0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 761In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function N0e(t,e){if(t){if(typeof t=="string")return u$(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u$(t,e)}}function u$(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function S0e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function C0e(t){if(Array.isArray(t))return t}function XS(){return XS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},XS.apply(this,arguments)}var k0e=function(e,r){var n;return U.isValidElement(e)?n=U.cloneElement(e,r):xt(e)?n=e(r):n=U.createElement("line",XS({},r,{className:"recharts-reference-line-line"})),n},E0e=function(e,r,n,a,i,o,l,u,d){var h=i.x,m=i.y,p=i.width,v=i.height;if(n){var b=d.y,y=e.y.apply(b,{position:o});if(ks(d,"discard")&&!e.y.isInRange(y))return null;var x=[{x:h+p,y},{x:h,y}];return u==="left"?x.reverse():x}if(r){var j=d.x,N=e.x.apply(j,{position:o});if(ks(d,"discard")&&!e.x.isInRange(N))return null;var S=[{x:N,y:m+v},{x:N,y:m}];return l==="top"?S.reverse():S}if(a){var k=d.segment,C=k.map(function(A){return e.apply(A,{position:o})});return ks(d,"discard")&&bve(C,function(A){return!e.isInRange(A)})?null:C}return null};function A0e(t){var e=t.x,r=t.y,n=t.segment,a=t.xAxisId,i=t.yAxisId,o=t.shape,l=t.className,u=t.alwaysShow,d=c0e(),h=zV(a),m=UV(i),p=f0e();if(!d||!p)return null;ii(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var v=Vk({x:h.scale,y:m.scale}),b=Mr(e),y=Mr(r),x=n&&n.length===2,j=E0e(v,b,y,x,p,t.position,h.orientation,m.orientation,t);if(!j)return null;var N=_0e(j,2),S=N[0],k=S.x,C=S.y,A=N[1],T=A.x,R=A.y,I=ks(t,"hidden")?"url(#".concat(d,")"):void 0,D=c$(c$({clipPath:I},jt(t,!0)),{},{x1:k,y1:C,x2:T,y2:R});return U.createElement(lr,{className:Ct("recharts-reference-line",l)},k0e(o,D),an.renderCallByParent(t,Zve({x1:k,y1:C,x2:T,y2:R})))}var Gk=(function(t){function e(){return m0e(this,e),v0e(this,e,arguments)}return b0e(e,t),g0e(e,[{key:"render",value:function(){return U.createElement(A0e,this.props)}}])})(U.Component);Hk(Gk,"displayName","ReferenceLine");Hk(Gk,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function ZS(){return ZS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ZS.apply(this,arguments)}function ku(t){"@babel/helpers - typeof";return ku=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ku(t)}function d$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function f$(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?d$(Object(r),!0).forEach(function(n){D0(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function P0e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function T0e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,GV(n.key),n)}}function O0e(t,e,r){return e&&T0e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function M0e(t,e,r){return e=wv(e),R0e(t,HV()?Reflect.construct(e,r||[],wv(t).constructor):e.apply(t,r))}function R0e(t,e){if(e&&(ku(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return I0e(t)}function I0e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function HV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(HV=function(){return!!t})()}function wv(t){return wv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wv(t)}function D0e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&QS(t,e)}function QS(t,e){return QS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},QS(t,e)}function D0(t,e,r){return e=GV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function GV(t){var e=$0e(t,"string");return ku(e)=="symbol"?e:e+""}function $0e(t,e){if(ku(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ku(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var L0e=function(e){var r=e.x,n=e.y,a=e.xAxis,i=e.yAxis,o=Vk({x:a.scale,y:i.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return ks(e,"discard")&&!o.isInRange(l)?null:l},$0=(function(t){function e(){return P0e(this,e),M0e(this,e,arguments)}return D0e(e,t),O0e(e,[{key:"render",value:function(){var n=this.props,a=n.x,i=n.y,o=n.r,l=n.alwaysShow,u=n.clipPathId,d=Mr(a),h=Mr(i);if(ii(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!d||!h)return null;var m=L0e(this.props);if(!m)return null;var p=m.x,v=m.y,b=this.props,y=b.shape,x=b.className,j=ks(this.props,"hidden")?"url(#".concat(u,")"):void 0,N=f$(f$({clipPath:j},jt(this.props,!0)),{},{cx:p,cy:v});return U.createElement(lr,{className:Ct("recharts-reference-dot",x)},e.renderDot(y,N),an.renderCallByParent(this.props,{x:p-o,y:v-o,width:2*o,height:2*o}))}}])})(U.Component);D0($0,"displayName","ReferenceDot");D0($0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});D0($0,"renderDot",function(t,e){var r;return U.isValidElement(t)?r=U.cloneElement(t,e):xt(t)?r=t(e):r=U.createElement(Bk,ZS({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function JS(){return JS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},JS.apply(this,arguments)}function Eu(t){"@babel/helpers - typeof";return Eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eu(t)}function h$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function m$(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?h$(Object(r),!0).forEach(function(n){L0(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function F0e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B0e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,YV(n.key),n)}}function V0e(t,e,r){return e&&B0e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function z0e(t,e,r){return e=_v(e),U0e(t,KV()?Reflect.construct(e,r||[],_v(t).constructor):e.apply(t,r))}function U0e(t,e){if(e&&(Eu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q0e(t)}function q0e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function KV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(KV=function(){return!!t})()}function _v(t){return _v=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},_v(t)}function W0e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&e2(t,e)}function e2(t,e){return e2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},e2(t,e)}function L0(t,e,r){return e=YV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function YV(t){var e=H0e(t,"string");return Eu(e)=="symbol"?e:e+""}function H0e(t,e){if(Eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var G0e=function(e,r,n,a,i){var o=i.x1,l=i.x2,u=i.y1,d=i.y2,h=i.xAxis,m=i.yAxis;if(!h||!m)return null;var p=Vk({x:h.scale,y:m.scale}),v={x:e?p.x.apply(o,{position:"start"}):p.x.rangeMin,y:n?p.y.apply(u,{position:"start"}):p.y.rangeMin},b={x:r?p.x.apply(l,{position:"end"}):p.x.rangeMax,y:a?p.y.apply(d,{position:"end"}):p.y.rangeMax};return ks(i,"discard")&&(!p.isInRange(v)||!p.isInRange(b))?null:IV(v,b)},F0=(function(t){function e(){return F0e(this,e),z0e(this,e,arguments)}return W0e(e,t),V0e(e,[{key:"render",value:function(){var n=this.props,a=n.x1,i=n.x2,o=n.y1,l=n.y2,u=n.className,d=n.alwaysShow,h=n.clipPathId;ii(d===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var m=Mr(a),p=Mr(i),v=Mr(o),b=Mr(l),y=this.props.shape;if(!m&&!p&&!v&&!b&&!y)return null;var x=G0e(m,p,v,b,this.props);if(!x&&!y)return null;var j=ks(this.props,"hidden")?"url(#".concat(h,")"):void 0;return U.createElement(lr,{className:Ct("recharts-reference-area",u)},e.renderRect(y,m$(m$({clipPath:j},jt(this.props,!0)),x)),an.renderCallByParent(this.props,x))}}])})(U.Component);L0(F0,"displayName","ReferenceArea");L0(F0,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});L0(F0,"renderRect",function(t,e){var r;return U.isValidElement(t)?r=U.cloneElement(t,e):xt(t)?r=t(e):r=U.createElement(Fk,JS({},e,{className:"recharts-reference-area-rect"})),r});function XV(t,e,r){if(e<1)return[];if(e===1&&r===void 0)return t;for(var n=[],a=0;a<t.length;a+=e)n.push(t[a]);return n}function K0e(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return Jve(n,r)}function Y0e(t,e,r){var n=r==="width",a=t.x,i=t.y,o=t.width,l=t.height;return e===1?{start:n?a:i,end:n?a+o:i+l}:{start:n?a+o:i+l,end:n?a:i}}function jv(t,e,r,n,a){if(t*e<t*n||t*e>t*a)return!1;var i=r();return t*(e-t*i/2-n)>=0&&t*(e+t*i/2-a)<=0}function X0e(t,e){return XV(t,e+1)}function Z0e(t,e,r,n,a){for(var i=(n||[]).slice(),o=e.start,l=e.end,u=0,d=1,h=o,m=function(){var b=n==null?void 0:n[u];if(b===void 0)return{v:XV(n,d)};var y=u,x,j=function(){return x===void 0&&(x=r(b,y)),x},N=b.coordinate,S=u===0||jv(t,N,j,h,l);S||(u=0,h=o,d+=1),S&&(h=N+t*(j()/2+a),u+=d)},p;d<=i.length;)if(p=m(),p)return p.v;return[]}function Eh(t){"@babel/helpers - typeof";return Eh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eh(t)}function p$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function rn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?p$(Object(r),!0).forEach(function(n){Q0e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Q0e(t,e,r){return e=J0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function J0e(t){var e=exe(t,"string");return Eh(e)=="symbol"?e:e+""}function exe(t,e){if(Eh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Eh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function txe(t,e,r,n,a){for(var i=(n||[]).slice(),o=i.length,l=e.start,u=e.end,d=function(p){var v=i[p],b,y=function(){return b===void 0&&(b=r(v,p)),b};if(p===o-1){var x=t*(v.coordinate+t*y()/2-u);i[p]=v=rn(rn({},v),{},{tickCoord:x>0?v.coordinate-x*t:v.coordinate})}else i[p]=v=rn(rn({},v),{},{tickCoord:v.coordinate});var j=jv(t,v.tickCoord,y,l,u);j&&(u=v.tickCoord-t*(y()/2+a),i[p]=rn(rn({},v),{},{isShow:!0}))},h=o-1;h>=0;h--)d(h);return i}function rxe(t,e,r,n,a,i){var o=(n||[]).slice(),l=o.length,u=e.start,d=e.end;if(i){var h=n[l-1],m=r(h,l-1),p=t*(h.coordinate+t*m/2-d);o[l-1]=h=rn(rn({},h),{},{tickCoord:p>0?h.coordinate-p*t:h.coordinate});var v=jv(t,h.tickCoord,function(){return m},u,d);v&&(d=h.tickCoord-t*(m/2+a),o[l-1]=rn(rn({},h),{},{isShow:!0}))}for(var b=i?l-1:l,y=function(N){var S=o[N],k,C=function(){return k===void 0&&(k=r(S,N)),k};if(N===0){var A=t*(S.coordinate-t*C()/2-u);o[N]=S=rn(rn({},S),{},{tickCoord:A<0?S.coordinate-A*t:S.coordinate})}else o[N]=S=rn(rn({},S),{},{tickCoord:S.coordinate});var T=jv(t,S.tickCoord,C,u,d);T&&(u=S.tickCoord+t*(C()/2+a),o[N]=rn(rn({},S),{},{isShow:!0}))},x=0;x<b;x++)y(x);return o}function Kk(t,e,r){var n=t.tick,a=t.ticks,i=t.viewBox,o=t.minTickGap,l=t.orientation,u=t.interval,d=t.tickFormatter,h=t.unit,m=t.angle;if(!a||!a.length||!n)return[];if(De(u)||ad.isSsr)return X0e(a,typeof u=="number"&&De(u)?u:0);var p=[],v=l==="top"||l==="bottom"?"width":"height",b=h&&v==="width"?Af(h,{fontSize:e,letterSpacing:r}):{width:0,height:0},y=function(S,k){var C=xt(d)?d(S.value,k):S.value;return v==="width"?K0e(Af(C,{fontSize:e,letterSpacing:r}),b,m):Af(C,{fontSize:e,letterSpacing:r})[v]},x=a.length>=2?es(a[1].coordinate-a[0].coordinate):1,j=Y0e(i,x,v);return u==="equidistantPreserveStart"?Z0e(x,j,y,a,o):(u==="preserveStart"||u==="preserveStartEnd"?p=rxe(x,j,y,a,o,u==="preserveStartEnd"):p=txe(x,j,y,a,o),p.filter(function(N){return N.isShow}))}var nxe=["viewBox"],axe=["viewBox"],sxe=["ticks"];function Au(t){"@babel/helpers - typeof";return Au=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Au(t)}function Vc(){return Vc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Vc.apply(this,arguments)}function g$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function kr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?g$(Object(r),!0).forEach(function(n){Yk(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ej(t,e){if(t==null)return{};var r=ixe(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ixe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function oxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function v$(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,QV(n.key),n)}}function lxe(t,e,r){return e&&v$(t.prototype,e),r&&v$(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function cxe(t,e,r){return e=Nv(e),uxe(t,ZV()?Reflect.construct(e,r||[],Nv(t).constructor):e.apply(t,r))}function uxe(t,e){if(e&&(Au(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return dxe(t)}function dxe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ZV(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(ZV=function(){return!!t})()}function Nv(t){return Nv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Nv(t)}function fxe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&t2(t,e)}function t2(t,e){return t2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},t2(t,e)}function Yk(t,e,r){return e=QV(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function QV(t){var e=hxe(t,"string");return Au(e)=="symbol"?e:e+""}function hxe(t,e){if(Au(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Au(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ld=(function(t){function e(r){var n;return oxe(this,e),n=cxe(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return fxe(e,t),lxe(e,[{key:"shouldComponentUpdate",value:function(n,a){var i=n.viewBox,o=Ej(n,nxe),l=this.props,u=l.viewBox,d=Ej(l,axe);return!Kc(i,u)||!Kc(o,d)||!Kc(a,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var a=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];a&&this.setState({fontSize:window.getComputedStyle(a).fontSize,letterSpacing:window.getComputedStyle(a).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var a=this.props,i=a.x,o=a.y,l=a.width,u=a.height,d=a.orientation,h=a.tickSize,m=a.mirror,p=a.tickMargin,v,b,y,x,j,N,S=m?-1:1,k=n.tickSize||h,C=De(n.tickCoord)?n.tickCoord:n.coordinate;switch(d){case"top":v=b=n.coordinate,x=o+ +!m*u,y=x-S*k,N=y-S*p,j=C;break;case"left":y=x=n.coordinate,b=i+ +!m*l,v=b-S*k,j=v-S*p,N=C;break;case"right":y=x=n.coordinate,b=i+ +m*l,v=b+S*k,j=v+S*p,N=C;break;default:v=b=n.coordinate,x=o+ +m*u,y=x+S*k,N=y+S*p,j=C;break}return{line:{x1:v,y1:y,x2:b,y2:x},tick:{x:j,y:N}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o;switch(a){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,a=n.orientation,i=n.mirror,o="end";switch(a){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,a=n.x,i=n.y,o=n.width,l=n.height,u=n.orientation,d=n.mirror,h=n.axisLine,m=kr(kr(kr({},jt(this.props,!1)),jt(h,!1)),{},{fill:"none"});if(u==="top"||u==="bottom"){var p=+(u==="top"&&!d||u==="bottom"&&d);m=kr(kr({},m),{},{x1:a,y1:i+p*l,x2:a+o,y2:i+p*l})}else{var v=+(u==="left"&&!d||u==="right"&&d);m=kr(kr({},m),{},{x1:a+v*o,y1:i,x2:a+v*o,y2:i+l})}return U.createElement("line",Vc({},m,{className:Ct("recharts-cartesian-axis-line",_a(h,"className"))}))}},{key:"renderTicks",value:function(n,a,i){var o=this,l=this.props,u=l.tickLine,d=l.stroke,h=l.tick,m=l.tickFormatter,p=l.unit,v=Kk(kr(kr({},this.props),{},{ticks:n}),a,i),b=this.getTickTextAnchor(),y=this.getTickVerticalAnchor(),x=jt(this.props,!1),j=jt(h,!1),N=kr(kr({},x),{},{fill:"none"},jt(u,!1)),S=v.map(function(k,C){var A=o.getTickLineCoord(k),T=A.line,R=A.tick,I=kr(kr(kr(kr({textAnchor:b,verticalAnchor:y},x),{},{stroke:"none",fill:d},j),R),{},{index:C,payload:k,visibleTicksCount:v.length,tickFormatter:m});return U.createElement(lr,Vc({className:"recharts-cartesian-axis-tick",key:"tick-".concat(k.value,"-").concat(k.coordinate,"-").concat(k.tickCoord)},Ig(o.props,k,C)),u&&U.createElement("line",Vc({},N,T,{className:Ct("recharts-cartesian-axis-tick-line",_a(u,"className"))})),h&&e.renderTickItem(h,I,"".concat(xt(m)?m(k.value,C):k.value).concat(p||"")))});return U.createElement("g",{className:"recharts-cartesian-axis-ticks"},S)}},{key:"render",value:function(){var n=this,a=this.props,i=a.axisLine,o=a.width,l=a.height,u=a.ticksGenerator,d=a.className,h=a.hide;if(h)return null;var m=this.props,p=m.ticks,v=Ej(m,sxe),b=p;return xt(u)&&(b=p&&p.length>0?u(this.props):u(v)),o<=0||l<=0||!b||!b.length?null:U.createElement(lr,{className:Ct("recharts-cartesian-axis",d),ref:function(x){n.layerReference=x}},i&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),an.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,a,i){var o,l=Ct(a.className,"recharts-cartesian-axis-tick-value");return U.isValidElement(n)?o=U.cloneElement(n,kr(kr({},a),{},{className:l})):xt(n)?o=n(kr(kr({},a),{},{className:l})):o=U.createElement(Hg,Vc({},a,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])})(w.Component);Yk(ld,"displayName","CartesianAxis");Yk(ld,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var mxe=["x1","y1","x2","y2","key"],pxe=["offset"];function El(t){"@babel/helpers - typeof";return El=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},El(t)}function x$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function sn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x$(Object(r),!0).forEach(function(n){gxe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gxe(t,e,r){return e=vxe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vxe(t){var e=xxe(t,"string");return El(e)=="symbol"?e:e+""}function xxe(t,e){if(El(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(El(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pl(){return pl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},pl.apply(this,arguments)}function y$(t,e){if(t==null)return{};var r=yxe(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function yxe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var bxe=function(e){var r=e.fill;if(!r||r==="none")return null;var n=e.fillOpacity,a=e.x,i=e.y,o=e.width,l=e.height,u=e.ry;return U.createElement("rect",{x:a,y:i,ry:u,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function JV(t,e){var r;if(U.isValidElement(t))r=U.cloneElement(t,e);else if(xt(t))r=t(e);else{var n=e.x1,a=e.y1,i=e.x2,o=e.y2,l=e.key,u=y$(e,mxe),d=jt(u,!1);d.offset;var h=y$(d,pxe);r=U.createElement("line",pl({},h,{x1:n,y1:a,x2:i,y2:o,fill:"none",key:l}))}return r}function wxe(t){var e=t.x,r=t.width,n=t.horizontal,a=n===void 0?!0:n,i=t.horizontalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,u){var d=sn(sn({},t),{},{x1:e,y1:l,x2:e+r,y2:l,key:"line-".concat(u),index:u});return JV(a,d)});return U.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function _xe(t){var e=t.y,r=t.height,n=t.vertical,a=n===void 0?!0:n,i=t.verticalPoints;if(!a||!i||!i.length)return null;var o=i.map(function(l,u){var d=sn(sn({},t),{},{x1:l,y1:e,x2:l,y2:e+r,key:"line-".concat(u),index:u});return JV(a,d)});return U.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function jxe(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,a=t.y,i=t.width,o=t.height,l=t.horizontalPoints,u=t.horizontal,d=u===void 0?!0:u;if(!d||!e||!e.length)return null;var h=l.map(function(p){return Math.round(p+a-a)}).sort(function(p,v){return p-v});a!==h[0]&&h.unshift(0);var m=h.map(function(p,v){var b=!h[v+1],y=b?a+o-p:h[v+1]-p;if(y<=0)return null;var x=v%e.length;return U.createElement("rect",{key:"react-".concat(v),y:p,x:n,height:y,width:i,stroke:"none",fill:e[x],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return U.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},m)}function Nxe(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,a=t.fillOpacity,i=t.x,o=t.y,l=t.width,u=t.height,d=t.verticalPoints;if(!r||!n||!n.length)return null;var h=d.map(function(p){return Math.round(p+i-i)}).sort(function(p,v){return p-v});i!==h[0]&&h.unshift(0);var m=h.map(function(p,v){var b=!h[v+1],y=b?i+l-p:h[v+1]-p;if(y<=0)return null;var x=v%n.length;return U.createElement("rect",{key:"react-".concat(v),x:p,y:o,width:y,height:u,stroke:"none",fill:n[x],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return U.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},m)}var Sxe=function(e,r){var n=e.xAxis,a=e.width,i=e.height,o=e.offset;return hV(Kk(sn(sn(sn({},ld.defaultProps),n),{},{ticks:ni(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.left,o.left+o.width,r)},Cxe=function(e,r){var n=e.yAxis,a=e.width,i=e.height,o=e.offset;return hV(Kk(sn(sn(sn({},ld.defaultProps),n),{},{ticks:ni(n,!0),viewBox:{x:0,y:0,width:a,height:i}})),o.top,o.top+o.height,r)},Nc={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function e7(t){var e,r,n,a,i,o,l=qk(),u=Wk(),d=h0e(),h=sn(sn({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:Nc.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:Nc.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:Nc.horizontal,horizontalFill:(a=t.horizontalFill)!==null&&a!==void 0?a:Nc.horizontalFill,vertical:(i=t.vertical)!==null&&i!==void 0?i:Nc.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:Nc.verticalFill,x:De(t.x)?t.x:d.left,y:De(t.y)?t.y:d.top,width:De(t.width)?t.width:d.width,height:De(t.height)?t.height:d.height}),m=h.x,p=h.y,v=h.width,b=h.height,y=h.syncWithTicks,x=h.horizontalValues,j=h.verticalValues,N=u0e(),S=d0e();if(!De(v)||v<=0||!De(b)||b<=0||!De(m)||m!==+m||!De(p)||p!==+p)return null;var k=h.verticalCoordinatesGenerator||Sxe,C=h.horizontalCoordinatesGenerator||Cxe,A=h.horizontalPoints,T=h.verticalPoints;if((!A||!A.length)&&xt(C)){var R=x&&x.length,I=C({yAxis:S?sn(sn({},S),{},{ticks:R?x:S.ticks}):void 0,width:l,height:u,offset:d},R?!0:y);ii(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(El(I),"]")),Array.isArray(I)&&(A=I)}if((!T||!T.length)&&xt(k)){var D=j&&j.length,L=k({xAxis:N?sn(sn({},N),{},{ticks:D?j:N.ticks}):void 0,width:l,height:u,offset:d},D?!0:y);ii(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(El(L),"]")),Array.isArray(L)&&(T=L)}return U.createElement("g",{className:"recharts-cartesian-grid"},U.createElement(bxe,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),U.createElement(wxe,pl({},h,{offset:d,horizontalPoints:A,xAxis:N,yAxis:S})),U.createElement(_xe,pl({},h,{offset:d,verticalPoints:T,xAxis:N,yAxis:S})),U.createElement(jxe,pl({},h,{horizontalPoints:A})),U.createElement(Nxe,pl({},h,{verticalPoints:T})))}e7.displayName="CartesianGrid";var kxe=["layout","type","stroke","connectNulls","isRange","ref"],Exe=["key"],t7;function Pu(t){"@babel/helpers - typeof";return Pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pu(t)}function r7(t,e){if(t==null)return{};var r=Axe(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Axe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function gl(){return gl=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gl.apply(this,arguments)}function b$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Xi(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?b$(Object(r),!0).forEach(function(n){ws(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Pxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w$(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a7(n.key),n)}}function Txe(t,e,r){return e&&w$(t.prototype,e),r&&w$(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Oxe(t,e,r){return e=Sv(e),Mxe(t,n7()?Reflect.construct(e,r||[],Sv(t).constructor):e.apply(t,r))}function Mxe(t,e){if(e&&(Pu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Rxe(t)}function Rxe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n7(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(n7=function(){return!!t})()}function Sv(t){return Sv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sv(t)}function Ixe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&r2(t,e)}function r2(t,e){return r2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},r2(t,e)}function ws(t,e,r){return e=a7(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function a7(t){var e=Dxe(t,"string");return Pu(e)=="symbol"?e:e+""}function Dxe(t,e){if(Pu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Pu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Oo=(function(t){function e(){var r;Pxe(this,e);for(var n=arguments.length,a=new Array(n),i=0;i<n;i++)a[i]=arguments[i];return r=Oxe(this,e,[].concat(a)),ws(r,"state",{isAnimationFinished:!0}),ws(r,"id",qh("recharts-area-")),ws(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),xt(o)&&o()}),ws(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),xt(o)&&o()}),r}return Ixe(e,t),Txe(e,[{key:"renderDots",value:function(n,a,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var u=this.props,d=u.dot,h=u.points,m=u.dataKey,p=jt(this.props,!1),v=jt(d,!0),b=h.map(function(x,j){var N=Xi(Xi(Xi({key:"dot-".concat(j),r:3},p),v),{},{index:j,cx:x.x,cy:x.y,dataKey:m,value:x.value,payload:x.payload,points:h});return e.renderDotItem(d,N)}),y={clipPath:n?"url(#clipPath-".concat(a?"":"dots-").concat(i,")"):null};return U.createElement(lr,gl({className:"recharts-area-dots"},y),b)}},{key:"renderHorizontalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,u=o[0].x,d=o[o.length-1].x,h=n*Math.abs(u-d),m=ao(o.map(function(p){return p.y||0}));return De(i)&&typeof i=="number"?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(ao(i.map(function(p){return p.y||0})),m)),De(m)?U.createElement("rect",{x:u<d?u:u-h,y:0,width:h,height:Math.floor(m+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var a=this.props,i=a.baseLine,o=a.points,l=a.strokeWidth,u=o[0].y,d=o[o.length-1].y,h=n*Math.abs(u-d),m=ao(o.map(function(p){return p.x||0}));return De(i)&&typeof i=="number"?m=Math.max(i,m):i&&Array.isArray(i)&&i.length&&(m=Math.max(ao(i.map(function(p){return p.x||0})),m)),De(m)?U.createElement("rect",{x:0,y:u<d?u:u-h,width:m+(l?parseInt("".concat(l),10):1),height:Math.floor(h)}):null}},{key:"renderClipRect",value:function(n){var a=this.props.layout;return a==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,a,i,o){var l=this.props,u=l.layout,d=l.type,h=l.stroke,m=l.connectNulls,p=l.isRange;l.ref;var v=r7(l,kxe);return U.createElement(lr,{clipPath:i?"url(#clipPath-".concat(o,")"):null},U.createElement(Of,gl({},jt(v,!0),{points:n,connectNulls:m,type:d,baseLine:a,layout:u,stroke:"none",className:"recharts-area-area"})),h!=="none"&&U.createElement(Of,gl({},jt(this.props,!1),{className:"recharts-area-curve",layout:u,type:d,connectNulls:m,fill:"none",points:n})),h!=="none"&&p&&U.createElement(Of,gl({},jt(this.props,!1),{className:"recharts-area-curve",layout:u,type:d,connectNulls:m,fill:"none",points:a})))}},{key:"renderAreaWithAnimation",value:function(n,a){var i=this,o=this.props,l=o.points,u=o.baseLine,d=o.isAnimationActive,h=o.animationBegin,m=o.animationDuration,p=o.animationEasing,v=o.animationId,b=this.state,y=b.prevPoints,x=b.prevBaseLine;return U.createElement(pi,{begin:h,duration:m,isActive:d,easing:p,from:{t:0},to:{t:1},key:"area-".concat(v),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(j){var N=j.t;if(y){var S=y.length/l.length,k=l.map(function(R,I){var D=Math.floor(I*S);if(y[D]){var L=y[D],z=va(L.x,R.x),H=va(L.y,R.y);return Xi(Xi({},R),{},{x:z(N),y:H(N)})}return R}),C;if(De(u)&&typeof u=="number"){var A=va(x,u);C=A(N)}else if(St(u)||rd(u)){var T=va(x,0);C=T(N)}else C=u.map(function(R,I){var D=Math.floor(I*S);if(x[D]){var L=x[D],z=va(L.x,R.x),H=va(L.y,R.y);return Xi(Xi({},R),{},{x:z(N),y:H(N)})}return R});return i.renderAreaStatically(k,C,n,a)}return U.createElement(lr,null,U.createElement("defs",null,U.createElement("clipPath",{id:"animationClipPath-".concat(a)},i.renderClipRect(N))),U.createElement(lr,{clipPath:"url(#animationClipPath-".concat(a,")")},i.renderAreaStatically(l,u,n,a)))})}},{key:"renderArea",value:function(n,a){var i=this.props,o=i.points,l=i.baseLine,u=i.isAnimationActive,d=this.state,h=d.prevPoints,m=d.prevBaseLine,p=d.totalLength;return u&&o&&o.length&&(!h&&p>0||!oh(h,o)||!oh(m,l))?this.renderAreaWithAnimation(n,a):this.renderAreaStatically(o,l,n,a)}},{key:"render",value:function(){var n,a=this.props,i=a.hide,o=a.dot,l=a.points,u=a.className,d=a.top,h=a.left,m=a.xAxis,p=a.yAxis,v=a.width,b=a.height,y=a.isAnimationActive,x=a.id;if(i||!l||!l.length)return null;var j=this.state.isAnimationFinished,N=l.length===1,S=Ct("recharts-area",u),k=m&&m.allowDataOverflow,C=p&&p.allowDataOverflow,A=k||C,T=St(x)?this.id:x,R=(n=jt(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,D=I===void 0?3:I,L=R.strokeWidth,z=L===void 0?2:L,H=rse(o)?o:{},Z=H.clipDot,te=Z===void 0?!0:Z,G=D*2+z;return U.createElement(lr,{className:S},k||C?U.createElement("defs",null,U.createElement("clipPath",{id:"clipPath-".concat(T)},U.createElement("rect",{x:k?h:h-v/2,y:C?d:d-b/2,width:k?v:v*2,height:C?b:b*2})),!te&&U.createElement("clipPath",{id:"clipPath-dots-".concat(T)},U.createElement("rect",{x:h-G/2,y:d-G/2,width:v+G,height:b+G}))):null,N?null:this.renderArea(A,T),(o||N)&&this.renderDots(A,te,T),(!y||j)&&uo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.animationId!==a.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:a.curPoints,prevBaseLine:a.curBaseLine}:n.points!==a.curPoints||n.baseLine!==a.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])})(w.PureComponent);t7=Oo;ws(Oo,"displayName","Area");ws(Oo,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!ad.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});ws(Oo,"getBaseValue",function(t,e,r,n){var a=t.layout,i=t.baseValue,o=e.props.baseValue,l=o??i;if(De(l)&&typeof l=="number")return l;var u=a==="horizontal"?n:r,d=u.scale.domain();if(u.type==="number"){var h=Math.max(d[0],d[1]),m=Math.min(d[0],d[1]);return l==="dataMin"?m:l==="dataMax"||h<0?h:Math.max(Math.min(d[0],d[1]),0)}return l==="dataMin"?d[0]:l==="dataMax"?d[1]:d[0]});ws(Oo,"getComposedData",function(t){var e=t.props,r=t.item,n=t.xAxis,a=t.yAxis,i=t.xAxisTicks,o=t.yAxisTicks,l=t.bandSize,u=t.dataKey,d=t.stackedData,h=t.dataStartIndex,m=t.displayedData,p=t.offset,v=e.layout,b=d&&d.length,y=t7.getBaseValue(e,r,n,a),x=v==="horizontal",j=!1,N=m.map(function(k,C){var A;b?A=d[h+C]:(A=ea(k,u),Array.isArray(A)?j=!0:A=[y,A]);var T=A[1]==null||b&&ea(k,u)==null;return x?{x:D3({axis:n,ticks:i,bandSize:l,entry:k,index:C}),y:T?null:a.scale(A[1]),value:A,payload:k}:{x:T?null:n.scale(A[1]),y:D3({axis:a,ticks:o,bandSize:l,entry:k,index:C}),value:A,payload:k}}),S;return b||j?S=N.map(function(k){var C=Array.isArray(k.value)?k.value[0]:null;return x?{x:k.x,y:C!=null&&k.y!=null?a.scale(C):null}:{x:C!=null?n.scale(C):null,y:k.y}}):S=x?a.scale(y):n.scale(y),Xi({points:N,baseLine:S,layout:v,isRange:j},p)});ws(Oo,"renderDotItem",function(t,e){var r;if(U.isValidElement(t))r=U.cloneElement(t,e);else if(xt(t))r=t(e);else{var n=Ct("recharts-area-dot",typeof t!="boolean"?t.className:""),a=e.key,i=r7(e,Exe);r=U.createElement(Bk,gl({},i,{key:a,className:n}))}return r});function Tu(t){"@babel/helpers - typeof";return Tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tu(t)}function $xe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Lxe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o7(n.key),n)}}function Fxe(t,e,r){return e&&Lxe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bxe(t,e,r){return e=Cv(e),Vxe(t,s7()?Reflect.construct(e,r||[],Cv(t).constructor):e.apply(t,r))}function Vxe(t,e){if(e&&(Tu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return zxe(t)}function zxe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s7(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(s7=function(){return!!t})()}function Cv(t){return Cv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cv(t)}function Uxe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n2(t,e)}function n2(t,e){return n2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},n2(t,e)}function i7(t,e,r){return e=o7(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o7(t){var e=qxe(t,"string");return Tu(e)=="symbol"?e:e+""}function qxe(t,e){if(Tu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Tu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function a2(){return a2=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},a2.apply(this,arguments)}function Wxe(t){var e=t.xAxisId,r=qk(),n=Wk(),a=zV(e);return a==null?null:w.createElement(ld,a2({},a,{className:Ct("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return ni(o,!0)}}))}var B0=(function(t){function e(){return $xe(this,e),Bxe(this,e,arguments)}return Uxe(e,t),Fxe(e,[{key:"render",value:function(){return w.createElement(Wxe,this.props)}}])})(w.Component);i7(B0,"displayName","XAxis");i7(B0,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function Ou(t){"@babel/helpers - typeof";return Ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ou(t)}function Hxe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gxe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u7(n.key),n)}}function Kxe(t,e,r){return e&&Gxe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Yxe(t,e,r){return e=kv(e),Xxe(t,l7()?Reflect.construct(e,r||[],kv(t).constructor):e.apply(t,r))}function Xxe(t,e){if(e&&(Ou(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zxe(t)}function Zxe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function l7(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l7=function(){return!!t})()}function kv(t){return kv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},kv(t)}function Qxe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s2(t,e)}function s2(t,e){return s2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},s2(t,e)}function c7(t,e,r){return e=u7(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u7(t){var e=Jxe(t,"string");return Ou(e)=="symbol"?e:e+""}function Jxe(t,e){if(Ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function i2(){return i2=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},i2.apply(this,arguments)}var eye=function(e){var r=e.yAxisId,n=qk(),a=Wk(),i=UV(r);return i==null?null:w.createElement(ld,i2({},i,{className:Ct("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:a},ticksGenerator:function(l){return ni(l,!0)}}))},V0=(function(t){function e(){return Hxe(this,e),Yxe(this,e,arguments)}return Qxe(e,t),Kxe(e,[{key:"render",value:function(){return w.createElement(eye,this.props)}}])})(w.Component);c7(V0,"displayName","YAxis");c7(V0,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function _$(t){return aye(t)||nye(t)||rye(t)||tye()}function tye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 762In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rye(t,e){if(t){if(typeof t=="string")return o2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o2(t,e)}}function nye(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function aye(t){if(Array.isArray(t))return o2(t)}function o2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var l2=function(e,r,n,a,i){var o=rs(e,Gk),l=rs(e,$0),u=[].concat(_$(o),_$(l)),d=rs(e,F0),h="".concat(a,"Id"),m=a[0],p=r;if(u.length&&(p=u.reduce(function(y,x){if(x.props[h]===n&&ks(x.props,"extendDomain")&&De(x.props[m])){var j=x.props[m];return[Math.min(y[0],j),Math.max(y[1],j)]}return y},p)),d.length){var v="".concat(m,"1"),b="".concat(m,"2");p=d.reduce(function(y,x){if(x.props[h]===n&&ks(x.props,"extendDomain")&&De(x.props[v])&&De(x.props[b])){var j=x.props[v],N=x.props[b];return[Math.min(y[0],j,N),Math.max(y[1],j,N)]}return y},p)}return i&&i.length&&(p=i.reduce(function(y,x){return De(x)?[Math.min(y[0],x),Math.max(y[1],x)]:y},p)),p},Aj={exports:{}},j$;function sye(){return j$||(j$=1,(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function i(u,d,h,m,p){if(typeof h!="function")throw new TypeError("The listener must be a function");var v=new a(h,m||u,p),b=r?r+d:d;return u._events[b]?u._events[b].fn?u._events[b]=[u._events[b],v]:u._events[b].push(v):(u._events[b]=v,u._eventsCount++),u}function o(u,d){--u._eventsCount===0?u._events=new n:delete u._events[d]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],h,m;if(this._eventsCount===0)return d;for(m in h=this._events)e.call(h,m)&&d.push(r?m.slice(1):m);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},l.prototype.listeners=function(d){var h=r?r+d:d,m=this._events[h];if(!m)return[];if(m.fn)return[m.fn];for(var p=0,v=m.length,b=new Array(v);p<v;p++)b[p]=m[p].fn;return b},l.prototype.listenerCount=function(d){var h=r?r+d:d,m=this._events[h];return m?m.fn?1:m.length:0},l.prototype.emit=function(d,h,m,p,v,b){var y=r?r+d:d;if(!this._events[y])return!1;var x=this._events[y],j=arguments.length,N,S;if(x.fn){switch(x.once&&this.removeListener(d,x.fn,void 0,!0),j){case 1:return x.fn.call(x.context),!0;case 2:return x.fn.call(x.context,h),!0;case 3:return x.fn.call(x.context,h,m),!0;case 4:return x.fn.call(x.context,h,m,p),!0;case 5:return x.fn.call(x.context,h,m,p,v),!0;case 6:return x.fn.call(x.context,h,m,p,v,b),!0}for(S=1,N=new Array(j-1);S<j;S++)N[S-1]=arguments[S];x.fn.apply(x.context,N)}else{var k=x.length,C;for(S=0;S<k;S++)switch(x[S].once&&this.removeListener(d,x[S].fn,void 0,!0),j){case 1:x[S].fn.call(x[S].context);break;case 2:x[S].fn.call(x[S].context,h);break;case 3:x[S].fn.call(x[S].context,h,m);break;case 4:x[S].fn.call(x[S].context,h,m,p);break;default:if(!N)for(C=1,N=new Array(j-1);C<j;C++)N[C-1]=arguments[C];x[S].fn.apply(x[S].context,N)}}return!0},l.prototype.on=function(d,h,m){return i(this,d,h,m,!1)},l.prototype.once=function(d,h,m){return i(this,d,h,m,!0)},l.prototype.removeListener=function(d,h,m,p){var v=r?r+d:d;if(!this._events[v])return this;if(!h)return o(this,v),this;var b=this._events[v];if(b.fn)b.fn===h&&(!p||b.once)&&(!m||b.context===m)&&o(this,v);else{for(var y=0,x=[],j=b.length;y<j;y++)(b[y].fn!==h||p&&!b[y].once||m&&b[y].context!==m)&&x.push(b[y]);x.length?this._events[v]=x.length===1?x[0]:x:o(this,v)}return this},l.prototype.removeAllListeners=function(d){var h;return d?(h=r?r+d:d,this._events[h]&&o(this,h)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l})(Aj)),Aj.exports}var iye=sye();const oye=Ft(iye);var Pj=new oye,Tj="recharts.syncMouseEvents";function Ah(t){"@babel/helpers - typeof";return Ah=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ah(t)}function lye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,d7(n.key),n)}}function uye(t,e,r){return e&&cye(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Oj(t,e,r){return e=d7(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d7(t){var e=dye(t,"string");return Ah(e)=="symbol"?e:e+""}function dye(t,e){if(Ah(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ah(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var fye=(function(){function t(){lye(this,t),Oj(this,"activeIndex",0),Oj(this,"coordinateList",[]),Oj(this,"layout","horizontal")}return uye(t,[{key:"setDetails",value:function(r){var n,a=r.coordinateList,i=a===void 0?null:a,o=r.container,l=o===void 0?null:o,u=r.layout,d=u===void 0?null:u,h=r.offset,m=h===void 0?null:h,p=r.mouseHandlerCallback,v=p===void 0?null:p;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=d??this.layout,this.offset=m??this.offset,this.mouseHandlerCallback=v??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var a=this.container.getBoundingClientRect(),i=a.x,o=a.y,l=a.height,u=this.coordinateList[this.activeIndex].coordinate,d=((r=window)===null||r===void 0?void 0:r.scrollX)||0,h=((n=window)===null||n===void 0?void 0:n.scrollY)||0,m=i+u+d,p=o+this.offset.top+l/2+h;this.mouseHandlerCallback({pageX:m,pageY:p})}}}])})();function hye(t,e,r){if(r==="number"&&e===!0&&Array.isArray(t)){var n=t==null?void 0:t[0],a=t==null?void 0:t[1];if(n&&a&&De(n)&&De(a))return!0}return!1}function mye(t,e,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-a:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-a,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function f7(t){var e=t.cx,r=t.cy,n=t.radius,a=t.startAngle,i=t.endAngle,o=Yr(e,r,n,a),l=Yr(e,r,n,i);return{points:[o,l],cx:e,cy:r,radius:n,startAngle:a,endAngle:i}}function pye(t,e,r){var n,a,i,o;if(t==="horizontal")n=e.x,i=n,a=r.top,o=r.top+r.height;else if(t==="vertical")a=e.y,o=a,n=r.left,i=r.left+r.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var l=e.cx,u=e.cy,d=e.innerRadius,h=e.outerRadius,m=e.angle,p=Yr(l,u,d,m),v=Yr(l,u,h,m);n=p.x,a=p.y,i=v.x,o=v.y}else return f7(e);return[{x:n,y:a},{x:i,y:o}]}function Ph(t){"@babel/helpers - typeof";return Ph=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ph(t)}function N$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function Wp(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?N$(Object(r),!0).forEach(function(n){gye(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gye(t,e,r){return e=vye(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vye(t){var e=xye(t,"string");return Ph(e)=="symbol"?e:e+""}function xye(t,e){if(Ph(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Ph(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function yye(t){var e,r,n=t.element,a=t.tooltipEventType,i=t.isActive,o=t.activeCoordinate,l=t.activePayload,u=t.offset,d=t.activeTooltipIndex,h=t.tooltipAxisBandSize,m=t.layout,p=t.chartName,v=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!v||!i||!o||p!=="ScatterChart"&&a!=="axis")return null;var b,y=Of;if(p==="ScatterChart")b=o,y=bge;else if(p==="BarChart")b=mye(m,o,u,h),y=Fk;else if(m==="radial"){var x=f7(o),j=x.cx,N=x.cy,S=x.radius,k=x.startAngle,C=x.endAngle;b={cx:j,cy:N,startAngle:k,endAngle:C,innerRadius:S,outerRadius:S},y=xV}else b={points:pye(m,o,u)},y=Of;var A=Wp(Wp(Wp(Wp({stroke:"#ccc",pointerEvents:"none"},u),b),jt(v,!1)),{},{payload:l,payloadIndex:d,className:Ct("recharts-tooltip-cursor",v.className)});return w.isValidElement(v)?w.cloneElement(v,A):w.createElement(y,A)}var bye=["item"],wye=["children","className","width","height","style","compact","title","desc"];function Mu(t){"@babel/helpers - typeof";return Mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mu(t)}function zc(){return zc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},zc.apply(this,arguments)}function S$(t,e){return Nye(t)||jye(t,e)||m7(t,e)||_ye()}function _ye(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 763In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jye(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,a,i,o,l=[],u=!0,d=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(u=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(h){d=!0,a=h}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(d)throw a}}return l}}function Nye(t){if(Array.isArray(t))return t}function C$(t,e){if(t==null)return{};var r=Sye(t,e),n,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(a=0;a<i.length;a++)n=i[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Sye(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Cye(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,p7(n.key),n)}}function Eye(t,e,r){return e&&kye(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Aye(t,e,r){return e=Ev(e),Pye(t,h7()?Reflect.construct(e,r||[],Ev(t).constructor):e.apply(t,r))}function Pye(t,e){if(e&&(Mu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Tye(t)}function Tye(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function h7(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h7=function(){return!!t})()}function Ev(t){return Ev=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ev(t)}function Oye(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c2(t,e)}function c2(t,e){return c2=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},c2(t,e)}function Ru(t){return Iye(t)||Rye(t)||m7(t)||Mye()}function Mye(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 764In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m7(t,e){if(t){if(typeof t=="string")return u2(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return u2(t,e)}}function Rye(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Iye(t){if(Array.isArray(t))return u2(t)}function u2(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function k$(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function be(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?k$(Object(r),!0).forEach(function(n){at(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k$(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function at(t,e,r){return e=p7(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function p7(t){var e=Dye(t,"string");return Mu(e)=="symbol"?e:e+""}function Dye(t,e){if(Mu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var $ye={xAxis:["bottom","top"],yAxis:["left","right"]},Lye={width:"100%",height:"100%"},g7={x:0,y:0};function Hp(t){return t}var Fye=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},Bye=function(e,r,n,a){var i=r.find(function(h){return h&&h.index===n});if(i){if(e==="horizontal")return{x:i.coordinate,y:a.y};if(e==="vertical")return{x:a.x,y:i.coordinate};if(e==="centric"){var o=i.coordinate,l=a.radius;return be(be(be({},a),Yr(a.cx,a.cy,l,o)),{},{angle:o,radius:l})}var u=i.coordinate,d=a.angle;return be(be(be({},a),Yr(a.cx,a.cy,u,d)),{},{angle:d,radius:u})}return g7},z0=function(e,r){var n=r.graphicalItems,a=r.dataStartIndex,i=r.dataEndIndex,o=(n??[]).reduce(function(l,u){var d=u.props.data;return d&&d.length?[].concat(Ru(l),Ru(d)):l},[]);return o.length>0?o:e&&e.length&&De(a)&&De(i)?e.slice(a,i+1):[]};function v7(t){return t==="number"?[0,"auto"]:void 0}var d2=function(e,r,n,a){var i=e.graphicalItems,o=e.tooltipAxis,l=z0(r,e);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(u,d){var h,m=(h=d.props.data)!==null&&h!==void 0?h:r;m&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(m=m.slice(e.dataStartIndex,e.dataEndIndex+1));var p;if(o.dataKey&&!o.allowDuplicatedCategory){var v=m===void 0?l:m;p=Mg(v,o.dataKey,a)}else p=m&&m[n]||l[n];return p?[].concat(Ru(u),[pV(d,p)]):u},[])},E$=function(e,r,n,a){var i=a||{x:e.chartX,y:e.chartY},o=Fye(i,n),l=e.orderedTooltipTicks,u=e.tooltipAxis,d=e.tooltipTicks,h=rhe(o,l,d,u);if(h>=0&&d){var m=d[h]&&d[h].value,p=d2(e,r,h,m),v=Bye(n,l,h,i);return{activeTooltipIndex:h,activeLabel:m,activePayload:p,activeCoordinate:v}}return null},Vye=function(e,r){var n=r.axes,a=r.graphicalItems,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,h=e.layout,m=e.children,p=e.stackOffset,v=fV(h,i);return n.reduce(function(b,y){var x,j=y.type.defaultProps!==void 0?be(be({},y.type.defaultProps),y.props):y.props,N=j.type,S=j.dataKey,k=j.allowDataOverflow,C=j.allowDuplicatedCategory,A=j.scale,T=j.ticks,R=j.includeHidden,I=j[o];if(b[I])return b;var D=z0(e.data,{graphicalItems:a.filter(function(W){var q,se=o in W.props?W.props[o]:(q=W.type.defaultProps)===null||q===void 0?void 0:q[o];return se===I}),dataStartIndex:u,dataEndIndex:d}),L=D.length,z,H,Z;hye(j.domain,k,N)&&(z=PS(j.domain,null,k),v&&(N==="number"||A!=="auto")&&(Z=Tf(D,S,"category")));var te=v7(N);if(!z||z.length===0){var G,M=(G=j.domain)!==null&&G!==void 0?G:te;if(S){if(z=Tf(D,S,N),N==="category"&&v){var F=Hae(z);C&&F?(H=z,z=pv(0,L)):C||(z=B3(M,z,y).reduce(function(W,q){return W.indexOf(q)>=0?W:[].concat(Ru(W),[q])},[]))}else if(N==="category")C?z=z.filter(function(W){return W!==""&&!St(W)}):z=B3(M,z,y).reduce(function(W,q){return W.indexOf(q)>=0||q===""||St(q)?W:[].concat(Ru(W),[q])},[]);else if(N==="number"){var K=ohe(D,a.filter(function(W){var q,se,me=o in W.props?W.props[o]:(q=W.type.defaultProps)===null||q===void 0?void 0:q[o],fe="hide"in W.props?W.props.hide:(se=W.type.defaultProps)===null||se===void 0?void 0:se.hide;return me===I&&(R||!fe)}),S,i,h);K&&(z=K)}v&&(N==="number"||A!=="auto")&&(Z=Tf(D,S,"category"))}else v?z=pv(0,L):l&&l[I]&&l[I].hasStack&&N==="number"?z=p==="expand"?[0,1]:mV(l[I].stackGroups,u,d):z=dV(D,a.filter(function(W){var q=o in W.props?W.props[o]:W.type.defaultProps[o],se="hide"in W.props?W.props.hide:W.type.defaultProps.hide;return q===I&&(R||!se)}),N,h,!0);if(N==="number")z=l2(m,z,I,i,T),M&&(z=PS(M,z,k));else if(N==="category"&&M){var B=M,O=z.every(function(W){return B.indexOf(W)>=0});O&&(z=B)}}return be(be({},b),{},at({},I,be(be({},j),{},{axisType:i,domain:z,categoricalDomain:Z,duplicateDomain:H,originalDomain:(x=j.domain)!==null&&x!==void 0?x:te,isCategorical:v,layout:h})))},{})},zye=function(e,r){var n=r.graphicalItems,a=r.Axis,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,h=e.layout,m=e.children,p=z0(e.data,{graphicalItems:n,dataStartIndex:u,dataEndIndex:d}),v=p.length,b=fV(h,i),y=-1;return n.reduce(function(x,j){var N=j.type.defaultProps!==void 0?be(be({},j.type.defaultProps),j.props):j.props,S=N[o],k=v7("number");if(!x[S]){y++;var C;return b?C=pv(0,v):l&&l[S]&&l[S].hasStack?(C=mV(l[S].stackGroups,u,d),C=l2(m,C,S,i)):(C=PS(k,dV(p,n.filter(function(A){var T,R,I=o in A.props?A.props[o]:(T=A.type.defaultProps)===null||T===void 0?void 0:T[o],D="hide"in A.props?A.props.hide:(R=A.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===S&&!D}),"number",h),a.defaultProps.allowDataOverflow),C=l2(m,C,S,i)),be(be({},x),{},at({},S,be(be({axisType:i},a.defaultProps),{},{hide:!0,orientation:_a($ye,"".concat(i,".").concat(y%2),null),domain:C,originalDomain:k,isCategorical:b,layout:h})))}return x},{})},Uye=function(e,r){var n=r.axisType,a=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,u=r.dataStartIndex,d=r.dataEndIndex,h=e.children,m="".concat(a,"Id"),p=rs(h,i),v={};return p&&p.length?v=Vye(e,{axes:p,graphicalItems:o,axisType:a,axisIdKey:m,stackGroups:l,dataStartIndex:u,dataEndIndex:d}):o&&o.length&&(v=zye(e,{Axis:i,graphicalItems:o,axisType:a,axisIdKey:m,stackGroups:l,dataStartIndex:u,dataEndIndex:d})),v},qye=function(e){var r=ro(e),n=ni(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:fk(n,function(a){return a.coordinate}),tooltipAxis:r,tooltipAxisBandSize:iv(r,n)}},A$=function(e){var r=e.children,n=e.defaultShowTooltip,a=Un(r,Nu),i=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(i=a.props.startIndex),a.props.endIndex>=0&&(o=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},Wye=function(e){return!e||!e.length?!1:e.some(function(r){var n=si(r&&r.type);return n&&n.indexOf("Bar")>=0})},P$=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Hye=function(e,r){var n=e.props,a=e.graphicalItems,i=e.xAxisMap,o=i===void 0?{}:i,l=e.yAxisMap,u=l===void 0?{}:l,d=n.width,h=n.height,m=n.children,p=n.margin||{},v=Un(m,Nu),b=Un(m,Yc),y=Object.keys(u).reduce(function(C,A){var T=u[A],R=T.orientation;return!T.mirror&&!T.hide?be(be({},C),{},at({},R,C[R]+T.width)):C},{left:p.left||0,right:p.right||0}),x=Object.keys(o).reduce(function(C,A){var T=o[A],R=T.orientation;return!T.mirror&&!T.hide?be(be({},C),{},at({},R,_a(C,"".concat(R))+T.height)):C},{top:p.top||0,bottom:p.bottom||0}),j=be(be({},x),y),N=j.bottom;v&&(j.bottom+=v.props.height||Nu.defaultProps.height),b&&r&&(j=she(j,a,n,r));var S=d-j.left-j.right,k=h-j.top-j.bottom;return be(be({brushBottom:N},j),{},{width:Math.max(S,0),height:Math.max(k,0)})},Gye=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},Kye=function(e){var r=e.chartName,n=e.GraphicalChild,a=e.defaultTooltipEventType,i=a===void 0?"axis":a,o=e.validateTooltipEventTypes,l=o===void 0?["axis"]:o,u=e.axisComponents,d=e.legendContent,h=e.formatAxisMap,m=e.defaultProps,p=function(j,N){var S=N.graphicalItems,k=N.stackGroups,C=N.offset,A=N.updateId,T=N.dataStartIndex,R=N.dataEndIndex,I=j.barSize,D=j.layout,L=j.barGap,z=j.barCategoryGap,H=j.maxBarSize,Z=P$(D),te=Z.numericAxisName,G=Z.cateAxisName,M=Wye(S),F=[];return S.forEach(function(K,B){var O=z0(j.data,{graphicalItems:[K],dataStartIndex:T,dataEndIndex:R}),W=K.type.defaultProps!==void 0?be(be({},K.type.defaultProps),K.props):K.props,q=W.dataKey,se=W.maxBarSize,me=W["".concat(te,"Id")],fe=W["".concat(G,"Id")],Q={},pe=u.reduce(function(ne,le){var Se=N["".concat(le.axisType,"Map")],Ae=W["".concat(le.axisType,"Id")];Se&&Se[Ae]||le.axisType==="zAxis"||kl();var Ce=Se[Ae];return be(be({},ne),{},at(at({},le.axisType,Ce),"".concat(le.axisType,"Ticks"),ni(Ce)))},Q),V=pe[G],J=pe["".concat(G,"Ticks")],oe=k&&k[me]&&k[me].hasStack&&yhe(K,k[me].stackGroups),re=si(K.type).indexOf("Bar")>=0,Me=iv(V,J),ee=[],ce=M&&nhe({barSize:I,stackGroups:k,totalSize:Gye(pe,G)});if(re){var je,de,we=St(se)?H:se,ke=(je=(de=iv(V,J,!0))!==null&&de!==void 0?de:we)!==null&&je!==void 0?je:0;ee=ahe({barGap:L,barCategoryGap:z,bandSize:ke!==Me?ke:Me,sizeList:ce[fe],maxBarSize:we}),ke!==Me&&(ee=ee.map(function(ne){return be(be({},ne),{},{position:be(be({},ne.position),{},{offset:ne.position.offset-ke/2})})}))}var Y=K&&K.type&&K.type.getComposedData;Y&&F.push({props:be(be({},Y(be(be({},pe),{},{displayedData:O,props:j,dataKey:q,item:K,bandSize:Me,barPosition:ee,offset:C,stackedData:oe,layout:D,dataStartIndex:T,dataEndIndex:R}))),{},at(at(at({key:K.key||"item-".concat(B)},te,pe[te]),G,pe[G]),"animationId",A)),childIndex:sse(K,j.children),item:K})}),F},v=function(j,N){var S=j.props,k=j.dataStartIndex,C=j.dataEndIndex,A=j.updateId;if(!eM({props:S}))return null;var T=S.children,R=S.layout,I=S.stackOffset,D=S.data,L=S.reverseStackOrder,z=P$(R),H=z.numericAxisName,Z=z.cateAxisName,te=rs(T,n),G=ghe(D,te,"".concat(H,"Id"),"".concat(Z,"Id"),I,L),M=u.reduce(function(W,q){var se="".concat(q.axisType,"Map");return be(be({},W),{},at({},se,Uye(S,be(be({},q),{},{graphicalItems:te,stackGroups:q.axisType===H&&G,dataStartIndex:k,dataEndIndex:C}))))},{}),F=Hye(be(be({},M),{},{props:S,graphicalItems:te}),N==null?void 0:N.legendBBox);Object.keys(M).forEach(function(W){M[W]=h(S,M[W],F,W.replace("Map",""),r)});var K=M["".concat(Z,"Map")],B=qye(K),O=p(S,be(be({},M),{},{dataStartIndex:k,dataEndIndex:C,updateId:A,graphicalItems:te,stackGroups:G,offset:F}));return be(be({formattedGraphicalItems:O,graphicalItems:te,offset:F,stackGroups:G},B),M)},b=(function(x){function j(N){var S,k,C;return Cye(this,j),C=Aye(this,j,[N]),at(C,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),at(C,"accessibilityManager",new fye),at(C,"handleLegendBBoxUpdate",function(A){if(A){var T=C.state,R=T.dataStartIndex,I=T.dataEndIndex,D=T.updateId;C.setState(be({legendBBox:A},v({props:C.props,dataStartIndex:R,dataEndIndex:I,updateId:D},be(be({},C.state),{},{legendBBox:A}))))}}),at(C,"handleReceiveSyncEvent",function(A,T,R){if(C.props.syncId===A){if(R===C.eventEmitterSymbol&&typeof C.props.syncMethod!="function")return;C.applySyncEvent(T)}}),at(C,"handleBrushChange",function(A){var T=A.startIndex,R=A.endIndex;if(T!==C.state.dataStartIndex||R!==C.state.dataEndIndex){var I=C.state.updateId;C.setState(function(){return be({dataStartIndex:T,dataEndIndex:R},v({props:C.props,dataStartIndex:T,dataEndIndex:R,updateId:I},C.state))}),C.triggerSyncEvent({dataStartIndex:T,dataEndIndex:R})}}),at(C,"handleMouseEnter",function(A){var T=C.getMouseInfo(A);if(T){var R=be(be({},T),{},{isTooltipActive:!0});C.setState(R),C.triggerSyncEvent(R);var I=C.props.onMouseEnter;xt(I)&&I(R,A)}}),at(C,"triggeredAfterMouseMove",function(A){var T=C.getMouseInfo(A),R=T?be(be({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};C.setState(R),C.triggerSyncEvent(R);var I=C.props.onMouseMove;xt(I)&&I(R,A)}),at(C,"handleItemMouseEnter",function(A){C.setState(function(){return{isTooltipActive:!0,activeItem:A,activePayload:A.tooltipPayload,activeCoordinate:A.tooltipPosition||{x:A.cx,y:A.cy}}})}),at(C,"handleItemMouseLeave",function(){C.setState(function(){return{isTooltipActive:!1}})}),at(C,"handleMouseMove",function(A){A.persist(),C.throttleTriggeredAfterMouseMove(A)}),at(C,"handleMouseLeave",function(A){C.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};C.setState(T),C.triggerSyncEvent(T);var R=C.props.onMouseLeave;xt(R)&&R(T,A)}),at(C,"handleOuterEvent",function(A){var T=ase(A),R=_a(C.props,"".concat(T));if(T&&xt(R)){var I,D;/.*touch.*/i.test(T)?D=C.getMouseInfo(A.changedTouches[0]):D=C.getMouseInfo(A),R((I=D)!==null&&I!==void 0?I:{},A)}}),at(C,"handleClick",function(A){var T=C.getMouseInfo(A);if(T){var R=be(be({},T),{},{isTooltipActive:!0});C.setState(R),C.triggerSyncEvent(R);var I=C.props.onClick;xt(I)&&I(R,A)}}),at(C,"handleMouseDown",function(A){var T=C.props.onMouseDown;if(xt(T)){var R=C.getMouseInfo(A);T(R,A)}}),at(C,"handleMouseUp",function(A){var T=C.props.onMouseUp;if(xt(T)){var R=C.getMouseInfo(A);T(R,A)}}),at(C,"handleTouchMove",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&C.throttleTriggeredAfterMouseMove(A.changedTouches[0])}),at(C,"handleTouchStart",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&C.handleMouseDown(A.changedTouches[0])}),at(C,"handleTouchEnd",function(A){A.changedTouches!=null&&A.changedTouches.length>0&&C.handleMouseUp(A.changedTouches[0])}),at(C,"handleDoubleClick",function(A){var T=C.props.onDoubleClick;if(xt(T)){var R=C.getMouseInfo(A);T(R,A)}}),at(C,"handleContextMenu",function(A){var T=C.props.onContextMenu;if(xt(T)){var R=C.getMouseInfo(A);T(R,A)}}),at(C,"triggerSyncEvent",function(A){C.props.syncId!==void 0&&Pj.emit(Tj,C.props.syncId,A,C.eventEmitterSymbol)}),at(C,"applySyncEvent",function(A){var T=C.props,R=T.layout,I=T.syncMethod,D=C.state.updateId,L=A.dataStartIndex,z=A.dataEndIndex;if(A.dataStartIndex!==void 0||A.dataEndIndex!==void 0)C.setState(be({dataStartIndex:L,dataEndIndex:z},v({props:C.props,dataStartIndex:L,dataEndIndex:z,updateId:D},C.state)));else if(A.activeTooltipIndex!==void 0){var H=A.chartX,Z=A.chartY,te=A.activeTooltipIndex,G=C.state,M=G.offset,F=G.tooltipTicks;if(!M)return;if(typeof I=="function")te=I(F,A);else if(I==="value"){te=-1;for(var K=0;K<F.length;K++)if(F[K].value===A.activeLabel){te=K;break}}var B=be(be({},M),{},{x:M.left,y:M.top}),O=Math.min(H,B.x+B.width),W=Math.min(Z,B.y+B.height),q=F[te]&&F[te].value,se=d2(C.state,C.props.data,te),me=F[te]?{x:R==="horizontal"?F[te].coordinate:O,y:R==="horizontal"?W:F[te].coordinate}:g7;C.setState(be(be({},A),{},{activeLabel:q,activeCoordinate:me,activePayload:se,activeTooltipIndex:te}))}else C.setState(A)}),at(C,"renderCursor",function(A){var T,R=C.state,I=R.isTooltipActive,D=R.activeCoordinate,L=R.activePayload,z=R.offset,H=R.activeTooltipIndex,Z=R.tooltipAxisBandSize,te=C.getTooltipEventType(),G=(T=A.props.active)!==null&&T!==void 0?T:I,M=C.props.layout,F=A.key||"_recharts-cursor";return U.createElement(yye,{key:F,activeCoordinate:D,activePayload:L,activeTooltipIndex:H,chartName:r,element:A,isActive:G,layout:M,offset:z,tooltipAxisBandSize:Z,tooltipEventType:te})}),at(C,"renderPolarAxis",function(A,T,R){var I=_a(A,"type.axisType"),D=_a(C.state,"".concat(I,"Map")),L=A.type.defaultProps,z=L!==void 0?be(be({},L),A.props):A.props,H=D&&D[z["".concat(I,"Id")]];return w.cloneElement(A,be(be({},H),{},{className:Ct(I,H.className),key:A.key||"".concat(T,"-").concat(R),ticks:ni(H,!0)}))}),at(C,"renderPolarGrid",function(A){var T=A.props,R=T.radialLines,I=T.polarAngles,D=T.polarRadius,L=C.state,z=L.radiusAxisMap,H=L.angleAxisMap,Z=ro(z),te=ro(H),G=te.cx,M=te.cy,F=te.innerRadius,K=te.outerRadius;return w.cloneElement(A,{polarAngles:Array.isArray(I)?I:ni(te,!0).map(function(B){return B.coordinate}),polarRadius:Array.isArray(D)?D:ni(Z,!0).map(function(B){return B.coordinate}),cx:G,cy:M,innerRadius:F,outerRadius:K,key:A.key||"polar-grid",radialLines:R})}),at(C,"renderLegend",function(){var A=C.state.formattedGraphicalItems,T=C.props,R=T.children,I=T.width,D=T.height,L=C.props.margin||{},z=I-(L.left||0)-(L.right||0),H=cV({children:R,formattedGraphicalItems:A,legendWidth:z,legendContent:d});if(!H)return null;var Z=H.item,te=C$(H,bye);return w.cloneElement(Z,be(be({},te),{},{chartWidth:I,chartHeight:D,margin:L,onBBoxUpdate:C.handleLegendBBoxUpdate}))}),at(C,"renderTooltip",function(){var A,T=C.props,R=T.children,I=T.accessibilityLayer,D=Un(R,vs);if(!D)return null;var L=C.state,z=L.isTooltipActive,H=L.activeCoordinate,Z=L.activePayload,te=L.activeLabel,G=L.offset,M=(A=D.props.active)!==null&&A!==void 0?A:z;return w.cloneElement(D,{viewBox:be(be({},G),{},{x:G.left,y:G.top}),active:M,label:te,payload:M?Z:[],coordinate:H,accessibilityLayer:I})}),at(C,"renderBrush",function(A){var T=C.props,R=T.margin,I=T.data,D=C.state,L=D.offset,z=D.dataStartIndex,H=D.dataEndIndex,Z=D.updateId;return w.cloneElement(A,{key:A.key||"_recharts-brush",onChange:Vp(C.handleBrushChange,A.props.onChange),data:I,x:De(A.props.x)?A.props.x:L.left,y:De(A.props.y)?A.props.y:L.top+L.height+L.brushBottom-(R.bottom||0),width:De(A.props.width)?A.props.width:L.width,startIndex:z,endIndex:H,updateId:"brush-".concat(Z)})}),at(C,"renderReferenceElement",function(A,T,R){if(!A)return null;var I=C,D=I.clipPathId,L=C.state,z=L.xAxisMap,H=L.yAxisMap,Z=L.offset,te=A.type.defaultProps||{},G=A.props,M=G.xAxisId,F=M===void 0?te.xAxisId:M,K=G.yAxisId,B=K===void 0?te.yAxisId:K;return w.cloneElement(A,{key:A.key||"".concat(T,"-").concat(R),xAxis:z[F],yAxis:H[B],viewBox:{x:Z.left,y:Z.top,width:Z.width,height:Z.height},clipPathId:D})}),at(C,"renderActivePoints",function(A){var T=A.item,R=A.activePoint,I=A.basePoint,D=A.childIndex,L=A.isRange,z=[],H=T.props.key,Z=T.item.type.defaultProps!==void 0?be(be({},T.item.type.defaultProps),T.item.props):T.item.props,te=Z.activeDot,G=Z.dataKey,M=be(be({index:D,dataKey:G,cx:R.x,cy:R.y,r:4,fill:Lk(T.item),strokeWidth:2,stroke:"#fff",payload:R.payload,value:R.value},jt(te,!1)),Rg(te));return z.push(j.renderActiveDot(te,M,"".concat(H,"-activePoint-").concat(D))),I?z.push(j.renderActiveDot(te,be(be({},M),{},{cx:I.x,cy:I.y}),"".concat(H,"-basePoint-").concat(D))):L&&z.push(null),z}),at(C,"renderGraphicChild",function(A,T,R){var I=C.filterFormatItem(A,T,R);if(!I)return null;var D=C.getTooltipEventType(),L=C.state,z=L.isTooltipActive,H=L.tooltipAxis,Z=L.activeTooltipIndex,te=L.activeLabel,G=C.props.children,M=Un(G,vs),F=I.props,K=F.points,B=F.isRange,O=F.baseLine,W=I.item.type.defaultProps!==void 0?be(be({},I.item.type.defaultProps),I.item.props):I.item.props,q=W.activeDot,se=W.hide,me=W.activeBar,fe=W.activeShape,Q=!!(!se&&z&&M&&(q||me||fe)),pe={};D!=="axis"&&M&&M.props.trigger==="click"?pe={onClick:Vp(C.handleItemMouseEnter,A.props.onClick)}:D!=="axis"&&(pe={onMouseLeave:Vp(C.handleItemMouseLeave,A.props.onMouseLeave),onMouseEnter:Vp(C.handleItemMouseEnter,A.props.onMouseEnter)});var V=w.cloneElement(A,be(be({},I.props),pe));function J(le){return typeof H.dataKey=="function"?H.dataKey(le.payload):null}if(Q)if(Z>=0){var oe,re;if(H.dataKey&&!H.allowDuplicatedCategory){var Me=typeof H.dataKey=="function"?J:"payload.".concat(H.dataKey.toString());oe=Mg(K,Me,te),re=B&&O&&Mg(O,Me,te)}else oe=K==null?void 0:K[Z],re=B&&O&&O[Z];if(fe||me){var ee=A.props.activeIndex!==void 0?A.props.activeIndex:Z;return[w.cloneElement(A,be(be(be({},I.props),pe),{},{activeIndex:ee})),null,null]}if(!St(oe))return[V].concat(Ru(C.renderActivePoints({item:I,activePoint:oe,basePoint:re,childIndex:Z,isRange:B})))}else{var ce,je=(ce=C.getItemByXY(C.state.activeCoordinate))!==null&&ce!==void 0?ce:{graphicalItem:V},de=je.graphicalItem,we=de.item,ke=we===void 0?A:we,Y=de.childIndex,ne=be(be(be({},I.props),pe),{},{activeIndex:Y});return[w.cloneElement(ke,ne),null,null]}return B?[V,null,null]:[V,null]}),at(C,"renderCustomized",function(A,T,R){return w.cloneElement(A,be(be({key:"recharts-customized-".concat(R)},C.props),C.state))}),at(C,"renderMap",{CartesianGrid:{handler:Hp,once:!0},ReferenceArea:{handler:C.renderReferenceElement},ReferenceLine:{handler:Hp},ReferenceDot:{handler:C.renderReferenceElement},XAxis:{handler:Hp},YAxis:{handler:Hp},Brush:{handler:C.renderBrush,once:!0},Bar:{handler:C.renderGraphicChild},Line:{handler:C.renderGraphicChild},Area:{handler:C.renderGraphicChild},Radar:{handler:C.renderGraphicChild},RadialBar:{handler:C.renderGraphicChild},Scatter:{handler:C.renderGraphicChild},Pie:{handler:C.renderGraphicChild},Funnel:{handler:C.renderGraphicChild},Tooltip:{handler:C.renderCursor,once:!0},PolarGrid:{handler:C.renderPolarGrid,once:!0},PolarAngleAxis:{handler:C.renderPolarAxis},PolarRadiusAxis:{handler:C.renderPolarAxis},Customized:{handler:C.renderCustomized}}),C.clipPathId="".concat((S=N.id)!==null&&S!==void 0?S:qh("recharts"),"-clip"),C.throttleTriggeredAfterMouseMove=lB(C.triggeredAfterMouseMove,(k=N.throttleDelay)!==null&&k!==void 0?k:1e3/60),C.state={},C}return Oye(j,x),Eye(j,[{key:"componentDidMount",value:function(){var S,k;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(k=this.props.margin.top)!==null&&k!==void 0?k:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var S=this.props,k=S.children,C=S.data,A=S.height,T=S.layout,R=Un(k,vs);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var D=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,L=d2(this.state,C,I,D),z=this.state.tooltipTicks[I].coordinate,H=(this.state.offset.top+A)/2,Z=T==="horizontal",te=Z?{x:z,y:H}:{y:z,x:H},G=this.state.formattedGraphicalItems.find(function(F){var K=F.item;return K.type.name==="Scatter"});G&&(te=be(be({},te),G.props.points[I].tooltipPosition),L=G.props.points[I].tooltipPayload);var M={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:D,activePayload:L,activeCoordinate:te};this.setState(M),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(S,k){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==k.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==S.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==S.margin){var C,A;this.accessibilityManager.setDetails({offset:{left:(C=this.props.margin.left)!==null&&C!==void 0?C:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0}})}return null}},{key:"componentDidUpdate",value:function(S){QN([Un(S.children,vs)],[Un(this.props.children,vs)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var S=Un(this.props.children,vs);if(S&&typeof S.props.shared=="boolean"){var k=S.props.shared?"axis":"item";return l.indexOf(k)>=0?k:i}return i}},{key:"getMouseInfo",value:function(S){if(!this.container)return null;var k=this.container,C=k.getBoundingClientRect(),A=Hle(C),T={chartX:Math.round(S.pageX-A.left),chartY:Math.round(S.pageY-A.top)},R=C.width/k.offsetWidth||1,I=this.inRange(T.chartX,T.chartY,R);if(!I)return null;var D=this.state,L=D.xAxisMap,z=D.yAxisMap,H=this.getTooltipEventType(),Z=E$(this.state,this.props.data,this.props.layout,I);if(H!=="axis"&&L&&z){var te=ro(L).scale,G=ro(z).scale,M=te&&te.invert?te.invert(T.chartX):null,F=G&&G.invert?G.invert(T.chartY):null;return be(be({},T),{},{xValue:M,yValue:F},Z)}return Z?be(be({},T),Z):null}},{key:"inRange",value:function(S,k){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,A=this.props.layout,T=S/C,R=k/C;if(A==="horizontal"||A==="vertical"){var I=this.state.offset,D=T>=I.left&&T<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return D?{x:T,y:R}:null}var L=this.state,z=L.angleAxisMap,H=L.radiusAxisMap;if(z&&H){var Z=ro(z);return U3({x:T,y:R},Z)}return null}},{key:"parseEventsOfWrapper",value:function(){var S=this.props.children,k=this.getTooltipEventType(),C=Un(S,vs),A={};C&&k==="axis"&&(C.props.trigger==="click"?A={onClick:this.handleClick}:A={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=Rg(this.props,this.handleOuterEvent);return be(be({},T),A)}},{key:"addListener",value:function(){Pj.on(Tj,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Pj.removeListener(Tj,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(S,k,C){for(var A=this.state.formattedGraphicalItems,T=0,R=A.length;T<R;T++){var I=A[T];if(I.item===S||I.props.key===S.key||k===si(I.item.type)&&C===I.childIndex)return I}return null}},{key:"renderClipPath",value:function(){var S=this.clipPathId,k=this.state.offset,C=k.left,A=k.top,T=k.height,R=k.width;return U.createElement("defs",null,U.createElement("clipPath",{id:S},U.createElement("rect",{x:C,y:A,height:T,width:R})))}},{key:"getXScales",value:function(){var S=this.state.xAxisMap;return S?Object.entries(S).reduce(function(k,C){var A=S$(C,2),T=A[0],R=A[1];return be(be({},k),{},at({},T,R.scale))},{}):null}},{key:"getYScales",value:function(){var S=this.state.yAxisMap;return S?Object.entries(S).reduce(function(k,C){var A=S$(C,2),T=A[0],R=A[1];return be(be({},k),{},at({},T,R.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(S){var k;return(k=this.state.xAxisMap)===null||k===void 0||(k=k[S])===null||k===void 0?void 0:k.scale}},{key:"getYScaleByAxisId",value:function(S){var k;return(k=this.state.yAxisMap)===null||k===void 0||(k=k[S])===null||k===void 0?void 0:k.scale}},{key:"getItemByXY",value:function(S){var k=this.state,C=k.formattedGraphicalItems,A=k.activeItem;if(C&&C.length)for(var T=0,R=C.length;T<R;T++){var I=C[T],D=I.props,L=I.item,z=L.type.defaultProps!==void 0?be(be({},L.type.defaultProps),L.props):L.props,H=si(L.type);if(H==="Bar"){var Z=(D.data||[]).find(function(F){return uge(S,F)});if(Z)return{graphicalItem:I,payload:Z}}else if(H==="RadialBar"){var te=(D.data||[]).find(function(F){return U3(S,F)});if(te)return{graphicalItem:I,payload:te}}else if(M0(I,A)||R0(I,A)||Nh(I,A)){var G=eve({graphicalItem:I,activeTooltipItem:A,itemData:z.data}),M=z.activeIndex===void 0?G:z.activeIndex;return{graphicalItem:be(be({},I),{},{childIndex:M}),payload:Nh(I,A)?z.data[G]:I.props.data[G]}}}return null}},{key:"render",value:function(){var S=this;if(!eM(this))return null;var k=this.props,C=k.children,A=k.className,T=k.width,R=k.height,I=k.style,D=k.compact,L=k.title,z=k.desc,H=C$(k,wye),Z=jt(H,!1);if(D)return U.createElement(o$,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement(eS,zc({},Z,{width:T,height:R,title:L,desc:z}),this.renderClipPath(),rM(C,this.renderMap)));if(this.props.accessibilityLayer){var te,G;Z.tabIndex=(te=this.props.tabIndex)!==null&&te!==void 0?te:0,Z.role=(G=this.props.role)!==null&&G!==void 0?G:"application",Z.onKeyDown=function(F){S.accessibilityManager.keyboardEvent(F)},Z.onFocus=function(){S.accessibilityManager.focus()}}var M=this.parseEventsOfWrapper();return U.createElement(o$,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},U.createElement("div",zc({className:Ct("recharts-wrapper",A),style:be({position:"relative",cursor:"default",width:T,height:R},I)},M,{ref:function(K){S.container=K}}),U.createElement(eS,zc({},Z,{width:T,height:R,title:L,desc:z,style:Lye}),this.renderClipPath(),rM(C,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])})(w.Component);at(b,"displayName",r),at(b,"defaultProps",be({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},m)),at(b,"getDerivedStateFromProps",function(x,j){var N=x.dataKey,S=x.data,k=x.children,C=x.width,A=x.height,T=x.layout,R=x.stackOffset,I=x.margin,D=j.dataStartIndex,L=j.dataEndIndex;if(j.updateId===void 0){var z=A$(x);return be(be(be({},z),{},{updateId:0},v(be(be({props:x},z),{},{updateId:0}),j)),{},{prevDataKey:N,prevData:S,prevWidth:C,prevHeight:A,prevLayout:T,prevStackOffset:R,prevMargin:I,prevChildren:k})}if(N!==j.prevDataKey||S!==j.prevData||C!==j.prevWidth||A!==j.prevHeight||T!==j.prevLayout||R!==j.prevStackOffset||!Kc(I,j.prevMargin)){var H=A$(x),Z={chartX:j.chartX,chartY:j.chartY,isTooltipActive:j.isTooltipActive},te=be(be({},E$(j,S,T)),{},{updateId:j.updateId+1}),G=be(be(be({},H),Z),te);return be(be(be({},G),v(be({props:x},G),j)),{},{prevDataKey:N,prevData:S,prevWidth:C,prevHeight:A,prevLayout:T,prevStackOffset:R,prevMargin:I,prevChildren:k})}if(!QN(k,j.prevChildren)){var M,F,K,B,O=Un(k,Nu),W=O&&(M=(F=O.props)===null||F===void 0?void 0:F.startIndex)!==null&&M!==void 0?M:D,q=O&&(K=(B=O.props)===null||B===void 0?void 0:B.endIndex)!==null&&K!==void 0?K:L,se=W!==D||q!==L,me=!St(S),fe=me&&!se?j.updateId:j.updateId+1;return be(be({updateId:fe},v(be(be({props:x},j),{},{updateId:fe,dataStartIndex:W,dataEndIndex:q}),j)),{},{prevChildren:k,dataStartIndex:W,dataEndIndex:q})}return null}),at(b,"renderActiveDot",function(x,j,N){var S;return w.isValidElement(x)?S=w.cloneElement(x,j):xt(x)?S=x(j):S=U.createElement(Bk,j),U.createElement(lr,{className:"recharts-active-dot",key:N},S)});var y=w.forwardRef(function(j,N){return U.createElement(b,zc({},j,{ref:N}))});return y.displayName=b.displayName,y},Yye=Kye({chartName:"AreaChart",GraphicalChild:Oo,axisComponents:[{axisType:"xAxis",AxisComp:B0},{axisType:"yAxis",AxisComp:V0}],formatAxisMap:Xve}),Uc=(t=>(t.TEXT="text",t.IMAGE="image",t.AUDIO="audio",t))(Uc||{}),ll=(t=>(t.INCOMING="incoming",t.OUTGOING="outgoing",t))(ll||{});function x7(t,e){var i,o,l,u,d,h,m,p,v,b;const r=[...e].sort((y,x)=>new Date(y.sent_at).getTime()-new Date(x.sent_at).getTime()),n=r[r.length-1],a=e.filter(y=>y.from_type==="user"&&y.status!=="read").length;return{id:t.id,contactId:t.contact_id,contactName:((i=t.contact)==null?void 0:i.name)||((o=t.contact)==null?void 0:o.call_name)||((l=t.contact)==null?void 0:l.phone_number)||"Desconhecido",contactPhone:((u=t.contact)==null?void 0:u.phone_number)||"",contactAvatar:((d=t.contact)==null?void 0:d.profile_picture_url)||`https://ui-avatars.c
764om/api/?name=${encodeURIComponent(((h=t.contact)==null?void 0:h.name)||"U")}&background=0ea5e9&color=fff`,contactEmail:((m=t.contact)==null?void 0:m.email)||null,status:t.status,isActive:t.is_active,assignedTeam:t.assigned_team,assignedUserId:t.assigned_user_id,assignedUserName:null,lastMessage:(n==null?void 0:n.content)||"",lastMessageTime:Qye(t.last_message_at),unreadCount:a,tags:[...t.tags||[],...((p=t.contact)==null?void 0:p.tags)||[]],messages:r.map(f2),clientMemory:((v=t.contact)==null?void 0:v.client_memory)||ebe(),notes:((b=t.contact)==null?void 0:b.notes)||null}}function f2(t){return{id:t.id,content:t.content||"",timestamp:Jye(t.sent_at),direction:t.from_type==="user"?"incoming":"outgoing",type:Xye(t.type),status:Zye(t.status),fromType:t.from_type,mediaUrl:t.media_url,whatsappMessageId:t.whatsapp_message_id}}function Xye(t){switch(t){case"image":return"image";case"audio":return"audio";default:return"text"}}function Zye(t){switch(t){case"read":return"read";case"delivered":return"delivered";default:return"sent"}}function Qye(t){const e=new Date(t),n=new Date().getTime()-e.getTime(),a=Math.floor(n/6e4),i=Math.floor(n/36e5),o=Math.floor(n/864e5);return a<1?"Agora":a<60?`${a}min`:i<24?`${i}h`:o===1?"Ontem":o<7?`${o}d`:e.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"})}function Jye(t){return new Date(t).toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"})}function ebe(){return{last_updated:null,lead_profile:{interests:[],lead_stage:"new",objections:[],products_discussed:[],communication_style:"unknown",qualification_score:0},sales_intelligence:{pain_points:[],next_best_action:"qualify",budget_indication:"unknown",decision_timeline:"unknown"},interaction_summary:{response_pattern:"unknown",last_contact_reason:"",total_conversations:0,preferred_contact_time:"unknown"},conversation_history:[]}}const Xs=async()=>{const{data:{user:t}}=await ve.auth.getUser();if(!t)throw new Error("User not authenticated");return t.id},ug=new Map,Mj=async()=>{const t=await Xs();if(ug.has(t))return ug.get(t);const{data:e}=await ve.from("pipeline_stages").select("id, title, is_system").eq("is_system",!0).eq("is_active",!0),r=e==null?void 0:e.find(i=>i.title.toLowerCase()==="ganho"),n=e==null?void 0:e.find(i=>i.title.toLowerCase()==="perdido"),a={ganhoId:(r==null?void 0:r.id)||null,perdidoId:(n==null?void 0:n.id)||null};return ug.set(t,a),a},Rj=()=>{ug.clear()},tbe=t=>{if(!t||t===0)return"0s";const e=Math.floor(t/1e3);if(e<60)return`${e}s`;const r=Math.floor(e/60),n=e%60;return`${r}m ${n}s`},Ij=(t,e)=>{if(e===0)return t>0?"+100%":"0%";const r=(t-e)/e*100;return`${r>=0?"+":""}${r.toFixed(0)}%`},T$=t=>["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"][t.getDay()],Gp=t=>t.toISOString().split("T")[0],Ge={fetchDashboardMetrics:async(t=1)=>{var l;new Date().setHours(23,59,59,999);const r=new Date;r.setDate(r.getDate()-(t-1)),r.setHours(0,0,0,0);const n=r.toISOString(),a=new Date(r);a.setMilliseconds(-1),a.toISOString();const i=new Date(r);i.setDate(i.getDate()-t);const o=i.toISOString();try{const[u,d,h,m,p,v,b,y,x]=await Promise.all([ve.from("conversations").select("id",{count:"exact",head:!0}).gte("last_message_at",n),ve.from("conversations").select("id",{count:"exact",head:!0}).gte("last_message_at",o).lt("last_message_at",n),ve.from("contacts").select("id",{count:"exact",head:!0}).gte("created_at",n),ve.from("contacts").select("id",{count:"exact",head:!0}).gte("created_at",o).lt("created_at",n),ve.from("deals").select("id",{count:"exact",head:!0}).not("won_at","is",null).gte("won_at",n),ve.from("deals").select("id",{count:"exact",head:!0}).not("won_at","is",null).gte("won_at",o).lt("won_at",n),ve.from("appointments").select("id",{count:"exact",head:!0}).gte("created_at",n),ve.from("appointments").select("id",{count:"exact",head:!0}).gte("created_at",o).lt("created_at",n),ve.from("messages").select("nina_response_time").not("nina_response_time","is",null).gt("nina_response_time",0).gte("sent_at",n)]),j=u.count||0,N=d.count||0,S=h.count||0,k=m.count||0,C=(p.count||0)+(b.count||0),A=(v.count||0)+(y.count||0),T=((l=x.data)==null?void 0:l.map(I=>I.nina_response_time).filter(I=>I!=null))||[],R=T.length>0?T.reduce((I,D)=>
764I+D,0)/T.length:0;return[{label:"Atendimentos",value:j.toString(),trend:Ij(j,N),trendUp:j>=N},{label:"Conversões",value:C.toString(),trend:Ij(C,A),trendUp:C>=A},{label:"Tempo Médio",value:tbe(R),trend:"-",trendUp:!0},{label:"Novos Leads",value:S.toString(),trend:Ij(S,k),trendUp:S>=k}]}catch(u){return console.error("[API] Error fetching dashboard metrics:",u),[{label:"Atendimentos",value:"0",trend:"0%",trendUp:!0},{label:"Conversões",value:"0",trend:"0%",trendUp:!0},{label:"Tempo Médio",value:"0s",trend:"-",trendUp:!0},{label:"Novos Leads",value:"0",trend:"0%",trendUp:!0}]}},fetchChartData:async(t=7)=>{const e=new Date;e.setDate(e.getDate()-(t-1)),e.setHours(0,0,0,0);try{const[r,n,a]=await Promise.all([ve.from("messages").select("sent_at").gte("sent_at",e.toISOString()),ve.from("deals").select("won_at").not("won_at","is",null).gte("won_at",e.toISOString()),ve.from("appointments").select("created_at").gte("created_at",e.toISOString())]),i=new Map;(r.data||[]).forEach(u=>{const d=Gp(new Date(u.sent_at));i.set(d,(i.get(d)||0)+1)});const o=new Map;(n.data||[]).forEach(u=>{if(u.won_at){const d=Gp(new Date(u.won_at));o.set(d,(o.get(d)||0)+1)}}),(a.data||[]).forEach(u=>{if(u.created_at){const d=Gp(new Date(u.created_at));o.set(d,(o.get(d)||0)+1)}});const l=[];for(let u=t-1;u>=0;u--){const d=new Date;d.setDate(d.getDate()-u);const h=Gp(d);let m;t===1?m="Hoje":t<=7?m=T$(d):m=`${d.getDate()}/${d.getMonth()+1}`,l.push({name:m,chats:i.get(h)||0,sales:o.get(h)||0})}return l}catch(r){console.error("[API] Error fetching chart data:",r);const n=[];for(let a=t-1;a>=0;a--){const i=new Date;i.setDate(i.getDate()-a),n.push({name:t===1?"Hoje":t<=7?T$(i):`${i.getDate()}/${i.getMonth()+1}`,chats:0,sales:0})}return n}},fetchContacts:async()=>{const{data:t,error:e}=await ve.from("contacts").select("*").order("last_activity",{ascending:!1}).limit(100);return e?(console.error("[API] Error fetching contacts:",e),[]):!t||t.length===0?[]:t.map(r=>({id:r.id,name:r.name||r.call_name||r.phone_number,phone:r.phone_number,email:r.email||"",status:"lead",lastContact:new Date(r.last_activity).toLocaleDateString("pt-BR")}))},fetchTeam:async()=>{const{data:t,error:e}=await ve.from("team_members").select(` 765 *, 766 team:teams(*), 767 function:team_functions(*) 768 `).order("created_at",{ascending:!1});return e?(console.error("[API] Error fetching team members:",e),[]):!t||t.length===0?[]:t.map(r=>({id:r.id,name:r.name,email:r.email,role:r.role,status:r.status,avatar:r.avatar||`https://ui-avatars.com/api/?name=${r.name.replace(" ","+")}&background=random`,lastActive:r.last_active||void 0,team_id:r.team_id,function_id:r.function_id,weight:r.weight??void 0,team:r.team,function:r.function}))},createTeamMember:async t=>{await Xs();const{data:e,error:r}=await ve.from("team_members").insert({name:t.name,email:t.email,role:t.role,team_id:t.team_id,function_id:t.function_id,weight:t.weight||1,status:"invited",user_id:null}).select().single();if(r)throw console.error("[API] Error creating team member:",r),r;return{id:e.id,name:e.name,email:e.email,role:e.role,status:e.status,avatar:e.avatar||`https://ui-avatars.com/api/?name=${e.name.replace(" ","+")}&background=random`,team_id:e.team_id,function_id:e.function_id,weight:e.weight??void 0}},updateTeamMember:async(t,e)=>{const{error:r}=await ve.from("team_members").update(e).eq("id",t);if(r)throw console.error("[API] Error updating team member:",r),r},deleteTeamMember:async t=>{const{error:e}=await ve.from("team_members").delete().eq("id",t);if(e)throw console.error("[API] Error deleting team member:",e),e},fetchTeams:async()=>{const{data:t,error:e}=await ve.from("teams").select("*").eq("is_active",!0).order("name",{ascending:!0});if(e)throw console.error("[API] Error fetching teams:",e),e;return t||[]},createTeam:async t=>{await Xs();const{data:e,error:r}=await ve.from("teams").insert({name:t.name,description:t.description,color:t.color||"#3b82f6",user_id:null}).select().single();if(r)throw console.error("[API] Error creating team:",r),r;return e},updateTeam:async(t,e)=>{const{error:r}=await ve.from("teams").update(e).eq("id",t);if(r)throw console.error("[API] Error updating team:",r),r},deleteTeam:async t=>{const{error:e}=await ve.from("teams").update({is_active:!1}).eq("id",t);if(e)throw console.error("[API] Error deleting team:",e),e},fetchTeamFunctions:async()=>{const{data:t,error:e}=await ve.from("team_functions").select("*").eq("is_active",!0).order("name",{ascending:!0});if(e)throw console.error("[API] Error fetching team functions:",e),e;return t||[]},createTeamFunction:async t=>{await Xs();const{data:e,error:r}=await ve.from("team_functions").insert({name:t.name,description:t.description,user_id:null}).select().single();if(r)throw console.error("[API] Error creating team function:",r),r;return e},updateTeamFunction:async(t,e)=>{const{error:r}=await ve.from("team_functions").update(e).eq("id",t);if(r)throw console.error("[API] Error updating team function:",r),r},deleteTeamFunction:async t=>{const{error:e}=await ve.from("team_functions").update({is_active:!1}).eq("id",t);if(e)throw console.error("[API] Error deleting team function:",e),e},fetchAppointments:async()=>{const{data:t,error:e}=await ve.from("appointments").select(` 769 *, 770 contact:contacts(id, name, phone_number) 771 `).order("date",{ascending:!0}).order("time",{ascending:!0});return e?(console.error("[API] Error fetching appointments:",e),[]):!t||t.length===0?[]:t.map(r=>
771({id:r.id,title:r.title,date:r.date,time:r.time,duration:r.duration,type:r.type,description:r.description??void 0,attendees:r.attendees||[],contact_id:r.contact_id??void 0,contact:r.contact?{id:r.contact.id,name:r.contact.name,phone_number:r.contact.phone_number}:void 0,metadata:r.metadata}))},createAppointment:async t=>{const e=await Xs(),{data:r,error:n}=await ve.from("appointments").insert({title:t.title,description:t.description,date:t.date,time:t.time,duration:t.duration||60,type:t.type,attendees:t.attendees||[],contact_id:t.contact_id,meeting_url:t.meeting_url,status:"scheduled",user_id:e}).select().single();if(n)throw console.error("[API] Error creating appointment:",n),n;return{id:r.id,title:r.title,date:r.date,time:r.time,duration:r.duration,type:r.type,description:r.description??void 0,attendees:r.attendees||[]}},updateAppointment:async(t,e)=>{const{error:r}=await ve.from("appointments").update(e).eq("id",t);if(r)throw console.error("[API] Error updating appointment:",r),r},deleteAppointment:async t=>{const{error:e}=await ve.from("appointments").delete().eq("id",t);if(e)throw console.error("[API] Error deleting appointment:",e),e},fetchPipeline:async()=>{const{data:t,error:e}=await ve.from("deals").select(` 772 *, 773 contact:contacts(name, call_name, phone_number, email, client_memory), 774 owner:team_members(name, avatar) 775 `).order("created_at",{ascending:!1});if(e)return console.error("[API] Error fetching pipeline:",e),[];const r=((t==null?void 0:t.filter(i=>i.contact_id).map(i=>i.contact_id))||[]).filter(i=>i!==null),{data:n}=await ve.from("conversations").select("id, contact_id").in("contact_id",r),a=new Map((n==null?void 0:n.map(i=>[i.contact_id,i.id]))||[]);return(t||[]).map(i=>{var o,l,u,d,h,m,p,v,b;return{id:i.id,title:i.title,company:i.company||((o=i.contact)==null?void 0:o.name)||((l=i.contact)==null?void 0:l.call_name)||"Sem empresa",value:Number(i.value)||0,stage:i.stage,stageId:i.stage_id,ownerAvatar:((u=i.owner)==null?void 0:u.avatar)||"https://ui-avatars.com/api/?name=NA&background=334155&color=fff",ownerId:i.owner_id,ownerName:(d=i.owner)==null?void 0:d.name,tags:i.tags||[],dueDate:i.due_date,priority:i.priority||"medium",contactId:i.contact_id,contactName:((h=i.contact)==null?void 0:h.name)||((m=i.contact)==null?void 0:m.call_name),contactPhone:(p=i.contact)==null?void 0:p.phone_number,contactEmail:(v=i.contact)==null?void 0:v.email,wonAt:i.won_at,lostAt:i.lost_at,lostReason:i.lost_reason,clientMemory:((b=i.contact)==null?void 0:b.client_memory)||null,conversationId:a.get(i.contact_id)||void 0}})},fetchPipelineStages:async()=>{await Xs();const{data:t,error:e}=await ve.from("pipeline_stages").select("*").eq("is_active",!0).order("position",{ascending:!0});if(e)throw console.error("Error fetching pipeline stages:",e),e;return t.map(r=>({id:r.id,title:r.title,color:r.color,position:r.position,isSystem:r.is_system,isActive:r.is_active,isAiManaged:r.is_ai_managed||!1,aiTriggerCriteria:r.ai_trigger_criteria}))},createPipelineStage:async t=>{await Xs();const{data:e}=await ve.from("pipeline_stages").select("position").eq("is_active",!0).order("position",{ascending:!1}).limit(1),r=e&&e.length>0?e[0].position+1:0,{data:n,error:a}=await ve.from("pipeline_stages").insert({title:t.title,color:t.color,position:r,is_system:!1,is_active:!0,is_ai_managed:t.isAiManaged||!1,ai_trigger_criteria:t.aiTriggerCriteria||null,user_id:null}).select().single();if(a)throw console.error("Error creating pipeline stage:",a),a;return Rj(),{id:n.id,title:n.title,color:n.color,position:n.position,isSystem:n.is_system,isActive:n.is_active,isAiManaged:n.is_ai_managed||!1,aiTriggerCriteria:n.ai_trigger_criteria}},updatePipelineStage:async(t,e)=>{const r={};e.title!==void 0&&(r.title=e.title),e.color!==void 0&&(r.color=e.color),e.position!==void 0&&(r.position=e.position),e.isActive!==void 0&&(r.is_active=e.isActive),e.isAiManaged!==void 0&&(r.is_ai_managed=e.isAiManaged),e.aiTriggerCriteria!==void 0&&(r.ai_trigger_criteria=e.aiTriggerCriteria);const{error:n}=await ve.from("pipeline_stages").update(r).eq("id",t);if(n)throw console.error("Error updating pipeline stage:",n),n;Rj()},deletePipelineStage:async(t,e)=>{if(e){const{error:n}=await ve.from("deals").update({stage_id:e}).eq("stage_id",t);if(n)throw console.error("Error moving deals:",n),n}const{error:r}=await ve.from("pipeline_stages").delete().eq("id",t);if(r)throw console.error("Error deleting pipeline stage:",r),r;Rj()},reorderPipelineStages:async t=>{const e=t.map((a,i)=>ve.from("pipeline_stages").update({position:i}).eq("id",a)),n=(await Promise.all(e)).filter(a=>a.error);if(n.length>0)throw console.error("Error reordering stages:",n),n[0].error},createDeal:async t=>{const e=await Xs(),r={...t,user_id:e};r.stage_id||delete r.stage_id;const{data:n,error:a}=await ve.from("deals").insert([r]).select().single();if(a)throw console.error("[API] Error creating deal:",a),a;return{id:n.id,title:n.title,company:n.company||"Sem empresa",value:Number(n.value)||0,stage:n.stage||"new",stageId:n.stage_id,ownerAvatar:"https://ui-avatars.c
775om/api/?name=NA&background=334155&color=fff",tags:n.tags||[],dueDate:n.due_date??void 0,priority:n.priority}},updateDeal:async(t,e)=>{const{error:r}=await ve.from("deals").update(e).eq("id",t);if(r)throw console.error("[API] Error updating deal:",r),r},deleteDeal:async t=>{const{error:e}=await ve.from("deals").delete().eq("id",t);if(e)throw console.error("[API] Error deleting deal:",e),e},moveDealStage:async(t,e)=>{const{ganhoId:r,perdidoId:n}=await Mj(),a={stage_id:e};e!==r&&e!==n&&(a.won_at=null,a.lost_at=null,a.lost_reason=null,a.stage="in_progress");const{error:i}=await ve.from("deals").update(a).eq("id",t);if(i)throw console.error("[API] Error moving deal stage:",i),i},markDealWon:async t=>{const{ganhoId:e}=await Mj();if(!e)throw console.error("[API] Ganho stage not found"),new Error('Stage "Ganho" not found in pipeline');const{error:r}=await ve.from("deals").update({stage:"won",stage_id:e,won_at:new Date().toISOString()}).eq("id",t);if(r)throw console.error("[API] Error marking deal as won:",r),r},markDealLost:async(t,e)=>{const{perdidoId:r}=await Mj();if(!r)throw console.error("[API] Perdido stage not found"),new Error('Stage "Perdido" not found in pipeline');const{error:n}=await ve.from("deals").update({stage:"lost",stage_id:r,lost_at:new Date().toISOString(),lost_reason:e}).eq("id",t);if(n)throw console.error("[API] Error marking deal as lost:",n),n},updateDealOwner:async(t,e)=>{const{error:r}=await ve.from("deals").update({owner_id:e}).eq("id",t);if(r)throw console.error("[API] Error updating deal owner:",r),r},fetchDealActivities:async t=>{const{data:e,error:r}=await ve.from("deal_activities").select(` 776 *, 777 created_by_member:team_members!deal_activities_created_by_fkey(name) 778 `).eq("deal_id",t).order("created_at",{ascending:!1});if(r)throw console.error("[API] Error fetching deal activities:",r),r;return e||[]},createDealActivity:async t=>{const{data:e,error:r}=await ve.from("deal_activities").insert({deal_id:t.dealId,type:t.type,title:t.title,description:t.description,scheduled_at:t.scheduledAt,created_by:t.createdBy}).select().single();if(r)throw console.error("[API] Error creating deal activity:",r),r;return e},updateDealActivity:async(t,e)=>{const r={};e.title!==void 0&&(r.title=e.title),e.description!==void 0&&(r.description=e.description),e.scheduledAt!==void 0&&(r.scheduled_at=e.scheduledAt),e.isCompleted!==void 0&&(r.is_completed=e.isCompleted,r.completed_at=e.isCompleted?new Date().toISOString():null);const{error:n}=await ve.from("deal_activities").update(r).eq("id",t);if(n)throw console.error("[API] Error updating deal activity:",n),n},deleteDealActivity:async t=>{const{error:e}=await ve.from("deal_activities").delete().eq("id",t);if(e)throw console.error("[API] Error deleting deal activity:",e),e},fetchConversations:async()=>{console.log("[API] Fetching conversations from Supabase...");const{data:t,error:e}=await ve.from("conversations").select(` 779 *, 780 contact:contacts(*) 781 `).eq("is_active",!0).order("last_message_at",{ascending:!1}).limit(50);if(e)throw console.error("[API] Error fetching conversations:",e),e;return!t||t.length===0?(console.log("[API] No conversations found"),[]):(console.log(`[API] Found ${t.length} conversations`),await Promise.all(t.map(async n=>{const{data:a,error:i}=await ve.from("messages").select("*").eq("conversation_id",n.id).order("sent_at",{ascending:!0}).limit(100);return i&&console.error(`[API] Error fetching messages for ${n.id}:`,i),x7(n,a||[])})))},sendMessage:async(t,e)=>{console.log(`[API] Sending message to conversation ${t}`);const{data:r,error:n}=await ve.from("conversations").select("contact_id").eq("id",t).single();if(n||!r)throw console.error("[API] Error getting conversation:",n),new Error("Conversation not found");const{data:a,error:i}=await ve.from("messages").insert({conversation_id:t,content:e,type:"text",from_type:"human",status:"processing",sent_at:new Date().toISOString()}).select("id").single();if(i||!a)throw console.error("[API] Error creating message record:",i),new Error("Failed to create message record");console.log("[API] Message created with ID:",a.id);const{error:o}=await ve.from("send_queue").insert({conversation_id:t,contact_id:r.contact_id,content:e,from_type:"human",message_type:"text",priority:2,message_id:a.id});if(o)throw console.error("[API] Error queuing message:",o),o;console.log("[API] Message queued for sending");try{console.log("[API] Triggering whatsapp-sender...");const{error:l}=await ve.functions.invoke("whatsapp-sender");l?console.error("[API] Error triggering whatsapp-sender:",l):console.log("[API] whatsapp-sender triggered successfully")}catch(l){console.error("[API] Failed to trigger whatsapp-sender:",l)}return a.id},updateConversationStatus:async(t,e)=>{const{error:r}=await ve.from("conversations").update({status:e}).eq("id",t);if(r)throw console.error("[API] Error updating conversation status:",r),r;console.log(`[API] Conversation ${t} status updated to ${e}`)},markMessagesAsRead:async t=>{const{error:e}=await ve.from("messages").update({status:"read",read_at:new Date().toISOString()}).eq("conversation_id",t).eq("from_type","user").in("status",["sent","delivered"]);if(e)throw console.error("[API] Error marking messages as read:",e),e;console.log(`[API] Messages marked as read for conversation ${t}`)},assignConversation:async(t,e,r)=>{const{error:n}=await ve.from("conversations").update({assigned_user_id:e}).eq("id",t);if(n)throw console.error("[API] Error assigning conversation:",n),n;const{error:a}=await ve.from("deals").update({owner_id:e}).eq("contact_id",r);
781if(a)throw console.error("[API] Error updating deal owner:",a),a;console.log(`[API] Conversation ${t} and deals assigned to user ${e}`)},updateContactNotes:async(t,e)=>{const{error:r}=await ve.from("contacts").update({notes:e}).eq("id",t);if(r)throw console.error("[API] Error updating contact notes:",r),r},toggleContactBlock:async(t,e,r)=>{const{error:n}=await ve.from("contacts").update({is_blocked:e,blocked_at:e?new Date().toISOString():null,blocked_reason:e?r:null}).eq("id",t);if(n)throw console.error("[API] Error toggling contact block:",n),n},fetchTagDefinitions:async()=>{const{data:t,error:e}=await ve.from("tag_definitions").select("*").eq("is_active",!0).order("category",{ascending:!0});if(e)throw console.error("[API] Error fetching tag definitions:",e),e;return t||[]},updateContactTags:async(t,e)=>{const{error:r}=await ve.from("contacts").update({tags:e}).eq("id",t);if(r)throw console.error("[API] Error updating contact tags:",r),r},createTagDefinition:async t=>{await Xs();const{data:e,error:r}=await ve.from("tag_definitions").insert({key:t.key,label:t.label,color:t.color,category:t.category,is_active:!0,user_id:null}).select().single();if(r)throw console.error("[API] Error creating tag definition:",r),r;return e},fetchConversationMessages:async(t,e=10)=>{const{data:r,error:n}=await ve.from("messages").select("id, content, from_type, type, sent_at, media_url").eq("conversation_id",t).order("sent_at",{ascending:!1}).limit(e);return n?(console.error("[API] Error fetching conversation messages:",n),[]):(r||[]).reverse()}},Dj="onboarding_wizard_seen";function U0(){const{user:t}=Na(),[e,r]=w.useState(!0),[n,a]=w.useState(!1),[i,o]=w.useState([{id:"identity",title:"Identidade",description:"Configure o nome da empresa e do agente",isComplete:!1,isRequired:!0},{id:"whatsapp",title:"WhatsApp",description:"Configure a API do WhatsApp Cloud",isComplete:!1,isRequired:!0},{id:"agent",title:"Agente",description:"Configure o prompt e comportamento do agente",isComplete:!1,isRequired:!0},{id:"elevenlabs",title:"ElevenLabs",description:"Configure respostas em áudio (opcional)",isComplete:!1,isRequired:!1},{id:"business_hours",title:"Horário",description:"Configure o horário de atendimento",isComplete:!1,isRequired:!1},{id:"verification",title:"Verificação",description:"Verifique se o sistema está configurado",isComplete:!1,isRequired:!1},{id:"finish",title:"Finalização",description:"Revise e teste sua configuração",isComplete:!1,isRequired:!1}]),[l,u]=w.useState(()=>localStorage.getItem(Dj)==="true"),d=w.useCallback(async()=>{if(!t){r(!1);return}r(!0);try{const{data:x}=await ve.from("user_roles").select("role").eq("user_id",t.id).maybeSingle(),j=(x==null?void 0:x.role)==="admin";a(j);const{data:N}=await ve.from("nina_settings").select("*").limit(1).maybeSingle();N&&o(S=>S.map(k=>{switch(k.id){case"identity":return{...k,isComplete:!!(N.company_name&&N.sdr_name)};case"whatsapp":return{...k,isComplete:!!(N.whatsapp_access_token&&N.whatsapp_phone_number_id&&N.whatsapp_business_account_id)};case"agent":return{...k,isComplete:!!(N.company_name&&N.sdr_name)};case"elevenlabs":return{...k,isComplete:!!N.elevenlabs_api_key};case"business_hours":const C=N.timezone==="America/Sao_Paulo"&&N.business_hours_start==="09:00:00"&&N.business_hours_end==="18:00:00"&&JSON.stringify(N.business_days)==="[1,2,3,4,5]";return{...k,isComplete:!C||l};case"verification":return{...k,isComplete:!!(N.company_name&&N.sdr_name&&N.whatsapp_access_token&&N.system_prompt_override)};case"finish":return{...k,isComplete:l};default:return k}}))}catch(x){console.error("Error fetching onboarding status:",x)}finally{r(!1)}},[l,t]);w.useEffect(()=>{d()},[d]);const h=w.useCallback(()=>{localStorage.setItem(Dj,"true"),u(!0),o(x=>x.map(j=>j.id==="finish"?{...j,isComplete:!0}:j))},[]),m=w.useCallback(()=>{localStorage.removeItem(Dj),u(!1),o(x=>x.map(j=>j.id==="finish"?{...j,isComplete:!1}:j))},[]);i.filter(x=>x.isRequired).filter(x=>x.isComplete).length;const v=i.every(x=>x.isComplete),b=i.findIndex(x=>!x.isComplete),y=Math.round(i.filter(x=>x.isComplete).length/i.length*100);return{loading:e,isComplete:v,currentStep:b===-1?i.length-1:b,steps:i,completionPercentage:y,hasSeenWizard:l,isAdmin:n,refetch:d,markWizardSeen:h,resetWizard:m}}const rbe=({onOpenWizard:t})=>{const{loading:e,isComplete:r,steps:n,completionPercentage:a}=U0();return e||r?null:s.jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-red-500/20 bg-gradient-to-r from-red-500/10 via-slate-900/50 to-violet-500/10 p-6 mb-8",children:[s.jsx("div",{className:"absolute -top-20 -right-20 w-40 h-40 bg-red-500/20 rounded-full blur-3xl pointer-events-none"}),s.jsx("div",{className:"absolute -bottom-20 -left-20 w-40 h-40 bg-violet-500/20 rounded-full blur-3xl pointer-events-none"}),s.jsx("div",{className:"relative z-10",children:s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-6",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-red-500/20 border border-red-500/30 flex items-center justify-center",children:s.jsx(uN,{className:"w-5 h-5 text-red-400"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-white",children:"Complete a configuração do sistema"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Configure sua empresa para começar a usar o sistema"})]})]}),s.jsxs("div",{className:"mb-4",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-400 mb-2",children:[s.jsx("span",{children:"Progresso"}),s.jsxs("span",{className:"text-red-400 font-medium",children:[a,"% concluÃdo"]})]}),s.jsx("div",{className:"h-2 bg-slate-800 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-red-500 to-violet-500 rounded-full transition-all duration-500",style:{width:`${a}%`}})})]}),s.jsx("div",{className:"flex flex-wrap gap-3",children:n.map(i=>s.jsxs("div",{className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded-full ${i.isComplete?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":i.isRequired?"bg-amber-500/10 text-amber-400 border border-amber-500/20":"bg-slate-800/50 text-slate-500 border border-slate-700/50"}`,children:[i.isComplete?s.jsx(vg,{className:"w-3 h-3"}):i.isRequired?s.jsx(tY,{className:"w-3 h-3"}):s.jsx(m8,{className:"w-3 h-3"}),i.title]},i.id))})]}),s.jsx("div",{className:"flex-shrink-0",children:s.jsxs(Ne,{variant:"primary",onClick:t,className:"gap-2 whitespace-nowrap",children:["Continuar Configuração",s.jsx(u8,{className:"w-4 h-4"})]})})]})})]})},nbe={identity:s.jsx(mn,{className:"w-4 h-4"}),whatsapp:s.jsx(Tn,{className:"w-4 h-4"}),agent_prompt:s.jsx(Or,{className:"w-4 h-4"}),elevenlabs:s.jsx(Ff,{className:"w-4 h-4"}),business_hours:s.jsx(oo,{className:"w-4 h-4"}),lovable_ai:s.jsx(C8,{className:"w-4 h-4"}),pipeline:s.jsx(b8,{className:"w-4 h-4"}),profile:s.jsx(mn,{className:"w-4 h-4"}),nina_settings:s.jsx(Or,{className:"w-4 h-4"})},abe={identity:"Identidade",whatsapp:"WhatsApp",agent_prompt:"Agente IA",elevenlabs:"ElevenLabs",business_hours:"Horário",lovable_ai:"Lovable AI",pipeline:"Pipeline",profile:"Perfil",nina_settings:"Configurações"},sbe=()=>{const[t,e]=w.useState(null),[r,n]=w.useState(!0),[a,i]=w.useState(!1),o=w.useCallback(async()=>{n(!0);try{const{data:h,error:m}=await ve.functions.invoke("validate-setup");if(m)throw m;e(h)}catch(h){console.error("Error fetching health:",h)}finally{n(!1)}},[]);w.useEffect(()=>{o()},[o]);const l=h=>{switch(h){case"ok":return s.jsx(vg,{className:"w-4 h-4 text-emerald-400"});case"warning":return s.jsx(ei,{className:"w-4 h-4 text-amber-400"});case"error":return s.jsx(au,{className:"w-4 h-4 text-red-400"})}},u=h=>{switch(h){case"ok":return"bg-emerald-500/10 border-emerald-500/20 text-emerald-400";case"warning":return"bg-amber-500/10 border-amber-500/20 text-amber-400";case"error":return"bg-red-500/10 border-red-500/20 text-red-400"}},d=h=>{switch(h){case"ok":return"from-emerald-500/20 to-emerald-500/5 border-emerald-500/30";case"warning":return"from-amber-500/20 to-amber-500/5 border-amber-500/30";case"error":return"from-red-500/20 to-red-500/5 border-red-500/30";default:return"from-slate-500/20 to-slate-500/5 border-slate-500/30"}};return r?s.jsx("div",{className:"rounded-2xl border bg-gradient-to-br from-slate-800/50 to-slate-900/50 border-slate-700/50 p-6",children:s.jsxs("div",{className:"flex items-center justify-center gap-3",children:[s.jsx(gt,{className:"w-5 h-5 animate-spin text-red-400"}),s.jsx("span",{className:"text-sm text-slate-400",children:"Verificando sistema..."})]})}):t?s.jsxs(Ie.div,{initial:{opacity:0,y:10}
781,animate:{opacity:1,y:0},className:`rounded-2xl border bg-gradient-to-br ${d(t.overallStatus)} p-6 transition-all duration-300`,children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[l(t.overallStatus),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-semibold text-white",children:"Status do Sistema"}),s.jsx("p",{className:"text-xs text-slate-400",children:t.message})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:`px-3 py-1 rounded-full text-xs font-medium ${u(t.overallStatus)}`,children:[t.summary.percentage,"% OK"]}),s.jsx("button",{onClick:o,disabled:r,className:"p-2 rounded-lg hover:bg-slate-700/50 transition-colors text-slate-400 hover:text-white",children:s.jsx(lo,{className:`w-4 h-4 ${r?"animate-spin":""}`})})]})]}),s.jsx("div",{className:"h-2 bg-slate-800 rounded-full overflow-hidden mb-4",children:s.jsx(Ie.div,{initial:{width:0},animate:{width:`${t.summary.percentage}%`},transition:{duration:.5,ease:"easeOut"},className:`h-full rounded-full ${t.overallStatus==="ok"?"bg-gradient-to-r from-emerald-500 to-rose-400":t.overallStatus==="warning"?"bg-gradient-to-r from-amber-500 to-yellow-400":"bg-gradient-to-r from-red-500 to-rose-400"}`})}),s.jsxs("button",{onClick:()=>i(!a),className:"w-full flex items-center justify-between py-2 text-sm text-slate-400 hover:text-white transition-colors",children:[s.jsx("span",{children:a?"Ocultar detalhes":"Ver detalhes"}),a?s.jsx(h8,{className:"w-4 h-4"}):s.jsx(Ga,{className:"w-4 h-4"})]}),a&&s.jsx(Ie.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"grid grid-cols-2 gap-2 mt-2",children:t.results.map((h,m)=>s.jsxs(Ie.div,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},transition:{delay:m*.05},className:`flex items-center gap-2 p-2 rounded-lg border ${u(h.status)} bg-opacity-50`,children:[s.jsx("div",{className:"flex-shrink-0",children:nbe[h.component]||s.jsx(vg,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-xs font-medium truncate",children:abe[h.component]||h.component}),s.jsx("p",{className:"text-[10px] opacity-70 truncate",children:h.message})]}),s.jsx("div",{className:"flex-shrink-0",children:l(h.status)})]},h.component))})]}):null},Kp={today:"Hoje","7days":"7 Dias","30days":"30 Dias"},O$={today:1,"7days":7,"30days":30},ibe=()=>{var b;const[t,e]=w.useState([]),[r,n]=w.useState([]),[a,i]=w.useState(!0),[o,l]=w.useState("today"),{setShowOnboarding:u}=a8(),{user:d}=Na(),h=((b=d==null?void 0:d.email)==null?void 0:b.toLowerCase())==="[email protected]";w.useEffect(()=>{(async()=>{i(!0);try{const x=O$[o],[j,N]=await Promise.all([Ge.fetchDashboardMetrics(x),Ge.fetchChartData(x)]);e(j),n(N)}catch(x){console.error("Erro ao carregar dashboard:",x)}finally{i(!1)}})()},[o]);const m=y=>y.includes("Conversões")?s.jsx(g8,{className:"h-5 w-5 text-emerald-400"}):y.includes("Atendimentos")?s.jsx(Tn,{className:"h-5 w-5 text-red-400"}):y.includes("Leads")?s.jsx(fo,{className:"h-5 w-5 text-violet-400"}):s.jsx(XK,{className:"h-5 w-5 text-orange-400"}),p=y=>y.includes("Conversões")?"from-emerald-500/20 to-emerald-500/5 border-emerald-500/20":y.includes("Atendimentos")?"from-red-500/20 to-red-500/5 border-red-500/20":y.includes("Leads")?"from-violet-500/20 to-violet-500/5 border-violet-500/20":"from-orange-500/20 to-orange-500/5 border-orange-500/20",v=y=>y.includes("Atendimentos")?o==="today"?"Atendimentos Hoje":`Atendimentos (${Kp[o]})`:y.includes("Leads")?o==="today"?"Novos Leads":`Novos Leads (${Kp[o]})`:y;return a?s.jsx("div",{className:"flex items-center justify-center h-full bg-slate-950",children:s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"absolute inset-0 bg-red-500/20 blur-xl rounded-full"}),s.jsx(gt,{className:"h-10 w-10 animate-spin text-red-400 relative z-10"})]}),s.jsx("p",{className:"text-sm text-slate-400 font-medium animate-pulse",children:"Carregando insights..."})]})}):s.jsxs("div",{className:"p-6 space-y-8 overflow-y-auto h-full bg-slate-950 text-slate-50 custom-scrollbar",children:[h&&s.jsx(rbe,{onOpenWizard:()=>u(!0)}),s.jsx(sbe,{}),s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-bold tracking-tight text-white",children:"Dashboard"}),s.jsxs("p",{className:"text-slate-400 mt-1",children:["Visão geral da performance da sua IA ",o==="today"?"hoje":`nos últimos ${Kp[o].toLowerCase()}`,"."]})]}),s.jsx("div",{className:"flex items-center gap-2 bg-slate-900 p-1 rounded-lg border border-slate-800",children:["today","7days","30days"].map(y=>s.jsx("button",{onClick:()=>l(y),className:`px-3 py-1 text-xs font-medium rounded-md transition-colors ${o===y?"bg-slate-800 text-white shadow-sm":"text-slate-500 hover:text-slate-300"}`,children:Kp[y]},y))})]}),s.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-4",children:t.map((y,x)=>s.jsxs("div",{className:`relative overflow-hidden rounded-2xl border bg-slate-900/50 backdrop-blur-sm p-6 shadow-xl transition-all duration-300 hover:translate-y-[-2px] hover:bg-slate-900 group ${p(y.label)}`,style:{animationDelay:`${x*100}ms`},children:[s.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-4",children:[s.jsx("div",{className:"text-sm font-medium text-slate-400",children:v(y.label)}),s.jsx("div",{className:"p-2 rounded-lg bg-slate-800/50 border border-slate-700/50 group-hover:border-slate-600 transition-colors",children:m(y.label)})]}),s.jsxs("div",{className:"flex items-end justify-between",children:[s.jsx("div",{className:"text-3xl font-bold text-white tracking-tight",children:y.value}),s.jsxs("div",{className:`flex items-center text-xs font-medium px-2 py-1 rounded-full ${y.trendUp?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:[y.trendUp?s.jsx(TY,{className:"w-3 h-3 mr-1"}):s.jsx(PY,{className:"w-3 h-3 mr-1"}),y.trend]})]}),s.jsx("div",{className:"absolute -bottom-10 -right-10 w-24 h-24 bg-white/5 blur-2xl rounded-full group-hover:bg-white/10 transition-all"})]},x))}),s.jsxs("div",{className:"grid gap-6 md:grid-cols-7",children:[s.jsxs("div",{className:"col-span-4 rounded-2xl border border-slate-800 bg-slate-900/50 backdrop-blur-sm p-6 shadow-lg",children:[s.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-white",children:"Volume de Atendimentos"}),s.jsxs("p",{className:"text-sm text-slate-400",children:["Interações da IA ",o==="today"?"hoje":`nos últimos ${O$[o]} dias`]})]}),s.jsx("button",{className:"text-red-400 hover:text-red-300 transition-colors p-2 hover:bg-red-950/30 rounded-lg",children:s.jsx(ZK,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"h-[300px] w-full",children:s.jsx(Fle,{width:"100%",height:"100%",children:s.jsxs(Yye,{data:r,margin:{top:10,right:10,left:-20,bottom:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:"colorChats",x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"5%",
781stopColor:"#06b6d4",stopOpacity:.3}),s.jsx("stop",{offset:"95%",stopColor:"#06b6d4",stopOpacity:0})]})}),s.jsx(e7,{vertical:!1,strokeDasharray:"3 3",stroke:"#1e293b"}),s.jsx(B0,{dataKey:"name",axisLine:!1,tickLine:!1,tickMargin:10,fontSize:12,stroke:"#64748b"}),s.jsx(V0,{axisLine:!1,tickLine:!1,fontSize:12,stroke:"#64748b"}),s.jsx(vs,{contentStyle:{backgroundColor:"#0f172a",borderRadius:"12px",border:"1px solid #1e293b",color:"#f8fafc",boxShadow:"0 4px 6px -1px rgba(0, 0, 0, 0.5)"},itemStyle:{color:"#06b6d4"}}),s.jsx(Oo,{type:"monotone",dataKey:"chats",stroke:"#06b6d4",strokeWidth:3,fillOpacity:1,fill:"url(#colorChats)",activeDot:{r:6,strokeWidth:0,fill:"#fff"}})]})})})]}),s.jsxs("div",{className:"col-span-3 rounded-2xl border border-slate-800 bg-slate-900/50 backdrop-blur-sm p-6 shadow-lg flex flex-col",children:[s.jsxs("div",{className:"mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-white",children:"Conversões"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Reuniões, vendas e ações concluÃdas"})]}),s.jsx("div",{className:"flex-1 flex flex-col justify-center space-y-5",children:r.slice(0,5).map((y,x)=>s.jsxs("div",{className:"group",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm font-medium text-slate-300",children:y.name}),s.jsxs("span",{className:"text-sm font-bold text-white group-hover:text-red-400 transition-colors",children:[y.sales," conv."]})]}),s.jsx("div",{className:"h-2.5 bg-slate-800 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-red-600 to-rose-500 rounded-full shadow-[0_0_10px_rgba(227,6,19,0.3)] transition-all duration-1000 ease-out group-hover:shadow-[0_0_15px_rgba(227,6,19,0.6)]",style:{width:`${Math.min(y.sales/Math.max(...r.map(j=>j.sales),1)*100,100)}%`}})})]},x))}),s.jsx("div",{className:"mt-6 pt-4 border-t border-slate-800",children:s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsx("span",{className:"text-slate-500",children:"Total no perÃodo"}),s.jsxs("span",{className:"text-emerald-400 font-bold",children:[r.reduce((y,x)=>y+x.sales,0)," conversões"]})]})})]})]})]})};function obe(){const[t,e]=w.useState([]),[r,n]=w.useState(!0),[a,i]=w.useState(null),[o,l]=w.useState(!0),u=w.useRef(new Set),d=w.useRef(new Set),h=w.useRef(null),m=w.useCallback(async S=>{if(d.current.has(S)){console.log("[Realtime] Already fetching conversation:",S);return}d.current.add(S),console.log("[Realtime] ð Fetching new conversation:",S);try{const{data:k,error:C}=await ve.from("conversations").select("*, contact:contacts(*)").eq("id",S).maybeSingle();if(C||!k){console.error("[Realtime] Error fetching conversation:",C);return}const{data:A,error:T}=await ve.from("messages").select("*").eq("conversation_id",S).order("sent_at",{ascending:!0});T&&console.error("[Realtime] Error fetching messages:",T);const R=x7(k,A||[]);e(I=>I.some(D=>D.id===R.id)?(console.log("[Realtime] Conversation already in state, skipping add"),I):(console.log("[Realtime] â
Adding new conversation to state:",R.id),[R,...I])),(A||[]).forEach(I=>u.current.add(I.id))}catch(k){console.error("[Realtime] Error in fetchAndAddConversation:",k)}finally{d.current.delete(S)}},[]),p=w.useCallback(async()=>{try{n(!0),i(null);const S=await Ge.fetchConversations();u.current.clear(),S.forEach(k=>{k.messages.forEach(C=>{u.current.add(C.id)})}),e(S)}catch(S){console.error("[useConversations] Error fetching:",S),i("Erro ao carregar conversas"),xe.error("Erro ao carregar conversas")}finally{n(!1)}},[]),v=w.useCallback(()=>{h.current||(console.warn("[Realtime] Starting polling fallback (10s interval)"),l(!1),h.current=setInterval(()=>{console.log("[Realtime] Polling fallback: fetching conversations..."),p()},1e4))},[p]),b=w.useCallback(()=>{h.current&&(console.log("[Realtime] Stopping polling fallback"),clearInterval(h.current),h.current=null),l(!0)},[]);w.useEffect(()=>{p(),console.log("[Realtime] Setting up real-time subscriptions...");const S=ve.channel("messages-realtime").on("postgres_changes",{event:"INSERT",schema:"public",table:"messages"},C=>{console.log("[Realtime] ð© New message received:",C.new);const A=C.new;if(u.current.has(A.id)){console.log("[Realtime] Message already processed (by ID), skipping:",A.id);return}e(T=>T.some(I=>I.id===A.conversation_id)?T.map(I=>
781{if(I.id===A.conversation_id){const D=f2(A);if(I.messages.some(H=>H.id===D.id))return console.log("[Realtime] Message already exists by ID in conversation, skipping"),I;if(A.whatsapp_message_id&&I.messages.some(Z=>Z.whatsappMessageId===A.whatsapp_message_id))return console.log("[Realtime] Message already exists by whatsapp_message_id, skipping"),I;const z=I.messages.findIndex(H=>H.id.startsWith("temp-")&&H.content===D.content&&H.fromType===D.fromType);if(z!==-1){console.log("[Realtime] Replacing temp message with real message");const H=[...I.messages];return H[z]=D,u.current.add(D.id),{...I,messages:H,lastMessage:A.content||"",lastMessageTime:"Agora"}}return console.log("[Realtime] Adding new message:",D.id),u.current.add(D.id),{...I,messages:[...I.messages,D],lastMessage:A.content||"",lastMessageTime:"Agora",unreadCount:A.from_type==="user"?I.unreadCount+1:I.unreadCount}}return I}):(console.log("[Realtime] Message from unknown conversation, fetching async..."),m(A.conversation_id),T))}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"messages"},C=>{console.log("[Realtime] Message updated:",C.new);const A=C.new;e(T=>T.map(R=>R.id===A.conversation_id?{...R,messages:R.messages.map(I=>I.id===A.id?f2(A):I)}:R))}).subscribe((C,A)=>{console.log("[Realtime] Messages channel status:",C),C==="SUBSCRIBED"?(console.log("[Realtime] â
Successfully connected to messages channel"),b()):C==="CHANNEL_ERROR"?(console.error("[Realtime] â Error connecting to messages channel:",A),v()):C==="TIMED_OUT"&&(console.warn("[Realtime] â ï¸ Connection timed out, retrying..."),v())}),k=ve.channel("conversations-realtime").on("postgres_changes",{event:"INSERT",schema:"public",table:"conversations"},C=>{console.log("[Realtime] ð New conversation INSERT detected:",C.new);const A=C.new;e(T=>T.some(R=>R.id===A.id)?(console.log("[Realtime] Conversation already in state from INSERT"),T):(m(A.id),T))}).on("postgres_changes",{event:"UPDATE",schema:"public",table:"conversations"},C=>{console.log("[Realtime] Conversation UPDATE:",C.new);const A=C.new;e(T=>T.map(R=>R.id===A.id?{...R,status:A.status,isActive:A.is_active,assignedTeam:A.assigned_team}:R))}).subscribe((C,A)=>{console.log("[Realtime] Conversations channel status:",C),C==="SUBSCRIBED"?(console.log("[Realtime] â
Successfully connected to conversations channel"),b()):C==="CHANNEL_ERROR"&&(console.error("[Realtime] â Error connecting to conversations channel:",A),v())});return()=>{console.log("[Realtime] Cleaning up subscriptions"),b(),ve.removeChannel(S),ve.removeChannel(k)}},[p,m,v,b]);const y=w.useCallback(async(S,k)=>{if(!k.trim())return;const C=`temp-${Date.now()}`,A={id:C,content:k,timestamp:new Date().toLocaleTimeString("pt-BR",{hour:"2-digit",minute:"2-digit"}),direction:ll.OUTGOING,type:Uc.TEXT,status:"sent",fromType:"human",mediaUrl:null,whatsappMessageId:null};e(T=>T.map(R=>R.id===S?{...R,messages:[...R.messages,A],lastMessage:k,lastMessageTime:"Agora"}:R));try{await Ge.sendMessage(S,k)}catch(T){console.error("[useConversations] Error sending message:",T),xe.error("Erro ao enviar mensagem"),e(R=>R.map(I=>I.id===S?{...I,messages:I.messages.filter(D=>D.id!==C)}:I))}},[]),x=w.useCallback(async(S,k)=>{try{await Ge.updateConversationStatus(S,k),e(A=>A.map(T=>T.id===S?{...T,status:k}:T));const C={nina:"IA ativada",human:"Atendimento humano ativado",paused:"Conversa pausada"};xe.success(C[k])}catch(C){console.error("[useConversations] Error updating status:",C),xe.error("Erro ao atualizar status")}},[]),j=w.useCallback(async S=>{e(k=>k.map(C=>C.id===S?{...C,unreadCount:0}:C));try{await Ge.markMessagesAsRead(S),console.log("[useConversations] Messages marked as read in database")}catch(k){console.error("[useConversations] Error marking messages as read:",k)}},[]),N=w.useCallback(async(S,k)=>{const C=t.find(A=>A.id===S);if(C){e(A=>A.map(T=>T.id===S?{...T,assignedUserId:k}:T));try{await Ge.assignConversation(S,k,C.contactId),console.log("[useConversations] Conversation and deal assigned")}catch(A){console.error("[useConversations] Error assigning conversation:",A),e(T=>T.map(R=>R.id===S?{...R,assignedUserId:C.assignedUserId}:R))}}},[t]);return{conversations:t,loading:r,error:a,realtimeConnected:o,sendMessage:y,updateStatus:x,markAsRead:j,assignConversation:N,refetch:p}}const kt=w.forwardRef(({className:t,type:e,...r},n)=>s.jsx("input",{type:e,className:Qe("flex h-10 w-full rounded-md border border-input bg-secondary/50 px-3 py-2 text-sm text-foreground ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:n,...r}));kt.displayName="Input";function M$(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Gl(...t){return e=>{let r=!1;const n=t.map(a=>{const i=M$(a,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let a=0;a<n.length;a++){const i=n[a];typeof i=="function"?i():M$(t[a],null)}}}}function Nt(...t){return w.useCallback(Gl(...t),t)}var lbe=Symbol.for("react.lazy"),Av=Zv[" use ".trim().toString()];function cbe(t){return typeof t=="object"&&t!==null&&"then"in t}function y7(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===lbe&&"_payload"in t&&cbe(t._payload)}function b7(t){const e=ube(t),r=w.forwardRef((n,a)=>{let{children:i,...o}=n;y7(i)&&typeof Av=="function"&&(i=Av(i._payload));const l=w.Children.toArray(i),u=l.find(fbe);if(u){const d=u.props.children,h=l.map(m=>m===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:m);return s.jsx(e,{...o,ref:a,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}var w7=b7("Slot");function ube(t){const e=w.forwardRef((r,n)=>{let{children:a,...i}=r;if(y7(a)&&typeof Av=="function"&&(a=Av(a._payload)),w.isValidElement(a)){const o=mbe(a),l=hbe(i,a.props);return a.type!==w.Fragment&&(l.ref=n?Gl(n,o):o),w.cloneElement(a,l)}return w.Children.count(a)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var dbe=Symbol("radix.slottable");function fbe(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===dbe}function hbe(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const u=i(...l);return a(...l),u}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}
781:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function mbe(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}const Xk=qC("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),zn=w.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...a},i)=>{const o=n?w7:"button";return s.jsx(o,{className:Qe(Xk({variant:e,size:r,className:t})),ref:i,...a})});zn.displayName="Button";const pbe=({availableTags:t,selectedTags:e,onToggleTag:r,onCreateTag:n})=>{const[a,i]=w.useState(""),[o,l]=w.useState(!1),[u,d]=w.useState({label:"",color:"#3b82f6",category:"custom"}),m=t.filter(b=>b.label.toLowerCase().includes(a.toLowerCase())||b.key.toLowerCase().includes(a.toLowerCase())).reduce((b,y)=>(b[y.category]||(b[y.category]=[]),b[y.category].push(y),b),{}),p={status:"STATUS",interest:"INTERESSE",action:"AÃÃO NECESSÃRIA",qualification:"QUALIFICAÃÃO",custom:"PERSONALIZADO"},v=()=>{if(!u.label.trim())return;const b=u.label.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"_").replace(/^_|_$/g,"");n({key:b,label:u.label,color:u.color,category:u.category}),d({label:"",color:"#3b82f6",category:"custom"}),l(!1)};return o?s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx("h4",{className:"text-sm font-semibold text-slate-200 mb-3",children:"Criar Nova Tag"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(kt,{placeholder:"Nome da tag",value:u.label,onChange:b=>d({...u,label:b.target.value}),className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(kt,{type:"color",value:u.color,onChange:b=>d({...u,color:b.target.value}),className:"w-16 h-9 p-1 cursor-pointer bg-background border-border"}),s.jsxs("select",{value:u.category,onChange:b=>d({...u,category:b.target.value}),className:"flex-1 h-9 px-3 rounded-md bg-slate-800 border border-slate-600 text-sm text-slate-200",children:[s.jsx("option",{value:"custom",children:"Personalizado"}),s.jsx("option",{value:"status",children:"Status"}),s.jsx("option",{value:"interest",children:"Interesse"}),s.jsx("option",{value:"action",children:"Ação"}),s.jsx("option",{value:"qualification",children:"Qualificação"})]})]})]}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx(zn,{onClick:v,size:"sm",className:"flex-1 bg-primary text-primary-foreground hover:bg-primary/90",children:"Criar"}),s.jsx(zn,{onClick:()=>l(!1),size:"sm",variant:"outline",className:"flex-1",children:"Cancelar"})]})]}):s.jsxs("div",{className:"w-full max-h-[400px] flex flex-col",children:[s.jsx("div",{className:"p-3 border-b border-border",children:s.jsxs("div",{className:"relative",children:[s.jsx(Gu,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),s.jsx(kt,{placeholder:"Buscar tags...",value:a,onChange:b=>i(b.target.value),className:"pl-9 h-9 bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500"})]})}),s.jsx("div",{className:"flex-1 overflow-y-auto p-2",children:Object.entries(m).map(([b,y])=>s.jsxs("div",{className:"mb-3",children:[s.jsx("h5",{className:"text-xs font-bold text-slate-400 uppercase tracking-wider px-2 py-1.5",children:p[b]||b}),s.jsx("div",{className:"space-y-0.5",children:y.map(x=>{const j=e.includes(x.key);return s.jsxs("button",{onClick:()=>r(x.key),className:"w-full flex items-center justify-between px-3 py-2 rounded-md hover:bg-accent/50 transition-colors text-left group",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:x.color}}),s.jsx("span",{className:"text-sm text-slate-200",children:x.label})]}),j&&s.jsx(ci,{className:"w-4 h-4 text-primary"})]},x.key)})})]},b))}),s.jsx("div",{className:"p-2 border-t border-border",children:s.jsxs("button",{onClick:()=>l(!0),className:"w-full flex items-center gap-2 px-3 py-2 rounded-md hover:bg-slate-800 transition-colors text-sm text-slate-400 hover:text-slate-200",children:[s.jsx(ts,{className:"w-4 h-4"}),s.jsx("span",{children:"Criar nova tag"})]})})]})};function et(t,e,{checkForDefaultPrevented:r=!0}={}
vendor: 11,170 bytes, line 781
781){return function(a){if(t==null||t(a),r===!1||!a.defaultPrevented)return e==null?void 0:e(a)}}function gbe(t,e){const r=w.createContext(e),n=i=>{const{children:o,...l}=i,u=w.useMemo(()=>l,Object.values(l));return s.jsx(r.Provider,{value:u,children:o})};n.displayName=t+"Provider";function a(i){const o=w.useContext(r);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[n,a]}function Ca(t,e=[]){let r=[];function n(i,o){const l=w.createContext(o),u=r.length;r=[...r,o];const d=m=>{var j;const{scope:p,children:v,...b}=m,y=((j=p==null?void 0:p[t])==null?void 0:j[u])||l,x=w.useMemo(()=>b,Object.values(b));return s.jsx(y.Provider,{value:x,children:v})};d.displayName=i+"Provider";function h(m,p){var y;const v=((y=p==null?void 0:p[t])==null?void 0:y[u])||l,b=w.useContext(v);if(b)return b;if(o!==void 0)return o;throw new Error(`\`${m}\` must be used within \`${i}\``)}return[d,h]}const a=()=>{const i=r.map(o=>w.createContext(o));return function(l){const u=(l==null?void 0:l[t])||i;return w.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return a.scopeName=t,[n,vbe(a,...e)]}function vbe(...t){const e=t[0];if(t.length===1)return e;const r=()=>{const n=t.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((l,{useScope:u,scopeName:d})=>{const m=u(i)[`__scope${d}`];return{...l,...m}},{});return w.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return r.scopeName=e.scopeName,r}function xbe(t){const e=ybe(t),r=w.forwardRef((n,a)=>{const{children:i,...o}=n,l=w.Children.toArray(i),u=l.find(wbe);if(u){const d=u.props.children,h=l.map(m=>m===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:m);return s.jsx(e,{...o,ref:a,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function ybe(t){const e=w.forwardRef((r,n)=>{const{children:a,...i}=r;if(w.isValidElement(a)){const o=jbe(a),l=_be(i,a.props);return a.type!==w.Fragment&&(l.ref=n?Gl(n,o):o),w.cloneElement(a,l)}return w.Children.count(a)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var bbe=Symbol("radix.slottable");function wbe(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===bbe}function _be(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const u=i(...l);return a(...l),u}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function jbe(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Nbe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],ht=Nbe.reduce((t,e)=>{const r=xbe(`Primitive.${e}`),n=w.forwardRef((a,i)=>{const{asChild:o,...l}=a,u=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(u,{...l,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function Sbe(t,e){t&&$h.flushSync(()=>t.dispatchEvent(e))}function po(t){const e=w.useRef(t);return w.useEffect(()=>{e.current=t}),w.useMemo(()=>(...r)=>{var n;return(n=e.current)==null?void 0:n.call(e,...r)},[])}function Cbe(t,e=globalThis==null?void 0:globalThis.document){const r=po(t);w.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return e.addEventListener("keydown",n,{capture:!0}),()=>e.removeEventListener("keydown",n,{capture:!0})},[r,e])}var kbe="DismissableLayer",h2="dismissableLayer.update",Ebe="dismissableLayer.pointerDownOutside",Abe="dismissableLayer.focusOutside",R$,_7=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zh=w.forwardRef((t,e)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:l,...u}=t,d=w.useContext(_7),[h,m]=w.useState(null),p=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,v]=w.useState({}),b=Nt(e,T=>m(T)),y=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),j=y.indexOf(x),N=h?y.indexOf(h):-1,S=d.layersWithOutsidePointerEventsDisabled.size>0,k=N>=j,C=Obe(T=>{const R=T.target,I=[...d.branches].some(D=>D.contains(R));!k||I||(a==null||a(T),o==null||o(T),T.defaultPrevented||l==null||l())},p),A=Mbe(T=>{const R=T.target;[...d.branches].some(D=>D.contains(R))||(i==null||i(T),o==null||o(T),T.defaultPrevented||l==null||l())},p);return Cbe(T=>{N===d.layers.size-1&&(n==null||n(T),!T.defaultPrevented&&l&&(T.preventDefault(),l()))},p),w.useEffect(()=>{if(h)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(R$=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),I$(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=R$)}},[h,p,r,d]),w.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),I$())},[h,d]),w.useEffect(()=>{const T=()=>v({});return document.addEventListener(h2,T),()=>document.removeEventListener(h2,T)},[]),s.jsx(ht.div,{...u,ref:b,style:{pointerEvents:S?k?"auto":"none":void 0,...t.style},onFocusCapture:et(t.onFocusCapture,A.onFocusCapture),onBlurCapture:et(t.onBlurCapture,A.onBlurCapture),onPointerDownCapture:et(t.onPointerDownCapture,C.onPointerDownCapture)})});Zh.displayName=kbe;var Pbe="DismissableLayerBranch",Tbe=w.forwardRef((t,e)=>{const r=w.useContext(_7),n=w.useRef(null),a=Nt(e,n);return w.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),s.jsx(ht.div,{...t,ref:a})});Tbe.displayName=Pbe;function Obe(t,e=globalThis==null?void 0:globalThis.document){const r=po(t),n=w.useRef(!1),a=w.useRef(()=>{});return w.useEffect(()=>{const i=l=>{if(l.target&&!n.current){let u=function(){j7(Ebe,r,d,{discrete:!0})};const d={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",a.current),a.current=u,e.addEventListener("click",a.current,{once:!0})):u()}else e.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",a.current)}},[e,r]),{onPointerDownCapture:()=>n.current=!0}}function Mbe(t,e=globalThis==null?void 0:globalThis.document){const r=po(t),n=w.useRef(!1);return w.useEffect(()=>{const a=i=>{i.target&&!n.current&&j7(Abe,r,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",a),()=>e.removeEventListener("focusin",a)},[e,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function I$(){const t=new CustomEvent(h2);document.dispatchEvent(t)}function j7(t,e,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:r});e&&a.addEventListener(t,e,{once:!0}),n?Sbe(a,i):a.dispatchEvent(i)}var $j=0;function Zk(){w.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??D$()),document.body.insertAdjacentElement("beforeend",t[1]??D$()),$j++,()=>{$j===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),$j--}},[])}function D$(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Lj="focusScope.autoFocusOnMount",Fj="focusScope.autoFocusOnUnmount",$$={bubbles:!1,cancelable:!0},Rbe="FocusScope",q0=w.forwardRef((t,e)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=t,[l,u]=w.useState(null),d=po(a),h=po(i),m=w.useRef(null),p=Nt(e,y=>u(y)),v=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(n){let y=function(S){if(v.paused||!l)return;const k=S.target;l.contains(k)?m.current=k:Zi(m.current,{select:!0})},x=function(S){if(v.paused||!l)return;const k=S.relatedTarget;k!==null&&(l.contains(k)||Zi(m.current,{select:!0}))},j=function(S){if(document.activeElement===document.body)for(const C of S)C.removedNodes.length>0&&Zi(l)};document.addEventListener("focusin",y),document.addEventListener("focusout",x);const N=new MutationObserver(j);return l&&N.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",x),N.disconnect()}}},[n,l,v.paused]),w.useEffect(()=>{if(l){F$.add(v);const y=document.activeElement;if(!l.contains(y)){const j=new CustomEvent(Lj,$$);l.addEventListener(Lj,d),l.dispatchEvent(j),j.defaultPrevented||(Ibe(Bbe(N7(l)),{select:!0}),document.activeElement===y&&Zi(l))}return()=>{l.removeEventListener(Lj,d),setTimeout(()=>{const j=new CustomEvent(Fj,$$);l.addEventListener(Fj,h),l.dispatchEvent(j),j.defaultPrevented||Zi(y??document.body,{select:!0}),l.removeEventListener(Fj,h),F$.remove(v)},0)}}},[l,d,h,v]);const b=w.useCallback(y=>{if(!r&&!n||v.paused)return;const x=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,j=document.activeElement;if(x&&j){const N=y.currentTarget,[S,k]=Dbe(N);S&&k?!y.shiftKey&&j===k?(y.preventDefault(),r&&Zi(S,{select:!0})):y.shiftKey&&j===S&&(y.preventDefault(),r&&Zi(k,{select:!0})):j===N&&y.preventDefault()}},[r,n,v.paused]);return s.jsx(ht.div,{tabIndex:-1,...o,ref:p,onKeyDown:b})});q0.displayName=Rbe;function Ibe(t,{select:e=!1}={}){const r=document.activeElement;for(const n of t)if(Zi(n,{select:e}),document.activeElement!==r)return}function Dbe(t){const e=N7(t),r=L$(e,t),n=L$(e.reverse(),t);return[r,n]}function N7(t){const e=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)e.push(r.currentNode);return e}function L$(t,e){for(const r of t)if(!$be(r,{upTo:e}))return r}function $be(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Lbe(t){return t instanceof HTMLInputElement&&"select"in t}function Zi(t,{select:e=!1}={}){if(t&&t.focus){const r=document.activeElement;t.focus({preventScroll:!0}),t!==r&&Lbe(t)&&e&&t.select()}}var F$=Fbe();function Fbe(){let t=[];return{add(e){const r=t[0];e!==r&&(r==null||r.pause()),t=B$(t,e),t.unshift(e)},remove(e){var r;t=B$(t,e),(r=t[0])==null||r.resume()}}}function B$(t,e){const r=[...t],n=r.indexOf(e);return n!==-1&&r.splice(n,1),r}function Bbe(t){return t.filter(e=>e.tagName!=="A")}var Xr=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{},Vbe=Zv[" useId ".trim().toString()]||(()=>{}),zbe=0;function ns(t){const[e,r]=w.useState(Vbe());return Xr(()=>{r(n=>n??String(zbe++))},[t]),e?`radix-${e}
781`:""}const Ube=["top","right","bottom","left"],go=Math.min,Wn=Math.max,Pv=Math.round,Yp=Math.floor,Es=t=>({x:t,y:t}),qbe={left:"right",right:"left",bottom:"top",top:"bottom"},Wbe={start:"end",end:"start"};function m2(t,e,r){return Wn(t,go(e,r))}function gi(t,e){return typeof t=="function"?t(e):t}function vi(t){return t.split("-")[0]}function cd(t){return t.split("-")[1]}function Qk(t){return t==="x"?"y":"x"}function Jk(t){return t==="y"?"height":"width"}const Hbe=new Set(["top","bottom"]);function _s(t){return Hbe.has(vi(t))?"y":"x"}function eE(t){return Qk(_s(t))}function Gbe(t,e,r){r===void 0&&(r=!1);const n=cd(t),a=eE(t),i=Jk(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Tv(o)),[o,Tv(o)]}function Kbe(t){const e=Tv(t);return[p2(t),e,p2(e)]}function p2(t){return t.replace(/start|end/g,e=>Wbe[e])}const V$=["left","right"],z$=["right","left"],Ybe=["top","bottom"],Xbe=["bottom","top"];function Zbe(t,e,r){switch(t){case"top":case"bottom":return r?e?z$:V$:e?V$:z$;case"left":case"right":return e?Ybe:Xbe;default:return[]}}function Qbe(t,e,r,n){const a=cd(t);let i=Zbe(vi(t),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),e&&(i=i.concat(i.map(p2)))),i}function Tv(t){return t.replace(/left|right|bottom|top/g,e=>qbe[e])}function Jbe(t){return{top:0,right:0,bottom:0,left:0,...t}}function S7(t){return typeof t!="number"?Jbe(t):{top:t,right:t,bottom:t,left:t}}function Ov(t){const{x:e,y:r,width:n,height:a}=t;return{width:n,height:a,top:r,left:e,right:e+n,bottom:r+a,x:e,y:r}}function U$(t,e,r){let{reference:n,floating:a}=t;const i=_s(e),o=eE(e),l=Jk(o),u=vi(e),d=i==="y",h=n.x+n.width/2-a.width/2,m=n.y+n.height/2-a.height/2,p=n[l]/2-a[l]/2;let v;switch(u){case"top":v={x:h,y:n.y-a.height};break;case"bottom":v={x:h,y:n.y+n.height};break;case"right":v={x:n.x+n.width,y:m};break;case"left":v={x:n.x-a.width,y:m};break;default:v={x:n.x,y:n.y}}switch(cd(e)){case"start":v[o]-=p*(r&&d?-1:1);break;case"end":v[o]+=p*(r&&d?-1:1);break}return v}const ewe=async(t,e,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,l=i.filter(Boolean),u=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:a}),{x:h,y:m}=U$(d,n,u),p=n,v={},b=0;for(let y=0;y<l.length;y++){const{name:x,fn:j}=l[y],{x:N,y:S,data:k,reset:C}=await j({x:h,y:m,initialPlacement:n,placement:p,strategy:a,middlewareData:v,rects:d,platform:o,elements:{reference:t,floating:e}});h=N??h,m=S??m,v={...v,[x]:{...v[x],...k}},C&&b<=50&&(b++,typeof C=="object"&&(C.placement&&(p=C.placement),C.rects&&(d=C.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:a}):C.rects),{x:h,y:m}=U$(d,p,u)),y=-1)}return{x:h,y:m,placement:p,strategy:a,middlewareData:v}};async function Th(t,e){var r;e===void 0&&(e={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:p=!1,padding:v=0}=gi(e,t),b=S7(v),x=l[p?m==="floating"?"reference":"floating":m],j=Ov(await i.getClippingRect({element:(r=await(i.isElement==null?void 0:i.isElement(x)))==null||r?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),N=m==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),k=await(i.isElement==null?void 0:i.isElement(S))?await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1}:{x:1,y:1},C=Ov(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:N,offsetParent:S,strategy:u}):N);return{top:(j.top-C.top+b.top)/k.y,bottom:(C.bottom-j.bottom+b.bottom)/k.y,left:(j.left-C.left+b.left)/k.x,right:(C.right-j.right+b.right)/k.x}}const twe=t=>({name:"arrow",options:t,async fn(e){const{x:r,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:u}=e,{element:d,padding:h=0}=gi(t,e)||{};if(d==null)return{};const m=S7(h),p={x:r,y:n},v=eE(a),b=Jk(v),y=await o.getDimensions(d),x=v==="y",j=x?"top":"left",N=x?"bottom":"right",S=x?"clientHeight":"clientWidth",k=i.reference[b]+i.reference[v]-p[v]-i.floating[b],C=p[v]-i.reference[v],A=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let T=A?A[S]:0;(!T||!await(o.isElement==null?void 0:o.isElement(A)))&&(T=l.floating[S]||i.floating[b]);const R=k/2-C/2,I=T/2-y[b]/2-1,D=go(m[j],I),L=go(m[N],I),z=D,H=T-y[b]-L,Z=T/2-y[b]/2+R,te=m2(z,Z,H),G=!u.arrow&&cd(a)!=null&&Z!==te&&i.reference[b]/2-(Z<z?D:L)-y[b]/2<0,M=G?Z<z?Z-z:Z-H:0;return{[v]:p[v]+M,data:{[v]:te,centerOffset:Z-te-M,...G&&{alignmentOffset:M}},reset:G}}}),rwe=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var r,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:p,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...x}=gi(t,e);if((r=i.arrow)!=null&&r.alignmentOffset)return{};const j=vi(a),N=_s(l),S=vi(l)===l,k=await(u.isRTL==null?void 0:u.isRTL(d.floating)),C=p||(S||!y?[Tv(l)]:Kbe(l)),A=b!=="none";!p&&A&&C.push(...Qbe(l,y,b,k));const T=[l,...C],R=await Th(e,x),I=[];let D=((n=i.flip)==null?void 0:n.overflows)||[];if(h&&I.push(R[j]),m){const Z=Gbe(a,o,k);I.push(R[Z[0]],R[Z[1]])}if(D=[...D,{placement:a,overflows:I}],!I.every(Z=>Z<=0)){var L,z;const Z=(((L=i.flip)==null?void 0:L.index)||0)+1,te=T[Z];
vendor: 29,056 bytes, line 781
781if(te&&(!(m==="alignment"?N!==_s(te):!1)||D.every(F=>_s(F.placement)===N?F.overflows[0]>0:!0)))return{data:{index:Z,overflows:D},reset:{placement:te}};let G=(z=D.filter(M=>M.overflows[0]<=0).sort((M,F)=>M.overflows[1]-F.overflows[1])[0])==null?void 0:z.placement;if(!G)switch(v){case"bestFit":{var H;const M=(H=D.filter(F=>{if(A){const K=_s(F.placement);return K===N||K==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(K=>K>0).reduce((K,B)=>K+B,0)]).sort((F,K)=>F[1]-K[1])[0])==null?void 0:H[0];M&&(G=M);break}case"initialPlacement":G=l;break}if(a!==G)return{reset:{placement:G}}}return{}}}};function q$(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function W$(t){return Ube.some(e=>t[e]>=0)}const nwe=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:r}=e,{strategy:n="referenceHidden",...a}=gi(t,e);switch(n){case"referenceHidden":{const i=await Th(e,{...a,elementContext:"reference"}),o=q$(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:W$(o)}}}case"escaped":{const i=await Th(e,{...a,altBoundary:!0}),o=q$(i,r.floating);return{data:{escapedOffsets:o,escaped:W$(o)}}}default:return{}}}}},C7=new Set(["left","top"]);async function awe(t,e){const{placement:r,platform:n,elements:a}=t,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=vi(r),l=cd(r),u=_s(r)==="y",d=C7.has(o)?-1:1,h=i&&u?-1:1,m=gi(e,t);let{mainAxis:p,crossAxis:v,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return l&&typeof b=="number"&&(v=l==="end"?b*-1:b),u?{x:v*h,y:p*d}:{x:p*d,y:v*h}}const swe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var r,n;const{x:a,y:i,placement:o,middlewareData:l}=e,u=await awe(e,t);return o===((r=l.offset)==null?void 0:r.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+u.x,y:i+u.y,data:{...u,placement:o}}}}},iwe=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:r,y:n,placement:a}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:l={fn:x=>{let{x:j,y:N}=x;return{x:j,y:N}}},...u}=gi(t,e),d={x:r,y:n},h=await Th(e,u),m=_s(vi(a)),p=Qk(m);let v=d[p],b=d[m];if(i){const x=p==="y"?"top":"left",j=p==="y"?"bottom":"right",N=v+h[x],S=v-h[j];v=m2(N,v,S)}if(o){const x=m==="y"?"top":"left",j=m==="y"?"bottom":"right",N=b+h[x],S=b-h[j];b=m2(N,b,S)}const y=l.fn({...e,[p]:v,[m]:b});return{...y,data:{x:y.x-r,y:y.y-n,enabled:{[p]:i,[m]:o}}}}}},owe=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=e,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=gi(t,e),h={x:r,y:n},m=_s(a),p=Qk(m);let v=h[p],b=h[m];const y=gi(l,e),x=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(u){const S=p==="y"?"height":"width",k=i.reference[p]-i.floating[S]+x.mainAxis,C=i.reference[p]+i.reference[S]-x.mainAxis;v<k?v=k:v>C&&(v=C)}if(d){var j,N;const S=p==="y"?"width":"height",k=C7.has(vi(a)),C=i.reference[m]-i.floating[S]+(k&&((j=o.offset)==null?void 0:j[m])||0)+(k?0:x.crossAxis),A=i.reference[m]+i.reference[S]+(k?0:((N=o.offset)==null?void 0:N[m])||0)-(k?x.crossAxis:0);b<C?b=C:b>A&&(b=A)}return{[p]:v,[m]:b}}}},lwe=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var r,n;const{placement:a,rects:i,platform:o,elements:l}=e,{apply:u=()=>{},...d}=gi(t,e),h=await Th(e,d),m=vi(a),p=cd(a),v=_s(a)==="y",{width:b,height:y}=i.floating;let x,j;m==="top"||m==="bottom"?(x=m,j=p===(await(o.isRTL==null?void 0:o.isRTL(l.floating))?"start":"end")?"left":"right"):(j=m,x=p==="end"?"top":"bottom");const N=y-h.top-h.bottom,S=b-h.left-h.right,k=go(y-h[x],N),C=go(b-h[j],S),A=!e.middlewareData.shift;let T=k,R=C;if((r=e.middlewareData.shift)!=null&&r.enabled.x&&(R=S),(n=e.middlewareData.shift)!=null&&n.enabled.y&&(T=N),A&&!p){const D=Wn(h.left,0),L=Wn(h.right,0),z=Wn(h.top,0),H=Wn(h.bottom,0);v?R=b-2*(D!==0||L!==0?D+L:Wn(h.left,h.right)):T=y-2*(z!==0||H!==0?z+H:Wn(h.top,h.bottom))}await u({...e,availableWidth:R,availableHeight:T});const I=await o.getDimensions(l.floating);return b!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function W0(){return typeof window<"u"}function ud(t){return k7(t)?(t.nodeName||"").toLowerCase():"#document"}function Zn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Is(t){var e;return(e=(k7(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function k7(t){return W0()?t instanceof Node||t instanceof Zn(t).Node:!1}function as(t){return W0()?t instanceof Element||t instanceof Zn(t).Element:!1}function Ts(t){return W0()?t instanceof HTMLElement||t instanceof Zn(t).HTMLElement:!1}function H$(t){return!W0()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Zn(t).ShadowRoot}const cwe=new Set(["inline","contents"]);function Qh(t){const{overflow:e,overflowX:r,overflowY:n,display:a}=ss(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+r)&&!cwe.has(a)}const uwe=new Set(["table","td","th"]);function dwe(t){return uwe.has(ud(t))}const fwe=[":popover-open",":modal"];function H0(t){return fwe.some(e=>{try{return t.matches(e)}catch{return!1}})}const hwe=["transform","translate","scale","rotate","perspective"],mwe=["transform","translate","scale","rotate","perspective","filter"],pwe=["paint","layout","strict","content"];function tE(t){const e=rE(),r=as(t)?ss(t):t;return hwe.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!e&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!e&&(r.filter?r.filter!=="none":!1)||mwe.some(n=>(r.willChange||"").includes(n))||pwe.some(n=>(r.contain||"").includes(n))}function gwe(t){let e=vo(t);for(;Ts(e)&&!Iu(e);){if(tE(e))return e;if(H0(e))return null;e=vo(e)}return null}function rE(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vwe=new Set(["html","body","#document"]);function Iu(t){return vwe.has(ud(t))}function ss(t){return Zn(t).getComputedStyle(t)}function G0(t){return as(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function vo(t){if(ud(t)==="html")return t;const e=t.assignedSlot||t.parentNode||H$(t)&&t.host||Is(t);return H$(e)?e.host:e}function E7(t){const e=vo(t);return Iu(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ts(e)&&Qh(e)?e:E7(e)}function Oh(t,e,r){var n;e===void 0&&(e=[]),r===void 0&&(r=!0);const a=E7(t),i=a===((n=t.ownerDocument)==null?void 0:n.body),o=Zn(a);if(i){const l=g2(o);return e.concat(o,o.visualViewport||[],Qh(a)?a:[],l&&r?Oh(l):[])}return e.concat(a,Oh(a,[],r))}function g2(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function A7(t){const e=ss(t);let r=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=Ts(t),i=a?t.offsetWidth:r,o=a?t.offsetHeight:n,l=Pv(r)!==i||Pv(n)!==o;return l&&(r=i,n=o),{width:r,height:n,$:l}}function nE(t){return as(t)?t:t.contextElement}function Qc(t){const e=nE(t);if(!Ts(e))return Es(1);const r=e.getBoundingClientRect(),{width:n,height:a,$:i}=A7(e);let o=(i?Pv(r.width):r.width)/n,l=(i?Pv(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const xwe=Es(0);function P7(t){const e=Zn(t);return!rE()||!e.visualViewport?xwe:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ywe(t,e,r){return e===void 0&&(e=!1),!r||e&&r!==Zn(t)?!1:e}function Al(t,e,r,n){e===void 0&&(e=!1),r===void 0&&(r=!1);const a=t.getBoundingClientRect(),i=nE(t);let o=Es(1);e&&(n?as(n)&&(o=Qc(n)):o=Qc(t));const l=ywe(i,r,n)?P7(i):Es(0);let u=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,h=a.width/o.x,m=a.height/o.y;if(i){const p=Zn(i),v=n&&as(n)?Zn(n):n;let b=p,y=g2(b);for(;y&&n&&v!==b;){const x=Qc(y),j=y.getBoundingClientRect(),N=ss(y),S=j.left+(y.clientLeft+parseFloat(N.paddingLeft))*x.x,k=j.top+(y.clientTop+parseFloat(N.paddingTop))*x.y;u*=x.x,d*=x.y,h*=x.x,m*=x.y,u+=S,d+=k,b=Zn(y),y=g2(b)}}return Ov({width:h,height:m,x:u,y:d})}function K0(t,e){const r=G0(t).scrollLeft;return e?e.left+r:Al(Is(t)).left+r}function T7(t,e){const r=t.getBoundingClientRect(),n=r.left+e.scrollLeft-K0(t,r),a=r.top+e.scrollTop;return{x:n,y:a}}function bwe(t){let{elements:e,rect:r,offsetParent:n,strategy:a}=t;const i=a==="fixed",o=Is(n),l=e?H0(e.floating):!1;if(n===o||l&&i)return r;let u={scrollLeft:0,scrollTop:0},d=Es(1);const h=Es(0),m=Ts(n);if((m||!m&&!i)&&((ud(n)!=="body"||Qh(o))&&(u=G0(n)),Ts(n))){const v=Al(n);d=Qc(n),h.x=v.x+n.clientLeft,h.y=v.y+n.clientTop}const p=o&&!m&&!i?T7(o,u):Es(0);return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-u.scrollLeft*d.x+h.x+p.x,y:r.y*d.y-u.scrollTop*d.y+h.y+p.y}}function wwe(t){return Array.from(t.getClientRects())}function _we(t){const e=Is(t),r=G0(t),n=t.ownerDocument.body,a=Wn(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Wn(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+K0(t);const l=-r.scrollTop;return ss(n).direction==="rtl"&&(o+=Wn(e.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}const G$=25;function jwe(t,e){const r=Zn(t),n=Is(t),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,u=0;if(a){i=a.width,o=a.height;const h=rE();(!h||h&&e==="fixed")&&(l=a.offsetLeft,u=a.offsetTop)}const d=K0(n);if(d<=0){const h=n.ownerDocument,m=h.body,p=getComputedStyle(m),v=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,b=Math.abs(n.clientWidth-m.clientWidth-v);b<=G$&&(i-=b)}else d<=G$&&(i+=d);return{width:i,height:o,x:l,y:u}}const Nwe=new Set(["absolute","fixed"]);function Swe(t,e){const r=Al(t,!0,e==="fixed"),n=r.top+t.clientTop,a=r.left+t.clientLeft,i=Ts(t)?Qc(t):Es(1),o=t.clientWidth*i.x,l=t.clientHeight*i.y,u=a*i.x,d=n*i.y;return{width:o,height:l,x:u,y:d}}function K$(t,e,r){let n;if(e==="viewport")n=jwe(t,r);else if(e==="document")n=_we(Is(t));else if(as(e))n=Swe(e,r);else{const a=P7(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Ov(n)}function O7(t,e){const r=vo(t);return r===e||!as(r)||Iu(r)?!1:ss(r).position==="fixed"||O7(r,e)}function Cwe(t,e){const r=e.get(t);if(r)return r;let n=Oh(t,[],!1).filter(l=>as(l)&&ud(l)!=="body"),a=null;const i=ss(t).position==="fixed";let o=i?vo(t):t;for(;as(o)&&!Iu(o);){const l=ss(o),u=tE(o);!u&&l.position==="fixed"&&(a=null),(i?!u&&!a:!u&&l.position==="static"&&!!a&&Nwe.has(a.position)||Qh(o)&&!u&&O7(t,o))?n=n.filter(h=>h!==o):a=l,o=vo(o)}return e.set(t,n),n}function kwe(t){let{element:e,boundary:r,rootBoundary:n,strategy:a}=t;const o=[...r==="clippingAncestors"?H0(e)?[]:Cwe(e,this._c):[].concat(r),n],l=o[0],u=o.reduce((d,h)=>{const m=K$(e,h,a);return d.top=Wn(m.top,d.top),d.right=go(m.right,d.right),d.bottom=go(m.bottom,d.bottom),d.left=Wn(m.left,d.left),d},K$(e,l,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Ewe(t){const{width:e,height:r}=A7(t);return{width:e,height:r}}function Awe(t,e,r){const n=Ts(e),a=Is(e),i=r==="fixed",o=Al(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=Es(0);function d(){u.x=K0(a)}if(n||!n&&!i)if((ud(e)!=="body"||Qh(a))&&(l=G0(e)),n){const v=Al(e,!0,i,e);u.x=v.x+e.clientLeft,u.y=v.y+e.clientTop}else a&&d();i&&!n&&a&&d();const h=a&&!n&&!i?T7(a,l):Es(0),m=o.left+l.scrollLeft-u.x-h.x,p=o.top+l.scrollTop-u.y-h.y;return{x:m,y:p,width:o.width,height:o.height}}function Bj(t){return ss(t).position==="static"}function Y$(t,e){if(!Ts(t)||ss(t).position==="fixed")return null;if(e)return e(t);let r=t.offsetParent;return Is(t)===r&&(r=r.ownerDocument.body),r}function M7(t,e){const r=Zn(t);if(H0(t))return r;if(!Ts(t)){let a=vo(t);for(;a&&!Iu(a);){if(as(a)&&!Bj(a))return a;a=vo(a)}return r}let n=Y$(t,e);for(;n&&dwe(n)&&Bj(n);)n=Y$(n,e);return n&&Iu(n)&&Bj(n)&&!tE(n)?r:n||gwe(t)||r}const Pwe=async function(t){const e=this.getOffsetParent||M7,r=this.getDimensions,n=await r(t.floating);return{reference:Awe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Twe(t){return ss(t).direction==="rtl"}const Owe={convertOffsetParentRelativeRectToViewportRelativeRect:bwe,getDocumentElement:Is,getClippingRect:kwe,getOffsetParent:M7,getElementRects:Pwe,getClientRects:wwe,getDimensions:Ewe,getScale:Qc,isElement:as,isRTL:Twe};function R7(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Mwe(t,e){let r=null,n;const a=Is(t);function i(){var l;clearTimeout(n),(l=r)==null||l.disconnect(),r=null}function o(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),i();const d=t.getBoundingClientRect(),{left:h,top:m,width:p,height:v}=d;if(l||e(),!p||!v)return;const b=Yp(m),y=Yp(a.clientWidth-(h+p)),x=Yp(a.clientHeight-(m+v)),j=Yp(h),S={rootMargin:-b+"px "+-y+"px "+-x+"px "+-j+"px",threshold:Wn(0,go(1,u))||1};let k=!0;function C(A){const T=A[0].intersectionRatio;if(T!==u){if(!k)return o();T?o(!1,T):n=setTimeout(()=>{o(!1,1e-7)},1e3)}T===1&&!R7(d,t.getBoundingClientRect())&&o(),k=!1}try{r=new IntersectionObserver(C,{...S,root:a.ownerDocument})}catch{r=new IntersectionObserver(C,S)}r.observe(t)}return o(!0),i}function Rwe(t,e,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=nE(t),h=a||i?[...d?Oh(d):[],...Oh(e)]:[];h.forEach(j=>{a&&j.addEventListener("scroll",r,{passive:!0}),i&&j.addEventListener("resize",r)});const m=d&&l?Mwe(d,r):null;let p=-1,v=null;o&&(v=new ResizeObserver(j=>{let[N]=j;N&&N.target===d&&v&&(v.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=v)==null||S.observe(e)})),r()}),d&&!u&&v.observe(d),v.observe(e));let b,y=u?Al(t):null;u&&x();function x(){const j=Al(t);y&&!R7(y,j)&&r(),y=j,b=requestAnimationFrame(x)}return r(),()=>{var j;h.forEach(N=>{a&&N.removeEventListener("scroll",r),i&&N.removeEventListener("resize",r)}),m==null||m(),(j=v)==null||j.disconnect(),v=null,u&&cancelAnimationFrame(b)}}const Iwe=swe,Dwe=iwe,$we=rwe,Lwe=lwe,Fwe=nwe,X$=twe,Bwe=owe,Vwe=(t,e,r)=>{const n=new Map,a={platform:Owe,...r},i={...a.platform,_c:n};return ewe(t,e,{...a,platform:i})};var zwe=typeof document<"u",Uwe=function(){},dg=zwe?w.useLayoutEffect:Uwe;function Mv(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let r,n,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(r=t.length,r!==e.length)return!1;for(n=r;n--!==0;)if(!Mv(t[n],e[n]))return!1;return!0}if(a=Object.keys(t),r=a.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(e,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&t.$$typeof)&&!Mv(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function I7(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Z$(t,e){const r=I7(t);return Math.round(e*r)/r}function Vj(t){const e=w.useRef(t);return dg(()=>{e.current=t}),e}function qwe(t){t===void 0&&(t={});const{placement:e="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[h,m]=w.useState({x:0,y:0,strategy:r,placement:e,middlewareData:{},isPositioned:!1}),[p,v]=w.useState(n);Mv(p,n)||v(n);const[b,y]=w.useState(null),[x,j]=w.useState(null),N=w.useCallback(F=>{F!==A.current&&(A.current=F,y(F))},[]),S=w.useCallback(F=>{F!==T.current&&(T.current=F,j(F))},[]),k=i||b,C=o||x,A=w.useRef(null),T=w.useRef(null),R=w.useRef(h),I=u!=null,D=Vj(u),L=Vj(a),z=Vj(d),H=w.useCallback(()=>{if(!A.current||!T.current)return;const F={placement:e,strategy:r,middleware:p};L.current&&(F.platform=L.current),Vwe(A.current,T.current,F).then(K=>{const B={...K,isPositioned:z.current!==!1};Z.current&&!Mv(R.current,B)&&(R.current=B,$h.flushSync(()=>{m(B)}))})},[p,e,r,L,z]);dg(()=>{d===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,m(F=>({...F,isPositioned:!1})))},[d]);const Z=w.useRef(!1);dg(()=>(Z.current=!0,()=>{Z.current=!1}),[]),dg(()=>{if(k&&(A.current=k),C&&(T.current=C),k&&C){if(D.current)return D.current(k,C,H);H()}},[k,C,H,D,I]);const te=w.useMemo(()=>({reference:A,floating:T,setReference:N,setFloating:S}),[N,S]),G=w.useMemo(()=>({reference:k,floating:C}),[k,C]),M=w.useMemo(()=>{const F={position:r,left:0,top:0};if(!G.floating)return F;const K=Z$(G.floating,h.x),B=Z$(G.floating,h.y);return l?{...F,transform:"translate("+K+"px, "+B+"px)",...I7(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:K,top:B}},[r,l,G.floating,h.x,h.y]);return w.useMemo(()=>({...h,update:H,refs:te,elements:G,floatingStyles:M}),[h,H,te,G,M])}const Wwe=t=>{function e(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:t,fn(r){const{element:n,padding:a}=typeof t=="function"?t(r):t;return n&&e(n)?n.current!=null?X$({element:n.current,padding:a}).fn(r):{}:n?X$({element:n,padding:a}).fn(r):{}}}},Hwe=(t,e)=>({...Iwe(t),options:[t,e]}),Gwe=(t,e)=>({...Dwe(t),options:[t,e]}),Kwe=(t,e)=>({...Bwe(t),options:[t,e]}),Ywe=(t,e)=>({...$we(t),options:[t,e]}),Xwe=(t,e)=>({...Lwe(t),options:[t,e]}),Zwe=(t,e)=>({...Fwe(t),options:[t,e]}),Qwe=(t,e)=>({...Wwe(t),options:[t,e]});var Jwe="Arrow",D7=w.forwardRef((t,e)=>{const{children:r,width:n=10,height:a=5,...i}=t;return s.jsx(ht.svg,{...i,ref:e,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:s.jsx("polygon",{points:"0,0 30,0 15,10"})})});D7.displayName=Jwe;var e1e=D7;function aE(t){const[e,r]=w.useState(void 0);return Xr(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;o=d.inlineSize,l=d.blockSize}else o=t.offsetWidth,l=t.offsetHeight;r({width:o,height:l})});return n.observe(t,{box:"border-box"}),()=>n.unobserve(t)}else r(void 0)},[t]),e}var sE="Popper",[$7,dd]=Ca(sE),[t1e,L7]=$7(sE),F7=t=>{const{__scopePopper:e,children:r}=t,[n,a]=w.useState(null);return s.jsx(t1e,{scope:e,anchor:n,onAnchorChange:a,children:r})};F7.displayName=sE;var B7="PopperAnchor",V7=w.forwardRef((t,e)=>{const{__scopePopper:r,virtualRef:n,...a}=t,i=L7(B7,r),o=w.useRef(null),l=Nt(e,o),u=w.useRef(null);return w.useEffect(()=>{const d=u.current;u.current=(n==null?void 0:n.current)||o.current,d!==u.current&&i.onAnchorChange(u.current)}),n?null:s.jsx(ht.div,{...a,ref:l})});V7.displayName=B7;var iE="PopperContent",[r1e,n1e]=$7(iE),z7=w.forwardRef((t,e)=>{var Q,pe,V,J,oe,re;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:l=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:m="partial",hideWhenDetached:p=!1,updatePositionStrategy:v="optimized",onPlaced:b,...y}=t,x=L7(iE,r),[j,N]=w.useState(null),S=Nt(e,Me=>N(Me)),[k,C]=w.useState(null),A=aE(k),T=(A==null?void 0:A.width)??0,R=(A==null?void 0:A.height)??0,I=n+(i!=="center"?"-"+i:""),D=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},L=Array.isArray(d)?d:[d],z=L.length>0,H={padding:D,boundary:L.filter(s1e),altBoundary:z},{refs:Z,floatingStyles:te,placement:G,isPositioned:M,middlewareData:F}=qwe({strategy:"fixed",placement:I,whileElementsMounted:(...Me)=>Rwe(...Me,{animationFrame:v==="always"}),elements:{reference:x.anchor},middleware:[Hwe({mainAxis:a+R,alignmentAxis:o}),u&&Gwe({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?Kwe():void 0,...H}),u&&Ywe({...H}),Xwe({...H,apply:({elements:Me,rects:ee,availableWidth:ce,availableHeight:je})=>{const{width:de,height:we}=ee.reference,ke=Me.floating.style;ke.setProperty("--radix-popper-available-width",`${ce}px`),ke.setProperty("--radix-popper-available-height",`${je}px`),ke.setProperty("--radix-popper-anchor-width",`${de}px`),ke.setProperty("--radix-popper-anchor-height",`${we}px`)}}),k&&Qwe({element:k,padding:l}),i1e({arrowWidth:T,arrowHeight:R}),p&&Zwe({strategy:"referenceHidden",...H})]}),[K,B]=W7(G),O=po(b);Xr(()=>{M&&(O==null||O())},[M,O]);const W=(Q=F.arrow)==null?void 0:Q.x,q=(pe=F.arrow)==null?void 0:pe.y,se=((V=F.arrow)==null?void 0:V.centerOffset)!==0,[me,fe]=w.useState();return Xr(()=>{j&&fe(window.getComputedStyle(j).zIndex)},[j]),s.jsx("div",{ref:Z.setFloating,"data-radix-popper-content-wrapper":"",style:{...te,transform:M?te.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:me,"--radix-popper-transform-origin":[(J=F.transformOrigin)==null?void 0:J.x,(oe=F.transformOrigin)==null?void 0:oe.y].join(" "),...((re=F.hide)==null?void 0:re.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:s.jsx(r1e,{scope:r,placedSide:K,onArrowChange:C,arrowX:W,arrowY:q,shouldHideArrow:se,children:s.jsx(ht.div,{"data-side":K,"data-align":B,...y,ref:S,style:{...y.style,animation:M?void 0:"none"}})})})});z7.displayName=iE;var U7="PopperArrow",a1e={top:"bottom",right:"left",bottom:"top",left:"right"},q7=w.forwardRef(function(e,r){const{__scopePopper:n,...a}=e,i=n1e(U7,n),o=a1e[i.placedSide];return s.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:s.jsx(e1e,{...a,ref:r,style:{...a.style,display:"block"}})})});q7.displayName=U7;function s1e(t){return t!==null}var i1e=t=>({name:"transformOrigin",options:t,fn(e){var x,j,N;const{placement:r,rects:n,middlewareData:a}=e,o=((x=a.arrow)==null?void 0:x.centerOffset)!==0,l=o?0:t.arrowWidth,u=o?0:t.arrowHeight,[d,h]=W7(r),m={start:"0%",center:"50%",end:"100%"}[h],p=(((j=a.arrow)==null?void 0:j.x)??0)+l/2,v=(((N=a.arrow)==null?void 0:N.y)??0)+u/2;let b="",y="";return d==="bottom"?(b=o?m:`${p}px`,y=`${-u}px`):d==="top"?(b=o?m:`${p}px`,y=`${n.floating.height+u}px`):d==="right"?(b=`${-u}px`,y=o?m:`${v}px`):d==="left"&&(b=`${n.floating.width+u}px`,y=o?m:`${v}px`),{data:{x:b,y}}}});function W7(t){const[e,r="center"]=t.split("-");return[e,r]}var oE=F7,Y0=V7,lE=z7,cE=q7,o1e="Portal",X0=w.forwardRef((t,e)=>{var l;const{container:r,...n}=t,[a,i]=w.useState(!1);Xr(()=>i(!0),[]);const o=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return o?ZL.createPortal(s.jsx(ht.div,{...n,ref:e}),o):null});X0.displayName=o1e;function l1e(t,e){return w.useReducer((r,n)=>e[r][n]??r,t)}var ji=t=>{const{present:e,children:r}=t,n=c1e(e),a=typeof r=="function"?r({present:n.isPresent}):w.Children.only(r),i=Nt(n.ref,u1e(a));return typeof r=="function"||n.isPresent?w.cloneElement(a,{ref:i}):null};ji.displayName="Presence";function c1e(t){const[e,r]=w.useState(),n=w.useRef(null),a=w.useRef(t),i=w.useRef("none"),o=t?"mounted":"unmounted",[l,u]=l1e(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const d=Xp(n.current);i.current=l==="mounted"?d:"none"},[l]),Xr(()=>{const d=n.current,h=a.current;if(h!==t){const p=i.current,v=Xp(d);t?u("MOUNT"):v==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(h&&p!==v?"ANIMATION_OUT":"UNMOUNT"),a.current=t}},[t,u]),Xr(()=>{if(e){let d;const h=e.ownerDocument.defaultView??window,m=v=>{const y=Xp(n.current).includes(CSS.escape(v.animationName));if(v.target===e&&y&&(u("ANIMATION_END"),!a.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",d=h.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},p=v=>{v.target===e&&(i.current=Xp(n.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",m),e.addEventListener("animationend",m),()=>{h.clearTimeout(d),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",m),e.removeEventListener("animationend",m)}}else u("ANIMATION_END")},[e,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:w.useCallback(d=>{n.current=d?getComputedStyle(d):null,r(d)},[])}}function Xp(t){return(t==null?void 0:t.animationName)||"none"}function u1e(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function d1e(t){const e=f1e(t),r=w.forwardRef((n,a)=>{const{children:i,...o}=n,l=w.Children.toArray(i),u=l.find(m1e);if(u){const d=u.props.children,h=l.map(m=>m===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:m);return s.jsx(e,{...o,ref:a,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function f1e(t){const e=w.forwardRef((r,n)=>{const{children:a,...i}=r;if(w.isValidElement(a)){const o=g1e(a),l=p1e(i,a.props);return a.type!==w.Fragment&&(l.ref=n?Gl(n,o):o),w.cloneElement(a,l)}return w.Children.count(a)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var h1e=Symbol("radix.slottable");function m1e(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===h1e}function p1e(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const u=i(...l);return a(...l),u}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function g1e(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var v1e=Zv[" useInsertionEffect ".trim().toString()]||Xr;function Os({prop:t,defaultProp:e,onChange:r=()=>{},caller:n}){const[a,i,o]=x1e({defaultProp:e,onChange:r}),l=t!==void 0,u=l?t:a;{const h=w.useRef(t!==void 0);w.useEffect(()=>{const m=h.current;m!==l&&console.warn(`${n} is changing from ${m?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=l},[l,n])}const d=w.useCallback(h=>{var m;if(l){const p=y1e(h)?h(t):h;p!==t&&((m=o.current)==null||m.call(o,p))}else i(h)},[l,t,i,o]);return[u,d]}function x1e({defaultProp:t,onChange:e}){const[r,n]=w.useState(t),a=w.useRef(r),i=w.useRef(e);return v1e(()=>{i.current=e},[e]),w.useEffect(()=>{var o;a.current!==r&&((o=i.current)==null||o.call(i,r),a.current=r)},[r,a]),[r,n,i]}function y1e(t){return typeof t=="function"}var b1e=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Sc=new WeakMap,Zp=new WeakMap,Qp={},zj=0,H7=function(t){return t&&(t.host||H7(t.parentNode))},w1e=function(t,e){return e.map(function(r){if(t.contains(r))return r;var n=H7(r);return n&&t.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",t,". Doing nothing"),null)}).filter(function(r){return!!r})},_1e=function(t,e,r,n){var a=w1e(e,Array.isArray(t)?t:[t]);Qp[r]||(Qp[r]=new WeakMap);var i=Qp[r],o=[],l=new Set,u=new Set(a),d=function(m){!m||l.has(m)||(l.add(m),d(m.parentNode))};a.forEach(d);var h=function(m){!m||u.has(m)||Array.prototype.forEach.call(m.children,function(p){if(l.has(p))h(p);else try{var v=p.getAttribute(n),b=v!==null&&v!=="false",y=(Sc.get(p)||0)+1,x=(i.get(p)||0)+1;Sc.set(p,y),i.set(p,x),o.push(p),y===1&&b&&Zp.set(p,!0),x===1&&p.setAttribute(r,"true"),b||p.setAttribute(n,"true")}catch(j){console.error("aria-hidden: cannot operate on ",p,j)}})};return h(e),l.clear(),zj++,function(){o.forEach(function(m){var p=Sc.get(m)-1,v=i.get(m)-1;Sc.set(m,p),i.set(m,v),p||(Zp.has(m)||m.removeAttribute(n),Zp.delete(m)),v||m.removeAttribute(r)}),zj--,zj||(Sc=new WeakMap,Sc=new WeakMap,Zp=new WeakMap,Qp={})}},uE=function(t,e,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(t)?t:[t]),a=b1e(t);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),_1e(n,a,r,"aria-hidden")):function(){return null}},fg="right-scroll-bar-position",hg="width-before-scroll-bar",j1e="with-scroll-bars-hidden",N1e="--removed-body-scroll-bar-size";function Uj(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function S1e(t,e){var r=w.useState(function(){return{value:t,callback:e,facade:{get current(){return r.value},set current(n){var a=r.value;a!==n&&(r.value=n,r.callback(n,a))}}}})[0];return r.callback=e,r.facade}var C1e=typeof window<"u"?w.useLayoutEffect:w.useEffect,Q$=new WeakMap;function k1e(t,e){var r=S1e(null,function(n){return t.forEach(function(a){return Uj(a,n)})});return C1e(function(){var n=Q$.get(r);if(n){var a=new Set(n),i=new Set(t),o=r.current;a.forEach(function(l){i.has(l)||Uj(l,null)}
vendor: 4,181 bytes, lines 781-796
781),i.forEach(function(l){a.has(l)||Uj(l,o)})}Q$.set(r,t)},[t]),r}function E1e(t){return t}function A1e(t,e){e===void 0&&(e=E1e);var r=[],n=!1,a={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:t},useMedium:function(i){var o=e(i,n);return r.push(o),function(){r=r.filter(function(l){return l!==o})}},assignSyncMedium:function(i){for(n=!0;r.length;){var o=r;r=[],o.forEach(i)}r={push:function(l){return i(l)},filter:function(){return r}}},assignMedium:function(i){n=!0;var o=[];if(r.length){var l=r;r=[],l.forEach(i),o=r}var u=function(){var h=o;o=[],h.forEach(i)},d=function(){return Promise.resolve().then(u)};d(),r={push:function(h){o.push(h),d()},filter:function(h){return o=o.filter(h),r}}}};return a}function P1e(t){t===void 0&&(t={});var e=A1e(null);return e.options=xa({async:!0,ssr:!1},t),e}var G7=function(t){var e=t.sideCar,r=No(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=e.read();if(!n)throw new Error("Sidecar medium not found");return w.createElement(n,xa({},r))};G7.isSideCarExport=!0;function T1e(t,e){return t.useMedium(e),G7}var K7=P1e(),qj=function(){},Z0=w.forwardRef(function(t,e){var r=w.useRef(null),n=w.useState({onScrollCapture:qj,onWheelCapture:qj,onTouchMoveCapture:qj}),a=n[0],i=n[1],o=t.forwardProps,l=t.children,u=t.className,d=t.removeScrollBar,h=t.enabled,m=t.shards,p=t.sideCar,v=t.noRelative,b=t.noIsolation,y=t.inert,x=t.allowPinchZoom,j=t.as,N=j===void 0?"div":j,S=t.gapMode,k=No(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=p,A=k1e([r,e]),T=xa(xa({},k),a);return w.createElement(w.Fragment,null,h&&w.createElement(C,{sideCar:K7,removeScrollBar:d,shards:m,noRelative:v,noIsolation:b,inert:y,setCallbacks:i,allowPinchZoom:!!x,lockRef:r,gapMode:S}),o?w.cloneElement(w.Children.only(l),xa(xa({},T),{ref:A})):w.createElement(N,xa({},T,{className:u,ref:A}),l))});Z0.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Z0.classNames={fullWidth:hg,zeroRight:fg};var O1e=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function M1e(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=O1e();return e&&t.setAttribute("nonce",e),t}function R1e(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function I1e(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var D1e=function(){var t=0,e=null;return{add:function(r){t==0&&(e=M1e())&&(R1e(e,r),I1e(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},$1e=function(){var t=D1e();return function(e,r){w.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&r])}},Y7=function(){var t=$1e(),e=function(r){var n=r.styles,a=r.dynamic;return t(n,a),null};return e},L1e={left:0,top:0,right:0,gap:0},Wj=function(t){return parseInt(t||"",10)||0},F1e=function(t){var e=window.getComputedStyle(document.body),r=e[t==="padding"?"paddingLeft":"marginLeft"],n=e[t==="padding"?"paddingTop":"marginTop"],a=e[t==="padding"?"paddingRight":"marginRight"];return[Wj(r),Wj(n),Wj(a)]},B1e=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return L1e;var e=F1e(t),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,n-r+e[2]-e[0])}},V1e=Y7(),Jc="data-scroll-locked",z1e=function(t,e,r,n){var a=t.left,i=t.top,o=t.right,l=t.gap;return r===void 0&&(r="margin"),` 782 .`.concat(j1e,` { 783 overflow: hidden `).concat(n,`; 784 padding-right: `).concat(l,"px ").concat(n,`; 785 } 786 body[`).concat(Jc,`] { 787 overflow: hidden `).concat(n,`; 788 overscroll-behavior: contain; 789 `).concat([e&&"position: relative ".concat(n,";"),r==="margin"&&` 790 padding-left: `.concat(a,`px; 791 padding-top: `).concat(i,`px; 792 padding-right: `).concat(o,`px; 793 margin-left:0; 794 margin-top:0; 795 margin-right: `).concat(l,"px ").concat(n,`; 796 `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";
796")].filter(Boolean).join(""),` 797 } 798 799 .`).concat(fg,` { 800 right: `).concat(l,"px ").concat(n,`; 801 } 802 803 .`).concat(hg,` { 804 margin-right: `).concat(l,"px ").concat(n,`; 805 } 806 807 .`).concat(fg," .").concat(fg,` { 808 right: 0 `).concat(n,`; 809 } 810 811 .`).concat(hg," .").concat(hg,` { 812 margin-right: 0 `).concat(n,`; 813 } 814 815 body[`).concat(Jc,`] { 816 `).concat(N1e,": ").concat(l,`px; 817 } 818`)},J$=function(){var t=parseInt(document.body.getAttribute(Jc)||"0",10);return isFinite(t)?t:0},U1e=function(){w.useEffect(function(){return document.body.setAttribute(Jc,(J$()+1).toString()),function(){var t=J$()-1;t<=0?document.body.removeAttribute(Jc):document.body.setAttribute(Jc,t.toString())}},[])},q1e=function(t){var e=t.noRelative,r=t.noImportant,n=t.gapMode,a=n===void 0?"margin":n;U1e();var i=w.useMemo(function(){return B1e(a)},[a]);return w.createElement(V1e,{styles:z1e(i,!e,a,r?"":"!important")})},v2=!1;if(typeof window<"u")try{var Jp=Object.defineProperty({},"passive",{get:function(){return v2=!0,!0}});window.addEventListener("test",Jp,Jp),window.removeEventListener("test",Jp,Jp)}catch{v2=!1}var Cc=v2?{passive:!1}:!1,W1e=function(t){return t.tagName==="TEXTAREA"},X7=function(t,e){if(!(t instanceof Element))return!1;var r=window.getComputedStyle(t);return r[e]!=="hidden"&&!(r.overflowY===r.overflowX&&!W1e(t)&&r[e]==="visible")},H1e=function(t){return X7(t,"overflowY")},G1e=function(t){return X7(t,"overflowX")},eL=function(t,e){var r=e.ownerDocument,n=e;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=Z7(t,n);if(a){var i=Q7(t,n),o=i[1],l=i[2];if(o>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},K1e=function(t){var e=t.scrollTop,r=t.scrollHeight,n=t.clientHeight;return[e,r,n]},Y1e=function(t){var e=t.scrollLeft,r=t.scrollWidth,n=t.clientWidth;return[e,r,n]},Z7=function(t,e){return t==="v"?H1e(e):G1e(e)},Q7=function(t,e){return t==="v"?K1e(e):Y1e(e)},X1e=function(t,e){return t==="h"&&e==="rtl"?-1:1},Z1e=function(t,e,r,n,a){var i=X1e(t,window.getComputedStyle(e).direction),o=i*n,l=r.target,u=e.contains(l),d=!1,h=o>0,m=0,p=0;do{if(!l)break;var v=Q7(t,l),b=v[0],y=v[1],x=v[2],j=y-x-i*b;(b||j)&&Z7(t,l)&&(m+=j,p+=b);var N=l.parentNode;l=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!u&&l!==document.body||u&&(e.contains(l)||e===l));return(h&&Math.abs(m)<1||!h&&Math.abs(p)<1)&&(d=!0),d},eg=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},tL=function(t){return[t.deltaX,t.deltaY]},rL=function(t){return t&&"current"in t?t.current:t},Q1e=function(t,e){return t[0]===e[0]&&t[1]===e[1]},J1e=function(t){return` 819 .block-interactivity-`.concat(t,` {pointer-events: none;} 820 .allow-interactivity-`).concat(t,` {pointer-events: all;} 821`)},e_e=0,kc=[];function t_e(t){var e=w.useRef([]),r=w.useRef([0,0]),n=w.useRef(),a=w.useState(e_e++)[0],i=w.useState(Y7)[0],o=w.useRef(t);w.useEffect(function(){o.current=t},[t]),w.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var y=eC([t.lockRef.current],(t.shards||[]).map(rL),!0).filter(Boolean);return y.forEach(function(x){return x.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),y.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var l=w.useCallback(function(y,x){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!o.current.allowPinchZoom;var j=eg(y),N=r.current,S="deltaX"in y?y.deltaX:N[0]-j[0],k="deltaY"in y?y.deltaY:N[1]-j[1],C,A=y.target,T=Math.abs(S)>Math.abs(k)?"h":"v";if("touches"in y&&T==="h"&&A.type==="range")return!1;var R=eL(T,A);if(!R)return!0;if(R?C=T:(C=T==="v"?"h":"v",R=eL(T,A)),!R)return!1;if(!n.current&&"changedTouches"in y&&(S||k)&&(n.current=C),!C)return!0;var I=n.current||C;return Z1e(I,x,y,I==="h"?S:k)},[]),u=w.useCallback(function(y){var x=y;if(!(!kc.length||kc[kc.length-1]!==i)){var j="deltaY"in x?tL(x):eg(x),N=e.current.filter(function(C){return C.name===x.type&&(C.target===x.target||x.target===C.shadowParent)&&Q1e(C.delta,j)})[0];if(N&&N.should){x.cancelable&&x.preventDefault();return}
vendor: 6,576 bytes, line 821
821if(!N){var S=(o.current.shards||[]).map(rL).filter(Boolean).filter(function(C){return C.contains(x.target)}),k=S.length>0?l(x,S[0]):!o.current.noIsolation;k&&x.cancelable&&x.preventDefault()}}},[]),d=w.useCallback(function(y,x,j,N){var S={name:y,delta:x,target:j,should:N,shadowParent:r_e(j)};e.current.push(S),setTimeout(function(){e.current=e.current.filter(function(k){return k!==S})},1)},[]),h=w.useCallback(function(y){r.current=eg(y),n.current=void 0},[]),m=w.useCallback(function(y){d(y.type,tL(y),y.target,l(y,t.lockRef.current))},[]),p=w.useCallback(function(y){d(y.type,eg(y),y.target,l(y,t.lockRef.current))},[]);w.useEffect(function(){return kc.push(i),t.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:p}),document.addEventListener("wheel",u,Cc),document.addEventListener("touchmove",u,Cc),document.addEventListener("touchstart",h,Cc),function(){kc=kc.filter(function(y){return y!==i}),document.removeEventListener("wheel",u,Cc),document.removeEventListener("touchmove",u,Cc),document.removeEventListener("touchstart",h,Cc)}},[]);var v=t.removeScrollBar,b=t.inert;return w.createElement(w.Fragment,null,b?w.createElement(i,{styles:J1e(a)}):null,v?w.createElement(q1e,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function r_e(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const n_e=T1e(K7,t_e);var Q0=w.forwardRef(function(t,e){return w.createElement(Z0,xa({},t,{ref:e,sideCar:n_e}))});Q0.classNames=Z0.classNames;var J0="Popover",[J7]=Ca(J0,[dd]),Jh=dd(),[a_e,Mo]=J7(J0),ez=t=>{const{__scopePopover:e,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!1}=t,l=Jh(e),u=w.useRef(null),[d,h]=w.useState(!1),[m,p]=Os({prop:n,defaultProp:a??!1,onChange:i,caller:J0});return s.jsx(oE,{...l,children:s.jsx(a_e,{scope:e,contentId:ns(),triggerRef:u,open:m,onOpenChange:p,onOpenToggle:w.useCallback(()=>p(v=>!v),[p]),hasCustomAnchor:d,onCustomAnchorAdd:w.useCallback(()=>h(!0),[]),onCustomAnchorRemove:w.useCallback(()=>h(!1),[]),modal:o,children:r})})};ez.displayName=J0;var tz="PopoverAnchor",s_e=w.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,a=Mo(tz,r),i=Jh(r),{onCustomAnchorAdd:o,onCustomAnchorRemove:l}=a;return w.useEffect(()=>(o(),()=>l()),[o,l]),s.jsx(Y0,{...i,...n,ref:e})});s_e.displayName=tz;var rz="PopoverTrigger",nz=w.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,a=Mo(rz,r),i=Jh(r),o=Nt(e,a.triggerRef),l=s.jsx(ht.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":lz(a.open),...n,ref:o,onClick:et(t.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:s.jsx(Y0,{asChild:!0,...i,children:l})});nz.displayName=rz;var dE="PopoverPortal",[i_e,o_e]=J7(dE,{forceMount:void 0}),az=t=>{const{__scopePopover:e,forceMount:r,children:n,container:a}=t,i=Mo(dE,e);return s.jsx(i_e,{scope:e,forceMount:r,children:s.jsx(ji,{present:r||i.open,children:s.jsx(X0,{asChild:!0,container:a,children:n})})})};az.displayName=dE;var Du="PopoverContent",sz=w.forwardRef((t,e)=>{const r=o_e(Du,t.__scopePopover),{forceMount:n=r.forceMount,...a}=t,i=Mo(Du,t.__scopePopover);return s.jsx(ji,{present:n||i.open,children:i.modal?s.jsx(c_e,{...a,ref:e}):s.jsx(u_e,{...a,ref:e})})});sz.displayName=Du;var l_e=d1e("PopoverContent.RemoveScroll"),c_e=w.forwardRef((t,e)=>{const r=Mo(Du,t.__scopePopover),n=w.useRef(null),a=Nt(e,n),i=w.useRef(!1);return w.useEffect(()=>{const o=n.current;if(o)return uE(o)},[]),s.jsx(Q0,{as:l_e,allowPinchZoom:!0,children:s.jsx(iz,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:et(t.onCloseAutoFocus,o=>{var l;o.preventDefault(),i.current||(l=r.triggerRef.current)==null||l.focus()}),onPointerDownOutside:et(t.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;i.current=d},{checkForDefaultPrevented:!1}),onFocusOutside:et(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})})}),u_e=w.forwardRef((t,e)=>{const r=Mo(Du,t.__scopePopover),n=w.useRef(!1),a=w.useRef(!1);return s.jsx(iz,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),iz=w.forwardRef((t,e)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:o,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:h,...m}=t,p=Mo(Du,r),v=Jh(r);return Zk(),s.jsx(q0,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Zh,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:h,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onDismiss:()=>p.onOpenChange(!1),children:s.jsx(lE,{"data-state":lz(p.open),role:"dialog",id:p.contentId,...v,...m,ref:e,style:{...m.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),oz="PopoverClose",d_e=w.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,a=Mo(oz,r);return s.jsx(ht.button,{type:"button",...n,ref:e,onClick:et(t.onClick,()=>a.onOpenChange(!1))})});d_e.displayName=oz;var f_e="PopoverArrow",h_e=w.forwardRef((t,e)=>{const{__scopePopover:r,...n}=t,a=Jh(r);return s.jsx(cE,{...a,...n,ref:e})});h_e.displayName=f_e;function lz(t){return t?"open":"closed"}var m_e=ez,p_e=nz,g_e=az,cz=sz;const fE=m_e,hE=p_e,ex=w.forwardRef(({className:t,align:e="center",sideOffset:r=4,...n},a)=>s.jsx(g_e,{children:s.jsx(cz,{ref:a,align:e,sideOffset:r,className:Qe("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
821de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));ex.displayName=cz.displayName;const v_e=()=>{const{conversations:t,loading:e,sendMessage:r,updateStatus:n,markAsRead:a,assignConversation:i}=obe(),{sdrName:o,companyName:l}=Yu(),[u,d]=w.useState(null),[h,m]=w.useState(""),[p,v]=w.useState(!0),[b,y]=w.useState(""),[x,j]=w.useState([]),[N,S]=w.useState(!1),[k,C]=w.useState([]),[A,T]=w.useState(""),[R,I]=w.useState(!1),[D,L]=w.useState(null),[z,H]=w.useState({}),[Z,te]=w.useState({}),G=w.useRef({}),M=t.find(V=>V.id===u),F=w.useRef(null),K=V=>{if(!V||isNaN(V))return"0:00";const J=Math.floor(V/60),oe=Math.floor(V%60);return`${J}:${oe.toString().padStart(2,"0")}`};w.useEffect(()=>{Ge.fetchTagDefinitions().then(j).catch(V=>{console.error("Error loading tags:",V),xe.error("Erro ao carregar tags")}),Ge.fetchTeam().then(C).catch(V=>{console.error("Error loading team members:",V)})},[]),w.useEffect(()=>{const J=new URLSearchParams(window.location.search).get("conversation");J&&t.some(oe=>oe.id===J)?d(J):t.length>0&&!u&&d(t[0].id)},[t,u]),w.useEffect(()=>{u&&((M==null?void 0:M.unreadCount)??0)>0&&a(u)},[u,M==null?void 0:M.unreadCount,a]),w.useEffect(()=>{M&&T(M.notes||"")},[M==null?void 0:M.id]);const B=async()=>{if(!(!M||A===(M.notes||""))){I(!0);try{await Ge.updateContactNotes(M.contactId,A),xe.success("Notas salvas")}catch(V){console.error("Error saving notes:",V),xe.error("Erro ao salvar notas")}finally{I(!1)}}},O=()=>{var V;(V=F.current)==null||V.scrollIntoView({behavior:"smooth"})};w.useEffect(()=>{M&&O()},[M==null?void 0:M.id,u]),w.useEffect(()=>{O()},[M==null?void 0:M.messages]);const W=async V=>{if(!M)return;const J=M.tags||[],oe=J.includes(V)?J.filter(re=>re!==V):[...J,V];try{await Ge.updateContactTags(M.contactId,oe),xe.success("Tag atualizada")}catch(re){console.error("Error updating tag:",re),xe.error("Erro ao atualizar tag")}},q=async V=>{try{const J=await Ge.createTagDefinition(V);j(oe=>[...oe,J]),xe.success("Tag criada com sucesso"),M&&await W(V.key)}catch(J){console.error("Error creating tag:",J),xe.error("Erro ao criar tag")}},se=async V=>{if(V==null||V.preventDefault(),!h.trim()||!M)return;const J=h.trim();m(""),await r(M.id,J)},me=async V=>{M&&await n(M.id,V)},fe=t.filter(V=>{if(!b)return!0;const J=b.toLowerCase();return V.contactName.toLowerCase().includes(J)||V.contactPhone.includes(J)||V.lastMessage.toLowerCase().includes(J)}),Q=V=>{const J={nina:{label:o,icon:Or,color:"bg-violet-500/20 text-violet-400 border-violet-500/30"},human:{label:"Humano",icon:mn,color:"bg-emerald-500/20 text-emerald-400 border-emerald-500/30"},paused:{label:"Pausado",icon:lb,color:"bg-amber-500/20 text-amber-400 border-amber-500/30"}},{label:oe,icon:re,color:Me}=J[V];return s.jsxs("span",{className:`px-2 py-0.5 rounded-md text-[10px] font-medium border flex items-center gap-1 ${Me}`,children:[s.jsx(re,{className:"w-3 h-3"}),oe]})},pe=V=>{if(V.type===Uc.IMAGE)return s.jsx("div",{className:"mb-1 group relative",children:s.jsx("img",{src:V.mediaUrl||V.content,alt:"Anexo",className:"rounded-lg max-w-full h-auto max-h-72 object-cover border border-slate-700/50 shadow-lg",loading:"lazy",onError:J=>{J.target.src="https://placehold.co/300x200/1e293b/cbd5e1?text=Erro+Imagem"}})});if(V.type===Uc.AUDIO){const J=D===V.id,oe=z[V.id]||0,re=Z[V.id]||0,Me=()=>{const ee=G.current[V.id];ee&&(J?(ee.pause(),L(null)):(Object.values(G.current).forEach(ce=>ce.pause()),ee.play(),L(V.id)))};return s.jsxs("div",{className:"flex items-center gap-3 min-w-[220px] py-1",children:[V.mediaUrl&&s.jsx("audio",{ref:ee=>{ee&&(G.current[V.id]=ee)},src:V.mediaUrl,onLoadedMetadata:ee=>{const ce=ee.currentTarget;H(je=>({...je,[V.id]:ce.duration}))},onTimeUpdate:ee=>{const ce=ee.currentTarget;te(je=>({...je,[V.id]:ce.currentTime}))},onEnded:()=>L(null)}),s.jsx("button",{onClick:Me,disabled:!V.mediaUrl,className:`flex items-center justify-center w-9 h-9 rounded-full transition-all shadow-md ${V.direction===ll.OUTGOING?"bg-white text-red-600 hover:bg-red-50 disabled:opacity-50":"bg-red-500 text-white hover:bg-red-400 disabled:opacity-50"}`,children:J?s.jsx(lb,{className:"w-3.5 h-3.5 fill-current"}):s.jsx(j8,{className:"w-3.5 h-3.5 ml-0.5 fill-current"})}),s.jsxs("div",{className:"flex-1 flex flex-col gap-1 justify-center h-9",children:[s.jsx("div",{className:`h-1.5 rounded-full overflow-hidden cursor-pointer ${V.direction===ll.OUTGOING?"bg-white/30":"bg-slate-600"}`,onClick:ee=>{const ce=G.current[V.id];if(!ce||!oe)return;const je=ee.currentTarget.getBoundingClientRect(),de=(ee.clientX-je.left)/je.width;ce.currentTime=de*oe},children:s.jsx("div",{className:`h-full rounded-full transition-all ${V.direction===ll.OUTGOING?"bg-white":"bg-red-400"}`,style:{width:`${oe?re/oe*100:0}%`}})}),s.jsxs("span",{className:`text-[10px] font-medium ${V.direction===ll.OUTGOING?"text-red-100":"text-slate-400"}`,children:[K(re)," / ",K(oe)]})]})]})}return s.jsx("p",{className:"leading-relaxed whitespace-pre-wrap",children:V.content})};return e?s.jsx("div",{className:"flex h-full bg-slate-950 items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsx(gt,{className:"h-8 w-8 animate-spin text-red-500"}),s.jsx("p",{className:"text-sm text-slate-500",children:"Sincronizando conversas..."})]})}):s.jsxs("div",{className:"flex h-full bg-slate-950 rounded-tl-2xl overflow-hidden border-t border-l border-slate-800/50 shadow-2xl",children:[s.jsxs("div",{className:"w-80 lg:w-96 border-r border-slate-800 flex flex-col bg-slate-900/50 backdrop-blur-md z-20 flex-shrink-0",children:[s.jsxs("div",{className:"p-4 border-b border-slate-800/50",children:[s.jsx("h2",{className:"text-lg font-bold text-white mb-4 px-1",children:"Chats Ativos"}),s.jsxs("div",{className:"relative group",children:[s.jsx(Gu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500 group-focus-within:text-red-400 transition-colors"}),s.jsx("input",{type:"text",placeholder:"Buscar conversa...",value:b,onChange:V=>y(V.target.value),className:"w-full pl-9 pr-4 py-2.5 bg-slate-950/50 border border-slate-800 rounded-xl text-sm focus:ring-2 focus:ring-red-500/50 focus:border-red-500/50 outline-none text-slate-200 placeholder:text-slate-600 transition-all"})]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:fe.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-slate-500 p-8 text-center",children:[s.jsx(Tn,{className:"w-12 h-12 mb-4 opacity-50"}),s.jsx("p",{className:"text-sm",children:"Nenhuma conversa encontrada"}),s.jsx("p",{className:"text-xs mt-1 opacity-70",children:"As conversas aparecerão aqui quando receberem mensagens"})]}):fe.map(V=>{var J,oe;return s.jsxs("div",{onClick:()=>d(V.id),className:`flex items-center p-4 cursor-pointer transition-all duration-200 border-b border-slate-800/30 hover:bg-slate-800/50 ${u===V.id?"bg-slate-800/80 border-l-2 border-l-red-500":"border-l-2 border-l-transparent"}`,children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-12 h-12 rounded-full p-0.5 bg-gradient-to-tr from-slate-700 to-slate-900",children:s.jsx("img",{src:V.contactAvatar,alt:V.contactName,className:"w-full h-full rounded-full object-cover border border-slate-800"})}),V.unreadCount>0?s.jsx("span",{className:"absolute bottom-0 right-0 w-3.5 h-3.5 bg-red-500 border-2 border-slate-900 rounded-full animate-pulse"}):s.jsx("span",{className:"absolute bottom-0 right-0 w-3.5 h-3.5 bg-slate-600 border-2 border-slate-900 rounded-full"})]}),s.jsxs("div",{className:"ml-3 flex-1 min-w-0",children:[s.jsxs("div",{className:"flex justify-between items-baseline mb-1",children:[s.jsx("h3",{className:`text-sm font-semibold truncate ${u===V.id?"text-white":"text-slate-300"}`,children:V.contactName}),s.jsx("span",{className:"text-[10px] text-slate-500 font-medium",children:V.lastMessageTime})]}),s.jsx("p",{className:"text-xs text-slate-500 truncate",children:((J=V.messages[V.messages.length-1])==null?void 0:J.type)===Uc.IMAGE?"ð· Imagem":((oe=V.messages[V.messages.length-1])==null?void 0:oe.type)===Uc.AU
821DIO?"ðµ Ãudio":V.lastMessage||"Sem mensagens"}),s.jsxs("div",{className:"flex items-center mt-2 gap-1.5",children:[Q(V.status),V.tags.slice(0,1).map(re=>s.jsx("span",{className:"px-2 py-0.5 bg-slate-800/80 border border-slate-700 text-slate-400 text-[10px] rounded-md font-medium",children:re},re)),V.unreadCount>0&&s.jsx("span",{className:"ml-auto bg-gradient-to-r from-red-600 to-rose-600 text-white text-[10px] font-bold px-1.5 h-4 min-w-[1rem] flex items-center justify-center rounded-full shadow-lg shadow-red-500/20",children:V.unreadCount})]})]})]},V.id)})})]}),M?s.jsxs("div",{className:"flex-1 flex overflow-hidden bg-[#0B0E14]",children:[s.jsxs("div",{className:"flex-1 flex flex-col min-w-0 relative",children:[s.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#ffffff 1px, transparent 1px)",backgroundSize:"30px 30px"}}),s.jsxs("div",{className:"h-16 px-6 flex items-center justify-between bg-slate-900/80 backdrop-blur-md border-b border-slate-800 z-10 shrink-0",children:[s.jsxs("div",{className:"flex items-center cursor-pointer hover:bg-slate-800/50 p-1.5 -ml-1.5 rounded-lg transition-colors pr-3",onClick:()=>v(!p),children:[s.jsxs("div",{className:"relative",children:[s.jsx("img",{src:M.contactAvatar,alt:M.contactName,className:"w-9 h-9 rounded-full ring-2 ring-slate-800"}),s.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 bg-emerald-500 border-2 border-slate-900 rounded-full"})]}),s.jsxs("div",{className:"ml-3",children:[s.jsxs("h2",{className:"text-sm font-bold text-slate-100 flex items-center gap-2",children:[M.contactName,Q(M.status)]}),s.jsx("p",{className:"text-xs text-red-500 font-medium",children:M.contactPhone})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ne,{variant:"ghost",size:"icon",className:`text-slate-400 hover:text-white ${M.status==="nina"?"bg-violet-500/20 text-violet-400":""}`,onClick:()=>me("nina"),title:`Ativar ${o} (IA)`,children:s.jsx(Or,{className:"w-5 h-5"})}),s.jsx(Ne,{variant:"ghost",size:"icon",className:`text-slate-400 hover:text-white ${M.status==="human"?"bg-emerald-500/20 text-emerald-400":""}`,onClick:()=>me("human"),title:"Assumir conversa",children:s.jsx(mn,{className:"w-5 h-5"})}),s.jsx(Ne,{variant:"ghost",size:"icon",className:`text-slate-400 hover:text-white ${M.status==="paused"?"bg-amber-500/20 text-amber-400":""}`,onClick:()=>me("paused"),title:"Pausar conversa",children:s.jsx(lb,{className:"w-5 h-5"})}),s.jsx("div",{className:"h-6 w-px bg-slate-800 mx-1"}),s.jsx(Ne,{variant:"ghost",size:"icon",className:`text-slate-400 hover:text-white ${p?"bg-slate-800 text-red-400":""}`,onClick:()=>v(!p),title:"Ver Informações",children:s.jsx(Js,{className:"w-5 h-5"})}),s.jsx(Ne,{variant:"ghost",size:"icon",disabled:!0,title:"Em breve: Mais opções",className:"text-slate-500 cursor-not-allowed opacity-50",children:s.jsx(iY,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6 custom-scrollbar relative z-0",children:[M.messages.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-slate-500",children:[s.jsx(Tn,{className:"w-16 h-16 mb-4 opacity-30"}),s.jsx("p",{className:"text-sm",children:"Nenhuma mensagem ainda"}),s.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Envie uma mensagem para iniciar a conversa"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex justify-center my-6",children:s.jsx("span",{className:"px-4 py-1.5 bg-slate-800/80 border border-slate-700 text-slate-400 text-xs font-medium rounded-full shadow-sm backdrop-blur-sm",children:"Hoje"})}),M.messages.map(V=>{const J=V.direction===ll.OUTGOING;return s.jsx("div",{className:`flex ${J?"justify-end":"justify-start"} group animate-in fade-in slide-in-from-bottom-2 duration-300`,children:s.jsxs("div",{className:`flex flex-col max-w-[75%] ${J?"items-end":"items-start"}`,children:[s.jsx("div",{className:`px-5 py-3 rounded-2xl shadow-md relative text-sm leading-relaxed ${J?V.fromType==="nina"?"bg-gradient-to-br from-violet-600 to-purple-700 text-white rounded-tr-sm shadow-violet-900/20":"bg-gradient-to-br from-red-600 to-rose-700 text-white rounded-tr-sm shadow-red-900/20":"bg-slate-800 text-slate-200 rounded-tl-sm border border-slate-700/50"}`,children:pe(V)}),s.jsxs("div",{className:"flex items-center mt-1.5 gap-1.5 opacity-60 group-hover:opacity-100 transition-opacity px-1",children:[J&&V.fromType==="nina"&&s.jsx(Or,{className:"w-3 h-3 text-violet-400"}),J&&V.fromType==="human"&&s.jsx(mn,{className:"w-3 h-3 text-red-400"}),s.jsx("span",{className:"text-[10px] text-slate-500 font-medium",children:V.timestamp}),J&&(V.status==="read"?s.jsx(YT,{className:"w-3.5 h-3.5 text-red-500"}):V.status==="delivered"?s.jsx(YT,{className:"w-3.5 h-3.5 text-slate-500"}):s.jsx(ci,{className:"w-3.5 h-3.5 text-slate-500"}))]})]})},V.id)})]}),s.jsx("div",{ref:F})]}),s.jsx("div",{className:"p-4 bg-slate-900/90 border-t border-slate-800 backdrop-blur-sm z-10",children:s.jsxs("form",{onSubmit:se,className:"flex items-end gap-3 max-w-4xl mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(Ne,{type:"button",variant:"ghost",size:"icon",disabled:!0,title:"Em breve: Emoji picker",className:"text-slate-500 rounded-full cursor-not-allowed opacity-50",children:s.jsx(kY,{className:"w-5 h-5"})}),s.jsx(Ne,{type:"button",variant:"ghost",size:"icon",disabled:!0,title:"Em breve: Enviar anexos",className:"text-slate-500 rounded-full cursor-not-allowed opacity-50",children:s.jsx(_8,{className:"w-5 h-5"})})]}),s.jsx("div",{className:"flex-1 bg-slate-950 rounded-2xl border border-slate-800 focus-within:ring-2 focus-within:ring-red-500/30 focus-within:border-red-500/50 transition-all shadow-inner",children:s.jsx("textarea",{value:h,onChange:V=>m(V.target.value),onKeyDown:V=>{V.key==="Enter"&&!V.shiftKey&&(V.preventDefault(),se())},placeholder:M.status==="nina"?`${o} está respondendo automaticamente...`:"Digite sua mensagem...",className:"w-full bg-transparent border-none p-3.5 max-h-32 min-h-[48px] text-sm text-slate-200 focus:ring-0 resize-none outline-none placeholder:text-slate-600",rows:1})}),s.jsx(Ne,{type:"submit",disabled:!h.trim(),className:`rounded-full w-12 h-12 p-0 transition-all ${h.trim()?"shadow-lg shadow-red-500/20 hover:scale-105 active:scale-95":"opacity-50 cursor-not-allowed"}`,children:s.jsx(ou,{className:"w-5 h-5 ml-0.5"})})]})})]}),s.jsx("div",{className:`${p?"w-80 border-l border-slate-800 opacity-100":"w-0 opacity-0 border-none"} transition-all duration-300 ease-in-out bg-slate-900/95 flex-shrink-0 flex flex-col overflow-hidden`,children:s.jsxs("div",{className:"w-80 h-full flex flex-col",children:[s.jsxs("div",{className:"h-16 flex items-center justify-between px-6 border-b border-slate-800 flex-shrink-0",children:[s.jsx("span",{className:"font-semibold text-white",children:"Informações do Lead"}),s.jsx("button",{onClick:()=>v(!1),className:"p-1.5 rounded-lg hover:bg-slate-800 text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 space-y-8",children:[s.jsxs("div",{className:"flex flex-col items-center text-center",children:[s.jsx("div",{className:"w-24 h-24 rounded-full p-1 bg-gradient-to-tr from-red-500 to-rose-600 shadow-xl mb-4",children:s.jsx("img",{src:M.contactAvatar,alt:M.contactName,className:"w-full h-full rounded-full object-cover border-2 border-slate-900"})}),s.jsx("h3",{className:"text-xl font-bold text-white mb-1",children:M.contactName}),s.jsx("p",{className:"text-sm text-slate-400 mb-4",children:M.clientMemory.lead_profile.lead_stage==="new"?"Novo Lead":M.clientMemory.lead_profile.lead_stage==="qualified"?"Lead Qualificado":M.clientMemory.lead_profile.lead_stage})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider",children:"Dados de Contato"}),s.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-800 flex items-center justify-center flex-shrink-0 text-slate-400",children:s.jsx(Hu,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"Telefone"}),s.jsx("span",{className:"text-slate-200 font-medium",children:M.contactPhone})]})]}),M.contactEmail&&s.jsxs("div",{className:"flex items-center gap-3 text-sm",children:[s.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-800 flex items-center justify-center flex-shrink-0 text-slate-400",children:s.jsx(iu,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"Email"}),s.jsx("span",{className:"text-slate-200 font-medium",children:M.contactEmail})]})]})]}),s.jsx("div",{className:"h-px bg-slate-800/50 w-full"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider flex items-center gap-2",children:[s.jsx(d8,{className:"w-4 h-4"}),"Memória do(a) ",o]}),M.clientMemory.lead_profile.interests.length>0&&s.jsxs("div",{className:"p-3 rounded-lg bg-slate-800/50 border border-slate-700/50",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Interesses"}),s.jsx("p",{className:"text-sm text-slate-200 mt-1",children:M.clientMemory.lead_profile.interests.join(", ")})]}),M.clientMemory.sales_intelligence.pain_points.length>0&&s.jsxs("div",{className:"p-3 rounded-lg bg-slate-800/50 border border-slate-700/50",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Dores Identificadas"}),s.jsx("p",{className:"text-sm text-slate-200 mt-1",children:M.clientMemory.sales_intelligence.pain_points.join(", ")})]}),s.jsxs("div",{className:"p-3 rounded-lg bg-slate-800/50 border border-slate-700/50",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Próxima Ação Sugerida"}),s.jsx("p",{className:"text-sm text-slate-200 mt-1",children:M.clientMemory.sales_intelligence.next_best_action==="qualify"?"Qualificar lead":M.clientMemory.sales_intelligence.next_best_action==="demo"?"Agendar demonstração":M.clientMemory.sales_intelligence.next_best_action})]}),s.jsxs("div",{className:"text-xs text-slate-500 text-center",children:["Total de conversas: ",M.clientMemory.interaction_summary.total_conversations]})]}),s.jsx("div",{className:"h-px bg-slate-800/50 w-full"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider flex items-center gap-2",children:[s.jsx(mn,{className:"w-4 h-4"}),"Responsável"]}),s.jsxs("select",{value:M.assignedUserId||"",onChange:V=>{const J=V.target.value||null;i(M.id,J),xe.success("Conversa atribuÃda. Deal atualizado automaticamente.")},className:"w-full bg-slate-950/50 border border-slate-800 rounded-lg p-3 text-sm text-slate-300 focus:ring-1 focus:ring-red-500/50 focus:border-red-500/50 outline-none transition-all",children:[s.jsx("option",{value:"",children:"Não atribuÃdo"}),k.map(V=>
821s.jsxs("option",{value:V.id,children:[V.name," (",V.role,")"]},V.id))]})]}),s.jsx("div",{className:"h-px bg-slate-800/50 w-full"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider flex items-center justify-between",children:["Tags",s.jsxs(fE,{open:N,onOpenChange:S,children:[s.jsx(hE,{asChild:!0,children:s.jsx("button",{className:"text-red-500 hover:text-red-400 transition-colors",children:s.jsx(ts,{className:"w-4 h-4"})})}),s.jsx(ex,{className:"w-72 p-0 bg-slate-900 border-slate-700",align:"end",children:s.jsx(pbe,{availableTags:x,selectedTags:M.tags||[],onToggleTag:W,onCreateTag:q})})]})]}),s.jsx("div",{className:"flex flex-wrap gap-2",children:M.tags&&M.tags.length>0?M.tags.map(V=>{const J=x.find(oe=>oe.key===V);return s.jsxs("span",{style:{backgroundColor:J!=null&&J.color?`${J.color}20`:"rgba(59, 130, 246, 0.2)",borderColor:(J==null?void 0:J.color)||"#3b82f6"},className:"px-2.5 py-1 rounded-md border text-xs font-medium flex items-center gap-1.5 group hover:brightness-110 transition-all",children:[s.jsx("span",{className:"text-slate-200",children:(J==null?void 0:J.label)||V}),s.jsx("button",{onClick:()=>W(V),className:"opacity-0 group-hover:opacity-100 transition-opacity",children:s.jsx(Xn,{className:"w-3 h-3 text-slate-400 hover:text-slate-200"})})]},V)}):s.jsx("p",{className:"text-xs text-slate-500 italic",children:"Nenhuma tag adicionada"})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider flex items-center gap-2",children:["Notas Internas",R&&s.jsx(gt,{className:"w-3 h-3 animate-spin text-red-500"})]}),s.jsx("textarea",{className:"w-full bg-slate-950/50 border border-slate-800 rounded-lg p-3 text-sm text-slate-300 placeholder:text-slate-600 focus:ring-1 focus:ring-red-500/50 focus:border-red-500/50 outline-none resize-none transition-all",rows:4,placeholder:"Adicione observações sobre este lead...",value:A,onChange:V=>T(V.target.value),onBlur:B})]})]})]})})]}):s.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center bg-[#0B0E14] relative overflow-hidden",children:[s.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-slate-900/20 to-transparent"}),s.jsxs("div",{className:"relative z-10 flex flex-col items-center p-8 text-center max-w-md",children:[s.jsxs("div",{className:"w-24 h-24 bg-slate-900 rounded-full flex items-center justify-center mb-6 shadow-2xl border border-slate-800 relative group",children:[s.jsx("div",{className:"absolute inset-0 bg-red-500/20 rounded-full blur-xl group-hover:bg-red-500/30 transition-all duration-1000"}),s.jsx(Tn,{className:"w-10 h-10 text-red-500"})]}),s.jsxs("h2",{className:"text-2xl font-bold text-white mb-2",children:[l," Workspace"]}),s.jsx("p",{className:"text-slate-400 text-sm leading-relaxed",children:t.length===0?"Aguardando novas conversas. Configure o webhook do WhatsApp para começar a receber mensagens.":"Selecione uma conversa ao lado para iniciar o atendimento inteligente."}),s.jsxs("div",{className:"mt-8 flex gap-3 text-xs text-slate-500 font-mono bg-slate-900/50 px-4 py-2 rounded-lg border border-slate-800/50",children:[s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse"}),o," Online"]}),s.jsx("span",{className:"w-px h-4 bg-slate-800"}),s.jsxs("span",{children:[t.length," conversas"]})]})]})]})]})},x_e=()=>{const[t,e]=w.useState([]),[r,n]=w.useState(!0),[a,i]=w.useState(""),o=Wu();w.useEffect(()=>{(async()=>{try{const m=await Ge.fetchContacts();e(m)}catch(m){console.error("Erro ao carregar contatos",m)}finally{n(!1)}})()},[]);const l=t.filter(h=>{var p,v;const m=a.toLowerCase();return(((p=h.name)==null?void 0:p.toLowerCase())||"").includes(m)||(h.phone||"").includes(m)||(((v=h.email)==null?void 0:v.toLowerCase())||"").includes(m)}),u=h=>{switch(h){case"customer":return"bg-emerald-500/10 text-emerald-400 border-emerald-500/20";case"lead":return"bg-red-500/10 text-red-400 border-red-500/20";case"churned":return"bg-slate-800 text-slate-400 border-slate-700";default:return"bg-slate-800 text-slate-400"}},d=h=>{o(`/chat?contact=${encodeURIComponent(h.phone)}`)};return s.jsxs("div",{className:"p-8 h-full overflow-y-auto bg-slate-950 text-slate-50",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 gap-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-bold tracking-tight text-white",children:"Contatos"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Gerencie sua base de leads e clientes com inteligência."})]}),s.jsxs(Ne,{className:"shadow-lg shadow-red-500/20 opacity-50 cursor-not-allowed",disabled:!0,title:"Em breve: Adicionar contato",children:[s.jsx(bg,{className:"w-4 h-4 mr-2"}),"Novo Contato"]})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 mb-8 bg-slate-900/50 p-2 rounded-xl border border-slate-800",children:[s.jsxs("div",{className:"relative flex-1 w-full",children:[s.jsx(Gu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500"}),s.jsx("input",{type:"text",placeholder:"Buscar por nome, email ou telefone",value:a,onChange:h=>i(h.target.value),className:"w-full pl-9 pr-4 py-2.5 rounded-lg bg-slate-950 border border-slate-800 text-sm text-slate-200 focus:outline-none focus:ring-2 focus:ring-red-500/50 focus:border-red-500/50 placeholder:text-slate-600 transition-all"})]}),s.jsxs(Ne,{variant:"outline",className:"w-full sm:w-auto bg-slate-950 border-slate-800 text-slate-500 cursor-not-allowed opacity-50",disabled:!0,title:"Em breve: Filtros avançados",children:[s.jsx(oY,{className:"w-4 h-4 mr-2"}),"Filtros Avançados"]})]}),s.jsx("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/40 backdrop-blur-sm shadow-xl overflow-hidden min-h-[400px]",children:r?s.jsxs("div",{className:"flex flex-col items-center justify-center h-80",children:[s.jsx(gt,{className:"h-10 w-10 animate-spin text-red-500 mb-3"}),s.jsx("span",{className:"text-sm text-slate-400 animate-pulse",children:"Carregando base de dados..."})]}):l.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center h-80 text-slate-400",children:[s.jsx(fo,{className:"w-12 h-12 mb-4 opacity-50"}),s.jsx("p",{className:"text-lg font-medium",children:"Nenhum contato encontrado"}),s.jsx("p",{className:"text-sm text-slate-500 mt-1",children:a?"Tente buscar por outro termo":"Os contatos aparecerão aqui"})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm text-left",children:[s.jsx("thead",{className:"bg-slate-900/80 text-slate-400 border-b border-slate-800 font-medium text-xs uppercase tracking-wider",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-6 py-4",children:"Nome / Telefone"}),s.jsx("th",{className:"px-6 py-4",children:"Status"}),s.jsx("th",{className:"px-6 py-4",children:"Canais"}),s.jsx("th",{className:"px-6 py-4",children:"Ãltima Interação"}),s.jsx("th",{className:"px-6 py-4 text-right",children:"Ações"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/50",children:l.map(h=>s.jsxs("tr",{className:"hover:bg-slate-800/40 transition-colors group",children:[s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-gradient-to-br from-slate-700 to-slate-800 border border-slate-700 flex items-center justify-center text-sm font-bold text-red-400 shadow-inner",children:(h.name||h.phone||"?").substring(0,2).toUpperCase()}),s.jsxs("div",{children:[s.jsx("div",{className:"font-semibold text-slate-200 group-hover:text-red-400 transition-colors",children:h.name||"Sem nome"}),s.jsx("div",{className:"text-xs text-slate-500",children:h.phone})]})]})}),s.jsx("td",{className:"px-6 py-4",children:s.jsx("span",{className:`px-2.5 py-1 rounded-md text-xs font-semibold border ${u(h.status)}`,children:h.status==="customer"?"Cliente Ativo":h.status==="lead"?"Lead Qualificado":"Churned"})}),s.jsx("td",{className:"px-6 py-4",children:s.jsxs("div",{className:"flex flex-col gap-1",children:[h.email&&s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs",children:[s.jsx(iu,{className:"w-3.5 h-3.5"}),h.email]}),s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-xs",children:[s.jsx(Hu,{className:"w-3.5 h-3.5"}),h.phone]})]})}),s.jsxs("td",{className:"px-6 py-4",children:[s.jsx("span",{className:"text-slate-400",children:new Date(h.lastContact).toLocaleDateString("pt-BR")}),s.jsx("div",{className:"text-[10px] text-slate-600",children:"via WhatsApp"})]}),s.jsx("td",{className:"px-6 py-4 text-right",children:s.jsxs("div",{className:"flex items-center justify-end gap-2 opacity-0 group-hover:opacity-100 transition-all transform translate-x-2 group-hover:translate-x-0",children:[s.jsx(Ne,{size:"sm",variant:"primary",className:"h-8 w-8 p-0 rounded-lg shadow-none",title:"Iniciar Conversa",onClick:()=>d(h),children:s.jsx(Tn,{className:"w-4 h-4"})}),s.jsx(Ne,{size:"sm",variant:"ghost",className:"h-8 w-8 p-0 rounded-lg text-slate-500 cursor-not-allowed opacity-50",disabled:!0,title:"Em breve: Mais opções",children:s.jsx(x8,{className:"w-4 h-4"})})]})})]}
vendor: 4,121 bytes, line 821
821,h.id))})]})})})]})};function nL(t){const e=y_e(t),r=w.forwardRef((n,a)=>{const{children:i,...o}=n,l=w.Children.toArray(i),u=l.find(w_e);if(u){const d=u.props.children,h=l.map(m=>m===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:m);return s.jsx(e,{...o,ref:a,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function y_e(t){const e=w.forwardRef((r,n)=>{const{children:a,...i}=r;if(w.isValidElement(a)){const o=j_e(a),l=__e(i,a.props);return a.type!==w.Fragment&&(l.ref=n?Gl(n,o):o),w.cloneElement(a,l)}return w.Children.count(a)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var b_e=Symbol("radix.slottable");function w_e(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===b_e}function __e(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const u=i(...l);return a(...l),u}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function j_e(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}function mE(t){const e=t+"CollectionProvider",[r,n]=Ca(e),[a,i]=r(e,{collectionRef:{current:null},itemMap:new Map}),o=y=>{const{scope:x,children:j}=y,N=U.useRef(null),S=U.useRef(new Map).current;return s.jsx(a,{scope:x,itemMap:S,collectionRef:N,children:j})};o.displayName=e;const l=t+"CollectionSlot",u=nL(l),d=U.forwardRef((y,x)=>{const{scope:j,children:N}=y,S=i(l,j),k=Nt(x,S.collectionRef);return s.jsx(u,{ref:k,children:N})});d.displayName=l;const h=t+"CollectionItemSlot",m="data-radix-collection-item",p=nL(h),v=U.forwardRef((y,x)=>{const{scope:j,children:N,...S}=y,k=U.useRef(null),C=Nt(x,k),A=i(h,j);return U.useEffect(()=>(A.itemMap.set(k,{ref:k,...S}),()=>void A.itemMap.delete(k))),s.jsx(p,{[m]:"",ref:C,children:N})});v.displayName=h;function b(y){const x=i(t+"CollectionConsumer",y);return U.useCallback(()=>{const N=x.collectionRef.current;if(!N)return[];const S=Array.from(N.querySelectorAll(`[${m}]`));return Array.from(x.itemMap.values()).sort((A,T)=>S.indexOf(A.ref.current)-S.indexOf(T.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},b,n]}var N_e=w.createContext(void 0);function tx(t){const e=w.useContext(N_e);return t||e||"ltr"}var Hj="rovingFocusGroup.onEntryFocus",S_e={bubbles:!1,cancelable:!0},em="RovingFocusGroup",[x2,uz,C_e]=mE(em),[k_e,dz]=Ca(em,[C_e]),[E_e,A_e]=k_e(em),fz=w.forwardRef((t,e)=>s.jsx(x2.Provider,{scope:t.__scopeRovingFocusGroup,children:s.jsx(x2.Slot,{scope:t.__scopeRovingFocusGroup,children:s.jsx(P_e,{...t,ref:e})})}));fz.displayName=em;var P_e=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:a=!1,dir:i,currentTabStopId:o,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:h=!1,...m}=t,p=w.useRef(null),v=Nt(e,p),b=tx(i),[y,x]=Os({prop:o,defaultProp:l??null,onChange:u,caller:em}),[j,N]=w.useState(!1),S=po(d),k=uz(r),C=w.useRef(!1),[A,T]=w.useState(0);return w.useEffect(()=>{const R=p.current;if(R)return R.addEventListener(Hj,S),()=>R.removeEventListener(Hj,S)},[S]),s.jsx(E_e,{scope:r,orientation:n,dir:b,loop:a,currentTabStopId:y,onItemFocus:w.useCallback(R=>x(R),[x]),onItemShiftTab:w.useCallback(()=>N(!0),[]),onFocusableItemAdd:w.useCallback(()=>T(R=>R+1),[]),onFocusableItemRemove:w.useCallback(()=>T(R=>R-1),[]),children:s.jsx(ht.div,{tabIndex:j||A===0?-1:0,"data-orientation":n,...m,ref:v,style:{outline:"none",...t.style},onMouseDown:et(t.onMouseDown,()=>{C.current=!0}),onFocus:et(t.onFocus,R=>{const I=!C.current;if(R.target===R.currentTarget&&I&&!j){const D=new CustomEvent(Hj,S_e);if(R.currentTarget.dispatchEvent(D),!D.defaultPrevented){const L=k().filter(G=>G.focusable),z=L.find(G=>G.active),H=L.find(G=>
vendor: 6,070 bytes, line 821
821G.id===y),te=[z,H,...L].filter(Boolean).map(G=>G.ref.current);pz(te,h)}}C.current=!1}),onBlur:et(t.onBlur,()=>N(!1))})})}),hz="RovingFocusGroupItem",mz=w.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:a=!1,tabStopId:i,children:o,...l}=t,u=ns(),d=i||u,h=A_e(hz,r),m=h.currentTabStopId===d,p=uz(r),{onFocusableItemAdd:v,onFocusableItemRemove:b,currentTabStopId:y}=h;return w.useEffect(()=>{if(n)return v(),()=>b()},[n,v,b]),s.jsx(x2.ItemSlot,{scope:r,id:d,focusable:n,active:a,children:s.jsx(ht.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...l,ref:e,onMouseDown:et(t.onMouseDown,x=>{n?h.onItemFocus(d):x.preventDefault()}),onFocus:et(t.onFocus,()=>h.onItemFocus(d)),onKeyDown:et(t.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){h.onItemShiftTab();return}if(x.target!==x.currentTarget)return;const j=M_e(x,h.orientation,h.dir);if(j!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=p().filter(k=>k.focusable).map(k=>k.ref.current);if(j==="last")S.reverse();else if(j==="prev"||j==="next"){j==="prev"&&S.reverse();const k=S.indexOf(x.currentTarget);S=h.loop?R_e(S,k+1):S.slice(k+1)}setTimeout(()=>pz(S))}}),children:typeof o=="function"?o({isCurrentTabStop:m,hasTabStop:y!=null}):o})})});mz.displayName=hz;var T_e={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function O_e(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function M_e(t,e,r){const n=O_e(t.key,r);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return T_e[n]}function pz(t,e=!1){const r=document.activeElement;for(const n of t)if(n===r||(n.focus({preventScroll:e}),document.activeElement!==r))return}function R_e(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var I_e=fz,D_e=mz,rx="Tabs",[$_e]=Ca(rx,[dz]),gz=dz(),[L_e,pE]=$_e(rx),vz=w.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:i,orientation:o="horizontal",dir:l,activationMode:u="automatic",...d}=t,h=tx(l),[m,p]=Os({prop:n,onChange:a,defaultProp:i??"",caller:rx});return s.jsx(L_e,{scope:r,baseId:ns(),value:m,onValueChange:p,orientation:o,dir:h,activationMode:u,children:s.jsx(ht.div,{dir:h,"data-orientation":o,...d,ref:e})})});vz.displayName=rx;var xz="TabsList",yz=w.forwardRef((t,e)=>{const{__scopeTabs:r,loop:n=!0,...a}=t,i=pE(xz,r),o=gz(r);return s.jsx(I_e,{asChild:!0,...o,orientation:i.orientation,dir:i.dir,loop:n,children:s.jsx(ht.div,{role:"tablist","aria-orientation":i.orientation,...a,ref:e})})});yz.displayName=xz;var bz="TabsTrigger",wz=w.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,disabled:a=!1,...i}=t,o=pE(bz,r),l=gz(r),u=Nz(o.baseId,n),d=Sz(o.baseId,n),h=n===o.value;return s.jsx(D_e,{asChild:!0,...l,focusable:!a,active:h,children:s.jsx(ht.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":d,"data-state":h?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:u,...i,ref:e,onMouseDown:et(t.onMouseDown,m=>{!a&&m.button===0&&m.ctrlKey===!1?o.onValueChange(n):m.preventDefault()}),onKeyDown:et(t.onKeyDown,m=>{[" ","Enter"].includes(m.key)&&o.onValueChange(n)}),onFocus:et(t.onFocus,()=>{const m=o.activationMode!=="manual";!h&&!a&&m&&o.onValueChange(n)})})})});wz.displayName=bz;var _z="TabsContent",jz=w.forwardRef((t,e)=>{const{__scopeTabs:r,value:n,forceMount:a,children:i,...o}=t,l=pE(_z,r),u=Nz(l.baseId,n),d=Sz(l.baseId,n),h=n===l.value,m=w.useRef(h);return w.useEffect(()=>{const p=requestAnimationFrame(()=>m.current=!1);return()=>cancelAnimationFrame(p)},[]),s.jsx(ji,{present:a||h,children:({present:p})=>s.jsx(ht.div,{"data-state":h?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":u,hidden:!p,id:d,tabIndex:0,...o,ref:e,style:{...t.style,animationDuration:m.current?"0s":void 0},children:p&&i})})});jz.displayName=_z;function Nz(t,e){return`${t}-trigger-${e}`}function Sz(t,e){return`${t}-content-${e}`}var F_e=vz,Cz=yz,kz=wz,Ez=jz;const Az=F_e,gE=w.forwardRef(({className:t,...e},r)=>s.jsx(Cz,{ref:r,className:Qe("inline-flex h-11 items-center justify-center rounded-lg bg-slate-900 p-1 text-slate-400 border border-slate-800",t),...e}));gE.displayName=Cz.displayName;const eu=w.forwardRef(({className:t,...e},r)=>s.jsx(kz,{ref:r,className:Qe("inline-flex items-center justify-center whitespace-nowrap rounded-md px-4 py-2 text-sm font-medium ring-offset-slate-950 transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-500 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-slate-950 data-[state=active]:text-cyan-400 data-[state=active]:shadow-sm",t),...e}));eu.displayName=kz.displayName;const tu=w.forwardRef(({className:t,...e},r)=>s.jsx(Ez,{ref:r,className:Qe("mt-6 ring-offset-slate-950 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-cyan-500 focus-visible:ring-offset-2",t),...e}));tu.displayName=Ez.displayName;function B_e(t){const e=V_e(t),r=w.forwardRef((n,a)=>{const{children:i,...o}=n,l=w.Children.toArray(i),u=l.find(U_e);if(u){const d=u.props.children,h=l.map(m=>m===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:m);return s.jsx(e,{...o,ref:a,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function V_e(t){const e=w.forwardRef((r,n)=>{const{children:a,...i}=r;if(w.isValidElement(a)){const o=W_e(a),l=q_e(i,a.props);return a.type!==w.Fragment&&(l.ref=n?Gl(n,o):o),w.cloneElement(a,l)}return w.Children.count(a)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var z_e=Symbol("radix.slottable");function U_e(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===z_e}function q_e(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const u=i(...l);return a(...l),u}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}
vendor: 6,714 bytes, lines 821-825
821:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function W_e(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var nx="Dialog",[Pz,Tz]=Ca(nx),[H_e,cs]=Pz(nx),Oz=t=>{const{__scopeDialog:e,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=t,l=w.useRef(null),u=w.useRef(null),[d,h]=Os({prop:n,defaultProp:a??!1,onChange:i,caller:nx});return s.jsx(H_e,{scope:e,triggerRef:l,contentRef:u,contentId:ns(),titleId:ns(),descriptionId:ns(),open:d,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(m=>!m),[h]),modal:o,children:r})};Oz.displayName=nx;var Mz="DialogTrigger",Rz=w.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=cs(Mz,r),i=Nt(e,a.triggerRef);return s.jsx(ht.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":yE(a.open),...n,ref:i,onClick:et(t.onClick,a.onOpenToggle)})});Rz.displayName=Mz;var vE="DialogPortal",[G_e,Iz]=Pz(vE,{forceMount:void 0}),Dz=t=>{const{__scopeDialog:e,forceMount:r,children:n,container:a}=t,i=cs(vE,e);return s.jsx(G_e,{scope:e,forceMount:r,children:w.Children.map(n,o=>s.jsx(ji,{present:r||i.open,children:s.jsx(X0,{asChild:!0,container:a,children:o})}))})};Dz.displayName=vE;var Rv="DialogOverlay",$z=w.forwardRef((t,e)=>{const r=Iz(Rv,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=cs(Rv,t.__scopeDialog);return i.modal?s.jsx(ji,{present:n||i.open,children:s.jsx(Y_e,{...a,ref:e})}):null});$z.displayName=Rv;var K_e=B_e("DialogOverlay.RemoveScroll"),Y_e=w.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=cs(Rv,r);return s.jsx(Q0,{as:K_e,allowPinchZoom:!0,shards:[a.contentRef],children:s.jsx(ht.div,{"data-state":yE(a.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),Pl="DialogContent",Lz=w.forwardRef((t,e)=>{const r=Iz(Pl,t.__scopeDialog),{forceMount:n=r.forceMount,...a}=t,i=cs(Pl,t.__scopeDialog);return s.jsx(ji,{present:n||i.open,children:i.modal?s.jsx(X_e,{...a,ref:e}):s.jsx(Z_e,{...a,ref:e})})});Lz.displayName=Pl;var X_e=w.forwardRef((t,e)=>{const r=cs(Pl,t.__scopeDialog),n=w.useRef(null),a=Nt(e,r.contentRef,n);return w.useEffect(()=>{const i=n.current;if(i)return uE(i)},[]),s.jsx(Fz,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:et(t.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:et(t.onPointerDownOutside,i=>{const o=i.detail.originalEvent,l=o.button===0&&o.ctrlKey===!0;(o.button===2||l)&&i.preventDefault()}),onFocusOutside:et(t.onFocusOutside,i=>i.preventDefault())})}),Z_e=w.forwardRef((t,e)=>{const r=cs(Pl,t.__scopeDialog),n=w.useRef(!1),a=w.useRef(!1);return s.jsx(Fz,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,l;(o=t.onCloseAutoFocus)==null||o.call(t,i),i.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var u,d;(u=t.onInteractOutside)==null||u.call(t,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((d=r.triggerRef.current)==null?void 0:d.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),Fz=w.forwardRef((t,e)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=t,l=cs(Pl,r),u=w.useRef(null),d=Nt(e,u);return Zk(),s.jsxs(s.Fragment,{children:[s.jsx(q0,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:s.jsx(Zh,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":yE(l.open),...o,ref:d,onDismiss:()=>l.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(J_e,{titleId:l.titleId}),s.jsx(tje,{contentRef:u,descriptionId:l.descriptionId})]})]})}),xE="DialogTitle",Bz=w.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=cs(xE,r);return s.jsx(ht.h2,{id:a.titleId,...n,ref:e})});Bz.displayName=xE;var Vz="DialogDescription",zz=w.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=cs(Vz,r);return s.jsx(ht.p,{id:a.descriptionId,...n,ref:e})});zz.displayName=Vz;var Uz="DialogClose",qz=w.forwardRef((t,e)=>{const{__scopeDialog:r,...n}=t,a=cs(Uz,r);return s.jsx(ht.button,{type:"button",...n,ref:e,onClick:et(t.onClick,()=>a.onOpenChange(!1))})});qz.displayName=Uz;function yE(t){return t?"open":"closed"}var Wz="DialogTitleWarning",[Q_e,Hz]=gbe(Wz,{contentName:Pl,titleName:xE,docsSlug:"dialog"}),J_e=({titleId:t})=>{const e=Hz(Wz),r=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users. 822 823If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component. 824 825For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return w.useEffect(()=>{t&&(document.getElementById(t)||console.error(r))},[r,t]),null},eje="DialogDescriptionWarning",tje=({contentRef:t,descriptionId:e})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Hz(eje).contentName}}.`;return w.useEffect(()=>{var i;const a=(i=t.current)==null?void 0:i.getAttribute("aria-describedby");e&&a&&(document.getElementById(e)||console.warn(n))},[n,t,e]),null},bE=Oz,rje=Rz,wE=Dz,tm=$z,rm=Lz,nm=Bz,am=zz,ax=qz;const nje=bE,aje=wE,Gz=w.forwardRef(({className:t,...e},r)=>s.jsx(tm,{className:Qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));Gz.displayName=tm.displayName;const Kz=w.forwardRef(({side:t="right",className:e,children:r,...n},a)=>s.jsxs(aje,{children:[s.jsx(Gz,{}),s.jsxs(rm,{ref:a,className:Qe("fixed z-50 gap-4 bg-slate-950 border-slate-800 p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",t==="top"&&"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",t==="bottom"&&"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",t==="left"&&"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",t==="right"&&"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-2xl",e),...n,children:[r,s.jsxs(ax,{className:"absolute right-4 top-4 roun
825ded-sm opacity-70 ring-offset-slate-950 transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-cyan-500 focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-slate-800",children:[s.jsx(Xn,{className:"h-4 w-4 text-slate-400"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Kz.displayName=rm.displayName;const Yz=({className:t,...e})=>s.jsx("div",{className:Qe("flex flex-col space-y-2 text-center sm:text-left",t),...e});Yz.displayName="SheetHeader";const Xz=w.forwardRef(({className:t,...e},r)=>s.jsx(nm,{ref:r,className:Qe("text-lg font-semibold text-slate-50",t),...e}));Xz.displayName=nm.displayName;const Zz=w.forwardRef(({className:t,...e},r)=>s.jsx(am,{ref:r,className:Qe("text-sm text-slate-400",t),...e}));Zz.displayName=am.displayName;const Qz=({open:t,onOpenChange:e,onPromptGenerated:r})=>{const{companyName:n,sdrName:a}=Yu(),[i,o]=w.useState(!1),[l,u]=w.useState(""),[d,h]=w.useState({sdr_name:"",role:"SDR",company_name:"",paper_type:"consultor amigo",personality:"Profissional, consultivo, empático e focado em entender necessidades reais",tone:"consultivo",prohibited_terms:"gÃrias, jargões complexos, pressão por venda",philosophy_name:"Venda Consultiva",lead_talk_percentage:80,max_lines:3,products:"",differentials:"",conversion_action:"Agendar reunião",tools:"agendamento, reagendamento, cancelamento"});w.useEffect(()=>{n&&a&&h(b=>({...b,company_name:n,sdr_name:a}))},[n,a]);const m=async()=>{if(!d.sdr_name||!d.company_name||!d.products||!d.differentials){xe.error("Preencha todos os campos obrigatórios");return}o(!0);try{const{data:b,error:y}=await ve.functions.invoke("generate-prompt",{body:d});if(y)throw y;b!=null&&b.prompt&&(u(b.prompt),xe.success("Prompt gerado com sucesso!"))}catch(b){console.error("Error generating prompt:",b),xe.error("Erro ao gerar prompt. Tente novamente.")}finally{o(!1)}},p=()=>{r(l),u(""),e(!1),xe.success("Prompt aplicado!")},v=()=>{u("")};return s.jsx(nje,{open:t,onOpenChange:e,children:s.jsxs(Kz,{className:"overflow-y-auto w-full sm:max-w-2xl",children:[s.jsxs(Yz,{children:[s.jsxs(Xz,{className:"flex items-center gap-2",children:[s.jsx(wg,{className:"w-5 h-5 text-red-400"}),"Gerador de Prompt com IA"]}),s.jsx(Zz,{children:"Preencha as informações abaixo para gerar um prompt personalizado para seu agente"})]}),s.jsxs("div",{className:"space-y-6 mt-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-red-400 flex items-center gap-2",children:"ð Informações Básicas"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300",children:["Nome do SDR ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:d.sdr_name,onChange:b=>h({...d,sdr_name:b.target.value}),placeholder:"ex: Assistente",className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300",children:["Cargo/Função ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:d.role,onChange:b=>h({...d,role:b.target.value}),placeholder:"ex: SDR, Closer, CS",className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300",children:["Nome da Empresa ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:d.company_name,onChange:b=>h({...d,company_name:b.target.value}),placeholder:"ex: Minha Empresa",className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300",children:["Tipo de Papel ",s.jsx("span",{className:"text-red-400",children:"*"})]}
825),s.jsx("input",{type:"text",value:d.paper_type,onChange:b=>h({...d,paper_type:b.target.value}),placeholder:"ex: consultor amigo",className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-violet-400 flex items-center gap-2",children:"ð Personalidade e Tom"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300",children:["Personalidade ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("textarea",{value:d.personality,onChange:b=>h({...d,personality:b.target.value}),placeholder:"ex: Profissional, consultivo, empático",rows:2,className:"flex w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50 resize-none"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Tom de Voz"}),s.jsxs("select",{value:d.tone,onChange:b=>h({...d,tone:b.target.value}),className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/50",children:[s.jsx("option",{value:"formal",children:"Formal"}),s.jsx("option",{value:"informal",children:"Informal"}),s.jsx("option",{value:"amigavel",children:"Amigável"}),s.jsx("option",{value:"tecnico",children:"Técnico"}),s.jsx("option",{value:"consultivo",children:"Consultivo"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Termos Proibidos"}),s.jsx("input",{type:"text",value:d.prohibited_terms,onChange:b=>h({...d,prohibited_terms:b.target.value}),placeholder:"ex: gÃrias, jargões",className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-indigo-400 flex items-center gap-2",children:"ð Filosofia de Vendas"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Nome da Filosofia"}),s.jsx("input",{type:"text",value:d.philosophy_name,onChange:b=>h({...d,philosophy_name:b.target.value}),placeholder:"ex: Venda Consultiva",className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300 flex justify-between",children:[s.jsx("span",{children:"Lead fala"}),s.jsxs("span",{className:"text-red-400 font-mono",children:[d.lead_talk_percentage,"%"]})]}),s.jsx("input",{type:"range",min:"50",max:"90",step:"5",value:d.lead_talk_percentage,onChange:b=>h({...d,lead_talk_percentage:parseInt(b.target.value)}),className:"w-full h-2 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-indigo-500"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300 flex justify-between",children:[s.jsx("span",{children:"Máximo de linhas"}),s.jsx("span",{className:"text-red-400 font-mono",children:d.max_lines})]}),s.jsx("input",{type:"range",min:"2",max:"6",step:"1",value:d.max_lines,onChange:b=>h({...d,max_lines:parseInt(b.target.value)}),className:"w-full h-2 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-indigo-500"})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-emerald-400 flex items-center gap-2",children:"ð¦ Produtos e Diferenciais"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300",children:["Produtos/Serviços ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("textarea",{value:d.products,onChange:b=>h({...d,products:b.target.value}),placeholder:`ex: - Produto A: Valor X a Y (Prazo Z). Uso: [Casos de Uso] 826- Produto B: Valor X a Y. BenefÃcio principal: [BenefÃcio]`,rows:4,className:"flex w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50 resize-none font-mono"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("label",{className:"text-sm font-medium text-slate-300",children:["Diferenciais Competitivos ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("textarea",{value:d.differentials,onChange:b=>h({...d,differentials:b.target.value}),placeholder:`ex: - Diferencial 1: [Descrição] 827- Diferencial 2: [Descrição]`,rows:3,className:"flex w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50 resize-none font-mono"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("h3",{className:"text-sm font-semibold text-amber-400 flex items-center gap-2",children:"ð¯ Conversão"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Ação de Conversão"}),s.jsxs("select",{value:d.conversion_action,onChange:b=>h({...d,conversion_action:b.target.value}),className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/50",children:[s.jsx("option",{value:"Agendar reunião",children:"Agendar reunião"}),s.jsx("option",{value:"Agendar Demo",children:"Agendar Demo"}
827),s.jsx("option",{value:"Enviar proposta",children:"Enviar proposta"}),s.jsx("option",{value:"Qualificar lead",children:"Qualificar lead"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Tools DisponÃveis"}),s.jsx("input",{type:"text",value:d.tools,onChange:b=>h({...d,tools:b.target.value}),placeholder:"ex: agendamento, reagendamento",className:"flex h-10 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]})]})]}),!l&&s.jsx(Ne,{onClick:m,disabled:i,className:"w-full shadow-lg shadow-red-500/20",size:"lg",children:i?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-5 h-5 mr-2 animate-spin"}),"Gerando prompt..."]}):s.jsxs(s.Fragment,{children:[s.jsx(wg,{className:"w-5 h-5 mr-2"}),"Gerar Prompt"]})}),l&&s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold text-red-400",children:"ð Prompt Gerado"}),s.jsx(Ne,{variant:"ghost",size:"sm",onClick:v,className:"text-slate-400 hover:text-slate-200",children:"Gerar Novamente"})]}),s.jsx("textarea",{value:l,onChange:b=>u(b.target.value),rows:12,className:"flex w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/50 resize-none font-mono"}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(Ne,{variant:"ghost",onClick:()=>e(!1),className:"flex-1",children:"Cancelar"}),s.jsx(Ne,{onClick:p,className:"flex-1 shadow-lg shadow-red-500/20",children:"â Usar este prompt"})]})]})]})]})})},y2=`<system_instruction> 828Você é a assistente virtual de vendas oficial da loja. Atenda clientes com agilidade, empatia e objetividade e encaminhe cada atendimento ao vendedor da loja cadastrada escolhida pelo cliente. Não invente informações. 829 830REGRAS DE COMUNICAÃÃO 831- Nunca informe valores, preços, parcelas, ofertas ou promoções. A negociação é exclusiva do vendedor. 832- Não detalhe modelos ou configurações especÃficas. Trabalhamos com Samsung, Apple e Motorola; o vendedor confirma modelos disponÃveis. 833- Mensagens curtas e claras, sem grandes blocos. Faça uma pergunta por vez. Não revele integrações internas, dados confidenciais ou o resumo do vendedor ao cliente. 834- Se não souber algo, diga que o vendedor da loja confirmará. Nunca prometa estoque, aprovação, horário ou envio antes da confirmação real. 835- Use o WhatsApp da conversa automaticamente; não peça outro celular, exceto se o cliente quiser usar outro contato. 836 837FLUXO DE ATENDIMENTO 8381. Cumprimente e obtenha nome e cidade, aproveitando dados já informados. Pergunte primeiro o nome e, na mensagem seguinte, a cidade. Faça somente uma pergunta por mensagem. 8392. Pergunte qual atendimento deseja, com as opções: 1 Comprar aparelho no boleto; 2 Comprar no cartão de crédito ou à vista; 3 Conhecer aparelhos Samsung, Apple e Motorola; 4 Claro troca de aparelho; 5 Aquisição de plano Claro; 6 Resgate de chip; 7 Seguro de aparelho; 8 Falar com um vendedor. Se a necessidade já estiver clara, não repita a pergunta. 8403. Pergunte qual loja cadastrada fica mais viável. Consulte a ferramenta de localização a partir da cidade/bairro e ofereça somente unidades realmente encontradas; respeite a preferência explÃcita do cliente. Informe o nome da loja e o link de localização retornado. Nunca invente unidades ou endereços. 8414. Para as opções 2 a 8, com nome, necessidade e loja confirmada, acione a ferramenta de encaminhamento. Só diga que conectou o cliente ao vendedor depois de confirmação de envio. O vendedor da vez é escolhido pelo rodÃzio, nunca manualmente. Se falhar, informe que não foi possÃvel encaminhar e ofereça nova tentativa. 8425. Para boleto, colete apenas dados faltantes: nome completo, CPF, e-mail, renda mensal, vÃnculo CLT (sim/não), CEP e autorização expressa para consulta de crédito e Dataprev. O telefone vem da conversa. Peça um dado por vez e não peça CPF/CEP para entrega; o CEP serve à consulta e à definição da região. Não consulte sem autorização. A ferramenta aplica limite de três consultas por dia para CPF, e-mail ou telefone repetidos. 8436. Após confirmar os dados e a autorização, execute a ferramenta de análise de crédito do primeiro formulário (somente Parcelex). O sistema encaminha em paralelo os dados completos ao responsável pela consulta manual DIMO da regional da loja escolhida, nunca aos dois responsáveis nem ao cliente. Não invente nem antecipe resultado; informe que a consulta está em andamento somente enquanto aguarda. Se aprovado, informe apenas a aprovação, sem valores, e encaminhe à loja escolhida após confirmar o envio ao vendedor. Se não aprovado, informe com cuidado que ainda não houve liberação; jamais prometa aprovação posterior. Explique que a equipe da região poderá verificar outras possibilidades e ofereça contato com o vendedor da loja para outras formas de compra. Falha técnica ou pendência não é reprovação, nem garantia de retorno ou liberação futura. 844 845SEGURANÃA E FERRAMENTAS 846- O resumo com dados pessoais é enviado exclusivamente pelo fluxo protegido ao vendedor da vez e ao gerente; nunca ao WhatsApp do cliente. Não envie CPF, renda ou resultados detalhados no texto ao cliente. 847- Para registrar encaminhamento, use somente a ferramenta de loja; não afirme que foi feito se a ferramenta falhar. Após sucesso, a conversa passa ao atendimento humano. 848- Não invente status de consulta, retorno de webhook ou liberação de crédito. Utilize somente o retorno real da ferramenta de consulta. Nunca exponha nomes de parceiros de análise. 849- Mantenha a conversa focada no encaminhamento ao vendedor; não apresente valores ou detalhes comerciais nem mesmo quando o cliente pedir. 850</system_instruction>`;var sje=Symbol("radix.slottable");function ije(t){const e=({children:r})=>s.jsx(s.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=sje,e}var Jz=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),oje="VisuallyHidden",eU=w.forwardRef((t,e)=>s.jsx(ht.span,{...t,ref:e,style:{...Jz,...t.style}}));eU.displayName=oje;var lje=eU,[sx]=Ca("Tooltip",[dd]),ix=dd(),tU="TooltipProvider",cje=700,b2="tooltip.open",[uje,_E]=sx(tU),rU=t=>{const{__scopeTooltip:e,delayDuration:r=cje,skipDelayDuration:n=300,disableHoverableContent:a=!1,children:i}=t,o=w.useRef(!0),l=w.useRef(!1),u=w.useRef(0);return w.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),s.jsx(uje,{scope:e,isOpenDelayedRef:o,delayDuration:r,onOpen:w.useCallback(()=>{window.clearTimeout(u.current),o.current=!1},[]),onClose:w.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>
vendor: 4,371 bytes, line 850
850o.current=!0,n)},[n]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(d=>{l.current=d},[]),disableHoverableContent:a,children:i})};rU.displayName=tU;var Mh="Tooltip",[dje,ox]=sx(Mh),nU=t=>{const{__scopeTooltip:e,children:r,open:n,defaultOpen:a,onOpenChange:i,disableHoverableContent:o,delayDuration:l}=t,u=_E(Mh,t.__scopeTooltip),d=ix(e),[h,m]=w.useState(null),p=ns(),v=w.useRef(0),b=o??u.disableHoverableContent,y=l??u.delayDuration,x=w.useRef(!1),[j,N]=Os({prop:n,defaultProp:a??!1,onChange:T=>{T?(u.onOpen(),document.dispatchEvent(new CustomEvent(b2))):u.onClose(),i==null||i(T)},caller:Mh}),S=w.useMemo(()=>j?x.current?"delayed-open":"instant-open":"closed",[j]),k=w.useCallback(()=>{window.clearTimeout(v.current),v.current=0,x.current=!1,N(!0)},[N]),C=w.useCallback(()=>{window.clearTimeout(v.current),v.current=0,N(!1)},[N]),A=w.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{x.current=!0,N(!0),v.current=0},y)},[y,N]);return w.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),s.jsx(oE,{...d,children:s.jsx(dje,{scope:e,contentId:p,open:j,stateAttribute:S,trigger:h,onTriggerChange:m,onTriggerEnter:w.useCallback(()=>{u.isOpenDelayedRef.current?A():k()},[u.isOpenDelayedRef,A,k]),onTriggerLeave:w.useCallback(()=>{b?C():(window.clearTimeout(v.current),v.current=0)},[C,b]),onOpen:k,onClose:C,disableHoverableContent:b,children:r})})};nU.displayName=Mh;var w2="TooltipTrigger",aU=w.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=ox(w2,r),i=_E(w2,r),o=ix(r),l=w.useRef(null),u=Nt(e,l,a.onTriggerChange),d=w.useRef(!1),h=w.useRef(!1),m=w.useCallback(()=>d.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),s.jsx(Y0,{asChild:!0,...o,children:s.jsx(ht.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...n,ref:u,onPointerMove:et(t.onPointerMove,p=>{p.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),h.current=!0)}),onPointerLeave:et(t.onPointerLeave,()=>{a.onTriggerLeave(),h.current=!1}),onPointerDown:et(t.onPointerDown,()=>{a.open&&a.onClose(),d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:et(t.onFocus,()=>{d.current||a.onOpen()}),onBlur:et(t.onBlur,a.onClose),onClick:et(t.onClick,a.onClose)})})});aU.displayName=w2;var fje="TooltipPortal",[UAe,hje]=sx(fje,{forceMount:void 0}),$u="TooltipContent",sU=w.forwardRef((t,e)=>{const r=hje($u,t.__scopeTooltip),{forceMount:n=r.forceMount,side:a="top",...i}=t,o=ox($u,t.__scopeTooltip);return s.jsx(ji,{present:n||o.open,children:o.disableHoverableContent?s.jsx(iU,{side:a,...i,ref:e}):s.jsx(mje,{side:a,...i,ref:e})})}),mje=w.forwardRef((t,e)=>{const r=ox($u,t.__scopeTooltip),n=_E($u,t.__scopeTooltip),a=w.useRef(null),i=Nt(e,a),[o,l]=w.useState(null),{trigger:u,onClose:d}=r,h=a.current,{onPointerInTransitChange:m}=n,p=w.useCallback(()=>{l(null),m(!1)},[m]),v=w.useCallback((b,y)=>{const x=b.currentTarget,j={x:b.clientX,y:b.clientY},N=yje(j,x.getBoundingClientRect()),S=bje(j,N),k=wje(y.getBoundingClientRect()),C=jje([...S,...k]);l(C),m(!0)},[m]);return w.useEffect(()=>()=>p(),[p]),w.useEffect(()=>{if(u&&h){const b=x=>v(x,h),y=x=>v(x,u);return u.addEventListener("pointerleave",b),h.addEventListener("pointerleave",y),()=>{u.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",y)}}},[u,h,v,p]),w.useEffect(()=>{if(o){const b=y=>{const x=y.target,j={x:y.clientX,y:y.clientY},N=(u==null?void 0:u.contains(x))||(h==null?void 0:h.contains(x)),S=!_je(j,o);N?p():S&&(p(),d())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[u,h,o,d,p]),s.jsx(iU,{...t,ref:i})}),[pje,gje]=sx(Mh,{isInside:!1}),vje=ije("TooltipContent"),iU=w.forwardRef((t,e)=>{const{__scopeTooltip:r,children:n,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:o,...l}=t,u=ox($u,r),d=ix(r),{onClose:h}=u;return w.useEffect(()=>(document.addEventListener(b2,h),()=>document.removeEventListener(b2,h)),[h]),w.useEffect(()=>{if(u.trigger){const m=p=>{const v=p.target;v!=null&&v.contains(u.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[u.trigger,h]),s.jsx(Zh,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:m=>
850m.preventDefault(),onDismiss:h,children:s.jsxs(lE,{"data-state":u.stateAttribute,...d,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(vje,{children:n}),s.jsx(pje,{scope:r,isInside:!0,children:s.jsx(lje,{id:u.contentId,role:"tooltip",children:a||n})})]})})});sU.displayName=$u;var oU="TooltipArrow",xje=w.forwardRef((t,e)=>{const{__scopeTooltip:r,...n}=t,a=ix(r);return gje(oU,r).isInside?null:s.jsx(cE,{...a,...n,ref:e})});xje.displayName=oU;function yje(t,e){const r=Math.abs(e.top-t.y),n=Math.abs(e.bottom-t.y),a=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(r,n,a,i)){case i:return"left";case a:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function bje(t,e,r=5){const n=[];switch(e){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}function wje(t){const{top:e,right:r,bottom:n,left:a}=t;return[{x:a,y:e},{x:r,y:e},{x:r,y:n},{x:a,y:n}]}function _je(t,e){const{x:r,y:n}=t;let a=!1;for(let i=0,o=e.length-1;i<e.length;o=i++){const l=e[i],u=e[o],d=l.x,h=l.y,m=u.x,p=u.y;h>n!=p>n&&r<(m-d)*(n-h)/(p-h)+d&&(a=!a)}return a}function jje(t){const e=t.slice();return e.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),Nje(e)}function Nje(t){if(t.length<=1)return t.slice();const e=[];for(let n=0;n<t.length;n++){const a=t[n];for(;e.length>=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))e.pop();else break}e.push(a)}e.pop();const r=[];for(let n=t.length-1;n>=0;n--){const a=t[n];for(;r.length>=2;){const i=r[r.length-1],o=r[r.length-2];if((i.x-o.x)*(a.y-o.y)>=(i.y-o.y)*(a.x-o.x))r.pop();else break}r.push(a)}return r.pop(),e.length===1&&r.length===1&&e[0].x===r[0].x&&e[0].y===r[0].y?e:e.concat(r)}var Sje=rU,Cje=nU,kje=aU,lU=sU;const Eje=Sje,tg=Cje,rg=kje,yf=w.forwardRef(({className:t,sideOffset:e=4,...r},n)=>s.jsx(lU,{ref:n,sideOffset:e,className:Qe("z-50 overflow-hidden rounded-md border border-slate-800 bg-slate-900 px-3 py-1.5 text-sm text-slate-100 shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...r}));yf.displayName=lU.displayName;const Aje=[{value:0,label:"Dom"},{value:1,label:"Seg"},{value:2,label:"Ter"},{value:3,label:"Qua"},{value:4,label:"Qui"},{value:5,label:"Sex"},{value:6,label:"Sáb"}],cU=w.forwardRef((t,e)=>{const{user:r}=Na(),[n,a]=w.useState(!0),[i,o]=w.useState(!1),[l,u]=w.useState(!1),[d,h]=w.useState({system_prompt_override:null,is_active:!0,auto_response_enabled:!0,ai_model_mode:"flash",message_breaking_enabled:!0,business_hours_start:"09:00",business_hours_end:"18:00",business_days:[1,2,3,4,5],company_name:null,sdr_name:null,ai_scheduling_enabled:!0});w.useImperativeHandle(e,()=>({save:p,cancel:m,isSaving:i})),w.useEffect(()=>{r!=null&&r.id&&m()},[r==null?void 0:r.id]);const m=async()=>{if(!(r!=null&&r.id)){a(!1);return}try{const{data:x,error:j}=await ve.from("nina_settings").select("*").limit(1).maybeSingle();if(j)throw j;if(!x){console.log("[AgentSettings] No global settings found"),a(!1);return}h({id:x.id,system_prompt_override:x.system_prompt_override,is_active:x.is_active,auto_response_enabled:x.auto_response_enabled,ai_model_mode:x.ai_model_mode==="flash"||x.ai_model_mode==="pro"||x.ai_model_mode==="pro3"||x.ai_model_mode==="adaptive"?x.ai_model_mode:"flash",message_breaking_enabled:x.message_breaking_enabled,business_hours_start:x.business_hours_start,business_hours_end:x.business_hours_end,business_days:x.business_days,company_name:x.company_name,s
850dr_name:x.sdr_name,ai_scheduling_enabled:x.ai_scheduling_enabled??!0})}catch(x){console.error("[AgentSettings] Error loading settings:",x),xe.error("Erro ao carregar configurações do agente")}finally{a(!1)}},p=async()=>{o(!0);try{const{error:x}=await ve.from("nina_settings").update({system_prompt_override:d.system_prompt_override,is_active:d.is_active,auto_response_enabled:d.auto_response_enabled,ai_model_mode:d.ai_model_mode,message_breaking_enabled:d.message_breaking_enabled,business_hours_start:d.business_hours_start,business_hours_end:d.business_hours_end,business_days:d.business_days,company_name:d.company_name,sdr_name:d.sdr_name,ai_scheduling_enabled:d.ai_scheduling_enabled,updated_at:new Date().toISOString()}).eq("id",d.id);if(x)throw x;xe.success("Configurações do agente salvas com sucesso!")}catch(x){console.error("Error saving agent settings:",x),xe.error("Erro ao salvar configurações do agente")}finally{o(!1)}},v=x=>{h(j=>({...j,business_days:j.business_days.includes(x)?j.business_days.filter(N=>N!==x):[...j.business_days,x].sort()}))},b=x=>{h(j=>({...j,system_prompt_override:x}))},y=()=>{h(x=>({...x,system_prompt_override:y2})),xe.success("Prompt restaurado para o padrão")};return n?s.jsx("div",{className:"flex items-center justify-center p-12",children:s.jsx(gt,{className:"w-8 h-8 animate-spin text-red-500"})}):s.jsxs(s.Fragment,{children:[s.jsx(Qz,{open:l,onOpenChange:u,onPromptGenerated:b}),s.jsx(Eje,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Or,{className:"w-5 h-5 text-red-400"}),s.jsx("h3",{className:"font-semibold text-white",children:"Prompt do Sistema"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Ne,{variant:"ghost",size:"sm",onClick:y,className:"text-slate-400 hover:text-white hover:bg-slate-700",children:[s.jsx(N8,{className:"w-4 h-4 mr-2"}),"Restaurar Padrão"]}),s.jsxs(Ne,{variant:"ghost",size:"sm",onClick:()=>u(!0),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:[s.jsx(wg,{className:"w-4 h-4 mr-2"}),"Gerar com IA"]})]})]}),s.jsx("div",{className:"mb-3 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20 text-xs text-amber-300",children:s.jsxs("p",{className:"flex items-start gap-2",children:[s.jsx(Js,{className:"w-4 h-4 flex-shrink-0 mt-0.5"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Template de exemplo:"})," Este é um modelo inicial para você começar. Personalize completamente com as informações da sua empresa, produtos, serviços e tom de comunicação."]})]})}),s.jsx("textarea",{value:d.system_prompt_override||"",onChange:x=>h({...d,system_prompt_override:x.target.value||null}),placeholder:"Cole ou escreva o prompt do agente aqui...",rows:12,className:"w-full rounded-lg border border-slate-700 bg-slate-950 px-4 py-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50 resize-y font-mono custom-scrollbar"}),s.jsxs("details",{className:"mt-3",children:[s.jsxs("summary",{className:"text-xs text-red-400 cursor-pointer hover:text-red-300 flex items-center gap-2",children:[s.jsx("span",{children:"ð"})," Variáveis dinâmicas disponÃveis"]}),s.jsxs("div",{className:"mt-2 p-3 rounded-lg bg-slate-950 border border-slate-800 text-xs font-mono space-y-1",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-red-400",children:"{{ data_hora }}"})," â Data e hora atual (ex: 29/11/2024 14:35:22)"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-red-400",children:"{{ data }}"})," â Apenas data (ex: 29/11/2024)"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-red-400",children:"{{ hora }}"})," â Apenas hora (ex: 14:35:22)"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-red-400",children:"{{ dia_semana }}"})," â Dia da semana por extenso (ex: sexta-feira)"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-red-400",children:"{{ cliente_nome }}"})," â Nome do cliente na conversa"]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-red-400",children:"{{ cliente_telefone }}"})," â Telefone do cliente"]})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(Lf,{className:"w-5 h-5 text-blue-400"}),s.jsx("h3",{className:"font-semibold text-white",children:"Informações da Empresa"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:["Nome da Empresa ",s.jsx("span",{className:"text-amber-400 text-[10px]",children:"(recomendado)"})]}),s.jsx("input",{type:"text",value:d.company_name||"",onChange:x=>h({...d,company_name:x.target.value||null}),placeholder:"Nome da sua empresa",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-blue-500/50"})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:["Nome do Agente ",s.jsx("span",{className:"text-amber-400 text-[10px]",children:"(recomendado)"})]}),s.jsx("input",{type:"text",value:d.sdr_name||"",onChange:x=>h({...d,sdr_name:x.target.value||null}),placeholder:"Nome do agente (ex: Ana, Sofia)",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-blue-500/50"})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(Ya,{className:"w-5 h-5 text-indigo-400"}),s.jsx("h3",{className:"font-semibold text-white",children:"Horário de Atendimento"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"InÃcio"}
850),s.jsx("input",{type:"time",value:d.business_hours_start,onChange:x=>h({...d,business_hours_start:x.target.value}),className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-indigo-500/50"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Fim"}),s.jsx("input",{type:"time",value:d.business_hours_end,onChange:x=>h({...d,business_hours_end:x.target.value}),className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-indigo-500/50"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-2 block",children:"Dias da Semana"}),s.jsx("div",{className:"flex gap-2",children:Aje.map(x=>s.jsx("button",{onClick:()=>v(x.value),className:`flex-1 h-9 text-xs font-medium rounded-lg transition-all ${d.business_days.includes(x.value)?"bg-indigo-500 text-white":"bg-slate-800 text-slate-400 hover:bg-slate-700"}`,children:x.label},x.value))})]})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsx(Or,{className:"w-5 h-5 text-violet-400"}),s.jsx("h3",{className:"font-semibold text-white",children:"Comportamento"})]}),s.jsxs("div",{className:"mb-4",children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-3 block",children:"Modelo de IA"}),s.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[s.jsxs("button",{type:"button",onClick:()=>h({...d,ai_model_mode:"flash"}),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-all ${d.ai_model_mode==="flash"?"bg-violet-500/20 border-violet-500 text-violet-300":"bg-slate-950/50 border-slate-800 text-slate-400 hover:bg-slate-800"}`,children:[s.jsx("span",{className:"text-lg",children:"â¡"}),s.jsx("span",{className:"text-xs font-medium",children:"Flash"}),s.jsx("span",{className:"text-[10px] text-center opacity-70",children:"Rápido"})]}),s.jsxs("button",{type:"button",onClick:()=>h({...d,ai_model_mode:"pro"}),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-all ${d.ai_model_mode==="pro"?"bg-violet-500/20 border-violet-500 text-violet-300":"bg-slate-950/50 border-slate-800 text-slate-400 hover:bg-slate-800"}`,children:[s.jsx("span",{className:"text-lg",children:"ð§ "}),s.jsx("span",{className:"text-xs font-medium",children:"Pro 2.5"}),s.jsx("span",{className:"text-[10px] text-center opacity-70",children:"Inteligente"})]}),s.jsxs("button",{type:"button",onClick:()=>h({...d,ai_model_mode:"pro3"}),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-all ${d.ai_model_mode==="pro3"?"bg-violet-500/20 border-violet-500 text-violet-300":"bg-slate-950/50 border-slate-800 text-slate-400 hover:bg-slate-800"}`,children:[s.jsx("span",{className:"text-lg",children:"ð"}),s.jsx("span",{className:"text-xs font-medium",children:"Pro 3"}),s.jsx("span",{className:"text-[10px] text-center opacity-70",children:"Mais Recente"})]}),s.jsxs("button",{type:"button",onClick:()=>h({...d,ai_model_mode:"adaptive"}),className:`flex flex-col items-center gap-1 p-3 rounded-lg border transition-all ${d.ai_model_mode==="adaptive"?"bg-violet-500/20 border-violet-500 text-violet-300":"bg-slate-950/50 border-slate-800 text-slate-400 hover:bg-slate-800"}`,children:[s.jsx("span",{className:"text-lg",children:"ð¯"}),s.jsx("span",{className:"text-xs font-medium",children:"Adaptativo"}),s.jsx("span",{className:"text-[10px] text-center opacity-70",children:"Contexto"})]})]}),s.jsxs("p",{className:"text-xs text-slate-500 mt-2",children:[d.ai_model_mode==="flash"&&"Gemini 2.5 Flash: respostas rápidas e econômicas",d.ai_model_mode==="pro"&&"Gemini 2.5 Pro: respostas elaboradas e inteligentes",d.ai_model_mode==="pro3"&&"Gemini 3 Pro: modelo mais recente e avançado",d.ai_model_mode==="adaptive"&&"Alterna automaticamente baseado no contexto da conversa"]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-slate-950/50 border border-slate-800",children:[s.jsxs(tg,{children:[s.jsx(rg,{asChild:!0,children:s.jsxs("span",{className:"text-sm text-slate-300 cursor-help flex items-center gap-1.5",children:["Agente Ativo",s.jsx(Js,{className:"w-3 h-3 text-slate-500"})]})}),s.jsx(yf,{children:s.jsx("p",{className:"text-xs max-w-[200px]",children:"Liga ou desliga o agente de IA completamente. Quando desativado, nenhuma resposta automática será enviada."})})]}),s.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:d.is_active,onChange:x=>h({...d,is_active:x.target.checked}),className:"sr-only peer"}),s.jsx("div",{className:"w-9 h-5 bg-slate-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-red-500/50 rounded-full peer peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-red-500"})]})]}),s.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-slate-950/50 border border-slate-800",children:[s.jsxs(tg,{children:[s.jsx(rg,{asChild:!0,children:s.jsxs("span",{className:"text-sm text-slate-300 cursor-help flex items-center gap-1.5",children:["Resposta Automática",s.jsx(Js,{className:"w-3 h-3 text-slate-500"})]})}),s.jsx(yf,{children:s.jsx("p",{className:"text-xs max-w-[200px]",children:"Quando ativo, o agente responde automaticamente sem necessidade de aprovação humana."})})]}),s.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:d.auto_response_enabled,onChange:x=>h({...d,auto_response_enabled:x.target.checked}),className:"sr-only peer"}),s.jsx("div",{className:"w-9 h-5 bg-slate-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-red-500/50 rounded-full peer peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-red-500"})]})]}),s.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-slate-950/50 border border-slate-800",children:[s.jsxs(tg,{children:[s.jsx(rg,{asChild:!0,children:s.jsxs("span",{className:"text-sm text-slate-300 cursor-help flex items-center gap-1.5",children:["Quebrar Mensagens",s.jsx(Js,{className:"w-3 h-3 text-slate-500"})]})}),s.jsx(yf,{children:s.jsx("p",{className:"text-xs max-w-[200px]",children:"Divide respostas longas em várias mensagens menores, simulando uma conversa mais natural."})})]}),s.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:d.message_breaking_enabled,onChange:x=>h({...d,message_breaking_enabled:x.target.checked}),className:"sr-only peer"}),s.jsx("div",{className:"w-9 h-5 bg-slate-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-red-500/50 rounded-full peer peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-red-500"})]})]}),s.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5 rounded-lg bg-slate-950/50 border border-slate-800",children:[s.jsxs(tg,{children:[s.jsx(rg,{asChild:!0,children:s.jsxs("span",{className:"text-sm text-slate-300 cursor-help flex items-center gap-1.5",children:["Agendamento via IA",s.jsx(Js,{className:"w-3 h-3 text-slate-500"})]})}),s.jsx(yf,{children:s.jsx("p",{className:"text-xs max-w-[200px]",children:"Permite que o agente crie, altere e c
850ancele agendamentos automaticamente durante a conversa."})})]}),s.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:d.ai_scheduling_enabled,onChange:x=>h({...d,ai_scheduling_enabled:x.target.checked}),className:"sr-only peer"}),s.jsx("div",{className:"w-9 h-5 bg-slate-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-red-500/50 rounded-full peer peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-red-500"})]})]})]})]})]})})]})});cU.displayName="AgentSettings";var lx="Collapsible",[Pje]=Ca(lx),[Tje,jE]=Pje(lx),uU=w.forwardRef((t,e)=>{const{__scopeCollapsible:r,open:n,defaultOpen:a,disabled:i,onOpenChange:o,...l}=t,[u,d]=Os({prop:n,defaultProp:a??!1,onChange:o,caller:lx});return s.jsx(Tje,{scope:r,disabled:i,contentId:ns(),open:u,onOpenToggle:w.useCallback(()=>d(h=>!h),[d]),children:s.jsx(ht.div,{"data-state":SE(u),"data-disabled":i?"":void 0,...l,ref:e})})});uU.displayName=lx;var dU="CollapsibleTrigger",fU=w.forwardRef((t,e)=>{const{__scopeCollapsible:r,...n}=t,a=jE(dU,r);return s.jsx(ht.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":SE(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...n,ref:e,onClick:et(t.onClick,a.onOpenToggle)})});fU.displayName=dU;var NE="CollapsibleContent",hU=w.forwardRef((t,e)=>{const{forceMount:r,...n}=t,a=jE(NE,t.__scopeCollapsible);return s.jsx(ji,{present:r||a.open,children:({present:i})=>s.jsx(Oje,{...n,ref:e,present:i})})});hU.displayName=NE;var Oje=w.forwardRef((t,e)=>{const{__scopeCollapsible:r,present:n,children:a,...i}=t,o=jE(NE,r),[l,u]=w.useState(n),d=w.useRef(null),h=Nt(e,d),m=w.useRef(0),p=m.current,v=w.useRef(0),b=v.current,y=o.open||l,x=w.useRef(y),j=w.useRef(void 0);return w.useEffect(()=>{const N=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(N)},[]),Xr(()=>{const N=d.current;if(N){j.current=j.current||{transitionDuration:N.style.transitionDuration,animationName:N.style.animationName},N.style.transitionDuration="0s",N.style.animationName="none";const S=N.getBoundingClientRect();m.current=S.height,v.current=S.width,x.current||(N.style.transitionDuration=j.current.transitionDuration,N.style.animationName=j.current.animationName),u(n)}},[o.open,n]),s.jsx(ht.div,{"data-state":SE(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!y,...i,ref:h,style:{"--radix-collapsible-content-height":p?`${p}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...t.style},children:y&&a})});function SE(t){return t?"open":"closed"}var cf=uU,uf=fU,df=hU;const Mje=[{id:"33B4UnXyTNbgLmdEDh5P",name:"Keren - Young Brazilian Female",desc:"Feminina, brasileira (Padrão)"},{id:"9BWtsMINqrJLrRacOk9x",name:"Aria",desc:"Feminina, natural"},{id:"CwhRBWXzGAHq8TQ4Fs17",name:"Roger",desc:"Masculina, confiante"},{id:"EXAVITQu4vr4xnSDxMaL",name:"Sarah",desc:"Feminina, suave"},{id:"FGY2WhTYpPnrIDTdsKH5",name:"Laura",desc:"Feminina, expressiva"},{id:"IKne3meq5aSn9XLyUdCD",name:"Charlie",desc:"Masculina, casual"},{id:"JBFqnCBsd6RMkjVDRZzb",name:"George",desc:"Masculina, britânica"},{id:"N2lVS1w4EtoT3dr4eOWO",name:"Callum",desc:"Masculina, transatlântica"},{id:"SAz9YHcvj6GT2YYXdXww",name:"River",desc:"Não-binária, americana"},{id:"TX3LPaxmHKxFdv7VOQHJ",name:"Liam",desc:"Masculina, articulada"},{id:"XB0fDUnXU5powFXDhCwa",name:"Charlotte",desc:"Feminina, sueca"},{id:"Xb7hH8MSUJpSbSDYk0k2",name:"Alice",desc:"Feminina, britânica"}
850,{id:"XrExE9yKIg1WjnnlVkGX",name:"Matilda",desc:"Feminina, calorosa"},{id:"bIHbv24MWmeRgasZH58o",name:"Will",desc:"Masculina, amigável"},{id:"cgSgspJ2msm6clMCkdW9",name:"Jessica",desc:"Feminina, expressiva"},{id:"cjVigY5qzO86Huf0OWal",name:"Eric",desc:"Masculina, amigável"},{id:"iP95p4xoKVk53GoZ742B",name:"Chris",desc:"Masculina, casual"},{id:"nPczCjzI2devNBz1zQrb",name:"Brian",desc:"Masculina, profunda"},{id:"onwK4e9ZLuTAKqWW03F9",name:"Daniel",desc:"Masculina, britânica"},{id:"pFZP5JQG7iQjIQuC4Bku",name:"Lily",desc:"Feminina, britânica"},{id:"pqHfZKP75CvOlQylNhV4",name:"Bill",desc:"Masculina, americana"}],Rje=[{id:"eleven_turbo_v2_5",name:"Turbo v2.5 (Recomendado)"},{id:"eleven_turbo_v2",name:"Turbo v2"},{id:"eleven_multilingual_v2",name:"Multilingual v2"}],mU=w.forwardRef((t,e)=>{var Dt;const{companyName:r}=Yu(),{user:n}=Na(),[a,i]=w.useState(!0),[o,l]=w.useState(!1),[u,d]=w.useState(!1),[h,m]=w.useState(!1),[p,v]=w.useState(!1),[b,y]=w.useState(!1),[x,j]=w.useState(!1),[N,S]=w.useState(!1),[k,C]=w.useState(""),[A,T]=w.useState(""),[R,I]=w.useState(!1),[D,L]=w.useState(!1),[z,H]=w.useState("Olá! Esta é uma mensagem de teste para verificar a qualidade da voz."),[Z,te]=w.useState(!1),[G,M]=w.useState(null),[F,K]=w.useState(null),B=w.useRef(null),[O,W]=w.useState(!1),[q,se]=w.useState(""),[me,fe]=w.useState(""),[Q,pe]=w.useState(null),[V,J]=w.useState(!1),[oe,re]=w.useState(null),Me=w.useRef(null),ee=()=>`verify-${crypto.randomUUID().slice(0,8)}`,[ce,je]=w.useState({whatsapp_access_token:null,whatsapp_phone_number_id:null,whatsapp_verify_token:ee(),elevenlabs_api_key:null,elevenlabs_voice_id:"33B4UnXyTNbgLmdEDh5P",elevenlabs_model:"eleven_turbo_v2_5",elevenlabs_stability:.75,elevenlabs_similarity_boost:.8,elevenlabs_style:.3,elevenlabs_speed:1,elevenlabs_speaker_boost:!0,audio_response_enabled:!1}),de=async()=>{if(!(!ce.id||!ce.elevenlabs_api_key))try{const{error:ye}=await ve.from("nina_settings").update({elevenlabs_api_key:ce.elevenlabs_api_key,updated_at:new Date().toISOString()}).eq("id",ce.id);if(ye)throw ye;xe.success("API Key da ElevenLabs salva automaticamente")}catch(ye){console.error("Error auto-saving ElevenLabs key:",ye)}},we="https://wqwtmxciixqilaulodpv.supabase.co/functions/v1/whatsapp-webhook";w.useEffect(()=>{T(`Olá! Esta é uma mensagem de teste do sistema ${r}. ð`)},[r]),w.useEffect(()=>{ke()},[]),w.useImperativeHandle(e,()=>({save:Y,cancel:ke,isSaving:o}));const ke=async()=>{if(!(n!=null&&n.id)){console.log("[ApiSettings] No user, skipping load"),i(!1);return}try{const{data:ye,error:mt}=await ve.from("nina_settings").select("*").limit(1).maybeSingle();if(mt)throw mt;if(!ye){console.log("[ApiSettings] No global settings found"),i(!1);return}const qt=ye.whatsapp_verify_token||ee();je({id:ye.id,whatsapp_access_token:ye.whatsapp_access_token,whatsapp_phone_number_id:ye.whatsapp_phone_number_id,whatsapp_verify_token:qt,elevenlabs_api_key:ye.elevenlabs_api_key,elevenlabs_voice_id:ye.elevenlabs_voice_id,elevenlabs_model:ye.elevenlabs_model,elevenlabs_stability:ye.elevenlabs_stability,elevenlabs_similarity_boost:ye.elevenlabs_similarity_boost,elevenlabs_style:ye.elevenlabs_style,elevenlabs_speed:ye.elevenlabs_speed,elevenlabs_speaker_boost:ye.elevenlabs_speaker_boost,audio_response_enabled:ye.audio_response_enabled||!1})}catch(ye){console.error("[ApiSettings] Error loading settings:",ye),xe.error("Erro ao carregar configurações")}finally{i(!1)}},Y=async()=>{l(!0);try{if(ce.whatsapp_phone_number_id&&!/^\d+$/.test(ce.whatsapp_phone_number_id)){xe.error("Phone Number ID deve conter apenas números");return}const{error:ye}=await ve.from("nina_settings").update({whatsapp_access_token:ce.whatsapp_access_token,whatsapp_phone_number_id:ce.whatsapp_phone_number_id,whatsapp_verify_token:ce.whatsapp_verify_token,elevenlabs_api_key:ce.elevenlabs_api_key,elevenlabs_voice_id:ce.elevenlabs_voice_id,elevenlabs_model:ce.elevenlabs_model,elevenlabs_stability:ce.elevenlabs_stability,elevenlabs_similarity_boost:ce.elevenlabs_similarity_boost,elevenlabs_style:ce.elevenlabs_style,elevenlabs_speed:ce.elevenlabs_speed,elevenlabs_speaker_boost:ce.elevenlabs_speaker_boost,audio_response_enabled:ce.audio_response_enabled,updated_at:new Date().toISOString()}).eq("id",ce.id);if(ye)throw ye;xe.success("Configurações de APIs salvas com sucesso!")}catch(ye){console.error("Error saving settings:",ye),xe.error("Erro ao salvar configurações")}finally{l(!1)}},ne=()=>{navigator.clipboard.writeText(we),v(!0),xe.success("URL do webhook copiada!"),setTimeout(()=>v(!1),2e3)},le=async()=>
850{if(!ce.elevenlabs_api_key){xe.error("Configure sua API Key da ElevenLabs primeiro");return}if(!z.trim()){xe.error("Insira um texto para converter em áudio");return}te(!0),M(null),K(null);try{const{data:ye,error:mt}=await ve.functions.invoke("test-elevenlabs-tts",{body:{text:z,apiKey:ce.elevenlabs_api_key,voiceId:ce.elevenlabs_voice_id,model:ce.elevenlabs_model,stability:ce.elevenlabs_stability,similarityBoost:ce.elevenlabs_similarity_boost,speed:ce.elevenlabs_speed}});if(mt)throw mt;if(ye!=null&&ye.success&&(ye!=null&&ye.audioBase64)){const qt=new Blob([Uint8Array.from(atob(ye.audioBase64),Je=>Je.charCodeAt(0))],{type:"audio/mpeg"}),cr=URL.createObjectURL(qt);M(cr),K({duration_ms:ye.duration_ms,size_kb:ye.size_kb}),xe.success(`Ãudio gerado em ${(ye.duration_ms/1e3).toFixed(1)}s`)}else throw new Error((ye==null?void 0:ye.error)||"Erro ao gerar áudio")}catch(ye){console.error("Error generating audio:",ye);const mt=ye instanceof Error?ye.message:"Erro ao gerar áudio";xe.error(mt)}finally{te(!1)}},Se=()=>{if(!G)return;const ye=document.createElement("a");ye.href=G,ye.download="elevenlabs-test.mp3",ye.click()},Ae=async()=>{if(!ce.whatsapp_access_token||!ce.whatsapp_phone_number_id){xe.error("â ï¸ Preencha e SALVE as credenciais do WhatsApp primeiro!",{description:'Clique em "Salvar Alterações" no topo da página antes de testar.'});return}if(!k.trim()){xe.error("Insira um número de telefone");return}if(!A.trim()){xe.error("Insira uma mensagem");return}if(!k.startsWith("+")){xe.error("O número deve estar no formato internacional (ex: +5511999999999)");return}I(!0);try{const{data:ye,error:mt}=await ve.functions.invoke("test-whatsapp-message",{body:{phone_number:k,message:A}});if(mt)throw mt;if(ye!=null&&ye.success)xe.success("Mensagem enviada com sucesso! â
",{description:`ID: ${ye.message_id}`});else throw new Error((ye==null?void 0:ye.error)||"Erro desconhecido")}catch(ye){console.error("Error sending test message:",ye);const mt=ye instanceof Error?ye.message:"Erro ao enviar mensagem de teste";xe.error("Falha ao enviar mensagem",{description:mt})}finally{I(!1)}},Ce=async()=>{var mt;if(!q.trim()){xe.error("Insira um número de telefone");return}if(!Q){xe.error("Selecione um arquivo de áudio");return}const ye=q.replace(/\D/g,"");if(ye.length<10){xe.error("Número de telefone inválido");return}J(!0),re(null);try{const qt=await Q.arrayBuffer(),cr=btoa(new Uint8Array(qt).reduce((bt,it)=>bt+String.fromCharCode(it),"")),{data:Je,error:Rt}=await ve.functions.invoke("simulate-audio-webhook",{body:{phone:ye,name:me.trim()||void 0,audio_base64:cr,audio_mime_type:Q.type||"audio/ogg"}});if(Rt)throw Rt;if(Je!=null&&Je.success)re({transcription:Je.transcription,contact_id:Je.contact_id,conversation_id:Je.conversation_id,message_id:Je.message_id,queued_for_nina:Je.queued_for_nina}),xe.success("Ãudio simulado com sucesso!",{description:`Transcrição: "${(mt=Je.transcription)==null?void 0:mt.substring(0,50)}..."`});else throw new Error((Je==null?void 0:Je.error)||"Erro ao simular áudio")}catch(qt){console.error("Error simulating audio webhook:",qt);const cr=qt instanceof Error?qt.message:"Erro ao simular recebimento de áudio";xe.error("Falha na simulação",{description:cr})}finally{J(!1)}},$e=ye=>{var qt;const mt=(qt=ye.target.files)==null?void 0:qt[0];if(mt){if(!["audio/ogg","audio/mpeg","audio/mp3","audio/wav","audio/m4a","audio/webm","audio/mp4"].includes(mt.type)&&!mt.name.match(/\.(ogg|mp3|wav|m4a|webm|mp4)$/i)){xe.error("Formato de áudio não suportado",{description:"Use .ogg, .mp3, .wav, .m4a ou .webm"});return}if(mt.size>10*1024*1024){xe.error("Arquivo muito grande",{description:"O arquivo deve ter no máximo 10MB"});return}pe(mt),re(null)}},Be=ce.whatsapp_access_token&&ce.whatsapp_phone_number_id,tt=ce.elevenlabs_api_key;return a?s.jsx("div",{className:"flex items-center justify-center p-12",children:s.jsx(gt,{className:"w-8 h-8 animate-spin text-red-500"})}):s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Tn,{className:"w-5 h-5 text-red-400"}),s.jsx("h3",{className:"font-semibold text-white",children:"WhatsApp Cloud API"})]}),s.jsxs("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${Be?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"}`,children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${Be?"bg-emerald-500":"bg-amber-500"}`}),Be?"Configurado":"Aguardando"]})]}),s.jsxs("details",{className:"mb-4",children:[s.jsxs("summary",{className:"text-xs text-red-400 cursor-pointer hover:text-red-300 flex items-center gap-2 py-2",children:[s.jsx(rY,{className:"w-4 h-4"}),"Como obter as credenciais do WhatsApp?"]}),s.jsxs("div",{className:"mt-2 p-4 rounded-lg bg-slate-950 border border-slate-800 text-xs space-y-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-white font-medium",children:"ð Passo a passo:"}),s.jsxs("ol",{className:"list-decimal list-inside space-y-1.5 text-slate-400",children:[s.jsxs("li",{children:["Acesse o ",s.jsx("a",{href:"https://developers.facebook.com",target:"_blank",rel:"noopener noreferrer",className:"text-red-400 hover:underline",children:"Meta for Developers"})]}),s.jsx("li",{children:'Crie ou selecione um App do tipo "Business"'}),s.jsx("li",{children:'Adicione o produto "WhatsApp" ao app'}),s.jsxs("li",{children:['Na seção "API Setup", copie o ',s.jsx("strong",{className:"text-white",children:"Access Token"})," temporário (ou gere um permanente)"]}),s.jsxs("li",{children:["Copie também o ",s.jsx("strong",{className:"text-white",children:"Phone Number ID"})," (número de identificação)"]}),s.jsx("li",{children:'Em "Configuration" â "Webhook", cole a URL e o Verify Token abaixo'})]})]}),s.jsx("div",{className:"pt-2 border-t border-slate-700",children:s.jsxs("p",{className:"text-slate-500",children:["ð ",s.jsx("a",{href:"https://developers.facebook.com/docs/whatsapp/cloud-api/get-started",target:"_blank",rel:"noopener noreferrer",className:"text-red-400 hover:underline",children:"Documentação oficial do WhatsApp Cloud API"})]})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 mb-4",children:[s.jsxs("div",{children:[s.jsxs("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:["Access Token ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:u?"text":"password",value:ce.whatsapp_access_token||"",onChange:ye=>je({...ce,whatsapp_access_token:ye.target.value}),placeholder:"EAAxxxxxxxxxxxxxxx...",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 pr-10 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"}),s.jsx("button",{type:"button",onClick:()=>d(!u),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:u?s.jsx(oN,{className:"w-4 h-4"}):s.jsx(su,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:["Phone Number ID ",s.jsx("span",{className:"text-red-400",children:"*"})]}),s.jsx("input",{type:"text",value:ce.whatsapp_phone_number_id||"",onChange:ye=>je({...ce,whatsapp_phone_number_id:ye.target.value}),placeholder:"123456789012345",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]})]}),s.jsxs(cf,{open:b,onOpenChange:y,children:[s.jsxs(uf,{className:"flex items-center gap-2 text-sm text-slate-400 hover:text-slate-300 transition-colors",children:[s.jsx(Ga,{className:`w-4 h-4 transition-transform ${b?"rotate-180":""}`}),"Configuração de Webhook"]}),s.jsxs(df,{className:"mt-3 space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Callback URL"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",value:we,readOnly:!0,className:"h-9 flex-1 rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-400 font-mono"}),s.jsx(Ne,{variant:"ghost",size:"sm",onClick:ne,className:"px-3",children:p?s.jsx(ci,{className:"w-4 h-4"}):s.jsx(iN,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Verify Token"}),s.jsx("input",{type:"text",value:ce.whatsapp_verify_token||"",onChange:ye=>je({...ce,whatsapp_verify_token:ye.target.value}),className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]})]})]})]}),s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ff,{className:"w-5 h-5 text-violet-400"}),s.jsx("h3",{className:"font-semibold text-white",children:"ElevenLabs (Text-to-Speech)"})]}),s.jsxs("div",{className:`flex items-center gap-2 px-3 py-1 rounded-full text-xs font-medium ${tt?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"}`,children:[s.jsx("span",{className:`h-2 w-2 rounded-full ${tt?"bg-emerald-500":"bg-amber-500"}`}),tt?"Configurado":"Aguardando"]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"API Key"}),s.jsxs("div",{className:"relative",children:[s.jsx("input",{type:h?"text":"password",value:ce.elevenlabs_api_key||"",onChange:ye=>je({...ce,elevenlabs_api_key:ye.target.value}),onBlur:de,placeholder:"sk_xxxxxxxxxxxxxxxxxxxxxxxx",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 pr-10 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-violet-500/50"}),s.jsx("button",{type:"button",onClick:()=>m(!h),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:h?s.jsx(oN,{className:"w-4 h-4"}):s.jsx(su,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Voz"}),s.jsx("select",{value:ce.elevenlabs_voice_id,onChange:ye=>je({...ce,elevenlabs_voice_id:ye.target.value}),className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-violet-500/50",children:Mje.map(ye=>s.jsxs("option",{value:ye.id,children:[ye.name," - ",ye.desc]},ye.id))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Modelo"}),s.jsx("select",{value:ce.elevenlabs_model||"eleven_turbo_v2_5",onChange:ye=>je({...ce,elevenlabs_model:ye.target.value}),className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 focus:outline-none focus:ring-2 focus:ring-violet-500/50",children:Rje.map(ye=>s.jsx("option",{value:ye.id,children:ye.name},ye.id))})]})]}),s.jsxs("div",{className:"p-4 bg-violet-500/5 border border-violet-500/20 rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx(sg,{className:"w-4 h-4 text-violet-400"}),s.jsx("span",{className:"text-sm font-medium text-white",children:"Respostas em Ãudio"})]}),s.jsx("p",{className:"text-xs text-slate-400",children:"Quando ativado, o agente responderá com áudios em vez de texto"})]}),s.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:ce.audio_response_enabled,onChange:ye=>je({...ce,audio_response_enabled:ye.target.checked}),disabled:!tt,className:"sr-only peer"}),s.jsx("div",{className:`w-11 h-6 bg-slate-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-violet-500/50 rounded-full peer peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-violet-500 ${tt?"":"op
850acity-50 cursor-not-allowed"}`})]})]}),!tt&&s.jsx("p",{className:"text-xs text-amber-400 mt-2",children:"â ï¸ Configure a API Key da ElevenLabs para habilitar respostas em áudio"}),ce.audio_response_enabled&&tt&&s.jsx("p",{className:"text-xs text-emerald-400 mt-2",children:"â
Ãudios recebidos serão transcritos automaticamente e o agente responderá com áudio"})]}),s.jsxs(cf,{open:x,onOpenChange:j,children:[s.jsxs(uf,{className:"flex items-center gap-2 text-sm text-slate-400 hover:text-slate-300 transition-colors",children:[s.jsx(Ga,{className:`w-4 h-4 transition-transform ${x?"rotate-180":""}`}),"Configurações Avançadas de Voz"]}),s.jsxs(df,{className:"mt-3 p-4 bg-slate-950/50 rounded-lg border border-slate-800 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("label",{className:"text-xs text-slate-400",children:"Stability"}),s.jsx("span",{className:"text-xs font-mono text-slate-300",children:ce.elevenlabs_stability.toFixed(2)})]}),s.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:ce.elevenlabs_stability,onChange:ye=>je({...ce,elevenlabs_stability:parseFloat(ye.target.value)}),className:"w-full h-2 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-violet-500"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("label",{className:"text-xs text-slate-400",children:"Similarity"}),s.jsx("span",{className:"text-xs font-mono text-slate-300",children:ce.elevenlabs_similarity_boost.toFixed(2)})]}),s.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:ce.elevenlabs_similarity_boost,onChange:ye=>je({...ce,elevenlabs_similarity_boost:parseFloat(ye.target.value)}),className:"w-full h-2 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-violet-500"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("label",{className:"text-xs text-slate-400",children:"Style"}),s.jsx("span",{className:"text-xs font-mono text-slate-300",children:ce.elevenlabs_style.toFixed(2)})]}),s.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:ce.elevenlabs_style,onChange:ye=>je({...ce,elevenlabs_style:parseFloat(ye.target.value)}),className:"w-full h-2 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-violet-500"})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex justify-between items-center mb-2",children:[s.jsx("label",{className:"text-xs text-slate-400",children:"Speed"}),s.jsx("span",{className:"text-xs font-mono text-slate-300",children:((Dt=ce.elevenlabs_speed)==null?void 0:Dt.toFixed(1))||"1.0"})]}),s.jsx("input",{type:"range",min:"0.5",max:"2",step:"0.1",value:ce.elevenlabs_speed||1,onChange:ye=>je({...ce,elevenlabs_speed:parseFloat(ye.target.value)}),className:"w-full h-2 bg-slate-800 rounded-lg appearance-none cursor-pointer accent-violet-500"})]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:ce.elevenlabs_speaker_boost,onChange:ye=>je({...ce,elevenlabs_speaker_boost:ye.target.checked}),className:"sr-only peer"}),s.jsx("div",{className:"w-9 h-5 bg-slate-700 peer-focus:outline-none peer-focus:ring-2 peer-focus:ring-violet-500/50 rounded-full peer peer-checked:after:translate-x-full after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-all peer-checked:bg-violet-500"})]}),s.jsx("span",{className:"text-sm text-slate-300",children:"Speaker Boost"})]})]})]}),s.jsxs(cf,{open:D,onOpenChange:L,className:"mt-4",children:[s.jsxs(uf,{className:"flex items-center gap-2 text-sm text-slate-400 hover:text-slate-300 transition-colors",children:[s.jsx(Ga,{className:`w-4 h-4 transition-transform ${D?"rotate-180":""}`}),s.jsx(sg,{className:"w-4 h-4"}),"Testar Ãudio"]}),s.jsxs(df,{className:"mt-3 p-4 bg-slate-950/50 rounded-lg border border-slate-800 space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Texto para converter em áudio"}),s.jsx("textarea",{value:z,onChange:ye=>H(ye.target.value),placeholder:"Digite o texto que deseja converter em áudio...",rows:3,maxLength:1e3,className:"w-full rounded-lg border border-slate-700 bg-slate-950 px-3 py-2 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-violet-500/50 resize-none"}),s.jsxs("p",{className:"text-xs text-slate-500 mt-1",children:[z.length,"/1000 caracteres"]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ne,{onClick:le,disabled:Z||!ce.elevenlabs_api_key,className:"bg-violet-600 hover:bg-violet-700",children:Z?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-4 h-4 mr-2 animate-spin"}),"Gerando..."]}):s.jsxs(s.Fragment,{children:[s.jsx(sg,{className:"w-4 h-4 mr-2"}),"Gerar e Ouvir"]})}),G&&s.jsxs(Ne,{onClick:Se,variant:"ghost",size:"sm",className:"text-slate-400 hover:text-slate-200",children:[s.jsx(v8,{className:"w-4 h-4 mr-1"}),"Baixar"]})]}),!ce.elevenlabs_api_key&&s.jsx("p",{className:"text-xs text-amber-400",children:"â ï¸ Configure sua API Key da ElevenLabs acima para testar"}),G&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("audio",{ref:B,src:G,controls:!0,className:"w-full h-10",autoPlay:!0}),F&&s.jsxs("p",{className:"text-xs text-slate-500",children:["â
Gerado em ",(F.duration_ms/1e3).toFixed(1),"s ⢠",F.size_kb,"KB"]})]})]})]})]})]}),s.jsx(cf,{open:N,onOpenChange:S,children:s.jsxs("div",{className:"rounded-xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs(uf,{className:"flex items-center gap-2 text-sm font-medium text-slate-300 hover:text-white transition-colors w-full",children:[s.jsx(ou,{className:"w-4 h-4"}),s.jsx("span",{children:"Teste de Envio"}),s.jsx(Ga,{className:`w-4 h-4 ml-auto transition-transform ${N?"rotate-180":""}`})]}),s.jsxs(df,{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Telefone"}),s.jsx("input",{type:"tel",value:k,onChange:ye=>C(ye.target.value),placeholder:"+5511999999999",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Mensagem"}),s.jsx("input",{type:"text",value:A,onChange:ye=>T(ye.target.value),placeholder:"Mensagem de teste...",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-red-500/50"})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(Ne,{onClick:Ae,disabled:R,className:"shadow-lg shadow-red-500/20",children:R?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-4 h-4 mr-2 animate-spin"}),"Enviando..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ou,{className:"w-4 h-4 mr-2"}),"Enviar Teste"]})})})]})]})}),s.jsxs("details",{className:"group",children:[s.jsxs("summary",{className:"cursor-pointer text-xs text-slate-500 hover:text-slate-400 flex items-center gap-2 py-2",children:[s.jsx(Ga,{className:"w-3 h-3 transition-transform group-open:rotate-180"}),"Ferramentas Avançadas de Teste"]}),s.jsx("div",{className:"mt-2",children:s.jsx(cf,{open:O,onOpenChange:W,children:s.jsxs("div",{className:"rounded-xl border border-amber-500/20 bg-slate-900/50 p-6",children:[s.jsxs(uf,{className:"flex items-center gap-2 text-sm font-medium text-slate-300 hover:text-white transition-colors w-full",children:[s.jsx(ob,{className:"w-4 h-4 text-amber-400"}),s.jsx("span",{children:"Simular Recebimento de Ãudio"}),s.jsx(Ga,{className:`w-4 h-4 ml-auto transition-transform ${O?"rotate-180":""}`})]}),s.jsxs(df,{className:"mt-4 space-y-4",children:[s.jsx("p",{className:"text-xs text-slate-400",children:"Simula o recebimento de um áudio pelo WhatsApp. O áudio será transcrito e processado pela IA."}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Telefone do Contato *"}),s.jsx("input",{type:"tel",value:q,onChange:ye=>se(ye.target.value),placeholder:"5511999999999",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-amber-500/50"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Nome do Contato (opcional)"}),s.jsx("input",{type:"text",value:me,onChange:ye=>fe(ye.target.value),placeholder:"João da Silva",className:"h-9 w-full rounded-lg border border-slate-700 bg-slate-950 px-3 text-sm text-slate-100 placeholder:text-slate-600 focus:outline-none focus:ring-2 focus:ring-amber-500/50"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-slate-400 mb-1.5 block",children:"Arquivo de Ãudio *"}),s.jsxs("div",{className:`border-2 border-dashed rounded-lg p-4 text-center cursor-pointer transition-colors ${Q?"border-amber-500/50 bg-amber-500/5":"border-slate-700 hover:border-slate-600 bg-slate-950/50"}`,onClick:()=>{var ye;return(ye=Me.current)==null?void 0:ye.click()},children:[s.jsx("input",{ref:Me,type:"file",accept:".ogg,.mp3,.wav,.m4a,.webm,audio/*",onChange:$e,className:"hidden"}),Q?s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx(ob,{className:"w-5 h-5 text-amber-400"}),s.jsxs("div",{className:"text-left",children:[s.jsx("p",{className:"text-sm text-slate-200",children:Q.name}),s.jsxs("p",{className:"text-xs text-slate-500",children:[(Q.size/1024).toFixed(1)," KB"]}
850)]}),s.jsx("button",{type:"button",onClick:ye=>{ye.stopPropagation(),pe(null),re(null)},className:"ml-2 text-slate-500 hover:text-slate-300",children:"â"})]}):s.jsxs("div",{children:[s.jsx(OY,{className:"w-8 h-8 mx-auto text-slate-500 mb-2"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Clique ou arraste um arquivo de áudio"}),s.jsx("p",{className:"text-xs text-slate-600 mt-1",children:".ogg, .mp3, .wav, .m4a, .webm (máx 10MB)"})]})]})]}),s.jsx("div",{className:"flex justify-end",children:s.jsx(Ne,{onClick:Ce,disabled:V||!Q||!q.trim(),className:"bg-amber-600 hover:bg-amber-700 shadow-lg shadow-amber-500/20",children:V?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-4 h-4 mr-2 animate-spin"}),"Processando..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ob,{className:"w-4 h-4 mr-2"}),"Simular Ãudio Recebido"]})})}),oe&&s.jsxs("div",{className:"p-4 bg-emerald-500/10 border border-emerald-500/20 rounded-lg space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-2 text-emerald-400",children:[s.jsx(ci,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Ãudio processado com sucesso!"})]}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-400",children:"Transcrição:"}),s.jsxs("p",{className:"text-slate-200 mt-1 p-2 bg-slate-950/50 rounded border border-slate-800",children:['"',oe.transcription,'"']})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Contact ID:"}),s.jsxs("p",{className:"text-slate-300 font-mono",children:[oe.contact_id.slice(0,8),"..."]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Conversation ID:"}),s.jsxs("p",{className:"text-slate-300 font-mono",children:[oe.conversation_id.slice(0,8),"..."]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Message ID:"}),s.jsxs("p",{className:"text-slate-300 font-mono",children:[oe.message_id.slice(0,8),"..."]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-slate-500",children:"Nina:"}),s.jsx("p",{className:oe.queued_for_nina?"text-emerald-400":"text-amber-400",children:oe.queued_for_nina?"â
Processando":"â¸ï¸ Não enfileirado"})]})]})]})]})]})]})})})]})]})});mU.displayName="ApiSettings";const Ije=()=>{const[t,e]=w.useState(["quickstart"]),r=a=>{e(i=>i.includes(a)?i.filter(o=>o!==a):[...i,a])},n=[{id:"quickstart",title:"ð InÃcio Rápido (5 passos)",icon:Yd,content:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-gradient-to-br from-red-500/10 to-emerald-500/10 border border-red-500/20 rounded-lg p-6",children:[s.jsx("p",{className:"text-slate-300 mb-4",children:"Configure seu agente de IA em poucos minutos seguindo estes passos:"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Configure sua empresa"}),s.jsx("p",{className:"text-sm text-slate-400",children:'Na aba "Agente", preencha o nome da empresa e do agente de IA'})]})]}),s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Personalize o prompt"}),s.jsx("p",{className:"text-sm text-slate-400",children:'Edite o prompt do sistema com as informações do seu negócio ou use o "Gerar com IA"'})]})]}),s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Conecte o WhatsApp"}),s.jsx("p",{className:"text-sm text-slate-400",children:'Na aba "APIs", configure o Access Token e Phone Number ID do WhatsApp Cloud API'})]})]}),s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"4"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Configure o Webhook"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Copie a URL e o Verify Token para configurar no Meta for Developers"})]})]}),s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-emerald-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"â"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Pronto!"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Seu agente está configurado e pronto para receber mensagens no WhatsApp"})]})]})]})]}),s.jsx("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-4",children:s.jsxs("p",{className:"text-xs text-slate-400",children:[s.jsx("strong",{className:"text-amber-400",children:"ð¡ Dica:"})," As seções abaixo contêm documentação técnica detalhada sobre a arquitetura do sistema. Você não precisa ler tudo para começar a usar o agente."]})})]})}
850,{id:"post-remix-checklist",title:"ð Checklist Pós-Remix (IMPORTANTE)",icon:ei,content:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-6",children:[s.jsx("p",{className:"text-amber-200 text-sm leading-relaxed mb-4",children:"Após remixar este projeto, algumas configurações precisam ser revisadas manualmente para garantir o funcionamento completo do sistema."}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"1"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Configurar verify_jwt = false nas Edge Functions"}),s.jsx("p",{className:"text-sm text-slate-400",children:"As funções abaixo precisam ter a verificação de JWT desabilitada para funcionar corretamente no fluxo single-tenant:"}),s.jsx("div",{className:"mt-2 bg-slate-950 border border-slate-700 rounded-lg p-3",children:s.jsx("code",{className:"text-xs text-emerald-400 font-mono break-all",children:"whatsapp-webhook, message-grouper, nina-orchestrator, whatsapp-sender, initialize-system, validate-setup, simulate-webhook, simulate-audio-webhook, test-whatsapp-message, test-elevenlabs-tts, generate-prompt, analyze-conversation, health-check, seed-appointments, trigger-nina-orchestrator, trigger-whatsapp-sender"})})]})]}),s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"2"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Configurar o Webhook no Meta for Developers"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Acesse o painel do Meta, vá em WhatsApp â Configuration, e configure a URL do webhook (whatsapp-webhook) com o Verify Token salvo nas configurações."})]})]}),s.jsxs("div",{className:"flex gap-4 items-start",children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-amber-500 flex items-center justify-center text-white font-bold text-sm flex-shrink-0",children:"3"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-white font-medium",children:"Configurar a ElevenLabs API Key (opcional)"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Para respostas em áudio, adicione sua API key da ElevenLabs na aba APIs das configurações. Se não configurar, o agente responderá apenas em texto."})]})]})]})]}),s.jsx("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-4",children:s.jsxs("p",{className:"text-xs text-slate-400",children:[s.jsx("strong",{className:"text-amber-400",children:"â ï¸ Atenção:"})," Este checklist é executado automaticamente após cada remix, mas as configurações de webhook e API keys externas precisam ser feitas manualmente no painel respectivo."]})})]})}
850,{id:"whatsapp-tutorial",title:"ð± Tutorial: Configurar WhatsApp Business API",icon:CY,content:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"bg-gradient-to-br from-emerald-500/10 to-red-500/10 border border-emerald-500/20 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-3 flex items-center gap-2",children:[s.jsx(Tn,{className:"w-5 h-5 text-emerald-400"}),"Visão Geral"]}),s.jsxs("p",{className:"text-slate-300 text-sm leading-relaxed",children:["Para conectar seu agente de IA ao WhatsApp, você precisa configurar a ",s.jsx("strong",{className:"text-emerald-400",children:"WhatsApp Cloud API"})," através do Meta for Developers. Este tutorial guiará você por todo o processo, passo a passo."]}),s.jsxs("div",{className:"mt-4 flex flex-wrap gap-2",children:[s.jsx("span",{className:"px-3 py-1 bg-slate-800 rounded-full text-xs text-slate-300",children:"â±ï¸ Tempo estimado: 15-30 minutos"}),s.jsx("span",{className:"px-3 py-1 bg-slate-800 rounded-full text-xs text-slate-300",children:"ð° Custo: Gratuito para começar"}),s.jsx("span",{className:"px-3 py-1 bg-slate-800 rounded-full text-xs text-slate-300",children:"ð Pré-requisito: Conta Meta/Facebook"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-lg flex-shrink-0",children:"1"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-white font-bold text-lg",children:"Criar conta no Meta for Developers"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Configure sua conta de desenvolvedor no Meta"})]})]}),s.jsxs("div",{className:"space-y-4 ml-14",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"1.1"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-slate-300",children:"Acesse o portal de desenvolvedores do Meta:"}),s.jsxs("a",{href:"https://developers.facebook.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 mt-2 px-4 py-2 bg-slate-800 hover:bg-slate-700 rounded-lg text-red-400 text-sm transition-colors",children:[s.jsx(Qi,{className:"w-4 h-4"}),"developers.facebook.com"]})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"1.2"}),s.jsx("p",{className:"text-slate-300",children:"Faça login com sua conta do Facebook/Meta"})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"1.3"}),s.jsx("p",{className:"text-slate-300",children:"Se for sua primeira vez, aceite os termos de desenvolvedor"})]})]}),s.jsx("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(ei,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-amber-200 text-sm",children:[s.jsx("strong",{children:"Importante:"})," Use uma conta Meta/Facebook que você tenha acesso permanente. Evite contas pessoais - prefira criar uma conta empresarial."]})]})})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-lg flex-shrink-0",children:"2"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-white font-bold text-lg",children:"Criar um App no Meta"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Crie um aplicativo para usar a WhatsApp API"})]})]}),s.jsxs("div",{className:"space-y-4 ml-14",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"2.1"}),s.jsxs("p",{className:"text-slate-300",children:["No painel, clique em ",s.jsx("strong",{className:"text-white",children:'"My Apps"'})," â ",s.jsx("strong",{className:"text-white",children:'"Create App"'})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"2.2"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-slate-300",children:["Selecione o tipo de app: ",s.jsx("strong",{className:"text-emerald-400",children:'"Business"'})]}),s.jsx("p",{className:"text-slate-500 text-xs mt-1",children:"Este tipo permite acesso à WhatsApp Business API"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"2.3"}),s.jsx("p",{className:"text-slate-300",children:'Dê um nome ao seu app (ex: "Minha Empresa - WhatsApp Bot")'})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"2.4"}),s.jsxs("p",{className:"text-slate-300",children:["Preencha seu email de contato e clique em ",s.jsx("strong",{className:"text-white",children:'"Create App"'})]})]})]}),s.jsx("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:s.jsxs("p",{className:"text-xs text-slate-400 flex items-center gap-2",children:[s.jsx(Js,{className:"w-4 h-4 text-red-400"}),"O Meta pode solicitar verificação de segurança (senha ou autenticação 2FA)"]})})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-lg flex-shrink-0",children:"3"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-white font-bold text-lg",children:"Adicionar WhatsApp ao App"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Configure o produto WhatsApp no seu app"})]})]}),s.jsxs("div",{className:"space-y-4 ml-14",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"3.1"}),s.jsxs("p",{className:"text-slate-300",children:["No menu lateral, clique em ",s.jsx("strong",{className:"text-white",children:'"Add Products"'})," ou ",s.jsx("strong",{className:"text-white",children:'"Adicionar Produtos"'})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"3.2"}),s.jsxs("p",{className:"text-slate-300",children:["Encontre ",s.jsx("strong",{className:"text-emerald-400",children:'"WhatsApp"'})," na lista e clique em ",s.jsx("strong",{className:"text-white",children:'"Set up"'})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"3.3"}),s.jsxs("p",{className:"text-slate-300",children:["Selecione ou crie uma ",s.jsx("strong",{className:"text-white",children:"Meta Business Account"})," (conta comercial)"]})]})]}),s.jsx("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Js,{className:"w-5 h-5 text-red-400 flex-shrink-0 mt-0.5"}),s.jsx("p",{className:"text-red-200 text-sm",children:"O Meta oferece um número de teste gratuito para desenvolvimento. Para produção, você precisará de um número de telefone próprio verificado."})]})})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-lg flex-shrink-0",children:"4"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-white font-bold text-lg",children:"Obter o Access Token"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Token de autenticação para a API"})]})]}),s.jsxs("div",{className:"space-y-4 ml-14",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"4.1"}),s.jsxs("p",{className:"text-slate-300",children:["No menu lateral, v
850á em ",s.jsx("strong",{className:"text-white",children:"WhatsApp"})," â ",s.jsx("strong",{className:"text-white",children:"API Setup"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"4.2"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-slate-300",children:["Localize a seção ",s.jsx("strong",{className:"text-white",children:'"Temporary access token"'})]}),s.jsx("p",{className:"text-slate-500 text-xs mt-1",children:"Este token expira em 24 horas - ideal para testes"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"4.3"}),s.jsxs("p",{className:"text-slate-300",children:["Clique em ",s.jsx("strong",{className:"text-white",children:'"Copy"'})," para copiar o token"]})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Exemplo de Access Token:"}),s.jsx("code",{className:"text-xs text-emerald-400 font-mono break-all",children:"EAAGm0PX4ZCps...xK2ZBzZA"})]}),s.jsx("div",{className:"bg-amber-500/10 border border-amber-500/30 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(ei,{className:"w-5 h-5 text-amber-400 flex-shrink-0 mt-0.5"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-amber-200 text-sm font-medium mb-1",children:"Token Permanente (Produção)"}),s.jsxs("p",{className:"text-amber-200/80 text-sm",children:["Para produção, crie um ",s.jsx("strong",{children:"System User"})," nas configurações do Business Manager e gere um token permanente. Vá em Business Settings â System Users â Generate Token."]})]})]})})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-lg flex-shrink-0",children:"5"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-white font-bold text-lg",children:"Obter Phone Number ID e Business Account ID"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Identificadores únicos do seu número e conta"})]})]}),s.jsxs("div",{className:"space-y-4 ml-14",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"5.
8501"}),s.jsxs("p",{className:"text-slate-300",children:["Na mesma página ",s.jsx("strong",{className:"text-white",children:"API Setup"}),", role para baixo"]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"5.2"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-slate-300",children:["Localize ",s.jsx("strong",{className:"text-emerald-400",children:'"Phone number ID"'})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-3 mt-2",children:[s.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Exemplo:"}),s.jsx("code",{className:"text-sm text-emerald-400 font-mono",children:"123456789012345"})]})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"5.3"}),s.jsxs("div",{children:[s.jsxs("p",{className:"text-slate-300",children:["Localize ",s.jsx("strong",{className:"text-emerald-400",children:'"WhatsApp Business Account ID"'})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-3 mt-2",children:[s.jsx("p",{className:"text-xs text-slate-400 mb-1",children:"Exemplo:"}),s.jsx("code",{className:"text-sm text-emerald-400 font-mono",children:"109876543210987"})]})]})]})]}),s.jsx("div",{className:"bg-red-500/10 border border-red-500/30 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Js,{className:"w-5 h-5 text-red-400 flex-shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-red-200 text-sm",children:[s.jsx("strong",{children:"Dica:"})," O Phone Number ID é diferente do número de telefone em si. à um identificador interno do Meta para seu número."]})]})})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-lg flex-shrink-0",children:"6"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-white font-bold text-lg",children:"Configurar Webhook"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Conecte o Meta ao seu sistema para receber mensagens"})]})]}),s.jsxs("div",{className:"space-y-4 ml-14",children:[s.jsx("div",{className:"bg-emerald-500/10 border border-emerald-500/30 rounded-lg p-4 mb-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Lr,{className:"w-5 h-5 text-emerald-400 flex-shrink-0 mt-0.5"}),s.jsxs("p",{className:"text-emerald-200 text-sm",children:[s.jsx("strong",{children:"Pré-requisito:"}),' Antes de configurar o webhook no Meta, você precisa ter preenchido as credenciais na aba "APIs" das Configurações do sistema. Isso gerará automaticamente a URL do Webhook e o Verify Token.']})]})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"6.1"}),s.jsxs("p",{className:"text-slate-300",children:["No seu sistema, vá em ",s.jsx("strong",{className:"text-white",children:"Configurações"})," â ",s.jsx("strong",{className:"text-white",children:"APIs"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"6.2"}),s.jsxs("p",{className:"text-slate-300",children:["Copie a ",s.jsx("strong",{className:"text-emerald-400",children:"URL do Webhook"})," e o ",s.jsx("strong",{className:"text-emerald-400",children:"Verify Token"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"6.3"}),s.jsxs("p",{className:"text-slate-300",children:["No Meta, vá em ",s.jsx("strong",{className:"text-white",children:"WhatsApp"})," â ",s.jsx("strong",{className:"text-white",children:"Configuration"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"6.4"}),s.jsxs("p",{className:"text-slate-300",children:["Na seção ",s.jsx("strong",{className:"text-white",children:'"Webhook"'}),", clique em ",s.jsx("strong",{className:"text-white",children:'"Edit"'})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"6.5"}),s.jsxs("p",{className:"text-slate-300",children:["Cole a ",s.jsx("strong",{className:"text-white",children:"Callback URL"})," (URL do Webhook do seu sistema)"]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"6.6"}),s.jsxs("p",{className:"text-slate-300",children:["Cole o ",s.jsx("strong",{className:"text-white",children:"Verify Token"})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"6.7"}),s.jsxs("p",{className:"text-slate-300",children:["Clique em ",s.jsx("strong",{className:"text-white",children:'"Verify and Save"'})]})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Formato da URL do Webhook:"}),s.jsx("code",{className:"text-xs text-emerald-400 font-mono break-all",children:"https://[project-id].supabase.co/functions/v1/whatsapp-webhook"})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("div",{className:"flex items-start gap-4 mb-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500 flex items-center justify-center text-white font-bold text-lg flex-shrink-0",children:"7"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-white font-bold text-lg",children:"Selecionar Eventos do Webhook"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Configure quais eventos serão enviados ao seu sistema"})]})]}),s.jsxs("div",{className:"space-y-4 ml-14",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"7.1"}),s.jsxs("p",{className:"text-slate-300",children:["Após verificar o webhook, clique em ",s.jsx("strong",{className:"text-white",children:'"Manage"'})]})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"7.2"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-slate-300 mb-2",children:"Ative (Subscribe) os seguintes eventos:"}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 px-3 py-2 rounded",children:[s.jsx(Lr,{className:"w-4 h-4 text-emerald-400"}),s.jsx("code",{className:"text-emerald-400 text-sm",children:"messages"}),s.jsx("span",{className:"text-slate-500 text-xs",children:"- Receber mensagens dos clientes"})]}),s.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 px-3 py-2 rounded",children:[s.jsx(Lr,{className:"w-4 h-4 text-emerald-400"}),s.jsx("code",{className:"text-emerald-400 text-sm",children:"message_echoes"}),s.jsx("span",{className:"text-slate-500 text-xs",children:"- Confirmação de mensagens enviadas"})]})]})]})]})]}),s.jsx("div",{className:"bg-slate-800 rounded-lg p-4 border border-slate-700",children:s.jsxs("p",{className:"text-xs text-slate-400",children:[s.jsx("strong",{className:"text-slate-300",children:"Opcional:"})," Você também pode ativar"," ",s.jsx("code",{className:"text-red-400",children:"message_status"})," para receber confirmações de leitura."]})})]})]}),s.jsxs("div",{className:"bg-gradient-to-br from-emerald-500/10 to-red-500/10 border border-emerald-500/20 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(Lr,{className:"w-5 h-5 text-emerald-400"}),"Checklist Final"]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded border-2 border-emerald-400 flex items-center justify-center",children:s.jsx(Lr,{className:"w-3 h-3 text-emerald-400"})}),s.jsx("p",{className:"text-slate-300 text-sm",children:"App criado no Meta for Developers"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded border-2 border-emerald-400 flex items-center justify-center",children:s.jsx(Lr,{className:"w-3 h-3 text-emerald-400"})}),s.jsx("p",{className:"text-slate-300 text-sm",children:"WhatsApp adicionado como produto"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded border-2 border-emerald-400 flex items-center justify-center",children:s.jsx(Lr,{className:"w-3 h-3 text-emerald-400"})}),s.jsx("p",{className:"text-slate-300 text-sm",children:"Access Token copiado e configurado"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded border-2 border-emerald-400 flex items-center justify-center",children:s.jsx(Lr,{className:"w-3 h-3 text-emerald-400"})}),s.jsx("p",{className:"text-slate-300 text-sm",children:"Phone Number ID copiado e configurado"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded border-2 border-emerald-400 flex items-center justify-center",children:s.jsx(Lr,{className:"w-3 h-3 text-emerald-400"})}),s.jsx("p",{className:"text-slate-300 text-sm",children:"Business Account ID copiado e configurado"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded border-2 border-emerald-400 flex items-center justify-center",children:s.jsx(Lr,{className:"w-3 h-3 text-emerald-400"})}),s.jsx("p",{className:"text-slate-300 text-sm",children:"Webhook configurado e verificado no Meta"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-5 h-5 rounded border-2 border-emerald-400 flex items-center justify-center",children:s.jsx(Lr,{className:"w-3 h-3 text-emerald-400"})}),s.jsxs("p",{className:"text-slate-300 text-sm",children:["Eventos ",s.jsx("code",{className:"text-red-400",children:"messages"})," e ",s.jsx("code",{className:"text-red-400",children:"message_echoes"})," ativados"]})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(ei,{className:"w-5 h-5 text-amber-400"}),"Solução de Problemas Comuns"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-amber-400 font-medium text-sm mb-2",children:'â "Token expirado" ou Erro 401'}),s.jsx("p",{className:"text-slate-400 text-sm",children:"O token temporário expira em 24 horas. Gere um novo token na página API Setup ou crie um token permanente através de um System User."})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-amber-400 font-medium text-sm mb-2",children:"â Webhook não verifica"}),s.jsx("p",{className:"text-slate-400 text-sm",children:"Verifique se o Verify Token está exatamente igual nos dois lugares (sistema e Meta). Certifique-se de que não há espaços extras
850no inÃcio ou fim."})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-amber-400 font-medium text-sm mb-2",children:"â Mensagens não chegam ao sistema"}),s.jsxs("ul",{className:"text-slate-400 text-sm space-y-1",children:[s.jsx("li",{children:'⢠Verifique se os eventos estão "Subscribed" (ativados)'}),s.jsx("li",{children:"⢠Confirme que o webhook está verificado (Ãcone verde)"}),s.jsx("li",{children:"⢠Teste enviando uma mensagem para o número de teste"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-amber-400 font-medium text-sm mb-2",children:"â Sistema não responde mensagens"}),s.jsxs("ul",{className:"text-slate-400 text-sm space-y-1",children:[s.jsx("li",{children:'⢠Verifique se o "Modo Automático" está ativado nas configurações do agente'}),s.jsx("li",{children:"⢠Confirme que o prompt do sistema está preenchido"}),s.jsx("li",{children:"⢠Verifique os logs no console do navegador"})]})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(Qi,{className:"w-5 h-5 text-red-400"}),"Links Ãteis"]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[s.jsxs("a",{href:"https://developers.facebook.com/docs/whatsapp/cloud-api/get-started",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-slate-800 hover:bg-slate-700 rounded-lg transition-colors",children:[s.jsx(Qi,{className:"w-4 h-4 text-red-400"}),s.jsx("span",{className:"text-slate-300 text-sm",children:"Documentação oficial WhatsApp Cloud API"})]}),s.jsxs("a",{href:"https://business.facebook.com/settings",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-slate-800 hover:bg-slate-700 rounded-lg transition-colors",children:[s.jsx(Qi,{className:"w-4 h-4 text-red-400"}),s.jsx("span",{className:"text-slate-300 text-sm",children:"Meta Business Settings"})]}),s.jsxs("a",{href:"https://developers.facebook.com/docs/whatsapp/cloud-api/reference/messages",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-slate-800 hover:bg-slate-700 rounded-lg transition-colors",children:[s.jsx(Qi,{className:"w-4 h-4 text-red-400"}),s.jsx("span",{className:"text-slate-300 text-sm",children:"Referência da API de Mensagens"})]}),s.jsxs("a",{href:"https://developers.facebook.com/docs/whatsapp/cloud-api/webhooks",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 bg-slate-800 hover:bg-slate-700 rounded-lg transition-colors",children:[s.jsx(Qi,{className:"w-4 h-4 text-red-400"}),s.jsx("span",{className:"text-slate-300 text-sm",children:"Documentação de Webhooks"})]})]})]})]})},{id:"overview",title:"ð Visão Geral da Arquitetura",icon:_Y,content:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(Yd,{className:"w-5 h-5 text-red-500"}),"Stack Tecnológica"]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-bold text-red-400 mb-2",children:"Frontend"}),s.jsxs("ul",{className:"text-sm text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠React 18 com TypeScript"}),s.jsx("li",{children:"⢠Vite (build tool)"}),s.jsx("li",{children:"⢠Tailwind CSS (estilização)"}),s.jsx("li",{children:"⢠shadcn/ui (componentes)"}),s.jsx("li",{children:"⢠React Router DOM (navegação)"}),s.jsx("li",{children:"⢠Tanstack Query (cache/fetch)"}),s.jsx("li",{children:"⢠react-hook-form + zod (formulários)"}),s.jsx("li",{children:"⢠date-fns + react-day-picker (datas)"}),s.jsx("li",{children:"⢠recharts (gráficos)"}),s.jsx("li",{children:"⢠sonner (notificações)"}),s.jsx("li",{children:"⢠embla-carousel (carrosséis)"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-bold text-emerald-400 mb-2",children:"Backend"}),s.jsxs("ul",{className:"text-sm text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠Supabase Edge Functions (Deno)"}),s.jsx("li",{children:"⢠PostgreSQL (banco de dados)"}),s.jsx("li",{children:"⢠Row Level Security (RLS)"}),s.jsx("li",{children:"⢠Realtime subscriptions (WebSocket)"}),s.jsx("li",{children:"⢠Lovable AI Gateway (Gemini/GPT)"}),s.jsx("li",{children:"⢠WhatsApp Cloud API"}),s.jsx("li",{children:"⢠ElevenLabs TTS API"})]})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Fluxo de Dados Principal"}),s.jsx("pre",{className:"text-xs text-slate-300 font-mono bg-slate-950 p-4 rounded border border-slate-700 overflow-x-auto",children:`WhatsApp Cloud API 851 â 852[whatsapp-webhook] Edge Function 853 â 854PostgreSQL (contacts, conversations, messages) 855 â
856[nina-orchestrator] Edge Function 857 â 858Lovable AI Gateway (Gemini/GPT) 859 â 860[whatsapp-sender] Edge Function 861 â 862WhatsApp Cloud API (resposta ao cliente)`})]})]})},{id:"frontend",title:"ð¥ï¸ Frontend - Páginas e Componentes",icon:yY,content:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-slate-900",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left p-4 text-red-400 font-bold",children:"Rota"}),s.jsx("th",{className:"text-left p-4 text-red-400 font-bold",children:"Componente"}),s.jsx("th",{className:"text-left p-4 text-red-400 font-bold",children:"Descrição"})]})}),s.jsxs("tbody",{className:"divide-y divide-slate-800",children:[s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/dashboard"}),s.jsx("td",{className:"p-4 text-white",children:"Dashboard.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Métricas principais, KPIs, gráficos de performance"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/chat"}),s.jsx("td",{className:"p-4 text-white",children:"ChatInterface.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Interface de conversas WhatsApp com sidebar de contatos"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/pipeline"}),s.jsx("td",{className:"p-4 text-white",children:"Kanban.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Pipeline de vendas/CRM com IA integrada para movimentação automática de deals"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/contacts"}),s.jsx("td",{className:"p-4 text-white",children:"Contacts.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Lista completa de contatos com filtros e tags"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/scheduling"}),s.jsx("td",{className:"p-4 text-white",children:"Scheduling.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Calendário de agendamentos com criação de reuniões"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/team"}),s.jsx("td",{className:"p-4 text-white",children:"Team.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Gestão de times, membros e funções"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/settings"}),s.jsx("td",{className:"p-4 text-white",children:"Settings.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Configurações do agente IA, integrações de APIs e documentação do sistema"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"/meeting/:id"}),s.jsx("td",{className:"p-4 text-white",children:"MeetingRoom.tsx"}),s.jsx("td",{className:"p-4 text-slate-400",children:"Sala de reunião virtual (rota externa)"})]})]})]})}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Modais e Componentes Especiais"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3 mb-6",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-red-400 font-bold text-xs mb-1",children:"CreateDealModal"}),s.jsx("p",{className:"text-slate-500 text-xs",children:"Criação de novos deals no CRM"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-emerald-400 font-bold text-xs mb-1",children:"LostReasonModal"}),s.jsx("p",{className:"text-slate-500 text-xs",children:"Captura motivo de perda de deal"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-violet-400 font-bold text-xs mb-1",children:"PipelineSettingsModal"}),s.jsx("p",{className:"text-slate-500 text-xs",children:"Configuração de estágios do funil"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-amber-400 font-bold text-xs mb-1",children:"TeamConfigModal"}),s.jsx("p",{className:"text-slate-500 text-xs",children:"Gestão de times e funções"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-pink-400 font-bold text-xs mb-1",children:"TagSelector"}),s.jsx("p",{className:"text-slate-500 text-xs",children:"Seleção e criação de tags"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-blue-400 font-bold text-xs mb-1",children:"PromptGeneratorSheet"}),s.jsx("p",{className:"text-slate-500 text-xs",children:"Geração de prompts com IA"})]})]}),s.jsx("h4",{className:"text-white font-bold mb-4",children:"Componentes Principais"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-red-400 font-bold mb-2",children:"ChatInterface.tsx"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠Sidebar com lista de conversas"}),s.jsx("li",{children:"⢠Ãrea de mensagens com scroll infinito"}),s.jsx("li",{children:"⢠Input de envio com suporte a texto"}),s.jsx("li",{children:"⢠Controles de takeover (assumir/reativar IA)"}),s.jsx("li",{children:"⢠Indicadores de status e typing"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-emerald-400 font-bold mb-2",children:"Kanban.tsx"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠Colunas dinâmicas de estágios"}),s.jsx("li",{children:"⢠Drag-and-drop entre estágios"}),s.jsx("li",{children:"⢠Modal de detalhes do deal"}),s.jsx("li",{children:"⢠Configuração de pipeline (PipelineSettingsModal)"}),s.jsx("li",{children:"⢠EstatÃsticas por estágio"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-violet-400 font-bold mb-2",children:"Settings.tsx"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsx("li",{children:'⢠Tab "Agente" (AgentSettings.tsx)'}),s.jsx("li",{children:'⢠Tab "APIs" (ApiSettings.tsx)'}),s.jsx("li",{children:'⢠Tab "Documentação" (SystemRoadmap.tsx)'}),s.jsx("li",{children:"⢠Gerador de prompts com IA"}),s.jsx("li",{children:"⢠Configuração de horários comerciais"}),s.jsx("li",{children:"⢠White-label (nome empresa/SDR)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("p",{className:"text-amber-400 font-bold mb-2",children:"Scheduling.tsx"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠Visualização semanal do calendário"}),s.jsx("li",{children:"⢠Criação de agendamentos"}),s.jsx("li",{children:"⢠Duração configurável (15-120min)"}),s.jsx("li",{children:"⢠Tipos: demo, meeting, support, followup"}),s.jsx("li",{children:"⢠Link de reunião virtual"})]})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6 mt-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(b8,{className:"w-5 h-5 text-red-400"}),"Componentes Reutilizáveis"]}),s.jsxs("p",{className:"text-slate-300 mb-4",children:["Componentes compartilhados em ",s.jsx("code",{className:"text-red-400",children:"src/components/"}),":"]}),s.jsxs("ul",{className:"list-disc list-inside space-y-2 text-slate-400 mb-6",children:[s.jsxs("li",{children:[s.jsx("strong",{className:"text-white",children:"Button.tsx"}),": Botão customizado com variants"]}),s.jsxs("li",{children:[s.jsx("strong",{className:"text-white",children:"Sidebar.tsx"}),": Menu lateral com navegação"]}),s.jsxs("li",{children:[s.jsx("strong",{className:"text-white",children:"TagSelector.tsx"}),": Seletor de tags para contatos"]}),s.jsxs("li",{children:[s.jsx("strong",{className:"text-white",children:"CreateDealModal.tsx"}),": Modal para criar deals"]}
862),s.jsxs("li",{children:[s.jsx("strong",{className:"text-white",children:"LostReasonModal.tsx"}),": Modal para marcar deal como perdido"]}),s.jsxs("li",{children:[s.jsx("strong",{className:"text-white",children:"PipelineSettingsModal.tsx"}),": Configuração de estágios"]}),s.jsxs("li",{children:[s.jsx("strong",{className:"text-white",children:"TeamConfigModal.tsx"}),": Gestão de times e funções"]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-5",children:[s.jsx("h5",{className:"text-lg font-semibold text-red-400 mb-3",children:"ð¨ Button Component Customizado"}),s.jsxs("p",{className:"text-slate-300 mb-3",children:["O componente ",s.jsx("code",{className:"text-red-400",children:"Button.tsx"})," utiliza ",s.jsx("code",{className:"text-red-400",children:"class-variance-authority"})," para variants tipadas:"]}),s.jsx("div",{className:"bg-slate-900 rounded-lg p-4 mb-4",children:s.jsx("pre",{className:"text-sm text-slate-300 overflow-x-auto",children:`// Variants disponÃveis: 863- primary: Gradiente cyan/teal com sombra glow (padrão) 864- secondary: Fundo slate-800, borda slate-700 865- outline: Transparente com borda slate-700 866- ghost: Texto slate-400, hover com bg slate-800 867- danger: Vermelho com fundo transparente 868- default: Igual ao secondary 869 870// Sizes disponÃveis: 871- sm: h-8, px-3, text-xs 872- md: h-10, px-4, text-sm (padrão) 873- lg: h-12, px-8, text-base 874- icon: h-10, w-10 (botão quadrado) 875 876// Uso: 877<Button variant="primary" size="md">Salvar</Button> 878<Button variant="outline">Cancelar</Button> 879<Button variant="danger" size="sm">Excluir</Button>`})}),s.jsxs("p",{className:"text-sm text-slate-400",children:["â¹ï¸ Todos os botões incluem animação ",s.jsx("code",{className:"text-red-400",children:"active:scale-95"})," e focus ring com ",s.jsx("code",{className:"text-red-400",children:"focus-visible:ring-2 ring-red-500"})]})]})]})]})},{id:"backend",title:"âï¸ Backend - Edge Functions",icon:QT,content:s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg overflow-hidden",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{className:"bg-slate-900",children:s.jsxs("tr",{children:[s.jsx("th",{className:"text-left p-4 text-red-400 font-bold",children:"Edge Function"}),s.jsx("th",{className:"text-left p-4 text-red-400 font-bold",children:"Propósito"}),s.jsx("th",{className:"text-left p-4 text-red-400 font-bold",children:"Autenticação"})]})}),s.jsxs("tbody",{className:"divide-y divide-slate-800",children:[s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-emerald-400",children:"whatsapp-webhook"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Recebe webhooks do WhatsApp Cloud API, processa mensagens recebidas"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-red-400",children:"nina-orchestrator"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Processa fila de mensagens, gera respostas via IA, gerencia contexto"}),s.jsx("td",{className:"p-4 text-amber-400",children:"verify_jwt: true"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-violet-400",children:"whatsapp-sender"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Processa fila de envio, envia mensagens via WhatsApp Cloud API"}),s.jsx("td",{className:"p-4 text-amber-400",children:"verify_jwt: true"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-blue-400",children:"analyze-conversation"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Análise de conversa com IA, extração de insights, movimentação automática de deals"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-pink-400",children:"generate-prompt"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Gerador de system prompts personalizados usando Gemini 3 Pro"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"simulate-webhook"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Simula mensagens recebidas para testes (desenvolvimento)"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"trigger-nina-orchestrator"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Trigger auxiliar para chamar nina-orchestrator via HTTP"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"trigger-whatsapp-sender"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Trigger auxiliar para chamar whatsapp-sender via HTTP"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"seed-appointments"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Popula tabela appointments com dados de exemplo (desenvolvimento)"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]}),s.jsxs("tr",{children:[s.jsx("td",{className:"p-4 font-mono text-slate-400",children:"test-whatsapp-message"}),s.jsx("td",{className:"p-4 text-slate-300",children:"Envia mensagem de teste via WhatsApp Cloud API"}),s.jsx("td",{className:"p-4 text-slate-500",children:"verify_jwt: false"})]})]})]})}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Arquitetura de Chamadas"}),s.jsxs("p",{className:"text-sm text-slate-400 mb-4",children:["As Edge Functions se comunicam diretamente via ",s.jsx("code",{className:"text-red-400 bg-slate-950 px-2 py-1 rounded",children:"fetch()"})," com autenticação via SERVICE_ROLE_KEY:"]}),s.jsx("pre",{className:"text-xs text-slate-300 font-mono bg-slate-950 p-4 rounded border border-slate-700 overflow-x-auto",children:`// Exemplo de chamada entre funções 880const response = await fetch( 881 \`\${SUPABASE_URL}/functions/v1/nina-orchestrator\`, 882 { 883 method: 'POST', 884 headers: { 885 'Authorization': \`Bearer \${SERVICE_ROLE_KEY}\`, 886 'Content-Type': 'application/json' 887 }, 888 body: JSON.stringify({ messageId, conversationId }) 889 } 890);`})]})]})}
vendor: 15,208 bytes, lines 890-944
890,{id:"database",title:"ðï¸ Banco de Dados - Tabelas Principais",icon:yl,content:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6 mb-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(yl,{className:"w-5 h-5 text-red-400"}),"ð Diagrama de Relacionamentos (ER)"]}),s.jsx("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:s.jsx("pre",{className:"text-xs text-slate-300 overflow-x-auto whitespace-pre",children:`erDiagram 891 contacts ||--o{ conversations : "tem" 892 contacts ||--o{ deals : "gera" 893 contacts ||--o{ appointments : "agenda" 894 895 conversations ||--o{ messages : "contém" 896 conversations ||--o| conversation_states : "possui" 897 898 deals ||--o{ deal_activities : "registra" 899 deals }o--|| pipeline_stages : "está em" 900 deals }o--o| team_members : "atribuÃdo a" 901 902 teams ||--o{ team_members : "possui" 903 team_functions ||--o{ team_members : "define" 904 905 messages }o--|| message_processing_queue : "processa" 906 messages }o--|| nina_processing_queue : "analisa" 907 messages }o--|| send_queue : "envia" 908 909 contacts { 910 uuid id PK 911 text phone_number UK 912 text name 913 text email 914 jsonb client_memory 915 text_array tags 916 boolean is_blocked 917 } 918 919 conversations { 920 uuid id PK 921 uuid contact_id FK 922 conversation_status status 923 team_assignment assigned_team 924 jsonb nina_context 925 } 926 927 messages { 928 uuid id PK 929 uuid conversation_id FK 930 message_type type 931 message_from from_type 932 message_status status 933 text content 934 } 935 936 deals { 937 uuid id PK 938 uuid contact_id FK 939 uuid stage_id FK 940 uuid owner_id FK 941 text title 942 numeric value 943 text stage 944 }`})}),s.jsxs("p",{className:"text-sm text-slate-400 mt-4 flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400",children:"â¹ï¸"}),s.jsxs("span",{children:["Este diagrama mostra os principais relacionamentos do banco. Copie o código Mermaid acima para visualizar em ferramentas como ",s.jsx("a",{href:"https://mermaid.live",target:"_blank",rel:"noopener noreferrer",className:"text-red-400 hover:underline",children:"mermaid.live"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-red-400 font-bold mb-3 text-sm",children:"contacts"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Armazena dados dos contatos/clientes"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠id, phone_number, name, email"}),s.jsx("li",{children:"⢠tags[], client_memory (JSONB)"}),s.jsx("li",{children:"⢠is_blocked, blocked_reason"}),s.jsx("li",{children:"⢠first_contact_date, last_activity"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-emerald-400 font-bold mb-3 text-sm",children:"conversations"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Gerencia conversas ativas"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠id, contact_id, status (nina/human/paused)"}),s.jsx("li",{children:"⢠assigned_team, assigned_user_id"}),s.jsx("li",{children:"⢠nina_context (JSONB)"}),s.jsx("li",{children:"⢠last_message_at, is_active"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-violet-400 font-bold mb-3 text-sm",children:"messages"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Histórico completo de mensagens"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠id, conversation_id, content"}),s.jsx("li",{children:"⢠from_type (user/nina/human)"}),s.jsx("li",{children:"⢠type (text/audio/image/document/video)"}),s.jsx("li",{children:"⢠status (sent/delivered/read/failed)"}),s.jsx("li",{children:"⢠whatsapp_message_id"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-amber-400 font-bold mb-3 text-sm",children:"deals"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Oportunidades no pipeline CRM"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠id, title, value, stage_id"}),s.jsx("li",{children:"⢠contact_id, owner_id"}),s.jsx("li",{children:"⢠priority, tags[], notes"}),s.jsx("li",{children:"⢠won_at, lost_at, lost_reason"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-pink-400 font-bold mb-3 text-sm",children:"pipeline_stages"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Estágios customizáveis do funil"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠id, title, color, position"}),s.jsx("li",{children:"⢠is_ai_managed (true/false)"}),s.jsx("li",{children:"⢠ai_trigger_criteria (texto)"}),s.jsx("li",{children:"⢠is_system, is_active"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-blue-400 font-bold mb-3 text-sm",children:"appointments"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Agendamentos e reuniões"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠id, title, description"}),s.jsx("li",{children:"⢠date, time, duration (minutos)"}),s.jsx("li",{children:"⢠type (demo/meeting/support/followup)"}),s.jsx("li",{children:"⢠contact_id, meeting_url"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-orange-400 font-bold mb-3 text-sm",children:"nina_settings"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Configurações globais do agente IA"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠company_name, sdr_name"}),s.jsx("li",{children:"⢠openai_model, openai_assistant_id"}),s.jsx("li",{children:"⢠system_prompt_override"}),s.jsx("li",{children:"⢠auto_response_enabled, ai_model_mode"}),s.jsx("li",{children:"⢠business_hours, business_days"})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-5",children:[s.jsx("h4",{className:"text-slate-400 font-bold mb-3 text-sm",children:"team_members / teams"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Estrutura de equipe e funções"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠teams: name, color, description"}),s.jsx("li",{children:"⢠team_functions: name, description"}),s.jsx("li",{children:"⢠team_members: name, email, role"}),s.jsx("li",{children:"⢠status (active/invited/disabled)"})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Filas de Processamento"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-red-400 font-mono text-xs",children:"nina_processing_queue"}),s.jsx("span",{className:"text-slate-400 text-xs",children:"â Mensagens aguardando processamento pela IA"})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-emerald-400 font-mono text-xs",children:"send_queue"}),s.jsx("span",{className:"text-slate-400 text-xs",children:"â Mensagens aguardando envio via WhatsApp"})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-violet-400 font-mono text-xs",children:"message_processing_queue"}),s.jsx("span",{className:"text-slate-400 text-xs",children:"â Fila de mensagens brutas recebidas do webhook"})]}),s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("span",{className:"text-slate-400 font-mono text-xs",children:"message_grouping_queue"}),s.jsx("span",{className:"text-slate-400 text-xs",children:"â Agrupamento temporário de mensagens do webhook"})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Tabelas Adicionais"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-4",children:[s.jsx("h5",{className:"text-red-400 font-bold text-sm mb-2",children:"conversation_states"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Estado de máquina para conversas"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠current_state (idle/active/scheduling)"}),s.jsx("li",{children:"⢠last_action, last_action_at"}),s.jsx("li",{children:"⢠scheduling_context (JSONB)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-4",children:[s.jsx("h5",{className:"text-emerald-400 font-bold text-sm mb-2",children:"deal_activities"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Atividades vinculadas a deals"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠title, description, type"}),s.jsx("li",{children:"⢠scheduled_at, completed_at"}),s.jsx("li",{children:"⢠created_by (team_member)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-4",children:[s.jsx("h5",{className:"text-violet-400 font-bold text-sm mb-2",children:"tag_definitions"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Definições de tags do sistema"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠key, label, color"}),s.jsx("li",{children:"⢠category (status/interest/action)"}),s.jsx("li",{children:"⢠is_active"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-4",children:[s.jsx("h5",{className:"text-amber-400 font-bold text-sm mb-2",children:"contacts_with_stats (VIEW)"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"View com estatÃsticas agregadas"}),s.jsxs("ul",{className:"text-xs text-slate-500 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠total_messages, nina_messages"}),s.jsx("li",{children:"⢠user_messages, human_messages"}),s.jsx("li",{children:"⢠Todos os campos de contacts"})]})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Database Functions (Stored Procedures)"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-red-400 font-mono text-xs mb-1",children:"claim_nina_processing_batch(p_limit)"}),s.jsx("p",{className:"text-slate-400 text-xs",children:"Atomicamente busca e marca mensagens como 'processing' na nina_processing_queue"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-emerald-400 font-mono text-xs mb-1",children:"claim_send_queue_batch(p_limit)"}),s.jsx("p",{className:"text-slate-400 text-xs",children:"Atomicamente busca e marca mensagens como 'processing' na send_queue"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-violet-400 font-mono text-xs mb-1",children:"claim_message_processing_batch(p_limit)"}),s.jsx("p",{className:"text-slate-400 text-xs",children:"Atomicamente busca e marca webhooks na message_processing_queue"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-amber-400 font-mono text-xs mb-1",children:"get_or_create_conversation_state(p_conversation_id)"}),s.jsx("p",{className:"text-slate-400 text-xs",children:"Retorna o estado da conversa ou cria um novo se não existir"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-pink-400 font-mono text-xs mb-1",children:"update_conversation_state(p_conversation_id, p_new_state, ...)"}),s.jsx("p",{className:"text-slate-400 text-xs",children:"Atualiza o estado da máquina de conversas com contexto e ação"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-blue-400 font-mono text-xs mb-1",children:"update_client_memory(p_contact_id, p_new_memory)"}),s.jsx("p",{className:"text-slate-400 text-xs",children:"Atualiza o JSONB client_memory de um contato"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-orange-400 font-mono text-xs mb-1",children:"cleanup_processed_queues()"}),s.jsx("p",{className:"text-slate-400 text-xs",children:"Remove registros antigos das filas de processamento (>24h completed, >7d failed)"})]})]})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Database Triggers"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-red-400 font-bold text-xs mb-1",children:"update_updated_at_column (8 tabelas)"}),s.jsxs("p",{className:"text-slate-400 text-xs",children:["Trigger ",s.jsx("code",{className:"text-slate-500",children:"BEFORE UPDATE"})," que automaticamente atualiza ",s.jsx("code",{children:"updated_at = now()"})]}),s.jsx("p",{className:"text-slate-500 text-xs mt-1",children:"Tabelas: contacts, conversations, conversation_states, nina_processing_queue, message_processing_queue, send_queue, nina_settings, tag_definitions"})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-emerald-400 font-bold text-xs mb-1",children:"update_conversation_last_message"}),s.jsxs("p",{className:"text-slate-400 text-xs",children:["Trigger ",s.jsx("code",{className:"text-slate-500",children:"AFTER INSERT"})," em messages que atualiza last_message_at nas conversations e last_activity nos contacts"]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded p-3",children:[s.jsx("p",{className:"text-violet-400 font-bold text-xs mb-1",children:"create_deal_for_new_contact"}),s.jsxs("p",{className:"text-slate-400 text-xs",children:["Trigger ",s.jsx("code",{className:"text-slate-500",children:"AFTER INSERT"})," em contacts que automaticamente cria um deal no estágio 'new'"]})]})]})]})]})}
944,{id:"enums",title:"ð·ï¸ Database ENUMs",icon:yl,content:s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Tipos Enumerados do PostgreSQL"}),s.jsx("p",{className:"text-sm text-slate-400 mb-4",children:"O sistema usa ENUMs nativos do PostgreSQL para garantir integridade de dados em campos especÃficos."}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-red-400 font-bold mb-2 text-sm",children:"appointment_type"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Tipo de compromisso agendado"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠demo"}),s.jsx("li",{children:"⢠meeting"}),s.jsx("li",{children:"⢠support"}),s.jsx("li",{children:"⢠followup"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-emerald-400 font-bold mb-2 text-sm",children:"conversation_status"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Estado da conversa"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠nina (IA respondendo)"}),s.jsx("li",{children:"⢠human (agente humano)"}),s.jsx("li",{children:"⢠paused (pausada)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-violet-400 font-bold mb-2 text-sm",children:"member_role"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Papel do membro da equipe"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠admin (administrador)"}),s.jsx("li",{children:"⢠manager (gerente)"}),s.jsx("li",{children:"⢠agent (agente)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-amber-400 font-bold mb-2 text-sm",children:"member_status"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Status do membro"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠active (ativo)"}),s.jsx("li",{children:"⢠invited (convidado)"}),s.jsx("li",{children:"⢠disabled (desabilitado)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-pink-400 font-bold mb-2 text-sm",children:"message_from"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Origem da mensagem"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠user (cliente)"}),s.jsx("li",{children:"⢠nina (IA)"}),s.jsx("li",{children:"⢠human (agente humano)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-blue-400 font-bold mb-2 text-sm",children:"message_status"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Status de entrega da mensagem"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠sent (enviada)"}),s.jsx("li",{children:"⢠delivered (entregue)"}),s.jsx("li",{children:"⢠read (lida)"}),s.jsx("li",{children:"⢠failed (falhou)"}),s.jsx("li",{children:"⢠processing (processando)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-orange-400 font-bold mb-2 text-sm",children:"message_type"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Tipo de mÃdia da mensagem"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠text (texto)"}),s.jsx("li",{children:"⢠audio (áudio)"}),s.jsx("li",{children:"⢠image (imagem)"}),s.jsx("li",{children:"⢠document (documento)"}),s.jsx("li",{children:"⢠video (vÃdeo)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-rose-400 font-bold mb-2 text-sm",children:"queue_status"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Status de itens nas filas"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠pending (pendente)"}),s.jsx("li",{children:"⢠processing (processando)"}),s.jsx("li",{children:"⢠completed (completado)"}),s.jsx("li",{children:"⢠failed (falhou)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-rose-400 font-bold mb-2 text-sm",children:"team_assignment"}),s.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Time de atendimento atribuÃdo"}),s.jsxs("ul",{className:"text-xs text-slate-300 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠mateus"}),s.jsx("li",{children:"⢠igor"}),s.jsx("li",{children:"⢠fe"}),s.jsx("li",{children:"⢠vendas"}),s.jsx("li",{children:"⢠suporte"})]})]})]}),s.jsx("div",{className:"bg-red-900/20 border border-red-700/50 rounded-lg p-4 mt-4",children:s.jsxs("p",{className:"text-sm text-red-200 flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"ð¡"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Por que usar ENUMs?"})," ENUMs garantem que apenas valores válidos sejam inseridos no banco, prevenindo erros de digitação e mantendo consistência. São mais eficientes que strings livres e facilitam validação no TypeScript (src/integrations/supabase/types.ts)."]})]})})]})})}
944,{id:"flows",title:"ð Fluxos Principais do Sistema",icon:lY,content:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(Tn,{className:"w-5 h-5 text-red-500"}),"1. Fluxo de Mensagem Recebida"]}),s.jsx("pre",{className:"text-xs text-slate-300 font-mono bg-slate-950 p-4 rounded border border-slate-700 overflow-x-auto leading-loose",children:`âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 945â Cliente envia mensagem via WhatsApp â 946ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 947 â 948âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 949â [whatsapp-webhook] Edge Function â 950â ⢠Valida webhook do WhatsApp Cloud API â 951â ⢠Cria/atualiza contact no DB â 952â ⢠Cria/atualiza conversation â 953â ⢠Insere message na tabela messages â 954ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 955 â 956âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 957â Adiciona item à nina_processing_queue â 958â ⢠priority = 1 (padrão) â 959â ⢠status = 'pending' â 960â ⢠context_data = { contact, conversation, message } â 961ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 962 â 963âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 964â [nina-orchestrator] Edge Function (chamada via fetch) â 965â ⢠Busca context: contato + conversa + histórico â 966â ⢠Verifica se deve responder (auto_response_enabled) â 967â ⢠Processa templates dinâmicos ({{ data_hora }}, etc) â 968â ⢠Envia prompt ao Lovable AI Gateway â 969â ⢠Recebe resposta da IA â 970ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 971 â 972âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 973â Quebra resposta em chunks (se message_breaking_enabled) â 974â ⢠Split por \\n\\n (double newline) â 975â ⢠Adiciona cada chunk à send_queue â 976â ⢠scheduled_at com delays progressivos (~1.5s entre cada) â 977ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 978 â 979âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 980â [whatsapp-sender] Edge Function (chamada via fetch) â 981â ⢠Processa send_queue em loop (até 25 segundos) â 982â ⢠Respeita scheduled_at de cada chunk â 983â ⢠Envia via WhatsApp Cloud API â 984â ⢠Salva whatsapp_message_id na tabela messages â 985â ⢠Atualiza status do item na fila: 'completed' â 986âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 987 â 988âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 989â Cliente recebe mensagens no WhatsApp â 990âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ`})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(KT,{className:"w-5 h-5 text-emerald-500"}),"2. Fluxo de Análise de Conversa"]}),s.jsx("pre",{className:"text-xs text-slate-300 font-mono bg-slate-950 p-4 rounded border border-slate-700 overflow-x-auto leading-loose",children:`âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 991â nina-orchestrator processa mensagem â 992ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 993 â 994âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 995â Verifica total de mensagens na conversa â 996â ⢠Se mensagem 1, 5, 10, 15, 20... â Trigger análise â 997ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 998 â (EdgeRuntime.waitUntil - assÃncrono) 999âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1000â [analyze-conversation] Edge Function â 1001â ⢠Busca todas as mensagens da conversa â 1002â ⢠Monta prompt de análise com histórico completo â 1003â ⢠Envia ao Lovable AI Gateway (Gemini 2.5 Flash) â 1004ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1005 â 1006âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1007â IA retorna análise estruturada (JSON) â 1008â ⢠interests: array de interesses do cliente â 1009â ⢠pain_points: array de dores identificadas â 1010â ⢠qualification_score: 0-100 â 1011â ⢠next_best_action: próxima ação recomendada â 1012â ⢠budget_indication: low/medium/high/unknown â 1013â ⢠decision_timeline: immediate/short/medium/long/unknown â 1014ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1015 â 1016âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1017â Atualiza contacts.client_memory (merge com dados anteriores)â 1018ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1019 â 1020âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1021â Busca pipeline_stages com is_ai_managed = true â 1022â Monta prompt: "Qual estágio adequado para este deal?" â 1023â IA analisa e retorna: { suggestedStageId, confidence } â 1024ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1025 â 1026âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ
1027â Se confidence > 70% â Move deal automaticamente â 1028â Senão â Registra sugestão mas não move â 1029âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ`})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsxs("h4",{className:"text-white font-bold mb-4 flex items-center gap-2",children:[s.jsx(fo,{className:"w-5 h-5 text-violet-500"}),"3. Fluxo de Takeover Humano"]}),s.jsx("pre",{className:"text-xs text-slate-300 font-mono bg-slate-950 p-4 rounded border border-slate-700 overflow-x-auto leading-loose",children:`âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1030â Agente humano clica "Assumir Conversa" na interface â 1031ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1032 â 1033âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1034â Frontend atualiza conversation.status = 'human' â 1035â (via supabase.from('conversations').update()) â 1036ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1037 â 1038âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1039â nina-orchestrator detecta status = 'human' â 1040â ⢠Não adiciona item à nina_processing_queue â 1041â ⢠IA para de responder automaticamente â 1042ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1043 â 1044âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1045â Agente responde manualmente via ChatInterface â 1046â ⢠Mensagens têm from_type = 'human' â 1047â ⢠Adicionadas diretamente ao send_queue â 1048ââââââââââââââââââââââ¬âââââââââââââââââââââââââââââââââââââââââ 1049 â 1050âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ 1051â Quando resolver, agente clica "Reativar IA" â 1052â conversation.status = 'nina' â 1053â IA volta a responder automaticamente â 1054âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ`})]})]})},{id:"hooks",title:"ð§© Hooks e Contextos",icon:Yd,content:s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Custom Hooks"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-red-400 font-bold mb-3",children:"useConversations"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Hook central para gerenciar todas as conversas e mensagens com realtime subscriptions."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3 mb-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Funcionalidades:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-red-400",children:"fetchConversations()"})," - Busca inicial de conversas"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-red-400",children:"sendMessage(conversationId, content)"})," - Envia mensagem com optimistic update"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-red-400",children:"updateStatus(conversationId, status)"})," - Alterna nina/human/paused"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-red-400",children:"markAsRead(conversationId)"})," - Marca mensagens como lidas"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-red-400",children:"assignConversation(conversationId, userId)"})," - Atribui a agente"]})]})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Realtime Subscriptions:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠",s.jsx("strong",{children:"messages"})," - INSERT/UPDATE â atualiza estado otimisticamente"]}),s.jsxs("li",{children:["⢠",s.jsx("strong",{children:"conversations"})," - INSERT/UPDATE â refetch ou atualiza local"]}),s.jsxs("li",{children:["⢠Deduplicação por ID temporário (temp-","{timestamp}",")"]})]})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3 mt-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Detalhes de Implementação:"}),s.jsx("pre",{className:"text-xs text-slate-400 font-mono overflow-x-auto",children:`// 1. Cria channel com schema-db-changes 1055const messagesChannel = supabase.channel('messages-channel') 1056 .on('postgres_changes', { 1057 event: 'INSERT', 1058 schema: 'public', 1059 table: 'messages' 1060 }, (payload) => { 1061 // Ignora se ID já existe (dedup) 1062 if (!conversations.some(msg => msg.id === payload.new.id)) { 1063 setConversations(prev => updateWithNewMessage(prev, payload.new)); 1064 } 1065 }) 1066 .subscribe(); 1067 1068// 2. Optimistic update ao enviar mensagem 1069const tempId = \`temp-\${Date.now()}\`; 1070setConversations(prev => addTempMessage(prev, tempId, content)); 1071 1072// 3. Após INSERT no DB, substitui temp ID pelo real 1073const { data } = await supabase.from('messages').insert(...); 1074setConversations(prev => replaceTempId(prev, tempId, data.id)); 1075 1076// 4. Realtime detecta INSERT â deduplicação ignora (ID real já existe)`})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-emerald-400 font-bold mb-3",children:"useCompanySettings"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Context Provider global que carrega e compartilha configurações de white-label (company_name, sdr_name)."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Valores Expostos:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-emerald-400",children:"companyName"}),' - Nome da empresa (fallback: "Sua Empresa")']}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-emerald-400",children:"sdrName"}),' - Nome do agente IA (fallback: "Agente IA")']}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-emerald-400",children:"loading"})," - Estado de carregamento"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-emerald-400",children:"refetch()"})," - Recarrega settings do banco"]})]})]}),s.jsx("p",{className:"text-xs text-slate-500 mt-3",children:"ð¡ Usado em Sidebar, ChatInterface, Settings, PromptGenerator para branding dinâmico."})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-violet-400 font-bold mb-3",children:"useIsMobile"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Hook para detectar viewport mobile (breakpoint: 768px)."}),s.jsx("div",{className:"bg-slate-900 rounded p-3",children:s.jsx("pre",{className:"text-xs text-slate-300 font-mono overflow-x-auto",children:`const isMobile = useIsMobile(); 1077 1078{isMobile ? ( 1079 <MobileLayout /> 1080) : ( 1081 <DesktopLayout /> 1082)}`})})]})]})]})})}
1082,{id:"services",title:"ð§ Serviços e API",icon:QT,content:s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"src/services/api.ts (1182 linhas)"}),s.jsx("p",{className:"text-sm text-slate-400 mb-4",children:"Camada de serviço centralizada que abstrai todas as operações CRUD com Supabase. Todas as chamadas ao banco passam por este arquivo."}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-red-400 font-bold mb-3 text-sm",children:"Contacts API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchContacts()"}),s.jsx("li",{children:"⢠fetchContactById(id)"}),s.jsx("li",{children:"⢠updateContact(id, data)"}),s.jsx("li",{children:"⢠deleteContact(id)"}),s.jsx("li",{children:"⢠blockContact(id, reason)"}),s.jsx("li",{children:"⢠unblockContact(id)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-emerald-400 font-bold mb-3 text-sm",children:"Conversations API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchConversations()"}),s.jsx("li",{children:"⢠fetchMessages(conversationId)"}),s.jsx("li",{children:"⢠sendMessage(conversationId, content)"}),s.jsx("li",{children:"⢠updateConversationStatus(id, status)"}),s.jsx("li",{children:"⢠assignConversation(id, userId)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-violet-400 font-bold mb-3 text-sm",children:"Deals API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchDeals()"}),s.jsx("li",{children:"⢠createDeal(data)"}),s.jsx("li",{children:"⢠updateDeal(id, data)"}),s.jsx("li",{children:"⢠deleteDeal(id)"}),s.jsx("li",{children:"⢠moveDeal(id, stageId)"}),s.jsx("li",{children:"⢠markDealAsWon(id)"}),s.jsx("li",{children:"⢠markDealAsLost(id, reason)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-amber-400 font-bold mb-3 text-sm",children:"Team API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchTeamMembers()"}),s.jsx("li",{children:"⢠fetchTeams()"}),s.jsx("li",{children:"⢠fetchTeamFunctions()"}),s.jsx("li",{children:"⢠createTeamMember(data)"}),s.jsx("li",{children:"⢠updateTeamMember(id, data)"}),s.jsx("li",{children:"⢠deleteTeamMember(id)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-pink-400 font-bold mb-3 text-sm",children:"Appointments API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchAppointments(date)"}),s.jsx("li",{children:"⢠createAppointment(data)"}),s.jsx("li",{children:"⢠updateAppointment(id, data)"}),s.jsx("li",{children:"⢠deleteAppointment(id)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-blue-400 font-bold mb-3 text-sm",children:"Settings API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchNinaSettings()"}),s.jsx("li",{children:"⢠updateNinaSettings(data)"}),s.jsx("li",{children:"⢠testWhatsAppMessage(phone, message)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-orange-400 font-bold mb-3 text-sm",children:"Pipeline API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchPipelineStages()"}),s.jsx("li",{children:"⢠createPipelineStage(data)"}),s.jsx("li",{children:"⢠updatePipelineStage(id, data)"}),s.jsx("li",{children:"⢠deletePipelineStage(id)"}),s.jsx("li",{children:"⢠reorderPipelineStages(stages[])"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-rose-400 font-bold mb-3 text-sm",children:"Tags API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchTagDefinitions()"}),s.jsx("li",{children:"⢠createTagDefinition(data)"}),s.jsx("li",{children:"⢠updateContactTags(contactId, tags[])"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-rose-400 font-bold mb-3 text-sm",children:"Deal Activities API"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠fetchDealActivities(dealId)"}),s.jsx("li",{children:"⢠createDealActivity(dealId, data)"}),s.jsx("li",{children:"⢠updateDealActivity(id, data)"}),s.jsx("li",{children:"⢠deleteDealActivity(id)"})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-indigo-400 font-bold mb-3 text-sm",children:"Métodos Extras"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsx("li",{children:"⢠updateContactNotes(contactId, notes)"}),s.jsx("li",{children:"⢠toggleContactBlock(contactId, blocked)"}),s.jsx("li",{children:"⢠markMessagesAsRead(conversationId)"}),s.jsx("li",{children:"⢠fetchConversationMessages(conversationId)"}),s.jsx("li",{children:"⢠fetchDashboardMetrics()"}),s.jsx("li",{children:"⢠fetchChartData(period)"})]})]})]})]})})}
1082,{id:"types",title:"ð¦ Tipos e Interfaces",icon:XT,content:s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Tipos Principais (src/types.ts)"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-red-400 font-bold mb-3 text-sm",children:"ClientMemory (JSONB)"}),s.jsxs("p",{className:"text-xs text-slate-400 mb-3",children:["Estrutura de memória contextual do cliente armazenada em ",s.jsx("code",{className:"text-red-400",children:"contacts.client_memory"})]}),s.jsx("pre",{className:"text-xs text-slate-300 font-mono bg-slate-900 p-3 rounded overflow-x-auto",children:`interface ClientMemory { 1083 last_updated: string | null; 1084 conversation_history: Array<{ 1085 date: string; 1086 summary: string; 1087 }>; 1088 lead_profile: { 1089 lead_stage: "new" | "qualified" | "engaged" | "hot"; 1090 interests: string[]; 1091 objections: string[]; 1092 products_discussed: string[]; 1093 communication_style: string; 1094 qualification_score: number; // 0-100 1095 }; 1096 sales_intelligence: { 1097 pain_points: string[]; 1098 budget_indication: "unknown" | "low" | "medium" | "high"; 1099 decision_timeline: string; 1100 next_best_action: string; 1101 }; 1102 interaction_summary: { 1103 total_conversations: number; 1104 last_contact_reason: string; 1105 response_pattern: string; 1106 preferred_contact_time: string; 1107 }; 1108}`})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-emerald-400 font-bold mb-3 text-sm",children:"Transformações DB â UI"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"O sistema usa tipos diferentes para o banco (DBConversation/DBMessage) e para UI (UIConversation/UIMessage)."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Motivo:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠",s.jsx("strong",{children:"DB"}),": Usa ",s.jsx("code",{children:"contact_id"})," (UUID), ",s.jsx("code",{children:"from_type"})," (enum)"]}),s.jsxs("li",{children:["⢠",s.jsx("strong",{children:"UI"}),": Hydrata com objeto ",s.jsx("code",{children:"contact: Contact"})," completo, agrupa mensagens"]}),s.jsx("li",{children:"⢠Transforma timestamps em Date objects"}),s.jsx("li",{children:"⢠Calcula unreadCount no frontend"})]})]}),s.jsx("pre",{className:"text-xs text-slate-300 font-mono bg-slate-900 p-3 rounded overflow-x-auto mt-3",children:`// useConversations.ts 1109const transformConversation = (dbConv: DBConversation): UIConversation => { 1110 return { 1111 ...dbConv, 1112 contact: { /* objeto Contact completo */ }, 1113 messages: dbConv.messages.map(transformMessage), 1114 unreadCount: calculateUnread(dbConv.messages), 1115 }; 1116};`})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-amber-400 font-bold mb-3 text-sm",children:"Utility Functions (src/types.ts)"}),s.jsx("p",{className:"text-xs text-slate-400 mb-3",children:"Funções auxiliares para transformação e formatação de dados."}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-1",children:"transformDBToUIConversation(dbConv, messages)"}),s.jsx("p",{className:"text-xs text-slate-400",children:"Converte DBConversation + DBMessage[] para UIConversation com hidratação de objetos"})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-1",children:"transformDBToUIMessage(dbMsg)"}),s.jsx("p",{className:"text-xs text-slate-400",children:"Converte DBMessage para UIMessage, mapeia status/type/direction"})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-1",children:"formatRelativeTime(date)"}),s.jsx("p",{className:"text-xs text-slate-400",children:'Formata data em texto relativo: "há 2 horas", "ontem", "há 3 dias"'})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-1",children:"formatMessageTime(timestamp)"}),s.jsx("p",{className:"text-xs text-slate-400",children:'Formata timestamp para hora legÃvel: "14:30"'})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-1",children:"getDefaultClientMemory()"}),s.jsx("p",{className:"text-xs text-slate-400",children:"Factory que retorna estrutura ClientMemory inicial com valores default"})]})]})]})]})]})})}
1116,{id:"advanced",title:"ð Funcionalidades Avançadas",icon:Yd,content:s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Sistemas Complexos Implementados"}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-red-400 font-bold mb-3",children:"1. Deduplicação de Mensagens"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Sistema de optimistic updates com IDs temporários para evitar duplicatas na UI."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Fluxo:"}),s.jsxs("ol",{className:"text-xs text-slate-400 space-y-1 list-decimal list-inside",children:[s.jsxs("li",{children:["Usuário envia mensagem â cria ",s.jsxs("code",{className:"text-red-400",children:["temp-","{timestamp}"]})]}),s.jsx("li",{children:"Mensagem inserida no banco â retorna ID real"}),s.jsx("li",{children:"ID temporário é substituÃdo pelo real no estado"}),s.jsx("li",{children:"Realtime subscription detecta INSERT â compara ID real"}),s.jsx("li",{children:"Se ID já existe, ignora (evita duplicata)"})]})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-emerald-400 font-bold mb-3",children:"2. Message Chunking & Timing"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Respostas longas da IA são quebradas em múltiplas mensagens para simular digitação natural."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3 mb-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Quando message_breaking_enabled = true:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠Nina retorna resposta com delimitador ",s.jsx("code",{className:"text-emerald-400",children:"\\n\\n"})]}),s.jsxs("li",{children:["⢠whatsapp-sender split() por ",s.jsx("code",{children:"\\n\\n"})]}),s.jsx("li",{children:"⢠Cada chunk vira uma mensagem separada na send_queue"}),s.jsx("li",{children:"⢠scheduled_at aumenta ~1.5s entre chunks"}),s.jsx("li",{children:"⢠whatsapp-sender processa em loop por 25s"})]})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-amber-300 mb-1",children:"â ï¸ Problema conhecido:"}),s.jsx("p",{className:"text-xs text-slate-400",children:"Chunks órfãos na fila podem ser enviados com próximas respostas. Solução: Loop de 25s garante que chunks do mesmo contexto sejam processados juntos."})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-violet-400 font-bold mb-3",children:"3. Adaptive AI Mode"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Sistema que seleciona dinamicamente o modelo de IA baseado no contexto da conversa."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Critérios de seleção (nina-orchestrator):"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠",s.jsx("strong",{children:"Usa gemini-2.5-pro se:"})," conversa longa (>10 msgs), urgente, técnica, objeções detectadas"]}),s.jsxs("li",{children:["⢠",s.jsx("strong",{children:"Usa gemini-2.5-flash se:"})," conversa curta, saudações, confirmações simples"]}),s.jsx("li",{children:"⢠Ajusta temperatura: 0.7 (pro) vs 0.8 (flash)"}),s.jsx("li",{children:"⢠Configurável via nina_settings.ai_model_mode = 'adaptive'"})]})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-amber-400 font-bold mb-3",children:"4. Template Variables no Prompt"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"System prompt suporta variáveis dinâmicas processadas em runtime."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Variáveis disponÃveis:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1 font-mono",children:[s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-amber-400",children:"{{ data_hora }}"}),' â "29/11/2024 14:30"']}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-amber-400",children:"{{ data }}"}),' â "29/11/2024"']}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-amber-400",children:"{{ hora }}"}),' â "14:30"']}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-amber-400",children:"{{ dia_semana }}"}),' â "Sexta-feira"']}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-amber-400",children:"{{ cliente_nome }}"})," â Nome do contato"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-amber-400",children:"{{ cliente_telefone }}"})," â Telefone do contato"]})]})]}),s.jsx("p",{className:"text-xs text-slate-500 mt-3",children:"ð¡ Processado por uma função template processor antes do envio à IA."})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-pink-400 font-bold mb-3",children:"5. Sincronização Conversa â Deal"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Sistema bidirecional de sincronização entre conversas e pipeline de vendas."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3 mb-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Automações:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠Novo contato â trigger cria deal automático no estágio 'new'"}),s.jsx("li",{children:"⢠Atribuir conversa a agente â atribui deal ao mesmo agente"}),s.jsx("li",{children:"⢠Análise de conversa (a cada 5 msgs) â IA sugere novo estágio"}),s.jsx("li",{children:"⢠Se confidence > 70% â move deal automaticamente"}
1116),s.jsx("li",{children:"⢠ChatInterface mostra dados do deal na sidebar"}),s.jsx("li",{children:"⢠Modal de deal mostra últimas 15 mensagens da conversa"})]})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Nina Insights visÃveis no deal:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠qualification_score (0-100)"}),s.jsx("li",{children:"⢠interests[], pain_points[]"}),s.jsx("li",{children:"⢠next_best_action"}),s.jsx("li",{children:"⢠budget_indication, decision_timeline"})]})]})]}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsx("h5",{className:"text-blue-400 font-bold mb-3",children:"6. Pipeline Stages AI-Managed"}),s.jsx("p",{className:"text-sm text-slate-400 mb-3",children:"Estágios podem ser configurados para movimentação automática por IA."}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Configuração:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-blue-400",children:"is_ai_managed: true"})," â IA pode mover para este estágio"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-blue-400",children:"ai_trigger_criteria: string"})," â Descrição de quando mover"]}),s.jsx("li",{children:"⢠analyze-conversation consulta apenas estágios com criteria definida"}),s.jsx("li",{children:"⢠Estágios Manual â IA ignora, só humano pode mover"}),s.jsx("li",{children:"⢠Estágios system (won/lost) â protegidos contra delete"})]})]})]})]})]})})},{id:"whitelabel",title:"ð¨ Configuração White-Label",icon:wY,content:s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("p",{className:"text-sm text-slate-400 mb-6",children:"O sistema é 100% white-label. Todas as configurações abaixo podem ser editadas via interface, sem tocar no código:"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("h4",{className:"text-red-400 font-bold mb-3 text-sm flex items-center gap-2",children:[s.jsx(r0,{className:"w-4 h-4"}),"Identidade Visual"]}),s.jsx("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Nome da Empresa:"})," ",s.jsx("span",{className:"text-slate-400",children:"Editável em Settings â Agente â Informações da Empresa"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Nome do SDR/Agente:"})," ",s.jsx("span",{className:"text-slate-400",children:"Editável em Settings â Agente â Informações da Empresa"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Uso no Sistema:"})," ",s.jsx("span",{className:"text-slate-400",children:"Sidebar, ChatInterface, Settings, status labels, prompts dinâmicos"})]})]})]})})]}),s.jsxs("div",{children:[s.jsxs("h4",{className:"text-emerald-400 font-bold mb-3 text-sm flex items-center gap-2",children:[s.jsx(Yd,{className:"w-4 h-4"}),"Comportamento da IA"]}),s.jsx("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-emerald-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"System Prompt:"})," ",s.jsx("span",{className:"text-slate-400",children:"Editável manualmente ou gerar com IA (Gemini 3 Pro)"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-emerald-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Modelo de IA:"})," ",s.jsx("span",{className:"text-slate-400",children:"Flash, Pro 2.5, Pro 3, ou Adaptive Mode"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-emerald-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Horário Comercial:"})," ",s.jsx("span",{className:"text-slate-400",children:"Dias da semana + faixa de horário (ex: 09:00 - 18:00)"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-emerald-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Timing:"})," ",s.jsx("span",{className:"text-slate-400",children:"Delays entre mensagens, quebra de texto em chunks"})]})]})]})})]}),s.jsxs("div",{children:[s.jsxs("h4",{className:"text-violet-400 font-bold mb-3 text-sm flex items-center gap-2",children:[s.jsx(lN,{className:"w-4 h-4"}),"Integrações de API"]}),s.jsx("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-violet-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"WhatsApp Cloud API:"})," ",s.jsx("span",{className:"text-slate-400",children:"Access Token + Phone Number ID + Verify Token"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-violet-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"ElevenLabs (opcional):"})," ",s.jsx("span",{className:"text-slate-400",children:"API Key + Voice ID + configurações avançadas (stability, speed, style)"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-violet-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Agendamento Nativo:"})," ",s.jsx("span",{className:"text-slate-400",children:"Integrado via Nina (create/reschedule/cancel appointment)"})]})]})]})})]}),s.jsxs("div",{children:[s.jsxs("h4",{className:"text-amber-400 font-bold mb-3 text-sm flex items-center gap-2",children:[s.jsx(KT,{className:"w-4 h-4"}),"Pipeline e CRM"]}),s.jsx("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-amber-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Estágios do Pipeline:"})," ",s.jsx("span",{className:"text-slate-400",children:"Criar/editar/reordenar/deletar estágios via modal de configuração"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-amber-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"IA nos Estágios:"})," ",s.jsx("span",{className:"text-slate-400",children:"Marcar como Manual ou Automático + definir critérios de trigger"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-amber-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Tags de Contatos:"})," ",s.jsx("span",{className:"text-slate-400",children:"Criar tags customizadas com cores e categorias"})]})]})]})})]}),s.jsxs("div",{children:[s.jsxs("h4",{className:"text-pink-400 font-bold mb-3 text-sm flex items-center gap-2",children:[s.jsx(fo,{className:"w-4 h-4"}),"Gestão de Equipe"]}),s.jsx("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-pink-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Times:"})," ",s.jsx("span",{className:"text-slate-400",children:"Criar/editar times com nome, descrição e c
1116or"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-pink-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Funções:"})," ",s.jsx("span",{className:"text-slate-400",children:"Criar/editar funções (ex: SDR, Closer, CS, Suporte)"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-pink-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("span",{className:"font-bold",children:"Membros:"})," ",s.jsx("span",{className:"text-slate-400",children:"Adicionar agentes com nome, email, função, time, peso de distribuição"})]})]})]})})]})]})]})})},{id:"secrets",title:"ð Variáveis de Ambiente e Secrets",icon:lN,content:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("p",{className:"text-sm text-slate-400 mb-6",children:"As credenciais são armazenadas em dois lugares:"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-red-400 font-bold mb-3 text-sm",children:"1. Variáveis de Ambiente (.env)"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("p",{className:"text-xs text-slate-400 mb-3",children:[s.jsx("strong",{children:"â ï¸ Gerenciadas automaticamente pelo Supabase/Lovable Cloud"})," - Não editar manualmente:"]}),s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2 font-mono",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400",children:"â¢"}),s.jsx("code",{className:"text-xs",children:"VITE_SUPABASE_URL"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400",children:"â¢"}),s.jsx("code",{className:"text-xs",children:"VITE_SUPABASE_PUBLISHABLE_KEY"})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400",children:"â¢"}),s.jsx("code",{className:"text-xs",children:"VITE_SUPABASE_PROJECT_ID"})]})]})]})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-emerald-400 font-bold mb-3 text-sm",children:"2. Credentials na Tabela (nina_settings)"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("p",{className:"text-xs text-slate-400 mb-3",children:[s.jsx("strong",{children:"â
Editáveis via Settings â APIs"}),":"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-bold text-violet-400 mb-2",children:"WhatsApp Cloud API (obrigatório)"}),s.jsxs("ul",{className:"text-sm text-slate-300 space-y-1 font-mono pl-4",children:[s.jsx("li",{className:"text-xs",children:s.jsx("code",{children:"whatsapp_access_token"})}),s.jsx("li",{className:"text-xs",children:s.jsx("code",{children:"whatsapp_phone_number_id"})}),s.jsxs("li",{className:"text-xs",children:[s.jsx("code",{children:"whatsapp_verify_token"})," (padrão: webhook-verify-token)"]})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-bold text-amber-400 mb-2",children:"ElevenLabs (opcional - text-to-speech)"}),s.jsxs("ul",{className:"text-sm text-slate-300 space-y-1 font-mono pl-4",children:[s.jsx("li",{className:"text-xs",children:s.jsx("code",{children:"elevenlabs_api_key"})}),s.jsx("li",{className:"text-xs",children:s.jsx("code",{children:"elevenlabs_voice_id"})}),s.jsx("li",{className:"text-xs",children:s.jsx("code",{children:"elevenlabs_model"})}),s.jsxs("li",{className:"text-xs",children:[s.jsx("code",{children:"elevenlabs_stability"}),", ",s.jsx("code",{children:"elevenlabs_style"}),", etc."]})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-bold text-pink-400 mb-2",children:"Agendamento"}),s.jsxs("ul",{className:"text-sm text-slate-300 space-y-1 pl-4",children:[s.jsxs("li",{className:"text-xs",children:["â
Agendamento é ",s.jsx("strong",{children:"nativo"})," via Nina (create/reschedule/cancel)"]}),s.jsxs("li",{className:"text-xs",children:["Dados salvos na tabela ",s.jsx("code",{children:"appointments"})]})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-xs font-bold text-blue-400 mb-2",children:"IA (Lovable AI Gateway)"}),s.jsxs("ul",{className:"text-sm text-slate-300 space-y-1 pl-4",children:[s.jsxs("li",{className:"text-xs",children:["â
O sistema usa ",s.jsx("strong",{children:"Lovable AI Gateway"})," (Gemini/GPT)"]}),s.jsx("li",{className:"text-xs",children:"Não requer API key própria da OpenAI"})]})]})]})]})]})]})]}),s.jsx("div",{className:"bg-amber-900/20 border border-amber-700/50 rounded-lg p-4",children:s.jsxs("p",{className:"text-sm text-amber-200 flex items-start gap-2",children:[s.jsx("span",{className:"text-amber-400 font-bold",children:"â ï¸"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Importante:"})," Nunca commitar credenciais no código. Todas as secrets devem estar em nina_settings ou em variáveis de ambiente gerenciadas pelo Lovable/Supabase."]})]})})]})}
1116,{id:"howto",title:"ð Como Modificar o Sistema",icon:XT,content:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6",children:[s.jsx("h4",{className:"text-white font-bold mb-4",children:"Guia de Modificações"}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("h5",{className:"text-red-400 font-bold mb-3 text-sm",children:"1. Adicionar Nova Página"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("ol",{className:"text-sm text-slate-300 space-y-2 list-decimal list-inside",children:[s.jsxs("li",{children:["Criar componente em ",s.jsx("code",{className:"text-red-400",children:"src/components/NovaPagina.tsx"})]}),s.jsxs("li",{children:["Adicionar rota em ",s.jsx("code",{className:"text-red-400",children:"src/App.tsx"})]}),s.jsxs("li",{children:["Adicionar link na ",s.jsx("code",{className:"text-red-400",children:"Sidebar.tsx"})]})]}),s.jsx("pre",{className:"text-xs text-slate-400 font-mono bg-slate-900 p-3 rounded mt-3 overflow-x-auto",children:`// App.tsx 1117<Route path="/nova-pagina" element={<NovaPagina />} /> 1118 1119// Sidebar.tsx 1120<Link to="/nova-pagina"> 1121 <Icon className="w-5 h-5" /> 1122 Nova Página 1123</Link>`})]})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-emerald-400 font-bold mb-3 text-sm",children:"2. Adicionar Nova Edge Function"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("ol",{className:"text-sm text-slate-300 space-y-2 list-decimal list-inside",children:[s.jsxs("li",{children:["Criar pasta ",s.jsx("code",{className:"text-emerald-400",children:"supabase/functions/minha-funcao/"})]}),s.jsxs("li",{children:["Criar ",s.jsx("code",{className:"text-emerald-400",children:"index.ts"})," dentro da pasta"]}),s.jsxs("li",{children:["Adicionar configuração em ",s.jsx("code",{className:"text-emerald-400",children:"supabase/config.toml"})]}),s.jsx("li",{children:"Deploy automático ao commitar"})]}),s.jsx("pre",{className:"text-xs text-slate-400 font-mono bg-slate-900 p-3 rounded mt-3 overflow-x-auto",children:`// supabase/config.toml 1124[functions.minha-funcao] 1125verify_jwt = false # ou true se precisa autenticação 1126 1127// index.ts 1128Deno.serve(async (req) => { 1129 // Sua lógica aqui 1130 return new Response(JSON.stringify({ success: true }), { 1131 headers: { 'Content-Type': 'application/json' } 1132 }); 1133});`})]})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-violet-400 font-bold mb-3 text-sm",children:"3. Modificar Comportamento da IA"}),s.jsx("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-violet-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Via Interface:"})," Settings â Agente â Editar prompt manualmente ou gerar com IA"]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-violet-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Via Código:"})," Editar lógica de processamento em ",s.jsx("code",{className:"text-violet-400",children:"nina-orchestrator/index.ts"})]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-violet-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Modelos DisponÃveis:"})," google/gemini-2.5-flash, google/gemini-2.5-pro, google/gemini-3-pro-preview, openai/gpt-5, openai/gpt-5-mini, openai/gpt-5-nano"]})]})]})})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-amber-400 font-bold mb-3 text-sm",children:"4. Adicionar Novo Estágio no Pipeline"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("ol",{className:"text-sm text-slate-300 space-y-2 list-decimal list-inside",children:[s.jsxs("li",{children:["Ir para ",s.jsx("code",{className:"text-amber-400",children:"/kanban"})]}),s.jsx("li",{children:'Clicar em "Configurar" no canto superior direito'}),s.jsx("li",{children:'Clicar em "+ Adicionar Estágio"'}),s.jsx("li",{children:"Definir nome, cor, tipo (Manual/Automático)"}),s.jsx("li",{children:"Se Automático, adicionar critérios de trigger para IA"})]}),s.jsx("p",{className:"text-xs text-slate-400 mt-3",children:"ð¡ Estágios automáticos serão usados pela IA para mover deals quando os critérios forem detectados."})]})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-pink-400 font-bold mb-3 text-sm",children:"5. Adicionar Nova Tabela no Banco"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("ol",{className:"text-sm text-slate-300 space-y-2 list-decimal list-inside",children:[s.jsxs("li",{children:["Criar migration SQL em ",s.jsx("code",{className:"text-pink-400",children:"supabase/migrations/"})]}),s.jsx("li",{children:"Definir colunas, constraints, Ãndices"}),s.jsx("li",{children:"Adicionar RLS policies para segurança"}),s.jsxs("li",{children:["Criar triggers para ",s.jsx("code",{children:"updated_at"})," se necessário"]}),s.jsxs("li",{children:["O arquivo ",s.jsx("code",{className:"text-pink-400",children:"src/integrations/supabase/types.ts"})," será auto-gerado"]})]}),s.jsx("pre",{className:"text-xs text-slate-400 font-mono bg-slate-900 p-3 rounded mt-3 overflow-x-auto",children:`CREATE TABLE public.minha_tabela ( 1134 id UUID PRIMARY KEY DEFAULT gen_random_uuid(), 1135 created_at TIMESTAMPTZ NOT NULL DEFAULT now(), 1136 updated_at TIMESTAMPTZ NOT NULL DEFAULT now(), 1137 -- suas colunas 1138); 1139 1140ALTER TABLE public.minha_tabela ENABLE ROW LEVEL SECURITY; 1141 1142CREATE POLICY "Allow all" ON public.minha_tabela 1143 FOR ALL USING (true) WITH CHECK (true);`})]})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-blue-400 font-bold mb-3 text-sm",children:"6. Customizar Cores e Tema"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("ul",{className:"text-sm text-slate-300 space-y-2",children:[s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-blue-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Cores Principais:"})," Editar ",s.jsx("code",{className:"text-blue-400",children:"src/index.css"})," (variáveis HSL)"]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-blue-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Tailwind Config:"})," Editar ",s.jsx("code",{className:"text-blue-400",children:"tailwind.config.ts"})," para novos tokens"]})]}),s.jsxs("li",{className:"flex items-start gap-2",children:[s.jsx("span",{className:"text-blue-400",children:"â¢"}),s.jsxs("div",{children:[s.jsx("strong",{children:"Componentes UI:"})," Editar ",s.jsx("code",{className:"text-blue-400",children:"src/components/ui/*"})," (shadcn variants)"]})]})]}),s.jsxs("p",{className:"text-xs text-slate-400 mt-3",children:["ð¡ Todas as cores devem usar ",s.jsx("strong",{children:"semantic tokens"})," (--primary, --background, etc.) para manter consistência."]})]})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-purple-400 font-bold mb-3 text-sm",children:"7. Mock Data e Desenvolvimento"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("p",{className:"text-sm text-slate-300 mb-3",children:["O sistema possui dados mock em ",s.jsx("code",{className:"text-purple-400",children:"src/constants.ts"})," para desenvolvimento e testes."]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3 mb-3",children:[s.jsx("p",{className:"text-xs text-slate-300 font-mono mb-2",children:"Conjuntos de mock data disponÃveis:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-purple-400",children:"MOCK_TEAM"})," - Membros da equipe"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-purple-400",children:"MOCK_CONTACTS"})," - Contatos de exemplo"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-purple-400",children:"MOCK_CONVERSATIONS"})," - Conversas simuladas"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-purple-400",children:"MOCK_APPOINTMENTS"})," - Compromissos de exemplo"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-purple-400",children:"MOCK_DEALS"}
1143)," - Deals para o pipeline"]}),s.jsxs("li",{children:["⢠",s.jsx("code",{className:"text-purple-400",children:"MOCK_BACKEND_FUNCTIONS"})," - Edge functions simuladas"]})]})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3",children:[s.jsx("p",{className:"text-xs text-amber-300 mb-2",children:"â ï¸ Quando usar mocks:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsx("li",{children:"⢠Durante desenvolvimento local sem banco configurado"}),s.jsx("li",{children:"⢠Para testes de interface antes de conectar APIs"}),s.jsx("li",{children:"⢠Como fallback quando banco está vazio (UX melhor)"})]})]}),s.jsxs("div",{className:"bg-slate-900 rounded p-3 mt-3",children:[s.jsx("p",{className:"text-xs text-emerald-300 mb-2",children:"â Para produção:"}),s.jsxs("ul",{className:"text-xs text-slate-400 space-y-1",children:[s.jsxs("li",{children:["⢠Remover ou desabilitar mocks em ",s.jsx("code",{children:"src/services/api.ts"})]}),s.jsx("li",{children:"⢠Garantir que todas as queries retornam dados reais do Supabase"}),s.jsx("li",{children:"⢠Testar comportamento com banco vazio (empty states)"})]})]})]})]}),s.jsxs("div",{children:[s.jsx("h5",{className:"text-indigo-400 font-bold mb-3 text-sm",children:"8. Customizar Navegação (Sidebar)"}),s.jsxs("div",{className:"bg-slate-950 border border-slate-700 rounded-lg p-4",children:[s.jsxs("p",{className:"text-sm text-slate-300 mb-3",children:["Para adicionar, remover ou reordenar itens do menu lateral, edite o array ",s.jsx("code",{className:"text-indigo-400",children:"menuItems"})," em ",s.jsx("code",{className:"text-indigo-400",children:"src/components/Sidebar.tsx"}),":"]}),s.jsx("div",{className:"bg-slate-900 rounded-lg p-4 mb-4",children:s.jsx("pre",{className:"text-xs text-slate-300 overflow-x-auto",children:`const menuItems = [ 1144 { id: 'dashboard', label: 'Dashboard', icon: LayoutDashboard }, 1145 { id: 'kanban', label: 'Pipeline', icon: Kanban }, 1146 { id: 'contacts', label: 'Contatos', icon: Users }, 1147 { id: 'chat', label: 'Chat', icon: MessageSquare }, 1148 { id: 'scheduling', label: 'Agenda', icon: Calendar }, 1149 { id: 'team', label: 'Time', icon: Users }, 1150 { id: 'functions', label: 'Backend', icon: Code }, 1151 { id: 'settings', label: 'Configurações', icon: Settings }, 1152]; 1153 1154// Para adicionar um novo item: 1155// 1. Importe o Ãcone do Lucide: 1156// import { NovoIcon } from 'lucide-react'; 1157// 2. Adicione ao array: 1158// { id: 'nova-rota', label: 'Novo Item', icon: NovoIcon } 1159// 3. Crie a rota correspondente no App.tsx 1160// 4. Crie o componente da página em src/components/`})}),s.jsxs("p",{className:"text-xs text-slate-400 flex items-start gap-2",children:[s.jsx("span",{className:"text-indigo-400",children:"â¹ï¸"}),s.jsxs("span",{children:["O ",s.jsx("code",{className:"text-indigo-400",children:"id"})," deve corresponder à rota definida no React Router. O item ativo é automaticamente destacado com ",s.jsx("code",{className:"text-indigo-400",children:"bg-red-500/10"}),"."]})]})]})]})]})]}),s.jsx("div",{className:"bg-red-900/20 border border-red-700/50 rounded-lg p-4",children:s.jsxs("p",{className:"text-sm text-red-200 flex items-start gap-2",children:[s.jsx("span",{className:"text-red-400 font-bold",children:"ð¡"}),s.jsxs("span",{children:[s.jsx("strong",{children:"Dica:"})," Para modificações avançadas, consulte a documentação do Supabase (",s.jsx("a",{href:"https://supabase.com/docs",className:"underline",children:"supabase.com/docs"}),") e do React (",s.jsx("a",{href:"https://react.dev",className:"underline",children:"react.dev"}),"). O código é 100% open-source e pode ser customizado livremente."]})]})})]})}];return s.jsxs("div",{className:"space-y-4 pb-20",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-lg p-6 mb-6",children:[s.jsxs("p",{className:"text-slate-300 text-sm leading-relaxed",children:["Esta documentação foi criada para ajudar você a entender a arquitetura completa do sistema. Como este é um projeto ",s.jsx("strong",{className:"text-red-400",children:"white-label"}),", todas as funcionalidades podem ser customizadas através da interface ou editando o código diretamente."]}),s.jsx("p",{className:"text-slate-400 text-xs mt-3",children:"ð¡ Clique nas seções abaixo para expandir e ver detalhes."})]}),n.map(a=>{const i=t.includes(a.id),o=a.icon;return s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl overflow-hidden hover:border-slate-700 transition-colors",children:[s.jsxs("button",{onClick:()=>r(a.id),className:"w-full p-5 flex items-center justify-between hover:bg-slate-900/80 transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(o,{className:"w-5 h-5 text-red-400"}),s.jsx("h3",{className:"text-lg font-bold text-white text-left",children:a.title})]}),i?s.jsx(Ga,{className:"w-5 h-5 text-slate-400"}):s.jsx(t0,{className:"w-5 h-5 text-slate-400"})]}),i&&s.jsx("div",{className:"p-6 pt-0 border-t border-slate-800/50 animate-in fade-in duration-200",children:a.content})]},a.id)})]})},Dje=()=>{var p,v;const{companyName:t,isAdmin:e}=Yu(),r=w.useRef(null),n=w.useRef(null),[a,i]=w.useState("agent"),{resetWizard:o}=U0(),{setShowOnboarding:l}=a8(),u=()=>{o(),l(!0)},d=async()=>{var b,y;a==="agent"?await((b=r.current)==null?void 0:b.save()):a==="apis"&&await((y=n.current)==null?void 0:y.save())},h=()=>{var b,y;a==="agent"?(b=r.current)==null||b.cancel():a==="apis"&&((y=n.current)==null||y.cancel())},m=a==="agent"?(p=r.current)==null?void 0:p.isSaving:(v=n.current)==null?void 0:v.isSaving;return s.jsxs("div",{className:"p-8 max-w-5xl mx-auto h-full overflow-y-auto bg-slate-950 text-slate-50 custom-scrollbar",children:[s.jsxs("div",{className:"mb-10 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-bold tracking-tight text-white",children:"Configurações"}),s.jsxs("p",{className:"text-sm text-slate-400 mt-1",children:["Central de controle da sua instância ",t,".",!e&&s.jsx("span",{className:"ml-2 text-amber-400",children:"(Somente leitura)"})]})]}),s.jsxs("div",{className:"flex gap-2 items-center",children:[e&&s.jsxs(Ne,{variant:"ghost",size:"sm",onClick:u,className:"text-slate-400 hover:text-white gap-2",children:[s.jsx(N8,{className:"w-4 h-4"}),"Refazer Onboarding"]}),s.jsx("span",{className:"px-3 py-1 bg-red-500/10 border border-red-500/20 text-red-400 text-xs rounded-full font-mono flex items-center",children:e?s.jsxs(s.Fragment,{children:[s.jsx(S8,{className:"w-3 h-3 mr-1"})," Admin"]}):s.jsxs(s.Fragment,{children:[s.jsx(xg,{className:"w-3 h-3 mr-1"})," Somente Leitura"]})})]})]}),s.jsxs(Az,{defaultValue:"agent",className:"w-full",onValueChange:i,children:[s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsxs(gE,{children:[s.jsxs(eu,{value:"agent",className:"gap-2",children:[s.jsx(Or,{className:"w-4 h-4"}),"Agente"]}),s.jsxs(eu,{value:"apis",className:"gap-2",children:[s.jsx(jY,{className:"w-4 h-4"}),"APIs"]}),s.jsxs(eu,{value:"docs",className:"gap-2",children:[s.jsx(QK,{className:"w-4 h-4"}),"Documentação"]})]}),a!=="docs"&&e&&s.jsxs("div",{className:"flex gap-3",children:[s.jsx(Ne,{variant:"ghost",onClick:h,disabled:m,children:"Cancelar"}),s.jsx(Ne,{variant:"primary",onClick:d,disabled:m,className:"gap-2",children:m?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-4 h-4 animate-spin"}),"Salvando..."]}):s.jsxs(s.Fragment,{children:[s.jsx(dN,{className:"w-4 h-4"}),"Salvar Alterações"]})})]}),a!=="docs"&&!e&&s.jsxs("div",{className:"flex items-center gap-2 text-sm text-amber-400",children:[s.jsx(xg,{className:"w-4 h-4"}),"Apenas administradores podem editar"]})]}),s.jsx(tu,{value:"agent",children:s.jsx(cU,{ref:r})}),s.jsx(tu,{value:"apis",children:s.jsx(mU,{ref:n})}),s.jsx(tu,{value:"docs",children:s.jsx(Ije,{})})]})]})},$je=({isOpen:t,onClose:e,onUpdate:r})=>{const[n,a]=w.useState("teams"),[i,o]=w.useState([]),[l,u]=w.useState([]),[d,h]=w.useState(!0),[m,p]=w.useState(null),[v,b]=w.useState({name:"",description:"",color:"#3b82f6"}),[y,x]=w.useState(!1);w.useEffect(()=>{t&&(j(),N())},[t]);const j=async()=>{h(!0);try{const[D,L]=await Promise.all([Ge.fetchTeams(),Ge.fetchTeamFunctions()]);o(D),u(L)}catch(D){console.error("Error loading data:",D)}finally{h(!1)}},N=()=>{const D=ve.channel("teams-changes").on("postgres_changes",{event:"*",schema:"public",table:"teams"},()=>{j()}).subscribe(),L=ve.channel("functions-changes").on("postgres_changes",{event:"*",schema:"public",table:"team_functions"},()=>{j()}).subscribe();return()=>{ve.removeChannel(D),ve.removeChannel(L)}},S=async()=>
1160{if(v.name.trim())try{await Ge.createTeam({name:v.name,description:v.description,color:v.color}),b({name:"",description:"",color:"#3b82f6"}),x(!1),r()}catch(D){console.error("Error creating team:",D)}},k=async()=>{if(v.name.trim())try{await Ge.createTeamFunction({name:v.name,description:v.description}),b({name:"",description:"",color:"#3b82f6"}),x(!1),r()}catch(D){console.error("Error creating function:",D)}},C=async D=>{try{await Ge.updateTeam(D,{name:v.name,description:v.description,color:v.color}),p(null),b({name:"",description:"",color:"#3b82f6"}),r()}catch(L){console.error("Error updating team:",L)}},A=async D=>{try{await Ge.updateTeamFunction(D,{name:v.name,description:v.description}),p(null),b({name:"",description:"",color:"#3b82f6"}),r()}catch(L){console.error("Error updating function:",L)}},T=async D=>{if(confirm("Tem certeza que deseja excluir este time?"))try{await Ge.deleteTeam(D),r()}catch(L){console.error("Error deleting team:",L)}},R=async D=>{if(confirm("Tem certeza que deseja excluir esta função?"))try{await Ge.deleteTeamFunction(D),r()}catch(L){console.error("Error deleting function:",L)}},I=(D,L)=>{p(D.id),b({name:D.name,description:D.description||"",color:L==="team"&&D.color||"#3b82f6"})};return t?s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:s.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-xl shadow-2xl max-w-2xl w-full max-h-[80vh] overflow-hidden animate-in zoom-in-95 duration-200",children:[s.jsxs("div",{className:"p-6 border-b border-slate-800 flex justify-between items-center",children:[s.jsx("h3",{className:"text-lg font-bold text-white",children:"âï¸ Configurar Equipe"}),s.jsx("button",{onClick:e,className:"text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"flex border-b border-slate-800",children:[s.jsx("button",{onClick:()=>a("teams"),className:`flex-1 px-6 py-3 text-sm font-medium transition-colors ${n==="teams"?"text-white border-b-2 border-red-500 bg-slate-800/50":"text-slate-400 hover:text-white"}`,children:"ð¢ Times"}),s.jsx("button",{onClick:()=>a("functions"),className:`flex-1 px-6 py-3 text-sm font-medium transition-colors ${n==="functions"?"text-white border-b-2 border-red-500 bg-slate-800/50":"text-slate-400 hover:text-white"}`,children:"ð¼ Funções"})]}),s.jsx("div",{className:"p-6 overflow-y-auto max-h-[50vh] custom-scrollbar",children:d?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(gt,{className:"h-6 w-6 animate-spin text-red-500"})}):n==="teams"?s.jsxs("div",{className:"space-y-3",children:[y?s.jsxs("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-4 space-y-3",children:[s.jsx("input",{type:"text",placeholder:"Nome do time",value:v.name,onChange:D=>b({...v,name:D.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsx("input",{type:"text",placeholder:"Descrição (opcional)",value:v.description,onChange:D=>b({...v,description:D.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"color",value:v.color,onChange:D=>b({...v,color:D.target.value}),className:"w-12 h-8 rounded cursor-pointer"}),s.jsx("span",{className:"text-xs text-slate-400",children:"Cor do time"})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{onClick:S,className:"flex-1",children:"Salvar"}),s.jsx(Ne,{onClick:()=>x(!1),variant:"ghost",children:"Cancelar"})]})]}):s.jsxs("button",{onClick:()=>x(!0),className:"w-full bg-slate-800/30 border border-dashed border-slate-700 rounded-lg p-4 text-slate-400 hover:text-white hover:border-slate-600 transition-colors flex items-center justify-center gap-2",children:[s.jsx(ts,{className:"w-4 h-4"}),"Novo Time"]}),i.map(D=>s.jsx("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-4",children:m===D.id?s.jsxs("div",{className:"space-y-3",children:[s.jsx("input",{type:"text",value:v.name,onChange:L=>b({...v,name:L.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsx("input",{type:"text",value:v.description,onChange:L=>b({...v,description:L.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("input",{type:"color",value:v.color,onChange:L=>b({...v,color:L.target.value}),className:"w-12 h-8 rounded cursor-pointer"})}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Ne,{onClick:()=>C(D.id),size:"sm",children:[s.jsx(dN,{className:"w-3 h-3 mr-1"}),"Salvar"]}),s.jsx(Ne,{onClick:()=>p(null),variant:"ghost",size:"sm",children:"Cancelar"})]})]}):s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-4 h-4 rounded-full",style:{backgroundColor:D.color||"#3b82f6"}}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-white",children:D.name}),D.description&&s.jsx("div",{className:"text-xs text-slate-400",children:D.description})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>I(D,"team"),className:"p-2 text-slate-400 hover:text-white transition-colors",children:s.jsx(cN,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>T(D.id),className:"p-2 text-slate-400 hover:text-red-400 transition-colors",children:s.jsx(cu,{className:"w-4 h-4"})})]})]})},D.id))]}):s.jsxs("div",{className:"space-y-3",children:[y?s.jsxs("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-4 space-y-3",children:[s.jsx("input",{type:"text",placeholder:"Nome da função",value:v.name,onChange:D=>b({...v,name:D.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsx("input",{type:"text",placeholder:"Descrição (opcional)",value:v.description,onChange:D=>b({...v,description:D.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{onClick:k,className:"flex-1",children:"Salvar"}),s.jsx(Ne,{onClick:()=>x(!1),variant:"ghost",children:"Cancelar"})]})]}):s.jsxs("button",{onClick:()=>x(!0),className:"w-full bg-slate-800/30 border border-dashed border-slate-700 rounded-lg p-4 text-slate-400 hover:text-white hover:border-slate-600 transition-colors flex items-center justify-center gap-2",children:[s.jsx(ts,{className:"w-4 h-4"}),"Nova Função"]}),l.map(D=>s.jsx("div",{className:"bg-slate-800/50 border border-slate-700 rounded-lg p-4",children:m===D.id?s.jsxs("div",{className:"space-y-3",children:[s.jsx("input",{type:"text",value:v.name,onChange:L=>b({...v,name:L.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsx("input",{type:"text",value:v.description,onChange:L=>b({...v,description:L.target.value}),className:"w-full bg-slate-950 border border-slate-700 rounded-lg px-3 py-2 text-sm text-white"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(Ne,{onClick:()=>A(D.id),size:"sm",children:[s.jsx(dN,{className:"w-3 h-3 mr-1"}),"Salvar"]}),s.jsx(Ne,{onClick:()=>p(null),variant:"ghost",size:"sm",children:"Cancelar"})]})]}):s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-medium text-white",children:D.name}),D.description&&s.jsx("div",{className:"text-xs text-slate-400",children:D.description})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>I(D,"function"),className:"p-2 text-slate-400 hover:text-white transition-colors",children:s.jsx(cN,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>R(D.id),className:"p-2 text-slate-400 hover:text-red-400 transition-colors",children:s.jsx(cu,{className:"w-4 h-4"})})]})]})},D.id))]})}),s.jsx("div",{className:"p-4 border-t border-slate-800 flex justify-end",children:s.jsx(Ne,{onClick:e,variant:"ghost",children:"Fechar"})})]})}):null};function CE(t){const e=w.useRef({value:t,previous:t});return w.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var cx="Switch",[Lje]=Ca(cx),[Fje,Bje]=Lje(cx),pU=w.forwardRef((t,e)=>{const{__scopeSwitch:r,name:n,checked:a,defaultChecked:i,required:o,disabled:l,value:u="on",onCheckedChange:d,form:h,...m}=t,[p,v]=w.useState(null),b=Nt(e,S=>v(S)),y=w.useRef(!1),x=p?h||!!p.closest("form"):!0,[j,N]=Os({prop:a,defaultProp:i??!1,onChange:d,caller:cx});return s.jsxs(Fje,{scope:r,checked:j,disabled:l,children:[s.jsx(ht.button,{type:"button",role:"switch","aria-checked":j,"aria-required":o,"data-state":yU(j),"data-disabled":l?"":void 0,disabled:l,value:u,...m,ref:b,onClick:et(t.onClick,S=>{N(k=>!k),x&&(y.current=S.isPropagationStopped(),y.current||S.stopPropagation())})}),x&&s.jsx(xU,{control:p,bubbles:!y.current,name:n,value:u,checked:j,required:o,disabled:l,form:h,style:{transform:"translateX(-100%)"}})]})});pU.displayName=cx;var gU="SwitchThumb",vU=w.forwardRef((t,e)=>{const{__scopeSwitch:r,...n}=t,a=Bje(gU,r);return s.jsx(ht.span,{"data-state":yU(a.checked),"data-disabled":a.disabled?"":void 0,...n,ref:e})});vU.displayName=gU;var Vje="SwitchBubbleInput",xU=w.forwardRef(({__scopeSwitch:t,control:e,checked:r,bubbles:n=!0,...a},i)=>{const o=w.useRef(null),l=Nt(o,i),u=CE(r),d=aE(e);return w.useEffect(()=>{const h=o.current;if(!h)return;const m=window.HTMLInputElement.prototype,v=Object.getOwnPropertyDescriptor(m,"checked").set;if(u!==r&&v){const b=new Event("click",{bubbles:n});v.call(h,r),h.dispatchEvent(b)}},[u,r,n]),s.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:l,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});xU.displayName=Vje;function yU(t){return t?"checked":"unchecked"}var bU=pU,zje=vU;const ux=w.forwardRef(({className:t,...e},r)=>s.jsx(bU,{className:Qe("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-violet-500 data-[state=unchecked]:bg-slate-600",t),...e,ref:r,children:s.jsx(zje,{className:Qe("pointer-events-none block h-4 w-4 roun
1160ded-full bg-white shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));ux.displayName=bU.displayName;var Uje=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qje=Uje.reduce((t,e)=>{const r=b7(`Primitive.${e}`),n=w.forwardRef((a,i)=>{const{asChild:o,...l}=a,u=o?r:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(u,{...l,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{}),Wje="Label",wU=w.forwardRef((t,e)=>s.jsx(qje.label,{...t,ref:e,onMouseDown:r=>{var a;r.target.closest("button, input, select, textarea")||((a=t.onMouseDown)==null||a.call(t,r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));wU.displayName=Wje;var _U=wU;const Hje=qC("text-sm font-medium leading-none text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pt=w.forwardRef(({className:t,...e},r)=>s.jsx(_U,{ref:r,className:Qe(Hje(),t),...e}));pt.displayName=_U.displayName;const Gje=()=>{const[t,e]=w.useState([]),[r,n]=w.useState([]),[a,i]=w.useState([]),[o,l]=w.useState(!0),[u,d]=w.useState(!1),[h,m]=w.useState(!1),[p,v]=w.useState({name:"",email:"",role:"agent",team_id:"",function_id:"",weight:1}),[b,y]=w.useState(""),[x,j]=w.useState(!1),[N,S]=w.useState(null),[k,C]=w.useState(!0),[A,T]=w.useState(null),[R,I]=w.useState(!1),[D,L]=w.useState({name:"",email:"",role:"agent",status:"invited",team_id:"",function_id:"",weight:1});w.useEffect(()=>(z(),H()),[]);const z=async()=>{l(!0);try{const[q,se,me]=await Promise.all([Ge.fetchTeam(),Ge.fetchTeams(),Ge.fetchTeamFunctions()]);e(q),n(se),i(me);const{data:fe}=await ve.from("system_settings").select("*").maybeSingle();C((fe==null?void 0:fe.registration_enabled)??!0),T((fe==null?void 0:fe.id)??null)}catch(q){console.error("Erro ao carregar dados da equipe",q)}finally{l(!1)}},H=()=>{const q=ve.channel("team-members-changes").on("postgres_changes",{event:"*",schema:"public",table:"team_members"},()=>{z()}).subscribe();return()=>{ve.removeChannel(q)}},Z=async q=>{I(!0);try{if(A)await ve.from("system_settings").update({registration_enabled:q}).eq("id",A);else{const{data:se}=await ve.from("system_settings").insert({registration_enabled:q}).select().single();se&&T(se.id)}C(q),xe.success(q?"Registro de novos usuários habilitado":"Registro de novos usuários desabilitado")}catch(se){console.error("Erro ao atualizar configuração de registro:",se),xe.error("Erro ao atualizar configuração")}finally{I(!1)}},te=async q=>{q.preventDefault();try{await Ge.createTeamMember({name:p.name,email:p.email,role:p.role,team_id:p.team_id||void 0,function_id:p.function_id||void 0,weight:p.weight}),xe.success("Membro convidado com sucesso!"),d(!1),v({name:"",email:"",role:"agent",team_id:"",function_id:"",weight:1}),await z()}catch(se){console.error("Erro ao convidar membro:",se),xe.error("Erro ao convidar membro. Verifique se o email já não está cadastrado.")}},G=async(q,se,me)=>{try{await Ge.updateTeamMember(q,{[se]:me}),xe.success("Membro atualizado com sucesso")}catch(fe){console.error("Erro ao atualizar membro:",fe),xe.error("Erro ao atualizar membro")}},M=async(q,se)=>{if(confirm(`Tem certeza que deseja excluir ${se}?`))try{await Ge.deleteTeamMember(q),xe.success("Membro removido com sucesso"),await z()}catch(me){console.error("Erro ao remover membro:",me),xe.error("Erro ao remover membro")}},F=q=>{S(q),L({name:q.name,email:q.email,role:q.role,status:q.status,team_id:q.team_id||"",function_id:q.function_id||"",weight:q.weight||1}),j(!0)},K=async q=>{if(q.preventDefault(),!!N)try{await Ge.updateTeamMember(N.id,{name:D.name,email:D.email,role:D.role,status:D.status,team_id:D.team_id||null,function_id:D.function_id||null,weight:D.weight}),xe.success("Membro atualizado com sucesso!"),j(!1),S(null),await z()}catch(se){console.error("Erro ao editar membro:",se),xe.error("Erro ao editar membro")}},B=q=>{switch(q){case"active":return s.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-bold bg-slate-950 border border-slate-700 text-white shadow-sm",children:"Ativo"});case"invited":return s.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-bold bg-slate-950 border border-amber-900/50 text-amber-500 shadow-sm",children:"Pendente"});default:return s.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-bold bg-slate-950 border border-slate-800 text-slate-500 shadow-sm",children:"Inativo"})}},O=t.filter(q=>{var Q,pe;if(!b.trim())return!0;const se=b.toLowerCase(),me=((Q=r.find(V=>V.id===q.team_id))==null?void 0:Q.name)||"",fe=((pe=a.find(V=>V.id===q.function_id))==null?void 0:pe.name)||"";return q.name.toLowerCase().includes(se)||q.email.toLowerCase().includes(se)||me.toLowerCase().includes(se)||fe.toLowerCase().includes(se)}),W={total:t.length,admins:t.filter(q=>q.role==="admin").length,members:t.filter(q=>q.role!=="admin").length,teams:r.length};return s.jsxs("div",{className:"p-8 h-full overflow-y-auto bg-slate-950 text-slate-50 relative custom-scrollbar",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 gap-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-bold tracking-tight text-white",children:"Equipe"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Gerencie usuários e times da organização"})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsxs(Ne,{onClick:()=>m(!0),variant:"outline",className:"border-slate-700",children:[s.jsx(r0,{className:"w-4 h-4 mr-2"}),"Configurar"]}),s.jsxs(Ne,{onClick:()=>d(!0),className:"shadow-lg shadow-red-500/20 bg-slate-100 text-slate-900 hover:bg-white hover:text-black",children:[s.jsx(bg,{className:"w-4 h-4 mr-2"}),"Convidar Usuário"]})]})]}),s.jsx("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-5 shadow-sm mb-6",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(n0,{className:"w-5 h-5 text-emerald-400"}),s.jsxs("div",{children:[s.jsx(pt,{htmlFor:"registration-toggle",className:"text-sm font-medium text-slate-200 cursor-pointer",children:"Permitir novos registros"}),s.jsx("p",{className:"text-xs text-slate-500 mt-0.5",children:k?"Novos usuários podem criar conta na plataforma":"Registro de novos usuários está bloqueado"})]})]}),s.jsx(ux,{id:"registration-toggle",checked:k,onCheckedChange:Z,disabled:R})]})}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-8",children:[s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-5 shadow-sm",children:[s.jsx("div",{className:"text-sm font-medium text-slate-400 mb-2",children:"Total de Usuários"}),s.jsx("div",{className:"text-3xl font-bold text-white",children:o?"-":W.total})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-5 shadow-sm",children:[s.jsx("div",{className:"text-sm font-medium text-slate-400 mb-2",children:"Admins"}),s.jsx("div",{className:"text-3xl font-bold text-white",children:o?"-":W.admins})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-5 shadow-sm",children:[s.jsx("div",{className:"text-sm font-medium text-slate-400 mb-2",children:"Membros"}),s.jsx("div",{className:"text-3xl font-bold text-white",children:o?"-":W.members})]}),s.jsxs("div",{className:"bg-slate-900/50 border border-slate-800 rounded-xl p-5 shadow-sm",children:[s.jsx("div",{className:"text-sm font-medium text-slate-400 mb-2",children:"Times Ativos"}),s.jsx("div",{className:"text-3xl font-bold text-white",children:W.teams})]})]}),s.jsxs("div",{className:"mb-6 relative",children:[s.jsx(Gu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500"}),s.jsx("input",{type:"text",placeholder:"Buscar por nome, email, time ou função...",value:b,onChange:q=>y(q.target.value),className:"w-full sm:w-96 pl-10 pr-4 py-2 bg-slate-900/50 border border-slate-800 rounded-lg text-sm text-slate-200 focus:ring-1 focus:ring-slate-700 outline-none placeholder:text-slate-600 transition-all"})]}),s.jsxs("div",{className:"bg-slate-900/30 border border-slate-800 rounded-xl overflow-hidden shadow-xl",children:[s.jsxs("div",{className:"p-6 border-b border-slate-800",children:[s.jsx("h3",{className:"text-lg font-bold text-white",children:"Usuários da Equipe"}),s.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Gerencie roles e times dos usuários"})]}),o?s.jsxs("div",{className:"flex flex-col items-center justify-center p-12",children:[s.jsx(gt,{className:"h-8 w-8 animate-spin text-red-500 mb-3"}),s.jsx("span",{className:"text-sm text-slate-400",children:"Carregando dados..."})]}):t.length===0?s.jsxs("div",{className:"flex flex-col items-center justify-center p-12",children:[s.jsx(fo,{className:"w-12 h-12 text-slate-600 mb-4"}),s.jsx("p",{className:"text-slate-400 mb-4",children:"Nenhum membro cadastrado ainda."}),s.jsxs(Ne,{onClick:()=>d(!0),className:"bg-slate-100 text-slate-900 hover:bg-white",children:[s.jsx(bg,{className:"w-4 h-4 mr-2"}),"Convidar Primeiro Membro"]})]}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-left border-collapse",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-slate-800/50",children:[s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Usuário"}),s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Email"}),s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Role"}),s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Time"}),s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Função"}),s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider",children:"Peso"}),s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider text-center",children:"Status"}),s.jsx("th",{className:"px-6 py-4 text-xs font-medium text-slate-500 uppercase tracking-wider text-center",children:"Ações"})]})}),s.jsx("tbody",{className:"divide-y divide-slate-800/30",children:O.map(q=>s.jsxs("tr",{className:"hover:bg-slate-800/20 transition-colors group",children:[s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex-shrink-0 w-9 h-9 rounded-full bg-slate-800 flex items-center justify-center text-xs font-bold text-slate-300 border border-slate-700 uppercase",children:q.name.substring(0,2)}),s.jsx("span",{className:"text-sm font-medium text-slate-200",children:q.name})]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("span",{className:"text-sm text-slate-400",children:q.email})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("select",{value:q.role,onChange:se=>G(q.id,"role",se.target.value),className:"w-32 px-3 py-1.5 bg-slate-950 border border-slate-800 rounded-md text-sm text-slate-300 cursor-pointer hover:border-slate-600 transition-colors",children:[s.jsx("option",{value:"agent",children:"Atendente"}),s.jsx("option",{value:"manager",children:"Gerente"}),s.jsx("option",{value:"admin",children:"Admin"})]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("select",{value:q.team_id||"",onChange:se=>G(q.id,"team_id",se.target.value||null),className:"w-32 px-3 py-1.5 bg-slate-950 border border-slate-800 rounded-md text-sm text-slate-300 cursor-pointer hover:border-slate-600 transition-colors",children:[s.jsx("option",{value:"",children:"Sem time"}),r.map(se=>s.jsx("option",{value:se.id,children:se.name},se.id))]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsxs("select",{value:q.function_id||"",onChange:se=>G(q.id,"function_id",se.target.value||null),className:"w-32 px-3 py-1.5 bg-slate-950 border border-slate-800 rounded-md text-sm text-slate-300 cursor-pointer hover:border-slate-600 transition-colors",children:[s.jsx("option",{value:"",children:"Sem função"}),a.map(se=>s.jsx("option",{value:se.id,children:se.name},se.id))]})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:s.jsx("input",{type:"number",min:"1",max:"10",value:q.weight||1,onChange:se=>G(q.id,"weight",parseInt(se.target.value)),className:"w-16 px-2 py-1 bg-slate-950 border border-slate-800 rounded-md text-sm text-slate-300 text-center"})}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-center",children:B(q.status)}),s.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-center",children:s.jsxs("div",{className:"flex items-center justify-center gap-1",children:[s.jsx("button",{onClick:()=>F(q),className:"p-2 rounded-lg text-slate-500 hover:bg-slate-800 hover:text-white transition-colors",title:"Editar membro",children:s.jsx(cN,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>M(q.id,q.name),className:"p-2 rounded-lg text-slate-500 hover:bg-red-900/50 hover:text-red-400 transition-colors",title:"Excluir membro",children:s.jsx(cu,{className:"w-4 h-4"})})]})})]},q.id))})]})})]}),u&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:s.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-xl shadow-2xl max-w-md w-full overflow-hidden animate-in zoom-in-95 duration-200",children:[s.jsxs("div",{className:"p-6 border-b border-slate-800 flex justify-between items-center",children:[s.jsx("h3",{className:"text-lg font-bold text-white",children:"Convidar para a Equipe"}),s.jsx("button",{onClick:()=>d(!1),className:"text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-5 h-5"})})]}),s.jsxs("form",{onSubmit:te,className:"p-6 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Nome Completo"}),s.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white focus:ring-1 focus:ring-slate-600 outline-none transition-all",placeholder:"Ex: João da Silva",value:p.name,onChange:q=>v({...p,name:q.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Email Corporativo"}),s.jsx("input",{required:!0,type:"email",className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white focus:ring-1 focus:ring-slate-600 outline-none transition-all",placeholder:"[email protected]",value:p.email,onChange:q=>v({...p,email:q.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"NÃvel de Acesso"}),s.jsx("div",{className:"grid grid-cols-3 gap-2",children:["agent","manager","admin"].map(q=>s.jsxs("div",{onClick:()=>v({...p,role:q}
1160),className:`cursor-pointer rounded-lg border p-2 text-center transition-all ${p.role===q?"bg-slate-800 border-slate-500 text-white":"bg-slate-950 border-slate-800 text-slate-500 hover:border-slate-700"}`,children:[s.jsx("div",{className:"text-xs font-bold uppercase mb-1",children:q==="agent"?"Atendente":q==="manager"?"Gerente":"Admin"}),p.role===q&&s.jsx("div",{className:"flex justify-center",children:s.jsx(ci,{className:"w-3 h-3"})})]},q))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Time (opcional)"}),s.jsxs("select",{value:p.team_id,onChange:q=>v({...p,team_id:q.target.value}),className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white",children:[s.jsx("option",{value:"",children:"Sem time"}),r.map(q=>s.jsx("option",{value:q.id,children:q.name},q.id))]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Função (opcional)"}),s.jsxs("select",{value:p.function_id,onChange:q=>v({...p,function_id:q.target.value}),className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white",children:[s.jsx("option",{value:"",children:"Sem função"}),a.map(q=>s.jsx("option",{value:q.id,children:q.name},q.id))]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Peso (para distribuição)"}),s.jsx("input",{type:"number",min:"1",max:"10",value:p.weight,onChange:q=>v({...p,weight:parseInt(q.target.value)}),className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white"})]}),s.jsxs("div",{className:"pt-4 flex gap-3",children:[s.jsx(Ne,{type:"button",variant:"ghost",onClick:()=>d(!1),className:"flex-1 border border-slate-700 hover:bg-slate-800",children:"Cancelar"}),s.jsx(Ne,{type:"submit",className:"flex-1 bg-white text-black hover:bg-slate-200",children:"Enviar Convite"})]})]})]})}),s.jsx($je,{isOpen:h,onClose:()=>m(!1),onUpdate:z}),x&&N&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:s.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-xl shadow-2xl max-w-md w-full overflow-hidden animate-in zoom-in-95 duration-200",children:[s.jsxs("div",{className:"p-6 border-b border-slate-800 flex justify-between items-center",children:[s.jsx("h3",{className:"text-lg font-bold text-white",children:"Editar Membro"}),s.jsx("button",{onClick:()=>{j(!1),S(null)},className:"text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-5 h-5"})})]}),s.jsxs("form",{onSubmit:K,className:"p-6 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Nome Completo"}),s.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white focus:ring-1 focus:ring-slate-600 outline-none transition-all",value:D.name,onChange:q=>L({...D,name:q.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Email"}),s.jsx("input",{required:!0,type:"email",className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white focus:ring-1 focus:ring-slate-600 outline-none transition-all",value:D.email,onChange:q=>L({...D,email:q.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"NÃvel de Acesso"}),s.jsx("div",{className:"grid grid-cols-3 gap-2",children:["agent","manager","admin"].map(q=>s.jsxs("div",{onClick:()=>L({...D,role:q}),className:`cursor-pointer rounded-lg border p-2 text-center transition-all ${D.role===q?"bg-slate-800 border-slate-500 text-white":"bg-slate-950 border-slate-800 text-slate-500 hover:border-slate-700"}`,children:[s.jsx("div",{className:"text-xs font-bold uppercase mb-1",children:q==="agent"?"Atendente":q==="manager"?"Gerente":"Admin"}),D.role===q&&s.jsx("div",{className:"flex justify-center",children:s.jsx(ci,{className:"w-3 h-3"})})]},q))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Status"}),s.jsxs("select",{value:D.status,onChange:q=>L({...D,status:q.target.value}),className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white",children:[s.jsx("option",{value:"active",children:"Ativo"}),s.jsx("option",{value:"invited",children:"Pendente"}),s.jsx("option",{value:"disabled",children:"Inativo"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Time"}),s.jsxs("select",{value:D.team_id,onChange:q=>L({...D,team_id:q.target.value}),className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white",children:[s.jsx("option",{value:"",children:"Sem time"}),r.map(q=>s.jsx("option",{value:q.id,children:q.name},q.id))]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Função"}),s.jsxs("select",{value:D.function_id,onChange:q=>L({...D,function_id:q.target.value}),className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white",children:[s.jsx("option",{value:"",children:"Sem função"}),a.map(q=>s.jsx("option",{value:q.id,children:q.name},q.id))]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-sm font-medium text-slate-300",children:"Peso"}),s.jsx("input",{type:"number",min:"1",max:"10",value:D.weight,onChange:q=>L({...D,weight:parseInt(q.target.value)}),className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-2.5 text-sm text-white"})]}),s.jsxs("div",{className:"pt-4 flex gap-3",children:[s.jsx(Ne,{type:"button",variant:"ghost",onClick:()=>{j(!1),S(null)},className:"flex-1 border border-slate-700 hover:bg-slate-800",children:"Cancelar"}),s.jsx(Ne,{type:"submit",className:"flex-1 bg-white text-black hover:bg-slate-200",children:"Salvar Alterações"})]})]})]})})]})},Kje=()=>{var ee,ce,je;const t=Wu(),[e,r]=w.useState(new Date),[n,a]=w.useState("month"),[i,o]=w.useState([]),[l,u]=w.useState([]),[d,h]=w.useState(!0),[m,p]=w.useState(!1),[v,b]=w.useState(!1),[y,x]=w.useState(!1),[j,N]=w.useState(null),[S,k]=w.useState(null),[C,A]=w.useState(null),[T,R]=w.useState({title:"",time:"09:00",type:"demo",description:"",duration:60}),[I,D]=w.useState({title:"",date:"",time:"09:00",type:"demo",description:"",duration:60,attendees:""}),[L,z]=w.useState(null);w.useEffect(()=>{const de=async()=>{try{const[ke,Y]=await Promise.all([Ge.fetchAppointments(),Ge.fetchContacts()]);o(ke),u(Y)}catch(ke){console.error("Erro ao carregar dados",ke)}finally{h(!1)}};de();const we=ve.channel("appointments-changes").on("postgres_changes",{event:"*",schema:"public",table:"appointments"},()=>{console.log("Appointment changed, refetching..."),de()}).subscribe();return()=>{ve.removeChannel(we)}},[]);const H=de=>{const we=new Date(e);n==="month"?we.setMonth(we.getMonth()+de):n==="week"?we.setDate(we.getDate()+de*7):we.setDate(we.getDate()+de),r(we)},Z=()=>r(new Date),te=()=>
1160e.toLocaleString("pt-BR",{month:"long",year:"numeric"}),G=()=>e.toLocaleDateString("pt-BR",{weekday:"long",day:"numeric",month:"long"}),M=()=>{const de=F(e),we=new Date(de);return we.setDate(we.getDate()+6),`${de.getDate()} ${de.toLocaleString("pt-BR",{month:"short"})} - ${we.getDate()} ${we.toLocaleString("pt-BR",{month:"short"})}`},F=de=>{const we=new Date(de),ke=we.getDay(),Y=we.getDate()-ke;return new Date(we.setDate(Y))},K=(de,we)=>new Date(de,we+1,0).getDate(),B=(de,we)=>new Date(de,we,1).getDay(),O=de=>de.toISOString().split("T")[0],W=de=>{const we=e.getFullYear(),ke=e.getMonth(),Y=`${we}-${String(ke+1).padStart(2,"0")}-${String(de).padStart(2,"0")}`;k(Y),b(!0)},q=(de,we)=>{k(de),we&&R(ke=>({...ke,time:we})),b(!0)},se=(de,we)=>{we.stopPropagation(),N(de)},me=(de,we)=>{const[ke,Y]=de.split(":").map(Number),ne=ke*60+Y+we,le=Math.floor(ne/60)%24,Se=ne%60;return`${String(le).padStart(2,"0")}:${String(Se).padStart(2,"0")}`},fe=async de=>{var we;if(de.preventDefault(),!!S){p(!0);try{const Y=(((we=document.querySelector('[name="attendees"]'))==null?void 0:we.value)||"").split(",").map(ne=>ne.trim()).filter(Boolean);await Ge.createAppointment({title:T.title,description:T.description,date:S,time:T.time,duration:T.duration,type:T.type,attendees:Y,contact_id:C||void 0}),xe.success("Agendamento criado com sucesso!"),b(!1),R({title:"",time:"09:00",type:"demo",description:"",duration:60}),k(null),A(null)}catch(ke){console.error("Error creating appointment:",ke),xe.error("Erro ao criar agendamento")}finally{p(!1)}}},Q=async de=>{if(confirm("Tem certeza que deseja excluir este agendamento?"))try{await Ge.deleteAppointment(de),xe.success("Agendamento excluÃdo com sucesso!"),N(null)}catch(we){console.error("Error deleting appointment:",we),xe.error("Erro ao excluir agendamento")}},pe=de=>{var we;D({title:de.title,date:de.date,time:de.time,type:de.type,description:de.description||"",duration:de.duration,attendees:((we=de.attendees)==null?void 0:we.join(", "))||""}),z(de.contact_id||null),x(!0),N(null)},V=async de=>{if(de.preventDefault(),!!j){p(!0);try{const we=I.attendees.split(",").map(ke=>ke.trim()).filter(Boolean);await Ge.updateAppointment(j.id,{title:I.title,date:I.date,time:I.time,type:I.type,description:I.description,duration:I.duration,attendees:we,contact_id:L||void 0}),xe.success("Agendamento atualizado com sucesso!"),x(!1),N(null)}catch(we){console.error("Error updating appointment:",we),xe.error("Erro ao atualizar agendamento")}finally{p(!1)}}},J=de=>{switch(de){case"demo":return"bg-red-500/10 text-red-300 border-red-500/20 hover:bg-red-500/20";case"meeting":return"bg-violet-500/10 text-violet-300 border-violet-500/20 hover:bg-violet-500/20";case"support":return"bg-emerald-500/10 text-emerald-300 border-emerald-500/20 hover:bg-emerald-500/20";case"followup":return"bg-orange-500/10 text-orange-300 border-orange-500/20 hover:bg-orange-500/20";default:return"bg-slate-700 text-slate-300 border-slate-600"}},oe=()=>{const de=e.getFullYear(),we=e.getMonth(),ke=K(de,we),Y=B(de,we);return s.jsxs("div",{className:"grid grid-cols-7 flex-1 auto-rows-fr",children:[Array.from({length:Y}).map((ne,le)=>s.jsx("div",{className:"border-b border-r border-slate-800/50 bg-slate-950/30 min-h-[100px]"},`empty-${le}`)),Array.from({length:ke}).map((ne,le)=>{const Se=le+1,Ae=`${de}-${String(we+1).padStart(2,"0")}-${String(Se).padStart(2,"0")}`,Ce=i.filter(Be=>Be.date===Ae),$e=O(new Date)===Ae;return s.jsxs("div",{onClick:()=>W(Se),className:`border-b border-r border-slate-800/50 p-2 min-h-[120px] cursor-pointer transition-colors hover:bg-slate-800/30 group relative ${$e?"bg-red-950/10":""}`,children:[s.jsx("span",{className:`text-sm font-medium w-7 h-7 flex items-center justify-center rounded-full mb-2 ${$e?"bg-red-500 text-white shadow-lg shadow-red-500/40":"text-slate-400 group-hover:text-white"}`,children:Se}),s.jsx("div",{className:"space-y-1",children:Ce.map(Be=>{var tt;return s.jsxs("div",{className:`text-[10px] px-2 py-1 rounded border truncate font-medium cursor-pointer relative ${J(Be.type)}`,onClick:Dt=>se(Be,Dt),children:[((tt=Be.metadata)==null?void 0:tt.source)==="nina_ai"&&s.jsx(Or,{className:"w-2.5 h-2.5 inline-block mr-0.5 text-red-400"}),Be.time," - ",Be.title]},Be.id)})})]},Se)}),Array.from({length:42-(ke+Y)}).map((ne,le)=>s.jsx("div",{className:"border-b border-r border-slate-800/50 bg-slate-950/30"},`remaining-${le}`))]})},re=()=>{const de=F(e),we=Array.from({length:7}).map((Y,ne)=>{const le=new Date(de);return le.setDate(le.getDate()+ne),le}),ke=Array.from({length:14}).map((Y,ne)=>ne+6);return s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto custom-scrollbar bg-slate-900/30",children:[s.jsxs("div",{className:"grid grid-cols-8 border-b border-slate-800 sticky top-0 bg-slate-900 z-10",children:[s.jsx("div",{className:"p-4 text-xs font-medium text-slate-500 border-r border-slate-800",children:"GMT-3"}),we.map((Y,ne)=>{const le=O(new Date)===O(Y);return s.jsxs("div",{className:`p-2 text-center border-r border-slate-800/50 ${le?"bg-red-950/20":""}`,children:[s.jsx("div",{className:`text-xs uppercase font-semibold ${le?"text-red-400":"text-slate-500"}`,children:Y.toLocaleDateString("pt-BR",{weekday:"short"})}),s.jsx("div",{className:`text-xl font-bold ${le?"text-red-500":"text-slate-300"}`,children:Y.getDate()})]},ne)})]}),s.jsx("div",{className:"flex-1",children:ke.map(Y=>{const ne=`${String(Y).padStart(2,"0")}:00`;return s.jsxs("div",{className:"grid grid-cols-8 min-h-[80px]",children:[s.jsx("div",{className:"border-r border-b border-slate-800/50 p-2 text-xs text-slate-500 text-right sticky left-0 bg-slate-900/30",children:ne}),we.map((le,Se)=>
1160{const Ae=O(le),Ce=O(new Date)===Ae,$e=i.filter(Be=>{const tt=parseInt(Be.time.split(":")[0]);return Be.date===Ae&&tt===Y});return s.jsxs("div",{onClick:()=>q(Ae,ne),className:`border-r border-b border-slate-800/50 relative p-1 transition-colors hover:bg-slate-800/20 group cursor-pointer ${Ce?"bg-red-950/5":""}`,children:[s.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 pointer-events-none",children:s.jsx(ts,{className:"w-4 h-4 text-slate-600"})}),$e.map(Be=>{var tt;return s.jsxs("div",{className:`mb-1 p-2 rounded text-xs border cursor-pointer hover:brightness-110 relative z-10 shadow-sm ${J(Be.type)}`,onClick:Dt=>se(Be,Dt),style:{minHeight:`${Math.max(40,Be.duration/60*80)}px`},children:[s.jsxs("div",{className:"font-bold truncate flex items-center gap-1",children:[((tt=Be.metadata)==null?void 0:tt.source)==="nina_ai"&&s.jsx(Or,{className:"w-3 h-3 text-red-400 flex-shrink-0"}),Be.title]}),s.jsxs("div",{className:"text-[10px] opacity-80",children:[Be.time," - ",me(Be.time,Be.duration)]})]},Be.id)})]},Se)})]},Y)})})]})},Me=()=>{const de=Array.from({length:14}).map((ke,Y)=>Y+6),we=O(e);return s.jsxs("div",{className:"flex flex-col flex-1 overflow-y-auto custom-scrollbar bg-slate-900/30",children:[s.jsx("div",{className:"p-4 border-b border-slate-800 bg-slate-900 sticky top-0 z-10",children:s.jsx("h3",{className:"text-xl font-bold text-white capitalize",children:e.toLocaleDateString("pt-BR",{weekday:"long",day:"numeric",month:"long"})})}),s.jsx("div",{className:"flex-1 p-4",children:de.map(ke=>{const Y=`${String(ke).padStart(2,"0")}:00`,ne=i.filter(le=>{const Se=parseInt(le.time.split(":")[0]);return le.date===we&&Se===ke});return s.jsxs("div",{className:"flex border-b border-slate-800/50 min-h-[100px] group hover:bg-slate-900/40 transition-colors",children:[s.jsx("div",{className:"w-20 py-4 pr-6 text-right text-sm font-medium text-slate-500 border-r border-slate-800/50",children:Y}),s.jsxs("div",{className:"flex-1 p-2 relative cursor-pointer",onClick:()=>q(we,Y),children:[s.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-10 pointer-events-none",children:s.jsx(ts,{className:"w-6 h-6 text-slate-700"})}),ne.map(le=>{var Se;return s.jsxs("div",{className:`mb-2 p-3 rounded-lg border flex justify-between items-center shadow-md relative z-10 cursor-pointer hover:brightness-110 ${J(le.type)}`,onClick:Ae=>se(le,Ae),style:{minHeight:`${Math.max(60,le.duration/60*100)}px`},children:[s.jsxs("div",{children:[s.jsxs("div",{className:"font-bold text-sm flex items-center gap-1.5",children:[((Se=le.metadata)==null?void 0:Se.source)==="nina_ai"&&s.jsx(Or,{className:"w-3.5 h-3.5 text-red-400 flex-shrink-0"}),le.title]}),s.jsx("div",{className:"text-xs opacity-80 mt-1",children:le.description||"Sem descrição"})]}),s.jsxs("div",{className:"text-right",children:[s.jsxs("div",{className:"font-mono text-sm",children:[le.time," - ",me(le.time,le.duration)]}),s.jsxs("div",{className:"text-[10px] opacity-75 uppercase tracking-wider font-bold mt-1",children:[le.type," ⢠",le.duration,"min"]})]})]},le.id)})]})]},ke)})})]})};return s.jsxs("div",{className:"p-6 h-full flex flex-col bg-slate-950 text-slate-50",children:[s.jsxs("div",{className:"flex flex-col xl:flex-row items-start xl:items-center justify-between mb-6 gap-4",children:[s.jsxs("div",{children:[s.jsxs("h2",{className:"text-3xl font-bold text-white flex items-center gap-2",children:[s.jsx(Ya,{className:"w-8 h-8 text-red-500"}),"Agendamentos"]}),s.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"Gerencie demos, reuniões e suporte técnico."})]}),s.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-4 w-full xl:w-auto",children:[s.jsxs("div",{className:"flex bg-slate-900 p-1 rounded-lg border border-slate-800",children:[s.jsxs("button",{onClick:()=>a("month"),className:`px-3 py-1.5 rounded-md text-xs font-medium flex items-center gap-2 transition-all ${n==="month"?"bg-slate-800 text-white shadow-sm":"text-slate-500 hover:text-slate-300"}`,children:[s.jsx(hY,{className:"w-3.5 h-3.5"})," Mês"]}),s.jsxs("button",{onClick:()=>a("week"),className:`px-3 py-1.5 rounded-md text-xs font-medium flex items-center gap-2 transition-all ${n==="week"?"bg-slate-800 text-white shadow-sm":"text-slate-500 hover:text-slate-300"}`,children:[s.jsx(nY,{className:"w-3.5 h-3.5"})," Semana"]}),s.jsxs("button",{onClick:()=>a("day"),className:`px-3 py-1.5 rounded-md text-xs font-medium flex items-center gap-2 transition-all ${n==="day"?"bg-slate-800 text-white shadow-sm":"text-slate-500 hover:text-slate-300"}`,children:[s.jsx(pY,{className:"w-3.5 h-3.5"})," Dia"]})]}),s.jsxs("div",{className:"flex items-center bg-slate-900 border border-slate-800 rounded-lg p-1",children:[s.jsx("button",{onClick:()=>H(-1),className:"p-2 hover:bg-slate-800 rounded-md text-slate-400 hover:text-white transition-colors",children:s.jsx(e0,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex flex-col items-center justify-center w-48 px-2 cursor-pointer",onClick:Z,title:"Ir para hoje",children:[s.jsx("span",{className:"text-sm font-bold text-slate-200 capitalize",children:n==="month"?te():n==="week"?M():G()}),n==="week"&&s.jsx("span",{className:"text-[10px] text-slate-500",children:e.getFullYear()})]}),s.jsx("button",{onClick:()=>H(1),className:"p-2 hover:bg-slate-800 rounded-md text-slate-400 hover:text-white transition-colors",children:s.jsx(t0,{className:"w-5 h-5"})})]}),s.jsxs(Ne,{onClick:()=>{k(new Date().toISOString().split("T")[0]),b(!0)},children:[s.jsx(ts,{className:"w-4 h-4 mr-2"}),"Agendar"]})]})]}),s.jsx("div",{className:"flex-1 bg-slate-900/50 border border-slate-800 rounded-xl overflow-hidden shadow-2xl flex flex-col relative",children:d?s.jsx("div",{className:"flex-1 flex items-center justify-center",children:s.jsx(gt,{className:"w-8 h-8 animate-spin text-red-500"})}):s.jsxs(s.Fragment,{children:[n==="month"&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-7 border-b border-slate-800 bg-slate-900",children:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"].map(de=>s.jsx("div",{className:"py-3 text-center text-sm font-semibold text-slate-500 uppercase tracking-wider",children:de},de))}),oe()]}),n==="week"&&re(),n==="day"&&Me()]})}),v&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:s.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-xl shadow-2xl max-w-md w-full overflow-hidden animate-in zoom-in-95 duration-200",children:[s.jsxs("div",{className:"p-6 border-b border-slate-800 flex justify-between items-center",children:[s.jsx("h3",{className:"text-lg font-bold text-white",children:"Novo Agendamento"}),s.jsx("button",{onClick:()=>b(!1),className:"text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-5 h-5"})})]}),s.jsxs("form",{onSubmit:fe,className:"p-6 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Data Selecionada"}),s.jsxs("div",{className:"flex items-center gap-2 text-white font-medium bg-slate-950 p-3 rounded-lg border border-slate-800",children:[s.jsx(Ya,{className:"w-4 h-4 text-red-500"}),S==null?void 0:S.split("-").reverse().join("/")]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Horário"}),s.jsxs("div",{className:"relative",children:[s.jsx(oo,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),s.jsx("input",{type:"time",className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none",value:T.time,onChange:de=>R({...T,time:de.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Duração"}),s.jsxs("select",{className:"w-full bg-slate-950 border border-slate-800 rounded-lg px-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none appearance-none",value:T.duration,onChange:de=>R({...T,duration:parseInt(de.target.value)}),children:[s.jsx("option",{value:"15",children:"15 min"}),s.jsx("option",{value:"30",children:"30 min"}),s.jsx("option",{value:"45",children:"45 min"}),s.jsx("option",{value:"60",children:"1 hora"}),s.jsx("option",{value:"90",children:"1h 30min"}),s.jsx("option",{value:"120",children:"2 horas"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Tipo"}),s.jsxs("select",{className:"w-full bg-slate-950 border border-slate-800 rounded-lg px-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none appearance-none",value:T.type,onCh
1160ange:de=>R({...T,type:de.target.value}),children:[s.jsx("option",{value:"demo",children:"Demo"}),s.jsx("option",{value:"meeting",children:"Reunião"}),s.jsx("option",{value:"support",children:"Suporte"}),s.jsx("option",{value:"followup",children:"Follow-up"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"TÃtulo do Evento"}),s.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-3 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none placeholder:text-slate-600",placeholder:"Ex: Apresentação para Cliente X",value:T.title,onChange:de=>R({...T,title:de.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Descrição"}),s.jsxs("div",{className:"relative",children:[s.jsx(GT,{className:"absolute left-3 top-3 w-4 h-4 text-slate-500"}),s.jsx("textarea",{className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-3 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none placeholder:text-slate-600 resize-none h-24",placeholder:"Detalhes adicionais...",value:T.description,onChange:de=>R({...T,description:de.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Contato Vinculado"}),s.jsxs("div",{className:"relative",children:[s.jsx(ib,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),s.jsxs("select",{value:C||"",onChange:de=>A(de.target.value||null),className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none appearance-none",children:[s.jsx("option",{value:"",children:"Selecionar contato (opcional)"}),l.map(de=>s.jsxs("option",{value:de.id,children:[de.name||de.phone," - ",de.phone]},de.id))]})]}),s.jsx("p",{className:"text-xs text-slate-500",children:"Vincule um contato existente ao evento"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Participantes Adicionais"}),s.jsxs("div",{className:"relative",children:[s.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),s.jsx("input",{type:"text",name:"attendees",className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none placeholder:text-slate-600",placeholder:"Ex: João Silva, Maria Santos"})]}),s.jsx("p",{className:"text-xs text-slate-500",children:"Separe os nomes por vÃrgula"})]}),s.jsxs("div",{className:"pt-4 flex gap-3",children:[s.jsx(Ne,{type:"button",variant:"ghost",onClick:()=>b(!1),className:"flex-1 border border-slate-700 hover:bg-slate-800",children:"Cancelar"}),s.jsx(Ne,{type:"submit",disabled:m,className:"flex-1",children:m?"Salvando...":"Salvar"})]})]})]})}),j&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:s.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-xl shadow-2xl max-w-md w-full overflow-hidden animate-in zoom-in-95 duration-200 flex flex-col",children:[s.jsxs("div",{className:`p-6 border-b border-slate-800 relative overflow-hidden ${J(j.type).replace("text-","bg-").replace("/10","/5")}`,children:[s.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-5",children:s.jsx(Ya,{className:"w-32 h-32"})}),s.jsxs("div",{className:"relative z-10",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`px-2 py-1 rounded text-[10px] font-bold uppercase border ${J(j.type)}`,children:j.type}),((ee=j.metadata)==null?void 0:ee.source)==="nina_ai"&&s.jsxs("span",{className:"px-2 py-1 rounded text-[10px] font-bold uppercase border bg-red-500/10 text-red-300 border-red-500/30 flex items-center gap-1",children:[s.jsx(Or,{className:"w-3 h-3"}),"Criado por IA"]})]}),s.jsx("button",{onClick:()=>N(null),className:"p-1 rounded-full bg-black/20 text-white hover:bg-black/40 transition-colors",children:s.jsx(Xn,{className:"w-4 h-4"})})]}),s.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:j.title}),s.jsxs("div",{className:"flex items-center gap-4 text-sm text-slate-300",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(oo,{className:"w-4 h-4 text-red-500"}),j.time," - ",me(j.time,j.duration)," (",j.duration,"min)"]}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Ya,{className:"w-4 h-4 text-red-500"}),j.date.split("-").reverse().join("/")]})]})]})]}),s.jsxs("div",{className:"p-6 space-y-6 flex-1",children:[j.description&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Descrição"}),s.jsx("p",{className:"text-sm text-slate-300 leading-relaxed bg-slate-950 p-3 rounded-lg border border-slate-800",children:j.description})]}),j.contact_id&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Contato Vinculado"}),s.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 px-3 py-2 rounded-lg border border-slate-700",children:[s.jsx(ib,{className:"w-5 h-5 text-red-500"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("span",{className:"text-sm text-white font-medium",children:((ce=j.contact)==null?void 0:ce.name)||"Contato"}),s.jsx("span",{className:"text-xs text-slate-400 ml-2",children:(je=j.contact)==null?void 0:je.ph
1160one_number})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Participantes"}),s.jsx("div",{className:"flex flex-wrap items-center gap-2",children:j.attendees&&j.attendees.length>0?j.attendees.map((de,we)=>s.jsxs("div",{className:"flex items-center gap-2 bg-slate-800 px-3 py-1.5 rounded-full border border-slate-700",children:[s.jsx("div",{className:"w-5 h-5 rounded-full bg-red-600 flex items-center justify-center text-[10px] text-white font-bold",children:de.charAt(0)}),s.jsx("span",{className:"text-xs text-slate-200",children:de})]},we)):s.jsx("span",{className:"text-sm text-slate-500",children:"Nenhum participante adicional."})})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{type:"button",variant:"outline",onClick:()=>Q(j.id),className:"flex-1 border-destructive text-destructive hover:bg-destructive/10",children:"Excluir"}),s.jsxs(Ne,{type:"button",variant:"outline",onClick:()=>{pe(j)},className:"flex-1",children:[s.jsx(yg,{className:"w-4 h-4 mr-1"}),"Editar"]})]}),s.jsxs(Ne,{className:"w-full shadow-lg shadow-red-500/20 py-3",size:"lg",onClick:()=>{t(`/meeting/${j.id}`)},children:[s.jsx(RY,{className:"w-5 h-5 mr-2"}),"Entrar na Sala de Reunião"]}),s.jsx("p",{className:"text-center text-xs text-slate-500",children:"A sala estará disponÃvel 5 minutos antes do horário."})]})]})]})}),y&&j&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/80 backdrop-blur-sm animate-in fade-in duration-200",children:s.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-xl shadow-2xl max-w-lg w-full overflow-hidden animate-in zoom-in-95 duration-200",children:[s.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-800 bg-gradient-to-r from-red-950/30 to-slate-900",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"p-2 bg-red-500/10 rounded-lg",children:s.jsx(yg,{className:"w-5 h-5 text-red-400"})}),s.jsx("h2",{className:"text-lg font-bold text-white",children:"Editar Agendamento"})]}),s.jsx("button",{onClick:()=>{x(!1),N(null)},className:"p-1.5 rounded-full hover:bg-slate-800 text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-5 h-5"})})]}),s.jsxs("form",{onSubmit:V,className:"p-6 space-y-5 max-h-[70vh] overflow-y-auto custom-scrollbar",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Data"}),s.jsxs("div",{className:"relative",children:[s.jsx(Ya,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),s.jsx("input",{type:"date",required:!0,className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none",value:I.date,onChange:de=>D({...I,date:de.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Horário"}),s.jsxs("div",{className:"relative",children:[s.jsx(oo,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),s.jsx("input",{type:"time",className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none",value:I.time,onChange:de=>D({...I,time:de.target.value})})]})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Duração"}),s.jsxs("select",{className:"w-full bg-slate-950 border border-slate-800 rounded-lg px-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none appearance-none",value:I.duration,onChange:de=>D({...I,duration:parseInt(de.target.value)}),children:[s.jsx("option",{value:"15",children:"15 min"}),s.jsx("option",{value:"30",children:"30 min"}),s.jsx("option",{value:"45",children:"45 min"}),s.jsx("option",{value:"60",children:"1 hora"}),s.jsx("option",{value:"90",children:"1h 30min"}),s.jsx("option",{value:"120",children:"2 horas"})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Tipo"}),s.jsxs("select",{className:"w-full bg-slate-950 border border-slate-800 rounded-lg px-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none appearance-none",value:I.type,onCh
1160ange:de=>D({...I,type:de.target.value}),children:[s.jsx("option",{value:"demo",children:"Demo"}),s.jsx("option",{value:"meeting",children:"Reunião"}),s.jsx("option",{value:"support",children:"Suporte"}),s.jsx("option",{value:"followup",children:"Follow-up"})]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"TÃtulo do Evento"}),s.jsx("input",{required:!0,type:"text",className:"w-full bg-slate-950 border border-slate-800 rounded-lg p-3 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none placeholder:text-slate-600",placeholder:"Ex: Apresentação para Cliente X",value:I.title,onChange:de=>D({...I,title:de.target.value})})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Descrição"}),s.jsxs("div",{className:"relative",children:[s.jsx(GT,{className:"absolute left-3 top-3 w-4 h-4 text-slate-500"}),s.jsx("textarea",{className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-3 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none placeholder:text-slate-600 resize-none h-24",placeholder:"Detalhes adicionais...",value:I.description,onChange:de=>D({...I,description:de.target.value})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Contato Vinculado"}),s.jsxs("div",{className:"relative",children:[s.jsx(ib,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),s.jsxs("select",{value:L||"",onChange:de=>z(de.target.value||null),className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none appearance-none",children:[s.jsx("option",{value:"",children:"Selecionar contato (opcional)"}),l.map(de=>s.jsxs("option",{value:de.id,children:[de.name||de.phone," - ",de.phone]},de.id))]})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-xs font-bold uppercase text-slate-500 tracking-wider",children:"Participantes Adicionais"}),s.jsxs("div",{className:"relative",children:[s.jsx(mn,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-500"}),s.jsx("input",{type:"text",className:"w-full bg-slate-950 border border-slate-800 rounded-lg pl-10 pr-3 py-2.5 text-sm text-white focus:ring-1 focus:ring-red-500 outline-none placeholder:text-slate-600",placeholder:"Ex: João Silva, Maria Santos",value:I.attendees,onChange:de=>D({...I,attendees:de.target.value})})]}),s.jsx("p",{className:"text-xs text-slate-500",children:"Separe os nomes por vÃrgula"})]}),s.jsxs("div",{className:"pt-4 flex gap-3",children:[s.jsx(Ne,{type:"button",variant:"ghost",onClick:()=>{x(!1),N(null)},className:"flex-1 border border-slate-700 hover:bg-slate-800",children:"Cancelar"}),s.jsx(Ne,{type:"submit",disabled:m,className:"flex-1",children:m?"Salvando...":"Salvar Alterações"})]})]})]})})]})};var sm=t=>t.type==="checkbox",vl=t=>t instanceof Date,kn=t=>t==null;const jU=t=>typeof t=="object";var Nr=t=>!kn(t)&&!Array.isArray(t)&&jU(t)&&!vl(t),NU=t=>Nr(t)&&t.target?sm(t.target)?t.target.checked:t.target.value:t,Yje=t=>t.substring(0,t.search(/\.\d+(\.|$)/))||t,SU=(t,e)=>t.has(Yje(e)),Xje=t=>{const e=t.constructor&&t.constructor.prototype;return Nr(e)&&e.hasOwnProperty("isPrototypeOf")},kE=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Pr(t){let e;const r=Array.isArray(t),n=typeof FileList<"u"?t instanceof FileList:!1;if(t instanceof Date)e=new Date(t);else if(!(kE&&(t instanceof Blob||n))&&(r||Nr(t)))if(e=r?[]:Object.create(Object.getPrototypeOf(t)),!r&&!Xje(t))e=t;else for(const a in t)t.hasOwnProperty(a)&&(e[a]=Pr(t[a]));else return t;return e}var dx=t=>/^\w*$/.test(t),hr=t=>t===void 0,EE=t=>Array.isArray(t)?t.filter(Boolean):[],AE=t=>EE(t.replace(/["|']|\]/g,"").split(/\.|\[/)),Le=(t,e,r)=>{if(!e||!Nr(t))return r;const n=(dx(e)?[e]:AE(e)).reduce((a,i)=>kn(a)?a:a[i],t);return hr(n)||n===t?hr(t[e])?r:t[e]:n},qn=t=>typeof t=="boolean",Vt=(t,e,r)=>{let n=-1;const a=dx(e)?[e]:AE(e),i=a.length,o=i-1;for(;++n<i;){const l=a[n];let u=r;if(n!==o){const d=t[l];u=Nr(d)||Array.isArray(d)?d:isNaN(+a[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;t[l]=u,t=t[l]}};const Iv={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Za={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Gs={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},PE=U.createContext(null);PE.displayName="HookFormContext";const fx=()=>U.useContext(PE),Zje=t=>{const{children:e,...r}=t;return U.createElement(PE.Provider,{value:r},e)};var CU=(t,e,r,n=!0)=>{const a={defaultValues:e._defaultValues};for(const i in t)Object.defineProperty(a,i,{get:()=>{const o=i;return e._proxyFormState[o]!==Za.all&&(e._proxyFormState[o]=!n||Za.all),r&&(r[o]=!0),t[o]}});return a};const TE=typeof window<"u"?U.useLayoutEffect:U.useEffect;function Qje(t){const e=fx(),{control:r=e.control,disabled:n,name:a,exact:i}=t||{},[o,l]=U.useState(r._formState),u=U.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return TE(()=>r._subscribe({name:a,formState:u.current,exact:i,callback:d=>{!n&&l({...r._formState,...d})}}),[a,n,i]),U.useEffect(()=>{u.current.isValid&&r._setValid(!0)},[r]),U.useMemo(()=>CU(o,r,u.current,!1),[o,r])}var Yn=t=>typeof t=="string",_2=(t,e,r,n,a)=>Yn(t)?(n&&e.watch.add(t),Le(r,t,a)):Array.isArray(t)?t.map(i=>(n&&e.watch.add(i),Le(r,i))):(n&&(e.watchAll=!0),r),j2=t=>kn(t)||!jU(t);function Qa(t,e,r=new WeakSet){if(j2(t)||j2(e))return Object.is(t,e);if(vl(t)&&vl(e))return t.getTime()===e.getTime();const n=Object.keys(t),a=Object.keys(e);if(n.length!==a.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const i of n){const o=t[i];if(!a.includes(i))return!1;if(i!=="ref"){const l=e[i];if(vl(o)&&vl(l)||Nr(o)&&Nr(l)||Array.isArray(o)&&Array.isArray(l)?!Qa(o,l,r):!Object.is(o,l))return!1}}return!0}function Jje(t){const e=fx(),{control:r=e.control,name:n,defaultValue:a,disabled:i,exact:o,c
vendor: 5,182 bytes, line 1160
1160ompute:l}=t||{},u=U.useRef(a),d=U.useRef(l),h=U.useRef(void 0),m=U.useRef(r),p=U.useRef(n);d.current=l;const[v,b]=U.useState(()=>{const k=r._getWatch(n,u.current);return d.current?d.current(k):k}),y=U.useCallback(k=>{const C=_2(n,r._names,k||r._formValues,!1,u.current);return d.current?d.current(C):C},[r._formValues,r._names,n]),x=U.useCallback(k=>{if(!i){const C=_2(n,r._names,k||r._formValues,!1,u.current);if(d.current){const A=d.current(C);Qa(A,h.current)||(b(A),h.current=A)}else b(C)}},[r._formValues,r._names,i,n]);TE(()=>((m.current!==r||!Qa(p.current,n))&&(m.current=r,p.current=n,x()),r._subscribe({name:n,formState:{values:!0},exact:o,callback:k=>{x(k.values)}})),[r,o,n,x]),U.useEffect(()=>r._removeUnmounted());const j=m.current!==r,N=p.current,S=U.useMemo(()=>{if(i)return null;const k=!j&&!Qa(N,n);return j||k?y():null},[i,j,n,N,y]);return S!==null?S:v}function eNe(t){const e=fx(),{name:r,disabled:n,control:a=e.control,shouldUnregister:i,defaultValue:o}=t,l=SU(a._names.array,r),u=U.useMemo(()=>Le(a._formValues,r,Le(a._defaultValues,r,o)),[a,r,o]),d=Jje({control:a,name:r,defaultValue:u,exact:!0}),h=Qje({control:a,name:r,exact:!0}),m=U.useRef(t),p=U.useRef(void 0),v=U.useRef(a.register(r,{...t.rules,value:d,...qn(t.disabled)?{disabled:t.disabled}:{}}));m.current=t;const b=U.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Le(h.errors,r)},isDirty:{enumerable:!0,get:()=>!!Le(h.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!Le(h.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!Le(h.validatingFields,r)},error:{enumerable:!0,get:()=>Le(h.errors,r)}}),[h,r]),y=U.useCallback(S=>v.current.onChange({target:{value:NU(S),name:r},type:Iv.CHANGE}),[r]),x=U.useCallback(()=>v.current.onBlur({target:{value:Le(a._formValues,r),name:r},type:Iv.BLUR}),[r,a._formValues]),j=U.useCallback(S=>{const k=Le(a._fields,r);k&&S&&(k._f.ref={focus:()=>S.focus&&S.focus(),select:()=>S.select&&S.select(),setCustomValidity:C=>S.setCustomValidity(C),reportValidity:()=>S.reportValidity()})},[a._fields,r]),N=U.useMemo(()=>({name:r,value:d,...qn(n)||h.disabled?{disabled:h.disabled||n}:{},onChange:y,onBlur:x,ref:j}),[r,n,h.disabled,y,x,j,d]);return U.useEffect(()=>{const S=a._options.shouldUnregister||i,k=p.current;k&&k!==r&&!l&&a.unregister(k),a.register(r,{...m.current.rules,...qn(m.current.disabled)?{disabled:m.current.disabled}:{}});const C=(A,T)=>{const R=Le(a._fields,A);R&&R._f&&(R._f.mount=T)};if(C(r,!0),S){const A=Pr(Le(a._options.defaultValues,r,m.current.defaultValue));Vt(a._defaultValues,r,A),hr(Le(a._formValues,r))&&Vt(a._formValues,r,A)}return!l&&a.register(r),p.current=r,()=>{(l?S&&!a._state.action:S)?a.unregister(r):C(r,!1)}},[r,a,l,i]),U.useEffect(()=>{a._setDisabledField({disabled:n,name:r})},[n,r,a]),U.useMemo(()=>({field:N,formState:h,fieldState:b}),[N,h,b])}const tNe=t=>t.render(eNe(t));var kU=(t,e,r,n,a)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:a||!0}}:{},Rf=t=>Array.isArray(t)?t:[t],aL=()=>{let t=[];return{get observers(){return t},next:a=>{for(const i of t)i.next&&i.next(a)},subscribe:a=>(t.push(a),{unsubscribe:()=>{t=t.filter(i=>i!==a)}}),unsubscribe:()=>{t=[]}}};function EU(t,e){const r={};for(const n in t)if(t.hasOwnProperty(n)){const a=t[n],i=e[n];if(a&&Nr(a)&&i){const o=EU(a,i);Nr(o)&&(r[n]=o)}else t[n]&&(r[n]=i)}return r}var fn=t=>Nr(t)&&!Object.keys(t).length,OE=t=>t.type==="file",Ja=t=>typeof t=="function",Dv=t=>{if(!kE)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},AU=t=>t.type==="select-multiple",ME=t=>t.type==="radio",rNe=t=>ME(t)||sm(t),Gj=t=>Dv(t)&&t.isConnected;function nNe(t,e){const r=e.slice(0,-1).length;let n=0;for(;n<r;)t=hr(t)?n++:t[e[n++]];return t}function aNe(t){for(const e in t)if(t.hasOwnProperty(e)&&!hr(t[e]))return!1;return!0}function xr(t,e){const r=Array.isArray(e)?e:dx(e)?[e]:AE(e),n=r.length===1?t:nNe(t,r),a=r.length-1,i=r[a];return n&&delete n[i],a!==0&&(Nr(n)&&fn(n)||Array.isArray(n)&&aNe(n))&&xr(t,r.slice(0,-1)),t}var sNe=t=>{for(const e in t)if(Ja(t[e]))return!0;return!1};function PU(t){return Array.isArray(t)||Nr(t)&&!sNe(t)}function N2(t,e={}){for(const r in t){const n=t[r];PU(n)?(e[r]=Array.isArray(n)?[]:{},N2(n,e[r])):hr(n)||(e[r]=!0)}return e}function Mc(t,e,r){r||(r=N2(e));for(const n in t){const a=t[n];if(PU(a))hr(e)||j2(r[n])?r[n]=N2(a,Array.isArray(a)?[]:{}):Mc(a,kn(e)?{}:e[n],r[n]);else{const i=e[n];r[n]=!Qa(a,i)}}return r}const sL={value:!1,isValid:!1},iL={value:!0,isValid:!0};var TU=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!hr(t[0].attributes.value)?hr(t[0].value)||t[0].value===""?iL:{value:t[0].value,isValid:!0}:iL:sL}return sL},OU=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:n})=>hr(t)?t:e?t===""?NaN:t&&+t:r&&Yn(t)?new Date(t):n?n(t):t;const oL={isValid:!1,value:null};var MU=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,oL):oL;function lL(t){const e=t.ref;return OE(e)?e.files:ME(e)?MU(t.refs).value:AU(e)?[...e.selectedOptions].map(({value:r})=>
vendor: 4,999 bytes, line 1160
1160r):sm(e)?TU(t.refs).value:OU(hr(e.value)?t.ref.value:e.value,t)}var iNe=(t,e,r,n)=>{const a={};for(const i of t){const o=Le(e,i);o&&Vt(a,i,o._f)}return{criteriaMode:r,names:[...t],fields:a,shouldUseNativeValidation:n}},$v=t=>t instanceof RegExp,ff=t=>hr(t)?t:$v(t)?t.source:Nr(t)?$v(t.value)?t.value.source:t.value:t,cL=t=>({isOnSubmit:!t||t===Za.onSubmit,isOnBlur:t===Za.onBlur,isOnChange:t===Za.onChange,isOnAll:t===Za.all,isOnTouch:t===Za.onTouched});const uL="AsyncFunction";var oNe=t=>!!t&&!!t.validate&&!!(Ja(t.validate)&&t.validate.constructor.name===uL||Nr(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===uL)),lNe=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),dL=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(n)&&/^\.\w+/.test(t.slice(n.length))));const If=(t,e,r,n)=>{for(const a of r||Object.keys(t)){const i=Le(t,a);if(i){const{_f:o,...l}=i;if(o){if(o.refs&&o.refs[0]&&e(o.refs[0],a)&&!n)return!0;if(o.ref&&e(o.ref,o.name)&&!n)return!0;if(If(l,e))break}else if(Nr(l)&&If(l,e))break}}};function fL(t,e,r){const n=Le(t,r);if(n||dx(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const i=a.join("."),o=Le(e,i),l=Le(t,i);if(o&&!Array.isArray(o)&&r!==i)return{name:r};if(l&&l.type)return{name:i,error:l};if(l&&l.root&&l.root.type)return{name:`${i}.root`,error:l.root};a.pop()}return{name:r}}var cNe=(t,e,r,n)=>{r(t);const{name:a,...i}=t;return fn(i)||Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(o=>e[o]===(!n||Za.all))},uNe=(t,e,r)=>!t||!e||t===e||Rf(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),dNe=(t,e,r,n,a)=>a.isOnAll?!1:!r&&a.isOnTouch?!(e||t):(r?n.isOnBlur:a.isOnBlur)?!t:(r?n.isOnChange:a.isOnChange)?t:!0,fNe=(t,e)=>!EE(Le(t,e)).length&&xr(t,e),hNe=(t,e,r)=>{const n=Rf(Le(t,r));return Vt(n,"root",e[r]),Vt(t,r,n),t};function hL(t,e,r="validate"){if(Yn(t)||Array.isArray(t)&&t.every(Yn)||qn(t)&&!t)return{type:r,message:Yn(t)?t:"",ref:e}}var Ec=t=>Nr(t)&&!$v(t)?t:{value:t,message:""},mL=async(t,e,r,n,a,i)=>{const{ref:o,refs:l,required:u,maxLength:d,minLength:h,min:m,max:p,pattern:v,validate:b,name:y,valueAsNumber:x,mount:j}=t._f,N=Le(r,y);if(!j||e.has(y))return{};const S=l?l[0]:o,k=z=>{a&&S.reportValidity&&(S.setCustomValidity(qn(z)?"":z||""),S.reportValidity())},C={},A=ME(o),T=sm(o),R=A||T,I=(x||OE(o))&&hr(o.value)&&hr(N)||Dv(o)&&o.value===""||N===""||Array.isArray(N)&&!N.length,D=kU.bind(null,y,n,C),L=(z,H,Z,te=Gs.maxLength,G=Gs.minLength)=>{const M=z?H:Z;C[y]={type:z?te:G,message:M,ref:o,...D(z?te:G,M)}};if(i?!Array.isArray(N)||!N.length:u&&(!R&&(I||kn(N))||qn(N)&&!N||T&&!TU(l).isValid||A&&!MU(l).isValid)){const{value:z,message:H}=Yn(u)?{value:!!u,message:u}:Ec(u);if(z&&(C[y]={type:Gs.required,message:H,ref:S,...D(Gs.required,H)},!n))return k(H),C}if(!I&&(!kn(m)||!kn(p))){let z,H;const Z=Ec(p),te=Ec(m);if(!kn(N)&&!isNaN(N)){const G=o.valueAsNumber||N&&+N;kn(Z.value)||(z=G>Z.value),kn(te.value)||(H=G<te.value)}else{const G=o.valueAsDate||new Date(N),M=B=>new Date(new Date().toDateString()+" "+B),F=o.type=="time",K=o.type=="week";Yn(Z.value)&&N&&(z=F?M(N)>M(Z.value):K?N>Z.value:G>new Date(Z.value)),Yn(te.value)&&N&&(H=F?M(N)<M(te.value):K?N<te.value:G<new Date(te.value))}if((z||H)&&(L(!!z,Z.message,te.message,Gs.max,Gs.min),!n))return k(C[y].message),C}if((d||h)&&!I&&(Yn(N)||i&&Array.isArray(N))){const z=Ec(d),H=Ec(h),Z=!kn(z.value)&&N.length>+z.value,te=!kn(H.value)&&N.length<+H.value;if((Z||te)&&(L(Z,z.message,H.message),!n))return k(C[y].message),C}if(v&&!I&&Yn(N)){const{value:z,message:H}=Ec(v);if($v(z)&&!N.match(z)&&(C[y]={type:Gs.pattern,message:H,ref:o,...D(Gs.pattern,H)},!n))return k(H),C}if(b){if(Ja(b)){const z=await b(N,r),H=hL(z,S);if(H&&(C[y]={...H,...D(Gs.validate,H.message)},!n))return k(H.message),C}else if(Nr(b)){let z={};for(const H in b){if(!fn(z)&&!n)break;const Z=hL(await b[H](N,r),S,H);Z&&(z={...Z,...D(H,Z.message)},k(Z.message),n&&(C[y]=z))}if(!fn(z)&&(C[y]={ref:S,...z},!n))return C}}return k(!0),C};const mNe={mode:Za.onSubmit,reValidateMode:Za.onChange,shouldFocusError:!0};function pNe(t={}){let e={...mNe,...t},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:Ja(e.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1},n={},a=Nr(e.defaultValues)||Nr(e.values)?Pr(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:Pr(a),o={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u,d=0;const h={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let m={...h};const p={array:aL(),state:aL()},v=e.criteriaMode===Za.all,b=Y=>ne=>{clearTimeout(d),d=setTimeout(Y,ne)},y=async Y=>{if(!e.disabled&&(h.isValid||m.isValid||Y)){const ne=e.resolver?fn((await T()).errors):await I(n,!0);ne!==r.isValid&&p.state.next({isValid:ne})}},x=(Y,ne)=>
vendor: 14,262 bytes, line 1160
1160{!e.disabled&&(h.isValidating||h.validatingFields||m.isValidating||m.validatingFields)&&((Y||Array.from(l.mount)).forEach(le=>{le&&(ne?Vt(r.validatingFields,le,ne):xr(r.validatingFields,le))}),p.state.next({validatingFields:r.validatingFields,isValidating:!fn(r.validatingFields)}))},j=(Y,ne=[],le,Se,Ae=!0,Ce=!0)=>{if(Se&&le&&!e.disabled){if(o.action=!0,Ce&&Array.isArray(Le(n,Y))){const $e=le(Le(n,Y),Se.argA,Se.argB);Ae&&Vt(n,Y,$e)}if(Ce&&Array.isArray(Le(r.errors,Y))){const $e=le(Le(r.errors,Y),Se.argA,Se.argB);Ae&&Vt(r.errors,Y,$e),fNe(r.errors,Y)}if((h.touchedFields||m.touchedFields)&&Ce&&Array.isArray(Le(r.touchedFields,Y))){const $e=le(Le(r.touchedFields,Y),Se.argA,Se.argB);Ae&&Vt(r.touchedFields,Y,$e)}(h.dirtyFields||m.dirtyFields)&&(r.dirtyFields=Mc(a,i)),p.state.next({name:Y,isDirty:L(Y,ne),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else Vt(i,Y,ne)},N=(Y,ne)=>{Vt(r.errors,Y,ne),p.state.next({errors:r.errors})},S=Y=>{r.errors=Y,p.state.next({errors:r.errors,isValid:!1})},k=(Y,ne,le,Se)=>{const Ae=Le(n,Y);if(Ae){const Ce=Le(i,Y,hr(le)?Le(a,Y):le);hr(Ce)||Se&&Se.defaultChecked||ne?Vt(i,Y,ne?Ce:lL(Ae._f)):Z(Y,Ce),o.mount&&!o.action&&y()}},C=(Y,ne,le,Se,Ae)=>{let Ce=!1,$e=!1;const Be={name:Y};if(!e.disabled){if(!le||Se){(h.isDirty||m.isDirty)&&($e=r.isDirty,r.isDirty=Be.isDirty=L(),Ce=$e!==Be.isDirty);const tt=Qa(Le(a,Y),ne);$e=!!Le(r.dirtyFields,Y),tt?xr(r.dirtyFields,Y):Vt(r.dirtyFields,Y,!0),Be.dirtyFields=r.dirtyFields,Ce=Ce||(h.dirtyFields||m.dirtyFields)&&$e!==!tt}if(le){const tt=Le(r.touchedFields,Y);tt||(Vt(r.touchedFields,Y,le),Be.touchedFields=r.touchedFields,Ce=Ce||(h.touchedFields||m.touchedFields)&&tt!==le)}Ce&&Ae&&p.state.next(Be)}return Ce?Be:{}},A=(Y,ne,le,Se)=>{const Ae=Le(r.errors,Y),Ce=(h.isValid||m.isValid)&&qn(ne)&&r.isValid!==ne;if(e.delayError&&le?(u=b(()=>N(Y,le)),u(e.delayError)):(clearTimeout(d),u=null,le?Vt(r.errors,Y,le):xr(r.errors,Y)),(le?!Qa(Ae,le):Ae)||!fn(Se)||Ce){const $e={...Se,...Ce&&qn(ne)?{isValid:ne}:{},errors:r.errors,name:Y};r={...r,...$e},p.state.next($e)}},T=async Y=>{x(Y,!0);const ne=await e.resolver(i,e.context,iNe(Y||l.mount,n,e.criteriaMode,e.shouldUseNativeValidation));return x(Y),ne},R=async Y=>{const{errors:ne}=await T(Y);if(Y)for(const le of Y){const Se=Le(ne,le);Se?Vt(r.errors,le,Se):xr(r.errors,le)}else r.errors=ne;return ne},I=async(Y,ne,le={valid:!0})=>{for(const Se in Y){const Ae=Y[Se];if(Ae){const{_f:Ce,...$e}=Ae;if(Ce){const Be=l.array.has(Ce.name),tt=Ae._f&&oNe(Ae._f);tt&&h.validatingFields&&x([Ce.name],!0);const Dt=await mL(Ae,l.disabled,i,v,e.shouldUseNativeValidation&&!ne,Be);if(tt&&h.validatingFields&&x([Ce.name]),Dt[Ce.name]&&(le.valid=!1,ne))break;!ne&&(Le(Dt,Ce.name)?Be?hNe(r.errors,Dt,Ce.name):Vt(r.errors,Ce.name,Dt[Ce.name]):xr(r.errors,Ce.name))}!fn($e)&&await I($e,ne,le)}}return le.valid},D=()=>{for(const Y of l.unMount){const ne=Le(n,Y);ne&&(ne._f.refs?ne._f.refs.every(le=>!Gj(le)):!Gj(ne._f.ref))&&Q(Y)}l.unMount=new Set},L=(Y,ne)=>!e.disabled&&(Y&&ne&&Vt(i,Y,ne),!Qa(B(),a)),z=(Y,ne,le)=>_2(Y,l,{...o.mount?i:hr(ne)?a:Yn(Y)?{[Y]:ne}:ne},le,ne),H=Y=>EE(Le(o.mount?i:a,Y,e.shouldUnregister?Le(a,Y,[]):[])),Z=(Y,ne,le={})=>{const Se=Le(n,Y);let Ae=ne;if(Se){const Ce=Se._f;Ce&&(!Ce.disabled&&Vt(i,Y,OU(ne,Ce)),Ae=Dv(Ce.ref)&&kn(ne)?"":ne,AU(Ce.ref)?[...Ce.ref.options].forEach($e=>$e.selected=Ae.includes($e.value)):Ce.refs?sm(Ce.ref)?Ce.refs.forEach($e=>{(!$e.defaultChecked||!$e.disabled)&&(Array.isArray(Ae)?$e.checked=!!Ae.find(Be=>Be===$e.value):$e.checked=Ae===$e.value||!!Ae)}):Ce.refs.forEach($e=>$e.checked=$e.value===Ae):OE(Ce.ref)?Ce.ref.value="":(Ce.ref.value=Ae,Ce.ref.type||p.state.next({name:Y,values:Pr(i)})))}(le.shouldDirty||le.shouldTouch)&&C(Y,Ae,le.shouldTouch,le.shouldDirty,!0),le.shouldValidate&&K(Y)},te=(Y,ne,le)=>{for(const Se in ne){if(!ne.hasOwnProperty(Se))return;const Ae=ne[Se],Ce=Y+"."+Se,$e=Le(n,Ce);(l.array.has(Y)||Nr(Ae)||$e&&!$e._f)&&!vl(Ae)?te(Ce,Ae,le):Z(Ce,Ae,le)}},G=(Y,ne,le={})=>{const Se=Le(n,Y),Ae=l.array.has(Y),Ce=Pr(ne);Vt(i,Y,Ce),Ae?(p.array.next({name:Y,values:Pr(i)}),(h.isDirty||h.dirtyFields||m.isDirty||m.dirtyFields)&&le.shouldDirty&&p.state.next({name:Y,dirtyFields:Mc(a,i),isDirty:L(Y,Ce)})):Se&&!Se._f&&!kn(Ce)?te(Y,Ce,le):Z(Y,Ce,le),dL(Y,l)&&p.state.next({...r,name:Y}),p.state.next({name:o.mount?Y:void 0,values:Pr(i)})},M=async Y=>{o.mount=!0;const ne=Y.target;let le=ne.name,Se=!0;const Ae=Le(n,le),Ce=tt=>{Se=Number.isNaN(tt)||vl(tt)&&isNaN(tt.getTime())||Qa(tt,Le(i,le,tt))},$e=cL(e.mode),Be=cL(e.reValidateMode);if(Ae){let tt,Dt;const ye=ne.type?lL(Ae._f):NU(Y),mt=Y.type===Iv.BLUR||Y.type===Iv.FOCUS_OUT,qt=!lNe(Ae._f)&&!e.resolver&&!Le(r.errors,le)&&!Ae._f.deps||dNe(mt,Le(r.touchedFields,le),r.isSubmitted,Be,$e),cr=dL(le,l,mt);Vt(i,le,ye),mt?(!ne||!ne.readOnly)&&(Ae._f.onBlur&&Ae._f.onBlur(Y),u&&u(0)):Ae._f.onChange&&Ae._f.onChange(Y);const Je=C(le,ye,mt),Rt=!fn(Je)||cr;if(!mt&&p.state.next({name:le,type:Y.type,values:Pr(i)}),qt)return(h.isValid||m.isValid)&&(e.mode==="onBlur"?mt&&y():mt||y()),Rt&&p.state.next({name:le,...cr?{}:Je});if(!mt&&cr&&p.state.next({...r}),e.resolver){const{errors:bt}=await T([le]);if(Ce(ye),Se){const it=fL(r.errors,n,le),wt=fL(bt,n,it.name||le);tt=wt.error,le=wt.name,Dt=fn(bt)}}else x([le],!0),tt=(await mL(Ae,l.disabled,i,v,e.shouldUseNativeValidation))[le],x([le]),Ce(ye),Se&&(tt?Dt=!1:(h.isValid||m.isValid)&&(Dt=await I(n,!0)));Se&&(Ae._f.deps&&(!Array.isArray(Ae._f.deps)||Ae._f.deps.length>0)&&K(Ae._f.deps),A(le,Dt,tt,Je))}},F=(Y,ne)=>{if(Le(r.errors,ne)&&Y.focus)return Y.focus(),1},K=async(Y,ne={})=>{let le,Se;const Ae=Rf(Y);if(e.resolver){const Ce=await R(hr(Y)?Y:Ae);le=fn(Ce),Se=Y?!Ae.some($e=>Le(Ce,$e)):le}else Y?(Se=(await Promise.all(Ae.map(async Ce=>{const $e=Le(n,Ce);return await I($e&&$e._f?{[Ce]:$e}:$e)}))).every(Boolean),!(!Se&&!r.isValid)&&y()):Se=le=await I(n);return p.state.next({...!Yn(Y)||(h.isValid||m.isValid)&&le!==r.isValid?{}:{name:Y},...e.resolver||!Y?{isValid:le}:{},errors:r.errors}),ne.shouldFocus&&!Se&&If(n,F,Y?Ae:l.mount),Se},B=(Y,ne)=>{let le={...o.mount?i:a};return ne&&(le=EU(ne.dirtyFields?r.dirtyFields:r.touchedFields,le)),hr(Y)?le:Yn(Y)?Le(le,Y):Y.map(Se=>Le(le,Se))},O=(Y,ne)=>({invalid:!!Le((ne||r).errors,Y),isDirty:!!Le((ne||r).dirtyFields,Y),error:Le((ne||r).errors,Y),isValidating:!!Le(r.validatingFields,Y),isTouched:!!Le((ne||r).touchedFields,Y)}),W=Y=>{Y&&Rf(Y).forEach(ne=>xr(r.errors,ne)),p.state.next({errors:Y?r.errors:{}})},q=(Y,ne,le)=>{const Se=(Le(n,Y,{_f:{}})._f||{}).ref,Ae=Le(r.errors,Y)||{},{ref:Ce,message:$e,type:Be,...tt}=Ae;Vt(r.errors,Y,{...tt,...ne,ref:Se}),p.state.next({name:Y,errors:r.errors,isValid:!1}),le&&le.shouldFocus&&Se&&Se.focus&&Se.focus()},se=(Y,ne)=>Ja(Y)?p.state.subscribe({next:le=>"values"in le&&Y(z(void 0,ne),le)}):z(Y,ne,!0),me=Y=>p.state.subscribe({next:ne=>{uNe(Y.name,ne.name,Y.exact)&&cNe(ne,Y.formState||h,de,Y.reRenderRoot)&&Y.callback({values:{...i},...r,...ne,defaultValues:a})}}).unsubscribe,fe=Y=>(o.mount=!0,m={...m,...Y.formState},me({...Y,formState:m})),Q=(Y,ne={})=>{for(const le of Y?Rf(Y):l.mount)l.mount.delete(le),l.array.delete(le),ne.keepValue||(xr(n,le),xr(i,le)),!ne.keepError&&xr(r.errors,le),!ne.keepDirty&&xr(r.dirtyFields,le),!ne.keepTouched&&xr(r.touchedFields,le),!ne.keepIsValidating&&xr(r.validatingFields,le),!e.shouldUnregister&&!ne.keepDefaultValue&&xr(a,le);p.state.next({values:Pr(i)}),p.state.next({...r,...ne.keepDirty?{isDirty:L()}:{}}),!ne.keepIsValid&&y()},pe=({disabled:Y,name:ne})=>{(qn(Y)&&o.mount||Y||l.disabled.has(ne))&&(Y?l.disabled.add(ne):l.disabled.delete(ne))},V=(Y,ne={})=>{let le=Le(n,Y);const Se=qn(ne.disabled)||qn(e.disabled);return Vt(n,Y,{...le||{},_f:{...le&&le._f?le._f:{ref:{name:Y}},name:Y,mount:!0,...ne}}),l.mount.add(Y),le?pe({disabled:qn(ne.disabled)?ne.disabled:e.disabled,name:Y}):k(Y,!0,ne.value),{...Se?{disabled:ne.disabled||e.disabled}:{},...e.progressive?{required:!!ne.required,min:ff(ne.min),max:ff(ne.max),minLength:ff(ne.minLength),maxLength:ff(ne.maxLength),pattern:ff(ne.pattern)}:{},name:Y,onChange:M,onBlur:M,ref:Ae=>{if(Ae){V(Y,ne),le=Le(n,Y);const Ce=hr(Ae.value)&&Ae.querySelectorAll&&Ae.querySelectorAll("input,select,textarea")[0]||Ae,$e=rNe(Ce),Be=le._f.refs||[];if($e?Be.find(tt=>tt===Ce):Ce===le._f.ref)return;Vt(n,Y,{_f:{...le._f,...$e?{refs:[...Be.filter(Gj),Ce,...Array.isArray(Le(a,Y))?[{}]:[]],ref:{type:Ce.type,name:Y}}:{ref:Ce}}}),k(Y,!1,void 0,Ce)}else le=Le(n,Y,{}),le._f&&(le._f.mount=!1),(e.shouldUnregister||ne.shouldUnregister)&&!(SU(l.array,Y)&&o.action)&&l.unMount.add(Y)}}},J=()=>e.shouldFocusError&&If(n,F,l.mount),oe=Y=>{qn(Y)&&(p.state.next({disabled:Y}),If(n,(ne,le)=>{const Se=Le(n,le);Se&&(ne.disabled=Se._f.disabled||Y,Array.isArray(Se._f.refs)&&Se._f.refs.forEach(Ae=>{Ae.disabled=Se._f.disabled||Y}))},0,!1))},re=(Y,ne)=>async le=>{let Se;le&&(le.preventDefault&&le.preventDefault(),le.persist&&le.persist());let Ae=Pr(i);if(p.state.next({isSubmitting:!0}),e.resolver){const{errors:Ce,values:$e}=await T();r.errors=Ce,Ae=Pr($e)}else await I(n);if(l.disabled.size)for(const Ce of l.disabled)xr(Ae,Ce);if(xr(r.errors,"root"),fn(r.errors)){p.state.next({errors:{}});try{await Y(Ae,le)}catch(Ce){Se=Ce}}else ne&&await ne({...r.errors},le),J(),setTimeout(J);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:fn(r.errors)&&!Se,submitCount:r.submitCount+1,errors:r.errors}),Se)throw Se},Me=(Y,ne={})=>{Le(n,Y)&&(hr(ne.defaultValue)?G(Y,Pr(Le(a,Y))):(G(Y,ne.defaultValue),Vt(a,Y,Pr(ne.defaultValue))),ne.keepTouched||xr(r.touchedFields,Y),ne.keepDirty||(xr(r.dirtyFields,Y),r.isDirty=ne.defaultValue?L(Y,Pr(Le(a,Y))):L()),ne.keepError||(xr(r.errors,Y),h.isValid&&y()),p.state.next({...r}))},ee=(Y,ne={})=>{const le=Y?Pr(Y):a,Se=Pr(le),Ae=fn(Y),Ce=Ae?a:Se;if(ne.keepDefaultValues||(a=le),!ne.keepValues){if(ne.keepDirtyValues){const $e=new Set([...l.mount,...Object.keys(Mc(a,i))]);for(const Be of Array.from($e))Le(r.dirtyFields,Be)?Vt(Ce,Be,Le(i,Be)):G(Be,Le(Ce,Be))}else{if(kE&&hr(Y))for(const $e of l.mount){const Be=Le(n,$e);if(Be&&Be._f){const tt=Array.isArray(Be._f.refs)?Be._f.refs[0]:Be._f.ref;if(Dv(tt)){const Dt=tt.closest("form");if(Dt){Dt.reset();break}}}}if(ne.keepFieldsRef)for(const $e of l.mount)G($e,Le(Ce,$e));else n={}}i=e.shouldUnregister?ne.keepDefaultValues?Pr(a):{}:Pr(Ce),p.array.next({values:{...Ce}}),p.state.next({values:{...Ce}})}l={mount:ne.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},o.mount=!h.isValid||!!ne.keepIsValid||!!ne.keepDirtyValues||!e.shouldUnregister&&!fn(Ce),o.watch=!!e.shouldUnregister,p.state.next({submitCount:ne.keepSubmitCount?r.submitCount:0,isDirty:Ae?!1:ne.keepDirty?r.isDirty:!!(ne.keepDefaultValues&&!Qa(Y,a)),isSubmitted:ne.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:Ae?{}:ne.keepDirtyValues?ne.keepDefaultValues&&i?Mc(a,i):r.dirtyFields:ne.keepDefaultValues&&Y?Mc(a,Y):ne.keepDirty?r.dirtyFields:{},touchedFields:ne.keepTouched?r.touchedFields:{},errors:ne.keepErrors?r.errors:{},isSubmitSuccessful:ne.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},ce=(Y,ne)=>ee(Ja(Y)?Y(i):Y,ne),je=(Y,ne={})=>{const le=Le(n,Y),Se=le&&le._f;if(Se){const Ae=Se.refs?Se.refs[0]:Se.ref;Ae.focus&&(Ae.focus(),ne.shouldSelect&&Ja(Ae.select)&&Ae.select())}},de=Y=>{r={...r,...Y}},ke={control:{register:V,unregister:Q,getFieldState:O,handleSubmit:re,setError:q,_subscribe:me,_runSchema:T,_focusError:J,_getWatch:z,_getDirty:L,_setValid:y,_setFieldArray:j,_setDisabledField:pe,_setErrors:S,_getFieldArray:H,_reset:ee,_resetDefaultValues:()=>Ja(e.defaultValues)&&e.defaultValues().then(Y=>{ce(Y,e.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:D,_disableForm:oe,_subjects:p,_proxyFormState:h,get _fields(){return n},get _formValues(){return i},get _state(){return o},set _state(Y){o=Y},get _defaultValues(){return a},get _names(){return l},set _names(Y){l=Y},get _formState(){return r},get _options(){return e},set _options(Y){e={...e,...Y}}},subscribe:fe,trigger:K,register:V,handleSubmit:re,watch:se,setValue:G,getValues:B,reset:ce,resetField:Me,clearErrors:W,unregister:Q,setError:q,setFocus:je,getFieldState:O};return{...ke,formControl:ke}}function gNe(t={}){const e=U.useRef(void 0),r=U.useRef(void 0),[n,a]=U.useState({isDirty:!1,isValidating:!1,isLoading:Ja(t.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1,isReady:!1,defaultValues:Ja(t.defaultValues)?void 0:t.defaultValues});if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!Ja(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:o,...l}=pNe(t);e.current={...l,formState:n}}const i=e.current.control;return i._options=t,TE(()=>{const o=i._subscribe({formState:i._proxyFormState,callback:()=>a({...i._formState}),reRenderRoot:!0});return a(l=>({...l,isReady:!0})),i._formState.isReady=!0,o},[i]),U.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),U.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),U.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),U.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),U.useEffect(()=>{if(i._proxyFormState.isDirty){const o=i._getDirty();o!==n.isDirty&&i._subjects.state.next({isDirty:o})}},[i,n.isDirty]),U.useEffect(()=>{var o;t.values&&!Qa(t.values,r.current)?(i._reset(t.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((o=i._options.resetOptions)===null||o===void 0)&&o.keepIsValid||i._setValid(),r.current=t.values,a(l=>({...l}))):i._resetDefaultValues()},[i,t.values]),U.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),e.current.formState=CU(n,i),e.current}const pL=(t,e,r)=>{if(t&&"reportValidity"in t){const n=Le(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},RU=(t,e)=>{for(const r in e.fields){const n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?pL(n.ref,r,t):n.refs&&n.refs.forEac
vendor: 3,057 bytes, line 1160
1160h(a=>pL(a,r,t))}},vNe=(t,e)=>{e.shouldUseNativeValidation&&RU(t,e);const r={};for(const n in t){const a=Le(e.fields,n),i=Object.assign(t[n]||{},{ref:a&&a.ref});if(xNe(e.names||Object.keys(t),n)){const o=Object.assign({},Le(r,n));Vt(o,"root",i),Vt(r,n,o)}else Vt(r,n,i)}return r},xNe=(t,e)=>t.some(r=>r.startsWith(e+"."));var yNe=function(t,e){for(var r={};t.length;){var n=t[0],a=n.code,i=n.message,o=n.path.join(".");if(!r[o])if("unionErrors"in n){var l=n.unionErrors[0].errors[0];r[o]={message:l.message,type:l.code}}else r[o]={message:i,type:a};if("unionErrors"in n&&n.unionErrors.forEach(function(h){return h.errors.forEach(function(m){return t.push(m)})}),e){var u=r[o].types,d=u&&u[n.code];r[o]=kU(o,e,r,a,d?[].concat(d,n.message):n.message)}t.shift()}return r},bNe=function(t,e,r){return r===void 0&&(r={}),function(n,a,i){try{return Promise.resolve((function(o,l){try{var u=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](n,e)).then(function(d){return i.shouldUseNativeValidation&&RU({},i),{errors:{},values:r.raw?n:d}})}catch(d){return l(d)}return u&&u.then?u.then(void 0,l):u})(0,function(o){if((function(l){return Array.isArray(l==null?void 0:l.errors)})(o))return{values:{},errors:vNe(yNe(o.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw o}))}catch(o){return Promise.reject(o)}}},Pt;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const i={};for(const o of a)i[o]=o;return i},t.getValidEnumValues=a=>{const i=t.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),o={};for(const l of i)o[l]=a[l];return t.objectValues(o)},t.objectValues=a=>t.objectKeys(a).map(function(i){return a[i]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const i=[];for(const o in a)Object.prototype.hasOwnProperty.call(a,o)&&i.push(o);return i},t.find=(a,i)=>{for(const o of a)if(i(o))return o},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(Pt||(Pt={}));var gL;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(gL||(gL={}));const We=Pt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),eo=t=>{switch(typeof t){case"undefined":return We.undefined;case"string":return We.string;case"number":return Number.isNaN(t)?We.nan:We.number;case"boolean":return We.boolean;case"function":return We.function;case"bigint":return We.bigint;case"symbol":return We.symbol;case"object":return Array.isArray(t)?We.array:t===null?We.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?We.promise:typeof Map<"u"&&t instanceof Map?We.map:typeof Set<"u"&&t instanceof Set?We.set:typeof Date<"u"&&t instanceof Date?We.date:We.object;default:return We.unknown}}
vendor: 2,117 bytes, line 1160
1160,Oe=Pt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class xi extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(i){return i.message},n={_errors:[]},a=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(a);else if(o.code==="invalid_return_type")a(o.returnTypeError);else if(o.code==="invalid_arguments")a(o.argumentsError);else if(o.path.length===0)n._errors.push(r(o));else{let l=n,u=0;for(;u<o.path.length;){const d=o.path[u];u===o.path.length-1?(l[d]=l[d]||{_errors:[]},l[d]._errors.push(r(o))):l[d]=l[d]||{_errors:[]},l=l[d],u++}}};return a(this),n}static assert(e){if(!(e instanceof xi))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Pt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const i=a.path[0];r[i]=r[i]||[],r[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}xi.create=t=>new xi(t);const S2=(t,e)=>{let r;switch(t.code){case Oe.invalid_type:t.received===We.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Oe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Pt.jsonStringifyReplacer)}`;break;case Oe.unrecognized_keys:r=`Unrecognized key(s) in object: ${Pt.joinValues(t.keys,", ")}`;break;case Oe.invalid_union:r="Invalid input";break;case Oe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Pt.j
1160oinValues(t.options)}`;break;case Oe.invalid_enum_value:r=`Invalid enum value. Expected ${Pt.joinValues(t.options)}, received '${t.received}'`;break;case Oe.invalid_arguments:r="Invalid function arguments";break;case Oe.invalid_return_type:r="Invalid function return type";break;case Oe.invalid_date:r="Invalid date";break;case Oe.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Pt.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Oe.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Oe.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Oe.custom:r="Invalid input";break;case Oe.invalid_intersection_types:r="Intersection results could not be merged";break;case Oe.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Oe.not_finite:r="Number must be finite";break;default:r=e.defaultError,Pt.assertNever(t)}return{message:r}};let wNe=S2;function _Ne(){return wNe}const jNe=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,i=[...r,...a.path||[]],o={...a,path:i};if(a.message!==void 0)return{...a,path:i,message:a.message};let l="";const u=n.filter(d=>!!d).slice().reverse();for(const d of u)l=d(o,{data:e,defaultError:l}).message;return{...a,path:i,message:l}};function Fe(t,e){const r=_Ne(),n=jNe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===S2?void 0:S2].filter(a=>!!a)});t.common.issues.push(n)}class ta{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return dt;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const i=await a.key,o=await a.value;n.push({key:i,value:o})}return ta.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:i,value:o}=a;if(i.status==="aborted"||o.status==="aborted")return dt;i.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||a.alwaysSet)&&(n[i.value]=o.value)}return{status:e.value,value:n}}}const dt=Object.freeze({status:"aborted"}),bf=t=>({status:"dirty",value:t}),ka=t=>({status:"valid",value:t}),vL=t=>t.status==="aborted",xL=t=>t.status==="dirty",Lu=t=>t.status==="valid",Lv=t=>typeof Promise<"u"&&t instanceof Promise;var Ye;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(Ye||(Ye={}));class xo{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const yL=(t,e)=>{if(Lu(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new xi(t.common.issues);return this._error=r,this._error}}};function yt(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(o,l)=>{const{message:u}=t;return o.code==="invalid_enum_value"?{message:u??l.defaultError}:typeof l.data>"u"?{message:u??n??l.defaultError}:o.code!=="invalid_type"?{message:l.defaultError}:{message:u??r??l.defaultError}},description:a}}class Et{get description(){return this._def.description}_getType(e){return eo(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:eo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ta,ctx:{common:e.parent.common,data:e.data,parsedType:eo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Lv(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eo(e)},a=this._parseSync({data:e,path:n.path,parent:n});return yL(n,a)}"~validate"(e){var n,a;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eo(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return Lu(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>Lu(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:eo(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Lv(a)?a:Promise.resolve(a));return yL(n,i)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}
vendor: 6,093 bytes, line 1160
1160:typeof r=="function"?r(a):r;return this._refinement((a,i)=>{const o=e(a),l=()=>i.addIssue({code:Oe.custom,...n(a)});return typeof Promise<"u"&&o instanceof Promise?o.then(u=>u?!0:(l(),!1)):o?!0:(l(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new Il({schema:this,typeName:ft.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return li.create(this,this._def)}nullable(){return Dl.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return As.create(this)}promise(){return Uv.create(this,this._def)}or(e){return Bv.create([this,e],this._def)}and(e){return Vv.create(this,e,this._def)}transform(e){return new Il({...yt(this._def),schema:this,typeName:ft.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new qv({...yt(this._def),innerType:this,defaultValue:r,typeName:ft.ZodDefault})}brand(){return new LU({typeName:ft.ZodBranded,type:this,...yt(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new Wv({...yt(this._def),innerType:this,catchValue:r,typeName:ft.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return IE.create(this,e)}readonly(){return Hv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const NNe=/^c[^\s-]{8,}$/i,SNe=/^[0-9a-z]+$/,CNe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,kNe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ENe=/^[a-z0-9_-]{21}$/i,ANe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,PNe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,TNe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ONe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Kj;const MNe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,RNe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,INe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,DNe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$Ne=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,LNe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,IU="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",FNe=new RegExp(`^${IU}$`);function DU(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function BNe(t){return new RegExp(`^${DU(t)}$`)}function VNe(t){let e=`${IU}T${DU(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function zNe(t,e){return!!((e==="v4"||!e)&&MNe.test(t)||(e==="v6"||!e)&&INe.test(t))}function UNe(t,e){if(!ANe.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function qNe(t,e){return!!((e==="v4"||!e)&&RNe.test(t)||(e==="v6"||!e)&&DNe.test(t))}
vendor: 16,673 bytes, line 1160
1160class ai extends Et{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==We.string){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_type,expected:We.string,received:i.parsedType}),dt}const n=new ta;let a;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=e.data.length>i.value,l=e.data.length<i.value;(o||l)&&(a=this._getOrReturnCtx(e,a),o?Fe(a,{code:Oe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):l&&Fe(a,{code:Oe.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")TNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"email",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Kj||(Kj=new RegExp(ONe,"u")),Kj.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"emoji",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")kNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"uuid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")ENe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"nanoid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")NNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"cuid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")SNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"cuid2",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")CNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"ulid",code:Oe.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),Fe(a,{validation:"url",code:Oe.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"regex",code:Oe.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?VNe(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?FNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?BNe(i).test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?PNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"duration",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?zNe(e.data,i.version)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"ip",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?UNe(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"jwt",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?qNe(e.data,i.version)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"cidr",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?$Ne.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"base64",code:Oe.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?LNe.test(e.data)||(a=this._getOrReturnCtx(e,a),Fe(a,{validation:"base64url",code:Oe.invalid_string,message:i.message}),n.dirty()):Pt.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:Oe.invalid_string,...Ye.errToObj(n)})}_addCheck(e){return new ai({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ye.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ye.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ye.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ye.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ye.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ye.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ye.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ye.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ye.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ye.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ye.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ye.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ye.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...Ye.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...Ye.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Ye.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Ye.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...Ye.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Ye.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Ye.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Ye.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Ye.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Ye.errToObj(r)})}nonempty(e){return this.min(1,Ye.errToObj(e))}trim(){return new ai({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ai({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ai({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}ai.create=t=>new ai({checks:[],typeName:ft.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...yt(t)});function WNe(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,i=Number.parseInt(t.toFixed(a).replace(".","")),o=Number.parseInt(e.toFixed(a).replace(".",""));return i%o/10**a}class Tl extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==We.number){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_type,expected:We.number,received:i.parsedType}),dt}let n;const a=new ta;for(const i of this._def.checks)i.kind==="int"?Pt.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?WNe(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.not_finite,message:i.message}),a.dirty()):Pt.assertNever(i);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Ye.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Ye.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Ye.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Ye.toString(r))}setLimit(e,r,n,a){return new Tl({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Ye.toString(a)}]})}_addCheck(e){return new Tl({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ye.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ye.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Ye.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Ye.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ye.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ye.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Pt.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}Tl.create=t=>new Tl({checks:[],typeName:ft.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...yt(t)});class Ol extends Et{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==We.bigint)return this._getInvalidInput(e);let n;const a=new ta;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Fe(n,{code:Oe.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):Pt.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return Fe(r,{code:Oe.invalid_type,expected:We.bigint,received:r.parsedType}),dt}gte(e,r){return this.setLimit("min",e,!0,Ye.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Ye.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Ye.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Ye.toString(r))}setLimit(e,r,n,a){return new Ol({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Ye.toString(a)}]})}_addCheck(e){return new Ol({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ye.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ye.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ye.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ye.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Ye.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Ol.create=t=>new Ol({checks:[],typeName:ft.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...yt(t)});class Fv extends Et{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==We.boolean){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:We.boolean,received:n.parsedType}),dt}return ka(e.data)}}Fv.create=t=>new Fv({typeName:ft.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...yt(t)});class Fu extends Et{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==We.date){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_type,expected:We.date,received:i.parsedType}),dt}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Fe(i,{code:Oe.invalid_date}),dt}const n=new ta;let a;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),Fe(a,{code:Oe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Pt.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Fu({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:Ye.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Ye.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Fu.create=t=>new Fu({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ft.ZodDate,...yt(t)});class bL extends Et{_parse(e){if(this._getType(e)!==We.symbol){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:We.symbol,received:n.parsedType}),dt}return ka(e.data)}}bL.create=t=>new bL({typeName:ft.ZodSymbol,...yt(t)});class C2 extends Et{_parse(e){if(this._getType(e)!==We.undefined){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:We.undefined,received:n.parsedType}),dt}return ka(e.data)}}C2.create=t=>new C2({typeName:ft.ZodUndefined,...yt(t)});class k2 extends Et{_parse(e){if(this._getType(e)!==We.null){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:We.null,received:n.parsedType}),dt}return ka(e.data)}}k2.create=t=>new k2({typeName:ft.ZodNull,...yt(t)});
vendor: 9,144 bytes, line 1160
1160class wL extends Et{constructor(){super(...arguments),this._any=!0}_parse(e){return ka(e.data)}}wL.create=t=>new wL({typeName:ft.ZodAny,...yt(t)});class _L extends Et{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ka(e.data)}}_L.create=t=>new _L({typeName:ft.ZodUnknown,...yt(t)});class yo extends Et{_parse(e){const r=this._getOrReturnCtx(e);return Fe(r,{code:Oe.invalid_type,expected:We.never,received:r.parsedType}),dt}}yo.create=t=>new yo({typeName:ft.ZodNever,...yt(t)});class jL extends Et{_parse(e){if(this._getType(e)!==We.undefined){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:We.void,received:n.parsedType}),dt}return ka(e.data)}}jL.create=t=>new jL({typeName:ft.ZodVoid,...yt(t)});class As extends Et{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==We.array)return Fe(r,{code:Oe.invalid_type,expected:We.array,received:r.parsedType}),dt;if(a.exactLength!==null){const o=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(o||l)&&(Fe(r,{code:o?Oe.too_big:Oe.too_small,minimum:l?a.exactLength.value:void 0,maximum:o?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(Fe(r,{code:Oe.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(Fe(r,{code:Oe.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((o,l)=>a.type._parseAsync(new xo(r,o,r.path,l)))).then(o=>ta.mergeArray(n,o));const i=[...r.data].map((o,l)=>a.type._parseSync(new xo(r,o,r.path,l)));return ta.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new As({...this._def,minLength:{value:e,message:Ye.toString(r)}})}max(e,r){return new As({...this._def,maxLength:{value:e,message:Ye.toString(r)}})}length(e,r){return new As({...this._def,exactLength:{value:e,message:Ye.toString(r)}})}nonempty(e){return this.min(1,e)}}As.create=(t,e)=>new As({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ft.ZodArray,...yt(e)});function Rc(t){if(t instanceof _r){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=li.create(Rc(n))}return new _r({...t._def,shape:()=>e})}else return t instanceof As?new As({...t._def,type:Rc(t.element)}):t instanceof li?li.create(Rc(t.unwrap())):t instanceof Dl?Dl.create(Rc(t.unwrap())):t instanceof Ml?Ml.create(t.items.map(e=>Rc(e))):t}class _r extends Et{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=Pt.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==We.object){const d=this._getOrReturnCtx(e);return Fe(d,{code:Oe.invalid_type,expected:We.object,received:d.parsedType}),dt}const{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:o}=this._getCached(),l=[];if(!(this._def.catchall instanceof yo&&this._def.unknownKeys==="strip"))for(const d in a.data)o.includes(d)||l.push(d);const u=[];for(const d of o){const h=i[d],m=a.data[d];u.push({key:{status:"valid",value:d},value:h._parse(new xo(a,m,a.path,d)),alwaysSet:d in a.data})}if(this._def.catchall instanceof yo){const d=this._def.unknownKeys;if(d==="passthrough")for(const h of l)u.push({key:{status:"valid",value:h},value:{status:"valid",value:a.data[h]}});else if(d==="strict")l.length>0&&(Fe(a,{code:Oe.unrecognized_keys,keys:l}),n.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const d=this._def.catchall;for(const h of l){const m=a.data[h];u.push({key:{status:"valid",value:h},value:d._parse(new xo(a,m,a.path,h)),alwaysSet:h in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const d=[];for(const h of u){const m=await h.key,p=await h.value;d.push({key:m,value:p,alwaysSet:h.alwaysSet})}return d}).then(d=>ta.mergeObjectSync(n,d)):ta.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Ye.errToObj,new _r({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,o;const a=((o=(i=this._def).errorMap)==null?void 0:o.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:Ye.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new _r({...this._def,unknownKeys:"strip"})}passthrough(){return new _r({...this._def,unknownKeys:"passthrough"})}extend(e){return new _r({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new _r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ft.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new _r({...this._def,catchall:e})}pick(e){const r={};for(const n of Pt.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new _r({...this._def,shape:()=>r})}omit(e){const r={};for(const n of Pt.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new _r({...this._def,shape:()=>r})}deepPartial(){return Rc(this)}partial(e){const r={};for(const n of Pt.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new _r({...this._def,shape:()=>r})}required(e){const r={};for(const n of Pt.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof li;)i=i._def.innerType;r[n]=i}return new _r({...this._def,shape:()=>r})}keyof(){return $U(Pt.objectKeys(this.shape))}}_r.create=(t,e)=>new _r({shape:()=>t,unknownKeys:"strip",catchall:yo.create(),typeName:ft.ZodObject,...yt(e)});_r.strictCreate=(t,e)=>new _r({shape:()=>t,unknownKeys:"strict",catchall:yo.create(),typeName:ft.ZodObject,...yt(e)});_r.lazycreate=(t,e)=>new _r({shape:t,unknownKeys:"strip",catchall:yo.create(),typeName:ft.ZodObject,...yt(e)});class Bv extends Et{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(i){for(const l of i)if(l.result.status==="valid")return l.result;for(const l of i)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;const o=i.map(l=>new xi(l.ctx.common.issues));return Fe(r,{code:Oe.invalid_union,unionErrors:o}),dt}if(r.common.async)return Promise.all(n.map(async i=>{const o={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:o}),ctx:o}})).then(a);{let i;const o=[];for(const u of n){const d={...r,common:{...r.common,issues:[]},parent:null},h=u._parseSync({data:r.data,path:r.path,parent:d});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:d}),d.common.issues.length&&o.push(d.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const l=o.map(u=>new xi(u));return Fe(r,{code:Oe.invalid_union,unionErrors:l}),dt}}get options(){return this._def.options}}Bv.create=(t,e)=>new Bv({options:t,typeName:ft.ZodUnion,...yt(e)});const Zs=t=>t instanceof A2?Zs(t.schema):t instanceof Il?Zs(t.innerType()):t instanceof zv?[t.value]:t instanceof Rl?t.options:t instanceof P2?Pt.objectValues(t.enum):t instanceof qv?Zs(t._def.innerType):t instanceof C2?[void 0]:t instanceof k2?[null]:t instanceof li?[void 0,...Zs(t.unwrap())]:t instanceof Dl?[null,...Zs(t.unwrap())]:t instanceof LU||t instanceof Hv?Zs(t.unwrap()):t instanceof Wv?Zs(t._def.innerType):[];class RE extends Et{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==We.object)return Fe(r,{code:Oe.invalid_type,expected:We.object,received:r.parsedType}),dt;const n=this.discriminator,a=r.data[n],i=this.optionsMap.get(a);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(Fe(r,{code:Oe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const i of r){const o=Zs(i.shape[e]);if(!o.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const l of o){if(a.has(l))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(l)}`);a.set(l,i)}}return new RE({typeName:ft.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...yt(n)})}}function E2(t,e){const r=eo(t),n=eo(e);if(t===e)return{valid:!0,data:t};if(r===We.object&&n===We.object){const a=Pt.objectKeys(e),i=Pt.objectKeys(t).filter(l=>a.indexOf(l)!==-1),o={...t,...e};for(const l of i){const u=E2(t[l],e[l]);if(!u.valid)return{valid:!1};o[l]=u.data}return{valid:!0,data:o}}else if(r===We.array&&n===We.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let i=0;i<t.length;i++){const o=t[i],l=e[i],u=E2(o,l);if(!u.valid)return{valid:!1};a.push(u.data)}return{valid:!0,data:a}}else return r===We.date&&n===We.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}
vendor: 1,627 bytes, line 1160
1160class Vv extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(i,o)=>{if(vL(i)||vL(o))return dt;const l=E2(i.value,o.value);return l.valid?((xL(i)||xL(o))&&r.dirty(),{status:r.value,value:l.data}):(Fe(n,{code:Oe.invalid_intersection_types}),dt)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,o])=>a(i,o)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Vv.create=(t,e,r)=>new Vv({left:t,right:e,typeName:ft.ZodIntersection,...yt(r)});class Ml extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==We.array)return Fe(n,{code:Oe.invalid_type,expected:We.array,received:n.parsedType}),dt;if(n.data.length<this._def.items.length)return Fe(n,{code:Oe.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),dt;!this._def.rest&&n.data.length>this._def.items.length&&(Fe(n,{code:Oe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((o,l)=>{const u=this._def.items[l]||this._def.rest;return u?u._parse(new xo(n,o,n.path,l)):null}).filter(o=>!!o);return n.common.async?Promise.all(i).then(o=>ta.mergeArray(r,o)):ta.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Ml({...this._def,rest:e})}}Ml.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ml({items:t,typeName:ft.ZodTuple,rest:null,...yt(e)})};
vendor: 8,352 bytes, line 1160
1160class NL extends Et{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==We.map)return Fe(n,{code:Oe.invalid_type,expected:We.map,received:n.parsedType}),dt;const a=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([l,u],d)=>({key:a._parse(new xo(n,l,n.path,[d,"key"])),value:i._parse(new xo(n,u,n.path,[d,"value"]))}));if(n.common.async){const l=new Map;return Promise.resolve().then(async()=>{for(const u of o){const d=await u.key,h=await u.value;if(d.status==="aborted"||h.status==="aborted")return dt;(d.status==="dirty"||h.status==="dirty")&&r.dirty(),l.set(d.value,h.value)}return{status:r.value,value:l}})}else{const l=new Map;for(const u of o){const d=u.key,h=u.value;if(d.status==="aborted"||h.status==="aborted")return dt;(d.status==="dirty"||h.status==="dirty")&&r.dirty(),l.set(d.value,h.value)}return{status:r.value,value:l}}}}NL.create=(t,e,r)=>new NL({valueType:e,keyType:t,typeName:ft.ZodMap,...yt(r)});class Rh extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==We.set)return Fe(n,{code:Oe.invalid_type,expected:We.set,received:n.parsedType}),dt;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(Fe(n,{code:Oe.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(Fe(n,{code:Oe.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const i=this._def.valueType;function o(u){const d=new Set;for(const h of u){if(h.status==="aborted")return dt;h.status==="dirty"&&r.dirty(),d.add(h.value)}return{status:r.value,value:d}}const l=[...n.data.values()].map((u,d)=>i._parse(new xo(n,u,n.path,d)));return n.common.async?Promise.all(l).then(u=>o(u)):o(l)}min(e,r){return new Rh({...this._def,minSize:{value:e,message:Ye.toString(r)}})}max(e,r){return new Rh({...this._def,maxSize:{value:e,message:Ye.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}Rh.create=(t,e)=>new Rh({valueType:t,minSize:null,maxSize:null,typeName:ft.ZodSet,...yt(e)});class A2 extends Et{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}A2.create=(t,e)=>new A2({getter:t,typeName:ft.ZodLazy,...yt(e)});class zv extends Et{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Fe(r,{received:r.data,code:Oe.invalid_literal,expected:this._def.value}),dt}return{status:"valid",value:e.data}}get value(){return this._def.value}}zv.create=(t,e)=>new zv({value:t,typeName:ft.ZodLiteral,...yt(e)});function $U(t,e){return new Rl({values:t,typeName:ft.ZodEnum,...yt(e)})}class Rl extends Et{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Fe(r,{expected:Pt.joinValues(n),received:r.parsedType,code:Oe.invalid_type}),dt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return Fe(r,{received:r.data,code:Oe.invalid_enum_value,options:n}),dt}return ka(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Rl.create(e,{...this._def,...r})}exclude(e,r=this._def){return Rl.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Rl.create=$U;class P2 extends Et{_parse(e){const r=Pt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==We.string&&n.parsedType!==We.number){const a=Pt.objectValues(r);return Fe(n,{expected:Pt.joinValues(a),received:n.parsedType,code:Oe.invalid_type}),dt}if(this._cache||(this._cache=new Set(Pt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=Pt.objectValues(r);return Fe(n,{received:n.data,code:Oe.invalid_enum_value,options:a}),dt}return ka(e.data)}get enum(){return this._def.values}}P2.create=(t,e)=>new P2({values:t,typeName:ft.ZodNativeEnum,...yt(e)});class Uv extends Et{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==We.promise&&r.common.async===!1)return Fe(r,{code:Oe.invalid_type,expected:We.promise,received:r.parsedType}),dt;const n=r.parsedType===We.promise?r.data:Promise.resolve(r.data);return ka(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Uv.create=(t,e)=>new Uv({type:t,typeName:ft.ZodPromise,...yt(e)});class Il extends Et{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ft.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:o=>{Fe(n,o),o.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){const o=a.transform(n.data,i);if(n.common.async)return Promise.resolve(o).then(async l=>{if(r.value==="aborted")return dt;const u=await this._def.schema._parseAsync({data:l,path:n.path,parent:n});return u.status==="aborted"?dt:u.status==="dirty"||r.value==="dirty"?bf(u.value):u});{if(r.value==="aborted")return dt;const l=this._def.schema._parseSync({data:o,path:n.path,parent:n});return l.status==="aborted"?dt:l.status==="dirty"||r.value==="dirty"?bf(l.value):l}}if(a.type==="refinement"){const o=l=>{const u=a.refinement(l,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l};if(n.common.async===!1){const l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?dt:(l.status==="dirty"&&r.dirty(),o(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?dt:(l.status==="dirty"&&r.dirty(),o(l.value).then(()=>({status:r.value,value:l.value}))))}if(a.type==="transform")if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Lu(o))return dt;const l=a.transform(o.value,i);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>Lu(o)?Promise.resolve(a.transform(o.value,i)).then(l=>({status:r.value,value:l})):dt);Pt.assertNever(a)}}Il.create=(t,e,r)=>new Il({schema:t,typeName:ft.ZodEffects,effect:e,...yt(r)});Il.createWithPreprocess=(t,e,r)=>new Il({schema:e,effect:{type:"preprocess",transform:t},typeName:ft.ZodEffects,...yt(r)});class li extends Et{_parse(e){return this._getType(e)===We.undefined?ka(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}li.create=(t,e)=>new li({innerType:t,typeName:ft.ZodOptional,...yt(e)});class Dl extends Et{_parse(e){return this._getType(e)===We.null?ka(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Dl.create=(t,e)=>new Dl({innerType:t,typeName:ft.ZodNullable,...yt(e)});class qv extends Et{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===We.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}qv.create=(t,e)=>new qv({innerType:t,typeName:ft.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...yt(e)});class Wv extends Et{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Lv(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new xi(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new xi(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Wv.create=(t,e)=>
1160new Wv({innerType:t,typeName:ft.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...yt(e)});class SL extends Et{_parse(e){if(this._getType(e)!==We.nan){const n=this._getOrReturnCtx(e);return Fe(n,{code:Oe.invalid_type,expected:We.nan,received:n.parsedType}),dt}return{status:"valid",value:e.data}}}SL.create=t=>new SL({typeName:ft.ZodNaN,...yt(t)});class LU extends Et{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class IE extends Et{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?dt:i.status==="dirty"?(r.dirty(),bf(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?dt:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new IE({in:e,out:r,typeName:ft.ZodPipeline})}}class Hv extends Et{_parse(e){const r=this._def.innerType._parse(e),n=a=>(Lu(a)&&(a.value=Object.freeze(a.value)),a);return Lv(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}Hv.create=(t,e)=>new Hv({innerType:t,typeName:ft.ZodReadonly,...yt(e)});var ft;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ft||(ft={}));const Br=ai.create;Tl.create;Ol.create;Fv.create;const FU=Fu.create;yo.create;As.create;const BU=_r.create;Bv.create;const HNe=RE.create;Vv.create;Ml.create;const T2=zv.create,VU=Rl.create;Uv.create;li.create;Dl.create;const zU={string:(t=>ai.create({...t,coerce:!0})),number:(t=>Tl.create({...t,coerce:!0})),boolean:(t=>Fv.create({...t,coerce:!0})),bigint:(t=>Ol.create({...t,coerce:!0})),date:(t=>Fu.create({...t,coerce:!0}))};function Tt(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function ra(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function nn(t,e){const r=Tt(t);return isNaN(e)?ra(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function is(t,e){const r=Tt(t);if(isNaN(e))return ra(t,NaN);if(!e)return r;const n=r.getDate(),a=ra(t,r.getTime());a.setMonth(r.getMonth()+e+1,0);const i=a.getDate();return n>=i?a:(r.setFullYear(a.getFullYear(),a.getMonth(),n),r)}const DE=6048e5,GNe=864e5;let KNe={};function im(){return KNe}function Ms(t,e){var l,u,d,h;const r=im(),n=(e==null?void 0:e.weekStartsOn)??((u=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??r.weekStartsOn??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Tt(t),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function $l(t){return Ms(t,{weekStartsOn:1})}function UU(t){const e=Tt(t),r=e.getFullYear(),n=ra(t,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const a=$l(n),i=ra(t,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=$l(i);return e.getTime()>=a.getTime()?r+1:e.getTime()>=o.getTime()?r:r-1}function Bu(t){const e=Tt(t);return e.setHours(0,0,0,0),e}function Gv(t){const e=Tt(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function js(t,e){const r=Bu(t),n=Bu(e),a=+r-Gv(r),i=+n-Gv(n);return Math.round((a-i)/GNe)}function YNe(t){const e=UU(t),r=ra(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),$l(r)}function O2(t,e){const r=e*7;return nn(t,r)}function XNe(t,e){return is(t,e*12)}function ZNe(t){let e;return t.forEach(function(r){const n=Tt(r);(e===void 0||e<n||isNaN(Number(n)))&&(e=n)}),e||new Date(NaN)}function QNe(t){let e;return t.forEach(r=>{const n=Tt(r);(!e||e>n||isNaN(+n))&&(e=n)}),e||new Date(NaN)}function Pn(t,e){const r=Bu(t),n=Bu(e);return+r==+n}function $E(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function JNe(t){if(!$E(t)&&typeof t!="number")return!1;const e=Tt(t);return!isNaN(Number(e))}function Ih(t,e){const r=Tt(t),n=Tt(e),a=r.getFullYear()-n.getFullYear(),i=r.getMonth()-n.getMonth();return a*12+i}function eSe(t,e,r){const n=Ms(t,r),a=Ms(e,r),i=+n-Gv(n),o=+a-Gv(a);return Math.round((i-o)/DE)}function LE(t){const e=Tt(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function On(t){const e=Tt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function qU(t){const e=Tt(t),r=ra(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}function FE(t,e){var l,u,d,h;const r=im(),n=(e==null?void 0:e.weekStartsOn)??((u=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:u.weekStartsOn)??r.weekStartsOn??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.weekStartsOn)??0,a=Tt(t),i=a.getDay(),o=(i<n?-7:0)+6-(i-n);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}function WU(t){return FE(t,{weekStartsOn:1}
vendor: 13,773 bytes, line 1160
1160)}const tSe={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},rSe=(t,e,r)=>{let n;const a=tSe[t];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function ru(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const nSe={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},aSe={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},sSe={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},iSe={date:ru({formats:nSe,defaultWidth:"full"}),time:ru({formats:aSe,defaultWidth:"full"}),dateTime:ru({formats:sSe,defaultWidth:"full"})},oSe={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},lSe=(t,e,r,n)=>oSe[t];function xs(t){return(e,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let a;if(n==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,l=r!=null&&r.width?String(r.width):o;a=t.formattingValues[l]||t.formattingValues[o]}else{const o=t.defaultWidth,l=r!=null&&r.width?String(r.width):t.defaultWidth;a=t.values[l]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const cSe={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},uSe={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},dSe={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},fSe={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},hSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},mSe={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},pSe=(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},gSe={ordinalNumber:pSe,era:xs({values:cSe,defaultWidth:"wide"}),quarter:xs({values:uSe,defaultWidth:"wide",argumentCallback:t=>t-1}),month:xs({values:dSe,defaultWidth:"wide"}),day:xs({values:fSe,defaultWidth:"wide"}),dayPeriod:xs({values:hSe,defaultWidth:"wide",formattingValues:mSe,defaultFormattingWidth:"wide"})};function ys(t){return(e,r={})=>{const n=r.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],u=Array.isArray(l)?xSe(l,m=>m.test(o)):vSe(l,m=>m.test(o));let d;d=t.valueCallback?t.valueCallback(u):u,d=r.valueCallback?r.valueCallback(d):d;const h=e.slice(o.length);return{value:d,rest:h}}}function vSe(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function xSe(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return r}function HU(t){return(e,r={})=>{const n=e.match(t.matchPattern);if(!n)return null;const a=n[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=e.slice(a.length);return{value:o,rest:l}}}const ySe=/^(\d+)(th|st|nd|rd)?/i,bSe=/\d+/i,wSe={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},_Se={any:[/^b/i,/^(a|c)/i]},jSe={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},NSe={any:[/1/i,/2/i,/3/i,/4/i]},SSe={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},CSe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},kSe={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ESe={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},ASe={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},PSe={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},TSe={ordinalNumber:HU({matchPattern:ySe,parsePattern:bSe,valueCallback:t=>parseInt(t,10)}),era:ys({matchPatterns:wSe,defaultMatchWidth:"wide",parsePatterns:_Se,defaultParseWidth:"any"}),quarter:ys({matchPatterns:jSe,defaultMatchWidth:"wide",parsePatterns:NSe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ys({matchPatterns:SSe,defaultMatchWidth:"wide",parsePatterns:CSe,defaultParseWidth:"any"}),day:ys({matchPatterns:kSe,defaultMatchWidth:"wide",parsePatterns:ESe,defaultParseWidth:"any"}),dayPeriod:ys({matchPatterns:ASe,defaultMatchWidth:"any",parsePatterns:PSe,defaultParseWidth:"any"})},GU={code:"en-US",formatDistance:rSe,formatLong:iSe,formatRelative:lSe,localize:gSe,match:TSe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function OSe(t){const e=Tt(t);return js(e,qU(e))+1}function KU(t){const e=Tt(t),r=+$l(e)-+YNe(e);return Math.round(r/DE)+1}function YU(t,e){var h,m,p,v;const r=Tt(t),n=r.getFullYear(),a=im(),i=(e==null?void 0:e.firstWeekContainsDate)??((m=(h=e==null?void 0:e.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??a.firstWeekContainsDate??((v=(p=a.locale)==null?void 0:p.options)==null?void 0:v.firstWeekContainsDate)??1,o=ra(t,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Ms(o,e),u=ra(t,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);const d=Ms(u,e);return r.getTime()>=l.getTime()?n+1:r.getTime()>=d.getTime()?n:n-1}function MSe(t,e){var l,u,d,h;const r=im(),n=(e==null?void 0:e.firstWeekContainsDate)??((u=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((h=(d=r.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,a=YU(t,e),i=ra(t,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),Ms(i,e)}function XU(t,e){const r=Tt(t),n=+Ms(r,e)-+MSe(r,e);return Math.round(n/DE)+1}function zt(t,e){const r=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return r+n}const Ki={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return zt(e==="yy"?n%100:n,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):zt(r+1,2)},d(t,e){return zt(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return zt(t.getHours()%12||12,e.length)},H(t,e){return zt(t.getHours(),e.length)},m(t,e){return zt(t.getMinutes(),e.length)},s(t,e){return zt(t.getSeconds(),e.length)},S(t,e){const r=e.length,n=t.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return zt(a,e.length)}},Ac={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},CL={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const n=t.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return Ki.y(t,e)},Y:function(t,e,r,n){const a=YU(t,n),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return zt(o,2)}return e==="Yo"?r.ordinalNumber(i,{unit:"year"}):zt(i,e.length)},R:function(t,e){const r=UU(t);return zt(r,e.length)},u:function(t,e){const r=t.getFullYear();return zt(r,e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return zt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return zt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return Ki.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return zt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const a=XU(t,n);return e==="wo"?r.ordinalNumber(a,{unit:"week"}):zt(a,e.length)},I:function(t,e,r){const n=KU(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):zt(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):Ki.d(t,e)},D:function(t,e,r){const n=OSe(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):zt(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return zt(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return zt(i,e.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return zt(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let a;switch(n===12?a=Ac.noon:n===0?a=Ac.midnight:a=n/12>
vendor: 4,717 bytes, line 1160
1160=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let a;switch(n>=17?a=Ac.evening:n>=12?a=Ac.afternoon:n>=4?a=Ac.morning:a=Ac.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Ki.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):Ki.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):zt(n,e.length)},k:function(t,e,r){let n=t.getHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):zt(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ki.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):Ki.s(t,e)},S:function(t,e){return Ki.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return EL(n);case"XXXX":case"XX":return al(n);case"XXXXX":case"XXX":default:return al(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return EL(n);case"xxxx":case"xx":return al(n);case"xxxxx":case"xxx":default:return al(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+kL(n,":");case"OOOO":default:return"GMT"+al(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+kL(n,":");case"zzzz":default:return"GMT"+al(n,":")}},t:function(t,e,r){const n=Math.trunc(t.getTime()/1e3);return zt(n,e.length)},T:function(t,e,r){const n=t.getTime();return zt(n,e.length)}};function kL(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+e+zt(i,2)}function EL(t,e){return t%60===0?(t>0?"-":"+")+zt(Math.abs(t)/60,2):al(t,e)}function al(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=zt(Math.trunc(n/60),2),i=zt(n%60,2);return r+a+e+i}const AL=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},ZU=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},RSe=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return AL(t,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",AL(n,e)).replace("{{time}}",ZU(a,e))},ISe={p:ZU,P:RSe},DSe=/^D+$/,$Se=/^Y+$/,LSe=["D","DD","YY","YYYY"];function FSe(t){return DSe.test(t)}function BSe(t){return $Se.test(t)}function VSe(t,e,r){const n=zSe(t,e,r);if(console.warn(n),LSe.includes(t))throw new RangeError(n)}function zSe(t,e,r){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const USe=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,qSe=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,WSe=/^'([^]*?)'?$/,HSe=/''/g,GSe=/[a-zA-Z]/;function vn(t,e,r){var h,m,p,v,b,y,x,j;const n=im(),a=(r==null?void 0:r.locale)??n.locale??GU,i=(r==null?void 0:r.firstWeekContainsDate)??((m=(h=r==null?void 0:r.locale)==null?void 0:h.options)==null?void 0:m.firstWeekContainsDate)??n.firstWeekContainsDate??((v=(p=n.locale)==null?void 0:p.options)==null?void 0:v.firstWeekContainsDate)??1,o=(r==null?void 0:r.weekStartsOn)??((y=(b=r==null?void 0:r.locale)==null?void 0:b.options)==null?void 0:y.weekStartsOn)??n.weekStartsOn??((j=(x=n.locale)==null?void 0:x.options)==null?void 0:j.weekStartsOn)??0,l=Tt(t);if(!JNe(l))throw new RangeError("Invalid time value");let u=e.match(qSe).map(N=>{const S=N[0];if(S==="p"||S==="P"){const k=ISe[S];return k(N,a.formatLong)}return N}).join("").match(USe).map(N=>{if(N==="''")return{isToken:!1,value:"'"};const S=N[0];if(S==="'")return{isToken:!1,value:KSe(N)};if(CL[S])return{isToken:!0,value:N};
1160if(S.match(GSe))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");return{isToken:!1,value:N}});a.localize.preprocessor&&(u=a.localize.preprocessor(l,u));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return u.map(N=>{if(!N.isToken)return N.value;const S=N.value;(!(r!=null&&r.useAdditionalWeekYearTokens)&&BSe(S)||!(r!=null&&r.useAdditionalDayOfYearTokens)&&FSe(S))&&VSe(S,e,String(t));const k=CL[S[0]];return k(l,S,a.localize,d)}).join("")}function KSe(t){const e=t.match(WSe);return e?e[1].replace(HSe,"'"):t}function YSe(t){const e=Tt(t),r=e.getFullYear(),n=e.getMonth(),a=ra(t,0);return a.setFullYear(r,n+1,0),a.setHours(0,0,0,0),a.getDate()}function XSe(t){return Math.trunc(+Tt(t)/1e3)}function ZSe(t){const e=Tt(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(0,0,0,0),e}function QSe(t,e){return eSe(ZSe(t),On(t),e)+1}function M2(t,e){const r=Tt(t),n=Tt(e);return r.getTime()>n.getTime()}function QU(t,e){const r=Tt(t),n=Tt(e);return+r<+n}function BE(t,e){const r=Tt(t),n=Tt(e);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}function JSe(t,e){const r=Tt(t),n=Tt(e);return r.getFullYear()===n.getFullYear()}function xl(t,e){return nn(t,-e)}function Yj(t,e){const r=Tt(t),n=r.getFullYear(),a=r.getDate(),i=ra(t,0);i.setFullYear(n,e,15),i.setHours(0,0,0,0);const o=YSe(i);return r.setMonth(e,Math.min(a,o)),r}function PL(t,e){const r=Tt(t);return isNaN(+r)?ra(t,NaN):(r.setFullYear(e),r)}const Ll=bE,e2e=wE,JU=w.forwardRef(({className:t,...e},r)=>s.jsx(tm,{ref:r,className:Qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e}));JU.displayName=tm.displayName;const bo=w.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(e2e,{children:[s.jsx(JU,{}),s.jsxs(rm,{ref:n,className:Qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg border-border",t),...r,children:[e,s.jsxs(ax,{className:"absolute right-4 top-4 roun
1160ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[s.jsx(Xn,{className:"h-4 w-4"}),s.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));bo.displayName=rm.displayName;const wo=({className:t,...e})=>s.jsx("div",{className:Qe("flex flex-col space-y-1.5 text-center sm:text-left",t),...e});wo.displayName="DialogHeader";const Vu=({className:t,...e})=>s.jsx("div",{className:Qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});Vu.displayName="DialogFooter";const _o=w.forwardRef(({className:t,...e},r)=>s.jsx(nm,{ref:r,className:Qe("text-lg font-semibold leading-none tracking-tight",t),...e}));_o.displayName=nm.displayName;const zu=w.forwardRef(({className:t,...e},r)=>s.jsx(am,{ref:r,className:Qe("text-sm text-muted-foreground",t),...e}));zu.displayName=am.displayName;const t2e=Zje,eq=w.createContext({}),Ba=({...t})=>s.jsx(eq.Provider,{value:{name:t.name},children:s.jsx(tNe,{...t})}),hx=()=>{const t=w.useContext(eq),e=w.useContext(tq),{getFieldState:r,formState:n}=fx(),a=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:i}=e;return{id:i,name:t.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...a}},tq=w.createContext({}),fa=w.forwardRef(({className:t,...e},r)=>{const n=w.useId();return s.jsx(tq.Provider,{value:{id:n},children:s.jsx("div",{ref:r,className:Qe("space-y-2",t),...e})})});fa.displayName="FormItem";const ha=w.forwardRef(({className:t,...e},r)=>{const{error:n,formItemId:a}=hx();return s.jsx(pt,{ref:r,className:Qe(n&&"text-destructive",t),htmlFor:a,...e})});ha.displayName="FormLabel";const ma=w.forwardRef(({...t},e)=>{const{error:r,formItemId:n,formDescriptionId:a,formMessageId:i}=hx();return s.jsx(w7,{ref:e,id:n,"aria-describedby":r?`${a} ${i}`:`${a}`,"aria-invalid":!!r,...t})});ma.displayName="FormControl";const wf=w.forwardRef(({className:t,...e},r)=>{const{formDescriptionId:n}=hx();return s.jsx("p",{ref:r,id:n,className:Qe("text-sm text-muted-foreground",t),...e})});wf.displayName="FormDescription";const pa=w.forwardRef(({className:t,children:e,...r},n)=>{const{error:a,formMessageId:i}=hx(),o=a?String(a==null?void 0:a.message):e;return o?s.jsx("p",{ref:n,id:i,className:Qe("text-sm font-medium text-destructive",t),...r,children:o}):null});pa.displayName="FormMessage";function Kv(t,[e,r]){return Math.min(r,Math.max(e,t))}function r2e(t){const e=n2e(t),r=w.forwardRef((n,a)=>{const{children:i,...o}=n,l=w.Children.toArray(i),u=l.find(s2e);if(u){const d=u.props.children,h=l.map(m=>m===u?w.Children.count(d)>1?w.Children.only(null):w.isValidElement(d)?d.props.children:null:m);return s.jsx(e,{...o,ref:a,children:w.isValidElement(d)?w.cloneElement(d,void 0,h):null})}return s.jsx(e,{...o,ref:a,children:i})});return r.displayName=`${t}.Slot`,r}function n2e(t){const e=w.forwardRef((r,n)=>{const{children:a,...i}=r;if(w.isValidElement(a)){const o=o2e(a),l=i2e(i,a.props);return a.type!==w.Fragment&&(l.ref=n?Gl(n,o):o),w.cloneElement(a,l)}return w.Children.count(a)>1?w.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var a2e=Symbol("radix.slottable");function s2e(t){return w.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===a2e}function i2e(t,e){const r={...e};for(const n in e){const a=t[n],i=e[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...l)=>{const u=i(...l);return a(...l),u}:a&&(r[n]=a):n==="style"?r[n]={...a,...i}:n==="className"&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...t,...r}}function o2e(t){var n,a;let e=(n=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:n.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=(a=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:a.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var l2e=[" ","Enter","ArrowUp","ArrowDown"],c2e=[" ","Enter"],Fl="Select",[mx,px,u2e]=mE(Fl),[fd]=Ca(Fl,[u2e,dd]),gx=dd(),[d2e,Ro]=fd(Fl),[f2e,h2e]=fd(Fl),rq=t=>{const{__scopeSelect:e,children:r,open:n,defaultOpen:a,onOpenChange:i,value:o,defaultValue:l,onValueChange:u,dir:d,name:h,autoComplete:m,disabled:p,required:v,form:b}=t,y=gx(e),[x,j]=w.useState(null),[N,S]=w.useState(null),[k,C]=w.useState(!1),A=tx(d),[T,R]=Os({prop:n,defaultProp:a??!1,onChange:i,caller:Fl}),[I,D]=Os({prop:o,defaultProp:l,onChange:u,caller:Fl}),L=w.useRef(null),z=x?b||!!x.closest("form"):!0,[H,Z]=w.useState(new Set),te=Array.from(H).map(G=>G.props.value).join(";");return s.jsx(oE,{...y,children:s.jsxs(d2e,{required:v,scope:e,trigger:x,onTriggerChange:j,valueNode:N,onValueNodeChange:S,valueNodeHasChildren:k,onValueNodeHasChildrenChange:C,contentId:ns(),value:I,onValueChange:D,open:T,onOpenChange:R,dir:A,triggerPointerDownPosRef:L,disabled:p,children:[s.jsx(mx.Provider,{scope:e,children:s.jsx(f2e,{scope:t.__scopeSelect,onNativeOptionAdd:w.useCallback(G=>{Z(M=>new Set(M).add(G))},[]),onNativeOptionRemove:w.useCallback(G=>{Z(M=>{const F=new Set(M);return F.delete(G),F})},[]),children:r})}),z?s.jsxs(Cq,{"aria-hidden":!0,required:v,tabIndex:-1,name:h,autoComplete:m,value:I,onChange:G=>D(G.target.value),disabled:p,form:b,children:[I===void 0?s.jsx("option",{value:""}):null,Array.from(H)]},te):null]})})};rq.displayName=Fl;var nq="SelectTrigger",aq=w.forwardRef((t,e)=>{const{__scopeSelect:r,disabled:n=!1,...a}=t,i=gx(r),o=Ro(nq,r),l=o.disabled||n,u=Nt(e,o.onTriggerChange),d=px(r),h=w.useRef("touch"),[m,p,v]=Eq(y=>{const x=d().filter(S=>!S.disabled),j=x.find(S=>S.value===o.value),N=Aq(x,y,j);N!==void 0&&o.onValueChange(N.value)}),b=y=>{l||(o.onOpenChange(!0),v()),y&&(o.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return s.jsx(Y0,{asChild:!0,...i,children:s.jsx(ht.button,{type:"button",role:"combobox","aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":"none",dir:o.dir,"data-state":o.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":kq(o.value)?"":void 0,...a,ref:u,onClick:et(a.onClick,y=>
vendor: 17,429 bytes, line 1160
1160{y.currentTarget.focus(),h.current!=="mouse"&&b(y)}),onPointerDown:et(a.onPointerDown,y=>{h.current=y.pointerType;const x=y.target;x.hasPointerCapture(y.pointerId)&&x.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(b(y),y.preventDefault())}),onKeyDown:et(a.onKeyDown,y=>{const x=m.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&p(y.key),!(x&&y.key===" ")&&l2e.includes(y.key)&&(b(),y.preventDefault())})})})});aq.displayName=nq;var sq="SelectValue",iq=w.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:a,children:i,placeholder:o="",...l}=t,u=Ro(sq,r),{onValueNodeHasChildrenChange:d}=u,h=i!==void 0,m=Nt(e,u.onValueNodeChange);return Xr(()=>{d(h)},[d,h]),s.jsx(ht.span,{...l,ref:m,style:{pointerEvents:"none"},children:kq(u.value)?s.jsx(s.Fragment,{children:o}):i})});iq.displayName=sq;var m2e="SelectIcon",oq=w.forwardRef((t,e)=>{const{__scopeSelect:r,children:n,...a}=t;return s.jsx(ht.span,{"aria-hidden":!0,...a,ref:e,children:n||"â¼"})});oq.displayName=m2e;var p2e="SelectPortal",lq=t=>s.jsx(X0,{asChild:!0,...t});lq.displayName=p2e;var Bl="SelectContent",cq=w.forwardRef((t,e)=>{const r=Ro(Bl,t.__scopeSelect),[n,a]=w.useState();if(Xr(()=>{a(new DocumentFragment)},[]),!r.open){const i=n;return i?$h.createPortal(s.jsx(uq,{scope:t.__scopeSelect,children:s.jsx(mx.Slot,{scope:t.__scopeSelect,children:s.jsx("div",{children:t.children})})}),i):null}return s.jsx(dq,{...t,ref:e})});cq.displayName=Bl;var Ua=10,[uq,Io]=fd(Bl),g2e="SelectContentImpl",v2e=r2e("SelectContent.RemoveScroll"),dq=w.forwardRef((t,e)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:o,side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:m,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:y,avoidCollisions:x,...j}=t,N=Ro(Bl,r),[S,k]=w.useState(null),[C,A]=w.useState(null),T=Nt(e,Q=>k(Q)),[R,I]=w.useState(null),[D,L]=w.useState(null),z=px(r),[H,Z]=w.useState(!1),te=w.useRef(!1);w.useEffect(()=>{if(S)return uE(S)},[S]),Zk();const G=w.useCallback(Q=>{const[pe,...V]=z().map(re=>re.ref.current),[J]=V.slice(-1),oe=document.activeElement;for(const re of Q)if(re===oe||(re==null||re.scrollIntoView({block:"nearest"}),re===pe&&C&&(C.scrollTop=0),re===J&&C&&(C.scrollTop=C.scrollHeight),re==null||re.focus(),document.activeElement!==oe))return},[z,C]),M=w.useCallback(()=>G([R,S]),[G,R,S]);w.useEffect(()=>{H&&M()},[H,M]);const{onOpenChange:F,triggerPointerDownPosRef:K}=N;w.useEffect(()=>{if(S){let Q={x:0,y:0};const pe=J=>{var oe,re;Q={x:Math.abs(Math.round(J.pageX)-(((oe=K.current)==null?void 0:oe.x)??0)),y:Math.abs(Math.round(J.pageY)-(((re=K.current)==null?void 0:re.y)??0))}},V=J=>{Q.x<=10&&Q.y<=10?J.preventDefault():S.contains(J.target)||F(!1),document.removeEventListener("pointermove",pe),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",pe),document.addEventListener("pointerup",V,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",pe),document.removeEventListener("pointerup",V,{capture:!0})}}},[S,F,K]),w.useEffect(()=>{const Q=()=>F(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[F]);const[B,O]=Eq(Q=>{const pe=z().filter(oe=>!oe.disabled),V=pe.find(oe=>oe.ref.current===document.activeElement),J=Aq(pe,Q,V);J&&setTimeout(()=>J.ref.current.focus())}),W=w.useCallback((Q,pe,V)=>{const J=!te.current&&!V;(N.value!==void 0&&N.value===pe||J)&&(I(Q),J&&(te.current=!0))},[N.value]),q=w.useCallback(()=>S==null?void 0:S.focus(),[S]),se=w.useCallback((Q,pe,V)=>{const J=!te.current&&!V;(N.value!==void 0&&N.value===pe||J)&&L(Q)},[N.value]),me=n==="popper"?R2:fq,fe=me===R2?{side:l,sideOffset:u,align:d,alignOffset:h,arrowPadding:m,collisionBoundary:p,collisionPadding:v,sticky:b,hideWhenDetached:y,avoidCollisions:x}:{};return s.jsx(uq,{scope:r,content:S,viewport:C,onViewportChange:A,itemRefCallback:W,selectedItem:R,onItemLeave:q,itemTextRefCallback:se,focusSelectedItem:M,selectedItemText:D,position:n,isPositioned:H,searchRef:B,children:s.jsx(Q0,{as:v2e,allowPinchZoom:!0,children:s.jsx(q0,{asChild:!0,trapped:N.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:et(a,Q=>{var pe;(pe=N.trigger)==null||pe.focus({preventScroll:!0}),Q.preventDefault()}),children:s.jsx(Zh,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:s.jsx(me,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:Q=>Q.preventDefault(),...j,...fe,onPlaced:()=>Z(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:et(j.onKeyDown,Q=>{const pe=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!pe&&Q.key.length===1&&O(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let J=z().filter(oe=>!oe.disabled).map(oe=>oe.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(J=J.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const oe=Q.target,re=J.indexOf(oe);J=J.slice(re+1)}setTimeout(()=>G(J)),Q.preventDefault()}})})})})})})});dq.displayName=g2e;var x2e="SelectItemAlignedPosition",fq=w.forwardRef((t,e)=>{const{__scopeSelect:r,onPlaced:n,...a}=t,i=Ro(Bl,r),o=Io(Bl,r),[l,u]=w.useState(null),[d,h]=w.useState(null),m=Nt(e,T=>h(T)),p=px(r),v=w.useRef(!1),b=w.useRef(!0),{viewport:y,selectedItem:x,selectedItemText:j,focusSelectedItem:N}=o,S=w.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&d&&y&&x&&j){const T=i.trigger.getBoundingClientRect(),R=d.getBoundingClientRect(),I=i.valueNode.getBoundingClientRect(),D=j.getBoundingClientRect();if(i.dir!=="rtl"){const oe=D.left-R.left,re=I.left-oe,Me=T.left-re,ee=T.width+Me,ce=Math.max(ee,R.width),je=window.innerWidth-Ua,de=Kv(re,[Ua,Math.max(Ua,je-ce)]);l.style.minWidth=ee+"px",l.style.left=de+"px"}else{const oe=R.right-D.right,re=window.innerWidth-I.right-oe,Me=window.innerWidth-T.right-re,ee=T.width+Me,ce=Math.max(ee,R.width),je=window.innerWidth-Ua,de=Kv(re,[Ua,Math.max(Ua,je-ce)]);l.style.minWidth=ee+"px",l.style.right=de+"px"}const L=p(),z=window.innerHeight-Ua*2,H=y.scrollHeight,Z=window.getComputedStyle(d),te=parseInt(Z.borderTopWidth,10),G=parseInt(Z.paddingTop,10),M=parseInt(Z.borderBottomWidth,10),F=parseInt(Z.paddingBottom,10),K=te+G+H+F+M,B=Math.min(x.offsetHeight*5,K),O=window.getComputedStyle(y),W=parseInt(O.paddingTop,10),q=parseInt(O.paddingBottom,10),se=T.top+T.height/2-Ua,me=z-se,fe=x.offsetHeight/2,Q=x.offsetTop+fe,pe=te+G+Q,V=K-pe;if(pe<=se){const oe=L.length>0&&x===L[L.length-1].ref.current;l.style.bottom="0px";const re=d.clientHeight-y.offsetTop-y.offsetHeight,Me=Math.max(me,fe+(oe?q:0)+re+M),ee=pe+Me;l.style.height=ee+"px"}else{const oe=L.length>0&&x===L[0].ref.current;l.style.top="0px";const Me=Math.max(se,te+y.offsetTop+(oe?W:0)+fe)+V;l.style.height=Me+"px",y.scrollTop=pe-se+y.offsetTop}l.style.margin=`${Ua}px 0`,l.style.minHeight=B+"px",l.style.maxHeight=z+"px",n==null||n(),requestAnimationFrame(()=>v.current=!0)}},[p,i.trigger,i.valueNode,l,d,y,x,j,i.dir,n]);Xr(()=>S(),[S]);const[k,C]=w.useState();Xr(()=>{d&&C(window.getComputedStyle(d).zIndex)},[d]);const A=w.useCallback(T=>{T&&b.current===!0&&(S(),N==null||N(),b.current=!1)},[S,N]);return s.jsx(b2e,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:v,onScrollButtonChange:A,children:s.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:s.jsx(ht.div,{...a,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});fq.displayName=x2e;var y2e="SelectPopperPosition",R2=w.forwardRef((t,e)=>{const{__scopeSelect:r,align:n="start",collisionPadding:a=Ua,...i}=t,o=gx(r);return s.jsx(lE,{...o,...i,ref:e,align:n,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});R2.displayName=y2e;var[b2e,VE]=fd(Bl,{}),I2="SelectViewport",hq=w.forwardRef((t,e)=>{const{__scopeSelect:r,nonce:n,...a}=t,i=Io(I2,r),o=VE(I2,r),l=Nt(e,i.onViewportChange),u=w.useRef(0);return s.jsxs(s.Fragment,{children:[s.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),s.jsx(mx.Slot,{scope:r,children:s.jsx(ht.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:et(a.onScroll,d=>{const h=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:p}=o;if(p!=null&&p.current&&m){const v=Math.abs(u.current-h.scrollTop);if(v>0){const b=window.innerHeight-Ua*2,y=parseFloat(m.style.minHeight),x=parseFloat(m.style.height),j=Math.max(y,x);if(j<b){const N=j+v,S=Math.min(b,N),k=N-S;m.style.height=S+"px",m.style.bottom==="0px"&&(h.scrollTop=k>0?k:0,m.style.justifyContent="flex-end")}}}u.current=h.scrollTop})})})]})});hq.displayName=I2;var mq="SelectGroup",[w2e,_2e]=fd(mq),j2e=w.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,a=ns();return s.jsx(w2e,{scope:r,id:a,children:s.jsx(ht.div,{role:"group","aria-labelledby":a,...n,ref:e})})});j2e.displayName=mq;var pq="SelectLabel",gq=w.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,a=_2e(pq,r);return s.jsx(ht.div,{id:a.id,...n,ref:e})});gq.displayName=pq;var Yv="SelectItem",[N2e,vq]=fd(Yv),xq=w.forwardRef((t,e)=>{const{__scopeSelect:r,value:n,disabled:a=!1,textValue:i,...o}=t,l=Ro(Yv,r),u=Io(Yv,r),d=l.value===n,[h,m]=w.useState(i??""),[p,v]=w.useState(!1),b=Nt(e,N=>{var S;return(S=u.itemRefCallback)==null?void 0:S.call(u,N,n,a)}),y=ns(),x=w.useRef("touch"),j=()=>{a||(l.onValueChange(n),l.onOpenChange(!1))};if(n==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return s.jsx(N2e,{scope:r,value:n,disabled:a,textId:y,isSelected:d,onItemTextChange:w.useCallback(N=>{m(S=>S||((N==null?void 0:N.textContent)??"").trim())},[]),children:s.jsx(mx.ItemSlot,{scope:r,value:n,disabled:a,textValue:h,children:s.jsx(ht.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...o,ref:b,onFocus:et(o.onFocus,()=>v(!0)),onBlur:et(o.onBlur,()=>v(!1)),onClick:et(o.onClick,()=>{x.current!=="mouse"&&j()}),onPointerUp:et(o.onPointerUp,()=>{x.current==="mouse"&&j()}),onPointerDown:et(o.onPointerDown,N=>{x.current=N.pointerType}),onPointerMove:et(o.onPointerMove,N=>{var S;x.current=N.pointerType,a?(S=u.onItemLeave)==null||S.call(u):x.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:et(o.onPointerLeave,N=>{var S;N.currentTarget===document.activeElement&&((S=u.onItemLeave)==null||S.call(u))}),onKeyDown:et(o.onKeyDown,N=>{var k;((k=u.searchRef)==null?void 0:k.current)!==""&&N.key===" "||(c2e.includes(N.key)&&j(),N.key===" "&&N.preventDefault())})})})})});xq.displayName=Yv;var _f="SelectItemText",yq=w.forwardRef((t,e)=>{const{__scopeSelect:r,className:n,style:a,...i}=t,o=Ro(_f,r),l=Io(_f,r),u=vq(_f,r),d=h2e(_f,r),[h,m]=w.useState(null),p=Nt(e,j=>m(j),u.onItemTextChange,j=>{var N;return(N=l.itemTextRefCallback)==null?void 0:N.call(l,j,u.value,u.disabled)}),v=h==null?void 0:h.textContent,b=w.useMemo(()=>s.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:y,onNativeOptionRemove:x}=d;return Xr(()=>(y(b),()=>x(b)),[y,x,b]),s.jsxs(s.Fragment,{children:[s.jsx(ht.span,{id:u.textId,...i,ref:p}),u.isSelected&&o.valueNode&&!o.valueNodeHasChildren?$h.createPortal(i.children,o.valueNode):null]})});yq.displayName=_f;var bq="SelectItemIndicator",wq=w.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return vq(bq,r).isSelected?s.jsx(ht.span,{"aria-hidden":!0,...n,ref:e}):null});wq.displayName=bq;var D2="SelectScrollUpButton",_q=w.forwardRef((t,e)=>{const r=Io(D2,t.__scopeSelect),n=VE(D2,t.__scopeSelect),[a,i]=w.useState(!1),o=Nt(e,n.onScrollButtonChange);return Xr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=u.scrollTop>0;i(d)};const u=r.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(Nq,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=r;l&&u&&(l.scrollTop=l.scrollTop-u.offsetHeight)}}):null});_q.displayName=D2;var $2="SelectScrollDownButton",jq=w.forwardRef((t,e)=>{const r=Io($2,t.__scopeSelect),n=VE($2,t.__scopeSelect),[a,i]=w.useState(!1),o=Nt(e,n.onScrollButtonChange);return Xr(()=>{if(r.viewport&&r.isPositioned){let l=function(){const d=u.scrollHeight-u.clientHeight,h=Math.ceil(u.scrollTop)<d;i(h)};const u=r.viewport;return l(),u.addEventListener("scroll",l),()=>u.removeEventListener("scroll",l)}},[r.viewport,r.isPositioned]),a?s.jsx(Nq,{...t,ref:o,onAutoScroll:()=>{const{viewport:l,selectedItem:u}=r;l&&u&&(l.scrollTop=l.scrollTop+u.offsetHeight)}}):null});jq.displayName=$2;var Nq=w.forwardRef((t,e)=>{const{__scopeSelect:r,onAutoScroll:n,...a}=t,i=Io("SelectScrollButton",r),o=w.useRef(null),l=px(r),u=w.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return w.useEffect(()=>()=>u(),[u]),Xr(()=>{var h;const d=l().find(m=>m.ref.current===document.activeElement);(h=d==null?void 0:d.ref.current)==null||h.scrollIntoView({block:"nearest"})},[l]),s.jsx(ht.div,{"aria-hidden":!0,...a,ref:e,style:{flexShrink:0,...a.style},onPointerDown:et(a.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(n,50))}),onPointerMove:et(a.onPointerMove,()=>{var d;(d=i.onItemLeave)==null||d.call(i),o.current===null&&(o.current=window.setInterval(n,50))}),onPointerLeave:et(a.onPointerLeave,()=>{u()})})}),S2e="SelectSeparator",Sq=w.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t;return s.jsx(ht.div,{"aria-hidden":!0,...n,ref:e})});Sq.displayName=S2e;var L2="SelectArrow",C2e=w.forwardRef((t,e)=>{const{__scopeSelect:r,...n}=t,a=gx(r),i=Ro(L2,r),o=Io(L2,r);return i.open&&o.position==="popper"?s.jsx(cE,{...a,...n,ref:e}):null});C2e.displayName=L2;var k2e="SelectBubbleInput",Cq=w.forwardRef(({__scopeSelect:t,value:e,...r},n)=>{const a=w.useRef(null),i=Nt(n,a),o=CE(e);return w.useEffect(()=>{const l=a.current;if(!l)return;const u=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(o!==e&&h){const m=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(m)}},[o,e]),s.jsx(ht.select,{...r,style:{...Jz,...r.style},ref:i,defaultValue:e})});Cq.displayName=k2e;function kq(t){return t===""||t===void 0}function Eq(t){const e=po(t),r=w.useRef(""),n=w.useRef(0),a=w.useCallback(o=>{const l=r.current+o;e(l),(function u(d){r.current=d,window.clearTimeout(n.current),d!==""&&(n.current=window.setTimeout(()=>u(""),1e3))})(l)},[e]),i=w.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,a,i]}function Aq(t,e,r){const a=e.length>1&&Array.from(e).every(d=>d===e[0])?e[0]:e,i=r?t.indexOf(r):-1;let o=E2e(t,Math.max(i,0));a.length===1&&(o=o.filter(d=>d!==r));const u=o.find(d=>d.textValue.toLowerCase().startsWith(a.toLowerCase()));return u!==r?u:void 0}function E2e(t,e){return t.map((r,n)=>t[(e+n)%t.length])}var A2e=rq,Pq=aq,P2e=iq,T2e=oq,O2e=lq,Tq=cq,M2e=hq,Oq=gq,Mq=xq,R2e=yq,I2e=wq,Rq=_q,Iq=jq,Dq=Sq;const Qn=A2e,Jn=P2e,Mn=w.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(Pq,{ref:n,className:Qe("flex h-10 w-full items-center justify-between rounded-md border border-input bg-secondary/50 px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...r,children:[e,s.jsx(T2e,{asChild:!0,children:s.jsx(Ga,{className:"h-4 w-4 opacity-50"})})]}));Mn.displayName=Pq.displayName;const $q=w.forwardRef(({className:t,...e},r)=>s.jsx(Rq,{ref:r,className:Qe("flex cursor-default items-center justify-center py-1 text-foreground",t),...e,children:s.jsx(h8,{className:"h-4 w-4"})}));$q.displayName=Rq.displayName;const Lq=w.forwardRef(({className:t,...e},r)=>s.jsx(Iq,{ref:r,className:Qe("flex cursor-default items-center justify-center py-1 text-foreground",t),...e,children:s.jsx(Ga,{className:"h-4 w-4"})}));Lq.displayName=Iq.displayName;const Rn=w.forwardRef(({className:t,children:e,position:r="popper",...n},a)=>s.jsx(O2e,{children:s.jsxs(Tq,{ref:a,className:Qe("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-input bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1160de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,...n,children:[s.jsx($q,{}),s.jsx(M2e,{className:Qe("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:e}),s.jsx(Lq,{})]})}));Rn.displayName=Tq.displayName;const D2e=w.forwardRef(({className:t,...e},r)=>s.jsx(Oq,{ref:r,className:Qe("py-1.5 pl-8 pr-2 text-sm font-semibold text-foreground",t),...e}));D2e.displayName=Oq.displayName;const on=w.forwardRef(({className:t,children:e,...r},n)=>s.jsxs(Mq,{ref:n,className:Qe("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-foreground outline-none focus:bg-accent/20 focus:text-foreground hover:bg-accent/20 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...r,children:[s.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:s.jsx(I2e,{children:s.jsx(ci,{className:"h-4 w-4 text-primary"})})}),s.jsx(R2e,{children:e})]}));on.displayName=Mq.displayName;const $2e=w.forwardRef(({className:t,...e},r)=>s.jsx(Dq,{ref:r,className:Qe("-mx-1 my-1 h-px bg-border",t),...e}));$2e.displayName=Dq.displayName;const L2e={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 mês",other:"cerca de {{count}} meses"},xMonths:{one:"1 mês",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},F2e=(t,e,r)=>{let n;const a=L2e[t];return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",String(e)),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"em "+n:"há "+n:n},B2e={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},V2e={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},z2e={full:"{{date}} 'à s' {{time}}",long:"{{date}} 'à s' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},U2e={date:ru({formats:B2e,defaultWidth:"full"}),time:ru({formats:V2e,defaultWidth:"full"}),dateTime:ru({formats:z2e,defaultWidth:"full"})},q2e={lastWeek:t=>{const e=t.getDay();return"'"+(e===0||e===6?"último":"última")+"' eeee 'à s' p"},yesterday:"'ontem à s' p",today:"'hoje à s' p",tomorrow:"'amanhã à s' p",nextWeek:"eeee 'à s' p",other:"P"},W2e=(t,e,r,n)=>{const a=q2e[t];return typeof a=="function"?a(e):a},H2e={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},G2e={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1º trimestre","2º trimestre","3º trimestre","4º trimestre"]},K2e={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},Y2e={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","terça","quarta","quinta","sexta","sábado"],wide:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"]},X2e={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manhã",afternoon:"tarde",evening:"tarde",night:"noite"}},Z2e={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manhã",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},Q2e=(t,e)=>{const r=Number(t);return(e==null?void 0:e.unit)==="week"?r+"ª":r+"º"},J2e={ordinalNumber:Q2e,era:xs({values:H2e,defaultWidth:"wide"}),quarter:xs({values:G2e,defaultWidth:"wide",argumentCallback:t=>t-1}),month:xs({values:K2e,defaultWidth:"wide"}),day:xs({values:Y2e,defaultWidth:"wide"}),dayPeriod:xs({values:X2e,defaultWidth:"wide",formattingValues:Z2e,defaultFormattingWidth:"wide"})},eCe=/^(\d+)[ºªo]?/i,tCe=/\d+/i,rCe={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i}
1160,nCe={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},aCe={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},sCe={any:[/1/i,/2/i,/3/i,/4/i]},iCe={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},oCe={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},lCe={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},cCe={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},uCe={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(d
1160a) (manhã|tarde|noite))/i},dCe={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},fCe={ordinalNumber:HU({matchPattern:eCe,parsePattern:tCe,valueCallback:t=>parseInt(t,10)}),era:ys({matchPatterns:rCe,defaultMatchWidth:"wide",parsePatterns:nCe,defaultParseWidth:"any"}),quarter:ys({matchPatterns:aCe,defaultMatchWidth:"wide",parsePatterns:sCe,defaultParseWidth:"any",valueCallback:t=>t+1}),month:ys({matchPatterns:iCe,defaultMatchWidth:"wide",parsePatterns:oCe,defaultParseWidth:"any"}),day:ys({matchPatterns:lCe,defaultMatchWidth:"wide",parsePatterns:cCe,defaultParseWidth:"any"}),dayPeriod:ys({matchPatterns:uCe,defaultMatchWidth:"any",parsePatterns:dCe,defaultParseWidth:"any"})},hCe={code:"pt-BR",formatDistance:F2e,formatLong:U2e,formatRelative:W2e,localize:J2e,match:fCe,options:{weekStartsOn:0,firstWeekContainsDate:1}};var lt=function(){return lt=Object.assign||function(e){for(var r,n=1,a=arguments.length;n<a;n++){r=arguments[n];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},lt.apply(this,arguments)};function mCe(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r}function Fq(t,e,r){for(var n=0,a=e.length,i;n<a;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}function om(t){return t.mode==="multiple"}function lm(t){return t.mode==="range"}function vx(t){return t.mode==="single"}var pCe={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};function gCe(t,e){return vn(t,"LLLL y",e)}function vCe(t,e){return vn(t,"d",e)}function xCe(t,e){return vn(t,"LLLL",e)}function yCe(t){return"".concat(t)}function bCe(t,e){return vn(t,"cccccc",e)}function wCe(t,e){return vn(t,"yyyy",e)}var _Ce=Object.freeze({__proto__:null,formatCaption:gCe,formatDay:vCe,formatMonthCaption:xCe,formatWeekNumber:yCe,formatWeekdayName:bCe,formatYearCaption:wCe}),jCe=function(t,e,r){return vn(t,"do MMMM (EEEE)",r)},NCe=function(){return"Month: "},SCe=function(){return"Go to next month"},CCe=function(){return"Go to previous month"},kCe=function(t,e){return vn(t,"cccc",e)},ECe=function(t){return"Week n. ".concat(t)},ACe=function(){return"Year: "},PCe=Object.freeze({__proto__:null,labelDay:jCe,labelMonthDropdown:NCe,labelNext:SCe,labelPrevious:CCe,labelWeekNumber:ECe,labelWeekday:kCe,labelYearDropdown:ACe});function TCe(){var t="buttons",e=pCe,r=GU,n={},a={},i=1,o={},l=new Date;return{captionLayout:t,classNames:e,formatters:_Ce,labels:PCe,locale:r,modifiersClassNames:n,modifiers:a,numberOfMonths:i,styles:o,today:l,mode:"default"}}function OCe(t){var e=t.fromYear,r=t.toYear,n=t.fromMonth,a=t.toMonth,i=t.fromDate,o=t.toDate;
1160return n?i=On(n):e&&(i=new Date(e,0,1)),a?o=LE(a):r&&(o=new Date(r,11,31)),{fromDate:i?Bu(i):void 0,toDate:o?Bu(o):void 0}}var Bq=w.createContext(void 0);function MCe(t){var e,r=t.initialProps,n=TCe(),a=OCe(r),i=a.fromDate,o=a.toDate,l=(e=r.captionLayout)!==null&&e!==void 0?e:n.captionLayout;l!=="buttons"&&(!i||!o)&&(l="buttons");var u;(vx(r)||om(r)||lm(r))&&(u=r.onSelect);var d=lt(lt(lt({},n),r),{captionLayout:l,classNames:lt(lt({},n.classNames),r.classNames),components:lt({},r.components),formatters:lt(lt({},n.formatters),r.formatters),fromDate:i,labels:lt(lt({},n.labels),r.labels),mode:r.mode||n.mode,modifiers:lt(lt({},n.modifiers),r.modifiers),modifiersClassNames:lt(lt({},n.modifiersClassNames),r.modifiersClassNames),onSelect:u,styles:lt(lt({},n.styles),r.styles),toDate:o});return s.jsx(Bq.Provider,{value:d,children:t.children})}function Xt(){var t=w.useContext(Bq);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function Vq(t){var e=Xt(),r=e.locale,n=e.classNames,a=e.styles,i=e.formatters.formatCaption;return s.jsx("div",{className:n.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:t.id,children:i(t.displayMonth,{locale:r})})}function RCe(t){return s.jsx("svg",lt({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},t,{children:s.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function zq(t){var e,r,n=t.onChange,a=t.value,i=t.children,o=t.caption,l=t.className,u=t.style,d=Xt(),h=(r=(e=d.components)===null||e===void 0?void 0:e.IconDropdown)!==null&&r!==void 0?r:RCe;return s.jsxs("div",{className:l,style:u,children:[s.jsx("span",{className:d.classNames.vhidden,children:t["aria-label"]}),s.jsx("select",{name:t.name,"aria-label":t["aria-label"],className:d.classNames.dropdown,style:d.styles.dropdown,value:a,onChange:n,children:i}),s.jsxs("div",{className:d.classNames.caption_label,style:d.styles.caption_label,"aria-hidden":"true",children:[o,s.jsx(h,{className:d.classNames.dropdown_icon,style:d.styles.dropdown_icon})]})]})}function ICe(t){var e,r=Xt(),n=r.fromDate,a=r.toDate,i=r.styles,o=r.locale,l=r.formatters.formatMonthCaption,u=r.classNames,d=r.components,h=r.labels.labelMonthDropdown;if(!n)return s.jsx(s.Fragment,{});if(!a)return s.jsx(s.Fragment,{});var m=[];if(JSe(n,a))for(var p=On(n),v=n.getMonth();v<=a.getMonth();v++)m.push(Yj(p,v));else for(var p=On(new Date),v=0;v<=11;v++)m.push(Yj(p,v));var b=function(x){var j=Number(x.target.value),N=Yj(On(t.displayMonth),j);t.onChange(N)},y=(e=d==null?void 0:d.Dropdown)!==null&&e!==void 0?e:zq;return s.jsx(y,{name:"months","aria-label":h(),className:u.dropdown_month,style:i.dropdown_month,onChange:b,value:t.displayMonth.getMonth(),caption:l(t.displayMonth,{locale:o}),children:m.map(function(x){return s.jsx("option",{value:x.getMonth(),children:l(x,{locale:o})},x.getMonth())})})}function DCe(t){var e,r=t.displayMonth,n=Xt(),a=n.fromDate,i=n.toDate,o=n.locale,l=n.styles,u=n.classNames,d=n.components,h=n.formatters.formatYearCaption,m=n.labels.labelYearDropdown,p=[];if(!a)return s.jsx(s.Fragment,{});if(!i)return s.jsx(s.Fragment,{});for(var v=a.getFullYear(),b=i.getFullYear(),y=v;y<=b;y++)p.push(PL(qU(new Date),y));var x=function(N){var S=PL(On(r),Number(N.target.value));t.onChange(S)},j=(e=d==null?void 0:d.Dropdown)!==null&&e!==void 0?e:zq;return s.jsx(j,{name:"years","aria-label":m(),className:u.dropdown_year,style:l.dropdown_year,onChange:x,value:r.getFullYear(),caption:h(r,{locale:o}),children:p.map(function(N){return s.jsx("option",{value:N.getFullYear(),children:h(N,{locale:o})},N.getFullYear())})})}function $Ce(t,e){var r=w.useState(t),n=r[0],a=r[1],i=e===void 0?n:e;return[i,a]}function LCe(t){var e=t.month,r=t.defaultMonth,n=t.today,a=e||r||n||new Date,i=t.toDate,o=t.fromDate,l=t.numberOfMonths,u=l===void 0?1:l;if(i&&Ih(i,a)<0){var d=-1*(u-1);a=is(i,d)}return o&&Ih(a,o)<0&&(a=o),On(a)}function FCe(){var t=Xt(),e=LCe(t),r=$Ce(e,t.month),n=r[0],a=r[1],i=function(o){var l;if(!t.disableNavigation){var u=On(o);a(u),(l=t.onMonthChange)===null||l===void 0||l.call(t,u)}};return[n,i]}function BCe(t,e){for(var r=e.reverseMonths,n=e.numberOfMonths,a=On(t),i=On(is(a,n)),o=Ih(i,a),l=[],u=0;u<o;u++){var d=is(a,u);l.push(d)}return r&&(l=l.reverse()),l}function VCe(t,e){if(!e.disableNavigation){var r=e.toDate,n=e.pagedNavigation,a=e.numberOfMonths,i=a===void 0?1:a,o=n?i:1,l=On(t);if(!r)return is(l,o);var u=Ih(r,t);if(!(u<i))return is(l,o)}}function zCe(t,e){if(!e.disableNavigation){var r=e.fromDate,n=e.pagedNavigation,a=e.numberOfMonths,i=a===void 0?1:a,o=n?i:1,l=On(t);if(!r)return is(l,-o);var u=Ih(l,r);if(!(u<=0))return is(l,-o)}}var Uq=w.createContext(void 0);function UCe(t){var e=Xt(),r=FCe(),n=r[0],a=r[1],i=BCe(n,e),o=VCe(n,e),l=zCe(n,e),u=function(m){return i.some(function(p){return BE(m,p)})},d=function(m,p){u(m)||(p&&QU(m,p)?a(is(m,1+e.numberOfMonths*-1)):a(m))},h={currentMonth:n,displayMonths:i,goToMonth:a,goToDate:d,previousMonth:l,nextMonth:o,isDateDisplayed:u};return s.jsx(Uq.Provider,{value:h,children:t.children})}function cm(){var t=w.useContext(Uq);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function TL(t){var e,r=Xt(),n=r.classNames,a=r.styles,i=r.components,o=cm().goToMonth,l=function(h){o(is(h,t.dis
1160playIndex?-t.displayIndex:0))},u=(e=i==null?void 0:i.CaptionLabel)!==null&&e!==void 0?e:Vq,d=s.jsx(u,{id:t.id,displayMonth:t.displayMonth});return s.jsxs("div",{className:n.caption_dropdowns,style:a.caption_dropdowns,children:[s.jsx("div",{className:n.vhidden,children:d}),s.jsx(ICe,{onChange:l,displayMonth:t.displayMonth}),s.jsx(DCe,{onChange:l,displayMonth:t.displayMonth})]})}function qCe(t){return s.jsx("svg",lt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:s.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function WCe(t){return s.jsx("svg",lt({width:"16px",height:"16px",viewBox:"0 0 120 120"},t,{children:s.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var Xv=w.forwardRef(function(t,e){var r=Xt(),n=r.classNames,a=r.styles,i=[n.button_reset,n.button];t.className&&i.push(t.className);var o=i.join(" "),l=lt(lt({},a.button_reset),a.button);return t.style&&Object.assign(l,t.style),s.jsx("button",lt({},t,{ref:e,type:"button",className:o,style:l}))});function HCe(t){var e,r,n=Xt(),a=n.dir,i=n.locale,o=n.classNames,l=n.styles,u=n.labels,d=u.labelPrevious,h=u.labelNext,m=n.components;if(!t.nextMonth&&!t.previousMonth)return s.jsx(s.Fragment,{});var p=d(t.previousMonth,{locale:i}),v=[o.nav_button,o.nav_button_previous].join(" "),b=h(t.nextMonth,{locale:i}),y=[o.nav_button,o.nav_button_next].join(" "),x=(e=m==null?void 0:m.IconRight)!==null&&e!==void 0?e:WCe,j=(r=m==null?void 0:m.IconLeft)!==null&&r!==void 0?r:qCe;return s.jsxs("div",{className:o.nav,style:l.nav,children:[!t.hidePrevious&&s.jsx(Xv,{name:"previous-month","aria-label":p,className:v,style:l.nav_button_previous,disabled:!t.previousMonth,onClick:t.onPreviousClick,children:a==="rtl"?s.jsx(x,{className:o.nav_icon,style:l.nav_icon}):s.jsx(j,{className:o.nav_icon,style:l.nav_icon})}),!t.hideNext&&s.jsx(Xv,{name:"next-month","aria-label":b,className:y,style:l.nav_button_next,disabled:!t.nextMonth,onClick:t.onNextClick,children:a==="rtl"?s.jsx(j,{className:o.nav_icon,style:l.nav_icon}):s.jsx(x,{className:o.nav_icon,style:l.nav_icon})})]})}function OL(t){var e=Xt().numberOfMonths,r=cm(),n=r.previousMonth,a=r.nextMonth,i=r.goToMonth,o=r.displayMonths,l=o.findIndex(function(b){return BE(t.displayMonth,b)}),u=l===0,d=l===o.length-1,h=e>1&&(u||!d),m=e>1&&(d||!u),p=function(){n&&i(n)},v=function(){a&&i(a)};return s.jsx(HCe,{displayMonth:t.displayMonth,hideNext:h,hidePrevious:m,nextMonth:a,previousMonth:n,onPreviousClick:p,onNextClick:v})}function GCe(t){var e,r=Xt(),n=r.classNames,a=r.disableNavigation,i=r.styles,o=r.captionLayout,l=r.components,u=(e=l==null?void 0:l.CaptionLabel)!==null&&e!==void 0?e:Vq,d;return a?d=s.jsx(u,{id:t.id,displayMonth:t.displayMonth}):o==="dropdown"?d=s.jsx(TL,{displayMonth:t.displayMonth,id:t.id}):o==="dropdown-buttons"?d=s.jsxs(s.Fragment,{children:[s.jsx(TL,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id}),s.jsx(OL,{displayMonth:t.displayMonth,displayIndex:t.displayIndex,id:t.id})]}):d=s.jsxs(s.Fragment,{children:[s.jsx(u,{id:t.id,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),s.jsx(OL,{displayMonth:t.displayMonth,id:t.id})]}),s.jsx("div",{className:n.caption,style:i.caption,children:d})}function KCe(t){var e=Xt(),r=e.footer,n=e.styles,a=e.classNames.tfoot;return r?s.jsx("tfoot",{className:a,style:n.tfoot,children:s.jsx("tr",{children:s.jsx("td",{colSpan:8,children:r})})}):s.jsx(s.Fragment,{})}function YCe(t,e,r){for(var n=r?$l(new Date):Ms(new Date,{locale:t,weekStartsOn:e}),a=[],i=0;i<7;i++){var o=nn(n,i);a.push(o)}return a}function XCe(){var t=Xt(),e=t.classNames,r=t.styles,n=t.showWeekNumber,a=t.locale,i=t.weekStartsOn,o=t.ISOWeek,l=t.formatters.formatWeekdayName,u=t.labels.labelWeekday,d=YCe(a,i,o);return s.jsxs("tr",{style:r.head_row,className:e.head_row,children:[n&&s.jsx("td",{style:r.head_cell,className:e.head_cell}),d.map(function(h,m){return s.jsx("th",{scope:"col",className:e.head_cell,style:r.head_cell,"aria-label":u(h,{locale:a}),children:l(h,{locale:a})},m)})]})}function ZCe(){var t,e=Xt(),r=e.classNames,n=e.styles,a=e.components,i=(t=a==null?void 0:a.HeadRow)!==null&&t!==void 0?t:XCe;return s.jsx("thead",{style:n.head,className:r.head,children:s.jsx(i,{})})}function QCe(t){var e=Xt(),r=e.locale,n=e.formatters.formatDay;return s.jsx(s.Fragment,{children:n(t.date,{locale:r})})}var zE=w.createContext(void 0);function JCe(t){if(!om(t.initialProps)){var e={selected:void 0,modifiers:{disabled:[]}};return s.jsx(zE.Provider,{value:e,children:t.children})}return s.jsx(eke,{initialProps:t.initialProps,children:t.children})}function eke(t){var e=t.initialProps,r=t.children,n=e.selected,a=e.min,i=e.max,o=function(d,h,m){var p,v;(p=e.onDayClick)===null||p===void 0||p.call(e,d,h,m);var b=!!(h.selected&&a&&(n==null?void 0:n.length)===a);if(!b){var y=!!(!h.selected&&i&&(n==null?void 0:n.length)===i);if(!y){var x=n?Fq([],n):[];if(h.selected){var j=x.findIndex(function(N){return Pn(d,N)});x.splice(j,1)}else x.push(d);(v=e.onSelect)===null||v===void 0||v.call(e,x,d,h,m)}}},l={disabled:[]};n&&l.disabled.push(function(d){var h=i&&n.length>i-1,m=n.some(function(p){return Pn(p,d)});return!!(h&&!m)});
1160var u={selected:n,onDayClick:o,modifiers:l};return s.jsx(zE.Provider,{value:u,children:r})}function UE(){var t=w.useContext(zE);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}function tke(t,e){var r=e||{},n=r.from,a=r.to;return n&&a?Pn(a,t)&&Pn(n,t)?void 0:Pn(a,t)?{from:a,to:void 0}:Pn(n,t)?void 0:M2(n,t)?{from:t,to:a}:{from:n,to:t}:a?M2(t,a)?{from:a,to:t}:{from:t,to:a}:n?QU(t,n)?{from:t,to:n}:{from:n,to:t}:{from:t,to:void 0}}var qE=w.createContext(void 0);function rke(t){if(!lm(t.initialProps)){var e={selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}};return s.jsx(qE.Provider,{value:e,children:t.children})}return s.jsx(nke,{initialProps:t.initialProps,children:t.children})}function nke(t){var e=t.initialProps,r=t.children,n=e.selected,a=n||{},i=a.from,o=a.to,l=e.min,u=e.max,d=function(v,b,y){var x,j;(x=e.onDayClick)===null||x===void 0||x.call(e,v,b,y);var N=tke(v,n);(j=e.onSelect)===null||j===void 0||j.call(e,N,v,b,y)},h={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(h.range_start=[i],o?(h.range_end=[o],Pn(i,o)||(h.range_middle=[{after:i,before:o}])):h.range_end=[i]):o&&(h.range_start=[o],h.range_end=[o]),l&&(i&&!o&&h.disabled.push({after:xl(i,l-1),before:nn(i,l-1)}),i&&o&&h.disabled.push({after:i,before:nn(i,l-1)}),!i&&o&&h.disabled.push({after:xl(o,l-1),before:nn(o,l-1)})),u){if(i&&!o&&(h.disabled.push({before:nn(i,-u+1)}),h.disabled.push({after:nn(i,u-1)})),i&&o){var m=js(o,i)+1,p=u-m;h.disabled.push({before:xl(i,p)}),h.disabled.push({after:nn(o,p)})}!i&&o&&(h.disabled.push({before:nn(o,-u+1)}),h.disabled.push({after:nn(o,u-1)}))}return s.jsx(qE.Provider,{value:{selected:n,onDayClick:d,modifiers:h},children:r})}function WE(){var t=w.useContext(qE);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function mg(t){return Array.isArray(t)?Fq([],t):t!==void 0?[t]:[]}function ake(t){var e={};return Object.entries(t).forEach(function(r){var n=r[0],a=r[1];e[n]=mg(a)}),e}var os;(function(t){t.Outside="outside",t.Disabled="disabled",t.Selected="selected",t.Hidden="hidden",t.Today="today",t.RangeStart="range_start",t.RangeEnd="range_end",t.RangeMiddle="range_middle"})(os||(os={}));var ske=os.Selected,Ks=os.Disabled,ike=os.Hidden,oke=os.Today,Xj=os.RangeEnd,Zj=os.RangeMiddle,Qj=os.RangeStart,lke=os.Outside;function cke(t,e,r){var n,a=(n={},n[ske]=mg(t.selected),n[Ks]=mg(t.disabled),n[ike]=mg(t.hidden),n[oke]=[t.today],n[Xj]=[],n[Zj]=[],n[Qj]=[],n[lke]=[],n);return t.fromDate&&a[Ks].push({before:t.fromDate}),t.toDate&&a[Ks].push({after:t.toDate}),om(t)?a[Ks]=a[Ks].concat(e.modifiers[Ks]):lm(t)&&(a[Ks]=a[Ks].concat(r.modifiers[Ks]),a[Qj]=r.modifiers[Qj],a[Zj]=r.modifiers[Zj],a[Xj]=r.modifiers[Xj]),a}var qq=w.createContext(void 0);function uke(t){var e=Xt(),r=UE(),n=WE(),a=cke(e,r,n),i=ake(e.modifiers),o=lt(lt({},a),i);return s.jsx(qq.Provider,{value:o,children:t.children})}function Wq(){var t=w.useContext(qq);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function dke(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function fke(t){return!!(t&&typeof t=="object"&&"from"in t)}function hke(t){return!!(t&&typeof t=="object"&&"after"in t)}function mke(t){return!!(t&&typeof t=="object"&&"before"in t)}function pke(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function gke(t,e){var r,n=e.from,a=e.to;if(n&&a){var i=js(a,n)<0;i&&(r=[a,n],n=r[0],a=r[1]);var o=js(t,n)>=0&&js(a,t)>=0;return o}return a?Pn(a,t):n?Pn(n,t):!1}function vke(t){return $E(t)}function xke(t){return Array.isArray(t)&&t.every($E)}function yke(t,e){return e.some(function(r){if(typeof r=="boolean")return r;if(vke(r))return Pn(t,r);if(xke(r))return r.includes(t);if(fke(r))return gke(t,r);if(pke(r))return r.dayOfWeek.includes(t.getDay());if(dke(r)){var n=js(r.before,t),a=js(r.after,t),i=n>0,o=a<0,l=M2(r.before,r.after);return l?o&&i:i||o}return hke(r)?js(t,r.after)>0:mke(r)?js(r.before,t)>0:typeof r=="function"?r(t):!1})}function HE(t,e,r){var n=Object.keys(e).reduce(function(i,o){var l=e[o];return yke(t,l)&&i.push(o),i},[]),a={};
1160return n.forEach(function(i){return a[i]=!0}),r&&!BE(t,r)&&(a.outside=!0),a}function bke(t,e){for(var r=On(t[0]),n=LE(t[t.length-1]),a,i,o=r;o<=n;){var l=HE(o,e),u=!l.disabled&&!l.hidden;if(!u){o=nn(o,1);continue}if(l.selected)return o;l.today&&!i&&(i=o),a||(a=o),o=nn(o,1)}return i||a}var wke=365;function Hq(t,e){var r=e.moveBy,n=e.direction,a=e.context,i=e.modifiers,o=e.retry,l=o===void 0?{count:0,lastFocused:t}:o,u=a.weekStartsOn,d=a.fromDate,h=a.toDate,m=a.locale,p={day:nn,week:O2,month:is,year:XNe,startOfWeek:function(x){return a.ISOWeek?$l(x):Ms(x,{locale:m,weekStartsOn:u})},endOfWeek:function(x){return a.ISOWeek?WU(x):FE(x,{locale:m,weekStartsOn:u})}},v=p[r](t,n==="after"?1:-1);n==="before"&&d?v=ZNe([d,v]):n==="after"&&h&&(v=QNe([h,v]));var b=!0;if(i){var y=HE(v,i);b=!y.disabled&&!y.hidden}return b?v:l.count>wke?l.lastFocused:Hq(v,{moveBy:r,direction:n,context:a,modifiers:i,retry:lt(lt({},l),{count:l.count+1})})}var Gq=w.createContext(void 0);function _ke(t){var e=cm(),r=Wq(),n=w.useState(),a=n[0],i=n[1],o=w.useState(),l=o[0],u=o[1],d=bke(e.displayMonths,r),h=a??(l&&e.isDateDisplayed(l))?l:d,m=function(){u(a),i(void 0)},p=function(x){i(x)},v=Xt(),b=function(x,j){if(a){var N=Hq(a,{moveBy:x,direction:j,context:v,modifiers:r});Pn(a,N)||(e.goToDate(N,a),p(N))}},y={focusedDay:a,focusTarget:h,blur:m,focus:p,focusDayAfter:function(){return b("day","after")},focusDayBefore:function(){return b("day","before")},focusWeekAfter:function(){return b("week","after")},focusWeekBefore:function(){return b("week","before")},focusMonthBefore:function(){return b("month","before")},focusMonthAfter:function(){return b("month","after")},focusYearBefore:function(){return b("year","before")},focusYearAfter:function(){return b("year","after")},focusStartOfWeek:function(){return b("startOfWeek","before")},focusEndOfWeek:function(){return b("endOfWeek","after")}};return s.jsx(Gq.Provider,{value:y,children:t.children})}function GE(){var t=w.useContext(Gq);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}function jke(t,e){var r=Wq(),n=HE(t,r,e);return n}var KE=w.createContext(void 0);function Nke(t){if(!vx(t.initialProps)){var e={selected:void 0};return s.jsx(KE.Provider,{value:e,children:t.children})}return s.jsx(Ske,{initialProps:t.initialProps,children:t.children})}function Ske(t){var e=t.initialProps,r=t.children,n=function(i,o,l){var u,d,h;if((u=e.onDayClick)===null||u===void 0||u.call(e,i,o,l),o.selected&&!e.required){(d=e.onSelect)===null||d===void 0||d.call(e,void 0,i,o,l);return}(h=e.onSelect)===null||h===void 0||h.call(e,i,i,o,l)},a={selected:e.selected,onDayClick:n};return s.jsx(KE.Provider,{value:a,children:r})}function Kq(){var t=w.useContext(KE);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Cke(t,e){var r=Xt(),n=Kq(),a=UE(),i=WE(),o=GE(),l=o.focusDayAfter,u=o.focusDayBefore,d=o.focusWeekAfter,h=o.focusWeekBefore,m=o.blur,p=o.focus,v=o.focusMonthBefore,b=o.focusMonthAfter,y=o.focusYearBefore,x=o.focusYearAfter,j=o.focusStartOfWeek,N=o.focusEndOfWeek,S=function(M){var F,K,B,O;vx(r)?(F=n.onDayClick)===null||F===void 0||F.call(n,t,e,M):om(r)?(K=a.onDayClick)===null||K===void 0||K.call(a,t,e,M):lm(r)?(B=i.onDayClick)===null||B===void 0||B.call(i,t,e,M):(O=r.onDayClick)===null||O===void 0||O.call(r,t,e,M)},k=function(M){var F;p(t),(F=r.onDayFocus)===null||F===void 0||F.call(r,t,e,M)},C=function(M){var F;m(),(F=r.onDayBlur)===null||F===void 0||F.call(r,t,e,M)},A=function(M){var F;(F=r.onDayMouseEnter)===null||F===void 0||F.call(r,t,e,M)},T=function(M){var F;(F=r.onDayMouseLeave)===null||F===void 0||F.call(r,t,e,M)},R=function(M){var F;(F=r.onDayPointerEnter)===null||F===void 0||F.call(r,t,e,M)},I=function(M){var F;(F=r.onDayPointerLeave)===null||F===void 0||F.call(r,t,e,M)},D=function(M){var F;(F=r.onDayTouchCancel)===null||F===void 0||F.call(r,t,e,M)},L=function(M){var F;(F=r.onDayTouchEnd)===null||F===void 0||F.call(r,t,e,M)},z=function(M){var F;(F=r.onDayTouchMove)===null||F===void 0||F.call(r,t,e,M)},H=function(M){var F;(F=r.onDayTouchStart)===null||F===void 0||F.call(r,t,e,M)},Z=function(M){var F;(F=r.onDayKeyUp)===null||F===void 0||F.call(r,t,e,M)},te=function(M){var F;switch(M.key){case"ArrowLeft":M.preventDefault(),M.stopPropagation(),r.dir==="rtl"?l(
1160):u();break;case"ArrowRight":M.preventDefault(),M.stopPropagation(),r.dir==="rtl"?u():l();break;case"ArrowDown":M.preventDefault(),M.stopPropagation(),d();break;case"ArrowUp":M.preventDefault(),M.stopPropagation(),h();break;case"PageUp":M.preventDefault(),M.stopPropagation(),M.shiftKey?y():v();break;case"PageDown":M.preventDefault(),M.stopPropagation(),M.shiftKey?x():b();break;case"Home":M.preventDefault(),M.stopPropagation(),j();break;case"End":M.preventDefault(),M.stopPropagation(),N();break}(F=r.onDayKeyDown)===null||F===void 0||F.call(r,t,e,M)},G={onClick:S,onFocus:k,onBlur:C,onKeyDown:te,onKeyUp:Z,onMouseEnter:A,onMouseLeave:T,onPointerEnter:R,onPointerLeave:I,onTouchCancel:D,onTouchEnd:L,onTouchMove:z,onTouchStart:H};return G}function kke(){var t=Xt(),e=Kq(),r=UE(),n=WE(),a=vx(t)?e.selected:om(t)?r.selected:lm(t)?n.selected:void 0;return a}function Eke(t){return Object.values(os).includes(t)}function Ake(t,e){var r=[t.classNames.day];return Object.keys(e).forEach(function(n){var a=t.modifiersClassNames[n];if(a)r.push(a);else if(Eke(n)){var i=t.classNames["day_".concat(n)];i&&r.push(i)}}),r}function Pke(t,e){var r=lt({},t.styles.day);return Object.keys(e).forEach(function(n){var a;r=lt(lt({},r),(a=t.modifiersStyles)===null||a===void 0?void 0:a[n])}),r}function Tke(t,e,r){var n,a,i,o=Xt(),l=GE(),u=jke(t,e),d=Cke(t,u),h=kke(),m=!!(o.onDayCl
1160ick||o.mode!=="default");w.useEffect(function(){var A;u.outside||l.focusedDay&&m&&Pn(l.focusedDay,t)&&((A=r.current)===null||A===void 0||A.focus())},[l.focusedDay,t,r,m,u.outside]);var p=Ake(o,u).join(" "),v=Pke(o,u),b=!!(u.outside&&!o.showOutsideDays||u.hidden),y=(i=(a=o.components)===null||a===void 0?void 0:a.DayContent)!==null&&i!==void 0?i:QCe,x=s.jsx(y,{date:t,displayMonth:e,activeModifiers:u}),j={style:v,className:p,children:x,role:"gridcell"},N=l.focusTarget&&Pn(l.focusTarget,t)&&!u.outside,S=l.focusedDay&&Pn(l.focusedDay,t),k=lt(lt(lt({},j),(n={disabled:u.disabled,role:"gridcell"},n["aria-selected"]=u.selected,n.tabIndex=S||N?0:-1,n)),d),C={isButton:m,isHidden:b,activeModifiers:u,selectedDays:h,buttonProps:k,divProps:j};return C}function Oke(t){var e=w.useRef(null),r=Tke(t.date,t.displayMonth,e);return r.isHidden?s.jsx("div",{role:"gridcell"}):r.isButton?s.jsx(Xv,lt({name:"day",ref:e},r.buttonProps)):s.jsx("div",lt({},r.divProps))}function Mke(t){var e=t.number,r=t.dates,n=Xt(),a=n.onWeekNumberClick,i=n.styles,o=n.classNames,l=n.locale,u=n.labels.labelWeekNumber,d=n.formatters.formatWeekNumber,h=d(Number(e),{locale:l});if(!a)return s.jsx("span",{className:o.weeknumber,style:i.weeknumber,children:h});var m=u(Number(e),{locale:l}),p=function(v){a(e,r,v)};return s.jsx(Xv,{name:"week-number","aria-label":m,className:o.weeknumber,style:i.weeknumber,onClick:p,children:h})}function Rke(t){var e,r,n=Xt(),a=n.styles,i=n.classNames,o=n.showWeekNumber,l=n.components,u=(e=l==null?void 0:l.Day)!==null&&e!==void 0?e:Oke,d=(r=l==null?void 0:l.WeekNumber)!==null&&r!==void 0?r:Mke,h;return o&&(h=s.jsx("td",{className:i.cell,style:a.cell,children:s.jsx(d,{number:t.weekNumber,dates:t.dates})})),s.jsxs("tr",{className:i.row,style:a.row,children:[h,t.dates.map(function(m){return s.jsx("td",{className:i.cell,style:a.cell,role:"presentation",children:s.jsx(u,{displayMonth:t.displayMonth,date:m})},XSe(m))})]})}function ML(t,e,r){for(var n=r!=null&&r.ISOWeek?WU(e):FE(e,r),a=r!=null&&r.ISOWeek?$l(t):Ms(t,r),i=js(n,a),o=[],l=0;l<=i;l++)o.push(nn(a,l));var u=o.reduce(function(d,h){var m=r!=null&&r.ISOWeek?KU(h):XU(h,r),p=d.find(function(v){return v.weekNumber===m});return p?(p.dates.push(h),d):(d.push({weekNumber:m,dates:[h]}),d)},[]);return u}function Ike(t,e){var r=ML(On(t),LE(t),e);if(e!=null&&e.useFixedWeeks){var n=QSe(t,e);if(n<6){var a=r[r.length-1],i=a.dates[a.dates.length-1],o=O2(i,6-n),l=ML(O2(i,1),o,e);r.push.apply(r,l)}}return r}function Dke(t){var e,r,n,a=Xt(),i=a.locale,o=a.classNames,l=a.styles,u=a.hideHead,d=a.fixedWeeks,h=a.components,m=a.weekStartsOn,p=a.firstWeekContainsDate,v=a.ISOWeek,b=Ike(t.displayMonth,{useFixedWeeks:!!d,ISOWeek:v,locale:i,weekStartsOn:m,firstWeekContainsDate:p}),y=(e=h==null?void 0:h.Head)!==null&&e!==void 0?e:ZCe,x=(r=h==null?void 0:h.Row)!==null&&r!==void 0?r:Rke,j=(n=h==null?void 0:h.Footer)!==null&&n!==void 0?n:KCe;return s.jsxs("table",{id:t.id,className:o.table,style:l.table,role:"grid","aria-labelledby":t["aria-labelledby"],children:[!u&&s.jsx(y,{}),s.jsx("tbody",{className:o.tbody,style:l.tbody,children:b.map(function(N){return s.jsx(x,{displayMonth:t.displayMonth,dates:N.dates,weekNumber:N.weekNumber},N.weekNumber)})}),s.jsx(j,{displayMonth:t.displayMonth})]})}function $ke(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}var Lke=$ke()?w.useLayoutEffect:w.useEffect,Jj=!1,Fke=0;function RL(){return"react-day-picker-".concat(++Fke)}function Bke(t){var e,r=t??(Jj?RL():null),n=w.useState(r),a=n[0],i=n[1];return Lke(function(){a===null&&i(RL())},[]),w.useEffect(function(){Jj===!1&&(Jj=!0)},[]),(e=t??a)!==null&&e!==void 0?e:void 0}function Vke(t){var e,r,n=Xt(),a=n.dir,i=n.classNames,o=n.styles,l=n.components,u=cm().displayMonths,d=Bke(n.id?"".concat(n.id,"-").concat(t.displayIndex):void 0),h=n.id?"".concat(n.id,"-grid-").concat(t.displayIndex):void 0,m=[i.month],p=o.month,v=t.displayIndex===0,b=t.displayIndex===u.length-1,y=!v&&!b;a==="rtl"&&(e=[v,b],b=e[0],v=e[1]),v&&(m.push(i.caption_start),p=lt(lt({},p),o.caption_start)),b&&(m.push(i.caption_end),p=lt(lt({},p),o.caption_end)),y&&(m.push(i.caption_between),p=lt(lt({},p),o.caption_between));var x=(r=l==null?void 0:l.Caption)!==null&&r!==void 0?r:GCe;return s.jsxs("div",{className:m.join(" "),style:p,children:[s.jsx(x,{id:d,displayMonth:t.displayMonth,displayIndex:t.displayIndex}),s.jsx(Dke,{id:h,"aria-labelledby":d,displayMonth:t.displayMonth})]},t.displayIndex)}function zke(t){var e=Xt(),r=e.classNames,n=e.styles;return s.jsx("div",{className:r.months,style:n.months,children:t.children})}function Uke(t){var e,r,n=t.initialProps,a=Xt(),i=GE(),o=cm(),l=w.useState(!1),u=l[0],d=l[1];w.useEffect(function(){a.initialFocus&&i.focusTarget&&(u||(i.focus(i.focusTarget),d(!0)))},[a.initialFocus,u,i.focus,i.focusTarget,i]);var h=[a.classNames.root,a.className];a.numberOfMonths>1&&h.push(a.classNames.multiple_months),a.showWeekNumber&&h.push(a.classNames.with_weeknumber);var m=lt(lt({},a.styles.root),a.style),p=Object.keys(n).filter(function(b){return b.startsWith("data-")}).reduce(function(b,y){var x;return lt(lt({},b),(x={},x[y]=n[y],x))},{}),v=(r=(e=n.components)===null||e===void 0?void 0:e.Months)!==null&&r!==void 0?r:zke;return s.jsx("div",lt({className:h.join(" "),style:m,dir:a.dir,id:a.id,nonce:n.nonce,title:n.title,lang:n.lang},p,{children:s.jsx(v,{children:o.displayMonths.map(function(b,y){return s.jsx(Vke,{displayIndex:y,displayMonth:b},y)})})}))}function qke(t){var e=t.children,r=mCe(t,["children"]);return s.jsx(MCe,{initialProps:r,children:s.jsx(UCe,{children:s.jsx(Nke,{initialProps:r,children:s.jsx(JCe,{initialProps:r,children:s.jsx(rke,{initialProps:r,children:s.jsx(uke,{children:s.jsx(_ke,{children:e})})})})})})})}function Wke(t){return s.jsx(qke,lt({},t,{children:s.jsx(Uke,{initialProps:t})}))}function YE({className:t,classNames:e,showOutsideDays:r=!0,...n}){return s.jsx(Wke,{showOutsideDays:r,className:Qe("p-3 pointer-events-auto",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:sp
1160ace-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:Qe(YN({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:Qe(YN({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...e},components:{IconLeft:({...a})=>s.jsx(e0,{className:"h-4 w-4"}),IconRight:({...a})=>s.jsx(t0,{className:"h-4 w-4"})},...n})}YE.displayName="Calendar";const Hke=BU({contact_mode:T2("existing"),contact_id:Br().min(1,{message:"Selecione um contato"}),new_contact_name:Br().optional(),new_contact_phone:Br().optional(),new_contact_email:Br().optional(),title:Br().trim().min(3,{message:"TÃtulo deve ter no mÃnimo 3 caracteres"}).max(100,{message:"TÃtulo deve ter no máximo 100 caracteres"}),company:Br().trim().max(100,{message:"Empresa deve ter no máximo 100 caracteres"}).optional(),value:zU.number().min(0,{message:"Valor deve ser positivo"}).max(999999999,{message:"Valor muito alto"}).default(0),priority:VU(["low","medium","high"]).default("medium"),tags:Br().max(500,{message:"Tags muito longas"}).optional(),due_date:FU().optional(),owner_id:Br().optional()}),Gke=BU({contact_mode:T2("new"),contact_id:Br().optional(),new_contact_name:Br().trim().min(2,{message:"Nome deve ter no mÃnimo 2 caracteres"}).max(100,{message:"Nome deve ter no máximo 100 caracteres"}),new_contact_phone:Br().trim().min(10,{message:"Telefone inválido"}).max(20,{message:"Telefone muito longo"}).regex(/^[\d\s\+\-\(\)]+$/,{message:"Telefone deve conter apenas números"}),new_contact_email:Br().trim().email({message:"Email inválido"}).optional().or(T2("")),title:Br().trim().min(3,{message:"TÃtulo deve ter no mÃnimo 3 caracteres"}).max(100,{message:"TÃtulo deve ter no máximo 100 caracteres"}),company:Br().trim().max(100,{message:"Empresa deve ter no máximo 100 caracteres"}).optional(),value:zU.number().min(0,{message:"Valor deve ser positivo"}).max(999999999,{message:"Valor muito alto"}).default(0),priority:VU(["low","medium","high"]).default("medium"),tags:Br().max(500,{message:"Tags muito longas"}).optional(),due_date:FU().optional(),owner_id:Br().optional()}),Kke=HNe("contact_mode",[Hke,Gke]),Yke=({open:t,onOpenChange:e,onDealCreated:r})=>{const[n,a]=w.useState([]),[i,o]=w.useState([]),[l,u]=w.useState(!1),[d,h]=w.useState("existing"),m=gNe({resolver:bNe(Kke),defaultValues:{contact_mode:"existing",title:"",company:"",value:0,priority:"medium",tags:"",new_contact_name:"",new_contact_phone:"",new_contact_email:""}});w.useEffect(()=>{t&&(async()=>{try{const[y,x]=await Promise.all([Ge.fetchContacts(),Ge.fetchTeam()]);a(y),o(x)}catch(y){console.error("Error loading data:",y)}})()},[t]);const p=b=>{const y=b;h(y),m.setValue("contact_mode",y)},v=async b=>{u(!0);try{let y=b.contact_mode==="existing"?b.contact_id:"";if(b.contact_mode==="new"){const{data:j}=await ve.from("contacts").select("id").eq("phone_number",b.new_contact_phone).maybeSingle();if(j){xe.error("Já existe um contato com este telefone"),u(!1);return}const{data:N,error:S}=await ve.from("contacts").insert({name:b.new_contact_name,phone_number:b.new_contact_phone,email:b.new_contact_email||null}).select("id").single();if(S||!N){console.error("Error creating contact:",S),xe.error("Erro ao criar contato"),u(!1);return}y=N.id,xe.success("Contato criado com sucesso!"),await ve.from("deals").delete().eq("contact_id",y)}const x=b.tags?b.tags.split(",").map(j=>j.trim()).filter(j=>j.length>0):[];await Ge.createDeal({contact_id:y,title:b.title,company:b.company,value:b.value,stage:"new",priority:b.priority,tags:x,due_date:b.due_date?vn(b.due_date,"yyyy-MM-dd"):void 0,owner_id:b.owner_id}),xe.success("Deal criado com sucesso!"),m.reset(),h("existing"),e(!1),r()}catch(y){console.error("Error creating deal:",y),xe.error("Erro ao criar deal")}finally{u(!1)}};return s.jsx(Ll,{open:t,onOpenChange:e,children:s.jsxs(bo,{className:"max-w-2xl max-h-[90vh] overflow-y-auto bg-slate-900 border-slate-700 text-slate-50",children:[s.jsxs(wo,{children:[s.jsx(_o,{className:"text-2xl font-bold text-white",children:"Criar Novo Deal"}),s.jsx(zu,{className:"text-slate-400",children:"Preencha as informações para criar uma nova oportunidade no pipeline."})]}),s.jsx(t2e,{...m,children:s.jsxs("form",{onSubmit:m.handleSubmit(v),className:"space-y-6",children:[s.jsxs(Az,{value:d,onValueChange:p,className:"w-full",children:[s.jsxs(gE,{className:"grid w-full grid-cols-2 bg-slate-800 p-1",children:[s.jsxs(eu,{value:"existing",className:"data-[state=active]:bg-red-600 data-[state=active]:text-white text-slate-300 flex items-center gap-2",children:[s.jsx(mn,{className:"w-4 h-4"}),"Contato Existente"]}),s.jsxs(eu,{value:"new",className:"data-[state=active]:bg-red-600 data-[state=active]:text-white text-slate-300 flex items-center gap-2",children:[s.jsx(bg,{className:"w-4 h-4"}),"Novo Contato"]})]}),s.jsx(tu,{value:"existing",className:"mt-4 space-y-4",children:s.jsx(Ba,{control:m.control,name:"contact_id",render:({field:b})=>s.jsxs(fa,{children:[s.jsx(ha,{className:"text-slate-200",children:"Contato *"}),s.jsxs(Qn,{onValueChange:b.onChange,value:b.value||"",children:[s.jsx(ma,{children:s.jsx(Mn,{className:"bg-slate-800 border-slate-600 text-slate-200 focus:ring-red-500 focus:border-red-500",children:s.jsx(Jn,{placeholder:"Selecione um contato"})})}),s.jsx(Rn,{className:"bg-slate-800 border-slate-600",children:n.map(y=>s.jsx(on,{value:y.id,className:"text-slate-200 focus:bg-red-600 focus:text-white",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{children:y.name||y.phone||"Sem nome"}),y.phone&&y.name&&s.jsxs("span",{className:"text-slate-400 text-xs",children:["(",y.phone,")"]})]})},y.id))})]}),s.jsx(wf,{className:"text-slate-500",children:"Cliente ou lead associado a esta oportunidade"}),s.jsx(pa,{className:"text-red-400"})]})})}),s.jsxs(tu,{value:"new",className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx(Ba,{control:m.control,name:"new_contact_name",render:({field:b})=>s.jsxs(fa,{children:[s.jsxs(ha,{className:"text-slate-200 flex items-center gap-2",children:[s.jsx(mn,{className:"w-4 h-4 text-red-400"}),"Nome *"]}),s.jsx(ma,{children:s.jsx(kt,{placeholder:"Nome do contato",className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500 focus:ring-red-500 focus:border-red-500",...b})}),s.jsx(pa,{className:"text-red-400"})]})}),s.jsx(Ba,{control:m.control,name:"new_contact_phone",render:({field:b})=>s.jsxs(fa,{children:[s.jsxs(ha,{className:"text-slate-200 flex items-center gap-2",children:[s.jsx(Hu,{className:"w-4 h-4 text-red-400"}),"Telefone *"]}),s.jsx(ma,{children:s.jsx(kt,{placeholder:"+55 11 99999-9999",className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500 focus:ring-red-500 focus:border-red-500",...b})}),s.jsx(wf,{className:"text-slate-500",children:"Formato WhatsApp com código do paÃs"}),s.jsx(pa,{className:"text-red-400"})]})})]}),s.jsx(Ba,{control:m.control,name:"new_contact_email",render:({field:b})=>s.jsxs(fa,{children:[s.jsxs(ha,{className:"text-slate-200 flex items-center gap-2",children:[s.jsx(iu,{className:"w-4 h-4 text-red-400"}),"Email (opcional)"]}),s.jsx(ma,{children:s.jsx(kt,{type:"email",placeholder:"[email protected]",className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500 focus:ring-red-500 focus:border-red-500",...b})}),s.jsx(pa,{className:"text-red-400"})]})})]})]}),s.jsxs("div",{className:"border-t border-slate-700 pt-6 space-y-4",children:[s.jsxs("h3",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[s.jsx(f8,{className:"w-5 h-5 text-red-400"}),"Informações do Deal"]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(Ba,{control:m.control,name:"title",render:({field:b})=>s.jsxs(fa,{children:[s.jsx(ha,{className:"text-slate-200",children:"TÃtulo *"}),s.jsx(ma,{children:s.jsx(kt,{placeholder:"Ex: Venda Premium...",className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500 focus:ring-red-500 focus:border-red-500",...b})}),s.jsx(pa,{className:"text-red-400"})]})}),s.jsx(Ba,{control:m.control,name:"company",render:({field:b})=>s.jsxs(fa,{children:[s.jsx(ha,{className:"text-slate-200",children:"Empresa"}),s.jsx(ma,{children:s.jsx(kt,{placeholder:"Nome da empresa",className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500 focus:ring-red-500 focus:border-red-500",...b})}),s.jsx(pa,{className:"text-red-400"})]})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(Ba,{control:m.control,name:"value",render:({field:b})=>s.jsxs(fa,{children:[s.jsx(ha,{className:"text-slate-200",children:"Valor (R$)"}),s.jsx(ma,{children:s.jsx(kt,{type:"number",step:"0.01",placeholder:"0.00",className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500 focus:ring-red-500 focus:border-red-500",...b})}),s.jsx(pa,{className:"text-red-400"})]})}),s.jsx(Ba,{control:m.control,name:"priority",render:({field:b})=>s.jsxs(fa,{children:[s.jsx(ha,{className:"text-slate-200",children:"Prioridade"}),s.jsxs(Qn,{onValueChange:b.onChange,defaultValue:b.value,children:[s.jsx(ma,{children:s.jsx(Mn,{className:"bg-slate-800 border-slate-600 text-slate-200 focus:ring-red-500 focus:border-red-500",children:s.jsx(Jn,{})})}),s.jsxs(Rn,{className:"bg-slate-800 border-slate-600",children:[s.jsx(on,{value:"low",className:"text-slate-200 focus:bg-red-600 focus:text-white",children:"Baixa"}),s.jsx(on,{value:"medium",className:"text-slate-200 focus:bg-red-600 focus:text-white",children:"Média"}),s.jsx(on,{value:"high",className:"text-slate-200 focus:bg-red-600 focus:text-white",children:"Alta"})]})]}),s.jsx(pa,{className:"text-red-400"})]})})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(Ba,{control:m.control,name:"due_date",render:({field:b})=>s.jsxs(fa,{className:"flex flex-col",children:[s.jsx(ha,{className:"text-slate-200",children:"Data Prevista"}),s.jsxs(fE,{children:[s.jsx(hE,{asChild:!0,children:s.jsx(ma,{children:s.jsxs(Ne,{variant:"outline",className:Qe("w-full pl-3 text-left font-normal bg-slate-800 border-slate-600 hover:bg-slate-700 focus:ring-red-500",!b.value&&"text-slate-500"),children:[b.value?vn(b.value,"dd/MM/yyyy"):s.jsx("span",{children:"Selecione uma data"}),s.jsx(Ya,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),s.jsx(ex,{className:"w-auto p-0 bg-slate-800 border-slate-600",align:"start",children:s.jsx(YE,{mode:"single",selected:b.value,onSelect:b.onChange,disabled:y=>y<new Date,initialFocus:!0,className:"pointer-events-auto"})})]}),s.jsx(wf,{className:"text-slate-500",children:"Previsão de fechamento"}),s.jsx(pa,{className:"text-red-400"})]})}),s.jsx(Ba,{control:m.control,name:"owner_id",render:({field:b})=>s.jsxs(fa,{children:[s.jsx(ha,{className:"text-slate-200",children:"Responsável"}),s.jsxs(Qn,{onValueChange:b.onChange,defaultValue:b.value,children:[s.jsx(ma,{children:s.jsx(Mn,{className:"bg-slate-800 border-slate-600 text-slate-200 focus:ring-red-500 focus:border-red-500",children:s.jsx(Jn,{placeholder:"Selecione"})})}),s.jsx(Rn,{className:"bg-slate-800 border-slate-600",children:i.map(y=>s.jsx(on,{value:y.id,className:"text-slate-200 focus:bg-red-600 focus:text-white",children:y.name},y.id))})]}),s.jsx(pa,{className:"text-red-400"})]})})]}),s.jsx(Ba,{control:m.control,name:"tags",render:({field:b})=>s.jsxs(fa,{children:[s.jsx(ha,{className:"text-slate-200",children:"Tags"}),s.jsx(ma,{children:s.jsx(kt,{placeholder:"Ex: premium, urgente (separadas por vÃrgula)",className:"bg-slate-800 border-slate-600 text-slate-200 placeholder:text-slate-500 focus:ring-red-500 focus:border-red-500",...b})}),s.jsx(wf,{className:"text-slate-500",children:"Separe múltiplas tags com vÃrgula"}),s.jsx(pa,{className:"text-red-400"})]})})]}),s.jsxs(Vu,{className:"gap-2 sm:gap-0",children:[s.jsx(Ne,{type:"button",variant:"secondary",onClick:()=>e(!1),disabled:l,className:"bg-slate-700 hover:bg-slate-600 text-slate-200 border-slate-600",children:"Cancelar"}),s.jsx(Ne,{type:"submit",disabled:l,className:"bg-gradient-to-r from-red-600 to-red-500 hover:from-red-500 hover:to-red-400 text-white shadow-lg shadow-red-500/20",children:l?"Criando...":d==="new"?"Criar Contato e Deal":"Criar Deal"})]})]})})]})})},Dh=w.forwardRef(({className:t,...e},r)=>s.jsx("textarea",{className:Qe("flex min-h-[80px] w-full rounded-md border border-input bg-secondary/50 px-3 py-2 text-sm text-foreground ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...e}));Dh.displayName="Textarea";const Xke=({open:t,onOpenChange:e,onConfirm:r,dealTitle:n})=>{const[a,i]=w.useState(""),o=()=>{a.trim()&&(r(a),i(""),e(!1))};return s.jsx(Ll,{open:t,onOpenChange:e,children:s.jsxs(bo,{className:"sm:max-w-[500px] bg-popover border-border","aria-describedby":"lost-reason-description",children:[s.jsxs(wo,{children:[s.jsx(_o,{className:"text-foreground",children:"Marcar Deal como Perdido"}),s.jsxs(zu,{className:"text-muted-foreground",children:['Você está marcando "',n,'" como perdido. Por favor, informe o motivo.']})]}),s.jsx("div",{className:"space-y-4 py-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"reason",children:"Motivo da Perda *"}),s.jsx(Dh,{id:"reason",placeholder:"Ex: Cliente escolheu concorrente, orçamento insuficiente, timing inadequado...",value:a,onChange:l=>i(l.target.value),rows:4,className:"resize-none"})]})}),s.jsxs(Vu,{children:[s.jsx(Ne,{variant:"outline",onClick:()=>e(!1),children:"Cancelar"}),s.jsx(Ne,{onClick:o,disabled:!a.trim(),variant:"danger",children:"Confirmar Perda"})]})]})})};var Zke=Symbol("radix.slottable");function Qke(t){const e=({children:r})=>s.jsx(s.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=Zke,e}var Yq="AlertDialog",[Jke]=Ca(Yq,[Tz]),Ni=Tz(),Xq=t=>{const{__scopeAlertDialog:e,...r}=t,n=Ni(e);return s.jsx(bE,{...n,...r,modal:!0})};Xq.displayName=Yq;var eEe="AlertDialogTrigger",tEe=w.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Ni(r);return s.jsx(rje,{...a,...n,ref:e})});tEe.displayName=eEe;var rEe="AlertDialogPortal",Zq=t=>{const{__scopeAlertDialog:e,...r}=t,n=Ni(e);return s.jsx(wE,{...n,...r})};
1160Zq.displayName=rEe;var nEe="AlertDialogOverlay",Qq=w.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Ni(r);return s.jsx(tm,{...a,...n,ref:e})});Qq.displayName=nEe;var nu="AlertDialogContent",[aEe,sEe]=Jke(nu),iEe=Qke("AlertDialogContent"),Jq=w.forwardRef((t,e)=>{const{__scopeAlertDialog:r,children:n,...a}=t,i=Ni(r),o=w.useRef(null),l=Nt(e,o),u=w.useRef(null);return s.jsx(Q_e,{contentName:nu,titleName:eW,docsSlug:"alert-dialog",children:s.jsx(aEe,{scope:r,cancelRef:u,children:s.jsxs(rm,{role:"alertdialog",...i,...a,ref:l,onOpenAutoFocus:et(a.onOpenAutoFocus,d=>{var h;d.preventDefault(),(h=u.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:d=>d.preventDefault(),onInteractOutside:d=>d.preventDefault(),children:[s.jsx(iEe,{children:n}),s.jsx(lEe,{contentRef:o})]})})})});Jq.displayName=nu;var eW="AlertDialogTitle",tW=w.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Ni(r);return s.jsx(nm,{...a,...n,ref:e})});tW.displayName=eW;var rW="AlertDialogDescription",nW=w.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Ni(r);return s.jsx(am,{...a,...n,ref:e})});nW.displayName=rW;var oEe="AlertDialogAction",aW=w.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,a=Ni(r);return s.jsx(ax,{...a,...n,ref:e})});aW.displayName=oEe;var sW="AlertDialogCancel",iW=w.forwardRef((t,e)=>{const{__scopeAlertDialog:r,...n}=t,{cancelRef:a}=sEe(sW,r),i=Ni(r),o=Nt(e,a);return s.jsx(ax,{...i,...n,ref:o})});iW.displayName=sW;var lEe=({contentRef:t})=>{const e=`\`${nu}\` requires a description for the component to be accessible for screen reader users. 1161 1162You can add a description to the \`${nu}\` by passing a \`${rW}\` component as a child, which also benefits sighted users by adding visible context to the dialog. 1163 1164Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${nu}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. 1165 1166For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var n;document.getElementById((n=t.current)==null?void 0:n.getAttribute("aria-describedby"))||console.warn(e)},[e,t]),null},cEe=Xq,uEe=Zq,oW=Qq,lW=Jq,cW=aW,uW=iW,dW=tW,fW=nW;const dEe=cEe,fEe=uEe,hW=w.forwardRef(({className:t,...e},r)=>s.jsx(oW,{className:Qe("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:r}));hW.displayName=oW.displayName;const mW=w.forwardRef(({className:t,...e},r)=>s.jsxs(fEe,{children:[s.jsx(hW,{}),s.jsx(lW,{ref:r,className:Qe("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...e})]}));mW.displayName=lW.displayName;const pW=({className:t,...e})=>s.jsx("div",{className:Qe("flex flex-col space-y-2 text-center sm:text-left",t),...e});pW.displayName="AlertDialogHeader";const gW=({className:t,...e})=>s.jsx("div",{className:Qe("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...e});gW.displayName="AlertDialogFooter";const vW=w.forwardRef(({className:t,...e},r)=>s.jsx(dW,{ref:r,className:Qe("text-lg font-semibold",t),...e}));vW.displayName=dW.displayName;const xW=w.forwardRef(({className:t,...e},r)=>s.jsx(fW,{ref:r,className:Qe("text-sm text-muted-foreground",t),...e}));
1166xW.displayName=fW.displayName;const yW=w.forwardRef(({className:t,...e},r)=>s.jsx(cW,{ref:r,className:Qe(Xk(),t),...e}));yW.displayName=cW.displayName;const bW=w.forwardRef(({className:t,...e},r)=>s.jsx(uW,{ref:r,className:Qe(Xk({variant:"outline"}),"mt-2 sm:mt-0",t),...e}));bW.displayName=uW.displayName;const IL=[{value:"border-slate-500",label:"Cinza",preview:"bg-slate-500"},{value:"border-red-500",label:"Ciano",preview:"bg-red-500"},{value:"border-violet-500",label:"Violeta",preview:"bg-violet-500"},{value:"border-orange-500",label:"Laranja",preview:"bg-orange-500"},{value:"border-emerald-500",label:"Verde",preview:"bg-emerald-500"},{value:"border-red-500",label:"Vermelho",preview:"bg-red-500"},{value:"border-blue-500",label:"Azul",preview:"bg-blue-500"},{value:"border-yellow-500",label:"Amarelo",preview:"bg-yellow-500"},{value:"border-pink-500",label:"Rosa",preview:"bg-pink-500"},{value:"border-indigo-500",label:"Ãndigo",preview:"bg-indigo-500"}];function hEe({open:t,onClose:e,onSave:r}){const[n,a]=w.useState([]),[i,o]=w.useState(!1),[l,u]=w.useState(null),[d,h]=w.useState(""),[m,p]=w.useState(""),[v,b]=w.useState(!1),[y,x]=w.useState(""),[j,N]=w.useState(""),[S,k]=w.useState("border-slate-500"),[C,A]=w.useState(!1),[T,R]=w.useState(""),[I,D]=w.useState(null),[L,z]=w.useState([]),[H,Z]=w.useState(""),[te,G]=w.useState(null);w.useEffect(()=>{t&&M()},[t]);const M=async()=>{o(!0);try{const Q=await Ge.fetchPipelineStages();a(Q)}catch{xe.error("Erro ao carregar etapas")}finally{o(!1)}},F=Q=>{u(Q.id),h(Q.title),p(Q.color),b(Q.isAiManaged),x(Q.aiTriggerCriteria||"")},K=async()=>{if(l)try{await Ge.updatePipelineStage(l,{title:d,color:m,isAiManaged:v,aiTriggerCriteria:y||null}),xe.success("Etapa atualizada"),u(null),M(),r==null||r()}catch{xe.error("Erro ao atualizar etapa")}},B=()=>{u(null),h(""),p(""),b(!1),x("")},O=async Q=>{var pe;try{if((await Ge.fetchPipeline()).filter(oe=>oe.stageId===Q.id).length>0){const oe=n.filter(re=>re.id!==Q.id);z(oe),Z(((pe=oe[0])==null?void 0:pe.id)||""),D({stageId:Q.id,stageName:Q.title})}else await Ge.deletePipelineStage(Q.id),xe.success("Etapa removida"),M(),r==null||r()}catch{xe.error("Erro ao verificar deals")}},W=async()=>{if(I)try{await Ge.deletePipelineStage(I.stageId,H),xe.success("Etapa removida e deals realocados"),D(null),Z(""),M(),r==null||r()}catch{xe.error("Erro ao remover etapa")}},q=async()=>{if(!j.trim()){xe.error("Digite um nome para a etapa");return}try{await Ge.createPipelineStage({title:j,color:S,isAiManaged:C,aiTriggerCriteria:T||void 0}),xe.success("Etapa criada"),N(""),k("border-slate-500"),A(!1),R(""),M(),r==null||r()}catch{xe.error("Erro ao criar etapa")}},se=Q=>{G(Q)},me=(Q,pe)=>{if(Q.preventDefault(),te===null||te===pe)return;const V=[...n],J=V[te];V.splice(te,1),V.splice(pe,0,J),a(V),G(pe)},fe=async()=>{if(te!==null)try{const Q=n.map(pe=>pe.id);await Ge.reorderPipelineStages(Q),xe.success("Ordem atualizada"),r==null||r()}catch{xe.error("Erro ao reordenar etapas"),M()}finally{G(null)}};return s.jsxs(s.Fragment,{children:[s.jsx(Ll,{open:t,onOpenChange:e,children:s.jsxs(bo,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[s.jsx(wo,{children:s.jsx(_o,{children:"âï¸ Configurar Pipeline"})}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"space-y-2",children:i?s.jsx("p",{className:"text-sm text-muted-foreground",children:"Carregando..."}):n.map((Q,pe)=>s.jsxs("div",{draggable:!0,onDragStart:()=>se(pe),onDragOver:V=>me(V,pe),onDragEnd:fe,className:`flex items-center gap-3 p-3 border rounded-lg bg-card cursor-move hover:bg-accent/50 transition-colors ${te===pe?"opacity-50":""}`,children:[s.jsx(uY,{className:"w-5 h-5 text-muted-foreground"}),s.jsx("div",{className:`w-3 h-3 rounded-full ${Q.color.replace("border-","bg-")}`}),l===Q.id?s.jsxs("div",{className:"flex-1 space-y-2",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx(kt,{value:d,onChange:V=>h(V.target.value),className:"flex-1",placeholder:"Nome da etapa"}),s.jsxs(Qn,{value:m,onValueChange:p,children:[s.jsx(Mn,{className:"w-32",children:s.jsx(Jn,{})}),s.jsx(Rn,{children:IL.map(V=>s.jsx(on,{value:V.value,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${V.preview}`}),V.label]})},V.value))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(pt,{className:"text-xs text-muted-foreground",children:"Tipo de Estágio:"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(zn,{type:"button",size:"sm",variant:v?"outline":"default",onClick:()=>b(!1),className:"flex-1",children:[s.jsx(mn,{className:"w-3 h-3 mr-1"}),"Manual"]}),s.jsxs(zn,{type:"button",size:"sm",variant:v?"default":"outline",onClick:()=>b(!0),className:"flex-1",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Automático"]})]})]}),v&&s.jsxs("div",{children:[s.jsx(pt,{className:"text-xs text-muted-foreground",children:"Critérios para IA mover para este estágio:"}),s.jsx(Dh,{value:y,onChange:V=>x(V.target.value),placeholder:"Ex: Lead demonstrou interesse claro e pediu demonstração...",className:"h-20 text-sm resize-none"})]}),s.jsxs("div",{className:"flex gap-2 justify-end",children:[s.jsx(zn,{size:"sm",onClick:K,children:"Salvar"}),s.jsx(zn,{size:"sm",variant:"ghost",onClick:B,children:"Cancelar"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1",children:[Q.isAiManaged?Q.aiTriggerCriteria?s.jsx("div",{title:"Estágio automático com critério configurado",children:s.jsx(Or,{className:"w-4 h-4 text-blue-500"})}):s.jsx("div",{title:"Estágio automático sem critério - IA não sabe quando usar",children:s.jsx(ei,{className:"w-4 h-4 text-yellow-500"})}):s.jsx("div",{title:"Estágio manual - apenas movimentação humana",children:s.jsx(mn,{className:"w-4 h-4 text-muted-foreground"})}),s.jsx("span",{className:"font-medium",children:Q.title})]}),s.jsx(zn,{size:"sm",variant:"ghost",onClick:()=>F(Q),children:s.jsx(yg,{className:"w-4 h-4"})}),Q.isSystem?s.jsx(zn,{size:"sm",variant:"ghost",disabled:!0,title:"Etapa de sistema não pode ser deletada",children:s.jsx(xg,{className:"w-4 h-4 text-muted-foreground"})}):s.jsx(zn,{size:"sm",variant:"ghost",onClick:()=>O(Q),children:s.jsx(cu,{className:"w-4 h-4 text-destructive"})})]})]},Q.id))}),s.jsxs("div",{className:"border-t pt-4 space-y-3",children:[s.jsx(pt,{className:"text-sm font-medium",children:"Nova Etapa"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(kt,{value:j,onChange:Q=>N(Q.target.value),placeholder:"Nome da etapa",className:"flex-1"}),s.jsxs(Qn,{value:S,onValueChange:k,children:[s.jsx(Mn,{className:"w-32",children:s.jsx(Jn,{})}),s.jsx(Rn,{children:IL.map(Q=>s.jsx(on,{value:Q.value,children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${Q.preview}`}),Q.label]})},Q.value))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(pt,{className:"text-xs text-muted-foreground",children:"Tipo de Estágio:"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsxs(zn,{type:"button",size:"sm",variant:C?"outline":"default",onClick:()=>A(!1),className:"flex-1",children:[s.jsx(mn,{className:"w-3 h-3 mr-1"}),"Manual"]}),s.jsxs(zn,{type:"button",size:"sm",variant:C?"default":"outline",onClick:()=>A(!0),className:"flex-1",children:[s.jsx(Or,{className:"w-3 h-3 mr-1"}),"Automático"]})]})]}),C&&s.jsxs("div",{children:[s.jsx(pt,{className:"text-xs text-muted-foreground",children:"Critérios para IA mover para este estágio:"}),s.jsx(Dh,{value:T,onChange:Q=>R(Q.target.value),placeholder:"Ex: Lead demonstrou interesse claro e pediu demonstração...",className:"h-20 text-sm resize-none"})]}),s.jsxs(zn,{onClick:q,className:"w-full",children:[s.jsx(ts,{className:"w-4 h-4 mr-1"}),"Adicionar Etapa"]}
1166)]})]})]})}),s.jsx(dEe,{open:!!I,onOpenChange:()=>D(null),children:s.jsxs(mW,{children:[s.jsxs(pW,{children:[s.jsxs(vW,{children:['Remover etapa "',I==null?void 0:I.stageName,'"?']}),s.jsx(xW,{children:"Existem deals nesta etapa. Para onde você deseja movê-los?"})]}),s.jsxs("div",{className:"my-4",children:[s.jsx(pt,{children:"Mover deals para:"}),s.jsxs(Qn,{value:H,onValueChange:Z,children:[s.jsx(Mn,{children:s.jsx(Jn,{placeholder:"Selecione uma etapa"})}),s.jsx(Rn,{children:L.map(Q=>s.jsx(on,{value:Q.id,children:Q.title},Q.id))})]})]}),s.jsxs(gW,{children:[s.jsx(bW,{children:"Cancelar"}),s.jsx(yW,{onClick:W,disabled:!H,children:"Confirmar"})]})]})})]})}const mEe=()=>{const{sdrName:t}=Yu(),[e,r]=w.useState([]),[n,a]=w.useState([]),[i,o]=w.useState(!0),[l,u]=w.useState(""),[d,h]=w.useState(null),[m,p]=w.useState("note"),[v,b]=w.useState(!1),[y,x]=w.useState(!1),[j,N]=w.useState(!1),[S,k]=w.useState([]),[C,A]=w.useState([]),[T,R]=w.useState(!1),[I,D]=w.useState(""),[L,z]=w.useState(""),[H,Z]=w.useState([]),[te,G]=w.useState(!1),M=w.useRef(null),F=async()=>{const ee=await Ge.fetchPipeline();r(ee)};w.useEffect(()=>{(async()=>{try{const ke=await Ge.fetchPipelineStages();a(ke)}catch(ke){console.error("Erro ao carregar etapas",ke)}})(),(async()=>{try{const ke=await Ge.fetchPipeline();r(ke)}catch(ke){console.error("Erro ao carregar pipeline",ke)}finally{o(!1)}})(),(async()=>{try{const ke=await Ge.fetchTeam();k(ke)}catch(ke){console.error("Erro ao carregar membros da equipe",ke)}})();const de=ve.channel("deals-changes").on("postgres_changes",{event:"*",schema:"public",table:"deals"},async()=>{const ke=await Ge.fetchPipeline();r(ke)}).subscribe(),we=ve.channel("pipeline-stages-changes").on("postgres_changes",{event:"*",schema:"public",table:"pipeline_stages"},async()=>{const ke=await Ge.fetchPipelineStages();a(ke)}).subscribe();return()=>{ve.removeChannel(de),ve.removeChannel(we)}},[]),w.useEffect(()=>{d&&B()},[d==null?void 0:d.id]),w.useEffect(()=>{d!=null&&d.conversationId?K():Z([])},[d==null?void 0:d.conversationId]);const K=async()=>{if(d!=null&&d.conversationId){G(!0);try{const ee=await Ge.fetchConversationMessages(d.conversationId,15);Z(ee)}catch(ee){console.error("Erro ao carregar mensagens",ee)}finally{G(!1)}}},B=async()=>{if(d){R(!0);try{const ee=await Ge.fetchDealActivities(d.id);A(ee)}catch(ee){console.error("Erro ao carregar atividades",ee)}finally{R(!1)}}},O=async()=>{if(d)try{await Ge.markDealWon(d.id),xe.success("Deal marcado como ganho! Parabéns pelo fechamento!"),h(null)}catch(ee){console.error("Erro ao marcar deal como ganho",ee),xe.error("Não foi possÃvel marcar como ganho")}},W=async ee=>{if(d)try{await Ge.markDealLost(d.id,ee),xe.success("Deal marcado como perdido. Motivo registrado."),h(null)}catch(ce){console.error("Erro ao marcar deal como perdido",ce),xe.error("Não foi possÃvel marcar como perdido")}},q=async ee=>{if(d)try{await Ge.updateDealOwner(d.id,ee);const ce=S.find(je=>je.id===ee);h({...d,ownerId:ee,ownerName:ce==null?void 0:ce.name}),xe.success("Proprietário atualizado")}catch(ce){console.error("Erro ao atualizar proprietário",ce),xe.error("Não foi possÃvel atualizar proprietário")}},se=async()=>{if(!(!d||!I.trim()))try{await Ge.createDealActivity({dealId:d.id,type:m==="activity"?"call":m==="email"?"email":"note",title:I,description:L}),D(""),z(""),B(),xe.success("Atividade criada")}catch(ee){console.error("Erro ao criar atividade",ee),xe.error("Não foi possÃvel criar atividade")}},me=async(ee,ce)=>{try{await Ge.updateDealActivity(ee,{isCompleted:!ce}),B()}catch(je){console.error("Erro ao atualizar atividade",je)}},fe=async ee=>{try{await Ge.deleteDealActivity(ee),B(),xe.success("Atividade excluÃda")}catch(ce){console.error("Erro ao excluir atividade",ce)}},Q=ee=>new Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL"}).format(ee),pe=(ee,ce)=>{M.current=ce,ee.dataTransfer.effectAllowed="move",ee.target.style.opacity="0.5"},V=ee=>{M.current=null,ee.target.style.opacity="1"},J=ee=>{ee.preventDefault()},oe=async(ee,ce)=>{ee.preventDefault();const je=M.current;if(!je)return;const de=e.map(we=>we.id===je?{...we,stageId:ce}:we);r(de);try{await Ge.moveDealStage(je,ce)}catch(we){console.error("Error moving deal:",we);const ke=await Ge.fetchPipeline();r(ke)}},re=e.filter(ee=>ee.title.toLowerCase().includes(l.toLowerCase())||ee.company.toLowerCase().includes(l.toLowerCase())),Me=ee=>{switch(ee){case"high":return"bg-red-500/10 text-red-400 border-red-500/20";case"medium":return"bg-amber-500/10 text-amber-400 border-amber-500/20";default:return"bg-emerald-500/10 text-emerald-400 border-emerald-500/20"}};return i?s.jsx("div",{className:"flex items-center justify-center h-full bg-slate-950",children:s.jsx(gt,{className:"h-8 w-8 animate-spin text-red-500"})}):s.jsxs("div",{className:"h-full flex flex-col bg-slate-950 text-slate-50 p-6 overflow-hidden relative",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between mb-8 gap-4 flex-shrink-0",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-3xl font-bold tracking-tight text-white",children:"Pipeline de Vendas"}),s.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Gerencie oportunidades e acompanhe o fluxo de receita."})]}),s.jsxs("div",{className:"flex gap-3 w-full sm:w-auto",children:[s.jsxs("div",{className:"relative flex-1 sm:w-64",children:[s.jsx(Gu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500"}),s.jsx("input",{type:"text",placeholder:"Buscar oportunidade...",value:l,onCh
1166ange:ee=>u(ee.target.value),className:"w-full pl-9 pr-4 py-2 bg-slate-900 border border-slate-800 rounded-lg text-sm text-slate-200 focus:ring-1 focus:ring-red-500 outline-none placeholder:text-slate-600"})]}),s.jsxs(Ne,{variant:"outline",className:"border-slate-700 text-slate-300 hover:bg-slate-800",onClick:()=>N(!0),children:[s.jsx(r0,{className:"w-4 h-4 mr-2"}),"Configurar"]}),s.jsxs(Ne,{className:"shadow-lg shadow-red-500/20",onClick:()=>b(!0),children:[s.jsx(ts,{className:"w-4 h-4 mr-2"}),"Novo Deal"]})]})]}),s.jsx("div",{className:"flex-1 overflow-x-auto overflow-y-hidden pb-4",children:s.jsx("div",{className:"flex h-full gap-4 min-w-max",children:n.map(ee=>{const ce=re.filter(ke=>ke.stageId===ee.id),je=ce.reduce((ke,Y)=>ke+Y.value,0),de=ee.title==="Ganho",we=ee.title==="Perdido";return s.jsxs("div",{className:`w-72 flex flex-col h-full rounded-xl border backdrop-blur-sm ${de?"bg-emerald-950/40 border-emerald-700/50":we?"bg-red-950/40 border-red-700/50":"bg-slate-900/30 border-slate-800/50"}`,onDragOver:J,onDrop:ke=>oe(ke,ee.id),children:[s.jsxs("div",{className:`p-3 border-b flex flex-col gap-1 rounded-t-xl ${de?"bg-emerald-500/20 border-emerald-700/50 border-t-4 border-t-emerald-500":we?"bg-red-500/20 border-red-700/50 border-t-4 border-t-red-500":`border-slate-800/50 border-t-2 ${ee.color}`}`,children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("h3",{className:`font-bold text-xs uppercase tracking-wide flex items-center gap-1.5 ${de?"text-emerald-300":we?"text-red-300":"text-slate-200"}`,children:[ee.isAiManaged&&s.jsx("span",{title:"Gerenciado pela IA",children:s.jsx(Or,{className:"w-3 h-3 text-red-400"})}),ee.title]}),s.jsx("span",{className:`text-[10px] px-2 py-0.5 rounded-full font-mono ${de?"bg-emerald-900/50 text-emerald-400":we?"bg-red-900/50 text-red-400":"bg-slate-800 text-slate-400"}`,children:ce.length})]}),s.jsxs("div",{className:"text-[10px] text-slate-500 font-medium",children:["Total: ",s.jsx("span",{className:de?"text-emerald-300":we?"text-red-300":"text-slate-300",children:Q(je)})]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 custom-scrollbar",children:ce.map(ke=>s.jsxs("div",{draggable:!0,onDragStart:Y=>pe(Y,ke.id),onDragEnd:V,onClick:()=>h(ke),className:"bg-slate-900 border border-slate-800 rounded-lg p-3 shadow-sm cursor-grab active:cursor-grabbing hover:border-red-500/50 hover:shadow-red-500/10 transition-all group relative",children:[s.jsxs("div",{className:"flex justify-between items-start mb-1.5",children:[s.jsx("span",{className:`text-[9px] px-1.5 py-0.5 rounded border font-medium ${Me(ke.priority)}`,children:ke.priority==="high"?"Alta":ke.priority==="medium"?"Média":"Baixa"}),s.jsx("button",{className:"text-slate-600 hover:text-white transition-colors opacity-0 group-hover:opacity-100",children:s.jsx(x8,{className:"w-3.5 h-3.5"})})]}),s.jsx("h4",{className:"font-semibold text-white text-sm mb-0.5 leading-tight",children:ke.title}),s.jsx("p",{className:"text-[10px] text-slate-400 mb-2",children:ke.company}),s.jsx("div",{className:"flex items-center gap-1.5 mb-2 flex-wrap",children:ke.tags.map(Y=>s.jsxs("span",{className:"text-[9px] text-slate-500 bg-slate-800 px-1.5 py-0.5 rounded flex items-center gap-1",children:[s.jsx(AY,{className:"w-2.5 h-2.5"})," ",Y]},Y))}),s.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-800",children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-slate-300 text-xs font-bold",children:[s.jsx(g8,{className:"w-3 h-3 text-emerald-500"}),Q(ke.value)]}),s.jsxs("div",{className:"flex items-center gap-2",children:[ke.dueDate&&s.jsxs("div",{className:"text-[9px] text-slate-500 flex items-center gap-1",title:"Data de previsão",children:[s.jsx(JK,{className:"w-3 h-3"}),new Date(ke.dueDate).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"})]}),s.jsx("img",{src:ke.ownerAvatar,alt:"Owner",className:"w-5 h-5 rounded-full border border-slate-700"})]})]})]},ke.id))})]},ee.id)})})}),d&&s.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-40 transition-opacity",onClick:()=>h(null)}),s.jsx("div",{className:`fixed top-0 right-0 h-full w-full max-w-2xl bg-slate-950 border-l border-slate-800 shadow-2xl z-50 transform transition-transform duration-300 ease-in-out flex flex-col ${d?"translate-x-0":"translate-x-full"}`,children:d&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex-shrink-0 bg-slate-900 border-b border-slate-800",children:[s.jsxs("div",{className:"p-6 pb-4 flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-white mb-1",children:d.title}),s.jsxs("div",{className:"flex items-center gap-2 text-slate-400 text-sm flex-wrap",children:[s.jsx("span",{className:"font-semibold text-emerald-400",children:Q(d.value)}),s.jsx("span",{className:"w-1 h-1 rounded-full bg-slate-600"}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(f8,{className:"w-3 h-3"})," ",d.company]}),s.jsx("span",{className:"w-1 h-1 rounded-full bg-slate-600"}),s.jsxs(Qn,{value:d.ownerId||"",onValueChange:q,children:[s.jsx(Mn,{className:"w-[180px] h-7 text-xs bg-slate-800 border-slate-700",children:s.jsx(Jn,{placeholder:"Selecione proprietário",children:s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx(mn,{className:"w-3 h-3"}),d.ownerName||"Sem proprietário"]})})}),s.jsx(Rn,{children:S.map(ee=>s.jsx(on,{value:ee.id,children:ee.name},ee.id))})]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Ne,{variant:"secondary",onClick:O,className:"bg-emerald-500/10 hover:bg-emerald-500/20 border-emerald-500/20 text-emerald-400",children:"Ganho"}),s.jsx(Ne,{variant:"secondary",onClick:()=>x(!0),className:"bg-red-500/10 hover:bg-red-500/20 border-red-500/20 text-red-400",children:"Perdido"}),s.jsx("button",{onClick:()=>h(null),className:"p-2 hover:bg-slate-800 rounded-lg text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-6 h-6"})})]})]}),s.jsx("div",{className:"px-6 pb-6 overflow-x-auto",children:s.jsx("div",{className:"flex items-center gap-1 w-full min-w-max",children:n.map((ee,ce)=>{const je=n.findIndex(ke=>
1166ke.id===d.stageId),de=ce<je,we=ce===je;return s.jsxs("div",{className:`flex-1 h-8 flex items-center justify-center px-2 relative cursor-pointer group transition-all first:rounded-l-md last:rounded-r-md 1167 ${de?"bg-emerald-500/20 text-emerald-400 hover:bg-emerald-500/30":we?"bg-red-600 text-white shadow-lg shadow-red-500/20":"bg-slate-800 text-slate-500 hover:bg-slate-700 hover:text-slate-300"} 1168 `,onClick:async()=>{const ke=ee.title==="Ganho",Y=ee.title==="Perdido";if(ke)try{await Ge.markDealWon(d.id),xe.success("Deal marcado como ganho!"),r(e.map(ne=>ne.id===d.id?{...ne,stageId:ee.id,wonAt:new Date().toISOString()}:ne)),h({...d,stageId:ee.id})}catch(ne){console.error("Error marking deal as won:",ne),xe.error("Erro ao marcar como ganho")}else if(Y)x(!0);else{r(e.map(ne=>ne.id===d.id?{...ne,stageId:ee.id}:ne)),h({...d,stageId:ee.id});try{await Ge.moveDealStage(d.id,ee.id)}catch(ne){console.error("Error moving deal:",ne)}}},children:[s.jsx("span",{className:"text-xs font-bold whitespace-nowrap z-10",children:ee.title}),ce!==n.length-1&&s.jsx("div",{className:"absolute right-0 top-0 bottom-0 w-[1px] bg-slate-950/20 z-20"})]},ee.id)})})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto bg-slate-950 custom-scrollbar",children:[s.jsxs("div",{className:"p-6 border-b border-slate-800 bg-slate-900/30",children:[s.jsxs("div",{className:"flex gap-4 mb-4",children:[s.jsxs("button",{onClick:()=>p("note"),className:`flex items-center gap-2 text-sm font-medium transition-colors ${m==="note"?"text-red-400":"text-slate-400 hover:text-white"}`,children:[s.jsx("div",{className:`p-2 rounded-full ${m==="note"?"bg-red-500/10":"bg-slate-800"}`,children:s.jsx(ZT,{className:"w-4 h-4"})}),"Nota"]}),s.jsxs("button",{onClick:()=>p("activity"),className:`flex items-center gap-2 text-sm font-medium transition-colors ${m==="activity"?"text-amber-400":"text-slate-400 hover:text-white"}`,children:[s.jsx("div",{className:`p-2 rounded-full ${m==="activity"?"bg-amber-500/10":"bg-slate-800"}`,children:s.jsx(Ya,{className:"w-4 h-4"})}),"Atividade"]}),s.jsxs("button",{onClick:()=>p("email"),className:`flex items-center gap-2 text-sm font-medium transition-colors ${m==="email"?"text-violet-400":"text-slate-400 hover:text-white"}`,children:[s.jsx("div",{className:`p-2 rounded-full ${m==="email"?"bg-violet-500/10":"bg-slate-800"}`,children:s.jsx(iu,{className:"w-4 h-4"})}),"Email"]})]}),s.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-xl overflow-hidden focus-within:ring-1 focus-within:ring-red-500/50 transition-all shadow-inner",children:[s.jsx("input",{type:"text",className:"w-full bg-transparent p-3 text-sm text-slate-200 placeholder:text-slate-600 outline-none border-b border-slate-800",placeholder:"TÃtulo da atividade",value:I,onChange:ee=>D(ee.target.value)}),s.jsx("textarea",{className:"w-full bg-transparent p-4 text-sm text-slate-200 placeholder:text-slate-600 outline-none resize-none min-h-[80px]",placeholder:m==="note"?"Escreva uma nota...":m==="activity"?"Descreva a atividade...":"Escreva o corpo do email...",value:L,onChange:ee=>z(ee.target.value)}),s.jsxs("div",{className:"px-3 py-2 bg-slate-950/50 border-t border-slate-800 flex justify-between items-center",children:[s.jsx("div",{className:"flex gap-2",children:s.jsx("button",{className:"p-1.5 hover:bg-slate-800 rounded text-slate-400 hover:text-red-400 transition-colors",children:s.jsx(_8,{className:"w-4 h-4"})})}),s.jsx(Ne,{size:"sm",className:"h-8",onClick:se,disabled:!I.trim(),children:"Salvar"})]})]})]}),s.jsxs("div",{className:"p-6",children:[s.jsxs("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider mb-6 flex items-center gap-2",children:[s.jsx(oo,{className:"w-3.5 h-3.5"})," Atividades (",C.length,")"]}),T?s.jsx("div",{className:"flex justify-center py-8",children:s.jsx(gt,{className:"w-6 h-6 animate-spin text-red-500"})}):C.length===0?s.jsx("div",{className:"text-center py-8 text-slate-500 text-sm",children:"Nenhuma atividade registrada"}):s.jsx("div",{className:"space-y-3",children:C.map(ee=>{const ce=ee.type==="call"?Hu:ee.type==="email"?iu:ee.type==="meeting"?Ya:ee.type==="task"?EY:ZT,je=ee.type==="call"?"text-amber-500 bg-amber-500/10":ee.type==="email"?"text-violet-500 bg-violet-500/10":ee.type==="meeting"?"text-red-500 bg-red-500/10":ee.type==="task"?"text-emerald-500 bg-emerald-500/10":"text-slate-500 bg-slate-500/10",de=ce;return s.jsxs("div",{className:"flex items-start gap-3 p-3 rounded-xl bg-slate-900/50 border border-slate-800 hover:border-slate-700 transition-all group",children:[s.jsx("button",{onClick:()=>me(ee.id,ee.isCompleted),className:"mt-0.5 text-slate-500 hover:text-emerald-500 transition-colors",children:ee.isCompleted?s.jsx(Lr,{className:"w-5 h-5 text-emerald-500"}):s.jsx(m8,{className:"w-5 h-5"})}),s.jsx("div",{className:`p-1.5 rounded ${je}`,children:s.jsx(de,{className:"w-3.5 h-3.5"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:`text-sm font-medium transition-colors ${ee.isCompleted?"text-slate-500 line-through":"text-slate-200 group-hover:text-white"}`,children:ee.title}),ee.description&&s.jsx("p",{className:"text-xs text-slate-500 mt-1",children:ee.description}),s.jsxs("p",{className:"text-[10px] text-slate-600 mt-1",children:[new Date(ee.createdAt).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"}),ee.createdByName&&` ⢠${ee.createdByName}`]})]}),s.jsx("button",{onClick:()=>fe(ee.id),className:"opacity-0 group-hover:opacity-100 p-1 hover:bg-red-500/10 rounded text-slate-500 hover:text-red-500 transition-all",children:s.jsx(cu,{className:"w-4 h-4"})})]},ee.id)})})]}),d.clientMemory&&s.jsxs("div",{className:"p-6 border-t border-slate-800",children:[s.jsxs("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider mb-4 flex items-center gap-2",children:[s.jsx(d8,{className:"w-4 h-4 text-violet-500"})," Insights do(a) ",t]}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"p-3 rounded-lg bg-slate-900/50 border border-slate-800",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Score de Qualificação"}),s.jsxs("span",{className:"text-sm font-bold text-red-400",children:[d.clientMemory.lead_profile.qualification_score||0,"%"]})]}),s.jsx("div",{className:"w-full bg-slate-800 rounded-full h-1.5",children:s.jsx("div",{className:"bg-gradient-to-r from-red-500 to-violet-500 h-1.5 rounded-full transition-all",style:{width:`${d.clientMemory.lead_profile.qualification_score||0}%`}})})]}),s.jsxs("div",{className:"p-3 rounded-lg bg-slate-900/50 border border-slate-800",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Próxima Ação Sugerida"}),s.jsx("p",{className:"text-sm text-red-400 mt-1 font-medium",children:d.clientMemory.sales_intelligence.next_best_action==="qualify"?"ð Qualificar lead":d.clientMemory.sales_intelligence.next_best_action==="demo"?"ð¯ Agendar demonstração":d.clientMemory.sales_intelligence.next_best_action==="follow_up"?"ð Fazer follow-up":d.clientMemory.sales_intelligence.next_best_action})]}),d.clientMemory.lead_profile.interests.length>0&&s.jsxs("div",{className:"p-3 rounded-lg bg-slate-900/50 border border-slate-800",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Interesses"}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:d.clientMemory.lead_profile.interests.map((ee,ce)=>s.jsx("span",{className:"px-2 py-0.5 bg-emerald-500/10 text-emerald-400 text-xs rounded-md border border-emerald-500/20",children:ee},ce))})]}),d.clientMemory.sales_intelligence.pain_points.length>0&&s.jsxs("div",{className:"p-3 rounded-lg bg-slate-900/50 border border-slate-800",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Dores Identificadas"}),s.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:d.clientMemory.sales_intelligence.pain_points.map((ee,ce)=>s.jsx("span",{className:"px-2 py-0.5 bg-red-500/10 text-red-400 text-xs rounded-md border border-red-500/20",children:ee},ce))})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("div",{className:"p-3 rounded-lg bg-slate-900/50 border border-slate-800",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Orçamento"}),s.jsxs("p",{className:"text-sm text-slate-200 mt-1 font-medium",children:["ð° ",d.clientMemory.sales_intelligence.budget_indication==="unknown"?"Não informado":d.clientMemory.sales_intelligence.budget_indication]})]}),s.jsxs("div",{className:"p-3 rounded-lg bg-slate-900/50 border border-slate-800",children:[s.jsx("span",{className:"text-xs text-slate-400",children:"Timeline"}),s.jsxs("p",{className:"text-sm text-slate-200 mt-1 font-medium",children:["â° ",d.clientMemory.sales_intelligence.decision_timeline==="unknown"?"Não definido":d.clientMemory.sales_intelligence.decision_timeline]})]})]})]})]}),d.conversationId&&s.jsxs("div",{className:"p-6 border-t border-slate-800",children:[s.jsxs("h4",{className:"text-xs font-bold text-slate-500 uppercase tracking-wider mb-4 flex items-center gap-2",children:[s.jsx(Tn,{className:"w-4 h-4 text-red-500"}),"Ãltimas Mensagens (",H.length,")"]}),te?s.jsx("div",{className:"flex justify-center py-4",children:s.jsx(gt,{className:"w-5 h-5 animate-spin text-red-500"})}):H.length===0?s.jsx("div",{className:"text-center py-4 text-slate-500 text-sm",children:"Nenhuma mensagem encontrada"}):s.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto custom-scrollbar",children:H.map(ee=>s.jsxs("div",{className:`p-2 rounded-lg text-sm ${ee.from_type==="user"?"bg-slate-800 text-slate-200 ml-0 mr-8":ee.from_type==="nina"?"bg-red-900/30 text-red-100 ml-8 mr-0":"bg-emerald-900/30 text-emerald-100 ml-8 mr-0"}`,children:[s.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-slate-500 mb-1",children:[s.jsx("span",{className:"font-medium",children:ee.from_type==="user"?"ð¤ Lead":ee.from_type==="nina"?`ð¤ ${t}`:"ð¨âð¼ Humano"}),s.jsx("span",{children:"â¢"}
1168),s.jsx("span",{children:new Date(ee.sent_at).toLocaleString("pt-BR",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})})]}),s.jsx("p",{className:"leading-relaxed line-clamp-3",children:ee.content||"[mÃdia]"})]},ee.id))}),s.jsxs(Ne,{className:"w-full mt-3 bg-violet-600 hover:bg-violet-700",onClick:()=>window.location.href=`/chat?conversation=${d.conversationId}`,children:[s.jsx(Tn,{className:"w-4 h-4 mr-2"}),"Ver Conversa Completa"]})]})]})]})}),s.jsx(Yke,{open:v,onOpenChange:b,onDealCreated:F}),s.jsx(Xke,{open:y,onOpenChange:x,onConfirm:W,dealTitle:(d==null?void 0:d.title)||""}),s.jsx(hEe,{open:j,onClose:()=>N(!1),onSave:async()=>{const ee=await Ge.fetchPipelineStages();a(ee)}})]})},pEe=Br().email("Email inválido"),gEe=Br().min(1,"Informe sua senha"),vEe=()=>{const[t,e]=w.useState(""),[r,n]=w.useState(""),[a,i]=w.useState(!1),[o,l]=w.useState({}),{signIn:u,user:d,loading:h}=Na(),{isCoordinator:m,loading:p}=zl(),v=Wu();w.useEffect(()=>{!h&&!p&&d&&v(m?"/leads-campanha":"/dashboard",{replace:!0})},[d,h,p,m,v]);const b=()=>{const x={},j=pEe.safeParse(t);j.success||(x.email=j.error.errors[0].message);const N=gEe.safeParse(r);return N.success||(x.password=N.error.errors[0].message),l(x),Object.keys(x).length===0},y=async x=>{if(x.preventDefault(),!!b()){i(!0);try{const{error:j}=await u(t,r);if(j){j.message.includes("Invalid login credentials")?xe.error("Email ou senha incorretos"):j.message.includes("Email not confirmed")?xe.error("Por favor, confirme seu email antes de fazer login"):xe.error(j.message);return}xe.success("Login realizado com sucesso!")}finally{i(!1)}}};return h?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsx(gt,{className:"h-8 w-8 animate-spin text-primary"})}):s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4 relative overflow-hidden",children:s.jsxs("div",{className:"w-full max-w-md relative z-10",children:[s.jsxs("div",{className:"text-center mb-8",children:[s.jsx("img",{src:WC,alt:"Inovacell",className:"mx-auto mb-4 h-20 w-64 object-contain object-center"}),s.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Bem-vindo de volta"}),s.jsx("p",{className:"text-muted-foreground mt-2",children:"Entre para acessar sua plataforma"})]}),s.jsx("div",{className:"bg-card border border-border rounded-2xl p-8 shadow-xl",children:s.jsxs("form",{onSubmit:y,className:"space-y-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"email",className:"text-foreground",children:"Email"}),s.jsxs("div",{className:"relative",children:[s.jsx(iu,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(kt,{id:"email",type:"email",placeholder:"[email protected]",value:t,onChange:x=>e(x.target.value),className:"pl-10"})]}),o.email&&s.jsx("p",{className:"text-sm text-destructive",children:o.email})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"password",className:"text-foreground",children:"Senha"}),s.jsxs("div",{className:"relative",children:[s.jsx(xg,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(kt,{id:"password",type:"password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:r,onChange:x=>n(x.target.value),className:"pl-10"})]}),o.password&&s.jsx("p",{className:"text-sm text-destructive",children:o.password})]}),s.jsxs(Ne,{type:"submit",variant:"primary",size:"lg",className:"w-full",disabled:a,children:[a?s.jsx(gt,{className:"h-4 w-4 animate-spin mr-2"}):s.jsx(u8,{className:"h-4 w-4 mr-2"}),"Entrar"]})]})}),s.jsx("p",{className:"text-center text-muted-foreground text-xs mt-6",children:"Ao continuar, você concorda com nossos Termos de Uso e PolÃtica de Privacidade."})]})})},wW="data:image/svg+xml,%3csvg%20width='90'%20height='38'%20viewBox='0%200%2090%2038'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M56.2563%2014.405L54.6266%2014.851C53.4913%2015.2963%2052.4753%2016.0653%2051.6187%2017.235V15.0918L47.5954%2015.054V31.8823H51.7819V23.8323C51.7819%2022.455%2051.946%2021.486%2052.3135%2020.877C52.5952%202
11680.2325%2053.1238%2019.7058%2053.7761%2019.2613C54.5066%2018.7738%2055.2782%2018.5308%2056.0938%2018.5308L57.3916%2018.6145L57.3529%2014.3228L56.2563%2014.405ZM23.4913%2031.8808H27.7188V9.95628H23.4913V31.8808ZM40.3196%2023.307L39.5078%2023.7478L37.3943%2024.2745C36.4983%2024.396%2035.8095%2024.5983%2035.4017%2024.8405C34.7129%2025.2858%2034.3848%2025.8955%2034.3848%2026.7438C34.3848%2027.512%2034.5914%2028.0358%2034.9954%2028.4025C35.4017%2028.7225%2035.89%2028.8855%2036.4983%2028.8855C37.4748%2028.8855%2038.3284%2028.6017%2039.1425%2028.0358C39.9125%2027.4698%2040.3196%2026.4578%2040.3196%2025.0043V23.307ZM44.7544%2019.5013V31.8815H40.5231V30.1405C39.2215%2031.2733%2037.3943%2031.84%2035.0789%2031.8815C33.6528%2031.84%2032.475%2031.4378%2031.6206%2030.708C30.6478%2029.8183%2030.1611%2028.6017%2030.2006%2027.1098C30.1611%2024.962%2030.9311%2023.467%2032.5152%2022.5365C33.4523%2022.0083%2034.6696%2021.6468%2036.1725%2021.4423L39.4265%2020.9193C40.075%2020.637%2040.4008%2020.188%2040.4008%2019.6243C40.3598%2018.9368%2040.1563%2018.45%2039.6695%2018.2078C39.1827%2017.9233%2038.4924%2017.7595%2037.5994%2017.8025C36.54%2017.7595%2035.8095%2018.0455%2035.3622%2018.6145C35.0789%2018.9368%2034.8321%2019.4235%2034.7539%2020.151H30.5241C30.6478%2018.6145%2031.0139%2017.3973%2031.7437%2016.4683C32.882%2014.9718%2034.8739%2014.2013%2037.7201%2014.2435C39.5488%2014.2013%2041.1731%2014.568%2042.6365%2015.3363C44.0171%2016.0645%2044.7544%2017.4788%2044.7544%2019.5013ZM10.8905%2014.1235C12.1929%2014.1235%2013.3707%2014.4858%2014.5091%2015.2155C15.5259%2015.9038%2016.3392%2016.8735%2016.908%2018.0055H21.3376C20.6876%2015.6608%2019.427%2013.7175%2017.5155%2012.224C15.5677%2010.6845%2013.3313%209.91628%2010.8905%209.95628C7.8446%209.91628%205.32111%2010.9675%203.20846%2013.1508C1.05481%2015.2955%200%2017.8425%200%2020.877C0%2023.8693%201.05481%2026.5023%203.20846%2028.6448C5.32111%2030.7457%207.8446%2031.8%2010.8905%2031.8C13.3313%2031.8%2015.5677%2031.0703%2017.5155%2029.573C19.427%2028.0358%2020.6876%2026.1363%2021.3376%2023.79H16.908C16.3392%2024.9235%2015.5259%2025.8502%2014.5091%2026.58C13.3707%2027.2705%2012.1929%2027.6335%2010.8905%2027.6335C9.02166%2027.6335%207.43756%2026.9453%206.13443%2025.648C4.79637%2024.3153%204.1448%2022.741%204.18429%2020.877C4.1448%2019.0183%204.79637%2017.4388%206.13443%2016.106C7.43756%2014.811%209.02166%2014.1235%2010.8905%2014.1235ZM71.2142%2023.1425C71.1717%2021.809%2070.7251%2020.7148%2069.8693%2019.8258C68.936%2018.8975%2067.8394%2018.45%2066.5378%2018.4915C65.2787%2018.45%2064.1806%2018.8975%2063.2876%2019.8258C62.3915%2020.7148%2061.9032%2021.809%2061.9032%2023.1425C61.9032%2024.396%2062.3915%2025.4888%2063.2876%2026.42C64.1806%2027.3528%2065.2787%2027.7927%2066.5378%2027.7927C67.8394%2027.7927%2068.936%2027.3528%2069.8298%2026.42C70.7251%2025.4888%2071.1717%2024.396%2071.2142%2023.1425ZM72.7968%2016.8735C74.5047%2018.6145%2075.359%2020.7148%2075.359%2023.1425C75.359%2025.5695%2074.5047%2027.672%2072.7968%2029.3715C71.0494%2031.1125%2068.936%2032%2066.5378%2032C64.1404%2032%2062.065%2031.1125%2060.3601%2029.3715C58.6097%2027.672%2057.7584%2025.5695%2057.7584%2023.1425C57.7584%2020.7148%2058.6097%2018.6145%2060.3601%2016.8735C62.065%2015.1355%2064.1404%2014.2828%2066.5378%2014.2828C68.936%2014.2828%2071.0494%2015.1355%2072.7968%2016.8735ZM77.963%2022.8995H89.1429V19.1383H77.963V22.8995ZM65.1572%2010.8853H68.9375V0H65.1572V10.8853ZM86.2981%204.77627L76.0911%2014.9303L73.4096%2012.2595L83.6137%202.10853L86.2981%204.77627Z'%20fill='%23DA291C'/%3e%3cmetadata%3e%20©%202025%20Claro.%20Todos%20os%20direitos%20reservados%20-%20CNPJ:%2040.432.544/0001-47%20%3c/metadata%3e%3c/svg%3e",hn=t=>t.replace(/\D/g,""),xEe=t=>hn(t).slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})\.(\d{3})(\d)/,"$1.$2.$3").replace(/(\d{3})\.(\d{3})\.(\d{3})(\d)/,"$1.$2.$3-$4"),yEe=t=>{let e=hn(t).replace(/^0+/,"");return e.startsWith("55")&&e.length>11&&(e=e.slice(2)),e=e.slice(0,11),e.length<=2?e:e.length<=7?e.replace(/^(\d{2})(\d+)/,"($1) $2"):e.replace(/^(\d{2})(\d{5})(\d{0,4})/,"($1) $2-$3").replace(/-$/,"")},bEe=t=>hn(t).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2"),F2=t=>{const e=hn(t);return e?Number.parseInt(e,10)/100:0},wEe=t=>
1168{const e=F2(t);return e?e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):""},DL=t=>{const e=hn(t);if(e.length!==11||/^(\d)\1{10}$/.test(e))return!1;const r=n=>{let a=0;for(let o=0;o<n;o+=1)a+=Number(e[o])*(n+1-o);const i=a*10%11;return i===10?0:i};return r(9)===Number(e[9])&&r(10)===Number(e[10])},B2=t=>{let e=hn(t).replace(/^0+/,"");if(e.startsWith("55")&&(e=e.slice(2)),e.length!==11||e[2]!=="9")return null;const r=Number(e.slice(0,2));return r<11||r>99?null:`55${e}`},$L=t=>{var e;return((e=B2(t))==null?void 0:e.slice(2))||null},LL=t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t.trim()),FL=async t=>{const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(t));return Array.from(new Uint8Array(e)).map(r=>r.toString(16).padStart(2,"0")).join("")},_Ee={fullName:"",cpf:"",whatsapp:"",email:"",monthlyIncome:"",cep:"",address:"",neighborhood:"",city:"",state:"",isClt:null,creditConsent:!0,storeChoice:""};function jEe(){const t=w.useRef(null),[e,r]=w.useState(_Ee),[n,a]=w.useState([]),[i,o]=w.useState(!0),[l,u]=w.useState(null),[d,h]=w.useState("form"),[m,p]=w.useState(null),[v,b]=w.useState(!1),[y,x]=w.useState(null),[j,N]=w.useState(""),[S,k]=w.useState(null),[C,A]=w.useState(null),[T,R]=w.useState(null),[I,D]=w.useState("idle"),[L,z]=w.useState(null),[H,Z]=w.useState(!1),te=async()=>{o(!0),u(null);const{data:J,error:oe}=await ve.from("active_claro_stores").select("id, name, address, city, state").order("name");oe?(a([]),u("Não foi possÃvel carregar as lojas. Tente novamente.")):a(J||[]),o(!1)};w.useEffect(()=>{te()},[]);const G=async J=>{var Me;const oe=hn(J);if(oe.length!==8)return;(Me=t.current)==null||Me.abort();const re=new AbortController;t.current=re,b(!0),x(null);try{const ee=await fetch(`https://viacep.com.br/ws/${oe}/json/`,{signal:re.signal});if(!ee.ok)throw new Error("CEP indisponÃvel");const ce=await ee.json();if(ce.erro)throw new Error("CEP não encontrado");r(je=>({...je,address:String(ce.logradouro||""),neighborhood:String(ce.bairro||""),city:String(ce.localidade||""),state:String(ce.uf||"").slice(0,2).toUpperCase()})),N(oe)}catch(ee){if(ee instanceof DOMException&&ee.name==="AbortError")return;N(""),x(ee instanceof Error&&ee.message==="CEP não encontrado"?"CEP não encontrado. Confira os números informados.":"Não foi possÃvel consultar o CEP. Tente novamente.")}finally{t.current===re&&b(!1)}},M=()=>e.fullName.trim().split(/\s+/).length<2?"Informe seu nome e sobrenome.":DL(e.cpf)?$L(e.whatsapp)?LL(e.email)?F2(e.monthlyIncome)<=0?"Informe sua renda mensal.":hn(e.cep).length!==8||j!==hn(e.cep)||!e.city.trim()||e.state.trim().length!==2?"CEP inválido":e.isClt===null?"Informe se o cliente trabalha com carteira assinada (CLT).":e.creditConsent?null:"Você deve aceitar os termos acima para continuar":"Email inválido":"Celular inválido":"CPF inválido",F=e.cpf&&!DL(e.cpf)?"CPF inválido":null,K=e.whatsapp&&!$L(e.whatsapp)?"Celular inválido":null,B=e.email&&!LL(e.email)?"Email inválido":null,O=e.cep&&(hn(e.cep).length!==8||hn(e.cep).length===8&&!v&&j!==hn(e.cep))?"CEP inválido":null,W=M()===null&&!v,q=async()=>{if(d==="loading")return;const J=M();if(J){p(J);return}h("loading"),p(null);try{const oe=crypto.randomUUID(),re=`${crypto.randomUUID()}${crypto.randomUUID()}`.replace(/-/g,""),Me=`${crypto.randomUUID()}${crypto.randomUUID()}`.replace(/-/g,""),ee=B2(e.whatsapp);if(!ee)throw new Error("Informe um WhatsApp válido com DDD.");const{error:ce}=await ve.from("campaign_leads").insert({id:oe,full_name:e.fullName.trim().slice(0,120),cpf:hn(e.cpf),whatsapp:ee,email:e.email.trim().slice(0,255),monthly_income:F2(e.monthlyIncome),cep:hn(e.cep),address:e.address.trim().slice(0,255),neighborhood:e.neighborhood.trim().slice(0,120),city:e.city.trim().slice(0,120),state:e.state.trim().slice(0,2).toUpperCase(),is_clt:e.isClt,address_number:null,address_complement:null,credit_consent_at:new Date().toISOString(),credit_consent_version:"2026-09-14-v3-parcelex-dataprev",credit_check_token_hash:await FL(re),notification_token_hash:await FL(Me)});if(ce)throw ce;k(oe);const{data:je,error:de}=await ve.functions.invoke("parcelex-preapprove",{body:{lead_id:oe,token:re}});if((je==null?void 0:je.status)==="duplicate_daily_limit")throw new Error("Esses dados já foram cadastrados três vezes hoje. Aguarde o contato da equipe ou informe dados válidos diferentes.");if(de||(je==null?void 0:je.success)===!1)throw new Error((je==null?void 0:je.error)||"A c
1168onsulta não foi concluÃda.");if((je==null?void 0:je.status)==="approved")sessionStorage.setItem(`campaign-notify:${oe}`,Me),h("approved");else if(["denied","no_action","price_out_of_range"].includes(je==null?void 0:je.status))h("denied");else throw new Error("A consulta não retornou uma decisão válida.")}catch(oe){h("error"),p(oe instanceof Error?oe.message:"Não foi possÃvel concluir a consulta.")}},se=()=>{r(J=>({...J,cpf:"",storeChoice:""})),k(null),h("form"),p(null)},me=async(J,oe)=>{D("sending"),z(null);const{data:re,error:Me}=await ve.functions.invoke("campaign-notify-store",{body:{store_id:J.id,lead_id:oe,token:sessionStorage.getItem(`campaign-notify:${oe}`)}});return re!=null&&re.seller&&R(re.seller),Me||(re==null?void 0:re.success)===!1?(D("pending"),z((re==null?void 0:re.error)||(Me==null?void 0:Me.message)||"O envio automático não foi concluÃdo."),!1):(D("sent"),!0)},fe=async()=>{const J=n.find(oe=>oe.id===e.storeChoice);!J||!S||I==="sending"||(A(J),Z(!0),await me(J,S))},Q=async()=>{C&&S&&await me(C,S)},pe=J=>{const oe=J?B2(J):"",re=encodeURIComponent(`Olá! Meu nome é ${e.fullName.trim()} e meu crédito foi pré-aprovado pelo formulário.`);return oe?`https://wa.me/${oe}?text=${re}`:`https://wa.me/?text=${re}`},V="w-full bg-card border border-border rounded-lg px-4 py-3 outline-none focus:ring-2 focus:ring-ring placeholder:text-muted-foreground";return H?s.jsx("div",{className:"min-h-screen bg-background text-foreground flex items-center justify-center p-5",children:s.jsxs(Ie.section,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},className:"w-full max-w-lg border border-border bg-card rounded-lg p-6 text-center space-y-5",children:[s.jsx(Lr,{className:"w-14 h-14 text-primary mx-auto"}),s.jsxs("div",{children:[s.jsxs("h1",{className:"text-2xl font-bold",children:["Tudo certo, ",e.fullName.split(" ")[0],"!"]}),s.jsx("p",{className:"text-muted-foreground mt-2",children:I==="sent"?"Seus dados foram enviados ao responsável pelo atendimento.":I==="sending"?"Estamos enviando seus dados para a loja.":"Seu cadastro foi salvo, mas a entrega ainda está pendente."})]}),I==="pending"&&s.jsxs("div",{className:"border border-destructive bg-destructive/10 rounded-lg p-4 text-left text-sm",children:[s.jsx("p",{children:L}),s.jsxs(Ne,{type:"button",variant:"outline",className:"mt-3 gap-2",onClick:Q,children:[s.jsx(lo,{className:"w-4 h-4"})," Tentar novamente"]})]}),C&&s.jsxs("div",{className:"border border-border bg-secondary/50 rounded-lg p-5 text-left space-y-3",children:[s.jsxs("div",{className:"flex gap-3",children:[s.jsx(lu,{className:"w-5 h-5 text-primary shrink-0"}),s.jsxs("div",{children:[s.jsx("p",{className:"font-semibold",children:C.name}),s.jsx("p",{className:"text-sm text-muted-foreground",children:C.address}),(T==null?void 0:T.name)&&s.jsxs("p",{className:"text-sm mt-2",children:["Atendimento com ",T.name]})]})]}),(T==null?void 0:T.whatsapp)&&s.jsxs("a",{href:pe(T.whatsapp),target:"_blank",rel:"noreferrer",className:"flex items-center justify-center gap-2 bg-primary text-primary-foreground rounded-lg px-4 py-3 font-semibold",children:[s.jsx(w8,{className:"w-4 h-4"})," Falar no WhatsApp"]}),s.jsxs("a",{href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(`${C.address}, ${C.city}, ${C.state}`)}`,target:"_blank",rel:"noreferrer",className:"flex items-center justify-center gap-2 border border-border rounded-lg px-4 py-3",children:[s.jsx(bY,{className:"w-4 h-4"})," Como chegar"]})]})]})}):s.jsxs("div",{className:"min-h-screen bg-background text-foreground",children:[s.jsxs("header",{className:"w-full max-w-2xl mx-auto px-5 pt-7 pb-5 space-y-3",children:[s.jsx("img",{src:wW,alt:"Claro",className:"h-11 w-auto"}),s.jsx("p",{className:"text-sm font-semibold uppercase",children:"Oferta especial"}),s.jsx("h1",{className:"text-2xl font-bold leading-tight",children:"Consulte seu crédito para comprar seu celular novo"}),s.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[s.jsxs("span",{className:"font-semibold text-foreground",children:[d==="approved"?"2":"1"," de 2"]}),s.jsx("div",{className:"h-1.5 flex-1 bg-secondary rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-primary transition-all",style:{width:d==="approved"?"100%":"50%"}})})]})]}),s.jsx("main",{className:"w-full max-w-2xl mx-auto px-5 pb-10",children:d==="approved"?s.jsxs(Ie.section,{initial:{opacity:0,x:16}
1168,animate:{opacity:1,x:0},className:"space-y-5",children:[s.jsxs("div",{className:"border border-primary/40 bg-primary/10 rounded-lg p-5 flex gap-3",children:[s.jsx(Lr,{className:"w-6 h-6 text-primary shrink-0"}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold",children:"Crédito Pré-Aprovado!"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Escolha a loja onde deseja receber o atendimento."})]})]}),s.jsxs("div",{className:"grid gap-3",children:[i&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Carregando lojas..."}),!i&&l&&s.jsxs("div",{className:"border border-destructive bg-destructive/10 rounded-lg p-4 text-sm",children:[s.jsx("p",{children:l}),s.jsxs(Ne,{type:"button",variant:"outline",className:"mt-3 gap-2",onClick:()=>void te(),children:[s.jsx(lo,{className:"w-4 h-4"})," Tentar novamente"]})]}),!i&&!l&&n.length===0&&s.jsx("p",{className:"text-sm text-muted-foreground",children:"Nenhuma loja disponÃvel no momento."}),n.map(J=>s.jsxs(Ne,{type:"button",variant:"outline",onClick:()=>r(oe=>({...oe,storeChoice:J.id})),className:`h-auto min-h-20 justify-start text-left px-4 py-3 ${e.storeChoice===J.id?"border-primary bg-primary/10":""}`,children:[s.jsx(vY,{className:"w-5 h-5 shrink-0 mr-3 text-primary"}),s.jsxs("span",{children:[s.jsx("span",{className:"block font-semibold text-foreground",children:J.name}),s.jsxs("span",{className:"block text-xs text-muted-foreground mt-1 whitespace-normal",children:[J.address," â ",J.city,"/",J.state]})]})]},J.id))]}),s.jsxs(Ne,{type:"button",size:"lg",className:"w-full gap-2",disabled:!e.storeChoice||I==="sending",onClick:fe,children:[I==="sending"?s.jsx(gt,{className:"w-5 h-5 animate-spin"}):s.jsx(lu,{className:"w-5 h-5"})," Selecionar loja e enviar"]})]}):s.jsx("section",{className:"space-y-5",children:d==="denied"?s.jsxs("div",{className:"border border-destructive bg-destructive/10 rounded-lg p-5 space-y-4",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold",children:"Infelizmente o crédito não foi aprovado no momento."}),s.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:"Você pode fazer uma nova consulta usando outro CPF."})]}),s.jsxs(Ne,{type:"button",variant:"outline",className:"w-full gap-2",onClick:se,children:[s.jsx(lo,{className:"w-4 h-4"})," Consultar outro CPF"]})]}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold",children:"Seus dados"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Preencha todos os campos para consultar."})]}),s.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[s.jsx("input",{"aria-label":"Nome completo",className:`${V} sm:col-span-2`,placeholder:"Nome completo",maxLength:120,value:e.fullName,onChange:J=>r(oe=>({...oe,fullName:J.target.value}))}),s.jsxs("div",{children:[s.jsx("input",{"aria-label":"CPF","aria-invalid":!!F,className:V,placeholder:"CPF",inputMode:"numeric",maxLength:14,value:e.cpf,onChange:J=>r(oe=>({...oe,cpf:xEe(J.target.value)}))}),F&&s.jsx("p",{className:"mt-1 text-sm text-destructive",children:F})]}),s.jsxs("div",{children:[s.jsx("input",{"aria-label":"Celular","aria-invalid":!!K,className:V,placeholder:"Celular com DDD",inputMode:"tel",maxLength:15,value:e.whatsapp,onChange:J=>r(oe=>({...oe,whatsapp:yEe(J.target.value)}))}),K&&s.jsx("p",{className:"mt-1 text-sm text-destructive",children:K})]}),s.jsxs("div",{className:"sm:col-span-2",children:[s.jsx("input",{"aria-label":"E-mail","aria-invalid":!!B,className:V,placeholder:"E-mail",type:"email",maxLength:255,value:e.email,onChange:J=>r(oe=>({...oe,email:J.target.value}))}),B&&s.jsx("p",{className:"mt-1 text-sm text-destructive",children:B})]}),s.jsx("input",{"aria-label":"Renda mensal",className:`${V} sm:col-span-2`,placeholder:"Renda mensal",inputMode:"numeric",value:e.monthlyIncome,onChange:J=>r(oe=>({...oe,monthlyIncome:wEe(J.target.value)}))}),s.jsxs("div",{className:"relative sm:col-span-2",children:[s.jsx("input",{"aria-label":"CEP",className:V,placeholder:"CEP",inputMode:"numeric",maxLength:9,value:e.cep,onChange:J=>{const oe=bEe(J.target.value);r(re=>({...re,cep:oe,address:"",neighborhood:"",city:"",state:""})),N(""),x(null),hn(oe).length===8&&G(oe)}}),v&&s.jsx(gt,{className:"absolute right-4 top-3.5 w-5 h-5 animate-spin text-muted-foreground"})]}),(y||O)&&s.jsx("p",{className:"sm:col-span-2 text-sm text-destructive",children:y||O})]}),s.jsxs("fieldset",{className:"border border-border bg-card rounded-lg p-4 space-y-3",children:[s.jsx("legend",{className:"sr-only",children:"O cliente é trabalhador de Carteira Assinada (CLT)?"}),s.jsx("p",{className:"text-sm font-semibold",children:"O cliente é trabalhador de Carteira Assinada (CLT)?"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{label:"Sim",value:!0},{label:"Não",value:!1}].map(J=>s.jsxs("label",{className:`flex items-center gap-2 rounded-lg border px-4 py-3 text-sm cursor-pointer ${e.isClt===J.value?"border-primary bg-primary/10":"border-border"}`,children:[s.jsx("input",{type:"radio",name:"is-clt",checked:e.isClt===J.value,onChange:()=>r(oe=>({...oe,isClt:J.value})),className:"h-4 w-4 accent-primary"}),s.jsx("span",{children:J.label})]},J.label))})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"flex items-start gap-3 border border-border bg-card rounded-lg p-4 text-sm leading-relaxed text-muted-foreground",children:[s.jsx("input",{type:"checkbox",checked:e.creditConsent,onChange:J=>
1168r(oe=>({...oe,creditConsent:J.target.checked})),className:"mt-1 h-4 w-4 accent-primary"}),s.jsx("span",{children:"Ao continuar, você declara que o cliente está de acordo com os Termos e autoriza a consulta à Dataprev"})]}),!e.creditConsent&&s.jsx("p",{className:"mt-1 text-sm text-destructive",children:"Você deve aceitar os termos acima para continuar"})]}),d==="error"&&s.jsxs("div",{className:"border border-destructive bg-destructive/10 rounded-lg p-4 text-sm",children:[s.jsx("p",{className:"font-semibold",children:"Não foi possÃvel concluir a consulta."}),s.jsx("p",{className:"text-muted-foreground mt-1",children:m})]}),d==="form"&&m&&s.jsx("p",{className:"border border-destructive bg-destructive/10 rounded-lg p-4 text-sm",children:m}),s.jsx(Ne,{type:"button",size:"lg",className:"w-full",disabled:d==="loading"||!W,onClick:q,children:d==="loading"?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-5 h-5 animate-spin mr-2"})," Carregando..."]}):"Consultar"})]})})})]})}const BL="/assets/claro-loading-DYD-wcT-.webp",Ka=t=>t.replace(/\D/g,""),NEe=t=>Ka(t).slice(0,11).replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d)/,"$1.$2").replace(/(\d{3})(\d{1,2})$/,"$1-$2"),SEe=t=>Ka(t).slice(0,11).replace(/(\d{2})(\d)/,"($1) $2").replace(/(\d{5})(\d{1,4})$/,"$1-$2"),CEe=t=>Ka(t).slice(0,8).replace(/(\d{5})(\d)/,"$1-$2"),_W=t=>{const e=Ka(t);return e?Number.parseInt(e,10)/100:0},kEe=t=>{const e=_W(t);return e?e.toLocaleString("pt-BR",{style:"currency",currency:"BRL"}):""},VL=async(t,e)=>{if(!(t instanceof mN))return e;try{return(await t.context.json()).error||e}catch{return e}},EEe=t=>{const e=Ka(t);if(e.length!==11||/^(\d)\1+$/.test(e))return!1;const r=n=>{let a=0;for(let o=0;o<n;o+=1)a+=Number(e[o])*(n+1-o);const i=a*10%11;return(i===10?0:i)===Number(e[n])};return r(9)&&r(10)},AEe=()=>{const[t,e]=w.useState("form"),[r,n]=w.useState([]),[a,i]=w.useState(!1),[o,l]=w.useState(""),[u,d]=w.useState(""),[h,m]=w.useState(""),[p,v]=w.useState(""),[b,y]=w.useState(0),[x,j]=w.useState(null),[N,S]=w.useState(!1),[k,C]=w.useState(null),[A,T]=w.useState(""),R=w.useRef(0),[I,D]=w.useState({fullName:"",cpf:"",email:"",whatsapp:"",income:"",cep:"",isClt:"",consent:!1});w.useEffect(()=>{if(t!=="analyzing")return;const G=window.setTimeout(()=>S(!0),6e4);return()=>window.clearTimeout(G)},[t]),w.useEffect(()=>{if(t!=="store"||r.length>0)return;(async()=>{i(!0);const{data:M,error:F}=await ve.from("active_claro_stores").select("id, name, city, state").order("name");if(F)l("Não foi possÃvel carregar as lojas. Tente novamente.");else{const K=M??[];n(K),K.length===0&&l("Nenhuma loja está disponÃvel no momento. Tente novamente.")}i(!1)})()},[t,r.length,b]);const L=(G,M)=>D(F=>({...F,[G]:M})),z=()=>{R.current+=1,D({fullName:"",cpf:"",email:"",whatsapp:"",income:"",cep:"",isClt:"",consent:!1}),d(""),m(""),v(""),n([]),j(null),l(""),C(null),T(""),e("form")},H=async(G,M,F,K,B)=>{for(;Date.now()<B&&R.current===K;){if(await new Promise(q=>window.setTimeout(q,4e3)),R.current!==K)return;const{data:O,error:W}=await ve.functions.invoke("dual-credit-submit",{body:{action:"check_status",lead_id:G,handoff_token:M}});if(R.current!==K)return;if(W||(O==null?void 0:O.success)===!1){F||e("technical");return}if(O.dimo_status!=="Em Análise"){O.approved?(C(typeof O.value=="number"?O.value:null),d(G),m(M),e("store")):(T(O.dimo_status==="CPF já consultado"?"CPF já consultado. Faça uma nova consulta se necessário.":"No momento não foi possÃvel aprovar seu crédito."),e(O.denied?"unavailable":"technical"));return}}R.current===K&&!F&&e("technical")},Z=async G=>{if(G.preventDefault(),l(""),I.fullName.trim().split(/\s+/).length<2)return l("Informe o nome completo do titular.");if(!EEe(I.cpf))return l("CPF inválido");if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(I.email.trim()))return l("Email inválido");if(Ka(I.whatsapp).length!==11)return l("Celular inválido");if(Ka(I.cep).length!==8)return l("CEP inválido");const M=_W(I.income);if(!M||M<=0)return l("Informe uma renda mensal válida.");if(I.isClt!=="yes"&&I.isClt!=="no")return l("Informe se trabalha registrado.");if(!I.consent)return l("Você deve aceitar os termos acima para continuar");S(!1),C(null),T("");const F=Date.now()+6e4,K=++R.current;e("analyzing");const{data:B,error:O}=await ve.functions.invoke("dual-credit-submit",{body:{action:"analyze",full_name:I.fullName.trim(),cpf:Ka(I.cpf),email:I.email.trim(),whatsapp:Ka(I.whatsapp),monthly_income:M,cep:Ka(I.cep),is_clt:I.isClt==="yes",consent:I.consent}});if(O||(B==null?void 0:B.success)===!1){e("form"),l((B==null?void 0:B.error)||await VL(O,"Não foi possÃvel concluir a análise. Tente novamente."));return}B.approved?(d(B.lead_id),m(B.handoff_token),e("store")):e("pending"),H(B.lead_id,B.handoff_token,B.approved,K,F)},te=async G=>{if(G.preventDefault(),l(""),!p)return l("Escolha a loja de preferência.");i(!0);const{data:M,error:F}=await ve.functions.invoke("dual-credit-submit",{body:{action:"select_store",lead_id:u,handoff_token:h,store_id:p}});if(i(!1),F||(M==null?void 0:M.success)===!1)return l((M==null?void 0:M.error)||await VL(F,"Não foi possÃvel encaminhar seus dados. Tente novamente."));j(M.seller),e("complete")};return s.jsx("main",{className:"min-h-dvh bg-background px-4 py-6 text-foreground sm:py-10",children:s.jsxs("div",{className:"mx-auto max-w-xl",children:[s.jsxs("header",{className:"text-center",children:[s.jsx("img",{src:wW,alt:"Claro",className:"mx-auto h-14 w-auto"}),s.jsx("h1",{className:"mt-5 text-3xl font-bold",children:"Análise de crédito"}),t==="form"&&s.jsx("p",{className:"mt-2 text-muted-foreground",children:"Preencha seus dados para consultar as condições disponÃveis."})]}),t==="analyzing"&&s.jsxs("section",{className:"mt-8 rounded-lg border border-border bg-card p-8 text-center shadow-xl","aria-live":"polite",children:[s.jsx("img",{src:BL,alt:"","aria-hidden":"true",className:"mx-auto h-20 w-20 object-contain motion-safe:animate-[claro-pulse_2.4s_ease-in-out_infinite]"}),s.jsx("h2",{className:"mt-5 text-xl font-semibold",children:"Analisando crédito, por favor aguarde..."}),s.jsx("p",{className:"mt-3 text-muted-foreground",children:N?"Aguarde só mais um instante.":"A análise pode demorar até 1 minuto."})]}),t==="pending"&&s.jsxs("section",{className:"mt-8 rounded-lg border border-border bg-card p-7 text-center shadow-xl","aria-live":"polite",children:[s.jsx("img",{src:BL,alt:"","aria-hidden":"true",className:"mx-auto h-20 w-20 object-contain motion-safe:animate-[claro-pulse_2.4s_ease-in-out_infinite]"}),s.jsx("h2",{className:"mt-5 text-xl font-semibold",children:"Consulta em andamento"}),s.jsx("p",{className:"mt-3 text-muted-foreground",children:"Analisando crédito, por favor aguarde..."})]}),t==="unavailable"&&s.jsxs("section",{className:"mt-8 rounded-lg border border-border bg-card p-7 text-center shadow-xl",children:[s.jsx(au,{className:"mx-auto h-12 w-12 text-muted-foreground"}),s.jsx("h2",{className:"mt-5 text-xl font-semibold",children:"Outras formas de pagamento"}),s.jsx("p",{className:"mt-3 text-muted-foreground",children:A||"No momento não foi possÃvel aprovar seu crédito."}),s.jsx(Ne,{type:"button",size:"lg",className:"mt-6 w-full",onClick:z,children:"Nova consulta"})]}),t==="technical"&&s.jsxs("section",{className:"mt-8 rounded-lg border border-border bg-card p-7 text-center shadow-xl",children:[s.jsx(au,{className:"mx-auto h-12 w-12 text-muted-foreground"}),s.jsx("h2",{className:"mt-5 text-xl font-semibold",children:"Não foi possÃvel concluir a consulta"}),s.jsx("p",{className:"mt-3 text-muted-foreground",children:A||"Tente novamente em alguns instantes."}),s.jsx(Ne,{type:"button",size:"lg",className:"mt-6 w-full",onClick:z,children:"Nova consulta"})]}),t==="store"&&s.jsxs("form",{onSubmit:te,className:"mt-8 space-y-5 rounded-lg border border-border bg-card p-6 shadow-xl",children:[s.jsxs("div",{className:"text-center",children:[s.jsx(Lr,{className:"mx-auto h-12 w-12 text-primary"}),s.jsx("h2",{className:"mt-4 text-xl font-semibold",children:"Parabéns! Seu crédito foi aprovado."}),k!=null&&s.jsxs("p",{className:"mt-2 text-muted-foreground",children:["Valor aprovado: ",k.toLocaleStr
1168ing("pt-BR",{style:"currency",currency:"BRL"})]})]}),s.jsxs("div",{className:"flex items-center gap-3 border-b border-border pb-4",children:[s.jsx("span",{className:"rounded-lg bg-primary/15 p-2 text-primary",children:s.jsx(lu,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"font-semibold",children:"Escolha onde deseja ser atendido"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Seus dados serão encaminhados ao vendedor da vez."})]})]}),s.jsxs("label",{className:"block text-sm font-medium",children:["Loja de preferência",s.jsxs("select",{value:p,onChange:G=>v(G.target.value),disabled:a,className:"mt-2 h-11 w-full rounded-lg border border-input bg-secondary px-3 text-foreground",required:!0,children:[s.jsx("option",{value:"",children:a?"Carregando lojas...":"Selecione uma loja"}),r.map(G=>s.jsxs("option",{value:G.id,children:[G.name," â ",G.city,"/",G.state]},G.id))]})]}),o&&s.jsx("div",{role:"alert",className:"rounded-lg border border-destructive/40 bg-destructive/15 p-3 text-sm text-destructive-foreground",children:o}),!a&&r.length===0&&s.jsxs(Ne,{type:"button",variant:"outline",className:"w-full gap-2",onClick:()=>{l(""),y(G=>G+1)},children:[s.jsx(gt,{className:"h-5 w-5"}),"Tentar carregar novamente"]}),s.jsxs(Ne,{type:"submit",size:"lg",className:"w-full gap-2",disabled:a||r.length===0||!p,children:[a?s.jsx(gt,{className:"h-5 w-5 animate-spin"}):s.jsx(lu,{className:"h-5 w-5"}),"Confirmar loja"]})]}),t==="complete"&&x&&s.jsxs("section",{className:"mt-8 rounded-lg border border-border bg-card p-7 text-center shadow-xl",children:[s.jsx(Lr,{className:"mx-auto h-12 w-12 text-primary"}),s.jsx("h2",{className:"mt-5 text-2xl font-bold",children:"Atendimento encaminhado"}),s.jsxs("p",{className:"mt-3 text-muted-foreground",children:[x.name," será responsável por continuar seu atendimento."]}),s.jsxs(Ne,{type:"button",size:"lg",className:"mt-6 w-full gap-2",onClick:()=>window.open(`https://wa.me/${Ka(x.whatsapp)}`,"_blank","noopener,noreferrer"),children:[s.jsx(w8,{className:"h-5 w-5"}),"Conversar no WhatsApp"]})]}),t==="form"&&s.jsxs("form",{onSubmit:Z,className:"mt-7 space-y-5 rounded-lg border border-border bg-card p-5 shadow-xl sm:p-7",noValidate:!0,children:[s.jsxs("div",{className:"flex items-center gap-3 border-b border-border pb-4",children:[s.jsx("span",{className:"rounded-lg bg-primary/15 p-2 text-primary",children:s.jsx(p8,{className:"h-5 w-5"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"font-semibold",children:"Dados do titular"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Preencha exatamente como consta nos documentos."})]})]}),[["Nome completo do titular","fullName","text",I.fullName],["CPF do titular","cpf","text",I.cpf],["E-mail do titular","email","email",I.email],["WhatsApp do titular","whatsapp","tel",I.whatsapp],["CEP do titular","cep","text",I.cep],["Renda mensal do titular","income","text",I.income]].map(([G,M,F,K])=>s.jsxs("label",{className:"block text-sm font-medium",children:[G,s.jsx("input",{value:K,onChange:B=>L(M,M==="cpf"?NEe(B.target.value):M==="whatsapp"?SEe(B.target.value):M==="cep"?CEe(B.target.value):M==="income"?kEe(B.target.value):B.target.value),type:F,inputMode:["cpf","whatsapp","cep","income"].includes(M)?"numeric":void 0,placeholder:M==="income"?"R$ 0,00":void 0,className:"mt-2 h-11 w-full rounded-lg border border-input bg-secondary px-3 text-foreground placeholder:text-muted-foreground focus:border-primary",required:!0})]},M)),s.jsxs("fieldset",{children:[s.jsx("legend",{className:"text-sm font-medium",children:"Trabalha registrado / CLT?"}),s.jsx("div",{className:"mt-2 grid grid-cols-2 gap-3",children:[["yes","Sim"],["no","Não"]].map(([G,M])=>s.jsxs("label",{className:"flex h-11 cursor-pointer items-center gap-3 rounded-lg border border-border bg-secondary px-4",children:[s.jsx("input",{type:"radio",name:"isClt",value:G,checked:I.isClt===G,onChange:()=>L("isClt",G),className:"accent-primary"}),s.jsx("span",{children:M})]},G))})]}),s.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border border-border bg-secondary p-4 text-sm",children:[s.jsx("input",{type:"checkbox",checked:I.consent,onChange:G=>L("consent",G.target.checked),className:"mt-1 h-4 w-4 accent-primary"}),s.jsxs("span",{children:[s.jsx("strong",{className:"block",children:"Autorização para análise"}),s.jsx("span",{className:"text-muted-foreground",children:"Autorizo a consulta dos meus dados para fins de análise de crédito e atendimento."})]})]}),o&&s.jsx("div",{role:"alert",className:"rounded-lg border border-destructive/40 bg-destructive/15 p-3 text-sm text-destructive-foreground",children:o}),s.jsxs(Ne,{type:"submit",size:"lg",className:"w-full gap-2",disabled:!I.consent,children:[s.jsx(n0,{className:"h-5 w-5"}),"Consultar condições"]})]})]})})}
1168,PEe={today:"Hoje",yesterday:"Ontem","7days":"7 Dias","30days":"30 Dias",custom:"PerÃodo"},TEe=["today","yesterday","7days","30days"],eN={approved:"Aprovado",denied:"Não aprovado",no_action:"Não aprovado",price_out_of_range:"Não aprovado",pending:"Em análise",not_requested:"Não consultado",failed:"Falha na consulta"},OEe=t=>{const e=t==null?"":String(t);return`"${(/^[=+\-@]/.test(e)?`'${e}`:e).replace(/"/g,'""')}"`},V2=()=>{const t=new Intl.DateTimeFormat("en-US",{timeZone:"America/Belem",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(new Date),e=r=>{var n;return((n=t.find(a=>a.type===r))==null?void 0:n.value)??""};return new Date(Number(e("year")),Number(e("month"))-1,Number(e("day")))},MEe=(t,e)=>{const r=V2(),n=t==="custom"&&(e!=null&&e.from)?e.from:t==="yesterday"?xl(r,1):t==="7days"?xl(r,6):t==="30days"?xl(r,29):r,a=t==="custom"&&(e!=null&&e.from)?e.to??e.from:t==="yesterday"?xl(r,1):r;return{from:`${vn(n,"yyyy-MM-dd")}T00:00:00-03:00`,to:`${vn(nn(a,1),"yyyy-MM-dd")}T00:00:00-03:00`}},REe=()=>{const[t,e]=w.useState([]),[r,n]=w.useState([]),[a,i]=w.useState(!0),[o,l]=w.useState("today"),[u,d]=w.useState(),[h,m]=w.useState(),[p,v]=w.useState(!1),[b,y]=w.useState("all"),{regional:x,canAccessGeneralPanel:j}=zl(),[N,S]=w.useState(x||"all"),[k,C]=w.useState(!1),[A,T]=w.useState(null),R=async(M=!0)=>{M&&i(!0);try{const F=MEe(o,u),[{data:K,error:B},{data:O,error:W},{data:q,error:se},{data:me,error:fe}]=await Promise.all([ve.from("campaign_leads").select("id, full_name, whatsapp, email, cpf, cep, monthly_income, address, neighborhood, city, state, address_number, address_complement, credit_consent_at, parcelex_checked_at, parcelex_error, created_at, assigned_store_id, preferred_store_id, assigned_seller_name, assigned_seller_whatsapp, outcome, outcome_source, notification_status, notification_error, reminder_count, parcelex_status, parcelex_result, parcelex_refusal_reason, parcelex_track_id, is_clt, dimo_status").gte("created_at",F.from).lt("created_at",F.to).order("created_at",{ascending:!1}),ve.from("dual_credit_leads").select("id, full_name, cpf, email, whatsapp_titular, monthly_income, cep, preferred_store_id, assigned_seller_name, assigned_seller_whatsapp, status_parcelex, valor_aprovado_parcelex, parcelex_track_id, parcelex_result, status_dimo, valor_aprovado_dimo, consented_at, data_ultima_consulta, created_at").gte("created_at",F.from).lt("created_at",F.to).order("created_at",{ascending:!1}),ve.from("dual_credit_applications").select("id, full_name, cpf, email, whatsapp_titular, monthly_income, cep, is_clt, preferred_store_id, assigned_seller_name, assigned_seller_whatsapp, status_parcelex, valor_aprovado_parcelex, parcelex_track_id, parcelex_result, status_dimo, valor_aprovado_dimo, consolidated_status, notification_status, consented_at, data_ultima_consulta, created_at").gte("created_at",F.from).lt("created_at",F.to).order("created_at",{ascending:!1}),ve.from("claro_stores").select("id, name, city, state, regional").order("name")]);if(B)throw B;if(W)throw W;if(se)throw se;if(fe)throw fe;const Q=(O||[]).map(V=>({id:V.id,full_name:V.full_name,whatsapp:V.whatsapp_titular,created_at:V.created_at,assigned_store_id:null,preferred_store_id:V.preferred_store_id,assigned_seller_name:V.assigned_seller_name,assigned_seller_whatsapp:V.assigned_seller_whatsapp,outcome:"pending",notification_status:"pending",notification_error:null,reminder_count:0,outcome_source:null,parcelex_status:V.status_parcelex==="Aprovado"?"approved":V.status_parcelex==="Negado"?"denied":V.status_parcelex==="Falha"?"failed":"pending",parcelex_result:V.parcelex_result,parcelex_refusal_reason:null,parcelex_track_id:V.parcelex_track_id,cpf:V.cpf,email:V.email,cep:V.cep,monthly_income:V.monthly_income,is_clt:null,dimo_status:"unavailable",address:null,neighborhood:null,city:null,state:null,address_number:null,address_complement:null,credit_consent_at:V.consented_at,parcelex_checked_at:V.data_ultima_consulta,parcelex_error:null,source:"dual",valor_aprovado_parcelex:V.valor_aprovado_parcelex,status_dimo_dual:V.status_dimo,valor_aprovado_dimo:V.valor_aprovado_dimo})),pe=(q||[]).map(V=>({id:V.id,full_name:V.full_name,whatsapp:V.whatsapp_titular,created_at:V.created_at,assigned_store_id:null,preferred_store_id:V.preferred_store_id,assigned_seller_name:V.assigned_seller_name,assigned_seller_whatsapp:V.assigned_seller_whatsapp,outcome:"pending",notification_status:V.notification_status==="sent"?"sent":V.notification_status==="failed"?"failed":"pending",notification_error:null,reminder_count:0,outcome_source:null,parcelex_status:V.status_parcelex==="Aprovado"?"approved":V.status_parcelex==="Negado"?"denied":V.status_parcelex==="Falha"?"failed":"pending",parcelex_result:V.parcelex_result,parcelex_refusal_reason:null,parcelex_track_id:V.parcelex_track_id,cpf:V.cpf,email:V.email,cep:V.cep,monthly_income:V.monthly_income,is_clt:V.is_clt,dimo_status:"unavailable",address:null,neighborhood:null,city:null,state:null,address_number:null,address_complement:null,credit_consent_at:V.consented_at,parcelex_checked_at:V.data_ultima_consulta,parcelex_error:null,source:"dual",valor_aprovado_parcelex:V.valor_aprovado_parcelex,status_dimo_dual:V.status_dimo,valor_aprovado_dimo:V.valor_aprovado_dimo}));e([...(K||[]).map(V=>({...V,source:"campaign"})),...Q,...pe].sort((V,J)=>Date.parse(J.created_at)-Date.parse(V.created_at))),n(me||[])}catch(F){console.error("Erro ao carregar leads da campanha:",F),xe.error("Não foi possÃvel atualizar os leads. Tente novamente.")}finally{M&&i(!1)}};w.useEffect(()=>{R()},[o,u]),w.useEffect(()=>{const M=window.setInterval(()=>{document.visibilityState==="visible"&&R(!1)},1e4);return()=>{window.clearInterval(M)}},[o,u]),w.useEffect(()=>{x?S(x):j&&S("all")},[x,j]),w.useEffect(()=>{y("all")},[N]);const I=M=>{var F;return((F=r.find(K=>K.id===M))==null?void 0:F.name)||"Sem loja"},D=w.useMemo(()=>N==="all"?r:r.filter(M=>M.regional===N),[r,N]),L=w.useMemo(()=>
1168{if(N==="all"&&j)return t;const M=new Set(D.map(F=>F.id));return t.filter(F=>{const K=F.assigned_store_id||F.preferred_store_id;return K?M.has(K):j})},[t,D,N,j]),z=w.useMemo(()=>b==="all"?L:L.filter(M=>(M.assigned_store_id||M.preferred_store_id)===b),[L,b]),H=w.useMemo(()=>{const M=new Map;return z.forEach(F=>{const K=F.assigned_store_id||F.preferred_store_id||"none",B=M.get(K)||{name:I(F.assigned_store_id||F.preferred_store_id),total:0,sellers:new Map};B.total+=1;const O=F.assigned_seller_name||"Não atribuÃdo";B.sellers.set(O,(B.sellers.get(O)||0)+1),M.set(K,B)}),Array.from(M.values()).sort((F,K)=>K.total-F.total)},[z,r]),Z=w.useMemo(()=>new Set(z.map(F=>F.assigned_seller_name).filter(Boolean)).size,[z]),te=()=>{var me;if(z.length===0)return xe.error("Não há leads para exportar neste filtro.");const M=["Cliente","WhatsApp","E-mail","CPF","CEP","Renda mensal","CLT","Loja","Vendedor","Data de entrada","Resultado Parcelex","Retorno Parcelex","Valor Parcelex","Status DIMO","Valor DIMO","Motivo Parcelex","Código da consulta","Origem"],F=z.map(fe=>[fe.full_name,fe.whatsapp,fe.email,fe.cpf,fe.cep,fe.monthly_income==null?"":Number(fe.monthly_income).toLocaleString("pt-BR",{minimumFractionDigits:2}),fe.is_clt===null?"Não informado":fe.is_clt?"Sim":"Não",I(fe.assigned_store_id||fe.preferred_store_id),fe.assigned_seller_name||"Não atribuÃdo",new Date(fe.created_at).toLocaleString("pt-BR",{timeZone:"America/Belem"}),eN[fe.parcelex_status],fe.parcelex_result,fe.valor_aprovado_parcelex==null?"":Number(fe.valor_aprovado_parcelex).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),fe.status_dimo_dual||(fe.dimo_status==="manual_pending"?"Consulta manual pendente":"Não consultado"),fe.valor_aprovado_dimo==null?"":Number(fe.valor_aprovado_dimo).toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),fe.parcelex_refusal_reason,fe.parcelex_track_id,fe.source==="dual"?"Análise Parcelex + DIMO":"Campanha"]),K=[M,...F].map(fe=>fe.map(OEe).join(";")).join(`\r 1169`),B=new Blob([`\uFEFF${K}`],{type:"text/csv;charset=utf-8;"}),O=URL.createObjectURL(B),W=document.createElement("a"),q=b==="all"?"todas-lojas":(((me=r.find(fe=>fe.id===b))==null?void 0:me.name)||"loja").normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-zA-Z0-9]+/g,"-").toLowerCase();W.href=O;const se=o==="custom"&&(u!=null&&u.from)?`${vn(u.from,"yyyy-MM-dd")}-a-${vn(u.to??u.from,"yyyy-MM-dd")}`:o;W.download=`leads-${N}-${se}-${q}-${new Date().toISOString().slice(0,10)}.csv`,document.body.appendChild(W),W.click(),W.remove(),URL.revokeObjectURL(O),xe.success("Planilha gerada com os filtros selecionados.")},G=async()=>{C(!0);const M=L.find(O=>O.source!=="dual");if(!M)return C(!1),xe.error("Nenhum lead disponÃvel para o teste.");const F=M.assigned_store_id||M.preferred_store_id;if(!F)return C(!1),xe.error("O último lead não possui loja selecionada.");const{data:K,error:B}=await ve.functions.invoke("campaign-notify-store",{body:{lead_id:M.id,store_id:F,override_to:"5591988308668"}});B||(K==null?void 0:K.success)===!1?xe.error((K==null?void 0:K.error)||(B==null?void 0:B.message)||"O teste não foi entregue."):xe.success("Resumo aceito pela Meta. A confirmação de entrega aparecerá no histórico."),C(!1)};return a?s.jsx("div",{className:"flex items-center justify-center h-full bg-slate-950",children:s.jsx(gt,{className:"h-9 w-9 animate-spin text-red-400"})}):s.jsxs("div",{className:"p-6 space-y-8 overflow-y-auto h-full bg-slate-950 text-slate-50 custom-scrollbar",children:[s.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold tracking-tight text-white",children:"Leads da Campanha"}),s.jsx("p",{className:"text-slate-400 mt-1",children:"Acompanhamento diário por loja e vendedor."})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-slate-800 bg-slate-900 p-1","aria-label":"Selecionar regional",children:[j&&s.jsx(Ne,{onClick:()=>S("all"),size:"sm",variant:N==="all"?"primary":"ghost",children:"Todas"}),["regional_1","regional_2"].map(M=>s.jsx(Ne,{onClick:()=>j&&S(M),disabled:!j&&M!==x,size:"sm",variant:N===M?"primary":"ghost",children:M==="regional_1"?"Regional 1":"Regional 2"},M))]}),s.jsxs(Ne,{onClick:te,disabled:z.length===0,size:"sm",variant:"secondary",className:"gap-2",children:[s.jsx(v8,{className:"h-4 w-4"}),"Exportar planilha"]}),s.jsxs(Ne,{onClick:G,disabled:k||L.length===0,size:"sm",className:"gap-2",children:[k?s.jsx(gt,{className:"h-4 w-4 animate-spin"}):s.jsx(ou,{className:"h-4 w-4"}),"Testar último lead"]}),s.jsxs("select",{value:b,onChange:M=>y(M.target.value),className:"bg-slate-900 border border-slate-800 rounded-lg text-sm px-3 py-2 text-slate-200",children:[s.jsx("option",{value:"all",children:"Todas as lojas"}),D.map(M=>s.jsx("option",{value:M.id,children:M.name},M.id))]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-1 bg-secondary p-1 rounded-lg border border-border","aria-label":"Filtrar por perÃodo",children:[TEe.map(M=>s.jsx(Ne,{onClick:()=>l(M),size:"sm",variant:o===M?"primary":"ghost",children:PEe[M]},M)),s.jsxs(fE,{open:p,onOpenChange:v,children:[s.jsx(hE,{asChild:!0,children:s.jsxs(Ne,{size:"sm",variant:o==="custom"?"primary":"ghost",className:"gap-2","aria-label":"Selecionar perÃodo entre datas",children:[s.jsx(eY,{className:"h-4 w-4"}),o==="custom"&&(u!=null&&u.from)?`${vn(u.from,"dd/MM/yyyy")} â ${vn(u.to??u.from,"dd/MM/yyyy")}`:"Entre datas"]})}),s.jsxs(ex,{align:"end",className:"w-auto max-w-[calc(100vw-2rem)] p-3",children:[s.jsx(YE,{mode:"range",locale:hCe,selected:h,onSelect:m,defaultMonth:(h==null?void 0:h.from)??V2(),disabled:{after:V2()},numberOfMonths:1,className:"pointer-events-auto p-0"}),s.jsx("div",{className:"flex justify-end border-t border-border pt-3",children:s.jsx(Ne,{size:"sm",disabled:!(h!=null&&h.from),onClick:()=>{h!=null&&h.from&&(d(h),l("custom"),v(!1))},children:"Aplicar perÃodo"})})]})]})]}),s.jsx(Ne,{onClick:()=>void R(),size:"icon",variant:"outline",title:"Atualizar","aria-label":"Atualizar leads",children:s.jsx(lo,{className:"w-4 h-4"})})]})]}),s.jsx("div",{className:"grid gap-6 md:grid-cols-4",children:[{label:"Leads no perÃodo",value:z.length,icon:s.jsx(k8,{className:"h-5 w-5 text-red-400"})},{label:"Lojas com leads",value:H.length,icon:s.jsx(lu,{className:"h-5 w-5 text-emerald-400"})},{label:"Vendedores atendendo",value:Z,icon:s.jsx(fo,{className:"h-5 w-5 text-violet-400"})},{label:"Crédito não aprovado",value:z.filter(M=>["denied","no_action","price_out_of_range"].includes(M.parcelex_status)).length,icon:s.jsx(p8,{className:"h-5 w-5 text-red-400"})}].map(M=>s.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between pb-4",children:[s.jsx("span",{className:"text-sm font-medium text-slate-400",children:M.label}),s.jsx("div",{className:"p-2 rounded-lg bg-slate-800/50 border border-slate-700/50",children:M.icon})]}),s.jsx("div",{className:"text-3xl font-bold text-white",children:M.value})]},M.label))}),s.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:"Distribuição por loja e vendedor"}),H.length===0?s.jsx("p",{className:"text-sm text-slate-500",children:"Nenhum lead no perÃodo selecionado."}):s.jsx("div",{className:"space-y-5",children:H.map(M=>s.jsxs("div",{className:"border border-slate-800 rounded-xl p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("span",{className:"font-semibold text-white",children:M.name}),s.jsxs("span",{className:"text-sm text-red-400 font-bold",children:[M.total," lead(s)"]})]}),s.jsx("div",{className:"space-y-2",children:Array.from(M.sellers.entr
1169ies()).sort((F,K)=>K[1]-F[1]).map(([F,K])=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between text-sm mb-1",children:[s.jsx("span",{className:"text-slate-300",children:F}),s.jsx("span",{className:"text-slate-400",children:K})]}),s.jsx("div",{className:"h-2 bg-slate-800 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-red-600 to-rose-500 rounded-full",style:{width:`${K/M.total*100}%`}})})]},F))})]},M.name))})]}),s.jsxs("div",{className:"rounded-2xl border border-slate-800 bg-slate-900/50 p-6",children:[s.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:"Leads recentes"}),s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"text-left text-slate-500 border-b border-slate-800",children:[s.jsx("th",{className:"py-2 pr-4 font-medium",children:"Cliente"}),s.jsx("th",{className:"py-2 pr-4 font-medium",children:"WhatsApp"}),s.jsx("th",{className:"py-2 pr-4 font-medium",children:"Loja"}),s.jsx("th",{className:"py-2 pr-4 font-medium",children:"Vendedor"}),s.jsx("th",{className:"py-2 pr-4 font-medium",children:"Data"}),s.jsx("th",{className:"py-2 pr-4 font-medium",children:"Parcelex"}),s.jsx("th",{className:"py-2 pr-4 font-medium",children:"DIMO"}),s.jsx("th",{className:"py-2 font-medium text-right",children:"Detalhes"})]})}),s.jsxs("tbody",{children:[z.map(M=>s.jsxs("tr",{className:"border-b border-slate-800/60 hover:bg-slate-800/30",children:[s.jsx("td",{className:"py-3 pr-4 text-white font-medium",children:M.full_name}),s.jsx("td",{className:"py-3 pr-4 text-slate-300",children:s.jsxs("a",{href:`https://wa.me/${(M.whatsapp||"").replace(/\D/g,"")}`,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 hover:text-red-400",children:[s.jsx(Hu,{className:"w-3 h-3"})," ",M.whatsapp]})}),s.jsx("td",{className:"py-3 pr-4 text-slate-300",children:I(M.assigned_store_id||M.preferred_store_id)}),s.jsx("td",{className:"py-3 pr-4 text-slate-300",children:M.assigned_seller_name||"â"}),s.jsx("td",{className:"py-3 pr-4 text-slate-500",children:new Date(M.created_at).toLocaleString("pt-BR",{timeZone:"America/Belem"})}),s.jsx("td",{className:"py-3 pr-4",children:s.jsxs("span",{className:`text-xs font-semibold ${M.parcelex_status==="approved"?"text-emerald-400":["denied","no_action","price_out_of_range"].includes(M.parcelex_status)?"text-red-400":M.parcelex_status==="failed"?"text-amber-400":"text-slate-400"}`,title:M.parcelex_refusal_reason||M.parcelex_result||void 0,children:[eN[M.parcelex_status],M.valor_aprovado_parcelex!=null&&s.jsx("span",{className:"mt-1 block font-normal text-slate-400",children:Number(M.valor_aprovado_parcelex).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})})]})}),s.jsx("td",{className:"py-3 pr-4",children:s.jsxs("span",{className:`text-xs font-semibold ${M.status_dimo_dual==="Aprovado"?"text-emerald-400":M.status_dimo_dual==="Negado"?"text-red-400":M.status_dimo_dual==="Falha"?"text-amber-400":"text-slate-400"}`,children:[M.status_dimo_dual||(M.dimo_status==="manual_pending"?"Consulta manual pendente":"Não consultado"),M.valor_aprovado_dimo!=null&&s.jsx("span",{className:"mt-1 block font-normal text-slate-400",children:Number(M.valor_aprovado_dimo).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})})]})}),s.jsx("td",{className:"py-3 text-right",children:s.jsx(Ne,{type:"button",size:"icon",variant:"ghost",onClick:()=>T(M),title:"Ver todas as informações","aria-label":`Ver informações de ${M.full_name}`,children:s.jsx(su,{className:"h-4 w-4"})})})]},M.id)),z.length===0&&s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"py-6 text-center text-slate-500",children:"Nenhum lead no perÃodo selecionado."})})]})]})})]}),s.jsx(Ll,{open:!!A,onOpenChange:M=>!M&&T(null),children:s.jsxs(bo,{className:"max-w-2xl max-h-[85vh] overflow-y-auto bg-slate-900 border-slate-700 text-slate-50",children:[s.jsx(wo,{children:s.jsx(_o,{children:"Informações do cliente"})}),A&&s.jsx("div",{className:"grid gap-4 sm:grid-cols-2",children:[["Nome completo",A.full_name],["WhatsApp",A.whatsapp],["CPF",A.cpf],["E-mail",A.email],["CEP",A.cep],["Cidade/UF",[A.city,A.state].filter(
1169Boolean).join("/")],["Bairro",A.neighborhood],["Endereço",[A.address,A.address_number,A.address_complement].filter(Boolean).join(", ")],["Renda mensal",A.monthly_income==null?null:Number(A.monthly_income).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})],["Trabalha como CLT",A.is_clt===null?null:A.is_clt?"Sim":"Não"],["Autorização de consulta",A.credit_consent_at?`Confirmada em ${new Date(A.credit_consent_at).toLocaleString("pt-BR",{timeZone:"America/Belem"})}`:null],["Resultado Parcelex",eN[A.parcelex_status]],["Valor aprovado Parcelex",A.valor_aprovado_parcelex==null?null:Number(A.valor_aprovado_parcelex).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})],["Retorno Parcelex",A.parcelex_result],["Motivo da negativa",A.parcelex_refusal_reason],["Erro da consulta",A.parcelex_error],["Código da consulta",A.parcelex_track_id],["Consulta realizada em",A.parcelex_checked_at?new Date(A.parcelex_checked_at).toLocaleString("pt-BR",{timeZone:"America/Belem"}):null],["Loja de referência",I(A.assigned_store_id||A.preferred_store_id)],["Responsável",A.assigned_seller_name],["Status DIMO",A.status_dimo_dual||(A.dimo_status==="manual_pending"?"Encaminhado para consulta":A.dimo_status==="manual_completed"?"Consulta concluÃda":"Não encaminhado")],["Valor aprovado DIMO",A.valor_aprovado_dimo==null?null:Number(A.valor_aprovado_dimo).toLocaleString("pt-BR",{style:"currency",currency:"BRL"})],["Origem",A.source==="dual"?"Análise Parcelex + DIMO":"Campanha"],["Entrega do resumo",A.notification_status],["Cadastrado em",new Date(A.created_at).toLocaleString("pt-BR",{timeZone:"America/Belem"})]].map(([M,F])=>s.jsxs("div",{className:"border-b border-slate-800 pb-3 min-w-0",children:[s.jsx("p",{className:"text-xs font-medium text-slate-500",children:M}),s.jsx("p",{className:"mt-1 break-words text-sm text-slate-100",children:F||"Não informado"})]},String(M)))})]})})]})},zL={name:"",whatsapp:"",storeId:"",isManager:!1},jW=t=>t.replace(/\D/g,""),tN=t=>{const e=jW(t).replace(/^55/,"").slice(0,11);return e.length?e.length<=2?`+55 (${e}`:e.length<=7?`+55 (${e.slice(0,2)}) ${e.slice(2)}`:`+55 (${e.slice(0,2)}) ${e.slice(2,7)}-${e.slice(7)}`:""},IEe=()=>{const[t,e]=w.useState([]),[r,n]=w.useState([]),[a,i]=w.useState(!0),[o,l]=w.useState(!1),[u,d]=w.useState(!1),[h,m]=w.useState(null),[p,v]=w.useState(""),[b,y]=w.useState("all"),[x,j]=w.useState(zL),N=async()=>{i(!0);const[{data:D,error:L},{data:z,error:H}]=await Promise.all([ve.from("claro_stores").select("id, name").eq("is_active",!0).order("name"),ve.from("store_sellers").select("id, name, whatsapp, store_id, is_manager, is_active, assignments_count").order("name")]);L||H?xe.error("Não foi possÃvel carregar os colaboradores."):(e(D||[]),n(z||[])),i(!1)};w.useEffect(()=>{N()},[]);const S=D=>{var L;return((L=t.find(z=>z.id===D))==null?void 0:L.name)||"Loja não encontrada"},k=w.useMemo(()=>{const D=p.trim().toLowerCase();return r.filter(L=>{const z=b==="all"||L.store_id===b,H=!D||L.name.toLowerCase().includes(D)||L.whatsapp.includes(D);return z&&H})},[r,p,b]),C=()=>{var D;m(null),j({...zL,storeId:b==="all"?((D=t[0])==null?void 0:D.id)||"":b}),d(!0)},A=D=>{m(D),j({name:D.name,whatsapp:tN(D.whatsapp),storeId:D.store_id,isManager:D.is_manager}),d(!0)},T=async()=>{const D=jW(x.whatsapp);if(x.name.trim().length<2||D.length<10||!x.storeId){xe.error("Preencha nome, WhatsApp e loja corretamente.");return}l(!0);const L={name:x.name.trim().slice(0,120),whatsapp:D.startsWith("55")?D:`55${D}`,store_id:x.storeId,is_manager:x.isManager,is_active:(h==null?void 0:h.is_active)??!0},{error:z}=h?await ve.from("store_sellers").update(L).eq("id",h.id):await ve.from("store_sellers").insert(L);z?xe.error(z.message||"Não foi possÃvel salvar o colaborador."):(xe.success(h?"Colaborador atualizado.":"Colaborador cadastrado."),d(!1),await N()),l(!1)},R=async D=>{const{error:L}=await ve.from("store_sellers").update({is_active:!D.is_active}).eq("id",D.id);L?xe.error("Não foi possÃvel alterar o status."):await N()},I=async D=>{if(!window.confirm(`Excluir ${D.name}?`))return;const{error:L}=await ve.from("store_sellers").delete().eq("id",D.id);L?xe.error("Este colaborador já possui leads. Desative-o para preservar o histórico."):(xe.success("Colaborador excluÃdo."),await N())};return s.jsxs("div",{className:"h-full overflow-y-auto bg-background p-5 text-foreground custom-scrollbar md:p-8",children:[s.jsxs("div",{className:"mx-auto max-w-6xl space-y-6",children:[s.jsxs("header",{className:"flex flex-col justify-between gap-4 md:flex-row md:items-end",children:[s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-xs font-semibold uppercase text-primary-foreground
1169/70",children:"Distribuição de leads"}),s.jsx("h1",{className:"text-3xl font-bold",children:"Colaboradores"}),s.jsx("p",{className:"mt-1 text-sm text-primary-foreground/70",children:"Gerencie quem recebe os leads de cada loja."})]}),s.jsxs(Ne,{onClick:C,className:"gap-2 bg-card text-card-foreground hover:bg-card/90",children:[s.jsx(ts,{className:"h-4 w-4"})," Novo colaborador"]})]}),s.jsxs("section",{className:"grid gap-3 rounded-lg border border-primary-foreground/20 bg-card/95 p-4 md:grid-cols-[1fr_280px]",children:[s.jsxs("label",{className:"relative",children:[s.jsx(Gu,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),s.jsx(kt,{value:p,onChange:D=>v(D.target.value),placeholder:"Buscar por nome ou WhatsApp",className:"pl-9"})]}),s.jsxs("select",{value:b,onChange:D=>y(D.target.value),className:"h-10 rounded-md border border-input bg-secondary/50 px-3 text-sm text-foreground",children:[s.jsx("option",{value:"all",children:"Todas as lojas"}),t.map(D=>s.jsx("option",{value:D.id,children:D.name},D.id))]})]}),s.jsx("section",{className:"overflow-hidden rounded-lg border border-primary-foreground/20 bg-card/95",children:a?s.jsx("div",{className:"flex h-48 items-center justify-center",children:s.jsx(gt,{className:"h-7 w-7 animate-spin text-primary"})}):s.jsxs("div",{className:"overflow-x-auto",children:[s.jsxs("table",{className:"w-full min-w-[760px] text-sm",children:[s.jsx("thead",{className:"border-b border-border bg-secondary/60 text-left text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"Nome"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"WhatsApp"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Loja"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Função"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Status"}),s.jsx("th",{className:"px-5 py-3 text-right font-medium",children:"Ações"})]})}),s.jsx("tbody",{children:k.map(D=>s.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[s.jsx("td",{className:"px-5 py-4 font-semibold",children:D.name}),s.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:tN(D.whatsapp)}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(lu,{className:"h-4 w-4 text-primary"}),S(D.store_id)]})}),s.jsx("td",{className:"px-5 py-4",children:D.is_manager?"Gerente":"Vendedor(a)"}),s.jsx("td",{className:"px-5 py-4",children:s.jsx("button",{type:"button",onClick:()=>R(D),className:`rounded-full px-3 py-1 text-xs font-semibold ${D.is_active?"bg-emerald-500/15 text-emerald-400":"bg-muted text-muted-foreground"}`,children:D.is_active?"Ativo":"Inativo"})}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs("div",{className:"flex justify-end gap-1",children:[s.jsx(Ne,{variant:"ghost",size:"icon",onClick:()=>A(D),title:"Editar",children:s.jsx(yg,{className:"h-4 w-4"})}),s.jsx(Ne,{variant:"ghost",size:"icon",onClick:()=>I(D),title:"Excluir",children:s.jsx(cu,{className:"h-4 w-4 text-destructive"})})]})})]},D.id))})]}),k.length===0&&s.jsx("div",{className:"py-12 text-center text-sm text-muted-foreground",children:"Nenhum colaborador encontrado."})]})})]}),s.jsx(Ll,{open:u,onOpenChange:d,children:s.jsxs(bo,{children:[s.jsxs(wo,{children:[s.jsxs(_o,{className:"flex items-center gap-2",children:[s.jsx(MY,{className:"h-5 w-5 text-primary"}),h?"Editar colaborador":"Novo colaborador"]}),s.jsx(zu,{children:"Defina a pessoa e a loja que receberá os próximos leads."})]}),s.jsxs("div",{className:"space-y-4 py-2",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"collaborator-name",children:"Nome"}),s.jsx(kt,{id:"collaborator-name",value:x.name,onChange:D=>j(L=>({...L,name:D.target.value})),placeholder:"Nome completo"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"collaborator-phone",children:"Contato (WhatsApp)"}),s.jsx(kt,{id:"collaborator-phone",inputMode:"numeric",value:x.whatsapp,onChange:D=>j(L=>({...L,whatsapp:tN(D.target.value)})),placeholder:"+55 (91) 99999-9999"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"collaborator-store",children:"Loja"}),s.jsxs("select",{id:"collaborator-store",value:x.storeId,onChange:D=>j(L=>({...L,storeId:D.target.value})),className:"h-10 w-full rounded-md border border-input bg-secondary/50 px-3 text-sm",children:[s.jsx("option",{value:"",children:"Selecione uma loja"}),t.map(D=>s.jsx("option",{value:D.id,children:D.name},D.id))]})]}),s.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-secondary/30 p-4",children:[s.jsxs("div",{children:[s.jsx(pt,{htmlFor:"collaborator-manager",children:"Gerente"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Recebe uma cópia dos leads da loja."})]}),s.jsx(ux,{id:"collaborator-manager",checked:x.isManager,onCheckedChange:D=>j(L=>({...L,isManager:D})),className:"data-[state=checked]:bg-primary"})]})]}),s.jsxs(Vu,{children:[s.jsx(Ne,{variant:"ghost",onClick:()=>d(!1),children:"Cancelar"}),s.jsxs(Ne,{onClick:T,disabled:o,className:"gap-2",children:[o&&s.jsx(gt,{className:"h-4 w-4 animate-spin"}),h?"Salvar alterações":"Cadastrar"]})]})]})})]})},qc="Use no mÃnimo 8 caracteres, incluindo letra maiúscula, letra minúscula, número e caractere especial.",z2=t=>t.length>=8&&/[A-Z]/.test(t)&&/[a-z]/.test(t)&&/\d/.test(t)&&/[^A-Za-z0-9]/.test(t),DEe={admin:"Administrador",master:"Master",coordinator:"Coordenador"}
1169,$Ee={regional_1:"Regional 1",regional_2:"Regional 2"},UL={fullName:"",email:"",password:"",role:"coordinator",regional:"regional_1"},LEe=()=>{var C;const[t,e]=w.useState([]),[r,n]=w.useState(!0),[a,i]=w.useState(!1),[o,l]=w.useState(!1),[u,d]=w.useState(UL),[h,m]=w.useState(null),[p,v]=w.useState(""),[b,y]=w.useState(!1),{user:x}=Na(),j=((C=x==null?void 0:x.email)==null?void 0:C.toLowerCase())==="[email protected]",N=async()=>{n(!0);const{data:A,error:T}=await ve.from("panel_user_access").select("id, user_id, full_name, email, role, regional, is_active, must_change_password, created_at").order("created_at",{ascending:!0});T&&xe.error("Não foi possÃvel carregar os usuários."),e(A||[]),n(!1)},S=async A=>{if(A.preventDefault(),!h||!z2(p)){xe.error(qc);return}y(!0);try{const{data:T,error:R}=await ve.functions.invoke("manage-panel-users",{body:{action:"reset-password",userId:h.user_id,password:p}});if(R||(T==null?void 0:T.success)!==!0){xe.error((T==null?void 0:T.error)||"Não foi possÃvel redefinir a senha.");return}xe.success("Senha temporária criada. O usuário deverá substituÃ-la no próximo acesso."),m(null),v(""),await N()}finally{y(!1)}};w.useEffect(()=>{N()},[]);const k=async A=>{if(A.preventDefault(),u.fullName.trim().length<2||!u.email.includes("@")||!z2(u.password)){xe.error(`Preencha nome e e-mail corretamente. ${qc}`);return}i(!0);try{const{data:T,error:R}=await ve.functions.invoke("manage-panel-users",{body:{fullName:u.fullName.trim(),email:u.email.trim().toLowerCase(),password:u.password,role:u.role,regional:u.role==="coordinator"?u.regi
1169onal:null}});let I=T&&typeof T=="object"?T:null;if(R&&"context"in R&&R.context instanceof Response&&(I=await R.context.clone().json().catch(()=>I)),R||(T==null?void 0:T.success)!==!0){xe.error((I==null?void 0:I.error)||(R==null?void 0:R.message)||"Não foi possÃvel criar o usuário.");return}xe.success("Usuário criado e pronto para acessar o painel."),l(!1),d(UL),await N()}catch{xe.error("Não foi possÃvel conectar ao serviço de cadastro. Tente novamente.")}finally{i(!1)}};return s.jsxs("div",{className:"h-full overflow-y-auto bg-background p-5 text-foreground custom-scrollbar md:p-8",children:[s.jsxs("div",{className:"mx-auto max-w-6xl space-y-6",children:[s.jsxs("header",{className:"flex flex-col justify-between gap-4 md:flex-row md:items-end",children:[s.jsxs("div",{children:[s.jsx("p",{className:"mb-2 text-xs font-semibold uppercase text-primary-foreground/70",children:"Controle de acesso"}),s.jsx("h1",{className:"text-3xl font-bold",children:"Usuários do painel"}),s.jsx("p",{className:"mt-1 text-sm text-primary-foreground/70",children:"Cadastre acessos gerais ou limitados por regional."})]}),s.jsxs(Ne,{onClick:()=>l(!0),className:"gap-2 bg-card text-card-foreground hover:bg-card/90",children:[s.jsx(ts,{className:"h-4 w-4"})," Novo usuário"]})]}),s.jsx("section",{className:"overflow-hidden rounded-lg border border-primary-foreground/20 bg-card/95",children:r?s.jsx("div",{className:"flex h-48 items-center justify-center",children:s.jsx(gt,{className:"h-7 w-7 animate-spin text-primary"})}):s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full min-w-[720px] text-sm",children:[s.jsx("thead",{className:"border-b border-border bg-secondary/60 text-left text-muted-foreground",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-5 py-3 font-medium",children:"Nome"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"E-mail"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Perfil"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Regional"}),s.jsx("th",{className:"px-5 py-3 font-medium",children:"Situação"}),j&&s.jsx("th",{className:"px-5 py-3 font-medium",children:"Senha"})]})}),s.jsx("tbody",{children:t.map(A=>s.jsxs("tr",{className:"border-b border-border/70 last:border-0",children:[s.jsx("td",{className:"px-5 py-4 font-semibold",children:A.full_name}),s.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:A.email}),s.jsx("td",{className:"px-5 py-4",children:s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsx(n0,{className:"h-4 w-4 text-primary"}),DEe[A.role]]})}),s.jsx("td",{className:"px-5 py-4 text-muted-foreground",children:A.regional?$Ee[A.regional]:"Todas"}),s.jsx("td",{className:"px-5 py-4",children:s.jsx("span",{className:A.is_active?"text-emerald-400":"text-muted-foreground",children:A.is_active?"Ativo":"Inativo"})}),j&&s.jsx("td",{className:"px-5 py-4",children:A.email.toLowerCase()==="[email protected]"?s.jsx("span",{className:"text-muted-foreground",children:"â"}):s.jsxs(Ne,{size:"sm",variant:"outline",className:"gap-2",onClick:()=>m(A),children:[s.jsx(y8,{className:"h-4 w-4"}),"Resetar senha"]})})]},A.id))})]})})})]}),s.jsx(Ll,{open:o,onOpenChange:l,children:s.jsx(bo,{children:s.jsxs("form",{onSubmit:k,children:[s.jsxs(wo,{children:[s.jsxs(_o,{className:"flex items-center gap-2",children:[s.jsx(E8,{className:"h-5 w-5 text-primary"}),"Novo usuário"]}),s.jsx(zu,{children:"Defina o perfil e, para coordenadores, a regional permitida."})]}),s.jsxs("div",{className:"space-y-4 py-5",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"panel-user-name",children:"Nome completo"}),s.jsx(kt,{id:"panel-user-name",value:u.fullName,onChange:A=>d(T=>({...T,fullName:A.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"panel-user-email",children:"E-mail"}),s.jsx(kt,{id:"panel-user-email",type:"email",value:u.email,onChange:A=>d(T=>({...T,email:A.target.value}))})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"panel-user-password",children:"Senha inicial"}),s.jsx(kt,{id:"panel-user-password",type:"password",minLength:8,value:u.password,onChange:A=>d(T=>({...T,password:A.target.value}))}),s.jsx("p",{className:"text-xs text-muted-foreground",children:qc})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"panel-user-role",children:"Perfil de acesso"}),s.jsxs("select",{id:"panel-user-role",value:u.role,onChange:A=>d(T=>({...T,role:A.target.value})),className:"h-10 w-full rounded-md border border-input bg-secondary/50 px-3 text-sm",children:[s.jsx("option",{value:"coordinator",children:"Coordenador"}),s.jsx("option",{value:"master",children:"Master"})]})]}),u.role==="coordinator"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"panel-user-regional",children:"Regional permitida"}),s.jsxs("select",{id:"panel-user-regional",value:u.regional,onCh
1169ange:A=>d(T=>({...T,regional:A.target.value})),className:"h-10 w-full rounded-md border border-input bg-secondary/50 px-3 text-sm",children:[s.jsx("option",{value:"regional_1",children:"Regional 1"}),s.jsx("option",{value:"regional_2",children:"Regional 2"})]})]})]}),s.jsxs(Vu,{children:[s.jsx(Ne,{type:"button",variant:"ghost",onClick:()=>l(!1),children:"Cancelar"}),s.jsxs(Ne,{type:"submit",disabled:a,className:"gap-2",children:[a&&s.jsx(gt,{className:"h-4 w-4 animate-spin"}),"Criar usuário"]})]})]})})}),s.jsx(Ll,{open:!!h,onOpenChange:A=>{A||(m(null),v(""))},children:s.jsx(bo,{children:s.jsxs("form",{onSubmit:S,children:[s.jsxs(wo,{children:[s.jsx(_o,{children:"Resetar senha"}),s.jsxs(zu,{children:["Defina uma senha temporária para ",h==null?void 0:h.full_name,". A troca será obrigatória no próximo acesso."]})]}),s.jsxs("div",{className:"space-y-2 py-5",children:[s.jsx(pt,{htmlFor:"temporary-password",children:"Senha temporária"}),s.jsx(kt,{id:"temporary-password",type:"password",minLength:8,autoComplete:"new-password",value:p,onChange:A=>v(A.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:qc})]}),s.jsxs(Vu,{children:[s.jsx(Ne,{type:"button",variant:"ghost",onClick:()=>m(null),children:"Cancelar"}),s.jsxs(Ne,{type:"submit",disabled:b,className:"gap-2",children:[b&&s.jsx(gt,{className:"h-4 w-4 animate-spin"}),"Confirmar reset"]})]})]})})})]})},FEe=({children:t})=>{const{user:e,loading:r}=Na(),n=Vl();return r?s.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center",children:s.jsxs("div",{className:"flex flex-col items-center gap-4",children:[s.jsx(gt,{className:"h-8 w-8 animate-spin text-primary"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Carregando..."})]})}):e?s.jsx(s.Fragment,{children:t}):s.jsx(Jv,{to:"/auth",state:{from:n},replace:!0})},Ys=({children:t,roles:e})=>{const{role:r,loading:n,isCoordinator:a}=zl();return n?s.jsx("div",{className:"flex h-full items-center justify-center bg-background",children:s.jsx(gt,{className:"h-8 w-8 animate-spin text-primary"})}):!r||!e.includes(r)?s.jsx(Jv,{to:a?"/leads-campanha":"/dashboard",replace:!0}):s.jsx(s.Fragment,{children:t})};var XE={};(function t(e,r,n,a){var i=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),o=typeof Path2D=="function"&&typeof DOMMatrix=="function",l=(function(){if(!e.OffscreenCanvas)return!1;try{var B=new OffscreenCanvas(1,1),O=B.getContext("2d");O.fillRect(0,0,1,1);var W=B.transferToImageBitmap();O.createPattern(W,"no-repeat")}catch{return!1}return!0})();function u(){}function d(B){var O=r.exports.Promise,W=O!==void 0?O:e.Promise;return typeof W=="function"?new W(B):(B(u,u),null)}var h=(function(B,O){return{transform:function(W){if(B)return W;if(O.has(W))return O.get(W);var q=new OffscreenCanvas(W.width,W.height),se=q.getContext("2d");return se.drawImage(W,0,0),O.set(W,q),q},clear:function(){O.clear()}}})(l,new Map),m=(function(){var B=Math.floor(16.666666666666668),O,W,q={},se=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(O=function(me){var fe=Math.random();return q[fe]=requestAnimationFrame(function Q(pe){se===pe||se+B-1<pe?(se=pe,delete q[fe],me()):q[fe]=requestAnimationFrame(Q)}),fe},W=function(me){q[me]&&cancelAnimationFrame(q[me])}):(O=function(me){return setTimeout(me,B)},W=function(me){return clearTimeout(me)}),{frame:O,cancel:W}})(),p=(function(){var B,O,W={};function q(se){function me(fe,Q){se.postMessage({options:fe||{},callback:Q})}se.init=function(Q){var pe=Q.transferControlToOffscreen();se.postMessage({canvas:pe},[pe])},se.fire=function(Q,pe,V){if(O)return me(Q,null),O;var J=Math.random().toString(36).slice(2);return O=d(function(oe){function re(Me){Me.data.callback===J&&(delete W[J],se.removeEventListener("message",re),O=null,h.clear(),V(),oe())}se.addEventListener("message",re),me(Q,J),W[J]=re.bind(null,{data:{callback:J}})}),O},se.reset=function(){se.postMessage({reset:!0});for(var Q in W)W[Q](),delete W[Q]}}return function(){if(B)return B;if(!n&&i){var se=["var CONFETTI, SIZE = {}, module = {};","("+t.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(` 1170`);try{B=new Worker(URL.createObjectURL(new Blob([se])))}catch(me){return typeof console<"u"&&typeof console.warn=="function"&&console.warn("ð Could not load worker",me),null}q(B)}return B}})(),v={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};
vendor: 5,169 bytes, line 1170
1170function b(B,O){return O?O(B):B}function y(B){return B!=null}function x(B,O,W){return b(B&&y(B[O])?B[O]:v[O],W)}function j(B){return B<0?0:Math.floor(B)}function N(B,O){return Math.floor(Math.random()*(O-B))+B}function S(B){return parseInt(B,16)}function k(B){return B.map(C)}function C(B){var O=String(B).replace(/[^0-9a-f]/gi,"");return O.length<6&&(O=O[0]+O[0]+O[1]+O[1]+O[2]+O[2]),{r:S(O.substring(0,2)),g:S(O.substring(2,4)),b:S(O.substring(4,6))}}function A(B){var O=x(B,"origin",Object);return O.x=x(O,"x",Number),O.y=x(O,"y",Number),O}function T(B){B.width=document.documentElement.clientWidth,B.height=document.documentElement.clientHeight}function R(B){var O=B.getBoundingClientRect();B.width=O.width,B.height=O.height}function I(B){var O=document.createElement("canvas");return O.style.position="fixed",O.style.top="0px",O.style.left="0px",O.style.pointerEvents="none",O.style.zIndex=B,O}function D(B,O,W,q,se,me,fe,Q,pe){B.save(),B.translate(O,W),B.rotate(me),B.scale(q,se),B.arc(0,0,1,fe,Q,pe),B.restore()}function L(B){var O=B.angle*(Math.PI/180),W=B.spread*(Math.PI/180);return{x:B.x,y:B.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:B.startVelocity*.5+Math.random()*B.startVelocity,angle2D:-O+(.5*W-Math.random()*W),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:B.color,shape:B.shape,tick:0,totalTicks:B.ticks,decay:B.decay,drift:B.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:B.gravity*3,ovalScalar:.6,scalar:B.scalar,flat:B.flat}}function z(B,O){O.x+=Math.cos(O.angle2D)*O.velocity+O.drift,O.y+=Math.sin(O.angle2D)*O.velocity+O.gravity,O.velocity*=O.decay,O.flat?(O.wobble=0,O.wobbleX=O.x+10*O.scalar,O.wobbleY=O.y+10*O.scalar,O.tiltSin=0,O.tiltCos=0,O.random=1):(O.wobble+=O.wobbleSpeed,O.wobbleX=O.x+10*O.scalar*Math.cos(O.wobble),O.wobbleY=O.y+10*O.scalar*Math.sin(O.wobble),O.tiltAngle+=.1,O.tiltSin=Math.sin(O.tiltAngle),O.tiltCos=Math.cos(O.tiltAngle),O.random=Math.random()+2);var W=O.tick++/O.totalTicks,q=O.x+O.random*O.tiltCos,se=O.y+O.random*O.tiltSin,me=O.wobbleX+O.random*O.tiltCos,fe=O.wobbleY+O.random*O.tiltSin;if(B.fillStyle="rgba("+O.color.r+", "+O.color.g+", "+O.color.b+", "+(1-W)+")",B.beginPath(),o&&O.shape.type==="path"&&typeof O.shape.path=="string"&&Array.isArray(O.shape.matrix))B.fill(M(O.shape.path,O.shape.matrix,O.x,O.y,Math.abs(me-q)*.1,Math.abs(fe-se)*.1,Math.PI/10*O.wobble));else if(O.shape.type==="bitmap"){var Q=Math.PI/10*O.wobble,pe=Math.abs(me-q)*.1,V=Math.abs(fe-se)*.1,J=O.shape.bitmap.width*O.scalar,oe=O.shape.bitmap.height*O.scalar,re=new DOMMatrix([Math.cos(Q)*pe,Math.sin(Q)*pe,-Math.sin(Q)*V,Math.cos(Q)*V,O.x,O.y]);re.multiplySelf(new DOMMatrix(O.shape.matrix));var Me=B.createPattern(h.transform(O.shape.bitmap),"no-repeat");Me.setTransform(re),B.globalAlpha=1-W,B.fillStyle=Me,B.fillRect(O.x-J/2,O.y-oe/2,J,oe),B.globalAlpha=1}else if(O.shape==="circle")B.ellipse?B.ellipse(O.x,O.y,Math.abs(me-q)*O.ovalScalar,Math.abs(fe-se)*O.ovalScalar,Math.PI/10*O.wobble,0,2*Math.PI):D(B,O.x,O.y,Math.abs(me-q)*O.ovalScalar,Math.abs(fe-se)*O.ovalScalar,Math.PI/10*O.wobble,0,2*Math.PI);else if(O.shape==="star")for(var ee=Math.PI/2*3,ce=4*O.scalar,je=8*O.scalar,de=O.x,we=O.y,ke=5,Y=Math.PI/ke;ke--;)de=O.x+Math.cos(ee)*je,we=O.y+Math.sin(ee)*je,B.lineTo(de,we),ee+=Y,de=O.x+Math.cos(ee)*ce,we=O.y+Math.sin(ee)*ce,B.lineTo(de,we),ee+=Y;else B.moveTo(Math.floor(O.x),Math.floor(O.y)),B.lineTo(Math.floor(O.wobbleX),Math.floor(se)),B.lineTo(Math.floor(me),Math.floor(fe)),B.lineTo(Math.floor(q),Math.floor(O.wobbleY));return B.closePath(),B.fill(),O.tick<O.totalTicks}function H(B,O,W,q,se){var me=O.slice(),fe=B.getContext("2d"),Q,pe,V=d(function(J){function oe(){Q=pe=null,fe.clearRect(0,0,q.width,q.height),h.clear(),se(),J()}function re(){n&&!(q.width===a.width&&q.height===a.height)&&(q.width=B.width=a.width,q.height=B.height=a.height),!q.width&&!q.height&&(W(B),q.width=B.width,q.height=B.height),fe.clearRect(0,0,q.width,q.height),me=me.filter(function(Me){return z(fe,Me)}),me.length?Q=m.frame(re):oe()}Q=m.frame(re),pe=oe});return{addFettis:function(J){return me=me.concat(J),V},canvas:B,promise:V,reset:function(){Q&&m.cancel(Q),pe&&pe()}}}function Z(B,O){var W=!B,q=!!x(O||{},"resize"),se=!1,me=x(O,"disableForReducedMotion",Boolean),fe=i&&!!x(O||{},"useWorker"),Q=fe?p():null,pe=W?T:R,V=B&&Q?!!B.__confetti_initialized:!1,J=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,oe;function re(ee,ce,je){for(var de=x(ee,"particleCount",j),we=x(ee,"angle",Number),ke=x(ee,"spread",Number),Y=x(ee,"startVelocity",Number),ne=x(ee,"decay",Number),le=x(ee,"gravity",Number),Se=x(ee,"drift",Number),Ae=x(ee,"colors",k),Ce=x(ee,"ticks",Number),$e=x(ee,"shapes"),Be=x(ee,"scalar"),tt=!!x(ee,"flat"),Dt=A(ee),ye=de,mt=[],qt=B.width*Dt.x,cr=B.height*Dt.y;ye--;)mt.push(L({x:qt,y:cr,angle:we,spread:ke,startVelocity:Y,color:Ae[ye%Ae.length],shape:$e[N(0,$e.length)],ticks:Ce,decay:ne,gravity:le,drift:Se,scalar:Be,flat:tt}));return oe?oe.addFettis(mt):(oe=H(B,mt,pe,ce,je),oe.promise)}function Me(ee){var ce=me||x(ee,"disableForReducedMotion",Boolean),je=x(ee,"zIndex",Number);if(ce&&J)return d(function(Y){Y()});
vendor: 4,384 bytes, line 1170
1170W&&oe?B=oe.canvas:W&&!B&&(B=I(je),document.body.appendChild(B)),q&&!V&&pe(B);var de={width:B.width,height:B.height};Q&&!V&&Q.init(B),V=!0,Q&&(B.__confetti_initialized=!0);function we(){if(Q){var Y={getBoundingClientRect:function(){if(!W)return B.getBoundingClientRect()}};pe(Y),Q.postMessage({resize:{width:Y.width,height:Y.height}});return}de.width=de.height=null}function ke(){oe=null,q&&(se=!1,e.removeEventListener("resize",we)),W&&B&&(document.body.contains(B)&&document.body.removeChild(B),B=null,V=!1)}return q&&!se&&(se=!0,e.addEventListener("resize",we,!1)),Q?Q.fire(ee,de,ke):re(ee,de,ke)}return Me.reset=function(){Q&&Q.reset(),oe&&oe.reset()},Me}var te;function G(){return te||(te=Z(null,{useWorker:!0,resize:!0})),te}function M(B,O,W,q,se,me,fe){var Q=new Path2D(B),pe=new Path2D;pe.addPath(Q,new DOMMatrix(O));var V=new Path2D;return V.addPath(pe,new DOMMatrix([Math.cos(fe)*se,Math.sin(fe)*se,-Math.sin(fe)*me,Math.cos(fe)*me,W,q])),V}function F(B){if(!o)throw new Error("path confetti are not supported in this browser");var O,W;typeof B=="string"?O=B:(O=B.path,W=B.matrix);var q=new Path2D(O),se=document.createElement("canvas"),me=se.getContext("2d");if(!W){for(var fe=1e3,Q=fe,pe=fe,V=0,J=0,oe,re,Me=0;Me<fe;Me+=2)for(var ee=0;ee<fe;ee+=2)me.isPointInPath(q,Me,ee,"nonzero")&&(Q=Math.min(Q,Me),pe=Math.min(pe,ee),V=Math.max(V,Me),J=Math.max(J,ee));oe=V-Q,re=J-pe;var ce=10,je=Math.min(ce/oe,ce/re);W=[je,0,0,je,-Math.round(oe/2+Q)*je,-Math.round(re/2+pe)*je]}return{type:"path",path:O,matrix:W}}function K(B){var O,W=1,q="#000000",se='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof B=="string"?O=B:(O=B.text,W="scalar"in B?B.scalar:W,se="fontFamily"in B?B.fontFamily:se,q="color"in B?B.color:q);var me=10*W,fe=""+me+"px "+se,Q=new OffscreenCanvas(me,me),pe=Q.getContext("2d");pe.font=fe;var V=pe.measureText(O),J=Math.ceil(V.actualBoundingBoxRight+V.actualBoundingBoxLeft),oe=Math.ceil(V.actualBoundingBoxAscent+V.actualBoundingBoxDescent),re=2,Me=V.actualBoundingBoxLeft+re,ee=V.actualBoundingBoxAscent+re;J+=re+re,oe+=re+re,Q=new OffscreenCanvas(J,oe),pe=Q.getContext("2d"),pe.font=fe,pe.fillStyle=q,pe.fillText(O,Me,ee);var ce=1/W;return{type:"bitmap",bitmap:Q.transferToImageBitmap(),matrix:[ce,0,0,ce,-J*ce/2,-oe*ce/2]}}r.exports=function(){return G().apply(this,arguments)},r.exports.reset=function(){G().reset()},r.exports.create=Z,r.exports.shapeFromPath=F,r.exports.shapeFromText=K})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),XE,!1);const BEe=XE.exports;XE.exports.create;const VEe={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.1}}},rN={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},zEe=({companyName:t,sdrName:e,onCompanyNameChange:r,onSdrNameChange:n})=>s.jsxs(Ie.div,{className:"space-y-8",variants:VEe,initial:"hidden",animate:"visible",children:[s.jsxs(Ie.div,{variants:rN,className:"text-center mb-8",children:[s.jsx(Ie.div,{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-gradient-to-br from-primary/20 to-accent/20 border border-primary/30 flex items-center justify-center",whileHover:{scale:1.05,rotate:5},transition:{type:"spring",stiffness:400},children:s.jsx(Lf,{className:"w-8 h-8 text-primary"})}),s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Identidade da Empresa"}),s.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:"Configure como sua empresa e agente de IA serão identificados no sistema."})]}),s.jsxs("div",{className:"space-y-6 max-w-md mx-auto",children:[s.jsxs(Ie.div,{variants:rN,className:"space-y-2",children:[s.jsxs(pt,{htmlFor:"companyName",className:"flex items-center gap-2",children:[s.jsx(Lf,{className:"w-4 h-4 text-muted-foreground"}),"Nome da Empresa"]}),s.jsx(kt,{id:"companyName",value:t,onChange:a=>r(a.target.value),placeholder:"Ex: Minha Empresa LTDA",className:"focus:ring-primary"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Aparecerá no header e comunicações"})]}),s.jsxs(Ie.div,{variants:rN,className:"space-y-2",children:[s.jsxs(pt,{htmlFor:"sdrName",className:"flex items-center gap-2",children:[s.jsx(mn,{className:"w-4 h-4 text-muted-foreground"}),"Nome do Agente (SDR)"]}
1170),s.jsx(kt,{id:"sdrName",value:e,onChange:a=>n(a.target.value),placeholder:"Ex: Julia, Carlos, Nina...",className:"focus:ring-primary"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Nome que a IA usará ao se apresentar"})]})]}),(t||e)&&s.jsxs(Ie.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,damping:24},className:"mt-8 p-4 rounded-xl bg-secondary/30 border border-border max-w-md mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground mb-3",children:[s.jsx(su,{className:"w-3 h-3"}),"Preview"]}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{className:"text-muted-foreground",children:[s.jsx("span",{className:"text-muted-foreground/70",children:"Empresa:"})," ",s.jsx("span",{className:"text-foreground font-medium",children:t||"Sua Empresa"})]}),s.jsxs("p",{className:"text-muted-foreground",children:[s.jsx("span",{className:"text-muted-foreground/70",children:"Agente:"})," ",s.jsx("span",{className:"text-primary font-medium",children:e||"Agente"})]})]})]})]}),UEe={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.1}}},Pc={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},qL=()=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let e="viver-ia-";for(let r=0;r<16;r++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},qEe=({accessToken:t,phoneNumberId:e,businessAccountId:r,verifyToken:n,onAccessTokenChange:a,onPhoneNumberIdChange:i,onBusinessAccountIdChange:o,onVerifyTokenChange:l,webhookUrl:u})=>{const[d,h]=w.useState(!1),[m,p]=w.useState(null);w.useEffect(()=>{(!n||n==="viver-de-ia-nina-webhook")&&l(qL())},[]);const v=(y,x)=>{navigator.clipboard.writeText(y),p(x),setTimeout(()=>p(null),2e3)},b=()=>{l(qL())};return s.jsxs(Ie.div,{className:"space-y-8",variants:UEe,initial:"hidden",animate:"visible",children:[s.jsxs(Ie.div,{variants:Pc,className:"text-center mb-8",children:[s.jsx(Ie.div,{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-gradient-to-br from-emerald-500/20 to-green-500/20 border border-emerald-500/30 flex items-center justify-center",whileHover:{scale:1.05,rotate:5},transition:{type:"spring",stiffness:400},children:s.jsx(Tn,{className:"w-8 h-8 text-emerald-400"})}),s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"WhatsApp Cloud API"}),s.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:"Conecte sua conta do WhatsApp Business para enviar e receber mensagens."})]}),s.jsxs("div",{className:"space-y-6 max-w-md mx-auto",children:[s.jsxs(Ie.div,{variants:Pc,className:"space-y-2",children:[s.jsxs(pt,{htmlFor:"accessToken",className:"flex items-center gap-2",children:[s.jsx(lN,{className:"w-4 h-4 text-muted-foreground"}),"Access Token"]}),s.jsx(kt,{id:"accessToken",type:"password",value:t,onChange:y=>a(y.target.value),placeholder:"EAAxxxxxxxx...",className:"font-mono text-sm focus:ring-emerald-500"})]}),s.jsxs(Ie.div,{variants:Pc,className:"space-y-2",children:[s.jsxs(pt,{htmlFor:"phoneNumberId",className:"flex items-center gap-2",children:[s.jsx(Hu,{className:"w-4 h-4 text-muted-foreground"}),"Phone Number ID"]}),s.jsx(kt,{id:"phoneNumberId",value:e,onChange:y=>i(y.target.value),placeholder:"123456789012345",className:"font-mono text-sm focus:ring-emerald-500"})]}),s.jsxs(Ie.div,{variants:Pc,className:"space-y-2",children:[s.jsxs(pt,{htmlFor:"businessAccountId",className:"flex items-center gap-2",children:[s.jsx(Lf,{className:"w-4 h-4 text-muted-foreground"}),"Business Account ID (WABA)"]}),s.jsx(kt,{id:"businessAccountId",value:r,onChange:y=>o(y.target.value),placeholder:"123456789012345",className:"font-mono text-sm focus:ring-emerald-500"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Encontrado em Meta Business Suite â Configurações â WhatsApp Accounts"})]}),s.jsxs(Ie.div,{variants:Pc,className:"pt-4 border-t border-border",children:[s.jsxs(Ie.button,{onClick:()=>h(!d),whileHover:{x:4},className:"flex items-center justify-between w-full text-left text-sm text-muted-foreground hover:text-foreground transition-colors",children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx(Qi,{className:"w-4 h-4"}),"Configuração de Webhook"]}),s.jsx(Ie.div,{animate:{rotate:d?180:0},transition:{duration:.2},children:s.jsx(Ga,{className:"w-4 h-4"})})]}),s.jsx(Ag,{children:d&&s.jsx(Ie.div,{initial:{opacity:0,height:0}
1170,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},className:"overflow-hidden",children:s.jsxs("div",{className:"mt-4 space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{className:"text-muted-foreground text-xs",children:"Webhook URL"}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(kt,{value:u,readOnly:!0,className:"bg-background border-border font-mono text-xs flex-1"}),s.jsx(Ne,{variant:"ghost",size:"sm",onClick:()=>v(u,"url"),className:"px-3",children:m==="url"?s.jsx(ci,{className:"w-4 h-4 text-emerald-400"}):s.jsx(iN,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs(pt,{htmlFor:"verifyToken",className:"text-muted-foreground text-xs flex items-center gap-2",children:["Verify Token",s.jsxs("span",{className:"text-emerald-400 flex items-center gap-1 text-[10px]",children:[s.jsx(C8,{className:"w-3 h-3"}),"Auto-gerado"]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(kt,{id:"verifyToken",value:n,readOnly:!0,className:"bg-background border-border font-mono text-xs flex-1"}),s.jsx(Ne,{variant:"ghost",size:"sm",onClick:()=>v(n,"token"),className:"px-3",disabled:!n,children:m==="token"?s.jsx(ci,{className:"w-4 h-4 text-emerald-400"}):s.jsx(iN,{className:"w-4 h-4"})}),s.jsx(Ne,{variant:"ghost",size:"sm",onClick:b,className:"px-3",title:"Regenerar token",children:s.jsx(lo,{className:"w-4 h-4"})})]}),s.jsx("p",{className:"text-[10px] text-muted-foreground",children:"Token gerado automaticamente. Use este mesmo valor no Meta Business."})]}),s.jsxs("div",{className:"p-3 rounded-lg bg-primary/10 border border-primary/20",children:[s.jsx("p",{className:"text-xs text-primary font-medium mb-2",children:"Como configurar:"}),s.jsxs("ol",{className:"text-xs text-primary/80 space-y-1 list-decimal list-inside",children:[s.jsx("li",{children:"Copie a Webhook URL e o Verify Token"}),s.jsxs("li",{children:["Acesse o ",s.jsx("a",{href:"https://developers.facebook.com/apps",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline font-medium",children:"Meta Business Dashboard"})]}),s.jsx("li",{children:"Vá em WhatsApp â Configuration â Webhook"}),s.jsx("li",{children:"Cole os valores e selecione: messages, message_echoes"})]})]})]})})})]})]}),s.jsx(Ie.div,{variants:Pc,className:"text-center pt-4",children:s.jsxs(Ie.a,{href:"https://developers.facebook.com/docs/whatsapp/cloud-api/get-started",target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.02},className:"inline-flex items-center gap-2 text-sm text-primary hover:text-primary/80 transition-colors",children:[s.jsx(Qi,{className:"w-4 h-4"}),"Como obter as credenciais do WhatsApp"]})})]})},WEe=[{value:"flash",label:"Gemini Flash",description:"Rápido e econômico"},{value:"pro",label:"Gemini Pro 2.5",description:"Mais inteligente"},{value:"pro3",label:"Gemini Pro 3",description:"Ãltima geração"},{value:"adaptive",label:"Modo Adaptativo",description:"Alterna automaticamente"}],HEe={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.1}}},ng={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},GEe=({systemPrompt:t,aiModelMode:e,onSystemPromptChange:r,onAiModelModeChange:n,onGeneratePrompt:a,isGenerating:i=!1})=>s.jsxs(Ie.div,{className:"space-y-8",variants:HEe,initial:"hidden",animate:"visible",children:[s.jsxs(Ie.div,{variants:ng,className:"text-center mb-8",children:[s.jsx(Ie.div,{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-gradient-to-br from-accent/20 to-primary/20 border border-accent/30 flex items-center justify-center",whileHover:{scale:1.05,rotate:5},transition:{type:"spring",stiffness:400},children:s.jsx(Or,{className:"w-8 h-8 text-accent"})}),s.jsx("h3",{className:"text-xl font-semibold text-foreground mb-2",children:"Configurar Agente"}),s.jsx("p",{className:"text-muted-foreground text-sm max-w-md mx-auto",children:"Defina a personalidade e comportamento do seu agente de IA."})]}),s.jsxs("div",{className:"space-y-6 max-w-lg mx-auto",children:[s.jsxs(Ie.div,{variants:ng,className:"space-y-2",children:[s.jsxs(pt,{className:"flex items-center gap-2",children:[s.jsx(sY,{className:"w-4 h-4 text-muted-foreground"}),"Modelo de IA"]}),s.jsxs(Qn,{value:e,onValueChange:n,children:[s.jsx(Mn,{children:s.jsx(Jn,{placeholder:"Selecione o modelo"})}),s.jsx(Rn,{children:WEe.map(o=>s.jsx(on,{value:o.value,children:s.jsxs("div",{className:"flex flex-col",children:[s.jsx("span",{children:o.label}),s.jsx("span",{className:"text-xs text-muted-foreground",children:o.description})]})},o.value))})]})]}),s.jsxs(Ie.div,{variants:ng,className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(pt,{htmlFor:"systemPrompt",className:"flex items-center gap-2",children:[s.jsx(Or,{className:"w-4 h-4 text-muted-foreground"}),"Prompt do Sistema"]}),s.jsx(Ie.div,{whileHover:{scale:1.05},whileTap:{scale:.95},children:s.jsxs(Ne,{variant:"ghost",size:"sm",onClick:a,disabled:i,className:"text-xs text-accent hover:text-accent/80 gap-1",children:[s.jsx(wg,{className:"w-3 h-3"}),i?"Gerando...":"Gerar com IA"]})})]}),s.jsx(Dh,{id:"systemPrompt",value:t,onChange:o=>r(o.target.value),placeholder:"Descreva como o agente deve se comportar, qual seu tom de voz, objetivos, e informações importantes sobre a empresa...",className:"min-h-[200px] resize-none focus:ring-accent"}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:["Use variáveis como ","{{ cliente_nome }}",", ","{{ data_hora }}"," para personalização dinâmica."]})]}),s.jsxs(Ie.div,{variants:ng,className:"p-4 rounded-xl bg-secondary/30 border border-border",children:[s.jsxs("h4",{className:"text-sm font-medium text-foreground mb-2 flex items-center gap-2",children:[s.jsx(mY,{className:"w-4 h-4 text-accent"}),"Dicas para um bom prompt"]}),s.jsxs("ul",{className:"text-xs text-muted-foreground space-y-1",children:[s.jsx("li",{children:"⢠Defina claramente o objetivo do agente (vendas, suporte, etc)"}),s.jsx("li",{children:"⢠Especifique o tom de voz (formal, casual, amigável)"}),s.jsx("li",{children:"⢠Inclua informações sobre produtos/serviços"}),s.jsx("li",{children:"⢠Defina limites do que o agente pode ou não fazer"})]})]})]})]});var NW=["PageUp","PageDown"],SW=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],CW={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},hd="Slider",[U2,KEe,YEe]=mE(hd),[kW]=Ca(hd,[YEe]),[XEe,xx]=kW(hd),EW=w.forwardRef((t,e)=>{const{name:r,min:n=0,max:a=100,step:i=1,orientation:o="horizontal",disabled:l=!1,minStepsBetweenThumbs:u=0,defaultValue:d=[n],value:h,onValueChange:m=()=>{},onValueCommit:p=()=>{},inverted:v=!1,form:b,...y}=t,x=w.useRef(new Set),j=w.useRef(0),S=o==="horizontal"?ZEe:QEe,[k=[],C]=Os({prop:h,defaultProp:d,onChange:L=>{var H;(H=[...x.current][j.current])==null||H.focus(),m(L)}}),A=w.useRef(k);function T(L){const z=nAe(k,L);D(L,z)}function R(L){D(L,j.current)}function I(){const L=A.current[j.current];k[j.current]!==L&&p(k)}function D(L,z,{commit:H}={commit:!1}){const Z=oAe(i),te=lAe(Math.round((L-n)/i)*i+n,Z),G=Kv(te,[n,a]);C((M=[])=>{const F=tAe(M,G,z);if(iAe(F,u*i)){j.current=F.indexOf(G);const K=String(F)!==String(M);return K&&H&&p(F),K?F:M}else return M})}return s.jsx(XEe,{scope:t.__scopeSlider,name:r,disabled:l,min:n,max:a,valueIndexToChangeRef:j,thumbs:x.current,values:k,orientation:o,form:b,children:s.jsx(U2.Provider,{scope:t.__scopeSlider,children:s.jsx(U2.Slot,{scope:t.__scopeSlider,children:s.jsx(S,{"aria-disabled":l,"data-disabled":l?"":void 0,...y,ref:e,onPointerDown:et(y.onPointerDown,()=>{l||(A.current=k)}),min:n,max:a,inverted:v,onSlideStart:l?void 0:T,onSlideMove:l?void 0:R,onSlideEnd:l?void 0:I,onHomeKeyDown:()=>!l&&D(n,0,{commit:!0}),onEndKeyDown:()=>!l&&D(a,k.length-1,{commit:!0}),onStepKeyDown:({event:L,direction:z})=>{if(!l){const te=NW.includes(L.key)||L.shiftKey&&SW.includes(L.key)?10:1,G=j.current,M=k[G],F=i*te*z;D(M+F,G,{commit:!0})}}})})})})});EW.displayName=hd;var[AW,PW]=kW(hd,{startEdge:"left",endEdge:"right",size:"width",direction:1}),ZEe=w.forwardRef((t,e)=>{const{min:r,max:n,dir:a,inverted:i,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...h}
1170=t,[m,p]=w.useState(null),v=Nt(e,S=>p(S)),b=w.useRef(void 0),y=tx(a),x=y==="ltr",j=x&&!i||!x&&i;function N(S){const k=b.current||m.getBoundingClientRect(),C=[0,k.width],T=ZE(C,j?[r,n]:[n,r]);return b.current=k,T(S-k.left)}return s.jsx(AW,{scope:t.__scopeSlider,startEdge:j?"left":"right",endEdge:j?"right":"left",direction:j?1:-1,size:"width",children:s.jsx(TW,{dir:y,"data-orientation":"horizontal",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:S=>{const k=N(S.clientX);o==null||o(k)},onSlideMove:S=>{const k=N(S.clientX);l==null||l(k)},onSlideEnd:()=>{b.current=void 0,u==null||u()},onStepKeyDown:S=>{const C=CW[j?"from-left":"from-right"].includes(S.key);d==null||d({event:S,direction:C?-1:1})}})})}),QEe=w.forwardRef((t,e)=>{const{min:r,max:n,inverted:a,onSlideStart:i,onSlideMove:o,onSlideEnd:l,onStepKeyDown:u,...d}=t,h=w.useRef(null),m=Nt(e,h),p=w.useRef(void 0),v=!a;function b(y){const x=p.current||h.current.getBoundingClientRect(),j=[0,x.height],S=ZE(j,v?[n,r]:[r,n]);return p.current=x,S(y-x.top)}return s.jsx(AW,{scope:t.__scopeSlider,startEdge:v?"bottom":"top",endEdge:v?"top":"bottom",size:"height",direction:v?1:-1,children:s.jsx(TW,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:y=>{const x=b(y.clientY);i==null||i(x)},onSlideMove:y=>{const x=b(y.clientY);o==null||o(x)},onSlideEnd:()=>{p.current=void 0,l==null||l()},onStepKeyDown:y=>{const j=CW[v?"from-bottom":"from-top"].includes(y.key);u==null||u({event:y,direction:j?-1:1})}})})}),TW=w.forwardRef((t,e)=>{const{__scopeSlider:r,onSlideStart:n,onSlideMove:a,onSlideEnd:i,onHomeKeyDown:o,onEndKeyDown:l,onStepKeyDown:u,...d}
1170=t,h=xx(hd,r);return s.jsx(ht.span,{...d,ref:e,onKeyDown:et(t.onKeyDown,m=>{m.key==="Home"?(o(m),m.preventDefault()):m.key==="End"?(l(m),m.preventDefault()):NW.concat(SW).includes(m.key)&&(u(m),m.preventDefault())}),onPointerDown:et(t.onPointerDown,m=>{const p=m.target;p.setPointerCapture(m.pointerId),m.preventDefault(),h.thumbs.has(p)?p.focus():n(m)}),onPointerMove:et(t.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&a(m)}),onPointerUp:et(t.onPointerUp,m=>{const p=m.target;p.hasPointerCapture(m.pointerId)&&(p.releasePointerCapture(m.pointerId),i(m))})})}),OW="SliderTrack",MW=w.forwardRef((t,e)=>{const{__scopeSlider:r,...n}=t,a=xx(OW,r);return s.jsx(ht.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...n,ref:e})});MW.displayName=OW;var q2="SliderRange",RW=w.forwardRef((t,e)=>{const{__scopeSlider:r,...n}=t,a=xx(q2,r),i=PW(q2,r),o=w.useRef(null),l=Nt(e,o),u=a.values.length,d=a.values.map(p=>$W(p,a.min,a.max)),h=u>1?Math.min(...d):0,m=100-Math.max(...d);return s.jsx(ht.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...n,ref:l,style:{...t.style,[i.startEdge]:h+"%",[i.endEdge]:m+"%"}})});RW.displayName=q2;var W2="SliderThumb",IW=w.forwardRef((t,e)=>{const r=KEe(t.__scopeSlider),[n,a]=w.useState(null),i=Nt(e,l=>a(l)),o=w.useMemo(()=>n?r().findIndex(l=>l.ref.current===n):-1,[r,n]);return s.jsx(JEe,{...t,ref:i,index:o})}),JEe=w.forwardRef((t,e)=>{const{__scopeSlider:r,index:n,name:a,...i}=t,o=xx(W2,r),l=PW(W2,r),[u,d]=w.useState(null),h=Nt(e,N=>d(N)),m=u?o.form||!!u.closest("form"):!0,p=aE(u),v=o.values[n],b=v===void 0?0:$W(v,o.min,o.max),y=rAe(n,o.values.length),x=p==null?void 0:p[l.size],j=x?aAe(x,b,l.direction):0;return w.useEffect(()=>{if(u)return o.thumbs.add(u),()=>{o.thumbs.delete(u)}},[u,o.thumbs]),s.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[l.startEdge]:`calc(${b}% + ${j}px)`},children:[s.jsx(U2.ItemSlot,{scope:t.__scopeSlider,children:s.jsx(ht.span,{role:"slider","aria-label":t["aria-label"]||y,"aria-valuemin":o.min,"aria-valuenow":v,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...i,ref:h,style:v===void 0?{display:"none"}:t.style,onFocus:et(t.onFocus,()=>{o.valueIndexToChangeRef.current=n})})}),m&&s.jsx(DW,{name:a??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:v},n)]})});IW.displayName=W2;var eAe="RadioBubbleInput",DW=w.forwardRef(({__scopeSlider:t,value:e,...r},n)=>{const a=w.useRef(null),i=Nt(a,n),o=CE(e);return w.useEffect(()=>{const l=a.current;if(!l)return;const u=window.HTMLInputElement.prototype,h=Object.getOwnPropertyDescriptor(u,"value").set;if(o!==e&&h){const m=new Event("input",{bubbles:!0});h.call(l,e),l.dispatchEvent(m)}},[o,e]),s.jsx(ht.input,{style:{display:"none"},...r,ref:i,defaultValue:e})});DW.displayName=eAe;function tAe(t=[],e,r){const n=[...t];return n[r]=e,n.sort((a,i)=>a-i)}function $W(t,e,r){const i=100/(r-e)*(t-e);return Kv(i,[0,100])}function rAe(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function nAe(t,e){if(t.length===1)return 0;const r=t.map(a=>Math.abs(a-e)),n=Math.min(...r);return r.indexOf(n)}function aAe(t,e,r){const n=t/2,i=ZE([0,50],[0,n]);return(n-i(e)*r)*r}function sAe(t){return t.slice(0,-1).map((e,r)=>t[r+1]-e)}function iAe(t,e){if(e>0){const r=sAe(t);return Math.min(...r)>=e}return!0}function ZE(t,e){return r=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const n=(e[1]-e[0])/(t[1]-t[0]);return e[0]+n*(r-t[0])}}function oAe(t){return(String(t).split(".")[1]||"").length}function lAe(t,e){const r=Math.pow(10,e);return Math.round(t*r)/r}var LW=EW,cAe=MW,uAe=RW,dAe=IW;const pg=w.forwardRef(({className:t,...e},r)=>s.jsxs(LW,{ref:r,className:Qe("relative flex w-full touch-none select-none items-center",t),...e,children:[s.jsx(cAe,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-slate-600",children:s.jsx(uAe,{className:"absolute h-full bg-violet-500"})}
1170),s.jsx(dAe,{className:"block h-4 w-4 rounded-full border-2 border-violet-500 bg-white shadow transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-400 disabled:pointer-events-none disabled:opacity-50"})]}));pg.displayName=LW.displayName;const fAe={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.1}}},Jo={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},WL=[{id:"33B4UnXyTNbgLmdEDh5P",name:"Keren - Young Brazilian Female",description:"Feminina, brasileira (Padrão)"},{id:"9BWtsMINqrJLrRacOk9x",name:"Aria",description:"Feminina, natural"},{id:"CwhRBWXzGAHq8TQ4Fs17",name:"Roger",description:"Masculina, profissional"},{id:"EXAVITQu4vr4xnSDxMaL",name:"Sarah",description:"Feminina, amigável"},{id:"FGY2WhTYpPnrIDTdsKH5",name:"Laura",description:"Feminina, suave"},{id:"IKne3meq5aSn9XLyUdCD",name:"Charlie",description:"Masculina, casual"},{id:"JBFqnCBsd6RMkjVDRZzb",name:"George",description:"Masculina, britânica"},{id:"TX3LPaxmHKxFdv7VOQHJ",name:"Liam",description:"Masculina, jovem"},{id:"XB0fDUnXU5powFXDhCwa",name:"Charlotte",description:"Feminina, elegante"},{id:"pFZP5JQG7iQjIQuC4Bku",name:"Lily",description:"Feminina, expressiva"},{id:"onwK4e9ZLuTAKqWW03F9",name:"Daniel",description:"Masculina, clara"}],hAe=[{id:"eleven_turbo_v2_5",name:"Turbo v2.5",description:"Rápido, 32 idiomas"},{id:"eleven_multilingual_v2",name:"Multilingual v2",description:"Alta qualidade, 29 idiomas"},{id:"eleven_turbo_v2",name:"Turbo v2",description:"Rápido, apenas inglês"}],mAe=({elevenLabsApiKey:t,elevenLabsVoiceId:e,elevenLabsModel:r,audioResponseEnabled:n,elevenLabsStability:a,elevenLabsSimilarityBoost:i,elevenLabsSpeed:o,onApiKeyChange:l,onVoiceIdChange:u,onModelChange:d,onAudioEnabledChange:h,onStabilityChange:m,onSimilarityBoostChange:p,onSpeedChange:v})=>{const[b,y]=w.useState(!1),[x,j]=w.useState(!1),N=async()=>{if(!t){xe.error("Digite a API Key primeiro");return}j(!0);try{const{data:k,error:C}=await ve.functions.invoke("test-elevenlabs-tts",{body:{text:"Olá! Esta é uma mensagem de teste do sistema de voz.",apiKey:t,voiceId:e,model:r,stability:a,similarityBoost:i,speed:o}});if(C)throw C;if(k!=null&&k.success&&(k!=null&&k.audioBase64)){const A=new Blob([Uint8Array.from(atob(k.audioBase64),I=>I.charCodeAt(0))],{type:"audio/mpeg"}),T=URL.createObjectURL(A);new Audio(T).play(),xe.success(`Ãudio reproduzido com sucesso! (${(k.duration_ms/1e3).toFixed(1)}s)`)}else{if(k!=null&&k.error)throw new Error(k.error);xe.success("Teste de voz concluÃdo!")}}catch(k){console.error("Error testing voice:",k),xe.error(k.message||"Erro ao testar voz")}finally{j(!1)}},S=WL.find(k=>k.id===e);return s.jsxs(Ie.div,{className:"space-y-8",variants:fAe,initial:"hidden",animate:"visible",children:[s.jsxs(Ie.div,{variants:Jo,className:"text-center mb-8",children:[s.jsx(Ie.div,{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-gradient-to-br from-violet-500/20 to-fuchsia-500/20 border border-violet-500/30 flex items-center justify-center",whileHover:{scale:1.05,rotate:5},transition:{type:"spring",stiffness:400},children:s.jsx(Ff,{className:"w-8 h-8 text-violet-400"})}),s.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Respostas em Ãudio"}),s.jsx("p",{className:"text-slate-400 text-sm max-w-md mx-auto",children:"Configure o ElevenLabs para que seu agente responda também por áudio."}),s.jsx("p",{className:"text-xs text-amber-400/80 mt-2",children:"â¡ Esta configuração é opcional"})]}),s.jsxs("div",{className:"space-y-6 max-w-md mx-auto",children:[s.jsxs(Ie.div,{variants:Jo,className:"flex items-center justify-between p-4 rounded-lg bg-slate-800/30 border border-slate-700/50",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(sg,{className:"w-5 h-5 text-violet-400"}),s.jsxs("div",{children:[s.jsx(pt,{className:"text-slate-300",children:"Habilitar Respostas em Ãudio"}),s.jsx("p",{className:"text-xs text-slate-500",children:"O agente enviará mensagens de voz"})]})]}),s.jsx(ux,{checked:n,onCheckedChange:h})]}),s.jsxs(Ie.div,{variants:Jo,className:"space-y-2",children:[s.jsxs(pt,{htmlFor:"elevenLabsApiKey",className:"text-slate-300 flex items-center gap-2",children:[s.jsx(Ff,{className:"w-4 h-4 text-slate-500"}),"API Key do ElevenLabs"]}),s.jsxs("div",{className:"relative",children:[s.jsx(kt,{id:"elevenLabsApiKey",type:b?"text":"password",value:t,onChange:k=>l(k.target.value),placeholder:"sk-...",className:"bg-slate-800/50 border-slate-700 focus:border-violet-500 text-white placeholder:text-slate-500 pr-10 font-mono"}),s.jsx("button",{type:"button",onClick:()=>y(!b),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-500 hover:text-slate-300",children:b?s.jsx(oN,{className:"w-4 h-4"}):s.jsx(su,{className:"w-4 h-4"})})]}),s.jsxs("p",{className:"text-xs text-slate-500",children:["Obtenha em"," ",s.jsx("a",{href:"https://elevenlabs.io/app/sett
1170ings/api-keys",target:"_blank",rel:"noopener noreferrer",className:"text-violet-400 hover:underline",children:"elevenlabs.io"})]})]}),s.jsxs(Ie.div,{variants:Jo,className:"space-y-2",children:[s.jsx(pt,{className:"text-slate-300",children:"Voz"}),s.jsxs(Qn,{value:e,onValueChange:u,children:[s.jsx(Mn,{className:"bg-slate-800/50 border-slate-700 text-white",children:s.jsx(Jn,{placeholder:"Selecione uma voz",children:S?`${S.name} - ${S.description}`:"Selecione uma voz"})}),s.jsx(Rn,{className:"bg-slate-800 border-slate-700 z-50",children:WL.map(k=>s.jsxs(on,{value:k.id,className:"text-white hover:bg-violet-500/20 focus:bg-violet-500/20 focus:text-white",children:[s.jsx("span",{className:"font-medium",children:k.name}),s.jsxs("span",{className:"text-slate-400 ml-2",children:["- ",k.description]})]},k.id))})]})]}),s.jsxs(Ie.div,{variants:Jo,className:"space-y-2",children:[s.jsx(pt,{className:"text-slate-300",children:"Modelo"}),s.jsxs(Qn,{value:r,onValueChange:d,children:[s.jsx(Mn,{className:"bg-slate-800/50 border-slate-700 text-white",children:s.jsx(Jn,{placeholder:"Selecione um modelo"})}),s.jsx(Rn,{className:"bg-slate-800 border-slate-700 z-50",children:hAe.map(k=>s.jsxs(on,{value:k.id,className:"text-white hover:bg-violet-500/20 focus:bg-violet-500/20 focus:text-white",children:[s.jsx("span",{className:"font-medium",children:k.name}),s.jsxs("span",{className:"text-slate-400 ml-2",children:["- ",k.description]})]},k.id))})]})]}),s.jsxs(Ie.div,{variants:Jo,className:"space-y-4 p-4 rounded-lg bg-slate-800/20 border border-slate-700/30",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-300",children:"Ajustes da Voz"}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{className:"text-slate-400",children:"Estabilidade"}),s.jsxs("span",{className:"text-slate-500",children:[(a*100).toFixed(0),"%"]})]}),s.jsx(pg,{value:[a],onValueChange:([k])=>m(k),min:0,max:1,step:.05,className:"w-full"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{className:"text-slate-400",children:"Similaridade"}),s.jsxs("span",{className:"text-slate-500",children:[(i*100).toFixed(0),"%"]})]}),s.jsx(pg,{value:[i],onValueChange:([k])=>p(k),min:0,max:1,step:.05,className:"w-full"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-xs",children:[s.jsx("span",{className:"text-slate-400",children:"Velocidade"}),s.jsxs("span",{className:"text-slate-500",children:[o.toFixed(1),"x"]})]}),s.jsx(pg,{value:[o],onValueChange:([k])=>v(k),min:.5,max:2,step:.1,className:"w-full"})]})]})]}),s.jsx(Ie.div,{variants:Jo,children:s.jsx(Ne,{variant:"outline",onClick:N,disabled:!t||x,className:"w-full gap-2",children:x?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-4 h-4 animate-spin"}),"Testando..."]}):s.jsxs(s.Fragment,{children:[s.jsx(j8,{className:"w-4 h-4"}),"Testar Voz"]})})})]})]})},pAe={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.1}}},hf={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},HL=[{id:"America/Sao_Paulo",name:"São Paulo (GMT-3)",short:"BRT"},{id:"America/Fortaleza",name:"Fortaleza (GMT-3)",short:"BRT"},{id:"America/Manaus",name:"Manaus (GMT-4)",short:"AMT"},{id:"America/Rio_Branco",name:"Rio Branco (GMT-5)",short:"ACT"},{id:"America/Noronha",name:"Fernando de Noronha (GMT-2)",short:"FNT"}
1170,{id:"America/New_York",name:"Nova York (GMT-5)",short:"EST"},{id:"America/Los_Angeles",name:"Los Angeles (GMT-8)",short:"PST"},{id:"Europe/Lisbon",name:"Lisboa (GMT+0)",short:"WET"},{id:"Europe/London",name:"Londres (GMT+0)",short:"GMT"}],GL=Array.from({length:24},(t,e)=>{const r=e.toString().padStart(2,"0");return{id:`${r}:00`,name:`${r}:00`}}),KL=[{id:0,name:"Dom",fullName:"Domingo"},{id:1,name:"Seg",fullName:"Segunda"},{id:2,name:"Ter",fullName:"Terça"},{id:3,name:"Qua",fullName:"Quarta"},{id:4,name:"Qui",fullName:"Quinta"},{id:5,name:"Sex",fullName:"Sexta"},{id:6,name:"Sáb",fullName:"Sábado"}],gAe=({timezone:t,businessHoursStart:e,businessHoursEnd:r,businessDays:n,onTimezoneChange:a,onBusinessHoursStartChange:i,onBusinessHoursEndChange:o,onBusinessDaysChange:l})=>{const u=m=>{n.includes(m)?l(n.filter(p=>p!==m)):l([...n,m].sort())},d=HL.find(m=>m.id===t),h=KL.filter(m=>n.includes(m.id)).map(m=>m.name).join(", ");return s.jsxs(Ie.div,{className:"space-y-8",variants:pAe,initial:"hidden",animate:"visible",children:[s.jsxs(Ie.div,{variants:hf,className:"text-center mb-8",children:[s.jsx(Ie.div,{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-gradient-to-br from-orange-500/20 to-amber-500/20 border border-orange-500/30 flex items-center justify-center",whileHover:{scale:1.05,rotate:5},transition:{type:"spring",stiffness:400},children:s.jsx(oo,{className:"w-8 h-8 text-orange-400"})}),s.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Horário Comercial"}),s.jsx("p",{className:"text-slate-400 text-sm max-w-md mx-auto",children:"Configure quando seu agente estará disponÃvel para atender."}),s.jsx("p",{className:"text-xs text-amber-400/80 mt-2",children:"â¡ Esta configuração é opcional"})]}),s.jsxs("div",{className:"space-y-6 max-w-md mx-auto",children:[s.jsxs(Ie.div,{variants:hf,className:"space-y-2",children:[s.jsxs(pt,{className:"text-slate-300 flex items-center gap-2",children:[s.jsx(cY,{className:"w-4 h-4 text-slate-500"}),"Fuso Horário"]}),s.jsxs(Qn,{value:t,onValueChange:a,children:[s.jsx(Mn,{className:"bg-slate-800/50 border-slate-700 text-white",children:s.jsx(Jn,{placeholder:"Selecione o fuso horário",children:(d==null?void 0:d.name)||"Selecione o fuso horário"})}),s.jsx(Rn,{className:"bg-slate-800 border-slate-700 z-50",children:HL.map(m=>s.jsx(on,{value:m.id,className:"text-white hover:bg-violet-500/20 focus:bg-violet-500/20 focus:text-white",children:m.name},m.id))})]})]}),s.jsxs(Ie.div,{variants:hf,className:"space-y-3",children:[s.jsxs(pt,{className:"text-slate-300 flex items-center gap-2",children:[s.jsx(oo,{className:"w-4 h-4 text-slate-500"}),"Horário de Atendimento"]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"InÃcio"}),s.jsxs(Qn,{value:e,onValueChange:i,children:[s.jsx(Mn,{className:"bg-slate-800/50 border-slate-700 text-white",children:s.jsx(Jn,{})}),s.jsx(Rn,{className:"bg-slate-800 border-slate-700 max-h-60 z-50",children:GL.map(m=>s.jsx(on,{value:m.id,className:"text-white hover:bg-violet-500/20 focus:bg-violet-500/20 focus:text-white",children:m.name},m.id))})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-xs text-slate-500",children:"Fim"}),s.jsxs(Qn,{value:r,onValueChange:o,children:[s.jsx(Mn,{className:"bg-slate-800/50 border-slate-700 text-white",children:s.jsx(Jn,{})}),s.jsx(Rn,{className:"bg-slate-800 border-slate-700 max-h-60 z-50",children:GL.map(m=>s.jsx(on,{value:m.id,className:"text-white hover:bg-violet-500/20 focus:bg-violet-500/20 focus:text-white",children:m.name},m.id))})]})]})]})]}),s.jsxs(Ie.div,{variants:hf,className:"space-y-3",children:[s.jsxs(pt,{className:"text-slate-300 flex items-center gap-2",children:[s.jsx(Ya,{className:"w-4 h-4 text-slate-500"}),"Dias de Atendimento"]}),s.jsx("div",{className:"flex gap-2 justify-center",children:KL.map(m=>s.jsx(Ie.button,{type:"button",onClick:()=>u(m.id),className:` 1171 w-10 h-10 rounded-lg text-sm font-medium transition-all 1172 ${n.includes(m.id)?"bg-orange-500 text-white shadow-lg shadow-orange-500/30":"bg-slate-800/50 text-slate-400 border border-slate-700 hover:border-orange-500/50"} 1173 `,whileHover:{scale:1.1},whileTap:{scale:.95},title:m.fullName,children:m.name},m.id))})]}),s.jsxs(Ie.div,{variants:hf,className:"mt-8 p-4 rounded-xl bg-slate-800/30 border border-slate-700/50",children:[s.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 mb-3",children:[s.jsx(su,{className:"w-3 h-3"}),"Preview do Horário"]}),s.jsxs("div",{className:"space-y-2 text-sm",children:[s.jsxs("p",{className:"text-slate-300",children:[s.jsx("span",{className:"text-slate-500",children:"Fuso:"})," ",s.jsx("span",{className:"text-white font-medium",children:(d==null?void 0:d.short)||t})]}),s.jsxs("p",{className:"text-slate-300",children:[s.jsx("span",{className:"text-slate-500",children:"Horário:"})," ",s.jsxs("span",{className:"text-orange-400 font-medium",children:[e," - ",r]})]}),s.jsxs("p",{className:"text-slate-300",children:[s.jsx("span",{className:"text-slate-500",children:"Dias:"})," ",s.jsx("span",{className:"text-white font-medium",children:h||"Nenhum selecionado"})]})]})]})]})]})},vAe={hidden:{opacity:0}
1173,visible:{opacity:1,transition:{staggerChildren:.1}}},xAe={hidden:{opacity:0,y:20},visible:{opacity:1,y:0}},yAe={lovable_api_key:s.jsx(S8,{className:"w-5 h-5"}),whatsapp:s.jsx(Tn,{className:"w-5 h-5"}),identity:s.jsx(Lf,{className:"w-5 h-5"}),agent_prompt:s.jsx(Or,{className:"w-5 h-5"}),nina_settings:s.jsx(yl,{className:"w-5 h-5"}),pipeline_stages:s.jsx(yl,{className:"w-5 h-5"}),tag_definitions:s.jsx(yl,{className:"w-5 h-5"}),teams:s.jsx(fo,{className:"w-5 h-5"}),elevenlabs:s.jsx(Ff,{className:"w-5 h-5"}),business_hours:s.jsx(oo,{className:"w-5 h-5"})},bAe={lovable_api_key:"Chave de IA",whatsapp:"WhatsApp Cloud API",identity:"Identidade da Empresa",agent_prompt:"Prompt do Agente",nina_settings:"Configurações do Sistema",pipeline_stages:"Pipeline de Vendas",tag_definitions:"Definições de Tags",teams:"Equipes",elevenlabs:"Respostas em Ãudio",business_hours:"Horário Comercial"},wAe=({onAllChecked:t})=>{const[e,r]=w.useState(!1),[n,a]=w.useState([]),[i,o]=w.useState(null),[l,u]=w.useState(!1),d=async()=>{r(!0);try{const{data:j,error:N}=await ve.functions.invoke("health-check");if(N){console.error("Health check error:",N),a([{component:"system",status:"error",message:"Erro ao verificar sistema: "+N.message}]),o("error"),t(!1);return}if(j){a(j.results),o(j.status);const S=j.results.filter(k=>["lovable_api_key","nina_settings","pipeline_stages"].includes(k.component)).every(k=>k.status!=="error");t(S)}}catch(j){console.error("Health check failed:",j),a([{component:"system",status:"error",message:"Falha ao conectar com o servidor"}]),o("error"),t(!1)}finally{r(!1),u(!0)}};w.useEffect(()=>{d()},[]);const h=j=>{switch(j){case"ok":return s.jsx(Lr,{className:"w-5 h-5 text-green-500"});case"warning":return s.jsx(ei,{className:"w-5 h-5 text-yellow-500"});case"error":return s.jsx(au,{className:"w-5 h-5 text-red-500"})}},m=j=>{switch(j){case"ok":return"border-green-500/30 bg-green-500/5";case"warning":return"border-yellow-500/30 bg-yellow-500/5";case"error":return"border-red-500/30 bg-red-500/5"}},p=()=>{if(!l)return null;switch(i){case"ok":return s.jsxs("div",{className:"p-4 rounded-lg border border-green-500/30 bg-green-500/10 text-green-300",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Lr,{className:"w-5 h-5"}),s.jsx("span",{className:"font-medium",children:"Sistema totalmente configurado!"})]}),s.jsx("p",{className:"text-sm mt-1 text-green-400/80",children:"Você está pronto para começar a usar o sistema."})]});case"warning":return s.jsxs("div",{className:"p-4 rounded-lg border border-yellow-500/30 bg-yellow-500/10 text-yellow-300",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(ei,{className:"w-5 h-5"}),s.jsx("span",{className:"font-medium",children:"Sistema funcional com pendências"})]}),s.jsx("p",{className:"text-sm mt-1 text-yellow-400/80",children:"Algumas configurações opcionais estão pendentes."})]});case"error":return s.jsxs("div",{className:"p-4 rounded-lg border border-red-500/30 bg-red-500/10 text-red-300",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(au,{className:"w-5 h-5"}),s.jsx("span",{className:"font-medium",children:"Configuração necessária"})]}),s.jsx("p",{className:"text-sm mt-1 text-red-400/80",children:"Complete os itens em vermelho para o sistema funcionar."})]});default:return null}},v=n.filter(j=>["lovable_api_key","nina_settings","pipeline_stages"].includes(j.component)),b=n.filter(j=>["whatsapp","identity","agent_prompt"].includes(j.component)),y=n.filter(j=>["teams","tag_definitions","elevenlabs","business_hours"].includes(j.component)),x=(j,N)=>N.length===0?null:s.jsxs("div",{className:"space-y-2",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-400",children:j}),s.jsx("div",{className:"space-y-2",children:N.map((S,k)=>s.jsxs(Ie.div,{variants:xAe,className:`p-3 rounded-lg border ${m(S.status)} flex items-start gap-3`,children:[s.jsx("div",{className:"mt-0.5",children:yAe[S.component]||s.jsx(yl,{className:"w-5 h-5"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("span",{className:"font-medium text-sm text-white",children:bAe[S.component]||S.component}),h(S.status)]}),s.jsx("p",{className:"text-xs text-slate-400 mt-0.5 truncate",children:S.message})]})]},S.component))})]});return s.jsxs(Ie.div,{variants:vAe,initial:"hidden",animate:"visible",className:"space-y-6",children:[s.jsxs("div",{className:"text-center",children:[s.jsx("h3",{className:"text-xl font-semibold text-white",children:"Verificação do Sistema"}),s.jsx("p",{className:"text-slate-400 text-sm mt-1",children:"Verificando se todos os componentes estão configurados corretamente"})]}),e?s.jsxs("div",{className:"flex flex-col items-center justify-center py-12 gap-4",children:[s.jsx(gt,{className:"w-8 h-8 animate-spin text-violet-400"}),s.jsx("p",{className:"text-sm text-slate-400",children:"Verificando sistema..."})]}):s.jsxs(s.Fragment,{children:[p(),s.jsxs("div",{className:"space-y-4",children:[x("ð´ CrÃtico",v),x("âï¸ Configuração",b),x("⨠Opcional",y)]}),s.jsx("div",{className:"flex justify-center",children:s.jsxs(Ne,{variant:"outline",size:"sm",onClick:d,disabled:e,className:"gap-2 border-violet-500/50 text-violet-400 hover:bg-violet-500/20 hover:text-violet-300",children:[s.jsx(lo,{className:`w-4 h-4 ${e?"animate-spin":""}`}),"Verificar Novamente"]})})]})]})},_Ae={hidden:{opacity:0}
1173,visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.1}}},ag={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},jAe={identity:"Identidade",whatsapp:"WhatsApp",agent_prompt:"Agente IA",elevenlabs:"ElevenLabs",business_hours:"Horário Comercial",lovable_ai:"IA Backend",pipeline:"Pipeline de Vendas",profile:"Perfil",nina_settings:"Configurações Nina"},NAe=({steps:t,companyName:e,sdrName:r,onComplete:n})=>{const[a,i]=w.useState(""),[o,l]=w.useState(null),[u,d]=w.useState(!1),h=()=>r&&e?`Olá! Aqui é ${r} da ${e}. Este é um teste do sistema! ð`:r?`Olá! Aqui é ${r}. Este é um teste do sistema Nina! ð`:e?`Olá! Aqui é o assistente da ${e}. Este é um teste do sistema! ð`:"Olá! Este é um teste do sistema Nina SDR! ð",[m,p]=w.useState(h),[v,b]=w.useState(!1);w.useEffect(()=>{p(h())},[r,e]);const y=w.useCallback(async()=>{d(!0);try{const{data:C,error:A}=await ve.functions.invoke("validate-setup");if(A)throw A;l(C),C.overallStatus==="ok"?xe.success("Todas as configurações estão corretas!"):C.overallStatus==="warning"?xe.warning("Sistema funcional, mas há itens opcionais pen
1173dentes"):xe.error("Há configurações obrigatórias pendentes")}catch(C){console.error("Validation error:",C),xe.error("Erro ao validar configurações")}finally{d(!1)}},[]);w.useEffect(()=>{y()},[y]),t.filter(C=>C.isComplete);const x=t.filter(C=>C.isRequired&&!C.isComplete),j=async()=>{if(!a){xe.error("Digite um número de telefone");return}b(!0);try{const{data:C,error:A}=await ve.functions.invoke("test-whatsapp-message",{body:{phone_number:a.replace(/\D/g,""),message:m}});if(A)throw A;if(!(C!=null&&C.success)){xe.error("Não foi possÃvel enviar a mensagem",{description:(C==null?void 0:C.error)||"Verifique as configurações do WhatsApp e tente novamente."});return}xe.success("Mensagem de teste enviada!")}catch(C){console.error("Error sending test:",C);const A=C instanceof Error?C.message:"Erro ao enviar mensagem de teste";xe.error(A)}finally{b(!1)}},N=C=>{switch(C){case"ok":return s.jsx(vg,{className:"w-4 h-4 text-emerald-400"});case"warning":return s.jsx(ei,{className:"w-4 h-4 text-amber-400"});case"error":return s.jsx(au,{className:"w-4 h-4 text-red-400"})}},S=C=>{switch(C){case"ok":return"bg-emerald-500/10 border-emerald-500/20";case"warning":return"bg-amber-500/10 border-amber-500/20";case"error":return"bg-red-500/10 border-red-500/20"}},k=(o==null?void 0:o.overallStatus)!=="error"&&x.length===0;return s.jsxs(Ie.div,{className:"space-y-6",variants:_Ae,initial:"hidden",animate:"visible",children:[s.jsxs(Ie.div,{variants:ag,className:"text-center mb-6",children:[s.jsx(Ie.div,{className:"w-16 h-16 mx-auto mb-4 rounded-2xl bg-gradient-to-br from-emerald-500/20 to-rose-500/20 border border-emerald-500/30 flex items-center justify-center",whileHover:{scale:1.05,rotate:5},children:s.jsx(uN,{className:"w-8 h-8 text-emerald-400"})}),s.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"Validação do Sistema"}),s.jsx("p",{className:"text-slate-400 text-sm max-w-md mx-auto",children:"Verificando todas as configurações antes de começar."})]}),s.jsxs(Ie.div,{variants:ag,className:"max-w-md mx-auto",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h4",{className:"text-sm font-medium text-slate-300",children:"Verificação Automática"}),s.jsxs(Ne,{variant:"secondary",size:"sm",onClick:y,disabled:u,className:"text-xs",children:[u?s.jsx(gt,{className:"w-3 h-3 animate-spin mr-1"}):s.jsx(lo,{className:"w-3 h-3 mr-1"}),"Verificar"]})]}),o&&s.jsxs(Ie.div,{initial:{opacity:0}
1173,animate:{opacity:1},className:"space-y-2",children:[s.jsx("div",{className:`p-4 rounded-xl border ${S(o.overallStatus)}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[N(o.overallStatus),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium text-white",children:o.message}),s.jsxs("p",{className:"text-xs text-slate-400",children:[o.summary.ok,"/",o.summary.total," verificações OK"]})]})]}),s.jsxs("div",{className:`text-2xl font-bold ${o.overallStatus==="ok"?"text-emerald-400":o.overallStatus==="warning"?"text-amber-400":"text-red-400"}`,children:[o.summary.percentage,"%"]})]})}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:o.results.map((C,A)=>s.jsxs(Ie.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:A*.05},className:`flex items-center gap-2 p-2 rounded-lg border ${S(C.status)}`,children:[N(C.status),s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-xs font-medium text-slate-200 truncate",children:jAe[C.component]||C.component})})]},C.component))})]}),u&&!o&&s.jsxs("div",{className:"flex items-center justify-center p-8",children:[s.jsx(gt,{className:"w-6 h-6 animate-spin text-red-400"}),s.jsx("span",{className:"ml-2 text-sm text-slate-400",children:"Validando..."})]})]}),s.jsxs(Ie.div,{variants:ag,className:"max-w-md mx-auto pt-4 border-t border-slate-700/50",children:[s.jsxs("h4",{className:"text-sm font-medium text-slate-300 mb-4 flex items-center gap-2",children:[s.jsx(ou,{className:"w-4 h-4"}),"Enviar Mensagem de Teste"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"testPhone",className:"text-slate-400 text-xs",children:"Número de Telefone (com DDD)"}),s.jsx(kt,{id:"testPhone",value:a,onChange:C=>i(C.target.value),placeholder:"5511999999999",className:"bg-slate-800/50 border-slate-700 text-white placeholder:text-slate-500 font-mono"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"testMessage",className:"text-slate-400 text-xs",children:"Mensagem de Teste"}),s.jsx(kt,{id:"testMessage",value:m,onChange:C=>p(C.target.value),className:"bg-slate-800/50 border-slate-700 text-white"})]}),s.jsx(Ne,{variant:"secondary",onClick:j,disabled:v||!a,className:"w-full",children:v?s.jsxs(s.Fragment,{children:[s.jsx(gt,{className:"w-4 h-4 animate-spin mr-2"}),"Enviando..."]}):s.jsxs(s.Fragment,{children:[s.jsx(ou,{className:"w-4 h-4 mr-2"}),"Enviar Teste"]})})]})]}),s.jsxs(Ie.div,{variants:ag,className:"max-w-md mx-auto pt-4",children:[s.jsxs(Ne,{variant:"primary",onClick:n,disabled:!k,className:"w-full py-3 text-base",children:[s.jsx(uN,{className:"w-5 h-5 mr-2"}),"Começar a Usar o Sistema"]}),!k&&s.jsx("p",{className:"text-xs text-slate-500 text-center mt-2",children:"Corrija os erros de validação para continuar"})]})]})},SAe={enter:t=>({x:t>0?80:-80,opacity:0,scale:.9,filter:"blur(10px)"}),center:{x:0,opacity:1,scale:1,filter:"blur(0px)"},exit:t=>({x:t<0?80:-80,opacity:0,scale:.9,filter:"blur(10px)"})},CAe={hidden:{opacity:0,scale:.9,y:30},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:30}},kAe={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},EAe=()=>s.jsx(Ie.svg,{viewBox:"0 0 24 24",className:"w-4 h-4",initial:"hidden",animate:"visible",children:s.jsx(Ie.path,{d:"M5 13l4 4L19 7",fill:"none",stroke:"currentColor",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round",variants:{hidden:{pathLength:0,opacity:0},visible:{pathLength:1,opacity:1,transition:{pathLength:{duration:.4,ease:"easeOut"},opacity:{duration:.1}}}}})}),AAe=({index:t,activeStep:e,isOptional:r,onClick:n})=>{const a=t<e,i=t===e;return s.jsxs(Ie.button,{onClick:n,className:"relative z-10 flex-shrink-0",whileHover:{scale:1.15},whileTap:{scale:.95},children:[i&&s.jsx(Ie.div,{className:"absolute inset-0 rounded-full bg-red-500/30",animate:{scale:[1,1.5,1],opacity:[.5,0,.5]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},style:{margin:"-4px"}}),s.jsx(Ie.div,{className:` 1174 relative flex items-center justify-center w-8 h-8 rounded-full 1175 border-2 transition-colors duration-300 1176 ${a?"bg-gradient-to-br from-red-400 to-red-600 border-red-400 text-white shadow-lg shadow-red-500/40":i?"border-red-500 text-red-400 bg-red-500/10 shadow-lg shadow-red-500/20":r?"border-slate-600 text-slate-500 bg-slate-800/50 border-dashed":"border-slate-700 text-slate-500 bg-slate-800/50"} 1177 `,animate:i?{boxShadow:["0 0 0px rgba(227,6,19,0.4)","0 0 25px rgba(227,6,19,0.6
1177)","0 0 0px rgba(227,6,19,0.4)"]}:{},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:a?s.jsx(EAe,{}):s.jsx(Ie.span,{className:"text-xs font-semibold",initial:{rotateY:-90,opacity:0},animate:{rotateY:0,opacity:1},transition:{duration:.3},children:t+1},t)})]})},PAe=({isCompleted:t})=>s.jsx("div",{className:"relative flex-1 h-0.5 mx-1 bg-slate-700/50 rounded-full overflow-hidden self-center min-w-[12px]",children:s.jsx(Ie.div,{className:"absolute inset-0 bg-gradient-to-r from-red-400 to-red-500",initial:{scaleX:0},animate:{scaleX:t?1:0},transition:{duration:.5,ease:"easeOut"},style:{transformOrigin:"left"}})}),TAe=({isOpen:t,onClose:e})=>{const{steps:r,refetch:n,markWizardSeen:a}=U0(),{user:i}=Na(),[o,l]=w.useState(0),[u,d]=w.useState(0),[h,m]=w.useState(!1),[p,v]=w.useState(!1),[b,y]=w.useState(!1),[x,j]=w.useState(!1),[N,S]=w.useState(""),[k,C]=w.useState(""),[A,T]=w.useState(""),[R,I]=w.useState(""),[D,L]=w.useState(""),[z,H]=w.useState(""),[Z,te]=w.useState(""),[G,M]=w.useState("flash"),[F,K]=w.useState(""),[B,O]=w.useState("33B4UnXyTNbgLmdEDh5P"),[W,q]=w.useState("eleven_turbo_v2_5"),[se,me]=w.useState(!1),[fe,Q]=w.useState(.75),[pe,V]=w.useState(.8),[J,oe]=w.useState(1),[re,Me]=w.useState("America/Sao_Paulo"),[ee,ce]=w.useState("09:00"),[je,de]=w.useState("18:00"),[we,ke]=w.useState([1,2,3,4,5]),Y="https://wqwtmxciixqilaulodpv.supabase.co/functions/v1/whatsapp-webhook";w.useEffect(()=>{t&&((async()=>{var Rt,bt;v(!0);try{const{data:it}=await ve.from("nina_settings").select("*").limit(1).maybeSingle();it&&(S(it.company_name||""),C(it.sdr_name||""),T(it.whatsapp_access_token||""),I(it.whatsapp_phone_number_id||""),L(it.whatsapp_business_account_id||""),H(it.whatsapp_verify_token||""),te(it.system_prompt_override||y2),M(it.ai_model_mode||"flash"),K(it.elevenlabs_api_key||""),O(it.elevenlabs_voice_id||"33B4UnXyTNbgLmdEDh5P"),q(it.elevenlabs_model||"eleven_turbo_v2_5"),me(it.audio_response_enabled||!1),Q(it.elevenlabs_stability||.75),V(it.elevenlabs_similarity_boost||.8),oe(it.elevenlabs_speed||1),Me(it.timezone||"America/Sao_Paulo"),ce(((Rt=it.business_hours_start)==null?void 0:Rt.substring(0,5))||"09:00"),de(((bt=it.business_hours_end)==null?void 0:bt.substring(0,5))||"18:00"),ke(it.business_days||[1,2,3,4,5]))}catch(it){console.error("[OnboardingWizard] Error:",it)}finally{v(!1)}})(),l(0))},[t]),w.useCallback(Je=>{const Rt=[];switch(console.log(`[OnboardingWizard] Validating step ${Je} data...`),Je){case 0:console.log("[OnboardingWizard] Step 0 (Identity) values:",{companyName:N,sdrName:k}),N!=null&&N.trim()||Rt.push("Nome da empresa está vazio"),k!=null&&k.trim()||Rt.push("Nome do SDR está vazio");break;case 1:console.log("[OnboardingWizard] Step 1 (WhatsApp) values:",{accessToken:A?`${A.substring(0,10)}...`:"EMPTY",phoneNumberId:R||"EMPTY",businessAccountId:D||"EMPTY",verifyToken:z||"EMPTY"}),A!=null&&A.trim()||Rt.push("Access Token está vazio"),R!=null&&R.trim()||Rt.push("Phone Number ID está vazio");break;case 2:console.log("[OnboardingWizard] Step 2 (Agent) values:",{systemPrompt:Z?`${Z.substring(0,30)}...`:"EMPTY",aiModelMode:G});break;case 3:console.log("[OnboardingWizard] Step 3 (ElevenLabs) values:",{elevenLabsApiKey:F?"***configured***":"EMPTY",audioResponseEnabled:se});break;case 4:console.log("[OnboardingWizard] Step 4 (BusinessHours) values:",{timezone:re,businessHoursStart:ee,businessHoursEnd:je,businessDays:we});break}return Rt.length>0?console.warn("[OnboardingWizard] Validation issues:",Rt):console.log("[OnboardingWizard] Step validation passed"),{valid:Rt.length===0,issues:Rt}},[N,k,A,R,D,z,Z,G,F,se,re,ee,je,we]);const ne=w.useCallback(async()=>{if(!i)return console.error("[OnboardingWizard] â No user found, cannot save settings"),xe.error("Erro: usuário não autenticado"),!1;m(!0),console.log("[OnboardingWizard] ========================================"),console.log("[OnboardingWizard] Starting saveSettings for user:",i.id),console.log("[OnboardingWizard] Current activeStep:",o),console.log("[OnboardingWizard] Current form state:",{companyName:N||"(empty)",sdrName:k||"(empty)",accessToken:A?`${A.substring(0,15)}...`:"(empty)",phoneNumberId:R||"(empty)",businessAccountId:D||"(empty)",verifyToken:z||"(empty)",systemPrompt:Z?`${Z.substring(0,50)}...`:"(empty)",aiModelMode:G,elevenLabsApiKey:F?"***":"(empty)",audioResponseEnabled:se,timezone:re,businessHoursStart:ee,businessHoursEnd:je,businessDays:we});try{console.log("[OnboardingWizard] Step 1: Checking for existing settings...");const{data:Je,error:Rt}=await ve.from("nina_settings").select("id, user_id, company_name, whatsapp_phone_number_id").limit(1).maybeSingle();if(Rt)return console.error("[OnboardingWizard] â Error fetching existing settings:",Rt),xe.error("Erro ao verificar configurações existentes"),!1;console.log("[OnboardingWizard] Existing settings found:",Je?{id:Je.id,user_id:Je.user_id,c
1177ompany_name:Je.company_name,whatsapp_phone_number_id:Je.whatsapp_phone_number_id?"***":null}:"NONE");const bt={company_name:(N==null?void 0:N.trim())||null,sdr_name:(k==null?void 0:k.trim())||null,whatsapp_access_token:(A==null?void 0:A.trim())||null,whatsapp_phone_number_id:(R==null?void 0:R.trim())||null,whatsapp_business_account_id:(D==null?void 0:D.trim())||null,whatsapp_verify_token:(z==null?void 0:z.trim())||null,system_prompt_override:(Z==null?void 0:Z.trim())||y2,ai_model_mode:G||"flash",elevenlabs_api_key:(F==null?void 0:F.trim())||null,elevenlabs_voice_id:B||"33B4UnXyTNbgLmdEDh5P",elevenlabs_model:W||"eleven_turbo_v2_5",audio_response_enabled:!!se,elevenlabs_stability:Number(fe)||.75,elevenlabs_similarity_boost:Number(pe)||.8,elevenlabs_speed:Number(J)||1,timezone:re||"America/Sao_Paulo",business_hours_start:ee||"09:00",business_hours_end:je||"18:00",business_days:(we==null?void 0:we.length)>0?we:[1,2,3,4,5],is_active:!0,auto_response_enabled:!0};console.log("[OnboardingWizard] Step 2: Settings object built:",{company_name:bt.company_name,sdr_name:bt.sdr_name,whatsapp_phone_number_id:bt.whatsapp_phone_number_id?"â SET":"â EMPTY",whatsapp_access_token:bt.whatsapp_access_token?"â SET":"â EMPTY",system_prompt_override:bt.system_prompt_override?"â SET":"â EMPTY",elevenlabs_api_key:bt.elevenlabs_api_key?"â SET":"â EMPTY",is_active:bt.is_active,auto_response_enabled:bt.auto_response_enabled});let it;if(Je?(console.log("[OnboardingWizard] Step 3: Updating existing settings by ID:",Je.id),it=await ve.from("nina_settings").update(bt).eq("id",Je.id).select().single()):(console.log("[OnboardingWizard] Step 3: Inserting new global settings..."),it=await ve.from("nina_settings").insert({...bt,user_id:null}).select().single()),it.error)return console.error("[OnboardingWizard] â Database error:",it.error),xe.error("Erro ao salvar: "+it.error.message),!1;if(!it.data)return console.error("[OnboardingWizard] â No data returned - possible RLS issue"),xe.error("Erro: configurações não foram salvas (RLS)"),!1;console.log("[OnboardingWizard] Step 4: Save result:",{id:it.data.id,company_name:it.data.company_name,sdr_name:it.data.sdr_name,whatsapp_phone_number_id:it.data.whatsapp_phone_number_id?"â SAVED":"â NOT SAVED",whatsapp_access_token:it.data.whatsapp_access_token?"â SAVED":"â NOT SAVED",system_prompt_override:it.data.system_prompt_override?"â SAVED":"â NOT SAVED",is_active:it.data.is_active}),console.log("[OnboardingWizard] Step 5: Verifying saved data...");const{data:wt,error:Ds}=await ve.from("nina_settings").select("company_name, sdr_name, whatsapp_phone_number_id, whatsapp_access_token, system_prompt_override, is_active").eq("id",it.data.id).maybeSingle();return Ds?console.error("[OnboardingWizard] â Verification query failed:",Ds):(console.log("[OnboardingWizard] â Verification result:",{company_name:(wt==null?void 0:wt.company_name)||"(null)",sdr_name:(wt==null?void 0:wt.sdr_name)||"(null)",whatsapp_phone_number_id:wt!=null&&wt.whatsapp_phone_number_id?"â VERIFIED":"â NULL",whatsapp_access_token:wt!=null&&wt.whatsapp_access_token?"â VERIFIED":"â NULL",system_prompt_override:wt!=null&&wt.system_prompt_override?"â VERIFIED":"â NULL",is_active:wt==null?void 0:wt.is_active}),bt.company_name&&!(wt!=null&&wt.company_name)&&console.error("[OnboardingWizard] â CRITICAL: company_name not persisted!"),bt.whatsapp_phone_number_id&&!(wt!=null&&wt.whatsapp_phone_number_id)&&console.error("[OnboardingWizard] â CRITICAL: whatsapp_phone_number_id not persisted!"),bt.whatsapp_access_token&&!(wt!=null&&wt.whatsapp_access_token)&&console.error("[OnboardingWizard] â CRITICAL: whatsapp_access_token not persisted!")),console.log("[OnboardingWizard] â Settings saved successfully!"),console.log("[OnboardingWizard] ========================================"),xe.success("Configurações salvas!"),await n(),!0}catch(Je){return console.error("[OnboardingWizard] â Unexpected error:",Je),xe.error("Erro inesperado ao salvar configurações"),!1}finally{m(!1)}},[i,o,N,k,A,R,D,z,Z,G,F,B,W,se,fe,pe,J,re,ee,je,we,n]),le=async()=>
1177{await ne(),o<r.length-1&&(d(1),l(o+1))},Se=async()=>{await ne(),o<r.length-1&&(d(1),l(o+1))},Ae=()=>{o>0&&(d(-1),l(o-1))},Ce=Je=>{d(Je>o?1:-1),l(Je)},$e=()=>{const Rt={origin:{y:.7},zIndex:9999};function bt(it,wt){BEe({...Rt,...wt,particleCount:Math.floor(200*it)})}bt(.25,{spread:26,startVelocity:55}),bt(.2,{spread:60}),bt(.35,{spread:100,decay:.91,scalar:.8}),bt(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),bt(.1,{spread:120,startVelocity:45})},Be=async()=>{await ne(),a(),$e(),xe.success("Configuração concluÃda! Bem-vindo ao sistema."),e(),setTimeout(()=>window.location.reload(),800)},tt=Je=>{te(Je),y(!1)},Dt=Je=>["elevenlabs","business_hours"].includes(Je),ye=()=>{switch(o){case 0:return s.jsx(zEe,{companyName:N,sdrName:k,onCompanyNameChange:S,onSdrNameChange:C});case 1:return s.jsx(qEe,{accessToken:A,phoneNumberId:R,businessAccountId:D,verifyToken:z,onAccessTokenChange:T,onPhoneNumberIdChange:I,onBusinessAccountIdChange:L,onVerifyTokenChange:H,webhookUrl:Y});case 2:return s.jsx(GEe,{systemPrompt:Z,aiModelMode:G,onSystemPromptChange:te,onAiModelModeChange:M,onGeneratePrompt:()=>y(!0)});case 3:return s.jsx(mAe,{elevenLabsApiKey:F,elevenLabsVoiceId:B,elevenLabsModel:W,audioResponseEnabled:se,elevenLabsStability:fe,elevenLabsSimilarityBoost:pe,elevenLabsSpeed:J,onApiKeyChange:K,onVoiceIdChange:O,onModelChange:q,onAudioEnabledChange:me,onStabilityChange:Q,onSimilarityBoostChange:V,onSpeedChange:oe});case 4:return s.jsx(gAe,{timezone:re,businessHoursStart:ee,businessHoursEnd:je,businessDays:we,onTimezoneChange:Me,onBusinessHoursStartChange:ce,onBusinessHoursEndChange:de,onBusinessDaysChange:ke});case 5:return s.jsx(wAe,{onAllChecked:j});case 6:return s.jsx(NAe,{steps:r,companyName:N,sdrName:k,onComplete:Be});default:return null}},mt=(o+1)/r.length*100,qt=r[o],cr=qt&&Dt(qt.id);return s.jsxs(s.Fragment,{children:[t&&s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[s.jsx(Ie.div,{variants:kAe,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.3},className:"absolute inset-0 bg-slate-950/90 backdrop-blur-md",onClick:e}),s.jsxs(Ie.div,{variants:CAe,initial:"hidden",animate:"visible",exit:"exit",transition:{duration:.4,type:"spring",stiffness:260,damping:25},className:"relative w-full max-w-2xl max-h-[90vh] mx-4 bg-slate-900 rounded-2xl border border-slate-800 shadow-2xl overflow-hidden flex flex-col",children:[s.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-slate-800",children:s.jsx(Ie.div,{className:"h-full bg-gradient-to-r from-red-500 via-violet-500 to-fuchsia-500",initial:{width:"0%"},animate:{width:`${mt}%`},transition:{duration:.5,ease:"easeOut"}})}),s.jsxs("div",{className:"flex items-center justify-between p-6 pt-7 border-b border-slate-800/50",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ie.div,{className:"p-2 rounded-lg bg-gradient-to-br from-red-500/20 to-violet-500/20 border border-red-500/30",animate:{boxShadow:["0 0 0px rgba(227,6,19,0.3)","0 0 15px rgba(227,6,19,0.4)","0 0 0px rgba(227,6,19,0.3)"]},transition:{duration:2,repeat:1/0},children:s.jsx(NY,{className:"w-5 h-5 text-red-400"})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-semibold text-white",children:"Configuração Inicial"}),s.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[s.jsx("span",{className:"text-sm text-slate-400",children:"Passo"}),s.jsx(Ie.span,{initial:{y:10,opacity:0},animate:{y:0,opacity:1},className:"text-sm font-semibold text-red-400",children:o+1},o),s.jsxs("span",{className:"text-sm text-slate-400",children:["de ",r.length]})]})]})]}),s.jsx(Ie.button,{whileHover:{scale:1.1,rotate:90},whileTap:{scale:.9},transition:{type:"spring",stiffness:400,damping:15},onClick:e,className:"p-2 rounded-lg hover:bg-slate-800 text-slate-400 hover:text-white transition-colors",children:s.jsx(Xn,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"px-6 py-4 border-b border-slate-800/30 bg-slate-900/50",children:[s.jsx("div",{className:"flex items-center justify-center max-w-lg mx-auto",children:r.map((Je,Rt)=>s.jsxs(U.Fragment,{children:[s.jsx(AAe,{index:Rt,activeStep:o,isOptional:Dt(Je.id),onClick:()=>Ce(Rt)}
1177),Rt<r.length-1&&s.jsx(PAe,{isCompleted:Rt<o})]},Je.id))}),s.jsx("div",{className:"text-center mt-3",children:s.jsxs(Ie.span,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},className:"text-sm font-medium text-red-400",children:[qt==null?void 0:qt.title,cr&&s.jsx("span",{className:"text-slate-500 font-normal ml-2",children:"(opcional)"})]},o)})]}),s.jsx("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar overflow-x-hidden",children:p?s.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[300px] gap-4",children:[s.jsx(Ie.div,{animate:{rotate:360},transition:{duration:1.5,repeat:1/0,ease:"linear"},children:s.jsx(gt,{className:"w-8 h-8 text-red-500"})}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-slate-300 font-medium",children:"Preparando sistema..."}),s.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Inicializando configurações necessárias"})]})]}):s.jsx(Ag,{mode:"wait",custom:u,children:s.jsx(Ie.div,{custom:u,variants:SAe,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:200,damping:25},opacity:{duration:.3},scale:{duration:.3},filter:{duration:.3}},children:ye()},o)})}),o<r.length-1&&s.jsxs(Ie.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:"flex items-center justify-between p-6 border-t border-slate-800/50 bg-slate-900/80 backdrop-blur-sm",children:[s.jsx(Ie.div,{whileHover:{scale:1.02,x:-3},whileTap:{scale:.98},children:s.jsxs(Ne,{variant:"ghost",onClick:Ae,disabled:o===0,className:"gap-2 group",children:[s.jsx(Ie.div,{animate:{x:[0,-3,0]},transition:{duration:1.5,repeat:1/0,repeatDelay:1},children:s.jsx(e0,{className:"w-4 h-4 group-hover:text-red-400 transition-colors"})}),"Anterior"]})}),s.jsx(Ag,{children:h&&s.jsxs(Ie.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},className:"flex items-center gap-2 text-xs text-slate-400",children:[s.jsx(Ie.div,{animate:{rotate:360},transition:{duration:1,repeat:1/0,ease:"linear"},children:s.jsx(gt,{className:"w-3 h-3"})}),s.jsx(Ie.span,{animate:{opacity:[.5,1,.5]},transition:{duration:1.5,repeat:1/0},children:"Salvando..."})]})}),s.jsxs("div",{className:"flex gap-2",children:[cr&&s.jsx(Ie.div,{whileHover:{scale:1.02},whileTap:{scale:.98},children:s.jsxs(Ne,{variant:"ghost",onClick:Se,disabled:h,className:"gap-2 text-slate-400 hover:text-slate-300",children:["Pular",s.jsx(SY,{className:"w-4 h-4"})]})}),s.jsx(Ie.div,{whileHover:{scale:1.02,x:3},whileTap:{scale:.98},children:s.jsxs(Ne,{variant:"primary",onClick:le,disabled:h,className:"gap-2 group bg-gradient-to-r from-red-600 to-violet-600 hover:from-red-500 hover:to-violet-500 border-0 shadow-lg shadow-red-500/20 hover:shadow-red-500/40 transition-all",children:["Próximo",s.jsx(Ie.div,{animate:{x:[0,3,0]},transition:{duration:1.5,repeat:1/0,repeatDelay:1},children:s.jsx(t0,{className:"w-4 h-4 group-hover:text-white transition-colors"})})]})})]})]})]})]}),s.jsx(Qz,{open:b,onOpenChange:y,onPromptGenerated:tt})]})},OAe=({children:t})=>{const{mustChangePassword:e,loading:r,refresh:n}=zl(),[a,i]=w.useState(""),[o,l]=w.useState(""),[u,d]=w.useState(!1);if(r)return null;if(!e)return s.jsx(s.Fragment,{children:t});const h=async m=>{if(m.preventDefault(),!z2(a)){xe.error(qc);return}if(a!==o){xe.error("As senhas não coincidem.");return}d(!0);try{const{data:p,error:v}=await ve.functions.invoke("manage-panel-users",{body:{action:"complete-password-change",password:a}});if(v||(p==null?void 0:p.success)!==!0){xe.error((p==null?void 0:p.error)||"Não foi possÃvel atualizar a senha.");return}await n(),xe.success("Nova senha criada com sucesso.")}finally{d(!1)}};return s.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-background p-4 text-foreground",children:s.jsxs("form",{onSubmit:h,className:"w-full max-w-md
1177space-y-6 rounded-lg border border-border bg-card p-6 shadow-xl",children:[s.jsxs("div",{className:"space-y-2 text-center",children:[s.jsx(y8,{className:"mx-auto h-10 w-10 text-primary"}),s.jsx("h1",{className:"text-2xl font-bold",children:"Crie uma nova senha"}),s.jsx("p",{className:"text-sm text-muted-foreground",children:"Por segurança, substitua a senha temporária antes de acessar o painel."})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"new-password",children:"Nova senha"}),s.jsx(kt,{id:"new-password",type:"password",minLength:8,autoComplete:"new-password",value:a,onChange:m=>i(m.target.value)}),s.jsx("p",{className:"text-xs text-muted-foreground",children:qc})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx(pt,{htmlFor:"confirm-password",children:"Confirmar nova senha"}),s.jsx(kt,{id:"confirm-password",type:"password",minLength:8,autoComplete:"new-password",value:o,onChange:m=>l(m.target.value)})]}),s.jsxs(Ne,{type:"submit",className:"w-full gap-2",disabled:u,children:[u&&s.jsx(gt,{className:"h-4 w-4 animate-spin"}),"Salvar nova senha"]})]})})},MAe=()=>{var d;const[t,e]=w.useState(!1),{isComplete:r,hasSeenWizard:n,loading:a,markWizardSeen:i}=U0(),{isCoordinator:o}=zl(),{user:l}=Na(),u=((d=l==null?void 0:l.email)==null?void 0:d.toLowerCase())==="[email protected]";return w.useEffect(()=>{!a&&u&&!o&&!r&&!n&&e(!0)},[a,u,o,r,n]),s.jsxs("div",{className:"flex h-dvh w-full flex-col overflow-hidden bg-background text-foreground md:flex-row",children:[s.jsx(nae,{}),s.jsxs("main",{className:"relative z-10 flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden",children:[s.jsx("div",{className:"absolute top-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-border to-transparent opacity-50 z-20"}),s.jsx("div",{className:"flex-1 w-full h-full relative",children:s.jsx(RK,{context:{showOnboarding:t,setShowOnboarding:e}})})]}),u&&!o&&s.jsx(TAe,{isOpen:t,onClose:()=>{i(),e(!1)}})]})},RAe=()=>s.jsx(sQ,{children:s.jsx(Qne,{children:s.jsxs(iQ,{children:[s.jsx(UK,{children:s.jsxs(DK,{children:[s.jsx(Wr,{path:"/auth",element:s.jsx(vEe,{})}),s.jsx(Wr,{path:"/oferta",element:s.jsx(jEe,{})}),s.jsx(Wr,{path:"/analise-credito",element:s.jsx(AEe,{})}),s.jsxs(Wr,{element:s.jsx(FEe,{children:s.jsx(OAe,{children:s.jsx(MAe,{})})}),children:[s.jsx(Wr,{path:"/",element:s.jsx(IAe,{})}),s.jsx(Wr,{path:"/dashboard",element:s.jsx(Ys,{roles:["admin","master"],children:s.jsx(ibe,{})})}),s.jsx(Wr,{path:"/pipeline",element:s.jsx(Ys,{roles:["admin","master"],children:s.jsx(mEe,{})})}),s.jsx(Wr,{path:"/leads-campanha",element:s.jsx(REe,{})}),s.jsx(Wr,{path:"/collaborators",element:s.jsx(Ys,{roles:["admin","master"],children:s.jsx(IEe,{})})}),s.jsx(Wr,{path:"/panel-users",element:s.jsx(Ys,{roles:["admin","master"],children:s.jsx(LEe,{})})}),s.jsx(Wr,{path:"/chat",element:s.jsx(Ys,{roles:["admin","master"],children:s.jsx(v_e,{})})}),s.jsx(Wr,{path:"/contacts",element:s.jsx(Ys,{roles:["admin","master"],children:s.jsx(x_e,{})})}),s.jsx(Wr,{path:"/scheduling",element:s.jsx(Ys,{roles:["admin","master","coordinator"],children:s.jsx(Kje,{})})}),s.jsx(Wr,{path:"/team",element:s.jsx(Ys,{roles:["admin","master"],children:s.jsx(Gje,{})})}),s.jsx(Wr,{path:"/settings",element:s.jsx(Ys,{roles:["admin"],children:s.jsx(Dje,{})})})]}),s.jsx(Wr,{path:"*",element:s.jsx(Jv,{to:"/dashboard",replace:!0})})]})}),s.jsx(Zne,{position:"top-right",richColors:!0,theme:"dark"})]})})}),IAe=()=>{const{isCoordinator:t,loading:e}=zl();return e?null:s.jsx(Jv,{to:t?"/leads-campanha":"/dashboard",replace:!0})},FW=document.getElementById("root");if(!FW)throw new Error("Could not find root element to mount to");const DAe=zG.createRoot(FW);DAe.render(s.jsx(U.StrictMode,{children:s.jsx(RAe,{})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.